/* Journey Studio - the field is the platform gradient; every card sits on it
   with alpha, per the transparent-field doctrine. Invariants: gold = touch,
   green = pass/correct, salmon = open/wrong. Hyphens, no victory laps. */

:root {
  --gold: #e8b84b;
  --green: #63c98a;
  --salmon: #f0897d;
  --cyan: #6fd3e0;
  --ink: #eef0f6;
  --ink-dim: #a9aec2;
  --card: rgba(255, 255, 255, 0.055);
  --card-edge: rgba(255, 255, 255, 0.10);
}

* { box-sizing: border-box; margin: 0; }

body {
  min-height: 100vh;
  font: 15px/1.55 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(111, 211, 224, 0.14), transparent 60%),
    radial-gradient(800px 600px at -10% 110%, rgba(232, 184, 75, 0.10), transparent 55%),
    linear-gradient(160deg, #101425 0%, #191331 55%, #221439 100%);
  background-attachment: fixed;
}

#app { max-width: 1060px; margin: 0 auto; padding: 28px 22px 64px; }

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- header ---- */
.mast { display: flex; align-items: baseline; gap: 14px; margin-bottom: 26px; }
.mast h1 { font-size: 21px; font-weight: 800; letter-spacing: 0.2px; }
.mast .sub { color: var(--ink-dim); font-size: 13px; }
.mast .spacer { flex: 1; }
.mast button { font-size: 13px; }

/* ---- login ---- */
.login-wrap { min-height: 82vh; display: grid; place-items: center; }
.login {
  width: min(400px, 92vw);
  padding: 34px 32px 30px;
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: 18px;
  backdrop-filter: blur(14px);
}
.login .mark { font-size: 30px; margin-bottom: 6px; }
.login h1 { font-size: 22px; font-weight: 800; }
.login p { color: var(--ink-dim); font-size: 13px; margin: 6px 0 22px; }
.login label { display: block; font-size: 12px; color: var(--ink-dim); margin: 14px 0 5px; text-transform: uppercase; letter-spacing: 0.6px; }
.login input {
  width: 100%; padding: 11px 13px; border-radius: 10px; font-size: 15px;
  color: var(--ink); background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--card-edge); outline: none;
}
.login input:focus { border-color: var(--gold); }
.login .err { color: var(--salmon); font-size: 13px; min-height: 18px; margin-top: 12px; }

button.primary {
  width: 100%; margin-top: 8px; padding: 12px; border-radius: 11px; border: none;
  font-size: 15px; font-weight: 700; cursor: pointer;
  color: #1c1607; background: var(--gold);
}
button.primary:hover { filter: brightness(1.07); }
button.ghost {
  padding: 7px 14px; border-radius: 9px; cursor: pointer; font-weight: 600;
  color: var(--ink); background: transparent; border: 1px solid var(--card-edge);
}
button.ghost:hover { border-color: var(--ink-dim); }

/* ---- shelf ---- */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.jcard {
  display: block; color: inherit; padding: 20px 20px 16px;
  background: var(--card); border: 1px solid var(--card-edge);
  border-radius: 16px; backdrop-filter: blur(12px);
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.jcard:hover { transform: translateY(-2px); border-color: var(--gold); text-decoration: none; }
.jcard h3 { font-size: 16.5px; font-weight: 750; margin-bottom: 3px; }
.jcard .meta { color: var(--ink-dim); font-size: 12.5px; margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  font-size: 11px; font-weight: 700; letter-spacing: 0.4px;
  padding: 3px 9px; border-radius: 999px; border: 1px solid transparent;
}
.chip.pass { color: var(--green); border-color: color-mix(in srgb, var(--green) 45%, transparent); background: color-mix(in srgb, var(--green) 12%, transparent); }
.chip.open { color: var(--salmon); border-color: color-mix(in srgb, var(--salmon) 45%, transparent); background: color-mix(in srgb, var(--salmon) 12%, transparent); }
.chip.wait { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, transparent); background: color-mix(in srgb, var(--gold) 12%, transparent); }
.chip.dim  { color: var(--ink-dim); border-color: var(--card-edge); }

.empty { color: var(--ink-dim); padding: 40px 8px; text-align: center; }
.jcard.new { border-style: dashed; }
.jcard.new h3 { color: var(--gold); }

.f-label { display: block; font-size: 12px; color: var(--ink-dim); margin: 14px 0 5px; text-transform: uppercase; letter-spacing: 0.6px; }
.f-input {
  width: 100%; padding: 10px 12px; border-radius: 10px; font-size: 14.5px;
  color: var(--ink); background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--card-edge); outline: none;
}
.f-input:focus { border-color: var(--gold); }
.panel form .primary { margin-top: 18px; }
.panel .err { color: var(--salmon); font-size: 13px; min-height: 18px; margin-top: 10px; }

/* ---- journey page ---- */
.crumb { font-size: 13px; color: var(--ink-dim); margin-bottom: 14px; }
.jhead h2 { font-size: 24px; font-weight: 800; }
.jhead .meta { color: var(--ink-dim); font-size: 13.5px; margin: 4px 0 18px; }

.panel {
  background: var(--card); border: 1px solid var(--card-edge);
  border-radius: 16px; backdrop-filter: blur(12px);
  padding: 20px 22px; margin-bottom: 16px;
}
.panel h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--ink-dim); margin-bottom: 12px; }

.gates { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.gate { padding: 12px 14px; border-radius: 12px; background: rgba(0, 0, 0, 0.22); border: 1px solid var(--card-edge); }
.gate b { display: block; font-size: 13px; }
.gate span { font-size: 12px; }
.gate.pass span { color: var(--green); }
.gate.open span { color: var(--salmon); }
.gate.wait span { color: var(--gold); }

.tools { display: flex; flex-wrap: wrap; gap: 10px; }
.tool {
  padding: 11px 16px; border-radius: 11px; cursor: pointer; font-weight: 700; font-size: 14px;
  color: var(--ink); background: rgba(0, 0, 0, 0.24); border: 1px solid var(--card-edge);
}
.tool:hover { border-color: var(--gold); color: var(--gold); }
.tool[disabled] { opacity: 0.45; cursor: not-allowed; }

ul.open-items { padding-left: 20px; }
ul.open-items li { color: var(--salmon); font-size: 14px; margin: 4px 0; }

pre.record {
  font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink); white-space: pre-wrap; word-break: break-word;
  background: rgba(0, 0, 0, 0.28); border-radius: 12px; padding: 16px;
  max-height: 420px; overflow: auto;
}

.viewer { position: fixed; inset: 0; z-index: 40; background: rgba(8, 8, 16, 0.72); backdrop-filter: blur(6px); display: grid; place-items: center; }
.viewer .frame-wrap { width: min(1200px, 96vw); height: 92vh; display: flex; flex-direction: column; gap: 8px; }
.viewer iframe { flex: 1; border: 1px solid var(--card-edge); border-radius: 14px; background: #fff; }
.viewer .bar { display: flex; justify-content: space-between; align-items: center; color: var(--ink-dim); font-size: 13px; }

/* ---- telemetry: usage over time ----------------------------------------
   Bars are CSS, not a charting library. The portal ships no dependencies and
   this page is read by one admin - a 40KB library to draw 21 rectangles would
   be the wrong trade, and an offline-hostile one. */

.tcols { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px; margin-top: 6px; }
.tcols h5 { margin: 0 0 8px; font-size: 12px; letter-spacing: .5px; text-transform: uppercase; color: var(--ink-dim); }
.trow { display: grid; grid-template-columns: 1fr 70px 34px; align-items: center; gap: 8px; margin-bottom: 4px; }
.trow-k { font: 12px ui-monospace, monospace; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow-bar { height: 8px; background: color-mix(in srgb, var(--ink-dim) 14%, transparent); border-radius: 999px; overflow: hidden; }
.trow-bar i { display: block; height: 100%; }
.trow-bar.c-cyan i { background: var(--cyan); }
.trow-bar.c-gold i { background: var(--gold); }
.trow-bar.c-green i { background: var(--green); }
.trow-n { font: 12px ui-monospace, monospace; color: var(--ink-dim); text-align: right; }

.tfail > div { border-left: 2px solid var(--salmon); padding: 6px 0 6px 10px; margin-bottom: 8px; font-size: 12px; }
.tfail .err { color: var(--salmon); font: 11px ui-monospace, monospace; }

/* The log list is SCROLLABLE rather than 60 rows tall. With the viewer beneath
   a full-height list, clicking a log opened it off-screen and looked like
   nothing had happened. */
.tlogs { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px;
         border: 1px solid var(--card-edge); border-radius: 8px; padding: 10px; }
.tlogs a { font: 12px ui-monospace, monospace; text-decoration: none; color: var(--cyan); }
.tlogs a:hover { text-decoration: underline; }
.tlog-body { max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word;
             font: 12px/1.55 ui-monospace, monospace; color: var(--ink);
             background: color-mix(in srgb, var(--ink-dim) 7%, transparent);
             border: 1px solid var(--card-edge); border-radius: 8px; padding: 12px; margin: 0; }

/* ---- telemetry: WHO worked, WHEN, on WHICH LANE -------------------------
   A grid, not a bar chart: the subject is the person, the axis is the day, and
   the colour is the lane - so the migration is legible at a glance rather than
   inferred from a number. Height carries volume; nobody needs to read it
   precisely, which is why there is no axis. */
.tgrid { display: grid; gap: 3px; align-items: end; }
.tgrid-d { font: 10px ui-monospace, monospace; color: var(--ink-dim); text-align: center; }
.tgrid-w { font: 11px ui-monospace, monospace; color: var(--ink); align-self: center;
           overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcell { display: flex; align-items: flex-end; justify-content: center; height: 38px;
         border-radius: 3px; background: color-mix(in srgb, var(--ink-dim) 8%, transparent); }
.tcell i { display: block; width: 100%; border-radius: 3px; }
.tcell.access i { background: var(--cyan); }
.tcell.bearer i { background: var(--gold); }
.tcell.both   i { background: linear-gradient(180deg, var(--cyan), var(--gold)); }
.tcell.legacy i { background: color-mix(in srgb, var(--ink-dim) 45%, transparent); }
.tkey { display: flex; gap: 16px; margin-top: 12px; font-size: 11px; color: var(--ink-dim); }
.tkey .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.tkey .sw.access { background: var(--cyan); } .tkey .sw.bearer { background: var(--gold); }
.tkey .sw.both { background: linear-gradient(180deg, var(--cyan), var(--gold)); }
.tkey .sw.legacy { background: color-mix(in srgb, var(--ink-dim) 45%, transparent); }
