/* CELEB UNNI Design System — tokens & base components */
:root {
  --ivory: #F7F5F0;
  --cream: #EDE8DF;
  --cream-2: #E4DDD1;
  --charcoal: #292929;
  --gray: #77736E;
  --gray-2: #A8A39C;
  --line: #DCD5C9;
  --brown: #725B4B;
  --black: #242424;
  --gold: #B69B72;
  --white: #FFFFFF;
  --danger: #A0443A;
  --success: #4F6B4A;
  --warn: #9A6B1F;

  --font-logo: 'Cormorant Garamond', 'Didot', 'Bodoni 72', 'Times New Roman', serif;
  --font-serif: 'Noto Serif KR', 'Nanum Myeongjo', 'Cormorant Garamond', serif;
  --font-sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --font-num: 'Pretendard Variable', Pretendard, 'Helvetica Neue', Arial, sans-serif;

  --radius: 2px;
  --radius-lg: 6px;
  --shadow: 0 10px 30px rgba(41, 41, 41, 0.08);
  --max: 1320px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--ivory); color: var(--charcoal); font-family: var(--font-sans); font-size: 15px; line-height: 1.65; letter-spacing: -0.01em; -webkit-font-smoothing: antialiased; word-break: keep-all; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 500; letter-spacing: -0.02em; line-height: 1.3; margin: 0; }
.en { font-family: var(--font-logo); letter-spacing: 0.12em; font-weight: 500; }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.muted { color: var(--gray); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.center { text-align: center; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; border: 1px solid var(--black); background: var(--black); color: var(--ivory); border-radius: var(--radius); font-size: 14px; letter-spacing: 0.04em; transition: background .2s var(--ease), color .2s var(--ease), opacity .2s; white-space: nowrap; }
.btn:hover { background: #000; }
.btn.outline { background: transparent; color: var(--black); }
.btn.outline:hover { background: var(--black); color: var(--ivory); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--charcoal); }
.btn.gold { background: var(--brown); border-color: var(--brown); }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn.xs { min-height: 30px; padding: 0 10px; font-size: 12px; }
.btn.block { width: 100%; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.link { text-decoration: underline; text-underline-offset: 3px; color: var(--brown); background: none; border: 0; padding: 0; }

/* Forms */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > label, .label { font-size: 13px; color: var(--gray); }
.input, .select, .textarea { width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); background: var(--white); border-radius: var(--radius); outline: none; transition: border-color .2s; }
.textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--charcoal); }
.input.sm, .select.sm { min-height: 36px; padding: 6px 10px; font-size: 13px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--black); margin-top: 3px; flex: none; }
.row { display: flex; gap: 10px; align-items: center; }
.row.fw { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Chips & badges */
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px; border: 1px solid var(--line); background: transparent; border-radius: 999px; font-size: 13px; color: var(--charcoal); }
.chip.on, .chip[aria-pressed="true"] { background: var(--charcoal); color: var(--ivory); border-color: var(--charcoal); }
.chip:disabled { opacity: .35; text-decoration: line-through; cursor: not-allowed; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; font-size: 11px; letter-spacing: .06em; border-radius: 2px; background: var(--cream); color: var(--brown); font-weight: 600; white-space: nowrap; }
.badge.dark { background: var(--charcoal); color: var(--ivory); }
.badge.gold { background: var(--gold); color: var(--white); }
.badge.line { background: transparent; border: 1px solid var(--line); color: var(--gray); }
.badge.test { background: #FFF3D6; color: var(--warn); }
.badge.ok { background: #E3ECDF; color: var(--success); }
.badge.err { background: #F6E1DE; color: var(--danger); }
.ai-tag { position: absolute; left: 10px; bottom: 10px; z-index: 2; background: rgba(41, 41, 41, .72); color: #fff; font-size: 10.5px; letter-spacing: .04em; padding: 3px 8px; border-radius: 2px; backdrop-filter: blur(4px); }

/* Card / panel */
.panel { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.notice { border: 1px solid var(--line); background: var(--cream); padding: 14px 16px; font-size: 13.5px; border-radius: var(--radius); color: var(--charcoal); }
.notice.warn { background: #FFF6E2; border-color: #EBD9AE; }
.notice.err { background: #F8E8E5; border-color: #E9C3BD; color: var(--danger); }
.notice.ok { background: #EAF0E6; border-color: #C9D7C2; }
.divider { height: 1px; background: var(--line); margin: 20px 0; border: 0; }

/* Table */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-weight: 500; color: var(--gray); font-size: 12.5px; letter-spacing: .02em; background: transparent; }
.table td.r, .table th.r { text-align: right; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Toast / modal */
.toast-wrap { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 1000; display: grid; gap: 8px; width: min(92vw, 420px); }
.toast { background: var(--charcoal); color: var(--ivory); padding: 13px 18px; border-radius: var(--radius); font-size: 14px; box-shadow: var(--shadow); animation: toastIn .25s var(--ease); }
.toast.err { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
.modal-bg { position: fixed; inset: 0; background: rgba(36, 36, 36, .45); z-index: 900; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .2s; }
.modal { background: var(--ivory); width: min(640px, 100%); max-height: 90vh; overflow: auto; border-radius: var(--radius-lg); padding: 28px; position: relative; box-shadow: var(--shadow); }
.modal.wide { width: min(1080px, 100%); }
.modal-x { position: absolute; right: 14px; top: 10px; background: none; border: 0; font-size: 26px; line-height: 1; color: var(--gray); }
@keyframes fade { from { opacity: 0; } }
.spinner { width: 22px; height: 22px; border: 2px solid var(--cream-2); border-top-color: var(--brown); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--cream) 25%, var(--cream-2) 50%, var(--cream) 75%); background-size: 200% 100%; animation: sk 1.4s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.empty { padding: 60px 20px; text-align: center; color: var(--gray); }
