/* ═══════════════════════════════════════════════════════════════
   Signal — MxD link telemetry console
   Dark instrument panel: amber signal on near-black, mono-dominant
   with an Instrument Serif display voice.
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

/* The UA stylesheet gives [hidden] display:none, but any author `display`
   rule outranks it — .modal and .shell set display:grid, so without this the
   modal and its scrim render over everything from first paint. */
[hidden] { display: none !important; }

:root {
  --bg:        #0A0B0D;
  --bg-2:      #0E1013;
  --surface:   #131519;
  --surface-2: #181B20;
  --surface-3: #1E2228;

  --line:      rgba(255,255,255,.07);
  --line-2:    rgba(255,255,255,.13);
  --line-3:    rgba(255,255,255,.22);

  --ink:       #E9E6E1;
  --ink-2:     #AEB5BF;
  --ink-3:     #888F9A;

  --signal:    #FFB224;
  --signal-2:  #FFC960;
  --signal-dim: rgba(255,178,36,.13);
  --signal-line: rgba(255,178,36,.34);

  --good:      #46C46B;
  --bad:       #FF6B5E;
  --info:      #6FA8FF;

  --mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;

  --r-sm: 4px;
  --r:    7px;
  --r-lg: 12px;

  --rail-w: 216px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  /* Faint instrument grid, so flat areas still have texture. */
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px, 64px 64px;
  background-position: -1px -1px;
}

/* Film grain over everything — kills the flat-vector look. */
.grain {
  position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: .038; mix-blend-mode: overlay;
  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='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--signal); color: #14100A; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--line-3); }

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

/* ───────────────────────────────────────────────── login ── */

.gate {
  position: relative;
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 32px;
  overflow: hidden;
}
.gate::after {
  /* Amber glow bleeding up from below the fold. */
  content: ""; position: absolute; left: 50%; bottom: -46vh;
  width: 120vw; height: 90vh; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255,178,36,.13), transparent 72%);
  pointer-events: none;
}
.gate__scan {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.022) 0 1px, transparent 1px 4px);
  pointer-events: none;
}
.gate__inner {
  position: relative; z-index: 1;
  width: min(420px, 100%);
  text-align: left;
  animation: rise .7s var(--ease) both;
}
.gate__mark {
  width: 42px; height: 42px; margin-bottom: 30px;
  border: 1px solid var(--signal-line); border-radius: 50%;
  display: grid; place-items: center;
  position: relative;
}
.pulse {
  width: 9px; height: 9px; border-radius: 50%; background: var(--signal);
  box-shadow: 0 0 14px var(--signal);
}
.gate__mark::after {
  content: ""; position: absolute; inset: -1px; border-radius: 50%;
  border: 1px solid var(--signal);
  animation: ping 2.8s var(--ease) infinite;
}
@keyframes ping {
  0%   { transform: scale(1);   opacity: .6; }
  70%  { transform: scale(1.9); opacity: 0; }
  100% { transform: scale(1.9); opacity: 0; }
}

.gate__eyebrow {
  margin: 0 0 6px; font-size: 10.5px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--ink-3);
}
.gate__title {
  margin: 0 0 14px;
  font-family: var(--serif); font-weight: 400; font-size: 76px;
  line-height: .92; letter-spacing: -.02em; color: var(--ink);
}
.gate__blurb {
  margin: 0 0 34px; color: var(--ink-2); font-size: 12.5px;
  max-width: 34ch; line-height: 1.7;
}
.gate__form { display: grid; gap: 16px; }
.gate__error {
  margin: 0; padding: 9px 12px; font-size: 12px;
  color: var(--bad); background: rgba(255,107,94,.09);
  border: 1px solid rgba(255,107,94,.28); border-radius: var(--r);
}
.gate__foot {
  margin: 26px 0 0; font-size: 11px; color: var(--ink-3);
  padding-top: 18px; border-top: 1px solid var(--line);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ──────────────────────────────────────────────── fields ── */

.field { display: grid; gap: 7px; }
.field__label {
  font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3);
}
.field__input, .field__select, .field__area {
  width: 100%; padding: 10px 12px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--r);
  font-size: 13px; outline: none;
  transition: border-color .16s, box-shadow .16s, background .16s;
}
.field__area { resize: vertical; min-height: 74px; }
.field__input::placeholder { color: var(--ink-3); }
.field__input:focus, .field__select:focus, .field__area:focus {
  border-color: var(--signal-line);
  box-shadow: 0 0 0 3px var(--signal-dim);
  background: var(--surface-2);
}
.field__hint { font-size: 11px; color: var(--ink-3); }
.field__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.check { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.check input { accent-color: var(--signal); width: 15px; height: 15px; }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink);
  font-size: 12px; font-weight: 500; letter-spacing: .01em;
  cursor: pointer; white-space: nowrap;
  transition: background .16s, border-color .16s, color .16s, transform .1s;
}
.btn:hover { background: var(--surface-3); border-color: var(--line-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--block { width: 100%; }
.btn--sm { padding: 6px 11px; font-size: 11.5px; }

.btn--signal {
  background: var(--signal); border-color: var(--signal); color: #17120A; font-weight: 700;
}
.btn--signal:hover { background: var(--signal-2); border-color: var(--signal-2); }

.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--surface-2); }

.btn--danger { color: var(--bad); border-color: rgba(255,107,94,.3); background: transparent; }
.btn--danger:hover { background: rgba(255,107,94,.1); border-color: rgba(255,107,94,.5); }

.iconbtn {
  width: 30px; height: 30px; display: grid; place-items: center;
  background: transparent; border: 1px solid transparent; border-radius: var(--r-sm);
  color: var(--ink-2); cursor: pointer; transition: background .15s, color .15s;
}
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.iconbtn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

/* ────────────────────────────────────────────────── shell ── */

.shell { display: grid; grid-template-columns: var(--rail-w) 1fr; min-height: 100vh; }

.rail {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 22px 14px 16px;
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-right: 1px solid var(--line);
}
.rail__brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 8px 22px; margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.rail__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--signal); box-shadow: 0 0 10px var(--signal);
  animation: breathe 3.4s ease-in-out infinite;
}
@keyframes breathe { 0%,100% { opacity: 1; } 50% { opacity: .42; } }
.rail__word {
  font-family: var(--serif); font-size: 24px; letter-spacing: -.01em;
}

.rail__nav { display: grid; gap: 2px; padding-top: 14px; }
.navlink {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: var(--r);
  color: var(--ink-2); text-decoration: none; font-size: 12.5px;
  position: relative; transition: background .15s, color .15s;
}
.navlink svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.navlink:hover { background: var(--surface); color: var(--ink); }
.navlink.is-on { background: var(--signal-dim); color: var(--signal); }
.navlink.is-on::before {
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 2px; height: 17px; background: var(--signal); border-radius: 0 2px 2px 0;
}

.rail__foot { margin-top: auto; display: grid; gap: 11px; padding-top: 16px; border-top: 1px solid var(--line); }
.whoami { padding: 0 8px; display: grid; gap: 3px; }
.whoami__key { font-size: 12px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whoami__scopes { font-size: 10px; color: var(--ink-3); letter-spacing: .06em; }

.main { padding: 30px 34px 64px; max-width: 1500px; }

/* ─────────────────────────────────────────────── heading ── */

.head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 22px; flex-wrap: wrap; margin-bottom: 26px;
}
.head__eyebrow {
  margin: 0 0 3px; font-size: 10px; letter-spacing: .22em;
  text-transform: uppercase; color: var(--ink-3);
}
.head__title {
  margin: 0; font-family: var(--serif); font-weight: 400;
  font-size: 40px; line-height: 1; letter-spacing: -.015em;
}
.head__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); padding: 2px; }
.seg__btn {
  padding: 5px 12px; border: 0; background: transparent; color: var(--ink-3);
  border-radius: var(--r-sm); cursor: pointer; font-size: 11.5px; transition: background .15s, color .15s;
}
.seg__btn:hover { color: var(--ink); }
.seg__btn.is-on { background: var(--surface-3); color: var(--signal); }

.search {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; min-width: 268px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r);
  transition: border-color .16s, box-shadow .16s;
}
.search:focus-within { border-color: var(--signal-line); box-shadow: 0 0 0 3px var(--signal-dim); }
.search svg { width: 14px; height: 14px; fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-linecap: round; flex: none; }
.search input { flex: 1; background: transparent; border: 0; outline: none; font-size: 12.5px; min-width: 0; }
.search input::placeholder { color: var(--ink-3); }

/* ───────────────────────────────────────────────── panels ── */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: 22px;
  overflow: hidden;
}
.panel__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.panel__title { margin: 0; font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.panel__note { font-size: 11px; color: var(--ink-3); }

/* ────────────────────────────────────────────── stat tiles ── */

.tiles {
  display: grid; gap: 14px; margin-bottom: 22px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.tile {
  position: relative; overflow: hidden;
  padding: 17px 18px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  animation: rise .5s var(--ease) both;
}
.tile::after {
  content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 1px;
  background: linear-gradient(90deg, var(--signal), transparent 62%);
  opacity: .5;
}
.tile__label {
  margin: 0 0 9px; font-size: 10px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-3);
}
.tile__value {
  font-family: var(--serif); font-size: 40px; line-height: 1;
  letter-spacing: -.02em; color: var(--ink);
}
.tile__meta { margin-top: 7px; font-size: 11px; color: var(--ink-3); }

/* ────────────────────────────────────────────────── chart ── */

.chartcard .chartwrap { padding: 18px 12px 10px; }
.chartwrap { position: relative; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--ink-3); font-family: var(--mono); font-size: 10px; }
.chart .series-line { fill: none; stroke: var(--signal); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .series-area { fill: url(#signalFade); }
.chart .dot { fill: var(--signal); stroke: var(--surface); stroke-width: 2; }
.chart .pt  { fill: var(--signal); stroke: var(--surface); stroke-width: 1.5; }
.chart .crosshair { stroke: var(--line-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .hit { fill: transparent; cursor: crosshair; }

.tip {
  position: absolute; z-index: 5; pointer-events: none;
  padding: 7px 10px; border-radius: var(--r);
  background: var(--surface-3); border: 1px solid var(--line-2);
  box-shadow: 0 8px 26px rgba(0,0,0,.5);
  font-size: 11.5px; white-space: nowrap;
  transform: translate(-50%, -128%);
  transition: opacity .12s;
}
.tip__day { color: var(--ink-3); display: block; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.tip__val { color: var(--ink); font-weight: 500; }
.tip__val b { color: var(--signal); font-weight: 700; }

/* ──────────────────────────────────────────────── toplist ── */

.toplist { padding: 6px 0; }
.toprow {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px;
  padding: 9px 18px; position: relative;
}
.toprow + .toprow { border-top: 1px solid var(--line); }
.toprow__bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--signal-dim); border-right: 1px solid var(--signal-line);
  pointer-events: none;
}
.toprow__label { position: relative; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toprow__n { position: relative; color: var(--signal); font-weight: 500; }

/* ────────────────────────────────────────────────── table ── */

.tablewrap { overflow-x: auto; margin-bottom: 14px; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table thead th {
  position: sticky; top: 0; z-index: 1;
  padding: 11px 14px; text-align: left; white-space: nowrap;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-2);
  font-size: 10px; font-weight: 500; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-3);
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .13s; cursor: pointer; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:hover .code { color: var(--signal); }
.table .num, .table td.num { text-align: right; }
.table .acts, .table td.acts { text-align: right; width: 1%; white-space: nowrap; }

.code {
  font-weight: 500; letter-spacing: .04em; color: var(--ink);
  transition: color .13s;
}

/* selection */
.table th.pick, .table td.pick { width: 1%; padding-right: 0; }
.table input[type="checkbox"] { accent-color: var(--signal); width: 15px; height: 15px; cursor: pointer; }
.table tbody tr.is-picked { background: var(--signal-dim); }
.table tbody tr.is-picked:hover { background: rgba(255,178,36,.18); }

/* Floats above the page rather than sitting above the table: with a full page
   of rows, an in-flow bar scrolls out of view exactly when you select the rows
   at the bottom, so the actions vanish at the moment you need them. */
.selbar {
  position: fixed; z-index: 50;
  left: calc(50% + (var(--rail-w) / 2)); bottom: 26px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 20px;
  padding: 11px 12px 11px 18px;
  background: var(--surface-3); border: 1px solid var(--signal-line);
  border-radius: 99px;
  box-shadow: 0 14px 44px rgba(0,0,0,.55), 0 0 0 1px rgba(0,0,0,.3);
  animation: dock .26s var(--ease) both;
}
@keyframes dock {
  from { opacity: 0; transform: translate(-50%, 14px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.selbar__count { font-size: 12.5px; color: var(--signal); white-space: nowrap; }
.selbar__count b { font-weight: 700; }
.selbar__actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .selbar {
    left: 12px; right: 12px; transform: none; bottom: 12px;
    justify-content: space-between; border-radius: var(--r-lg);
  }
  @keyframes dock {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
  }
}
.dest {
  display: block; max-width: 320px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); font-size: 12px;
}
.who { color: var(--ink-2); font-size: 12px; }
.who small { display: block; color: var(--ink-3); font-size: 10.5px; }
.muted { color: var(--ink-3); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 99px;
  font-size: 10.5px; letter-spacing: .05em; text-transform: uppercase;
  border: 1px solid transparent;
}
.pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pill--live    { color: var(--good); background: rgba(70,196,107,.1);  border-color: rgba(70,196,107,.26); }
.pill--off     { color: var(--ink-3); background: rgba(255,255,255,.04); border-color: var(--line-2); }
.pill--expired { color: var(--bad);  background: rgba(255,107,94,.1);  border-color: rgba(255,107,94,.26); }
.pill--soon    { color: var(--signal); background: var(--signal-dim);  border-color: var(--signal-line); }

.empty { padding: 46px 20px; text-align: center; color: var(--ink-3); font-size: 12.5px; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.pager__info { font-size: 11.5px; color: var(--ink-3); }
.pager__btns { display: flex; gap: 8px; }

.hint { font-size: 11.5px; color: var(--ink-3); max-width: 62ch; line-height: 1.7; }

/* ─────────────────────────────────────────────────── bulk ── */

.panelbody { padding: 18px; }
.panelfoot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 18px; border-top: 1px solid var(--line); background: var(--surface-2);
}

.drop {
  margin: 18px; padding: 40px 24px; text-align: center;
  border: 1px dashed var(--line-3); border-radius: var(--r-lg);
  background: rgba(255,255,255,.012);
  transition: border-color .18s, background .18s;
}
.drop.is-over {
  border-color: var(--signal); background: var(--signal-dim);
}
.drop__icon {
  width: 30px; height: 30px; margin-bottom: 14px;
  fill: none; stroke: var(--ink-3); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round;
}
.drop.is-over .drop__icon { stroke: var(--signal); }
.drop__title { margin: 0 0 10px; font-size: 13px; color: var(--ink); }
.drop__hint {
  margin: 0 auto; max-width: 68ch; font-size: 11.5px; color: var(--ink-3); line-height: 1.9;
}
.drop__hint code {
  padding: 2px 6px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink-2);
  font-size: 11px;
}

/* Spreadsheet mock — deliberately looks like a sheet so it reads as
   "this is your file", not as another data table in the console. */
.sheetwrap {
  overflow-x: auto;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--bg-2);
}
.sheet { border-collapse: collapse; width: 100%; font-size: 11.5px; white-space: nowrap; }
.sheet th, .sheet td {
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 7px 11px; text-align: left;
}
.sheet tr:last-child td { border-bottom: 0; }
.sheet th:last-child, .sheet td:last-child { border-right: 0; }

/* column-letter strip */
.sheet .sheet__ref th {
  background: var(--surface-3); color: var(--ink-3);
  font-weight: 400; font-size: 10px; text-align: center;
  padding: 3px 11px; letter-spacing: .1em;
}
/* header row of the file itself */
.sheet .sheet__head th {
  background: var(--surface-2); color: var(--ink);
  font-weight: 700; font-size: 11px; letter-spacing: .02em;
}
.sheet .sheet__head th.req::after {
  content: " *"; color: var(--signal); font-weight: 700;
}
.sheet .sheet__head th.extra { color: var(--ink-3); font-weight: 400; font-style: italic; }
.sheet .sheet__head th.added { color: var(--signal); }
.sheet td { color: var(--ink-2); }
.sheet td.rownum {
  background: var(--surface-3); color: var(--ink-3);
  text-align: center; font-size: 10px; width: 1%;
}
.sheet td.empty { color: var(--ink-3); font-style: italic; }
.sheet td.added { color: var(--signal); }
.sheet tbody tr:hover td:not(.rownum) { background: rgba(255,255,255,.02); }

.linkbtn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--signal); text-decoration: underline; text-underline-offset: 3px;
  font-size: inherit; font-family: inherit;
}

.note {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 0 18px 18px; padding: 11px 13px; border-radius: var(--r);
  font-size: 12px; line-height: 1.65;
}
.note--ok   { background: rgba(70,196,107,.08);  border: 1px solid rgba(70,196,107,.24); color: var(--good); }
.note--warn { background: var(--signal-dim);     border: 1px solid var(--signal-line);   color: var(--signal); }
.note--bad  { background: rgba(255,107,94,.08);  border: 1px solid rgba(255,107,94,.26); color: var(--bad); }
.note b { font-weight: 700; }
.note span { color: var(--ink-2); }

.bar {
  height: 5px; border-radius: 99px; overflow: hidden;
  background: var(--surface-3); border: 1px solid var(--line);
}
.bar__fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--signal), var(--signal-2));
  transition: width .3s var(--ease);
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border-radius: 99px; font-size: 11px;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink-2);
}
.chip b { color: var(--ink); font-weight: 500; }
.chip--off { opacity: .55; }

/* ───────────────────────────────────────────────── drawer ── */

.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer__scrim, .modal__scrim {
  position: absolute; inset: 0; background: rgba(4,5,7,.68);
  backdrop-filter: blur(2px); animation: fade .2s ease both;
}
.drawer__panel {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: min(620px, 100%);
  background: var(--bg-2); border-left: 1px solid var(--line-2);
  box-shadow: -30px 0 70px rgba(0,0,0,.55);
  display: flex; flex-direction: column;
  animation: slidein .34s var(--ease) both;
}
@keyframes slidein { from { transform: translateX(26px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.drawer__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 20px 22px; border-bottom: 1px solid var(--line);
}
.drawer__eyebrow { margin: 0 0 2px; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); }
.drawer__title { margin: 0; font-family: var(--serif); font-size: 27px; font-weight: 400; letter-spacing: -.01em; word-break: break-all; }
.drawer__body { padding: 22px; overflow-y: auto; flex: 1; }

.kv { display: grid; grid-template-columns: 118px 1fr; gap: 9px 16px; margin-bottom: 24px; font-size: 12.5px; }
.kv dt { color: var(--ink-3); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding-top: 1px; }
.kv dd { margin: 0; word-break: break-word; }

.copyrow { display: flex; align-items: center; gap: 8px; }
.copyrow code {
  flex: 1; padding: 8px 11px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line-2);
  font-size: 11.5px; color: var(--signal); word-break: break-all;
}

.sub { margin: 0 0 12px; font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }

.clicks { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.click { background: var(--surface); padding: 10px 13px; font-size: 11.5px; }
.click__top { display: flex; justify-content: space-between; gap: 12px; }
.click__when { color: var(--ink); }
.click__who { color: var(--signal); }
.click__meta { color: var(--ink-3); font-size: 10.5px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ───────────────────────────────────────────────── modal ── */

.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px; }
.modal__panel {
  position: relative; width: min(540px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: pop .26s var(--ease) both;
}
@keyframes pop { from { opacity: 0; transform: scale(.975) translateY(8px); } to { opacity: 1; transform: none; } }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.modal__title { margin: 0; font-family: var(--serif); font-size: 24px; font-weight: 400; }
.modal__body { padding: 20px; }
.form { display: grid; gap: 15px; }
.form__actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 6px; border-top: 1px solid var(--line); margin-top: 4px; }

.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.preset {
  padding: 5px 10px; font-size: 11px; border-radius: 99px;
  border: 1px solid var(--line-2); background: transparent; color: var(--ink-2); cursor: pointer;
  transition: all .15s;
}
.preset:hover { border-color: var(--line-3); color: var(--ink); }
.preset.is-on { background: var(--signal-dim); border-color: var(--signal-line); color: var(--signal); }

.reveal {
  padding: 13px; border-radius: var(--r); margin-bottom: 14px;
  background: var(--signal-dim); border: 1px solid var(--signal-line);
}
.reveal p { margin: 0 0 9px; font-size: 11.5px; color: var(--signal-2); }

/* ──────────────────────────────────────────────── toasts ── */

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 9px; justify-items: end; }
.toast {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 14px; border-radius: var(--r);
  background: var(--surface-3); border: 1px solid var(--line-2);
  box-shadow: 0 12px 34px rgba(0,0,0,.5);
  font-size: 12px; animation: toastin .28s var(--ease) both;
}
.toast::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--good); flex: none; }
.toast--err::before { background: var(--bad); }
.toast--err { border-color: rgba(255,107,94,.35); }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ─────────────────────────────────────────────── responsive ── */

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .rail {
    position: static; height: auto; flex-direction: row; align-items: center;
    gap: 14px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line);
    overflow-x: auto;
  }
  .rail__brand { padding: 0 12px 0 0; margin: 0; border-bottom: 0; border-right: 1px solid var(--line); }
  .rail__nav { display: flex; padding: 0; gap: 4px; }
  .navlink.is-on::before { display: none; }
  .navlink span { display: none; }
  .rail__foot { margin: 0 0 0 auto; padding: 0; border-top: 0; grid-auto-flow: column; align-items: center; }
  .whoami { display: none; }
  .main { padding: 20px 16px 48px; }
  .head__title { font-size: 30px; }
  .gate__title { font-size: 58px; }
  .search { min-width: 0; flex: 1; }
  .head__actions { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
