/* Oxcart — flat black, titanium, stencil red. Square corners throughout. */
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(fonts/barlow-condensed-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(fonts/barlow-condensed-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 800; font-display: swap; src: url(fonts/barlow-condensed-latin-800-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(fonts/barlow-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url(fonts/barlow-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(fonts/barlow-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-display: swap; src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-display: swap; src: url(fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Saira Stencil One"; font-weight: 400; font-display: swap; src: url(fonts/saira-stencil-one-latin-400-normal.woff2) format("woff2"); }

:root {
  --iron: #0D0F12;       /* ground */
  --hangar: #161A1F;     /* panels */
  --rivet: #2A3038;      /* borders */
  --rivet-2: #4A525C;
  --titanium: #A3A9B0;   /* secondary text */
  --bone: #ECEAE4;       /* primary text */
  --bone-2: #C9CDD2;
  --red: #EF5340;        /* stencil red: accent, outbound */
  --amber: #F2A541;      /* afterburner: inbound, holding */
  --red-dim: #7A2A22;
  --red-dark: #4A1F1A;

  --f-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --f-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --f-stencil: "Saira Stencil One", "Barlow Condensed", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--iron); color: var(--bone); font: 16px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
a { color: var(--red); }
a:hover { color: var(--amber); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* ---------- type helpers */
.mono { font-family: var(--f-mono); }
.label { font: 500 12px var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--titanium); }
.h { margin: 0; font: 700 24px/1.1 var(--f-display); letter-spacing: .08em; text-transform: uppercase; }
.muted { color: var(--titanium); }
.placard { font-family: var(--f-stencil); letter-spacing: .12em; font-size: 14px; white-space: nowrap; }
.placard.box { border: 2px solid currentColor; padding: 2px 10px; display: inline-block; line-height: 1.4; }
.c-red { color: var(--red); } .c-amber { color: var(--amber); } .c-bone { color: var(--bone); } .c-ti { color: var(--titanium); }

/* ---------- header */
.top { border-bottom: 1px solid var(--rivet); }
.top .bar { max-width: 1240px; margin: 0 auto; padding: 0 24px; min-height: 72px; display: flex; align-items: stretch; gap: 32px; }
.lockup { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--bone); flex: none; }
.lockup svg { width: 60px; height: 20px; flex: none; }
.lockup .word { font: 800 28px/1 var(--f-display); letter-spacing: .08em; }
.lockup .word i { font-style: normal; color: var(--red); }
nav.tabs { display: flex; gap: 4px; }
nav.tabs button {
  background: none; border: 0; border-bottom: 3px solid transparent; padding: 0 14px; cursor: pointer;
  font: 600 18px var(--f-display); letter-spacing: .1em; color: var(--titanium); display: flex; align-items: center; gap: 8px;
}
nav.tabs button:hover { color: var(--bone); }
nav.tabs button[aria-selected="true"] { color: var(--bone); font-weight: 700; border-bottom-color: var(--red); }
.count { font: 500 12px var(--f-mono); color: var(--titanium); }
.count:empty { display: none; }
.who { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.who .name { font: 13px var(--f-mono); color: var(--titanium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }

/* ---------- buttons */
.btn {
  min-height: 44px; padding: 0 18px; border: 1px solid var(--rivet); background: transparent; color: var(--bone);
  font: 500 15px var(--f-body); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; white-space: nowrap; border-radius: 0;
}
.btn:hover { border-color: var(--titanium); color: var(--bone); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn.light { background: var(--bone); color: var(--iron); border-color: var(--bone); font-weight: 600; }
.btn.light:hover { background: #fff; }
.btn.go { background: var(--red); border-color: var(--red); color: var(--iron); font: 700 17px var(--f-display); letter-spacing: .1em; text-transform: uppercase; }
.btn.go:hover { filter: brightness(1.08); color: var(--iron); }
.btn.amber { background: var(--amber); border-color: var(--amber); color: var(--iron); font-weight: 600; }
.btn.amber:hover { filter: brightness(1.06); color: var(--iron); }
.btn.outline { border-color: var(--titanium); }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: .45; cursor: default; }
.ico { width: 44px; padding: 0; }
.ico svg { width: 16px; height: 16px; }

/* ---------- inputs */
input[type="text"], input[type="email"], input[type="number"], input[type="password"], select, textarea {
  min-height: 44px; padding: 0 12px; background: var(--iron); border: 1px solid var(--rivet); color: var(--bone);
  font: 15px var(--f-body); width: 100%; border-radius: 0;
}
textarea { padding: 12px; font: 14px/1.5 var(--f-mono); resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--titanium); opacity: .7; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--titanium); }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--titanium); min-width: 0; }
label.chk { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; color: var(--bone); min-height: 44px; cursor: pointer; }
label.chk input { width: 20px; height: 20px; accent-color: var(--red); margin: 0; }

/* segmented control (Private | Team, direction) */
.seg { display: inline-flex; border: 1px solid var(--rivet); }
.seg button {
  min-height: 34px; padding: 0 12px; background: transparent; border: 0; color: var(--titanium); cursor: pointer;
  font: 600 13px var(--f-display); letter-spacing: .12em; text-transform: uppercase; display: inline-flex; align-items: center; gap: 6px;
}
.seg button + button { border-left: 1px solid var(--rivet); }
.seg button[aria-pressed="true"] { background: var(--bone); color: var(--iron); }
.seg svg { width: 13px; height: 13px; }
.seg.big button { min-height: 44px; padding: 0 16px; font-size: 15px; }

/* ---------- layout */
main.wrap { max-width: 1240px; margin: 0 auto; padding: 28px 24px 64px; display: flex; flex-direction: column; gap: 28px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.panel { background: var(--hangar); border: 1px solid var(--rivet); padding: 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.row-fields .span2 { grid-column: span 2; }
.actions { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.actions .grow { flex: 1; }
.banner { border: 1px solid var(--amber); color: var(--amber); padding: 10px 14px; font: 13px var(--f-mono); letter-spacing: .04em; }

/* drop zone */
.drop {
  min-height: 108px; border: 2px dashed var(--rivet); display: flex; align-items: center; justify-content: center;
  gap: 14px; color: var(--titanium); font-size: 16px; padding: 16px; text-align: center; flex-wrap: wrap;
  transition: border-color .15s, background .15s;
}
.drop.over { border-color: var(--red); background: rgba(239, 83, 64, .06); color: var(--bone); }

/* ---------- contrail */
.flight { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--rivet); padding-top: 14px; }
.flight .top-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.flight .fname { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.flight .readout { font: 13px var(--f-mono); color: var(--titanium); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.flight .readout .grow { flex: 1; min-width: 0; }
.contrail { position: relative; height: 24px; padding-right: 32px; }
.contrail .track { position: relative; height: 100%; }
.contrail .ahead { position: absolute; top: 11px; right: -32px; border-top: 2px dotted var(--rivet); }
.contrail .s { position: absolute; top: 10px; height: 4px; border-radius: 2px; }
.contrail .cold { background: var(--rivet); }
.contrail .mid { background: var(--titanium); }
.contrail .hot { background: var(--red); }
.contrail svg { position: absolute; top: 2px; width: 32px; height: 19px; }
.contrail svg polygon { fill: var(--bone); }
.contrail.inbound .hot { background: var(--amber); }
.contrail.holding .hot, .contrail.holding svg polygon { background: var(--amber); fill: var(--amber); }
.contrail.holding .mid { background: var(--rivet-2); }
.contrail.landed .s { background: var(--titanium); }
.contrail.aborted .hot { background: var(--red); }
.contrail.aborted .mid { background: var(--red-dim); }
.contrail.aborted .cold { background: var(--red-dark); }
.contrail.aborted svg polygon { fill: var(--red); }
@media (prefers-reduced-motion: no-preference) { .contrail .s, .contrail svg { transition: left .25s linear, width .25s linear; } }

/* ---------- article lists */
.list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.filters { display: flex; gap: 0; }
.art {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 4px 18px; align-items: center;
  padding: 12px 0; border-top: 1px solid var(--rivet);
}
.art .kind { font: 500 12px var(--f-mono); letter-spacing: .1em; color: var(--titanium); grid-row: 1 / span 3; align-self: start; padding-top: 3px; }
.art .title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.art .title .nm { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--bone); text-decoration: none; }
.art .title a.nm:hover { color: var(--red); }
.art .note { font-size: 14px; color: var(--bone-2); grid-column: 2; overflow-wrap: anywhere; }
.art .note.add { color: var(--titanium); font-style: italic; }
.art .note.editable { cursor: text; }
.art .note.editable:hover { background: var(--hangar); }
.art .note input { min-height: 34px; }
.art .meta { grid-column: 2; display: flex; flex-wrap: wrap; gap: 4px 14px; font: 13px var(--f-mono); color: var(--titanium); align-items: center; }
.art .meta .soon { color: var(--amber); }
.art .meta .warn { color: var(--red); }
.art .acts { grid-column: 3; grid-row: 1 / span 3; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.art .acts select { min-height: 36px; width: auto; font-size: 14px; }
.art pre {
  grid-column: 2 / -1; margin: 4px 0 0; padding: 10px 12px; background: var(--iron); border: 1px solid var(--rivet);
  font: 13px/1.5 var(--f-mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 9.5em; overflow: hidden;
}
.art pre.open { max-height: none; }
.art pre.masked { color: var(--titanium); letter-spacing: .2em; user-select: none; }
.badge { display: inline-flex; align-items: center; gap: 5px; font: 500 11px var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--titanium); border: 1px solid var(--rivet); padding: 1px 6px; white-space: nowrap; }
.badge svg { width: 11px; height: 11px; }
.badge.red { color: var(--red); border-color: var(--red); }
.badge.amber { color: var(--amber); border-color: var(--amber); }
.linkbtn { background: none; border: 0; padding: 0; color: var(--red); cursor: pointer; font: 13px var(--f-mono); }
.linkbtn:hover { color: var(--amber); }
.empty { padding: 28px 0; color: var(--titanium); border-top: 1px solid var(--rivet); }

/* ---------- payloads */
.pl { background: var(--hangar); border: 1px solid var(--rivet); padding: 20px 22px; display: grid; gap: 14px; }
.pl-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.pl-title { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pl-title .nm { font: 700 22px/1.15 var(--f-display); letter-spacing: .05em; overflow-wrap: anywhere; }
.code {
  font: 400 clamp(22px, 3.6vw, 34px)/1 var(--f-stencil); letter-spacing: .08em; color: var(--bone); white-space: nowrap;
}
.code-row { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.stats { display: flex; flex-wrap: wrap; gap: 4px 18px; font: 13px var(--f-mono); color: var(--titanium); }
.stats b { color: var(--bone); font-weight: 500; }
.pl-items { display: grid; gap: 0; }
.pl-item { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--rivet); font-size: 15px; }
.pl-item .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-item .sz { font: 13px var(--f-mono); color: var(--titanium); }
.pl-item.burned .nm { color: var(--titanium); text-decoration: line-through; }
.qr { background: var(--bone); padding: 8px; width: 196px; height: 196px; display: block; }
.log { width: 100%; border-collapse: collapse; font: 12.5px var(--f-mono); }
.log th, .log td { text-align: left; padding: 6px 10px 6px 0; border-top: 1px solid var(--rivet); vertical-align: top; }
.log th { color: var(--titanium); font-weight: 500; letter-spacing: .1em; }
.log .bad { color: var(--red); }
.scroll-x { overflow-x: auto; }

/* ---------- dialog */
dialog { background: var(--hangar); color: var(--bone); border: 1px solid var(--rivet-2); padding: 0; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
dialog::backdrop { background: rgba(5, 6, 8, .72); }
.dlg { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.dlg .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dlg .grid .full { grid-column: 1 / -1; }
.dlg fieldset { border: 1px solid var(--rivet); margin: 0; padding: 14px 16px 16px; display: grid; gap: 12px; min-width: 0; }
.dlg legend { padding: 0 6px; }
.pick { max-height: 240px; overflow: auto; border: 1px solid var(--rivet); }
.pick label { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--rivet); cursor: pointer; font-size: 15px; }
.pick label:first-child { border-top: 0; }
.pick label span.n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick input { width: 18px; height: 18px; accent-color: var(--red); }
.cleared { display: grid; gap: 16px; justify-items: start; }
.cleared .code { font-size: clamp(26px, 5vw, 44px); }

/* ---------- toast */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--bone); color: var(--iron); padding: 10px 16px; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100% - 32px); z-index: 10; }
.toast.show { opacity: 1; }

/* ---------- sign in / public */
.center { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.card { background: var(--hangar); border: 1px solid var(--rivet); padding: 36px 32px; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 18px; }
.card .big-lockup svg { width: 120px; height: 40px; }
.card .big-lockup .word { font: 800 52px/1 var(--f-display); letter-spacing: .06em; }
.tagline { font: 600 22px/1.2 var(--f-display); letter-spacing: .03em; color: var(--bone); margin: 0; }

@media (max-width: 900px) {
  .grid2 { grid-template-columns: 1fr; }
  .top .bar { flex-wrap: wrap; gap: 0 20px; padding-top: 10px; }
  nav.tabs { order: 3; width: 100%; overflow-x: auto; min-height: 48px; }
  .who { margin-left: auto; }
}
@media (max-width: 620px) {
  .row-fields { grid-template-columns: 1fr; }
  .row-fields .span2 { grid-column: auto; }
  .art { grid-template-columns: minmax(0, 1fr); }
  .art .kind { grid-row: auto; padding: 0; }
  .art .note, .art .meta, .art pre { grid-column: 1; }
  .art .acts { grid-column: 1; grid-row: auto; justify-content: flex-start; order: 10; }
  .art pre { order: 9; }
  .who .name { display: none; }
  .dlg .grid { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  nav.tabs button { padding: 0 10px; font-size: 16px; }
}

/* misc */
.grid-col { display: grid; gap: 16px; }
.list-head p { margin: 6px 0 0; max-width: 70ch; }
.list-head .h + p { font-size: 15px; }
section[role="tabpanel"] { display: flex; flex-direction: column; gap: 20px; }
.list-head a { text-decoration: none; }
