/* ==========================================================================
   스포츠브릿지 design system — 오로라(Aurora) 테마 (univDash 기본 테마 이식)
   담당자용 = 오로라 다크(data-theme="dark"), 이용자용 = 오로라 라이트(data-theme="light").
   모드는 서버가 고정하며 사용자가 바꿀 수 없습니다. 레이아웃·컴포넌트 형태는 Commeet 구조를 따릅니다.
   ========================================================================== */

:root, :root[data-theme="dark"] {
  --aurora-bg: radial-gradient(circle at 10% 10%, rgba(59, 130, 246, 0.20), transparent 35%),
               radial-gradient(circle at 90% 0%, rgba(168, 85, 247, 0.18), transparent 40%),
               radial-gradient(circle at 50% 100%, rgba(16, 185, 129, 0.10), transparent 45%),
               #05070f;
  --glass-blur: 20px;

  --color-primary: #3b82f6;
  --color-primary-hover: #2f6fdd;
  --color-primary-dark: #bfdbfe;            /* 연한 배경 위 글자 역할 */
  --color-primary-pale: rgba(59, 130, 246, 0.15);
  --color-primary-pale-2: rgba(59, 130, 246, 0.26);
  --color-primary-rgb: 59, 130, 246;
  --color-accent: #93c5fd;
  --color-gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --color-glow: 0 8px 24px rgba(59, 130, 246, 0.30);
  --color-glow-hover: 0 10px 30px rgba(139, 92, 246, 0.40);

  --color-navy: #8b5cf6;                    /* 보조 버튼·선택 상태 = 보라 */
  --color-navy-hover: #7c4ee6;
  --color-navy-pale: rgba(139, 92, 246, 0.15);
  --color-navy-pale-2: rgba(139, 92, 246, 0.26);
  --color-heading: #ffffff;

  --color-warning-bg: rgba(245, 158, 11, 0.14);
  --color-warning-border: rgba(245, 158, 11, 0.35);
  --color-warning-text: #fcd34d;
  --color-danger: #ef4444;
  --color-danger-hover: #dc2626;
  --color-danger-bg: rgba(239, 68, 68, 0.14);
  --color-danger-border: rgba(239, 68, 68, 0.35);
  --color-danger-text: #fca5a5;
  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.14);
  --color-success-text: #6ee7b7;
  --color-info-bg: rgba(59, 130, 246, 0.14);
  --color-info-text: #bfdbfe;
  --color-warm: #f472b6;
  --color-warm-pale: rgba(244, 114, 182, 0.16);

  --color-bg: #05070f;
  --color-surface: rgba(255, 255, 255, 0.05);
  --color-surface-solid: rgba(14, 18, 34, 0.96);   /* 다이얼로그·드롭다운·모바일 메뉴 */
  --color-surface-2: rgba(255, 255, 255, 0.07);
  --color-surface-3: rgba(255, 255, 255, 0.11);
  --color-border: rgba(255, 255, 255, 0.10);
  --color-border-light: rgba(255, 255, 255, 0.07);
  --color-input-border: rgba(255, 255, 255, 0.14);
  --color-input-bg: rgba(255, 255, 255, 0.05);

  --color-text: #eef1f8;
  --color-text-muted: rgba(255, 255, 255, 0.62);
  --color-text-faint: rgba(255, 255, 255, 0.42);
  --color-text-on-primary: #ffffff;
  --color-neutral-text: rgba(255, 255, 255, 0.78);

  --color-footer-bg: rgba(255, 255, 255, 0.03);
  --color-footer-text: rgba(255, 255, 255, 0.6);
  --color-footer-link: rgba(255, 255, 255, 0.8);
  --color-footer-copy: rgba(255, 255, 255, 0.35);
  --color-footer-border: rgba(255, 255, 255, 0.08);

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.5);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;
  --header-height: 64px;
  --container-width: 1400px;
  --font-sans: 'Inter', 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --aurora-bg: radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.14), transparent 35%),
               radial-gradient(circle at 90% 0%, rgba(236, 72, 153, 0.10), transparent 40%),
               radial-gradient(circle at 50% 100%, rgba(16, 185, 129, 0.10), transparent 45%),
               #eef0f9;

  --color-primary: #3b82f6;
  --color-primary-hover: #2563eb;
  --color-primary-dark: #1e40af;
  --color-primary-pale: rgba(59, 130, 246, 0.10);
  --color-primary-pale-2: rgba(59, 130, 246, 0.20);
  --color-accent: #1d4ed8;
  --color-glow: 0 8px 24px rgba(59, 130, 246, 0.22);
  --color-glow-hover: 0 10px 30px rgba(139, 92, 246, 0.30);

  --color-navy: #6d28d9;
  --color-navy-hover: #5b21b6;
  --color-navy-pale: rgba(124, 58, 237, 0.10);
  --color-navy-pale-2: rgba(124, 58, 237, 0.18);
  --color-heading: #101828;

  --color-warning-bg: rgba(245, 158, 11, 0.12);
  --color-warning-border: rgba(180, 83, 9, 0.3);
  --color-warning-text: #92400e;
  --color-danger: #dc2626;
  --color-danger-hover: #b91c1c;
  --color-danger-bg: rgba(239, 68, 68, 0.10);
  --color-danger-border: rgba(220, 38, 38, 0.3);
  --color-danger-text: #b91c1c;
  --color-success: #059669;
  --color-success-bg: rgba(16, 185, 129, 0.12);
  --color-success-text: #047857;
  --color-info-bg: rgba(59, 130, 246, 0.10);
  --color-info-text: #1e3a8a;
  --color-warm: #db2777;
  --color-warm-pale: rgba(236, 72, 153, 0.12);

  --color-bg: #eef0f9;
  --color-surface: rgba(255, 255, 255, 0.62);
  --color-surface-solid: rgba(255, 255, 255, 0.97);
  --color-surface-2: rgba(15, 23, 42, 0.045);
  --color-surface-3: rgba(15, 23, 42, 0.08);
  --color-border: rgba(15, 23, 42, 0.10);
  --color-border-light: rgba(15, 23, 42, 0.07);
  --color-input-border: rgba(15, 23, 42, 0.14);
  --color-input-bg: rgba(255, 255, 255, 0.7);

  --color-text: #101828;
  --color-text-muted: #47536e;
  --color-text-faint: #6b7490;
  --color-neutral-text: #253046;

  --color-footer-bg: rgba(255, 255, 255, 0.45);
  --color-footer-text: #47536e;
  --color-footer-link: #253046;
  --color-footer-copy: #8a92aa;
  --color-footer-border: rgba(15, 23, 42, 0.08);

  --shadow-sm: 0 2px 6px rgba(30, 41, 59, 0.08);
  --shadow-md: 0 6px 18px rgba(30, 41, 59, 0.14);
  --shadow-lg: 0 20px 60px rgba(30, 41, 59, 0.25);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
* { scrollbar-width: thin; scrollbar-color: var(--color-border) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
[hidden] { display: none !important; }

body {
  font-family: var(--font-sans);
  background: var(--aurora-bg);
  background-attachment: fixed;
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  font-size: 15px;
}
main { flex: 1; width: 100%; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-primary-dark); text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 10px; font-weight: 700; line-height: 1.3; color: var(--color-heading); }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
p { margin: 0 0 12px; line-height: 1.6; color: var(--color-text-muted); }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }
img { max-width: 100%; }
code, .mono { font-family: var(--font-mono); font-size: 0.92em; }
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 20px; width: 100%; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--color-text-muted); }
.faint { color: var(--color-text-faint); font-size: 13px; }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mb-16 { margin-bottom: 16px; }

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: var(--radius-md); padding: 11px 18px; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: background-color 0.2s, color 0.2s; white-space: nowrap; line-height: 1.2; text-decoration: none;
  min-height: 42px;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--color-gradient); color: #fff; box-shadow: var(--color-glow); transition: box-shadow 0.15s, transform 0.15s; }
.btn-primary:hover:not(:disabled) { color: #fff; box-shadow: var(--color-glow-hover); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary { background-color: var(--color-navy); color: #fff; }
.btn-secondary:hover:not(:disabled) { background-color: var(--color-navy-hover); color: #fff; }
.btn-ghost { background-color: var(--color-surface-2); color: var(--color-neutral-text); }
.btn-ghost:hover:not(:disabled) { background-color: var(--color-surface-3); color: var(--color-neutral-text); }
.btn-ghost.active { background-color: var(--color-primary); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--color-primary); color: var(--color-accent); }
.btn-outline:hover:not(:disabled) { background: var(--color-primary-pale); }
.btn-danger { background-color: var(--color-danger); color: #fff; }
.btn-danger:hover:not(:disabled) { background-color: var(--color-danger-hover); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 13px; min-height: 34px; }
.btn-icon {
  padding: 7px; min-width: 36px; min-height: 36px; border-radius: var(--radius-md); background: transparent; border: none;
  color: var(--color-text-muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; line-height: 1;
}
.btn-icon:hover { background-color: var(--color-surface-2); color: var(--color-text); }
.btn-block { width: 100%; }

/* ---------------------------------------------------------------- Forms */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 6px; color: var(--color-heading); }
.field .hint { font-size: 12px; color: var(--color-text-muted); margin-top: 5px; line-height: 1.5; }
.input, select.input, textarea.input {
  width: 100%; padding: 10px; border: 1px solid var(--color-input-border); border-radius: var(--radius-md);
  font-size: 15px; font-family: inherit; color: var(--color-text); background-color: var(--color-input-bg);
  transition: border-color 0.2s, box-shadow 0.2s; min-height: 42px;
}
.input:focus, select.input:focus, textarea.input:focus { outline: none; border-color: rgba(96, 165, 250, 0.6); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); }
select.input option { background: var(--color-surface-solid); color: var(--color-text); }
.input:disabled { background-color: var(--color-surface-2); color: var(--color-text-faint); }
textarea.input { resize: vertical; min-height: 72px; }
.input-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.input-row .input { flex: 1; min-width: 140px; }
.checkbox-row { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; color: var(--color-text); cursor: pointer; margin-bottom: 10px; line-height: 1.5; }
.checkbox-row input[type="checkbox"] { margin-top: 3px; accent-color: var(--color-primary); width: 16px; height: 16px; flex-shrink: 0; }
.toggle-group { display: inline-flex; border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 3px; background-color: var(--color-surface); }
.toggle-group button { border: none; background: transparent; padding: 7px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 700; color: var(--color-text-muted); cursor: pointer; }
.toggle-group button.active { background-color: var(--color-primary); color: #fff; }
.dow-toggle-row { display: flex; gap: 6px; flex-wrap: wrap; }
.dow-toggle { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--color-border); background-color: var(--color-surface); color: var(--color-text); font-size: 14px; font-weight: 700; cursor: pointer; }
.dow-toggle.active { background-color: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.form-error { color: var(--color-danger-text); font-size: 13px; margin: -4px 0 12px; min-height: 1em; }

/* ---------------------------------------------------------------- Header */
.site-header { background-color: var(--color-surface); border-bottom: 1px solid var(--color-border); position: sticky; top: 0; z-index: 40; }
.site-header .container { min-height: var(--header-height); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--color-accent); }
.brand:hover { text-decoration: none; }
.brand-logo { display: inline-flex; color: var(--color-primary); flex-shrink: 0; filter: drop-shadow(0 4px 10px rgba(59,130,246,0.35)); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-mark { font-size: 20px; font-weight: 800; color: var(--color-accent); letter-spacing: -0.02em; line-height: 1.1; white-space: nowrap; }
.brand-sub { font-size: 12px; color: var(--color-text-muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { padding: 8px 13px; border-radius: var(--radius-md); color: var(--color-heading); font-weight: 700; font-size: 14px; }
.nav-links a:hover, .nav-links a.active { background-color: var(--color-primary-pale); color: var(--color-accent); text-decoration: none; box-shadow: inset 0 1px 0 rgba(255,255,255,0.04); }
:root[data-theme="dark"] .nav-links a.active { border: 1px solid rgba(96, 165, 250, 0.25); padding: 7px 12px; }
.nav-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.nav-toggle { display: none; }
:root[data-theme="dark"] :root[data-theme="dark"] .demo-banner { background: var(--color-warning-bg); color: var(--color-warning-text); border-bottom: 1px solid var(--color-warning-border); text-align: center; font-size: 13px; padding: 7px 16px; font-weight: 700; }

/* ---------------------------------------------------------------- Footer */
.site-footer { background-color: var(--color-footer-bg); color: var(--color-footer-text); width: 100%; padding: 36px 0; margin-top: 40px; border-top: 1px solid var(--color-footer-border); }
.footer-inner { max-width: var(--container-width); margin: 0 auto; padding: 0 20px; }
.footer-title { font-weight: 800; color: #fff; font-size: 16px; margin-bottom: 10px; }
.site-footer p { color: var(--color-footer-text); font-size: 13px; max-width: 820px; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; margin: 10px 0; }
.footer-links a { color: var(--color-footer-link); font-size: 13px; }
.copyright { color: var(--color-footer-copy); font-size: 12px; margin-top: 12px; }

/* ---------------------------------------------------------------- Cards / badges / notices */
.card { background-color: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur)); }
.list-item, .tile, .combo-card, .step-card, .mode-card, .evidence-card, .review-item, .guide-box, .site-header, .site-footer, .notice { backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur)); }
.card-pad { padding: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.notice { background-color: var(--color-info-bg); color: var(--color-info-text); border: 1px solid transparent; border-radius: var(--radius-lg); padding: 12px 16px; margin: 0 0 16px; line-height: 1.6; font-size: 14px; }
.notice.warn { background: var(--color-warning-bg); color: var(--color-warning-text); border-color: var(--color-warning-border); }
.notice.error { background: var(--color-danger-bg); color: var(--color-danger-text); border-color: var(--color-danger-border); }
.notice p { margin: 0; color: inherit; font-size: inherit; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 700; background-color: var(--color-primary-pale); color: var(--color-primary-dark); white-space: nowrap; }
.badge-muted { background-color: var(--color-surface-2); color: var(--color-text-muted); }
.badge-warn { background: var(--color-warning-bg); color: var(--color-warning-text); }
.badge-ok { background: var(--color-success-bg); color: var(--color-success-text); }
.badge-danger { background: var(--color-danger-bg); color: var(--color-danger-text); }
.prov { display: inline-block; padding: 2px 7px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.prov-public { background: var(--color-info-bg); color: var(--color-info-text); }
.prov-rule { background: var(--color-surface-2); color: var(--color-text-muted); }
.prov-llm_extracted { background: var(--color-warning-bg); color: var(--color-warning-text); }
.prov-llm_reviewed { background: var(--color-success-bg); color: var(--color-success-text); }
.prov-confirmed { background: var(--color-primary); color: #fff; }
.prov-assumed { background: var(--color-danger-bg); color: var(--color-danger-text); border-style: dashed; border-color: var(--color-danger-border); }

/* ---------------------------------------------------------------- Dialog / snackbar */
.dialog-backdrop { position: fixed; inset: 0; background-color: rgba(10, 20, 40, 0.55); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 100; }
.dialog-backdrop.open { display: flex; }
.dialog { background-color: var(--color-surface-solid); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; padding: 22px; }
.dialog.dialog-lg { max-width: 860px; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.dialog-header h2 { font-size: 18px; margin: 0; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
#snackbar-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; width: calc(100% - 40px); max-width: 420px; pointer-events: none; }
.snackbar { background: var(--color-gradient); color: #fff; padding: 12px 18px; border-radius: var(--radius-md); font-size: 14px; box-shadow: var(--shadow-md); animation: snackbar-in 0.15s ease-out; text-align: center; line-height: 1.5; }
.snackbar.error { background-color: var(--color-danger); }
.snackbar.success { background-color: var(--color-success); }
@keyframes snackbar-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid var(--color-border); border-top-color: var(--color-primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state { text-align: center; padding: 40px 16px; color: var(--color-text-muted); }

/* ---------------------------------------------------------------- Page layout */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; margin: 26px 0 16px; flex-wrap: wrap; gap: 12px; }
.page-head h1 { margin: 0; }
.page-head .sub { margin: 4px 0 0; font-size: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.layout-side { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.layout-side .side { position: sticky; top: calc(var(--header-height) + 12px); }
.layout-side .side .card { max-height: calc(100vh - var(--header-height) - 24px); overflow-y: auto; }

.stat { padding: 16px 18px; }
.stat .label { font-size: 12px; color: var(--color-text-muted); font-weight: 700; margin-bottom: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.stat .value { font-size: 26px; font-weight: 800; color: var(--color-heading); line-height: 1.1; }
.stat .value small { font-size: 13px; font-weight: 600; color: var(--color-text-muted); margin-left: 4px; }
.stat .desc { font-size: 12px; color: var(--color-text-faint); margin-top: 6px; line-height: 1.4; }
.stat.na .value { color: var(--color-text-faint); font-size: 18px; }

.rank-pill { display: inline-flex; align-items: center; gap: 4px; background: var(--color-primary-pale); color: var(--color-primary-dark); border-radius: var(--radius-pill); padding: 3px 10px; font-size: 12px; font-weight: 700; }
.rank-pill.hot { background: var(--color-danger-bg); color: var(--color-danger-text); }

/* ---------------------------------------------------------------- Tables (mobile → cards) */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--color-border-light); text-align: left; vertical-align: top; }
.table th { font-size: 12px; color: var(--color-text-muted); font-weight: 700; background: var(--color-surface-2); position: sticky; top: 0; white-space: nowrap; }
.table th.sortable { cursor: pointer; user-select: none; }
.table th.sortable:hover { color: var(--color-accent); }
.table th.sorted::after { content: ' ▾'; color: var(--color-accent); }
.table th.sorted.asc::after { content: ' ▴'; }
.table tr:hover td { background: var(--color-primary-pale); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .name a { font-weight: 700; }
.table td .sub { display: block; font-size: 12px; color: var(--color-text-faint); margin-top: 2px; }
@media (max-width: 760px) {
  table.table.responsive, .table.responsive thead, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive thead { display: none; }
  .table.responsive tr { border: 1px solid var(--color-border); border-radius: var(--radius-lg); margin-bottom: 10px; padding: 8px 12px; background: var(--color-surface); }
  .table.responsive td { border: none; padding: 5px 0; display: flex; justify-content: space-between; gap: 12px; text-align: left; }
  .table.responsive td.num { text-align: right; }
  .table.responsive td::before { content: attr(data-label); font-size: 12px; color: var(--color-text-muted); font-weight: 700; flex-shrink: 0; }
  .table.responsive td.name { flex-direction: column; gap: 2px; }
  .table.responsive td.name::before { display: none; }
  .table.responsive tr:hover td { background: transparent; }
}

/* ---------------------------------------------------------------- Bars / mini charts */
.bar { height: 8px; background: var(--color-surface-3); border-radius: 4px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--color-primary); border-radius: 4px; }
.bar-list { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) 60px; gap: 8px; align-items: center; font-size: 13px; }
.bar-row .k { color: var(--color-text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .v { text-align: right; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 36px; }
.spark span { flex: 1; background: var(--color-primary); opacity: 0.75; border-radius: 2px 2px 0 0; min-width: 3px; }

/* ---------------------------------------------------------------- Landing */
.hero { padding: 56px 0 36px; text-align: center; }
.hero .badge { margin-bottom: 18px; font-size: 12px; padding: 5px 12px; }
.hero h1 { font-size: 38px; max-width: 760px; margin: 0 auto 16px; line-height: 1.3; }
.hero .subtitle { font-size: 16px; max-width: 620px; margin: 0 auto 26px; }
.hero .cta-row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.section { padding: 44px 0; }
.section-title { text-align: center; font-size: 24px; margin-bottom: 8px; }
.section-subtitle { text-align: center; max-width: 620px; margin: 0 auto 30px; }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.step-card { background-color: var(--color-surface); border: 1px solid var(--color-border-light); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 22px 18px; }
.step-card h3 { font-size: 16px; }
.step-number { width: 36px; height: 36px; border-radius: 50%; background: var(--color-gradient); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.region-picker { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 760px; margin: 0 auto; }
.region-picker select { min-width: 160px; }
.error-page { text-align: center; padding: 60px 20px; }
.error-page h1 { font-size: 64px; color: var(--color-primary); }

/* ---------------------------------------------------------------- Scenario editor */
.list-editor { display: flex; flex-direction: column; gap: 10px; }
.list-item { border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 12px; background: var(--color-surface); }
.list-item .head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.list-item .head b { font-size: 14px; }
.list-item .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.list-item .field { margin-bottom: 0; }
.list-item .field label { font-size: 12px; }
.list-item .input { min-height: 36px; padding: 6px 8px; font-size: 14px; }
.combo-card { border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 14px; background: var(--color-surface); }
.combo-card.best { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-pale); }
.combo-card .title { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.combo-card .big { font-size: 24px; font-weight: 800; color: var(--color-heading); }
.combo-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background-color: var(--color-primary-pale); color: var(--color-primary-dark); border-radius: var(--radius-sm); padding: 4px 8px; font-size: 12px; font-weight: 700; }
.chip.off { background: var(--color-surface-2); color: var(--color-text-faint); }
.trace { font-size: 13px; }
.trace li { padding: 6px 0; border-bottom: 1px dashed var(--color-border-light); }
.sticky-actions { position: sticky; bottom: 0; background: var(--color-surface); border-top: 1px solid var(--color-border); padding: 10px 0; margin-top: 16px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; z-index: 5; }

/* ---------------------------------------------------------------- Agent dashboard */
.agent-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 16px; align-items: start; }
.chat { display: flex; flex-direction: column; gap: 12px; min-height: 320px; }
.msg { max-width: 92%; padding: 12px 14px; border-radius: 12px; line-height: 1.6; font-size: 14px; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--color-primary); color: #fff; border-bottom-right-radius: 4px; }
.msg.assistant { align-self: flex-start; background: var(--color-surface-2); color: var(--color-text); border-bottom-left-radius: 4px; }
.msg.assistant .appendix { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--color-border); font-size: 12px; color: var(--color-text-muted); }
.chat-form { display: flex; gap: 8px; margin-top: 12px; }
.chat-form textarea { flex: 1; }
.timeline { display: flex; flex-direction: column; gap: 6px; max-height: 70vh; overflow-y: auto; }
.tl-item { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; padding: 8px 10px; border-radius: var(--radius-md); background: var(--color-surface-2); font-size: 13px; }
.tl-item .icon { font-weight: 800; color: var(--color-accent); }
.tl-item.call { background: var(--color-info-bg); }
.tl-item.result { background: var(--color-success-bg); }
.tl-item.guard, .tl-item.warn { background: var(--color-warning-bg); }
.tl-item.error { background: var(--color-danger-bg); }
.tl-item .title { font-weight: 700; }
.tl-item .text { color: var(--color-text-muted); margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.tl-item.pending .icon { animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
.evidence-card { border: 1px solid var(--color-border-light); border-radius: var(--radius-md); padding: 10px; font-size: 13px; background: var(--color-surface); }
.evidence-card .k { font-weight: 700; color: var(--color-heading); }
.sample-qs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.sample-qs button { border: 1px solid var(--color-border); background: var(--color-surface); border-radius: var(--radius-pill); padding: 6px 12px; font-size: 12px; cursor: pointer; color: var(--color-text); }
.sample-qs button:hover { border-color: var(--color-primary); color: var(--color-accent); }

/* ---------------------------------------------------------------- Review queue */
.review-item { border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 14px; background: var(--color-surface); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
.review-item .evidence { background: var(--color-surface-2); border-radius: var(--radius-md); padding: 8px 10px; font-size: 13px; margin-top: 6px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 12px; font-size: 13px; }
.kv dt { color: var(--color-text-muted); font-weight: 700; }
.kv dd { margin: 0; }
details.expandable { border-top: 1px solid var(--color-border-light); padding-top: 12px; margin-top: 8px; }
details.expandable summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--color-heading); }
.doc-preview { white-space: pre-wrap; font-size: 14px; line-height: 1.7; background: var(--color-surface-2); border-radius: var(--radius-md); padding: 16px; }
.watermark { font-size: 12px; color: var(--color-danger-text); font-weight: 700; }

/* ---------------------------------------------------------------- Mode choice (landing) */
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 900px; margin: 8px auto 0; text-align: left; }
.mode-card { display: flex; flex-direction: column; gap: 10px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-sm); color: var(--color-text); transition: box-shadow 0.2s, border-color 0.2s; }
.mode-card:hover { text-decoration: none; border-color: var(--color-primary); box-shadow: var(--shadow-md); color: var(--color-text); }
.mode-card h2 { margin: 0; font-size: 20px; }
.mode-card p { margin: 0; font-size: 14px; flex: 1; }
.mode-card .btn { align-self: flex-start; pointer-events: none; }
.mode-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--color-gradient); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip { cursor: pointer; border: none; }
@media (max-width: 760px) { .mode-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------------- Guide */
.guide-layout { grid-template-columns: 260px minmax(0, 1fr); }
.guide-toc ol { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.guide-toc a { display: block; padding: 6px 8px; border-radius: var(--radius-sm); font-size: 13px; color: var(--color-text); }
.guide-toc a:hover { background: var(--color-primary-pale); color: var(--color-accent); text-decoration: none; }
.guide-body { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.guide-body section { scroll-margin-top: calc(var(--header-height) + 12px); }
.guide-body h2 { font-size: 20px; padding-bottom: 8px; border-bottom: 1px solid var(--color-border-light); margin-bottom: 12px; }
.guide-body h3 { font-size: 15px; margin-top: 16px; }
.guide-body p { color: var(--color-text); font-size: 14px; }
.guide-list li { padding: 4px 0; font-size: 14px; line-height: 1.6; color: var(--color-text); }
.guide-steps { padding-left: 20px; margin: 0; }
.guide-steps li { margin: 8px 0; line-height: 1.6; font-size: 14px; color: var(--color-text); }
.guide-box { border: 1px solid var(--color-border-light); border-radius: var(--radius-lg); padding: 14px; background: var(--color-surface-2); }
.guide-box h4 { margin: 0 0 8px; font-size: 14px; }
.guide-box li { font-size: 13px; line-height: 1.6; padding: 2px 0; color: var(--color-text); }
.guide-glossary dt { padding-top: 6px; }
.guide-glossary dd { padding-top: 6px; line-height: 1.5; }
.guide-promo { border-color: var(--color-primary-pale-2); }
@media (max-width: 1000px) { .guide-layout { grid-template-columns: minmax(0, 1fr); } .guide-toc ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .guide-toc ol { grid-template-columns: minmax(0, 1fr); } .guide-promo .row { flex-direction: column; align-items: stretch; } .guide-promo .btn { width: 100%; } }

/* ---------------------------------------------------------------- Import progress */
.progress { height: 10px; background: var(--color-surface-3); border-radius: 5px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--color-gradient); transition: width 0.4s ease; border-radius: 5px; }
.progress-bar.done { background: var(--color-success); }
.progress-bar.failed { background: var(--color-danger); }
.global-import { position: sticky; top: var(--header-height); z-index: 39; background: var(--color-info-bg); color: var(--color-info-text); border-bottom: 1px solid var(--color-border); }
.global-import-inner { max-width: var(--container-width); margin: 0 auto; padding: 8px 20px; display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 700; }
.global-import-inner .progress { flex: 1; min-width: 80px; }
@media (max-width: 640px) { .global-import-inner { flex-wrap: wrap; padding: 8px 16px; } }


/* ---------------------------------------------------------------- 이용자용 보조 컴포넌트 */
.nav-switch { margin-left: 6px; font-size: 12px !important; color: var(--color-text-faint) !important; border: 1px dashed var(--color-border); }
.nav-switch:hover { color: var(--color-accent) !important; background: transparent !important; }
.u-hero { padding: 26px 0 8px; }
.u-hero h1 { font-size: 26px; margin-bottom: 6px; }
.fav-btn { border: 1px solid var(--color-border); background: var(--color-surface); border-radius: var(--radius-pill); padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--color-text-muted); }
.fav-btn.on { background: var(--color-warm-pale); color: var(--color-warm); border-color: var(--color-warm); }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tile { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.tile .t { font-weight: 700; font-size: 15px; color: var(--color-heading); }
.tile .m { font-size: 13px; color: var(--color-text-muted); }
.big-num { font-size: 34px; font-weight: 800; color: var(--color-heading); line-height: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip { cursor: pointer; border: none; }


/* ==========================================================================
   모바일 앱 셸 (prompts/templates/mobile.css 기반)
   - 확대 금지, 16px 입력, safe-area, 하단 탭바 + '더보기' 시트, 터치 반응
   ========================================================================== */
:root { --app-h: 100%; --vv-h: 100vh; --vv-top: 0px; --tabbar-h: 0px; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; touch-action: manipulation; }
button, a, .chip, .dow-toggle, .fav-btn { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.site-header { padding-top: env(safe-area-inset-top); }
.site-header .container { min-height: var(--header-height); }
.global-import { top: calc(var(--header-height) + env(safe-area-inset-top)); }
.layout-side .side { top: calc(var(--header-height) + env(safe-area-inset-top) + 12px); }
.guide-body section { scroll-margin-top: calc(var(--header-height) + env(safe-area-inset-top) + 12px); }

.tabbar { display: none; }
.more-sheet { display: none; }

@media (pointer: coarse), (max-width: 767.98px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), textarea, select { font-size: 16px !important; }
  ::-webkit-scrollbar { width: 0; height: 0; }
  .table-wrap, .timeline, .chat, .layout-side .side .card { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .btn:active, .tab-item:active, .chip:active, .dow-toggle:active, .fav-btn:active, .mode-card:active, .tile:active { opacity: .7; }
  .btn, .btn-icon, .dow-toggle { min-height: 44px; }
  .btn-sm { min-height: 40px; }
  .site-footer { display: none; }                 /* 푸터는 데스크톱만 */
  .page-head .sub { display: none; }              /* 긴 설명 문구는 휴대폰에서 숨김 */
  .demo-banner { font-size: 12px; }
}

@media (max-width: 767.98px) {
  :root { --tabbar-h: 62px; }
  main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .nav-links, .nav-toggle { display: none !important; }
  .brand-mark { font-size: 17px; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    display: flex; padding: 6px 6px max(6px, calc(env(safe-area-inset-bottom) - 12px));
    background: var(--color-surface-solid);
    backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-top: 1px solid var(--color-border);
  }
  .tab-item { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 0 2px; border-radius: 12px; color: var(--color-text-faint); font-weight: 700; text-decoration: none; background: none; border: none; font-family: inherit; }
  .tab-item .tab-icon { font-size: 18px; line-height: 1; height: 20px; display: inline-flex; align-items: center; }
  .tab-item .tab-label { font-size: 10.5px; }
  .tab-item.active, .tab-item[aria-expanded="true"] { color: var(--color-accent); }
  html.kb-open .tabbar { display: none; }
  html.kb-open main { padding-bottom: 0; }
  .more-sheet { position: fixed; inset: 0; z-index: 400; background: rgba(5, 7, 15, 0.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; }
  .more-sheet[hidden] { display: none; }
  .more-sheet .sheet { width: 100%; max-height: calc(var(--app-h) - 40px); overflow-y: auto; overscroll-behavior: contain; border-radius: 22px 22px 0 0; background: var(--color-surface-solid); border: 1px solid var(--color-border); padding: 4px 12px max(12px, env(safe-area-inset-bottom)); animation: sheet-in .2s ease-out; }
  .sheet-grip { width: 38px; height: 4px; border-radius: 99px; background: var(--color-text-faint); margin: 8px auto 6px; opacity: .6; }
  .sheet-title { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--color-text-faint); padding: 6px 8px; }
  .sheet-action { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 12px; font-size: 15px; font-weight: 600; color: var(--color-text); text-decoration: none; }
  .sheet-action:hover, .sheet-action.active { background: var(--color-primary-pale); color: var(--color-accent); text-decoration: none; }
  .sheet-action .tab-icon { width: 24px; text-align: center; font-size: 18px; }
  .sheet-action.switch { border-top: 1px solid var(--color-border-light); margin-top: 6px; padding-top: 14px; color: var(--color-text-muted); }
  @keyframes sheet-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
  /* 다이얼로그는 바텀 시트처럼 */
  .dialog-backdrop { align-items: flex-end; padding: 0; }
  .dialog { max-width: none; max-height: calc(var(--app-h) - 40px); border-radius: 22px 22px 0 0; padding: 16px 16px max(16px, env(safe-area-inset-bottom)); animation: sheet-in .2s ease-out; }
  .dialog.dialog-lg { width: 100%; }
  /* 스낵바는 탭바 위에 */
  #snackbar-root { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); }
  html.kb-open #snackbar-root { bottom: 12px; }
  /* 시나리오 고정 액션 바도 탭바 위에 */
  .sticky-actions { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .hero { padding: 28px 0 16px; }
  .hero h1 { font-size: 24px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head .row { flex-wrap: wrap; }
  .page-head .row .btn { flex: 1; }
  .input-row .input { min-width: 0; flex: 1 1 140px; }
  /* 질문 입력바: 평소엔 탭바 위에 붙고, 키보드가 올라오면 보이는 영역 아래 끝(키보드 위)에 고정 */
  .chat-form { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 40; margin: 12px -14px -14px; padding: 8px 14px calc(8px + env(safe-area-inset-bottom)); background: var(--color-surface-solid); border-top: 1px solid var(--color-border); flex-direction: row; }
  .chat-form textarea { min-height: 44px; }
  html.kb-open .chat-form { position: fixed; left: 0; right: 0; bottom: auto; top: calc(var(--vv-top) + var(--vv-h)); transform: translateY(-100%); margin: 0; padding-bottom: 8px; }
  html.kb-open .chat { padding-bottom: 80px; }
  /* backdrop-filter가 있는 조상은 fixed 요소의 기준 상자가 되므로 키보드 상태에서는 blur를 끕니다 */
  html.kb-open .agent-layout .card { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
  .region-picker { flex-direction: column; align-items: stretch; }
  .region-picker select, .region-picker .btn { width: 100%; }
  .card-head { align-items: flex-start; }
  .stat .value { font-size: 20px; }
  .doc-preview { padding: 12px; font-size: 13px; }
  .msg { max-width: 100%; }
  .timeline { max-height: 50vh; }
  .mono, code { overflow-wrap: anywhere; }
  .table-wrap table.table:not(.responsive) { min-width: 640px; }   /* 넓은 표는 가로 스크롤 */
  .tile-grid { grid-template-columns: minmax(0, 1fr); }
  .list-item .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .more-sheet .sheet, .dialog { animation: none !important; } }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1000px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-side { grid-template-columns: minmax(0, 1fr); }
  .layout-side .side { position: static; }
  .layout-side .side .card { max-height: none; }
  .agent-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--color-surface-solid); border-bottom: 1px solid var(--color-border); box-shadow: var(--shadow-md); padding: 8px 12px 12px; gap: 2px;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; font-size: 15px; }
  .nav-toggle { display: inline-flex; }
  .brand-sub { display: none; }
  .brand-mark { font-size: 18px; }
  :root { --header-height: 60px; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .footer-inner { padding: 0 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 36px 0 24px; }
  .hero h1 { font-size: 26px; }
  .hero .subtitle { font-size: 14px; }
  .section { padding: 28px 0; }
  .section-title { font-size: 20px; }
  .page-head { margin: 18px 0 12px; }
  h1 { font-size: 22px; }
  .card-pad { padding: 14px; }
  .stat .value { font-size: 22px; }
  .btn { padding: 11px 14px; }
  .dialog { padding: 16px; max-height: 94vh; }
  .review-item { grid-template-columns: minmax(0, 1fr); }
  .bar-row { grid-template-columns: 72px 1fr 52px; }
  .msg { max-width: 100%; }
  .region-picker select { min-width: 0; flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
@media print {
  .site-header, .site-footer, .sticky-actions, .nav-actions, .demo-banner, .btn { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
}
