/* Perspectives on the Newsreel app design system.
   Every color, radius and size here resolves to static/tokens.css, which is
   app.newsreel.co's own token set. If a value is not a token, it does not go
   in this file. Components map to the app's screens:
     .field / .chip / .list-card / .section-title  -> Explore tab
     .profile / .tabs                              -> journalist profile
     .story-head                                   -> feed story
     .btn                                          -> sign-in button
   Light is the default (html.light), exactly as the app ships. */

/* ─── Fonts: the app self-hosts these three; the site loads them from Google Fonts ─── */
:root {
  --font-bree-serif: "Bree Serif", Georgia, serif;
  --font-dm-sans: "DM Sans", system-ui, sans-serif;
  --font-ibm-plex-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --wrap: 1040px;
  --gutter: calc(var(--spacing) * 5);       /* 20px */
  --header-h: 64px;
}

/* ─── Base ─── */
*, *::before, *::after { box-sizing: border-box; }
/* the header is sticky, so anything scrolled to must stop clear of it */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  background: var(--color-background);
  color: var(--color-text-primary);
  font-family: var(--font-dm-sans);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--color-newsreel-red); outline-offset: 2px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.wrap--narrow { max-width: 720px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ─── Type by role ─── */
h1, h2, h3, .display { font-family: var(--font-bree-serif); font-weight: 400; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: 40px; line-height: 48px; }
h2 { font-size: 32px; line-height: 41.6px; }
h3 { font-size: 24px; line-height: 33.6px; }
.display { font-size: 48px; line-height: 1.1; }
p { margin: 0; }
.lede { font-size: var(--text-xl); line-height: 1.5; color: var(--color-text-secondary); max-width: 62ch; }
.meta { font-size: var(--text-sm); line-height: 1.43; color: var(--color-text-subtle); }
.muted { color: var(--color-text-muted); }
.eyebrow {
  font-size: var(--text-xs); line-height: 1.33; font-weight: var(--font-weight-medium);
  letter-spacing: var(--tracking-wider); text-transform: uppercase; color: var(--color-text-subtle);
}
.mono { font-family: var(--font-ibm-plex-mono); font-size: var(--text-sm); }
.link { color: var(--color-newsreel-red); font-weight: var(--font-weight-medium); }
.link:hover { text-decoration: underline; }
@media (max-width: 720px) {
  h1 { font-size: 30px; line-height: 36px; }
  h2 { font-size: 26px; line-height: 32px; }
  .display { font-size: 34px; }
  .lede { font-size: var(--text-base); }
}

/* ─── Shell: header ─── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--color-background);
  border-bottom: 1px solid var(--color-surface-elevated);
}
.site-header__in { display: flex; align-items: center; justify-content: space-between; gap: var(--gutter); min-height: var(--header-h); }
.brand { display: inline-flex; align-items: baseline; gap: 10px; }
.brand__mark { height: 22px; width: auto; }
.brand__label {
  font-family: var(--font-ibm-plex-mono); font-size: var(--text-xs); font-weight: var(--font-weight-medium);
  letter-spacing: var(--tracking-wider); text-transform: uppercase; color: var(--color-newsreel-red);
}
.site-nav { display: flex; gap: calc(var(--spacing) * 6); }
.site-nav a {
  position: relative; padding: 20px 0; font-size: 15px; font-weight: var(--font-weight-medium);
  color: var(--color-text-subtle); transition: color var(--default-transition-duration);
}
.site-nav a:hover { color: var(--color-text-primary); }
body[data-page="search"] .site-nav a[data-nav="search"],
body[data-page="voices"] .site-nav a[data-nav="voices"],
body[data-page="voice"]  .site-nav a[data-nav="voices"],
body[data-page="methodology"] .site-nav a[data-nav="methodology"],
body[data-page="review"] .site-nav a[data-nav="methodology"] { color: var(--color-text-primary); }
body[data-page="search"] .site-nav a[data-nav="search"]::after,
body[data-page="voices"] .site-nav a[data-nav="voices"]::after,
body[data-page="voice"]  .site-nav a[data-nav="voices"]::after,
body[data-page="methodology"] .site-nav a[data-nav="methodology"]::after,
body[data-page="review"] .site-nav a[data-nav="methodology"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--color-newsreel-red);
}
.crumb { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 0 0; font-size: var(--text-sm); color: var(--color-text-subtle); }
.crumb:hover { color: var(--color-text-primary); }
.crumb svg { width: 12px; height: 12px; }
/* The phone header is ONE row of 56px with a definite bottom edge.
   Two rows cost 101px of a 812px screen and tucked section labels under
   themselves on scroll. The nav links become full-height 56px targets, so the
   row is also the tap target. Below 560px the "PERSPECTIVES" label steps
   aside: the three destinations and the full lockup cannot both fit on any
   iPhone (brand 183px + nav 225px against 335px of usable width), and a link
   is worth more than a word. The wordmark still says whose site this is. */
@media (max-width: 720px) {
  :root { --header-h: 56px; }
  .site-header { border-bottom-color: var(--color-border); }
  .site-header__in { flex-wrap: nowrap; min-height: var(--header-h); gap: 12px; }
  .brand { flex: none; align-items: center; min-height: var(--header-h); }
  .brand__mark { height: 20px; }
  .site-nav { gap: calc(var(--spacing) * 5); }
  .site-nav a { padding: 18px 0; font-size: var(--text-sm); }
  .crumb { padding-top: 4px; }
}
@media (max-width: 560px) {
  .brand__label { display: none; }
  .site-nav { gap: 18px; }
}

/* ─── Shell: footer ─── */
.site-footer { margin-top: calc(var(--spacing) * 20); border-top: 1px solid var(--color-surface-elevated); }
.site-footer__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; padding: 28px var(--gutter); }
.site-footer__brand { font-family: var(--font-bree-serif); font-size: var(--text-xl); }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 20px; font-size: var(--text-sm); color: var(--color-text-subtle); }
.site-footer__links a:hover { color: var(--color-text-primary); }
.site-footer__copy { width: 100%; font-size: var(--text-xs); color: var(--color-text-muted); }

/* ─── Section title: the app's "Browse" header (red dot, hairline to the right) ─── */
.section-title { display: flex; align-items: center; gap: 12px; margin: calc(var(--spacing) * 8) 0 calc(var(--spacing) * 4); }
.section-title::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--color-newsreel-red); flex: none; }
.section-title h2, .section-title h3 { flex: none; }
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--color-surface-elevated); }

/* ─── Field: the app's search field ─── */
.field {
  display: flex; align-items: center; gap: 10px;
  height: 48px; padding: 0 16px;
  background: var(--color-surface);  /* the app's field is grey, not white */
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: border-color var(--default-transition-duration), background var(--default-transition-duration);
}
.field:focus-within { background: var(--color-background); border-color: var(--color-text-primary); }
.field svg { width: 18px; height: 18px; flex: none; color: var(--color-text-subtle); }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: var(--text-base); color: var(--color-text-primary); }
.field input::placeholder { color: var(--color-text-muted); }
.field--lg { height: 56px; font-size: var(--text-xl); }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

/* ─── Buttons ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px;
  border: 0; border-radius: var(--radius-lg);
  font-weight: var(--font-weight-semibold); font-size: 15px; cursor: pointer;
  transition: background var(--default-transition-duration), color var(--default-transition-duration);
}
.btn--primary { background: var(--color-newsreel-red); color: var(--color-white); }
.btn--primary:hover { background: color-mix(in oklab, var(--color-newsreel-red) 88%, var(--color-black)); }
.btn--secondary { background: var(--color-surface); color: var(--color-text-primary); }
.btn--secondary:hover { background: var(--color-surface-elevated); }
.btn--ghost { background: transparent; color: var(--color-text-secondary); }
.btn--ghost:hover { background: var(--color-surface); }
.btn--sm { min-height: 44px; padding: 0 14px; font-size: var(--text-sm); }  /* 44px: the brand's mobile tap minimum */

/* ─── A row that scrolls sideways has to say so ─── */
/* The trailing edge fades out, so a half-chip at the screen edge reads as
   "there is more that way" instead of as a clipping bug. Where the browser
   supports a scroll timeline the fade moves to whichever end still has
   content; everywhere else it is a fixed fade on the right. The mask only
   uses alpha, so --color-black is standing in for "opaque", not for a colour. */
@property --fade-l { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --fade-r { syntax: "<length>"; inherits: false; initial-value: 0px; }
.edge-fade {
  --fade-l: 0px; --fade-r: 24px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, var(--color-black) var(--fade-l), var(--color-black) calc(100% - var(--fade-r)), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, var(--color-black) var(--fade-l), var(--color-black) calc(100% - var(--fade-r)), transparent 100%);
}
@supports (animation-timeline: scroll(self inline)) {
  .edge-fade { animation: edge-fade linear both; animation-timeline: scroll(self inline); }
  @keyframes edge-fade {
    from { --fade-l: 0px; --fade-r: 24px; }
    to   { --fade-l: 24px; --fade-r: 0px; }
  }
}

/* ─── Chips: the app's Browse pills ─── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips--scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.chips--scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 18px;
  background: var(--color-surface); color: var(--color-text-primary);
  border: 0; border-radius: 9999px;
  font-size: var(--text-sm); font-weight: var(--font-weight-medium); cursor: pointer; white-space: nowrap;
  transition: background var(--default-transition-duration), color var(--default-transition-duration);
}
.chip:hover { background: var(--color-surface-elevated); }
.chip.is-active { background: var(--color-newsreel-red); color: var(--color-white); }
.chip__count { font-family: var(--font-ibm-plex-mono); font-size: var(--text-xs); opacity: .7; }
.chip--sm { min-height: 32px; padding: 0 12px; font-size: var(--text-xs); }

/* ─── Cards ─── */
.card { background: var(--color-surface); border-radius: var(--radius-2xl); padding: 20px; }
.card--flat { background: transparent; border: 1px solid var(--color-surface-elevated); }
.list-card {
  display: grid; grid-template-columns: 112px 1fr; gap: 20px; align-items: start;
  background: var(--color-surface); border-radius: var(--radius-2xl); padding: 16px;
  transition: background var(--default-transition-duration);
}
.list-card:hover { background: var(--color-surface-elevated); }
.list-card__thumb { width: 112px; aspect-ratio: 1; border-radius: var(--radius-lg); object-fit: cover; background: var(--color-surface-elevated); }
.list-card__title { font-family: var(--font-dm-sans); font-weight: var(--font-weight-semibold); font-size: 18px; line-height: 1.3; }
.list-card__dek { margin-top: 6px; font-size: 15px; line-height: 1.45; color: var(--color-text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list-card--no-thumb { grid-template-columns: 1fr; }
@media (max-width: 720px) {
  .list-card { grid-template-columns: 88px 1fr; gap: 14px; }
  .list-card__thumb { width: 88px; }
  .list-card__title { font-size: 16px; }
}

/* ─── Byline: round avatar + name ─── */
.byline { display: inline-flex; align-items: center; gap: 10px; margin-top: 12px; font-size: var(--text-sm); font-weight: var(--font-weight-medium); }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--color-surface-elevated); }
.avatar--lg { width: 72px; height: 72px; }
.avatar--xl { width: 96px; height: 96px; }
.avatar--stack { display: inline-flex; }
.avatar--stack .avatar { margin-left: -8px; border: 2px solid var(--color-background); }
.avatar--stack .avatar:first-child { margin-left: 0; }
.avatar-fallback { display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-bree-serif); color: var(--color-text-secondary); }

/* ─── Badge: the app's "Verified by Newsreel" row ─── */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); font-weight: var(--font-weight-medium); color: var(--color-newsreel-red); }
.badge svg { width: 16px; height: 16px; }
.tag { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: var(--radius-md); background: var(--color-surface-elevated); font-size: var(--text-xs); font-weight: var(--font-weight-medium); color: var(--color-text-secondary); }

/* ─── Tabs: the app's profile tab row (red underline on the active tab) ─── */
.tabs { display: flex; gap: 24px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--color-surface-elevated); }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; flex: none; padding: 12px 2px; background: none; border: 0; cursor: pointer;
  font-size: 15px; font-weight: var(--font-weight-medium); color: var(--color-text-subtle); white-space: nowrap;
  transition: color var(--default-transition-duration);
}
.tab:hover { color: var(--color-text-primary); }
.tab.is-active { color: var(--color-text-primary); }
.tab.is-active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--color-newsreel-red); }
.tab__count { margin-left: 6px; font-family: var(--font-ibm-plex-mono); font-size: var(--text-xs); color: var(--color-text-muted); }
.tabs--vertical { flex-direction: column; gap: 0; border-bottom: 0; overflow: visible; }
.tabs--vertical .tab { display: flex; justify-content: space-between; align-items: baseline; padding: 10px 0; }
.tabs--vertical .tab.is-active::after { left: -16px; right: auto; top: 12px; bottom: 12px; width: 2px; height: auto; border-radius: 1px; }

/* ─── Profile header: the app's journalist profile ─── */
.profile { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; padding: calc(var(--spacing) * 8) 0 calc(var(--spacing) * 6); }
.profile__name { font-size: 32px; line-height: 1.15; }
.profile__role { margin-top: 4px; font-size: 15px; color: var(--color-text-secondary); max-width: 60ch; }
.profile__badges { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
@media (max-width: 720px) { .profile { grid-template-columns: 1fr; gap: 14px; } .profile__name { font-size: 28px; } }

/* ─── Position row: the voice page's summary-led entry ─── */
.day { margin: calc(var(--spacing) * 6) 0 calc(var(--spacing) * 2); }
.day:first-child { margin-top: 0; }
.position {
  display: block; padding: 16px; margin: 0 -16px; border-radius: var(--radius-2xl);
  transition: background var(--default-transition-duration);
}
.position:hover { background: var(--color-surface); }
.position__pos { font-family: var(--font-bree-serif); font-size: 20px; line-height: 1.35; max-width: 64ch; text-wrap: pretty; overflow-wrap: anywhere; }
.position__quote {
  margin: 10px 0 0; padding-left: 14px; border-left: 2px solid var(--color-surface-elevated);
  font-size: 15px; line-height: 1.5; color: var(--color-text-secondary); max-width: 60ch; overflow-wrap: anywhere;
}
.position__meta { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: var(--text-sm); color: var(--color-text-subtle); }
.position__meta svg { width: 12px; height: 12px; }
.position:hover .position__meta { color: var(--color-text-primary); }

/* ─── Story header: the app's feed story ─── */
.story-head { padding: calc(var(--spacing) * 8) 0 calc(var(--spacing) * 6); }
.story-head h1 { max-width: 22ch; }
.story-head .lede { margin-top: 12px; }
.story-head__actions { display: flex; gap: 10px; margin-top: 20px; }

/* ─── Bar: a share track (the pages color segments inline, ranked: one accent then a grey ramp) ─── */
.bar { display: flex; height: 8px; border-radius: var(--radius-sm); overflow: hidden; background: var(--color-surface); }
.bar > span { display: block; height: 100%; }

/* ─── Layout helpers ─── */
.stack > * + * { margin-top: var(--stack, 16px); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.rail { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-width: 0; gap: calc(var(--spacing) * 12); align-items: start; }
.rail__side { position: sticky; top: calc(var(--header-h) + 16px); }
.divider { border: 0; border-top: 1px solid var(--color-surface-elevated); margin: calc(var(--spacing) * 8) 0; }
.empty { padding: 64px 20px; text-align: center; color: var(--color-text-subtle); }
.loading { padding: 80px 20px; text-align: center; color: var(--color-text-muted); font-size: var(--text-sm); }
/* minmax(0,1fr), not 1fr: a nowrap tab row inside a plain 1fr column sets the
   column's minimum width to the row's full width and drags the page to ~1200px
   at 375 (Sep 19). minmax(0, ...) lets overflow-x: auto actually scroll. */
@media (max-width: 960px) { .rail { grid-template-columns: minmax(0, 1fr); gap: 0; } .rail__side { position: static; min-width: 0; } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
/* ─── Skeleton: loading placeholders shared by the directory and story pages ─── */
.skeleton { background: var(--color-surface); border-radius: var(--radius-md); animation: pulse 1.6s ease-in-out infinite; }
.skeleton-line { height: 14px; margin-bottom: 10px; }
.skeleton-line.h-lg { height: 20px; }
.skeleton-line.h-xl { height: 32px; }
.w-full { width: 100%; } .w-3-4 { width: 75%; } .w-1-2 { width: 50%; } .w-1-3 { width: 33%; } .w-1-4 { width: 25%; }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 50%; flex: none; }
@keyframes pulse { 50% { opacity: .45; } }

/* ─── Toast ─── */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); z-index: 60;
  padding: 10px 16px; border-radius: var(--radius-lg);
  background: var(--color-text-primary); color: var(--color-background);
  font-size: var(--text-sm); font-weight: var(--font-weight-medium);
  opacity: 0; pointer-events: none; transition: opacity var(--default-transition-duration), transform var(--default-transition-duration);
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* ─── State message: empty and error states ─── */
.state-message { padding: 56px 20px; text-align: center; max-width: 48ch; margin: 0 auto; }
.state-message-icon { color: var(--color-text-muted); margin-bottom: 12px; }
.state-message-icon svg { width: 32px; height: 32px; }
.state-message-title { font-family: var(--font-bree-serif); font-size: 22px; }
.state-message-body { margin-top: 8px; color: var(--color-text-subtle); font-size: 15px; }
.state-message-actions { display: flex; justify-content: center; gap: 10px; margin-top: 20px; }
.state-action { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: var(--radius-lg); font-weight: var(--font-weight-semibold); font-size: 15px; }
.state-action-primary { background: var(--color-newsreel-red); color: var(--color-white); }
.state-action-secondary { background: var(--color-surface); color: var(--color-text-primary); }

/* 44px tap targets on touch widths, including small chips and footer links */
@media (max-width: 720px) {
  .chip, .chip--sm { min-height: 44px; }
  .site-footer__links { gap: 4px 20px; }
  .site-footer__links a { display: inline-flex; align-items: center; min-height: 44px; }
  .site-footer__in { padding: 20px var(--gutter) 28px; }
  .site-footer { margin-top: calc(var(--spacing) * 12); }
  .tabs { scroll-padding-inline: var(--gutter); }
  /* the picked row must not land under the sticky header */
  .section-title, .tabs { scroll-margin-top: calc(var(--header-h) + 12px); }
  /* 16px or iOS zooms the page on focus and the layout jumps */
  input, textarea, select { font-size: var(--text-base); }
  /* the field is 44-52px tall; the input inside it should be too, or the
     tap target is the 26px line box and the rest of the pill is dead */
  .field input { align-self: stretch; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ─── The gate: sign in, the organization code, the account ───
   One panel, four states, mounted by static/gate.js either where the paid
   content would have been or as an overlay from the header control. Nothing
   here is a new colour: the panel is a .list-card, the button is a .btn, the
   input is a .field. */
.gate-slot { display: flex; align-items: center; flex: none; }
.gate-signin {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 14px;
  background: transparent; border: 1px solid var(--color-border);
  border-radius: 9999px;
  font-size: var(--text-sm); font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary); cursor: pointer; white-space: nowrap;
  transition: background var(--default-transition-duration), color var(--default-transition-duration);
}
.gate-signin:hover { background: var(--color-surface); color: var(--color-text-primary); }

.gate-panel {
  max-width: 44ch; margin: 40px auto; padding: 28px;
  background: var(--color-surface-deep); border-radius: var(--radius-2xl);
}
.gate-panel.is-busy { opacity: .6; pointer-events: none; }
.gate-panel__title { font-family: var(--font-bree-serif); font-size: 24px; line-height: 1.3; }
.gate-panel__body { margin-top: 8px; color: var(--color-text-subtle); font-size: 15px; }
.gate-form { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.gate-field { display: flex; flex-direction: column; gap: 6px; }
.gate-field__label {
  font-size: var(--text-xs); font-weight: var(--font-weight-medium);
  letter-spacing: var(--tracking-wider); text-transform: uppercase; color: var(--color-text-subtle);
}
.gate-input {
  height: 48px; padding: 0 16px;
  background: var(--color-background); color: var(--color-text-primary);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  font-family: inherit; font-size: var(--text-base);
}
.gate-input::placeholder { color: var(--color-text-muted); }
.gate-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 20px; border: 0; border-radius: var(--radius-lg);
  background: var(--color-newsreel-red); color: var(--color-white);
  font-weight: var(--font-weight-semibold); font-size: 15px; cursor: pointer;
}
.gate-btn:hover { background: color-mix(in oklab, var(--color-newsreel-red) 88%, var(--color-black)); }
.gate-btn--quiet { background: var(--color-surface-elevated); color: var(--color-text-primary); }
.gate-btn--quiet:hover { background: var(--color-surface-elevated); }
.gate-link {
  align-self: flex-start; min-height: 44px; padding: 0;
  background: none; border: 0; cursor: pointer;
  font-size: var(--text-sm); color: var(--color-text-subtle); text-decoration: underline;
}
.gate-link:hover { color: var(--color-text-primary); }
.gate-link[disabled] { cursor: default; text-decoration: none; color: var(--color-text-muted); }
.gate-inline-link { padding: 0; border: 0; background: none; font: inherit; color: var(--color-newsreel-red); text-decoration: underline; cursor: pointer; }
.gate-fine { margin: -2px 0 0; font-size: var(--text-sm); line-height: 1.45; color: var(--color-text-subtle); }
.gate-note { margin-top: 12px; font-size: var(--text-sm); color: var(--color-text-subtle); }
.gate-error { margin-top: 12px; font-size: var(--text-sm); color: var(--color-feedback-red); }

.gate-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: var(--gutter);
  background: color-mix(in srgb, var(--color-black) 45%, transparent);
}
.gate-overlay__card { position: relative; width: 100%; max-width: 420px; }
.gate-overlay .gate-panel { margin: 0; background: var(--color-background); box-shadow: 0 24px 60px color-mix(in srgb, var(--color-black) 28%, transparent); }
/* the title must not run under the close control */
.gate-overlay .gate-panel__title { padding-right: 72px; }
.gate-close {
  position: absolute; top: 8px; right: 8px;
  min-height: 44px; min-width: 44px; padding: 0 12px;
  background: transparent; color: var(--color-text-subtle);
  border: 0; border-radius: 9999px; font-size: var(--text-sm); cursor: pointer;
}
.gate-close:hover { background: var(--color-surface); color: var(--color-text-primary); }

/* The phone header is one row of 56px and it was already full: brand plus
   three destinations against 335px of usable width. The sign-in control earns
   its place by tightening the nav, not by wrapping the row. */
@media (max-width: 720px) {
  .gate-panel { margin: 24px auto; padding: 20px; }
  .gate-signin { padding: 0 12px; }
}
@media (max-width: 560px) {
  body.has-gate .site-header__in { gap: 8px; }
  body.has-gate .site-nav { gap: 12px; }
  body.has-gate .site-nav a { font-size: var(--text-xs); }
  .gate-signin { padding: 0 10px; font-size: var(--text-xs); }
}
