:root {
  --ink: #171d1e;
  --ink-2: #222a2c;
  --paper: #f4f3ed;
  --line: #cfd0c9;
  --green: #55df9d;
  --green-dark: #087a4f;
  --amber: #ffd166;
  --coral: #ff745d;
  --white: #fff;
  font-family: "Geist", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; overflow-x: hidden; background: var(--paper); color: var(--ink); }
button, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.app { min-height: 100vh; overflow-x: hidden; }
.topbar { position: sticky; top: 0; z-index: 10; height: 58px; display: grid; grid-template-columns: 1fr auto 38px; align-items: center; gap: 14px; padding: 0 18px; color: white; background: #101718; border-bottom: 1px solid #364144; }
.brand { min-width: 0; display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 800; white-space: nowrap; }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--green); color: var(--green); font: 800 10px/1 ui-monospace, Menlo, monospace; }
.library-status { display: flex; align-items: center; gap: 8px; color: #d7dfdf; font: 650 10px/1 ui-monospace, Menlo, monospace; white-space: nowrap; }
.library-status span { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.library-status.ready span { background: var(--green); box-shadow: 0 0 0 3px rgba(85,223,157,.12); }
.icon-button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #485457; border-radius: 6px; color: white; background: transparent; }
.icon-button:hover, .icon-button:focus-visible { color: var(--green); border-color: var(--green); outline: 0; }
.icon-button svg { width: 17px; }

.workspace { display: grid; grid-template-columns: minmax(420px, .82fr) minmax(0, 1.18fr); min-height: calc(100vh - 58px); }
.editor { padding: 21px 24px 18px; border-right: 1px solid var(--line); background: linear-gradient(rgba(23,29,30,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(23,29,30,.035) 1px, transparent 1px), var(--paper); background-size: 24px 24px; }
.eyebrow { margin: 0 0 7px; color: var(--green-dark); font: 800 10px/1.2 ui-monospace, Menlo, monospace; text-transform: uppercase; }
h1 { max-width: 650px; margin: 0; font-size: 35px; line-height: 1.04; letter-spacing: 0; }
.editor-head > p:last-child { max-width: 580px; margin: 9px 0 0; color: #566164; font-size: 12px; line-height: 1.45; }
.sample-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0 13px; }
.sample-button, .primary-button, .export-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px; border-radius: 6px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.sample-button { border: 1px solid #9ca39f; color: var(--ink); background: rgba(255,255,255,.55); }
.sample-button.active { border-color: #d65f4c; background: #fff0ec; }
.sample-button:hover { background: white; }
.sample-button svg, .primary-button svg, .export-button svg { width: 16px; height: 16px; }
.manifest-label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; color: #536064; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.manifest-label code { color: #7b8586; font-size: 9px; text-transform: none; }
#manifest-input { width: 100%; height: 278px; resize: vertical; padding: 11px 12px; border: 1px solid #abb0aa; border-radius: 6px; outline: 0; background: #fcfbf7; color: #243033; font: 500 9px/1.45 ui-monospace, Menlo, monospace; }
#manifest-input:focus { border-color: var(--green-dark); box-shadow: 0 0 0 2px rgba(8,122,79,.12); }
.editor-actions { margin-top: 9px; }
.primary-button { width: 100%; border: 1px solid #36bd7c; color: #10201a; background: var(--green); }
.primary-button:hover { background: #73e8b1; }
.error { margin: 8px 0 0; padding: 8px 10px; border-left: 3px solid #b82d25; color: #7e211c; background: #ffefec; font-size: 10px; }
.source-boundary { margin: 8px 0 0; color: #6a7475; font-size: 9px; line-height: 1.45; }

.proof { min-width: 0; padding: 20px 22px; overflow: hidden; color: white; background: radial-gradient(circle at 92% 5%, rgba(85,223,157,.08), transparent 29%), var(--ink); }
.proof:focus { outline: none; }
.empty { min-height: calc(100vh - 98px); display: grid; place-content: center; justify-items: center; gap: 22px; text-align: center; color: #aeb9ba; }
.empty p { max-width: 390px; margin: 0; font-size: 13px; line-height: 1.5; }
.empty-rails { width: 300px; height: 100px; position: relative; }
.empty-rails span { position: absolute; left: 0; width: 165px; height: 1px; background: #586466; transform-origin: left; }
.empty-rails span:nth-child(1) { top: 20px; transform: rotate(10deg); }
.empty-rails span:nth-child(2) { top: 50px; }
.empty-rails span:nth-child(3) { top: 80px; transform: rotate(-10deg); }
.empty-rails b { position: absolute; right: 0; top: 30px; width: 95px; height: 40px; display: grid; place-items: center; border: 1px solid #566467; color: var(--green); font: 700 10px/1 ui-monospace, Menlo, monospace; }
.proof-head { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: end; padding-bottom: 14px; border-bottom: 1px solid #3c4749; }
.proof-brand { display: block; margin-bottom: 5px; color: #91a0a2; font: 700 9px/1 ui-monospace, Menlo, monospace; }
.schema-proof { margin: 0; color: var(--green); font: 700 10px/1.3 ui-monospace, Menlo, monospace; }
.verdict-lockup { text-align: right; }
.verdict-lockup span, .metric-rail span, .summary-bar span, .interpretation-grid span { display: block; margin-bottom: 4px; color: #8d9a9c; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.verdict-lockup strong { color: var(--coral); font: 800 25px/1 ui-monospace, Menlo, monospace; }
.verdict-lockup.ready strong { color: var(--green); }
.metric-rail { display: grid; grid-template-columns: repeat(5, 1fr); border-bottom: 1px solid #3c4749; }
.metric-rail > div { min-width: 0; padding: 11px 10px 11px 0; }
.metric-rail > div + div { padding-left: 10px; border-left: 1px solid #3c4749; }
.metric-rail strong { color: #f5f8f7; font: 800 19px/1 ui-monospace, Menlo, monospace; }
.summary-bar { display: grid; grid-template-columns: .65fr 1.3fr max-content; gap: 14px; align-items: center; padding: 10px 0; }
.summary-bar strong { display: block; color: #e4e9e8; font-size: 10px; line-height: 1.25; }
.summary-bar > div:first-child strong { font-family: ui-monospace, Menlo, monospace; }
.export-button { min-height: 38px; border: 1px solid #ecb93b; color: var(--ink); background: var(--amber); }
.criterion-list { border: 1px solid #435052; }
.criterion-row { display: grid; grid-template-columns: 132px minmax(0, 1fr) 110px; min-height: 62px; border-bottom: 1px solid #354245; }
.criterion-row:last-child { border-bottom: 0; }
.criterion-name { min-width: 0; padding: 9px 10px; border-right: 1px solid #354245; }
.criterion-name strong { display: block; overflow: hidden; text-overflow: ellipsis; color: #f0f4f3; font: 700 9px/1.2 ui-monospace, Menlo, monospace; white-space: nowrap; }
.criterion-name span { display: block; margin-top: 5px; color: #829092; font-size: 8px; line-height: 1.25; }
.record-rail { min-width: 0; display: flex; align-items: stretch; overflow: hidden; }
.record { min-width: 0; flex: 1 1 0; padding: 8px 9px; border-right: 1px solid #354245; }
.record:last-child { border-right: 0; }
.record-top { display: flex; justify-content: space-between; gap: 8px; font: 700 8px/1.2 ui-monospace, Menlo, monospace; }
.record-top b { color: #cbd3d3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.record-top em { font-style: normal; color: var(--green); }
.record.fail .record-top em { color: var(--coral); }
.record code { display: block; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; color: #899698; font-size: 7px; white-space: nowrap; }
.record-empty { display: flex; align-items: center; padding: 0 10px; color: #768588; font-size: 8px; }
.classification { padding: 9px; display: flex; flex-direction: column; justify-content: center; }
.class-pill { align-self: flex-start; padding: 4px 6px; border: 1px solid #596669; color: #d3dcdb; font: 800 7px/1 ui-monospace, Menlo, monospace; text-transform: uppercase; }
.classification.verified .class-pill { border-color: #2d9b6c; color: var(--green); }
.classification.conflict .class-pill, .classification.failed .class-pill { border-color: #b64f3f; color: var(--coral); }
.classification.missing_evidence .class-pill, .classification.uncovered .class-pill { border-color: #b98c2d; color: var(--amber); }
.classification p { margin: 5px 0 0; color: #879597; font-size: 7px; line-height: 1.3; }
.stale-warning { margin-top: 9px; padding: 8px 10px; border-left: 3px solid var(--amber); color: #d7c999; background: rgba(255,209,102,.07); font-size: 8px; line-height: 1.35; }
.interpretation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #3c4749; }
.interpretation-grid p { margin: 0; color: #aab6b7; font-size: 8px; line-height: 1.4; }
.export-status { min-height: 13px; margin: 7px 0 0; color: var(--green); font: 650 8px/1.3 ui-monospace, Menlo, monospace; }

button:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
@media (max-width: 960px) {
  .topbar { grid-template-columns: 1fr 38px; }
  .library-status { display: none; }
  .workspace { display: block; }
  .editor { min-height: calc(100svh - 58px); border-right: 0; border-bottom: 1px solid var(--line); }
  .proof { min-height: 100svh; }
  .empty { min-height: calc(100svh - 44px); }
}
@media (max-width: 620px) {
  .topbar { padding: 0 12px; }
  .brand { font-size: 12px; }
  .editor { padding: 18px 14px 16px; }
  h1 { font-size: 29px; }
  .sample-switch { grid-template-columns: 1fr; }
  .sample-button, .primary-button, .export-button { min-height: 44px; }
  #manifest-input { height: 290px; }
  .manifest-label { align-items: flex-start; }
  .manifest-label code { max-width: 150px; text-align: right; }
  .proof { padding: 16px 12px 20px; }
  .proof-head { grid-template-columns: 1fr; gap: 10px; }
  .verdict-lockup { text-align: left; }
  .metric-rail { grid-template-columns: repeat(3, 1fr); }
  .metric-rail > div:nth-child(4) { border-left: 0; }
  .metric-rail > div:nth-child(n+4) { border-top: 1px solid #3c4749; }
  .summary-bar { grid-template-columns: 1fr 1fr; }
  .export-button { grid-column: 1 / -1; width: 100%; }
  .criterion-row { grid-template-columns: 1fr 96px; }
  .criterion-name { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid #354245; }
  .record-rail { min-height: 48px; }
  .classification { border-left: 1px solid #354245; }
  .interpretation-grid { grid-template-columns: 1fr; gap: 9px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition-duration: .01ms !important; } }
