/* OSINT Digest — Resend-inspired SPA. Dark-first, hairline depth, editorial type. */

/* Self-hosted webfonts. Previously loaded from fonts.googleapis.com, which handed every
   visitor's IP and user agent to Google before any consent; serving them from our own
   origin means Cloudflare is the only third party involved in rendering a page.
   The latin / latin-ext split mirrors Google's own subsetting, so a reader who never
   hits an extended glyph never downloads that file. Regenerate by re-fetching the CSS
   at fonts.googleapis.com/css2 and pulling the woff2 URLs it lists. */

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/fonts/outfit-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/fonts/outfit-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215,
    U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-serif-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root,
[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #000000;
  --surface: #0a0a0c;
  --surface-2: #101012;
  --surface-3: #16161a;
  --ink: #fcfdff;
  --body: rgba(252, 253, 255, 0.86);
  --muted: #a1a4a5;
  --ash: #888e90;
  --stone: #464a4d;
  --hairline: rgba(255, 255, 255, 0.06);
  --hairline-strong: rgba(255, 255, 255, 0.14);
  --divider: rgba(255, 255, 255, 0.04);
  --cta: #fcfdff;
  --cta-ink: #000000;
  --link: #7eb6ff;
  --danger: #ff2047;
  --ok: #11ff99;
  --warn: #ff801f;
  --glow-a: rgba(59, 158, 255, 0.18);
  --glow-b: rgba(255, 128, 31, 0.12);
  --globe-fade: linear-gradient(to top left, transparent 55%, rgba(0, 0, 0, 0.35) 100%);
  --nav-bg: rgba(0, 0, 0, 0.72);
  --input-bg: #0a0a0c;
  --score-high: #7c2d12;
  --score-max: #7f1d1d;
  --shadow-soft: none;
  --radius: 12px;
  --radius-sm: 8px;
  --font-display: "Instrument Serif", "Times New Roman", serif;
  --font-sans: "Outfit", "Segoe UI", sans-serif;
}

[data-theme="light"] {
  color-scheme: light;
  --canvas: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --surface-3: #e6e8ec;
  --ink: #0a0a0c;
  --body: rgba(10, 10, 12, 0.82);
  --muted: #5c636a;
  --ash: #6b7280;
  --stone: #9ca3af;
  --hairline: rgba(10, 10, 12, 0.08);
  --hairline-strong: rgba(10, 10, 12, 0.16);
  --divider: rgba(10, 10, 12, 0.05);
  --cta: #0a0a0c;
  --cta-ink: #fcfdff;
  --link: #2563eb;
  --danger: #dc2626;
  --ok: #059669;
  --warn: #ea580c;
  --glow-a: rgba(37, 99, 235, 0.1);
  --glow-b: rgba(234, 88, 12, 0.08);
  --globe-fade: linear-gradient(to top left, transparent 50%, rgba(245, 246, 248, 0.45) 100%);
  --nav-bg: rgba(245, 246, 248, 0.82);
  --input-bg: #ffffff;
  --score-high: #c2410c;
  --score-max: #b91c1c;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
  /* Column layout so the site footer (a sibling of #app, see index.html) sits at the
     bottom of the viewport on short pages instead of below the fold. */
  display: flex;
  flex-direction: column;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
  display: block;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
  line-height: 1.45;
}

/* —— Atmosphere —— */

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.atmosphere__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.9;
  animation: glow-drift 18s ease-in-out infinite alternate;
}

.atmosphere__glow--a {
  width: min(55vw, 640px);
  height: min(55vw, 640px);
  top: -12%;
  left: -8%;
  background: var(--glow-a);
}

.atmosphere__glow--b {
  width: min(45vw, 520px);
  height: min(45vw, 520px);
  bottom: 8%;
  right: 18%;
  background: var(--glow-b);
  animation-delay: -7s;
}

.atmosphere__noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: overlay;
}

[data-theme="light"] .atmosphere__noise {
  opacity: 0.045;
  mix-blend-mode: multiply;
}

@keyframes glow-drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(4%, 6%, 0) scale(1.08);
  }
}

/* —— Globe stage (bottom-right, often clipped) —— */

.globe-stage {
  position: fixed;
  z-index: 1;
  right: -12vw;
  bottom: -22vh;
  /* Cap by vw fraction so mid-width viewports (iPad) don't get a near-full-bleed orb */
  width: min(70vw, 1100px);
  aspect-ratio: 1;
  pointer-events: none;
  mask-image: radial-gradient(circle at 48% 45%, #000 52%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle at 48% 45%, #000 52%, transparent 80%);
}

.globe-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--globe-fade);
  pointer-events: none;
  opacity: 0.55;
}

#globe-canvas {
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: auto;
  contain: layout paint size;
}

#globe-canvas.is-ready {
  opacity: 1;
}

/* Tablets: desktop offsets were too mild once width tracked the viewport */
@media (min-width: 721px) and (max-width: 1200px) {
  .globe-stage {
    right: -26vw;
    bottom: -30vh;
    width: min(62vw, 720px);
  }
}

@media (max-width: 720px) {
  .globe-stage {
    right: -34vw;
    bottom: -28vh;
    width: min(120vw, 640px);
    opacity: 0.85;
  }
}

/* —— App shell —— */

#app {
  position: relative;
  z-index: 2;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: nowrap;
  padding: 16px clamp(16px, 4vw, 40px);
  background: var(--nav-bg);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--hairline);
  animation: nav-in 0.7s ease both;
}

/* Skip entrance animation on subsequent SPA navigations (header is recreated). */
.site-header--settled {
  animation: none;
}

@keyframes nav-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand__icon {
  display: block;
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  margin-right: 0.45em;
  background: url("/logo-mark-dark.svg") center / contain no-repeat;
}

[data-theme="light"] .brand__icon {
  background-image: url("/logo-mark-light.svg");
}

.brand__mark {
  font-style: normal;
}

.brand__rest {
  font-style: italic;
  opacity: 0.92;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  flex-shrink: 0;
  position: relative;
}

.nav-pages {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.nav-menu-toggle.icon-btn {
  display: none;
}

.site-header--compact .nav-menu-toggle.icon-btn {
  display: inline-flex;
}

.site-header--compact .nav-pages {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  min-width: 200px;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  animation: nav-menu-in 0.2s ease both;
}

.site-header--compact.site-header--menu-open .nav-pages {
  display: flex;
}

@keyframes nav-menu-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.site-header--compact .nav-pages .nav-link {
  width: 100%;
  text-align: left;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.site-header--compact .nav-pages .nav-link:hover {
  background: var(--surface-2);
}

.nav-link {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.nav-link:hover {
  color: var(--ink);
  text-decoration: none;
}

.nav-link.is-active {
  color: var(--ink);
  border-color: var(--hairline-strong);
  background: var(--surface-3);
  cursor: default;
}

.site-header--compact .nav-pages .nav-link.is-active {
  background: color-mix(in srgb, var(--surface-3) 80%, var(--ink) 8%);
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong);
  background: transparent;
  color: var(--ink);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.2s ease;
}

.icon-btn:hover {
  background: var(--surface-2);
  border-color: var(--ink);
}

.icon-btn:active {
  transform: scale(0.96);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.page {
  flex: 1;
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 40px) 96px;
}

.page--wide {
  width: min(1080px, 100%);
}

.page--landing {
  width: 100%;
  max-width: none;
  padding: 0;
}

/* —— Buttons —— */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong);
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease,
    opacity 0.15s ease;
}

.btn:hover {
  background: var(--surface-2);
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--cta);
  border-color: var(--cta);
  color: var(--cta-ink);
  font-weight: 600;
}

.btn--primary:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--canvas);
  filter: brightness(1.05);
}

.btn--danger {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  background: transparent;
}

.btn--danger:hover {
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}

.btn--ghost {
  border-color: transparent;
  color: var(--muted);
}

.btn--ghost:hover {
  color: var(--ink);
  background: var(--divider);
}

/* —— Landing hero —— */

.hero {
  position: relative;
  min-height: min(100vh, 920px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(48px, 12vh, 120px) clamp(16px, 6vw, 80px) clamp(80px, 14vh, 160px);
  max-width: 1200px;
}

.hero__brand {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.03em;
  margin: 0 0 28px;
  max-width: 14ch;
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero__brand em {
  font-style: italic;
  font-weight: inherit;
}

.hero__headline {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3.4vw, 2.75rem);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0 0 16px;
  max-width: 18ch;
  color: var(--ink);
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.hero__lede {
  margin: 0 0 32px;
  max-width: 38ch;
  color: var(--body);
  font-size: clamp(1rem, 1.4vw, 1.125rem);
  line-height: 1.55;
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.16s both;
}

.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  animation: rise 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.24s both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* —— Sections —— */

.section {
  position: relative;
  padding: clamp(64px, 10vh, 120px) clamp(16px, 6vw, 80px);
  border-top: 1px solid var(--hairline);
  max-width: 1200px;
  margin: 0 auto;
}

.section__eyebrow {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ash);
  margin: 0 0 14px;
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.2vw, 2.75rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 12px;
  max-width: 22ch;
}

.section__lede {
  margin: 0 0 40px;
  color: var(--muted);
  max-width: 48ch;
  font-size: 1.05rem;
}

.steps {
  display: grid;
  gap: 28px;
  counter-reset: step;
  max-width: 640px;
}

.step {
  counter-increment: step;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: start;
}

.step::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--ash);
  line-height: 1.2;
  padding-top: 2px;
}

.step h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* —— Auth panel —— */

.auth-panel {
  width: min(100%, 400px);
  padding: 24px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-panel h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: -0.02em;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-actions .btn {
  flex: 1 1 auto;
}

#auth-status.err-text {
  color: var(--danger);
}

/* —— Forms —— */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 130px;
}

.field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

input,
select,
textarea {
  background: var(--input-bg);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--ink);
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 96px;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--ink);
  background: transparent;
  border: none;
}

input[type="checkbox"] {
  accent-color: var(--ink);
  width: 16px;
  height: 16px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.quiet-hours {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.quiet-hours__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.quiet-hours__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 14px;
  align-items: end;
  min-width: 0;
  max-width: 100%;
}

.quiet-hours__range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: end;
  min-width: 0;
  max-width: 100%;
  flex: 1 1 220px;
}

.quiet-hours__range .field {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

/* Match control heights — native time inputs otherwise render taller than <select>. */
.quiet-hours__controls input[type="time"],
.quiet-hours__controls select {
  box-sizing: border-box;
  height: 44px;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1.25;
  vertical-align: middle;
}

.quiet-hours__range input[type="time"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding-inline: 12px;
}

.quiet-hours__range input[type="time"]::-webkit-calendar-picker-indicator {
  margin-inline-start: 4px;
  padding: 0;
}

.quiet-hours__tz {
  flex: 1 1 180px;
  min-width: min(100%, 180px);
  max-width: 100%;
}

.quiet-hours__tz select {
  width: 100%;
  max-width: 100%;
}

@media (max-width: 520px) {
  .quiet-hours__controls {
    flex-direction: column;
    align-items: stretch;
  }

  .quiet-hours__range {
    width: 100%;
    flex: none;
    /* Content-sized time inputs share a row; wrap only if the card is too narrow. */
    display: flex;
    flex-wrap: wrap;
    justify-content: start;
  }

  .quiet-hours__range .field {
    width: max-content;
    max-width: 100%;
  }

  /* Content-sized like cadence — don't stretch flush to the card edge. */
  .quiet-hours__range input[type="time"] {
    width: max-content;
    min-width: 0;
    max-width: 100%;
  }

  .quiet-hours__tz {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
  }
}

/* —— Interactive surfaces (cards only for interaction) —— */

.panel {
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0 0 14px;
}

.panel h3 {
  margin: 0 0 2px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.panel .desc {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 12px;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 8px 0 10px;
}

.page-lede {
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 52ch;
}

.pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong);
  color: var(--muted);
  letter-spacing: 0.02em;
}

.pill.on {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 50%, transparent);
}

.score-badge {
  display: inline-block;
  min-width: 22px;
  text-align: center;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  padding: 1px 5px;
  background: var(--surface-2);
  border: 1px solid var(--hairline-strong);
}

.score-badge.high {
  background: var(--score-high);
  border-color: transparent;
  color: #fff;
}

.score-badge.max {
  background: var(--score-max);
  border-color: transparent;
  color: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--hairline);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}

.tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 18px;
  flex-wrap: wrap;
}

.tabs .btn.active {
  background: var(--cta);
  border-color: var(--cta);
  color: var(--cta-ink);
  font-weight: 600;
}

.status-bar {
  font-size: 13px;
  color: var(--muted);
}

.status-bar b {
  color: var(--ink);
  font-weight: 600;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 50;
  background: var(--surface-2);
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: min(90vw, 420px);
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.err {
  border-color: color-mix(in srgb, var(--danger) 55%, transparent);
  color: var(--danger);
}

.err-text {
  color: var(--danger);
}

/* —— Account —— */

.panel--danger {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--hairline-strong));
}

.passkey-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.passkey-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--hairline);
}

.passkey-item:first-child {
  border-top: none;
  padding-top: 0;
}

.passkey-item__label {
  font-weight: 600;
  font-size: 0.95rem;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: color-mix(in srgb, var(--canvas) 55%, transparent);
  backdrop-filter: blur(8px);
  animation: fade-in 0.2s ease both;
}

.modal {
  width: min(100%, 420px);
  padding: 24px;
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  animation: rise 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.modal__title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  letter-spacing: -0.02em;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.footer-mini {
  border-top: 1px solid var(--hairline);
  padding: 28px clamp(16px, 6vw, 80px) 40px;
  color: var(--ash);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 2; /* above .globe-stage, which is fixed at z-index 1 */
  flex: 0 0 auto;
}

.footer-mini__links {
  display: flex;
  gap: 18px;
}

.footer-mini a {
  color: var(--ash);
  text-decoration: none;
}

.footer-mini a:hover {
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ---------------------------------------------------------------------------
   Legal documents (/terms, /privacy)

   Served straight from the Worker as static HTML rather than through the SPA,
   so these pages must read correctly with JavaScript disabled. They reuse the
   tokens and self-hosted @font-face rules above; everything below is prose
   layout only.
   --------------------------------------------------------------------------- */

.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px clamp(20px, 6vw, 40px) 96px;
  color: var(--body);
  font-size: 15.5px;
  line-height: 1.7;
}

.legal a {
  color: var(--link);
}

.legal-head {
  border-bottom: 1px solid var(--hairline-strong);
  padding-bottom: 28px;
  margin-bottom: 36px;
}

.legal-back {
  display: inline-block;
  font-size: 13px;
  color: var(--ash);
  text-decoration: none;
  margin-bottom: 24px;
}

.legal-back:hover {
  color: var(--ink);
}

.legal h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 6vw, 44px);
  line-height: 1.12;
  color: var(--ink);
  margin: 0 0 12px;
  font-weight: 400;
}

.legal-dates {
  font-size: 13px;
  color: var(--ash);
  margin: 0;
}

.legal-lede {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  margin: 0 0 8px;
}

.legal h2 {
  font-size: 19px;
  line-height: 1.3;
  color: var(--ink);
  margin: 44px 0 14px;
  font-weight: 600;
  scroll-margin-top: 24px;
}

.legal h3 {
  font-size: 15.5px;
  color: var(--ink);
  margin: 26px 0 10px;
  font-weight: 600;
}

.legal p,
.legal li {
  margin: 0 0 14px;
}

.legal ul,
.legal ol {
  padding-left: 22px;
  margin: 0 0 16px;
}

.legal li {
  margin-bottom: 8px;
}

.legal strong {
  color: var(--ink);
  font-weight: 600;
}

/* Pulled-out passages that a reader genuinely needs to see — the AI-accuracy
   warning, the "we never send your data to the model" guarantee. Not decoration. */
.legal-callout {
  border-left: 2px solid var(--hairline-strong);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 18px;
  margin: 0 0 20px;
}

.legal-callout p:last-child {
  margin-bottom: 0;
}

.legal-toc {
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 0 0 8px;
}

.legal-toc p {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ash);
  margin: 0 0 12px;
}

.legal-toc ol {
  margin: 0;
  padding-left: 20px;
  font-size: 14.5px;
}

.legal-toc li {
  margin-bottom: 5px;
}

.legal-table-wrap {
  overflow-x: auto;
  margin: 0 0 20px;
}

.legal table {
  border-collapse: collapse;
  width: 100%;
  min-width: 460px;
  font-size: 14px;
}

.legal th,
.legal td {
  text-align: left;
  vertical-align: top;
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--hairline);
}

.legal th {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--hairline-strong);
}

.legal-contact {
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 20px 0;
}

.legal-contact p {
  margin-bottom: 6px;
}

.legal-contact p:last-child {
  margin-bottom: 0;
}

.legal-foot {
  border-top: 1px solid var(--hairline);
  margin-top: 56px;
  padding-top: 24px;
  font-size: 13px;
  color: var(--ash);
}
