/* Native HTML adaptation of current site.css, catalog.css and content.css. */
* { box-sizing: border-box; }
html { text-size-adjust: 100%; scroll-padding-top: 32px; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); font: 15px/1.75 var(--sans); font-synthesis: none; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--link); }
button, input, select, textarea { font: inherit; }
button, input, select { min-height: 44px; }
button, a, input, select { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }
::selection { background: var(--selection); color: var(--ink); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; top: -80px; left: 20px; z-index: 100; padding: 12px; background: var(--surface); }
.skip:focus { top: 10px; }
.shell { width: 100%; max-width: 1384px; margin-inline: auto; padding-inline: 32px; }
main.shell { padding-bottom: 64px; }
body[data-page="index"] main { max-width: 1104px; }
h1, h2, h3 { text-wrap: balance; overflow-wrap: anywhere; }
h2 { margin: 0 0 22px; font: 600 clamp(26px, 3vw, 32px)/1.24 var(--serif); }
h3 { margin: 32px 0 16px; font: 600 21px/1.35 var(--serif); }
.eyebrow, .mono { color: var(--muted); font: 12px/1.6 var(--mono); }
.eyebrow { letter-spacing: .1em; }
.lede { color: var(--muted); font-size: 16px; line-height: 1.78; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 9px 14px; border: 1px solid transparent; border-radius: 3px; background: var(--site-accent-soft); color: var(--link); font-size: 13px; }
.button:hover { background: var(--selection); }
.button.primary { background: var(--accent); color: var(--bg); font-weight: 600; }
.icon-button { width: 44px; height: 44px; flex-shrink: 0; padding: 0; border: 0; border-radius: 3px; background: transparent; color: var(--ink); font-size: 22px; }
.icon-button:hover { background: var(--soft); }
.text-link { color: var(--link); text-decoration: underline; text-underline-offset: 4px; }
.catalog-header { padding-top: 36px; margin-bottom: 24px; }
.catalog-header h1 { margin: 0; font: 500 clamp(42px, 5vw, 64px)/1.15 var(--serif); letter-spacing: -.035em; }
.catalog-header__description { max-width: 58ch; margin: 12px 0 0; color: var(--muted); font-size: 16px; }
.catalog-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin-top: 12px; font-size: 13px; }
.catalog-links a { display: inline-flex; align-items: center; min-height: 44px; }
.section { padding-block: 24px; }
#gallery { padding-top: 0; }
.filters { display: grid; grid-template-columns: minmax(200px, 27%) minmax(0, 1fr); grid-template-areas: "search controls" "results results"; align-items: center; gap: 12px; padding-block: 12px; }
.filters:has(.filter-summary:not([hidden])) { grid-template-areas: "search controls" "summary summary" "results results"; }
.filter-controls { grid-area: controls; display: flex; flex-wrap: wrap; gap: 12px; min-width: 0; }
.filter-toggle { display: none; }
.filter-summary { grid-area: summary; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 13px; }
.filter-summary span { overflow-wrap: anywhere; }
.filter-summary button { flex-shrink: 0; }
.filter-selects { flex: 1; display: flex; gap: 12px; min-width: 0; }
.filter-selects select { flex: 1 1 0; width: 0; text-overflow: ellipsis; }
.filters .tabs { grid-area: tabs; }
.filters :is(button, input, select) { height: 44px; min-height: 44px; padding-block: 0; }
.tabs { display: flex; flex-wrap: nowrap; gap: 12px; }
.tab { padding: 8px 12px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--muted); font-size: 13px; }
.tab:hover { background: var(--site-accent-soft); }
.tab[aria-pressed="true"] { background: var(--surface); color: var(--ink); }
.search { grid-area: search; min-width: 0; }
.search input, select { max-width: 100%; min-width: 0; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); color: var(--ink); font-size: 14px; }
.search input { width: 100%; }
.result-line { grid-area: results; display: flex; flex-direction: row; justify-content: space-between; gap: 8px; min-width: 0; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 24px; }
.provider-section { margin-block: 20px 40px; }
.provider-title { margin: 0 0 12px; color: var(--muted); font: 500 14px/1.6 var(--sans); }
.model-section { margin-block: 16px 28px; }
.model-title { margin: 0 0 12px; font: 600 24px/1.5 var(--sans); }
.effort-label { margin-bottom: 4px; }
.card { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 10px; padding: 0; min-width: 0; }
.card-cover { display: block; overflow: hidden; aspect-ratio: 3/2; border: 1px solid var(--line); border-radius: 3px; background: var(--soft); }
.card-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-body { min-width: 0; }
.card-meta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 8px; color: var(--muted); font: 11px/1.6 var(--mono); }
.badge { color: var(--muted); font: 12px/1.6 var(--sans); }
.badge.failed { color: #a33b29; }
:root[data-theme="dark"] .badge.failed { color: #f3b297; }
.card h2 { margin: 0; font: 600 22px/1.5 var(--sans); }
.card p { max-width: 65ch; margin: 8px 0; color: var(--muted); font-size: 14px; line-height: 1.75; }
.card-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; font-size: 12px; color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; color: var(--ink); }
.check input { width: 16px; height: 16px; min-height: 0; accent-color: var(--link); }
.card:has(input:checked) .card-cover { outline: 2px solid var(--link); outline-offset: 3px; }
.empty { grid-column: 1/-1; padding: 48px 16px; text-align: center; }
.empty p, .note { color: var(--muted); }
.note { margin: 24px 0; font-size: 13px; line-height: 1.8; }
.footer { padding: 24px 0 32px; color: var(--muted); font-size: 11px; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; }
.footer a { text-decoration: underline; text-underline-offset: 3px; }
.comparison-tray { position: sticky; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; max-width: 900px; margin: 12px auto; padding: 16px 20px; border-radius: 5px; background: var(--surface); color: var(--ink); box-shadow: var(--site-shadow-float); }
.selected-items { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.selection-chip { padding: 5px 10px; border: 0; border-radius: 3px; background: var(--soft); color: var(--ink); text-align: left; font-size: 12px; }
.selection-chip span { margin-left: 8px; }
.page-title { padding: 64px 0 32px; }
.page-title h1 { margin: 18px 0 24px; font: 600 clamp(38px, 4.8vw, 56px)/1.2 var(--serif); }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 10px; color: var(--muted); font-size: 12px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 16px 0 24px; }
.toolbar .push { margin-left: auto; }
.compare-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-bottom: 16px; }
.compare-slot { display: flex; align-items: start; gap: 8px; min-width: 0; }
.compare-slot label { flex: 1; }
.compare-slot > button { margin-top: 27px; }
.slot-identity { overflow-wrap: anywhere; line-height: 1.5; }
.add-compare { justify-self: start; align-self: start; }
body[data-page="compare"] .page-title { padding: 28px 0 16px; }
body[data-page="compare"] .page-title h1 { margin: 12px 0 0; font-size: 38px; }
body[data-page="compare"] .toolbar { margin: 12px 0; gap: 8px; }
.preview-note { margin: 12px 0; }
.preview-block { min-width: 0; }
.enlarge-preview { margin-bottom: 8px; }
.compare-picker label { display: grid; gap: 6px; min-width: 0; color: var(--muted); font-size: 12px; }
.compare-picker select { width: 100%; }
.compare-grid { display: grid; grid-template-columns: repeat(var(--columns, 2), minmax(0, 1fr)); gap: 24px; }
.compare-column { min-width: 0; }
.compare-column h2 { min-height: 2.8em; margin: 12px 0; font: 600 21px/1.4 var(--sans); }
.preview-surface { position: relative; width: 100%; overflow: hidden; aspect-ratio: 3/2; border: 1px solid var(--line); border-radius: 3px; background: var(--soft); }
.preview-surface.mobile { aspect-ratio: 390/844; max-width: 390px; margin-inline: auto; }
.preview-surface iframe { position: absolute; top: 0; left: 0; display: block; border: 0; transform-origin: top left; background: white; }
.preview-surface img { display: block; width: 100%; height: 100%; object-fit: contain; }
.preview-placeholder { position: absolute; inset: 0; display: grid; place-content: center; padding: 20px; text-align: center; color: var(--muted); font-size: 13px; }
.spec-list { margin: 18px 0 0; font-size: 13px; }
.spec-list div { display: flex; justify-content: space-between; gap: 24px; padding: 10px 0; }
.spec-list dt { flex-shrink: 0; color: var(--muted); }
.spec-list dd { min-width: 0; margin: 0; text-align: right; overflow-wrap: anywhere; }
body[data-page="entry"] main { max-width: 754px; }
.detail-layout { display: block; }
.detail-layout > *, .method-layout > * { min-width: 0; }
.detail-section, .detail-aside { margin-block: 64px; }
.detail-aside h3 { margin-top: 40px !important; }
.code { display: block; max-height: 470px; padding: 22px; border: 1px solid var(--line); border-radius: 5px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--site-code-bg); color: var(--site-code-text); font: 13px/1.8 var(--mono); scrollbar-width: thin; tab-size: 2; }
.hash { overflow-wrap: anywhere; color: var(--muted); font: 12px/1.8 var(--mono); }
body[data-page="method"] main { max-width: 1152px; }
body[data-page="method"] .page-title { margin-left: 272px; }
.method-layout { display: grid; grid-template-columns: 224px minmax(0, 1fr); gap: 48px; }
.toc { position: sticky; top: 32px; align-self: start; display: grid; gap: 8px; color: var(--muted); font-size: 13px; }
.toc a { display: flex; align-items: center; min-height: 44px; }
.prose { max-width: var(--reading); font: 16px/1.82 var(--sans); }
.prose section { margin-bottom: 64px; scroll-margin-top: 32px; }
.prose p, .prose li { color: var(--ink); }
.prose p { margin-block: 18px; }
.prose ul, .prose ol { padding-left: 1.45em; }
.prose li { padding-block: 4px; }
.prose a { color: var(--link); text-decoration: underline; text-underline-offset: 4px; }
summary { padding-block: 10px; color: var(--link); }
table { width: 100%; border-collapse: collapse; overflow-wrap: anywhere; font-size: 13px; }
th, td { padding: 14px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-weight: 600; }
td { color: var(--muted); }
.weight, .status-dot { color: var(--link); }
.weight { width: 65px; font-family: var(--mono); }
.toast { position: fixed; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 30; width: max-content; max-width: 90vw; padding: 12px 22px; border-radius: 5px; background: var(--ink); color: var(--bg); font-size: 13px; }
.dialog { width: calc(100% - 32px); border: 1px solid var(--line); background: var(--bg); color: var(--ink); box-shadow: var(--site-shadow-float); }
.dialog-head { display: flex; justify-content: space-between; gap: 20px; }
body:has(dialog[open]) { overflow: hidden; }
@media (max-width: 959px) {
  .compare-grid, .compare-picker { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .method-layout { grid-template-columns: 160px minmax(0, 1fr); gap: 32px; }
  body[data-page="method"] .page-title { margin-left: 192px; }
}
@media (max-width: 639px) {
  .filters { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "search toggle" "results results"; }
  .filters:has(.filter-toggle[aria-expanded="true"]) { grid-template-areas: "search toggle" "controls controls" "results results"; }
  .filters:has(.filter-summary:not([hidden])) { grid-template-areas: "search toggle" "summary summary" "results results"; }
  .filters:has(.filter-toggle[aria-expanded="true"]):has(.filter-summary:not([hidden])) { grid-template-areas: "search toggle" "controls controls" "summary summary" "results results"; }
  .filter-toggle { display: inline-flex; grid-area: toggle; }
  .filter-toggle[aria-expanded="false"] + .filter-controls { display: none; }
  .filter-selects { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; flex-basis: 100%; }
  .filter-selects select { width: 100%; }
  .result-line { flex-wrap: wrap; font-size: 12px; line-height: 1.5; }
}
@media (max-width: 639px) {
  .shell { padding-inline: 24px; }
  .catalog-header { padding-top: 24px; margin-bottom: 16px; }
  .catalog-links { gap: 8px 16px; }
  .search input, .filters select { font-size: 16px; }
  .card { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 0; }
  .card h2 { font-size: 18px; }
  .card p { font-size: 13px; }
  .card-meta { font-size: 10px; gap: 4px 8px; }
  .card-bottom { align-items: start; flex-direction: column; }
  .page-title { padding-top: 36px; }
  .page-title h1 { font-size: clamp(36px, 10.5vw, 48px); line-height: 1.24; }
  .method-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  body[data-page="method"] .page-title { margin-left: 0; }
  .toc { position: static; display: flex; flex-wrap: wrap; gap: 4px 20px; }
  .compare-grid { grid-template-columns: minmax(0, 1fr); }
  .toolbar .push { margin-left: 0; }
  .compare-picker { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .compare-picker select { font-size: 16px; }
  body[data-page="compare"] .page-title { padding-top: 20px; }
  .comparison-tray { padding: 14px; }
  .selected-items { max-height: 100px; overflow-y: auto; padding: 3px; }
  .detail-section, .detail-aside { margin-block: 48px; }
  th, td { padding: 10px 6px; }
  .code { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
/* Prompt reader: only the text scrolls; actions remain within reach. */
.dialog { padding: 0; max-width: 800px; max-height: min(88dvh, 860px); overflow: hidden; border-radius: 5px; }
.dialog[open] { display: flex; flex-direction: column; animation: prompt-enter 180ms ease-out; }
.dialog::backdrop { background: rgba(20, 24, 23, 0.55); backdrop-filter: blur(5px); }
.dialog-head { flex: 0 0 auto; padding: 26px 28px 12px; align-items: flex-start; }
.dialog-head h2 { margin-top: 10px; font: 32px/1.3 var(--serif); }
.dialog-head .icon-button { flex-shrink: 0; background: var(--surface); }
#dialog-description { margin: 0; padding: 0 28px 20px; color: var(--muted); font-size: 14px; }
.dialog-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px 28px; border-block: 1px solid var(--line); background: var(--surface); scrollbar-width: thin; }
.dialog-body:focus-visible { outline-offset: -4px; }
#dialog-prompt { margin: 0; max-height: none; white-space: pre-wrap; overflow-wrap: anywhere; font: 15px/1.95 var(--sans); }
.dialog-footer { flex-shrink: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 18px; align-items: center; padding: 16px 28px; }
.dialog-footer details { min-width: 0; font-size: 12px; }
.dialog-footer .hash { margin: 0 0 6px; }
#dialog-status { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--link); }
#dialog-status:not(:empty) { padding-top: 10px; }
@keyframes prompt-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 620px) {
  .dialog { max-height: 90dvh; width: calc(100% - 24px); }
  .dialog-head { padding: 20px 18px 12px; gap: 8px; }
  .dialog-head h2 { font-size: 26px; }
  .dialog-head .eyebrow { font-size: 9px; letter-spacing: 0.07em; }
  #dialog-description { padding: 0 18px 16px; }
  .dialog-body { padding: 18px; }
  #dialog-prompt { font-size: 14px; }
  .dialog-footer { padding: 12px 18px; gap: 4px; grid-template-columns: 1fr; }
  .dialog-footer .button { grid-row: 1; }
}

/* A separate fixed-viewport canvas keeps the underlying observation intact. */
.preview-dialog { width: calc(100% - 24px); max-width: 1320px; height: 92dvh; max-height: 92dvh; }
.preview-dialog .dialog-head { padding: 12px 16px 4px; align-items: center; }
.preview-dialog .dialog-head h2 { margin: 0; font: 600 18px/1.4 var(--sans); }
.preview-dialog-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 16px; padding: 8px 16px; }
.preview-dialog-controls label { display: grid; gap: 4px; font-size: 12px; }
.preview-scale-note { margin: 0; padding: 4px 16px 12px; color: var(--muted); font-size: 13px; }
.preview-scroll { min-height: 0; flex: 1; overflow: auto; padding: 0 16px 16px; overscroll-behavior: contain; }
.preview-scroll .preview-surface { max-width: none; margin: 0; flex-shrink: 0; }

/* Keep the observation sequence ahead of optional metadata. */
.compare-locator { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding-block: 12px; background: var(--bg); }
.compare-locator label { display: grid; gap: 4px; min-width: 0; flex: 1; }
.compare-locator select { width: 100%; min-width: 0; }
.compare-column h2 { scroll-margin-top: 130px; }
.compare-column h2 .eyebrow { display: block; margin-bottom: 6px; }
.compare-column h2 a { overflow-wrap: anywhere; }
.compare-specs { margin-top: 32px; scroll-margin-top: 130px; }
.compare-specs section { min-width: 0; }
.compare-specs h3 { overflow-wrap: anywhere; }
.compare-specs .text-link { display: inline-block; margin-top: 16px; }
@supports (grid-template-rows: subgrid) {
  .compare-column { display: grid; grid-template-rows: subgrid; grid-row: span 2; }
}
#selection-toggle { white-space: nowrap; }
@media (max-width: 639px), (max-height: 500px) {
  .compare-locator { position: sticky; top: 0; z-index: 4; font-size: 12px; gap: 8px; }
  .comparison-tray { gap: 6px; padding: 8px; }
  .comparison-tray .actions { gap: 4px; }
  .comparison-tray .button { padding: 8px 6px; font-size: 12px; min-height: 44px; }
  .selected-items { max-height: min(120px, 30dvh); overflow-y: auto; }
}

/* Keep method text readable and long commands independently scrollable. */
body[data-page="method"] { min-width: 0; }
.prose table { table-layout: fixed; font-size: 16px; line-height: 1.82; }
.prose th, .prose td { overflow-wrap: anywhere; }
.prose th[scope="row"] { width: 30%; }
.prose .rubric-table th:first-child { width: 27%; }
.prose .rubric-table th:nth-child(2) { width: 18%; }
.prose .code { min-width: 0; max-width: 100%; font-size: 14px; }
#method-commands { white-space: pre; overflow-wrap: normal; overscroll-behavior: contain; }
.prose .code:focus-visible { outline-offset: 2px; }
.card { scroll-margin-top: 24px; }
/* Short viewports reserve most of the prompt dialog for the text. */
@media (max-height: 500px) {
  #prompt-dialog { height: calc(100dvh - 24px); max-height: calc(100dvh - 24px); }
  #prompt-dialog .dialog-head { padding: 8px 16px 4px; align-items: center; }
  #prompt-dialog .dialog-head .eyebrow { font-size: 9px; line-height: 1.2; }
  #prompt-dialog .dialog-head h2 { margin: 2px 0 0; font-size: 20px; line-height: 1.2; }
  #prompt-dialog #dialog-description { padding: 0 16px 6px; font-size: 12px; }
  #prompt-dialog .dialog-body { flex: 1; padding: 12px 16px; }
  #prompt-dialog .dialog-footer { padding: 6px 16px; gap: 0 12px; grid-template-columns: minmax(0, 1fr) auto; max-height: 120px; overflow-y: auto; }
  #prompt-dialog .dialog-footer .button { grid-row: auto; }
  #prompt-dialog .dialog-footer summary { padding-block: 4px; }
  #prompt-dialog #dialog-status:not(:empty) { padding-top: 2px; }
}
