/* ─────────────────────────────────────────────────────────────────
   Instamart Alerts — control panel
   Warm-charcoal mission control: condensed technical type, serif
   numerals, amber signal, crop-marked panels, a console that reads
   like a real terminal.
   ───────────────────────────────────────────────────────────────── */

:root {
  --void:      #0d0c0a;
  --panel:     #15130f;
  --panel-2:   #1c1914;
  --panel-3:   #24201a;
  --rule:      rgba(255, 233, 194, .11);
  --rule-soft: rgba(255, 233, 194, .06);

  --ink:       #f2ebdd;
  --ink-2:     #b6ac99;
  --ink-3:     #7d7466;

  --amber:     #ffb02e;
  --amber-dim: rgba(255, 176, 46, .16);
  --signal:    #ff5200;
  --live:      #6ee7a8;
  --alarm:     #ff5f52;
  --debug:     #6ba8ff;

  --sans: "IBM Plex Sans Condensed", "Helvetica Neue", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", monospace;
  --serif: "Instrument Serif", Georgia, serif;

  --r: 3px;
  --gap: 18px;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

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

/* Several elements below set `display`, which would otherwise beat the
   `hidden` attribute and leave invisible panes swallowing clicks. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  background: var(--void);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* Warm vignette + film grain so the dark never reads as flat #000. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 80% at 12% -10%, rgba(255, 176, 46, .09), transparent 60%),
    radial-gradient(90% 70% at 100% 110%, rgba(255, 82, 0, .07), transparent 55%);
}
body::after {
  content: "";
  position: fixed; inset: -50%; z-index: 0; pointer-events: none;
  opacity: .035;
  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(--amber); color: #17130a; }

/* ── scrollbars ─────────────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--panel-3) transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--panel-3); border-radius: 9px; }
*::-webkit-scrollbar-thumb:hover { background: #3a3328; }

/* ── shell ──────────────────────────────────────────────────────── */
.app {
  position: relative; z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100dvh;
}

.topbar {
  display: flex; align-items: center; gap: 26px;
  padding: 0 22px; height: 72px;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(180deg, rgba(28, 25, 20, .9), rgba(13, 12, 10, .55));
  backdrop-filter: blur(8px);
}

.topbar__brand { display: flex; align-items: center; gap: 13px; }

.mark {
  width: 34px; height: 34px; flex: none;
  border: 1px solid var(--rule);
  border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 50%, rgba(255, 176, 46, .12), transparent 70%);
}
.mark__dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--ink-3);
  transition: background .3s var(--ease), box-shadow .3s var(--ease);
}
.mark__dot.is-live {
  background: var(--amber);
  box-shadow: 0 0 0 0 rgba(255, 176, 46, .6);
  animation: beacon 2.4s infinite;
}
@keyframes beacon {
  0%   { box-shadow: 0 0 0 0 rgba(255, 176, 46, .55); }
  70%  { box-shadow: 0 0 0 13px rgba(255, 176, 46, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 176, 46, 0); }
}
.mark__dot.is-busy { background: var(--signal); animation: beacon .9s infinite; }

.brand__name {
  font-weight: 700; font-size: 15px;
  letter-spacing: .22em; line-height: 1;
}
.brand__sub {
  font-size: 13px; color: var(--ink-3);
  letter-spacing: .12em; line-height: 1.4;
}
.brand__sub em { font-family: var(--serif); font-size: 16px; letter-spacing: 0; color: var(--amber); }

.topbar__stats {
  display: flex; align-items: stretch; gap: 0;
  margin-left: auto;
}
.stat {
  padding: 0 20px;
  border-left: 1px solid var(--rule-soft);
  display: flex; flex-direction: column; justify-content: center;
  min-width: 92px;
}
.stat--wide { min-width: 118px; }
.stat__k {
  font-size: 10px; text-transform: uppercase; letter-spacing: .16em;
  color: var(--ink-3);
}
.stat__v {
  font-family: var(--serif); font-size: 25px; line-height: 1.15;
  color: var(--ink); font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stat__v.is-good { color: var(--live); }
.stat__v.is-bad  { color: var(--alarm); }
.stat__v.is-warm { color: var(--amber); }

.topbar__poller { padding-left: 20px; border-left: 1px solid var(--rule-soft); }

/* ── switch ─────────────────────────────────────────────────────── */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch__track {
  width: 46px; height: 24px; flex: none;
  border: 1px solid var(--rule);
  border-radius: 100px;
  background: var(--panel-2);
  position: relative;
  transition: background .25s var(--ease), border-color .25s var(--ease);
}
.switch__thumb {
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--ink-3);
  transition: transform .25s var(--ease), background .25s var(--ease);
}
.switch input:checked + .switch__track { background: var(--amber-dim); border-color: rgba(255, 176, 46, .5); }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(22px); background: var(--amber); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--amber); outline-offset: 2px; }
.switch__label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .16em; color: var(--ink-2);
}

/* ── workspace ──────────────────────────────────────────────────── */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr);
  min-height: 0;
}

.rail {
  min-height: 0; min-width: 0; overflow-y: auto;
  padding: var(--gap) var(--gap) 40px;
  display: flex; flex-direction: column; gap: var(--gap);
  border-right: 1px solid var(--rule);
}

.rail__foot {
  margin-top: auto; padding-top: 12px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3);
  word-break: break-all;
}

/* ── cards ──────────────────────────────────────────────────────── */
.card {
  position: relative;
  border: 1px solid var(--rule);
  background:
    linear-gradient(180deg, rgba(36, 32, 26, .55), rgba(21, 19, 15, .8));
}
/* crop marks */
.card::before, .card::after {
  content: ""; position: absolute; width: 8px; height: 8px;
  border: 1px solid var(--amber); opacity: .45; pointer-events: none;
}
.card::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.card::after  { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }

.card__head {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--rule-soft);
}
.card__title {
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .2em;
  display: flex; align-items: baseline; gap: 10px;
}
.card__title i {
  font-family: var(--serif); font-style: normal; font-size: 17px;
  color: var(--amber); letter-spacing: 0;
}
/* Everything after the title sits right; a hidden badge must not disturb it. */
.card__title { margin-right: auto; }

.card__body { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.card__body--flush { padding: 0; gap: 0; }

.note {
  font-size: 12.5px; color: var(--ink-3); line-height: 1.55;
  max-width: 58ch;
}
.note--tight { margin-top: -4px; }
.note b { color: var(--ink-2); font-weight: 600; }

.rule { height: 1px; background: var(--rule-soft); }

/* ── fields ─────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em;
  color: var(--ink-2);
  display: flex; align-items: baseline; gap: 8px;
}
.field__label b { color: var(--amber); font-weight: 600; }
.field__label .ghost-btn { margin-left: auto; }
.field__aside {
  text-transform: none; letter-spacing: .02em; color: var(--ink-3); font-size: 11px;
}
a.field__aside { color: var(--amber); text-decoration: none; }
a.field__aside:hover { text-decoration: underline; }

.input {
  width: 100%;
  background: var(--void);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  color: var(--ink);
  font-family: var(--sans); font-size: 14px;
  padding: 9px 11px;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.input:hover { border-color: rgba(255, 233, 194, .2); }
.input:focus {
  outline: none;
  border-color: var(--amber);
  background: #100e0b;
  box-shadow: 0 0 0 3px rgba(255, 176, 46, .1);
}
.input::placeholder { color: #524b40; }
.input--mono { font-family: var(--mono); font-size: 13px; letter-spacing: .01em; }
input[type="number"].input { -moz-appearance: textfield; }

select.input {
  appearance: none; cursor: pointer; padding-right: 30px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
select.input option { background: var(--panel-2); color: var(--ink); }

.input-wrap { position: relative; display: flex; }
.input-wrap .input { padding-right: 68px; }
.input-wrap .ghost-btn { position: absolute; right: 4px; top: 4px; bottom: 4px; }

.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }

/* ── buttons ────────────────────────────────────────────────────── */
.btn {
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em;
  padding: 9px 15px;
  border: 1px solid var(--rule);
  border-radius: var(--r);
  background: var(--panel-2);
  color: var(--ink);
  cursor: pointer;
  position: relative; overflow: hidden;
  transition: border-color .18s var(--ease), color .18s var(--ease), background .18s var(--ease), transform .1s var(--ease);
}
.btn:hover { border-color: var(--amber); color: var(--amber); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; border-color: var(--rule); color: var(--ink-3); }
.btn--primary {
  background: var(--amber); border-color: var(--amber); color: #16120a;
}
.btn--primary:hover { background: #ffc25c; border-color: #ffc25c; color: #16120a; }
.btn--small { padding: 6px 11px; font-size: 10.5px; }
.btn--quiet { background: transparent; color: var(--ink-2); }
.btn--block { width: 100%; padding: 11px; }
.btn.is-busy { color: transparent !important; pointer-events: none; }
.btn.is-busy::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid rgba(22, 18, 10, .3); border-top-color: #16120a;
  animation: spin .6s linear infinite;
}
.btn:not(.btn--primary).is-busy::after { border-color: rgba(255, 176, 46, .25); border-top-color: var(--amber); }
@keyframes spin { to { transform: rotate(360deg); } }

.ghost-btn {
  font-family: var(--mono); font-size: 11px;
  padding: 5px 9px;
  background: var(--panel-3);
  border: 1px solid transparent;
  border-radius: var(--r);
  color: var(--ink-2);
  cursor: pointer;
  transition: color .16s var(--ease), background .16s var(--ease);
}
.ghost-btn:hover { color: var(--amber); background: #2c261d; }
.ghost-btn[data-on="1"] { color: var(--amber); background: var(--amber-dim); }
.ghost-btn--danger:hover { color: var(--alarm); }

.linkish {
  background: none; border: 0; padding: 0;
  color: var(--ink-3); font-family: var(--mono); font-size: 10.5px;
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.linkish:hover { color: var(--amber); }

.row { display: flex; gap: 9px; align-items: center; }
.row--wrap { flex-wrap: wrap; }

/* ── pills / badges ─────────────────────────────────────────────── */
.pill {
  font-family: var(--mono); font-size: 10.5px;
  padding: 3px 9px; border-radius: 100px;
  border: 1px solid var(--rule);
  color: var(--ink-3);
  white-space: nowrap;
}
.pill.is-good { color: var(--live); border-color: rgba(110, 231, 168, .35); background: rgba(110, 231, 168, .07); }
.pill.is-bad  { color: var(--alarm); border-color: rgba(255, 95, 82, .35); background: rgba(255, 95, 82, .07); }
.pill--quiet { opacity: .8; }

.dirty {
  font-family: var(--mono); font-size: 10px; color: var(--signal);
  text-transform: uppercase; letter-spacing: .1em;
  display: inline-flex; align-items: center; gap: 6px;
}
.dirty::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--signal); animation: beacon 1.6s infinite;
}

.result {
  font-size: 12.5px; line-height: 1.5;
  padding: 10px 12px; border-radius: var(--r);
  border: 1px solid var(--rule);
  background: var(--void);
  color: var(--ink-2);
}
.result.is-good { border-color: rgba(110, 231, 168, .3); color: var(--live); }
.result.is-bad { border-color: rgba(255, 95, 82, .3); color: #ffb4ad; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; font-family: var(--mono); font-size: 11.5px; }
.kv dt, .kv .k { color: var(--ink-3); text-transform: uppercase; letter-spacing: .1em; font-size: 10px; padding-top: 2px; }
.kv .v { color: var(--ink); word-break: break-word; }

.path { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); word-break: break-all; }

code {
  font-family: var(--mono); font-size: 11px; color: var(--ink-2);
  background: var(--void); border: 1px solid var(--rule-soft);
  border-radius: 2px; padding: 1px 5px;
}

/* ── chat picker ────────────────────────────────────────────────── */
.chat-picker { display: flex; flex-direction: column; gap: 6px; }
.chat-opt {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 11px; text-align: left; width: 100%;
  background: var(--void); border: 1px solid var(--rule); border-radius: var(--r);
  color: var(--ink); cursor: pointer; font-family: var(--mono); font-size: 12px;
  transition: border-color .16s var(--ease);
}
.chat-opt:hover { border-color: var(--amber); }
.chat-opt b { color: var(--amber); font-weight: 500; }
.chat-opt.is-added { opacity: .45; }
.chat-opt.is-added b::after { content: " ✓"; color: var(--live); }
.chat-opt span { color: var(--ink-3); margin-left: auto; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; }

/* ── watches ────────────────────────────────────────────────────── */
.watches { display: flex; flex-direction: column; }
.watches:empty::after {
  content: "No search terms yet. Add one to start watching.";
  display: block; padding: 22px 16px; color: var(--ink-3); font-size: 13px;
}
.watches__foot {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; border-top: 1px solid var(--rule-soft);
}
.watches__foot .path { margin-left: auto; text-align: right; }

.watch { border-top: 1px solid var(--rule-soft); }
.watch:first-child { border-top: 0; }
.watch.is-off { opacity: .5; }

.watch__head {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 16px;
}
.watch__disc {
  background: none; border: 0; cursor: pointer;
  color: var(--ink-3); font-size: 12px; padding: 2px 3px;
  transition: transform .2s var(--ease), color .2s var(--ease);
}
.watch__disc:hover { color: var(--amber); }
.watch.is-open .watch__disc { transform: rotate(90deg); color: var(--amber); }

.watch__name {
  flex: 1; min-width: 0;
  background: none; border: 0; border-bottom: 1px solid transparent;
  color: var(--ink); font-family: var(--sans); font-size: 15px; font-weight: 600;
  padding: 2px 0;
}
.watch__name:focus { outline: none; border-bottom-color: var(--amber); }

.watch__meta {
  font-family: var(--serif); font-size: 20px; color: var(--ink-2);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.watch__meta b { color: var(--amber); font-weight: 400; }
.watch__meta i {
  font-family: var(--sans); font-style: normal; font-size: 9.5px;
  text-transform: uppercase; letter-spacing: .14em; color: var(--ink-3);
  margin-left: 5px;
}

.watch__body {
  display: none;
  padding: 4px 16px 18px 16px;
  flex-direction: column; gap: 14px;
}
.watch.is-open .watch__body { display: flex; animation: unfold .28s var(--ease); }
@keyframes unfold { from { opacity: 0; transform: translateY(-5px); } }

/* checkbox */
.tick { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; flex: none; }
.tick input { position: absolute; opacity: 0; pointer-events: none; }
.tick > span:first-of-type {
  width: 17px; height: 17px; flex: none;
  border: 1px solid var(--rule); border-radius: 2px;
  background: var(--void);
  display: grid; place-items: center;
  transition: background .16s var(--ease), border-color .16s var(--ease);
}
.tick > span:first-of-type::after {
  content: ""; width: 8px; height: 4px;
  border-left: 2px solid #16120a; border-bottom: 2px solid #16120a;
  transform: rotate(-45deg) scale(0); transform-origin: center;
  transition: transform .16s var(--ease);
  margin-top: -2px;
}
.tick input:checked + span { background: var(--amber); border-color: var(--amber); }
.tick input:checked + span::after { transform: rotate(-45deg) scale(1); }
.tick input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: 2px; }
.tick__text { font-size: 13px; color: var(--ink-2); }
.tick--row { align-self: flex-start; }

/* slider */
.slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 22px; background: none; cursor: pointer;
}
.slider::-webkit-slider-runnable-track {
  height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, var(--signal), var(--amber)) 0 / var(--fill, 50%) 100% no-repeat, var(--panel-3);
}
.slider::-moz-range-track { height: 3px; border-radius: 3px; background: var(--panel-3); }
.slider::-moz-range-progress { height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--signal), var(--amber)); }
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px; border-radius: 50%; margin-top: -6px;
  background: var(--ink); border: 3px solid var(--amber);
  transition: transform .15s var(--ease);
}
.slider::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: 50%; border: 3px solid var(--amber);
  background: var(--ink);
}
.slider:hover::-webkit-slider-thumb { transform: scale(1.18); }
.slider:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--amber); outline-offset: 3px; }

/* tag inputs */
.tags {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 7px 8px; min-height: 38px;
  border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--void);
  transition: border-color .16s var(--ease);
}
.tags:focus-within { border-color: var(--amber); }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 4px 3px 9px; border-radius: 100px;
  background: var(--amber-dim); border: 1px solid rgba(255, 176, 46, .3);
  font-family: var(--mono); font-size: 11px; color: var(--amber);
}
.tag button {
  background: none; border: 0; color: inherit; cursor: pointer;
  opacity: .6; font-size: 12px; line-height: 1; padding: 0 3px;
}
.tag button:hover { opacity: 1; }
.tags input {
  flex: 1; min-width: 90px;
  background: none; border: 0; outline: none;
  color: var(--ink); font-family: var(--mono); font-size: 12px; padding: 3px 2px;
}
.tags input::placeholder { color: #4d473c; }

/* preview table */
.preview {
  border: 1px solid var(--rule); border-radius: var(--r);
  background: var(--void); overflow: hidden;
}
.preview__head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 11px; border-bottom: 1px solid var(--rule-soft);
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .1em;
}
.preview__head b { color: var(--amber); font-weight: 500; }
.preview__list { max-height: 300px; overflow-y: auto; }
.prow {
  display: grid; grid-template-columns: 54px 1fr auto;
  gap: 10px; align-items: center;
  padding: 7px 11px;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 12.5px;
}
.prow:last-child { border-bottom: 0; }
.prow.is-hit { background: rgba(255, 176, 46, .06); }
.prow.is-out { opacity: .42; }
.prow__pct {
  font-family: var(--mono); font-size: 12px; text-align: right;
  color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.prow.is-hit .prow__pct { color: var(--amber); font-weight: 600; }
.prow__name { min-width: 0; }
.prow__name a { color: var(--ink); text-decoration: none; }
.prow__name a:hover { color: var(--amber); text-decoration: underline; }
.prow__name small { display: block; color: var(--ink-3); font-size: 10.5px; }
.prow__price { font-family: var(--mono); font-size: 12px; text-align: right; white-space: nowrap; }
.prow__price s { color: var(--ink-3); margin-left: 5px; }
.prow__bar {
  grid-column: 1 / -1; height: 2px; background: var(--panel-3); border-radius: 2px; overflow: hidden;
}
.prow__bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--signal), var(--amber)); }

/* screenshot of a failed WAF bootstrap */
.shot { border: 1px solid rgba(255, 95, 82, .35); border-radius: var(--r); overflow: hidden; }
.shot__head {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 11px; border-bottom: 1px solid var(--rule-soft);
  background: rgba(255, 95, 82, .07);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--alarm);
}
.shot__head time { margin-left: auto; font-family: var(--mono); letter-spacing: 0; text-transform: none; color: var(--ink-3); }
.shot img { display: block; width: 100%; height: auto; }
.shot .note { padding: 9px 11px; }

/* ── console ────────────────────────────────────────────────────── */
.console {
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0; min-width: 0;
  background:
    repeating-linear-gradient(180deg, rgba(255, 233, 194, .012) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, #100e0b, #0b0a08);
}

.console__head {
  display: flex; flex-direction: column; gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--rule);
}
.console__title { display: flex; align-items: center; gap: 10px; }
.console__title h2 {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .2em;
}
.console__count {
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3);
  margin-left: auto;
}
.live {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); flex: none;
}
.live.is-on { background: var(--live); box-shadow: 0 0 8px rgba(110, 231, 168, .8); animation: blink 2s infinite; }
@keyframes blink { 50% { opacity: .35; } }

.console__tools { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.levels { display: flex; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.lvl {
  background: none; border: 0; border-right: 1px solid var(--rule);
  color: var(--ink-3); font-family: var(--mono); font-size: 10.5px;
  padding: 5px 10px; cursor: pointer;
  transition: color .16s var(--ease), background .16s var(--ease);
}
.lvl:last-child { border-right: 0; }
.lvl:hover { color: var(--ink); }
.lvl.is-on { color: var(--amber); background: var(--amber-dim); }
.input--search {
  flex: 1; min-width: 90px; padding: 5px 9px;
  font-family: var(--mono); font-size: 11.5px;
}

.console__body {
  min-height: 0; overflow-y: auto;
  padding: 8px 0 14px;
  font-family: var(--mono); font-size: 12px; line-height: 1.55;
}
.console__empty { padding: 20px 16px; color: var(--ink-3); font-style: italic; }

.line {
  display: grid; grid-template-columns: 62px 46px minmax(0, 1fr);
  gap: 10px;
  padding: 1px 16px;
  border-left: 2px solid transparent;
  white-space: pre-wrap; word-break: break-word;
  animation: slidein .22s var(--ease);
}
@keyframes slidein { from { opacity: 0; transform: translateX(-6px); } }
.line.is-replayed { animation: none; }
.line:hover { background: rgba(255, 233, 194, .035); }
.line__t { color: #4f4739; font-variant-numeric: tabular-nums; }
.line__l { font-size: 10px; letter-spacing: .06em; padding-top: 1.5px; }
.line__m { color: var(--ink-2); }
.line__m b { color: var(--ink-3); font-weight: 400; }

.line--INFO    .line__l { color: var(--ink-3); }
.line--DEBUG   .line__l { color: var(--debug); }
.line--WARNING { border-left-color: rgba(255, 176, 46, .55); background: rgba(255, 176, 46, .045); }
.line--WARNING .line__l, .line--WARNING .line__m { color: var(--amber); }
.line--ERROR, .line--CRITICAL { border-left-color: var(--alarm); background: rgba(255, 95, 82, .07); }
.line--ERROR .line__l, .line--CRITICAL .line__l { color: var(--alarm); }
.line--ERROR .line__m, .line--CRITICAL .line__m { color: #ffb4ad; }

/* run result blocks in the stream */
.runblock {
  margin: 9px 16px; border: 1px solid var(--rule); border-radius: var(--r);
  background: rgba(255, 176, 46, .04);
  animation: slidein .22s var(--ease);
}
.runblock.is-bad { border-color: rgba(255, 95, 82, .35); background: rgba(255, 95, 82, .05); }
.runblock.is-replayed { animation: none; }
.runblock__head {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 11px; border-bottom: 1px solid var(--rule-soft);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-2);
  font-family: var(--sans); font-weight: 600;
}
.runblock__head time { margin-left: auto; color: var(--ink-3); font-family: var(--mono); letter-spacing: 0; text-transform: none; }
.runblock__rows { padding: 4px 0; }
.rrow {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px; align-items: baseline;
  padding: 4px 11px; font-size: 12px;
}
.rrow__name { color: var(--ink); }
.rrow__num { font-family: var(--mono); font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rrow__best { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); }
.rrow__best.is-hit { color: var(--amber); }
.rrow__more {
  background: none; border: 0; cursor: pointer; padding: 0;
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3);
  text-decoration: underline; text-underline-offset: 3px;
}
.rrow__more:hover { color: var(--amber); }
.rrow__more::before { content: "▸ "; text-decoration: none; display: inline-block; }
.rrow__more[aria-expanded="true"]::before { content: "▾ "; }

/* the full candidate list behind a run's summary line */
.tracklist {
  margin: 2px 11px 8px 11px;
  border-left: 2px solid var(--rule);
  animation: unfold .2s var(--ease);
}
.trow {
  display: grid; grid-template-columns: 52px 68px minmax(0, 1fr);
  gap: 10px; align-items: baseline;
  padding: 2px 0 2px 10px;
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
}
.trow:hover { background: rgba(255, 233, 194, .035); }
.trow.is-hit { color: var(--amber); }
.trow.is-out { opacity: .45; }
.trow__pct { text-align: right; font-variant-numeric: tabular-nums; }
.trow.is-hit .trow__pct { font-weight: 600; }
.trow__price { text-align: right; white-space: nowrap; }
.trow__price s { color: var(--ink-3); opacity: .7; }
.trow__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow__name a { color: inherit; text-decoration: none; }
.trow__name a:hover { text-decoration: underline; }
.trow__flag { color: var(--live); }
.tracklist__note { padding: 3px 0 3px 10px; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); font-style: italic; }
.rhit {
  padding: 3px 11px 3px 22px; font-size: 11.5px; color: var(--amber);
  border-left: 2px solid rgba(255, 176, 46, .35); margin-left: 11px;
}
.rhit a { color: inherit; text-decoration: none; }
.rhit a:hover { text-decoration: underline; }
.rhit s { color: var(--ink-3); }

.console__foot {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-top: 1px solid var(--rule);
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3);
}
.console__cursor { color: var(--amber); animation: blink 1.1s steps(2) infinite; }

/* ── lock screen ────────────────────────────────────────────────── */
.lock {
  position: fixed; inset: 0; z-index: 20;
  display: grid; place-items: center;
  background: var(--void);
  padding: 24px;
}
.lock__card {
  position: relative;
  width: min(390px, 100%);
  border: 1px solid var(--rule);
  background: linear-gradient(180deg, rgba(36, 32, 26, .6), rgba(21, 19, 15, .9));
  padding: 30px 28px;
  display: flex; flex-direction: column; gap: 15px;
  animation: rise .5s var(--ease) both;
}
.lock__card::before, .lock__card::after {
  content: ""; position: absolute; width: 10px; height: 10px;
  border: 1px solid var(--amber); opacity: .5;
}
.lock__card::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; }
.lock__card::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; }
.lock__mark {
  font-size: 11px; letter-spacing: .3em; color: var(--amber); font-weight: 600;
}
.lock__mark span { opacity: .5; margin: 0 2px; }
.lock__title { font-family: var(--serif); font-size: 34px; font-weight: 400; line-height: 1; }
.lock__title em { color: var(--amber); }
.lock__hint { font-size: 12.5px; color: var(--ink-3); line-height: 1.55; }
.lock__error { font-size: 12.5px; color: var(--alarm); }

/* ── toasts ─────────────────────────────────────────────────────── */
.toasts {
  position: fixed; z-index: 30; right: 18px; bottom: 18px;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
}
.toast {
  border: 1px solid var(--rule);
  background: var(--panel-2);
  border-left: 2px solid var(--amber);
  padding: 10px 14px; max-width: 340px;
  font-size: 12.5px; color: var(--ink);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .55);
  animation: rise .3s var(--ease) both;
}
.toast.is-bad { border-left-color: var(--alarm); }
.toast.is-good { border-left-color: var(--live); }
.toast.is-leaving { animation: fade .25s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes fade { to { opacity: 0; transform: translateY(-6px); } }

/* ── entrance ───────────────────────────────────────────────────── */
.reveal { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms + 60ms); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ── responsive ─────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .stat { padding: 0 13px; min-width: 74px; }
  .stat__v { font-size: 21px; }
}
@media (max-width: 900px) {
  body { overflow: auto; }
  .app { height: auto; min-height: 100dvh; }
  .topbar { flex-wrap: wrap; height: auto; padding: 12px 14px; gap: 14px; }
  .topbar__brand { flex: 1; }
  /* Brand + switch share the first line; the stats strip gets its own. */
  .topbar__poller { order: 1; border-left: 0; padding-left: 0; }
  .topbar__stats { order: 2; margin-left: 0; width: 100%; min-width: 0; overflow-x: auto; }
  .stat:first-child { border-left: 0; padding-left: 0; }
  .watches__foot { flex-wrap: wrap; }
  .watches__foot .path { margin-left: 0; text-align: left; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .rail { border-right: 0; overflow: visible; }
  .console { height: 70dvh; border-top: 1px solid var(--rule); }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
}
