/* ============================================================
   Why WOS — docs-style page (sidebar + advantage tabs)
   Reuses tokens from styles.css. Light/paper theme.
   ============================================================ */

/* Push the footer DOWN on /why without growing the black band: margin-top adds
   beige page-background space above the footer (padding-top would just enlarge
   the dark footer itself). Black band keeps its normal 64px padding.
   Scoped to this page only — why.css loads after styles.css. */
footer { padding-top: 64px; margin-top: 416px; }

/* layout */
.why-shell { width: min(1280px, 94vw); margin: 0 auto; display: grid;
  grid-template-columns: 256px minmax(0,1fr); gap: 0; align-items: start; }
@media (max-width: 900px){ .why-shell { grid-template-columns: 1fr; } }

/* top group tabs (docs-style) */
.why-tabs { border-bottom: 1px solid var(--border); }
.why-tabs .ti { width: min(1280px, 94vw); margin: 0 auto; display: flex; align-items: center; gap: 2px; height: 50px; }
.why-tabs .ti > button { border: 0; background: none; font: inherit; font-size: 14.5px; font-weight: 600;
  color: var(--text-2); padding: 8px 16px; cursor: pointer; position: relative; transition: color .15s; white-space: nowrap; }
.why-tabs .ti > button:hover { color: var(--text); }
.why-tabs .ti > button.on { color: var(--accent); }
.why-tabs .ti > button.on::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: -1px;
  height: 2px; background: var(--accent); border-radius: 2px 2px 0 0; }

/* top-bar search + AI search */
.tab-search { margin-left: auto; display: flex; align-items: center; gap: 6px; position: relative; }
.tab-search > .si { width: 15px; height: 15px; color: var(--muted); margin-right: -28px; z-index: 1; pointer-events: none; }
.tab-search input { font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border-2);
  border-radius: 9px; padding: 7px 12px 7px 32px; width: clamp(120px, 18vw, 220px); transition: border-color .15s, box-shadow .15s, width .2s; }
.tab-search input::placeholder { color: var(--muted); }
.tab-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); width: clamp(160px, 22vw, 260px); }
.tab-search .ask-ai { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-2); background: var(--surface);
  color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 11px; border-radius: 9px; cursor: pointer; white-space: nowrap; transition: all .15s; }
.tab-search .ask-ai:hover { border-color: var(--accent); color: var(--accent); }
.tab-search .ask-ai svg { width: 13px; height: 13px; color: var(--accent); }
@media (max-width: 720px){ .tab-search .ask-ai span { display: none; } .tab-search .ask-ai { padding: 7px 9px; } }

/* search results popover */
.search-pop { position: absolute; top: calc(100% + 8px); right: 0; width: 300px; max-width: 80vw; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; z-index: 60; display: none; }
.search-pop.on { display: block; }
.search-pop .res { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; font: inherit;
  font-size: 13.5px; color: var(--text); padding: 9px 11px; border-radius: 8px; cursor: pointer; }
.search-pop .res:hover, .search-pop .res.sel { background: var(--surface-2); }
.search-pop .res .grp { margin-left: auto; font-size: 11px; color: var(--muted); }
.search-pop .res.ai { color: var(--accent); font-weight: 600; border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; margin-top: 2px; }
.search-pop .res.ai svg { width: 15px; height: 15px; }
.search-pop .res.ai .q { color: var(--text-2); font-weight: 400; }
.search-pop .empty { padding: 10px 11px; font-size: 12.5px; color: var(--muted); }

/* top tabs now label the groups → hide sidebar sub-headers */
.why-side h6 { display: none; }

/* ---- sidebar ---- */
.why-search { position: relative; margin: 0 8px 18px 2px; }
.why-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.why-search input { width: 100%; font: inherit; font-size: 13.5px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px 9px 34px; transition: border-color .15s, box-shadow .15s; }
.why-search input::placeholder { color: var(--muted); }
.why-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.why-side .sgroup.no-match { display: none; }
.why-side button[data-pane].no-match { display: none; }
.why-search-empty { font-size: 12.5px; color: var(--muted); padding: 8px 12px; display: none; }
.why-search-empty.on { display: block; }
.why-side { position: sticky; top: 70px; align-self: start;
  padding: 30px 26px 60px 2px; border-right: 1px solid var(--border);
  max-height: calc(100vh - 70px); overflow-y: auto; }
@media (max-width: 900px){
  /* Narrow: the section list moves up but stays a single horizontal,
     side-by-side row (scrolls sideways), not a vertical stack. */
  .why-side { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--border);
    display: flex; align-items: flex-start; gap: 6px; overflow-x: auto; padding: 12px 0; }
  .why-side .sgroup { flex: none; display: flex; align-items: flex-start; gap: 6px; margin: 0; }
  .why-side .sgroup + .sgroup { margin-top: 0; }
  .why-side button { width: auto; flex: none; }
}
.why-side .sgroup + .sgroup { margin-top: 26px; }
.why-side h6 { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  font-weight: 700; margin: 0 0 12px; padding-left: 12px; }
@media (max-width: 900px){ .why-side h6 { display:none; } }
.why-side button { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  border: 0; background: none; font: inherit; cursor: pointer; color: var(--text-2);
  font-size: 14.5px; font-weight: 500; padding: 9px 12px; border-radius: 9px; line-height: 1.25;
  transition: background .15s, color .15s; white-space: nowrap; }
.why-side button .si { width: 17px; height: 17px; flex: none; color: var(--muted); transition: color .15s; display: none; }
.why-side button:hover { background: var(--surface-2); color: var(--text); }
.why-side button.on { background: var(--surface); color: var(--accent); box-shadow: inset 0 0 0 1px var(--border); }
.why-side button.on .si { color: var(--accent); }

/* ---- content ---- */
.why-main { padding: 38px clamp(8px,3vw,56px) 100px; min-width: 0; }
.why-pane { display: none; }
.why-pane.on { display: block; }
@keyframes whyfade { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform:none; } }

.why-kicker { font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
  font-weight: 600; margin: 0 0 14px; display:inline-flex; align-items:center; gap:9px; }
.why-kicker::before { content:""; width: 22px; height:1px; background: var(--accent); opacity:.6; }
.why-pane h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1.08; letter-spacing: -0.02em;
  font-weight: 400; margin: 0 0 14px; max-width: 20ch; text-wrap: balance; }
[data-lang="ko"] .why-pane h1 { word-break: keep-all; }
.why-pane .lead { font-size: clamp(17px, 1.5vw, 20px); color: var(--text-2); line-height: 1.55;
  max-width: none; margin: 0 0 34px; }
[data-lang="ko"] .why-pane .lead { word-break: keep-all; }
.why-pane h2 { font-size: clamp(20px, 2.2vw, 26px); font-weight: 500; letter-spacing: -0.01em;
  margin: 44px 0 14px; }
.why-pane p { color: var(--text-2); font-size: 16px; line-height: 1.7; max-width: none; margin: 0 0 16px; }
[data-lang="ko"] .why-pane p { word-break: keep-all; }
.why-pane p b, .why-pane li b { color: var(--text); font-weight: 600; }
.why-pane code { font-family: "JetBrains Mono", monospace; font-size: 13.5px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; color: var(--text); }
.why-pane ul { margin: 0 0 18px; padding: 0; list-style: none; max-width: none; }
.why-pane li { position: relative; padding-left: 26px; color: var(--text-2); font-size: 16px;
  line-height: 1.6; margin-bottom: 11px; }
[data-lang="ko"] .why-pane li { word-break: keep-all; }
.why-pane li::before { content: ""; position: absolute; left: 6px; top: 10px; width: 6px; height: 6px;
  border-radius: 2px; background: var(--accent); }

/* stat strip */
.why-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; margin: 8px 0 34px; }
.why-stats .st { background: var(--surface); padding: 20px 22px; }
.why-stats .st .v { font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.02em; line-height: 1;
  font-family: "Newsreader", serif; }
.why-stats .st .v .u { font-size: .5em; color: var(--muted); }
.why-stats .st .l { font-size: 12.5px; color: var(--muted); margin-top: 8px; line-height: 1.4; }

/* callout */
.why-note { display: flex; gap: 12px; background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); border-radius: 13px;
  padding: 16px 20px; margin: 24px 0; font-size: 14.5px; color: var(--text-2); line-height: 1.6; max-width: none; }
.why-note svg { width: 18px; height: 18px; color: var(--accent); flex: none; margin-top: 2px; }
.why-note b { color: var(--text); }

/* code block */
.why-code { background: var(--code-bg); border-radius: 13px; padding: 20px 22px; overflow-x: auto;
  margin: 0 0 22px; }
.why-code pre { margin: 0; font-family: "JetBrains Mono", monospace; font-size: 13px; line-height: 1.7; color: #d8d2c4; }
.why-code .k { color: #c89bd8; } .why-code .s { color: #9ec78f; } .why-code .c { color: #7d765f; }
.why-code .f { color: #7fb0e0; }

/* steps (how it works) */
.why-steps { display: grid; gap: 14px; margin: 6px 0 26px; }
.why-step { display: grid; grid-template-columns: 44px 1fr; gap: 16px; align-items: start;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px 24px; }
.why-step .n { width: 44px; height: 44px; border-radius: 11px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-family: "Newsreader", serif; font-size: 20px; }
.why-step h3 { margin: 0 0 5px; font-size: 17px; font-weight: 600; }
.why-step p { margin: 0; font-size: 14.5px; }
.why-step code { font-size: 12.5px; }

/* ============ MODEL LINEUP ============ */
.model-list { display: grid; gap: 14px; margin: 10px 0 24px; }
.model-card { display: grid; grid-template-columns: 48px 1fr; gap: 18px; align-items: start;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px 24px; }
.model-mark { width: 48px; height: 48px; border-radius: 12px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; }
.model-mark svg { width: 24px; height: 24px; }
.model-head { display: flex; align-items: center; gap: 11px; margin: 0 0 3px; }
.model-head h3 { margin: 0; font-size: 23px; font-weight: 600; line-height: 1; }
.model-meta { display: block; font-size: 12.5px; color: var(--muted); letter-spacing: .01em; margin-bottom: 9px; }
.model-card p { margin: 0; font-size: 14.5px; color: var(--text-2); line-height: 1.6; }
.model-status { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.model-status.live { background: var(--accent-soft); color: var(--accent); }
.model-status.next { background: var(--bg-2); color: var(--muted); border: 1px solid var(--border); }
@media (max-width: 560px){ .model-card { grid-template-columns: 1fr; } .model-mark { display: none; } }

/* ============ COST CALCULATOR + CHART ============ */
.cost-wrap { border: 1px solid var(--border); border-radius: 18px; overflow: hidden; background: var(--surface);
  box-shadow: var(--shadow); margin: 8px 0 14px; }
.cost-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 18px 24px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.cost-head .t { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 9px; }
.cost-head .t svg { width: 16px; height: 16px; color: var(--accent); }
.cost-head .mode { display: flex; gap: 4px; padding: 4px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; }
.cost-head .mode button { border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--text-2); padding: 6px 13px; border-radius: 7px; cursor: pointer; transition: all .18s; }
.cost-head .mode button.on { background: var(--ink); color: var(--bg); }
.cost-model { font-size: 11.5px; font-weight: 600; color: var(--text-2); background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px 11px; white-space: nowrap; }

/* ============ BENCHMARK CLIMB (frontier + graduation) ============ */
.bench-climb { display: grid; gap: 12px; margin: 10px 0 24px; }
.bench-step { border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; background: var(--surface); }
.bench-step.next { border-style: dashed; opacity: .8; }
.bench-top { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.bench-name { font-family: "Newsreader", "Noto Serif KR", serif; font-size: 19px; color: var(--text); }
.bench-state { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; }
.bench-state.on { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.bench-bar { position: relative; height: 10px; background: var(--surface-2); border-radius: 999px; margin-bottom: 9px; }
.bench-fill { height: 100%; background: var(--accent); border-radius: 999px; }
.bench-grad { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-2); border-radius: 2px; }
/* Per-model-version bars: each version its own color + length, climbing toward the
   94% graduation line; hover/focus emphasizes that version and dims the rest. */
.bench-multi { display: grid; gap: 14px; margin-bottom: 11px; }
.bench-track { transition: opacity .15s ease; }
.bench-multi:hover .bench-track { opacity: .4; }
.bench-multi .bench-track:hover { opacity: 1; }
.bench-trow { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; }
.bench-tlabel { font-size: 13px; font-weight: 600; color: var(--text); }
.bench-score { font-size: 13px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.bench-bar2 { position: relative; height: 9px; background: var(--surface-2); border-radius: 999px; }
.bench-fill2 { height: 100%; border-radius: 999px; transition: filter .15s ease; }
.bench-track.seg-tablet .bench-fill2 { background: #a8a29e; }
.bench-track.seg-scroll .bench-fill2 { background: var(--accent); }
.bench-track:hover .bench-fill2 { filter: brightness(1.08) saturate(1.1); }
.bench-grad2 { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-2); border-radius: 2px; }
.bench-judge { color: var(--muted); font-weight: 400; }
.bench-row2 { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.bench-best { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.bench-best > span { font-weight: 400; color: var(--muted); }
.bench-goal, .bench-locked { color: var(--muted); }
.bench-passed { font-size: 13px; color: var(--muted); padding: 6px 2px 2px; }
.bench-passed b { color: var(--text-2); }

/* per-model price table */
.price-table td:first-child { font-weight: 600; color: var(--text); }
.price-table td { font-variant-numeric: tabular-nums; }
.pr-tag { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.pr-tag.live { color: var(--accent); background: var(--accent-soft); }
.pr-tag.next { color: var(--muted); background: var(--bg-2); border: 1px solid var(--border); }

.cost-body { display: grid; grid-template-columns: 280px 1fr; gap: 0; }
@media (max-width: 760px){ .cost-body { grid-template-columns: 1fr; } }
.cost-controls { padding: 24px; border-right: 1px solid var(--border); display: grid; gap: 22px; align-content: start; }
@media (max-width: 760px){ .cost-controls { border-right: 0; border-bottom: 1px solid var(--border); } }
.cost-controls.hidden { display: none; }
.cost-ctl .cl { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px;
  color: var(--text-2); margin-bottom: 10px; }
.cost-ctl .cl b { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.cost-ctl input[type=range] { width: 100%; -webkit-appearance: none; appearance: none; height: 5px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); outline: none; }
.cost-ctl input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px;
  border-radius: 50%; background: var(--ink); cursor: pointer; border: 3px solid var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.cost-ctl input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--ink); cursor: pointer; border: 3px solid var(--surface); }
.cost-seg { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.cost-seg button { flex: 1; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600;
  color: var(--text-2); padding: 8px 6px; border-radius: 7px; cursor: pointer; transition: all .18s; }
.cost-seg button.on { background: var(--ink); color: var(--bg); }

/* chart */
.cost-chart { padding: 28px 30px; display: flex; flex-direction: column; justify-content: center; }
.cc-bigrow { display: flex; align-items: baseline; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.cc-big { font-family: "Newsreader", serif; font-size: clamp(40px, 6vw, 60px); line-height: .9; letter-spacing: -0.03em; color: var(--accent); }
.cc-biglab { font-size: 14px; color: var(--text-2); }
.cc-biglab b { color: var(--text); }
.ccbar { margin-bottom: 18px; }
.ccbar .h { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; margin-bottom: 8px; }
.ccbar .h .nm { color: var(--text-2); font-weight: 600; }
.ccbar .h .amt { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 14.5px; }
.ccbar .track { height: 34px; background: var(--surface-2); border-radius: 9px; overflow: hidden; }
.ccbar .fill { height: 100%; min-width: 12px; border-radius: 9px; transition: width .5s cubic-bezier(.2,.7,.2,1); }
.ccbar.without .fill { background: #cf9277; }
.ccbar.without .amt { color: #a85f3f; }
.ccbar.with .fill { background: var(--accent); }
.ccbar.with .amt { color: var(--accent); }
.cc-foot { font-size: 12.5px; color: var(--muted); margin-top: 10px; line-height: 1.55; }
.cc-foot b { color: var(--text-2); }

/* ============ docs: method reference (flat, Anthropic-feel) ============ */
.m-cat { font-family: "Newsreader", "Noto Serif KR", serif; font-size: 26px; font-weight: 500; margin: 44px 0 4px; padding-top: 26px; border-top: 1px solid var(--border); }
.m-cat:first-of-type { border-top: none; padding-top: 6px; }
.m-sec { margin: 30px 0 38px; }
.m-sec > h3 { margin: 0 0 4px; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.m-sec > p { margin: 6px 0 14px; font-size: 14.5px; color: var(--text-2); }
.m-badge { font-family: "Pretendard", sans-serif; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; color: #3d7a4e; background: #3d7a4e14; border: 1px solid #3d7a4e2e; border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
/* dark code block with copy button */
.d-code { position: relative; background: var(--code-bg); border-radius: 13px; padding: 18px 20px; overflow-x: auto; margin: 12px 0 0; }
.d-code pre { margin: 0; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13px; line-height: 1.7; color: #d8d2c4; white-space: pre; }
.d-code .k { color: #c89bd8; } .d-code .s { color: #9ec78f; } .d-code .c { color: #7d765f; } .d-code .f { color: #7fb0e0; }
.copy-btn { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 8px; border: 1px solid #ffffff1a; background: #ffffff0a; color: #b5ae9d; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s; }
.copy-btn:hover { background: #ffffff14; color: #e8e2d4; }
.copy-btn svg { width: 14px; height: 14px; }
.copy-btn.ok { color: #8fc79f; }
/* response: dark block with label, no white card */
.why-resp { position: relative; background: var(--code-bg); border-radius: 13px; padding: 14px 20px 15px; margin: 10px 0 0; overflow-x: auto; }
.why-resp .rl { display: block; font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #8a8470; margin-bottom: 8px; }
.why-resp pre { margin: 0; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12.5px; line-height: 1.65; color: #b9c4a8; white-space: pre; }
.p-table { width: 100%; border-collapse: collapse; margin: 14px 0 2px; font-size: 13.5px; }
.p-table th { text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 0 14px 7px 0; border-bottom: 1px solid var(--border); }
.p-table td { padding: 8px 14px 8px 0; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--text-2); }
.p-table td:first-child { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12.5px; color: var(--text); white-space: nowrap; }
.p-table tr:last-child td { border-bottom: none; }
.req { color: var(--accent); font-size: 11px; font-weight: 600; }
.docs-code { margin: 14px 0 0; }
.docs-code .code-body [data-code-pane] pre { white-space: pre; }
.why-warn { display: flex; gap: 12px; background: #b0822512; border: 1px solid #b0822533; border-radius: 12px; padding: 14px 16px; margin: 16px 0; font-size: 14px; color: var(--text-2); }
.why-warn svg { width: 18px; height: 18px; color: #b08225; flex: none; margin-top: 2px; }

/* ============ sidebar: nested SDK group ============ */
.side-sub { margin: 2px 0; }
/* Desktop: the wrapper is transparent — the SDK children lay out exactly as if
   they were direct children of .side-sub (vertical list under the label). It only
   becomes a real box in the narrow layout below. */
.side-sub-items { display: contents; }
.side-sub-label { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.side-sub-label .si { width: 16px; height: 16px; flex: none; opacity: .75; }
/* Indent + vertical guide line belong to the SDK sublist ITEMS only (Python/TS/…),
   not the SDK label — scoping to .side-sub-items keeps the stray bar off the label
   (it was showing as a vertical line next to SDK in the narrow nav row). */
.side-sub-items button { position: relative; padding-left: 38px; font-size: 13px; }
.side-sub-items button::before { content: ""; position: absolute; left: 19px; top: 0; bottom: 0; width: 1px; background: var(--border); }
.side-sub-items button.on::before { background: var(--accent); width: 2px; left: 18.5px; }

/* collapsible sub-group */
button.side-sub-label { width: 100%; border: none; background: none; cursor: pointer; font-family: inherit; text-align: left; border-radius: 10px; transition: background .15s; }
button.side-sub-label:hover { background: var(--hover, #00000008); }
.side-sub-label .chev { width: 14px; height: 14px; margin-left: auto; flex: none; opacity: .55; transition: transform .18s; }
.side-sub.closed .side-sub-label .chev { transform: rotate(-90deg); }
.side-sub.closed button[data-pane] { display: none; }

/* ============ tier tabs (Claude-style) + refined tables ============ */
.tier-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: 18px 0 0; overflow-x: auto; }
.tier-tabs button { appearance: none; border: none; background: none; cursor: pointer; font-family: inherit; font-size: 13.5px; font-weight: 500; color: var(--muted); padding: 9px 14px 11px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color .15s; }
.tier-tabs button:hover { color: var(--text); }
.tier-tabs button.on { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
/* table: rounded border, subtle header (Mintlify-feel) */
.p-table { border: 1px solid var(--border); border-collapse: separate; border-spacing: 0; border-radius: 12px; overflow: hidden; }
.p-table th { background: #00000005; padding: 10px 16px; border-bottom: 1px solid var(--border); }
.p-table td { padding: 11px 16px; }
.p-table td, .p-table th { border-right: none; }
.p-table tbody tr:not(:last-child) td { border-bottom: 1px solid var(--border); }
.p-table tbody tr:hover td { background: #00000003; }

/* inline-code pill must NOT apply inside dark code blocks (light text restored per block) */
.why-pane .code-body code, .why-pane .why-code code, .why-pane .d-code code, .why-pane .why-resp code {
  background: none; border: none; border-radius: 0; padding: 0; font-size: 13px;
}
.why-pane .code-body code { color: #d9d2c4; }
.why-pane .why-code code, .why-pane .d-code code { color: #d8d2c4; }
.why-pane .why-resp code { color: #b9c4a8; }

/* ---- language picker (top-left of the docs bar; click-to-select dropdown,
   built to grow as more locales ship) ---- */
.why-tabs .ti .why-lang { position: relative; margin-right: 12px; flex: none; }
.why-lang-btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border-2);
  background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600;
  padding: 7px 11px; border-radius: 9px; cursor: pointer; white-space: nowrap; transition: all .15s; }
.why-lang-btn:hover { border-color: var(--accent); color: var(--accent); }
.why-lang-btn svg { width: 15px; height: 15px; color: var(--accent); }
.why-lang-btn .chev { width: 13px; height: 13px; color: var(--muted); transition: transform .15s; }
.why-lang.open .why-lang-btn .chev { transform: rotate(180deg); }
.why-lang-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 168px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 11px; box-shadow: var(--shadow); padding: 5px; z-index: 70; }
.why-lang-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px;
  border-radius: 8px; font-size: 13.5px; color: var(--text); text-decoration: none; }
.why-lang-item:hover { background: var(--surface-2); }
.why-lang-item.on { color: var(--accent); font-weight: 600; }
.why-lang-item svg { width: 14px; height: 14px; color: var(--accent); flex: none; }
@media (max-width: 720px){ .why-lang-btn span { display: none; } .why-lang-btn { padding: 7px 9px; } }

/* Narrow sidebar = horizontal row. Placed AFTER the general .why-side rules so
   it wins source order (the earlier @media block was overridden by the later
   `.why-side button { width:100% }`). */
@media (max-width: 900px){
  .why-side .sgroup { display: flex; gap: 6px; margin: 0; }
  .why-side .sgroup + .sgroup { margin-top: 0; }
  .why-side button { width: auto; }
}

/* ---- engram catalog (single nav entry → searchable card grid; scales as
   engrams accumulate instead of overflowing the nav) ---- */
.engram-toolbar { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; flex-wrap: wrap; }
.engram-filter { position: relative; flex: 1 1 300px; max-width: 560px; margin: 0; }
.engram-favtoggle { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 9px 14px; cursor: pointer; transition: all .15s; }
.engram-favtoggle > svg { width: 15px; height: 15px; }
.engram-favtoggle:hover { border-color: var(--accent); color: var(--text); }
.engram-favtoggle.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.engram-favtoggle.on > svg { fill: currentColor; }
.engram-filter > svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.engram-filter input { width: 100%; font: inherit; font-size: 14px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px 10px 38px; transition: border-color .15s, box-shadow .15s; }
.engram-filter input::placeholder { color: var(--muted); }
.engram-filter input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.engram-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 14px; }
.engram-card { position: relative; display: flex; flex-direction: column; gap: 8px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; padding: 18px; text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s; }
.engram-card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.engram-card .ec-name { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace; font-size: 15px; font-weight: 600; color: var(--text); }
.engram-card .ec-fav { cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; margin: -4px -4px -4px 3px; border-radius: 7px; color: var(--muted);
  font-size: 17px; line-height: 1; user-select: none; transition: color .15s, background .15s, transform .1s; }
.engram-card .ec-fav:hover { color: var(--accent); background: var(--accent-soft); transform: scale(1.1); }
.engram-card .ec-fav.on { color: var(--accent); }
.engram-card .ec-desc { font-size: 13.5px; color: var(--text-2); line-height: 1.5; max-width: 30ch; }
[data-lang="ko"] .engram-card .ec-desc { word-break: keep-all; }
.engram-card .ec-arrow { position: absolute; top: 16px; right: 16px; width: 16px; height: 16px; color: var(--muted); transition: color .15s, transform .15s; }
.engram-card:hover .ec-arrow { color: var(--accent); transform: translateX(2px); }
.engram-more { font-size: 13px; color: var(--muted); margin: 18px 0 0; }

/* back link on engram detail panes → return to the catalog */
.why-back { display: flex; width: fit-content; align-items: center; gap: 7px; font-size: 13px; font-weight: 600;
  color: var(--text-2); text-decoration: none; margin: 0 0 16px; padding: 6px 13px 6px 10px;
  border: 1px solid var(--border-2); border-radius: 999px; background: var(--surface); transition: all .15s; }
.why-back:hover { border-color: var(--accent); color: var(--accent); }
.why-back svg { width: 15px; height: 15px; }

/* The narrow SDK band lives as its own element at the bottom of .why-side; on the
   desktop (vertical) sidebar it's redundant with the in-place SDK sublist, so hide
   it there. It's revealed only in the narrow layout below, and only while the
   Developers group is active (JS adds .active). */
.sdk-band { display: none; }

/* Narrow layout: the nav buttons stay in their ORIGINAL single horizontal row that
   scrolls sideways (.sgroup is the scroller, nowrap). The SDK options render as a
   SEPARATE full-width band BELOW that row — a sibling of the button row, not inside
   it — so the buttons never wrap to a second line, Engrams stays next to SDK, and
   nothing is overlapped. The in-sidebar sublist (.side-sub-items) is the desktop
   form and is hidden here; .sdk-band is the narrow twin. */
@media (max-width: 900px) {
  .why-side { display: flex; flex-direction: column; align-items: stretch; overflow: visible; }
  /* Responsive: the nav buttons stay on ONE line while they fit (compacted so more
     fit), and WRAP to a second line only when the window is genuinely too narrow —
     so nothing is ever cut off the right edge and there's no hidden scroll to hunt. */
  .why-side .sgroup { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 4px;
    width: 100%; margin: 0; }
  .why-side .sgroup button { padding: 8px 10px; font-size: 13.5px; }
  .why-side .side-sub { display: flex; align-items: center; }
  .why-side .side-sub-items { display: none; }        /* desktop sublist hidden on narrow */
  /* Band: present only while the dev group is active, but COLLAPSED until you press
     SDK (.open). It slides open (max-height/opacity) and hugs its content so the box
     ends right after curl instead of stretching the full width. */
  .why-side .sdk-band.active { display: flex; flex-wrap: wrap; gap: 4px; align-self: flex-start;
    width: fit-content; max-width: 100%; overflow: hidden; max-height: 0; opacity: 0; margin-top: 0;
    padding: 0 6px; border: 1px solid transparent; border-radius: 11px;
    transition: max-height .22s ease, opacity .18s ease, margin-top .22s ease, padding .22s ease, border-color .18s ease; }
  .why-side .sdk-band.active.open { max-height: 200px; opacity: 1; margin-top: 8px; padding: 6px;
    background: var(--surface); border-color: var(--border); }
  .why-side .sdk-band button { display: flex; align-items: center; width: auto; border: 0; background: none;
    font: inherit; font-size: 13px; font-weight: 500; color: var(--text-2); padding: 7px 12px; border-radius: 9px;
    cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
  .why-side .sdk-band button:hover { background: var(--surface-2); color: var(--text); }
  .why-side .sdk-band button.on { background: var(--accent-soft); color: var(--accent); }
}
