:root {
  color-scheme: dark;
  --background: #151417;
  --surface: #1c1b20;
  --surface-raised: #24222a;
  --ink: #f3f0ef;
  --muted: #aeabb6;
  --line: #38353d;
  --accent: #dfc7ff;
  --muted-accent: #c1abda;
  --accent-ink: #21152d;
  --well: #17161a;
  --control: #2c2933;
  --rule: #413b4a;
  --success: #b9e6c5;
  --mono: 'IBM Plex Mono', Consolas, 'Liberation Mono', monospace;
  --display: 'Segoe UI Variable Display', 'Segoe UI', Arial, sans-serif;
  font: 15px/1.5 var(--display);
  background: var(--background);
  color: var(--ink);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
[hidden], .sprite { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button, summary, .file-label { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button svg, a svg, .panel-header svg, .record-mark svg { width: 17px; height: 17px; flex: none; }
svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }
h1, h2, h3, p { margin: 0; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; top: 6px; left: 6px; z-index: 9; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; }

.frame { display: grid; grid-template-columns: 199px minmax(0, 1fr); min-height: 100vh; }
.rail { align-content: start; background: #19181c; border-right: 1px solid var(--line); display: grid; grid-template-rows: 76px 1fr auto; height: 100dvh; position: sticky; top: 0; }
.identity { display: flex; align-items: center; gap: 11px; margin-inline: 19px; font-size: 16px; font-weight: 650; letter-spacing: -.025em; }
.identity small, .rail-bottom small { display: block; color: var(--muted); font: 10px/1.6 var(--mono); letter-spacing: .055em; }
.identity img { flex: none; }
.nav { display: grid; align-content: start; gap: 4px; padding: 21px 11px; }
.nav a { border: 1px solid transparent; border-radius: 4px; color: var(--muted); display: flex; gap: 10px; align-items: center; padding: 10px 11px; font-size: 13px; font-weight: 600; position: relative; }
.nav a:hover { background: var(--surface-raised); color: var(--ink); }
.nav a[aria-current] { background: #282233; border-color: #453852; color: var(--accent); }
.nav a[aria-current]::after { content: ''; height: 5px; width: 5px; background: var(--accent); position: absolute; right: 12px; border-radius: 50%; }
.rail-bottom { display: flex; align-items: flex-start; gap: 10px; padding: 17px 17px 22px; border-top: 1px solid var(--line); color: var(--ink); font-size: 12px; font-weight: 600; }
.rail-bottom .status-light { margin-top: 6px; }
.status-light { display: inline-block; width: 6px; height: 6px; flex: none; border-radius: 50%; background: #c4a4ed; box-shadow: 0 0 0 3px #c4a4ed22; }
.shell { display: flex; min-width: 0; flex-direction: column; }
.mast { min-height: 57px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-inline: clamp(20px, 4vw, 58px); font: 12px/1.35 var(--mono); }
.breadcrumbs { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.breadcrumbs span:last-child { color: var(--ink); }
.network { display: inline-flex; align-items: center; gap: 8px; background: #272131; border: 1px solid #493b58; color: var(--accent); border-radius: 3px; padding: 6px 9px; }
.network .status-light { width: 5px; height: 5px; box-shadow: none; }
main { width: 100%; max-width: 1490px; margin-inline: auto; padding: 32px clamp(20px, 4vw, 58px) 56px; flex: 1; }
.footer { border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0 10px; padding: 4px clamp(20px, 4vw, 58px); font: 11px/1.4 var(--mono); color: var(--muted); }
.footer span span { margin: 0 5px; color: var(--muted-accent); }
.social-x { display: inline-grid; place-items: center; inline-size: 17px; block-size: 17px; border: 1px solid currentColor; font: 700 11px/1 var(--mono); }
.footer-social { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; }

.hero { min-height: 308px; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(260px, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 27px; }
.hero-copy { padding: 28px clamp(20px, 3vw, 48px) 28px 0; display: grid; align-content: center; justify-items: start; }
.hero h1, .view-intro h1 { font-size: clamp(2.75rem, 4.55vw, 4.75rem); line-height: .99; letter-spacing: -.067em; font-weight: 630; text-wrap: balance; }
.hero-copy > p { margin: 17px 0 16px; max-width: 400px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.hero-action { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); min-height: 34px; font-size: 13px; font-weight: 600; }
.hero-action svg:last-child { margin-left: 2px; transition: transform .18s ease; }
.hero-action:hover svg:last-child { transform: translateX(4px); }
.instrument { display: grid; align-content: center; min-width: 0; padding: 19px 19px 18px; background: #201c27; border-inline: 1px solid #453b51; }
.instrument-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; color: var(--ink); margin-bottom: 15px; font-size: 13px; font-weight: 650; }
.instrument-top span:last-child { color: var(--muted-accent); font: 11px/1.4 var(--mono); text-align: right; }
.commitment-matrix { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 3px; min-width: 0; padding: 6px; border: 1px solid #433750; border-radius: 3px; background: #1a161f; }
.commitment-matrix i { display: grid; min-width: 0; min-height: 31px; place-items: center; border-radius: 1px; background: #292234; color: #f7efff; font: 11px/1 var(--mono); transition: background .3s ease-out, color .3s ease-out; }
.commitment-matrix:not(.has-commitment) i:nth-child(3n + 1) { background: #332941; }
.commitment-matrix:not(.has-commitment) i:nth-child(5n + 2) { background: #3c2e4e; }
.commitment-matrix i[data-intensity='1'] { background: #433353; }
.commitment-matrix i[data-intensity='2'] { background: #644f79; }
.commitment-matrix i[data-intensity='3'] { background: #c8aceb; color: #251831; }
.instrument-code { color: var(--muted-accent); display: block; margin: 9px 0 14px; font: 11px/1.4 var(--mono); overflow-wrap: anywhere; }
.instrument-steps { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; border: 1px solid #4c4059; border-radius: 3px; color: var(--muted); font: 11px/1.4 var(--mono); }
.instrument-steps li { display: flex; justify-content: center; gap: 5px; border-right: 1px solid #4c4059; padding: 8px 2px; }
.instrument-steps li:last-child { border: 0; }
.instrument-steps .complete { color: var(--accent); }
.instrument-steps li[aria-current] { background: #3b2b4d; color: #f4e8ff; }
.instrument-steps .skipped { text-decoration: line-through; }
.step-number { opacity: .63; }

.studio-grid, .verify-grid, .agent-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr); align-items: stretch; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; }
.panel-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; min-height: 55px; gap: 8px 12px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.panel-header > div { display: flex; align-items: center; gap: 9px; min-width: 0; }
.panel-header h2 { font-size: 14px; font-weight: 650; }
.panel-header > div > svg { color: var(--muted-accent); }
.panel-body { padding: 18px; min-width: 0; }
.manifest .panel-body { display: grid; gap: 14px; }
.form-line { display: grid; gap: 10px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
label { display: grid; gap: 6px; color: #ded9e2; font-size: 12px; font-weight: 600; min-width: 0; }
input, textarea { width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid var(--rule); border-radius: 3px; background: var(--well); color: var(--ink); font-size: 13px; }
textarea { resize: vertical; min-height: 63px; }
input::placeholder, textarea::placeholder { color: #a39daa; }
input[name='ticker'], input[name='anchorSigner'], .packet-form input, #receipt-json { font-family: var(--mono); }
.anchor-settings, .recovery { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 7px 0; color: var(--muted); font-size: 12px; }
.anchor-settings summary, .recovery summary { padding: 3px 0; color: #ded9e2; }
.anchor-settings summary span { font: 10px/1.4 var(--mono); padding-left: 5px; color: var(--muted); }
.anchor-settings label, .anchor-settings p { margin-block: 8px 4px; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.form-actions > span { font: 10px/1.35 var(--mono); color: var(--muted); }
.button, .text-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 37px; padding: 7px 11px; color: var(--ink); background: var(--control); border: 1px solid var(--rule); border-radius: 3px; font-size: 12px; font-weight: 650; text-align: left; white-space: nowrap; transition: background .16s ease, color .16s ease, border-color .16s ease; }
.button:hover { background: #393142; border-color: #6b597c; }
.button.primary { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.button.primary:hover { background: #ecdafe; border-color: #ecdafe; }
.button.compact { min-height: 32px; padding: 5px 8px; font-size: 11px; color: #ded7e7; white-space: normal; }
.text-button { min-height: 28px; background: transparent; border-color: transparent; color: #cac0d5; padding: 3px 0; }
.text-button svg { width: 14px; height: 14px; }
.text-button:hover { color: var(--accent); }
.packet-label, .count { border: 1px solid #493b57; background: #292232; color: #dec9f5; padding: 3px 6px; border-radius: 3px; font: 10px/1.3 var(--mono); white-space: nowrap; }
.count { min-width: 21px; text-align: center; }
.packet #proof-packet { display: grid; gap: 12px; }
.packet-empty { min-height: 168px; display: grid; place-content: center; justify-items: center; text-align: center; padding: 14px; border: 1px dashed var(--rule); border-radius: 4px; background: var(--well); }
.packet-empty-mark { width: 36px; height: 36px; display: grid; place-items: center; margin-bottom: 8px; background: #292232; color: var(--muted-accent); border: 1px solid var(--rule); border-radius: 4px; }
.packet-empty-mark svg { width: 21px; height: 21px; }
.packet-empty strong { font-size: 13px; }
.packet-empty p { color: var(--muted); font-size: 12px; max-width: 240px; margin-top: 4px; }
.packet-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 3px; }
.packet-checks > div { padding: 8px 10px; }
.packet-checks > div + div { border-left: 1px solid var(--line); }
.packet-heading { display: flex; gap: 9px; align-items: baseline; flex-wrap: wrap; }
.packet-heading h3 { font-size: 16px; }
.packet-heading span { font: 11px/1.4 var(--mono); }
.fact { display: grid; gap: 3px; min-width: 0; }
.field-caption { font: 10px/1.4 var(--mono); text-transform: uppercase; color: var(--muted); letter-spacing: .055em; }
.fact-value { font-size: 13px; }
.digest { font: 11px/1.55 var(--mono); color: #ddd0e8; display: block; word-break: break-all; }
.recovery { border-bottom: 0; }
.recovery-actions { display: flex; flex-wrap: wrap; gap: 2px 16px; align-items: center; }
.recovery-raw { margin-block: 3px; }
.recovery-raw > .fact { margin: 7px 0 2px; }
.copy-button, .chain-link { justify-self: start; white-space: normal; }
.packet-form { display: grid; gap: 8px; }
.packet-form .button { justify-self: start; }
.packet-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.feedback { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.feedback[data-kind='error'], .error { color: #ffb2a8; }
.feedback[data-kind='success'], .positive { color: var(--success); }
.app-error { margin-bottom: 14px; font-size: 13px; }
.muted { color: var(--muted); }

.index-panel { margin-top: 16px; }
.record-row { display: flex; align-items: center; gap: 10px; padding: 10px 18px; color: var(--muted); }
.record-row:hover { background: var(--surface-raised); }
.record-row[aria-current] .record-mark { border-color: #6b597c; color: var(--accent); }
.record-row + .record-row { border-top: 1px solid var(--line); }
.record-mark { display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid var(--line); border-radius: 3px; background: #282233; flex: none; }
.record-copy { display: grid; min-width: 0; flex: 1; }
.record-copy strong { font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.record-copy small { color: var(--muted); font: 10px/1.4 var(--mono); }
.record-status { font: 10px/1.4 var(--mono); text-align: right; }
.record-status.revealed { color: var(--success); }
.list-empty { color: var(--muted); padding: 15px 18px; font-size: 13px; }

.view-intro { padding-block: 13px 26px; }
.view-intro h1 { font-size: clamp(2.8rem, 4vw, 4.35rem); }
.view-intro > p:last-child { color: var(--muted); margin-top: 12px; }
.comms-page-header { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 5px 0 18px; }
.comms-page-header h1 { font: 400 clamp(1.6rem, 3.2vw, 2.65rem)/1.1 var(--pixel); letter-spacing: -.035em; }
.comms-page-header p { color: var(--muted); font-size: 13px; margin-top: 7px; }
.agent-grid { grid-template-columns: minmax(155px, 205px) minmax(0, 1fr) minmax(190px, 246px); align-items: start; }
.agent-directory .panel-header { gap: 6px; }
.agent-directory .record-row[aria-current] { background: var(--control); }
.agent-directory .record-copy { line-height: 1.32; }
.agent-floor-link { display: grid; gap: 6px; border-top: 1px solid var(--line); padding: 8px; color: var(--muted); font: 11px/1.3 var(--mono); }
.agent-floor-link > span:last-child { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 1px 2px; }
.agent-floor-link:hover { color: var(--accent); }
.agent-floor-window { display: block; aspect-ratio: 2/1; overflow: hidden; border: 1px solid var(--line); background: var(--well); }
#agent-floor-art { display: block; width: 225%; max-width: none; height: auto; transform: translate(-51%, -34%); image-rendering: pixelated; }
.directory-action { margin: 0 18px 11px; }
.conversation-header { min-height: 68px; }
.conversation-header .conversation-identity { gap: 10px; align-items: center; }
.conversation-header h2 { overflow-wrap: anywhere; line-height: 1.25; }
.comms-avatar { width: 34px; height: 34px; display: grid; place-items: center; flex: none; color: var(--accent); background: var(--well); border: 1px solid var(--rule); }
.comms-avatar svg { width: 19px; height: 19px; }
.comms-mode { display: block; color: var(--muted); font: 11px/1.45 var(--mono); margin-top: 3px; }
.comms-connection { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font: 11px/1.35 var(--mono); }
.comms-connection::before { content: ''; width: 6px; height: 6px; flex: none; background: currentColor; }
.comms-connection[data-status='live'] { color: var(--success); }
.comms-connection:is([data-status='connecting'], [data-status='reconnecting']) { color: var(--accent); }
.agent-evidence summary { min-height: 54px; padding: 16px 13px; font-weight: 650; font-size: 13px; background: var(--surface-raised); }
.agent-evidence[open] summary { border-bottom: 1px solid var(--line); }
#agent-context { display: grid; gap: 12px; padding: 12px 14px; }
.agent-mission { min-width: 0; }
#agent-context p { margin-top: 5px; color: var(--ink); max-height: 11em; overflow: auto; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.agent-proof { display: grid; justify-items: start; align-content: center; border-top: 1px solid var(--rule); padding-top: 10px; }
.comms-activity { display: grid; padding: 0; margin: 0; list-style: none; gap: 5px; }
.comms-activity li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 3px 8px; border-top: 1px solid var(--line); padding: 7px 0 0; font-size: 12px; }
.comms-activity time { color: var(--muted); font: 10px/1.4 var(--mono); }
.thread { min-height: min(42vh, 480px); max-height: min(54vh, 580px); overflow-y: auto; display: flex; flex-direction: column; gap: 10px; background: var(--well); padding: 16px; scrollbar-color: var(--rule) var(--well); }
.thread:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.thread-placeholder { color: var(--muted); font-size: 13px; margin: auto; text-align: center; }
.thread-start { margin: auto; display: grid; justify-items: center; text-align: center; gap: 10px; }
.thread-start p { color: var(--muted); font-size: 13px; }
.agent-mark { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--rule); border-radius: 4px; color: var(--accent); background: #2a2233; }
.agent-mark svg { width: 22px; height: 22px; }
.message { align-self: start; max-width: min(92%, 74ch); padding: 10px 13px; border: 1px solid var(--line); border-radius: 3px; background: var(--surface); }
.message.user { align-self: end; border-color: #50405f; background: #292333; }
.message.pending { border-style: dashed; }
.message-pending { color: var(--accent); }
.message-header { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; justify-content: space-between; color: var(--muted-accent); font: 10px/1.4 var(--mono); margin-bottom: 6px; }
.message-header time { color: var(--muted); }
.message-meta { display: flex; align-items: center; gap: 8px; }
.message-copy { padding: 0 4px; min-height: 21px; }
.message p { font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
#agent-compose { padding: 12px 16px; border-top: 1px solid var(--line); }
.prompt-list { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }
#chat-form { display: flex; gap: 7px; align-items: stretch; }
#chat-form .button { align-self: end; width: 42px; height: 42px; flex: none; }
#chat-feedback { margin-bottom: 8px; }
.verify-aside { display: grid; gap: 12px; align-content: start; }
#verify-form { display: grid; gap: 10px; }
#receipt-json { min-height: 190px; }
.verification-result { display: grid; gap: 12px; font-size: 13px; }
.check-option { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 36px; }
.check-option input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.file-label { position: relative; }
.file-label:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.file-label input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

@media (max-width: 1000px) {
  .frame { grid-template-columns: 155px minmax(0, 1fr); }
  .identity { margin-inline: 12px; gap: 7px; font-size: 14px; }
  .identity img { width: 29px; height: 29px; }
  .identity small { font-size: 9px; }
  .nav { padding-inline: 8px; }
  .panel-body, .panel-header { padding-inline: 14px; }
  .agent-grid { grid-template-columns: minmax(150px, .4fr) minmax(0, 1fr); }
  .agent-evidence { grid-column: 2; }
}
@media (max-width: 760px) {
  .frame { display: block; }
  .rail { height: auto; display: flex; flex-wrap: wrap; align-items: center; position: static; border: 0; }
  .identity { margin: 9px 13px; }
  .nav { display: flex; gap: 3px; flex: 1 1 auto; justify-content: end; padding: 4px 10px 5px; }
  .nav a { padding: 7px; gap: 4px; font-size: 12px; }
  .nav a svg { width: 14px; height: 14px; }
  .nav a[aria-current]::after, .rail-bottom { display: none; }
  .mast { min-height: 40px; padding-inline: 16px; border-top: 1px solid var(--line); }
  main { padding: 16px 15px 32px; }
  .hero { min-height: 0; grid-template-columns: minmax(0, 1.2fr) minmax(175px, .8fr); margin-bottom: 12px; }
  .hero-copy { padding: 20px 12px 20px 0; }
  .hero h1 { font-size: clamp(2rem, 6vw, 3.45rem); }
  .hero-copy > p { font-size: 13px; }
  .studio-grid, .verify-grid { gap: 10px; }
}
@media (max-width: 565px) {
  .nav { flex-basis: 100%; justify-content: start; }
  .nav a { flex: 1; justify-content: center; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: clamp(2.45rem, 9vw, 3.3rem); }
  .instrument { border-top: 1px solid #453b51; padding: 12px; }
  .instrument-top { margin-bottom: 8px; }
  .commitment-matrix i { min-height: 21px; font-size: 10px; }
  .instrument-code { margin: 6px 0 8px; }
  .instrument-steps li { padding-block: 6px; }
  .studio-grid, .verify-grid, .agent-grid { grid-template-columns: minmax(0, 1fr); }
  .agent-grid { gap: 10px; }
  .agent-evidence { grid-column: auto; }
  .agent-floor-link { display: none; }
  .thread { max-height: 65vh; }
  .footer { font-size: 10px; padding-inline: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
