.device-stage { position: relative; width: 640px; height: 480px; }
.device { position: relative; width: 640px; height: 480px; }
.device-grid {
  position: absolute; inset: -24px -12px -24px -36px;
  background-image: radial-gradient(circle, var(--border-strong) 1px, var(--mask-clear) 1.3px);
  background-size: 16px 16px; background-position: 0 0; opacity: .75;
  -webkit-mask-image: radial-gradient(ellipse 62% 60% at 55% 48%, var(--mask-solid) 35%, var(--mask-clear) 100%);
  mask-image: radial-gradient(ellipse 62% 60% at 55% 48%, var(--mask-solid) 35%, var(--mask-clear) 100%);
}
.blueprint { position: absolute; inset: 0; width: 640px; height: 480px; overflow: visible; }
.bp-box, .bp-diamond { fill: var(--bg); stroke: var(--border-strong); stroke-width: 1; }
.bp-line { fill: none; stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 3 4; }
.bp-halo { fill: var(--accent-wash); }
.bp-node { fill: var(--accent); }
.bp-cap { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .08em; fill: var(--text-muted); }
.bp-txt { font-family: var(--font-mono); font-size: 11px; fill: var(--text-muted); }
.bp-tag { font-family: var(--font-mono); font-size: 12px; fill: var(--text); }
.ghost {
  position: absolute; left: 52px; top: 136px; width: 456px; height: 320px;
  border: 1px solid var(--border-strong); border-radius: var(--r-card);
  background: var(--bg); color: var(--text);
}
.ghost::before { content: ""; position: absolute; left: 0; right: 0; top: 36px; border-top: 1px solid var(--border); }
.win {
  position: absolute; left: 28px; top: 112px; width: 456px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--r-card); box-shadow: var(--shadow-float);
}
.win-bar { position: relative; height: 36px; display: flex; align-items: center; padding: 0 14px; border-bottom: 1px solid var(--border); }
.win-dots { display: flex; gap: 6px; }
.win-dots i { width: 10px; height: 10px; border-radius: var(--r-round); background: var(--chrome-dot); display: block; flex-shrink: 0; }
.win-title { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.win-tabs { display: flex; gap: 4px; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.wtab { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: var(--r-pill); font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.wtab.is-on { background: var(--bg-panel-2); color: var(--text); }
.win-body { padding-top: 6px; padding-bottom: 6px; }
.set-row { display: flex; align-items: center; justify-content: space-between; height: 38px; margin: 0 16px; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: 0; }
.set-label { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.set-name { font-size: 13px; color: var(--text); }
.set-key { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.field, .sel {
  display: inline-flex; align-items: center; height: 26px; border: 1px solid var(--border);
  border-radius: var(--r-control); background: var(--bg); color: var(--text);
  font-family: var(--font-mono); font-size: 12px; flex-shrink: 0;
}
.field { width: 88px; padding: 0 10px; }
.sel { min-width: 132px; padding: 0 8px 0 10px; justify-content: space-between; gap: 10px; }
.sel svg { width: 10px; height: 10px; color: var(--text-muted); }
.tgl { position: relative; width: 32px; height: 18px; border-radius: var(--r-pill); background: var(--bg-panel-2); border: 1px solid var(--border); display: inline-block; flex-shrink: 0; }
.tgl .knob { position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: var(--r-round); background: var(--surface); box-shadow: 0 0 0 1px var(--border-strong); }
.tgl.is-on { background: var(--accent); border-color: var(--accent-edge); }
.tgl.is-on .knob { left: 16px; box-shadow: none; }
.codestrip {
  position: absolute; right: -28px; bottom: -17px; display: inline-flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--r-control);
  background: var(--bg-panel); color: var(--text); box-shadow: var(--shadow-strip);
  font-family: var(--font-mono); font-size: 12px; white-space: nowrap;
}
.cs-file { color: var(--text-muted); padding-right: 10px; border-right: 1px solid var(--border); }
.codestrip .k { color: var(--accent-dark); }
.codestrip .p { color: var(--text-muted); }
.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 32px; }
.feature-card { display: flex; flex-direction: column; min-width: 0; min-height: 300px; padding: 24px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); color: var(--text); }
.feature-card:first-child { grid-column: span 2; }
.feature-icon { width: 22px; height: 22px; margin-bottom: 22px; fill: none; stroke: var(--text); stroke-width: 1.2; }
.feature-card h3 { margin: 0 0 10px; font-size: 19px; }
.feature-card p { margin: 0 0 24px; color: var(--text-muted); font-size: 14px; }
.feature-card strong { color: var(--text); font-weight: var(--weight-normal); }
.feature-diagram { width: 100%; height: 100px; margin-top: auto; }
.diagram-line { fill: none; stroke: var(--border-strong); stroke-width: 1; }
.diagram-node { fill: var(--accent); }
.diagram-text { fill: var(--text-muted); font-family: var(--font-mono); font-size: 11px; }
.tabs { min-width: 0; }
.tab-list, [role="tablist"] { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
[role="tab"] {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 10px 22px; border: 1px solid var(--border); border-radius: var(--r-pill);
  background: var(--bg); color: var(--text-muted); font: inherit;
}
[role="tab"]:hover { border-color: var(--border-strong); color: var(--text); }
[role="tab"][aria-selected="true"] { border-color: var(--text); background: var(--bg-panel-2); color: var(--text); }
[role="tabpanel"] { min-width: 0; scroll-margin-top: 24px; }
.settings-detail { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.settings-detail > * { min-width: 0; }
.settings-detail p { line-height: 1.9; color: var(--text-muted); }
.settings-window { border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); color: var(--text); min-width: 0; }
.settings-window .set-row { height: auto; min-height: 44px; gap: 12px; padding-top: 8px; padding-bottom: 8px; flex-wrap: wrap; }
.settings-window .field { width: auto; min-width: 100px; max-width: 100%; }
.settings-window .win-body { padding-bottom: 18px; }
.toc {
  position: sticky; top: 12px; z-index: 10; display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px; margin-bottom: 32px; border: 1px solid var(--border);
  border-radius: var(--r-card); background: var(--bg); color: var(--text);
}
.toc a { display: inline-flex; min-height: 36px; align-items: center; padding: 6px 12px; border-radius: var(--r-pill); color: var(--text-muted); font-size: 13px; }
.toc a:hover, .toc a[aria-current] { background: var(--bg-panel-2); color: var(--text); }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:first-child { border-top: 1px solid var(--border); }
.faq-item summary { position: relative; list-style: none; cursor: pointer; padding: 20px 36px 20px 0; color: var(--text); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 8px; top: 18px; font-family: var(--font-mono); color: var(--text-muted); }
.faq-item[open] summary::after { content: "−"; }
.faq-answer { padding-right: 28px; padding-bottom: 20px; color: var(--text-muted); }
.faq-answer p:last-child { margin-bottom: 0; }
.term-card { min-width: 0; padding: 24px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); color: var(--text); }
.term-card h3 { margin: 12px 0; }
.term-card p { color: var(--text-muted); }
.term-key { font-family: var(--font-mono); font-size: 12px; color: var(--accent-dark); }
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.badge, .tag {
  display: inline-block; max-width: 100%; padding: 3px 9px; border: 1px solid var(--border);
  border-radius: var(--r-pill); background: var(--bg-panel); color: var(--text-muted);
  font-size: 12px; line-height: 1.5; white-space: normal; overflow-wrap: anywhere;
}
.badge-primary { border-color: var(--accent-dark); background: var(--surface); color: var(--accent-dark); }
.badge-recommended { border-color: var(--border-strong); background: var(--bg-panel-2); color: var(--text); }
.badge-retired { border-style: dashed; background: var(--bg-panel); color: var(--text-muted); }
.client-card { min-width: 0; padding: 28px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); color: var(--text); }
.client-card.is-preferred { border-color: var(--accent-dark); }
.client-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.client-heading img { width: 56px; height: 56px; flex-shrink: 0; }
.client-heading h3 { margin: 0 0 6px; }
.client-heading > div { min-width: 0; }
.client-description { color: var(--text-muted); }
.client-version { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.client-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.client-notes { font-size: 13px; color: var(--text-muted); margin-top: 16px; }
.article-card { display: flex; flex-direction: column; min-width: 0; padding: 24px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); color: var(--text); }
.article-meta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; color: var(--text-muted); font-size: 12px; }
.article-card h3 { font-size: 19px; margin: 20px 0 12px; }
.article-card h3 a:hover { color: var(--accent-dark); }
.article-card p { color: var(--text-muted); font-size: 14px; }
.article-card .text-link { margin-top: auto; font-size: 13px; align-self: flex-start; }
.callout { margin: 24px 0; padding: 20px 24px; border: 1px solid var(--border); border-left: 3px solid var(--accent-dark); border-radius: var(--r-control); background: var(--bg-panel); color: var(--text); }
.callout p:last-child { margin-bottom: 0; }
.callout-title { display: block; margin-bottom: 8px; font-weight: var(--weight-normal); }
.callout-warning { border-left-color: var(--warn); }
.table-scroll { max-width: 100%; min-width: 0; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-card); -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; color: var(--text); }
.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(--border);
  vertical-align: top; overflow-wrap: normal; word-break: normal;
}
.data-table th, .prose table th, .article-body table th { background: var(--bg-panel); color: var(--text); font-weight: var(--weight-normal); }
.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; text-align: left;
}
.prose table code, .article-body table code, .data-table code { overflow-wrap: anywhere; white-space: normal; }
.download-guide { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 24px; margin-top: 48px; padding: 28px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--bg-panel); color: var(--text); }
.download-guide > div { flex: 1 1 240px; min-width: 0; }
.download-guide h2 { font-size: 22px; margin: 0 0 10px; }
.download-guide p { margin: 0; color: var(--text-muted); }
.dl-fab {
  position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom)); z-index: 20;
  display: inline-flex; align-items: center; gap: 12px; max-width: calc(100% - 40px);
  padding: 12px 16px; border: 1px solid var(--border-strong); border-radius: var(--r-card);
  background: var(--surface); color: var(--text);
}
.dl-fab svg { width: 20px; height: 20px; color: var(--accent-dark); flex-shrink: 0; }
.dl-fab strong, .dl-fab small { display: block; }
.dl-fab strong { font-size: 14px; font-weight: var(--weight-normal); }
.dl-fab small { font-size: 12px; color: var(--text-muted); }
.dl-fab:hover { border-color: var(--accent-dark); }
.has-dl-fab .site-footer { padding-bottom: 110px; }
.preview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.swatch { min-width: 0; border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; background: var(--surface); color: var(--text); }
.swatch-sample { height: 64px; border-bottom: 1px solid var(--border); }
.swatch code { display: block; padding: 10px; font-size: 11px; }
.sw-bg { background: var(--bg); }
.sw-panel { background: var(--bg-panel); }
.sw-panel2 { background: var(--bg-panel-2); }
.sw-surface { background: var(--surface); }
.sw-border { background: var(--border); }
.sw-border-strong { background: var(--border-strong); }
.sw-chrome { background: var(--chrome-dot); }
.sw-accent { background: var(--accent); }
.sw-edge { background: var(--accent-edge); }
.sw-dark { background: var(--accent-dark); }
.sw-wash { background: var(--accent-wash); }
.sw-text { background: var(--text); }
.sw-muted { background: var(--text-muted); }
.sw-faint { background: var(--text-faint); }
.sw-success { background: var(--success); }
.sw-warn { background: var(--warn); }
.sw-error { background: var(--error); }
.sw-mask { background: var(--mask-solid); }
.sw-clear { background: var(--mask-clear); }
.sw-veil { background: var(--veil); }
.preview-stack { display: grid; gap: 24px; }
.preview-state-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.preview-display { font-size: var(--h1-size); line-height: 1.15; margin: 0; font-weight: var(--weight-normal); }
.preview-caption { margin-top: 16px; color: var(--text-muted); font-size: 13px; }
.static-language { position: relative; }
.static-language > summary { list-style: none; }
.static-language > summary::-webkit-details-marker { display: none; }
@media (max-width: 1000px) {
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-detail { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 720px) {
  .device-stage { width: 100%; height: 270px; overflow: hidden; }
  .device { transform: scale(.54); transform-origin: top left; }
  .preview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .feature-grid { grid-template-columns: minmax(0, 1fr); }
  .feature-card:first-child { grid-column: auto; }
  .feature-card { min-height: 280px; }
  [role="tablist"] { gap: 6px; }
  [role="tab"] { padding-inline: 14px; font-size: 13px; }
  .client-card { padding: 20px; }
  .toc { position: static; }
  .dl-fab { padding: 10px 12px; }
}
@media (max-width: 374px) {
  .device-stage { height: 230px; }
  .device { transform: scale(.45); }
}