:root {
  --ink: #101920;
  --panel: #17232d;
  --line: #324553;
  --paper: #eff3ed;
  --secondary: #aebdc3;
  --mint: #a8edcb;
  --warm: #ffc09e;
  --background: #111c24;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; color: var(--paper); background: var(--background); font: 16px/1.45 "Avenir Next", Avenir, system-ui, sans-serif; }
.shell { width: min(1160px, calc(100% - 48px)); margin-inline: auto; }
.masthead { border-bottom: 1px solid var(--line); background: var(--ink); }
.release { margin-block: 24px; color: var(--secondary); font-family: var(--mono); }
.mast-content, .brand, .account, .box-title { display: flex; align-items: center; }
.mast-content, .box-title { justify-content: space-between; gap: 12px; }
.mast-content { min-height: 75px; }
.brand { gap: 12px; font-size: 20px; letter-spacing: -.045em; }
.brand strong { color: var(--mint); font-weight: 680; }
.compass { width: 27px; aspect-ratio: 1; position: relative; border: 1px solid #64867c; border-radius: 50%; }
.compass::before, .compass::after { content: ""; position: absolute; inset: 5px 9px; clip-path: polygon(50% 0,100% 50%,50% 100%,0 50%); background: linear-gradient(var(--mint) 50%,#416257 50%); transform: rotate(34deg); }
.account { gap: 12px; }
button, input, select, textarea, a { font: inherit; }
button, .secondary { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; }
h1, h2, p { margin: 0; }
h1 { font: 400 clamp(2.65rem, 6.3vw, 5.45rem)/.99 Baskerville, "Iowan Old Style", Georgia, serif; letter-spacing: -.065em; }
h1 em { font-weight: 400; color: var(--mint); }
h2 { letter-spacing: -.045em; font-size: 1.28rem; font-weight: 650; }
.intro { padding: 36px 0 23px; }
.intro p, .gate p, .hint, .empty { color: var(--secondary); }
.intro p { margin-top: 13px; }
.modes { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 19px; overflow-x: auto; }
.modes button { background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--secondary); padding: 12px 17px; white-space: nowrap; }
.modes button[aria-pressed="true"] { color: var(--mint); border-bottom-color: var(--mint); }
.work-grid, .admin-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 18px; align-items: start; padding-bottom: 35px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 15px; padding: 22px; min-width: 0; }
.box-title { margin-bottom: 16px; }
.quiet { border: 0; border-radius: 3px; background: transparent; color: var(--mint); padding: 3px; font-size: .86rem; }
.quiet:hover, .modes button:hover { text-decoration: underline; text-underline-offset: 4px; }
.field { margin-bottom: 14px; }
label { display: block; font-weight: 650; font-size: .85rem; margin-bottom: 6px; }
textarea, input, select { display: block; width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; color: var(--paper); background: var(--ink); }
textarea, code, .datum, .readout { font-family: var(--mono); }
textarea { resize: vertical; min-height: 92px; max-height: 50vh; font-size: .88rem; }
textarea::placeholder, input::placeholder { color: #91a5ae; }
.hint { display: block; font-size: .8rem; margin-top: 8px; overflow-wrap: anywhere; }
.destinations { border-top: 1px solid var(--line); padding-top: 15px; margin-top: 18px; }
.destinations h2 { margin-bottom: 9px; }
.chips { padding: 4px 3px 5px; display: flex; flex-wrap: wrap; gap: 7px; max-height: 156px; overflow: auto; margin-top: 7px; }
.chip, .secondary { font-size: .82rem; padding: 6px 10px; border-radius: 7px; border: 1px solid #4d6471; background: var(--ink); color: var(--paper); text-decoration: none; }
.chip[aria-pressed="true"] { background: #24463f; border-color: #71af96; color: var(--mint); }
.chip[aria-pressed="true"]::before { content: "✓ "; }
.custom-app { font-size: .86rem; color: var(--secondary); margin-top: 7px; }
.custom-app summary { cursor: pointer; color: var(--mint); padding-block: 5px; }
.custom-app .field { margin: 6px 0 0; }
.chip:hover, .secondary:hover { border-color: var(--mint); }
.primary { background: var(--mint); color: #12261f; border: 1px solid transparent; border-radius: 8px; padding: 9px 16px; font-weight: 730; min-height: 43px; }
.primary:hover { background: #c9fbe4; }
.primary span { margin-left: 10px; }
.convert { margin-top: 14px; }
.message { color: var(--warm); font-size: .84rem; }
.message:empty { display: none; }
.message:not(:empty) { margin-top: 10px; }
.datum { color: var(--mint); font-size: .75rem; text-align: right; }
.plot { position: relative; overflow: hidden; border-radius: 9px; background: #11262f; border: 1px solid #345159; }
.plot canvas { display: block; width: 100%; height: auto; }
.readout { display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; color: var(--mint); background: #13252b; border-top: 1px solid #345159; padding: 9px 12px; font-size: .74rem; }
.output-list { margin-top: 14px; }
.output-list .empty { font-size: .9rem; }
.result { padding: 13px 0; border-bottom: 1px solid var(--line); display: grid; gap: 8px; }
.result:first-child { padding-top: 0; }
.result:last-child { border-bottom: 0; padding-bottom: 0; }
.result h3 { margin: 0; font-size: .98rem; }
.result code, .new-invite code { display: block; border: 1px solid var(--line); background: var(--ink); padding: 10px; border-radius: 7px; font-size: .83rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.result-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.result small { color: var(--secondary); }
.result code.result-link { color: var(--mint); font-size: .75rem; }
#app-destinations:not([hidden]) + #format-destinations { margin-top: 14px; }
.warning, .revoke { color: var(--warm) !important; }
.admin-grid h2 { margin-bottom: 13px; }
.new-invite { margin-top: 12px; }
.new-invite code { margin: 8px 0; color: var(--mint); }
.gate { display: grid; grid-template-columns: 1fr 1fr; margin: max(36px, 7vh) auto 0; min-height: 405px; max-width: 930px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.gate-card { padding: clamp(22px, 5vw, 52px); background: var(--panel); position: relative; }
.gate h1 { font-size: clamp(2.65rem, 5vw, 4.1rem); }
.gate-card > p { margin: 15px 0 22px; }
.gate-card .primary { margin-top: 13px; }
.gate-card .message { color: var(--warm); }
.gate-art { background-color: #122932; background-image: linear-gradient(to right,#29444b 1px, transparent 1px), linear-gradient(to bottom,#29444b 1px, transparent 1px); background-size: 35px 35px; position: relative; display: grid; place-items: center; }
.reticle { width: 63%; aspect-ratio: 1; position: relative; border: 1px solid #5b887f; border-radius: 50%; box-shadow: inset 0 0 0 31px #122932, inset 0 0 0 32px #3b675e; }
.reticle::before { content: ""; position: absolute; inset: 15% 39%; clip-path: polygon(50% 0,100% 50%,50% 100%,0 50%); background: linear-gradient(var(--mint) 50%,#416257 50%); transform: rotate(34deg); }
.gate-art > span:not(.reticle) { color: var(--mint); position: absolute; font: 13px var(--mono); }
.north { top: 8%; }.south { bottom: 8%; }.west { left: 9%; }.east { right: 9%; }
#boot-message { margin-top: 30px; }
@media (max-width: 760px) {
  .shell { width: min(1160px, calc(100% - 28px)); }
  .work-grid, .admin-grid { grid-template-columns: 1fr; }
  .mast-content { min-height: 61px; }
  .intro { padding-top: 27px; }
  .panel { padding: 16px; }
  .modes button { padding: 11px 10px; font-size: .9rem; }
  .gate { grid-template-columns: 1fr; min-height: auto; max-width: 480px; }
  .gate-art { min-height: 150px; }
  .reticle { width: 110px; box-shadow: inset 0 0 0 12px #122932, inset 0 0 0 13px #3b675e; }
  .north { top: 3%; }.south { bottom: 3%; }.west { left: 27%; }.east { right: 27%; }
}
@media (max-width: 365px) { .brand { font-size: 17px; gap: 7px; } .account { gap: 4px; } .account .quiet { font-size: .76rem; } }
