/* ---------- Self-hosted fonts ---------- */
/* Was loaded from fonts.googleapis.com / fonts.gstatic.com before. That
   leaked visitor IP addresses to Google on every page-load, which has
   been ruled a GDPR violation in EU courts (German court 2022). Self-
   hosting also removes a third-party CDN dependency. Latin subset only;
   if we ever need cyrillic/greek/etc. extend with additional files. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700; /* variable font — single file covers 400→700 */
  font-display: swap;
  src: url('/vendor/fonts/inter-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/vendor/fonts/playfair-display-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url('/vendor/fonts/playfair-display-latin-italic.woff2') format('woff2');
}

:root {
  --bg: #000000;
  --surface: #0A0A0A;
  --surface-elevated: #141414;
  --border: #1F1F1F;
  --border-strong: #2A2A2A;
  --text: #FFFFFF;
  --text-secondary: #A0A0A0;
  --text-tertiary: #606060;
  --accent: #C9A961;
  --accent-pressed: #A8894D;
  --accent-soft: rgba(201, 169, 97, 0.12);
  --error: #E5484D;
  --success: #30A46C;
  --display: 'Playfair Display', serif;
  --body: 'Inter', sans-serif;
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* Hard guard against any rogue element pushing horizontal scroll on
     mobile (e.g. tables, fixed-width images, very long unbroken strings).
     The y-axis is governed by per-page overflow rules. */
  overflow-x: hidden;
}

html, body { height: 100%; }
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-y: hidden;
}

/* Long unbroken strings (URLs, IDs) shouldn't punch out of cards on mobile. */
@media (max-width: 640px) {
  p, h1, h2, h3, .lede, .card-pitch, .card-name, .card-meta {
    overflow-wrap: anywhere;
    word-break: normal;
  }
  /* Images never overflow the column they're in. */
  img { max-width: 100%; height: auto; }
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--text); }

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- Nav ---------- */
.nav {
  flex-shrink: 0;
  z-index: 10;
  background: rgba(0,0,0,0.6);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 32px;
  max-width: 1040px;
  margin: 0 auto;
}
.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: -0.3px;
  color: var(--text);
}
.nav-brand:hover { color: var(--text); }
.nav-brand img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
}
.nav-brand em { font-style: italic; color: var(--accent); }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { color: var(--text-secondary); font-size: 14px; }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--accent);
  color: #000 !important;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.3px;
}
.nav-cta:hover { background: var(--accent-pressed); color: #000 !important; }

/* ---------- Typography ---------- */
.eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 28px;
}

h1.display {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(44px, 7vw, 88px);
  line-height: 1.02;
  letter-spacing: -1.5px;
}
h1.display em {
  font-style: italic;
  color: var(--accent);
}

h2.display {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.8px;
  margin-bottom: 20px;
}
h2.display em { font-style: italic; color: var(--accent); }

h3 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: -0.3px;
  margin-bottom: 12px;
}
h3 em { font-style: italic; color: var(--accent); }

.lede {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.55;
}

p { color: var(--text-secondary); }
p + p { margin-top: 14px; }

/* ---------- Hero ---------- */
/* align-items: flex-start with a viewport-relative padding-top keeps the
   Prometheus mark at a consistent vertical position across landing pages,
   even when the pages have different amounts of content below it. */
.hero {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(40px, 10vh, 130px) 0 70px;
  text-align: center;
}
.hero-mark {
  width: 56px;
  height: 56px;
  object-fit: contain;
  display: block;
  margin: 0 auto 20px;
}
.hero .eyebrow { margin-bottom: 20px; }
.hero h1.display { max-width: 940px; margin: 0 auto 20px; }
.hero .lede { margin: 0 auto 28px; }

/* ---------- CTA button ---------- */
.cta {
  display: inline-block;
  background: var(--accent);
  color: #000;
  border: 0;
  border-radius: 12px;
  padding: 16px 32px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 150ms, transform 150ms;
}
.cta:hover { background: var(--accent-pressed); }
.cta:active { transform: translateY(1px); }

/* ---------- Sections ---------- */
section {
  padding: clamp(60px, 10vh, 120px) 0;
  border-top: 1px solid var(--border);
}
section .eyebrow { display: block; margin-bottom: 16px; }

.section-intro {
  max-width: 640px;
  margin: 0 auto 60px;
  text-align: center;
}
.section-intro p {
  margin-top: 18px;
  font-size: 17px;
}

/* ---------- Steps / cards ---------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.grid-3 .card {
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}
.grid-3 .card .num {
  font-family: var(--display);
  font-style: italic;
  color: var(--accent);
  font-size: 24px;
  margin-bottom: 18px;
}

/* ---------- Pricing ---------- */
.pricing {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.tier {
  padding: 36px 32px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.tier.featured {
  border-color: var(--accent);
  background: var(--surface-elevated);
  position: relative;
}
.tier.featured::before {
  content: 'Most popular';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #000;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 8px;
}
.tier h3 {
  font-family: var(--body);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.tier .price {
  font-family: var(--display);
  font-size: 44px;
  line-height: 1;
  margin-bottom: 4px;
}
.tier .price span {
  font-size: 15px;
  color: var(--text-tertiary);
  font-family: var(--body);
}
.tier ul {
  list-style: none;
  margin-top: 28px;
  padding: 0;
}
.tier li {
  padding: 10px 0;
  font-size: 15px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.tier li:last-child { border-bottom: 0; }
.tier li::before {
  content: '—';
  margin-right: 10px;
  color: var(--accent);
}

/* ---------- Manifesto / quotes ---------- */
.manifesto {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}
.manifesto p {
  font-family: var(--display);
  font-size: clamp(24px, 3.2vw, 36px);
  line-height: 1.35;
  color: var(--text);
  letter-spacing: -0.3px;
}
.manifesto p em { color: var(--accent); }

/* ---------- Portal nav: More dropdown ---------- */
.nav-more,
.nav-resources {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.nav-more-trigger,
.nav-resources-trigger {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: inherit;
}
.nav-more-trigger:hover,
.nav-more-trigger.active,
.nav-resources-trigger:hover,
.nav-resources-trigger.active { color: var(--accent); }
.nav-more-caret,
.nav-resources-caret {
  font-size: 9px;
  display: inline-block;
  transition: transform 140ms;
  margin-top: 1px;
}
.nav-more.open .nav-more-caret,
.nav-resources.open .nav-resources-caret { transform: rotate(180deg); }
.nav-more-menu,
.nav-resources-menu {
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.55);
  display: none;
  flex-direction: column;
  padding: 6px;
  z-index: 50;
}
.nav-more.open .nav-more-menu,
.nav-resources.open .nav-resources-menu { display: flex; }
/* Transparent bridge that fills the 14px gap between the trigger and the
   menu, so the cursor doesn't trigger mouseleave when it transits across. */
.nav-more-menu::before,
.nav-resources-menu::before {
  content: '';
  position: absolute;
  top: -14px;
  left: 0;
  right: 0;
  height: 14px;
}
.nav-more-menu a,
.nav-resources-menu a {
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.nav-more-menu a:hover,
.nav-resources-menu a:hover { background: rgba(255,255,255,0.04); color: var(--accent); }
.nav-more-menu a.active,
.nav-resources-menu a.active { color: var(--accent); }

/* ---------- Footer ---------- */
footer {
  flex-shrink: 0;
  padding: 20px 0 22px;
  border-top: 1px solid var(--border);
  text-align: center;
}
footer .brand {
  font-family: var(--display);
  font-size: 24px;
  margin-bottom: 18px;
}
footer .brand em { font-style: italic; color: var(--accent); }
footer .links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
footer .links a + a::before {
  content: '·';
  color: var(--text-tertiary);
  margin-right: 14px;
}
footer .links a {
  color: var(--text-secondary);
  font-size: 13px;
  letter-spacing: 0.3px;
}
footer .legal {
  font-size: 12px;
  color: var(--text-tertiary);
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
footer .legal-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
footer .legal a {
  color: var(--text-tertiary);
}
footer .legal a:hover {
  color: var(--text);
}

/* ---------- Legal pages ---------- */
.legal-body {
  overflow-y: auto;
}
.legal-body .nav-inner {
  justify-content: flex-start;
}
.legal-page {
  width: min(100%, 860px);
  flex: 1 0 auto;
  margin: 0 auto;
  padding: 80px 32px 120px;
}
.legal-kicker {
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.legal-page h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 48px;
  margin-bottom: 8px;
  letter-spacing: -0.8px;
}
.legal-page h1 em { font-style: italic; color: var(--text); }
.legal-page .updated {
  color: var(--text-tertiary);
  font-size: 13px;
  margin-bottom: 40px;
}
.legal-lede {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 30px;
}
.legal-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 30px 0 8px;
}
.legal-summary div {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 16px;
}
.legal-summary strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  margin-bottom: 8px;
}
.legal-summary span {
  display: block;
  color: var(--text-tertiary);
  font-size: 12px;
  line-height: 1.5;
}
.legal-page h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: 24px;
  margin-top: 40px;
  margin-bottom: 12px;
  letter-spacing: -0.2px;
}
.legal-page p,
.legal-page li {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.65;
}
.legal-page ul {
  margin: 12px 0 12px 20px;
}
.legal-page li { margin-bottom: 6px; }
.legal-page a { color: var(--accent); }
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 16px 0 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}
table.processors,
table.cookies {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}
table.processors th,
table.processors td,
table.cookies th,
table.cookies td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.55;
}
table.processors th,
table.cookies th {
  color: var(--text);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255,255,255,0.025);
}
table.processors tr:last-child td,
table.cookies tr:last-child td {
  border-bottom: 0;
}

/* ---------- Tablet + mobile (≤ 860px) ---------- */
@media (max-width: 860px) {
  .container { padding: 0 22px; }
  .nav-inner { padding: 14px 22px; }
  .nav-brand { font-size: 20px; }

  .hero { padding: 16px 0 40px; }
  .hero-mark { width: 48px; height: 48px; margin-bottom: 16px; }
  .hero .eyebrow { margin-bottom: 14px; font-size: 10px; letter-spacing: 2.5px; }
  h1.display { font-size: clamp(36px, 12vw, 60px); line-height: 1.04; letter-spacing: -1px; }
  .hero h1.display { margin-bottom: 16px; }
  .lede { font-size: 16px; line-height: 1.5; max-width: 520px; }
  .hero .lede { margin-bottom: 20px; }

  .cta {
    padding: 14px 28px;
    font-size: 14px;
    width: 100%;
    max-width: 340px;
  }

  /* Stack grids on tablet+mobile */
  .grid-3 { grid-template-columns: 1fr 1fr; gap: 14px; }
  .grid-3 .card { padding: 24px; }
  .pricing { grid-template-columns: 1fr; gap: 16px; max-width: 460px; margin-left: auto; margin-right: auto; }
  .tier { padding: 28px 22px; }
  .tier .price { font-size: 38px; }

  section { padding: clamp(48px, 8vh, 80px) 0; }
  .section-intro { margin-bottom: 40px; }

  .manifesto p { font-size: clamp(20px, 5.4vw, 30px); }

  footer { padding: 16px 0 20px; }
  footer .links { gap: 10px; margin-bottom: 10px; }
  footer .links a + a::before { margin-right: 10px; }
  footer .links a { font-size: 12px; }
  footer .legal { font-size: 11px; line-height: 1.55; padding: 0 16px; }

  /* Legal pages get normal scroll on mobile */
  .legal-body .nav-inner { justify-content: center; }
  .legal-page { padding: 32px 22px 64px; }
  .legal-page h1 { font-size: 36px; }
  .legal-lede { font-size: 15px; line-height: 1.65; }
  .legal-summary { grid-template-columns: 1fr; }
  .legal-page h2 { font-size: 20px; margin-top: 28px; }
  .legal-page p, .legal-page li { font-size: 14px; }
  table.processors, table.cookies { font-size: 12px; }
  table.processors th, table.processors td,
  table.cookies th, table.cookies td { padding: 8px 6px; font-size: 12px; }
}

/* ---------- Phone (≤ 640px) ---------- */
/* This is where the "shared portal/top-nav" inline styles used across
   every authenticated page (investor-portal, crm, podcast, tools, etc.)
   need to be reined in. These rules use !important because each page
   declares the same patterns inline; rewriting each <style> block
   individually was error-prone, so the override is centralised here. */
@media (max-width: 640px) {
  .container { padding: 0 18px; }

  /* Stack the 2-column grid down to 1 column on phones. */
  .grid-3 { grid-template-columns: 1fr; }

  /* Shared portal top-bar (used across investor-portal, crm, podcast,
     investor-ai-agent, memo-writer, model-analyzer, pitch-deck-review,
     term-sheet-review, startup-credits, contact). */
  .portal-top-inner {
    padding: 12px 16px !important;
    gap: 12px !important;
    flex-wrap: wrap !important;
  }
  .portal-brand { font-size: 18px !important; gap: 8px !important; }
  .portal-brand img { width: 26px !important; height: 26px !important; }
  .portal-top-right {
    gap: 14px !important;
    font-size: 12.5px !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
  }
  /* Hide the per-page "Hi, Name" label on small screens; sign-out is in More */
  .portal-top-right > span#investor-label { display: none !important; }

  /* Dropdown menus stay readable on small screens. */
  .nav-more-menu, .nav-resources-menu {
    right: 0; left: auto;
    min-width: 200px;
  }

  /* Authenticated-page main wrappers — common padding override. */
  main.portal-main,
  main.podcast-main,
  main.review-main,
  main.crm-main { padding: 20px 16px 56px !important; }

  /* Investor-portal header toolbar: stack the filter groups vertically
     so they don't wrap awkwardly. */
  .portal-header {
    gap: 12px !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .portal-header > div {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  /* Stage / view tab strips: horizontal scroll instead of wrap so the
     pill row stays one line and looks intentional. */
  .portal-tabs {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .portal-tabs::-webkit-scrollbar { display: none; }
  .portal-tab { flex: 0 0 auto; white-space: nowrap; min-height: 36px; }

  /* Sector / digest / view-toggle full-width buttons for an even row. */
  .sector-dropdown,
  .sector-dropdown-btn,
  .digest-btn { width: 100%; justify-content: center; }
  .view-toggle { margin-left: 0 !important; width: 100%; }

  /* Investor-portal cards: stack vertically. */
  .cards-grid .card {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
    padding: 16px !important;
  }
  .cards-grid .card-top {
    flex: 0 0 auto !important;
    width: 100%;
    padding-right: 90px; /* leave room for the absolute "added" stamp */
  }
  .cards-grid .card-middle { width: 100%; }
  .cards-grid .card-actions {
    flex: 0 0 auto;
    flex-wrap: wrap;
    width: 100%;
    gap: 8px !important;
  }
  .cards-grid .card-actions .card-btn {
    flex: 1 0 calc(50% - 4px) !important;
    min-width: 0 !important;
    height: 44px; /* Apple HIG minimum touch target */
    padding: 0 12px !important;
    font-size: 12.5px !important;
  }
  .card-added {
    top: 12px !important;
    right: 12px !important;
    font-size: 10px !important;
  }
  .card-name { font-size: 19px !important; }

  /* DM / digest modal — already has a 560px breakpoint, just tighten the
     padding so the modal sits comfortably on small phones. */
  .dm-overlay { padding: 12px !important; }
  .dm-modal { max-height: calc(100vh - 24px) !important; max-height: calc(100dvh - 24px) !important; border-radius: 14px !important; }
  .dm-header { padding: 18px 18px 14px !important; }
  .dm-body { padding: 16px 18px 18px !important; }
  .dm-title { font-size: 19px !important; }

  footer .links { font-size: 12px; gap: 8px; }
  footer .legal { font-size: 11px; }

  /* Apple HIG minimum touch target on mobile is 44pt — apply across all
     interactive surfaces: nav links, portal pills, top-bar links, dropdown
     items, sector/digest buttons, sign-out and the magic-link CTAs. The
     pill row uses min-height (it can grow); CTAs use min-height with
     line-height kept at the design value so the button face stays
     proportionate. */
  .nav-links a,
  .portal-tab,
  .portal-top-right a,
  .digest-btn,
  .nav-more-menu a,
  .nav-resources-menu a,
  .sector-dropdown-btn,
  .view-toggle,
  .signin-cta,
  .nav-cta { min-height: 44px; }

  /* Center text vertically inside the new larger pills so they don't look
     top-anchored after the height bump. */
  .nav-links a,
  .portal-tab,
  .portal-top-right a,
  .digest-btn,
  .nav-more-menu a,
  .nav-resources-menu a,
  .sector-dropdown-btn,
  .view-toggle { display: inline-flex; align-items: center; }
}

/* ---------- Small phones (≤ 380px) ---------- */
@media (max-width: 380px) {
  .container { padding: 0 14px; }
  h1.display { font-size: clamp(28px, 9vw, 38px); line-height: 1.05; }
  .hero { padding: 8px 0 28px; }
  .hero-mark { width: 42px; height: 42px; margin-bottom: 12px; }
  .lede { font-size: 15px; }

  main.portal-main,
  main.podcast-main,
  main.review-main,
  main.crm-main { padding: 16px 12px 48px !important; }

  .portal-top-inner { padding: 10px 12px !important; }
  .portal-brand { font-size: 16px !important; }
  .portal-top-right { gap: 10px !important; font-size: 12px !important; }

  .cards-grid .card { padding: 14px !important; }
}

/* Very short screens — tighten further (landscape phones, small windows) */
@media (max-height: 700px) and (min-width: 861px) {
  .hero { padding: 12px 0 24px; }
  .hero-mark { width: 44px; height: 44px; margin-bottom: 12px; }
  .hero .eyebrow { margin-bottom: 10px; }
  .hero h1.display { margin-bottom: 14px; }
  .hero .lede { margin-bottom: 18px; }
  footer { padding: 14px 0 16px; }
}

/* ---------- Mobile foundation ---------- */
/* These rules harden the mobile experience without altering how the desktop
   site looks. They address four known iOS Safari papercuts: the 16px-input-or-
   we-zoom-on-focus rule, the default blue tap-flash that doesn't match our
   palette, the residual 300ms tap delay on interactive elements, and the
   missing focus-visible ring (keyboard-only, hidden from mouse/touch). */

/* Stop iOS Safari from auto-resizing text in landscape orientation. */
html { -webkit-text-size-adjust: 100%; }

/* Replace the default iOS blue tap flash with our gold accent at 18% alpha.
   Only visible on touch devices — no effect on desktop. */
button, a, input, textarea, select, label, [role="button"] {
  -webkit-tap-highlight-color: rgba(201, 169, 97, 0.18);
}

/* `manipulation` removes the 300ms double-tap-to-zoom delay and prevents
   accidental pinch-zoom on these elements. Touch-only — no desktop effect. */
button, a, [role="button"], .cta, .nav-cta, .card-btn, .portal-tab,
.digest-btn, .sector-dropdown-btn, .view-toggle {
  touch-action: manipulation;
}

/* iOS Safari zooms the page on focus for any input under 16px. Lifting the
   floor to 16px on mobile-sized viewports kills the zoom without changing
   how forms look on desktop. !important is needed here to beat per-page
   class-level rules (signin-input, .field input, .input-bar textarea) that
   set 14px — those classes are inline in individual pages, and we want the
   iOS-zoom guard to win regardless of which page added a smaller size. */
@media (max-width: 860px) {
  input, textarea, select {
    font-size: 16px !important;
  }
}

/* Visible focus ring for keyboard users only — :focus-visible suppresses
   the ring on mouse-click / touch-tap. Falls back gracefully in browsers
   that don't support :focus-visible (Safari ≥ 15.4 does). */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
[role="button"]:focus:not(:focus-visible) { outline: none; }

/* ---------- iOS standalone-mode safe areas ---------- */
/* Activated by viewport-fit=cover in the page <head>. In normal Safari with
   the address bar visible, env() values return 0 so these rules add nothing
   to desktop or to web-browsing on mobile. They only kick in when the page
   is launched from the iOS home screen as a standalone PWA — where the
   status bar overlays content (apple-mobile-web-app-status-bar-style:
   black-translucent) and the home indicator sits at the bottom, so we need
   to pad content away from both edges so the user can see and reach it. */
.nav,
.portal-top { padding-top: env(safe-area-inset-top); }
footer { padding-bottom: max(22px, env(safe-area-inset-bottom)); }
@media (max-width: 860px) {
  footer { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
}
