/* DROP ZONE roadmap — the game terminal's language: warm near-black, orange for
   anything waiting on a person, green for anything running, white for taken
   ground. Mono type throughout. No blue anywhere: blue was the old board's
   default, not a choice. */

:root {
  --void:        #060605;
  --bg:          #0b0b0a;
  --surface:     #12110f;
  --surface-2:   #171613;
  --line:        #2a2820;
  --line-soft:   #201e18;

  --dim:         #8a8474;
  --text:        #b9b4a4;
  --text-bright: #eee9da;

  --done:        #f3f0e6;
  --done-ink:    #12110c;

  --green:       #4ec97a;
  --green-deep:  #2c7d4c;
  --green-fill:  #0d2114;

  --amber:       #F9AE42;
  --amber-deep:  #D3862B;
  --amber-fill:  #241705;

  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

/* Every panel here is toggled with the `hidden` attribute, and a class-level
   `display` in an author stylesheet outranks the UA rule that honors it.
   Without this line the gate never hides. */
[hidden] { display: none !important; }

html, body {
  margin: 0; height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  overscroll-behavior: none;
}

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--amber-deep); outline-offset: 2px; }

/* ───────────────────────────────────────────────── buttons ── */

.btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 16px;
  letter-spacing: .09em;
  font-size: 12.5px;
  cursor: pointer;
  border-radius: 2px;
  transition: border-color .15s, color .15s, background .15s;
}
.btn:hover { border-color: var(--amber-deep); color: var(--amber); }
.btn:active { background: #17150f; }
.btn-primary {
  border-color: var(--amber-deep);
  color: var(--amber);
  background: linear-gradient(180deg, rgba(249,174,66,.10), rgba(249,174,66,.03));
}
.btn-primary:hover { background: rgba(249,174,66,.16); }
.btn-wide { width: 100%; display: block; }
.btn:disabled { opacity: .45; cursor: default; }

/* ──────────────────────────────────────────────────── gate ── */

.gate {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background:
    radial-gradient(120% 90% at 50% 0%, #14120c 0%, var(--void) 70%);
  z-index: 50;
  padding: 24px;
}

.gate-panel {
  position: relative;
  width: min(380px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 34px 28px 24px;
}

.bracket { position: absolute; width: 12px; height: 12px; border: 2px solid var(--amber-deep); }
.bracket.tl { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.bracket.tr { top: -1px; right: -1px; border-left: 0; border-bottom: 0; }
.bracket.bl { bottom: -1px; left: -1px; border-right: 0; border-top: 0; }
.bracket.br { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.wordmark {
  margin: 0; text-align: center;
  font-size: 27px; font-weight: 800; letter-spacing: .16em;
  color: var(--text-bright);
}
.gate-sub {
  margin: 6px 0 26px; text-align: center;
  font-size: 12px; letter-spacing: .34em; color: var(--amber-deep);
}

.gate-block { margin-bottom: 4px; }
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: 12px; letter-spacing: .2em; color: var(--dim); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 10px 12px;
  background: var(--void);
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--text-bright);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--amber-deep); }

.or { position: relative; text-align: center; margin: 18px 0; }
.or::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  border-top: 1px solid var(--line);
}
.or span { position: relative; background: var(--surface); padding: 0 12px; font-size: 12px; letter-spacing: .2em; color: var(--dim); }

.gate-error { min-height: 18px; margin: 12px 0 0; font-size: 12px; color: #e2703a; text-align: center; }
.gate-foot { margin: 18px 0 0; text-align: center; font-size: 12px; letter-spacing: .12em; color: var(--dim); }

/* ───────────────────────────────────────────────── chrome ── */

.app { display: flex; flex-direction: column; height: 100%; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  flex: none;
}
.topbar-left { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.mark { font-weight: 800; letter-spacing: .14em; font-size: 16px; color: var(--text-bright); white-space: nowrap; }
.mark-sub { font-size: 12px; letter-spacing: .28em; color: var(--amber-deep); }
.stamp { font-size: 12px; color: var(--dim); letter-spacing: .1em; white-space: nowrap; }

.tabs { display: flex; gap: 8px; }
.tab {
  background: transparent; border: 1px solid transparent; border-radius: 2px;
  color: var(--dim); padding: 9px 16px; cursor: pointer;
  font-size: 13px; letter-spacing: .14em;
  transition: color .15s, border-color .15s, background .15s;
}
.tab:hover { color: var(--text-bright); }
.tab.on {
  color: var(--text-bright); border-color: var(--line);
  background: var(--surface-2);
}
#orange-n:empty { display: none; }

.topbar-right { display: flex; align-items: center; gap: 10px; }
/* Completion, stated once: the count, the same count as a bar, and the percent.
   Three readings of one number and no second number competing with it. */
.counts { display: flex; align-items: center; gap: 10px; margin-right: 6px; }
.c-fig { font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.c-fig b { color: var(--done); font-weight: 700; font-size: 16px; }
.c-fig i { color: var(--dim); font-style: normal; font-size: 12px; }
.c-meter {
  width: 96px; height: 3px; background: #23211a; display: block; overflow: hidden;
}
.c-meter i { display: block; height: 100%; background: var(--done); }
.c-pct { font-size: 12px; letter-spacing: .1em; color: var(--dim); font-variant-numeric: tabular-nums; }

.menu {
  position: absolute; top: 56px; right: 14px; z-index: 30;
  width: 270px; padding: 16px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.menu-who { margin: 0 0 12px; font-size: 12px; color: var(--dim); }
.menu-who strong { color: var(--text-bright); }
.menu-enrolled { font-size: 12px; color: var(--dim); margin-bottom: 12px; line-height: 1.7; }
.menu .btn { margin-bottom: 8px; }
.menu-msg { margin: 6px 0 0; font-size: 12px; color: var(--amber); min-height: 14px; }

.loading {
  position: fixed; inset: 0; display: grid; place-items: center;
  font-size: 12px; letter-spacing: .3em; color: var(--dim);
  pointer-events: none; z-index: 10;
}

/* ─────────────────────────────────────────────────── views ── */

.view { flex: 1; overflow-y: auto; }
.view-inner { max-width: 860px; margin: 0 auto; padding: 26px 20px 80px; }

.view-intro {
  margin: 0 0 26px; font-size: 13px; line-height: 1.7;
  letter-spacing: .04em; color: var(--dim);
}

/* ─────────────────────────────────── tree: stick and ball ── */

.view-tree { display: flex; flex-direction: column; overflow: hidden; position: relative; }
.tree-scroll {
  flex: 1; overflow: auto; display: flex;
  touch-action: none; cursor: grab;
  user-select: none; -webkit-user-select: none;
  scrollbar-width: none;            /* Firefox */
}
.tree-scroll::-webkit-scrollbar { display: none; }  /* Chrome, Safari, Edge */
.tree-scroll.dragging { cursor: grabbing; }
.tree-stage { position: relative; margin: auto; }
#tree-svg { display: block; }

.tree-labels { position: absolute; inset: 0; pointer-events: none; }
.tree-arc { position: absolute; left: 16px; width: 150px; }
.tree-arc-name {
  font-size: 13px; font-weight: 700; letter-spacing: .14em; line-height: 1.35;
  text-transform: uppercase; color: var(--text-bright);
}
.tree-arc-tally { margin-top: 3px; font-size: 12px; color: var(--done); font-variant-numeric: tabular-nums; }
.tree-arc-tally em { color: var(--dim); font-style: normal; }

.lane-band { fill: #100f0d; }

.stick { stroke: #26241d; stroke-width: 1; }
.stick.to-done { stroke: #56534a; stroke-width: 1; }
.stick.to-wait { stroke: var(--amber-deep); stroke-width: 1; opacity: .5; }
.stick.hl { stroke: var(--amber); stroke-width: 1.8; opacity: 1; }

.ball { cursor: pointer; stroke-width: 1.2; }
.ball.b-done    { fill: var(--done); stroke: #ffffff; }
.ball.b-active  { fill: var(--green); stroke: #8ce8ad; }
.ball.b-wait    { fill: var(--amber); stroke: #ffd28a; }
.ball.b-planned { fill: #3a372d; stroke: #56523f; }
.ball.b-parked  { fill: var(--bg); stroke: #46433a; stroke-dasharray: 2.5 2; }
.ball:hover { stroke: var(--amber); stroke-width: 2; }
.ball.selected { stroke: var(--amber); stroke-width: 2.5; }

.halo { fill: var(--amber); opacity: .5; pointer-events: none; animation: pulse 2.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .25; } 50% { opacity: .7; } }
@media (prefers-reduced-motion: reduce) { .halo { animation: none; opacity: .45; } }

.legend-tree {
  padding: 10px 18px; border-top: 1px solid var(--line); background: var(--surface);
  flex: none;
}
.legend-tree .hint { margin-left: auto; color: #5c584c; }
.legend-tree #tree-fit { padding: 5px 12px; font-size: 11.5px; margin-left: 6px; }
.dot { width: 11px; height: 11px; border-radius: 50%; border: 1px solid #56523f; background: #3a372d; display: inline-block; }
.dot.s-done   { background: var(--done); border-color: #fff; }
.dot.s-active { background: var(--green); border-color: #8ce8ad; }
.dot.s-wait   { background: var(--amber); border-color: #ffd28a; box-shadow: 0 0 7px rgba(249,174,66,.7); }
.dot.s-parked { background: var(--bg); border-style: dashed; }

/* Millionaires — the ball past the last ball. Its face floats above it and its
   name sits under it, both anchored to the node and always on. */
.mill-gif {
  position: absolute; transform: translate(-50%, -100%);
  width: 92px; image-rendering: auto;
  filter: drop-shadow(0 0 14px rgba(249,174,66,.35));
}
.mill-label {
  position: absolute; transform: translateX(-50%);
  font-size: 13px; font-weight: 700; letter-spacing: .18em;
  color: var(--amber); text-transform: uppercase;
  text-shadow: 0 0 12px rgba(249,174,66,.5);
  white-space: nowrap;
}

.hoverlab {
  position: absolute; z-index: 25; pointer-events: none;
  max-width: 340px; padding: 10px 14px;
  background: var(--surface-2); border: 1px solid var(--line);
  box-shadow: 0 8px 30px rgba(0,0,0,.6);
}
.hl-status { display: block; font-size: 11.5px; letter-spacing: .2em; margin-bottom: 4px; color: var(--dim); }
.hl-status.hl-done { color: #b9b5a5; }
.hl-status.hl-active { color: var(--green); }
.hl-status.hl-wait { color: var(--amber); }
.hl-title { display: block; font-size: 14px; line-height: 1.45; color: var(--text-bright); }

/* ──────────────────────────────────────── queries: the wire ── */

.q {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 22px 24px 20px;
  margin-bottom: 22px;
}
/* An unanswered query carries the terminal's corner brackets — the mark of a
   live prompt. Answering it takes the brackets away. */
.q .bracket { border-color: var(--amber-deep); }
.q.answered .bracket { display: none; }
.q.answered { border-color: var(--line-soft); }

.q-head {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  margin-bottom: 10px;
  font-size: 12px; letter-spacing: .18em;
}
.q-num { color: var(--dim); font-variant-numeric: tabular-nums; }
.q-num i { font-style: normal; color: #5c584c; }
.q-arc { color: var(--dim); }
.q-kind { color: var(--amber); }
.q.answered .q-kind { color: var(--dim); }
.q-answered-stamp { color: var(--green); letter-spacing: .18em; margin-left: auto; }

.q-title {
  margin: 0 0 14px; font-size: 19px; line-height: 1.4;
  color: var(--text-bright); letter-spacing: .01em;
}

/* The question itself is the loudest text on the card — it is the entire
   reason the card exists. */
.q-ask {
  margin: 0 0 12px; font-size: 15px; line-height: 1.75;
  color: #e2dcc9;
}
.q-why { margin: 0 0 18px; font-size: 13px; line-height: 1.7; color: var(--dim); }

.q-reply { display: flex; flex-direction: column; gap: 10px; }
.q-reply textarea {
  width: 100%; min-height: 64px; padding: 12px 14px; resize: vertical;
  background: var(--void); border: 1px solid var(--line); border-radius: 2px;
  color: var(--text-bright); font-size: 14px; line-height: 1.6;
}
.q-reply textarea:focus { outline: none; border-color: var(--amber-deep); }
.q-reply-row { display: flex; align-items: center; gap: 14px; }
.q-msg { font-size: 12.5px; color: var(--amber); }

.q-notes { margin-top: 16px; }
.q-note { border-left: 2px solid var(--green-deep); padding: 6px 0 6px 12px; margin-top: 10px; }
.q-note .q-note-meta { font-size: 12px; letter-spacing: .12em; color: var(--dim); margin-bottom: 4px; }
.q-note p { margin: 0; font-size: 13.5px; line-height: 1.65; color: var(--text); white-space: pre-wrap; }

.q-empty {
  border: 1px dashed var(--line); padding: 34px 24px; text-align: center;
  color: var(--dim); font-size: 14px; letter-spacing: .06em; line-height: 1.7;
}

/* ─────────────────────────────────────── board: the ledger ── */

.legend {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 0 2px 22px; font-size: 13px; letter-spacing: .06em; color: var(--dim);
}
.key { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 12px; height: 12px; border: 1px solid var(--line); background: var(--surface-2); display: inline-block; }
.swatch.s-done   { background: var(--done); border-color: #fff; }
.swatch.s-active { background: var(--green-fill); border-color: var(--green); }
.swatch.s-wait   { background: var(--amber-fill); border-color: var(--amber); box-shadow: 0 0 7px rgba(249,174,66,.6); }
.swatch.s-parked { border-style: dashed; background: var(--bg); }

.arc { margin-bottom: 38px; }
.arc-head {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px; margin-bottom: 14px;
}
.arc-name {
  margin: 0; font-size: 19px; font-weight: 800; letter-spacing: .16em;
  color: var(--text-bright); text-transform: uppercase;
}
.arc-stat { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; }
.arc-meter { width: 110px; height: 4px; background: #23211a; overflow: hidden; }
.arc-meter i { display: block; height: 100%; background: var(--done); }
.arc-tally { font-size: 13.5px; color: var(--done); font-variant-numeric: tabular-nums; font-weight: 600; }
.arc-tally em { color: var(--dim); font-style: normal; font-weight: 400; }
.arc-blurb { width: 100%; margin: 4px 0 0; font-size: 13px; line-height: 1.6; color: var(--dim); }

/* Chips run in build order, so the white simply stops where the work does —
   the front line with no geometry drawn at all. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  max-width: 100%;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 2px;
  color: var(--text); padding: 9px 13px;
  font-size: 13.5px; letter-spacing: .01em; line-height: 1.35;
  cursor: pointer; text-align: left;
  transition: border-color .15s, color .15s;
}
.chip:hover { border-color: var(--amber); }
.chip.selected { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
.chip i { font-style: normal; flex: none; }

.chip.s-done { background: var(--done); border-color: #fff; color: var(--done-ink); font-weight: 600; }
.chip.s-done i { color: #6d6a5c; }
.chip.s-active { background: var(--green-fill); border-color: var(--green); color: #d9f4e2; font-weight: 600; }
.chip.s-active i { color: var(--green); }
.chip.s-wait {
  background: var(--amber-fill); border-color: var(--amber); color: var(--amber); font-weight: 600;
  box-shadow: 0 0 9px rgba(249,174,66,.45);
}
.chip.s-planned { color: var(--text); }
.chip.s-parked { border-style: dashed; background: transparent; color: var(--dim); }

/* ─────────────────────────────────────────────── dialogue ── */

.detail {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 40;
  width: min(480px, 100%);
  background: var(--surface-2);
  border-left: 1px solid var(--line);
  padding: 22px 24px 30px;
  overflow-y: auto;
  box-shadow: -20px 0 46px rgba(0,0,0,.55);
}
.detail-close {
  position: absolute; top: 10px; right: 12px;
  background: none; border: 0; color: var(--dim);
  font-size: 26px; line-height: 1; cursor: pointer; padding: 4px 8px;
}
.detail-close:hover { color: var(--amber); }
.detail-arc { display: flex; gap: 12px; align-items: center; font-size: 12px; letter-spacing: .2em; color: var(--dim); margin-bottom: 10px; }
.detail-arc span:last-child { color: var(--amber); }
.detail h2 { margin: 0 0 14px; font-size: 20px; line-height: 1.35; color: var(--text-bright); letter-spacing: .01em; }

.blocker { border: 1px solid var(--amber-deep); background: rgba(211,134,43,.07); padding: 14px 16px; margin-bottom: 16px; }
.blocker-head { font-size: 12px; letter-spacing: .24em; color: var(--amber); margin-bottom: 8px; }
.blocker p { margin: 0; font-size: 14px; line-height: 1.7; color: #e0cba4; }

.detail-body { font-size: 14px; line-height: 1.75; color: var(--text); margin: 0 0 16px; }
.detail-deps { font-size: 13.5px; line-height: 1.9; color: var(--dim); margin-bottom: 22px; }
.detail-deps b { display: block; letter-spacing: .18em; font-size: 12px; color: var(--dim); margin-bottom: 4px; font-weight: 400; }
.detail-deps a { color: var(--text); text-decoration: none; border-bottom: 1px dotted var(--line); cursor: pointer; }
.detail-deps a:hover { color: var(--amber); }

.fb { border-top: 1px solid var(--line); padding-top: 18px; }
.fb-head { font-size: 12px; letter-spacing: .24em; color: var(--dim); margin-bottom: 10px; }
.fb textarea {
  width: 100%; padding: 12px 14px; resize: vertical;
  background: var(--void); border: 1px solid var(--line); border-radius: 2px;
  color: var(--text-bright); font-size: 14px; line-height: 1.6; margin-bottom: 10px;
}
.fb textarea:focus { outline: none; border-color: var(--amber-deep); }
.fb-msg { min-height: 16px; margin: 8px 0 0; font-size: 13px; color: var(--amber); }
.fb-list { margin-top: 14px; }
.fb-note { border-left: 2px solid var(--green-deep); padding: 6px 0 6px 12px; margin-bottom: 10px; }
.fb-note .fb-meta { font-size: 12px; letter-spacing: .12em; color: var(--dim); margin-bottom: 4px; }
.fb-note p { margin: 0; font-size: 13.5px; line-height: 1.65; color: var(--text); white-space: pre-wrap; }

/* A deep-linked or jumped-to card announces itself once. */
@keyframes q-flash { 0% { border-color: var(--amber); } 100% { border-color: var(--line); } }
.q.flash { animation: q-flash 1.6s ease-out 1; }
@media (prefers-reduced-motion: reduce) { .q.flash { animation: none; } }

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 10px; }
  .tabs { order: 3; width: 100%; }
  .tab { flex: 1; text-align: center; }
  .counts { display: none; }
  .stamp { display: none; }
  .view-inner { padding: 18px 12px 60px; }
  .q { padding: 18px 16px 16px; }
  .detail { width: 100%; border-left: 0; }
}
