/* VirtualCompany — 디자인 토큰 & 공용 컴포넌트 */
:root {
  /* --font / --font-display / --mono 는 fonts.css 에서 정의 (Pretendard Variable · Sora · JetBrains Mono) */

  --bg: #060914;
  --bg-2: #0a1022;
  --bg-3: #0f1730;
  --glass: rgba(13, 19, 40, 0.62);
  --glass-2: rgba(18, 26, 52, 0.66);
  --glass-strong: rgba(10, 15, 32, 0.86);
  --glass-hi: rgba(255, 255, 255, 0.045);
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --surface-3: rgba(255, 255, 255, 0.09);
  --line: rgba(150, 175, 255, 0.12);
  --line-2: rgba(150, 175, 255, 0.2);
  --line-3: rgba(150, 175, 255, 0.32);

  --text: #eaf0ff;
  --text-2: #b4bfdf;
  --text-3: #8d99bf;
  --text-4: #6b779f;

  --primary: #6d8bff;
  --primary-2: #8aa2ff;
  --cyan: #22d3ee;
  --violet: #a78bfa;
  --magenta: #e879f9;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #fb7185;
  --gold: #f6c453;
  --gold-2: #ffdf8a;

  --grad: linear-gradient(135deg, #22d3ee 0%, #6d8bff 48%, #a78bfa 100%);
  --grad-soft: linear-gradient(135deg, rgba(34, 211, 238, .18), rgba(109, 139, 255, .16) 50%, rgba(167, 139, 250, .18));
  --grad-gold: linear-gradient(135deg, #ffe29a, #f6c453 50%, #e8a33d);

  --r-xs: 6px;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 26px;

  --shadow: 0 10px 40px -10px rgba(0, 0, 0, .6), 0 2px 8px rgba(0, 0, 0, .25);
  --shadow-lg: 0 30px 80px -20px rgba(0, 0, 0, .75), 0 8px 24px rgba(0, 0, 0, .35);
  --glow: 0 0 0 1px rgba(109, 139, 255, .35), 0 8px 30px -6px rgba(109, 139, 255, .55);
  --blur: blur(22px) saturate(150%);

  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  --nav-w: 78px;
  --top-h: 62px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 450;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.011em;
  overflow: hidden;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: var(--primary-2); text-decoration: none; }
a:hover { color: #fff; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
/* 고정폭 요소도 앱 글꼴 스택(fonts.css)으로 — UA 기본 monospace 로 떨어지지 않게 */
code, kbd, samp, pre { font-family: var(--mono); }
/* Pretendard·Sora 에는 이탤릭 면이 없다(font-synthesis:none → 기울임 없이 그대로 보임) → 강조는 굵기로 */
em, cite, dfn, var { font-style: normal; }
em { font-weight: 650; }
:is(h1, h2, h3, h4, h5, b, strong, th) em { font-weight: inherit; }
/* 최소 글자 12px (작은 글씨 small 은 부모의 85% 이되 12px 아래로 내려가지 않음) */
small { font-size: max(12px, .85em); }
button { cursor: pointer; }
img, svg { display: inline-block; vertical-align: middle; }
.ic { flex: none; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 750; letter-spacing: -0.025em; line-height: 1.3; }
.num, .display { font-family: var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.eyebrow { font-family: var(--font-display); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
p { margin: 0; }
::selection { background: rgba(109, 139, 255, .45); color: #fff; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }

/* 스크롤바 */
* { scrollbar-width: thin; scrollbar-color: rgba(150, 175, 255, .22) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(150, 175, 255, .18); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(150, 175, 255, .32); }
::-webkit-scrollbar-track { background: transparent; }

/* 유틸 */
.grow { flex: 1 1 auto; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 10px; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.muted { color: var(--text-3); }
.dim { color: var(--text-2); }
.small { font-size: 12.5px; }
.tiny { font-size: 12px; }
.bold { font-weight: 700; }
.mono { font-family: var(--mono); }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
/* 인라인 요소는 overflow 가 먹지 않아 말줄임 없이 옆 요소 밑으로 삐져나감 → 인라인 블록으로 (플렉스/그리드 항목이면 영향 없음) */
:is(span, small, b, strong, a, em, time, code).ellipsis { display: inline-block; max-width: 100%; vertical-align: bottom; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hidden { display: none !important; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gold-text { background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* 글래스 */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .05);
}

/* ── 버튼 ─────────────────────────────────────────────── */
.btn {
  --bh: 38px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: var(--bh); padding: 0 15px; border-radius: 11px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text); font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .25s, opacity .2s;
  user-select: none; text-decoration: none; position: relative;
}
.btn:hover { background: var(--surface-3); border-color: var(--line-3); color: #fff; }
.btn:active { transform: translateY(1px) scale(.985); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary {
  border: 0; color: #fff;
  background: linear-gradient(135deg, #3fb8f5 0%, #6d8bff 50%, #9a7bff 100%);
  box-shadow: 0 6px 22px -6px rgba(109, 139, 255, .7), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-primary:hover { background: linear-gradient(135deg, #56c6fb 0%, #7f9aff 50%, #ab90ff 100%); box-shadow: 0 10px 30px -6px rgba(109, 139, 255, .85), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn-gold { border: 0; color: #2a1d00; background: var(--grad-gold); box-shadow: 0 6px 22px -6px rgba(246, 196, 83, .65), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn-gold:hover { color: #1a1200; filter: brightness(1.06); }
.btn-success { border: 0; color: #032417; background: linear-gradient(135deg, #5ef0b8, #22c58b); box-shadow: 0 6px 20px -6px rgba(52, 211, 153, .6); }
.btn-danger { border: 1px solid rgba(251, 113, 133, .45); background: rgba(251, 113, 133, .14); color: #ffc2cc; }
.btn-danger:hover { background: rgba(251, 113, 133, .26); color: #fff; border-color: rgba(251, 113, 133, .7); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn-outline { background: transparent; }
.btn-sm { --bh: 31px; padding: 0 11px; font-size: 13px; border-radius: 9px; gap: 5px; }
.btn-xs { --bh: 26px; padding: 0 9px; font-size: 12px; border-radius: 8px; gap: 4px; }
.btn-lg { --bh: 48px; padding: 0 22px; font-size: 15.5px; border-radius: 14px; }
.btn-xl { --bh: 58px; padding: 0 30px; font-size: 17px; border-radius: 16px; gap: 10px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--text-2);
  transition: background .2s, color .2s, border-color .2s, transform .15s;
  position: relative; flex: none;
}
.icon-btn:hover { background: var(--surface-2); color: #fff; border-color: var(--line); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.danger:hover { color: var(--danger); background: rgba(251, 113, 133, .12); }

/* 스피너 */
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .18); border-top-color: var(--cyan); animation: spin .8s linear infinite; display: inline-block; flex: none; vertical-align: middle; }
.spinner.sm { width: 14px; height: 14px; border-width: 2px; }
.spinner.lg { width: 34px; height: 34px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 폼 ───────────────────────────────────────────────── */
.input, .select, .textarea, select.input, textarea.input {
  width: 100%; min-height: 40px; padding: 9px 13px;
  background: rgba(5, 9, 22, .55); border: 1px solid var(--line-2); border-radius: 11px;
  color: var(--text); outline: none; transition: border-color .2s, box-shadow .2s, background .2s;
}
input.input { text-overflow: ellipsis; }   /* 좁은 칸에서 긴 자리표시자·값은 말줄임(글자가 반쯤 잘려 보이지 않게) */
textarea.input { resize: vertical; min-height: 84px; line-height: 1.6; }
select.input { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239aa6cc' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
select.input option { background: #101833; color: var(--text); }
.input::placeholder { color: var(--text-4); }
.input:hover { border-color: var(--line-3); }
.input:focus { border-color: rgba(109, 139, 255, .75); box-shadow: 0 0 0 4px rgba(109, 139, 255, .16); background: rgba(5, 9, 22, .75); }
.input.sm { min-height: 33px; padding: 5px 11px; font-size: 13px; border-radius: 9px; }
.input[readonly] { opacity: .75; }
input[type=color].swatch-input { width: 40px; height: 40px; padding: 3px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: 0; border-radius: 7px; }
input[type=range] { accent-color: var(--primary); width: 100%; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span, .field-label { font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.field .hint, .hint { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.field .req::after { content: ' *'; color: var(--danger); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.input-group { display: flex; gap: 8px; align-items: stretch; }
.input-group .input { flex: 1; }
.input-icon { position: relative; }
.input-icon .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 38px; }

/* 스위치 */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 44px; height: 25px; border-radius: 20px; background: rgba(255, 255, 255, .12); border: 1px solid var(--line-2); position: relative; transition: background .25s, border-color .25s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: #cfd8f7; transition: transform .3s var(--ease-spring), background .25s; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.switch input:checked + .track { background: linear-gradient(135deg, #22d3ee, #6d8bff); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(19px); background: #fff; }
.switch input:focus-visible + .track { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* 토글 칩 */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-toggle { position: relative; display: inline-flex; }
.chip-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.chip-toggle > span {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .2s var(--ease); user-select: none; white-space: nowrap;
}
.chip-toggle > span:hover { border-color: var(--line-3); color: var(--text); background: var(--surface-2); }
.chip-toggle input:checked + span { color: #fff; border-color: rgba(109, 139, 255, .7); background: linear-gradient(135deg, rgba(34, 211, 238, .25), rgba(109, 139, 255, .3)); box-shadow: 0 0 0 1px rgba(109, 139, 255, .25), 0 4px 14px -4px rgba(109, 139, 255, .6); }
.chip-toggle input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 2px; }
.chip-toggle.sm > span { height: 27px; padding: 0 10px; font-size: 12px; }

/* 세그먼트 */
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(5, 9, 22, .5); border: 1px solid var(--line); gap: 2px; flex-wrap: wrap; }
.seg button, .seg label > span { border: 0; background: transparent; color: var(--text-3); height: 32px; padding: 0 14px; border-radius: 9px; font-weight: 600; font-size: 13.5px; transition: all .2s; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.seg label { position: relative; }
.seg label input { position: absolute; opacity: 0; pointer-events: none; }
.seg button:hover, .seg label > span:hover { color: var(--text); }
.seg button.active, .seg label input:checked + span { background: var(--surface-3); color: #fff; box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 4px 12px rgba(0, 0, 0, .3); }
.seg .count { font-size: 12px; padding: 0 6px; border-radius: 10px; background: rgba(255, 255, 255, .08); color: var(--text-2); }

/* 탭 */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; flex-shrink: 0; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: transparent; color: var(--text-3); padding: 10px 14px; font-weight: 600; position: relative; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; flex: none; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: #fff; }
.tabs button.active::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--grad); box-shadow: 0 0 12px rgba(109, 139, 255, .8); }
[data-pane] { display: none; }
[data-pane].active { display: block; animation: fadeUp .3s var(--ease); }

/* ── 카드 ─────────────────────────────────────────────── */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .02));
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px;
  position: relative; transition: border-color .25s, transform .25s var(--ease), box-shadow .25s, background .25s;
}
.card.hover:hover, a.card:hover { border-color: var(--line-3); transform: translateY(-2px); box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .7), 0 0 0 1px rgba(109, 139, 255, .08); }
.card.clickable { cursor: pointer; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h3, .card-head h4 { font-size: 15.5px; display: flex; align-items: center; gap: 8px; }
.card-head .sub { font-size: 12.5px; color: var(--text-3); font-weight: 500; }
.card.pad-0 { padding: 0; }
.card.tight { padding: 14px; }
.section-title { font-size: 13px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; margin: 22px 0 10px; display: flex; align-items: center; gap: 8px; }

/* 그리드 */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-auto-sm { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* ── 필/배지 ──────────────────────────────────────────── */
.pill {
  --pc: 148, 163, 200;
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; white-space: nowrap; letter-spacing: 0;
  color: rgb(var(--pc)); background: rgba(var(--pc), .12); border: 1px solid rgba(var(--pc), .28);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pill-sm { height: 21px; padding: 0 8px; font-size: 12px; }
.pill-neutral { --pc: 160, 174, 214; }
.pill-muted { --pc: 110, 122, 158; }
.pill-info { --pc: 125, 211, 252; }
.pill-active { --pc: 110, 168, 255; }
.pill-active .dot { box-shadow: 0 0 0 0 rgba(110, 168, 255, .7); animation: pulse 1.6s infinite; }
.pill-success { --pc: 74, 222, 160; }
.pill-warning { --pc: 251, 191, 36; }
.pill-danger { --pc: 251, 113, 133; }
.pill-gold { --pc: 246, 196, 83; }
.pill-violet { --pc: 196, 160, 255; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(110, 168, 255, .7); } 70% { box-shadow: 0 0 0 7px rgba(110, 168, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(110, 168, 255, 0); } }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 7px; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.badge-gold { background: linear-gradient(135deg, rgba(246, 196, 83, .22), rgba(232, 163, 61, .14)); color: var(--gold-2); border-color: rgba(246, 196, 83, .4); }
.badge-promo { background: linear-gradient(135deg, rgba(52, 211, 153, .22), rgba(34, 211, 238, .16)); color: #7ff3c8; border-color: rgba(52, 211, 153, .45); animation: promoGlow 2.2s ease-in-out infinite; }
@keyframes promoGlow { 50% { box-shadow: 0 0 14px rgba(52, 211, 153, .45); } }

/* 직급 */
.rank { display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 800; white-space: nowrap; color: #dfe6ff; background: rgba(148, 163, 200, .16); border: 1px solid rgba(148, 163, 200, .26); }
.rank-0 { color: #b9c2dd; background: rgba(148, 163, 184, .14); }
.rank-1 { color: #a5d8ff; background: rgba(96, 165, 250, .16); border-color: rgba(96, 165, 250, .3); }
.rank-2 { color: #99f6e4; background: rgba(45, 212, 191, .15); border-color: rgba(45, 212, 191, .3); }
.rank-3 { color: #86efac; background: rgba(74, 222, 128, .15); border-color: rgba(74, 222, 128, .3); }
.rank-4 { color: #c4b5fd; background: rgba(139, 92, 246, .18); border-color: rgba(139, 92, 246, .35); }
.rank-5 { color: #f0abfc; background: rgba(217, 70, 239, .16); border-color: rgba(217, 70, 239, .32); }
.rank-6 { color: #fda4af; background: rgba(244, 63, 94, .16); border-color: rgba(244, 63, 94, .32); }
.rank-7, .rank-8, .rank-9 { color: #2a1d00; background: var(--grad-gold); border-color: transparent; box-shadow: 0 0 12px rgba(246, 196, 83, .35); }

/* 파일 포맷 */
.fmt { --c: #94a3b8; flex: none; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 21px; padding: 0 6px; border-radius: 6px; font-size: 12px; font-weight: 800; letter-spacing: .03em; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.file-chip { --c: #94a3b8; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 4px 0 6px; border-radius: 11px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line-2); max-width: 100%; transition: border-color .2s, background .2s; }
.file-chip:hover { border-color: color-mix(in srgb, var(--c) 60%, transparent); background: color-mix(in srgb, var(--c) 8%, transparent); }
.file-chip .fc-fmt { font-size: 12px; font-weight: 800; color: var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); border-radius: 6px; padding: 3px 6px; letter-spacing: .03em; }
.file-chip .fc-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.file-chip .fc-size { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.file-chip .fc-btn { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: 0; background: transparent; color: var(--text-2); }
.file-chip .fc-btn:hover { background: var(--surface-3); color: #fff; }
.files { display: flex; flex-wrap: wrap; gap: 8px; }

/* 진행 바 */
.progress { position: relative; height: 8px; border-radius: 10px; background: rgba(255, 255, 255, .07); overflow: hidden; flex: 1 1 auto; min-width: 60px; }
.progress.thin { height: 5px; }
.progress > i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--grad); box-shadow: 0 0 12px rgba(56, 189, 248, .55); transition: width .6s var(--ease); }
.progress.success > i { background: linear-gradient(90deg, #22c58b, #5ef0b8); box-shadow: 0 0 10px rgba(52, 211, 153, .5); }
.progress.danger > i { background: linear-gradient(90deg, #e11d48, #fb7185); box-shadow: none; }
.progress.gold > i { background: var(--grad-gold); box-shadow: 0 0 10px rgba(246, 196, 83, .45); }
.progress.animated > i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent); transform: translateX(-100%); animation: shimmer 1.6s infinite; }
.progress > span { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 800; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* 별점 */
.stars { display: inline-flex; gap: 2px; align-items: center; }
.stars .star { color: rgba(255, 255, 255, .18); background: none; border: 0; padding: 1px; display: inline-grid; place-items: center; transition: transform .15s, color .15s; }
.stars .star.on { color: var(--gold); }
.stars .star.on svg { fill: var(--gold); filter: drop-shadow(0 0 6px rgba(246, 196, 83, .5)); }
.stars.interactive .star { cursor: pointer; }
.stars.interactive .star:hover { transform: scale(1.18); }

/* 아바타 */
.av {
  --s: 36px; --c1: #4f8cff; --c2: #22d3ee;
  position: relative; display: inline-grid; place-items: center; flex: none;
  width: var(--s); height: var(--s); border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--c2) 70%, #fff 10%), var(--c1) 70%);
  box-shadow: 0 0 0 2px rgba(10, 15, 32, .9), 0 0 0 3px color-mix(in srgb, var(--c1) 55%, transparent), 0 6px 16px -6px color-mix(in srgb, var(--c1) 80%, transparent);
}
.av-in { font-size: calc(var(--s) * .52); line-height: 1; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); }
.av-txt .av-in { font-size: calc(var(--s) * .42); font-weight: 800; color: #fff; }
.av-crown { position: absolute; top: calc(var(--s) * -.3); left: 50%; transform: translateX(-50%) rotate(-8deg); font-size: calc(var(--s) * .38); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); }
.av-st { position: absolute; right: -1px; bottom: -1px; width: calc(var(--s) * .3); height: calc(var(--s) * .3); min-width: 9px; min-height: 9px; border-radius: 50%; border: 2px solid #0b1124; background: #7c88ad; }
.st-idle { background: #8b97bd; } .st-thinking { background: #7dd3fc; } .st-working { background: #6ea8ff; box-shadow: 0 0 8px #6ea8ff; animation: blink 1.4s infinite; }
.st-reviewing { background: #a78bfa; } .st-reporting { background: #fbbf24; } .st-meeting { background: #22d3ee; }
.st-done { background: #34d399; } .st-error { background: #fb7185; } .st-away { background: #475070; }
@keyframes blink { 50% { opacity: .45; } }
.av-stack { display: inline-flex; }
.av-stack .av { margin-left: -8px; }
.av-stack .av:first-child { margin-left: 0; }
.team-dot { --c: #4f8cff; width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); display: inline-block; flex: none; }

/* 표 */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: rgba(255, 255, 255, .02); }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 12px; font-weight: 700; color: var(--text-3); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: rgba(255, 255, 255, .02); position: sticky; top: 0; }
.table td { padding: 11px 14px; border-bottom: 1px solid rgba(150, 175, 255, .07); vertical-align: middle; }
.table th, .table td, .md th, .md td { overflow-wrap: break-word; word-break: keep-all; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: rgba(109, 139, 255, .06); }
.table tr.clickable { cursor: pointer; }

/* 빈 상태 / 스켈레톤 */
.empty { text-align: center; padding: 46px 20px; color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty-ic { width: 66px; height: 66px; border-radius: 22px; display: grid; place-items: center; color: var(--primary-2); background: var(--grad-soft); border: 1px solid var(--line-2); margin-bottom: 6px; box-shadow: 0 10px 30px -10px rgba(109, 139, 255, .5); }
.empty h4 { color: var(--text); font-size: 16px; }
.empty p { max-width: 420px; font-size: 13.5px; }
.empty-act { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.skel { border-radius: var(--r); background: linear-gradient(90deg, rgba(255, 255, 255, .04) 25%, rgba(255, 255, 255, .09) 37%, rgba(255, 255, 255, .04) 63%); background-size: 400% 100%; animation: skel 1.4s ease infinite; }
.skel-card { height: 130px; }
.skel-row { height: 54px; margin-bottom: 8px; }
.skel-kpi { height: 96px; }
.skel-line { height: 14px; margin-bottom: 10px; border-radius: 6px; }
@keyframes skel { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ── 모달 ─────────────────────────────────────────────── */
.modal-wrap { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3, 6, 16, .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s; }
.modal {
  position: relative; width: 100%; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(22, 31, 62, .94), rgba(12, 18, 38, .96));
  border: 1px solid var(--line-2); border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, .07), 0 0 0 1px rgba(0, 0, 0, .3);
  opacity: 0; transform: translateY(18px) scale(.97); transition: opacity .25s var(--ease), transform .3s var(--ease);
}
.modal::before { content: ''; position: absolute; inset: -1px -1px auto; height: 1px; background: linear-gradient(90deg, transparent, rgba(34, 211, 238, .7), rgba(167, 139, 250, .7), transparent); border-radius: var(--r-xl) var(--r-xl) 0 0; }
.modal-wrap.in .modal-backdrop { opacity: 1; }
.modal-wrap.in .modal { opacity: 1; transform: none; }
.modal-wrap.out .modal-backdrop { opacity: 0; }
.modal-wrap.out .modal { opacity: 0; transform: translateY(10px) scale(.98); }
.modal-sm { max-width: 440px; } .modal-md { max-width: 600px; } .modal-lg { max-width: 820px; } .modal-xl { max-width: 1120px; }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 22px 14px; }
.modal-titles { flex: 1; min-width: 0; }
.modal-head h3 { font-size: 18px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.modal-head p { color: var(--text-3); font-size: 13px; margin-top: 4px; }
.modal-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--grad-soft); color: var(--primary-2); border: 1px solid var(--line-2); flex: none; }
.modal-danger .modal-ic { background: rgba(251, 113, 133, .14); color: var(--danger); border-color: rgba(251, 113, 133, .35); }
.modal-body { padding: 6px 22px 20px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 22px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.confirm-msg p { color: var(--text-2); }
.preview-modal .modal-body { padding: 0 16px 16px; }
.preview-frame { position: relative; height: 72vh; border-radius: 14px; overflow: hidden; background: #fff; border: 1px solid var(--line); }
.preview-frame iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.preview-loading { position: absolute; inset: 0; display: flex; gap: 10px; align-items: center; justify-content: center; color: #334; background: #f3f5fb; font-size: 14px; padding: 20px; text-align: center; }

/* 드로어 */
.drawer-wrap { position: fixed; inset: 0; z-index: 800; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(3, 6, 16, .45); opacity: 0; transition: opacity .25s; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(var(--w), 100vw); display: flex; flex-direction: column; background: linear-gradient(180deg, rgba(20, 28, 58, .95), rgba(10, 15, 32, .97)); border-left: 1px solid var(--line-2); box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .32s var(--ease); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.drawer-wrap.in .drawer { transform: none; }
.drawer-wrap.in .drawer-backdrop { opacity: 1; }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { flex: 1; font-size: 17px; display: flex; gap: 10px; align-items: center; min-width: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 30px; }

/* 팝 메뉴 */
.popmenu { position: fixed; z-index: 1000; min-width: 200px; padding: 6px; border-radius: 14px; animation: popIn .18s var(--ease); background: var(--glass-strong); }
.popmenu hr { margin: 5px 4px; }
.pm-item { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; border: 0; background: transparent; color: var(--text-2); text-align: left; font-weight: 600; font-size: 13.5px; }
.pm-item:hover { background: var(--surface-3); color: #fff; }
.pm-item.danger { color: #fda4af; }
.pm-item.danger:hover { background: rgba(251, 113, 133, .14); }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } }

/* 토스트 */
#toasts { position: fixed; top: calc(var(--top-h) + 14px); right: 18px; z-index: 1100; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 28px)); pointer-events: none; }
.toast {
  --tc: 109, 139, 255;
  pointer-events: auto; display: flex; align-items: flex-start; gap: 11px; padding: 13px 12px 13px 14px; border-radius: 15px;
  background: linear-gradient(180deg, rgba(24, 33, 66, .95), rgba(14, 20, 42, .96)); border: 1px solid rgba(var(--tc), .4);
  box-shadow: var(--shadow), 0 0 24px -8px rgba(var(--tc), .6); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  animation: toastIn .4s var(--ease-spring);
}
.toast.out { animation: toastOut .3s var(--ease) forwards; }
.toast-ic { color: rgb(var(--tc)); margin-top: 1px; }
.toast-body { flex: 1; font-size: 13.5px; color: var(--text); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.toast-body b { font-size: 14px; }
.toast-x { border: 0; background: transparent; color: var(--text-3); padding: 2px; border-radius: 6px; }
.toast-x:hover { color: #fff; }
.toast-act { border: 1px solid rgba(var(--tc), .5); background: rgba(var(--tc), .15); color: #fff; border-radius: 8px; padding: 4px 10px; font-size: 12.5px; font-weight: 700; align-self: center; white-space: nowrap; }
.toast-success { --tc: 52, 211, 153; } .toast-warning { --tc: 251, 191, 36; } .toast-error { --tc: 251, 113, 133; }
.toast-celebrate { --tc: 246, 196, 83; background: linear-gradient(135deg, rgba(60, 44, 10, .96), rgba(24, 22, 48, .96)); }
.toast-celebrate .toast-ic { animation: wiggle 1s ease-in-out 2; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }
@keyframes wiggle { 25% { transform: rotate(-14deg) scale(1.15); } 75% { transform: rotate(14deg) scale(1.15); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }
@keyframes fadeIn { from { opacity: 0; } }

/* 마크다운 */
.md { font-size: 14.5px; line-height: 1.8; color: #dce3fb; }
.md > *:first-child { margin-top: 0; }
.md h1, .md h2, .md h3, .md h4 { color: #fff; margin: 1.6em 0 .6em; line-height: 1.35; }
.md h1 { font-size: 1.7em; padding-bottom: .4em; border-bottom: 1px solid var(--line-2); }
.md h2 { font-size: 1.35em; padding-left: 12px; border-left: 3px solid; border-image: var(--grad) 1; }
.md h3 { font-size: 1.12em; color: #cfe0ff; }
.md p, .md ul, .md ol, .md blockquote, .md pre, .md .md-table { margin: 0 0 1em; }
.md ul, .md ol { padding-left: 1.4em; }
.md li { margin: .25em 0; }
.md li::marker { color: var(--cyan); }
.md strong { color: #fff; }
.md a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.md code { font-family: var(--mono); font-size: .88em; background: rgba(109, 139, 255, .14); padding: 2px 6px; border-radius: 6px; color: #c7d4ff; }
.md pre { background: rgba(3, 6, 16, .6); padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { border-left: 3px solid var(--violet); padding: 8px 16px; background: rgba(167, 139, 250, .08); border-radius: 0 10px 10px 0; color: var(--text-2); }
.md hr { border-top: 1px dashed var(--line-2); margin: 1.6em 0; }
.md-table { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line-2); }
.md table { border-collapse: collapse; width: 100%; font-size: .93em; }
.md th { background: linear-gradient(180deg, rgba(109, 139, 255, .2), rgba(109, 139, 255, .1)); color: #fff; font-weight: 700; text-align: left; }
.md th, .md td { padding: 9px 13px; border-bottom: 1px solid var(--line); border-right: 1px solid rgba(150, 175, 255, .07); }
.md tr:nth-child(even) td { background: rgba(255, 255, 255, .02); }
.md img { max-width: 100%; border-radius: 10px; }

/* 키보드 */
kbd { font-family: var(--mono); font-size: 12px; padding: 2px 6px; border-radius: 6px; background: rgba(255, 255, 255, .08); border: 1px solid var(--line-2); border-bottom-width: 2px; color: var(--text-2); }

.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: 14px; background: rgba(109, 139, 255, .08); border: 1px solid rgba(109, 139, 255, .25); color: var(--text-2); font-size: 13.5px; line-height: 1.65; }
.callout .ic { color: var(--primary-2); margin-top: 2px; }
.callout.warn { background: rgba(251, 191, 36, .08); border-color: rgba(251, 191, 36, .3); }
.callout.warn .ic { color: var(--warning); }
.callout.ok { background: rgba(52, 211, 153, .08); border-color: rgba(52, 211, 153, .3); }
.callout.ok .ic { color: var(--success); }
.callout.err { background: rgba(251, 113, 133, .08); border-color: rgba(251, 113, 133, .3); }
.callout.err .ic { color: var(--danger); }
.callout b { color: var(--text); }
.callout ol, .callout ul { margin: 6px 0 0; padding-left: 20px; }
.callout code { font-family: var(--mono); font-size: 12px; background: rgba(255, 255, 255, .08); padding: 1px 6px; border-radius: 5px; color: #dbe4ff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
