/* =============================================================================
 * Eval2Action — Design System
 * (Pretendard 웹폰트는 index.html에서 비차단 방식으로 로드)
 * ===========================================================================*/
:root {
  /* palette */
  --bg: #f7f8fb;
  --bg-elev: #ffffff;
  --bg-sidebar: #0f1117;
  --bg-sidebar-2: #161922;
  --surface: #ffffff;
  --surface-2: #f3f4f8;
  --surface-3: #eceef4;
  --border: #e6e8f0;
  --border-strong: #d7dae6;

  --text: #16181f;
  --text-2: #545a6b;
  --text-3: #8a90a2;
  --text-inv: #f4f5fa;

  --primary: #5b54f0;
  --primary-2: #7b73ff;
  --primary-soft: #efeefe;
  --primary-ink: #2e2a8f;
  --accent: #11b3a3;
  --accent-soft: #e2f7f4;

  --danger: #e5484d;
  --danger-soft: #fdecec;
  --warn: #e09b2d;
  --warn-soft: #fcf3e2;
  --ok: #2fa36b;
  --ok-soft: #e6f6ee;

  --grad: linear-gradient(135deg, #6d64ff 0%, #5b54f0 45%, #3f8cff 100%);
  --grad-soft: linear-gradient(135deg, #f3f1ff 0%, #eef4ff 100%);

  --shadow-sm: 0 1px 2px rgba(16,18,31,.06), 0 1px 3px rgba(16,18,31,.04);
  --shadow: 0 4px 14px rgba(16,18,31,.08), 0 2px 6px rgba(16,18,31,.04);
  --shadow-lg: 0 18px 44px rgba(20,22,40,.16), 0 6px 16px rgba(20,22,40,.08);

  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 24px;
  --sidebar-w: 268px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(91,84,240,.06), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(63,140,255,.05), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-size: 14.5px;
  line-height: 1.62;
  letter-spacing: -0.1px;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
::selection { background: rgba(91,84,240,.18); }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d3d6e2; border-radius: 20px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #bfc3d4; }

/* ============================ LAYOUT ====================================== */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  color: var(--text-inv);
  display: flex; flex-direction: column;
  position: fixed; inset: 0 auto 0 0; height: 100vh;
  z-index: 50;
  border-right: 1px solid rgba(255,255,255,.05);
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 20px 20px 18px;
  width: 100%; text-align: left; color: inherit;
  transition: background .15s ease;
}
.brand:hover, .brand:focus-visible { background: rgba(255,255,255,.05); outline: none; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--grad);
  display: grid; place-items: center;
  font-weight: 800; color: #fff; font-size: 17px;
  box-shadow: 0 4px 12px rgba(91,84,240,.45);
}
.brand-name { font-weight: 750; font-size: 16px; letter-spacing: -.2px; }
.brand-sub { font-size: 11px; color: #7a8194; margin-top: 1px; }

.nav { padding: 6px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 10.5px; color: #6b7180; text-transform: uppercase; letter-spacing: .8px; padding: 14px 10px 6px; font-weight: 700; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: 9px;
  color: #c2c7d4; font-size: 13.5px; font-weight: 550;
  transition: all .15s ease; width: 100%; text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(123,115,255,.18); color: #fff; }
.nav-item.active .nav-ico { color: var(--primary-2); }
.nav-item.disabled { opacity: .42; pointer-events: none; }
.nav-ico { width: 18px; height: 18px; flex: 0 0 18px; color: #8a90a2; }
.nav-item.active .nav-ico, .nav-item:hover .nav-ico { color: #fff; }
.nav-badge { margin-left: auto; font-size: 10px; background: rgba(255,255,255,.1); padding: 1px 7px; border-radius: 20px; color: #cfd3de; }

.sidebar-foot { margin-top: auto; padding: 14px; }
.data-pill {
  background: var(--bg-sidebar-2); border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px; padding: 12px 13px;
}
.data-pill .row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: #a8aebd; }
.data-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(47,163,107,.2); }
.data-pill .big { font-size: 13px; color: #fff; font-weight: 700; margin-top: 7px; }
.data-pill .small { font-size: 11px; color: #6b7180; margin-top: 2px; }

/* main */
.main { margin-left: var(--sidebar-w); flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 66px; background: rgba(247,248,251,.78); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 44px;
  position: sticky; top: 0; z-index: 40;
}
.crumb { font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 7px; }
.crumb b { color: var(--text); font-weight: 650; }
.crumb .sep { color: var(--border-strong); }
.topbar-spacer { flex: 1; }
.topbar-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--text-2); font-weight: 600;
  padding: 7px 12px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); transition: all .15s;
}
.topbar-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }

.content { padding: 40px 56px 96px; max-width: 1320px; margin: 0 auto; width: 100%; }

/* ============================ PAGES ======================================= */
.page { display: none; animation: fade .35s ease; }
.page.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page-head { margin-bottom: 28px; }
.page-head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.page-head-main { min-width: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; flex: 0 0 auto; }
.page-title { font-size: 24px; font-weight: 770; letter-spacing: -.6px; }
.page-desc { color: var(--text-2); font-size: 13.5px; margin-top: 7px; line-height: 1.6; }

/* ---------- HERO / HOME ---------- */
.hero {
  background: var(--grad); border-radius: var(--r-xl); padding: 46px 46px 50px;
  color: #fff; position: relative; overflow: hidden; box-shadow: var(--shadow-lg);
}
.hero::after {
  content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(255,255,255,.22), transparent 65%);
}
.hero::before {
  content: ""; position: absolute; left: 30%; bottom: -120px; width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(63,140,255,.4), transparent 60%);
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.22);
  padding: 5px 12px; border-radius: 30px; backdrop-filter: blur(6px);
}
.hero h1 { font-size: 29px; font-weight: 800; letter-spacing: -.7px; margin: 16px 0 12px; line-height: 1.3; position: relative; }
.hero p { font-size: 14px; color: rgba(255,255,255,.85); max-width: 600px; position: relative; line-height: 1.65; }

/* search panel */
.search-panel {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  border: 1px solid var(--border); padding: 26px 28px; margin-top: -40px; position: relative; z-index: 5;
  margin-left: 16px; margin-right: 16px;
}
.search-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1.4fr auto; gap: 16px; align-items: end; }
.field label { display: block; font-size: 11.5px; font-weight: 650; color: var(--text-2); margin-bottom: 6px; }
.field select, .field input {
  width: 100%; height: 42px; border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 0 12px; font-size: 13.5px; color: var(--text); background: var(--surface);
  font-family: inherit; transition: all .15s; outline: none;
}
.field input::placeholder { color: var(--text-3); }
.field select:focus, .field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91,84,240,.13); }
.btn-search {
  height: 42px; padding: 0 22px; border-radius: 10px; background: var(--grad); color: #fff;
  font-weight: 700; font-size: 13.5px; display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 12px rgba(91,84,240,.4); transition: transform .12s, box-shadow .12s; white-space: nowrap;
}
.btn-search:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(91,84,240,.5); }
.btn-search:active { transform: translateY(0); }

.section-label { font-size: 13px; font-weight: 720; color: var(--text-2); margin: 48px 0 18px; display: flex; align-items: center; gap: 9px; }
.section-label::before { content:""; width: 4px; height: 15px; background: var(--primary); border-radius: 4px; }

/* preset cards */
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.preset-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 26px 24px; text-align: left; transition: all .18s cubic-bezier(.2,.7,.3,1); position: relative; overflow: hidden;
}
.preset-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.preset-card .pc-ico { font-size: 26px; }
.preset-card .pc-persona { font-size: 11px; color: var(--primary); font-weight: 700; margin-top: 12px; background: var(--primary-soft); display: inline-block; padding: 3px 9px; border-radius: 20px; }
.preset-card .pc-title { font-size: 16px; font-weight: 730; margin-top: 12px; letter-spacing: -.3px; }
.preset-card .pc-desc { font-size: 12.5px; color: var(--text-2); margin-top: 6px; line-height: 1.5; }
.preset-card .pc-go { margin-top: 14px; font-size: 12.5px; font-weight: 650; color: var(--primary); display: inline-flex; align-items: center; gap: 5px; }
.preset-card:hover .pc-go { gap: 9px; }

/* feature strip */
.feat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-top: 12px; }
.feat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; }
.feat .fn { font-size: 12.5px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.feat .fd { font-size: 11.5px; color: var(--text-2); margin-top: 6px; line-height: 1.5; }
.feat .fi { width: 30px; height: 30px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin-bottom: 10px; }

/* ---------- SEARCH RESULTS ---------- */
.result-summary {
  display: flex; align-items: center; gap: 12px; background: var(--grad-soft);
  border: 1px solid var(--border); border-radius: var(--r); padding: 14px 18px; margin-bottom: 18px; flex-wrap: wrap;
}
.chip { font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-2); }
.chip b { color: var(--primary); }

.proj-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 24px 26px; margin-bottom: 16px; transition: all .18s cubic-bezier(.2,.7,.3,1); cursor: pointer;
  display: flex; gap: 26px; align-items: center;
}
.proj-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.sim-ring { flex: 0 0 76px; display: flex; flex-direction: column; align-items: center; }
.sim-ring .pct { font-size: 21px; font-weight: 800; letter-spacing: -.5px; }
.sim-ring .lbl { font-size: 10px; color: var(--text-3); font-weight: 600; }
.ring-svg { transform: rotate(-90deg); }
.proj-body { flex: 1; min-width: 0; }
.proj-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 7px; }
.tag { font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.tag.code { font-family: 'SF Mono', ui-monospace, monospace; color: var(--primary-ink); background: var(--primary-soft); border-color: transparent; font-size: 10.5px; }
.proj-name { font-size: 16px; font-weight: 720; letter-spacing: -.3px; }
.proj-sum { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.proj-stats { display: flex; gap: 18px; margin-top: 11px; }
.proj-stats .st { font-size: 11.5px; color: var(--text-3); }
.proj-stats .st b { color: var(--text); font-weight: 650; font-size: 12.5px; }
.proj-risk-mini { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 11px; }
.proj-go { flex: 0 0 auto; color: var(--text-3); }

/* risk badges */
.rbadge { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px; }
.rbadge.high { background: var(--danger-soft); color: var(--danger); }
.rbadge.medium { background: var(--warn-soft); color: #b87514; }
.rbadge.low { background: var(--ok-soft); color: var(--ok); }

/* ---------- RISK ANALYSIS ---------- */
.analysis-grid { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
@media (max-width: 1000px){ .analysis-grid { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.card-head { padding: 18px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.card-head h3 { font-size: 15px; font-weight: 730; margin: 0; }
.card-head .ch-sub { font-size: 12px; color: var(--text-3); margin-left: auto; }
.card-body { padding: 22px 24px; }

.score-card { background: var(--bg-sidebar); color: #fff; border-radius: var(--r-lg); padding: 22px; position: relative; overflow: hidden; }
.score-card::after { content:""; position:absolute; right:-50px; top:-50px; width:180px; height:180px; background: radial-gradient(circle, rgba(123,115,255,.35), transparent 65%); }
.score-card .sc-label { font-size: 12px; color: #9aa0b0; font-weight: 600; }
.score-gauge { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 4px; }
.score-gauge .num { font-size: 38px; font-weight: 840; letter-spacing: -1.2px; }
.score-gauge .den { font-size: 15px; color: #9aa0b0; }
.score-level { font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 20px; display: inline-block; }
.score-bar { height: 8px; border-radius: 20px; background: rgba(255,255,255,.12); margin-top: 16px; overflow: hidden; }
.score-bar > span { display: block; height: 100%; border-radius: 20px; background: linear-gradient(90deg,#f5a623,#e5484d); }
.score-breakdown { margin-top: 18px; display: flex; flex-direction: column; gap: 9px; }
.sb-row { display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: #c3c8d4; }
.sb-row .sb-bar { flex: 1; height: 5px; background: rgba(255,255,255,.1); border-radius: 10px; overflow: hidden; }
.sb-row .sb-bar > span { display: block; height: 100%; background: var(--primary-2); border-radius: 10px; }
.sb-row .sb-val { width: 30px; text-align: right; color: #fff; font-weight: 650; }

/* indicators table */
.ind-table { width: 100%; border-collapse: collapse; }
.ind-table th { font-size: 11px; color: var(--text-3); font-weight: 650; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: .3px; }
.ind-table td { padding: 12px 10px; border-bottom: 1px solid var(--border); font-size: 12.5px; vertical-align: middle; }
.ind-table tr:last-child td { border-bottom: none; }
.ind-name { font-weight: 600; color: var(--text); }
.ind-domain { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.val { font-family: 'SF Mono', ui-monospace, monospace; font-size: 12.5px; }
.val.miss { color: var(--danger); font-weight: 700; }
.val.miss::before { content: "결측"; }
.val.qual { color: var(--warn); }
.achv { font-weight: 750; font-size: 13px; }
.achv.bad { color: var(--danger); }
.achv.mid { color: var(--warn); }
.achv.good { color: var(--ok); }
.achv.na { color: var(--text-3); font-weight: 600; }

/* risk tag list */
.risk-list { display: flex; flex-direction: column; gap: 10px; }
.risk-item { display: flex; gap: 12px; padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--r); transition: all .15s; }
.risk-item:hover { border-color: var(--border-strong); background: var(--surface-2); }
.risk-item.high { border-left: 3px solid var(--danger); }
.risk-item.medium { border-left: 3px solid var(--warn); }
.ri-code { font-family: 'SF Mono', ui-monospace, monospace; font-weight: 800; font-size: 13px; flex: 0 0 36px; }
.ri-code.high { color: var(--danger); }
.ri-code.medium { color: var(--warn); }
.ri-main .ri-name { font-weight: 700; font-size: 13px; }
.ri-main .ri-desc { font-size: 12px; color: var(--text-2); margin-top: 3px; line-height: 1.5; }
.ri-main .ri-src { font-size: 10.5px; color: var(--text-3); margin-top: 6px; }
.ri-main .ri-src b { color: var(--accent); }

/* country trend box */
.trend-box { background: var(--warn-soft); border: 1px solid #f0dcb4; border-radius: var(--r); padding: 14px 16px; }
.trend-box .tb-h { font-size: 12px; font-weight: 700; color: #b87514; display: flex; align-items: center; gap: 7px; }
.trend-box .tb-t { font-size: 13px; font-weight: 650; margin-top: 8px; }
.trend-box .tb-n { font-size: 12px; color: var(--text-2); margin-top: 5px; line-height: 1.5; }
.trend-box .tb-meta { font-size: 10.5px; color: var(--text-3); margin-top: 8px; }

.flow-cta { display: flex; justify-content: flex-end; margin-top: 22px; }
.btn-primary {
  height: 44px; padding: 0 24px; border-radius: 11px; background: var(--grad); color: #fff;
  font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 9px;
  box-shadow: 0 5px 16px rgba(91,84,240,.4); transition: transform .12s, box-shadow .12s;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 9px 24px rgba(91,84,240,.5); }
.btn-ghost { height: 44px; padding: 0 20px; border-radius: 11px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-weight: 650; font-size: 13.5px; display: inline-flex; align-items: center; gap: 8px; transition: all .15s; }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--text-3); }
.btn-small { height: 36px; padding: 0 13px; border-radius: 9px; font-size: 12.5px; white-space: nowrap; }

/* ---------- CHECKLIST ---------- */
.check-intro { background: var(--accent-soft); border: 1px solid #b9ece5; border-radius: var(--r-lg); padding: 18px 22px; margin-bottom: 22px; display: flex; gap: 16px; align-items: center; }
.check-intro .ci-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--accent); color: #fff; display: grid; place-items: center; flex: 0 0 44px; }
.check-intro .ci-t { font-size: 15px; font-weight: 730; }
.check-intro .ci-d { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }

.check-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  margin-bottom: 16px; overflow: hidden; box-shadow: var(--shadow-sm); transition: all .15s;
}
.check-card:hover { box-shadow: var(--shadow); }
.cc-top { display: flex; gap: 14px; padding: 18px 20px; align-items: flex-start; }
.cc-check {
  width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--border-strong);
  flex: 0 0 24px; margin-top: 1px; display: grid; place-items: center; transition: all .15s; cursor: pointer; color: transparent;
}
.cc-check.done { background: var(--accent); border-color: var(--accent); color: #fff; }
.cc-content { flex: 1; }
.cc-tags { display: flex; gap: 6px; margin-bottom: 9px; flex-wrap: wrap; }
.cc-problem { font-size: 11.5px; color: var(--danger); font-weight: 650; display: flex; align-items: center; gap: 6px; }
.cc-action { font-size: 15px; font-weight: 720; margin: 7px 0 0; letter-spacing: -.3px; line-height: 1.45; }
.cc-detail { font-size: 13px; color: var(--text-2); margin-top: 7px; line-height: 1.6; }
.cc-evidence { background: var(--surface-2); border-top: 1px solid var(--border); padding: 13px 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cc-evidence .ev-lbl { font-size: 11px; font-weight: 700; color: var(--text-3); }
.ev-link { font-size: 11.5px; color: var(--primary); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; background: var(--primary-soft); border-radius: 7px; transition: all .15s; }
.ev-link:hover { background: #e2e0fd; }
.ev-link .ev-ico { width: 13px; height: 13px; }
.ev-src { font-size: 11px; color: var(--text-3); font-family: 'SF Mono', ui-monospace, monospace; }

.export-bar { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-top: 26px; padding: 18px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }
.export-bar .eb-info { font-size: 12.5px; color: var(--text-2); }
.export-bar .eb-info b { color: var(--text); }

/* ---------- DATA STATUS ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 26px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.stat-card .sc-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 12px; }
.stat-card .sc-num { font-size: 28px; font-weight: 820; letter-spacing: -1px; }
.stat-card .sc-lbl { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.stat-card .sc-trend { font-size: 11px; font-weight: 650; margin-top: 7px; }

.ds-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.ds-table th { font-size: 11px; color: var(--text-3); font-weight: 700; text-align: left; padding: 13px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); text-transform: uppercase; letter-spacing: .3px; }
.ds-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.ds-table tr:last-child td { border-bottom: none; }
.ds-table tr:hover td { background: var(--surface-2); }
.tier-badge { font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: 6px; }
.tier-badge.core { background: var(--primary-soft); color: var(--primary-ink); }
.tier-badge.ext { background: var(--accent-soft); color: #0a8478; }
.ds-name { font-weight: 650; }
.ds-role { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.mini-bar { width: 70px; height: 6px; background: var(--surface-3); border-radius: 10px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 8px; }
.mini-bar > span { display: block; height: 100%; border-radius: 10px; }
.dot-ok { color: var(--ok); font-weight: 700; }
.dot-warn { color: var(--warn); font-weight: 700; }

/* ---------- modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(16,18,31,.5); backdrop-filter: blur(3px); z-index: 100; display: none; align-items: center; justify-content: center; padding: 24px; animation: fade .2s; }
.modal-overlay.open { display: flex; }
.modal { background: var(--surface); border-radius: var(--r-xl); width: 100%; max-width: 560px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .25s; }
@keyframes pop { from { transform: scale(.96) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.modal-head h3 { font-size: 16px; font-weight: 740; margin: 0; }
.modal-head .close { margin-left: auto; color: var(--text-3); font-size: 20px; line-height: 1; }
.modal-body { padding: 22px 24px; }
.modal-body .mb-row { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.modal-body .mb-row:last-child { border-bottom: none; }
.modal-body .mb-row .k { color: var(--text-3); }
.modal-body .mb-row .v { font-weight: 600; text-align: right; }
.modal-body .mb-row .v a { color: var(--primary); }

/* loading overlay — pipeline log */
.loader { position: fixed; inset: 0; background: rgba(16,18,31,.34); backdrop-filter: blur(5px); z-index: 90; display: none; align-items: center; justify-content: center; padding: 24px; }
.loader.show { display: flex; animation: fade .2s; }
.spinner { width: 46px; height: 46px; border: 4px solid var(--surface-3); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
.spinner.sm { width: 22px; height: 22px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.loader-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--shadow-lg); width: 100%; max-width: 500px; overflow: hidden; animation: pop .25s; }
.loader-head { display: flex; align-items: center; gap: 13px; padding: 20px 22px 16px; border-bottom: 1px solid var(--border); }
.loader-head .lh-title { font-size: 15px; font-weight: 740; letter-spacing: -.3px; }
.loader-head .lh-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.loader-head .lh-pct { margin-left: auto; font-size: 15px; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }
.loader-cancel { font-size: 12px; font-weight: 650; color: var(--text-2); border: 1px solid var(--border-strong); background: var(--surface); padding: 6px 13px; border-radius: 8px; transition: all .14s; }
.loader-cancel:hover { background: var(--danger-soft); color: var(--danger); border-color: #f2c9ca; }

.loader-log { padding: 12px 22px 16px; display: flex; flex-direction: column; gap: 3px; max-height: 340px; overflow-y: auto; }
.log-line { display: flex; align-items: flex-start; gap: 11px; padding: 6px 0; font-size: 12.5px; color: var(--text); animation: logIn .26s ease; }
@keyframes logIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.log-line .ll-ico { flex: 0 0 18px; height: 18px; display: grid; place-items: center; color: var(--ok); margin-top: 1px; }
.log-line .ll-spin { width: 13px; height: 13px; border: 2px solid var(--surface-3); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
.log-line .ll-main { flex: 1; min-width: 0; }
.log-line .ll-head { display: flex; align-items: baseline; gap: 8px; }
.log-line .ll-txt { flex: 1; }
.log-line.active .ll-txt { color: var(--text); font-weight: 650; }
.log-line.active::after { content: ""; }
.log-line.done { color: var(--text-2); }
.log-line.done .ll-txt { font-weight: 500; }
.log-line .ll-sub { color: var(--text-3); font-size: 11px; font-family: 'SF Mono', ui-monospace, monospace; }
.log-line .ll-time { font-size: 10.5px; color: var(--text-3); font-variant-numeric: tabular-nums; flex: 0 0 auto; opacity: .8; }
.log-line.final.done { color: var(--ok); font-weight: 700; }
.log-line.final .ll-sub { color: var(--ok); }
.log-line .retry { color: var(--warn); font-family: inherit; animation: pulse 1s ease infinite; }
@keyframes pulse { 50% { opacity: .5; } }

/* count sub-progress */
.sub-prog { display: flex; align-items: center; gap: 9px; margin-top: 7px; }
.sub-bar { flex: 1; height: 5px; background: var(--surface-3); border-radius: 10px; overflow: hidden; }
.sub-bar > span { display: block; height: 100%; width: 0; background: var(--primary-2); border-radius: 10px; }
.sub-num { font-size: 10.5px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; font-family: 'SF Mono', ui-monospace, monospace; min-width: 72px; text-align: right; }
.sub-thr { font-size: 10px; color: var(--accent); font-family: 'SF Mono', ui-monospace, monospace; min-width: 78px; }

/* stream matches */
.stream-list { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.stream-item { display: flex; align-items: center; gap: 8px; font-size: 11.5px; padding: 5px 9px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; animation: streamIn .3s ease; }
@keyframes streamIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.stream-item .si-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); flex: 0 0 6px; }
.stream-item .si-name { flex: 1; color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stream-item .si-score { color: var(--text-3); font-size: 10.5px; font-family: 'SF Mono', ui-monospace, monospace; }
.stream-item .si-score b { color: var(--primary); }

.loader-progress { height: 4px; background: var(--surface-3); }
.loader-progress > span { display: block; height: 100%; width: 0; background: var(--grad); transition: width .4s cubic-bezier(.3,.7,.3,1); }

/* empty state */
.empty { text-align: center; padding: 70px 20px; color: var(--text-3); }
.empty .e-ico { font-size: 40px; opacity: .5; }
.empty .e-t { font-size: 15px; font-weight: 650; color: var(--text-2); margin-top: 12px; }
.empty .e-d { font-size: 13px; margin-top: 6px; }

/* badge inline */
.gradebadge { font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 6px; }
.grade-good { background: var(--ok-soft); color: var(--ok); }
.grade-mid { background: var(--warn-soft); color: #b87514; }
.grade-bad { background: var(--danger-soft); color: var(--danger); }

.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--bg-sidebar); color: #fff; padding: 12px 20px; border-radius: 12px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg); z-index: 120; opacity: 0; transition: all .3s; display: flex; align-items: center; gap: 9px; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* data provenance */
.src-chip { background: var(--accent-soft) !important; color: #0a8478 !important; border-color: #bfeae4 !important; font-weight: 700; }
.prov-note { margin-top: 16px; padding-top: 13px; border-top: 1px dashed var(--border); font-size: 11px; color: var(--text-3); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.prov-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 1px; }
.prov-dot.real { background: var(--accent); }
.prov-dot.est { background: var(--warn); margin-left: 16px; }

/* more air in dense tables/lists */
.ind-table th { padding: 10px 12px; }
.ind-table td { padding: 15px 12px; }
.risk-item { padding: 15px 16px; }
.cc-top { padding: 22px 24px; }
.preset-grid + .section-label { margin-top: 52px; }

@media (max-width: 1100px) {
  .content { padding: 32px 28px 80px; }
}
@media (max-width: 920px) {
  .sidebar { transform: translateX(-100%); }
  .main { margin-left: 0; }
  .content { padding: 24px 18px 70px; }
  .search-grid, .preset-grid, .feat-grid, .stat-grid { grid-template-columns: 1fr; }
  .page-head-row { flex-direction: column; align-items: stretch; }
  .page-actions { justify-content: flex-start; }
}
