/* ============================================================
   T1 Process Training — design tokens
   ============================================================ */
:root {
  color-scheme: dark;
  --bg:            #060b14;
  --bg-grad-a:     #081226;
  --bg-grad-b:     #050910;
  --surface-1:     #0f1b2d;
  --surface-2:     #13233a;
  --surface-3:     #182b45;
  --border:        rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.16);
  --text-primary:  #f4f7fb;
  --text-secondary:#aab6c9;
  --text-muted:    #7c8aa0;

  --series-1: #3987e5; /* blue   — stringer */
  --series-2: #d95926; /* orange — backend  */
  --series-3: #199e70; /* aqua   — layup    */

  --status-good:     #0ca30c;
  --status-warning:  #fab219;
  --status-serious:  #ec835a;
  --status-critical: #d03b3b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 1px 0 rgba(255,255,255,0.04) inset, 0 10px 30px -18px rgba(0,0,0,0.7);
  --shadow-pop: 0 24px 60px -20px rgba(0,0,0,0.75);
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 620px at 82% -10%, rgba(57,135,229,0.16), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(25,158,112,0.10), transparent 55%),
    linear-gradient(180deg, var(--bg-grad-a), var(--bg-grad-b) 55%, var(--bg) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: proportional-nums;
}
h1,h2,h3,h4 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
p { margin: 0; }
button { font-family: inherit; }
a { color: inherit; }
::selection { background: rgba(57,135,229,0.35); }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--series-1); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(6,11,20,0.78);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1240px; margin: 0 auto;
  display: flex; align-items: center; gap: 20px;
  padding: 12px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; background: none; border: none; cursor: pointer; padding: 4px; border-radius: 10px; }
.brand:hover { background: rgba(255,255,255,0.04); }
.brand-mark svg { width: 28px; height: 28px; display: block; }
.brand-mark .mark-a { fill: var(--series-1); }
.brand-mark .mark-b { fill: var(--series-3); }
.brand-name { font-size: 15.5px; color: var(--text-secondary); white-space: nowrap; }
.brand-name b { color: var(--text-primary); font-weight: 700; }

.header-search {
  flex: 1; max-width: 480px; display: flex; align-items: center; gap: 8px;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 999px;
  padding: 9px 14px; transition: border-color .15s, background .15s;
}
.header-search:focus-within { border-color: var(--series-1); background: var(--surface-2); }
.header-search .search-icon { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.header-search input { flex: 1; background: none; border: none; outline: none; color: var(--text-primary); font-size: 14px; min-width: 0; }
.header-search input::placeholder { color: var(--text-muted); }
.header-search kbd { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); border: 1px solid var(--border-strong); border-radius: 5px; padding: 1px 6px; }

.header-nav { display: flex; gap: 4px; flex-shrink: 0; }
.header-nav.mobile { display: none; padding: 8px 16px 12px; border-top: 1px solid var(--border); }
.nav-btn {
  display: flex; align-items: center; gap: 7px;
  background: none; border: 1px solid transparent; color: var(--text-secondary);
  font-size: 13.5px; font-weight: 600; padding: 9px 13px; border-radius: 999px; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.nav-btn svg { width: 16px; height: 16px; }
.nav-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.nav-btn.is-active { color: #fff; background: var(--surface-3); border-color: var(--border-strong); }
.menu-toggle { display: none; background: var(--surface-1); border: 1px solid var(--border); color: var(--text-primary); width: 38px; height: 38px; border-radius: 10px; align-items: center; justify-content: center; cursor: pointer; }
.menu-toggle svg { width: 18px; height: 18px; }

@media (max-width: 900px) {
  .header-nav:not(.mobile) { display: none; }
  .menu-toggle { display: flex; }
  .header-nav.mobile.is-open { display: flex; flex-direction: column; }
  .header-nav.mobile .nav-btn { justify-content: flex-start; width: 100%; }
}
@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; }
  .header-search { order: 3; max-width: none; width: 100%; }
  .brand-name small { display: none; }
}

/* ============================================================
   Layout / main
   ============================================================ */
main { max-width: 1240px; margin: 0 auto; padding: 32px 24px 80px; }
.view-head { max-width: 720px; margin-bottom: 28px; }
.view-head h2 { font-size: clamp(24px, 3vw, 32px); margin: 8px 0 10px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 11.5px; font-weight: 700; color: var(--series-1); margin: 0; }
.lede { color: var(--text-secondary); font-size: 15.5px; line-height: 1.6; }
.muted-note { color: var(--text-muted); font-size: 12.5px; }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.5fr 1fr; gap: 28px;
  padding: 40px 8px 36px; align-items: center;
}
.hero h1 { font-size: clamp(32px, 4.4vw, 50px); line-height: 1.08; margin: 10px 0 14px; }
.hero-actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.hero-stat-col { display: flex; flex-direction: column; gap: 14px; }
.stat-card {
  background: linear-gradient(160deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px 22px; box-shadow: var(--shadow-card);
}
.stat-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); font-weight: 700; }
.stat-value { font-size: 26px; font-weight: 800; margin: 6px 0 2px; font-family: var(--font-mono); letter-spacing: -0.01em; }
.stat-sub { font-size: 12.5px; color: var(--text-muted); }
.progress-track { height: 6px; border-radius: 4px; background: rgba(255,255,255,0.08); margin-top: 10px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--series-3), var(--series-1)); width: 0%; transition: width .4s ease; border-radius: 4px; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 20px; }
  .hero-stat-col { flex-direction: row; }
  .stat-card { flex: 1; }
}
@media (max-width: 560px) {
  .hero-stat-col { flex-direction: column; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font-weight: 650; font-size: 14px; padding: 11px 20px; border-radius: 999px;
  border: 1px solid transparent; cursor: pointer; transition: transform .12s, background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--series-1), #2a6fc4); color: #fff; box-shadow: 0 10px 26px -12px rgba(57,135,229,0.65); }
.btn-primary:hover { box-shadow: 0 14px 30px -12px rgba(57,135,229,0.8); }
.btn-ghost { background: var(--surface-2); border-color: var(--border-strong); color: var(--text-primary); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-sm { padding: 7px 14px; font-size: 12.5px; }
.btn.is-active { background: var(--series-1); border-color: var(--series-1); color: #fff; }

/* ---------- Area chips ---------- */
.area-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 8px 26px; }
.chip {
  background: var(--surface-1); border: 1px solid var(--border); color: var(--text-secondary);
  font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: 999px; cursor: pointer;
  transition: all .15s;
}
.chip:hover { border-color: var(--border-strong); color: var(--text-primary); }
.chip.is-active { background: var(--series-1); border-color: var(--series-1); color: #fff; }

/* ---------- Flow diagram (home strip) ---------- */
.flow-wrap { margin: 0 8px 30px; overflow-x: auto; padding-bottom: 4px; }
.flow-diagram { display: flex; align-items: center; gap: 0; min-width: 620px; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 22px; box-shadow: var(--shadow-card); }
.flow-node { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; background: none; transition: background .15s, border-color .15s; flex-shrink: 0; }
.flow-node:hover { background: var(--surface-2); border-color: var(--border); }
.flow-node .node-badge { width: 54px; height: 54px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-family: var(--font-mono); font-size: 13px; background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text-secondary); }
.flow-node.is-module .node-badge, .flow-node.is-endcap .node-badge { background: linear-gradient(135deg, var(--series-3), #0e6c4d); color: #fff; border-color: transparent; }
.flow-node .node-label { font-size: 13px; font-weight: 700; }
.flow-node .node-sub { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.flow-connector { flex: 1; min-width: 26px; height: 3px; background: repeating-linear-gradient(90deg, var(--series-1) 0 6px, transparent 6px 11px); border-radius: 2px; margin: 0 2px; }

/* ---------- Process cards (home) ---------- */
.process-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 0 8px 44px; }
@media (max-width: 900px) { .process-cards { grid-template-columns: 1fr; } }
.process-card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px 22px 20px; box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 14px;
  position: relative; overflow: hidden;
}
.process-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--card-accent, var(--series-1)); }
.process-card[data-process="stringer"] { --card-accent: var(--series-1); }
.process-card[data-process="layup"] { --card-accent: var(--series-3); }
.process-card[data-process="backend"] { --card-accent: var(--series-2); }
.process-card-head { display: flex; justify-content: space-between; align-items: flex-start; }
.process-card-head .num { font-family: var(--font-mono); font-size: 22px; color: var(--text-muted); font-weight: 700; }
.process-card h3 { font-size: 20px; }
.process-card p.desc { color: var(--text-secondary); font-size: 13.5px; line-height: 1.55; }
.station-pill-row { display: flex; flex-wrap: wrap; gap: 6px; }
.station-pill { font-size: 11.5px; font-weight: 600; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-secondary); cursor: pointer; }
.station-pill:hover { color: var(--text-primary); border-color: var(--border-strong); }
.process-card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 6px; font-size: 12.5px; color: var(--text-muted); }
.process-card-foot .link { color: var(--card-accent, var(--series-1)); font-weight: 700; cursor: pointer; background: none; border: none; font-size: 12.5px; }
.process-card-foot .link:hover { text-decoration: underline; }

/* ---------- Fast access / filters ---------- */
.fast-access { margin: 0 8px; }
.fast-access-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-row select {
  background: var(--surface-1); border: 1px solid var(--border); color: var(--text-secondary);
  font-size: 12.5px; font-weight: 600; padding: 8px 12px; border-radius: 999px; cursor: pointer;
}
.result-count { color: var(--text-muted); font-size: 12.5px; margin: 10px 0 16px; }

.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.lesson-card {
  text-align: left; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 18px 18px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 10px;
  transition: border-color .15s, transform .15s, background .15s;
}
.lesson-card:hover { border-color: var(--border-strong); background: var(--surface-2); transform: translateY(-2px); }
.lesson-card-tags { display: flex; justify-content: space-between; align-items: center; }
.tag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 3px 9px; border-radius: 999px; }
.tag-type { background: rgba(57,135,229,0.15); color: #7db3f5; }
.tag-level { color: var(--text-muted); font-weight: 700; }
.lesson-card h4 { font-size: 15.5px; line-height: 1.35; }
.lesson-card p.summary { font-size: 13px; color: var(--text-secondary); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lesson-card-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-muted); margin-top: auto; padding-top: 4px; }
.lesson-card-foot .station-tag { font-weight: 600; color: var(--text-secondary); }
.lesson-card-foot .open-arrow { color: var(--series-1); font-weight: 700; }
.lesson-card.is-reviewed { border-color: rgba(25,158,112,0.45); }
.reviewed-check { display: inline-flex; align-items: center; gap: 4px; color: var(--status-good); font-size: 11px; font-weight: 700; }
.empty-state { text-align: center; color: var(--text-muted); padding: 60px 20px; font-size: 14px; }

/* ============================================================
   Process line view
   ============================================================ */
.line-stage-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.stage-tab {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 12px 18px; cursor: pointer;
  color: var(--text-secondary); text-align: left; min-width: 160px; transition: all .15s;
}
.stage-tab b { display: block; color: var(--text-primary); font-size: 14.5px; }
.stage-tab small { font-size: 11.5px; color: var(--text-muted); }
.stage-tab.is-active { border-color: var(--stage-accent, var(--series-1)); background: var(--surface-2); box-shadow: 0 0 0 1px var(--stage-accent, var(--series-1)) inset; }
.stage-tab[data-process="stringer"] { --stage-accent: var(--series-1); }
.stage-tab[data-process="layup"] { --stage-accent: var(--series-3); }
.stage-tab[data-process="backend"] { --stage-accent: var(--series-2); }

.line-canvas { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 30px 26px; box-shadow: var(--shadow-card); }
.line-canvas .stage-focus { color: var(--text-secondary); font-size: 13.5px; line-height: 1.6; max-width: 640px; margin-bottom: 26px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.station-rail { display: flex; gap: 18px; overflow-x: auto; padding: 10px 4px 18px; perspective: 1400px; }
.station-node {
  flex-shrink: 0; width: 190px; background: linear-gradient(165deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--border); border-radius: 16px; padding: 18px 16px; cursor: pointer;
  transform: rotateY(0deg); transition: transform .25s ease, border-color .2s, box-shadow .2s;
  transform-style: preserve-3d;
}
.station-node:hover { transform: rotateY(-6deg) translateY(-4px) scale(1.02); border-color: var(--border-strong); box-shadow: var(--shadow-pop); }
.station-node .idx { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.station-node .short { font-family: var(--font-mono); font-size: 20px; font-weight: 800; margin: 6px 0 10px; color: var(--stage-accent, var(--series-1)); }
.station-node .name { font-size: 14.5px; font-weight: 700; margin-bottom: 6px; }
.station-node .risk { font-size: 11.5px; color: var(--text-muted); }
.station-node .risk b { color: var(--status-warning); font-weight: 700; }

/* ============================================================
   Trends view
   ============================================================ */
.trends-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; margin-bottom: 30px; }
@media (max-width: 900px) { .trends-grid { grid-template-columns: 1fr; } }
.chart-card, .coverage-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow-card); }
.chart-card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; flex-wrap: wrap; gap: 6px; }
.chart-card-head h3, .coverage-card h3 { font-size: 15.5px; }

.coverage-row { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.coverage-item .coverage-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.coverage-item .coverage-label b { color: var(--text-primary); }
.coverage-item .coverage-label span { color: var(--text-muted); font-family: var(--font-mono); font-size: 12px; }
.coverage-bar-track { height: 8px; border-radius: 5px; background: rgba(255,255,255,0.07); overflow: hidden; }
.coverage-bar-fill { height: 100%; border-radius: 5px; }

.case-examples h3 { font-size: 15.5px; margin-bottom: 14px; }
.case-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.case-card { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; box-shadow: var(--shadow-card); }
.case-card .case-count { font-family: var(--font-mono); font-size: 28px; font-weight: 800; color: var(--series-2); }
.case-card .case-label { font-size: 14px; font-weight: 700; margin: 4px 0 6px; }
.case-card .case-context { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }

/* --- svg line chart --- */
.viz-root { color-scheme: dark; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.chart-svg-wrap { position: relative; }
.chart-tooltip {
  position: absolute; pointer-events: none; background: var(--surface-3); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 10px 12px; font-size: 12px; box-shadow: var(--shadow-pop); opacity: 0; transition: opacity .1s;
  transform: translate(-50%, -110%); white-space: nowrap; z-index: 5;
}
.chart-tooltip.is-visible { opacity: 1; }
.chart-tooltip .tt-week { color: var(--text-muted); font-family: var(--font-mono); font-size: 10.5px; margin-bottom: 4px; }
.chart-tooltip .tt-row { display: flex; align-items: center; gap: 6px; }

/* ============================================================
   Modals
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(4,7,13,0.72); backdrop-filter: blur(3px);
  display: flex; justify-content: flex-end; z-index: 100;
  animation: fade-in .15s ease;
}
.modal-backdrop[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--surface-1); border-left: 1px solid var(--border-strong); height: 100%; width: min(520px, 100%);
  overflow-y: auto; padding: 30px 28px 60px; position: relative;
  animation: slide-in .2s ease;
  box-shadow: var(--shadow-pop);
}
@keyframes slide-in { from { transform: translateX(24px); opacity: .6; } to { transform: translateX(0); opacity: 1; } }
.modal-close {
  position: absolute; top: 22px; right: 22px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-secondary); cursor: pointer; font-size: 14px;
}
.modal-close:hover { background: var(--surface-3); color: var(--text-primary); }

/* lesson modal content */
.lm-eyebrow-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.lm-title { font-size: 24px; line-height: 1.25; margin: 8px 0 10px; padding-right: 34px; }
.lm-summary { color: var(--text-secondary); font-size: 14.5px; line-height: 1.6; margin-bottom: 18px; }
.lm-meta-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.lm-meta-pill { font-size: 11.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-secondary); }
.lm-review-btn { display: flex; align-items: center; gap: 8px; width: 100%; justify-content: center; margin-bottom: 24px; }
.lm-section { margin-bottom: 22px; }
.lm-section h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.lm-section h4 .dot { width: 7px; height: 7px; border-radius: 50%; }
.lm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lm-list li { font-size: 13.5px; line-height: 1.55; color: var(--text-primary); padding-left: 18px; position: relative; }
.lm-list li::before { content: ""; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); }
.lm-section.symptoms h4 .dot { background: var(--status-warning); }
.lm-section.causes h4 .dot { background: var(--status-critical); }
.lm-section.checks h4 .dot { background: var(--series-1); }
.lm-section.actions h4 .dot { background: var(--status-good); }
.lm-verify { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; font-size: 13.5px; color: var(--text-primary); }
.lm-caution { background: rgba(250,178,25,0.09); border: 1px solid rgba(250,178,25,0.35); border-radius: 12px; padding: 14px 16px; font-size: 13px; color: #f5d488; line-height: 1.55; display: flex; gap: 10px; }
.lm-related { display: flex; flex-direction: column; gap: 8px; }
.lm-related-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.lm-related-item:hover { border-color: var(--border-strong); }
.lm-related-item small { color: var(--text-muted); display: block; margin-top: 2px; }

/* station modal content */
.sm-eyebrow { color: var(--series-1); }
.sm-title { font-size: 26px; margin: 8px 0 8px; padding-right: 34px; }
.sm-sub { color: var(--text-secondary); font-size: 14px; margin-bottom: 18px; }
.sm-pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.sm-section { margin-bottom: 22px; }
.sm-section h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 10px; }
.sm-focus { font-size: 14px; line-height: 1.6; }

/* ============================================================
   Assistant widget
   ============================================================ */
.assistant { position: fixed; right: 22px; bottom: 22px; z-index: 90; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.assistant-launcher {
  display: flex; align-items: center; gap: 10px; background: linear-gradient(135deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 8px 16px 8px 8px; cursor: pointer;
  box-shadow: var(--shadow-pop); color: var(--text-primary);
}
.assistant-avatar { position: relative; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-3); display: flex; align-items: center; justify-content: center; color: var(--series-3); }
.assistant-avatar svg { width: 18px; height: 18px; }
.assistant-dot { position: absolute; bottom: -1px; right: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--status-good); border: 2px solid var(--surface-1); }
.assistant-launcher-text { display: flex; flex-direction: column; text-align: left; line-height: 1.25; }
.assistant-launcher-text b { font-size: 13.5px; }
.assistant-launcher-text small { font-size: 11px; color: var(--text-muted); }

.assistant-panel {
  width: min(370px, 88vw); max-height: min(560px, 70vh); background: var(--surface-1); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; overflow: hidden;
  animation: pop-in .16s ease;
}
.assistant-panel[hidden] { display: none; }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.assistant-panel-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 16px 14px; border-bottom: 1px solid var(--border); }
.assistant-panel-head b { font-size: 14px; display: block; }
.assistant-panel-head small { font-size: 11px; color: var(--text-muted); }
.assistant-panel-head .modal-close { position: static; width: 28px; height: 28px; font-size: 12px; }
.assistant-body { flex: 1; overflow-y: auto; padding: 14px 16px; }
.assistant-msg { font-size: 13px; color: var(--text-secondary); line-height: 1.55; margin-bottom: 12px; }
.assistant-chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 14px; }
.assistant-chip { font-size: 12px; font-weight: 600; padding: 7px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-secondary); cursor: pointer; }
.assistant-chip:hover { color: var(--text-primary); border-color: var(--border-strong); }
.assistant-results { display: flex; flex-direction: column; gap: 8px; }
.assistant-result-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 13px; cursor: pointer; }
.assistant-result-item:hover { border-color: var(--border-strong); }
.assistant-result-item .ari-title { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.assistant-result-item .ari-meta { font-size: 11px; color: var(--text-muted); }
.assistant-result-item .ari-why { font-size: 11.5px; color: var(--text-secondary); margin-top: 5px; }
.assistant-no-result { font-size: 12.5px; color: var(--text-muted); padding: 6px 2px; }
.assistant-input-row { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.assistant-input-row input { flex: 1; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 10px 14px; color: var(--text-primary); font-size: 13px; outline: none; }
.assistant-input-row input:focus { border-color: var(--series-1); }
.assistant-input-row button { width: 38px; height: 38px; border-radius: 50%; background: var(--series-1); border: none; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.assistant-input-row button svg { width: 16px; height: 16px; }
.assistant-footnote { font-size: 10.5px; color: var(--text-muted); text-align: center; padding: 0 16px 12px; }

@media (max-width: 520px) {
  .assistant { right: 12px; bottom: 12px; left: 12px; align-items: stretch; }
  .assistant-launcher { align-self: flex-end; }
  .assistant-panel { width: 100%; }
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer { max-width: 1240px; margin: 0 auto; padding: 30px 24px 46px; border-top: 1px solid var(--border); }
.footer-disclaimer { font-size: 12px; color: var(--text-muted); line-height: 1.6; max-width: 820px; }
.footer-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 10px; font-family: var(--font-mono); }

/* ============================================================
   Utility
   ============================================================ */
.hidden { display: none !important; }
[data-view-panel] { animation: fade-in .2s ease; }
