/* ============================================================
   Hancom AX — Design Tokens
   Brand: Hancom Innostream (Black + Orange accent)
   ============================================================ */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.min.css');

/* ---------- Tokens (Light is default) ---------- */
:root {
  --font-sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
               'Apple SD Gothic Neo', 'Segoe UI', 'Noto Sans KR', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-display: 'Pretendard Variable', Pretendard, sans-serif;

  /* Brand */
  --brand-orange: #F0561D;
  --brand-orange-600: #D9491A;
  --brand-orange-100: #FFE6DC;
  --brand-black: #0A0A0B;

  /* Accent (driven by Tweaks; default = Hancom orange) */
  --accent: #F0561D;
  --accent-hover: #D9491A;
  --accent-soft: rgba(240, 86, 29, 0.10);
  --accent-fg: #FFFFFF;

  /* Light theme */
  --bg: #FAFAFA;
  --canvas: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F4F4F5;
  --surface-3: #ECECEE;
  --border: #E4E4E7;
  --border-strong: #D4D4D8;
  --border-subtle: #EFEFF1;
  --text: #0A0A0B;
  --text-2: #3F3F46;
  --text-3: #71717A;
  --text-4: #A1A1AA;
  --invert: #FFFFFF;
  --shadow-sm: 0 1px 2px rgba(10,10,11,0.04), 0 1px 1px rgba(10,10,11,0.03);
  --shadow-md: 0 4px 12px rgba(10,10,11,0.06), 0 1px 2px rgba(10,10,11,0.04);
  --shadow-lg: 0 12px 40px rgba(10,10,11,0.10), 0 2px 6px rgba(10,10,11,0.05);

  /* Semantic */
  --success: #16A34A;
  --success-bg: #ECFDF5;
  --warning: #D97706;
  --warning-bg: #FEF3C7;
  --danger: #DC2626;
  --danger-bg: #FEE2E2;
  --info: #2563EB;
  --info-bg: #EFF6FF;

  /* Sizing */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

/* Dark theme */
[data-theme="dark"] {
  --bg: #0A0A0B;
  --canvas: #0E0E10;
  --surface: #18181B;
  --surface-2: #1F1F23;
  --surface-3: #27272A;
  --border: #27272A;
  --border-strong: #3F3F46;
  --border-subtle: #1F1F23;
  --text: #FAFAFA;
  --text-2: #D4D4D8;
  --text-3: #A1A1AA;
  --text-4: #71717A;
  --invert: #0A0A0B;
  --accent-soft: rgba(240, 86, 29, 0.18);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
  --success-bg: rgba(22, 163, 74, 0.12);
  --warning-bg: rgba(217, 119, 6, 0.14);
  --danger-bg: rgba(220, 38, 38, 0.14);
  --info-bg: rgba(37, 99, 235, 0.14);
}

/* ---------- Base ---------- */
.hax {
  font-family: var(--font-sans);
  font-feature-settings: 'ss01', 'ss02', 'tnum';
  color: var(--text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.005em;
}
.hax *, .hax *::before, .hax *::after { box-sizing: border-box; }
.hax button { font-family: inherit; cursor: pointer; }
.hax input, .hax textarea, .hax select { font-family: inherit; color: inherit; }
.hax ::selection { background: var(--accent); color: #fff; }

/* Mono numerals */
.hax .tnum { font-variant-numeric: tabular-nums; }

/* ─────────────────────────────────────────────────────────────
   CONSISTENCY GUARDS — prevent unwanted text wrapping & shrinking
   These fixes ensure labels/badges/buttons keep their full width
   across every screen and density (default + SI).
   ───────────────────────────────────────────────────────────── */

/* Inline atoms must never wrap their text or be squeezed flat */
.hax .badge,
.hax .btn,
.hax .seg button,
.hax .nav-item,
.hax .gnb-item,
.hax .sub-tab,
.hax .crumb,
.hax .eyebrow,
.hax .label,
.hax .stat-label,
.hax .stat-delta,
.hax .kbd {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Table headers + numeric cells never wrap */
.hax .tbl th { white-space: nowrap; }
.hax .tbl td.tnum, .hax .tbl td .tnum { white-space: nowrap; }

/* Headings inside flex rows shouldn't be cropped by sibling actions */
.hax .row > .col,
.hax .row > .grow {
  min-width: 0;
}
.hax .row .h-1,
.hax .row .h-2,
.hax .row .h-3,
.hax .row .h-4 {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Page chrome (GNB / sub-tabs / breadcrumb / page header) must not shrink */
.hax .gnb,
.hax .sub-tabs,
.hax .crumb,
.hax .page-header-si,
.hax .page-header {
  flex-shrink: 0;
}

/* Action group (buttons cluster on the right of headers / toolbars) */
.hax .actions {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ---------- Typography ---------- */
.hax .h-display {
  font-size: 40px; line-height: 1.1; font-weight: 700;
  letter-spacing: -0.02em;
}
.hax .h-1 { font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -0.018em; }
.hax .h-2 { font-size: 22px; line-height: 1.25; font-weight: 700; letter-spacing: -0.015em; }
.hax .h-3 { font-size: 18px; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; }
.hax .h-4 { font-size: 15px; line-height: 1.35; font-weight: 600; }
.hax .t-lg { font-size: 15px; line-height: 1.5; }
.hax .t-md { font-size: 13.5px; line-height: 1.5; }
.hax .t-sm { font-size: 12.5px; line-height: 1.45; }
.hax .t-xs { font-size: 11.5px; line-height: 1.4; }
.hax .t-muted { color: var(--text-3); }
.hax .t-dim   { color: var(--text-2); }

/* Eyebrow / overline */
.hax .eyebrow {
  font-size: 11px; line-height: 1; font-weight: 600;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--text-3);
}

/* ---------- Layout helpers ---------- */
.hax .row { display: flex; align-items: center; gap: 8px; }
.hax .col { display: flex; flex-direction: column; }
.hax .grow { flex: 1 1 auto; min-width: 0; }
.hax .gap-2 { gap: 8px; } .hax .gap-3 { gap: 12px; }
.hax .gap-4 { gap: 16px; } .hax .gap-6 { gap: 24px; }
.hax .gap-8 { gap: 32px; }

/* ---------- Buttons ---------- */
.hax .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px;
  font-size: 13.5px; font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: var(--surface); color: var(--text);
  transition: background .15s, border-color .15s, color .15s, transform .05s;
  white-space: nowrap; user-select: none;
  letter-spacing: -0.005em;
}
.hax .btn:active { transform: translateY(0.5px); }
.hax .btn-primary { background: var(--accent); color: var(--accent-fg); }
.hax .btn-primary:hover { background: var(--accent-hover); }
.hax .btn-secondary {
  background: var(--surface); color: var(--text);
  border-color: var(--border-strong);
}
.hax .btn-secondary:hover { background: var(--surface-2); }
.hax .btn-ghost { background: transparent; color: var(--text-2); }
.hax .btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.hax .btn-danger { background: var(--surface); color: var(--danger); border-color: var(--border); }
.hax .btn-danger:hover { background: var(--danger-bg); }
.hax .btn-lg { height: 44px; padding: 0 20px; font-size: 14.5px; border-radius: var(--radius-md); }
.hax .btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.hax .btn-icon { padding: 0; width: 32px; height: 32px; }
.hax .btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Cards / Surfaces ---------- */
.hax .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  box-shadow: var(--shadow-sm);
}
.hax .card-flat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
}
.hax .card-section + .card-section { border-top: 1px solid var(--border-subtle); }

/* ---------- Inputs ---------- */
.hax .input {
  height: 38px; padding: 0 12px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  font-size: 13.5px; outline: none;
  transition: border-color .12s, box-shadow .12s;
  width: 100%;
}
.hax .input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.hax .input::placeholder { color: var(--text-4); }
.hax textarea.input {
  height: auto; min-height: 80px; padding: 10px 12px; resize: vertical;
  line-height: 1.5;
}
.hax .label {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--text-2); margin-bottom: 6px;
  letter-spacing: -0.005em;
}

/* ---------- Badges ---------- */
.hax .badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px;
  font-size: 11.5px; font-weight: 600;
  border-radius: 999px;
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border);
}
.hax .badge-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.hax .badge-success { background: var(--success-bg); color: var(--success); border-color: transparent; }
.hax .badge-warning { background: var(--warning-bg); color: var(--warning); border-color: transparent; }
.hax .badge-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: transparent; }
.hax .badge-info    { background: var(--info-bg);    color: var(--info);    border-color: transparent; }
.hax .badge-dot::before {
  content: ''; width: 6px; height: 6px; border-radius: 999px;
  background: currentColor; opacity: 0.9;
}

/* ---------- Tables ---------- */
.hax table.tbl {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 13px;
}
.hax .tbl th {
  text-align: left; font-weight: 600; font-size: 11.5px;
  color: var(--text-3); letter-spacing: 0.04em; text-transform: uppercase;
  padding: 10px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.hax .tbl th,
.hax .tbl td {
  text-align: left;
}
.hax .tbl td {
  padding: 14px; border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  color: var(--text);
  text-align: left;
}
.hax .tbl tr:last-child td { border-bottom: none; }
.hax .tbl tr.hover-row:hover td { background: var(--surface-2); }

/* ---------- Sidebar / Topbar ---------- */
.hax .sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.hax .nav-item {
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 10px;
  border-radius: var(--radius-md);
  color: var(--text-2); font-size: 13px; font-weight: 500;
  cursor: pointer; user-select: none;
  letter-spacing: -0.005em;
  transition: background .12s, color .12s;
}
.hax .nav-item:hover { background: var(--surface-2); color: var(--text); }
.hax .nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.hax .nav-item .icon { opacity: 0.85; flex: 0 0 auto; }

/* ---------- Progress ---------- */
.hax .progress {
  position: relative; height: 6px; background: var(--surface-2);
  border-radius: 999px; overflow: hidden;
}
.hax .progress > i {
  display: block; height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .35s cubic-bezier(.4,.0,.2,1);
}

/* ---------- Misc ---------- */
.hax .divider { height: 1px; background: var(--border); }
.hax .vdivider { width: 1px; background: var(--border); align-self: stretch; }
.hax .kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  font-size: 10.5px; font-weight: 600; font-family: var(--font-mono);
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border); border-radius: 4px;
  line-height: 1;
}

/* Logo H bar */
.hax .logo-mark {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 800; letter-spacing: -0.02em; font-size: 17px;
  color: var(--text);
}
.hax .logo-mark .hbar {
  width: 14px; height: 6px; background: var(--accent);
  display: inline-block;
}

/* Question card focus animation */
@keyframes haxFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hax .fade-in { animation: haxFadeIn .28s ease both; }

/* Choice option */
.hax .choice {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s;
  font-size: 14px;
  color: var(--text);
}
.hax .choice:hover { border-color: var(--text-3); background: var(--surface-2); }
.hax .choice.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.hax .choice .marker {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  flex: 0 0 auto; position: relative;
  background: var(--surface);
}
.hax .choice.selected .marker { border-color: var(--accent); }
.hax .choice.selected .marker::after {
  content: ''; position: absolute; inset: 3px;
  border-radius: 50%; background: var(--accent);
}
.hax .choice.checkbox .marker { border-radius: 4px; }
.hax .choice.checkbox.selected .marker {
  background: var(--accent); border-color: var(--accent);
}
.hax .choice.checkbox.selected .marker::after {
  content: ''; position: absolute; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' d='M3.5 8.5l3 3 6-7'/></svg>");
  background-size: 14px; background-repeat: no-repeat;
  background-position: center;
}

/* Likert scale */
.hax .likert {
  display: grid; grid-template-columns: repeat(var(--scale, 5), 1fr);
  gap: 8px;
}
.hax .likert .pt {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 8px; border-radius: var(--radius-md);
  border: 1px solid var(--border-strong); background: var(--surface);
  cursor: pointer; transition: background .12s, border-color .12s;
}
.hax .likert .pt:hover { border-color: var(--text-3); background: var(--surface-2); }
.hax .likert .pt.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.hax .likert .pt .num {
  font-size: 18px; font-weight: 700;
  color: var(--text);
}
.hax .likert .pt.selected .num { color: var(--accent); }
.hax .likert .pt .lbl {
  font-size: 11.5px; color: var(--text-3); text-align: center;
}

/* Stat tile */
.hax .stat {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  display: flex; flex-direction: column; gap: 6px;
}
.hax .stat .stat-label {
  font-size: 12px; color: var(--text-3); font-weight: 600;
  letter-spacing: -0.005em;
}
.hax .stat .stat-value {
  font-size: 28px; font-weight: 700; color: var(--text);
  letter-spacing: -0.02em; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.hax .stat .stat-delta {
  font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
}
.hax .stat .stat-delta.pos { color: var(--success); }
.hax .stat .stat-delta.neg { color: var(--danger); }

/* Avatar */
.hax .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  background: var(--surface-3); color: var(--text-2);
  flex: 0 0 auto;
}

/* Brand swatch ribbon (header decoration) */
.hax .ribbon {
  height: 3px; background: var(--accent);
  display: block;
}

/* Skill bar (small horizontal bar) */
.hax .skill-bar {
  height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden;
}
.hax .skill-bar > i {
  display: block; height: 100%; background: var(--accent); border-radius: 999px;
}

/* Toast inline */
.hax .toast {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  font-size: 12.5px; color: var(--text-2);
}

/* tab segmented */
.hax .seg {
  display: inline-flex; padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.hax .seg button {
  border: 0; background: transparent;
  height: 26px; padding: 0 12px; border-radius: 5px;
  font-size: 12.5px; font-weight: 600; color: var(--text-3);
}
.hax .seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ============================================================
   한국 SI / 엔터프라이즈 스타일 (관리자 화면용)
   - 사이드바 대신 상단 GNB
   - 정보 밀도 ↑, 모서리 ↓, 표 중심
   - 전통적인 한국 SI/그룹웨어 정서: 또렷한 헤더 라인, 차분한 톤
   ============================================================ */
.hax[data-admin-ui="si"] {
  --radius-xs: 2px;
  --radius-sm: 3px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --radius-xl: 8px;
  --bg: #F4F5F7;
  --canvas: #F4F5F7;
  --surface: #FFFFFF;
  --surface-2: #F7F8FA;
  --surface-3: #EEF0F3;
  --border: #DCDFE4;
  --border-strong: #C6CAD0;
  --border-subtle: #E8EAED;
}
.hax[data-admin-ui="si"] .si-only { display: initial; }
.hax:not([data-admin-ui="si"]) .si-only { display: none; }
.hax[data-admin-ui="si"] .si-hide { display: none !important; }

/* GNB (Global Nav Bar) — top horizontal nav */
.hax .gnb {
  display: flex; align-items: stretch;
  height: 48px;
  background: #1B1D22;
  color: #fff;
  padding: 0 24px;
  border-bottom: 2px solid var(--accent);
  white-space: nowrap;
  min-width: 0;
}
.hax .gnb-logo {
  display: flex; align-items: center; gap: 8px;
  padding-right: 28px;
  margin-right: 16px;
  border-right: 1px solid rgba(255,255,255,0.12);
  font-weight: 800; font-size: 14.5px; letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}
.hax .gnb-logo .hbar { width: 14px; height: 5px; background: var(--accent); display: inline-block; }
.hax .gnb-item {
  display: inline-flex; align-items: center; gap: 6px;
  height: 100%; padding: 0 16px;
  font-size: 13px; font-weight: 500;
  color: rgba(255,255,255,0.72);
  cursor: pointer;
  position: relative;
  letter-spacing: -0.005em;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  flex-shrink: 0;
}
.hax .gnb-item:hover { color: #fff; }
.hax .gnb-item.active {
  color: #fff;
  border-bottom-color: var(--accent);
  font-weight: 600;
}
.hax .gnb-item .badge-mini {
  background: var(--accent); color: #fff;
  height: 16px; min-width: 16px; padding: 0 4px;
  border-radius: 8px;
  font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
.hax .gnb-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.7);
}
.hax .gnb-right .gnb-icon-btn {
  width: 28px; height: 28px; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: rgba(255,255,255,0.8);
  background: transparent; border: 0;
}
.hax .gnb-right .gnb-icon-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.hax .gnb-user {
  display: flex; align-items: center; gap: 8px;
  padding-left: 12px; margin-left: 4px;
  border-left: 1px solid rgba(255,255,255,0.12);
  color: #fff; font-size: 12.5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.hax .gnb-user .name { font-weight: 600; white-space: nowrap; }
.hax .gnb-user .role { color: rgba(255,255,255,0.55); font-size: 11.5px; white-space: nowrap; }

/* Sub-tab strip under GNB */
.hax .sub-tabs {
  display: flex; align-items: stretch;
  height: 36px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  white-space: nowrap;
}
.hax .sub-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 14px;
  font-size: 12.5px; font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  position: relative;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  flex-shrink: 0;
}
.hax .sub-tab:hover { color: var(--text); }
.hax .sub-tab.active {
  color: var(--accent);
  font-weight: 700;
  border-bottom-color: var(--accent);
}
.hax .sub-tab + .sub-tab { border-left: 1px solid var(--border-subtle); }

/* Breadcrumb */
.hax .crumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--text-3);
  padding: 6px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}
.hax .crumb a { color: var(--text-3); text-decoration: none; }
.hax .crumb .sep { color: var(--text-4); font-size: 9px; }
.hax .crumb .leaf { color: var(--text); font-weight: 600; }

/* SI page chrome — tighter padding everywhere */
.hax[data-admin-ui="si"] .page-pad { padding: 18px 24px; }
.hax[data-admin-ui="si"] .page-header-si {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex; align-items: center; gap: 14px;
}
.hax[data-admin-ui="si"] .page-header-si .h1-si {
  font-size: 17px; font-weight: 700; letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 8px;
}
.hax[data-admin-ui="si"] .page-header-si .h1-si::before {
  content: ''; width: 3px; height: 14px; background: var(--accent); display: inline-block;
}
.hax[data-admin-ui="si"] .page-header-si .desc-si {
  font-size: 12px; color: var(--text-3);
}

/* SI table density */
.hax[data-admin-ui="si"] table.tbl { font-size: 12.5px; }
.hax[data-admin-ui="si"] .tbl th {
  padding: 8px 12px;
  font-size: 11px; letter-spacing: 0.02em;
  background: var(--surface-3);
  color: var(--text-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-transform: none;
  font-weight: 700;
}
.hax[data-admin-ui="si"] .tbl td {
  padding: 8px 12px;
  font-size: 12.5px;
}
.hax[data-admin-ui="si"] .card {
  border-radius: 2px;
  box-shadow: none;
}
.hax[data-admin-ui="si"] .stat {
  padding: 12px 16px;
  border-radius: 2px;
}
.hax[data-admin-ui="si"] .stat .stat-value { font-size: 22px; }
.hax[data-admin-ui="si"] .stat .stat-label { font-size: 11.5px; }
.hax[data-admin-ui="si"] .btn {
  height: 30px; padding: 0 10px; font-size: 12px; font-weight: 600;
  border-radius: var(--radius-sm);
}
.hax[data-admin-ui="si"] .btn-lg { height: 34px; padding: 0 14px; font-size: 12.5px; }
.hax[data-admin-ui="si"] .btn-sm { height: 24px; padding: 0 8px; font-size: 11.5px; }
.hax[data-admin-ui="si"] .input {
  height: 30px; font-size: 12.5px; border-radius: var(--radius-sm);
}
.hax[data-admin-ui="si"] .badge {
  height: 20px; padding: 0 6px; font-size: 11px;
  border-radius: 3px;
}
.hax[data-admin-ui="si"] .seg { border-radius: var(--radius-sm); }
.hax[data-admin-ui="si"] .seg button { height: 24px; padding: 0 10px; font-size: 11.5px; border-radius: 2px; }
.hax[data-admin-ui="si"] .h-1 { font-size: 18px; }
.hax[data-admin-ui="si"] .h-2 { font-size: 15px; }
.hax[data-admin-ui="si"] .h-3 { font-size: 14px; }
.hax[data-admin-ui="si"] .h-4 { font-size: 13px; }
.hax[data-admin-ui="si"] .eyebrow { font-size: 10.5px; letter-spacing: 0.06em; }

/* SI: striped rows for tables */
.hax[data-admin-ui="si"] .tbl tbody tr:nth-child(even) td { background: var(--surface-2); }
.hax[data-admin-ui="si"] .tbl tr.hover-row:hover td { background: #FFF6F0; }

/* SI: dotted axis around metric tiles */
.hax[data-admin-ui="si"] .metric-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.hax[data-admin-ui="si"] .metric-strip > .metric-cell {
  background: var(--surface);
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.hax[data-admin-ui="si"] .metric-strip .ml { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.hax[data-admin-ui="si"] .metric-strip .mv { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.hax[data-admin-ui="si"] .metric-strip .md { font-size: 11px; color: var(--text-3); }

/* KPI strip — single horizontal table-like row of metrics (works in both modes) */
.hax .kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.hax .kpi-strip > .kpi-cell {
  padding: 14px 20px;
  display: flex; flex-direction: column; gap: 6px;
  position: relative;
  border-right: 1px solid var(--border-subtle);
}
.hax .kpi-strip > .kpi-cell:last-child { border-right: none; }
.hax .kpi-strip .kpi-tone-bar {
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.hax .kpi-strip .kpi-label {
  font-size: 11.5px; color: var(--text-3); font-weight: 600;
  letter-spacing: -0.005em; white-space: nowrap;
}
.hax .kpi-strip .kpi-value {
  font-size: 24px; font-weight: 700; letter-spacing: -0.02em;
  line-height: 1.1; font-variant-numeric: tabular-nums;
}
.hax .kpi-strip .kpi-subtle {
  font-size: 11.5px; color: var(--text-3); white-space: nowrap;
}

/* ─────────────────────────────────────────────────────────────
   Resizable horizontal split — drag handle between 2 cards
   ───────────────────────────────────────────────────────────── */
.hax .resize-split {
  display: flex; align-items: stretch;
  min-width: 0; width: 100%;
}
.hax .resize-handle {
  flex: 0 0 8px;
  position: relative;
  cursor: col-resize;
  align-self: stretch;
  margin: 0 -1px;
  z-index: 5;
}
.hax .resize-handle::before {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 2px; height: 28px;
  border-radius: 2px;
  background: var(--border);
  transition: background .15s, height .15s;
}
.hax .resize-handle:hover::before,
.hax .resize-handle.dragging::before {
  background: var(--accent);
  height: 40px;
}

/* Resizable row — custom horizontal handle at the bottom (matches vertical handle look) */
.hax .resize-row {
  display: flex; flex-direction: column;
  overflow: hidden;
  min-height: 220px;
  position: relative;
  border-radius: 2px;
}
.hax .resize-row-body {
  flex: 1 1 auto; min-height: 0; overflow: hidden;
}
/* Make inner split + cards stretch to fill the row body height */
.hax .resize-row-body .resize-split,
.hax .resize-row-body .resize-split > div { height: 100%; min-height: 0; }
.hax .resize-row-body .resize-split > div > .card {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* Cards may scroll their own body if content overflows */
.hax .resize-row-body .resize-split > div > .card > * { flex: 0 0 auto; }
.hax .resize-row-body .resize-split > div > .card > .col,
.hax .resize-row-body .resize-split > div > .card > .scroll-body {
  flex: 1 1 auto;
  overflow: auto;
  min-height: 0;
}

/* Horizontal drag handle — symmetric to .resize-handle (vertical) */
.hax .resize-handle-h {
  position: relative;
  flex: 0 0 8px;
  cursor: row-resize;
  align-self: stretch;
  margin: -1px 0;
  z-index: 5;
}
.hax .resize-handle-h::before {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 28px; height: 2px;
  border-radius: 2px;
  background: var(--border);
  transition: background .15s, width .15s;
}
.hax .resize-handle-h:hover::before,
.hax .resize-handle-h.dragging::before {
  background: var(--accent);
  width: 40px;
}

/* ─────────────────────────────────────────────────────────────
   Page container — every screen's body is wrapped in this.
   - Provides a card-like surface with internal scroll
   - SI mode (no sidebar) → centered with max-width
   - Default mode (with sidebar) → fills remaining width
   ───────────────────────────────────────────────────────────── */
.hax .page-container {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
}
/* No sidebar (SI mode) — centered, capped width */
.hax .page-container[data-no-sidebar="true"] {
  max-width: 1400px;
  margin: 12px auto;
  width: calc(100% - 24px);
}
/* SI 모드 — 사이드바가 없을 때 내부 컨텐츠 가운데 정렬.
   단, 페이지 안에 내부 리스트 패널(좌측 사이드바 역할)이 있으면 적용 안 함.
   `display: block`(div) 컨텐츠 래퍼만 가운데로 모음.
   inline 요소(span 등 셀 내부 텍스트)에서 inline-style maxWidth 쓰는 경우는 제외. */
.hax .page-container[data-no-sidebar="true"]:not(:has([data-inner-sidebar="true"])) div[style*="max-width"] {
  margin-left: auto;
  margin-right: auto;
}
/* With sidebar — small inset on the right/bottom */
.hax .page-container[data-no-sidebar="false"] {
  margin: 12px;
  width: calc(100% - 24px);
}

/* ─────────────────────────────────────────────────────────────
   Borderless card style — Tweaks toggle
   페이지 컨테이너는 그대로 두고, 내부 카드/KPI/메트릭 테두리만 제거.
   테두리가 사라진 자리에는 추가 여백·구분선·배경 톤으로 경계 보완.
   ───────────────────────────────────────────────────────────── */
.hax[data-card-style="borderless"] .card,
.hax[data-card-style="borderless"] .card-flat,
.hax[data-card-style="borderless"] .stat {
  border: none;
  box-shadow: none;
  background: var(--surface-2);
}
/* 카드 사이 간격 확장 — column 안에서 card끼리는 16→22px 정도 */
.hax[data-card-style="borderless"] .col > .card + .card,
.hax[data-card-style="borderless"] .col > .card-flat + .card-flat {
  margin-top: 8px;
}
/* 카드 내부 헤더(eyebrow/h-3) 강조 — 테두리 대신 굵은 좌측 액센트 바 */
.hax[data-card-style="borderless"] .card > .eyebrow,
.hax[data-card-style="borderless"] .card > header > .col > .eyebrow {
  position: relative;
  padding-left: 10px;
}
.hax[data-card-style="borderless"] .card > .eyebrow::before,
.hax[data-card-style="borderless"] .card > header > .col > .eyebrow::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
}
/* KPI strip — 카드 톤이 surface-2 같아지면 셀끼리 안 구분되니 강한 그리드선 + 더 큰 간격 */
.hax[data-card-style="borderless"] .kpi-strip {
  border: none;
  background: transparent;
  gap: 8px;
}
.hax[data-card-style="borderless"] .kpi-strip > .kpi-cell {
  background: var(--surface-2);
  border-right: none;
  border-radius: 2px;
}
/* SI metric strip */
.hax[data-card-style="borderless"][data-admin-ui="si"] .metric-strip {
  border: none;
  background: transparent;
  gap: 6px;
}
.hax[data-card-style="borderless"][data-admin-ui="si"] .metric-strip > .metric-cell {
  background: var(--surface-2);
  border-radius: 2px;
}

/* ============================================================
   토스 스타일 (응시자 화면용)
   - 큰 둥근 모서리, 넉넉한 여백, 굵은 CTA
   - 친근하지만 또렷한 정서
   ============================================================ */
.hax[data-taker-ui="toss"] {
  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --bg: #F6F7F9;
  --canvas: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F2F4F6;
  --surface-3: #E5E8EB;
  --border: #E8ECF0;
  --border-strong: #D1D6DB;
  --border-subtle: #F1F3F5;
}
.hax[data-taker-ui="toss"] .toss-only { display: initial; }
.hax:not([data-taker-ui="toss"]) .toss-only { display: none; }
.hax[data-taker-ui="toss"] .toss-hide { display: none !important; }

/* Toss buttons — large, bold, rounded */
.hax[data-taker-ui="toss"] .btn {
  height: 44px;
  padding: 0 18px;
  font-size: 14.5px;
  font-weight: 700;
  border-radius: 14px;
  letter-spacing: -0.01em;
}
.hax[data-taker-ui="toss"] .btn-lg {
  height: 56px;
  padding: 0 24px;
  font-size: 16px;
  font-weight: 700;
  border-radius: 16px;
}
.hax[data-taker-ui="toss"] .btn-sm {
  height: 36px; padding: 0 14px; font-size: 13px;
  border-radius: 10px;
}
.hax[data-taker-ui="toss"] .btn-primary {
  background: #191F28;
  color: #fff;
}
.hax[data-taker-ui="toss"] .btn-primary:hover { background: #000; }
.hax[data-taker-ui="toss"] .btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: transparent;
}
.hax[data-taker-ui="toss"] .btn-secondary:hover { background: var(--surface-3); }
.hax[data-taker-ui="toss"] .btn-ghost { background: transparent; color: var(--text-2); font-weight: 600; }
.hax[data-taker-ui="toss"] .btn-ghost:hover { background: var(--surface-2); }

/* Toss accent button (orange) */
.hax[data-taker-ui="toss"] .btn-accent {
  background: var(--accent); color: #fff;
}
.hax[data-taker-ui="toss"] .btn-accent:hover { background: var(--accent-hover); }

/* Toss inputs */
.hax[data-taker-ui="toss"] .input {
  height: 56px;
  padding: 0 18px;
  font-size: 16px;
  font-weight: 500;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 14px;
}
.hax[data-taker-ui="toss"] .input:focus {
  background: var(--surface);
  border-color: var(--text);
  box-shadow: none;
}
.hax[data-taker-ui="toss"] textarea.input {
  height: auto; padding: 16px 18px;
}
.hax[data-taker-ui="toss"] .label {
  font-size: 13px; font-weight: 600; color: var(--text-2);
  margin-bottom: 10px;
}

/* Toss cards */
.hax[data-taker-ui="toss"] .card {
  border-radius: 20px;
  border-color: transparent;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03), 0 8px 24px rgba(0,0,0,0.04);
}

/* Toss choice options — flat, soft, rounded */
.hax[data-taker-ui="toss"] .choice {
  padding: 20px 22px;
  border-radius: 16px;
  border: 2px solid transparent;
  background: var(--surface-2);
  font-size: 15.5px;
  font-weight: 500;
  transition: background .12s, border-color .12s;
}
.hax[data-taker-ui="toss"] .choice:hover {
  background: var(--surface-3);
  border-color: transparent;
}
.hax[data-taker-ui="toss"] .choice.selected {
  background: #FFF1E9;
  border-color: var(--accent);
  box-shadow: none;
}
.hax[data-taker-ui="toss"] .choice .marker {
  width: 22px; height: 22px;
  border-width: 2px;
  background: var(--surface);
}
.hax[data-taker-ui="toss"] .choice.selected .marker::after {
  inset: 4px;
}

/* Toss likert */
.hax[data-taker-ui="toss"] .likert .pt {
  padding: 18px 8px;
  border-radius: 14px;
  border: 2px solid transparent;
  background: var(--surface-2);
}
.hax[data-taker-ui="toss"] .likert .pt:hover { background: var(--surface-3); border-color: transparent; }
.hax[data-taker-ui="toss"] .likert .pt.selected {
  background: #FFF1E9;
  border-color: var(--accent);
  box-shadow: none;
}
.hax[data-taker-ui="toss"] .likert .pt .num { font-size: 20px; }

/* Toss badges */
.hax[data-taker-ui="toss"] .badge {
  height: 26px; padding: 0 10px; font-size: 12px;
  border-radius: 8px;
  border: none;
  background: var(--surface-2);
  color: var(--text-2);
}
.hax[data-taker-ui="toss"] .badge-accent {
  background: #FFE9DC; color: var(--accent);
}
.hax[data-taker-ui="toss"] .badge-success { background: #E6F7EC; color: #1A8B47; }

/* Toss progress */
.hax[data-taker-ui="toss"] .progress { height: 4px; background: var(--surface-3); }

/* Toss typography */
.hax[data-taker-ui="toss"] .h-display {
  font-size: 44px; line-height: 1.2; font-weight: 800;
  letter-spacing: -0.02em;
}
.hax[data-taker-ui="toss"] .h-1 { font-size: 30px; font-weight: 800; line-height: 1.25; }
.hax[data-taker-ui="toss"] .h-2 { font-size: 24px; font-weight: 800; line-height: 1.3; }
.hax[data-taker-ui="toss"] .h-3 { font-size: 18px; font-weight: 700; }
.hax[data-taker-ui="toss"] .h-4 { font-size: 15px; font-weight: 700; }
.hax[data-taker-ui="toss"] .t-lg { font-size: 16px; line-height: 1.6; }
.hax[data-taker-ui="toss"] .t-md { font-size: 14.5px; }
.hax[data-taker-ui="toss"] .eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0;
  text-transform: none; color: var(--accent);
}

/* Toss compact section labels */
.hax[data-taker-ui="toss"] .toss-section-label {
  font-size: 12.5px; font-weight: 700; color: var(--text-3);
  letter-spacing: -0.005em;
}

/* Toss header — minimal */
.hax[data-taker-ui="toss"] .taker-header {
  padding: 18px 24px !important;
  height: 60px;
  border-bottom: 1px solid transparent !important;
  background: var(--canvas) !important;
}

/* Toss "back" bar style */
.hax .back-bar {
  display: flex; align-items: center; gap: 0;
  padding: 18px 24px;
  background: var(--canvas);
  height: 60px;
}
.hax .back-bar .back-btn {
  width: 36px; height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; cursor: pointer; color: var(--text);
}
.hax .back-bar .back-btn:hover { background: var(--surface-2); }

/* Sticky bottom CTA bar (Toss) */
.hax .toss-cta-bar {
  padding: 16px 24px 20px;
  background: var(--canvas);
  border-top: 1px solid transparent;
}

/* Big stat for taker complete */
.hax[data-taker-ui="toss"] .stat {
  padding: 22px 24px;
  border-radius: 18px;
  border-color: transparent;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03), 0 6px 18px rgba(0,0,0,0.04);
}
.hax[data-taker-ui="toss"] .stat .stat-value { font-size: 32px; font-weight: 800; }
.hax[data-taker-ui="toss"] .toast {
  background: var(--surface-2);
  border: none;
  border-left: 0;
  border-radius: 14px;
  padding: 14px 16px;
}

/* Weight slider — uniform track look across all category colors.
   채워진 부분(왼쪽)은 카테고리 색, 남은 부분은 var(--surface-2)로 고정. */
.hax .weight-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 999px;
  outline: none;
}
.hax .weight-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--text);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  margin-top: -5px;
}
.hax .weight-slider::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--text);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.hax .weight-slider::-webkit-slider-runnable-track {
  height: 6px;
  background: transparent;
  border-radius: 999px;
}
.hax .weight-slider::-moz-range-track {
  height: 6px;
  background: transparent;
  border-radius: 999px;
}

/* Skill bar in Toss */
.hax[data-taker-ui="toss"] .skill-bar { height: 10px; border-radius: 999px; background: var(--surface-3); }

