/* =========================================================================================
   WhaleRestocks Web Console — "deep-ocean sonar operations console"
   A dark mission-control terminal. Bioluminescent cyan accent pings like sonar when
   inventory surfaces. Industrial HUD typography. Refined, dense, high-stakes.
   ========================================================================================= */

:root {
  /* --- light "tidepool" surfaces --- */
  --abyss:      #eaf0f6;   /* page floor (soft cool off-white) */
  --deep:       #f4f8fb;   /* app shell / rail */
  --surface:    #ffffff;   /* panels */
  --surface-2:  #f4f8fb;   /* raised / hover */
  --surface-3:  #eef3f8;   /* inputs / active */
  --line:       rgba(20, 50, 70, .12);
  --line-soft:  rgba(20, 50, 70, .07);
  --line-strong:rgba(20, 50, 70, .18);

  /* --- ink --- */
  --ink:        #142430;
  --ink-dim:    #4b6373;
  --ink-faint:  #8096a4;
  --ink-ghost:  #aabac6;

  /* --- bioluminescence (accents, darkened for legibility on light) --- */
  --sonar:      #07978a;   /* primary: live / cartable / success */
  --sonar-deep: #05796f;
  --sonar-glow: rgba(7, 151, 138, .28);
  --sonar-dim:  rgba(7, 151, 138, .12);

  --amber:      #c47d12;   /* warn / benched / checking / queued */
  --amber-glow: rgba(196, 125, 18, .20);
  --coral:      #d83a48;   /* danger / failed / banned / fraud */
  --coral-glow: rgba(216, 58, 72, .18);
  --tide:       #1f6fd0;   /* info / links / secondary */
  --tide-glow:  rgba(31, 111, 208, .16);

  /* --- type --- */
  --f-display: "Chakra Petch", "IBM Plex Sans", system-ui, sans-serif;
  --f-body:    "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --f-mono:    "IBM Plex Mono", ui-monospace, "JetBrains Mono", monospace;

  /* --- geometry --- */
  --rail-w: 232px;
  --radius: 10px;
  --radius-sm: 6px;
  --gap: 18px;
  --shadow: 0 14px 34px -20px rgba(20, 45, 70, .28);
  --shadow-glow: 0 0 0 1px var(--sonar-dim), 0 14px 34px -18px rgba(7, 151, 138, .16);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--abyss);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* tidepool atmosphere: a faint sonar wash from the top + the faintest grain */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(120% 80% at 18% -10%, rgba(7, 151, 138, .07), transparent 55%),
    radial-gradient(90% 70% at 100% 110%, rgba(31, 111, 208, .05), transparent 60%),
    var(--abyss);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: .018;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--tide); text-decoration: none; }
a:hover { color: #1559a8; }

svg.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

::selection { background: var(--sonar-dim); color: var(--ink); }

/* scrollbars */
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #d4dee7; border-radius: 99px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: #b7c6d2; background-clip: padding-box; }

/* =========================================================================================
   APP SHELL — fixed command rail + top fleet strip + content
   ========================================================================================= */
.shell { display: grid; grid-template-columns: var(--rail-w) 1fr; min-height: 100vh; }

/* ---- command rail (sidebar) ---- */
.rail {
  position: sticky; top: 0; align-self: start;
  height: 100vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--deep), var(--abyss));
  border-right: 1px solid var(--line);
  padding: 0;
}
.rail__brand {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 18px 16px;
  border-bottom: 1px solid var(--line-soft);
}
.rail__mark { width: 30px; height: 30px; flex: none; color: var(--sonar); filter: drop-shadow(0 0 8px var(--sonar-glow)); }
.rail__title { font-family: var(--f-display); font-weight: 600; letter-spacing: .3px; font-size: 15px; line-height: 1.05; }
.rail__title small { display: block; font-family: var(--f-mono); font-weight: 400; font-size: 9.5px; letter-spacing: 2.2px; text-transform: uppercase; color: var(--ink-faint); margin-top: 2px; }

/* instance switcher */
.rail__instance { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); }
.rail__instance label { display: block; font-family: var(--f-mono); font-size: 9px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px; }

.rail__nav { flex: 1; overflow-y: auto; padding: 10px 10px; display: flex; flex-direction: column; gap: 2px; }
.navlink {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--ink-dim); font-weight: 500; font-size: 13.5px;
  position: relative; transition: background .14s, color .14s;
}
.navlink svg { width: 17px; height: 17px; flex: none; opacity: .85; }
.navlink:hover { background: var(--surface); color: var(--ink); }
.navlink.is-active { background: var(--surface-2); color: var(--ink); }
.navlink.is-active::before {
  content: ""; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 99px;
  background: var(--sonar); box-shadow: 0 0 10px var(--sonar-glow);
}
.navlink__badge { margin-left: auto; font-family: var(--f-mono); font-size: 10.5px; color: var(--ink-faint); }

.rail__foot { padding: 12px 16px; border-top: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; }
.rail__foot .ver { font-family: var(--f-mono); font-size: 10px; color: var(--ink-ghost); }
.rail__foot a { font-size: 11.5px; color: var(--ink-faint); }
.rail__foot a:hover { color: var(--coral); }

/* ---- main column ---- */
.main { min-width: 0; display: flex; flex-direction: column; }

/* top fleet-health strip — the old console title, now a HUD bar */
.fleet {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 9px 22px;
  background: rgba(255, 255, 255, .82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.fleet__title { font-family: var(--f-display); font-weight: 600; font-size: 13px; letter-spacing: .4px; margin-right: 8px; color: var(--ink); }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 10px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line);
  font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-dim);
  white-space: nowrap;
}
.chip b { color: var(--ink); font-weight: 600; }
.chip .dot { width: 7px; height: 7px; border-radius: 99px; background: var(--ink-faint); flex: none; }
.chip.good .dot { background: var(--sonar); box-shadow: 0 0 7px var(--sonar-glow); }
.chip.warn .dot { background: var(--amber); box-shadow: 0 0 7px var(--amber-glow); }
.chip.bad  .dot { background: var(--coral); box-shadow: 0 0 7px var(--coral-glow); }
.chip.good b { color: var(--sonar); }
.chip.warn b { color: var(--amber); }
.chip.bad  b { color: var(--coral); }
.fleet__spacer { flex: 1; }
.fleet__clock { font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-faint); }

.content { padding: 26px 22px 60px; max-width: 1480px; width: 100%; }

/* page header */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head__l { min-width: 0; }
.eyebrow { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 2.4px; text-transform: uppercase; color: var(--sonar-deep); margin-bottom: 7px; }
h1 { font-family: var(--f-display); font-weight: 600; font-size: 27px; letter-spacing: .2px; margin: 0; line-height: 1.1; }
.page-head p { color: var(--ink-dim); margin: 7px 0 0; font-size: 13.5px; max-width: 70ch; }
.page-head__r { display: flex; gap: 10px; align-items: center; flex: none; }

h2 { font-family: var(--f-display); font-weight: 600; font-size: 16px; letter-spacing: .3px; margin: 0; }
h3 { font-family: var(--f-display); font-weight: 600; font-size: 13.5px; letter-spacing: .3px; margin: 0; color: var(--ink); }

/* =========================================================================================
   PANELS / CARDS / STATS
   ========================================================================================= */
.panel {
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 18px; border-bottom: 1px solid var(--line-soft); }
.panel__head .sub { font-family: var(--f-mono); font-size: 11px; color: var(--ink-faint); }
.panel__body { padding: 18px; }
.panel__body.flush { padding: 0; }

.grid { display: grid; gap: var(--gap); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } .grid.cols-3 { grid-template-columns: repeat(2,1fr);} }
@media (max-width: 720px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

/* stat card — big mono number, thin bioluminescent top rule */
.stat {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 17px 15px;
}
.stat::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--sonar), transparent 70%); opacity: .55; }
.stat.is-warn::before { background: linear-gradient(90deg, var(--amber), transparent 70%); }
.stat.is-bad::before  { background: linear-gradient(90deg, var(--coral), transparent 70%); }
.stat__label { font-family: var(--f-mono); font-size: 10px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--ink-faint); display: flex; align-items: center; gap: 7px; }
.stat__value { font-family: var(--f-mono); font-weight: 600; font-size: 30px; letter-spacing: -.5px; margin-top: 8px; line-height: 1; color: var(--ink); }
.stat__value .unit { font-size: 14px; color: var(--ink-faint); font-weight: 400; margin-left: 3px; }
.stat__sub { margin-top: 7px; font-size: 11.5px; color: var(--ink-dim); }
.stat.is-good .stat__value { color: var(--sonar); }
.stat.is-warn .stat__value { color: var(--amber); }
.stat.is-bad  .stat__value { color: var(--coral); }

/* =========================================================================================
   PILLS / BADGES / DOTS
   ========================================================================================= */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2.5px 9px; border-radius: 99px;
  font-family: var(--f-mono); font-size: 11px; font-weight: 500; letter-spacing: .2px;
  border: 1px solid var(--line-strong); color: var(--ink-dim); background: var(--surface);
}
.pill .dot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.pill.good { color: var(--sonar); border-color: var(--sonar-dim); background: rgba(47,240,207,.06); }
.pill.warn { color: var(--amber); border-color: var(--amber-glow); background: rgba(246,180,77,.06); }
.pill.bad  { color: var(--coral); border-color: var(--coral-glow); background: rgba(255,93,108,.06); }
.pill.info { color: var(--tide);  border-color: var(--tide-glow);  background: rgba(78,163,255,.06); }
.pill.idle { color: var(--ink-faint); }

.pulse { position: relative; }
.pulse::after {
  content: ""; position: absolute; left: -3px; top: 50%; width: 6px; height: 6px;
  transform: translateY(-50%); border-radius: 99px; background: currentColor;
  animation: sonar-ping 1.8s ease-out infinite;
}
@keyframes sonar-ping {
  0%   { box-shadow: 0 0 0 0 currentColor; opacity: .7; }
  70%  { box-shadow: 0 0 0 9px transparent; opacity: 0; }
  100% { box-shadow: 0 0 0 0 transparent; opacity: 0; }
}

/* =========================================================================================
   BUTTONS
   ========================================================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font-family: var(--f-display); font-weight: 600; font-size: 13px; letter-spacing: .3px;
  padding: 8px 15px; border-radius: var(--radius-sm); cursor: pointer;
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-strong);
  transition: background .14s, border-color .14s, transform .05s, box-shadow .14s;
  white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--surface-3); border-color: var(--sonar-dim); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn.primary {
  background: linear-gradient(180deg, var(--sonar), var(--sonar-deep));
  color: #ffffff; border-color: transparent; box-shadow: 0 6px 18px -8px var(--sonar-glow);
}
.btn.primary:hover { box-shadow: 0 8px 26px -8px var(--sonar-glow); filter: brightness(1.05); }
.btn.danger { color: var(--coral); border-color: var(--coral-glow); }
.btn.danger:hover { background: rgba(255,93,108,.1); border-color: var(--coral); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { background: var(--surface); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 9px; flex-wrap: wrap; }

/* =========================================================================================
   TABLES
   ========================================================================================= */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; font-family: var(--f-mono); font-weight: 500; font-size: 10px;
  letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink-faint);
  padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--line-soft); color: var(--ink-dim); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: var(--surface); }
table.data td.mono, table.data .mono { font-family: var(--f-mono); color: var(--ink); }
table.data td.num { font-family: var(--f-mono); text-align: right; }
.t-primary { color: var(--ink); font-weight: 500; }

/* =========================================================================================
   FORMS
   ========================================================================================= */
label.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px; }
input[type=text], input[type=password], input[type=number], input[type=search], input[type=url], select, textarea {
  width: 100%; font-family: var(--f-body); font-size: 13.5px; color: var(--ink);
  background: var(--surface-3); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 9px 12px; transition: border-color .14s, box-shadow .14s; outline: none;
}
input[type=text].mono, input.mono, textarea.mono, select.mono { font-family: var(--f-mono); }
input:focus, select:focus, textarea:focus { border-color: var(--sonar); box-shadow: 0 0 0 3px var(--sonar-dim); }
input::placeholder, textarea::placeholder { color: var(--ink-ghost); }
textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2388a2b0' stroke-width='2'%3E%3Cpath d='M3 5l3 3 3-3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--ink-dim); }
.checkbox input { width: auto; accent-color: var(--sonar); }
.help { font-size: 11.5px; color: var(--ink-faint); margin-top: 5px; }
.inline-form { display: flex; gap: 9px; align-items: flex-end; flex-wrap: wrap; }

/* =========================================================================================
   EMPTY STATE / MISC
   ========================================================================================= */
.empty { text-align: center; padding: 46px 20px; color: var(--ink-faint); }
.empty svg { width: 38px; height: 38px; opacity: .4; margin-bottom: 12px; color: var(--sonar); }
.empty h3 { color: var(--ink-dim); margin-bottom: 5px; }
.muted { color: var(--ink-faint); }
.mono { font-family: var(--f-mono); }
.tnum { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 1px; }
hr.rule { border: none; border-top: 1px solid var(--line-soft); margin: 18px 0; }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.row { display: flex; gap: var(--gap); align-items: center; }
.banner { display: flex; align-items: center; gap: 11px; padding: 11px 15px; border-radius: var(--radius-sm); font-size: 13px; border: 1px solid var(--line-strong); background: var(--surface); margin-bottom: 18px; }
.banner.warn { border-color: var(--amber-glow); background: rgba(246,180,77,.06); color: var(--amber); }
.banner.bad { border-color: var(--coral-glow); background: rgba(255,93,108,.06); color: var(--coral); }
.banner svg { width: 17px; height: 17px; flex: none; }

/* secret mask */
.secret { font-family: var(--f-mono); color: var(--ink-faint); }
.reveal { cursor: pointer; border-bottom: 1px dotted var(--ink-ghost); }

/* =========================================================================================
   MODAL / DRAWER
   ========================================================================================= */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 70; display: none;
  background: rgba(26, 42, 56, .42); backdrop-filter: blur(3px);
  align-items: flex-start; justify-content: center; padding: 7vh 18px 18px;
}
.modal-backdrop.open { display: flex; }
.modal {
  width: 100%; max-width: 720px; max-height: 84vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow); animation: rise .22s cubic-bezier(.2,.7,.3,1) both;
}
.modal.wide { max-width: 920px; }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.modal__head h2 { font-size: 16px; }
.modal__close { cursor: pointer; color: var(--ink-faint); background: none; border: none; padding: 4px; border-radius: 5px; }
.modal__close:hover { color: var(--ink); background: var(--surface-2); }
.modal__body { padding: 20px; overflow-y: auto; }
.modal__foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line-soft); }
.steps { display: flex; gap: 8px; margin-bottom: 18px; }
.step { flex: 1; height: 3px; border-radius: 99px; background: var(--surface-3); }
.step.active { background: var(--sonar); box-shadow: 0 0 8px var(--sonar-glow); }
.step.done { background: var(--sonar-deep); }
.pick-list { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; }
.pick {
  display: flex; align-items: center; gap: 12px; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
  cursor: pointer; transition: border-color .12s, background .12s;
}
.pick:hover { border-color: var(--sonar-dim); }
.pick.sel { border-color: var(--sonar); background: rgba(47,240,207,.05); }
.pick input { accent-color: var(--sonar); }
.pick__meta { min-width: 0; flex: 1; }
.pick__t { color: var(--ink); font-weight: 500; }
.pick__s { font-size: 11.5px; color: var(--ink-faint); font-family: var(--f-mono); margin-top: 2px; }
.chips-edit { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-toggle { cursor: pointer; user-select: none; padding: 4px 10px; border-radius: 99px; font-family: var(--f-mono); font-size: 11.5px; border: 1px solid var(--line-strong); color: var(--ink-dim); background: var(--surface-2); }
.chip-toggle.on { color: var(--sonar); border-color: var(--sonar); background: rgba(47,240,207,.06); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line-strong); border-top-color: var(--sonar); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* tiny inline controls used in data tables */
.toggle { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-family: var(--f-mono); font-size: 11px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--ink-faint); background: var(--surface); }
.toggle.on { color: var(--sonar); border-color: var(--sonar-dim); background: rgba(47,240,207,.06); }
.toggle .dot { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.inp-mini { width: 64px; padding: 4px 7px; font-size: 12px; }
.sel-mini { padding: 4px 24px 4px 8px; font-size: 12px; }
.icon-btn { cursor: pointer; color: var(--ink-faint); background: none; border: 1px solid var(--line); border-radius: 5px; padding: 4px; display: inline-flex; }
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); background: var(--surface-2); }
.icon-btn.danger:hover { color: var(--coral); border-color: var(--coral-glow); }

/* =========================================================================================
   TOASTS
   ========================================================================================= */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13px;
  background: var(--surface-2); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow); animation: toast-in .25s ease both;
}
.toast.good { border-left: 3px solid var(--sonar); }
.toast.warn { border-left: 3px solid var(--amber); }
.toast.bad  { border-left: 3px solid var(--coral); }
.toast.info { border-left: 3px solid var(--tide); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* =========================================================================================
   LOGIN
   ========================================================================================= */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate__card { width: 100%; max-width: 380px; }
.gate__brand { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 26px; text-align: center; }
.gate__mark { width: 58px; height: 58px; color: var(--sonar); filter: drop-shadow(0 0 18px var(--sonar-glow)); }
.gate__brand h1 { font-size: 22px; }
.gate__brand small { font-family: var(--f-mono); font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: var(--ink-faint); }
.gate .panel__body { padding: 24px; }
.gate .err { color: var(--coral); font-size: 13px; margin-bottom: 14px; text-align: center; }

/* staggered page-load reveal */
.reveal-in { animation: rise .5s cubic-bezier(.2,.7,.3,1) both; }
.reveal-in:nth-child(1) { animation-delay: .02s; }
.reveal-in:nth-child(2) { animation-delay: .07s; }
.reveal-in:nth-child(3) { animation-delay: .12s; }
.reveal-in:nth-child(4) { animation-delay: .17s; }
.reveal-in:nth-child(5) { animation-delay: .22s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* responsive rail collapse */
@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: fixed; left: 0; top: 0; width: var(--rail-w); transform: translateX(-100%); transition: transform .2s; z-index: 60; }
  .rail.open { transform: none; }
  .content { padding: 20px 14px 50px; }
}
.rail-toggle { display: none; }
@media (max-width: 880px) { .rail-toggle { display: inline-flex; } }
