/* =============================================================================
   Hamidun News — Brand System v2 (from Claude Design handoff)
   Based on Figma "Hamidun & CLOUT" brandbook
   ============================================================================= */

@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src:
    url("/portal/fonts/InterTight-Variable.woff2") format("woff2-variations"),
    url("/portal/fonts/InterTight-Variable.woff2") format("woff2");
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src:
    url("/portal/fonts/Manrope-Variable.woff2") format("woff2-variations"),
    url("/portal/fonts/Manrope-Variable.woff2") format("woff2");
}

:root {
  /* Brand colors (from Figma brandbook) */
  --h-primary: #2d2fe8;
  --h-primary-hover: #2022c7;
  --h-deep: #010334;
  --h-black: #010106;
  --h-cyan: #29a9ff;
  --h-green: #62c584;
  --h-red: #f95d51;
  --h-accent-light: #c7d2e9;

  /* Surface */
  --h-bg: #ffffff;
  --h-bg-soft: #efefef;
  --h-bg-warm: #f7f6f3;
  --h-surface: #ffffff;
  --h-surface-2: #fafaf8;
  --h-border: #e8e8e6;
  --h-border-strong: #d4d4d0;
  --h-divider: #ededea;

  /* Text */
  --h-text: #111111;
  --h-text-muted: #4a4a55;
  --h-text-subtle: #7a7a82;
  --h-text-inverse: #ffffff;

  /* Type scale */
  --h-hero: clamp(44px, 5vw, 72px);
  --h-h1: 40px;
  --h-h2: 32px;
  --h-h3: 24px;
  --h-lead: 18px;
  --h-body: 16px;
  --h-small: 14px;
  --h-tiny: 12px;

  /* Spacing */
  --h-sp-1: 4px;
  --h-sp-2: 8px;
  --h-sp-3: 12px;
  --h-sp-4: 16px;
  --h-sp-5: 24px;
  --h-sp-6: 32px;
  --h-sp-7: 48px;
  --h-sp-8: 64px;
  --h-sp-9: 96px;

  /* Radius */
  --h-r-sm: 6px;
  --h-r-md: 10px;
  --h-r-lg: 16px;
  --h-r-xl: 24px;
  --h-r-pill: 999px;

  /* Shadow */
  --h-shadow-xs: 0 1px 2px rgba(1, 1, 6, 0.04);
  --h-shadow-sm: 0 2px 6px rgba(1, 1, 6, 0.06);
  --h-shadow-md: 0 8px 24px rgba(1, 1, 6, 0.08);
  --h-shadow-lg: 0 20px 60px rgba(1, 3, 52, 0.12);

  /* Fonts */
  --h-font-head: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --h-font-body: "Manrope", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --h-font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Legacy fallback aliases */
  --bg: var(--h-bg);
  --text: var(--h-text);
  --text-secondary: var(--h-text-muted);
  --text-muted: var(--h-text-subtle);
  --accent: var(--h-primary);
  --font: var(--h-font-head);
  --font-body: var(--h-font-body);
}

/* Explicit dark theme (outside @media) — manual toggle */
html[data-theme="dark"] {
  --h-bg: #070926;
  --h-bg-soft: #0c0f35;
  --h-bg-warm: #0a0c30;
  --h-surface: #0f1238;
  --h-surface-2: #141748;
  --h-border: #1f2350;
  --h-border-strong: #2b2f65;
  --h-divider: #1a1e45;
  --h-text: #f0f1fa;
  --h-text-muted: #a8aac4;
  --h-text-subtle: #7174a0;
  --h-text-inverse: #010334;
}
html[data-theme="dark"] body {
  background: var(--h-bg);
  color: var(--h-text);
}

@media (prefers-color-scheme: dark) {
  :root.h-auto-dark,
  html[data-theme="dark"] {
    --h-bg: #070926;
    --h-bg-soft: #0c0f35;
    --h-bg-warm: #0a0c30;
    --h-surface: #0f1238;
    --h-surface-2: #141748;
    --h-border: #1f2350;
    --h-border-strong: #2b2f65;
    --h-divider: #1a1e45;
    --h-text: #f0f1fa;
    --h-text-muted: #a8aac4;
    --h-text-subtle: #7174a0;
    --h-text-inverse: #010334;
  }
}

/* Global resets */
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  background: var(--h-bg);
  color: var(--h-text);
  font-family: var(--h-font-body);
  font-size: var(--h-body);
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--h-font-head);
  letter-spacing: -0.02em;
  line-height: 1.08;
  font-weight: 640;
  color: var(--h-text);
  margin: 0;
}
p {
  margin: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font-family: inherit;
  cursor: pointer;
}
::selection {
  background: var(--h-primary);
  color: #fff;
}
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* LQIP pattern for placeholders */
.h-lqip {
  background-color: var(--h-accent-light);
  background-image:
    linear-gradient(135deg, rgba(1, 3, 52, 0.06) 0 1px, transparent 1px 14px),
    linear-gradient(135deg, rgba(1, 3, 52, 0.03) 0 2px, transparent 2px 14px);
  background-size:
    14px 14px,
    14px 14px;
  position: relative;
  overflow: hidden;
  color: #010334;
}
.h-lqip::after {
  content: attr(data-label);
  position: absolute;
  left: 10px;
  bottom: 8px;
  font-family: var(--h-font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(1, 3, 52, 0.55);
  background: rgba(255, 255, 255, 0.7);
  padding: 2px 6px;
  border-radius: 3px;
}

/* =================== NAVIGATION =================== */
.nav {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 18px 40px;
  border-bottom: 1px solid var(--h-border);
  background: var(--h-bg);
  color: var(--h-text);
  position: relative;
  z-index: 5;
}
.nav--dark {
  background: var(--h-deep);
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
.nav__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
}
.nav__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--h-font-head);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.nav__logo-mark {
  width: 32px;
  height: 32px;
  display: block;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}
.nav__logo-slash {
  opacity: 0.5;
}
.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.nav__links a {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 520;
  color: var(--h-text-muted);
  transition: background 0.15s;
  white-space: nowrap;
}
.nav--dark .nav__links a {
  color: rgba(255, 255, 255, 0.65);
}
.nav__links a:hover,
.nav__links a.active {
  background: var(--h-bg-soft);
  color: var(--h-text);
}
.nav--dark .nav__links a:hover,
.nav--dark .nav__links a.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.nav__spacer {
  flex: 1;
}
.nav__search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--h-r-pill);
  border: 1px solid var(--h-border);
  color: var(--h-text-muted);
  font-size: 13px;
  min-width: 220px;
  cursor: pointer;
  background: none;
  font-family: var(--h-font-body);
}
.nav--dark .nav__search {
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.75);
}
.nav__search-kbd {
  font-family: var(--h-font-mono);
  font-size: 11px;
  opacity: 0.6;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--h-border-strong);
  margin-left: auto;
}
.nav--dark .nav__search-kbd {
  border-color: rgba(255, 255, 255, 0.2);
}
.nav__locales {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: var(--h-r-pill);
  border: 1px solid var(--h-border);
}
.nav--dark .nav__locales {
  border-color: rgba(255, 255, 255, 0.15);
}
.nav__locale {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--h-text-muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-transform: uppercase;
  font-family: var(--h-font-body);
}
.nav--dark .nav__locale {
  color: rgba(255, 255, 255, 0.7);
}
.nav__locale.active,
.nav__locale[aria-current="true"] {
  background: var(--h-deep);
  color: #fff;
}
.nav--dark .nav__locale.active,
.nav--dark .nav__locale[aria-current="true"] {
  background: #fff;
  color: var(--h-deep);
}
.nav__user,
.nav__theme {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--h-bg-soft);
  color: var(--h-text);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}
.nav__theme {
  margin-right: 8px;
}
.nav__theme:hover {
  background: var(--h-border);
}
.nav__theme-icon--moon {
  display: none;
}
html[data-theme="dark"] .nav__theme-icon--sun {
  display: none;
}
html[data-theme="dark"] .nav__theme-icon--moon {
  display: block;
}
.nav--dark .nav__user,
.nav--dark .nav__theme {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.nav--dark .nav__theme:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* Hide screen-reader-only Q&A used for AI crawlers */
.qa-box--sr-only {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* =================== HERO =================== */
.hero {
  position: relative;
  background: var(--h-deep);
  color: #fff;
  overflow: hidden;
  padding: 60px 40px 80px;
}
.hero__glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 110%, #29a9ff 0%, rgba(41, 169, 255, 0) 35%),
    radial-gradient(circle at 85% -20%, rgba(1, 1, 6, 0.8) 0%, rgba(1, 1, 6, 0) 50%);
  opacity: 0.85;
  pointer-events: none;
}
.hero__grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 80px 80px;
  pointer-events: none;
}
.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 60px;
  align-items: end;
  min-height: 380px;
  max-width: 1440px;
  margin: 0 auto;
}
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.04em;
  margin-bottom: 32px;
}
.hero__badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--h-green);
  box-shadow: 0 0 8px var(--h-green);
}
.hero__title {
  font-size: clamp(52px, 6vw, 88px);
  line-height: 0.98;
  font-weight: 700;
  letter-spacing: -0.035em;
  text-wrap: balance;
  font-family: var(--h-font-head);
  color: #fff;
}
.hero__title-accent {
  color: var(--h-cyan);
}
.hero__lead {
  margin-top: 24px;
  font-size: 20px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.72);
  max-width: 540px;
}
.hero__cta-row {
  display: flex;
  gap: 10px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.hero__brief {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--h-r-lg);
  padding: 24px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.hero__brief-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--h-cyan);
  font-weight: 640;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero__brief-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.hero__brief-item {
  display: flex;
  gap: 12px;
  font-size: 14px;
  line-height: 1.35;
}
.hero__brief-num {
  color: rgba(255, 255, 255, 0.4);
  font-family: var(--h-font-mono);
  font-size: 11px;
  margin-top: 2px;
  flex-shrink: 0;
}
.hero__brief-text {
  color: rgba(255, 255, 255, 0.92);
}
.hero__brief-foot {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

/* =================== CATEGORY RAIL =================== */
.category-rail {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 24px 40px;
  border-bottom: 1px solid var(--h-border);
  overflow-x: auto;
  max-width: 1520px;
  margin: 0 auto;
}
.category-rail::-webkit-scrollbar {
  display: none;
}

/* =================== CHIPS =================== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--h-bg-soft);
  color: var(--h-text);
  border: 1px solid transparent;
  border-radius: var(--h-r-pill);
  padding: 6px 12px;
  font-family: var(--h-font-body);
  font-size: 13px;
  font-weight: 520;
  letter-spacing: -0.005em;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.chip--outline {
  background: transparent;
  border-color: var(--h-border-strong);
}
.chip--primary {
  background: var(--h-primary);
  color: #fff;
  border-color: var(--h-primary);
}
.chip--dark {
  background: var(--h-deep);
  color: #fff;
  border-color: var(--h-deep);
}
.chip--ghost {
  background: transparent;
  color: var(--h-text-muted);
  border-color: var(--h-border);
}
.chip--hot {
  background: rgba(249, 93, 81, 0.1);
  color: var(--h-red);
  border-color: rgba(249, 93, 81, 0.3);
}
.chip.active {
  background: var(--h-deep);
  color: #fff;
  border-color: var(--h-deep);
}
.chip--sm {
  font-size: 11px;
  padding: 4px 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 620;
}

/* =================== BUTTONS =================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--h-primary);
  color: #fff;
  border: 1px solid var(--h-primary);
  border-radius: var(--h-r-md);
  padding: 10px 18px;
  font-family: var(--h-font-body);
  font-size: 14px;
  font-weight: 580;
  letter-spacing: -0.005em;
  height: 40px;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.1s;
}
.btn:hover {
  background: var(--h-primary-hover);
}
.btn:active {
  transform: translateY(1px);
}
.btn--sm {
  padding: 6px 12px;
  font-size: 13px;
  height: 30px;
}
.btn--lg {
  padding: 14px 24px;
  font-size: 15px;
  height: 48px;
}
.btn--dark {
  background: var(--h-deep);
  color: #fff;
  border-color: var(--h-deep);
}
.btn--outline {
  background: transparent;
  color: var(--h-text);
  border-color: var(--h-border-strong);
}
.btn--ghost {
  background: transparent;
  color: var(--h-text);
  border-color: transparent;
}
.btn--white {
  background: #fff;
  color: var(--h-deep);
  border-color: #fff;
}

/* =================== MAIN =================== */
.content {
  max-width: 1520px;
  margin: 0 auto;
  padding: 0 40px 80px;
}
.section-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 640;
  color: var(--h-text-subtle);
}
.section-header {
  display: flex;
  flex-direction: column; /* JHA-FIX stack eyebrow/title/subtitle */
  align-items: flex-start;
  gap: 8px;
  padding: 48px 0 24px;
}
.section__header--centered {
  text-align: center;
  align-items: center;
}
.section-title {
  font-size: 28px;
  font-weight: 640;
  letter-spacing: -0.02em;
}

/* =================== CARDS =================== */
.featured-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 32px;
  padding: 32px 0;
  border-top: 1px solid var(--h-border);
  border-bottom: 1px solid var(--h-border);
}
.featured-card__image {
  aspect-ratio: 4/3;
  min-height: 320px;
  border-radius: var(--h-r-md);
  overflow: hidden;
}
.featured-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.featured-card:hover .featured-card__image img {
  transform: scale(1.045);
}
.featured-card__title a {
  transition: color 0.18s ease;
}
.featured-card:hover .featured-card__title a {
  color: var(--h-primary);
}
.featured-card__body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 0;
}
.featured-card__chips {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.featured-card__title {
  font-size: 44px;
  line-height: 1.05;
  font-weight: 640;
  letter-spacing: -0.025em;
  margin-bottom: 18px;
  text-wrap: balance;
}
.featured-card__title a {
  color: inherit;
}
.featured-card__dek {
  font-size: 18px;
  line-height: 1.5;
  color: var(--h-text-muted);
  margin-bottom: 20px;
  max-width: 520px;
}
.featured-card__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--h-text-muted);
  flex-wrap: wrap;
}
.meta-sep {
  opacity: 0.4;
}

/* Regular card */
.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}
.card__image {
  aspect-ratio: 16/10;
  border-radius: var(--h-r-md);
  overflow: hidden;
}
.card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.card:hover .card__image img {
  transform: scale(1.05);
}
.card__title {
  transition: color 0.18s ease;
}
.card:hover .card__title {
  color: var(--h-primary);
}
.card__cat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 620;
  color: var(--h-primary);
}
.card__title {
  font-size: 20px;
  line-height: 1.15;
  font-weight: 620;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--h-text);
  margin: 0;
}
.card--sm .card__title {
  font-size: 17px;
}
.card--lg .card__title {
  font-size: 24px;
}
.card__dek {
  font-size: 14px;
  line-height: 1.5;
  color: var(--h-text-muted);
}
.card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--h-text-subtle);
  margin-top: auto;
  flex-wrap: wrap;
}

/* Compact card */
.compact-card {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--h-divider);
  text-decoration: none;
  color: inherit;
}
.compact-card:last-child {
  border-bottom: none;
}
.compact-card__num {
  font-family: var(--h-font-head);
  font-size: 20px;
  font-weight: 700;
  color: var(--h-text-subtle);
  letter-spacing: -0.02em;
}
.compact-card__cat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 620;
  color: var(--h-primary);
  margin-bottom: 8px;
}
.compact-card__title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin: 0;
}
.compact-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--h-text-subtle);
  margin-top: 8px;
}

/* List row (search results, tag page) */
.list-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--h-border);
  text-decoration: none;
  color: inherit;
}
.list-row__image {
  aspect-ratio: 4/3;
  border-radius: var(--h-r-md);
  overflow: hidden;
}
.list-row__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.list-row__title {
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 10px 0;
  text-wrap: balance;
}
.list-row__dek {
  font-size: 15px;
  line-height: 1.5;
  color: var(--h-text-muted);
  margin-bottom: 12px;
}
.list-row__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--h-text-subtle);
  flex-wrap: wrap;
}

/* Source chip */
.source-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--h-text-muted);
  font-weight: 520;
}
.source-chip__dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* =================== TRENDING SIDEBAR =================== */
.sidebar-card {
  background: var(--h-bg-warm);
  border-radius: var(--h-r-lg);
  padding: 28px;
  margin-bottom: 24px;
}
.sidebar-card__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 640;
  color: var(--h-red);
  margin-bottom: 16px;
}
.newsletter-card {
  background: var(--h-deep);
  color: #fff;
  border-radius: var(--h-r-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
}
.newsletter-card__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 110%, var(--h-cyan) 0%, transparent 45%);
  opacity: 0.3;
  pointer-events: none;
}
.newsletter-card__inner {
  position: relative;
}
.newsletter-card__label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 640;
  color: var(--h-cyan);
  margin-bottom: 14px;
}
.newsletter-card__title {
  color: #fff;
  font-size: 22px;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  text-wrap: balance;
}
.newsletter-card__lead {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 18px;
}
.newsletter-form {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--h-r-md);
  padding: 5px;
}
.newsletter-form input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 14px;
  padding: 6px 10px;
  font-family: var(--h-font-body);
}
.newsletter-form input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* =================== FOOTER =================== */
.footer {
  padding: 64px 40px 32px;
  background: var(--h-deep);
  color: rgba(255, 255, 255, 0.85);
}
.footer__inner {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer__about {
  margin-top: 16px;
  max-width: 340px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 14px;
  line-height: 1.55;
}
.footer__socials {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}
.footer__social {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
}
.footer__col-title {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 600;
  margin-bottom: 16px;
}
.footer__col-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.footer__col-links a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}
.footer__col-links a:hover {
  color: #fff;
}
.footer__bottom {
  max-width: 1440px;
  margin: 48px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  flex-wrap: wrap;
  gap: 20px;
}
.footer__bottom-links {
  display: flex;
  gap: 20px;
}
.footer__bottom-links a {
  color: inherit;
  text-decoration: none;
}

/* =================== RESPONSIVE =================== */
@media (max-width: 1024px) {
  .hero__inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .featured-card {
    grid-template-columns: 1fr;
  }
  .featured-card__title {
    font-size: 32px;
  }
  .content > .grid-3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .content > .split-2\\:1 {
    grid-template-columns: 1fr !important;
  }
  .footer__inner {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 640px) {
  .nav {
    padding: 14px 20px;
    gap: 16px;
    flex-wrap: wrap;
  }
  .nav__links {
    display: none;
  }
  .nav__search {
    display: none;
  }
  .hero {
    padding: 24px 20px 28px;
  }
  .hero__inner {
    min-height: auto;
    gap: 22px;
  }
  .hero__title {
    font-size: 34px;
  }
  .hero__lead {
    margin-top: 14px;
    font-size: 15px;
    line-height: 1.4;
  }
  .hero__cta-row {
    margin-top: 18px;
  }
  .hero__brief {
    padding: 16px;
  }
  .hero__brief-list {
    gap: 10px;
  }
  .hero__brief-item {
    font-size: 13px;
  }
  /* Trim BRIEF to top-3 on mobile so the first article card clears the fold */
  .hero__brief-list .hero__brief-item:nth-child(n+4) {
    display: none;
  }
  .hero__brief-foot {
    margin-top: 14px;
    padding-top: 12px;
  }
  .category-rail {
    padding: 12px 20px;
  }
  .content {
    padding: 0 20px 60px;
  }
  .content > .grid-3 {
    grid-template-columns: 1fr !important;
  }
  .footer__inner {
    grid-template-columns: 1fr;
  }
  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (min-width: 1600px) {
  .content > .grid-3.wide-4 {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

/* Grid utilities */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.split-2\:1 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 48px;
  margin-top: 72px;
  padding-top: 48px;
  border-top: 1px solid var(--h-border);
}

/* =============================================================================
   ARTICLE PAGE
   ============================================================================= */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--h-border);
  z-index: 20;
}
.reading-progress__fill {
  height: 100%;
  background: var(--h-primary);
  width: 0;
  transition: width 0.1s linear;
}
.article {
  display: grid;
  grid-template-columns: 56px 220px minmax(0, 1fr) 300px;
  gap: 32px;
  padding: 40px 40px 80px;
  max-width: 1440px;
  margin: 0 auto;
}
/* Without TOC (no h2/h3 in body), drop the 220px TOC column */
.article.article--no-toc {
  grid-template-columns: 56px minmax(0, 1fr) 300px;
}
.article__share {
  position: sticky;
  top: 40px;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  z-index: 5;
}
.article__share-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--h-r-md);
  background: var(--h-bg);
  border: 1px solid var(--h-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--h-text);
  cursor: pointer;
  text-decoration: none;
}
.article__share-btn:hover {
  background: var(--h-bg-soft);
}
.article__share-font {
  font-family: var(--h-font-head);
  font-weight: 700;
  font-size: 13px;
  background: none;
}
.article__share-divider {
  height: 1px;
  background: var(--h-border);
  margin: 4px 6px;
}
.article__toc {
  position: sticky;
  top: 40px;
  align-self: start;
  padding-top: 8px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}
.article__toc-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 640;
  color: var(--h-text-subtle);
  margin-bottom: 18px;
}
.article__toc-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.article__toc-item {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 8px 0 8px 12px;
  margin-left: -12px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--h-text-muted);
  font-weight: 440;
  border-left: 2px solid var(--h-border);
  text-decoration: none;
}
.article__toc-item:hover,
.article__toc-item.active {
  color: var(--h-text);
  font-weight: 600;
  border-left-color: var(--h-primary);
}
.article__toc-num {
  font-family: var(--h-font-mono);
  font-size: 10px;
  color: var(--h-text-subtle);
}
.article__body {
  max-width: 720px;
}
.article__source-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: var(--h-bg-soft);
  border-radius: var(--h-r-pill);
  font-size: 12px;
  margin-bottom: 20px;
  text-decoration: none;
  color: var(--h-text);
}
.article__source-chip .source-chip__dot {
  width: 8px;
  height: 8px;
}
.article__source-chip-orig {
  color: var(--h-text-muted);
}
.article__breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--h-text-subtle);
  margin-bottom: 16px;
}
.article__breadcrumbs a {
  color: inherit;
}
.article__breadcrumbs .current {
  color: var(--h-text);
  font-weight: 520;
}
.article__title {
  font-size: 48px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 680;
  margin: 0 0 20px;
  text-wrap: balance;
}
.article__dek {
  font-size: 22px;
  line-height: 1.45;
  color: var(--h-text-muted);
  margin-bottom: 32px;
  font-family: var(--h-font-body);
  font-weight: 400;
}
.article__byline {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 24px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--h-border);
  font-size: 13px;
  color: var(--h-text-muted);
}
.article__author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--h-primary), var(--h-cyan));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--h-font-head);
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.article__author-name {
  color: var(--h-text);
  font-weight: 600;
  font-size: 14px;
}
.article__author-role {
  font-size: 12px;
  color: var(--h-text-muted);
}
.article__byline-meta {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
}
.article__hero {
  aspect-ratio: 16/9;
  border-radius: var(--h-r-md);
  overflow: hidden;
  margin: 0 0 10px;
}
.article__hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.article__hero-caption {
  font-size: 12px;
  color: var(--h-text-subtle);
  margin: 0 0 32px;
}
.article__content {
  font-size: 19px;
  line-height: 1.75;
  color: var(--h-text);
  font-family: var(--h-font-body);
  max-width: 680px;
  /* Better hyphenation + smart-quote rendering */
  hyphens: auto;
  -webkit-hyphens: auto;
  text-rendering: optimizeLegibility;
  font-feature-settings: "liga", "kern";
}
.article__content p {
  margin: 0 0 24px;
}
/* Lede — first paragraph, larger, slightly heavier, with drop cap */
.article__content .article__lede {
  font-size: 22px;
  line-height: 1.55;
  font-weight: 460;
  color: var(--h-text);
  margin-bottom: 28px;
  letter-spacing: -0.005em;
}
.article__content .article__lede::first-letter {
  font-family: var(--h-font-head);
  font-size: 4.6em;
  line-height: 0.85;
  font-weight: 700;
  float: left;
  margin: 8px 14px 0 0;
  color: var(--h-primary);
  letter-spacing: -0.04em;
}
/* Pull quote — extends slightly into margin, breaks the column rhythm */
.article__pull-quote {
  position: relative;
  margin: 48px -32px;
  padding: 28px 32px 28px 56px;
  font-family: var(--h-font-head);
  font-size: 26px;
  line-height: 1.3;
  font-weight: 560;
  letter-spacing: -0.02em;
  color: var(--h-text);
  border-top: 2px solid var(--h-primary);
  border-bottom: 1px solid var(--h-border);
  background: var(--h-bg-warm);
  border-radius: var(--h-r-md);
}
.article__pull-quote::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 18px;
  bottom: 18px;
  width: 4px;
  border-radius: 2px;
  background: var(--h-primary);
}
.article__pull-quote .article__pull-quote-mark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 64px;
  line-height: 0;
  position: relative;
  top: 14px;
  margin-right: 8px;
  color: var(--h-primary);
  opacity: 0.3;
}
@media (max-width: 720px) {
  .article__pull-quote {
    margin: 32px 0;
    padding: 20px 20px 20px 40px;
    font-size: 20px;
  }
  .article__pull-quote::before {
    left: 12px;
  }
  .article__content .article__lede {
    font-size: 19px;
  }
  .article__content .article__lede::first-letter {
    font-size: 3.8em;
  }
}
.article__content h2 {
  font-size: 32px;
  margin: 48px 0 20px;
  letter-spacing: -0.025em;
  font-weight: 640;
}
.article__content h3 {
  font-size: 24px;
  margin: 32px 0 16px;
  letter-spacing: -0.02em;
  font-weight: 640;
}
.article__content a {
  color: var(--h-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.article__content blockquote {
  margin: 32px 0;
  padding: 20px 24px;
  border-left: 3px solid var(--h-primary);
  background: var(--h-bg-warm);
  border-radius: 0 var(--h-r-md) var(--h-r-md) 0;
  font-size: 22px;
  line-height: 1.4;
  letter-spacing: -0.015em;
  font-family: var(--h-font-head);
  font-weight: 560;
}
.article__content ul,
.article__content ol {
  margin: 0 0 20px;
  padding-left: 24px;
}
.article__content li {
  margin-bottom: 8px;
}
.article__content img {
  width: 100%;
  border-radius: var(--h-r-md);
  margin: 24px 0;
}

/* Font size toggle via class on article body */
.article__body[data-font-size="s"] .article__content {
  font-size: 16px;
  line-height: 1.65;
}
.article__body[data-font-size="m"] .article__content {
  font-size: 18px;
  line-height: 1.7;
}
.article__body[data-font-size="l"] .article__content {
  font-size: 21px;
  line-height: 1.75;
}

/* Key Takeaways (AIO block) */
.key-takeaways {
  margin: 40px 0;
  padding: 24px;
  background: var(--h-bg-soft);
  border-radius: var(--h-r-lg);
  border: 1px solid var(--h-border);
}
.key-takeaways__label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 640;
  color: var(--h-primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.key-takeaways__list {
  margin: 0;
  padding-left: 18px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--h-text);
}
.key-takeaways__list li {
  margin-bottom: 6px;
}

/* Q&A box (AIO-friendly, indexable by LLM crawlers) */
.qa-box {
  margin: 40px 0;
  padding: 24px;
  background: #fff;
  border-radius: var(--h-r-lg);
  border: 1px solid var(--h-border);
}
.qa-box__label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 640;
  color: var(--h-cyan);
  margin-bottom: 14px;
}
.qa-item {
  margin-bottom: 20px;
}
.qa-item:last-child {
  margin-bottom: 0;
}
.qa-item__q {
  font-size: 16px;
  font-weight: 640;
  color: var(--h-text);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.qa-item__a {
  font-size: 15px;
  line-height: 1.65;
  color: var(--h-text-muted);
  margin: 0;
}

/* Author card */
.author-card {
  margin-top: 48px;
  padding: 24px;
  border: 1px solid var(--h-border);
  border-radius: var(--h-r-lg);
  display: flex;
  gap: 20px;
}
.author-card__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--h-primary), var(--h-cyan));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--h-font-head);
  font-weight: 700;
  font-size: 22px;
  flex-shrink: 0;
}
.author-card__name {
  font-size: 16px;
  font-weight: 620;
}
.author-card__bio {
  font-size: 13px;
  color: var(--h-text-muted);
  margin: 2px 0 14px;
}
.author-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* JSON-LD badge */
.jsonld-badge {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: var(--h-r-md);
  background: var(--h-bg-warm);
  font-size: 11px;
  font-family: var(--h-font-mono);
  color: var(--h-text-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
}
.jsonld-badge-check {
  color: var(--h-green);
  font-size: 12px;
}

/* Article sidebar */
.article__sidebar {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.article__sidebar-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 640;
  color: var(--h-text-subtle);
  margin-bottom: 14px;
}
.related-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  margin-bottom: 16px;
}
.related-item__image {
  aspect-ratio: 1;
  border-radius: var(--h-r-sm);
  overflow: hidden;
}
.related-item__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.related-item__cat {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 640;
  color: var(--h-primary);
  margin-bottom: 4px;
}
.related-item__title {
  font-size: 13px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}
.trending-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.article__newsletter {
  padding: 20px;
  background: var(--h-bg-warm);
  border-radius: var(--h-r-lg);
}
.article__newsletter-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 640;
  color: var(--h-primary);
  margin-bottom: 10px;
}
.article__newsletter-title {
  font-size: 15px;
  line-height: 1.35;
  font-weight: 580;
  letter-spacing: -0.015em;
  margin-bottom: 12px;
}
.article__newsletter form {
  display: flex;
  gap: 6px;
  background: #fff;
  border-radius: var(--h-r-md);
  padding: 4px;
  border: 1px solid var(--h-border);
}
.article__newsletter input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 13px;
  padding: 6px 10px;
  background: transparent;
  font-family: var(--h-font-body);
}

/* Read next + Comments */
.read-next {
  margin-top: 72px;
}
.read-next__label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 640;
  color: var(--h-text-subtle);
  margin-bottom: 20px;
}
.read-next__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.comments {
  margin-top: 64px;
  padding-top: 48px;
  border-top: 1px solid var(--h-border);
}
.comments__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
}
.comments__header h2 {
  font-size: 28px;
  letter-spacing: -0.02em;
}
.comments__count {
  color: var(--h-text-subtle);
  font-weight: 500;
}
.comments__input {
  padding: 16px;
  border: 1px solid var(--h-border);
  border-radius: var(--h-r-md);
  background: var(--h-surface);
  margin-bottom: 32px;
}
.comments__input-placeholder {
  font-size: 14px;
  color: var(--h-text-subtle);
  padding: 16px 0;
}
.comment {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--h-divider);
}
.comment__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--h-bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--h-font-head);
  font-weight: 600;
  font-size: 14px;
}
.comment__header {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}
.comment__name {
  font-weight: 620;
  font-size: 14px;
}
.comment__time {
  font-size: 12px;
  color: var(--h-text-subtle);
}
.comment__body {
  font-size: 15px;
  line-height: 1.55;
  color: var(--h-text);
  margin: 0;
}
.comment__actions {
  display: flex;
  gap: 16px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--h-text-muted);
}

/* Drop cap for first paragraph */
.article__content p:first-child::first-letter {
  font-family: var(--h-font-head);
  font-size: 72px;
  font-weight: 680;
  float: left;
  line-height: 0.9;
  margin-right: 10px;
  margin-top: 4px;
  color: var(--h-primary);
  letter-spacing: -0.04em;
}

/* Article page responsive */
@media (max-width: 1200px) {
  .article,
  .article.article--no-toc {
    grid-template-columns: 56px minmax(0, 1fr) 280px;
  }
  .article__toc {
    display: none;
  }
}
@media (max-width: 900px) {
  .article,
  .article.article--no-toc {
    grid-template-columns: 1fr !important;
    padding: 20px 20px 60px;
    gap: 24px;
  }
  .article__share {
    flex-direction: row;
    position: static;
    overflow-x: auto;
  }
  .article__sidebar {
    order: 99;
  }
  .article__title {
    font-size: 32px;
  }
  .article__dek {
    font-size: 18px;
  }
  .article__content {
    font-size: 17px;
  }
  .read-next__grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================================================
   AI DIALOG (floating button + bottom sheet)
   ============================================================================= */
.ai-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: var(--h-deep);
  color: #fff;
  border: 1px solid var(--h-cyan);
  border-radius: var(--h-r-pill);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(1, 3, 52, 0.25);
  cursor: pointer;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}
.ai-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(1, 3, 52, 0.35);
}
.ai-fab[hidden] {
  display: none !important;
}
.ai-fab svg {
  color: var(--h-cyan);
}

.ai-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.ai-dialog[hidden] {
  display: none !important;
}
.ai-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 3, 52, 0.55);
  backdrop-filter: blur(4px);
}
.ai-dialog__sheet {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  background: var(--h-bg);
  border-radius: var(--h-r-xl) var(--h-r-xl) 0 0;
  box-shadow: var(--h-shadow-lg);
  display: flex;
  flex-direction: column;
  animation: ai-sheet-up 0.25s ease-out;
}
@keyframes ai-sheet-up {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.ai-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--h-border);
}
.ai-dialog__label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 640;
  color: var(--h-cyan);
  margin-bottom: 4px;
}
.ai-dialog__title {
  font-size: 22px;
  font-weight: 640;
  letter-spacing: -0.02em;
  margin: 0;
}
.ai-dialog__close {
  width: 36px;
  height: 36px;
  border-radius: var(--h-r-md);
  background: var(--h-bg-soft);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--h-text);
}
.ai-dialog__quick {
  display: flex;
  gap: 8px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--h-border);
  overflow-x: auto;
  scrollbar-width: none;
}
.ai-dialog__quick::-webkit-scrollbar {
  display: none;
}
.ai-dialog__chat {
  flex: 1;
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 120px;
}
.ai-dialog__chat:empty::before {
  content: "Задайте любой вопрос о статье — AI ответит на основе её содержания";
  color: var(--h-text-subtle);
  font-size: 14px;
  text-align: center;
  display: block;
  padding: 40px 20px;
}
.ai-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: var(--h-r-lg);
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.ai-msg--user {
  align-self: flex-end;
  background: var(--h-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ai-msg--assistant {
  align-self: flex-start;
  background: var(--h-bg-soft);
  color: var(--h-text);
  border-bottom-left-radius: 4px;
}
.ai-dialog__form {
  display: flex;
  gap: 8px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--h-border);
}
.ai-dialog__form textarea {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--h-r-md);
  border: 1px solid var(--h-border);
  outline: none;
  font-family: var(--h-font-body);
  font-size: 15px;
  resize: none;
  min-height: 44px;
  max-height: 120px;
}
.ai-dialog__form textarea:focus {
  border-color: var(--h-primary);
}
.ai-dialog__form button {
  height: 44px;
  width: 44px;
  padding: 0;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .ai-fab {
    bottom: 16px;
    right: 16px;
    padding: 10px 14px;
    font-size: 13px;
  }
  .ai-dialog__sheet {
    max-height: 92vh;
  }
  .ai-dialog__header {
    padding: 16px 20px 10px;
  }
  .ai-dialog__chat {
    padding: 16px 20px;
  }
  .ai-dialog__form {
    padding: 12px 20px 16px;
  }
}

/* Hide FAB when not on article page */
body:not(:has(.article-reader)) .ai-fab {
  display: none !important;
}

/* ============ Mobile burger menu ============ */
.nav__burger {
  display: none;
  background: none;
  border: 0;
  width: 40px;
  height: 40px;
  padding: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  color: inherit;
}
.nav__burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  transition:
    transform 0.2s,
    opacity 0.2s;
}
.nav--dark .nav__burger {
  color: #fff !important;
}
.nav--dark .nav__burger span {
  background: #fff !important;
}
.nav__burger span {
  background: currentColor !important;
}

.nav__burger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav__burger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav__burger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.nav__mobile-drawer {
  display: none;
  position: fixed;
  top: 68px;
  left: 0;
  right: 0;
  background: var(--h-bg, #fff);
  border-bottom: 1px solid var(--h-border);
  padding: 16px;
  flex-direction: column;
  gap: 4px;
  z-index: 100;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  max-height: calc(100vh - 68px);
  overflow-y: auto;
}
.nav--dark .nav__mobile-drawer {
  background: var(--h-deep, #010334);
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
.nav__mobile-drawer.is-open {
  display: flex;
}
.nav__mobile-drawer a {
  padding: 14px 16px;
  font-size: 17px;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
  border-radius: 10px;
}
.nav__mobile-drawer a:hover,
.nav__mobile-drawer a.active {
  background: var(--h-bg-soft, rgba(0, 0, 0, 0.04));
}
.nav--dark .nav__mobile-drawer a:hover,
.nav--dark .nav__mobile-drawer a.active {
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 900px) {
  .nav__burger {
    display: inline-flex;
  }
  .nav__links {
    display: none !important;
  }
  .nav__search {
    display: none !important;
  }
  .nav__locales {
    display: none !important;
  }
}

/* ============ Bookmark button active state ============ */
.article__share-btn[data-bookmark].is-active,
button[data-bookmark].is-active {
  color: var(--h-primary, #2d2fe8) !important;
}
.article__share-btn[data-bookmark].is-active::after,
button[data-bookmark].is-active::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--h-primary, #2d2fe8);
}

/* ============ AI dialog chat scroll ============ */
.ai-dialog__chat {
  max-height: 55vh;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding-bottom: 8px;
}
.ai-dialog__sheet {
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

/* ============ Copy toast ============ */
.h-toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%) translateY(20px);
  background: #111;
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
  z-index: 10000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.h-toast.is-shown {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* ============ RTL support — Arabic ============ */
html[dir="rtl"] {
  direction: rtl;
  text-align: right;
}
html[dir="rtl"] body {
  text-align: right;
}
html[dir="rtl"] .nav__logo-slash {
  margin-left: 0;
  margin-right: 2px;
}
html[dir="rtl"] .nav__inner {
  flex-direction: row-reverse;
}
html[dir="rtl"] .category-rail {
  direction: rtl;
}
html[dir="rtl"] .hero__brief-num {
  margin-right: 0;
  margin-left: 12px;
}
html[dir="rtl"] .hero__brief-foot {
  flex-direction: row-reverse;
}
html[dir="rtl"] .hero__cta-row {
  flex-direction: row-reverse;
  justify-content: flex-end;
}
html[dir="rtl"] .featured-card,
html[dir="rtl"] .card,
html[dir="rtl"] .compact-card,
html[dir="rtl"] .list-row,
html[dir="rtl"] .related-item {
  text-align: right;
}
html[dir="rtl"] .article__share {
  /* Sidebar share buttons — flip to right side */
  right: auto;
  left: 24px;
}
html[dir="rtl"] .article__byline {
  flex-direction: row-reverse;
}
html[dir="rtl"] .article__byline-meta {
  margin-left: 0;
  margin-right: auto;
}
html[dir="rtl"] .article__source-chip-orig::before {
  content: "← ";
}
html[dir="rtl"] .article__source-chip-orig {
  /* Override the "→ оригинал" arrow if any */
}
html[dir="rtl"] .nav__search-kbd {
  margin-left: 0;
  margin-right: auto;
}
html[dir="rtl"] .source-chip {
  flex-direction: row-reverse;
}
html[dir="rtl"] .stories-rail__scroll {
  flex-direction: row-reverse;
}
html[dir="rtl"] .h-cmt {
  flex-direction: row-reverse;
}
html[dir="rtl"] .h-cmt-user-bar {
  flex-direction: row-reverse;
}
html[dir="rtl"] .breadcrumbs {
  flex-direction: row-reverse;
}
html[dir="rtl"] .key-takeaways {
  border-left: none;
  border-right: 4px solid var(--h-cyan);
  padding-left: 16px;
  padding-right: 20px;
}
html[dir="rtl"] .article__pull-quote {
  border-left: none;
  border-right: 4px solid var(--h-primary);
}
/* Forms — flip label/input direction */
html[dir="rtl"] .article__comment-form-row {
  flex-direction: row-reverse;
}
html[dir="rtl"] .nav__locales {
  flex-direction: row-reverse;
}

/* ─── JHA-222 / JHA-223 / JHA-227: engagement (audio + reactions + comments) ─── */
.article__engagement {
  margin: 32px 0;
  padding: 24px;
  background: var(--h-surface);
  border: 1px solid var(--h-border);
  border-radius: 16px;
}
.article__engagement-title {
  font-family: var(--h-font-head);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--h-primary);
  margin-bottom: 16px;
}
.article__reactions {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.article__reactions-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--h-bg);
  color: var(--h-text);
  border: 1px solid var(--h-border);
  border-radius: 24px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.article__reactions-btn[disabled] {
  cursor: default;
  opacity: 0.6;
}
.article__reactions-btn:not([disabled]):hover {
  border-color: var(--h-primary);
  color: var(--h-primary);
}
.article__reactions-btn.is-active {
  background: var(--h-primary);
  border-color: var(--h-primary);
  color: #fff;
}
.article__reactions-btn.is-active:hover {
  background: var(--h-primary);
  color: #fff;
}

/* Public comment form */
.article__comment-form {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--h-border);
  border-radius: var(--h-r-md);
  background: var(--h-bg-warm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.article__comment-name-input,
.article__comment-text-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--h-border);
  border-radius: var(--h-r-sm, 10px);
  background: var(--h-bg);
  color: var(--h-text);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.45;
  resize: vertical;
}
.article__comment-name-input:focus,
.article__comment-text-input:focus {
  outline: none;
  border-color: var(--h-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.article__comment-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.article__comment-form-hint {
  font-size: 12px;
  color: var(--h-text-muted);
}
.article__comment-form-error {
  font-size: 13px;
  color: #d97757;
  background: rgba(217, 119, 87, 0.08);
  padding: 8px 12px;
  border-radius: 6px;
}
.article__audio {
  margin-bottom: 24px;
}
.article__audio audio {
  width: 100%;
  margin-top: 8px;
}
.article__audio-gen {
  padding: 10px 18px;
  background: var(--h-primary);
  color: #fff;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.article__audio-gen[disabled] {
  opacity: 0.5;
  cursor: wait;
}
.article__audio-error {
  margin-top: 8px;
  color: #c0392b;
  font-size: 13px;
}
.article__comments-title {
  font-family: var(--h-font-head);
  font-size: 22px;
  font-weight: 700;
  margin: 32px 0 16px;
}
.article__comments-empty {
  padding: 24px;
  text-align: center;
  color: var(--h-text-subtle);
  background: var(--h-bg);
  border-radius: 12px;
}
.article__comment {
  padding: 16px;
  background: var(--h-bg);
  border: 1px solid var(--h-border);
  border-radius: 12px;
  margin-bottom: 12px;
}
.article__comment-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.article__comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--h-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  flex-shrink: 0;
}
.article__comment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.article__comment-name {
  font-weight: 600;
  font-size: 14px;
}
.article__comment-date {
  font-size: 12px;
  color: var(--h-text-subtle);
  margin-left: auto;
}
.article__comment-text {
  font-size: 15px;
  line-height: 1.55;
  color: var(--h-text);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.article__comment-score {
  margin-top: 8px;
  font-size: 12px;
  color: var(--h-text-subtle);
}
.article__comments-cta {
  margin-top: 16px;
  padding: 16px;
  background: var(--h-bg-warm);
  border: 1px dashed var(--h-border-strong);
  border-radius: 12px;
  font-size: 14px;
  text-align: center;
  color: var(--h-text-subtle);
}
.article__comments-cta a {
  color: var(--h-primary);
  font-weight: 600;
  text-decoration: none;
}

/* ======= Stories rail (home page) — editorial style ======= */
.stories-rail {
  margin: 24px -40px 32px;
  padding: 0 40px;
  overflow: hidden;
  position: relative;
}
.stories-rail__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.stories-rail__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--h-primary);
}
.stories-rail__scroll {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 4px 4px 16px;
  -webkit-overflow-scrolling: touch;
}
.stories-rail__scroll::-webkit-scrollbar {
  display: none;
}
.story-tile {
  flex: 0 0 auto;
  width: 132px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--h-text);
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform 0.18s ease;
}
.story-tile:hover {
  transform: translateY(-2px);
}
.story-tile:hover .story-tile__title {
  color: var(--h-primary);
}
.story-tile.story-tile--seen .story-tile__ring {
  background: var(--h-border-strong) !important;
  opacity: 0.7;
}
.story-tile__ring {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  padding: 3px;
  display: block;
  flex-shrink: 0;
}
.story-tile__ring--muted {
  opacity: 0.85;
}
.story-tile__inner {
  border-radius: 50%;
  background: var(--h-bg, #faf7f2);
  border: 3px solid var(--h-bg, #faf7f2);
  overflow: hidden;
  display: block;
  position: absolute;
  inset: 3px;
}
.story-tile__inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.story-tile__badge {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  background: var(--h-cyan);
  color: #fff;
  border-radius: 999px;
  border: 2px solid var(--h-bg, #faf7f2);
  line-height: 1.2;
}
.story-tile__source {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--h-primary);
  text-align: center;
  max-width: 132px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.story-tile__title {
  font-size: 12px;
  line-height: 1.3;
  color: var(--h-text);
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 132px;
  transition: color 0.15s ease;
}
@media (max-width: 720px) {
  .stories-rail {
    margin: 16px -16px 24px;
    padding: 0 16px;
  }
  .story-tile {
    width: 108px;
  }
  .story-tile__ring {
    width: 76px;
    height: 76px;
  }
  .story-tile__title {
    font-size: 11px;
    -webkit-line-clamp: 2;
  }
}

/* Stories full-screen viewer */
.stories-viewer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(20, 16, 12, 0.96);
  display: none;
  align-items: stretch;
  justify-content: center;
  padding: 24px;
  -webkit-tap-highlight-color: transparent;
}
.stories-viewer[hidden] {
  display: none;
}
.stories-viewer.is-open {
  display: flex;
}
.stories-viewer__progress {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  gap: 4px;
  z-index: 2;
}
.stories-viewer__progress-bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  overflow: hidden;
}
.stories-viewer__progress-fill {
  height: 100%;
  background: #fff;
  width: 0;
  transition: width 0.1s linear;
}
.stories-viewer__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.stories-viewer__close:hover {
  background: rgba(255, 255, 255, 0.2);
}
.stories-viewer__card {
  width: 100%;
  max-width: 420px;
  height: min(720px, 90vh);
  margin-top: 32px;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  background: #1a1612;
  display: flex;
  flex-direction: column;
}
.stories-viewer__image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.stories-viewer__image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.05) 0%,
    rgba(0, 0, 0, 0.05) 60%,
    rgba(0, 0, 0, 0.85) 100%
  );
}
.stories-viewer__body {
  position: relative;
  margin-top: auto;
  padding: 24px;
  color: #fff !important;
  z-index: 3;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 0, 0, 0.65) 30%,
    rgba(0, 0, 0, 0.92) 100%
  );
}
.stories-viewer__source {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: rgba(255, 255, 255, 0.85) !important;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}
.stories-viewer__title {
  font-size: clamp(20px, 3.6vw, 26px) !important;
  font-weight: 700 !important;
  line-height: 1.25;
  margin: 0 0 18px !important;
  letter-spacing: -0.02em;
  color: #fff !important;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
}
.stories-viewer__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  color: #1a1612 !important;
  padding: 11px 20px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  position: relative;
  z-index: 4;
}
.stories-viewer__cta:hover {
  background: rgba(255, 255, 255, 0.92);
  transform: translateY(-1px);
}
.stories-viewer__nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 30%; /* leave bottom 30% for body+CTA so they're clickable */
  display: grid;
  grid-template-columns: 1fr 1fr;
  z-index: 2;
}
.stories-viewer__nav button {
  background: transparent;
  border: 0;
  cursor: pointer;
}

/* ============================================================
   Reduced motion — respect user OS-level setting
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .card:hover .card__image img,
  .featured-card:hover .featured-card__image img,
  .story-tile:hover {
    transform: none !important;
  }
}

/* ============================================================
   Small phones (<480px) — final responsive layer
   ============================================================ */
@media (max-width: 480px) {
  /* Tighter padding */
  .article {
    padding: 16px 16px 64px;
    gap: 16px;
  }
  /* Stack vertically — drop sidebars */
  .article,
  .article.article--no-toc {
    grid-template-columns: 1fr;
  }
  /* Hide left rail on phone — actions move to a sticky bottom bar */
  .article__share {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    margin: 0 0 12px;
  }
  .article__share-divider {
    display: none;
  }
  .article__sidebar {
    display: none;
  }
  /* Smaller article title on phone */
  .article__title {
    font-size: 32px;
    line-height: 1.1;
    letter-spacing: -0.02em;
  }
  .article__dek {
    font-size: 17px;
  }
  /* Body type — slightly smaller for phone reading */
  .article__content {
    font-size: 17px;
    line-height: 1.7;
  }
  .article__content .article__lede {
    font-size: 18px;
  }
  .article__content .article__lede::first-letter {
    font-size: 3.4em;
  }
  /* Hero image — full bleed on phone */
  .article__hero {
    margin: 0 -16px 16px;
    border-radius: 0;
  }
  /* Nav: hide desktop links, keep theme + burger + user */
  .nav__inner {
    padding: 12px 16px;
  }
  .nav__links,
  .nav__locales,
  .nav__search-kbd {
    display: none;
  }
  .nav__search {
    width: 40px;
    padding: 0;
    justify-content: center;
  }
  .nav__search span:not(.nav__search-kbd) {
    display: none;
  }
  /* Section padding scales down */
  .content {
    padding: 0 16px;
  }
  /* Cards: full-width grids → single column */
  .grid-3 {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  /* Featured card stacks */
  .featured-card {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 24px 0;
  }
  .featured-card__title {
    font-size: 28px;
  }
  .featured-card__image {
    min-height: 220px;
  }
  /* Hero rail */
  .hero {
    padding: 32px 16px 48px;
  }
  /* Pull quote — full bleed on phone */
  .article__pull-quote {
    margin: 32px -16px;
    padding: 20px 20px 20px 36px;
    font-size: 19px;
    border-radius: 0;
  }
  /* Touch target — buttons get min 44×44 for accessibility */
  .btn,
  .chip,
  .nav__user,
  .nav__theme,
  .article__share-btn,
  .article__reactions-btn {
    min-height: 44px;
  }
}

/* ============================================================
   Smooth scroll fallback (when motion not reduced)
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* ============================================================
   Continue-reading floating bar (article pages)
   ============================================================ */
.continue-bar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%) translateY(160%);
  width: min(640px, calc(100vw - 32px));
  background: var(--h-bg);
  color: var(--h-text);
  border: 1px solid var(--h-border);
  border-radius: 999px;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.06);
  padding: 8px 12px 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 90;
  transition:
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 0.25s ease;
  opacity: 0;
}
.continue-bar.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.continue-bar__progress {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  position: relative;
}
.continue-bar__progress svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.continue-bar__progress circle {
  fill: none;
  stroke-width: 2.4;
}
.continue-bar__progress-track {
  stroke: var(--h-border);
}
.continue-bar__progress-fill {
  stroke: var(--h-primary);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.18s ease;
}
.continue-bar__text {
  flex: 1;
  font-size: 13px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--h-text-muted);
}
.continue-bar__text strong {
  color: var(--h-text);
  font-weight: 600;
}
.continue-bar__close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  background: var(--h-bg-soft);
  color: var(--h-text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}
.continue-bar__close:hover {
  background: var(--h-border);
  color: var(--h-text);
}
@media (max-width: 480px) {
  .continue-bar {
    bottom: 8px;
    padding: 6px 8px 6px 12px;
  }
  .continue-bar__text {
    font-size: 12px;
  }
}

/* ============================================================
 * Audio player (Sprint 5.1) — used on article pages.
 * Mirrors mini-app .ap styles.
 * ============================================================ */
.ap-block {
  margin: 24px 0;
  padding: 20px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(0, 180, 200, 0.06));
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 16px;
}
.ap-block__head {
  font-family: var(--h-font-display, "Georgia", serif);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--h-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ap__row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ap__btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--h-bg);
  border: 1px solid var(--h-border);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--h-text);
  font-size: 14px;
  transition: transform 0.1s, background 0.15s;
}
.ap__btn:hover {
  background: var(--h-bg-soft);
}
.ap__btn:active {
  transform: scale(0.92);
}
.ap__btn--play {
  width: 50px;
  height: 50px;
  background: var(--h-primary);
  color: #fff;
  border-color: var(--h-primary);
  font-size: 18px;
}
.ap__btn--play:hover {
  background: var(--h-primary);
  filter: brightness(1.08);
}
.ap__btn--small {
  width: 36px;
  height: 36px;
  font-size: 11px;
  font-weight: 600;
}
.ap__progress {
  flex: 1;
  position: relative;
  height: 5px;
  background: var(--h-border);
  border-radius: 3px;
  cursor: pointer;
}
.ap__progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--h-primary);
  border-radius: 3px;
  width: 0%;
  transition: width 0.1s linear;
}
.ap__progress-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--h-primary);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.ap__progress:hover .ap__progress-thumb {
  opacity: 1;
}
.ap__time {
  font-size: 12px;
  color: var(--h-text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 40px;
}
.ap__time--right {
  text-align: right;
}
.ap__speed {
  background: transparent;
  border: 1px solid var(--h-border);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  color: var(--h-text);
  cursor: pointer;
}
.ap__speed:hover {
  background: var(--h-bg-soft);
}
.ap__gen-btn {
  width: 100%;
  padding: 12px 16px;
  background: var(--h-primary);
  color: #fff;
  border: 0;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.ap__gen-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.ap__error {
  color: var(--h-error, #d33);
  font-size: 13px;
}
@media (max-width: 480px) {
  .ap-block {
    margin: 18px -8px;
    padding: 16px;
    border-radius: 12px;
  }
  .ap__btn {
    width: 36px;
    height: 36px;
  }
  .ap__btn--play {
    width: 46px;
    height: 46px;
  }
  .ap__btn--small {
    width: 32px;
    height: 32px;
    font-size: 10px;
  }
}

/* ============================================================
   Cases page — case-card design (added to design system)
   ============================================================ */
.cases-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 32px;
}
@media (max-width: 880px) { .cases-grid { grid-template-columns: 1fr; } }

.case-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 32px 28px;
  background: #fff;
  border: 1px solid var(--h-border);
  border-radius: 20px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  min-height: 380px; /* JHA-FIX uniform grid rows */
}
.case-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(0,0,0,0.06);
  border-color: var(--h-text);
}
.case-card__icon {
  font-size: 32px;
  line-height: 1;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--h-bg-warm);
  border-radius: 14px;
}
.case-card__industry {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--h-text-muted);
}
.case-card__title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--h-text);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  min-height: calc(1.25em * 2); /* reserve ≥2 lines */
}
.case-card__result {
  font-size: 15px;
  line-height: 1.55;
  color: var(--h-text-muted);
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
.case-card__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--h-border);
}
.case-card__metrics > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.case-card__metric-value {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--h-text);
  font-variant-numeric: tabular-nums;
}
.case-card__metric-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--h-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.3;
}

/* Mobile/tablet responsive — show nav scroll bar (base hides at 900px) */
@media (max-width: 900px) {
  .nav__inner {
    flex-wrap: wrap !important;
    gap: 12px;
  }
  .nav__links {
    display: flex !important;
    width: 100%;
    order: 3;
    gap: 14px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 4px 0 6px;
    border-top: 1px solid var(--h-border);
    margin-top: 4px;
  }
  .nav__links::-webkit-scrollbar { display: none; }
  .nav__links a {
    flex-shrink: 0;
    font-size: 14px;
  }
}
@media (max-width: 480px) {
  .case-card { padding: 24px 20px; }
  .case-card__title { font-size: 19px; }
  .case-card__metrics { grid-template-columns: 1fr 1fr; }
  .case-card__metric-value { font-size: 18px; }
}

/* Lang switcher — pill row of small buttons */
.lang-switch,
#lang-switcher {
  display: inline-flex !important;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--h-bg-warm);
  border-radius: 999px;
  border: 1px solid var(--h-border);
}
.nav__lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 26px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--h-text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}
.nav__lang-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--h-text);
}
.nav__lang-btn--active,
.nav__lang-btn.active {
  background: var(--h-text);
  color: #fff;
}

/* Footer — proper grid layout (template uses __brand/__group classes) */
.footer__inner {
  display: grid;
  grid-template-columns: 1.4fr 2fr;
  gap: 64px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px 24px 32px;
}
@media (max-width: 880px) {
  .footer__inner { grid-template-columns: 1fr; gap: 32px; padding: 40px 20px 24px; }
}
.footer__brand h3 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
  color: #fff;
}
.footer__brand p {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
  margin: 0;
  max-width: 360px;
}
.footer__links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}
@media (max-width: 600px) { .footer__links { grid-template-columns: repeat(2, 1fr); } }
.footer__group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer__group h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin: 0 0 6px;
}
.footer__group a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: color 0.15s;
  line-height: 1.5;
}
.footer__group a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 24px;
  max-width: 1280px;
  margin: 0 auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}
.footer__bottom a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.15s;
}
.footer__bottom a:hover { color: #fff; }

/* Article-actions states (article-actions.js targets) */
.article__share-btn.is-active {
  color: var(--h-coral, #e85a3c);
  background: rgba(232, 90, 60, 0.1);
}
.article__share-btn.article__share-btn[data-font].is-active {
  background: var(--h-text) !important;
  color: var(--h-bg, #fff) !important;
}
.article__body[data-font-size="s"] { font-size: 15px; line-height: 1.65; }
.article__body[data-font-size="m"] { font-size: 17px; line-height: 1.7; }
.article__body[data-font-size="l"] { font-size: 19px; line-height: 1.75; }


@media (max-width: 640px) {
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}


/* ============================================================================
   Dark theme — override CSS custom properties on html.h-theme-dark.
   Brand v2 uses var(--h-bg/--h-text/etc) everywhere → flip vars and the
   whole site re-themes automatically. No per-element rules needed.
   ============================================================================ */
html.h-theme-dark {
  color-scheme: dark;
  --h-bg: #0a0a0a;
  --h-bg-soft: #161616;
  --h-bg-warm: #1a1a1a;
  --h-surface: #161616;
  --h-border: #262626;
  --h-border-strong: #383838;
  --h-divider: #1f1f1f;
  --h-text: #f0f0f0;
  --h-text-muted: #b8b8b8;
  --h-text-subtle: #808080;
  --h-text-inverse: #0a0a0a;
}
html.h-theme-dark body {
  background: var(--h-bg);
  color: var(--h-text);
}
/* Specific overrides for elements with hardcoded colors */
html.h-theme-dark .article__share-btn {
  background: var(--h-bg-soft);
  border-color: var(--h-border);
  color: var(--h-text-muted);
}
html.h-theme-dark .article__share-btn:hover {
  background: var(--h-bg-warm);
  color: var(--h-text);
}
html.h-theme-dark .article__share-btn[data-font].is-active {
  background: var(--h-text);
  color: var(--h-bg);
}
html.h-theme-dark .nav,
html.h-theme-dark .footer {
  background: #050505;
}
html.h-theme-dark .nav__lang-btn--active,
html.h-theme-dark .nav__lang-btn.active {
  background: var(--h-text);
  color: var(--h-bg);
}
html.h-theme-dark .card,
html.h-theme-dark .featured-card,
html.h-theme-dark .case-card,
html.h-theme-dark .news-card,
html.h-theme-dark .sidebar-card,
html.h-theme-dark .newsletter-card {
  background: var(--h-surface);
  border-color: var(--h-border);
}
html.h-theme-dark .card:hover,
html.h-theme-dark .featured-card:hover,
html.h-theme-dark .case-card:hover {
  border-color: var(--h-border-strong);
}
html.h-theme-dark .chip {
  border-color: var(--h-border);
  color: var(--h-text-muted);
}
html.h-theme-dark .chip:hover { color: var(--h-text); border-color: var(--h-border-strong); }
html.h-theme-dark .chip.active,
html.h-theme-dark .chip--primary {
  background: var(--h-text);
  color: var(--h-bg);
  border-color: var(--h-text);
}

/* === Reactions block (article bottom) === */
.article__reactions .reaction-btn {
  font-family: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.article__reactions .reaction-btn:hover {
  border-color: var(--h-text);
}
.article__reactions .reaction-btn.is-active {
  background: var(--h-text);
  color: var(--h-bg);
  border-color: var(--h-text);
}
.article__reactions .reaction-btn.is-active [data-reaction-count] {
  color: rgba(255,255,255,.7);
}

/* === AI Dialog FAB + Modal (article page) === */
.ai-dialog-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px 14px 18px;
  background: var(--h-primary, #2D2FE8);
  color: #fff;
  border: none;
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 620;
  letter-spacing: -0.005em;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(45,47,232,.35), 0 4px 12px rgba(0,0,0,.12);
  transition: transform .15s ease, box-shadow .15s ease;
}
.ai-dialog-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(45,47,232,.45), 0 6px 16px rgba(0,0,0,.16);
}
.ai-dialog-fab svg { flex-shrink: 0; }
@media (max-width: 720px) {
  .ai-dialog-fab { bottom: 16px; right: 16px; padding: 12px; }
  .ai-dialog-fab__label { display: none; }
}
.ai-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(1,3,52,.55);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 20px;
}
.ai-dialog-overlay[hidden] { display: none; }
.ai-dialog {
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--h-bg, #fff);
  border: 1px solid var(--h-border, #e5e7eb);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  overflow: hidden;
}
.ai-dialog__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: var(--h-deep, #010334);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.ai-dialog__head-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--h-cyan, #29A9FF), var(--h-primary, #2D2FE8));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.ai-dialog__head-text { flex: 1; min-width: 0; }
.ai-dialog__head-title { font-size: 14px; font-weight: 620; line-height: 1.2; }
.ai-dialog__head-sub { font-size: 11px; color: rgba(255,255,255,.6); margin-top: 2px; }
.ai-dialog__close {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  border: none;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.ai-dialog__close:hover { background: rgba(255,255,255,.16); }
.ai-dialog__body { flex: 1; overflow-y: auto; padding: 18px; }
.ai-dialog__suggest-label {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 640; color: var(--h-text-subtle, #8898a6);
  margin-bottom: 8px;
}
.ai-dialog__suggest { display: flex; flex-direction: column; gap: 6px; }
.ai-dialog__suggest-btn {
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--h-border, #e5e7eb);
  background: var(--h-bg, #fff);
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  color: var(--h-text, #010334);
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.ai-dialog__suggest-btn:hover { background: var(--h-bg-soft, #f7f8fc); border-color: var(--h-primary, #2D2FE8); }
.ai-dialog__messages { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.ai-dialog__msg {
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 14px;
  max-width: 92%;
  white-space: pre-wrap;
}
.ai-dialog__msg--user {
  align-self: flex-end;
  background: var(--h-deep, #010334);
  color: #fff;
  border-radius: 14px 14px 4px 14px;
}
.ai-dialog__msg--ai {
  align-self: flex-start;
  background: var(--h-bg-soft, #f7f8fc);
  color: var(--h-text, #010334);
  border-radius: 14px 14px 14px 4px;
}
.ai-dialog__form {
  padding: 14px 16px;
  border-top: 1px solid var(--h-border, #e5e7eb);
  background: var(--h-bg-soft, #f7f8fc);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}
.ai-dialog__input {
  padding: 10px 12px;
  border: 1px solid var(--h-border-strong, #c7d2e9);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--h-text, #010334);
  outline: none;
}
.ai-dialog__input:focus { border-color: var(--h-primary, #2D2FE8); }
.ai-dialog__send {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--h-primary, #2D2FE8);
  color: #fff;
  border: none;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 620;
  cursor: pointer;
}
.ai-dialog__send:hover { background: #4a4cf0; }
.ai-dialog__foot {
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--h-text-subtle, #8898a6);
  margin-top: 4px;
}

/* === Profile page enhancements === */
.profile-stats4 {
  padding: 32px 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  border-bottom: 1px solid var(--h-border);
}
@media (max-width: 720px) {
  .profile-stats4 { grid-template-columns: repeat(2, 1fr); }
}
.profile-stat {
  padding: 24px;
  border: 1px solid var(--h-border);
  border-radius: var(--h-r-lg, 16px);
  background: var(--h-bg);
  position: relative;
  overflow: hidden;
}
.profile-stat--gradient {
  background: linear-gradient(135deg, var(--h-primary, #2D2FE8), #4a4cf0);
  color: #fff;
  border: none;
}
.profile-stat__label {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 640;
  color: var(--h-text-subtle, #8898a6);
  margin-bottom: 8px;
}
.profile-stat--gradient .profile-stat__label { color: rgba(255,255,255,.8); }
.profile-stat__value {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-family: var(--h-font-head, var(--h-font-display, Georgia, serif));
}
.profile-stat__sub { margin-top: 4px; font-size: 13px; color: var(--h-text-muted); }
.profile-stat--gradient .profile-stat__sub { color: rgba(255,255,255,.85); }
.profile-donate-card {
  position: relative;
  padding: 24px;
  background: var(--h-deep, #010334);
  color: #fff;
  border-radius: var(--h-r-lg, 16px);
  overflow: hidden;
}
.profile-donate-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 100%, var(--h-cyan, #29A9FF) 0%, transparent 50%);
  opacity: .25;
  pointer-events: none;
}
.profile-donate-card > * { position: relative; z-index: 1; }
.profile-donate-card__badge {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 640;
  color: var(--h-cyan, #29A9FF);
  margin-bottom: 12px;
}
.profile-donate-card__title {
  font-size: 20px;
  letter-spacing: -.02em;
  margin: 0 0 10px;
  color: #fff;
  font-family: var(--h-font-head, var(--h-font-display, Georgia, serif));
}
.profile-donate-card__lead {
  font-size: 13px;
  color: rgba(255,255,255,.72);
  line-height: 1.55;
  margin: 0 0 16px;
}
.profile-donate-card__btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.profile-donate-card__btn {
  padding: 10px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,.1);
  color: #fff;
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 620;
}
.profile-donate-card__btn--accent { background: #fff; color: var(--h-deep, #010334); }
.profile-donate-card__btn:hover { background: rgba(255,255,255,.18); }
.profile-donate-card__btn--accent:hover { background: #f0f0ff; }
.profile-subs {
  padding: 20px;
  border: 1px solid var(--h-border);
  border-radius: var(--h-r-lg, 16px);
}
.profile-subs__label {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 640;
  color: var(--h-text-subtle);
  margin-bottom: 14px;
}

/* === Archive month calendar === */
.archive-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  max-width: 520px;
}
.archive-cal__dayname {
  font-size: 10px; letter-spacing: .08em;
  color: var(--h-text-subtle);
  text-align: center;
  padding: 4px 0;
  font-weight: 600;
}
.archive-cal__day {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 6px;
  text-decoration: none;
  font-family: var(--h-font-mono, "JetBrains Mono", monospace);
  font-size: 11px;
  transition: transform .12s;
}
.archive-cal__day:hover { transform: scale(1.05); }
.archive-cal__day-n { line-height: 1; }
.archive-cal__day-count {
  font-weight: 700;
  font-size: 13px;
  font-family: var(--h-font-head, var(--h-font-display, Georgia, serif));
}

/* === Branded 404 === */
.not-found-page { min-height: 60vh; }
.not-found-page h1 {
  background: linear-gradient(135deg, var(--h-primary, #2D2FE8), var(--h-cyan, #29A9FF));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* === Source page redesign (handoff 2026-05-16) === */
.source-hero {
  padding: 40px 0 36px;
  background: var(--h-bg-warm, #f4f0e8);
  border-bottom: 1px solid var(--h-border, #e7e3d8);
  margin: 0 -40px 0;
  padding-left: 40px;
  padding-right: 40px;
}
.source-hero__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 32px;
  align-items: center;
  max-width: 1440px;
}
.source-hero__logo {
  width: 120px;
  height: 120px;
  border-radius: 20px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--h-font-head, Georgia, serif);
  font-weight: 800;
  font-size: 52px;
  letter-spacing: -0.04em;
  box-shadow: var(--h-shadow-md, 0 6px 20px rgba(0,0,0,0.08));
  flex-shrink: 0;
}
.source-hero__main { min-width: 0; }
.source-hero__badge {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 640;
  color: var(--h-text-subtle, #8b8579);
  margin-bottom: 10px;
}
.source-hero__title {
  font-size: clamp(40px, 5vw, 56px);
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0;
}
.source-hero__desc {
  font-size: 16px;
  color: var(--h-text-muted, #5a5347);
  margin-top: 14px;
  max-width: 640px;
  line-height: 1.5;
}
.source-hero__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--h-text-muted, #5a5347);
  flex-wrap: wrap;
}
.source-hero__sep { opacity: 0.4; }
.source-hero__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.source-hero__status-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--h-green, #28C26F);
  box-shadow: 0 0 6px var(--h-green, #28C26F);
}
.source-hero__ext {
  color: var(--h-primary, #2D2FE8);
  text-decoration: none;
}
.source-hero__ext:hover { text-decoration: underline; }
.source-hero__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 180px;
}
.source-hero__btn { width: 100%; justify-content: center; }

.source-grid {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 48px;
  margin-top: 32px;
}
.source-grid__main { min-width: 0; }
.source-list__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.source-list__title {
  font-size: 28px;
  letter-spacing: -0.02em;
  margin: 0;
}
.source-list { display: flex; flex-direction: column; }

.source-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.source-sidebar__card {
  padding: 24px;
  border-radius: var(--h-r-lg, 16px);
}
.source-sidebar__card--warm { background: var(--h-bg-warm, #f4f0e8); }
.source-sidebar__card--outline {
  padding: 20px 24px;
  border: 1px solid var(--h-border, #e7e3d8);
}
.source-sidebar__label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 640;
  color: var(--h-text-subtle, #8b8579);
  margin-bottom: 16px;
}
.source-topics { display: flex; flex-direction: column; gap: 10px; }
.source-topic {
  display: grid;
  grid-template-columns: 1fr auto 80px;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  padding: 4px 0;
}
.source-topic:hover .source-topic__name { color: var(--h-primary, #2D2FE8); }
.source-topic__name {
  font-size: 14px;
  font-weight: 560;
  color: var(--h-text, #1a1812);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.source-topic__count {
  font-size: 12px;
  color: var(--h-text-subtle, #8b8579);
  font-family: var(--h-font-mono, 'JetBrains Mono', monospace);
}
.source-topic__bar {
  width: 80px;
  height: 4px;
  background: var(--h-border, #e7e3d8);
  border-radius: 2px;
  overflow: hidden;
  display: block;
}
.source-topic__bar-fill {
  display: block;
  height: 100%;
  background: var(--h-primary, #2D2FE8);
}
.source-trust__score {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.source-trust__num {
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-family: var(--h-font-head, Georgia, serif);
}
.source-trust__den {
  font-size: 14px;
  color: var(--h-text-muted, #5a5347);
}
.source-trust__basis {
  font-size: 12px;
  color: var(--h-text-subtle, #8b8579);
  margin-top: 8px;
  line-height: 1.5;
}

/* Button variants used by source-hero (fallbacks if base styles miss) */
.btn--dark {
  background: var(--h-deep, #010106);
  color: #fff;
  border-color: var(--h-deep, #010106);
}
.btn--outline {
  background: transparent;
  color: var(--h-text, #1a1812);
  border-color: var(--h-border-strong, #d6d0c1);
}

@media (max-width: 960px) {
  .source-hero__inner {
    grid-template-columns: auto 1fr;
    grid-template-areas: "logo main" "actions actions";
    gap: 20px;
  }
  .source-hero__logo { grid-area: logo; width: 88px; height: 88px; font-size: 40px; border-radius: 16px; }
  .source-hero__main { grid-area: main; }
  .source-hero__actions { grid-area: actions; flex-direction: row; min-width: 0; }
  .source-hero__btn { flex: 1; }
  .source-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}
@media (max-width: 640px) {
  .source-hero__title { font-size: 32px; }
  .source-hero__desc { font-size: 14px; }
  .source-hero__meta { font-size: 12px; gap: 8px; }
}

/* ============================================================
   Profile screen v2 — identity row, tabs, heatmap, bookmarks grid
   ============================================================ */
.profile-identity {
  padding: 32px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  border-bottom: 1px solid var(--h-border);
}
.profile-identity__left {
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
}
.profile-avatar {
  width: 96px;
  height: 96px;
  flex: 0 0 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--h-primary, #2D2FE8), var(--h-cyan, #29A9FF));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--h-font-head);
  font-weight: 700;
  font-size: 36px;
  letter-spacing: -0.02em;
}
.profile-identity__meta { min-width: 0; }
.profile-identity__eyebrow {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 640;
  color: var(--h-text-subtle);
  margin-bottom: 8px;
}
.profile-identity__name {
  font-size: 44px;
  letter-spacing: -0.03em;
  line-height: 1;
  margin: 0;
}
.profile-identity__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--h-text-muted);
  align-items: center;
}
.profile-identity__dot { opacity: 0.4; }
.profile-identity__badge {
  color: var(--h-primary);
  font-weight: 620;
}
.profile-identity__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
@media (max-width: 760px) {
  .profile-identity { grid-template-columns: 1fr; }
  .profile-identity__name { font-size: 32px; }
  .profile-avatar { width: 72px; height: 72px; flex-basis: 72px; font-size: 28px; }
  .profile-identity__actions { width: 100%; }
  .profile-identity__actions .btn { flex: 1; justify-content: center; }
}

/* Streak heatmap */
.profile-heatmap-section {
  padding: 24px 0 32px;
  border-bottom: 1px solid var(--h-border);
}
.profile-heatmap-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 640;
  color: var(--h-text-subtle);
  margin-bottom: 14px;
}
.profile-heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  max-width: 420px;
}
.profile-heatmap__cell {
  aspect-ratio: 1;
  border-radius: 4px;
  background: var(--h-bg-soft, rgba(0,0,0,0.04));
}
.profile-heatmap__cell[data-lvl="1"] { background: rgba(45, 47, 232, 0.25); }
.profile-heatmap__cell[data-lvl="2"] { background: rgba(45, 47, 232, 0.45); }
.profile-heatmap__cell[data-lvl="3"] { background: rgba(45, 47, 232, 0.7); }
.profile-heatmap__cell[data-lvl="4"] { background: var(--h-primary, #2D2FE8); }
.profile-heatmap-hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--h-text-muted);
  line-height: 1.5;
}

/* Tab bar */
.profile-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--h-border);
  margin: 32px 0 32px;
}
.profile-tab {
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 520;
  color: var(--h-text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.profile-tab:hover { color: var(--h-text); }
.profile-tab--active {
  color: var(--h-text);
  font-weight: 640;
  border-bottom-color: var(--h-primary, #2D2FE8);
}
@media (max-width: 760px) {
  .profile-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .profile-tab { padding: 12px 14px; font-size: 13px; }
}

/* Tab panel */
.profile-panel { padding: 0 0 24px; }
.profile-panel-title {
  font-size: 28px;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
}
.profile-panel-count {
  color: var(--h-text-subtle);
  font-weight: 500;
}

/* Bookmarks 3-col grid */
.profile-bookmarks-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 1024px) {
  .profile-bookmarks-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .profile-bookmarks-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Search screen v2 — left filter sidebar + AI banner
   ============================================================ */
.search-layout { padding-top: 40px; }
.search-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 48px;
  max-width: 1200px;
  margin: 0 auto;
}
@media (max-width: 880px) {
  .search-grid { grid-template-columns: 1fr; gap: 24px; }
}

.search-filters { min-width: 0; }
.search-filters__eyebrow {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 640;
  color: var(--h-text-subtle);
  margin-bottom: 14px;
}
.search-filter-group { margin-bottom: 28px; }
.search-filter-group__label {
  font-size: 12px;
  font-weight: 640;
  color: var(--h-text);
  margin-bottom: 10px;
  letter-spacing: -0.005em;
}
.search-filter-group__items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.search-filter-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--h-text-muted);
  text-decoration: none;
  padding: 4px 0;
}
.search-filter-item:hover { color: var(--h-text); }
.search-filter-item--active { color: var(--h-text); font-weight: 600; }
.search-filter-item__check {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 4px;
  border: 1.5px solid var(--h-border-strong, var(--h-border));
  background: transparent;
  position: relative;
}
.search-filter-item__check--on {
  background: var(--h-primary, #2D2FE8);
  border-color: var(--h-primary, #2D2FE8);
}
.search-filter-item__check--on::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: #fff;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
.search-filter-item__radio {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid var(--h-border-strong, var(--h-border));
  background: transparent;
  position: relative;
}
.search-filter-item__radio--on {
  border-color: var(--h-primary, #2D2FE8);
}
.search-filter-item__radio--on::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--h-primary, #2D2FE8);
}
.search-filter-item__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.search-filter-item__count {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--h-text-subtle);
  font-variant-numeric: tabular-nums;
}

/* Results column */
.search-results { min-width: 0; }

/* AI answer banner */
.search-ai-banner {
  margin-bottom: 32px;
  padding: 24px;
  background: var(--h-deep, #010334);
  color: #fff;
  border-radius: var(--h-r-lg, 14px);
  position: relative;
  overflow: hidden;
}
.search-ai-banner__overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 100% 0%, var(--h-cyan, #29A9FF) 0%, transparent 40%);
  opacity: 0.2;
  pointer-events: none;
}
.search-ai-banner__inner { position: relative; z-index: 1; }
.search-ai-banner__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 640;
  color: var(--h-cyan, #29A9FF);
  margin-bottom: 14px;
}
.search-ai-banner__body {
  font-size: 17px;
  line-height: 1.55;
  margin: 0;
  color: rgba(255,255,255,0.92);
}
.search-ai-banner__sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 18px;
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  align-items: center;
}
.search-ai-banner__source-chip {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  color: rgba(255,255,255,0.85);
}


/* ─── 2026-05-16: Handoff-aligned portal screen polish ────────────────────── */

/* ── TAG screen ───────────────────────────────────────────────────────────── */
.tag-hero--warm {
  background: linear-gradient(180deg, var(--h-bg-warm, #faf7f2) 0%, var(--h-bg, #fff) 100%);
}
.tag-hero__h1 {
  font-family: var(--h-font-head, inherit);
}
.tag-hero__desc {
  font-family: var(--h-font-body, inherit);
}
.tag-hero__related {
  align-items: center;
}
.tag-hero__filters {
  position: sticky;
  top: 64px;
  background: var(--h-bg);
  padding: 12px 0;
  z-index: 5;
  border-bottom: 1px solid var(--h-border-soft, transparent);
}
.tag-grid-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 32px;
  margin-top: 32px;
  align-items: start;
}
.tag-grid-layout__main {
  min-width: 0;
}
.tag-grid {
  margin-bottom: 24px;
}
@media (max-width: 1024px) {
  .tag-grid-layout {
    grid-template-columns: 1fr;
  }
  .tag-side-sources {
    order: -1;
  }
}
.tag-side-sources {
  position: sticky;
  top: 88px;
  padding: 22px;
  background: var(--h-bg-soft, #f5f3ee);
  border-radius: var(--h-r-lg, 12px);
}
.tag-aside__head {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 640;
  color: var(--h-primary);
  margin-bottom: 14px;
}
.tag-aside__row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--h-border);
}
.tag-aside__row:last-child {
  border-bottom: 0;
}
.source-chip__dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.tag-aside__name {
  flex: 1;
  font-size: 14px;
  font-weight: 560;
  color: var(--h-text);
  text-decoration: none;
}
.tag-aside__name:hover {
  color: var(--h-primary);
}
.tag-aside__count {
  font-size: 12px;
  color: var(--h-text-subtle);
  font-family: var(--h-font-mono, monospace);
}

/* Filter chips */
.chip--xs {
  font-size: 11px;
  padding: 3px 8px;
}
.chip--sm {
  font-size: 12px;
  padding: 5px 10px;
}
.chip--solid {
  background: var(--h-deep, #010306);
  color: #fff;
  border: 1px solid var(--h-deep, #010306);
}
.chip--solid:hover {
  background: var(--h-primary);
  border-color: var(--h-primary);
}

/* ── ARCHIVE screen ───────────────────────────────────────────────────────── */
.archive-hero__head {
  align-items: baseline;
}
.archive-hero__nav .btn {
  text-transform: capitalize;
}
.archive-year-strip {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
  margin: 24px 0;
}
.archive-year-strip__cell {
  display: block;
  padding: 10px 6px;
  text-align: center;
  border-radius: var(--h-r-md, 8px);
  background: var(--h-bg-soft, #f5f3ee);
  color: var(--h-text);
  text-decoration: none;
  transition: background 0.15s;
  border: 1px solid transparent;
}
.archive-year-strip__cell:hover {
  background: var(--h-bg-warm, #faf7f2);
  border-color: var(--h-border);
}
.archive-year-strip__cell.is-current {
  background: var(--h-deep, #010306);
  color: #fff;
  border-color: var(--h-deep, #010306);
}
.archive-year-strip__cell.is-future {
  opacity: 0.4;
  pointer-events: none;
}
.archive-year-strip__name {
  font-size: 12px;
  font-weight: 560;
}
.archive-year-strip__count {
  font-size: 10px;
  margin-top: 2px;
  color: var(--h-text-subtle);
  font-family: var(--h-font-mono, monospace);
}
.archive-year-strip__cell.is-current .archive-year-strip__count {
  color: rgba(255, 255, 255, 0.6);
}

.archive-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 48px;
  margin-top: 32px;
  align-items: start;
}
.archive-layout__main {
  min-width: 0;
}
@media (max-width: 1024px) {
  .archive-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .archive-sidebar {
    order: 2;
  }
}

.archive-sidebar__section {
  margin-bottom: 32px;
}
.archive-sidebar__label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 640;
  color: var(--h-text-subtle);
  margin-bottom: 16px;
}
.archive-sidebar__row {
  display: grid;
  grid-template-columns: 10px 1fr auto 120px;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13px;
}
.archive-sidebar__section:not(:first-child) .archive-sidebar__row {
  grid-template-columns: 1fr auto 120px;
}
.archive-sidebar__name {
  color: var(--h-text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.archive-sidebar__name:hover {
  color: var(--h-primary);
}
.archive-sidebar__count {
  font-size: 12px;
  color: var(--h-text-subtle);
  font-family: var(--h-font-mono, monospace);
}
.archive-sidebar__bar {
  width: 120px;
  height: 6px;
  background: var(--h-border);
  border-radius: 3px;
  overflow: hidden;
}
.archive-sidebar__bar-fill {
  height: 100%;
  background: var(--h-primary);
  transition: width 0.3s ease;
}
.archive-sidebar__bar-fill--cyan {
  background: var(--h-cyan, #29A9FF);
}

.archive-day-group {
  margin-bottom: 56px;
}
.archive-day-group__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--h-border);
}
.archive-day-group__h2 {
  font-size: 28px;
  letter-spacing: -0.02em;
  margin: 0;
  text-transform: capitalize;
}
.archive-day-group__count {
  font-size: 13px;
  color: var(--h-text-muted);
}

/* ── 404 screen — dark theme ──────────────────────────────────────────────── */
.not-found-page--dark {
  background: var(--h-deep, #010306);
  color: #fff;
  position: relative;
  overflow: hidden;
  min-height: 80vh;
  padding: 0;
}
.not-found-page__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 110%, rgba(41, 169, 255, 0.32) 0%, rgba(41, 169, 255, 0) 45%),
    radial-gradient(circle at 90% -10%, rgba(45, 47, 232, 0.18) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}
.not-found-page__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 80px;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 40px 100px;
}
@media (max-width: 900px) {
  .not-found-page__inner {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 48px 24px 64px;
  }
}
.not-found-page__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(249, 93, 81, 0.15);
  border: 1px solid rgba(249, 93, 81, 0.3);
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 640;
  color: var(--h-red, #F95D51);
  margin-bottom: 24px;
}
.not-found-page__h1 {
  font-size: clamp(56px, 9vw, 96px);
  letter-spacing: -0.035em;
  line-height: 0.95;
  font-weight: 700;
  text-wrap: balance;
  margin: 0;
  color: #fff;
}
.not-found-page__h1-accent {
  color: var(--h-cyan, #29A9FF);
}
.not-found-page__lead {
  font-size: 19px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.7);
  margin: 24px 0 32px;
  max-width: 500px;
}
.not-found-page__search {
  display: flex;
  gap: 8px;
  max-width: 480px;
  margin-bottom: 24px;
}
.not-found-page__search input {
  flex: 1;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--h-r-md, 8px);
  color: #fff;
  font-size: 15px;
}
.not-found-page__search input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}
.not-found-page__search input:focus {
  outline: none;
  border-color: var(--h-cyan, #29A9FF);
  background: rgba(255, 255, 255, 0.1);
}
.not-found-page__search button {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--h-cyan, #29A9FF);
  border: 0;
  border-radius: var(--h-r-md, 8px);
  color: #fff;
  cursor: pointer;
}
.not-found-page__cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.not-found-page__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--h-r-md, 8px);
  font-size: 15px;
  font-weight: 560;
  text-decoration: none;
  letter-spacing: -0.005em;
}
.not-found-page__btn--white {
  background: #fff;
  color: var(--h-deep, #010306);
}
.not-found-page__btn--white:hover {
  background: var(--h-bg-warm, #faf7f2);
}
.not-found-page__btn--ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}
.not-found-page__btn--ghost:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
}
.not-found-page__aside-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 640;
  color: var(--h-cyan, #29A9FF);
  margin-bottom: 18px;
}
.not-found-page__list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.not-found-page__link {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  color: #fff;
  transition: padding 0.15s;
}
.not-found-page__link:hover {
  padding-left: 8px;
}
.not-found-page__link-num {
  font-family: var(--h-font-mono, monospace);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
}
.not-found-page__link-title {
  font-size: 16px;
  font-weight: 560;
  letter-spacing: -0.015em;
}
.not-found-page__link-url {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 3px;
  font-family: var(--h-font-mono, monospace);
}
.not-found-page__link-arrow {
  color: rgba(255, 255, 255, 0.5);
}
.not-found-page__link:hover .not-found-page__link-arrow {
  color: var(--h-cyan, #29A9FF);
}

/* ── AI dialog right-side panel mode ──────────────────────────────────────── */
.ai-dialog-overlay--right {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: block;
  pointer-events: auto;
  background: transparent;
}
.ai-dialog-overlay--right::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(1, 3, 6, 0.32);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.3s;
}
.ai-dialog-overlay--right.is-open::before {
  opacity: 1;
}
.ai-dialog-overlay--right .ai-dialog {
  position: fixed;
  left: auto !important;
  right: 0;
  top: 0;
  bottom: 0;
  width: 440px;
  max-width: 100vw;
  max-height: none;
  background: var(--h-bg);
  border-radius: 0;
  border-left: 1px solid var(--h-border);
  box-shadow: -16px 0 48px rgba(1, 3, 6, 0.18);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  animation: none;
}
.ai-dialog-overlay--right.is-open .ai-dialog {
  transform: translateX(0);
}
@media (max-width: 600px) {
  .ai-dialog-overlay--right .ai-dialog {
    width: 100vw;
  }
}
.ai-dialog-overlay--right .ai-dialog__head {
  padding: 18px 20px;
  background: var(--h-deep, #010306);
  color: #fff;
  border-bottom: 0;
  align-items: center;
}
.ai-dialog-overlay--right .ai-dialog__head-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--h-cyan, #29A9FF), var(--h-primary, #2D2FE8));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ai-dialog-overlay--right .ai-dialog__head-title {
  color: #fff;
  font-weight: 620;
  font-size: 14px;
}
.ai-dialog-overlay--right .ai-dialog__head-sub {
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
}
.ai-dialog-overlay--right .ai-dialog__close {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 18px;
  border: 0;
  cursor: pointer;
}
.ai-dialog-overlay--right .ai-dialog__close:hover {
  background: rgba(255, 255, 255, 0.2);
}
.ai-dialog-overlay--right .ai-dialog__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ai-dialog-overlay--right .ai-dialog__suggest-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 640;
  color: var(--h-text-subtle);
  margin-bottom: 4px;
}
.ai-dialog-overlay--right .ai-dialog__suggest {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: visible;
}
.ai-dialog-overlay--right .ai-dialog__suggest-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  padding: 11px 14px;
  border: 1px solid var(--h-border);
  background: transparent;
  border-radius: var(--h-r-md, 8px);
  font-size: 13px;
  color: var(--h-text);
  cursor: pointer;
  width: 100%;
  font-family: inherit;
}
.ai-dialog-overlay--right .ai-dialog__suggest-btn:hover {
  background: var(--h-bg-soft, #f5f3ee);
  border-color: var(--h-text-subtle);
}
.ai-dialog-overlay--right .ai-dialog__suggest-btn::after {
  content: "→";
  color: var(--h-text-subtle);
}
.ai-dialog-overlay--right .ai-dialog__messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.ai-dialog__msg-wrap {
  display: flex;
  flex-direction: column;
  max-width: 92%;
}
.ai-dialog__msg-wrap--user {
  align-self: flex-end;
}
.ai-dialog__msg-wrap--ai {
  align-self: flex-start;
}
.ai-dialog__msg-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 640;
  color: var(--h-primary, #2D2FE8);
  margin-bottom: 6px;
}
.ai-dialog-overlay--right .ai-dialog__msg {
  padding: 12px 14px;
  border-radius: 14px 14px 14px 4px;
  background: var(--h-bg-soft, #f5f3ee);
  color: var(--h-text);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.ai-dialog-overlay--right .ai-dialog__msg--user {
  background: var(--h-deep, #010306);
  color: #fff;
  border-radius: 14px 14px 4px 14px;
}
.ai-dialog__cites {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.ai-dialog__cite {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px 3px 4px;
  background: #fff;
  border: 1px solid var(--h-border);
  border-radius: 999px;
  font-size: 11px;
  color: var(--h-text-muted);
}
.ai-dialog__cite-num {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--h-primary, #2D2FE8);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ai-dialog__cite-src {
  white-space: nowrap;
}
.ai-dialog-overlay--right .ai-dialog__form {
  padding: 14px 16px 16px;
  border-top: 1px solid var(--h-border);
  background: var(--h-surface-2, #faf7f2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-dialog-overlay--right .ai-dialog__input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--h-border-strong, #d4d0c8);
  border-radius: var(--h-r-md, 8px);
  background: #fff;
  font-size: 14px;
  color: var(--h-text);
}
.ai-dialog-overlay--right .ai-dialog__input:focus {
  outline: none;
  border-color: var(--h-primary, #2D2FE8);
}
.ai-dialog-overlay--right .ai-dialog__send {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  background: var(--h-deep, #010306);
  color: #fff;
  border: 0;
  border-radius: var(--h-r-md, 8px);
  font-size: 13px;
  font-weight: 560;
  cursor: pointer;
  align-self: flex-end;
}
.ai-dialog-overlay--right .ai-dialog__send:hover {
  background: var(--h-primary, #2D2FE8);
}
.ai-dialog-overlay--right .ai-dialog__foot {
  font-size: 11px;
  color: var(--h-text-subtle);
  text-align: center;
}
body.ai-dialog-is-open .article,
body.ai-dialog-is-open main.content {
  filter: blur(1px);
  transition: filter 0.2s;
  pointer-events: none;
}
body.ai-dialog-is-open .ai-dialog-overlay--right .ai-dialog,
body.ai-dialog-is-open .ai-dialog-overlay--right * {
  filter: none;
  pointer-events: auto;
}

/* ============================================================
   MOBILE RESPONSIVE v23 — based on handoff mobile.jsx
   Breakpoints: 760 (tablet→phone) + 480 (small phone)
   Goal: no horizontal scroll, no <44px tap targets,
   stack sidebars, collapse 4-col article, fix nav overflow.
   ============================================================ */

/* TABLET / MEDIUM PHONE (≤760px) ----------------------------- */
@media (max-width: 760px) {
  html, body { overflow-x: hidden; }

  /* Nav: logo left, lang switcher (compact pill) right */
  .nav {
    padding: 12px 16px !important;
    flex-wrap: nowrap !important;
    gap: 8px;
  }
  .nav__inner {
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
  }
  .nav__links {
    display: none !important;
  }
  .nav__right {
    margin-left: auto;
  }
  .lang-switch {
    gap: 2px;
    overflow-x: auto;
    max-width: 60vw;
    scrollbar-width: none;
  }
  .lang-switch::-webkit-scrollbar { display: none; }
  .nav__lang-btn {
    min-width: 30px;
    padding: 6px 8px;
    font-size: 11px;
  }
  .nav__logo {
    flex-shrink: 0;
  }
  .nav__logo-text {
    font-size: 18px;
  }
  .nav__logo-badge {
    font-size: 10px;
  }

  /* Hero: smaller padding, smaller title, single col, hide brief decor */
  .hero {
    padding: 32px 18px 48px !important;
  }
  .hero__inner {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    min-height: 0;
  }
  .hero__title {
    font-size: clamp(32px, 9vw, 48px) !important;
    line-height: 1.04;
  }
  .hero__lead {
    font-size: 16px !important;
    margin-top: 16px;
  }
  .hero__badge {
    font-size: 11px;
    padding: 4px 10px 4px 6px;
    margin-bottom: 16px;
    max-width: 100%;
    flex-wrap: wrap;
    line-height: 1.4;
  }
  .hero__cta-row {
    margin-top: 20px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .hero__cta-row .btn {
    min-height: 44px;
    flex: 1 1 auto;
    min-width: 0;
  }
  .hero__brief {
    padding: 16px !important;
    margin-top: 4px;
  }
  .hero__brief-list {
    gap: 12px !important;
  }
  .hero__brief-num {
    font-size: 22px !important;
  }
  .hero__brief-text {
    font-size: 12px !important;
  }
  /* Wave 70: hide both .hero__glow (radial gradients tile on real Android) and .hero__grid.
     Mobile hero is just clean solid #010334 — no overlays, no risk. */
  .hero__glow, .hero__grid { display: none; }

  /* Category rail */
  .category-rail {
    padding: 12px 16px !important;
    gap: 6px;
  }
  .chip {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    font-size: 13px;
  }

  /* Stories rail */
  .stories-rail {
    padding: 12px 16px !important;
  }
  .stories-rail__scroll {
    gap: 10px !important;
  }
  .story-tile {
    min-width: 130px;
  }

  /* Main content padding */
  .content {
    padding: 16px !important;
  }
  .content > .grid-3,
  .content .grid-3 {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }
  .content > .split-2\:1,
  .content .split-2\:1 {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  /* Section header */
  .section-header {
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 0 12px;
  }
  .section-title {
    font-size: 22px !important;
    letter-spacing: -0.015em;
  }
  .section-label {
    font-size: 10px;
    letter-spacing: 0.1em;
  }

  /* Featured / Big card */
  .featured-card {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .featured-card__image {
    aspect-ratio: 16 / 9;
  }
  .featured-card__title {
    font-size: 24px !important;
    line-height: 1.18;
  }
  .featured-card__dek {
    font-size: 15px;
  }
  .featured-card__body {
    padding: 0;
  }

  /* Compact / regular cards */
  .card__title { font-size: 17px; }
  .card__dek { font-size: 14px; }
  .compact-card__title { font-size: 15px; }
  .compact-card__num { font-size: 11px; }

  /* Sidebar cards stack below main */
  .sidebar-card {
    margin-bottom: 16px;
  }
  .newsletter-card__inner {
    padding: 22px 18px !important;
  }
  .newsletter-card__title {
    font-size: 22px !important;
  }
  .newsletter-form {
    flex-direction: column;
    gap: 8px;
  }
  .newsletter-form input,
  .newsletter-form button {
    width: 100%;
    min-height: 44px;
  }

  /* Article: collapse 4-col → 1-col, hide left share rail + TOC */
  .article {
    grid-template-columns: 1fr !important;
    padding: 16px !important;
    gap: 20px !important;
  }
  .article.article--no-toc {
    grid-template-columns: 1fr !important;
  }
  .article__share {
    position: fixed !important;
    left: 0; right: 0; bottom: 0;
    top: auto !important;
    flex-direction: row !important;
    justify-content: space-around;
    background: var(--h-bg);
    border-top: 1px solid var(--h-border);
    padding: 8px 12px !important;
    gap: 4px !important;
    z-index: 50;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.06);
  }
  .article__share-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px;
  }
  .article__share-divider {
    width: 1px;
    height: 28px;
    margin: 6px 4px !important;
    align-self: center;
  }
  .article__toc {
    position: static !important;
    max-height: none !important;
    overflow: visible !important;
    margin-bottom: 16px;
    padding: 12px !important;
    background: var(--h-bg-soft);
    border-radius: 12px;
  }
  .article__body {
    padding-bottom: 80px; /* room for fixed share bar */
  }
  .article__title {
    font-size: clamp(28px, 7vw, 36px) !important;
    line-height: 1.1 !important;
  }
  .article__dek {
    font-size: 17px !important;
  }
  .article__content {
    font-size: 17px;
    line-height: 1.65;
  }
  .article__content h2 { font-size: 24px !important; margin: 32px 0 14px !important; }
  .article__content h3 { font-size: 19px !important; margin: 24px 0 10px !important; }
  .article__content blockquote { font-size: 18px; padding: 14px 16px; }
  .article__sidebar {
    margin-top: 24px;
  }
  .article__byline {
    flex-wrap: wrap;
    gap: 10px;
  }
  .article__hero {
    margin-left: -16px;
    margin-right: -16px;
    border-radius: 0;
  }
  .article__hero img {
    border-radius: 0;
  }
  .article__breadcrumbs {
    font-size: 12px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
  }
  .article__breadcrumbs::-webkit-scrollbar { display: none; }
  .article__newsletter {
    padding: 20px 18px;
  }
  .article__newsletter form {
    flex-direction: column;
    gap: 8px;
  }
  .article__newsletter input,
  .article__newsletter button {
    width: 100%;
    min-height: 44px;
  }

  /* Search / Archive / Tag / Source / Profile filter chips */
  .filter-row,
  .filter-bar,
  .tag-filters,
  .source-filters,
  .archive-filters,
  .profile-tabs,
  .search-filters {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 6px;
    padding: 8px 16px;
    margin: 0 -16px;
  }
  .filter-row::-webkit-scrollbar,
  .filter-bar::-webkit-scrollbar,
  .tag-filters::-webkit-scrollbar,
  .source-filters::-webkit-scrollbar,
  .archive-filters::-webkit-scrollbar,
  .profile-tabs::-webkit-scrollbar,
  .search-filters::-webkit-scrollbar { display: none; }
  .filter-row .chip,
  .filter-bar .chip,
  .profile-tabs > * {
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* Search box */
  .search-box,
  .search__input {
    width: 100% !important;
    min-height: 44px;
    font-size: 16px; /* iOS no-zoom */
  }

  /* AI dialog: full-screen on mobile */
  .ai-dialog-overlay--right .ai-dialog {
    width: 100vw !important;
    border-left: 0 !important;
  }
  .ai-dialog__head {
    padding: 14px 16px !important;
  }
  .ai-dialog__body {
    padding: 16px !important;
  }
  .ai-dialog__suggest-btn {
    min-height: 44px;
    padding: 10px 14px !important;
  }

  /* Footer: stack 3 cols → 1 */
  .footer__inner {
    grid-template-columns: 1fr !important;
    gap: 28px;
    padding: 32px 20px !important;
  }
  .footer__brand h3 { font-size: 18px; }
  .footer__links {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }
  .footer__group h4 { font-size: 12px; }
  .footer__bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 20px;
  }

  /* Tap targets — anchors, buttons */
  .nav__lang-btn,
  .footer__group a,
  .article__share-btn,
  .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .btn--sm { min-height: 38px; }

  /* Brief cartouche on hero — hide decorative parts to save space */
  .hero__brief-foot {
    display: none;
  }

  /* Profile page: stat grid 3→2 cols, then 1 */
  .profile-stats,
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }

  /* Source / Tag detail headers */
  .source-page__hero,
  .tag-page__hero,
  .archive__hero {
    padding: 24px 16px !important;
  }

  /* Comments */
  .comment, .comments__item {
    padding: 14px 12px;
  }

  /* 404 */
  .not-found-page {
    padding: 32px 18px !important;
  }
  .not-found-page__title {
    font-size: clamp(40px, 14vw, 64px) !important;
  }
}

/* SMALL PHONE (≤480px) -------------------------------------- */
@media (max-width: 480px) {
  .hero {
    padding: 24px 14px 36px !important;
  }
  .hero__title {
    font-size: clamp(28px, 9.5vw, 40px) !important;
  }
  .hero__lead {
    font-size: 15px !important;
  }
  .hero__badge {
    font-size: 10px;
    padding: 3px 8px 3px 5px;
  }
  .hero__brief {
    padding: 14px !important;
  }
  .hero__brief-num {
    font-size: 20px !important;
  }
  .nav {
    padding: 10px 12px !important;
  }
  .nav__logo-text { font-size: 16px; }
  .nav__logo-badge { font-size: 9px; }
  .lang-switch {
    max-width: 50vw;
  }
  .nav__lang-btn {
    min-width: 28px;
    padding: 6px 6px;
    font-size: 10px;
  }
  .content {
    padding: 12px !important;
  }
  .featured-card__title {
    font-size: 21px !important;
  }
  .section-title {
    font-size: 19px !important;
  }
  .article {
    padding: 12px !important;
  }
  .article__title {
    font-size: clamp(24px, 8vw, 30px) !important;
  }
  .article__content {
    font-size: 16px;
    line-height: 1.6;
  }
  .article__hero {
    margin-left: -12px;
    margin-right: -12px;
  }
  .footer__links {
    grid-template-columns: 1fr !important;
  }
  .footer__inner {
    padding: 24px 16px !important;
  }
  .profile-stats,
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
  .story-tile {
    min-width: 110px;
  }
}

/* Telegram WebApp viewport unit fallback (mini-app embed) */
@supports (height: 100dvh) {
  @media (max-width: 760px) {
    .ai-dialog-overlay--right .ai-dialog {
      height: 100dvh;
    }
  }
}

/* ============================================================
   STORIES VIEWER v3 — multi-slide variants + 3-zone tap areas
   ============================================================ */

/* 3-zone tap layout: prev | pause | next (replaces old .stories-viewer__nav) */
.stories-viewer__zones {
  position: absolute;
  top: 24px;
  left: 0;
  right: 0;
  bottom: 16%; /* leave bottom for CTA on outro slide */
  display: grid;
  grid-template-columns: 30% 40% 30%;
  z-index: 2;
}
.stories-viewer__zone {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.stories-viewer__zone:focus {
  outline: none;
}

/* Slide container fills card */
.stories-viewer__slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
}

/* Slide 1: HERO — image + title + dek bottom */
.stories-viewer__hero-bg,
.stories-viewer__kpi-bg,
.stories-viewer__outro-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.stories-viewer__hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.92) 100%);
}
.stories-viewer__hero-body {
  position: relative;
  margin-top: auto;
  padding: 24px;
  z-index: 2;
  color: #fff;
}
.stories-viewer__dek {
  font-size: 14px;
  line-height: 1.45;
  color: rgba(255,255,255,0.85);
  margin: 12px 0 0;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

/* Slide 2: KPI — blurred image + huge number/quote center */
.stories-viewer__kpi-bg {
  filter: blur(18px) brightness(0.5);
  transform: scale(1.1);
}
.stories-viewer__kpi-gradient {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(45,47,232,0.2) 0%, rgba(0,0,0,0.6) 60%);
}
.stories-viewer__kpi-body {
  position: relative;
  margin: auto;
  padding: 24px;
  text-align: center;
  z-index: 2;
  color: #fff;
}
.stories-viewer__kpi-num {
  font-family: var(--h-font-head, inherit);
  font-size: clamp(56px, 16vw, 96px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  margin: 18px 0 12px;
  text-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
.stories-viewer__kpi-label {
  font-size: 15px;
  line-height: 1.4;
  color: rgba(255,255,255,0.85);
  max-width: 320px;
  margin: 0 auto;
}

/* Slide 3: OUTRO — image dim + title + CTA */
.stories-viewer__outro-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.7) 60%, rgba(0,0,0,0.95) 100%);
}
.stories-viewer__outro-body {
  position: relative;
  margin: auto 0 0;
  padding: 24px;
  z-index: 2;
  color: #fff;
}
.stories-viewer__title--sm {
  font-size: clamp(18px, 3.2vw, 22px) !important;
  margin-bottom: 22px !important;
}

/* Paused state — dim progress, optional pause icon */
.stories-viewer.is-paused .stories-viewer__progress-fill {
  opacity: 0.6;
}
.stories-viewer.is-paused .stories-viewer__zone--pause::after {
  content: "❚❚";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255,255,255,0.85);
  font-size: 32px;
  letter-spacing: 4px;
  pointer-events: none;
}
.stories-viewer__zone--pause {
  position: relative;
}

/* Mobile-tighter zones (still big enough to tap) */
@media (max-width: 480px) {
  .stories-viewer {
    padding: 12px;
  }
  .stories-viewer__card {
    max-width: 100%;
    height: min(720px, 92vh);
    margin-top: 24px;
    border-radius: 12px;
  }
  .stories-viewer__hero-body,
  .stories-viewer__outro-body {
    padding: 20px 18px;
  }
  .stories-viewer__kpi-num {
    font-size: clamp(48px, 18vw, 80px);
  }
}

/* ARCHIVE PIXELPERFECT 2026-05-17 */
.archive-hero {
  padding: 56px 40px 40px;
  border-bottom: 1px solid var(--h-border);
  max-width: 1520px;
  margin: 0 auto;
}
.archive-hero__crumbs a:hover { color: var(--h-text); }
.archive-hero__head {
  align-items: end !important;
}
.archive-hero__title {
  text-wrap: balance;
}
.archive-hero__subtitle {
  text-wrap: balance;
}

/* Archive year strip nestled inside hero */
.archive-hero .archive-year-strip {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 4px;
  margin-top: 32px;
}
.archive-hero .archive-year-strip__cell {
  padding: 10px 6px;
  text-align: center;
  border-radius: var(--h-r-md, 10px);
  background: var(--h-bg-soft);
  color: var(--h-text);
  font-size: 12px;
  font-weight: 560;
  text-decoration: none;
}
.archive-hero .archive-year-strip__cell.is-current {
  background: var(--h-deep);
  color: #fff;
}
.archive-hero .archive-year-strip__cell.is-future {
  opacity: 0.4;
  pointer-events: none;
}
.archive-hero .archive-year-strip__name {
  font-size: 12px;
}
.archive-hero .archive-year-strip__count {
  font-family: var(--h-font-mono);
  font-size: 10px;
  margin-top: 2px;
  color: var(--h-text-subtle);
}
.archive-hero .archive-year-strip__cell.is-current .archive-year-strip__count {
  color: rgba(255, 255, 255, 0.6);
}

/* Archive layout — 380px aside + 1fr main */
.archive-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 48px;
  padding: 48px 40px 80px;
  max-width: 1520px;
  margin: 0 auto;
  align-items: start;
}
.archive-layout__main { min-width: 0; }
@media (max-width: 1024px) {
  .archive-layout {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 32px 24px 64px;
  }
  .archive-sidebar { order: 2; }
  .archive-hero {
    padding: 32px 24px;
  }
  .archive-hero__title {
    font-size: 48px !important;
  }
  .archive-hero__head {
    grid-template-columns: 1fr !important;
  }
}

.archive-sidebar { min-width: 0; }
.archive-sidebar__section { margin-bottom: 40px; }
.archive-sidebar__label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 640;
  color: var(--h-text-subtle);
  margin-bottom: 16px;
}
.archive-sidebar__heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.archive-sidebar__heatmap-name {
  font-size: 10px;
  color: var(--h-text-subtle);
  text-align: center;
  padding: 4px 0;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.archive-sidebar__heatmap-cell {
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 6px;
  font-size: 11px;
  font-family: var(--h-font-mono);
  text-decoration: none;
  transition: transform 0.15s;
}
.archive-sidebar__heatmap-cell:hover {
  transform: scale(1.06);
  z-index: 2;
  position: relative;
}
.archive-sidebar__heatmap-d { line-height: 1; }
.archive-sidebar__heatmap-n {
  font-weight: 700;
  font-size: 13px;
  font-family: var(--h-font-head);
}
.archive-sidebar__legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 11px;
  color: var(--h-text-subtle);
}
.archive-sidebar__legend-cell {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

/* Categories rows in sidebar */
.archive-sidebar__row {
  display: grid;
  grid-template-columns: 1fr auto 120px;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 13px;
}
.archive-sidebar__name {
  color: var(--h-text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.archive-sidebar__name:hover { color: var(--h-primary); }
.archive-sidebar__count {
  font-family: var(--h-font-mono);
  font-size: 12px;
  color: var(--h-text-subtle);
}
.archive-sidebar__bar {
  width: 120px;
  height: 6px;
  background: var(--h-border);
  border-radius: 3px;
  overflow: hidden;
}
.archive-sidebar__bar-fill {
  height: 100%;
  background: var(--h-primary);
  transition: width 0.3s ease;
}

/* Day group styling */
.archive-day-group { margin-bottom: 56px; }
.archive-day-group__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
}
.archive-day-group__h2 {
  font-size: 28px;
  letter-spacing: -0.02em;
  margin: 0;
  text-transform: capitalize;
}
.archive-day-group__count {
  font-size: 13px;
  color: var(--h-text-muted);
}
.archive-day-group__more {
  display: inline-block;
  margin-top: 16px;
  font-size: 13px;
  color: var(--h-primary);
  text-decoration: none;
  font-weight: 600;
}
.archive-day-group__more:hover { text-decoration: underline; }

/* RTL: flip year strip arrows + heatmap directions */
[dir="rtl"] .archive-hero__nav .btn { direction: rtl; }
[dir="rtl"] .archive-sidebar__bar { transform: scaleX(-1); }
[dir="rtl"] .archive-hero__crumbs { direction: rtl; }


/* PROFILE PIXELPERFECT 2026-05-17 */
.profile-main2 {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 48px;
  margin-top: 24px;
}
.profile-main2__col { min-width: 0; }
.profile-main2__aside {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}
.profile-main2__aside .profile-donate-card { padding: 28px; }
.profile-main2__aside .profile-heatmap-section {
  padding: 24px;
  border: 1px solid var(--h-border);
  border-radius: var(--h-r-lg);
}
.profile-main2__aside .profile-heatmap-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 640;
  color: var(--h-text-subtle);
  margin-bottom: 16px;
}
.profile-main2__aside .profile-heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.profile-main2__aside .profile-heatmap__cell {
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  background: var(--h-bg-soft);
}
.profile-main2__aside .profile-heatmap-hint {
  font-size: 12px;
  color: var(--h-text-muted);
  margin-top: 12px;
  line-height: 1.5;
}

@media (max-width: 1024px) {
  .profile-main2 {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .profile-main2__aside { order: 2; }
}

/* Panel header with action chips */
.profile-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.profile-panel-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.profile-panel-head .profile-panel-title { margin: 0; }

/* Smaller chip variant for view toggles */
.chip--sm {
  font-size: 12px !important;
  padding: 4px 10px !important;
}

/* RTL */
[dir="rtl"] .profile-panel-head { flex-direction: row-reverse; }
[dir="rtl"] .profile-main2 { direction: rtl; }
