@font-face {
  font-family: Silkscreen;
  src: url('/silkscreen.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

body {
  --background: #151c2c;
  --surface: #1b2538;
  --surface-raised: #23304a;
  --ink: #edf0f2;
  --muted: #a9b6cb;
  --line: #394966;
  --accent: #f4c978;
  --muted-accent: #b8ccef;
  --accent-ink: #2a2112;
  --well: #141d2e;
  --control: #263550;
  --rule: #465977;
  --success: #b7e3b6;
  --pixel: Silkscreen, Consolas, monospace;
  --desktop-ink: #202d48;
  --desktop-paper: #eef1e9;
  --desktop-yellow: #f4cd78;
  --desktop-blue: #a6b9dc;
  background: var(--background);
}

.rail { background: #192235; }
.nav a[aria-current] { background: #293852; border-color: #556c95; color: #d3e2ff; border-radius: 1px; }
.nav a[aria-current]::after { background: var(--accent); }
.network { color: #d3e2ff; background: #25354e; border-color: #506688; border-radius: 1px; }
.status-light { background: var(--accent); box-shadow: 0 0 0 3px #f4c97825; }
.panel { border-radius: 1px; box-shadow: 3px 3px 0 #101726; }
.panel-header { background: #212d44; }
.button, input, textarea, .packet-label, .count, .record-mark { border-radius: 1px; }
.button.primary:hover { background: #ffdb94; border-color: #ffdb94; }
.packet-label, .count { background: #263652; border-color: #4c6285; color: #d6e4ff; }
.instrument { background: #1d2a42; border-color: #435678; }
.commitment-matrix { background: #152139; border-color: #4c5f85; }
.commitment-matrix i { background: #273958; }
.commitment-matrix:not(.has-commitment) i:nth-child(3n + 1) { background: #2d4368; }
.commitment-matrix:not(.has-commitment) i:nth-child(5n + 2) { background: #344e75; }
.commitment-matrix i[data-intensity='1'] { background: #3a5379; }
.commitment-matrix i[data-intensity='2'] { background: #526f9c; }
.commitment-matrix i[data-intensity='3'] { background: #afc7ed; color: #172847; }
.instrument-steps, .instrument-steps li { border-color: #495d80; }
.instrument-steps li[aria-current] { background: #314a73; color: #e2edff; }
.packet-empty-mark, .agent-mark, .record-mark { background: #2b3c58; color: #c4d6f6; }
.message.user { background: #293b58; border-color: #526d97; }

body[data-view='menu'] .frame, body[data-view='office'] .frame { display: block; }
body[data-view='menu'] :is(.rail, .mast, .footer), body[data-view='office'] :is(.rail, .mast, .footer) { display: none; }
body[data-view='menu'] :is(.shell, main), body[data-view='office'] :is(.shell, main) { display: block; max-width: none; margin: 0; padding: 0; }
body[data-view='menu'] .app-error, body[data-view='office'] .app-error { z-index: 2; position: fixed; top: 12px; left: 50%; max-width: 90vw; transform: translateX(-50%); padding: 8px 12px; background: var(--well); border: 1px solid var(--line); }

.dispatch-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 28px 20px 36px;
  background-color: #344058;
  background-image: radial-gradient(ellipse at 44% 40%, #6b839522, #11182c88), linear-gradient(90deg, #23304a88 1px, transparent 1px), linear-gradient(#23304a88 1px, transparent 1px);
  background-size: auto, 26px 26px, 26px 26px;
  background-position: center;
}
.dispatch-card {
  width: min(100%, 560px);
  color: var(--desktop-ink);
  color-scheme: light;
  background: var(--desktop-paper);
  padding: 27px 27px 21px;
  border: 3px solid #20304e;
  outline: 2px solid #839ac1;
  outline-offset: -5px;
  box-shadow: 9px 11px 0 #182134b3, 0 0 0 1px #b0bfdc;
}
.dispatch-heading { display: flex; align-items: center; gap: 12px; }
.dispatch-heading h1 { font: 400 clamp(1.15rem, 5.4vw, 2.68rem)/1.05 var(--pixel); letter-spacing: -.055em; }
.dispatch-mark { width: 49px; height: 49px; flex: none; display: grid; place-items: center; background: #2c4067; border: 2px solid var(--desktop-ink); box-shadow: 3px 3px #adbed9; color: #e8ecdf; }
.dispatch-mark svg { width: 31px; height: 31px; }
.dispatch-network { display: flex; align-items: center; gap: 6px; font: 11px/1.15 var(--mono); margin-bottom: 7px; color: #34486c; }
.dispatch-network > span, .office-network > i, .office-lamp { width: 7px; height: 7px; flex: none; display: inline-block; background: #4c7c51; box-shadow: 2px 2px #85a47c66; }
.dispatch-description { margin: 16px 0 19px; color: #354463; font-size: 16px; line-height: 1.45; }
.dispatch-description strong { color: var(--desktop-ink); font-weight: 650; }
.dispatch-actions { display: grid; gap: 7px; }
.dispatch-action { min-height: 40px; display: grid; grid-template-columns: 20px minmax(0, 1fr) auto 15px; align-items: center; gap: 9px; padding: 7px 9px; background: #dbe4f1; border: 2px solid #465e85; color: var(--desktop-ink); }
.dispatch-action strong { font: 700 13px/1.25 var(--mono); }
.dispatch-action span { color: #465a79; font: 11px/1.2 var(--mono); }
.dispatch-action svg { width: 16px; height: 16px; }
.dispatch-action svg:last-child { width: 14px; height: 14px; justify-self: end; }
.dispatch-primary { background: var(--desktop-yellow); border-color: #594a35; }
.dispatch-primary span { color: #473c2c; }
.dispatch-sample { background: #e9edf1; border-style: dashed; }
.dispatch-social { grid-template-columns: 20px minmax(0, 1fr) 15px; min-height: 44px; border-width: 1px; background: transparent; }
.dispatch-action:hover, .dispatch-action:focus-visible { color: #fff; background: #385884; }
.dispatch-action:hover span, .dispatch-action:focus-visible span { color: #e3eaff; }
.dispatch-card a:focus-visible { outline: 2px solid #2e507f; outline-offset: 3px; }
.dispatch-token { margin-top: 12px; padding: 8px 9px; background: #dfe6ef; border: 1px solid #8d9fbc; }
.dispatch-token .field-caption, .dispatch-token .digest { color: #273f66; }
.dispatch-token .copy-button { color: #304b75; }
.dispatch-token .copy-button:hover { color: #142a4a; text-decoration: underline; }
.dispatch-guide { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; padding-block: 4px; color: #304b75; font: 700 11px/1.35 var(--mono); }
.dispatch-guide:hover { color: #1a355d; text-decoration: underline; }
.dispatch-guide svg { width: 13px; height: 13px; }
.dispatch-links { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0 12px; }
button.dispatch-guide { padding-inline: 0; border: 0; background: transparent; cursor: pointer; }

.wallet-dialog {
  width: min(435px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  color: var(--ink);
  background: #1a273d;
  border: 1px solid #607598;
  box-shadow: 6px 6px 0 #121a2a, 0 15px 55px #090d16bb;
}
.wallet-dialog::backdrop { background: #0c1525bd; }
.wallet-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; background: #233550; border-bottom: 1px solid #556a8c; }
.wallet-heading > div, .wallet-connected > div:first-child { display: flex; align-items: center; gap: 8px; }
.wallet-heading > div svg { width: 20px; height: 20px; color: var(--accent); }
.wallet-heading h2 { font: 400 17px/1.25 var(--pixel); }
.wallet-body { display: grid; gap: 12px; padding: 14px; }
.wallet-body > p, .wallet-foot > span { color: var(--muted); font-size: 12px; }
.wallet-choices, .wallet-connected { display: grid; gap: 7px; }
.wallet-choice { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; color: var(--ink); background: var(--surface-raised); border: 1px solid var(--line); text-align: start; }
.wallet-choice:not(:disabled):hover { border-color: var(--accent); }
.wallet-choice strong { font-size: 13px; }
.wallet-choice > span { color: var(--muted); font: 10px/1.3 var(--mono); }
.wallet-connected { padding: 10px; background: var(--well); border: 1px solid var(--line); }
.wallet-connected > div:first-child { flex-wrap: wrap; }
.wallet-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.wallet-foot { display: grid; justify-items: start; border-top: 1px solid var(--line); padding-top: 5px; }

.office-screen { display: grid; place-items: center; min-height: 100dvh; padding: 12px; background: #151e31; }
.office-content { min-width: 0; width: min(100%, 1380px, max(820px, calc((100dvh - 110px) * 16 / 9))); border: 2px solid #101a2c; box-shadow: 0 0 0 1px #516b8d, 6px 6px 0 #0d1525; }
.office-toolbar { min-height: 51px; align-items: center; justify-content: space-between; display: flex; flex-wrap: wrap; gap: 8px 15px; background: #223653; border-bottom: 2px solid #111a2a; padding: 8px 11px; }
.office-toolbar > div { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.office-toolbar h1 { font: 400 21px/1.1 var(--pixel); color: #eff2f8; }
.office-back, .office-network { align-items: center; display: inline-flex; gap: 6px; color: #f2f3ec; background: #15243a; border: 1px solid #567192; padding: 5px 7px; font: 11px/1.4 var(--mono); }
.office-back:hover { background: #395577; }
.office-back svg { width: 14px; height: 14px; }
.office-actions { justify-content: flex-end; }
.office-comms-toggle { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 8px; border: 1px solid #836945; color: #231d15; background: var(--accent); font: 700 11px/1.35 var(--mono); }
.office-comms-toggle:hover { background: #ffdd96; }
.office-comms-toggle svg { width: 14px; height: 14px; }
.office-comms-toggle[aria-expanded='true'] { background: #2c4161; color: #e9edf6; border-color: #5a779d; }
.office-network { color: #dfe6f5; white-space: nowrap; }
.office-network > i { background: #eac77e; box-shadow: 2px 2px #f5c15a33; }
.office-layout { min-width: 0; }
.office-scene { align-self: start; min-width: 0; }
.office-floor { position: relative; min-width: 0; }
#office-art { display: block; width: 100%; height: auto; aspect-ratio: 16/9; background: #24324a; image-rendering: pixelated; }
.office-stations { position: absolute; inset: 0; pointer-events: none; }
.station {
  position: absolute;
  z-index: 1;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 33px;
  padding: 4px 9px 4px 5px;
  border: 2px solid #121d30;
  outline: 1px solid #839bbf;
  background: #edf0e9;
  color: #202e49;
  box-shadow: 3px 3px #15253b88;
  font: 700 13px/1.3 var(--mono);
  white-space: nowrap;
}
.station::before { content: ''; position: absolute; border: 6px solid transparent; border-bottom-color: #1b2c47; left: calc(50% - 6px); top: -13px; }
.station:hover, .station:focus-visible { background: #f6d486; color: #302714; outline: 2px solid #faf0b3; outline-offset: 2px; }
.station svg { width: 15px; height: 15px; }
.station kbd { display: inline-flex; align-items: center; justify-content: center; background: #d3deea; border: 1px solid #a5b6cd; width: 19px; height: 19px; color: #253653; font: 11px/1 var(--mono); }
.station[data-destination='launch'] { left: 22.19%; top: 43.06%; }
.station[data-destination='agents'] { left: 75.47%; top: 41.67%; }
.station[data-destination='ledger'] { left: 25.47%; top: 77.22%; }
.station[data-destination='verify'] { left: 74.69%; top: 76.39%; }
.office-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 16px; min-height: 36px; padding: 6px 11px; border-top: 2px solid #111a2a; background: #21314c; color: #e1e8f6; font: 11px/1.45 var(--mono); }
.office-footer > div, .office-footer a { overflow-wrap: anywhere; display: inline-flex; align-items: center; gap: 7px; }
.office-footer a { color: #f4cd78; }
.office-footer a:hover { text-decoration: underline; }
.office-footer a svg { width: 14px; height: 14px; }
.office-lamp { background: #9fbae9; box-shadow: none; }

.has-comms .office-content { width: min(100%, 1480px); }
.has-comms .office-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(342px, 425px); align-items: start; background: #19283f; }
.office-dock { min-width: 0; align-self: stretch; border-left: 2px solid #101a2c; background: #243653; }
.dock-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 2px solid #101a2c; }
.dock-header h2 { font: 400 14px/1.3 var(--pixel); letter-spacing: -.035em; scroll-margin-top: 92px; }
.dock-header > div { display: flex; gap: 5px; }
.dock-icon { width: 31px; height: 31px; display: grid; place-items: center; color: var(--ink); background: #1a293f; border: 1px solid #597596; }
.dock-icon:hover { color: var(--accent); }
.dock-icon svg { width: 15px; height: 15px; }
.is-docked.agent-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 8px; }
.is-docked .agent-directory { display: none; }
.is-docked .agent-evidence { grid-column: 1; }
.is-docked .agent-evidence summary { padding: 10px 12px; min-height: 0; }
.is-docked .conversation-header { min-height: 62px; padding-inline: 11px; }
.is-docked .thread { padding: 11px; min-height: 230px; max-height: clamp(230px, 31vh, 370px); }
.is-docked .message { max-width: 96%; padding-inline: 10px; }
.is-docked #agent-compose { padding: 10px; }
.is-docked .prompt-list > button { min-height: 31px; font-size: 10px; }
.dock-launch-picker { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.dock-launch-picker > span { flex: none; }
.dock-launch-picker select { min-width: 0; flex: 1; border: 1px solid var(--line); padding: 6px; background: var(--well); color: var(--ink); font: inherit; }

@media (max-width: 1090px) {
  .has-comms .office-content { width: min(100%, 820px); }
  .has-comms .office-layout { grid-template-columns: minmax(0, 1fr); }
  .office-dock { border-left: 0; border-top: 2px solid #101a2c; }
}

@media (max-width: 650px) {
  .office-content { width: 100%; }
  .office-toolbar h1 { font-size: 15px; }
  .office-stations { position: static; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 9px; background: #263b5a; }
  .station { position: relative; inset: auto !important; transform: none; box-shadow: 2px 2px #15253b88; min-height: 42px; }
  .station::before { content: none; }
  .instrument { border-color: #435678; }
}
@media (max-width: 440px) {
  .dispatch-screen { padding-inline: 14px; }
  .dispatch-card { padding: 18px 15px 14px; }
  .dispatch-mark { width: 37px; height: 37px; }
  .dispatch-mark svg { width: 24px; height: 24px; }
  .dispatch-heading { gap: 9px; }
  .dispatch-description { margin-block: 13px 15px; font-size: 15px; }
  .dispatch-action { grid-template-columns: 16px minmax(0, 1fr) 14px; min-height: 45px; }
  .dispatch-action span { display: none; }
  .office-screen { padding: 9px; }
  .office-toolbar { padding-inline: 8px; }
  .office-toolbar > div { gap: 7px; }
  .office-back, .office-network { font-size: 10px; }
  .office-comms-toggle { min-height: 27px; font-size: 10px; padding: 3px 5px; }
  .nav a { padding-inline: 4px; }
  .nav a svg { display: none; }
}
