/* =============================================================
   narratrak · app.css · Operator direction
   Requires: tokens.css loaded first, Bootstrap Icons CDN (icons only)
   ============================================================= */

/* ── 1. Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  font-size: var(--t-body);
  line-height: var(--t-body-lh);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--accent-hover); }
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }
p { margin: 0; }

/* ── 2. Layout ── */
.page {
  flex: 1;
  padding: var(--s-6);
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
}
.page--narrow { max-width: 780px; }
.page--center {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

/* ── 3. TopNav ── */
/* ── Unified nav: same structure on every page ── */
.topnav {
  height: var(--nav-h);
  background: var(--ink);
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  padding: 0 var(--s-6);
  gap: var(--s-5);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}
/* Logo: always far left, never grows */
.topnav__logo { flex-shrink: 0; display: flex; align-items: center; }
.topnav__logo img { height: 32px; width: auto; display: block; }
/* Nav links: sit right of the logo */
.topnav__links { display: flex; align-items: center; gap: var(--s-1); }
.topnav__link {
  font-size: var(--t-body);
  font-weight: 500;
  color: rgba(255,255,255,.5);
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-2);
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  text-decoration: none;
  white-space: nowrap;
}
.topnav__link:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.topnav__link.is-active { color: #fff; background: rgba(255,255,255,.1); }
/* Right side: always pushed to the far right by margin-left:auto */
.topnav__right {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  margin-left: auto;
  flex-shrink: 0;
}
.topnav__plan {
  font-family: var(--font-mono);
  font-size: var(--t-label);
  letter-spacing: var(--t-label-ls);
  text-transform: uppercase;
  background: rgba(255,255,255,.1);
  color: rgba(255,255,255,.6);
  padding: 3px var(--s-2);
  border-radius: var(--r-1);
  text-decoration: none;
  white-space: nowrap;
}
.topnav__plan:hover { text-decoration: none; color: #fff; }
.topnav__plan--upgrade { background: var(--accent); color: var(--on-accent); }
.topnav__plan--upgrade:hover { background: var(--accent-hover); color: var(--on-accent); }
/* Account dropdown trigger */
.topnav__acct {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  font-size: var(--t-meta);
  color: rgba(255,255,255,.7);
  background: none;
  border: none;
  padding: var(--s-1) var(--s-2);
  border-radius: var(--r-2);
  cursor: pointer;
  max-width: 220px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.topnav__acct:hover { color: #fff; background: rgba(255,255,255,.08); }
/* Mobile hamburger — hidden on desktop */
.topnav__toggle {
  display: none;
  background: none;
  border: none;
  color: rgba(255,255,255,.7);
  font-size: 1.25rem;
  padding: var(--s-1);
  line-height: 1;
  cursor: pointer;
}

/* ── 4. Footer ── */
.footer {
  background: var(--ink);
  padding: var(--s-3) var(--s-6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-5);
  flex-wrap: wrap;
  flex-shrink: 0;
}
.footer a {
  font-size: var(--t-meta);
  color: rgba(255,255,255,.35);
  text-decoration: none;
}
.footer a:hover { color: rgba(255,255,255,.7); text-decoration: none; }
.footer__brand { font-size: var(--t-meta); color: rgba(255,255,255,.18); }

/* ── 5. Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  height: 36px;
  padding: 0 var(--s-3);
  font-size: var(--t-body);
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--r-2);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease);
  user-select: none;
  flex-shrink: 0;
}
.btn:focus-visible { box-shadow: var(--ring); outline: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn:hover { text-decoration: none; }

.btn--default { background: var(--panel); color: var(--ink); border-color: var(--line-strong); }
.btn--default:hover { background: var(--raised); color: var(--ink); }

.btn--primary { background: var(--ink); color: var(--on-accent); border-color: var(--ink); }
.btn--primary:hover { background: #2a2a30; color: var(--on-accent); }

.btn--accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn--accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }

.btn--ghost { background: transparent; color: var(--dim); border-color: transparent; }
.btn--ghost:hover { background: var(--raised); color: var(--ink); }
/* Ghost buttons inside the dark topnav need their own hover so the light bg doesn't clash */
.topnav .btn--ghost { color: rgba(255,255,255,.6) !important; }
.topnav .btn--ghost:hover { background: rgba(255,255,255,.1) !important; color: #fff !important; }

.btn--danger { background: var(--panel); color: var(--hot-ink); border-color: var(--line-strong); }
.btn--danger:hover { background: var(--hot-soft); border-color: var(--hot-line); color: var(--hot-ink); }

.btn--sm { height: 30px; padding: 0 var(--s-2); font-size: var(--t-meta); }
.btn--lg { height: 44px; padding: 0 var(--s-5); font-size: 15px; }
.btn--wide { width: 100%; }
.btn--icon { width: 36px; padding: 0; }
.btn--icon.btn--sm { width: 30px; }

/* Scan button running state */
.btn--scanning { background: var(--raised); color: var(--dim); border-color: var(--line); cursor: default; }

/* ── 6. Forms ── */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: var(--s-4);
}
.field__label { font-size: 13px; font-weight: 500; color: var(--ink); }
.field__help { font-size: var(--t-meta); color: var(--dim); line-height: 1.55; }
.field__help code, .field__help em {
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--raised);
  padding: 1px 4px;
  border-radius: var(--r-1);
  font-style: normal;
  color: var(--ink);
}
.field__error { font-size: var(--t-meta); color: var(--hot-ink); }
.field__opt { font-size: var(--t-meta); color: var(--faint); font-weight: 400; }

.input {
  width: 100%;
  height: var(--field-h);
  padding: 0 var(--s-3);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  font-size: var(--t-body);
  color: var(--ink);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  outline: none;
}
.input:focus { border-color: var(--ink); box-shadow: var(--ring); }
.input:disabled { background: var(--raised); color: var(--dim); cursor: not-allowed; }

.textarea {
  width: 100%;
  min-height: 108px;
  padding: var(--s-2) var(--s-3);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  font-family: var(--font-mono);
  font-size: var(--t-data);
  color: var(--ink);
  resize: vertical;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  outline: none;
  line-height: 1.5;
}
.textarea:focus { border-color: var(--ink); box-shadow: var(--ring); }

.field--check {
  flex-direction: row;
  align-items: flex-start;
  gap: var(--s-2);
  margin-bottom: var(--s-4);
}
.field--check input[type="checkbox"] {
  width: 16px; height: 16px;
  margin-top: 2px; flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.field--check label { font-size: var(--t-meta); color: var(--dim); cursor: pointer; }
.field--check label a { color: var(--accent); }

/* ── 7. Segmented control ── */
.seg {
  display: inline-flex;
  align-self: flex-start;
  background: var(--raised);
  border-radius: var(--r-2);
  padding: 3px;
  gap: 2px;
}
.seg__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 var(--s-3);
  font-size: var(--t-meta);
  font-weight: 500;
  background: transparent;
  color: var(--dim);
  border: none;
  border-radius: calc(var(--r-2) - 1px);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.seg__btn:hover { color: var(--ink); }
.seg__btn.is-active { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-1); }
.seg__btn:focus-visible { box-shadow: var(--ring); outline: none; }
/* Hidden radio inside label for form submission */
.seg__radio { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }

/* ── 8. Cards ── */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-1);
}
.card__body { padding: var(--s-6); }
.card--danger { border-color: var(--hot-line); }

/* ── 9. Alerts ── */
.alert {
  padding: var(--s-2) var(--s-4);
  border-radius: var(--r-2);
  font-size: var(--t-body);
  border: 1px solid transparent;
  margin-bottom: var(--s-3);
}
.alert--ok { background: var(--ok-soft); color: var(--ok-ink); border-color: var(--ok-line); }
.alert--danger { background: var(--hot-soft); color: var(--hot-ink); border-color: var(--hot-line); }
.alert--info { background: var(--raised); color: var(--dim); border-color: var(--line-strong); }

/* ── 10. Category badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px var(--s-2) 2px 7px;
  border-radius: var(--r-full);
  font-size: var(--t-meta);
  font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge__dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.badge--hot { background: var(--hot-soft); color: var(--hot-ink); border-color: var(--hot-line); }
.badge--relevant { background: var(--relevant-soft); color: var(--relevant-ink); border-color: var(--relevant-line); }
.badge--latest { background: var(--latest-soft); color: var(--latest); border-color: var(--latest-line); }
.badge--new { background: var(--ok-soft); color: var(--ok-ink); border-color: var(--ok-line); }
.badge--plain { background: var(--raised); color: var(--dim); border-color: var(--line); padding: 2px var(--s-2); }

/* Post status badges (must keep class names for JS) */
.status-badge {
  font-size: var(--t-label);
  font-family: var(--font-mono);
  letter-spacing: .04em;
  padding: 2px var(--s-2);
  border-radius: var(--r-full);
  border: 1px solid transparent;
}
.badge-new { background: var(--ok-soft); color: var(--ok-ink); border-color: var(--ok-line); }
.badge-seen { background: var(--raised); color: var(--faint); border-color: var(--line); }

/* ── 11. Chips ── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  padding: 2px var(--s-2);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  font-family: var(--font-mono);
  font-size: var(--t-meta);
  color: var(--ink);
  white-space: nowrap;
}

/* ── 12. Monitor tabs ── */
.tabs {
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  font-size: var(--t-body);
  font-weight: 500;
  color: var(--dim);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
  flex-shrink: 0;
}
.tab:hover { color: var(--ink); text-decoration: none; }
.tab.is-active { color: var(--ink); border-bottom-color: var(--ink); }
.tab__count {
  font-family: var(--font-mono);
  font-size: var(--t-label);
  letter-spacing: .04em;
  padding: 1px 6px;
  border-radius: var(--r-1);
  background: var(--raised);
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.tab.is-active .tab__count { background: var(--accent); color: var(--on-accent); }

/* ── 13. Page header ── */
.page-hd {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
  flex-wrap: wrap;
}
.page-hd__title {
  font-size: var(--t-h2);
  font-weight: 600;
  letter-spacing: var(--t-h2-ls);
}
.page-hd__meta { font-size: var(--t-meta); color: var(--dim); }
.page-hd__right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
}

/* ── 14. Filter strip (dashboard) ── */
.filter-strip {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-wrap: wrap;
  margin-bottom: var(--s-4);
}

/* ── 15. Dashboard scan overlay ── */
#scanOverlay {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--s-8) var(--s-6);
  text-align: center;
  margin-bottom: var(--s-4);
}

/* ── 16. Progress bar ── */
.progress {
  background: var(--raised);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: var(--r-full);
  transition: width .5s ease;
}
.progress-bar.bg-danger { background: var(--accent); }

/* ── 17. Spinner ── */
.spinner-border {
  display: inline-block;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 18. DataTable ── */
#tableWrapper {
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
#tableScroll {
  overflow-y: auto;
  max-height: calc(100vh - 260px);
}
.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--panel);
  font-size: var(--t-body);
}
.data thead {
  position: sticky;
  top: 0;
  z-index: 200;
}
.data thead tr { box-shadow: 0 2px 0 0 var(--line); }

/* keep .sth for JS compat */
.sth, .data__th {
  background: var(--bg);
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: var(--t-label);
  letter-spacing: var(--t-label-ls);
  text-transform: uppercase;
  font-weight: 500;
  padding: var(--s-2) var(--s-4);
  border-bottom: none !important;
  text-align: left;
  white-space: nowrap;
}
.data thead tr { background: var(--bg); }
.data tbody { border-top: none !important; }

/* keyword group header rows — keep class for JS compat */
.kw-header-row td {
  padding: var(--s-2) var(--s-4);
  background: var(--bg);
  border-top: 2px solid var(--line) !important;
  border-bottom: 1px solid var(--line) !important;
  font-size: var(--t-meta);
  letter-spacing: .03em;
  cursor: pointer;
  user-select: none;
  position: sticky;
  z-index: 50;
}
.kw-header-row:hover td { background: var(--raised) !important; }

/* post rows — keep classes for JS compat */
.post-row td {
  padding: var(--s-2) var(--s-4);
  border-top: 1px solid var(--line) !important;
  vertical-align: middle;
}
.post-row:hover td { background: var(--bg); cursor: pointer; }
.post-row td:first-child { padding-left: var(--s-4); }

/* category cell sticky inner */
.cat-sticky-inner {
  position: sticky;
  z-index: 5;
  padding: var(--s-2);
  text-align: center;
  background: var(--panel);
}
.data__num {
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--t-data);
  font-variant-numeric: tabular-nums;
  color: var(--dim);
}
.data__comment {
  font-size: var(--t-meta);
  color: var(--dim);
  font-style: italic;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.data__posted {
  font-family: var(--font-mono);
  font-size: var(--t-meta);
  font-variant-numeric: tabular-nums;
  color: var(--dim);
  white-space: nowrap;
}
.data__sub a { color: var(--dim); font-size: var(--t-meta); }
.data__sub a:hover { color: var(--ink); text-decoration: none; }
.data__title { max-width: 340px; font-weight: 500; }
.clickable-row { cursor: pointer; }

/* ── 19. Monitor cards grid ── */
.monitors-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-4);
}
.moncard {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--s-5);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  height: 100%;
  min-height: 180px;
}
.moncard:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); }
.moncard--paused { opacity: .65; }
.moncard__hd { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-2); }
.moncard__name-wrap { display: flex; align-items: flex-start; gap: var(--s-2); flex: 1; min-width: 0; }
.moncard__dot {
  width: 7px; height: 7px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.moncard__name { font-size: var(--t-h3); font-weight: 600; color: var(--ink); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.moncard__paused {
  font-family: var(--font-mono);
  font-size: var(--t-label);
  letter-spacing: .06em;
  text-transform: uppercase;
  background: var(--raised);
  color: var(--faint);
  padding: 1px 6px;
  border-radius: var(--r-1);
  margin-top: 2px;
}
.moncard__kws { display: flex; flex-wrap: wrap; gap: var(--s-1); align-items: flex-start; }
.moncard__more { position: relative; display: inline-flex; }
.moncard__more-pill { cursor: default; background: var(--raised); color: var(--dim); border-color: var(--line); }
.moncard__more-tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  box-shadow: var(--shadow-2);
  padding: var(--s-2);
  display: none;
  flex-wrap: wrap;
  gap: var(--s-1);
  min-width: 160px;
  max-width: 260px;
  z-index: 20;
}
.moncard__more:hover .moncard__more-tip { display: flex; }
.moncard__scope { font-size: var(--t-meta); color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.moncard__ft {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line);
  margin-top: auto;
}
.stat { display: flex; flex-direction: column; gap: 1px; }
.stat__l { font-family: var(--font-mono); font-size: var(--t-label); text-transform: uppercase; letter-spacing: .06em; color: var(--faint); }
.stat__v { font-size: var(--t-h3); font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat__v--accent { color: var(--accent); }
.moncard__ago { margin-left: auto; font-family: var(--font-mono); font-size: var(--t-label); color: var(--faint); text-align: right; line-height: 1.5; }

/* ── 20. Monitor form ── */
.form-page { max-width: 640px; margin: 0 auto; }
.form__plan-info {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  font-size: var(--t-meta);
  color: var(--dim);
}
.form__actions { display: flex; gap: var(--s-2); margin-top: var(--s-5); }

/* ── 21. Auth pages ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}
.auth-page .topnav { flex-shrink: 0; }
.auth-page .topnav .topnav__right { margin-left: auto; }
.auth-wrap {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: var(--s-10) var(--s-4);
}
/* auth-logo no longer needed — logo is in the topnav */
.auth-logo { display: none; }
.auth-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--s-6);
  box-shadow: var(--shadow-2);
}
.auth-card__title { font-size: var(--t-h2); font-weight: 600; letter-spacing: var(--t-h2-ls); margin-bottom: 4px; }
.auth-card__sub { font-size: var(--t-meta); color: var(--dim); margin-bottom: var(--s-5); }
.auth-footer { text-align: center; margin-top: var(--s-4); font-size: var(--t-meta); color: var(--dim); }
.auth-footer a { color: var(--accent); }

/* ── 22. Dropdown menus ── */
.dd { position: relative; display: inline-block; }
.dd__menu {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 180px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  box-shadow: var(--shadow-2);
  z-index: 500;
  padding: var(--s-1) 0;
}
.dd__menu.is-open { display: block; }
.dd__menu--left { right: auto; left: 0; }
.dd__item {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) var(--s-4);
  font-size: var(--t-body);
  color: var(--ink);
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--dur-fast) var(--ease);
}
.dd__item:hover { background: var(--raised); text-decoration: none; color: var(--ink); }
.dd__item--danger { color: var(--hot-ink); }
.dd__item--danger:hover { background: var(--hot-soft); }
.dd__sep { height: 1px; background: var(--line); margin: var(--s-1) 0; }
.dd__label { padding: var(--s-1) var(--s-4); font-family: var(--font-mono); font-size: var(--t-label); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
/* Language dropdown */
.dd__menu--lang { left: 0; right: auto; max-height: 260px; overflow-y: auto; min-width: 160px; }
.dd__item--check { gap: var(--s-2); font-size: var(--t-meta); }
.dd__item--check input[type="checkbox"] { accent-color: var(--accent); }

/* ── 23. Collapse ── */
.collapse { display: none; }
.collapse.is-open { display: block; }

/* ── 24. Onboarding steps ── */
.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  margin-bottom: var(--s-6);
}
.step { display: flex; align-items: center; gap: var(--s-2); }
.step__num {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--t-meta);
  font-weight: 600;
  flex-shrink: 0;
}
.step__num--active { background: var(--accent); color: var(--on-accent); }
.step__num--pending { background: transparent; color: var(--faint); border: 2px solid var(--line); }
.step__label { font-size: var(--t-meta); font-weight: 600; }
.step__label--pending { color: var(--dim); font-weight: 400; }
.steps__line { width: 36px; height: 2px; background: var(--line); }

/* ── 25. Cookie notice ── */
#cookieBanner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9999;
  background: var(--ink);
  color: rgba(255,255,255,.75);
  padding: var(--s-3) var(--s-6);
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  flex-wrap: wrap;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: var(--t-meta);
}
#cookieBanner a { color: var(--hot-ink); }

/* ── 26. Admin ── */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
  margin-bottom: var(--s-6);
}
.admin-stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: var(--s-4);
}
.admin-stat__label { font-family: var(--font-mono); font-size: var(--t-label); text-transform: uppercase; letter-spacing: var(--t-label-ls); color: var(--dim); margin-bottom: var(--s-1); }
.admin-stat__value { font-size: var(--t-h2); font-weight: 600; font-variant-numeric: tabular-nums; }
.admin-table { width: 100%; border-collapse: collapse; font-size: var(--t-body); }
.admin-table th {
  font-family: var(--font-mono);
  font-size: var(--t-label);
  letter-spacing: var(--t-label-ls);
  text-transform: uppercase;
  color: var(--dim);
  padding: var(--s-2) var(--s-4);
  text-align: left;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  white-space: nowrap;
}
.admin-table td {
  padding: var(--s-2) var(--s-4);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.admin-table tbody tr:hover td { background: var(--bg); }

/* ── 27. Drag handle ── */
.drag-handle { cursor: grab; opacity: .3; transition: opacity var(--dur-fast); color: var(--dim); }
.drag-handle:hover { opacity: 1; }
.sortable-ghost { opacity: .4; }

/* ── 28. Utility classes ── */
.d-none { display: none !important; }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-block { display: block; }
.d-md-inline { display: none; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1; min-width: 0; }
.ml-auto { margin-left: auto; }
.shrink-0 { flex-shrink: 0; }
.gap-1 { gap: var(--s-1); }
.gap-2 { gap: var(--s-2); }
.gap-3 { gap: var(--s-3); }
.gap-4 { gap: var(--s-4); }
.mb-1 { margin-bottom: var(--s-1); }
.mb-2 { margin-bottom: var(--s-2); }
.mb-3 { margin-bottom: var(--s-3); }
.mb-4 { margin-bottom: var(--s-4); }
.mb-5 { margin-bottom: var(--s-5); }
.mb-6 { margin-bottom: var(--s-6); }
.mt-1 { margin-top: var(--s-1); }
.mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-4); }
.mt-5 { margin-top: var(--s-5); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--dim); }
.text-faint { color: var(--faint); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--hot-ink); }
.text-ok { color: var(--ok-ink); }
.text-sm { font-size: var(--t-meta); }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.t-label { font-family: var(--font-mono); font-size: var(--t-label); letter-spacing: var(--t-label-ls); text-transform: uppercase; color: var(--dim); }
.w-full { width: 100%; }
.nowrap { white-space: nowrap; }
hr { border: none; border-top: 1px solid var(--line); margin: var(--s-4) 0; }
small { font-size: var(--t-meta); }
code { font-family: var(--font-mono); font-size: 11.5px; background: var(--raised); padding: 1px 4px; border-radius: var(--r-1); }

/* ── 29. Responsive ── */
@media (min-width: 769px) {
  .d-md-inline { display: inline; }
}
@media (max-width: 768px) {
  /* Mobile nav */
  .topnav {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--nav-h);
    padding: 0 var(--s-4);
    position: relative;
    align-items: flex-start;
  }
  .topnav__logo { height: var(--nav-h); align-items: center; }
  .topnav__toggle { display: flex; align-items: center; height: var(--nav-h); }
  .topnav__links {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: var(--s-2) 0;
    gap: 0;
  }
  .topnav__right {
    display: none;
    flex-direction: row;
    flex-wrap: wrap;
    margin-left: 0;
    width: 100%;
    padding: var(--s-2) 0 var(--s-3);
    border-top: 1px solid rgba(255,255,255,.08);
  }
  .topnav.is-open .topnav__links,
  .topnav.is-open .topnav__right { display: flex; }
  .topnav__link { width: 100%; padding: var(--s-2) var(--s-3); }
  .monitors-grid { grid-template-columns: 1fr; }
  .admin-stats { grid-template-columns: 1fr; }
  .page { padding: var(--s-4); }
  .data__comment, .data__posted { display: none; }
  .filter-strip .d-md-inline { display: none; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .monitors-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ── 30. (pub-nav merged into .topnav) ── */

/* ── 31. Policy pages (terms, privacy) ── */
.policy-wrap { max-width: 720px; margin: 0 auto; padding: var(--s-10) var(--s-6); }
.policy-wrap h1 { font-size: var(--t-h1); font-weight: 600; letter-spacing: var(--t-h1-ls); margin-bottom: var(--s-1); }
.policy-wrap .last-updated { font-size: var(--t-meta); color: var(--faint); margin-bottom: var(--s-6); }
.policy-body h2 { font-size: var(--t-h3); font-weight: 600; margin-top: var(--s-6); margin-bottom: var(--s-2); }
.policy-body p { font-size: var(--t-body); line-height: 1.75; color: var(--dim); margin-bottom: var(--s-3); }
.policy-body ul, .policy-body ol { padding-left: var(--s-4); margin-bottom: var(--s-3); }
.policy-body li { font-size: var(--t-body); line-height: 1.75; color: var(--dim); margin-bottom: var(--s-1); }
.policy-body a { color: var(--accent); }
.policy-footer { text-align: center; font-size: var(--t-meta); color: var(--faint); padding: var(--s-6) 0; }
.policy-footer a { color: var(--faint); }
.policy-footer a:hover { color: var(--dim); }

/* ── 32. FAQ accordion ── */
.faq-wrap { max-width: 720px; margin: 0 auto; padding: var(--s-10) var(--s-6); }
.faq-section { margin-bottom: var(--s-8); }
.faq-section__label {
  font-family: var(--font-mono);
  font-size: var(--t-label);
  letter-spacing: var(--t-label-ls);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--s-3);
}
.faq__item {
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  margin-bottom: 4px;
  overflow: hidden;
}
.faq__btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--s-4);
  font-size: var(--t-body);
  font-weight: 600;
  color: var(--ink);
  background: var(--panel);
  border: none;
  text-align: left;
  cursor: pointer;
  gap: var(--s-3);
  font-family: inherit;
  transition: background var(--dur-fast) var(--ease);
}
.faq__btn:hover { background: var(--raised); }
.faq__btn i { flex-shrink: 0; color: var(--faint); transition: transform var(--dur-base) var(--ease); font-size: .8rem; }
.faq__item.is-open .faq__btn { color: var(--accent); background: var(--accent-soft); }
.faq__item.is-open .faq__btn i { transform: rotate(180deg); color: var(--accent); }
.faq__body { display: none; padding: var(--s-4); border-top: 1px solid var(--line); background: var(--panel); }
.faq__item.is-open .faq__body { display: block; }
.faq__body p, .faq__body li { font-size: var(--t-body); line-height: 1.75; color: var(--dim); }
.faq__body ul, .faq__body ol { padding-left: var(--s-5); margin-top: var(--s-2); }
.faq__body li { margin-bottom: var(--s-1); }
.faq__body a { color: var(--accent); }
.faq__body code { font-family: var(--font-mono); font-size: 12px; background: var(--raised); padding: 1px 5px; border-radius: var(--r-1); }

/* ── 33. Error pages ── */
.err-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: var(--s-8) var(--s-4);
  text-align: center;
}
.err-page__code {
  font-size: 5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--line-strong);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}
.err-page__title { font-size: var(--t-h2); font-weight: 600; margin: var(--s-2) 0; }
.err-page__sub { color: var(--dim); margin-bottom: var(--s-6); max-width: 380px; }

/* ── 34. Public page layout ── */
.pub-page {
  flex: 1;
  background: var(--bg);
}
.pub-footer {
  background: var(--ink);
  padding: var(--s-3) var(--s-6);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-5);
  flex-wrap: wrap;
}
.pub-footer a { font-size: var(--t-meta); color: rgba(255,255,255,.35); text-decoration: none; }
.pub-footer a:hover { color: rgba(255,255,255,.7); }

/* ── 35. Billing toggle switch ── */
.billing-switch {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  padding: 6px 18px;
}
.billing-switch__opt {
  font-size: .9rem;
  font-weight: 600;
  color: var(--faint);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease);
  user-select: none;
}
.billing-switch__opt.is-active { color: var(--ink); }
.billing-switch__opt .save-badge {
  color: var(--accent);
  font-size: .72rem;
  font-weight: 700;
  margin-left: 3px;
}
.billing-switch__knob {
  width: 40px;
  height: 22px;
  background: var(--line-strong);
  border: none;
  border-radius: var(--r-full);
  position: relative;
  cursor: pointer;
  transition: background var(--dur-base) var(--ease);
  flex-shrink: 0;
  padding: 0;
}
.billing-switch__knob::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 3px;
  left: 3px;
  background: var(--panel);
  border-radius: 50%;
  transition: transform var(--dur-base) var(--ease);
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.billing-switch__knob.is-on { background: var(--accent); }
.billing-switch__knob.is-on::after { transform: translateX(18px); }
.billing-switch__knob:focus-visible { box-shadow: var(--ring); outline: none; }

/* ── 36. Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
