/* ALF97+ VAULT — table-set instrument + constructivist drafting stage.
   Tokens match plus/alf-plus.css. Geometry from BBS table-set; drawing from
   loading-constructivist-bauhaus + aegean handDrawLine. */

@import url('https://fonts.googleapis.com/css2?family=Darker+Grotesque:wght@700;800;900&family=Outfit:wght@800;900&family=JetBrains+Mono:wght@400;700;800&display=swap');

:root {
  --paper: #fafafa; --ink: #000; --dim: #222; --faint: #555;
  --red: #ff3300; --blue: #0033ff; --yellow: #ffaa00; --hi: #faff00; --danger: #cc0000;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --disp: "Darker Grotesque", system-ui, sans-serif;
  --outfit: "Outfit", var(--disp), sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--paper); color: var(--ink);
  font-family: var(--mono); overflow: hidden;
}
a { color: var(--ink); text-decoration: none; }
a:hover { background: var(--hi); }
::selection { background: var(--red); color: #fff; }

.crop {
  position: absolute; width: 14px; height: 14px; z-index: 12; pointer-events: none;
  border: 2px solid var(--red);
}
.crop.tl { top: 6px; left: 6px; border-right: 0; border-bottom: 0; }
.crop.tr { top: 6px; right: 6px; border-left: 0; border-bottom: 0; }
.crop.bl { bottom: 6px; left: 6px; border-right: 0; border-top: 0; }
.crop.br { bottom: 6px; right: 6px; border-left: 0; border-top: 0; }

.app {
  position: absolute; inset: 14px;
  border: 2px solid var(--ink);
  display: flex; flex-direction: column;
  background: var(--paper);
}

/* redpaper spec bar — same geometry as PLUS swarm-head */
.bar {
  display: flex; align-items: stretch; flex: none; height: 42px;
  border-bottom: 2px solid var(--ink);
  font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
}
.bar .l {
  padding: 0 14px; border-right: 2px solid var(--ink);
  background: var(--red); color: #000; font-weight: 700;
  display: flex; align-items: center; white-space: nowrap;
}
.bar .m {
  flex: 1; padding: 0 14px; display: flex; align-items: center; gap: 16px;
  color: var(--dim); min-width: 0;
}
.bar .m b { color: var(--ink); }
.bar .m em { font-style: normal; color: var(--ink); font-weight: 700; }
.bar .stamps { display: flex; align-items: stretch; flex: none; }
.bar .stamps span {
  display: flex; align-items: center; padding: 0 12px;
  border-left: 2px solid var(--ink); font-weight: 700; white-space: nowrap;
}
.bar .stamps .blk-red { background: var(--red); color: #000; }
.bar .stamps .blk-blue { background: var(--blue); color: #fff; }
.bar .plus {
  display: flex; align-items: center; padding: 0 14px;
  border-left: 2px solid var(--ink); background: var(--blue); color: #fff;
  font-weight: 700; letter-spacing: .04em;
}
.bar .plus:hover { background: var(--ink); color: var(--paper); }

table.set {
  width: 100%; flex: 1; height: auto;
  border-collapse: collapse;
  background: var(--paper);
}
table.set > tbody > tr > td { border: 2px solid var(--ink); border-top: 0; padding: 0; }
table.set > tbody > tr:first-child > td { border-top: 0; }

td.nav { width: 228px; background: #fff; vertical-align: top; }
table.cmd { width: 100%; border-collapse: collapse; }
table.cmd th {
  padding: 9px 12px; font-size: 9px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--faint); text-align: left;
  border-bottom: 2px solid var(--ink);
}
table.cmd td {
  padding: 11px 12px; font-size: 12px; letter-spacing: .04em;
  border-bottom: 1px solid #0000001f; cursor: pointer;
}
table.cmd td.k { width: 22px; font-weight: 800; color: var(--blue); }
table.cmd tr:hover td { background: var(--hi); }
table.cmd tr.on td { background: var(--blue); color: #fff; }
table.cmd tr.on td.k { color: var(--yellow); }
table.cmd tr.danger td.k { color: var(--danger); }
table.cmd tr.danger.on td { background: var(--danger); color: #fff; }

td.stage {
  position: relative; vertical-align: top; overflow: hidden;
  background: var(--paper);
}
#draft, #sw {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}
#draft { z-index: 0; }
#sw { z-index: 3; }

.sheet {
  position: relative; z-index: 2;
  margin: 22px 22px 18px 56px;
  border: 2px solid var(--ink);
  background: rgba(250,250,250,.88);
  box-shadow: 8px 8px 0 var(--ink);
  display: flex; flex-direction: column;
  height: calc(100% - 40px);
  min-height: 0;
}
.sheet .titleblk {
  display: flex; align-items: flex-end; gap: 18px;
  padding: 12px 16px 10px;
  border-bottom: 2px solid var(--ink);
  border-left: 8px solid var(--ink);
}
.sheet .titleblk .no {
  font-family: var(--outfit); font-weight: 900; font-size: 28px; line-height: .8;
  letter-spacing: -.03em; text-transform: uppercase;
}
.sheet .titleblk .no i { font-style: normal; color: var(--red); }
.sheet .titleblk .meta {
  flex: 1; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim);
  padding-bottom: 2px;
}
.sheet .titleblk .meta b { color: var(--ink); }
.sheet .titleblk .xfer {
  font-weight: 800; font-size: 10px; letter-spacing: .16em;
  border: 2px solid var(--ink); padding: 4px 8px;
}
.scroll { flex: 1; overflow: auto; min-height: 0; }

table.flat { width: 100%; border-collapse: collapse; }
table.flat th, table.flat td {
  border-bottom: 1px solid var(--ink);
  padding: 9px 12px; font-size: 12px; text-align: left;
}
table.flat th {
  font-size: 9px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--faint); background: #fff; position: sticky; top: 0;
}
table.flat tr:hover td { background: var(--hi); cursor: pointer; }
table.flat tr.on td { background: var(--yellow); }
table.flat td.sz { font-variant-numeric: tabular-nums; width: 88px; color: var(--dim); }
table.flat td.act { width: 72px; }
table.flat td.act a {
  display: inline-block; padding: 3px 7px; border: 2px solid var(--ink);
  font: 700 9px/1 var(--mono); letter-spacing: .1em;
}
table.flat .dir td:nth-child(2) { font-weight: 800; }
table.flat .lock td { color: var(--danger); }

.viewer {
  display: none; border-top: 2px solid var(--ink);
  max-height: 38%; overflow: auto; background: #fff;
}
.viewer.on { display: block; }
.viewer .vh {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; border-bottom: 2px solid var(--ink);
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
}
.viewer .vh b { font-family: var(--disp); font-size: 18px; letter-spacing: .02em; }
.viewer .vh button {
  border: 2px solid var(--ink); background: #fff; font: 700 10px/1 var(--mono);
  letter-spacing: .12em; text-transform: uppercase; padding: 6px 10px; cursor: pointer;
}
.viewer .vh button:hover { background: var(--ink); color: var(--paper); }
.viewer pre {
  margin: 0; padding: 14px 16px; font: 400 11px/1.45 var(--mono);
  white-space: pre-wrap; word-break: break-word;
}
.viewer img {
  display: block; max-width: 100%; max-height: 220px; margin: 12px auto;
  border: 2px solid var(--ink);
}

td.foot { height: 48px; background: #fff; }
table.go { width: 100%; height: 48px; border-collapse: collapse; }
table.go td { border: 0; padding: 0 12px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
table.go td.lbl { width: 70px; font-weight: 700; }
table.go input {
  width: 100%; border: 0; outline: 0; background: transparent;
  font: 700 13px/1 var(--mono); color: var(--ink);
}
table.go td.act {
  width: 90px; background: var(--blue); color: #fff; text-align: center;
  font-weight: 800; cursor: pointer;
}
table.go td.act:hover { background: var(--hi); color: #000; }
table.go td.hazard {
  width: 74px; padding: 0; height: 48px;
  background: repeating-linear-gradient(45deg, #000 0 8px, var(--yellow) 8px 16px);
}

.watermark {
  position: absolute; right: 18px; top: 18px; z-index: 1; pointer-events: none;
  font-family: var(--outfit); font-weight: 900; font-size: clamp(64px, 10vw, 140px);
  line-height: .78; letter-spacing: -.04em; text-transform: uppercase;
  display: flex; flex-direction: column; align-items: flex-end; opacity: .11;
}
.watermark .outline {
  -webkit-text-stroke: 2px var(--ink);
  -webkit-text-fill-color: transparent; color: transparent;
}
.watermark .filled { color: var(--red); }

.color-block-red {
  position: absolute; left: 18px; top: 18px; width: 92px; height: 12px;
  background: var(--red); border: 3px solid var(--ink); z-index: 1; pointer-events: none;
}
.color-block-blue {
  position: absolute; left: 18px; bottom: 18px; width: 12px; height: 110px;
  background: var(--blue); z-index: 1; pointer-events: none;
}
