:root {
  --black: #080b0a;
  --black-2: #101614;
  --paper: #f2f0e9;
  --ink: #131917;
  --green: #b7f34a;
  --cyan: #48d7ff;
  --amber: #ffc857;
  --coral: #ff665a;
  --line-dark: #2a3632;
  --line-light: #a9b1ad;
  --muted: #82918b;
  --header: 52px;
}
* { box-sizing: border-box; }
html { background: var(--black); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; overflow-x: hidden; background: var(--black); color: var(--paper); font-family: Arial, Helvetica, sans-serif; letter-spacing: 0; }
button, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:focus-visible, textarea:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
[hidden], .empty-result[hidden] { display: none !important; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--header); display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 16px; border-bottom: 1px solid var(--line-dark); background: var(--black); }
.brand { min-width: 0; display: inline-flex; align-items: center; gap: 9px; color: var(--paper); text-decoration: none; font-size: 12px; font-weight: 900; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--green); color: var(--green); }
.brand-mark svg { width: 16px; height: 16px; }
.runtime { min-width: 0; display: inline-flex; align-items: center; gap: 7px; color: #bdc9c4; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; white-space: nowrap; }
.runtime span { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.runtime.ready span { background: var(--green); box-shadow: 0 0 0 3px rgba(183,243,74,.12); }
.workspace { width: 100%; max-width: 100%; min-height: calc(100vh - var(--header)); display: grid; grid-template-columns: minmax(430px, 46fr) minmax(0, 54fr); overflow-x: hidden; }
.input-bay { min-width: 0; padding: 16px 18px 14px; border-right: 1px solid var(--line-light); background: var(--paper); color: var(--ink); }
.source-boundary { margin: 0 0 8px; color: #53615c; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; font-weight: 800; }
.sample-actions { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; margin-bottom: 10px; }
.sample-actions button, .compile-actions button, .segmented button, .editor-tabs button, .result-actions button { min-width: 0; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 10px; border: 1px solid #7c8984; background: #fff; color: var(--ink); font-size: 9px; font-weight: 900; white-space: nowrap; }
.sample-actions button svg, .compile-actions button svg, .result-actions button svg { width: 15px; height: 15px; flex: 0 0 auto; }
.sample-actions #sample-button { border-color: #719f25; background: var(--green); }
.sample-actions #invalid-button { border-color: #ce776f; background: #fff4f2; }
h1 { width: 100%; max-width: 720px; margin: 0; font-family: Arial, Helvetica, sans-serif; font-size: clamp(2.3rem, 4vw, 4.25rem); line-height: .92; letter-spacing: 0; }
.lede { max-width: 660px; margin: 7px 0 10px; color: #46534e; font-size: 10px; line-height: 1.35; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #18362d; font-size: .95em; }
.policy-row { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 9px; align-items: center; margin-bottom: 9px; }
.policy-row > span { color: #53615c; font-size: 8px; font-weight: 900; text-transform: uppercase; }
.segmented { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border: 1px solid #7c8984; }
.segmented button { min-height: 36px; border: 0; border-right: 1px solid #7c8984; background: transparent; }
.segmented button:last-child { border-right: 0; }
.segmented button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.editor-tabs { display: none; }
.editors { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.editor-panel { min-width: 0; }
.editor-panel label { display: block; margin-bottom: 5px; color: #53615c; font-size: 8px; font-weight: 900; text-transform: uppercase; }
.editor-panel textarea { width: 100%; height: 190px; resize: vertical; padding: 9px; border: 1px solid #7c8984; background: #fff; color: #14201c; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; line-height: 1.35; white-space: pre; overflow: auto; }
.compile-actions { display: grid; grid-template-columns: minmax(0,1fr) 92px; gap: 8px; margin-top: 8px; }
.compile-actions .compile-button { border-color: #156d83; background: var(--cyan); }
.compile-actions .reset-button { background: transparent; }
.input-error { margin-top: 8px; padding: 8px 10px; border-left: 4px solid var(--coral); background: #fff; color: #842a22; font-size: 9px; }
.input-error strong { display: block; margin-bottom: 4px; }
#input-error-details { max-height: 52px; overflow: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; line-height: 1.4; }
.result-bay { min-width: 0; min-height: calc(100vh - var(--header)); padding: 16px 20px 12px; background: var(--black); color: var(--paper); }
.result-identity { color: #91a19b; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; }
.result-head { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 14px; align-items: end; margin-top: 7px; }
#schema-proof { margin: 0 0 5px; color: var(--green); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; font-weight: 800; }
h2 { margin: 0; color: var(--amber); font-size: clamp(1.9rem, 3.6vw, 3.8rem); line-height: .9; letter-spacing: 0; overflow-wrap: anywhere; }
#policy-proof { margin: 6px 0 0; color: var(--cyan); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; font-weight: 800; }
.result-actions { display: grid; grid-template-columns: 44px 116px; gap: 6px; }
.result-actions button { border-color: #71817a; background: transparent; color: var(--paper); }
.result-actions #view-button { width: 44px; padding: 0; }
.result-actions #view-button span { display: none; }
.result-actions #export-button { border-color: #a98020; background: var(--amber); color: var(--ink); }
.result-actions button:disabled { cursor: not-allowed; opacity: .4; }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin-top: 13px; border-top: 1px solid var(--line-dark); border-bottom: 1px solid var(--line-dark); }
.metrics > div { min-width: 0; padding: 9px 10px; border-right: 1px solid var(--line-dark); }
.metrics > div:first-child { padding-left: 0; }
.metrics > div:last-child { border-right: 0; }
.metrics span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 7px; font-weight: 800; }
.metrics strong { display: block; color: var(--paper); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: clamp(.8rem, 1.35vw, 1.08rem); line-height: 1.15; overflow-wrap: anywhere; }
.operation-rail { position: relative; min-height: 126px; display: grid; align-content: center; padding: 8px 0; border-bottom: 1px solid var(--line-dark); }
.operation-row { min-width: 0; display: grid; grid-template-columns: minmax(120px,.8fr) 118px minmax(0,1.3fr); gap: 9px; align-items: center; padding: 7px 8px; border-top: 1px solid #202a27; }
.operation-row:first-child { border-top: 0; }
.operation-row .server-name { min-width: 0; color: var(--paper); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 800; overflow-wrap: anywhere; }
.operation-row .op-main { color: var(--green); font-size: 8px; font-weight: 900; }
.operation-row.review .op-main { color: var(--coral); }
.operation-row .op-detail { min-width: 0; color: #94a39d; font-size: 8px; overflow-wrap: anywhere; }
.empty-result { display: grid; place-items: center; align-content: center; gap: 7px; color: #6e7d77; font-size: 9px; }
.empty-result svg { width: 24px; height: 24px; }
.evidence-strip { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); border-bottom: 1px solid var(--line-dark); }
.evidence-strip > div { min-width: 0; padding: 8px 9px; border-right: 1px solid var(--line-dark); }
.evidence-strip > div:first-child { padding-left: 0; }
.evidence-strip > div:last-child { border-right: 0; }
.evidence-strip span { display: block; color: var(--muted); font-size: 7px; }
.evidence-strip strong { display: block; margin-top: 4px; color: var(--amber); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; line-height: 1.3; overflow-wrap: anywhere; }
.json-proof { margin-top: 8px; }
.json-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 5px; color: #899992; font-size: 7px; font-weight: 800; text-transform: uppercase; }
.json-head span:last-child { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; text-transform: none; }
#merged-json { width: 100%; height: 112px; margin: 0; overflow: auto; padding: 8px 9px; border: 1px solid #2f3d38; background: var(--black-2); color: #dce7e2; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 7px; line-height: 1.35; white-space: pre; }
.interpretation { display: grid; grid-template-columns: 16px minmax(0,1fr); gap: 8px; align-items: start; margin-top: 7px; }
.interpretation svg { width: 15px; height: 15px; color: var(--amber); }
.interpretation p { margin: 0; color: #aab7b2; font-size: 8px; line-height: 1.4; }
.export-status { min-height: 12px; margin: 5px 0 0; color: var(--green); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 8px; }
@media (max-width: 820px) {
  .workspace { grid-template-columns: minmax(360px, 44fr) minmax(0,56fr); }
  .input-bay { padding-inline: 12px; }
  .result-bay { padding-inline: 14px; }
  .editors { grid-template-columns: 1fr; }
  .editor-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin-bottom: 6px; }
  .editor-tabs button { min-height: 34px; border-color: #7c8984; background: transparent; }
  .editor-tabs button[aria-pressed="true"] { background: var(--ink); color: #fff; }
  .editor-panel { display: none; }
  .editor-panel.active { display: block; }
  .editor-panel textarea { height: 190px; }
}
@media (max-width: 640px) {
  :root { --header: 50px; }
  html { scroll-behavior: auto; }
  body.proof-focus .topbar { position: static; }
  .topbar { padding: 0 11px; }
  .brand { font-size: 10px; }
  .brand-mark { width: 28px; height: 28px; }
  .runtime { max-width: 118px; overflow: hidden; text-overflow: ellipsis; font-size: 7px; }
  .workspace { display: block; min-height: 0; }
  .input-bay { min-height: 0; padding: 12px 11px 15px; border-right: 0; }
  .sample-actions button { font-size: 8px; }
  h1 { font-size: clamp(2.45rem, 12vw, 3.1rem); }
  .lede { font-size: 9px; }
  .policy-row { grid-template-columns: 1fr; gap: 5px; }
  .editor-panel textarea { height: 220px; }
  .result-bay { min-height: 100vh; padding: 13px 12px 14px; }
  .result-head { grid-template-columns: 1fr; align-items: start; }
  .result-actions { grid-template-columns: 44px minmax(0,1fr); }
  .result-actions #view-button { width: 44px; }
  h2 { font-size: clamp(2.3rem, 11vw, 3.05rem); }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metrics > div { min-height: 56px; border-bottom: 1px solid var(--line-dark); }
  .metrics > div:nth-child(2) { border-right: 0; }
  .metrics > div:nth-child(3), .metrics > div:nth-child(4) { border-bottom: 0; }
  .metrics > div:nth-child(3) { padding-left: 0; }
  .operation-row { grid-template-columns: minmax(0,1fr) 108px; }
  .operation-row .op-detail { grid-column: 1 / -1; }
  .evidence-strip { grid-template-columns: 1fr; }
  .evidence-strip > div { border-right: 0; border-bottom: 1px solid var(--line-dark); padding-left: 0; }
  .evidence-strip > div:last-child { border-bottom: 0; }
  #merged-json { height: 142px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
