/* Mobile first, because the first time anyone opens this it will be on a phone. */

/* ── THEME ────────────────────────────────────────────────────────────────────
   Dark is the base. Light arrives two ways and they must not fight:

     1. the system asks for it  -> @media (prefers-color-scheme: light)
     2. the human asked for it  -> :root[data-theme="light"]

   The media block is scoped to :not([data-theme="dark"]) so an explicit "dark"
   choice BEATS a light system preference. Without that guard the toggle would
   look broken for exactly one group of people - someone on a light Mac who wants
   this app dark - which is the half nobody tests.

   THREE ACCENT TOKENS, NOT ONE. The brand gold is a fine FILL on any background
   and a poor INK on a white one (#d9a441 on white is about 2:1, well under the
   4.5:1 text floor). So --accent stays the fill in both themes, --accent-ink is
   the accent used as TEXT and darkens for light, --accent-dim is the accent used
   as a BORDER. Same for the status colours: the dark-mode green and amber are
   tuned for a near-black surface and go weak on white, so both themes carry their
   own. --err exists for the same reason and was previously hardcoded.
   ─────────────────────────────────────────────────────────────────────────── */
:root{
  color-scheme:dark;
  --bg:#0e1116; --panel:#161b22; --line:#232a35; --line-soft:#1b2029;
  --ink:#e6edf3; --dim:#8b949e; --field:#0b0e13; --header-bg:rgba(14,17,22,.94);
  --accent:#d9a441; --accent-ink:#d9a441; --accent-dim:#6b5320;
  --ok:#3fb950; --warn:#d29922; --err:#f85149; --go-ink:#1a1205;
}

@media (prefers-color-scheme: light){
  :root:not([data-theme="dark"]){
    color-scheme:light;
    --bg:#f6f7f9; --panel:#ffffff; --line:#dfe3e8; --line-soft:#eceff3;
    --ink:#1b1f24; --dim:#5c6570; --field:#ffffff; --header-bg:rgba(246,247,249,.94);
    --accent:#d9a441; --accent-ink:#7a5200; --accent-dim:#c8a24a;
    --ok:#1a7f37; --warn:#8a5d00; --err:#b42318; --go-ink:#1a1205;
  }
}

:root[data-theme="light"]{
  color-scheme:light;
  --bg:#f6f7f9; --panel:#ffffff; --line:#dfe3e8; --line-soft:#eceff3;
  --ink:#1b1f24; --dim:#5c6570; --field:#ffffff; --header-bg:rgba(246,247,249,.94);
  --accent:#d9a441; --accent-ink:#7a5200; --accent-dim:#c8a24a;
  --ok:#1a7f37; --warn:#8a5d00; --err:#b42318; --go-ink:#1a1205;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;background:var(--bg);color:var(--ink);
  font:16px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased}
a{color:inherit;text-decoration:none}
.wrap{max-width:860px;margin:0 auto;padding:20px 16px 48px}

/* header */
header{display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:18px 16px;border-bottom:1px solid var(--line);position:sticky;top:0;
  background:var(--header-bg);backdrop-filter:blur(8px);z-index:5}
.brand{display:flex;align-items:baseline;gap:10px;min-width:0;text-decoration:none;color:inherit}
.brand b{font-size:17px;letter-spacing:.2px;font-weight:600}
.brand span{color:var(--dim);font-size:12px;letter-spacing:.12em;text-transform:uppercase}
.who{display:flex;align-items:center;gap:10px;flex-shrink:0}
.who .name{font-size:13px;color:var(--dim);white-space:nowrap}
.pill{font-size:10px;letter-spacing:.1em;text-transform:uppercase;padding:3px 8px;
  border:1px solid var(--accent-dim);color:var(--accent-ink);border-radius:999px}
button.link,a.link{background:none;border:0;color:var(--dim);font-size:13px;padding:6px;
  cursor:pointer;text-decoration:none}
button.link:hover,a.link:hover{color:var(--ink)}

/* app tabs - the launcher. Replaced the tile grid 2026-09-13 (Keelan): a row of tabs
   reads as navigation, which is what it is. Nothing is framed; each tab is a link to
   the app's own page. Scrolls sideways rather than wrapping on a phone, so the row
   stays one row and the tab you want is a swipe away rather than a reflow. */
h2{font-size:12px;letter-spacing:.14em;text-transform:uppercase;color:var(--dim);
  margin:28px 0 12px;font-weight:600}
/* TIER 1 - modules. Deliberately NOT pills: if both tiers looked the same the row would
   read as one long list of eight things rather than a hierarchy of two. Text with an
   accent underline for the current one, which is the cheapest way to say "these are
   departments, those are apps" without inventing a colour. */
.mods{display:flex;gap:18px;padding:10px 16px 0;overflow-x:auto;scrollbar-width:none}
.mods::-webkit-scrollbar{display:none}
.mod{background:none;border:0;border-bottom:2px solid transparent;color:var(--dim);
  padding:6px 1px 8px;font-size:13px;font-family:inherit;cursor:pointer;white-space:nowrap;
  flex-shrink:0;letter-spacing:.01em}
.mod:hover{color:var(--ink)}
.mod.on{color:var(--ink);border-bottom-color:var(--accent);font-weight:600}
/* the tier-1 row already draws the top edge, so tier 2 loses its own */
.mods + .tabs{padding-top:10px}

.tabs{display:flex;gap:6px;padding:12px 16px;border-bottom:1px solid var(--line);
  overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none}
.tabs::-webkit-scrollbar{display:none}
.tab{background:var(--panel);border:1px solid var(--line);color:var(--dim);
  padding:8px 14px;border-radius:8px;font-size:13px;white-space:nowrap;flex-shrink:0;
  font-family:inherit;transition:border-color .15s,color .15s}
a.tab:hover{border-color:var(--accent-dim);color:var(--ink)}
/* current location. Filled rather than outlined so it reads at a glance on a phone. */
.tab.on{background:var(--accent);border-color:var(--accent);color:var(--go-ink);font-weight:600}
a.tab.on:hover{color:var(--go-ink)}
/* registered, not deployed: visibly present, deliberately not a link */
.tab.pending{opacity:.55;cursor:default}
/* The landing page's one line. CENTRED (Keelan, 2026-09-13: "why is this not centered
   on the screen... it's like 1/3 from the right").
   It was not misplaced by a stray margin - it was left-aligned text inside `.wrap`, a
   860px column that `margin:0 auto` centres on a ~1920px screen. So the line began at
   the column's left edge, ~28% across, which reads as randomly parked rather than as
   the empty state of a page. On a narrow window the two are indistinguishable, which is
   why it survived this long.
   Scoped to .hint rather than .wrap ON PURPOSE: platform.html shares .wrap and its
   content is a real left-aligned column that should stay one. .hint is used in exactly
   one place - shell.html's landing line - so this moves that line and nothing else. */
.hint{color:var(--dim);font-size:13px;margin:24px 0 0;text-align:center}

/* the theme toggle on the login view, which has no header to live in */
.themebtn{position:fixed;top:max(14px,env(safe-area-inset-top));right:14px;z-index:10}

/* login */
.login{min-height:100svh;display:flex;align-items:center;justify-content:center;padding:24px}
.card{width:100%;max-width:360px;background:var(--panel);border:1px solid var(--line);
  border-radius:16px;padding:28px}
.card .mark{font-size:12px;letter-spacing:.2em;text-transform:uppercase;color:var(--accent-ink);
  margin-bottom:6px}
.card h1{margin:0 0 4px;font-size:22px;font-weight:600}
.card .sub{color:var(--dim);font-size:13px;margin-bottom:22px}
input{width:100%;padding:14px;font-size:17px;letter-spacing:.18em;text-align:center;
  background:var(--field);border:1px solid var(--line);border-radius:10px;color:var(--ink);
  text-transform:uppercase;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
input:focus{outline:none;border-color:var(--accent)}
button.go{width:100%;margin-top:12px;padding:14px;font-size:16px;font-weight:600;
  background:var(--accent);color:var(--go-ink);border:0;border-radius:10px;cursor:pointer}
button.go:disabled{opacity:.5}
.err{margin-top:12px;color:var(--err);font-size:13px;min-height:18px;text-align:center}

/* admin panel */
.panel{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:16px;
  margin-top:12px;overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:13px}
th{text-align:left;color:var(--dim);font-weight:600;font-size:11px;letter-spacing:.1em;
  text-transform:uppercase;padding:6px 10px 6px 0;border-bottom:1px solid var(--line)}
td{padding:8px 10px 8px 0;border-bottom:1px solid var(--line-soft);white-space:nowrap}
tr:last-child td{border-bottom:0}
