/* Mycontracts — design system
 *
 * Modeled after a refined, professional job-board / opportunity-board UX
 * (tabbed sub-nav, two-pane list/detail, filter chip row, matched-qualifications
 * callouts, Save vs Apply dual CTA). NOT chat-AI-generic.
 */

:root {
  --brand: #1f2937;          /* slate-800, solid primary */
  --brand-2: #4338ca;        /* indigo-700, accent for links / focus */
  --danger: #b91c1c;         /* red-700, primary action that's heavy */
  --ok-bg: #ecfdf5;          /* emerald-50 — matched-qualification chips */
  --ok-text: #065f46;        /* emerald-800 */
  --warn-bg: #fef3c7;        /* amber-100 — caution */
  --warn-text: #92400e;
  --bad-bg: #fee2e2;         /* red-100 — NOT QUALIFIED chip */
  --bad-text: #991b1b;
  --surface: #ffffff;
  --canvas: #f7f7f9;
  --border: #e5e7eb;         /* slate-200 */
  --border-strong: #d4d4d8;  /* zinc-300 */
  --text: #0f172a;           /* slate-900 */
  --text-2: #475569;         /* slate-600 */
  --muted: #94a3b8;          /* slate-400 */
  --radius: 6px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.06);
  --shadow: 0 4px 16px rgba(15,23,42,.06);
}

html {
  background: var(--canvas);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  color: var(--text);
  font-family: "Inter var", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
/* Lock form input font to 16px on touch devices so iOS doesn't zoom on focus */
@media (max-width: 768px) {
  input, select, textarea, .form-input, .form-select { font-size: 16px !important; }
}
/* Touch targets — buttons + nav items must be at least 44px on phone */
@media (max-width: 768px) {
  .btn, .btn-cta, .btn-sm { min-height: 40px; }
  .mc-side-link, .mc-bottom-link { min-height: 44px; }
}

/* ---- HTMX indicators ---- */
.htmx-indicator { opacity: 0; transition: opacity 200ms ease; }
.htmx-request .htmx-indicator { opacity: 1; }

/* ---- Brand bar ---- */
.brandbar {
  background: var(--brand);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background 0.4s ease, backdrop-filter 0.4s ease,
              box-shadow 0.4s ease, border-color 0.4s ease;
}
/* Taps on SVGs inside the hamburger / bottom-menu / collapse buttons should
   always register on the button itself — iOS Safari sometimes routes tap
   events to the inner SVG path and the parent button never fires. */
#mc-shell-toggle svg,
#mc-shell-toggle-bottom svg,
#mc-sidebar-collapse svg { pointer-events: none; }
#mc-shell-toggle, #mc-shell-toggle-bottom {
  -webkit-tap-highlight-color: rgba(255,255,255,.18);
  touch-action: manipulation;
  cursor: pointer;
}
/* When the landing page is rendered, the brandbar is TRANSPARENT at the
   top of the page and solidifies as the user scrolls (ondemandexpert-style).
   The .is-scrolled class is toggled by JS in base.html when scrollY > 24. */
body.has-landing-bg .brandbar {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid transparent;
  box-shadow: none;
}
body.has-landing-bg .brandbar.is-scrolled {
  background: rgba(8, 12, 24, 0.78);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 4px 24px -8px rgba(0,0,0,0.55);
}
.brandbar a:not(.btn) { color: rgba(255,255,255,.92); }
.brandbar a:not(.btn):hover { color: #fff; }
/* Buttons keep their own palette inside the brandbar */
.brandbar a.btn-secondary { color: var(--text); }
.brandbar a.btn-secondary:hover { color: var(--text); }
.brandbar a.btn-primary,
.brandbar a.btn-accent,
.brandbar a.btn-danger { color: #fff; }
.brandbar .nav-link {
  position: relative;
  padding: 18px 14px;
  display: inline-flex;
  align-items: center;
  font-weight: 500;
}
.brandbar .nav-link.active::after {
  content: "";
  position: absolute;
  inset-inline: 14px;
  bottom: 0;
  height: 3px;
  background: #fff;
  border-radius: 2px 2px 0 0;
}
.brandbar input[type="search"] {
  background: rgba(255,255,255,.95);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 16px;
  border: none;
  width: 280px;
}
.brandbar input[type="search"]::placeholder { color: var(--text-2); }
.brandbar input[type="search"]:focus { outline: 2px solid rgba(255,255,255,.6); }

/* ---- Page chrome ---- */
.breadcrumbs {
  color: var(--text-2);
  font-size: 14px;
  padding: 16px 0 8px;
}
.breadcrumbs a:hover { color: var(--brand-2); }

/* ---- Tabbed sub-nav ---- */
.subnav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 0 4px;
}
.subnav .tab {
  position: relative;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
}
.subnav .tab:hover { color: var(--text); }
.subnav .tab.active {
  color: var(--text);
}
.subnav .tab.active::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: -1px;
  height: 2px; background: var(--brand-2); border-radius: 2px;
}
.subnav .tab .badge {
  margin-left: 6px;
  font-size: 11px;
  font-weight: 700;
  background: var(--border);
  color: var(--text-2);
  border-radius: 999px;
  padding: 2px 7px;
}

/* ---- Inputs ---- */
.form-input,
.form-select {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}
.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(67,56,202,.15);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: filter .15s ease, background .15s ease;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); color: #fff; }
.btn-accent { background: var(--brand-2); color: #fff; }
.btn-accent:hover { filter: brightness(1.08); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-secondary {
  background: #fff;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-secondary:hover { background: var(--canvas); }
.btn-ghost {
  background: transparent;
  color: var(--text-2);
  padding: 6px 8px;
}
.btn-ghost:hover { color: var(--text); }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-icon {
  width: 32px; height: 32px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-2);
}
.btn-icon:hover { background: var(--canvas); color: var(--text); }

/* ---- Filter chip row ---- */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 12px 0;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}
.chip:hover { border-color: var(--text-2); }
.chip.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}
.chip svg { width: 14px; height: 14px; }

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}
.card-padded { padding: 20px; }

/* ---- List row (left column) ---- */
.list {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.list-row {
  display: block;
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  position: relative;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: #fafafa; }
.list-row.active {
  background: #fff8e1;
  border-left: 3px solid var(--brand-2);
  padding-left: 17px;
}
.list-row .title { font-weight: 600; font-size: 15px; color: var(--text); line-height: 1.3; }
.list-row .meta { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.list-row .footer { font-size: 12px; color: var(--text-2); margin-top: 8px; display: flex; align-items: center; justify-content: space-between; }
.list-row .star {
  position: absolute;
  top: 14px; right: 14px;
  color: var(--muted);
  cursor: pointer;
  background: none; border: none; padding: 4px;
}
.list-row .star.saved { color: #f59e0b; }
.list-row .star:hover { color: var(--brand-2); }
.list-row .due {
  color: var(--brand-2);
  font-weight: 500;
}

/* ---- Match badges ---- */
.match-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ok-bg);
  color: var(--ok-text);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
}
.not-qualified {
  display: inline-block;
  background: var(--bad-bg);
  color: var(--bad-text);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

/* ---- Detail pane sections ---- */
.detail-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
}
.detail-header .logo {
  width: 56px; height: 56px; border-radius: 8px;
  background: #f4f4f5; border: 1px solid var(--border);
  display: grid; place-items: center;
  color: var(--brand); font-weight: 800;
}
.detail-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.detail-section h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}
.detail-section p { color: var(--text); line-height: 1.55; }

/* ---- Status badges (tier) ---- */
.tier {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.tier-hot { background: #fee2e2; color: #991b1b; }
.tier-warm { background: #fef3c7; color: #92400e; }
.tier-cool { background: #e0f2fe; color: #075985; }
.tier-cold { background: #f1f5f9; color: #475569; }

/* ---- Prose (rendered AI markdown) ---- */
.prose h1 { font-size: 1.5rem; font-weight: 700; margin: 0.75rem 0 .5rem; }
.prose h2 { font-size: 1.2rem; font-weight: 700; margin: 1rem 0 .35rem; }
.prose h3 { font-size: 1.05rem; font-weight: 600; margin: .75rem 0 .25rem; }
.prose p { margin: .5rem 0; line-height: 1.55; }
.prose ul { list-style: disc; padding-left: 1.25rem; margin: .5rem 0; }
.prose ol { list-style: decimal; padding-left: 1.25rem; margin: .5rem 0; }
.prose blockquote {
  border-left: 3px solid var(--border-strong);
  padding: 4px 12px;
  color: var(--text-2);
  margin: .5rem 0;
}
.prose code { background: #f1f5f9; padding: 1px 5px; border-radius: 3px; font-size: 90%; }

/* ---- Two-pane layout helper ---- */
.two-pane {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1024px) {
  .two-pane { grid-template-columns: 380px minmax(0, 1fr); }
}

/* ---- Empty state ---- */
.empty {
  text-align: center;
  padding: 36px 16px;
  color: var(--text-2);
}

/* ---- App shell: sidebar + main + bottom bar ----
 *
 * Mobile (<768): sidebar is a fixed-position drawer that slides in.
 * Desktop (>=768): sidebar is docked (sticky flex item) inside .mc-shell-flex,
 * so it scrolls with the page but stays anchored. NOT floating over content.
 * Collapsed state shrinks it to a 64px icon-only rail.
 */
.mc-shell-flex {
  display: flex;
  align-items: stretch;
  min-height: calc(100vh - 60px);
}
.mc-sidebar {
  position: fixed;
  top: 60px;
  left: 0;
  bottom: 0;
  width: 248px;
  background: #fff;
  border-right: 1px solid var(--border);
  z-index: 40;
  display: flex;
  flex-direction: column;
  transform: translateX(-105%);
  transition: transform .2s ease, width .2s ease;
  box-shadow: 4px 0 24px rgba(15,23,42,.05);
}
.mc-sidebar.is-open { transform: translateX(0); }

.mc-sidebar-workspace {
  padding: 14px 12px 12px;
  border-bottom: 1px solid var(--border);
}
.mc-workspace-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
}
.mc-workspace-link:hover { background: var(--canvas); }
.mc-workspace-avatar {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #4338ca 0%, #1f2937 100%);
  color: #fff; font-weight: 800; font-size: 15px;
  flex-shrink: 0;
}
.mc-workspace-meta { display: flex; flex-direction: column; min-width: 0; }
.mc-workspace-name { font-weight: 700; font-size: 14px; line-height: 1.1; color: var(--text); }
.mc-workspace-sub { font-size: 11px; color: var(--text-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mc-sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 6px 8px 6px;
}
.mc-sidebar-section { padding: 4px 0 8px; }
.mc-sidebar-section + .mc-sidebar-section { border-top: 1px solid var(--border); padding-top: 10px; }
.mc-sidebar-heading {
  padding: 6px 12px 4px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.mc-sidebar-nav { display: flex; flex-direction: column; gap: 1px; }

/* ── Collapsible <details> sidebar groups (Explore / Learn / My Org) ── */
.mc-side-group { padding: 8px 0; }
.mc-side-group > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  user-select: none;
  transition: background 0.15s ease;
}
.mc-side-group > summary::-webkit-details-marker { display: none; }
.mc-side-group > summary:hover {
  background: rgba(15, 23, 42, 0.04);
  color: var(--text);
}
.mc-side-group-chevron {
  transition: transform 0.2s ease;
  flex-shrink: 0;
  opacity: 0.55;
}
.mc-side-group[open] > summary .mc-side-group-chevron {
  transform: rotate(90deg);
}

.mc-side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  line-height: 1;
  position: relative;
  transition: background .12s ease, color .12s ease;
}
.mc-side-link svg { flex-shrink: 0; color: var(--muted); transition: color .12s ease; }
.mc-side-link:hover { background: #f1f5f9; color: var(--text); }
.mc-side-link:hover svg { color: var(--text-2); }
.mc-side-link.is-active {
  background: #eef2ff;
  color: var(--brand-2);
  font-weight: 600;
}
.mc-side-link.is-active svg { color: var(--brand-2); }
.mc-side-link.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px; bottom: 6px;
  width: 3px;
  background: var(--brand-2);
  border-radius: 0 3px 3px 0;
}

.mc-sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  background: #fafafa;
}
.mc-sidebar-footer:hover { background: #f1f5f9; }
.mc-sidebar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.mc-sidebar-avatar-fallback {
  display: grid; place-items: center;
  background: var(--brand-2);
  color: #fff; font-weight: 700; font-size: 13px;
}
.mc-sidebar-foot-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mc-sidebar-foot-name { font-size: 13px; font-weight: 600; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mc-sidebar-foot-mail { font-size: 11px; color: var(--text-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mc-shell-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 35;
}
.mc-shell-backdrop.is-open { opacity: 1; pointer-events: auto; }

@media (min-width: 768px) {
  /* Docked sidebar — sticky flex item, NOT fixed/floating.
     Width scales gently with viewport so on a 1280-wide MacBook it doesn't
     dominate, on a 27" iMac it grows enough to keep nav labels readable. */
  .mc-sidebar {
    position: sticky;
    top: 60px;
    left: auto;
    bottom: auto;
    width: clamp(220px, 17vw, 264px);
    height: calc(100vh - 60px);
    transform: none;
    box-shadow: none;
    align-self: flex-start;
    flex-shrink: 0;
    /* Smooth collapse animation so the user actually sees it work */
    transition: width 0.22s cubic-bezier(.4,0,.2,1);
  }
  .mc-shell-backdrop { display: none; }
  /* Main: take everything left of the sidebar. min-width:0 is critical so
     children that overflow (long tables, code blocks) don't push the layout. */
  body.has-shell .mc-main-shell {
    margin-left: 0;
    max-width: none;
    flex: 1 1 0%;
    min-width: 0;
    width: auto;
  }
  /* Inner: fluid, no width cap, generous internal padding via the main's
     own px-* utility. Letting it go full-bleed means pages that DO want a
     narrower reading column (long-form articles) opt in explicitly with
     mx-auto max-w-* on the content they render. */
  body.has-shell .mc-main-inner {
    max-width: none;
    width: 100%;
    margin: 0;
  }

  /* Collapsed rail — icons only, 64px */
  .mc-sidebar.is-collapsed { width: 64px; }
  .mc-sidebar.is-collapsed .mc-workspace-meta,
  .mc-sidebar.is-collapsed .mc-side-link span:not(.sr-only),
  .mc-sidebar.is-collapsed .mc-sidebar-heading,
  .mc-sidebar.is-collapsed .mc-sidebar-foot-meta,
  .mc-sidebar.is-collapsed #mc-credit-pill .font-normal,
  .mc-sidebar.is-collapsed #mc-credit-pill .text-\[10px\] { display: none; }
  .mc-sidebar.is-collapsed .mc-side-link { justify-content: center; padding: 10px 0; }
  .mc-sidebar.is-collapsed .mc-sidebar-footer { justify-content: center; padding: 10px 4px; }
  .mc-sidebar.is-collapsed .mc-workspace-link { justify-content: center; padding: 8px 0; }
  .mc-sidebar.is-collapsed #mc-credit-pill { padding: 6px 4px; }
  .mc-sidebar.is-collapsed #mc-credit-pill span > span:first-child { gap: 0; }
  .mc-sidebar.is-collapsed #mc-credit-pill #mc-credit-balance { font-size: 9px; }

  /* Collapse button — icon-only, top-right of the sidebar header.
     Industry-standard placement (Linear / Notion / Arc / Vercel).
     Higher specificity (id selector) so it wins over Tailwind utilities. */
  #mc-sidebar-collapse.mc-collapse-btn--top {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-2);
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
    transition: background .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
  }
  #mc-sidebar-collapse.mc-collapse-btn--top:hover {
    background: rgba(67, 56, 202, 0.08);
    color: var(--brand-2);
    border-color: rgba(67, 56, 202, 0.15);
  }
  #mc-sidebar-collapse.mc-collapse-btn--top:active {
    transform: scale(0.94);
  }
  .mc-collapse-icon { transition: transform .25s ease; flex-shrink: 0; }
  /* When collapsed, the icon flips visually so the user knows clicking
     re-expands. The sidebar.is-collapsed selector handles the rotation. */
  .mc-sidebar.is-collapsed .mc-collapse-icon { transform: scaleX(-1); }
  /* When sidebar is collapsed the workspace becomes a single column; center
     the (now lone) collapse button. */
  .mc-sidebar.is-collapsed .mc-sidebar-workspace { justify-content: center; }
  .mc-sidebar.is-collapsed .mc-sidebar-workspace .mc-workspace-link { display: none; }
  .mc-sidebar.is-collapsed #mc-sidebar-collapse.mc-collapse-btn--top {
    margin: 0 auto;
  }
}
/* On mobile, the collapse rail is meaningless — hide via the
   element id so it wins over any Tailwind utility. */
@media (max-width: 767.98px) {
  #mc-sidebar-collapse { display: none !important; }
}
@media (max-width: 767.98px) {
  /* Hide the collapse toggle on mobile — the drawer pattern owns this UX */
  .mc-sidebar-collapse { display: none; }
}
/* iPad-portrait: narrower default — collapse-rail still works */
@media (min-width: 768px) and (max-width: 1023px) {
  .mc-sidebar { width: 220px; }
}
/* Ultrawide: NO outer width cap on .mc-main-inner — that was creating equal
   empty margins on both sides ("gap between content and sidebar" complaint).
   Content goes full-bleed; individual narrow-reading sections opt in via
   their own max-w-* + mx-auto wrappers. */

/* ---- Bottom tab bar (mobile only) ---- */
.mc-bottombar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  z-index: 30;
  box-shadow: 0 -2px 12px rgba(15,23,42,.06);
}
.mc-bottom-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
  line-height: 1;
}
.mc-bottom-link svg { color: var(--muted); }
.mc-bottom-link.is-active,
.mc-bottom-link:active { color: var(--brand-2); }
.mc-bottom-link.is-active svg,
.mc-bottom-link:active svg { color: var(--brand-2); }

/* ────────────────────────────────────────────────────────────────────────
   Framer-style design language — applied broadly across landing + dashboard
   ──────────────────────────────────────────────────────────────────────── */

/* Mesh / gradient backgrounds for hero + section dividers */
.mc-mesh {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.mc-mesh::before {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: -1;
  background:
    radial-gradient(circle at 18% 22%, rgba(67,56,202,.18), transparent 45%),
    radial-gradient(circle at 82% 28%, rgba(168,85,247,.14), transparent 50%),
    radial-gradient(circle at 50% 92%, rgba(14,165,233,.12), transparent 55%);
  filter: blur(40px);
  opacity: .9;
}
.mc-mesh-dark {
  background: linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
  color: #fff;
}
.mc-mesh-dark::before {
  background:
    radial-gradient(circle at 15% 20%, rgba(99,102,241,.34), transparent 45%),
    radial-gradient(circle at 85% 30%, rgba(217,70,239,.20), transparent 50%),
    radial-gradient(circle at 50% 100%, rgba(34,211,238,.18), transparent 55%);
  opacity: 1;
}

/* Big display typography — Framer-pricing-style */
.display-1 {
  font-size: clamp(2.5rem, 5.6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.02;
}
.display-2 {
  font-size: clamp(2rem, 3.8vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
}
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--text-2);
}
.gradient-text {
  background: linear-gradient(135deg, var(--brand-2) 0%, #a855f7 50%, #06b6d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Soft glass card */
.glass-card {
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(15,23,42,.06);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(15,23,42,.08);
}

/* CTA button — refined */
.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--text);
  color: #fff;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 4px 16px rgba(15,23,42,.2);
}
.btn-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15,23,42,.28); color:#fff; }
.btn-cta-light {
  background: #fff; color: var(--text);
  box-shadow: 0 2px 10px rgba(15,23,42,.08);
}
.btn-cta-light:hover { color: var(--text); }

/* Pricing card — framer.com/pricing inspired */
.price-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.price-card:hover {
  transform: translateY(-2px);
  border-color: var(--text-2);
  box-shadow: 0 12px 32px rgba(15,23,42,.08);
}
.price-card.is-featured {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  border-color: transparent;
  position: relative;
}
.price-card.is-featured::after {
  content: attr(data-badge);
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #a855f7, #06b6d4);
  color: #fff;
  font-size: 10px; font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: .08em;
}
.price-amount {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.price-features {
  margin-top: 8px;
  display: flex; flex-direction: column;
  gap: 8px;
  font-size: 13.5px;
}
.price-features li { display: flex; gap: 8px; align-items: flex-start; }
.price-features li::before { content: "✓"; color: var(--brand-2); font-weight: 800; margin-top: -1px; }
.price-card.is-featured .price-features li::before { color: #06b6d4; }

/* Feature row for the comparison table look */
.feature-row {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.feature-row:hover { background: #fafafa; }
.feature-row .feat { color: var(--text-2); }
.feature-row .yes { color: var(--brand-2); font-weight: 700; }
.feature-row .no { color: var(--muted); }

/* Reveal-on-scroll baseline — CSS-first so content is visible without JS.
   Only when motion.js has successfully loaded (html.motion-ready) do we
   hide elements pending the IntersectionObserver fade-in. This was the
   empty-white-card bug: if the CDN failed, opacity:0 stuck forever. */
[data-reveal] { will-change: opacity, transform; }
html.motion-ready [data-reveal] { opacity: 0; transform: translateY(18px); }
/* Respect user reduced-motion preference + safety net: never hide. */
@media (prefers-reduced-motion: reduce) {
  html.motion-ready [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* Section scroll-snap helper */
.snap-y { scroll-snap-type: y mandatory; }
.snap-start { scroll-snap-align: start; }

/* Color-swatch picker for brand customization */
.color-swatch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
}
.color-swatch.is-selected {
  border-color: var(--text);
  box-shadow: 0 0 0 2px #fff inset;
}
.color-swatch input[type=radio] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}

/* Social icon row */
.social-row {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.social-row a {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--canvas);
  color: var(--text-2);
  border: 1px solid var(--border);
  transition: transform .15s ease, color .15s ease, background .15s ease;
}
.social-row a:hover { transform: translateY(-2px); color: var(--brand-2); background: #eef2ff; }

/* ──────────────────────────────────────────────────────────────────────────
   Framer.com-grade polish: hero orbs, marquee, bento, parallax, magnetic CTA
   ──────────────────────────────────────────────────────────────────────── */

/* Floating orbs in a hero background. Place inside a .mc-mesh container. */
.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(80px);
  opacity: .5;
  pointer-events: none;
  will-change: transform;
  z-index: -1;
}
@keyframes orb-float-1 { 0%,100% { transform: translate3d(0,0,0); } 50% { transform: translate3d(40px,-30px,0); } }
@keyframes orb-float-2 { 0%,100% { transform: translate3d(0,0,0); } 50% { transform: translate3d(-50px,20px,0); } }
@keyframes orb-float-3 { 0%,100% { transform: translate3d(0,0,0); } 50% { transform: translate3d(20px,40px,0); } }
.orb-1 { background: rgba(99,102,241,.55); animation: orb-float-1 14s ease-in-out infinite; }
.orb-2 { background: rgba(168,85,247,.45); animation: orb-float-2 18s ease-in-out infinite; }
.orb-3 { background: rgba(14,165,233,.45); animation: orb-float-3 22s ease-in-out infinite; }

/* Landing page connecting-dots background — fixed full viewport.
   Uses normal blending (no multiply) so the indigo/purple particles glow
   over both the dark hero and the white sections below. Sits at z-index 0
   beneath everything else. */
.mc-landing-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
}
.mc-landing-bg + section,
.mc-landing-bg ~ section,
.mc-landing-bg ~ div { position: relative; z-index: 1; }

/* ──────────────────────────────────────────────────────────────────────────
   Dark immersive hero (corama-style aesthetic).
   ──────────────────────────────────────────────────────────────────────── */
.hero-dark {
  background: radial-gradient(ellipse at center, #1e293b 0%, #0a0f1e 60%, #050810 100%);
  min-height: 78vh;
  padding: 96px 24px 120px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #fff;
}
@media (max-width: 768px) {
  .hero-dark { min-height: 70vh; padding: 64px 18px 80px; }
}
.hero-radar {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
@keyframes radar-sweep {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.hero-radar-sweep {
  transform-origin: 600px 400px;
  animation: radar-sweep 6s linear infinite;
  mix-blend-mode: screen;
}
@keyframes blip-pulse {
  0%, 100% { opacity: .25; r: 2; }
  50%      { opacity: 1; r: 4; }
}
.hero-blips circle {
  animation: blip-pulse 2.4s ease-in-out infinite;
}
.hero-blips circle:nth-child(1) { animation-delay: 0s; }
.hero-blips circle:nth-child(2) { animation-delay: .4s; }
.hero-blips circle:nth-child(3) { animation-delay: .8s; }
.hero-blips circle:nth-child(4) { animation-delay: 1.2s; }
.hero-blips circle:nth-child(5) { animation-delay: 1.6s; }
.hero-blips circle:nth-child(6) { animation-delay: 2.0s; }

.hero-dark-content {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero-dark-title {
  margin-top: 28px;
  font-size: clamp(2.6rem, 7vw, 6.2rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.96;
  color: #fff;
  text-wrap: balance;
}
.hero-dark-accent {
  background: linear-gradient(135deg, #818cf8 0%, #a855f7 60%, #06b6d4 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* RFX word cycler — types each variant, blinks a caret. The gradient matches
   the hero accent so the rotating word reads as a single brand mark. */
.rfx-cycler {
  display: inline-flex;
  align-items: baseline;
  min-width: 0;
  background: linear-gradient(135deg, #818cf8 0%, #a855f7 60%, #06b6d4 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-ligatures: none;
  position: relative;
  text-shadow: 0 0 60px rgba(168, 85, 247, .25);
}
.rfx-cycler-track {
  display: inline-block;
  white-space: nowrap;
}
.rfx-cycler-caret {
  display: inline-block;
  margin-inline-start: 6px;
  color: #a5b4fc;
  background: none;
  -webkit-text-fill-color: #a5b4fc;
  animation: rfx-caret-blink 1s steps(2, end) infinite;
  font-weight: 400;
  transform: translateY(-2px);
}
@keyframes rfx-caret-blink {
  50% { opacity: 0; }
}
.hero-dark-lead {
  margin-top: 22px;
  font-size: clamp(1rem, 1.4vw, 1.18rem);
  color: rgba(255,255,255,.72);
  line-height: 1.55;
  max-width: 640px;
}
.hero-dark-cta {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
}
.hero-dark-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 15px 28px;
  background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
  box-shadow: 0 8px 32px rgba(99,102,241,.4);
  will-change: transform;
}
.hero-dark-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(99,102,241,.55);
  color: #fff;
}
.hero-dark-btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 15px 22px;
  color: rgba(255,255,255,.85);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 999px;
  transition: color .15s ease, background .15s ease;
}
.hero-dark-btn-secondary:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
}

/* Hero display headline — clamp on phone, oversized on desktop */
.display-hero {
  font-size: clamp(2.4rem, 6.4vw, 5.6rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 0.96;
}

/* Edge-to-edge hero wrapper (only on the landing page) */
.hero-full {
  position: relative;
  padding-left: clamp(20px, 5vw, 64px);
  padding-right: clamp(20px, 5vw, 64px);
}
.hero-full-inner {
  max-width: 1480px;
  margin: 0 auto;
}

/* ──────────────────────────────────────────────────────────────────────
   Live contract ticker — sits below the dark hero, before the stats card.
   Same horizontal-scroll mechanic as the marquee but content is real
   contracts streamed from /api/public/contract-ticker.
   ────────────────────────────────────────────────────────────────────── */
.rfx-ticker-wrap {
  position: relative;
  z-index: 2;
  margin-top: -28px;
  background: linear-gradient(180deg, rgba(15,23,42,0.95) 0%, rgba(15,23,42,0.85) 100%);
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: #fff;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.rfx-ticker-label {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .18em;
  background: linear-gradient(135deg, #4338ca, #a855f7);
  color: #fff;
  z-index: 2;
  box-shadow: 4px 0 14px rgba(0,0,0,0.35);
}
.rfx-ticker-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34,197,94,0.85);
  animation: rfx-tdot 1.4s ease-in-out infinite;
}
@keyframes rfx-tdot { 50% { opacity: .35; } }
.rfx-ticker {
  flex: 1;
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to right, transparent 0, #000 4%, #000 96%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 4%, #000 96%, transparent 100%);
}
.rfx-ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 32px;
  white-space: nowrap;
  animation: rfx-ticker-scroll 80s linear infinite;
  padding: 11px 24px;
}
.rfx-ticker-wrap:hover .rfx-ticker-track { animation-play-state: paused; }
.rfx-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s ease;
}
.rfx-ticker-item:hover { color: #fff; }
.rfx-ticker-sep { opacity: 0.3; font-size: 11px; }
.rfx-ticker-val {
  background: linear-gradient(135deg, #818cf8, #a855f7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.rfx-ticker-tag {
  background: rgba(99,102,241,0.18);
  border: 1px solid rgba(168,85,247,0.45);
  color: #c7d2fe;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
@keyframes rfx-ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .rfx-ticker-track { animation: none !important; }
}

/* Marquee strip — trust / agency logos */
.marquee {
  overflow: hidden;
  position: relative;
  mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex;
  gap: 64px;
  width: max-content;
  animation: marquee 36s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 17px;
  color: var(--text-2);
  white-space: nowrap;
  opacity: .8;
  display: inline-flex; align-items: center; gap: 8px;
}
.marquee-item::before { content: "●"; font-size: 6px; opacity: .35; }
@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Bento — Framer-style asymmetric feature grid (auto-stacks on phone) */
.bento {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}
@media (min-width: 768px) {
  .bento {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-auto-rows: 1fr;
  }
  .bento-2x2 { grid-column: span 3 / span 3; grid-row: span 2 / span 2; }
  .bento-2x1 { grid-column: span 3 / span 3; }
  .bento-1x1 { grid-column: span 2 / span 2; }
  .bento-3x1 { grid-column: span 3 / span 3; }
  .bento-4x1 { grid-column: span 4 / span 4; }
}
.bento-tile {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px;
  position: relative;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  isolation: isolate;
}
.bento-tile:hover {
  transform: translateY(-4px);
  border-color: var(--text-2);
  box-shadow: 0 16px 40px rgba(15,23,42,.08);
}
.bento-tile.is-dark {
  background: linear-gradient(140deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  border-color: transparent;
}
.bento-tile.is-dark::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 20% 20%, rgba(99,102,241,.5), transparent 50%);
  z-index: -1;
}
.bento-tile.is-accent {
  background: linear-gradient(140deg, #4338ca 0%, #7c3aed 60%, #06b6d4 130%);
  color: #fff;
  border-color: transparent;
}
.bento-tile-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.bento-tile-title { font-size: clamp(1.3rem, 2.2vw, 1.8rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.015em; margin-top: 10px; }
.bento-tile-desc { font-size: 14px; line-height: 1.5; margin-top: 8px; opacity: .85; }
.bento-tile-art {
  position: absolute; top: 18px; right: 18px;
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 14px;
  background: rgba(15,23,42,.06);
  color: var(--text-2);
}
.bento-tile.is-dark .bento-tile-art,
.bento-tile.is-accent .bento-tile-art { background: rgba(255,255,255,.12); color: #fff; }

/* Magnetic CTA — subtle hover lift with gradient sweep */
.btn-magnetic {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.btn-magnetic::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #4338ca, #a855f7, #06b6d4);
  opacity: 0;
  z-index: -1;
  transition: opacity .25s ease;
}
.btn-magnetic:hover::before { opacity: 1; }
.btn-magnetic:hover { color: #fff; }

/* Scroll-tied parallax (driven by IntersectionObserver+JS via --p var) */
.parallax { transform: translate3d(0, calc(var(--p, 0) * -40px), 0); will-change: transform; }
.parallax-slow { transform: translate3d(0, calc(var(--p, 0) * -20px), 0); will-change: transform; }
.parallax-fast { transform: translate3d(0, calc(var(--p, 0) * -80px), 0); will-change: transform; }

/* Sticky mobile CTA bar (above the bottom tab bar when authenticated) */
.mobile-cta-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  z-index: 25;
  display: none;
}
@media (max-width: 640px) {
  body.has-mobile-cta .mobile-cta-bar { display: block; }
  body.has-mobile-cta main { padding-bottom: 100px; }
}

/* iPad-portrait tuning (768-1023): just brandbar + display sizing.
   NOTE: do NOT set margin-left on .mc-main-shell here — the sidebar
   is a sticky FLEX child so it already takes its space; adding a
   margin-left double-shifts content and leaves dead space on the
   right. The newer layout block above (line ~582-650) handles all
   sidebar/main sizing correctly via clamp() + flex:1. */
@media (min-width: 768px) and (max-width: 1023px) {
  .brandbar input[type="search"] { width: 200px; }
  .display-hero { font-size: clamp(3rem, 6.5vw, 5rem); }
  .bento-2x2 { grid-row: span 1 / span 1; }
  .bento-tile { min-height: 180px; padding: 22px; }
}

/* Desktop ultrawide: only widens the brandbar/footer max-w-7xl cap.
   The OLD rule `mc-main-shell > div { max-width: 1400px }` was the
   exact cause of the "big empty space on the right" complaint —
   killed. Inner pages now go full-bleed; pages that want narrow
   reading columns opt in via their own max-w-* + mx-auto. */
@media (min-width: 1536px) {
  .max-w-7xl { max-width: 92rem; }
}

/* Better phone defaults */
@media (max-width: 640px) {
  .display-1 { font-size: clamp(2.2rem, 9vw, 3.2rem); }
  .display-2 { font-size: clamp(1.6rem, 6vw, 2.2rem); }
  .display-hero { font-size: clamp(2.2rem, 11vw, 3.4rem); letter-spacing: -0.025em; }
  .card-padded { padding: 16px; }
  .mc-sidebar { width: 84vw; max-width: 320px; }
  /* Brandbar shrinks on phone */
  .brandbar input[type="search"] { display: none; }
}

/* ──────────────────────────────────────────────────────────────────────
   MOBILE HAMBURGER — pure HTML <details> dropdown (no JS).
   The browser natively toggles open/closed on tap of the <summary>.
   ────────────────────────────────────────────────────────────────────── */

#rfx-mobile-nav summary {
  list-style: none;
  -webkit-tap-highlight-color: rgba(255,255,255,.2);
}
#rfx-mobile-nav summary::-webkit-details-marker { display: none; }
#rfx-mobile-nav summary::marker { content: ""; }

.rfx-mobile-menu {
  position: fixed;
  top: 60px;
  left: 0; right: 0;
  bottom: 0;
  background: #fff;
  z-index: 60;
  overflow-y: auto;
  padding: 12px 0 calc(80px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  animation: rfx-menu-in .22s ease-out;
}
@keyframes rfx-menu-in {
  from { transform: translateY(-8px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Backdrop dim when open — uses :has() which is supported on iOS 15.4+, Chrome 105+ */
body:has(#rfx-mobile-nav[open])::after {
  content: "";
  position: fixed;
  top: 60px; left: 0; right: 0; bottom: 0;
  background: rgba(15,23,42,.0);
  z-index: 55;
  pointer-events: none;
}
/* Lock body scroll when menu is open */
body:has(#rfx-mobile-nav[open]) { overflow: hidden; }

.rfx-mobile-section {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.rfx-mobile-section:last-child { border-bottom: 0; }
.rfx-mobile-section-title {
  padding: 12px 20px 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.rfx-mobile-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  min-height: 48px;
  border-left: 3px solid transparent;
  transition: background .12s ease, border-color .12s ease;
}
.rfx-mobile-link svg { color: var(--text-2); flex-shrink: 0; }
.rfx-mobile-link:hover, .rfx-mobile-link:active {
  background: #f1f5f9;
  color: var(--brand-2);
}
.rfx-mobile-link:hover svg, .rfx-mobile-link:active svg { color: var(--brand-2); }
.rfx-mobile-link.is-active {
  background: #eef2ff;
  color: var(--brand-2);
  border-left-color: var(--brand-2);
}
.rfx-mobile-link.is-active svg { color: var(--brand-2); }

/* Hide the existing slide-in drawer on small phones now that the
   <details> dropdown is the mobile nav. Desktop tablet+ keeps the docked
   sidebar (handled by the existing media queries). */
@media (max-width: 767.98px) {
  #mc-sidebar { display: none !important; }
  #mc-shell-backdrop { display: none !important; }
}

/* ──────────────────────────────────────────────────────────────────────
   FULL-BLEED LANDING SECTIONS
   Each section extends its background edge-to-edge while the inner
   content stays readable (max-width: 1280px). Alternating background
   styles give the landing rhythmic, cinematic feel.
   ────────────────────────────────────────────────────────────────────── */

.rfx-section {
  width: 100%;
  position: relative;
  padding: clamp(48px, 7vw, 96px) clamp(20px, 5vw, 64px);
}
.rfx-section-inner {
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.rfx-section.is-dark {
  background: linear-gradient(180deg, #0a0f1e 0%, #1e1b4b 100%);
  color: #fff;
}
.rfx-section.is-dark .text-slate-900 { color: #fff !important; }
.rfx-section.is-dark .text-slate-600 { color: rgba(255,255,255,0.72) !important; }
.rfx-section.is-dark .text-slate-500 { color: rgba(255,255,255,0.55) !important; }
.rfx-section.is-dark .card {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.10);
  color: #fff;
}
.rfx-section.is-dark .card .text-slate-600,
.rfx-section.is-dark .card .text-slate-500 { color: rgba(255,255,255,0.65) !important; }
.rfx-section.is-mesh {
  background:
    radial-gradient(ellipse at 20% 30%, rgba(99,102,241,0.18), transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(168,85,247,0.16), transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(6,182,212,0.12), transparent 50%),
    #ffffff;
}
.rfx-section.is-soft { background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%); }
.rfx-section.is-accent {
  background: linear-gradient(135deg, #4338ca 0%, #7c3aed 50%, #06b6d4 100%);
  color: #fff;
}
.rfx-section.is-accent .text-slate-900,
.rfx-section.is-accent .text-slate-600,
.rfx-section.is-accent .text-slate-500 { color: rgba(255,255,255,0.92) !important; }

/* Section "eyebrow" + heading typography on full-bleed sections */
.rfx-section .eyebrow { color: var(--brand-2); }
.rfx-section.is-dark .eyebrow { color: #a5b4fc; }
.rfx-section.is-accent .eyebrow { color: rgba(255,255,255,0.85); }

/* Soft top + bottom bleed transitions between sections */
.rfx-section.is-dark + .rfx-section:not(.is-dark)::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 80px;
  background: linear-gradient(180deg, rgba(15,23,42,0.18) 0%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

/* ──────────────────────────────────────────────────────────────────────
   MOBILE EXPERIENCE — comprehensive pass
   Focused improvements for phones (≤ 640px) and small tablets (≤ 767px).
   Goals: tap targets ≥44px, no horizontal scroll, sticky CTAs, scrollable
   chip rows, admin tables that read as cards, comfortable typography.
   ────────────────────────────────────────────────────────────────────── */

/* ---- Universal mobile-first helpers ---- */
@media (max-width: 767.98px) {
  /* Kill any accidental horizontal scroll caused by full-bleed sections */
  html, body { overflow-x: hidden; }
  /* Push content above the fixed bottom tab bar when authenticated */
  body.has-shell main { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  body.has-shell.has-mobile-cta main { padding-bottom: calc(140px + env(safe-area-inset-bottom)); }

  /* Larger, more comfortable form inputs on phones */
  .form-input, .form-select, input[type="search"], input[type="text"], input[type="email"], input[type="tel"], input[type="url"], select, textarea {
    font-size: 16px !important;
    padding: 12px 14px !important;
    border-radius: 10px;
  }
  /* Touch targets — buttons + nav items must be at least 44px */
  .btn, .btn-cta, .btn-sm, .btn-secondary, .btn-primary, .btn-accent, .btn-icon, .chip {
    min-height: 42px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .btn-icon { width: 42px; height: 42px; padding: 0; }
  .mc-side-link, .mc-bottom-link { min-height: 48px; }

  /* Cards: more breathing room */
  .card-padded { padding: 16px; }

  /* Tighter section spacing on phones */
  section.mt-12, section.mt-16, section.mt-10 { margin-top: 32px !important; }
  section.mt-8 { margin-top: 24px !important; }

  /* Brandbar: hide the search input on phone (already partly done) */
  .brandbar input[type="search"] { display: none; }
  .brandbar > div { padding-top: 4px; padding-bottom: 4px; gap: 8px; }
  .brandbar .nav-link { padding: 12px 8px; font-size: 13px; }

  /* Sidebar drawer — adjust width */
  .mc-sidebar { width: 86vw; max-width: 320px; }

  /* Hero typography for very small screens */
  .hero-dark { padding: 72px 18px 56px; min-height: 64vh; }
  .hero-dark-title { font-size: clamp(2rem, 9.5vw, 3.4rem) !important; line-height: 1.02 !important; }
  .hero-dark-lead { font-size: 15px; max-width: 520px; }
  .hero-dark-cta { gap: 10px; }
  .hero-dark-btn-primary, .hero-dark-btn-secondary {
    padding: 14px 22px; font-size: 15px;
  }

  /* Word cycler — never let it overflow the viewport */
  .rfx-cycler { display: inline-block; max-width: 100%; }
  .rfx-cycler-track { max-width: calc(100vw - 40px); overflow: hidden; text-overflow: ellipsis; }

  /* Live ticker — smaller text + faster scroll */
  .rfx-ticker-label { padding: 8px 12px; font-size: 9.5px; }
  .rfx-ticker-track { gap: 22px; padding: 10px 16px; animation-duration: 60s; font-size: 12px; }
  .rfx-ticker-item { font-size: 12px; }
  .rfx-ticker-val { font-size: 13px; }
  .rfx-ticker-tag { font-size: 10px; padding: 1px 6px; }

  /* Bento tiles — single column with breathing room */
  .bento-tile { min-height: 160px; padding: 20px; }
  .bento-tile-title { font-size: 1.15rem !important; }
  .bento-tile-desc { font-size: 13px; }

  /* List rows on /contracts — make the whole row obviously tappable */
  .list-row {
    padding: 14px 16px 16px;
  }
  .list-row .title { font-size: 15px; line-height: 1.3; }
  .list-row .meta { font-size: 12.5px; }
  .list-row .footer { font-size: 12px; }

  /* Filter chip row → horizontal scroll without showing a scrollbar */
  .mc-mobile-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 16px 12px;
    margin: 0 -16px;
    scroll-snap-type: x proximity;
  }
  .mc-mobile-scroll::-webkit-scrollbar { display: none; }
  .mc-mobile-scroll > * { scroll-snap-align: start; flex-shrink: 0; }

  /* Admin tables → render as cards */
  .mc-mobile-cards table { display: block; }
  .mc-mobile-cards thead { display: none; }
  .mc-mobile-cards tbody { display: block; }
  .mc-mobile-cards tr {
    display: block;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
  }
  .mc-mobile-cards td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 6px 0 !important;
    border: 0;
    text-align: right;
    font-size: 13px;
  }
  .mc-mobile-cards td::before {
    content: attr(data-label);
    text-align: left;
    color: var(--text-2);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    flex-shrink: 0;
  }
  .mc-mobile-cards td[data-label=""]::before { content: none; }

  /* Contract detail: stack 2-col grid into 1-col without specific class */
  section.grid.lg\:grid-cols-\[1\.6fr_1fr\] { grid-template-columns: 1fr; }
  section.grid.lg\:grid-cols-\[1fr_280px\] { grid-template-columns: 1fr; }
  section.grid.lg\:grid-cols-\[1\.2fr_1fr\] { grid-template-columns: 1fr; }

  /* Display headings shrink */
  .display-1 { font-size: clamp(2rem, 9vw, 3rem) !important; letter-spacing: -.025em; }
  .display-2 { font-size: clamp(1.5rem, 7vw, 2.2rem) !important; }
}

/* ---- Tablet portrait (768-1023): keep desktop layout but tighter ---- */
@media (min-width: 768px) and (max-width: 1023px) {
  .hero-dark-title { font-size: clamp(2.6rem, 6.5vw, 4.4rem); }
  .bento-tile { padding: 22px; min-height: 180px; }
}

/* ---- Sticky mobile CTA bar on contract detail ---- */
.mc-mobile-cta-bar {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 30;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 18px rgba(15,23,42,.08);
  gap: 8px;
  align-items: center;
}
.mc-mobile-cta-bar .mc-mobile-cta-meta {
  flex: 1;
  min-width: 0;
}
.mc-mobile-cta-bar .mc-mobile-cta-title {
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.mc-mobile-cta-bar .mc-mobile-cta-due {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-2);
  margin-top: 2px;
}
.mc-mobile-cta-bar .btn { white-space: nowrap; flex-shrink: 0; }
@media (max-width: 767.98px) {
  body.has-mobile-cta .mc-mobile-cta-bar { display: flex; }
  body.has-mobile-cta .mc-bottombar { bottom: 64px; }
}

/* ---- Better default tap feedback on iOS ---- */
button, a {
  -webkit-tap-highlight-color: rgba(67,56,202,0.12);
  touch-action: manipulation;
}

/* ---- Mobile-only floating "back to top" button (auto-shows on scroll) ---- */
.mc-back-top {
  display: none;
  position: fixed;
  right: 14px;
  bottom: calc(80px + env(safe-area-inset-bottom));
  z-index: 28;
  width: 44px; height: 44px;
  background: rgba(15,23,42,0.85);
  color: #fff;
  border-radius: 50%;
  border: 0;
  display: none;
  place-items: center;
  box-shadow: 0 6px 20px rgba(15,23,42,.25);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
@media (max-width: 767.98px) {
  body.has-back-top .mc-back-top { display: grid; }
}

/* Sane fallback for prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
    scroll-behavior: auto !important;
  }
  .marquee-track { animation: none !important; }
  .orb { animation: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════
   RESPONSIVE OVERHAUL — iPhone / iPad / Desktop polish
   Targets:
     iPhone portrait: 375-428px
     iPad portrait:   768-834px
     iPad landscape:  1024-1180px
     Desktop:         1280px+
   ═══════════════════════════════════════════════════════════════════ */

/* iPhone (≤640px) — tighten typography + spacing, never let cards
   overflow the viewport, keep CTAs at least 44px tap target. */
@media (max-width: 640px) {
  body { font-size: 15px; }
  h1, .display-1 { font-size: 2.25rem !important; line-height: 1.1 !important; }
  h2, .display-2 { font-size: 1.875rem !important; line-height: 1.15 !important; }
  h3 { font-size: 1.25rem !important; }

  /* Tap targets — Apple HIG says min 44pt, Material says 48dp */
  a.btn, button.btn, .btn-cta, .btn-magnetic {
    min-height: 44px;
    padding-top: 11px;
    padding-bottom: 11px;
  }

  /* Cards on mobile take full width with comfortable padding */
  .card-padded { padding: 16px; }

  /* Floating CTAs — feedback + sofia — don't overlap the bottom tab bar */
  #sofia-toggle, #mc-fb-toggle {
    bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px)) !important;
  }
  #sofia-panel, #mc-fb-panel {
    bottom: calc(8.5rem + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Hero stat grids — never let numbers crush each other */
  .grid-cols-2 > * { min-width: 0; }

  /* Forms — full width inputs on phone */
  .form-input, .form-select, textarea.form-input {
    font-size: 16px; /* prevents iOS auto-zoom on focus */
  }
}

/* iPhone landscape (max-width 928px AND landscape orientation) */
@media (max-width: 928px) and (orientation: landscape) and (max-height: 500px) {
  /* Hero sections shouldn't push the CTA off-screen */
  section.pt-12, section.pt-16, section.pt-20, section.pt-24 {
    padding-top: 2.5rem !important;
    padding-bottom: 2rem !important;
  }
}

/* iPad portrait (768-1024px) — sidebar is narrower, content fluid, larger
   tap targets than desktop. */
@media (min-width: 768px) and (max-width: 1023px) {
  body.has-shell .mc-main-shell {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }
  /* Smaller display headings — iPad portrait is narrower */
  h1.text-7xl { font-size: 3.5rem !important; }
  h2.text-5xl { font-size: 2.5rem !important; }

  /* Cards: tap-friendly */
  .card, .price-card { border-radius: 14px; }
}

/* iPad landscape (1024-1279) — feels like a small desktop. */
@media (min-width: 1024px) and (max-width: 1279px) {
  body.has-shell .mc-main-shell {
    padding-left: 2rem !important;
    padding-right: 2rem !important;
  }
}

/* Desktop XL (1536px+) — generous padding, but content stays fluid */
@media (min-width: 1536px) {
  body.has-shell .mc-main-shell {
    padding-left: 3rem !important;
    padding-right: 3rem !important;
  }
}

/* Ultrawide (1920px+) — keep content fluid. Earlier we capped at 1800px
   which left empty margins on external 4K monitors — user complaint.
   Now we just bump padding for breathing room; content fills the viewport
   minus padding. Individual sections opt in to narrow reading widths
   (max-w-3xl for FAQ, max-w-4xl for forms) where it actually helps. */
@media (min-width: 1920px) {
  body.has-shell .mc-main-shell {
    padding-left: 4rem !important;
    padding-right: 4rem !important;
  }
}

/* Sofia chat panel — full-screen on iPhone, fixed on tablet+ */
@media (max-width: 640px) {
  #sofia-panel {
    right: 0.5rem !important;
    left: 0.5rem !important;
    width: auto !important;
    bottom: calc(8.5rem + env(safe-area-inset-bottom, 0px)) !important;
    height: min(70vh, 520px) !important;
  }
  #mc-fb-panel {
    left: 0.5rem !important;
    right: 0.5rem !important;
    width: auto !important;
  }
}

/* Tables — horizontal scroll on small screens instead of overflow */
.overflow-x-auto { -webkit-overflow-scrolling: touch; }

/* Image safety — never overflow parent */
img { max-width: 100%; height: auto; }

/* ═══════════════════════════════════════════════════════════════════
   GLOBAL CARD POLISH — applies to every page using .card / .card-padded
   without touching individual templates. Subtle gradient border on
   hover, deeper shadow, smoother corners. Stripe/Linear-grade default.
   ═══════════════════════════════════════════════════════════════════ */
.card {
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #fff;
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.card:hover {
  box-shadow: 0 6px 24px -8px rgba(15, 23, 42, 0.08), 0 2px 4px -1px rgba(15, 23, 42, 0.03);
}
.card-padded { padding: 20px; }
@media (min-width: 640px)  { .card-padded { padding: 24px; } }
@media (min-width: 1024px) { .card-padded { padding: 28px; } }

/* Slightly tighter on grids — when a card sits inside a grid cell, the
   default 28px padding eats too much. Step down 20%. */
.grid > .card-padded { padding: 18px; }
@media (min-width: 640px)  { .grid > .card-padded { padding: 22px; } }
@media (min-width: 1024px) { .grid > .card-padded { padding: 24px; } }

/* KPI tile look — same .card.card-padded base, but the data-counter / */
/* tracking-widest combo signals it's a stat tile and we tighten further. */
.card.card-padded:has(.tracking-widest:first-child) {
  padding-top: 14px;
  padding-bottom: 14px;
}

/* Page-level top spacing — every authenticated page gets a consistent
   top breathing space without per-template tweaking. */
body.has-shell .mc-main-inner > section:first-child,
body.has-shell .mc-main-inner > div:first-child {
  padding-top: 1.5rem;
}

/* Section headings — global treatment so /grants /funders /alerts etc
   all match the dashboard styling. */
.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.section-header h1, .section-header h2 {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.section-header .eyebrow {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
  font-weight: 600;
}

/* Safe-area-aware bottom padding for the bottom tab bar so content
   isn't hidden behind it on iPhones with home indicator. */
@media (max-width: 767.98px) {
  body.has-shell .mc-main-shell {
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   KRATOS RESPONSIVE FINAL — iPhone / iPad portrait / iPad landscape
   Targets the new KRATOS landing + Sofia chat + feedback widget so the
   experience is sharp on each form factor. Built bottom-up from the
   actual viewport sizes Apple ships:
     iPhone 14/15 Pro:   393×852 (portrait)
     iPhone 16 Pro Max:  440×956
     iPad 11" portrait:  834×1194
     iPad 11" landscape: 1194×834
     iPad Pro 13:        1024×1366
   ═══════════════════════════════════════════════════════════════════ */

/* ─── iPhone portrait (≤480px wide) ────────────────────────────── */
@media (max-width: 480px) {
  /* Landing hero — text needs to breathe on a 393px screen */
  section.pt-16, section.pt-24, section.lg\:pt-32 {
    padding-top: 3rem !important;
  }
  h1.text-7xl, h1.lg\:text-7xl {
    font-size: 2.25rem !important;
    line-height: 1.08 !important;
  }
  h2.text-5xl, h2.lg\:text-5xl, h2.lg\:text-6xl {
    font-size: 1.875rem !important;
    line-height: 1.12 !important;
  }
  /* The demo-form input + button stack on phone */
  #demo-form > div {
    flex-direction: column !important;
  }
  #demo-submit {
    width: 100% !important;
  }
  /* Sofia + feedback floating buttons — pin tight to corners on phone,
     don't show the wordmark "Ask Sofia"/"Feedback" — icon only saves space. */
  #sofia-toggle span:not([class*="rounded-full"]) { display: none; }
  #mc-fb-toggle span { display: none; }
  /* Sofia panel full-width minus inset */
  #sofia-panel {
    height: min(78vh, 560px) !important;
  }
  /* Floating CTAs lifted above mobile bottom tab bar */
  #sofia-toggle  { bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px)) !important; }
  #mc-fb-toggle  { bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px)) !important; }
  /* Hero icon smaller on phone — was 96-128px, now ~80px */
  .h-24, .sm\:h-32 { height: 5rem !important; }
  /* Pricing cards stack one per row, no scaling */
  .grid.grid-cols-1.sm\:grid-cols-2.lg\:grid-cols-4 > article.lg\:scale-\[1\.03\] {
    transform: none !important;
  }
}

/* ─── iPad portrait (768-1023px) ──────────────────────────────── */
@media (min-width: 768px) and (max-width: 1023px) {
  /* Hero icon medium on tablets */
  img[src*="hero-icon"] { width: 110px !important; height: 110px !important; }
  /* Landing demo form takes 70% of viewport width on iPad portrait */
  #demo-form { max-width: 90% !important; }
  /* Pricing table: switch from 4-up to 2-up so cards stay readable */
  section.grid.grid-cols-1.sm\:grid-cols-2.lg\:grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  /* Featured pricing card sits in column 2 of row 1; un-scale it on iPad */
  section.grid.grid-cols-1.sm\:grid-cols-2.lg\:grid-cols-4 > article.lg\:scale-\[1\.03\] {
    transform: none !important;
  }
  /* Dashboard KPI grid: 3 across (we have 5 tiles → 3+2 rows is fine) */
  section.grid.grid-cols-2.md\:grid-cols-3.lg\:grid-cols-5 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

/* ─── iPad landscape (1024-1279px) ────────────────────────────── */
@media (min-width: 1024px) and (max-width: 1279px) {
  /* Pricing: 4 columns work but reduce card padding so they fit */
  section.grid.grid-cols-1.sm\:grid-cols-2.lg\:grid-cols-4 > article {
    padding: 18px !important;
  }
  /* Hero icon slightly larger on landscape iPad */
  img[src*="hero-icon"] { width: 130px !important; height: 130px !important; }
  /* Sidebar default — already clamps; keep tight */
  .mc-sidebar { width: clamp(220px, 18vw, 240px) !important; }
}

/* ─── Very narrow iPhone SE (≤375px) ────────────────────────── */
@media (max-width: 375px) {
  h1.text-4xl, h1.sm\:text-5xl { font-size: 1.875rem !important; }
  .btn { font-size: 0.875rem; padding-left: 14px; padding-right: 14px; }
  /* Sofia button text hidden — icon only */
  #sofia-toggle { padding: 0.5rem 0.75rem; }
}

