:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-2: #f0efe9;
  --surface-3: #e9e8e0;
  --ink: #15181d;
  --muted: #5d6470;
  --faint: #858c96;
  --line: #dcdcd3;
  --accent: #2447cd;
  --accent-2: #123a9e;
  --accent-soft: #e8ecfb;
  --good: #126c5c;
  --good-soft: #e5f2ee;
  --bad: #a72d25;
  --bad-soft: #fbeeec;
  --warn: #8a5a12;
  --warn-soft: #f8f0df;
  --shadow: 0 12px 32px rgba(20, 24, 32, .08);
  --radius: 9px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

html[data-theme="dark"] {
  --bg: #0f1116;
  --surface: #171a21;
  --surface-2: #1d212a;
  --surface-3: #242935;
  --ink: #e9ebf0;
  --muted: #a3aab6;
  --faint: #79818e;
  --line: #2d3340;
  --accent: #8eacff;
  --accent-2: #adc2ff;
  --accent-soft: #1e2b49;
  --good: #6fd3b6;
  --good-soft: #16332d;
  --bad: #ff9d94;
  --bad-soft: #3a201f;
  --warn: #e8bd73;
  --warn-soft: #34291a;
  --shadow: 0 14px 40px rgba(0, 0, 0, .35);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; }
button { cursor: pointer; }
code, pre { font-family: var(--mono); font-size: .86em; }
code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: .08em .35em; }
pre { margin: 0; white-space: pre-wrap; word-break: break-word; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Topbar */
.topbar { position: sticky; top: 0; z-index: 60; height: 64px; display: flex; align-items: center; gap: 18px; padding: 0 26px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg, .search-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.menu-btn { display: none; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; letter-spacing: -.03em; font-size: 17px; flex: 0 0 auto; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 6px; background: var(--ink); color: var(--bg); font-family: var(--mono); font-size: 13px; font-weight: 700; }
.brand-name span { color: var(--faint); font-weight: 500; }
.search-wrap { position: relative; margin-left: auto; width: min(420px, 42vw); display: flex; align-items: center; }
.search-icon { position: absolute; left: 12px; color: var(--faint); pointer-events: none; }
#global-search { width: 100%; height: 38px; padding: 0 62px 0 38px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); outline: none; }
#global-search::placeholder { color: var(--faint); }
#global-search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#global-search::-webkit-search-cancel-button { cursor: pointer; }
.search-kbd { position: absolute; right: 9px; font-family: var(--mono); font-size: 10px; color: var(--faint); border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; background: var(--surface-2); pointer-events: none; }
.search-results { position: absolute; top: calc(100% + 8px); left: 0; right: 0; max-height: 460px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; }
.search-meta { padding: 6px 10px 8px; font-size: 12px; color: var(--faint); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.search-item { display: block; width: 100%; text-align: left; border: 0; border-radius: 6px; padding: 9px 10px; background: transparent; color: var(--ink); }
.search-item:hover, .search-item.is-cursor { background: var(--accent-soft); }
.search-item .si-top { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--faint); }
.search-item strong { display: block; font-size: 13.5px; margin: 2px 0 1px; }
.search-item .si-snippet { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-item mark { background: #ffe08a; color: #20242b; border-radius: 2px; padding: 0 1px; }
html[data-theme="dark"] .search-item mark { background: #7a6120; color: #fff; }
.search-empty { padding: 14px 10px; color: var(--muted); font-size: 13px; }
.moon-icon { display: none; }
html[data-theme="dark"] .sun-icon { display: none; }
html[data-theme="dark"] .moon-icon { display: block; }

/* Shell and sidebar */
.shell { display: grid; grid-template-columns: 246px minmax(0, 1fr); align-items: start; }
.sidebar { position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; border-right: 1px solid var(--line); padding: 28px 18px 22px; background: var(--bg); }
.sidebar-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 10px 16px; }
.eyebrow { font-family: var(--mono); font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--faint); font-weight: 600; }
.eyebrow.accent { color: var(--accent); }
.sidebar-version { font-family: var(--mono); font-size: 10px; color: var(--faint); }
#side-nav { display: grid; gap: 2px; }
#side-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 6px; color: var(--muted); font-size: 13.5px; font-weight: 500; border-left: 2px solid transparent; }
#side-nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
#side-nav a.is-active { background: var(--accent-soft); color: var(--accent); border-left-color: var(--accent); }
.nav-num { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
#side-nav a.is-active .nav-num { color: var(--accent); }
.sidebar-foot { margin-top: 26px; padding: 14px 10px 0; border-top: 1px solid var(--line); }
.sidebar-foot p { margin: 0 0 6px; font-size: 11.5px; color: var(--faint); }
.sidebar-foot kbd { font-family: var(--mono); font-size: 10.5px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 3px 6px; }
.nav-backdrop { display: none; }

/* Content */
.content { min-width: 0; max-width: 1240px; padding: 40px clamp(22px, 4vw, 64px) 60px; margin: 0 auto; }
.section { padding-bottom: 74px; margin-bottom: 62px; border-bottom: 1px solid var(--line); scroll-margin-top: 84px; }
.section:last-of-type { border-bottom: 0; margin-bottom: 20px; }
.section-head { max-width: 760px; margin-bottom: 28px; }
.section-head h2 { font-size: clamp(27px, 3.4vw, 41px); line-height: 1.08; letter-spacing: -.045em; margin: 10px 0 12px; font-weight: 680; }
.lead { color: var(--muted); font-size: 16px; line-height: 1.65; margin: 0; }
h3 { font-size: 17px; letter-spacing: -.02em; margin: 0 0 10px; }
.section-subhead { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 38px 0 16px; }
.section-subhead h3 { margin: 0; font-size: 19px; }
.source-note { font-size: 12.5px; color: var(--faint); margin-top: 18px; }
.small-note { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; }
.count-pill, .hint { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.hint { font-family: var(--sans); font-size: 12.5px; }

/* Hero */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr); gap: 48px; align-items: center; padding: 18px 0 48px; }
h1 { font-size: clamp(46px, 6.6vw, 88px); line-height: .96; letter-spacing: -.06em; margin: 16px 0 22px; font-weight: 700; }
h1 em { font-family: Georgia, "Times New Roman", serif; font-weight: 400; color: var(--accent); letter-spacing: -.04em; }
.hero-lead { font-size: 18px; color: var(--muted); max-width: 570px; line-height: 1.6; margin: 0 0 28px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 6px; font-size: 13.5px; font-weight: 600; border: 1px solid transparent; }
.btn:hover { text-decoration: none; }
.btn.primary { background: var(--ink); color: var(--bg); }
.btn.primary:hover { background: var(--accent); }
.btn.ghost { border-color: var(--line); background: var(--surface); color: var(--ink); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.hero-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 22px; }
.panel-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.panel-key { color: var(--muted); }
.panel-val { font-family: var(--mono); font-size: 12.5px; font-weight: 600; }
.panel-note { margin-top: 16px; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.principle-strip { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.principle-strip > div { padding: 20px 22px 20px 0; }
.principle-strip > div + div { border-left: 1px solid var(--line); padding-left: 22px; }
.strip-num { font-family: var(--mono); font-size: 11px; color: var(--accent); display: block; margin-bottom: 6px; }
.principle-strip strong { display: block; font-size: 14px; margin-bottom: 4px; }
.principle-strip small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* Panels and cards */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; min-width: 0; }
.control-panel { margin-bottom: 8px; }
.control-top { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.control-top h3 { margin-top: 6px; }
.task-chips, .filters, .filter-row { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; line-height: 1.3; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.reco-text { color: var(--muted); margin: 16px 0; max-width: 800px; }
.snippet { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-top: 18px; }
.snippet-inline { margin-top: 14px; }
.snippet-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin-bottom: 10px; }
.copy-btn, .text-btn { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 5px; padding: 3px 9px; font-size: 11px; font-family: var(--sans); text-transform: none; letter-spacing: 0; }
.copy-btn:hover, .text-btn:hover { color: var(--accent); border-color: var(--accent); }
.copy-btn.is-done { color: var(--good); border-color: var(--good); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 12px; }
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px 18px; min-width: 0; transition: border-color .16s, transform .16s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.card-title { font-size: 15px; font-weight: 650; letter-spacing: -.015em; }
.card-kind { font-family: var(--mono); font-size: 10px; color: var(--faint); text-align: right; }
.card p { font-size: 13px; color: var(--muted); margin: 0 0 12px; line-height: 1.55; }
.card-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-family: var(--mono); font-size: 10px; color: var(--faint); background: var(--surface-2); border-radius: 3px; padding: 2px 6px; }
.card-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; }
.card-link { font-weight: 600; }
.model-card .card-top { align-items: center; }
.model-role { display: inline-block; font-size: 11px; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 2px 7px; margin-bottom: 10px; }
.vendor { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.model-card .tip { font-size: 12.5px; color: var(--muted); margin: 0 0 12px; }
.select-wrap select { height: 34px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 6px; padding: 0 28px 0 10px; font-size: 12.5px; }
.callout { display: flex; gap: 14px; align-items: flex-start; padding: 17px 18px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 6px; background: var(--surface); margin-top: 16px; }
.callout-mark { width: 24px; height: 24px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-family: var(--mono); font-size: 12px; font-weight: 700; }
.callout strong { font-size: 13.5px; }
.callout p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

/* Tokens */
.formula { border: 1px dashed var(--line); border-radius: var(--radius); padding: 16px 18px; background: var(--surface-2); margin-bottom: 22px; }
.formula-label { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: 9px; }
.formula code { background: transparent; border: 0; padding: 0; font-size: 13.5px; color: var(--ink); }
.formula p { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); }
.two-col { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 14px; align-items: start; }
.two-col.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.column-stack { display: grid; gap: 14px; }
.checklist-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.checklist-head h3 { margin-top: 6px; }
.progress-label { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.progress-track { height: 3px; background: var(--surface-3); border-radius: 2px; margin: 16px 0 8px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--accent); transition: width .25s; }
.check-item { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.check-item:last-child { border-bottom: 0; }
.check-item input { margin: 4px 0 0; accent-color: var(--accent); width: 15px; height: 15px; flex: 0 0 auto; }
.check-body strong { font-size: 13.5px; display: block; }
.check-body p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.impact { font-family: var(--mono); font-size: 10px; border-radius: 3px; padding: 1px 5px; margin-left: 7px; background: var(--surface-2); color: var(--faint); }
.impact.duzy { background: var(--good-soft); color: var(--good); }
.check-item input:checked ~ .check-body strong { color: var(--faint); text-decoration: line-through; }
.makeover-block { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.makeover-block.bad { border-left: 3px solid var(--bad); }
.makeover-block.good { border-left: 3px solid var(--good); }
.makeover-head { display: flex; justify-content: space-between; align-items: center; padding: 7px 12px; background: var(--surface-2); font-size: 11px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }
.makeover-block pre { padding: 12px; font-size: 12.5px; }
.makeover-arrow { text-align: center; color: var(--faint); font-size: 18px; line-height: 1.6; }
.makeover-note { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; }
.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini-grid > div { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 13px; }
.mini-grid strong { display: block; font-size: 12.5px; margin-bottom: 4px; }
.mini-grid span { font-size: 11.5px; color: var(--muted); line-height: 1.45; display: block; }

/* Skills */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tab { background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 10px 14px; font-size: 13.5px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }
.code-block { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 14px; font-size: 12px; line-height: 1.65; }
.tree { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 14px; font-size: 12px; line-height: 1.75; }
.field-table { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.field-row { display: grid; grid-template-columns: 190px 90px 1fr; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12.5px; align-items: center; }
.field-row:first-child { border-top: 0; }
.field-row.head { background: var(--surface-2); font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); }
.field-row:not(.head) span { color: var(--muted); }
.flow-three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.flow-three article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.flow-three h3 { margin-top: 10px; }
.flow-three p { font-size: 12.5px; color: var(--muted); margin: 0; }
.step-num { font-family: var(--mono); font-size: 11px; color: var(--accent); }

/* Plan */
.stepper { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.step-btn { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 12px 13px; color: var(--muted); min-height: 76px; }
.step-btn:hover { border-color: var(--accent); }
.step-btn.is-active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.step-btn .step-num { display: block; margin-bottom: 6px; }
.step-btn.is-active .step-num { color: var(--accent-soft); }
.step-btn strong { font-size: 12.5px; line-height: 1.35; display: block; }
.step-detail { margin-top: 10px; border-left: 3px solid var(--accent); }
.step-detail h3 { font-size: 18px; margin-bottom: 6px; }
.step-detail p { color: var(--muted); margin: 0 0 10px; }
.step-output { font-family: var(--mono); font-size: 11.5px; color: var(--accent); }
.mode-grid .card { padding: 15px 16px; }
.mode-name { font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--accent); }
.mode-use { display: block; font-size: 12px; color: var(--muted); margin: 3px 0 8px; }

/* Context */
.context-layers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.layer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 17px; }
.layer-tag { display: inline-block; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border-radius: 3px; padding: 2px 6px; margin-bottom: 10px; }
.layer strong { display: block; font-size: 13.5px; margin-bottom: 6px; }
.layer p { font-size: 12.5px; color: var(--muted); margin: 0; }
.context-grid { grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); }
.context-grid .card { padding: 14px 16px; }
.context-token { font-family: var(--mono); font-size: 12.5px; font-weight: 700; color: var(--ink); }
.context-group { font-family: var(--mono); font-size: 10px; color: var(--faint); }
.context-grid p { margin: 8px 0 0; font-size: 12.5px; }
.builder { margin-top: 18px; }
.builder-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.builder-head h3 { margin-top: 5px; }
.builder-options { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.context-option { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line); border-radius: 6px; padding: 8px 11px; cursor: pointer; background: var(--surface-2); }
.context-option:hover { border-color: var(--accent); }
.context-option input { margin: 3px 0 0; accent-color: var(--accent); }
.context-option strong { font-family: var(--mono); font-size: 11.5px; display: block; }
.context-option small { font-size: 11px; color: var(--faint); }

/* Resources & community */
.filters { gap: 7px; }
.filter-count { font-family: var(--mono); font-size: 10px; color: var(--faint); margin-left: 4px; }
.result-line { display: flex; justify-content: space-between; gap: 12px; margin: 18px 0 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.resource-grid .card { display: flex; flex-direction: column; }
.resource-grid .card p { flex: 1; }
.community-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.community-grid .card-kind { text-transform: uppercase; letter-spacing: .08em; }
.community-card-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.community-badge { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--accent); }
.closing { margin-top: 24px; background: var(--ink); color: var(--bg); border-radius: var(--radius); padding: 28px; }
.closing .eyebrow { color: color-mix(in srgb, var(--bg) 60%, transparent); }
.closing h3 { font-size: 24px; letter-spacing: -.035em; margin: 10px 0; }
.closing p { color: color-mix(in srgb, var(--bg) 78%, transparent); margin: 0; max-width: 680px; }
.footer { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; font-size: 11.5px; color: var(--faint); padding-top: 4px; }

/* Workshop and random tips */
.workshop-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.workshop-grid .card { display: flex; flex-direction: column; }
.workshop-grid .card p { flex: 1; }
.workshop-code { margin-top: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 11px 12px; font-size: 11.5px; line-height: 1.6; max-height: 190px; overflow: auto; }
.workshop-category { display: inline-block; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border-radius: 3px; padding: 2px 6px; margin-bottom: 9px; }

.random-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr); gap: 14px; align-items: stretch; }
.random-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; min-height: 270px; }
.random-card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.random-category { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 4px 8px; }
.random-counter { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.random-card h3 { font-size: clamp(20px, 2.6vw, 28px); letter-spacing: -.035em; line-height: 1.2; margin-bottom: 12px; }
.random-card p { font-size: 15px; color: var(--muted); line-height: 1.65; margin: 0 0 24px; flex: 1; }
.random-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.copy-btn-lg { padding: 8px 12px; font-size: 12px; }
.random-side { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.random-side h3 { font-size: 17px; margin: 8px 0 10px; }
.random-side > p { font-size: 13px; color: var(--muted); margin: 0 0 16px; }
.random-side-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.random-side-stats strong { display: block; font-size: 27px; letter-spacing: -.04em; color: var(--ink); line-height: 1.1; }
.random-side-stats span { font-size: 11.5px; color: var(--muted); }
.random-side .small-note { margin: 0; }

.tip-bank { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.tip-item { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 14px 16px; }
.tip-item:hover { border-color: var(--accent); }
.tip-item-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 6px; }
.tip-item-cat { font-family: var(--mono); font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }
.tip-item-title { font-size: 13.5px; font-weight: 650; letter-spacing: -.01em; }
.tip-item p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.tip-empty { padding: 24px; color: var(--muted); font-size: 13px; border: 1px dashed var(--line); border-radius: var(--radius); }

/* Search highlight */
.is-match-flash { animation: flash 1.7s ease-out; border-color: var(--accent) !important; }
@keyframes flash { 0%, 45% { box-shadow: 0 0 0 4px var(--accent-soft); } 100% { box-shadow: 0 0 0 0 transparent; } }

@media (max-width: 1100px) {
  .menu-btn { display: grid; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 64px; left: 0; z-index: 55; width: 264px; transform: translateX(-102%); transition: transform .2s ease; box-shadow: var(--shadow); background: var(--bg); }
  .sidebar.is-open { transform: translateX(0); }
  .nav-backdrop { display: block; position: fixed; inset: 64px 0 0; background: rgba(10, 12, 16, .38); z-index: 50; }
  .search-wrap { width: min(420px, 46vw); }
  .content { padding-top: 32px; }
}

@media (max-width: 820px) {
  .hero-grid, .two-col, .two-col.equal, .random-layout { grid-template-columns: 1fr; gap: 24px; }
  .random-card { min-height: 220px; }
  .hero-panel { max-width: none; }
  .principle-strip { grid-template-columns: 1fr; }
  .principle-strip > div { padding: 15px 0; }
  .principle-strip > div + div { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; }
  .flow-three, .context-layers { grid-template-columns: 1fr; }
  .stepper { grid-template-columns: repeat(2, 1fr); }
  .field-row { grid-template-columns: 1fr; gap: 4px; }
  .field-row.head { display: none; }
  .mini-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .topbar { padding: 0 12px; gap: 10px; }
  .brand-name { display: none; }
  .search-wrap { width: auto; flex: 1; }
  .search-kbd { display: none; }
  #global-search { padding-right: 12px; }
  .content { padding: 26px 16px 48px; }
  .section { padding-bottom: 54px; margin-bottom: 48px; }
  h1 { font-size: clamp(40px, 12vw, 62px); }
  .hero-lead { font-size: 16px; }
  .stepper { grid-template-columns: 1fr 1fr; }
  .step-btn { min-height: 68px; }
  .result-line { flex-direction: column; gap: 4px; }
  .footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
