:root {
  --ink: #10242a;
  --ink-2: #29434a;
  --muted: #687b7e;
  --paper: #f6f3ea;
  --paper-2: #ebe7db;
  --white: #fffdf8;
  --line: #d7d4c9;
  --teal: #0d766e;
  --teal-dark: #07544f;
  --aqua: #7bc8bc;
  --copper: #b8663d;
  --gold: #c79727;
  --blue: #3e7893;
  --danger: #9d3f35;
  --shadow: 0 20px 50px rgb(23 42 44 / 10%);
  --sidebar: 248px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
code, kbd, .number { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

.skip-link { position: fixed; top: -50px; left: 16px; z-index: 100; padding: 10px 14px; color: white; background: var(--ink); }
.skip-link:focus { top: 12px; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar); padding: 28px 20px 20px;
  color: #eef4ef; background: var(--ink); display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 13px; text-decoration: none; margin: 0 9px 45px; }
.brand b { display: block; letter-spacing: .19em; font-size: 17px; }
.brand small { display: block; margin-top: 4px; color: #93aaa9; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.brand-mark { display: flex; align-items: flex-end; gap: 2px; width: 33px; height: 31px; transform: skewX(-12deg); }
.brand-mark i { display: block; width: 7px; border-radius: 1px 1px 0 0; background: var(--aqua); }
.brand-mark i:nth-child(1) { height: 8px; opacity: .42; }
.brand-mark i:nth-child(2) { height: 15px; opacity: .62; }
.brand-mark i:nth-child(3) { height: 23px; opacity: .8; }
.brand-mark i:nth-child(4) { height: 31px; }

#primary-nav { display: grid; gap: 6px; }
#primary-nav a { display: flex; align-items: center; gap: 14px; padding: 11px 12px; border-radius: 5px; color: #aebfbd; text-decoration: none; font-size: 13px; transition: .18s ease; }
#primary-nav a span { width: 22px; color: #657d7c; font: 9px "SFMono-Regular", monospace; }
#primary-nav a:hover, #primary-nav a.active { color: white; background: rgb(255 255 255 / 8%); }
#primary-nav a.active span { color: var(--aqua); }
.sidebar-foot { margin-top: auto; }
.trust-key { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 10px; padding: 17px 11px; border-block: 1px solid rgb(255 255 255 / 10%); }
.trust-key p { grid-column: 1 / -1; margin: 0 0 3px; color: #718988; font-size: 9px; letter-spacing: .13em; text-transform: uppercase; }
.trust-key span { font-size: 9px; color: #9cafad; white-space: nowrap; }
.trust-key span:last-child { grid-column: 1 / -1; }
.tier-dot { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--muted); }
.tier-dot.exact { background: var(--teal); }
.tier-dot.gold { background: var(--gold); }
.tier-dot.consensus { background: var(--blue); }
.tier-dot.archived { background: #889391; }
.account-button { width: 100%; margin-top: 16px; display: flex; align-items: center; gap: 11px; padding: 9px; color: white; border: 0; border-radius: 5px; background: transparent; text-align: left; cursor: pointer; }
.account-button:hover { background: rgb(255 255 255 / 7%); }
.account-button .avatar { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #4f6968; border-radius: 50%; color: var(--aqua); font-size: 11px; }
.account-button b, .account-button small { display: block; }
.account-button b { font-size: 11px; font-weight: 600; }
.account-button small { color: #849b99; font-size: 9px; margin-top: 2px; }

.workspace { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; top: 0; z-index: 20; height: 66px; padding: 0 36px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgb(246 243 234 / 92%); backdrop-filter: blur(12px); }
.menu-button { display: none; }
.snapshot-status { display: flex; align-items: center; gap: 9px; color: var(--muted); font: 10px "SFMono-Regular", monospace; }
.status-light { width: 7px; height: 7px; border-radius: 50%; background: #9ba4a1; box-shadow: 0 0 0 4px rgb(120 130 128 / 10%); }
.snapshot-status.ok .status-light { background: var(--teal); box-shadow: 0 0 0 4px rgb(13 118 110 / 12%); }
.top-actions { display: flex; align-items: center; gap: 22px; }
.search-button { display: flex; gap: 45px; align-items: center; padding: 7px 9px 7px 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; background: rgb(255 255 255 / 45%); font-size: 11px; cursor: pointer; }
kbd { padding: 1px 5px; border: 1px solid #cecabe; border-radius: 3px; background: var(--paper-2); font-size: 9px; }
.docs-link { color: var(--ink-2); font-size: 11px; text-decoration: none; }
.docs-link:hover { color: var(--teal); }

main { min-height: calc(100vh - 66px); }
.view { display: none; padding: 54px clamp(30px, 5vw, 78px) 80px; animation: appear .2s ease; }
.view.active { display: block; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } }
.eyebrow { margin: 0 0 9px; color: var(--teal); font-size: 9px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
h1, h2, h3 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 400; letter-spacing: -.025em; }
h1 { font-size: clamp(42px, 5vw, 67px); line-height: .98; }
h2 { font-size: 27px; line-height: 1.1; }
h3 { font-size: 19px; }
.muted { color: var(--muted); }

.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(310px, .75fr); gap: 9vw; align-items: center; min-height: 385px; padding-bottom: 54px; }
.hero h1 em { color: var(--teal); font-weight: 400; }
.hero-copy { max-width: 570px; margin: 25px 0 0; color: var(--ink-2); font: 17px/1.65 Georgia, serif; }
.hero-diagram { position: relative; height: 245px; display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; gap: 4px; }
.hero-diagram::after { content: "confidence"; position: absolute; right: -31px; top: 62px; color: var(--muted); font-size: 8px; letter-spacing: .16em; text-transform: uppercase; transform: rotate(-90deg); }
.tier-step { min-height: 43px; padding: 0 14px; display: flex; justify-content: space-between; align-items: center; border-left: 3px solid; background: rgb(255 255 255 / 44%); clip-path: polygon(0 0, 96% 0, 100% 100%, 0 100%); }
.tier-step span { font-size: 10px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.tier-step b { font: 17px "SFMono-Regular", monospace; }
.tier-step-1 { width: 100%; border-color: #899694; color: #5e6f6e; }
.tier-step-2 { width: 82%; border-color: var(--blue); color: var(--blue); }
.tier-step-3 { width: 64%; border-color: var(--gold); color: #8d6a18; }
.tier-step-4 { width: 46%; border-color: var(--teal); color: var(--teal); }

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); background: var(--white); box-shadow: 0 8px 25px rgb(23 42 44 / 4%); }
.metric-grid article { min-height: 127px; padding: 24px; border-right: 1px solid var(--line); }
.metric-grid article:last-child { border-right: 0; }
.metric-grid span, .metric-grid small { display: block; }
.metric-grid span { color: var(--muted); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; }
.metric-grid strong { display: block; margin: 10px 0 6px; font: 29px "SFMono-Regular", monospace; font-weight: 450; }
.metric-grid small { color: #82908f; font-size: 10px; }

.overview-grid { display: grid; grid-template-columns: 1.45fr .85fr; gap: 20px; margin-top: 20px; }
.panel { padding: 28px; border: 1px solid var(--line); background: var(--white); }
.panel-heading, .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.panel-heading a, .section-heading a { color: var(--teal); font-size: 10px; text-decoration: none; }
.consensus-figure { display: grid; grid-template-columns: repeat(3, 1fr); margin: 32px 0 25px; }
.consensus-figure div { padding-left: 18px; border-left: 2px solid var(--paper-2); }
.consensus-figure strong, .consensus-figure span { display: block; }
.consensus-figure strong { font: 27px "SFMono-Regular", monospace; }
.consensus-figure span { margin-top: 5px; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .07em; }
.spread-line { display: flex; justify-content: space-between; gap: 20px; padding: 14px 16px; background: var(--paper); color: var(--muted); font-size: 10px; }
.spread-line code { color: var(--ink); }
.warning { display: grid; gap: 4px; margin-top: 14px; padding: 12px 14px; border-left: 3px solid var(--danger); background: #fbefeb; }
.warning b { color: var(--danger); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.warning span { color: #744c46; font-size: 10px; line-height: 1.5; }
.contract-panel dl { margin: 27px 0 0; }
.contract-panel dl div { display: grid; grid-template-columns: 80px 1fr; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.contract-panel dt { color: var(--teal); font-size: 9px; font-weight: 700; text-transform: uppercase; }
.contract-panel dd { margin: 0; color: var(--ink-2); font: 12px/1.4 Georgia, serif; }
.set-strip { margin-top: 58px; }
.section-heading { margin-bottom: 20px; }

.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 35px; }
.page-heading h1 { font-size: clamp(38px, 4vw, 54px); }
.page-heading p:not(.eyebrow) { max-width: 650px; margin: 13px 0 0; color: var(--muted); font: 14px/1.55 Georgia, serif; }
.heading-actions { display: flex; gap: 9px; }
button.primary, button.secondary, .load-more { min-height: 36px; padding: 0 16px; border-radius: 3px; cursor: pointer; font-size: 10px; font-weight: 650; letter-spacing: .04em; }
button.primary { color: white; border: 1px solid var(--teal); background: var(--teal); }
button.primary:hover { background: var(--teal-dark); }
button.primary.small { min-height: 31px; padding: 0 11px; }
button.secondary, .load-more { color: var(--ink); border: 1px solid var(--line); background: transparent; }
button.secondary:hover, .load-more:hover { border-color: var(--teal); color: var(--teal); }
button:disabled { cursor: not-allowed; opacity: .5; }

.filter-bar { display: grid; grid-template-columns: repeat(5, 1fr) auto; gap: 10px; align-items: end; padding: 18px; border: 1px solid var(--line); background: var(--white); }
.filter-bar.slim { grid-template-columns: repeat(3, minmax(150px, 240px)) auto; }
label { color: var(--muted); font-size: 9px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
input, select, textarea { width: 100%; margin-top: 7px; padding: 9px 10px; color: var(--ink); border: 1px solid #cbc9c0; border-radius: 2px; outline: none; background: #fffefa; font-size: 11px; letter-spacing: normal; text-transform: none; }
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 2px rgb(13 118 110 / 9%); }
.archived-gate { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 11px; padding: 12px 17px; border: 1px dashed #c5c3b9; color: var(--muted); background: rgb(255 255 255 / 34%); }
.archived-gate b, .archived-gate span { display: block; font-size: 9px; }
.archived-gate b { margin-bottom: 3px; color: var(--ink-2); }
.switch { display: flex; align-items: center; gap: 8px; white-space: nowrap; cursor: pointer; }
.switch input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.switch:focus-within > span { outline: 2px solid var(--teal); outline-offset: 3px; }
.switch > span { position: relative; width: 28px; height: 15px; border-radius: 9px; background: #bdc4c1; }
.switch > span::after { content: ""; position: absolute; width: 11px; height: 11px; top: 2px; left: 2px; border-radius: 50%; background: white; transition: .15s; }
.switch input:checked + span { background: var(--copper); }
.switch input:checked + span::after { left: 15px; }
.result-meta { min-height: 38px; display: flex; align-items: center; gap: 15px; color: var(--muted); font: 9px "SFMono-Regular", monospace; }
.provenance-chip { padding: 3px 7px; border: 1px solid var(--line); border-radius: 12px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--white); }
table { width: 100%; border-collapse: collapse; font-size: 10px; }
th { padding: 11px 13px; color: var(--muted); border-bottom: 1px solid var(--line); background: var(--paper); text-align: left; font-size: 8px; letter-spacing: .1em; text-transform: uppercase; }
td { padding: 13px; border-bottom: 1px solid #e5e2d9; vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f9f8f2; }
td b, td small { display: block; }
td small { margin-top: 4px; color: var(--muted); }
.value { color: var(--ink); font: 11px "SFMono-Regular", monospace; white-space: nowrap; }
.tier-badge { display: inline-block; padding: 4px 7px; border-radius: 2px; font-size: 8px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.tier-badge.exact { color: #07564f; background: #d8eee9; }
.tier-badge.gold { color: #745914; background: #f3e8c7; }
.tier-badge.consensus { color: #285d76; background: #dcebf0; }
.tier-badge.archived { color: #656d6b; background: #e5e7e3; }
.load-more { display: block; margin: 17px auto 0; }

.split-browser { display: grid; grid-template-columns: minmax(250px, .72fr) minmax(420px, 1.28fr); min-height: 510px; border: 1px solid var(--line); background: var(--white); }
.browser-list { max-height: 700px; overflow: auto; border-right: 1px solid var(--line); }
.browser-item { width: 100%; padding: 15px 17px; display: flex; justify-content: space-between; gap: 15px; color: var(--ink); border: 0; border-bottom: 1px solid #e4e1d7; background: transparent; text-align: left; cursor: pointer; }
.browser-item:hover, .browser-item.active { background: var(--paper); }
.browser-item.active { box-shadow: inset 3px 0 var(--teal); }
.browser-item b, .browser-item small { display: block; }
.browser-item b { font-size: 11px; }
.browser-item small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.browser-item > span:last-child { color: var(--muted); font: 9px "SFMono-Regular", monospace; white-space: nowrap; }
.detail-panel { min-width: 0; padding: 30px; background: var(--white); }
.detail-panel.empty { display: grid; place-items: center; color: var(--muted); text-align: center; font: 15px/1.5 Georgia, serif; }
.detail-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.detail-head h2 { overflow-wrap: anywhere; }
.hash { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font: 8px "SFMono-Regular", monospace; }
.detail-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 22px 0; background: var(--line); border: 1px solid var(--line); }
.detail-facts div { padding: 13px; background: var(--paper); }
.detail-facts span, .detail-facts b { display: block; }
.detail-facts span { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.detail-facts b { margin-top: 5px; font-size: 11px; }
.atom-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; max-height: 190px; overflow: auto; padding: 10px; background: var(--paper); font: 9px "SFMono-Regular", monospace; }
.atom-list span { display: flex; gap: 8px; }
.atom-list b { color: var(--teal); }

.tabs { display: flex; gap: 2px; margin-bottom: 17px; border-bottom: 1px solid var(--line); }
.tabs button { padding: 10px 16px; color: var(--muted); border: 0; border-bottom: 2px solid transparent; background: none; cursor: pointer; font-size: 10px; }
.tabs button.active { color: var(--teal); border-bottom-color: var(--teal); }
.registry-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.registry-card { min-height: 145px; padding: 19px; border: 1px solid var(--line); background: var(--white); }
.registry-card:hover { border-color: #9db3ae; }
.registry-card .card-id { color: var(--teal); font: 9px "SFMono-Regular", monospace; }
.registry-card h3 { margin: 8px 0 13px; }
.registry-card p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.registry-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 14px; }
.registry-meta span { padding: 3px 6px; background: var(--paper); color: var(--ink-2); font-size: 8px; }

.ladder-browser .browser-list { max-height: 760px; }
.ladder-controls { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 8px; align-items: end; margin: 20px 0; }
.chart-shell { position: relative; min-height: 290px; padding: 15px; border: 1px solid var(--line); background: #fffefa; }
.chart-shell svg { width: 100%; height: 260px; overflow: visible; }
.chart-axis { stroke: #bfc5c1; stroke-width: 1; }
.chart-grid { stroke: #e5e4dc; stroke-width: 1; }
.chart-line { fill: none; stroke: var(--teal); stroke-width: 2; }
.chart-point { fill: var(--white); stroke: var(--teal); stroke-width: 2; }
.chart-label { fill: var(--muted); font: 8px "SFMono-Regular", monospace; }
.chart-empty { display: grid; place-items: center; min-height: 250px; color: var(--muted); font: 13px Georgia, serif; }

.set-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.set-cards.compact { grid-template-columns: repeat(4, 1fr); }
.set-card { position: relative; min-height: 165px; padding: 20px; overflow: hidden; border: 1px solid var(--line); background: var(--white); cursor: pointer; }
.set-card::after { content: ""; position: absolute; right: -24px; bottom: -32px; width: 100px; height: 100px; border: 18px solid var(--paper-2); border-radius: 50%; }
.set-card:hover { border-color: var(--teal); }
.set-card h3 { max-width: 80%; margin: 9px 0; }
.set-card p { max-width: 85%; color: var(--muted); font-size: 9px; line-height: 1.45; }
.set-card .completeness { position: absolute; right: 13px; top: 13px; z-index: 1; color: var(--teal); font: 9px "SFMono-Regular", monospace; }
.set-card.draft .completeness { color: var(--copper); }
.set-detail { margin-top: 18px; border: 1px solid var(--line); }
.version-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.version-row:last-child { border-bottom: 0; }
.version-row code { color: var(--muted); font-size: 8px; }
.version-status { padding: 4px 7px; color: var(--teal); background: #dfeeea; font-size: 8px; text-transform: uppercase; }
.version-status.draft { color: var(--copper); background: #f6e7dd; }

.account-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 15px; }
.account-grid .panel:last-child { grid-column: 1 / -1; }
.profile-name { margin: 7px 0 3px; font: 25px Georgia, serif; }
.role-list { display: flex; gap: 6px; margin: 18px 0; }
.role-list span { padding: 5px 8px; color: var(--teal-dark); background: #dfeeea; font-size: 8px; text-transform: uppercase; }
.token-row { display: grid; grid-template-columns: 1fr auto; gap: 15px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.token-row b, .token-row small { display: block; }
.token-row b { font-size: 10px; }
.token-row small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.text-button { padding: 4px 0; color: var(--teal); border: 0; border-bottom: 1px solid currentColor; background: transparent; cursor: pointer; font-size: 10px; }

dialog { color: var(--ink); border: 0; box-shadow: var(--shadow); }
dialog::backdrop { background: rgb(10 28 32 / 62%); backdrop-filter: blur(3px); }
.auth-dialog { width: min(540px, calc(100vw - 28px)); padding: 38px 44px 34px; background: var(--white); }
.auth-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 34px; letter-spacing: .14em; }
.auth-brand .brand-mark { width: 24px; height: 24px; }
.auth-brand .brand-mark i { width: 5px; }
.auth-brand .brand-mark i:nth-child(1) { height: 6px; }.auth-brand .brand-mark i:nth-child(2) { height: 11px; }.auth-brand .brand-mark i:nth-child(3) { height: 17px; }.auth-brand .brand-mark i:nth-child(4) { height: 24px; }
.dialog-close { position: absolute; right: 17px; top: 13px; color: var(--muted); border: 0; background: none; font-size: 24px; cursor: pointer; }
.auth-copy { margin-bottom: 25px; }
.auth-copy > p:last-child { color: var(--muted); font: 12px/1.5 Georgia, serif; }
.auth-form { display: grid; gap: 15px; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-status { min-height: 14px; margin: 0; color: var(--danger); font-size: 9px; }
.activation-link { display: block; margin: 20px auto 0; color: var(--muted); border: 0; background: none; cursor: pointer; font-size: 9px; }
.terms-check { display: flex; gap: 8px; align-items: start; padding: 10px; border: 1px solid var(--line); }
.terms-check input { width: auto; margin: 2px 0 0; }
.terms-check span { color: var(--ink-2); font-size: 10px; line-height: 1.4; text-transform: none; letter-spacing: normal; }
.terms-document { border: 1px solid var(--line); background: var(--paper); }
.terms-document .terms-check { border: 0; }
.terms-document details { padding: 0 10px 10px; }
.terms-document summary { color: var(--teal); cursor: pointer; font-size: 9px; }
.terms-document pre { max-height: 210px; margin: 10px 0 0; padding: 12px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid var(--line); background: var(--white); font: 10px/1.55 "SFMono-Regular", monospace; }
.search-dialog { width: min(720px, calc(100vw - 28px)); min-height: 350px; padding: 35px; background: var(--white); }
.search-dialog > form { position: absolute; right: 15px; top: 12px; }
.search-dialog > form button { border: 0; background: none; font-size: 20px; cursor: pointer; }
.search-dialog label span { display: block; margin-bottom: 8px; }
.search-dialog input { padding: 14px; font-size: 16px; }
#search-results { margin-top: 20px; }
.search-result { display: flex; justify-content: space-between; width: 100%; padding: 11px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; cursor: pointer; }
.token-dialog { width: min(470px, calc(100vw - 28px)); padding: 32px; background: var(--white); }
.token-dialog form { display: grid; gap: 15px; }
.token-dialog fieldset { display: flex; gap: 18px; padding: 12px; border: 1px solid var(--line); }
.token-dialog fieldset label { display: flex; gap: 7px; align-items: center; text-transform: none; }
.token-dialog fieldset input { width: auto; margin: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.secret-once { padding: 13px; overflow-wrap: anywhere; border: 1px solid var(--copper); background: #fbf0e8; font: 10px/1.5 "SFMono-Regular", monospace; user-select: all; }
.toast { position: fixed; z-index: 100; right: 25px; bottom: 25px; max-width: 360px; padding: 12px 16px; color: white; border-radius: 3px; background: var(--ink); box-shadow: var(--shadow); font-size: 10px; opacity: 0; transform: translateY(12px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: none; }
.skeleton { height: 70px; border-radius: 3px; background: linear-gradient(90deg, #ece9df 20%, #f6f3ea 45%, #ece9df 70%); background-size: 300% 100%; animation: shimmer 1.4s infinite; }
.skeleton.wide { grid-column: 1 / -1; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.error-state { padding: 25px; color: var(--danger); border: 1px solid #e3bdb7; background: #faefeb; font-size: 11px; }

@media (max-width: 1080px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-grid article:nth-child(2) { border-right: 0; }
  .metric-grid article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .filter-bar { grid-template-columns: repeat(3, 1fr); }
  .registry-grid { grid-template-columns: repeat(2, 1fr); }
  .set-cards.compact { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 800px) {
  :root { --sidebar: 0px; }
  .sidebar { width: 248px; transform: translateX(-100%); transition: .2s; box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: none; }
  .workspace { margin-left: 0; }
  .menu-button { display: block; color: var(--ink); border: 0; background: none; font-size: 18px; }
  .topbar { padding: 0 18px; }
  .docs-link { display: none; }
  .view { padding: 38px 18px 65px; }
  .hero { grid-template-columns: 1fr; min-height: auto; gap: 35px; }
  .hero-diagram { max-width: 430px; }
  .overview-grid, .split-browser, .account-grid { grid-template-columns: 1fr; }
  .browser-list { max-height: 360px; border-right: 0; border-bottom: 1px solid var(--line); }
  .account-grid .panel:last-child { grid-column: auto; }
  .set-cards { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .top-actions { gap: 8px; }
  .search-button span { display: none; }
  .search-button { gap: 0; }
  .snapshot-status { max-width: 180px; overflow: hidden; white-space: nowrap; }
  .metric-grid, .overview-grid, .registry-grid, .set-cards.compact { grid-template-columns: 1fr; }
  .metric-grid article { border-right: 0; border-bottom: 1px solid var(--line); }
  .filter-bar, .filter-bar.slim, .ladder-controls { grid-template-columns: 1fr; }
  .page-heading, .archived-gate { align-items: stretch; flex-direction: column; }
  .consensus-figure { grid-template-columns: 1fr; gap: 12px; }
  .detail-facts { grid-template-columns: 1fr 1fr; }
  .auth-dialog { padding: 30px 22px; }
  .two-fields { grid-template-columns: 1fr; }
}

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

/* Application workflows share the existing scientific workspace vocabulary. */
[hidden] { display: none !important; }
.sidebar { overflow-y: auto; }
.license-link { display: block; margin: 20px 10px 12px; font-size: 10px; color: #aebfbd; }
#primary-nav { gap: 2px; }
.brand { margin-bottom: 28px; }
.section-space { margin-top: 28px; }
.detail-panel h3 { margin: 24px 0 12px; }
.notice { padding: 14px 18px; border-left: 3px solid var(--copper); background: var(--paper-2); font-size: 13px; line-height: 1.6; }
.input-preview { max-height: 440px; overflow: auto; white-space: pre; padding: 20px; border: 1px solid var(--line); border-radius: 5px; background: var(--white); font: 12px/1.65 "SFMono-Regular", monospace; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.task-link { font: inherit; color: var(--teal); text-align: left; border: 0; padding: 0; background: none; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.detail-json { overflow: auto; font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.data-table { margin-top: 18px; }
.data-table td { max-width: 300px; overflow-wrap: anywhere; }
.view .filter-bar { flex-wrap: wrap; }
.filter-bar input, .filter-bar select { min-width: 0; }
#task-filters { grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); }
.admin-card { margin-top: 15px; padding: 18px; border: 1px solid var(--line); border-radius: 5px; }
.admin-card p { white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-card h3 { margin: 0; }
#library-list .browser-item { overflow-wrap: anywhere; }
#library-list .browser-item small { word-break: break-word; }
#decision-form { display: grid; gap: 18px; }
#decision-form label { display: grid; gap: 8px; font-size: 12px; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [role="button"]:focus-visible { outline: 2px solid var(--teal); outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media (max-width: 700px) { .detail-actions { flex-direction: column; } .snapshot-status { max-width: 55%; overflow-wrap: anywhere; } .input-preview { max-width: 100%; } }
@media (min-width: 801px) and (max-width: 1100px) {
  .split-browser, .hero { grid-template-columns: minmax(0, 1fr); }
  .filter-bar.slim { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-diagram { max-width: 430px; }
}
.terms-editor { width: min(760px, calc(100vw - 30px)); max-height: 90vh; overflow-y: auto; padding: 28px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--white); }
#terms-form { display: grid; gap: 16px; }
#terms-form label, #export-dialog label { display: grid; gap: 7px; font-size: 12px; }
#terms-form .terms-check { display: flex; align-items: center; }
#terms-form textarea { width: 100%; padding: 12px; resize: vertical; }
#export-command { padding: 16px; border: 1px solid var(--line); background: var(--paper); user-select: all; }
.selected-card { outline: 2px solid var(--teal); outline-offset: 2px; }
#login-form.terms-only > label, #login-form.terms-only > button { display: none; }

#evaluation-form { grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); }
#evaluation-form label, #reference-check .detail-actions label { min-width: 0; }
#evaluation-result .data-table table { min-width: 850px; }
#benchmark-result .data-table table { min-width: 760px; }
#testset-detail .detail-actions label { min-width: 0; max-width: 100%; }

#benchmark-result { scroll-margin-top: 82px; }
#benchmark-result .data-table td:first-child { min-width: 150px; white-space: nowrap; }
