/* One stylesheet, no build step. The reader asked for a simple interface and
   the deploy path is "copy three files to S3" — a bundler here would buy
   nothing and add a way for the site to break. */
:root {
  --bg: #0b0e14; --panel: #141922; --panel-2: #1b212c; --line: #263041;
  --ink: #e6ebf4; --muted: #8b98ad; --accent: #4c8dff; --accent-ink: #fff;
  --green: #35c17e; --red: #ff5f6d; --amber: #f2b53a;
  --radius: 12px; --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }

/* The `hidden` attribute is only `display: none` from the UA stylesheet, so ANY
   author rule that sets `display` beats it. `.gate` is `display: grid` and
   `.badge` is `display: inline-block`, which meant the sign-in panel rendered
   permanently on top of the dashboard and the approvals badge always showed a
   zero. This one line is the fix, and it has to stay above every component
   rule: an element the JS calls hidden must actually be hidden, whatever class
   it also carries. */
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
h1, h2, h3 { margin: 0 0 .5rem; font-weight: 620; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; }
a { color: var(--accent); }
.muted { color: var(--muted); }
.error { color: var(--red); min-height: 1.2em; margin: .5rem 0 0; }

/* ── gate ─────────────────────────────────────────────────────────────── */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem; }
.gate-card { width: min(360px, 100%); }
.gate-card h1 { font-size: 1.4rem; }
.gate-card h1 span { color: var(--accent); }

/* ── chrome ───────────────────────────────────────────────────────────── */
header { position: sticky; top: 0; z-index: 10; display: flex; gap: .75rem;
  align-items: center; flex-wrap: wrap; padding: .7rem 1rem;
  background: rgba(11,14,20,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; }
.brand span { color: var(--accent); }
.session { font-size: .78rem; padding: .2rem .55rem; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); }
.session.open { color: var(--green); border-color: rgba(53,193,126,.4); }
.session.ext { color: var(--amber); border-color: rgba(242,181,58,.4); }
nav { display: flex; gap: .25rem; flex: 1 1 100%; overflow-x: auto;
  scrollbar-width: none; }
nav::-webkit-scrollbar { display: none; }
nav button { background: none; border: 0; color: var(--muted); padding: .45rem .7rem;
  border-radius: 8px; font: inherit; font-size: .9rem; cursor: pointer; white-space: nowrap; }
nav button.active { background: var(--panel-2); color: var(--ink); }
.badge { display: inline-block; min-width: 1.35em; padding: 0 .3em; margin-left: .3em;
  border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  font-size: .72rem; text-align: center; }
main { padding: 1rem; max-width: 900px; margin: 0 auto; }
.tab { display: none; }
.tab.active { display: block; }
.tabhead { display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; margin-bottom: .75rem; flex-wrap: wrap; }
.stack { display: grid; gap: .75rem; }

/* ── cards ────────────────────────────────────────────────────────────── */
.card { background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem; }
.card.live { border-color: rgba(255,95,109,.45); }
.card h3 { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.sym { font-size: 1.15rem; font-weight: 700; letter-spacing: .02em; }
.pill { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  padding: .15rem .45rem; border-radius: 6px; background: var(--panel-2);
  color: var(--muted); border: 1px solid var(--line); }
.pill.live { color: var(--red); border-color: rgba(255,95,109,.4); }
.pill.paper { color: var(--accent); border-color: rgba(76,141,255,.4); }
.pill.ok { color: var(--green); border-color: rgba(53,193,126,.4); }
.pill.warn { color: var(--amber); border-color: rgba(242,181,58,.4); }

/* The four levels the plan named. A grid so entry/stop/T1/T2 always land in
   the same place — the reader is comparing them across cards, not reading
   prose. */
.levels { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem;
  margin: .75rem 0; font-family: var(--mono); font-size: .85rem; }
.levels div { background: var(--panel-2); border-radius: 8px; padding: .4rem .5rem; }
.levels span { display: block; font-size: .68rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); }
.levels .stop b { color: var(--red); }
.levels .t1 b, .levels .t2 b { color: var(--green); }
.levels .entry b { color: var(--amber); }

.prose { display: grid; gap: .3rem; margin: .6rem 0; font-size: .9rem; }
.prose p { margin: 0; }
.prose .why { color: var(--muted); }

.sizerow { display: flex; gap: .5rem; align-items: flex-end; flex-wrap: wrap;
  margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--line); }
.sizerow label { flex: 1 1 100px; }
.actions { display: flex; gap: .5rem; margin-top: .75rem; flex-wrap: wrap; }

label { display: block; font-size: .78rem; color: var(--muted); margin-bottom: .5rem; }
input, select { width: 100%; margin-top: .25rem; padding: .5rem .6rem;
  background: var(--panel-2); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; font: inherit; font-size: .9rem; }
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button.primary { background: var(--accent); color: var(--accent-ink); border: 0;
  padding: .55rem 1rem; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; }
button.danger { background: var(--red); color: #fff; border: 0; padding: .55rem 1rem;
  border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; }
button.ghost { background: none; color: var(--ink); border: 1px solid var(--line);
  padding: .5rem .9rem; border-radius: 8px; font: inherit; cursor: pointer; }
button.small { padding: .3rem .6rem; font-size: .82rem; }
button:disabled { opacity: .5; cursor: not-allowed; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; }
.form-grid .full { grid-column: 1 / -1; }

table { width: 100%; border-collapse: collapse; font-size: .87rem; }
th, td { text-align: right; padding: .4rem .5rem; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 500; font-size: .74rem;
  text-transform: uppercase; letter-spacing: .05em; }
td.num { font-family: var(--mono); }
.pos { color: var(--green); } .neg { color: var(--red); }
.scroll { overflow-x: auto; }

.empty { color: var(--muted); text-align: center; padding: 2rem 1rem;
  border: 1px dashed var(--line); border-radius: var(--radius); }

.toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%);
  background: var(--panel-2); border: 1px solid var(--line); color: var(--ink);
  padding: .6rem 1rem; border-radius: 10px; z-index: 50; max-width: 90vw;
  box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.toast.bad { border-color: var(--red); }

@media (max-width: 520px) {
  .levels { grid-template-columns: repeat(2, 1fr); }
}
