:root {
  --bronze: #cd7f32;
  --silver: #b8c2cc;
  --emerald: #10b981;
  --diamond: #38bdf8;

  --bg: #0d1117;
  --panel: #151b23;
  --line: #232c37;
  --text: #e8edf3;
  --muted: #8a95a3;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ---------------------------------------------------------------- topbar */

.topbar {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 24px;
  height: 62px;
  position: sticky;
  top: 0;
  z-index: 20;

  background: rgba(19, 25, 32, 0.86);
  backdrop-filter: blur(14px);          /* content scrolls *under* the bar, not behind a slab */
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 6px 24px -12px rgba(0, 0, 0, 0.8);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}
.brand img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  /* The mark is a crosshair — a faint glow makes it read as a live instrument rather than a
     flat sticker. */
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.35));
  transition: filter 0.2s ease, transform 0.2s ease;
}
.brand:hover img {
  filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.65));
  transform: scale(1.05);
}
.brand span {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--muted);
}
.brand b { color: var(--text); font-weight: 700; }

/* The tab strip: a single inset pill holding the four stages of the funnel. */
.tabs {
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 11px;
  background: #0d1219;
  border: 1px solid #1e2630;
}
.tabs a {
  position: relative;
  padding: 7px 14px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}
.tabs a:hover { color: var(--text); background: #1a2129; }

.tabs a.on {
  color: var(--text);
  background: linear-gradient(180deg, #2a3441, #222b36);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 2px 6px rgba(0, 0, 0, 0.35);
}
/* An emerald underline on the active tab — the same colour that means "good" everywhere else. */
.tabs a.on::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

.nav-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

main { max-width: 1320px; margin: 0 auto; padding: 28px 28px 120px; }

.head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.head h1 { font-size: 26px; margin: 0 0 4px; display: flex; align-items: center; gap: 10px; }
.head .total {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 11px;
}
.head p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* --------------------------------------------------------------- filters */

.filters { display: flex; gap: 8px; margin: 22px 0; flex-wrap: wrap; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}
.chip b { color: var(--text); font-size: 11.5px; }
.chip:hover { border-color: #33404f; color: var(--text); }
.chip.on { color: var(--text); background: #232c37; }
.chip.t-bronze.on  { border-color: var(--bronze);  box-shadow: inset 0 0 0 1px var(--bronze); }
.chip.t-silver.on  { border-color: var(--silver);  box-shadow: inset 0 0 0 1px var(--silver); }
.chip.t-emerald.on { border-color: var(--emerald); box-shadow: inset 0 0 0 1px var(--emerald); }
.chip.t-diamond.on { border-color: var(--diamond); box-shadow: inset 0 0 0 1px var(--diamond); }

/* ----------------------------------------------------------------- cards */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
  gap: 26px; /* the frames glow — they need room to breathe */
  align-items: start; /* cards keep their own height instead of stretching to the tallest
                         in the row, which used to expose the frame gradient as a big
                         coloured slab under short cards */
}

/* ---------------------------------------------------------- the tier frame */

/* Animating a conic-gradient means animating an angle, and an angle is only
   interpolatable if the browser knows it's an angle. That's what @property buys us. */
@property --angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

/* The frame is not a border — it's a 5px gradient *background* with the card's content
   sitting on top, inset by the padding. Rotating the gradient sends a wave of light
   travelling around the edge. */
.card {
  position: relative;
  padding: 5px;
  border: 0;
  border-radius: 20px;
  display: block;
  background: conic-gradient(
    from var(--angle),
    var(--edge) 0%,
    var(--sheen) 12%,
    var(--edge) 30%,
    var(--edge) 55%,
    var(--sheen) 68%,
    var(--edge) 88%
  );
  animation: frame-wave 7s linear infinite;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5) inset,
    0 6px 22px rgba(0, 0, 0, 0.45),
    0 0 34px -10px var(--glow);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

@keyframes frame-wave {
  to { --angle: 360deg; }
}

.card.t-bronze {
  --edge: #8a4b1a;
  --sheen: #f0b072;
  --glow: rgba(205, 127, 50, 0.55);
}
.card.t-silver {
  --edge: #78838f;
  --sheen: #ffffff;
  --glow: rgba(184, 194, 204, 0.5);
}
.card.t-emerald {
  --edge: #047857;
  --sheen: #6ee7b7;
  --glow: rgba(16, 185, 129, 0.6);
}
/* Diamond is the prize: three-stop iridescence, a brighter halo, a faster wave. */
.card.t-diamond {
  --edge: #0ea5e9;
  --sheen: #ffffff;
  --glow: rgba(56, 189, 248, 0.75);
  background: conic-gradient(
    from var(--angle),
    #0ea5e9 0%,
    #ffffff 10%,
    #a5f3fc 20%,
    #818cf8 38%,
    #0ea5e9 55%,
    #ffffff 70%,
    #67e8f9 82%,
    #0ea5e9 100%
  );
  animation-duration: 4.5s;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5) inset,
    0 6px 22px rgba(0, 0, 0, 0.45),
    0 0 46px -8px var(--glow);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.5) inset,
    0 10px 28px rgba(0, 0, 0, 0.5),
    0 0 52px -8px var(--glow);
}

.card.picked {
  transform: translateY(-3px) scale(1.012);
  box-shadow:
    0 0 0 2px var(--emerald),
    0 10px 30px rgba(0, 0, 0, 0.5),
    0 0 56px -6px var(--glow);
}

/* A page of spinning gradients is a lot. Respect the opt-out. */
@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
}

/* The opaque surface the content sits on. The card itself is nothing but the gradient;
   this covers all of it except the 5px of padding, which is what you see as the frame.
   Its own overflow:hidden is what keeps the creative inside the rounded corners. */
.inner {
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  background: var(--panel);
  display: flex;
  flex-direction: column;
}

/* A fixed 4:5 window onto the creative.
   The video is absolutely positioned rather than laid out in flow, because a flex item's
   automatic minimum size is its *content* size — an in-flow vertical video would blow past
   the aspect-ratio box and make the card metres tall. Taking it out of flow means the box
   dictates the size, not the video. */
.media {
  position: relative;
  aspect-ratio: 4 / 5;
  background: #06090d;
  flex: none;
}
.media video,
.media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* `contain`, not `cover`: these are mostly 9:16 vertical ads, and cropping them would
     cut off the hook text at the top — the single most useful thing on the creative. */
  object-fit: contain;
  display: block;
}
.no-media {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #4b5563;
  font-size: 12px;
}

.badge {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.5), 0 0 16px -3px var(--glow);
}
.t-bronze  .badge { background: linear-gradient(135deg, #f0b072, var(--bronze));  color: #1a0e03; }
.t-silver  .badge { background: linear-gradient(135deg, #ffffff, #9aa5b1);        color: #10151b; }
.t-emerald .badge { background: linear-gradient(135deg, #6ee7b7, var(--emerald)); color: #04120c; }
.t-diamond .badge { background: linear-gradient(135deg, #ffffff, #67e8f9, #818cf8); color: #04141c; }

.pick { position: absolute; right: 10px; top: 10px; cursor: pointer; }
.pick input {
  width: 21px;
  height: 21px;
  cursor: pointer;
  accent-color: var(--emerald);
}

/* The card's own background is the animated gradient, so the content needs to paint
   its own opaque surface on top of it. */
.body {
  background: var(--panel);
  padding: 13px 15px 15px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.age {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}
.age b { font-size: 17px; color: var(--text); }
.age small { margin-left: auto; font-size: 11px; }

.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 12.5px;
}
.row > span { color: var(--muted); flex-shrink: 0; }
.row a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px dashed #3c4855;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row a:hover { color: var(--emerald); border-color: var(--emerald); }
/* A long advertiser name must ellipsis, not wrap to a second line — a card that grows a row
   taller than its neighbours is what made the grid ragged in the first place. */
.row em,
.row strong {
  min-width: 0;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row em { color: #4f5b68; font-style: normal; }
.row strong { font-weight: 600; }
.row strong small { color: var(--muted); font-weight: 400; }
.row .hot { color: var(--emerald); }

.empty {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 56px 20px;
  text-align: center;
}
.empty p { margin: 0 0 6px; font-weight: 600; }
.empty small { color: var(--muted); }

/* ------------------------------------------------------- action bar/modal */

.btn {
  padding: 9px 16px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #202832;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: #27313d; }
.btn.primary { background: var(--emerald); border-color: var(--emerald); color: #04120c; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: #f87171; border-color: #452023; background: #24151700; }
.btn.danger:hover { background: #2a1618; }
.btn.ghost { background: transparent; color: var(--muted); }

.actionbar {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px 11px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.55);
  font-size: 13px;
  color: var(--muted);
  z-index: 20;
}
.actionbar b { color: var(--text); font-size: 15px; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 12, 0.72);
  display: grid;
  place-items: center;
  z-index: 30;
}
.sheet {
  width: min(420px, 92vw);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
}
.sheet h2 { margin: 0 0 8px; font-size: 18px; }
.sheet p { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.sheet p b { color: var(--text); }
.sheet-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* The destructive opt-in inside the promote dialog. */
.opt {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 13px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #10161d;
  cursor: pointer;
  font-size: 13px;
}
.opt:hover { border-color: #3a4552; }
.opt input { margin-top: 1px; width: 16px; height: 16px; accent-color: #ef4444; cursor: pointer; }
.opt small { display: block; margin-top: 3px; color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.opt small b { color: #f87171; }
.opt:has(input:checked) { border-color: #7f1d1d; background: #1a1113; }

[hidden] { display: none !important; }

/* ======================================================================
   Age filters (Scraped) — domain age + page age
   ====================================================================== */

.agebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.agerow {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.agebar-label {
  flex-shrink: 0;
  width: 82px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.agebar .presets { display: flex; gap: 6px; flex-wrap: wrap; }
.agebar .range { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.agebar .range span { color: var(--muted); font-size: 12px; }
.agebar .range .unit { margin-right: 2px; }
.agebar input {
  width: 66px;
  padding: 6px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #10161d;
  color: var(--text);
  font-size: 12.5px;
}
.agebar input:focus { outline: none; border-color: var(--emerald); }

.agebar-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.agebar-note { font-size: 11.5px; color: var(--muted); line-height: 1.5; flex: 1; min-width: 220px; }
.agebar-note b { color: #c6cfd9; }
.agebar-actions { display: flex; gap: 8px; margin-left: auto; }
.agebar-actions .btn { width: auto; }

/* ======================================================================
   In Tracking — the form
   ====================================================================== */

.grid-wide { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }

.track {
  padding: 14px 15px;
  background: #10161d;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.track-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.track-head .saved { color: var(--emerald); font-style: normal; }

.f { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.f > span { font-size: 11px; color: var(--muted); }
.f-row { display: flex; gap: 9px; }

.track input[type='text'],
.track input[type='url'],
.track input[type='date'],
.track input[type='number'] {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0d1117;
  color: var(--text);
  font-size: 12.5px;
  font-family: inherit;
}
.track input:focus { outline: none; border-color: var(--emerald); }
.track input::placeholder { color: #4a5764; }

.hint { font-size: 10.5px; color: var(--muted); line-height: 1.45; }
.hint b { color: var(--text); }
.hint b.hot { color: var(--emerald); }

.checks { display: flex; gap: 16px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 7px; font-size: 12.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--emerald); cursor: pointer; }

.track-actions { display: flex; gap: 8px; }
.track-actions .btn { flex: 1; }

/* ======================================================================
   Ad-count monitor + chart
   ====================================================================== */

.monitor { padding: 13px 15px; background: #0d1117; border-top: 1px solid var(--line); }
.monitor-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.monitor-head b { font-size: 20px; color: var(--text); letter-spacing: 0; }
.monitor-head em { font-style: normal; text-transform: none; letter-spacing: 0; font-weight: 400; }
.monitor-head em.warn { color: #f59e0b; }

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart-line { fill: none; stroke: var(--emerald); stroke-width: 2; stroke-linejoin: round; }
.chart-area { fill: var(--emerald); opacity: 0.1; }
.chart .dot { fill: var(--emerald); stroke: var(--panel); stroke-width: 1.5; transition: r 90ms ease; }
.chart .dot-hit { fill: transparent; stroke: none; cursor: pointer; }
.chart .pt:hover .dot { r: 5; }
.chart .tick { fill: var(--muted); font-size: 9px; text-anchor: end; font-family: inherit; }

/* Instant hover card — one element, positioned over whichever dot the cursor is on. */
.chart-tip {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  min-width: 150px;
  padding: 9px 12px;
  background: #fff;
  color: #111827;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  font-size: 12.5px;
  line-height: 1.35;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 12px));
  transition: opacity 80ms ease;
}
.chart-tip.show { opacity: 1; }
.chart-tip.below { transform: translate(-50%, 12px); }
.chart-tip__date { font-weight: 700; margin-bottom: 5px; }
.chart-tip__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.chart-tip__key { display: flex; align-items: center; gap: 7px; color: #6b7280; }
.chart-tip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--emerald); }
.chart-tip__val { font-weight: 700; }

.chart-foot { margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.chart-foot b { color: var(--text); font-size: 13px; }
.chart-foot.up b, .chart-foot.up { color: var(--emerald); }
.chart-foot.down { color: #f87171; }

.chart-empty {
  padding: 16px 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}
.chart-empty b { color: var(--text); }

/* ======================================================================
   The WINNERS button — the loudest thing in the app, on purpose
   ====================================================================== */

/* Card footer: WINNERS on top (the loud one), Delete beneath it. */
.card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 15px 15px;
}
.card-actions .btn.danger { width: 100%; }

.btn.winner {
  padding: 12px;
  border: 0;
  border-radius: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #04120c;
  background: linear-gradient(110deg, #34d399, #10b981 40%, #6ee7b7 55%, #10b981 70%, #059669);
  background-size: 220% 100%;
  box-shadow: 0 4px 18px -4px rgba(16, 185, 129, 0.6);
  animation: winner-sheen 3.5s linear infinite;
  cursor: pointer;
}
@keyframes winner-sheen {
  to { background-position: -220% 0; }
}
.btn.winner:hover { filter: brightness(1.1); box-shadow: 0 6px 26px -4px rgba(16, 185, 129, 0.8); }
@media (prefers-reduced-motion: reduce) {
  .btn.winner { animation: none; }
}

/* ======================================================================
   Detailed information modal
   ====================================================================== */

.sheet-lg {
  width: min(860px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
}
.sheet-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #1b222b;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}
.sheet-close:hover { color: var(--text); }

#detail-body h2 { margin: 0 0 6px; font-size: 21px; }
.d-sub { display: flex; align-items: center; gap: 10px; margin: 0 0 20px !important; }
.d-sub .badge { position: static; }

.d-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 700px) { .d-grid { grid-template-columns: 1fr; } }

#detail-body h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
#detail-body section { margin-bottom: 22px; }

.d-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.d-row > span { color: var(--muted); flex-shrink: 0; }
.d-row b { font-weight: 600; text-align: right; overflow: hidden; text-overflow: ellipsis; }
.d-row b.hot, .d-row b .hot, .d-row .yes { color: var(--emerald); }
.d-row em { color: #4f5b68; font-style: normal; }
.d-row a { color: var(--text); border-bottom: 1px dashed #3c4855; text-decoration: none; }
.d-row a:hover { color: var(--emerald); border-color: var(--emerald); }

.btn.tiny { padding: 5px 10px; font-size: 11px; text-transform: none; letter-spacing: 0; }

.d-copy {
  margin: 0;
  padding: 12px;
  background: #0d1117;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 160px;
  overflow-y: auto;
}
.hint b.warn { color: #f59e0b; }
#detail-body h3 small { font-weight: 500; text-transform: none; letter-spacing: 0; color: #4f5b68; }

/* ======================================================================
   Tooltips
   ====================================================================== */

.tip { position: relative; }

/* Rendered as a pseudo-element rather than title="", because the native tooltip takes about
   a second to appear, can't be styled, and truncates. This one is instant and readable. */
.tip::after {
  content: attr(data-tip);
  position: absolute;
  left: 0;
  top: calc(100% + 9px);
  z-index: 40;
  width: max-content;
  max-width: 230px;
  padding: 9px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #05080c;
  color: var(--text);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6);

  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  white-space: normal;

  opacity: 0;
  transform: translateY(-3px);
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
}
.tip:hover::after { opacity: 1; transform: translateY(0); }

/* The badge sits inside .inner, which clips its overflow — so the tooltip must open
   DOWNWARD, into the creative, where there's always room. */
.badge.tip::after { top: calc(100% + 8px); }

/* ======================================================================
   The Guide
   ====================================================================== */

.nav-guide {
  margin-left: auto;             /* pins it to the right of the navbar */
  padding: 7px 15px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
}
.nav-guide::before { content: "📖 "; }
.nav-guide:hover { color: var(--text); border-color: #3a4552; background: #1d242e; }
.nav-guide.on { color: var(--text); background: #232c37; border-color: #3a4552; }

.guide {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 44px;
  max-width: 1150px;
  margin: 0 auto;
  padding: 34px 28px 100px;
}
@media (max-width: 860px) {
  .guide { grid-template-columns: 1fr; }
  .toc { display: none; }
}

.toc {
  position: sticky;
  top: 82px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12.5px;
}
.toc b {
  margin-bottom: 8px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.toc a {
  padding: 6px 10px;
  border-radius: 7px;
  border-left: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
}
.toc a:hover { color: var(--text); background: var(--panel); border-left-color: var(--emerald); }

.doc { font-size: 14.5px; line-height: 1.72; color: #c6cfd9; }
.doc-hero { padding-bottom: 26px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.doc-hero h1 { margin: 0 0 8px; font-size: 34px; color: var(--text); letter-spacing: -0.02em; }
.doc-hero p { margin: 0; font-size: 16px; color: var(--muted); }

.doc section { padding: 30px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 76px; }
.doc section:last-of-type { border-bottom: 0; }
.doc h2 { margin: 0 0 14px; font-size: 22px; color: var(--text); letter-spacing: -0.01em; }
.doc h3 { margin: 26px 0 8px; font-size: 15px; color: var(--text); }
.doc p { margin: 0 0 14px; }
.doc b { color: var(--text); }
.doc em { color: #aab5c1; }
.doc ul, .doc ol { margin: 0 0 14px; padding-left: 20px; }
.doc li { margin-bottom: 7px; }
.doc code {
  padding: 2px 6px;
  border-radius: 5px;
  background: #0b0f14;
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  color: #a5f3fc;
}
.doc pre {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #0b0f14;
  border: 1px solid var(--line);
  overflow-x: auto;
}
.doc pre code { padding: 0; border: 0; background: none; color: #93a1b1; line-height: 1.7; }

.doc .lede { font-size: 16px; color: var(--text); }
.doc .warn-line { color: #f0b072; }

.note {
  margin: 18px 0;
  padding: 13px 15px;
  border-radius: 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--diamond);
  background: #10161d;
  font-size: 13.5px;
}

.steps li { margin-bottom: 9px; }

.tbl { width: 100%; border-collapse: collapse; margin: 6px 0 16px; font-size: 13.5px; }
.tbl th {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr td:first-child { color: var(--text); white-space: nowrap; }

/* Tier reference table */
.tier-table { display: flex; flex-direction: column; gap: 9px; margin: 18px 0; }
.tier-row {
  display: grid;
  grid-template-columns: 108px 82px 88px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 11px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--edge);
  font-size: 13px;
}
.tier-row .badge { position: static; justify-self: start; }
.tier-row .verdict { color: var(--sheen); }
.tier-row span:last-child { color: var(--muted); }
@media (max-width: 720px) {
  .tier-row { grid-template-columns: 1fr; gap: 6px; }
}

/* Funnel diagram */
.funnel { margin: 18px 0; }
.stage {
  padding: 13px 16px;
  border-radius: 11px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--emerald);
  margin-bottom: 8px;
}
.stage b { display: block; font-size: 14px; margin-bottom: 2px; }
.stage span { font-size: 13px; color: var(--muted); }
.stage em {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--emerald);
  font-style: normal;
}

/* Signal stack */
.signal-stack { display: grid; gap: 14px; margin-top: 18px; }
.sig {
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
}
.sig > b { display: block; margin-bottom: 10px; font-size: 14.5px; }
.sig ul { margin-bottom: 10px; }
.sig p { margin: 0; font-size: 13px; color: var(--muted); }
.sig.good { border-left-color: var(--emerald); }
.sig.good > b { color: var(--emerald); }
.sig.meh { border-left-color: var(--bronze); }
.sig.meh > b { color: #f0b072; }
.sig.bad { border-left-color: #b91c1c; }
.sig.bad > b { color: #f87171; }

/* Glossary */
.gloss { margin: 0; }
.gloss dt {
  margin-top: 16px;
  font-weight: 700;
  color: var(--text);
  font-size: 14px;
}
.gloss dd { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }

.doc-foot { padding-top: 26px; color: var(--muted); font-size: 13px; }

/* ======================================================================
   Auth: login / setup
   ====================================================================== */

body.centered { display: grid; place-items: center; min-height: 100vh; padding: 24px; }

.auth-card {
  width: min(390px, 100%);
  padding: 30px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}
.auth-brand img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  /* Same faint crosshair glow the nav logo carries. */
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.4));
}
.auth-brand span {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--muted);
}
.auth-brand b { color: var(--text); font-weight: 700; }
.auth-card h1 { margin: 0 0 6px; font-size: 22px; }
.auth-sub { margin: 0 0 22px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.auth-card .f { margin-bottom: 14px; }
.auth-card .f > span { font-size: 11px; color: var(--muted); }
.auth-card input {
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #0d1117;
  color: var(--text);
  font-size: 14px;
}
.auth-card input:focus { outline: none; border-color: var(--emerald); }
.auth-card .btn { width: 100%; padding: 11px; margin-top: 4px; }

.auth-error {
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid #7f1d1d;
  background: #1a1113;
  color: #f87171;
  font-size: 12.5px;
}
.auth-foot { margin: 16px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.5; }

/* ======================================================================
   Settings
   ====================================================================== */

.nav-settings {
  margin-left: 8px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
}
.nav-settings:hover { color: var(--text); background: #1d242e; border-color: #3a4552; }
.nav-settings.on { color: var(--text); background: #232c37; }

main.narrow { max-width: 780px; }

.panel {
  margin-top: 22px;
  padding: 22px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.panel h2 { margin: 0 0 6px; font-size: 16px; }
.panel .muted { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0 0 16px; }
.panel .f { margin-bottom: 13px; max-width: 340px; }
.panel .f > span { font-size: 11px; color: var(--muted); }
.panel input {
  width: 100%;
  margin-top: 5px;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0d1117;
  color: var(--text);
  font-size: 13px;
}
.panel input:focus { outline: none; border-color: var(--emerald); }

.keyrow { display: flex; gap: 8px; margin-bottom: 14px; }
.keyrow input {
  flex: 1;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.02em;
}
.keyrow .btn { flex-shrink: 0; }

.keyactions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.small { font-size: 11.5px; line-height: 1.5; }
.small.ok { color: var(--emerald); }
.small.bad { color: #f87171; }
.muted.small { color: var(--muted); }
.keyactions .muted { color: var(--muted); max-width: 380px; }

.banner {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 11px;
  font-size: 13px;
  line-height: 1.6;
}
.banner.danger { border: 1px solid #7f1d1d; background: #1a1113; color: #fca5a5; }
.banner code {
  padding: 1px 6px;
  border-radius: 5px;
  background: #0b0f14;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12px;
}

/* ======================================================================
   Notes (Winners)
   ====================================================================== */

.btn.notes { position: relative; }
.btn.notes.written { border-color: var(--emerald); color: var(--emerald); }
.btn.notes .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 5px;
  border-radius: 50%;
  background: var(--emerald);
  vertical-align: middle;
}

.notes-sheet { display: flex; flex-direction: column; gap: 14px; }
.notes-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.notes-head h2 { margin: 0 0 2px; font-size: 18px; }
.notes-head .sheet-close { position: static; flex-shrink: 0; }
.notes-head p { margin: 0; word-break: break-all; }

/* Monospace on purpose: the template is aligned with ===== rules, and a proportional font
   turns them into ragged noise. */
#notes-text {
  width: 100%;
  min-height: 52vh;
  padding: 16px 18px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #0b0f14;
  color: #dbe3ec;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.75;
  resize: vertical;
  tab-size: 2;
}
#notes-text:focus { outline: none; border-color: var(--emerald); }

.notes-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.notes-foot .sheet-actions { margin-left: auto; }

/* ======================================================================
   Alerts (Settings)
   ====================================================================== */

.pill {
  margin-left: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #10161d;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: middle;
}
.pill.on { border-color: var(--emerald); color: var(--emerald); background: #0f1a15; }

.f > span small { text-transform: none; letter-spacing: 0; color: #5b6672; font-weight: 400; }
.f.wide { max-width: 100%; }

.tg-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.tg-actions .btn { width: auto; }

.rule { border: 0; border-top: 1px solid var(--line); margin: 20px 0 16px; }
h3.sub { margin: 0 0 12px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }

.thresholds { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.thresholds .f { max-width: none; margin: 0; }
.unit-input { display: flex; align-items: center; gap: 7px; }
.unit-input input { width: 78px; }
.unit-input em { font-style: normal; font-size: 11.5px; color: var(--muted); }

/* Alert feed */
.feed { display: flex; flex-direction: column; }
.feed-row {
  display: grid;
  grid-template-columns: 190px 1fr auto;
  gap: 14px;
  align-items: baseline;
  padding: 10px 0 10px 12px;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid var(--line);
  font-size: 13px;
}
.feed-row:last-child { border-bottom: 0; }
.feed-row span { color: var(--muted); }
.feed-row em { font-style: normal; font-size: 11px; color: #5b6672; white-space: nowrap; }
.feed-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.feed-row.k-scaling  { border-left-color: var(--emerald); }
.feed-row.k-scaling b  { color: var(--emerald); }
.feed-row.k-new_high { border-left-color: var(--diamond); }
.feed-row.k-new_high b { color: var(--diamond); }
.feed-row.k-killed   { border-left-color: #b91c1c; }
.feed-row.k-killed b   { color: #f87171; }
.feed-row.k-pullback { border-left-color: #f59e0b; }
.feed-row.k-pullback b { color: #f0b072; }

@media (max-width: 640px) {
  .feed-row { grid-template-columns: 1fr; gap: 3px; }
}

/* --- nav right cluster (overrides the earlier, plainer versions) ------------ */
.nav-guide {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 0;
  padding: 8px 13px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #151c24;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}
.nav-guide::before { content: none; }
.nav-guide .ico { font-size: 13px; }
.nav-guide:hover { color: var(--text); border-color: #3a4552; background: #1d242e; }
.nav-guide.on { color: var(--text); background: #232c37; border-color: #3a4552; }

.nav-settings {
  margin-left: 0;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #151c24;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  transition: transform 0.3s ease, color 0.15s ease;
}
.nav-settings:hover { color: var(--text); background: #1d242e; transform: rotate(45deg); }
.nav-settings.on { color: var(--text); background: #232c37; border-color: #3a4552; }

@media (max-width: 900px) {
  .topbar { gap: 12px; padding: 0 14px; }
  .brand span { display: none; }
  .tabs a { padding: 7px 10px; font-size: 12px; }
  .nav-guide span:not(.ico) { display: none; }
}

.checks-stack { display: flex; flex-direction: column; gap: 12px; margin: 4px 0 14px; }
.checks-stack .check { align-items: flex-start; }
.checks-stack .check input { margin-top: 2px; }
.checks-stack .check small {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}

/* ======================================================================
   Settings — checkbox rows
   ======================================================================
   `.panel input { width: 100% }` was also hitting the checkboxes, stretching each one across
   the panel and shoving its label to the far right. Same specificity as `.check input`, and it
   came later in the file, so it won. These rules are scoped tighter so they can't lose again. */

.panel .check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: 100%;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #10161d;
  cursor: pointer;
  font-size: 13.5px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.panel .check:hover { border-color: #3a4552; background: #131b23; }

.panel .check input[type="checkbox"] {
  width: 17px;
  height: 17px;
  min-width: 17px;   /* flex must not be allowed to squash it */
  margin: 1px 0 0;
  padding: 0;
  flex: none;
  accent-color: var(--emerald);
  cursor: pointer;
}

.panel .check > span { flex: 1; min-width: 0; line-height: 1.5; }
.panel .check small {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.55;
}

/* A ticked row reads as active rather than just having a tick in it. */
.panel .check:has(input:checked) {
  border-color: #1c4d3a;
  background: #0f1a15;
}
.panel .check:has(input:checked) > span > b { color: var(--emerald); }

.checks-stack { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 16px; }

/* The threshold row: keep the label above its input, and stop the number boxes from sprawling. */
.thresholds { margin-bottom: 6px; }
.thresholds .f > span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.thresholds .unit-input input { width: 86px; margin: 0; }

.panel .rule { margin: 22px 0 18px; }

/* ======================================================================
   Auto Mode config manager (Settings)
   ====================================================================== */

.cfg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #10161d;
  margin-bottom: 8px;
}
.cfg-meta b { font-size: 13.5px; }
.cfg-meta span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.cfg-row-actions { display: flex; gap: 7px; flex-shrink: 0; }
.cfg-row-actions .btn { width: auto; }

.cfg-form {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.cfg-form .f-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cfg-form .f { max-width: none; margin: 0; }
.cfg-form .f[class*='wide'] { flex-basis: 100%; }
.cfg-form select {
  margin-top: 5px;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0d1117;
  color: var(--text);
  font-size: 13px;
}
.cfg-form textarea {
  width: 100%;
  margin-top: 5px;
  padding: 11px 13px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #0d1117;
  color: var(--text);
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  resize: vertical;
}
.cfg-form textarea:focus, .cfg-form select:focus { outline: none; border-color: var(--emerald); }
.cfg-form-actions { display: flex; align-items: center; gap: 10px; }
.cfg-form-actions .btn { width: auto; }

/* ======================================================================
   MOBILE APP MODE  —  body.app
   The iOS hybrid shell's phone-optimized skin. Applied ONLY when the native
   app's WebView is detected (User-Agent carries "AdLibHunterApp"), so the
   desktop dashboard and any mobile-web visitor are left exactly as they were.
   The native app draws its own bottom tab bar, so the desktop topbar is gone
   and each route becomes a standalone, full-height screen.
   ====================================================================== */

body.app {
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

body.app .topbar { display: none; }              /* the native tab bar replaces it */

body.app main,
body.app main.narrow {
  max-width: 100%;
  margin: 0;
  padding: calc(var(--safe-top) + 6px) 14px calc(var(--safe-bottom) + 28px);
}

/* --- sticky glass screen header (title + count + one action) --- */
body.app .head {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: calc(-1 * (var(--safe-top) + 6px)) -14px 12px;
  padding: calc(var(--safe-top) + 10px) 14px 10px;
  background: rgba(13, 17, 23, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
body.app .head h1 { font-size: 20px; display: flex; align-items: center; gap: 8px; }
body.app .head > div > p { display: none; }      /* subtitle: hidden to save vertical room */
body.app .head .btn { padding: 9px 13px; font-size: 13px; min-height: 0; }

/* --- filters: a single horizontally-scrollable row of pills --- */
body.app .filters {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 6px;
  margin-bottom: 12px;
}
body.app .filters::-webkit-scrollbar { display: none; }
body.app .filters .chip { flex: 0 0 auto; padding: 9px 14px; font-size: 13px; }

/* --- age filter bar (Scraped): stack, and scroll the presets --- */
body.app .agebar { padding: 12px; }
body.app .agerow { flex-direction: column; align-items: stretch; gap: 8px; }
body.app .presets { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
body.app .presets::-webkit-scrollbar { display: none; }
body.app .presets .chip { flex: 0 0 auto; }
body.app .agebar-foot { flex-direction: column; align-items: stretch; gap: 10px; }

/* --- cards: one per row, full width, tap-friendly --- */
body.app .grid { display: block; }
body.app .card { width: 100%; margin-bottom: 14px; }
body.app .card .media video,
body.app .card .media img { width: 100%; }
body.app .card .row { padding: 10px 0; font-size: 14px; }
body.app .empty { padding: 40px 16px; }

/* --- selection bar: floating pill above the home indicator --- */
body.app .actionbar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--safe-bottom) + 12px);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55);
  flex-wrap: wrap;
  gap: 8px;
}
body.app .actionbar .btn { flex: 1 1 auto; }

/* --- confirm dialog: a bottom sheet --- */
body.app .modal { align-items: flex-end; }
body.app .modal .sheet {
  width: 100%;
  max-width: 100%;
  border-radius: 20px 20px 0 0;
  padding-bottom: calc(var(--safe-bottom) + 20px);
}
body.app .sheet-actions .btn { flex: 1; }

/* --- comfortable tap targets + no iOS zoom-on-focus (needs >=16px) --- */
body.app .btn { min-height: 44px; }
body.app input[type="text"],
body.app input[type="password"],
body.app input[type="number"],
body.app textarea,
body.app select { font-size: 16px; }
body.app main.narrow .panel { padding: 16px; }

/* --- login: fixed, centered, never scrolls (the thing you called out) --- */
body.app.centered {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(var(--safe-top), 18px) 18px max(var(--safe-bottom), 18px);
}
body.app .auth-card { width: 100%; max-width: 420px; }
