.tabs { min-width: 0; }
[role="tablist"] { display: flex; gap: 8px; max-width: 100%; overflow-x: auto; padding: 4px; overscroll-behavior-inline: contain; }
[role="tab"] {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
  min-height: 44px;
  padding: 12px 20px;
  border: 1px solid var(--c-clear);
  border-radius: var(--r-pill);
  background: var(--c-panel);
  color: var(--c-muted);
  font-weight: 500;
  line-height: 1.4;
  text-align: left;
}
[role="tab"]:hover { background: var(--c-panel-2); color: var(--c-text); }
[role="tab"][aria-selected="true"] { background: var(--c-accent-soft); color: var(--c-accent-dark); font-weight: 700; }
[role="tabpanel"] { min-width: 0; }
[role="tabpanel"]:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 4px; }
.feature-tabs { display: grid; grid-template-columns: 240px minmax(0,1fr); gap: 32px; padding: 32px; border-radius: var(--r-2xl); background: var(--c-panel); color: var(--c-text); }
.feature-tabs [role="tablist"] { flex-direction: column; overflow: visible; align-self: start; }
.feature-tabs [role="tab"] { width: 100%; justify-content: flex-start; padding: 16px 20px; background: var(--c-clear); color: var(--c-muted); }
.feature-tabs [role="tab"]::before { content: ""; width: 7px; height: 7px; flex-shrink: 0; border-radius: var(--r-circle); background: var(--c-clear); }
.feature-tabs [role="tab"][aria-selected="true"] { background: var(--c-white); color: var(--c-text); box-shadow: var(--shadow-xs); font-weight: 800; }
.feature-tabs [role="tab"][aria-selected="true"]::before { background: var(--c-accent); }
.feature-page { padding: 32px; border: 1px solid var(--c-border); border-radius: var(--r-xl); background: var(--c-white); color: var(--c-text); box-shadow: var(--shadow-sheet); }
.feature-page-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.feature-page-head h3 { margin: 0; font-size: 28px; font-weight: 800; }
.feature-page p { color: var(--c-muted); line-height: 1.85; }
.mini-demo { padding: 18px; margin-top: 26px; border: 1px solid var(--c-border); border-radius: var(--r-md); background: var(--c-panel); color: var(--c-text); }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 5px; border-radius: var(--r-pill); background: var(--c-panel-2); color: var(--c-text); }
.segmented > span, .segmented > button { padding: 8px 18px; border: 0; border-radius: var(--r-pill); background: var(--c-clear); color: var(--c-muted); }
.segmented .is-selected { background: var(--c-white); color: var(--c-accent-dark); box-shadow: var(--shadow-xs); }
.mode-options { display: grid; gap: 10px; border: 0; margin: 0; padding: 0; }
.mode-options label { display: flex; align-items: flex-start; gap: 9px; }
.mode-options input { accent-color: var(--c-accent-dark); flex-shrink: 0; margin-top: 6px; }

.toc { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px; margin-block: 24px; border-radius: var(--r-xl); background: var(--c-panel); color: var(--c-text); }
.toc a { display: block; min-height: 44px; padding: 10px 16px; border-radius: var(--r-pill); color: var(--c-muted); text-decoration: none; }
.toc a:hover, .toc a[aria-current="location"] { background: var(--c-white); color: var(--c-accent-dark); box-shadow: var(--shadow-xs); }
.toc--sticky { position: sticky; top: 12px; z-index: 2; }
.toc--static { position: static; }

.faq-item { margin-bottom: 12px; border: 1px solid var(--c-border); border-radius: var(--r-lg); background: var(--c-white); color: var(--c-text); box-shadow: var(--shadow-xs); }
.faq-item summary { position: relative; min-height: 56px; padding: 18px 52px 18px 22px; font-weight: 700; cursor: pointer; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 22px; top: 15px; font-family: var(--font-mono); font-size: 22px; font-weight: 400; color: var(--c-accent-dark); }
.faq-item[open] summary::after { content: "−"; }
.faq-item[open] summary { border-bottom: 1px solid var(--c-border); }
.faq-answer { padding: 20px 22px; color: var(--c-muted); }
.faq-answer > :last-child { margin-bottom: 0; }

.badge, .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 11px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  background: var(--c-panel);
  color: var(--c-text);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}
.badge--first { background: var(--c-accent-soft); color: var(--c-accent-dark); border-color: var(--c-accent-soft-2); }
.badge--recommended { background: var(--c-white); color: var(--c-accent-dark); border-color: var(--c-accent-soft-2); }
.badge--retired { background: var(--c-panel-2); color: var(--c-muted); border-color: var(--c-border); }
.tag--route { background: var(--c-accent-softer); color: var(--c-accent-dark); border-color: var(--c-accent-soft-2); font-family: var(--font-mono); }
.tag--direct { background: var(--c-panel-2); color: var(--c-text); font-family: var(--font-mono); }
.badge-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.term-card { padding: 28px; border: 1px solid var(--c-border); border-radius: var(--r-xl); background: var(--c-white); color: var(--c-text); box-shadow: var(--shadow-card); }
.term-card h3 { margin: 14px 0 10px; }
.term-card p { color: var(--c-muted); }
.term-card .term-name { font-family: var(--font-mono); font-size: 14px; color: var(--c-accent-dark); }
.download-card { padding: 30px; border: 1px solid var(--c-border); border-radius: var(--r-xl); background: var(--c-white); color: var(--c-text); box-shadow: var(--shadow-sheet); }
.download-card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 18px; }
.download-card-head h3 { margin: 0; font-size: 26px; }
.download-card p { color: var(--c-muted); }
.download-card .cta { margin-top: 22px; }
.download-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--c-muted); font-size: 13px; font-family: var(--font-mono); }
.download-note { margin-top: 16px; font-size: 13px; }
.article-card { padding: 28px; border: 1px solid var(--c-border); border-radius: var(--r-xl); background: var(--c-white); color: var(--c-text); box-shadow: var(--shadow-card); }
.article-card h3 { font-size: 21px; margin-block: 16px 12px; line-height: 1.45; }
.article-card h3 a { color: var(--c-text); text-decoration: none; }
.article-card h3 a:hover { color: var(--c-accent-dark); }
.article-card p { color: var(--c-muted); font-size: 14px; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 12px; color: var(--c-muted); }
.article-card .read-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--c-accent-dark); font-size: 14px; font-weight: 700; text-decoration: none; }

.callout { padding: 22px 24px; margin: 26px 0; border: 1px solid var(--c-accent-soft-2); border-left: 4px solid var(--c-accent); border-radius: var(--r-md); background: var(--c-accent-softer); color: var(--c-text); }
.callout p:last-child { margin-bottom: 0; }
.callout-title { display: block; margin-bottom: 8px; font-weight: 700; color: var(--c-accent-dark); }
.callout--neutral { background: var(--c-panel); color: var(--c-text); border-color: var(--c-border); border-left-color: var(--c-border-strong); }
.callout--neutral .callout-title { color: var(--c-text); }
.article-download { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; margin-top: 48px; padding: 28px; border-radius: var(--r-section); background: var(--c-panel); color: var(--c-text); }
.article-download h3 { margin: 0 0 8px; }
.article-download p { color: var(--c-muted); margin: 0; }
.article-download-copy { flex: 1 1 260px; min-width: 0; }
.dl-fab { position: fixed; right: 24px; bottom: max(24px, env(safe-area-inset-bottom)); z-index: var(--z-fab); display: inline-flex; align-items: center; gap: 10px; max-width: calc(100vw - 40px); min-height: 52px; padding: 12px 18px; border: 1px solid var(--c-accent-soft-2); border-radius: var(--r-pill); background: var(--c-white); color: var(--c-accent-dark); box-shadow: var(--shadow-lift); text-decoration: none; font-size: 14px; font-weight: 700; }
.dl-fab svg { width: 20px; height: 20px; flex-shrink: 0; }
.dl-fab:hover { background: var(--c-accent-soft); color: var(--c-accent-dark); }
.has-dl-fab .site-footer { padding-bottom: 100px; }

.table-scroll { overflow-x: auto; max-width: 100%; min-width: 0; overscroll-behavior-inline: contain; border: 1px solid var(--c-border); border-radius: var(--r-md); background: var(--c-white); color: var(--c-text); -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; background: var(--c-white); color: var(--c-text); }
.data-table caption { padding: 14px 18px; text-align: left; font-weight: 700; }
.data-table th, .data-table td,
.prose table th, .prose table td,
.article-body table th, .article-body table td {
  min-width: 7em;
  padding: 14px 18px;
  border-bottom: 1px solid var(--c-border);
  overflow-wrap: normal;
  word-break: normal;
  vertical-align: top;
}
.data-table th, .prose table th, .article-body table th { background: var(--c-panel); color: var(--c-text); font-weight: 700; }
.data-table td, .prose table td, .article-body table td { background: var(--c-white); color: var(--c-text); }
.data-table tr:last-child td { border-bottom: 0; }
.prose table, .article-body table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  min-width: 0;
  border-collapse: collapse;
  overscroll-behavior-inline: contain;
  background: var(--c-white);
  color: var(--c-text);
}
.prose table code, .article-body table code, .data-table code { overflow-wrap: anywhere; word-break: normal; }

.device { position: relative; width: min(700px, calc(100% - 120px)); z-index: 1; }
.stage { position: relative; transform: perspective(2200px) rotateX(5deg) rotateY(-5deg); transform-origin: 50% 62%; }
.board-sheet { position: absolute; left: 26px; right: 26px; top: 26px; bottom: -16px; border: 1px solid var(--c-border); border-radius: var(--r-xl); background: var(--c-white); color: var(--c-text); box-shadow: var(--shadow-sheet); }
.board { position: relative; z-index: 1; border: 1px solid var(--c-border); border-radius: var(--r-xl); background: var(--c-white); color: var(--c-text); box-shadow: var(--shadow-window); overflow: hidden; }
.chrome { position: relative; display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 15px; background: var(--c-panel); color: var(--c-muted); border-bottom: 1px solid var(--c-border); }
.chrome-dot { width: 11px; height: 11px; flex-shrink: 0; border-radius: var(--r-circle); background: var(--c-chrome); }
.chrome-title { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); font-size: 12.5px; font-weight: 600; color: var(--c-muted); white-space: nowrap; }
.board-body { display: grid; grid-template-columns: 128px minmax(0,1fr); }
.side { padding: 12px 8px 16px; background: var(--c-panel); color: var(--c-text); border-right: 1px solid var(--c-border); }
.side-label { padding: 0 8px 8px; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; color: var(--c-muted); }
.side-item { display: flex; align-items: center; gap: 8px; min-height: 31px; padding: 6px 8px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 500; color: var(--c-text); white-space: nowrap; line-height: 1.4; }
.side-item svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--c-muted); }
.side-item + .side-item { margin-top: 2px; }
.side-item.is-current { background: var(--c-accent-soft); color: var(--c-accent-dark); font-weight: 700; }
.side-item.is-current svg { color: var(--c-accent); }
.board-main { padding: 14px 14px 16px; min-width: 0; }
.main-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 2px 14px; }
.main-title { font-family: var(--font-display); font-size: 17px; font-weight: 800; letter-spacing: -.015em; }
.main-file { padding: 3px 9px; border: 1px solid var(--c-border); border-radius: var(--r-pill); background: var(--c-panel); color: var(--c-muted); font-family: var(--font-mono); font-size: 10.5px; }
.kb { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; align-items: start; }
.kb-col { display: flex; flex-direction: column; gap: 6px; padding: 8px 6px; border-radius: var(--r-md); background: var(--c-panel); color: var(--c-text); }
.kb-head { margin: 0 2px 3px; }
.kb-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 22px; padding: 3px 9px 3px 7px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; color: var(--c-text); line-height: 1.4; }
.kb-chip i { width: 7px; height: 7px; border-radius: var(--r-circle); flex-shrink: 0; }
.kb-chip--purple { background: var(--c-accent-soft); color: var(--c-text); }
.kb-chip--purple i { background: var(--ill-purple); }
.kb-chip--yellow { background: var(--ill-yellow-soft); color: var(--c-text); }
.kb-chip--yellow i { background: var(--ill-yellow); }
.kb-chip--sky { background: var(--ill-sky-soft); color: var(--c-text); }
.kb-chip--sky i { background: var(--ill-sky); }
.kb-chip--green { background: var(--ill-green-soft); color: var(--c-text); }
.kb-chip--green i { background: var(--ill-green); }
.kb-card { position: relative; padding: 8px 9px; border: 1px solid var(--c-border); border-radius: var(--r-sm); background: var(--c-white); color: var(--c-text); box-shadow: var(--shadow-card); font-size: 12.5px; font-weight: 500; line-height: 1.4; }
.kb-t { display: block; }
.kb-s { display: block; margin-top: 3px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 400; color: var(--c-muted); line-height: 1.35; overflow-wrap: anywhere; }
.kb-opt { display: flex; align-items: flex-start; gap: 7px; }
.kb-radio { flex-shrink: 0; width: 12px; height: 12px; margin-top: 2.5px; border-radius: var(--r-circle); border: 1.5px solid var(--c-border-strong); background: var(--c-white); }
.kb-card.is-on { border-color: var(--c-accent-soft-2); }
.kb-card.is-on .kb-radio { border-color: var(--c-accent); background: var(--c-accent); box-shadow: inset 0 0 0 2px var(--c-white); }
.kb-toggle { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.kb-switch { position: relative; flex-shrink: 0; width: 24px; height: 14px; margin-top: 2.5px; border-radius: var(--r-pill); background: var(--c-panel-2); border: 1px solid var(--c-border-strong); }
.kb-switch::after { content: ""; position: absolute; top: 1px; left: 1px; width: 10px; height: 10px; border-radius: var(--r-circle); background: var(--c-white); box-shadow: var(--shadow-xs); }
.kb-slot { position: relative; }
.kb-slot::before { content: ""; position: absolute; inset: 0; border: 1.5px dashed var(--c-border-strong); border-radius: var(--r-sm); }
.kb-card.is-drag { z-index: 2; transform: translate(7px,-5px) rotate(3.5deg); box-shadow: var(--shadow-lift); border-color: var(--c-border-strong); }
.kb-card.is-tilt { transform: rotate(-2deg); box-shadow: var(--shadow-lift); }
.kb-code { font-family: var(--font-mono); font-size: 11px; font-weight: 500; line-height: 1.5; }
.kb-code-k { color: var(--c-accent-dark); overflow-wrap: anywhere; }
.kb-code-a { color: var(--c-muted); }
.kb-code-v { display: inline-block; padding: 0 5px; border-radius: var(--r-xs); background: var(--c-panel-2); color: var(--c-text); }
.stk { position: absolute; z-index: 3; border: 3px solid var(--c-ink); border-radius: var(--r-circle); box-shadow: var(--shadow-sticker); overflow: hidden; color: var(--c-ink); }
.stk svg { width: 100%; height: 100%; }
.sv-w { fill: var(--c-white); stroke: var(--c-ink); stroke-width: 2.8; stroke-linejoin: round; stroke-linecap: round; }
.sv-i { fill: var(--c-ink); }
.sv-l { fill: none; stroke: var(--c-ink); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.sv-thick { stroke-width: 3.4; }
.stk--key { width: 78px; height: 78px; background: var(--ill-purple); left: -50px; top: 96px; transform: rotate(-12deg); }
.stk--terminal { width: 64px; height: 64px; background: var(--ill-green); left: -38px; bottom: 64px; transform: rotate(-7deg); }
.stk--plug { width: 66px; height: 66px; background: var(--ill-yellow); left: 300px; bottom: -36px; transform: rotate(8deg); }
.stk--star { width: 54px; height: 54px; background: var(--ill-yellow); right: 120px; top: -30px; transform: rotate(14deg); }
.stk--gear { width: 72px; height: 72px; background: var(--ill-coral); right: -44px; top: 150px; transform: rotate(10deg); }
.stk--branch { width: 68px; height: 68px; background: var(--ill-sky); right: 72px; bottom: -38px; transform: rotate(-8deg); }

.swatch-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.swatch { margin: 0; padding: 10px; border: 1px solid var(--c-border); border-radius: var(--r-md); background: var(--c-white); color: var(--c-text); }
.swatch-chip { height: 62px; border: 1px solid var(--c-border); border-radius: var(--r-sm); }
.swatch figcaption { margin-top: 8px; font-family: var(--font-mono); font-size: 11px; overflow-wrap: anywhere; }
.sw-bg { background: var(--c-bg); color: var(--c-text); }
.sw-panel { background: var(--c-panel); color: var(--c-text); }
.sw-panel2 { background: var(--c-panel-2); color: var(--c-text); }
.sw-border { background: var(--c-border); color: var(--c-text); }
.sw-border-strong { background: var(--c-border-strong); color: var(--c-text); }
.sw-dot { background: var(--c-dot); color: var(--c-text); }
.sw-chrome { background: var(--c-chrome); color: var(--c-text); }
.sw-accent { background: var(--c-accent); color: var(--c-white); }
.sw-accent-dark { background: var(--c-accent-dark); color: var(--c-white); }
.sw-accent-soft { background: var(--c-accent-soft); color: var(--c-text); }
.sw-accent-soft2 { background: var(--c-accent-soft-2); color: var(--c-text); }
.sw-accent-softer { background: var(--c-accent-softer); color: var(--c-text); }
.sw-text { background: var(--c-text); color: var(--c-white); }
.sw-muted { background: var(--c-muted); color: var(--c-white); }
.sw-faint { background: var(--c-faint); color: var(--c-text); }
.sw-success { background: var(--c-success); color: var(--c-text); }
.sw-warn { background: var(--c-warn); color: var(--c-text); }
.sw-error { background: var(--c-error); color: var(--c-white); }
.sw-purple { background: var(--ill-purple); color: var(--c-white); }
.sw-yellow { background: var(--ill-yellow); color: var(--c-text); }
.sw-coral { background: var(--ill-coral); color: var(--c-text); }
.sw-sky { background: var(--ill-sky); color: var(--c-text); }
.sw-green { background: var(--ill-green); color: var(--c-text); }
.sw-yellow-soft { background: var(--ill-yellow-soft); color: var(--c-text); }
.sw-sky-soft { background: var(--ill-sky-soft); color: var(--c-text); }
.sw-green-soft { background: var(--ill-green-soft); color: var(--c-text); }
.sw-white { background: var(--c-white); color: var(--c-text); }
.sw-ink { background: var(--c-ink); color: var(--c-white); }
.sw-clear { background: var(--c-clear); color: var(--c-text); }
.sw-veil { background: var(--c-veil); color: var(--c-text); }
.preview-stack { display: grid; gap: 24px; }
.type-sample-title { font-family: var(--font-display); font-size: clamp(34px,3.2vw,46px); font-weight: 800; line-height: 1.18; margin: 0 0 20px; }
.preview-footer { margin-top: 64px; }
.preview-fab { position: static; margin-top: 24px; }

@media (max-width: 1280px) {
  .board-body { grid-template-columns: 112px minmax(0,1fr); }
  .kb-card, .side-item { font-size: 11.5px; }
}
@media (max-width: 1100px) {
  .device { width: min(700px, calc(100% - 100px)); }
  .feature-tabs { grid-template-columns: 200px minmax(0,1fr); gap: 20px; }
}
@media (max-width: 720px) {
  .feature-tabs { display: block; padding: 16px; }
  .feature-tabs [role="tablist"] { flex-direction: row; overflow-x: auto; margin-bottom: 16px; }
  .feature-tabs [role="tab"] { width: auto; padding: 12px 16px; }
  .feature-page { padding: 22px; }
  .feature-page-head h3 { font-size: 24px; }
  .device { width: calc(100% - 40px); }
  .stage { transform: none; }
  .side { display: none; }
  .board-body { grid-template-columns: minmax(0,1fr); }
  .kb { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .kb-card { font-size: 12px; }
  .stk { width: 48px; height: 48px; border-width: 2.5px; }
  .stk--terminal, .stk--plug, .stk--star { display: none; }
  .stk--key { left: -14px; top: -22px; }
  .stk--gear { right: -14px; top: 42%; }
  .stk--branch { right: 28px; bottom: -24px; }
  .swatch-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 640px) {
  .kb-card.is-drag, .kb-card.is-tilt, .stage { transform: none; }
  .download-card, .article-card, .term-card { padding: 22px; }
  .dl-fab { right: 20px; bottom: max(20px, env(safe-area-inset-bottom)); }
  .feature-page-head { gap: 12px; }
  .main-file { font-size: 9px; padding-inline: 6px; }
  .chrome-title { position: static; transform: none; margin-left: auto; font-size: 10px; white-space: normal; }
  .chrome { padding-inline: 10px; gap: 5px; }
  .chrome-dot { width: 8px; height: 8px; }
}