/* ------ Design tokens ------
 * Masterclass brand: red primary, navy surfaces, Bricolage Grotesque for
 * display type and Inter for body. Every colour, type size, radius, shadow
 * and duration used below (and in template inline styles) comes from here.
 */
:root {
  /* Colour roles */
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-sunken: #f1f3f6;
  --border: #e5e7eb;
  --border-strong: #cfd4dc;
  --text: #111827;
  --heading: #0b1f4b;
  --text-body: #374151;
  --text-muted: #5b6478;
  --text-subtle: #94a3b8;
  --primary: #cf2a1e;
  --primary-rgb: 207 42 30;
  --primary-hover: #a61e14;
  --primary-soft: #fdeeec;
  --primary-fg: #ffffff;
  --navy: #0b1f4b;
  --navy-rgb: 11 31 75;
  --navy-700: #16306b;
  --navy-soft: #e8ecf6;
  --on-navy: #f5f7fb;
  --on-navy-muted: #b4bfd6;
  --success: #15803d;
  --success-strong: #166534;
  --success-soft: #ecfdf3;
  --success-border: #a7e8c0;
  --warning: #d97706;
  --warning-strong: #92400e;
  --warning-soft: #fff8e6;
  --warning-border: #fbdf9a;
  --danger: #dc2626;
  --danger-strong: #991b1b;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;
  --info: #1e3a8a;
  --info-soft: #e8eefb;
  --info-border: #bccbee;
  --focus-ring: #1d4ed8;

  /* Type */
  --font-display: "Bricolage Grotesque Variable", "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Inter Variable", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-12: 0.75rem;
  --fs-14: 0.875rem;
  --fs-16: 1rem;
  --fs-18: 1.125rem;
  --fs-20: 1.25rem;
  --fs-24: 1.5rem;
  --fs-30: 1.875rem;
  --fs-36: 2.25rem;
  --fs-48: 3rem;

  /* Spacing (4-pt scale) */
  --sp-4: 4px;
  --sp-8: 8px;
  --sp-12: 12px;
  --sp-16: 16px;
  --sp-24: 24px;
  --sp-32: 32px;
  --sp-48: 48px;
  --sp-64: 64px;
  --sp-96: 96px;

  /* Shape, elevation, motion */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgb(var(--navy-rgb) / 0.06);
  --shadow-md: 0 8px 24px -8px rgb(var(--navy-rgb) / 0.16);
  --shadow-lg: 0 24px 48px -16px rgb(var(--navy-rgb) / 0.32);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 320ms;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --container: 1200px;
  --logo-chip: transparent;
  color-scheme: light;
}

/* Dark theme. Applied when the visitor picks it (data-theme="dark"), or when
   the OS asks for dark and no explicit choice is stored. Only tokens change. */
:root[data-theme="dark"] {
  --bg: #0a1020;
  --surface: #121a2e;
  --surface-sunken: #1a243b;
  --border: #26324d;
  --border-strong: #3a4868;
  --text: #f1f4fa;
  --heading: #f5f7fb;
  --text-body: #d3dae8;
  --text-muted: #a3aec4;
  --text-subtle: #7483a0;
  --primary: #e5483c;
  --primary-rgb: 229 72 60;
  --primary-hover: #f0685d;
  --primary-soft: #3a1714;
  --navy: #1b2c57;
  --navy-rgb: 0 0 0;
  --navy-700: #24386b;
  --navy-soft: #1e2a47;
  --success: #4ade80;
  --success-strong: #86efac;
  --success-soft: #0f2a1c;
  --success-border: #1f5a39;
  --warning: #fbbf24;
  --warning-strong: #fcd34d;
  --warning-soft: #2e2208;
  --warning-border: #6b4e0f;
  --danger: #f87171;
  --danger-strong: #fca5a5;
  --danger-soft: #331416;
  --danger-border: #6e2327;
  --info: #a5b8f0;
  --info-soft: #1a2547;
  --info-border: #34457a;
  --focus-ring: #8fb0ff;
  --logo-chip: #f5f7fb;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1020;
    --surface: #121a2e;
    --surface-sunken: #1a243b;
    --border: #26324d;
    --border-strong: #3a4868;
    --text: #f1f4fa;
    --heading: #f5f7fb;
    --text-body: #d3dae8;
    --text-muted: #a3aec4;
    --text-subtle: #7483a0;
    --primary: #e5483c;
    --primary-rgb: 229 72 60;
    --primary-hover: #f0685d;
    --primary-soft: #3a1714;
    --navy: #1b2c57;
    --navy-rgb: 0 0 0;
    --navy-700: #24386b;
    --navy-soft: #1e2a47;
    --success: #4ade80;
    --success-strong: #86efac;
    --success-soft: #0f2a1c;
    --success-border: #1f5a39;
    --warning: #fbbf24;
    --warning-strong: #fcd34d;
    --warning-soft: #2e2208;
    --warning-border: #6b4e0f;
    --danger: #f87171;
    --danger-strong: #fca5a5;
    --danger-soft: #331416;
    --danger-border: #6e2327;
    --info: #a5b8f0;
    --info-soft: #1a2547;
    --info-border: #34457a;
    --focus-ring: #8fb0ff;
    --logo-chip: #f5f7fb;
    color-scheme: dark;
  }
}

/* ------ Reset / base ------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-16);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  overflow-x: clip;
}
/* The admin console is data-dense; it keeps a smaller base size. */
body.admin-body { font-size: var(--fs-14); }
h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--heading);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
button, input, select, textarea { font-family: inherit; }
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ------ Admin Sidebar Layout ------ */

/* Full-height flex canvas */
.admin-body {
  min-height: 100vh;
  overflow: hidden;
}

.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ── */
.admin-sidebar {
  width: 248px;
  min-width: 248px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  flex-shrink: 0;
  transition: width 0.22s ease, min-width 0.22s ease;
  z-index: 100;
}

/* Brand block */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px 18px;

  flex-shrink: 0;
}
.sidebar-brand-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}
.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-brand-name {
  font-family: var(--font-display);
  font-size: var(--fs-16);
  font-weight: 700;
  color: var(--heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.sidebar-brand-sub {
  font-size: var(--fs-12);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
  letter-spacing: 0;
}

/* Nav section */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: var(--sp-8) var(--sp-12) var(--sp-4);
  flex: 1 0 auto;
}
.sidebar-nav-label {
  font-size: var(--fs-12);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  padding: var(--sp-8) var(--sp-12) var(--sp-4);
  display: block;
}

/* Nav item */
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: var(--sp-8) var(--sp-12);
  border-radius: var(--radius-sm);
  color: var(--text-body);
  font-size: var(--fs-14);
  font-weight: 500;
  text-decoration: none;
  transition: background 0.14s, color 0.14s;
  position: relative;
  margin-bottom: 2px;
  cursor: pointer;
}
.sidebar-nav-item i {
  font-size: var(--fs-16);
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}
.sidebar-nav-item span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-nav-item:hover {
  background: var(--surface-sunken);
  color: var(--heading);
  text-decoration: none;
}
.sidebar-nav-item.active {
  background: var(--navy);
  color: var(--on-navy);
}
.sidebar-nav-item.active i {
  color: var(--on-navy);
}

/* Error badge on sidebar nav item */
.sidebar-error-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--danger);
  color: var(--primary-fg);
  font-size: var(--fs-12);
  font-weight: 700;
  margin-left: auto;
  flex-shrink: 0;
  line-height: 1;
}

/* External link subtle indicator */
.sidebar-ext-icon {
  font-size: 10px !important;
  width: auto !important;
  margin-left: auto;
  opacity: 0.5;
  flex-shrink: 0;
}

/* Footer nav (health + external tools) */
.sidebar-footer {
  padding: var(--sp-8) var(--sp-12) var(--sp-12);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── CSS-only sidebar collapse ── */
.sidebar-toggle-input {
  display: none;
}

/* ── Content area ── */
.admin-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  overflow-y: auto;
  height: 100vh;
}

/* Mobile topbar (hamburger + title) */
.admin-topbar {
  display: flex;
  min-height: 56px;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  padding: var(--sp-8) var(--sp-24);
  position: sticky;
  top: 0;
  z-index: 50;
}
.sidebar-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-body);
  font-size: var(--fs-24);
  flex-shrink: 0;
  transition: background 0.12s;
}
.sidebar-hamburger:hover { background: var(--surface-sunken); }
.admin-topbar-title {
  font-family: var(--font-display);
  font-size: var(--fs-16);
  font-weight: 600;
  color: var(--heading);
}

/* ── Layout ── */
/* The page sits on a white rounded panel over the tinted canvas. */
.admin-content > main {
  flex: 1;
  margin: 0 var(--sp-16) var(--sp-16);
  padding: var(--sp-24);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.admin-topbar__user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  min-width: 0;
}
.admin-topbar__email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-muted);
}
.admin-topbar__user form { margin: 0; }

/* ── Responsive: collapse sidebar on small screens ── */
@media (max-width: 768px) {
  .admin-topbar { padding: var(--sp-8) var(--sp-12); }
  .admin-topbar__email, .admin-topbar-title { display: none; }
  .sidebar-hamburger { display: flex; }
  .admin-content > main { margin: 0 var(--sp-8) var(--sp-8); padding: var(--sp-16); border-radius: var(--radius-md); }
  .admin-sidebar {
    position: fixed;
    left: -248px;
    top: 0;
    height: 100vh;
    transition: left 0.22s ease;
    z-index: 200;
  }
  /* When toggle checkbox is checked, slide sidebar in */
  .sidebar-toggle-input:checked ~ .admin-layout .admin-sidebar {
    left: 0;
  }
  /* Overlay backdrop */
  .sidebar-toggle-input:checked ~ .admin-layout::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 150;
  }
  .admin-content {
    height: auto;
    min-height: 100vh;
  }
}

h1 { font-size: var(--fs-24); margin: 0 0 var(--sp-16); }
h2 { font-size: var(--fs-18); margin: var(--sp-24) 0 var(--sp-12); }

/* ------ Admin Flash Toasts ------ */
.admin-flashes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.admin-toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-14);
  font-weight: 500;
  border: 1px solid transparent;
  animation: toast-slidein 0.25s ease-out;
}
@keyframes toast-slidein {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.admin-toast i { font-size: var(--fs-16); flex-shrink: 0; }
.admin-toast-success {
  background: var(--success-soft);
  border-color: var(--success-border);
  color: var(--success-strong);
}
.admin-toast-success i { color: var(--success); }
.admin-toast-error {
  background: var(--danger-soft);
  border-color: var(--danger-border);
  color: var(--danger-strong);
}
.admin-toast-error i { color: var(--danger); }
.admin-toast-warning {
  background: var(--warning-soft);
  border-color: var(--warning-border);
  color: var(--warning-strong);
}
.admin-toast-warning i { color: var(--warning); }
.admin-toast-info {
  background: var(--primary-soft);
  border-color: var(--info-border);
  color: var(--info);
}
.admin-toast-info i { color: var(--primary); }

/* ------ Analytics period selector ------ */
.analytics-period-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.analytics-period-pills {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.period-pill {
  display: inline-block;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-14);
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface-sunken);
  text-decoration: none;
  transition: all 0.12s;
  border: 1px solid transparent;
}
.period-pill:hover {
  background: var(--primary-soft);
  color: var(--primary);
  text-decoration: none;
}
.period-pill.active {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary-hover);
}
.analytics-custom-range {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ------ Analytics section label ------ */
.analytics-section-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: var(--fs-14);
  font-weight: 700;
  color: var(--text-body);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  margin-top: 4px;
}
.analytics-section-label i {
  font-size: var(--fs-16);
  color: var(--primary);
}

/* ------ Page header ------ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

/* ------ Subscriber detail layout ------ */
.sub-detail-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 960px) {
  .sub-detail-layout {
    grid-template-columns: 1fr;
  }
  .sub-detail-actions {
    order: -1;
  }
}

.sub-detail-main {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sub-detail-actions {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Subscriber avatar circle */
.sub-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--navy) 100%);
  color: var(--primary-fg);
  font-size: var(--fs-20);
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: 0;
}

/* Action group within the actions card */
.action-group {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--surface-sunken);
}
.action-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.action-group-label {
  font-size: var(--fs-12);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-subtle);
  margin-bottom: 8px;
}

/* Action button */
.action-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-body);
  border-radius: var(--radius-sm);
  font-size: var(--fs-14);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, border-color 0.12s;
}
.action-btn:last-child { margin-bottom: 0; }
.action-btn i { font-size: var(--fs-14); color: var(--text-muted); flex-shrink: 0; }
.action-btn:hover {
  background: var(--bg);
  border-color: var(--border-strong);
  text-decoration: none;
}
.action-btn.danger {
  color: var(--danger);
  border-color: var(--danger-border);
}
.action-btn.danger i { color: var(--danger); }
.action-btn.danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
}

/* Deleted row in subscribers table */
tr.row-deleted td {
  opacity: 0.55;
  background: var(--danger-soft);
}

/* ------ Cards ------ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--sp-24);
  margin-bottom: var(--sp-16);
}
@media (max-width: 640px) {
  .card { padding: var(--sp-16); }
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.stat {
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: var(--sp-16);
}
.stat .label { color: var(--text-muted); font-size: var(--fs-12); text-transform: uppercase; letter-spacing: 0.5px; }
.stat .value { font-family: var(--font-display); font-size: var(--fs-30); font-weight: 700; line-height: 1.2; color: var(--text); margin-top: 4px; }
.stat.warn .value { color: var(--warning-strong); }
.stat.bad  .value { color: var(--danger-strong); }
.stat.ok   .value { color: var(--success); }
.stat.relevant {
  border-color: var(--success-border);
  background: var(--success-soft);
}
.stat.relevant .label { color: var(--success); font-weight: 600; }
.stat.relevant .value { color: var(--success-strong); }
.stat .sub { margin-top: 4px; font-size: var(--fs-12); }

/* Relevant row highlight on the tenders list */
tr.row-relevant td { background: var(--success-soft); }
tr.row-relevant:hover td { background: var(--success-soft); }

/* Inline toggle for "Only relevant" filter */
.filter-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 5px 10px; font-size: var(--fs-14); cursor: pointer;
}
.filter-toggle:has(input:checked) {
  background: var(--success-soft); border-color: var(--success-border); color: var(--success-strong);
}

/* ------ Tables ------ */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--surface-sunken);
  vertical-align: top;
}
th {
  background: var(--bg);
  font-weight: 600;
  font-size: var(--fs-12);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-body);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }
/* Wide tables scroll inside themselves on small screens so the page never does. */
@media (max-width: 900px) {
  table { position: relative; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ------ Badges ------ */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-12);
  font-weight: 600;
  background: var(--border);
  color: var(--text-body);
}
.badge.active   { background: var(--success-soft); color: var(--success-strong); }
.badge.expired  { background: var(--danger-soft); color: var(--danger-strong); }
.badge.pending  { background: var(--warning-soft); color: var(--warning-strong); }
.badge.processed{ background: var(--info-soft); color: var(--info); }
.badge.failed   { background: var(--danger-soft); color: var(--danger-strong); }
.badge.success  { background: var(--success-soft); color: var(--success-strong); }
.badge.partial  { background: var(--warning-soft); color: var(--warning-strong); }
.badge.running  { background: var(--primary-soft); color: var(--info); }
.badge.sector   { background: var(--navy-soft); color: var(--navy); }
.badge.relevant     { background: var(--success-soft); color: var(--success-strong); border: 1px solid var(--success-border); }
.badge.not-relevant { background: var(--surface-sunken); color: var(--text-muted); }

/* ------ Forms ------ */
form.inline { display: inline; }
input[type=text], input[type=search], input[type=email], input[type=number], select {
  min-height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: var(--sp-4) var(--sp-12);
  font-size: var(--fs-14);
  background: var(--surface);
  color: var(--text);
}
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  min-height: 36px;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: var(--primary-fg);
  padding: var(--sp-4) var(--sp-16);
  border-radius: var(--radius-sm);
  font-size: var(--fs-14);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
button:hover, .btn:hover { background: var(--primary-hover); border-color: var(--primary-hover); text-decoration: none; }
button:disabled, .btn[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; }
button.secondary, .btn.secondary {
  background: var(--surface);
  color: var(--heading);
  border-color: var(--border-strong);
}
button.secondary:hover, .btn.secondary:hover { background: var(--surface-sunken); border-color: var(--text-subtle); }
button.danger { background: var(--danger-strong); border-color: var(--danger-strong); }

/* ------ Filter bar ------ */
.filters {
  display: flex;
  gap: var(--sp-8);
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: var(--sp-12);
}
.filters--panel {
  padding: var(--sp-16);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.filters--panel input[type=text], .filters--panel input[type=search] { flex: 1 1 280px; }
@media (max-width: 640px) {
  /* 16px inputs stop iOS zooming the page on focus. */
  .filters input[type=text], .filters input[type=search], .filters select, .filters button {
    flex: 1 1 100%;
    min-height: 44px;
    font-size: var(--fs-16);
  }
}

/* ------ Pagination ------ */
.pager {
  margin-top: 16px;
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-14);
}
.pager a, .pager span {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: var(--sp-4) var(--sp-12);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.pager .current { background: var(--navy); color: var(--on-navy); border-color: var(--navy); }

/* ------ Misc ------ */
.muted { color: var(--text-muted); }
.tag {
  display: inline-block;
  background: var(--surface-sunken);
  color: var(--text-body);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-12);
  margin-right: 4px;
}
.kv { display: grid; grid-template-columns: 220px 1fr; gap: 6px 16px; }
@media (max-width: 640px) {
  .kv { grid-template-columns: 1fr; gap: 0 0; }
  .kv .k { margin-top: var(--sp-12); font-size: var(--fs-12); }
}
.kv .k { color: var(--text-muted); }
pre.raw {
  background: var(--navy);
  color: var(--on-navy);
  padding: 12px;
  border-radius: var(--radius-sm);
  overflow: auto;
  font-size: var(--fs-12);
  max-height: 320px;
}
.title-trunc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ------ Live run status ------ */
.run-status {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left-width: 4px;
  background: var(--surface);
}
.run-status.idle    { border-left-color: var(--text-subtle); background: var(--bg); }
.run-status.running { border-left-color: var(--warning); background: var(--warning-soft); }
.run-status.success { border-left-color: var(--success); background: var(--success-soft); }
.run-status.partial { border-left-color: var(--warning); background: var(--warning-soft); }
.run-status.failed  { border-left-color: var(--danger); background: var(--danger-soft); }
.run-status-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px; font-size: var(--fs-14);
}
.run-status-body {
  font-size: var(--fs-14); color: var(--text-body);
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.run-status-body .metric { white-space: nowrap; }
.run-status-body .metric b { color: var(--heading); }
.run-status-body .metric.bad b { color: var(--danger-strong); }
.run-status-body .sep { color: var(--on-navy); }
.run-status-notes {
  margin-top: 8px; font-size: var(--fs-12);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-word;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--warning);
  border-top-color: transparent;
  border-radius: 50%;
  animation: mts-spin 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes mts-spin {
  to { transform: rotate(360deg); }
}

/* Status dot */
.dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text-subtle);
}
.dot.ok   { background: var(--success); }
.dot.warn { background: var(--warning); }
.dot.bad  { background: var(--danger); }

/* Flash message */
.flash {
  background: var(--success-soft);
  color: var(--success-strong);
  border: 1px solid var(--success-border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 10px;
  font-size: var(--fs-14);
  animation: mts-fadein 0.25s ease-in;
}
@keyframes mts-fadein {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ====== Interests Hub (Account Dashboard) ====== */

.interests-hub {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  max-width: 1120px;
  margin: 0 auto;
  align-items: start;
}
@media (max-width: 860px) {
  .interests-hub {
    grid-template-columns: 1fr;
  }
  .settings-rail { order: -1; }
}

/* -- Main column -- */
.interests-main {}

.interests-greeting {
  margin: 0 0 6px;
  font-size: var(--fs-24);
  font-weight: 700;
  color: var(--text);
}
.interests-subtext {
  margin: 0 0 24px;
  font-size: var(--fs-14);
  color: var(--text-muted);
  line-height: 1.5;
}

/* Add-interest tile — thinner, flatter, Linear-style restraint */
.add-interest-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  margin-bottom: 20px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--primary);
  font-size: var(--fs-14);
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.add-interest-tile:hover {
  background: var(--bg);
  border-color: var(--text-subtle);
  text-decoration: none;
}
.add-interest-tile .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  background: transparent;
  font-size: var(--fs-14);
  font-weight: 700;
  line-height: 1;
}

/* Interest card — thin border, no shadow at rest */
.interest-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 10px;
  transition: border-color .15s;
}
.interest-card:hover {
  border-color: var(--border-strong);
}
.interest-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.interest-card-name {
  font-size: var(--fs-18);
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
.interest-card-summary {
  font-size: var(--fs-14);
  color: var(--text-muted);
  margin: 4px 0 0;
  line-height: 1.5;
}

/* Status pill — Linear-style: dot + plain text, no colored background */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border-radius: 0;
  font-size: var(--fs-12);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--text-body);
  background: none;
}
.status-pill::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-pill.active::before {
  background: var(--success);
}
.status-pill.paused::before {
  background: var(--warning);
}
.status-pill.trialing::before,
.status-pill.canceled::before {
  background: var(--text-subtle);
}

/* Chip row — muted gray tags instead of colored pills */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.chip {
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-12);
  font-weight: 500;
  white-space: nowrap;
  background: var(--surface-sunken);
  color: var(--text-body);
  border: 1px solid var(--border);
}
.chip.sector,
.chip.keyword,
.chip.closing {
  background: var(--surface-sunken);
  color: var(--text-body);
}

/* Action row */
.interest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--surface-sunken);
}
.interest-actions a,
.interest-actions button {
  font-size: var(--fs-12);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-body);
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s;
}
.interest-actions a:hover,
.interest-actions button:hover {
  background: var(--surface-sunken);
  text-decoration: none;
}
.interest-actions .btn-preview {
  border-color: var(--primary);
  color: var(--primary);
}
.interest-actions .btn-delete {
  border-color: var(--danger-border);
  color: var(--danger);
}
.interest-actions .btn-delete:hover {
  background: var(--danger-soft);
}

/* Empty state */
.interests-empty {
  text-align: center;
  padding: 48px 24px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}
.interests-empty-icon {
  font-size: var(--fs-30);
  margin-bottom: 14px;
  color: var(--text-subtle);
}
.interests-empty h3 {
  font-size: var(--fs-18);
  color: var(--text);
  margin: 0 0 8px;
}
.interests-empty p {
  font-size: var(--fs-14);
  color: var(--text-muted);
  margin: 0 0 20px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}
.interests-empty .steps {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin: 24px 0;
  flex-wrap: wrap;
}
.interests-empty .step {
  text-align: center;
  max-width: 140px;
}
.interests-empty .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  font-size: var(--fs-14);
  font-weight: 700;
  margin-bottom: 8px;
}
.interests-empty .step-label {
  font-size: var(--fs-14);
  color: var(--text-body);
  line-height: 1.4;
}

/* -- Settings rail (sidebar) -- */
.settings-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}
.settings-card-title {
  font-size: var(--fs-12);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  font-weight: 700;
  margin: 0 0 10px;
}
.settings-card p {
  margin: 0;
  font-size: var(--fs-14);
  color: var(--text);
}
.settings-card .meta {
  font-size: var(--fs-12);
  color: var(--text-muted);
  margin-top: 4px;
}
.settings-card .coming-soon {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  color: var(--text-subtle);
  font-size: var(--fs-12);
  font-weight: 600;
}

/* Status line: small dot + label, Linear-style (replaces icon+text rows) */
.status-line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: var(--fs-14);
  color: var(--text-body);
}
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot--ok    { background: var(--success); }
.status-dot--warn  { background: var(--warning); }
.status-dot--muted { background: var(--border-strong); }

/* Account sidebar nav — flat list items, no fill/pill backgrounds */
.account-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 12px;
}
.account-nav__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--primary);
  font-size: var(--fs-14);
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  transition: background .12s, color .12s;
}
.account-nav__item:hover {
  background: var(--primary-soft);
  text-decoration: none;
  color: var(--primary-hover);
}
.account-nav__item i {
  color: var(--primary);
  font-size: var(--fs-14);
  width: 16px;
  text-align: center;
}
.account-nav__item:hover i {
  color: var(--primary-hover);
}
.account-nav__item--admin {
  color: var(--warning-strong);
}
.account-nav__item--admin i {
  color: var(--warning);
}
.account-nav__item--admin:hover {
  background: var(--warning-soft);
  color: var(--warning-strong);
}

/* Danger zone in rail */
.settings-danger {
  border-color: var(--danger-border);
}
.settings-danger summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--danger);
  font-size: var(--fs-14);
}

/* ====== Guided Form (New / Edit Interest) ====== */

.guided-shell {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  max-width: 1040px;
  margin: 0 auto;
  align-items: start;
}
@media (max-width: 800px) {
  .guided-shell {
    grid-template-columns: 1fr;
  }
}

.guided-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 32px;
}
.guided-form .back-link {
  display: inline-block;
  color: var(--primary);
  text-decoration: none;
  font-size: var(--fs-14);
  margin-bottom: 20px;
}
.guided-form .back-link:hover { text-decoration: underline; }

.guided-form h1 {
  font-size: var(--fs-24);
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}
.guided-form .form-subtitle {
  font-size: var(--fs-14);
  color: var(--text-muted);
  margin: 0 0 28px;
}

/* Form sections */
.form-section {
  margin-bottom: 28px;
}
.form-section-title {
  font-size: var(--fs-16);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
}
.form-section-hint {
  font-size: var(--fs-14);
  color: var(--text-subtle);
  margin: 0 0 12px;
}

/* Sector chips grid */
.sector-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sector-chip {
  position: relative;
}
.sector-chip input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.sector-chip label {
  display: inline-block;
  padding: 7px 16px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  font-size: var(--fs-14);
  color: var(--text-body);
  cursor: pointer;
  transition: all .12s;
  user-select: none;
}
.sector-chip label:hover {
  border-color: var(--info-border);
  background: var(--primary-soft);
}
.sector-chip input:checked + label {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
  font-weight: 500;
}
.sector-chip.locked label {
  opacity: 0.4;
  cursor: not-allowed;
  border-color: var(--border);
  background: var(--bg);
}
.sector-chip.locked label:hover {
  border-color: var(--border);
  background: var(--bg);
}
.limit-hint {
  margin-top: 8px;
  font-size: var(--fs-12);
  color: var(--text-subtle);
}
.limit-hint.at-limit {
  color: var(--warning);
  font-weight: 500;
}

/* Text input field */
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: var(--fs-14);
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  box-sizing: border-box;
  transition: border-color .12s;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(var(--primary-rgb) / 0.1);
}
.form-input::placeholder { color: var(--text-subtle); }

/* Closing-date radios */
.closing-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.closing-option {
  position: relative;
}
.closing-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.closing-option label {
  display: inline-block;
  padding: 7px 16px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  font-size: var(--fs-14);
  color: var(--text-body);
  cursor: pointer;
  transition: all .12s;
  user-select: none;
}
.closing-option label:hover {
  border-color: var(--info-border);
  background: var(--primary-soft);
}
.closing-option input:checked + label {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
  font-weight: 500;
}

/* Custom days input (shown/hidden by JS) */
.custom-days-input {
  display: none;
  margin-top: 10px;
  max-width: 160px;
}
.custom-days-input.visible {
  display: flex;
  align-items: center;
  gap: 8px;
}
.custom-days-input input {
  width: 70px;
  padding: 7px 10px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: var(--fs-14);
  text-align: center;
}
.custom-days-input span {
  font-size: var(--fs-14);
  color: var(--text-muted);
}

/* Notify toggle */
.notify-toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.notify-toggle input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}
.notify-toggle-text {
  font-size: var(--fs-14);
  font-weight: 500;
  color: var(--text);
}
.notify-toggle-hint {
  font-size: var(--fs-12);
  color: var(--text-subtle);
  margin-top: 2px;
}

/* Form buttons */
.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 8px;
}
.form-actions .btn-primary {
  padding: 10px 24px;
  background: var(--primary);
  color: var(--primary-fg);
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--fs-14);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.form-actions .btn-primary:hover { background: var(--primary-hover); }
.form-actions .btn-cancel {
  padding: 10px 20px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: var(--fs-14);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
}
.form-actions .btn-cancel:hover {
  background: var(--bg);
  text-decoration: none;
}

/* Sticky preview sidebar */
.form-preview {
  position: sticky;
  top: 24px;
}
.preview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}
.preview-card h3 {
  font-size: var(--fs-14);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 700;
  margin: 0 0 12px;
}
.preview-card .preview-name {
  font-size: var(--fs-16);
  font-weight: 600;
  color: var(--text);
  margin: 0 0 10px;
}
.preview-card .preview-summary {
  font-size: var(--fs-14);
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 14px;
}
.preview-card .preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 14px;
}
.preview-card .preview-footer {
  font-size: var(--fs-12);
  color: var(--text-subtle);
  padding-top: 12px;
  border-top: 1px solid var(--surface-sunken);
}

/* Tips card — flat/muted, matching the preview card's restraint */
.tips-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-top: 14px;
}
.tips-card h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-14);
  font-weight: 700;
  color: var(--text-muted);
  margin: 0 0 10px;
}
.tips-card h3 i {
  color: var(--warning);
  font-size: var(--fs-14);
}
.tips-card ul {
  margin: 0;
  padding: 0 0 0 18px;
  font-size: var(--fs-12);
  color: var(--text-body);
  line-height: 1.6;
}

/* ====== Auth Pages (Login / Signup / Forgot / Reset) ====== */

.auth-shell {
  display: grid;
  grid-template-columns: 1fr 380px;
  min-height: calc(100vh - 80px);
  max-width: 1080px;
  margin: -24px auto 0;
}
@media (max-width: 800px) {
  .auth-shell {
    grid-template-columns: 1fr;
    min-height: auto;
    margin-top: 0;
  }
  .auth-brand-panel { display: none; }
}

/* Left side: the form */
.auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
}
.auth-form-card {
  width: 100%;
  max-width: 420px;
}
.auth-form-card h1 {
  font-size: var(--fs-24);
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
}
.auth-form-card .auth-subtitle {
  font-size: var(--fs-14);
  color: var(--text-muted);
  margin: 0 0 24px;
  line-height: 1.5;
}
.auth-form-card form {
  margin: 0;
}
.auth-form-card .form-group {
  margin-bottom: 16px;
}
.auth-form-card .form-group label {
  display: block;
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--text-body);
  margin-bottom: 5px;
}
.auth-form-card .form-group .field-error {
  color: var(--danger);
  font-size: var(--fs-12);
  margin-top: 4px;
}
.auth-form-card .auth-submit {
  width: 100%;
  padding: 11px 16px;
  background: var(--primary);
  color: var(--primary-fg);
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--fs-14);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  margin-top: 4px;
  transition: background .12s;
}
.auth-form-card .auth-submit:hover {
  background: var(--primary-hover);
}
.auth-form-card .auth-links {
  margin-top: 20px;
  text-align: center;
  font-size: var(--fs-14);
  color: var(--text-muted);
}
.auth-form-card .auth-links a {
  color: var(--primary);
  font-weight: 500;
}

/* Right side: brand panel */
.auth-brand-panel {
  background: var(--navy);
  color: var(--on-navy);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 48px 36px;
  border-left: 1px solid rgba(255,255,255,0.06);
}
.auth-brand-panel h2 {
  font-size: var(--fs-20);
  font-weight: 700;
  color: var(--primary-fg);
  margin: 0 0 16px;
}
.auth-brand-panel .brand-tagline {
  font-size: var(--fs-14);
  color: var(--on-navy-muted);
  line-height: 1.6;
  margin: 0 0 28px;
}
.auth-brand-panel .brand-features {
  list-style: none;
  padding: 0;
  margin: 0;
}
.auth-brand-panel .brand-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
  font-size: var(--fs-14);
  color: var(--on-navy);
  line-height: 1.5;
}
.auth-brand-panel .brand-features .feat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: rgb(var(--primary-rgb) / 0.2);
  color: var(--primary);
  font-size: var(--fs-14);
  flex-shrink: 0;
}
.auth-brand-panel .brand-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font-size: var(--fs-12);
  color: var(--text-muted);
}

/* Auth confirmation pages (signup_sent, forgot_sent, verify_failed) */
.auth-confirm-card {
  width: 100%;
  max-width: 420px;
}
.auth-confirm-card h1 {
  font-size: var(--fs-24);
  font-weight: 700;
  color: var(--text);
  margin: 0 0 12px;
}
.auth-confirm-card p {
  font-size: var(--fs-14);
  color: var(--text-body);
  line-height: 1.6;
  margin: 0 0 12px;
}
.auth-confirm-card .muted-text {
  font-size: var(--fs-14);
  color: var(--text-muted);
  margin-top: 16px;
}
.auth-confirm-card .auth-links {
  margin-top: 20px;
  font-size: var(--fs-14);
}
.auth-confirm-card .auth-links a {
  color: var(--primary);
  font-weight: 500;
}

/* ====== Pricing Page ====== */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  max-width: 1080px;
}
.pricing-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s;
}
.pricing-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
}
.pricing-card.popular {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgb(var(--primary-rgb) / 0.15);
}
.pricing-card.current {
  border-color: var(--success);
  background: var(--success-soft);
}
.pricing-badge {
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: var(--primary-fg);
  padding: 3px 14px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-12);
  font-weight: 700;
  white-space: nowrap;
}
.pricing-badge.current-badge {
  background: var(--success);
}
.pricing-plan-name {
  font-size: var(--fs-18);
  font-weight: 700;
  color: var(--text);
  margin: 8px 0 16px;
  text-align: center;
}
.pricing-price {
  text-align: center;
  margin-bottom: 8px;
}
.pricing-price .price-currency {
  font-size: var(--fs-14);
  color: var(--text-muted);
  vertical-align: super;
}
.pricing-price .price-amount {
  font-size: var(--fs-36);
  font-weight: 800;
  color: var(--text);
}
.pricing-price .price-interval {
  font-size: var(--fs-14);
  color: var(--text-muted);
}
.pricing-trial {
  text-align: center;
  font-size: var(--fs-12);
  color: var(--primary);
  font-weight: 600;
  margin: 0 0 16px;
}
.pricing-features {
  list-style: none;
  padding: 0;
  margin: 16px 0 24px;
  flex: 1;
}
.pricing-features li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: var(--fs-14);
  color: var(--text-body);
}
.pricing-cta {
  text-align: center;
}
.pricing-btn {
  display: inline-block;
  width: 100%;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-14);
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background .12s;
  box-sizing: border-box;
}
.pricing-btn.upgrade-btn {
  background: var(--primary);
  color: var(--primary-fg);
  border: none;
}
.pricing-btn.upgrade-btn:hover {
  background: var(--primary-hover);
  text-decoration: none;
}
.pricing-btn.current-btn {
  background: var(--success-soft);
  color: var(--success-strong);
  border: 1.5px solid var(--success-border);
  cursor: default;
}
.pricing-btn.disabled-btn {
  background: var(--surface-sunken);
  color: var(--text-subtle);
  border: 1px solid var(--border);
  cursor: default;
}

/* ====== Billing Page ====== */

.billing-plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 28px;
}
.billing-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-14);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-body);
  font-family: inherit;
  transition: background .12s;
}
.billing-btn:hover { background: var(--surface-sunken); text-decoration: none; }
.billing-btn.primary {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
}
.billing-btn.primary:hover { background: var(--primary-hover); }
.billing-btn.danger {
  color: var(--danger);
  border-color: var(--danger-border);
}
.billing-btn.danger:hover { background: var(--danger-soft); }

/* Status pill for subscription statuses */
.status-pill.trialing {
  background: var(--info-soft);
  color: var(--info);
}
.status-pill.trialing::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
}
.status-pill.cancelled {
  background: var(--surface-sunken);
  color: var(--text-muted);
}
.status-pill.cancelled::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-subtle);
}
.status-pill.past_due {
  background: var(--danger-soft);
  color: var(--danger-strong);
}
.status-pill.past_due::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--danger);
}

/* ====== Public / account shell: header, main container, footer ====== */
.skip-link {
  position: absolute;
  left: var(--sp-16);
  top: -64px;
  z-index: 300;
  padding: var(--sp-8) var(--sp-16);
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: var(--on-navy);
  font-weight: 600;
}
.skip-link:focus { top: var(--sp-8); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--sp-12) var(--sp-24);
  display: flex;
  align-items: center;
  gap: var(--sp-24);
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-12);
  color: var(--heading);
  flex-shrink: 0;
}
.site-brand:hover { text-decoration: none; }
.site-brand__mark, .sidebar-brand-icon img {
  display: block;
  width: 36px;
  height: 30px;
  /* The mark has a black letter; in dark mode it sits on a light chip. */
  border-radius: var(--radius-sm);
  background: var(--logo-chip);
}
.site-brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.site-brand__name {
  font-family: var(--font-display);
  font-size: var(--fs-18);
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.site-brand__by { font-size: var(--fs-12); color: var(--text-muted); }

.site-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-16);
}
.site-nav__links, .site-nav__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.site-nav__link {
  padding: var(--sp-8) var(--sp-12);
  border-radius: var(--radius-sm);
  font-size: var(--fs-14);
  font-weight: 500;
  color: var(--text-body);
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.site-nav__link:hover {
  background: var(--surface-sunken);
  color: var(--heading);
  text-decoration: none;
}
.site-nav__link.active { color: var(--primary); font-weight: 600; }
.site-nav__actions .lp-btn { margin-left: var(--sp-8); }

.site-nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--heading);
  font-size: var(--fs-24);
}
.site-nav-toggle:hover { background: var(--surface-sunken); }

.site-main {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--sp-32) var(--sp-24) var(--sp-64);
  min-height: 60vh;
}
.site-main > h1 { font-size: var(--fs-36); margin: 0 0 var(--sp-16); }

.site-footer {
  background: var(--navy);
  color: var(--on-navy-muted);
  font-size: var(--fs-14);
}
.site-footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--sp-48) var(--sp-24) var(--sp-32);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--sp-48);
}
.site-footer__name {
  font-family: var(--font-display);
  font-size: var(--fs-20);
  font-weight: 700;
  color: var(--on-navy);
  margin: 0 0 var(--sp-8);
}
.site-footer p { margin: 0; max-width: 46ch; line-height: 1.6; }
.site-footer h2 {
  font-family: var(--font-body);
  font-size: var(--fs-12);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--on-navy);
  margin: 0 0 var(--sp-12);
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-8); }
.site-footer a { color: var(--on-navy-muted); }
.site-footer a:hover { color: var(--on-navy); }
.site-footer__legal {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--sp-16) var(--sp-24) var(--sp-24);
  border-top: 1px solid rgb(255 255 255 / 0.12);
  font-size: var(--fs-12);
}

@media (max-width: 900px) {
  .site-header__inner { flex-wrap: wrap; padding: var(--sp-12) var(--sp-16); gap: var(--sp-12); }
  .site-nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: var(--sp-8);
    padding: var(--sp-8) 0 var(--sp-4);
    border-top: 1px solid var(--border);
  }
  .site-nav.is-open { display: flex; }
  .site-nav__links, .site-nav__actions { flex-direction: column; align-items: stretch; }
  .site-nav__link { padding: var(--sp-12); font-size: var(--fs-16); }
  .site-nav__actions .lp-btn { margin: var(--sp-4) 0 0; justify-content: center; }
  .site-main { padding: var(--sp-24) var(--sp-16) var(--sp-48); }
  .site-main > h1 { font-size: var(--fs-30); }
  .site-footer__inner { grid-template-columns: 1fr 1fr; gap: var(--sp-32); padding: var(--sp-32) var(--sp-16) var(--sp-24); }
  .site-footer__about { grid-column: 1 / -1; }
  .site-footer__legal { padding: var(--sp-16); }
}

/* ====== Marketing buttons ====== */
.lp-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  min-height: 44px;
  padding: var(--sp-8) var(--sp-24);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: var(--fs-14);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.lp-btn:hover { text-decoration: none; }
.lp-btn:active { transform: translateY(1px); }
.lp-btn--primary { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.lp-btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--primary-fg); }
.lp-btn--outline { background: var(--surface); border-color: var(--border-strong); color: var(--heading); }
.lp-btn--outline:hover { background: var(--surface-sunken); border-color: var(--text-subtle); }
.lp-btn--on-navy { background: transparent; border-color: rgb(255 255 255 / 0.36); color: var(--on-navy); }
.lp-btn--on-navy:hover { background: rgb(255 255 255 / 0.08); border-color: rgb(255 255 255 / 0.64); color: var(--on-navy); }
.lp-btn--sm { min-height: 36px; padding: var(--sp-4) var(--sp-16); }
.lp-btn--full { width: 100%; justify-content: center; }

/* ====== Landing page (home.html) ====== */
.lp-hero {
  position: relative;
  overflow: hidden;
  /* Full-bleed band: breaks out of the centred container to the viewport
     edges (body clips the scrollbar-width overhang of 100vw). */
  margin: calc(var(--sp-32) * -1) calc(50% - 50vw) var(--sp-48);
  padding: var(--sp-64) var(--sp-24) var(--sp-48);
  /* Soft brand-tinted glow, echoing the red in the Masterclass mark. */
  background:
    radial-gradient(60% 50% at 50% 100%, rgb(var(--primary-rgb) / 0.1), transparent 70%),
    radial-gradient(40% 40% at 0% 0%, rgb(var(--primary-rgb) / 0.08), transparent 70%),
    var(--surface);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.lp-hero__copy { position: relative; z-index: 1; max-width: 880px; margin: 0 auto; }
.lp-hero__badge {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-8);
  margin-bottom: var(--sp-24);
  padding: var(--sp-8) var(--sp-16);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: var(--fs-14);
  color: var(--text-muted);
}
.lp-hero__badge i, .lp-hero__badge strong { color: var(--primary); }
.lp-hero__headline {
  margin: 0 auto var(--sp-16);
  max-width: 16ch;
  font-size: clamp(var(--fs-36), 5.5vw, 3.75rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--heading);
  text-wrap: balance;
}
.lp-hero__headline em { font-style: normal; color: var(--primary); }
.lp-hero__kicker {
  margin: 0 0 var(--sp-16);
  font-family: var(--font-display);
  font-size: var(--fs-20);
  font-weight: 600;
  color: var(--text-body);
}
.lp-hero__rotator { color: var(--primary); white-space: nowrap; }
.lp-hero__rotator::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.12em;
  background: var(--primary);
  animation: lp-caret 1s steps(1) infinite;
}
@keyframes lp-caret { 50% { opacity: 0; } }
.lp-hero__sub {
  margin: 0 auto var(--sp-32);
  max-width: 56ch;
  font-size: var(--fs-18);
  line-height: 1.6;
  color: var(--text-muted);
}
.lp-hero__sub a { color: var(--primary); text-decoration: underline; }
.lp-hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-12); }
.lp-btn--pill { min-height: 48px; border-radius: var(--radius-pill); }

.lp-doodle { position: absolute; color: var(--primary); pointer-events: none; }
.lp-doodle--ring { top: var(--sp-64); left: var(--sp-48); width: 112px; opacity: 0.5; }
.lp-doodle--dots { top: 46%; left: var(--sp-96); width: 72px; opacity: 0.4; }
.lp-doodle--spark { top: var(--sp-96); right: 14%; width: 32px; color: var(--warning); }
/* Fill + stroke painted stroke-first, so the fill hides the overlapping inner
   contours a variable font would otherwise show through an outline. */
.lp-hero__outline {
  position: absolute;
  top: var(--sp-48);
  right: var(--sp-48);
  writing-mode: vertical-rl;
  font-family: var(--font-body);
  font-size: 6rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--surface);
  -webkit-text-stroke: 3px rgb(var(--primary-rgb) / 0.28);
  paint-order: stroke fill;
  pointer-events: none;
  user-select: none;
}
@media (max-width: 1100px) {
  .lp-hero__outline { display: none; }
}

/* Arched gallery of art + product mocks */
.lp-gallery {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--sp-16);
  margin-top: var(--sp-64);
}
.lp-tile {
  flex: 0 0 auto;
  width: 200px;
  height: 232px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-12);
  padding: var(--sp-16);
  border-radius: var(--sp-64) var(--sp-64) var(--radius-lg) var(--radius-lg);
  text-align: left;
}
.lp-tile:nth-child(2), .lp-tile:nth-child(4) { height: 272px; }
.lp-tile:nth-child(3) { height: 312px; }
.lp-tile img { width: 100%; height: auto; }
.lp-tile .mock-card { width: 100%; }
.lp-tile--rose { background: var(--primary-soft); }
.lp-tile--sky { background: var(--navy-soft); }
.lp-tile--navy { background: var(--navy); }
.lp-tile--navy img { padding: var(--sp-8); border-radius: var(--radius-md); background: var(--on-navy); }
.lp-tile--sun { background: var(--warning-soft); }
.lp-tile--mint { background: var(--success-soft); }
.lp-tile__caption { font-size: var(--fs-14); color: var(--on-navy-muted); text-align: center; }
.lp-tile__caption b { font-family: var(--font-display); font-size: var(--fs-24); color: var(--on-navy); }

/* Rotating ring link */
.lp-ring {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 120px;
  height: 120px;
  margin: calc(var(--sp-48) * -1) auto 0;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  color: var(--text);
}
.lp-ring__text { position: absolute; inset: 0; }
.lp-ring__text text { font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; fill: currentColor; }
.lp-ring__dot {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-fg);
  font-size: var(--fs-18);
  transition: transform var(--dur-base) var(--ease);
}
.lp-ring:hover .lp-ring__dot { transform: scale(1.1); }

/* Product mock cards (decorative) */
.mock-card {
  padding: var(--sp-16);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.mock-card__head {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  margin-bottom: var(--sp-8);
  font-size: var(--fs-12);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.mock-card__title { margin-bottom: var(--sp-8); font-weight: 600; color: var(--heading); }
.mock-card__row { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-8); }
.mock-card__meta { font-size: var(--fs-14); color: var(--text-muted); }
.mock-card__foot { margin-top: var(--sp-12); font-size: var(--fs-14); font-weight: 600; color: var(--warning-strong); }
.mock-card__num { font-family: var(--font-display); font-size: var(--fs-36); font-weight: 700; line-height: 1; }
.mock-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
}
.mock-chip-row { display: flex; flex-wrap: wrap; gap: var(--sp-8); }
.mock-chip {
  padding: var(--sp-4) var(--sp-12);
  border-radius: var(--radius-pill);
  background: var(--surface-sunken);
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--text-body);
}
.mock-chip--active { background: var(--navy); color: var(--on-navy); }
.mock-chip--onbrand { background: rgb(255 255 255 / 0.2); color: var(--primary-fg); }
.mock-chip--onbrand.mock-chip--active { background: var(--surface); color: var(--primary-hover); }

/* Stats strip */
.lp-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 0 var(--sp-64);
  padding: 0;
}
.lp-stat { padding: var(--sp-24); border-left: 1px solid var(--border); }
.lp-stat:first-child { border-left: 0; }
.lp-stat__num {
  display: block;
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-36);
  font-weight: 700;
  line-height: 1.1;
  color: var(--heading);
  font-variant-numeric: tabular-nums;
}
.lp-stat__label { display: block; margin-top: var(--sp-4); font-size: var(--fs-14); color: var(--text-muted); }

/* Section headings */
.lp-section { margin-bottom: var(--sp-64); }
.lp-eyebrow {
  margin: 0 0 var(--sp-8);
  font-size: var(--fs-12);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
}
.lp-section-title { margin: 0 0 var(--sp-8); font-size: var(--fs-30); font-weight: 700; }
.lp-section-sub { margin: 0 0 var(--sp-24); max-width: 62ch; color: var(--text-muted); }

/* How it works */
.lp-steps {
  list-style: none;
  margin: var(--sp-32) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-32);
}
.lp-step img {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: var(--sp-24);
  padding: var(--sp-16);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}
.lp-step__num {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-fg);
  font-family: var(--font-display);
  font-weight: 700;
}
.lp-step h3 { margin: var(--sp-12) 0 var(--sp-8); font-size: var(--fs-20); }
.lp-step p { margin: 0; max-width: 40ch; line-height: 1.6; color: var(--text-muted); }
@media (max-width: 900px) {
  .lp-steps { grid-template-columns: 1fr; gap: var(--sp-48); }
  .lp-step img { max-width: 320px; }
}

/* Category tabs */
.lp-tabs { display: flex; flex-wrap: wrap; gap: var(--sp-8); margin-bottom: var(--sp-24); }
.lp-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  min-height: 36px;
  padding: var(--sp-4) var(--sp-16);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: var(--fs-14);
  font-weight: 500;
  color: var(--text-body);
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.lp-tab:hover { background: var(--surface-sunken); border-color: var(--border-strong); }
.lp-tab--active, .lp-tab--active:hover { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
.lp-tab__count { font-size: var(--fs-12); font-weight: 600; opacity: 0.72; font-variant-numeric: tabular-nums; }
.lp-panel--hidden { display: none; }

/* Preview cards */
.lp-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: var(--sp-16);
}
.lp-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  padding: var(--sp-16);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.lp-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.lp-card__meta { display: flex; flex-wrap: wrap; gap: var(--sp-4); }
.lp-card__title { margin: 0; font-family: var(--font-body); font-size: var(--fs-16); font-weight: 600; line-height: 1.4; letter-spacing: 0; }
.lp-card__title a { color: var(--heading); }
.lp-card__title a:hover { color: var(--primary); text-decoration: none; }
.lp-card__entity { font-size: var(--fs-14); color: var(--text-body); }
.lp-card__entity i { margin-right: var(--sp-4); color: var(--text-subtle); }
.lp-card__summary {
  margin: 0;
  font-size: var(--fs-14);
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lp-card__footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-8);
  margin-top: auto;
  padding-top: var(--sp-8);
}
.lp-card__closing-abs { font-size: var(--fs-12); }
.lp-empty {
  padding: var(--sp-48) var(--sp-24);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--text-muted);
}
.lp-empty i { display: block; margin-bottom: var(--sp-8); font-size: var(--fs-30); color: var(--text-subtle); }

/* Closing-date urgency chip (also used by public/_card.html) */
.closing-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-12);
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--fs-12);
  font-weight: 600;
  white-space: nowrap;
}
.closing-chip--urgent { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger-strong); }
.closing-chip--soon { background: var(--warning-soft); border-color: var(--warning-border); color: var(--warning-strong); }
.closing-chip--normal { background: var(--success-soft); border-color: var(--success-border); color: var(--success-strong); }

/* Call-to-action band under the preview */
.lp-preview__cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--sp-16);
  margin-top: var(--sp-24);
  padding: var(--sp-24);
  border-radius: var(--radius-md);
  background: var(--navy);
}
.lp-preview__cta p { margin: 0; max-width: 60ch; color: var(--on-navy-muted); }
.lp-preview__cta strong { color: var(--on-navy); }
.lp-preview__cta-actions { display: flex; flex-wrap: wrap; gap: var(--sp-12); }

/* Feature bento */
.lp-features__bento {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-16);
  margin-top: var(--sp-24);
}
.feat-tile {
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  padding: var(--sp-24);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.feat-tile h3 { margin: var(--sp-8) 0 0; font-size: var(--fs-18); font-weight: 700; }
.feat-tile p { margin: 0; font-size: var(--fs-14); line-height: 1.6; color: var(--text-muted); }
.feat-tile--lg { flex-direction: row; align-items: center; gap: var(--sp-24); }
.feat-tile--lg .feat-tile__copy { flex: 1; display: flex; flex-direction: column; gap: var(--sp-8); }
.feat-tile--dark { background: var(--navy); border-color: var(--navy); }
.feat-tile--dark h3 { color: var(--on-navy); }
.feat-tile--dark p { color: var(--on-navy-muted); }
.feat-tile--brand { background: var(--primary); border-color: var(--primary); }
.feat-tile--brand h3, .feat-tile--brand p { color: var(--primary-fg); }
.feat-tile__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 0.14);
  color: var(--primary-fg);
  font-size: var(--fs-18);
}
.feat-tile__icon--accent { background: var(--primary-soft); color: var(--primary); }
.feat-mock {
  flex-shrink: 0;
  padding: var(--sp-16);
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: var(--radius-md);
  background: rgb(255 255 255 / 0.06);
}
.feat-mock__row {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  padding: var(--sp-4) 0;
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--on-navy);
}
.feat-mock__row--muted { font-weight: 400; color: var(--on-navy-muted); }
.feat-tile--brand .mock-chip-row { margin-top: var(--sp-8); }
.feat-tile .closing-chip { margin-top: var(--sp-8); width: fit-content; }

/* Contact */
.lp-contact {
  /* Full-bleed tinted band that runs into the footer; the form is the one
     raised surface on it, so it reads as the thing to act on. */
  margin: 0 calc(50% - 50vw) calc(var(--sp-64) * -1);
  padding: var(--sp-64) max(var(--sp-24), calc(50vw - var(--container) / 2 + var(--sp-24)));
  background:
    radial-gradient(40% 70% at 100% 100%, rgb(var(--primary-rgb) / 0.16), transparent 70%),
    var(--primary-soft);
  scroll-margin-top: var(--sp-64);
}
.lp-contact__form-wrap {
  padding: var(--sp-32);
  border-top: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.lp-contact__form-title { margin: 0 0 var(--sp-16); font-size: var(--fs-20); }
.lp-contact__inner { display: grid; grid-template-columns: 1fr 1.4fr; gap: var(--sp-48); align-items: start; }
.lp-contact__copy h2 { margin: 0 0 var(--sp-12); font-size: var(--fs-30); }
.lp-contact__copy p { margin: 0 0 var(--sp-24); line-height: 1.6; color: var(--text-muted); }
.lp-contact__perks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-8); }
.lp-contact__perks li { display: flex; align-items: center; gap: var(--sp-8); font-size: var(--fs-14); color: var(--text-body); }
.lp-contact__perks i { color: var(--success); flex-shrink: 0; }

.lp-flash {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  margin-bottom: var(--sp-16);
  padding: var(--sp-12) var(--sp-16);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: var(--fs-14);
  font-weight: 500;
}
.lp-flash--success { background: var(--success-soft); border-color: var(--success-border); color: var(--success-strong); }
.lp-flash--error { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger-strong); }

.lp-form { display: flex; flex-direction: column; gap: var(--sp-16); }
.lp-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-16); }
.lp-form__group { display: flex; flex-direction: column; gap: var(--sp-4); }
.lp-form__group label { font-size: var(--fs-14); font-weight: 600; color: var(--text-body); }
.lp-form__group input,
.lp-form__group textarea,
.lp-form__group select {
  width: 100%;
  min-height: 44px;
  padding: var(--sp-8) var(--sp-12);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: var(--fs-16);
  color: var(--text);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.lp-form__group input:focus,
.lp-form__group textarea:focus,
.lp-form__group select:focus {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 3px rgb(29 78 216 / 0.2);
}
.lp-form__group textarea { min-height: 120px; resize: vertical; }
.lp-form__hint { font-weight: 400; color: var(--text-muted); }
.lp-required { color: var(--danger); }

@media (max-width: 900px) {
  .lp-doodle--dots { display: none; }
  .lp-doodle--ring { left: calc(var(--sp-32) * -1); top: var(--sp-16); }
  /* The gallery scrolls sideways inside itself; the page never does. */
  .lp-gallery { justify-content: flex-start; overflow-x: auto; margin-inline: calc(var(--sp-24) * -1); padding: 0 var(--sp-24) var(--sp-16); scrollbar-width: none; }
  .lp-stat { padding-inline: var(--sp-16); }
  .lp-gallery::-webkit-scrollbar { display: none; }
  .lp-contact__inner { grid-template-columns: 1fr; gap: var(--sp-32); }
}
@media (max-width: 640px) {
  .lp-hero { margin-top: calc(var(--sp-24) * -1); padding: var(--sp-48) var(--sp-16) var(--sp-32); }
  .lp-doodle { display: none; }
  .lp-hero__kicker { font-size: var(--fs-18); }
  .lp-gallery { margin-top: var(--sp-48); margin-inline: calc(var(--sp-16) * -1); padding-inline: var(--sp-16); }
  .lp-ring { margin-top: var(--sp-16); }
  .lp-hero__sub { font-size: var(--fs-16); }
  .lp-hero__actions .lp-btn { flex: 1 1 100%; justify-content: center; }
  .lp-stats { grid-template-columns: 1fr; margin-bottom: var(--sp-48); }
  .lp-stat { padding: var(--sp-16); border-left: 0; border-top: 1px solid var(--border); }
  .lp-stat:first-child { border-top: 0; }
  .lp-stat__num { font-size: var(--fs-30); }
  .lp-section { margin-bottom: var(--sp-48); }
  .lp-section-title, .lp-contact__copy h2 { font-size: var(--fs-24); }
  /* Tabs scroll sideways inside their own row; the page itself never does. */
  .lp-tabs { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--sp-16) * -1); padding: 0 var(--sp-16) var(--sp-4); scrollbar-width: none; }
  .lp-tabs::-webkit-scrollbar { display: none; }
  .lp-tab { flex-shrink: 0; min-height: 44px; }
  .lp-preview__cta { flex-direction: column; align-items: stretch; }
  .lp-preview__cta-actions .lp-btn { flex: 1; justify-content: center; }
  .lp-features__bento { grid-template-columns: 1fr; }
  .feat-tile--lg { flex-direction: column; align-items: stretch; }
  .lp-form__row { grid-template-columns: 1fr; }
  .lp-contact { margin-bottom: calc(var(--sp-48) * -1); padding: var(--sp-48) var(--sp-16); }
  .lp-contact__form-wrap { padding: var(--sp-24) var(--sp-16); }
}

/* ====== Public tender list (tenders.html, _card.html) ====== */
.page-lede { margin: 0 0 var(--sp-24); max-width: 70ch; color: var(--text-muted); }
.filter-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8); margin: var(--sp-8) 0 var(--sp-16); font-size: var(--fs-14); }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-12);
  border-radius: var(--radius-pill);
  background: var(--navy-soft);
  color: var(--navy);
  font-weight: 600;
}
.filter-chip:hover { background: var(--border); text-decoration: none; }
.result-count { margin: 0 0 var(--sp-12); font-size: var(--fs-14); color: var(--text-muted); }
.tender-list { display: flex; flex-direction: column; gap: var(--sp-16); }
.tender-card { margin-bottom: 0; transition: border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease); }
.tender-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
.tender-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8); }
.tender-card__title { margin: var(--sp-12) 0 var(--sp-4); font-family: var(--font-body); font-size: var(--fs-18); font-weight: 600; line-height: 1.4; letter-spacing: 0; }
.tender-card__title a { color: var(--heading); }
.tender-card__title a:hover { color: var(--primary); text-decoration: none; }
.tender-card__entity { display: flex; flex-wrap: wrap; gap: var(--sp-4) var(--sp-16); font-size: var(--fs-14); color: var(--text-body); }
.tender-card__entity i { color: var(--text-subtle); }
.tender-card__summary { margin: var(--sp-12) 0 0; max-width: 80ch; font-size: var(--fs-14); color: var(--text-muted); }
.tender-card__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-12) var(--sp-16);
  margin-top: var(--sp-16);
  padding-top: var(--sp-16);
  border-top: 1px solid var(--border);
}
.tender-card__dates { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8) var(--sp-12); font-size: var(--fs-12); }
.tender-card__actions { display: flex; flex-wrap: wrap; gap: var(--sp-8); }
.lp-empty p { margin: 0 0 var(--sp-16); }
@media (max-width: 640px) {
  .tender-card__actions { flex: 1 1 100%; }
  .tender-card__actions .btn { flex: 1 1 100%; min-height: 44px; }
}

/* ====== Empty states ====== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-12);
  padding: var(--sp-48) var(--sp-24);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--text-muted);
}
.empty-state__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  color: var(--text-muted);
  font-size: var(--fs-24);
}
.empty-state__art { width: 160px; height: auto; }
.empty-state p { margin: 0; max-width: 52ch; }

/* ====== Illustrations ====== */
.auth-brand-art {
  width: 200px;
  height: auto;
  margin-bottom: var(--sp-24);
  padding: var(--sp-12);
  border-radius: var(--radius-lg);
  background: var(--on-navy);
}
.lp-contact__art { display: block; width: 240px; height: auto; margin-top: var(--sp-32); }
.lp-empty .empty-state__art { display: block; margin: 0 auto var(--sp-12); }
@media (max-width: 900px) {
  .lp-contact__art { display: none; }
}

/* ====== Page hero (every page except home) ====== */
.page-hero {
  position: relative;
  overflow: hidden;
  /* Full-bleed band, same technique as the home hero. */
  margin: calc(var(--sp-32) * -1) calc(50% - 50vw) var(--sp-32);
  padding: var(--sp-64) var(--sp-24);
  /* Layered mesh: a red glow from the brand mark, a cool glow opposite it,
     over deep navy. A dot grid fades in from the right (see ::before). */
  background:
    radial-gradient(48% 90% at 88% 0%, rgb(207 42 30 / 0.5), transparent 70%),
    radial-gradient(40% 80% at 0% 100%, rgb(64 110 220 / 0.35), transparent 70%),
    linear-gradient(135deg, #0b1f4b, #071432);
  color: var(--on-navy);
}
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgb(255 255 255 / 0.22) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  -webkit-mask-image: linear-gradient(100deg, transparent 30%, #000 100%);
          mask-image: linear-gradient(100deg, transparent 30%, #000 100%);
  pointer-events: none;
}
.page-hero .lp-eyebrow { color: #ffb4ab; }
.page-hero .lp-doodle { color: var(--on-navy); }
.page-hero .lp-doodle--spark { color: #fbbf24; }
.page-hero__inner {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-48);
}
.page-hero h1 { margin: 0 0 var(--sp-12); font-size: clamp(var(--fs-30), 4vw, var(--fs-48)); letter-spacing: -0.02em; text-wrap: balance; color: var(--on-navy); }
.page-hero__lede { max-width: 60ch; font-size: var(--fs-18); line-height: 1.6; color: var(--on-navy-muted); }
.page-hero__lede strong, .page-hero__lede a { color: var(--on-navy); }
.page-hero__lede a { text-decoration: underline; }
.page-hero__art {
  width: 240px;
  height: auto;
  flex-shrink: 0;
  padding: var(--sp-16);
  border-radius: var(--sp-48) var(--radius-lg) var(--sp-48) var(--radius-lg);
  background: var(--on-navy);
  box-shadow: var(--shadow-lg);
  rotate: 3deg;
}
.page-hero .lp-doodle--ring { top: calc(var(--sp-32) * -1); left: calc(var(--sp-32) * -1); width: 128px; opacity: 0.4; }
.page-hero .lp-doodle--spark { top: var(--sp-24); right: 30%; }
.lp-doodle--squiggle { bottom: var(--sp-16); left: 40%; width: 120px; opacity: 0.5; }
.page-hero--inset {
  margin: 0 0 var(--sp-24);
  padding: var(--sp-24);
  border-radius: var(--radius-lg);
}
.page-hero--inset h1 { font-size: var(--fs-30); }
.page-hero--inset .page-hero__lede { font-size: var(--fs-14); }
.page-hero--inset .page-hero__art { width: 160px; padding: var(--sp-8); }

/* Account band: sub-navigation + artwork above every account page */
.account-band {
  position: relative;
  overflow: hidden;
  margin: calc(var(--sp-32) * -1) calc(50% - 50vw) var(--sp-32);
  padding: var(--sp-24);
  background:
    radial-gradient(50% 100% at 100% 0%, rgb(var(--primary-rgb) / 0.1), transparent 70%),
    var(--surface);
  border-bottom: 1px solid var(--border);
}
.account-band__inner {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-24);
}
.account-band__nav { display: flex; flex-wrap: wrap; gap: var(--sp-8); }
.account-band__nav a {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  min-height: 44px;
  padding: var(--sp-8) var(--sp-16);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--text-body);
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.account-band__nav a:hover { border-color: var(--border-strong); background: var(--surface-sunken); text-decoration: none; }
.account-band__nav a.active { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
.account-band__art { width: 128px; height: auto; flex-shrink: 0; }
.account-band .lp-doodle--ring { top: calc(var(--sp-48) * -1); left: calc(var(--sp-48) * -1); width: 128px; opacity: 0.3; }
.account-band .lp-doodle--spark { top: var(--sp-16); right: 24%; width: 24px; }
.account-band .lp-doodle--squiggle { left: 46%; }

/* Scroll progress bar (injected by motion.js) */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 400;
  width: 100%;
  height: 3px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

@media (max-width: 900px) {
  .page-hero, .account-band { margin-top: calc(var(--sp-24) * -1); margin-bottom: var(--sp-24); padding: var(--sp-32) var(--sp-16); }
  .page-hero__art { width: 120px; }
  .account-band { padding: var(--sp-16); }
  .account-band__art, .lp-doodle--squiggle { display: none; }
  /* Sub-nav scrolls sideways inside itself on phones. */
  .account-band__nav { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--sp-16) * -1); padding-inline: var(--sp-16); scrollbar-width: none; }
  .account-band__nav::-webkit-scrollbar { display: none; }
  .account-band__nav a { flex-shrink: 0; }
}
@media (max-width: 640px) {
  .page-hero__inner { flex-direction: column-reverse; align-items: flex-start; gap: var(--sp-16); }
  .page-hero--inset .page-hero__art { display: none; }
}

/* ====== Theme toggle ====== */
.theme-toggle {
  width: 44px;
  min-height: 44px;
  padding: 0;
  border-color: var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--heading);
  font-size: var(--fs-18);
}
.theme-toggle:hover { background: var(--surface-sunken); border-color: var(--border-strong); }
.theme-toggle .bi-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .bi-sun { display: inline; }
:root[data-theme="dark"] .theme-toggle .bi-moon-stars { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .bi-sun { display: inline; }
  :root:not([data-theme="light"]) .theme-toggle .bi-moon-stars { display: none; }
}
/* Illustrations are drawn on white; keep them on a light plate in dark mode. */
:root[data-theme="dark"] :is(.page-hero__art, .account-band__art, .split__art, .cta-band__art, .empty-state__art, .lp-contact__art, .lp-step img, .lp-tile img) {
  padding: var(--sp-8);
  border-radius: var(--radius-md);
  background: var(--on-navy);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.page-hero__art, .account-band__art, .split__art, .cta-band__art, .empty-state__art, .lp-contact__art, .lp-step img, .lp-tile img) {
    padding: var(--sp-8);
    border-radius: var(--radius-md);
    background: var(--on-navy);
  }
}

/* ====== Admin: collapsible nav groups and icon rail ====== */
.sidebar-group { margin-bottom: var(--sp-4); }
.sidebar-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.sidebar-group > summary::-webkit-details-marker { display: none; }
.sidebar-group > summary:hover { background: var(--surface-sunken); color: var(--heading); }
.sidebar-group__chevron { font-size: var(--fs-12); transition: transform var(--dur-base) var(--ease); }
.sidebar-group:not([open]) .sidebar-group__chevron { transform: rotate(-90deg); }
.sidebar-collapse { width: 44px; min-height: 44px; padding: 0; font-size: var(--fs-18); }

@media (min-width: 769px) {
  .sidebar-collapsed .admin-sidebar { width: 72px; min-width: 72px; }
  .sidebar-collapsed .sidebar-brand { justify-content: center; padding-inline: var(--sp-8); }
  .sidebar-collapsed .sidebar-brand-text,
  .sidebar-collapsed .sidebar-nav-item span,
  .sidebar-collapsed .sidebar-ext-icon,
  .sidebar-collapsed .sidebar-group > summary { display: none; }
  /* In rail mode every link stays reachable, whatever groups were closed. */
  .sidebar-collapsed .sidebar-group:not([open]) > *:not(summary) { display: flex; }
  .sidebar-collapsed .sidebar-group { padding-top: var(--sp-8); border-top: 1px solid var(--border); }
  .sidebar-collapsed .sidebar-group:first-child { border-top: 0; }
  .sidebar-collapsed .sidebar-nav-item { justify-content: center; padding-inline: 0; }
  .sidebar-collapsed .sidebar-nav-item i { font-size: var(--fs-18); }
}
@media (max-width: 768px) {
  .sidebar-collapse { display: none; }
}

/* ====== Loading states ====== */
.nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 500;
  width: 100%;
  height: 3px;
  overflow: hidden;
  background: var(--primary-soft);
}
.nav-progress::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  background: var(--primary);
  animation: nav-progress 1.1s var(--ease) infinite;
}
@keyframes nav-progress {
  from { transform: translateX(-100%); }
  to { transform: translateX(250%); }
}

/* Busy button: spinner replaces nothing, label stays readable. */
button.is-loading, .btn.is-loading, .htmx-request button { cursor: progress; opacity: 0.8; }
button.is-loading::before, .htmx-request button::before {
  content: "";
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: mts-spin 0.8s linear infinite;
}

/* Skeleton shimmer for content that is still arriving. */
.skeleton, .chart-slot[aria-busy="true"] {
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--surface-sunken) 25%, var(--border) 37%, var(--surface-sunken) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}
@keyframes skeleton-shimmer {
  from { background-position: 100% 50%; }
  to { background-position: 0 50%; }
}
/* Chart-shaped skeleton: faint bars rising from a baseline. */
.chart-slot[aria-busy="true"] {
  -webkit-mask-image: linear-gradient(90deg, #000 8%, transparent 8% 12%, #000 12% 22%, transparent 22% 26%, #000 26% 38%, transparent 38% 42%, #000 42% 56%, transparent 56% 60%, #000 60% 74%, transparent 74% 78%, #000 78% 92%, transparent 92%);
          mask-image: linear-gradient(90deg, #000 8%, transparent 8% 12%, #000 12% 22%, transparent 22% 26%, #000 26% 38%, transparent 38% 42%, #000 42% 56%, transparent 56% 60%, #000 60% 74%, transparent 74% 78%, #000 78% 92%, transparent 92%);
}
.chart-slot.is-empty {
  display: grid;
  place-items: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-muted);
}
.chart-slot.is-empty::before { content: "No data for this period yet."; }
.chart-slot.is-failed {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-12);
  padding: var(--sp-16);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-align: center;
}
.chart-slot.is-failed p { margin: 0; }
/* "Show the numbers" table under each chart. */
.chart-data { margin-top: var(--sp-12); }
.chart-data summary {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
}
.chart-data__scroll { max-height: 360px; margin-top: var(--sp-8); overflow: auto; border-radius: var(--radius-sm); }
.chart-data table { font-size: var(--fs-14); font-variant-numeric: tabular-nums; }
.chart-data tbody th {
  background: none;
  font-size: inherit;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  color: var(--heading);
}
.chart-data td { text-align: right; white-space: nowrap; }
.chart-data thead th:not(:first-child) { text-align: right; }
/* Live fragments dim slightly while htmx refreshes them. */
.htmx-request.run-status, #run-status.htmx-request { opacity: 0.7; transition: opacity var(--dur-base) var(--ease); }

/* ====== Split rows, callout, closing CTA, floating contact ====== */
.split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: var(--sp-64);
  align-items: center;
  margin-bottom: var(--sp-64);
}
.split--reverse .split__art { order: 2; }
.split__art {
  width: 100%;
  height: auto;
  padding: var(--sp-32);
  border-radius: var(--sp-64) var(--radius-lg) var(--sp-64) var(--radius-lg);
  background: var(--primary-soft);
}
.split--reverse .split__art { background: var(--navy-soft); border-radius: var(--radius-lg) var(--sp-64) var(--radius-lg) var(--sp-64); }
.split__copy h2 { margin: 0 0 var(--sp-16); font-size: var(--fs-30); }
.split__copy p { max-width: 60ch; line-height: 1.7; color: var(--text-body); }

.callout {
  display: flex;
  gap: var(--sp-24);
  margin-bottom: var(--sp-32);
  padding: var(--sp-32);
  border: 1px solid var(--warning-border);
  border-radius: var(--radius-lg);
  background: var(--warning-soft);
}
.callout__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--warning);
  color: var(--primary-fg);
  font-size: var(--fs-24);
}
.callout h2 { margin: 0 0 var(--sp-8); font-size: var(--fs-20); }
.callout p { margin: 0; max-width: 75ch; line-height: 1.7; color: var(--text-body); }

.cta-band { position: relative; overflow: hidden; padding: var(--sp-48) var(--sp-24); background: var(--navy-700); color: var(--on-navy); }
.cta-band__inner {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--sp-32);
}
.cta-band__art { width: 160px; height: auto; flex-shrink: 0; padding: var(--sp-8); border-radius: var(--radius-lg); background: var(--on-navy); }
.cta-band__copy { flex: 1; }
.cta-band h2 { margin: 0 0 var(--sp-8); font-size: var(--fs-30); color: var(--on-navy); }
.cta-band p { margin: 0; max-width: 52ch; color: var(--on-navy-muted); }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: var(--sp-12); }
.cta-band .lp-doodle { color: var(--on-navy); }
.cta-band .lp-doodle--ring { top: calc(var(--sp-48) * -1); right: var(--sp-48); left: auto; width: 160px; opacity: 0.2; }
.cta-band .lp-doodle--spark { top: var(--sp-24); left: 45%; right: auto; width: 24px; color: var(--warning); }
.cta-band .lp-doodle--squiggle { bottom: var(--sp-16); left: 30%; opacity: 0.3; }

.contact-fab {
  position: fixed;
  left: var(--sp-24);
  bottom: var(--sp-24);
  z-index: 250;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  min-height: 48px;
  padding: var(--sp-12) var(--sp-16);
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--primary-fg);
  font-size: var(--fs-14);
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  transition: background var(--dur-fast) var(--ease), transform var(--dur-base) var(--ease);
}
.contact-fab:hover { background: var(--primary-hover); color: var(--primary-fg); text-decoration: none; transform: translateY(-2px); }
.contact-fab i { font-size: var(--fs-18); }

@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; gap: var(--sp-24); margin-bottom: var(--sp-48); }
  .split--reverse .split__art { order: 0; }
  .split__art { max-width: 360px; padding: var(--sp-24); }
  .cta-band__inner { flex-direction: column; align-items: flex-start; }
  .cta-band__art { width: 120px; }
}
@media (max-width: 640px) {
  .callout { flex-direction: column; padding: var(--sp-24) var(--sp-16); }
  /* Icon-only on phones so it never covers content or the submit button. */
  .contact-fab { left: var(--sp-16); bottom: var(--sp-16); width: 48px; padding: 0; justify-content: center; }
  .contact-fab span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .cta-band__actions .lp-btn { flex: 1 1 100%; justify-content: center; }
}

/* ====== Tender results: layout switch, grid and table views ====== */
.result-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-12);
  margin-bottom: var(--sp-16);
}
.result-bar .result-count { margin: 0; }
/* Segmented control, also used for the insights period selector. */
.view-switch {
  display: inline-flex;
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
}
.view-switch__option {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-8);
  min-height: 36px;
  padding: var(--sp-4) var(--sp-16);
  border-radius: var(--radius-pill);
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.view-switch__option:hover { background: var(--surface-sunken); color: var(--heading); text-decoration: none; }
.view-switch__option.active { background: var(--navy); color: var(--on-navy); }

.tender-list--grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  align-items: stretch;
}
.tender-list--grid .tender-card { display: flex; flex-direction: column; }
/* nowrap: a wrapping column flexbox would push the actions into a second column. */
.tender-list--grid .tender-card__footer { margin-top: auto; flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
.tender-list--grid .tender-card__actions { flex: 0 0 auto; }
.tender-list--grid .tender-card__actions .btn { flex: 1; }
.tender-list--grid .tender-card__summary {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* position: relative keeps absolutely-positioned children (.sr-only labels)
   inside the scroll box instead of widening the page. */
.table-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius-sm); }
.table-scroll > table { display: table; min-width: 640px; }
.tender-table td { vertical-align: middle; font-size: var(--fs-14); }
.tender-table__title { font-weight: 600; color: var(--heading); }
.tender-table .muted { font-size: var(--fs-12); }

/* ====== Insights: data window, KPIs, chart cards ====== */
.insights-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-16);
  margin-bottom: var(--sp-24);
  padding: var(--sp-16);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
/* Tear-off calendar leaf showing the latest day covered. */
.date-leaf {
  display: flex;
  flex-direction: column;
  width: 64px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  text-align: center;
  rotate: -4deg;
}
.date-leaf__month {
  padding: var(--sp-4) 0;
  background: var(--primary);
  color: var(--primary-fg);
  font-size: var(--fs-12);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.date-leaf__day {
  padding: var(--sp-4) 0;
  background: var(--surface-sunken);
  font-family: var(--font-display);
  font-size: var(--fs-24);
  font-weight: 700;
  line-height: 1.2;
  color: var(--heading);
}
.insights-bar__range { flex: 1 1 240px; display: flex; flex-direction: column; gap: var(--sp-4); }
.insights-bar__label { font-size: var(--fs-12); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.insights-bar__dates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-8);
  font-family: var(--font-display);
  font-size: var(--fs-20);
  font-weight: 700;
  color: var(--heading);
}
.insights-bar__dates i { color: var(--primary); }
.insights-bar__fresh { display: inline-flex; align-items: center; gap: var(--sp-8); font-size: var(--fs-14); color: var(--text-muted); }
/* Custom date range: its own row under the presets. */
.range-form {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--sp-8);
  padding-top: var(--sp-12);
  border-top: 1px solid var(--border);
}
.range-form__label { margin-right: auto; font-size: var(--fs-14); font-weight: 600; color: var(--text-muted); }
.range-form.is-active .range-form__label { color: var(--heading); }
.range-form i { color: var(--primary); }
.range-form input[type="date"] {
  min-height: 36px;
  padding: var(--sp-4) var(--sp-12);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--heading);
  font: inherit;
  font-size: var(--fs-14);
}
.range-form.is-active input[type="date"] { border-color: var(--navy); }
.range-form .btn { min-height: 36px; }

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: var(--sp-16);
  margin-bottom: var(--sp-24);
}
.kpi {
  display: flex;
  align-items: center;
  gap: var(--sp-16);
  padding: var(--sp-24);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.kpi__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  font-size: var(--fs-24);
}
.kpi__icon--brand { background: var(--primary-soft); color: var(--primary); }
.kpi__icon--success { background: var(--success-soft); color: var(--success); }
.kpi__icon--navy { background: var(--navy-soft); color: var(--heading); }
.kpi__value { font-family: var(--font-display); font-size: var(--fs-36); font-weight: 700; line-height: 1.1; color: var(--heading); font-variant-numeric: tabular-nums; }
.kpi__label { font-weight: 600; color: var(--text-body); }
.kpi__sub { font-size: var(--fs-14); color: var(--text-muted); }

.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-16); margin-bottom: var(--sp-24); }
.chart-card {
  min-width: 0;
  padding: var(--sp-24);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.chart-card--wide { grid-column: 1 / -1; }
.chart-card__head { display: flex; align-items: flex-start; gap: var(--sp-12); margin-bottom: var(--sp-16); }
.chart-card__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: var(--fs-18);
}
.chart-card h2 { margin: 0 0 var(--sp-4); font-size: var(--fs-18); }
.chart-card__head p { margin: 0; max-width: 70ch; font-size: var(--fs-14); color: var(--text-muted); }
.provenance { max-width: 90ch; margin: 0 0 var(--sp-32); font-size: var(--fs-12); color: var(--text-muted); }

/* ── Response-window section ──────────────────────────────────────────
   Visually separated from the volume charts above because it answers a
   different question (how long do you get, not how many are there) and is
   measured over a subset of the data. */
.window-section { margin-bottom: var(--sp-32); }
.window-section__head { margin-bottom: var(--sp-16); }
.window-section__head h2 {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  margin: 0 0 var(--sp-8);
  font-size: var(--fs-24);
  color: var(--heading);
}
.window-section__head h2 i { color: var(--primary); }
.window-section__head p { margin: 0; max-width: 70ch; color: var(--text-muted); }

/* The one shareable number. Deliberately oversized -- this is the stat
   intended to be screenshotted and posted. */
.stat-callout {
  display: flex;
  align-items: center;
  gap: var(--sp-24);
  padding: var(--sp-24);
  margin-bottom: var(--sp-16);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  background: var(--primary-soft);
}
.stat-callout__figure { display: flex; align-items: baseline; gap: var(--sp-4); }
.stat-callout__value {
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.stat-callout__unit { font-size: var(--fs-18); font-weight: 700; color: var(--primary); }
.stat-callout__text { margin: 0; max-width: 52ch; font-size: var(--fs-18); color: var(--heading); }
.stat-callout__source {
  display: block;
  margin-top: var(--sp-8);
  font-size: var(--fs-12);
  font-weight: 500;
  color: var(--text-muted);
}

/* Coverage disclosure. These charts cover fewer tenders than the counters
   at the top of the page, and that has to be visible, not buried. */
.coverage-note {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-8);
  max-width: 90ch;
  margin: 0 0 var(--sp-16);
  font-size: var(--fs-12);
  color: var(--text-muted);
}
.coverage-note i { flex-shrink: 0; margin-top: 2px; }

/* ── Insights: chart captions, linked charts ── */
/* Stands in for the month-by-month charts until there are enough months. */
.trend-pending {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-12);
  margin: 0 0 var(--sp-24);
  padding: var(--sp-16) var(--sp-24);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}
.trend-pending i { flex-shrink: 0; margin-top: 2px; color: var(--primary); }
.chart-card__note { margin: var(--sp-8) 0 0; font-size: var(--fs-12); color: var(--text-muted); }
.chart-card__more { margin: var(--sp-12) 0 0; font-size: var(--fs-14); font-weight: 600; }

/* ── All procuring entities (/insights/buyers) ── */
.buyers-back { margin: 0 0 var(--sp-16); font-size: var(--fs-14); font-weight: 600; }
.buyers-table td { font-size: var(--fs-14); font-variant-numeric: tabular-nums; }
.buyers-table__name { font-weight: 600; color: var(--heading); }
/* Results dim briefly while a live search is fetching. */
.live-results { transition: opacity var(--dur-fast) var(--ease); }
.live-results[aria-busy="true"] { opacity: 0.55; }
/* The free-account prompt under the preview rows. */
.signup-gate {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-16);
  margin: var(--sp-24) 0 var(--sp-48);
  padding: var(--sp-24);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  background: var(--primary-soft);
}
.signup-gate__icon { flex-shrink: 0; font-size: var(--fs-24); color: var(--primary); }
.signup-gate h2 { margin: 0 0 var(--sp-8); font-size: var(--fs-20); color: var(--heading); }
.signup-gate p { margin: 0 0 var(--sp-12); color: var(--text-body); }
.signup-gate__actions { display: flex; flex-wrap: wrap; gap: var(--sp-12); margin: 0; }
/* Plotly's drag layer sits on top of the bars, so the cursor goes there. */
.chart-slot.is-linked .nsewdrag { cursor: pointer !important; }

/* ── Findings: the shareable sentences at the top of /insights ── */
.findings { margin-bottom: var(--sp-32); }
.findings__head { margin-bottom: var(--sp-16); }
.findings__head h2 { margin: 0 0 var(--sp-8); font-size: var(--fs-24); color: var(--heading); }
.findings__head p { margin: 0; max-width: 70ch; color: var(--text-muted); }
.findings__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: var(--sp-16);
}
.finding {
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  padding: var(--sp-24);
  border: 1px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: var(--radius-lg);
  background: var(--surface);
  scroll-margin-top: 96px;
}
.finding:target { box-shadow: 0 0 0 3px var(--primary-soft); }
.finding__stat { display: flex; align-items: baseline; gap: var(--sp-8); margin: 0; }
.finding__value {
  font-family: var(--font-display);
  font-size: var(--fs-48);
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.finding__unit { font-size: var(--fs-16); font-weight: 700; color: var(--primary); }
.finding__headline { margin: 0; font-size: var(--fs-20); line-height: 1.3; color: var(--heading); }
.finding__detail { margin: 0; font-size: var(--fs-14); color: var(--text-muted); }
.finding__links { display: flex; flex-wrap: wrap; gap: var(--sp-16); margin: 0; font-size: var(--fs-14); font-weight: 600; }
.share-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-8);
  margin-top: auto;
  padding-top: var(--sp-12);
  border-top: 1px solid var(--border);
}
.share-bar__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-4);
  min-height: 36px;
  padding: var(--sp-4) var(--sp-12);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-body);
  font: inherit;
  font-size: var(--fs-12);
  font-weight: 600;
  cursor: pointer;
}
.share-bar__btn:hover { background: var(--surface-sunken); color: var(--heading); text-decoration: none; }
.share-bar__native { border-color: var(--primary); color: var(--primary); }

/* Filter buttons over a chart (e.g. buyers by category). */
.chart-switch { max-width: 100%; gap: var(--sp-4); margin-bottom: var(--sp-12); overflow-x: auto; scrollbar-width: none; }
/* These are <button>s, so they carry the brand-red button fill: keep it,
   with white text, and navy for the selected category. */
.chart-switch .view-switch__option { border: none; color: var(--primary-fg); }
.chart-switch .view-switch__option:hover { background: var(--primary-hover); color: var(--primary-fg); }
.chart-switch .view-switch__option.active { background: var(--navy); color: var(--on-navy); }
.chart-switch::-webkit-scrollbar { display: none; }
.chart-switch[hidden] { display: none; }

/* ── Buyer pages and the weekly recap ── */
.buyer-section { margin-bottom: var(--sp-32); }
.buyer-section h2 { font-size: var(--fs-24); color: var(--heading); }
.buyer-summary {
  max-width: 70ch;
  margin: 0 0 var(--sp-32);
  font-size: var(--fs-18);
  line-height: 1.6;
  color: var(--text-body);
}
/* Section header shared by the recap's ranked lists. */
.leaders { margin-bottom: var(--sp-32); }
.leaders__head { margin-bottom: var(--sp-16); }
.leaders__head h2 {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  margin: 0 0 var(--sp-8);
  font-size: var(--fs-24);
  color: var(--heading);
}
.leaders__head h2 i { color: var(--primary); }
.leaders__head p { margin: 0; max-width: 70ch; color: var(--text-muted); }
/* Ranked buyers, each bar scaled to the week's leader. */
.weekly-buyers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--sp-4);
  max-width: 640px;
}
.weekly-buyers a {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-8);
  padding: var(--sp-8) var(--sp-12) var(--sp-12);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-body);
  font-size: var(--fs-14);
}
.weekly-buyers a:hover { background: var(--surface-sunken); text-decoration: none; }
.weekly-buyers__name { min-width: 0; font-weight: 600; color: var(--heading); overflow-wrap: anywhere; }
.weekly-buyers__count { font-weight: 700; font-variant-numeric: tabular-nums; }
.weekly-buyers__bar {
  position: absolute;
  left: var(--sp-12);
  bottom: var(--sp-4);
  max-width: calc(100% - 2 * var(--sp-12));
  height: 4px;
  border-radius: var(--radius-pill);
  background: var(--primary);
  opacity: 0.6;
}

/* ── Single-finding share page ── */
.share-page { max-width: 760px; margin: 0 auto var(--sp-48); padding-top: var(--sp-32); }
.share-page__eyebrow {
  margin: 0 0 var(--sp-12);
  font-size: var(--fs-12);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.share-page .finding__headline { font-size: var(--fs-24); }
.share-page__card { display: block; width: 100%; height: auto; margin: var(--sp-24) 0; border-radius: var(--radius-lg); }
.share-page__more h2 { font-size: var(--fs-18); color: var(--heading); }
.share-page__more ul { padding-left: var(--sp-16); }
.share-page__more li { margin-bottom: var(--sp-8); }
.share-page__actions { display: flex; flex-wrap: wrap; gap: var(--sp-12); }

@media (max-width: 900px) {
  .chart-grid { grid-template-columns: 1fr; }
  .chart-card { padding: var(--sp-16); }
  .stat-callout { flex-direction: column; align-items: flex-start; gap: var(--sp-12); }
  .stat-callout__value { font-size: 48px; }
  .insights-bar .view-switch, .result-bar .view-switch { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .view-switch::-webkit-scrollbar { display: none; }
}
@media (max-width: 640px) {
  .view-switch__option { min-height: 44px; }
  .insights-bar__dates { font-size: var(--fs-18); }
  .range-form { justify-content: flex-start; }
  .range-form__label { flex: 1 1 100%; }
  .range-form__field { flex: 1 1 0; min-width: 0; }
  .range-form input[type="date"] { width: 100%; min-height: 44px; }
  .range-form .btn { flex: 1 1 100%; min-height: 44px; }
}
