/* ==========================================================================
   HamroNeta — Stitch redesign foundation (CLAUDE.md §11 rev 13)
   Loaded LAST by layouts/main.blade.php, only when hno_redesign() is on.
   Everything is scoped under html.rd so the current site is untouched while
   the preview switch is off.

   1. Tokens            5. Command bar (⌘K)
   2. Legacy remap      6. Global component reset
   3. Typography        7. Footer
   4. Header + drawer   8. Shared components (rd-*)
   ========================================================================== */

/* 1. TOKENS ─────────────────────────────────────────────────────────────── */
html.rd {
  --rd-primary-900: #0b2545;
  --rd-primary-800: #133e87;
  --rd-primary-700: #1d4ed8;
  --rd-primary-50:  #eff6ff;
  --rd-crimson: #dc2626;
  --rd-amber:   #d97706;
  --rd-emerald: #059669;
  --rd-pending: #94a3b8;
  --rd-base:   #f8fafc;
  --rd-card:   #ffffff;
  --rd-border: #e2e8f0;
  --rd-muted:  #64748b;
  --rd-text:   #0f172a;
  --rd-text-2: #334155;

  --rd-font: 'Public Sans', 'Mukta', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --rd-radius: 10px;
  --rd-radius-lg: 14px;
  --rd-shadow: 0 1px 2px rgba(15, 23, 42, .05);
  --rd-shadow-hover: 0 4px 14px rgba(15, 23, 42, .08);
  --rd-gutter: 16px;
  --rd-max: 1280px;

/* 2. LEGACY REMAP — the old inline CSS and design-tokens.css read these, so
      re-pointing them recolours most of the site without touching views. */
  --blue: var(--rd-primary-800); --blue-m: var(--rd-primary-700); --blue-l: #60a5fa;
  --blue-bg: var(--rd-primary-50); --blue-50: var(--rd-primary-50);
  --red: var(--rd-crimson); --red-bg: #fef2f2;
  --gold: var(--rd-amber); --gold-bg: #fffbeb; --saffron: var(--rd-amber); --saffron-bg: #fffbeb;
  --green: var(--rd-emerald); --green-bg: #ecfdf5;
  --white: #fff; --snow: #fff; --cream: var(--rd-base);
  --t1: var(--rd-text); --t2: var(--rd-text-2); --t3: var(--rd-muted); --bd: var(--rd-border);
  --coral: var(--rd-crimson); --violet: var(--rd-primary-700);
  --dv: var(--rd-font); --body: var(--rd-font);

  --color-bg-page: var(--rd-base);
  --color-bg-surface: var(--rd-card);
  --color-bg-elevated: var(--rd-card);
  --color-text-primary: var(--rd-text);
  --color-text-muted: var(--rd-muted);
  --color-text-link: var(--rd-primary-800);
  --color-border-soft: var(--rd-border);
  --color-border-strong: #94a3b8;
  --color-action: var(--rd-primary-800);
  --color-action-hover: var(--rd-primary-900);
  --font-family-display: var(--rd-font);
  --font-family-body: var(--rd-font);
  --font-family-ui: var(--rd-font);
  --font-family-ne: var(--rd-font);
}

/* 3. TYPOGRAPHY ─────────────────────────────────────────────────────────── */
html.rd body {
  font-family: var(--rd-font) !important;
  background: var(--rd-base) !important;
  color: var(--rd-text);
  padding-top: 0 !important;           /* header is sticky now, not fixed */
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
/* Legacy views hard-code Yatra One / Mukta / Noto / Playfair / Montserrat in
   inline styles and component CSS. Normalise every text element to the one
   stack — icon fonts (<i>, .fa*, .ti-*) are excluded. */
html.rd :is(h1, h2, h3, h4, h5, h6, p, a, span, div, li, td, th, label, button, input, select, textarea, small, strong, b, em, blockquote, figcaption, summary, dt, dd):not([class*="fa-"]):not([class^="ti-"]):not([class*=" ti-"]):not(.fa):not(.fas):not(.far):not(.fab) {
  font-family: var(--rd-font) !important;
}
/* No global heading colour: legacy heroes set white-on-photo per page, and
   most headings already read var(--t1)/var(--blue), which are remapped above. */
html.rd :is(h1, h2, h3, h4) { letter-spacing: -.015em; line-height: 1.2; }
html.rd h1 { font-weight: 800; }
html.rd :is(h2, h3) { font-weight: 700; }
/* §11.2: nothing above 56px, nothing below 14px. */
html.rd :is(h1, .hero-title, .cab-title) { font-size: clamp(28px, 4.2vw, 48px) !important; }
html.rd a { color: var(--rd-primary-800); }
html.rd :focus-visible { outline: 2px solid var(--rd-primary-700); outline-offset: 2px; }

/* 4. HEADER ─────────────────────────────────────────────────────────────── */
.rd-header {
  position: sticky; top: 0; z-index: 1000;
  background: var(--rd-card);
  border-bottom: 1px solid var(--rd-border);
}
.rd-flagline { height: 3px; background: linear-gradient(90deg, var(--rd-crimson) 0 50%, var(--rd-primary-800) 50% 100%); }
.rd-nav {
  max-width: var(--rd-max); margin: 0 auto; height: 64px;
  display: flex; align-items: center; gap: 20px; padding: 0 24px;
}
.rd-logo { display: flex; align-items: center; flex-shrink: 0; background: none !important; }
.rd-logo img { height: 36px; width: auto; display: block; }

.rd-verticals { display: flex; align-items: stretch; gap: 4px; list-style: none; margin: 0 auto; padding: 0; height: 100%; }
.rd-vert { position: relative; display: flex; }
.rd-vert-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 100%; padding: 0 14px; border: 0; background: none; cursor: pointer;
  font-size: 15px; font-weight: 600; color: var(--rd-text-2);
  border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s;
}
.rd-vert-btn:hover, .rd-vert.is-open .rd-vert-btn { color: var(--rd-primary-800); border-bottom-color: var(--rd-border); }
.rd-vert.is-active .rd-vert-btn { color: var(--rd-primary-800); border-bottom-color: var(--rd-primary-800); }
.rd-vert-btn svg { transition: transform .15s; }
.rd-vert.is-open .rd-vert-btn svg { transform: rotate(180deg); }
.rd-dd {
  display: none; position: absolute; top: calc(100% + 1px); left: 0; min-width: 240px;
  background: var(--rd-card); border: 1px solid var(--rd-border); border-radius: 0 0 var(--rd-radius) var(--rd-radius);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .08); padding: 6px; z-index: 20;
}
.rd-vert.is-open .rd-dd { display: block; }
.rd-dd a {
  display: block; padding: 10px 12px; border-radius: 6px; min-height: 44px;
  font-size: 15px; font-weight: 500; color: var(--rd-text) !important; text-decoration: none; background-image: none !important;
}
.rd-dd a:hover { background: var(--rd-primary-50); color: var(--rd-primary-800) !important; }

.rd-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.rd-search-trigger {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 12px;
  border: 1px solid var(--rd-border); border-radius: 8px; background: var(--rd-base);
  color: var(--rd-muted); font-size: 14px; cursor: pointer; min-width: 180px;
}
.rd-search-trigger:hover { border-color: #cbd5e1; color: var(--rd-text-2); }
.rd-search-label { flex: 1; text-align: left; }
.rd-kbd, .rd-cmd-esc kbd {
  font-family: var(--rd-font) !important; font-size: 12px; font-weight: 600; color: var(--rd-muted);
  border: 1px solid var(--rd-border); border-radius: 5px; padding: 1px 6px; background: #fff;
}
.rd-lang {
  height: 40px; padding: 0 12px; border: 1px solid var(--rd-border); border-radius: 8px;
  background: #fff; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--rd-primary-800);
}
.rd-lang:hover { background: var(--rd-primary-50); }
/* The button names the language you will switch TO. */
html[data-lang="np"] .rd-lang-ne, html:not([data-lang]) .rd-lang-ne { display: none; }
html[data-lang="en"] .rd-lang-en { display: none; }
.rd-cta-report {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px;
  border-radius: 8px; background: var(--rd-crimson); color: #fff !important;
  font-size: 14px; font-weight: 700; text-decoration: none; background-image: none !important; white-space: nowrap;
}
.rd-cta-report:hover { background: #b91c1c; }
.rd-signin {
  display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border-radius: 8px;
  background: var(--rd-primary-800); color: #fff !important; font-size: 14px; font-weight: 600;
  text-decoration: none; background-image: none !important; white-space: nowrap;
}
.rd-signin:hover { background: var(--rd-primary-900); }
.rd-user img { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--rd-border); display: block; }
.rd-burger { display: none; width: 44px; height: 44px; border: 0; background: none; color: var(--rd-text); cursor: pointer; border-radius: 8px; }
.rd-burger:hover { background: var(--rd-primary-50); }

@media (max-width: 1180px) {
  .rd-search-trigger { min-width: 0; }
  .rd-search-label, .rd-kbd { display: none; }
  .rd-vert-btn { padding: 0 10px; }
}
@media (max-width: 960px) {
  .rd-verticals, .rd-signin, .rd-user, .rd-actions > .rd-lang, .rd-actions > .rd-cta-report { display: none; }
  .rd-burger { display: inline-flex; align-items: center; justify-content: center; }
  .rd-actions { margin-left: auto; }
  .rd-search-trigger { width: 44px; height: 44px; justify-content: center; padding: 0; border: 0; background: none; }
  .rd-nav { height: 56px; padding: 0 var(--rd-gutter); gap: 8px; }
  .rd-logo img { height: 30px; }
}

/* Drawer */
.rd-drawer-scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1100; }
.rd-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(360px, 88vw); z-index: 1101;
  background: var(--rd-card); box-shadow: -8px 0 24px rgba(15, 23, 42, .12);
  transform: translateX(100%); transition: transform .2s ease-out; overflow-y: auto;
  display: flex; flex-direction: column; overscroll-behavior: contain;
}
.rd-drawer.is-open { transform: none; }
.rd-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 12px var(--rd-gutter); border-bottom: 1px solid var(--rd-border); }
.rd-drawer-close { width: 44px; height: 44px; border: 0; background: none; border-radius: 8px; cursor: pointer; color: var(--rd-text); }
.rd-drawer-search {
  display: flex; align-items: center; gap: 10px; margin: 12px var(--rd-gutter); min-height: 48px; padding: 0 14px;
  border: 1px solid var(--rd-border); border-radius: 10px; background: var(--rd-base); color: var(--rd-muted);
  font-size: 15px; text-align: left; cursor: pointer;
}
.rd-drawer-group { border-bottom: 1px solid var(--rd-border); }
.rd-drawer-group summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  min-height: 52px; padding: 0 var(--rd-gutter); font-size: 16px; font-weight: 700; color: var(--rd-primary-900);
}
.rd-drawer-group summary::-webkit-details-marker { display: none; }
.rd-drawer-group summary::after { content: '+'; font-size: 20px; color: var(--rd-muted); font-weight: 400; }
.rd-drawer-group[open] summary::after { content: '−'; }
.rd-drawer-group a {
  display: flex; align-items: center; min-height: 44px; padding: 0 var(--rd-gutter) 0 28px;
  font-size: 15px; color: var(--rd-text-2) !important; text-decoration: none; background-image: none !important;
}
.rd-drawer-group a:hover { background: var(--rd-primary-50); }
.rd-drawer-group[open] { padding-bottom: 8px; }
.rd-drawer-foot { margin-top: auto; padding: 16px var(--rd-gutter) 24px; display: grid; gap: 10px; }
.rd-cta-block, .rd-lang-block { width: 100%; height: 48px; justify-content: center; display: flex; align-items: center; }

/* Hide the legacy header bits if both somehow render. */
html.rd .v5-header, html.rd #mobile-mega { display: none !important; }

/* 5. COMMAND BAR ────────────────────────────────────────────────────────── */
.rd-cmd {
  border: 0; padding: 0; background: transparent; width: min(640px, calc(100vw - 32px));
  margin: 12vh auto auto; max-height: 76vh; overflow: visible;
}
.rd-cmd::backdrop { background: rgba(15, 23, 42, .5); }
.rd-cmd-box {
  background: var(--rd-card); border-radius: var(--rd-radius-lg); border: 1px solid var(--rd-border);
  box-shadow: 0 24px 48px rgba(15, 23, 42, .2); overflow: hidden; display: flex; flex-direction: column; max-height: 76vh;
}
.rd-cmd-grab { display: none; }
.rd-cmd-field { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--rd-border); color: var(--rd-muted); }
.rd-cmd-field input {
  flex: 1; min-width: 0; height: 56px; border: 0; outline: 0; background: none;
  font-size: 17px; color: var(--rd-text);
}
.rd-cmd-field input::-webkit-search-cancel-button { display: none; }
.rd-cmd-esc { border: 0; background: none; cursor: pointer; padding: 6px; }
.rd-cmd-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.rd-cmd-sec { padding: 10px 10px 4px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--rd-muted); }
.rd-cmd-item {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px; min-height: 48px; border-radius: 8px;
  color: var(--rd-text) !important; text-decoration: none; background-image: none !important;
}
.rd-cmd-item:hover, .rd-cmd-item.is-active { background: var(--rd-primary-50); }
.rd-cmd-item img, .rd-cmd-av { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.rd-cmd-av { display: inline-flex; align-items: center; justify-content: center; background: var(--rd-primary-50); color: var(--rd-primary-800); font-weight: 700; font-size: 14px; }
.rd-cmd-av--ai { background: var(--rd-primary-800); color: #fff; font-size: 12px; }
.rd-cmd-item b { font-weight: 600; }
.rd-cmd-item small { color: var(--rd-muted); font-size: 14px; }
.rd-cmd-item em { display: block; font-style: normal; font-size: 14px; color: var(--rd-muted); }
.rd-cmd-page::before {
  content: ''; width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px; background: var(--rd-base)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 2v6h6'/%3E%3C/svg%3E") center no-repeat;
}
@media (max-width: 640px) {
  /* Bottom sheet */
  .rd-cmd { width: 100vw; max-width: 100vw; margin: auto 0 0; max-height: 88vh; }
  .rd-cmd-box { border-radius: 16px 16px 0 0; max-height: 88vh; border-bottom: 0; }
  .rd-cmd-grab { display: block; width: 40px; height: 4px; border-radius: 2px; background: #cbd5e1; margin: 8px auto 0; }
  .rd-cmd-esc { display: none; }
}

/* 6. GLOBAL COMPONENT RESET ─────────────────────────────────────────────── */
/* Banned per §11.9 / rev 13: decorative skyline, rainbow rules, shimmer,
   glows, textile dividers, the once-per-visit welcome overlay. */
html.rd :is(.page-skyline, .hno-divider, .lat, .cloud-gap) { display: none !important; }
html.rd #hno-welcome { display: none !important; }
html.rd .card::before, html.rd .cab::before, html.rd .cab-pm-card::before { display: none !important; }
html.rd .sh-t::after, html.rd .section-rule {
  background: var(--rd-crimson) !important; width: 40px !important; height: 3px !important; border-radius: 0 !important;
}
html.rd :is(.hero-title, .qs-num, .hero-stat-num) {
  background: none !important; -webkit-text-fill-color: currentColor !important; animation: none !important; filter: none !important; text-shadow: none !important;
}
html.rd :is(.reveal, .stagger > [class]) { opacity: 1 !important; transform: none !important; }
html.rd .hero-search-bar { animation: none !important; }

/* Sections: flat white cards on the slate base, one rhythm, no zig-zag offsets. */
html.rd .sec {
  background: var(--rd-card) !important; border: 1px solid var(--rd-border) !important; border-radius: var(--rd-radius-lg) !important;
  box-shadow: none !important; margin: 24px auto !important; max-width: var(--rd-max) !important;
  width: calc(100% - 32px); text-align: left;
}
html.rd .sec:nth-child(n) { margin-left: auto !important; margin-right: auto !important; }

/* Cards */
html.rd :is(.card, .new-card, .top-stories, .cc, .pf, .prov-c, .branch) {
  border: 1px solid var(--rd-border) !important; border-radius: var(--rd-radius) !important;
  box-shadow: var(--rd-shadow) !important; background: var(--rd-card) !important; transition: box-shadow .15s, border-color .15s !important;
}
html.rd :is(.card, .new-card, .top-stories, .cc, .pf, .prov-c):hover { box-shadow: var(--rd-shadow-hover) !important; border-color: #cbd5e1 !important; transform: none !important; }
html.rd .card-h { background: var(--rd-card) !important; }
html.rd .cc { border-top: 3px solid var(--party, var(--rd-primary-800)) !important; }
html.rd .cc-photo::after { display: none !important; }
html.rd .two, html.rd .cab-g, html.rd .prov-g, html.rd .ps { perspective: none !important; }
html.rd .card img:not(.no-blend) { mix-blend-mode: normal !important; }

/* Buttons: solid fills only. */
html.rd :is(.btn-hno, .hero-btn, .btn-primary) { border-radius: 8px !important; box-shadow: none !important; filter: none !important; }
html.rd :is(.btn-hno--blue, .hero-btn--primary, .btn-primary) { background: var(--rd-primary-800) !important; color: #fff !important; border-color: var(--rd-primary-800) !important; }
html.rd :is(.btn-hno--coral, .hero-btn--secondary) { background: var(--rd-crimson) !important; color: #fff !important; }
html.rd :is(.btn-hno--green, .hero-btn--accent) { background: var(--rd-emerald) !important; color: #fff !important; }
html.rd :is(.btn-hno--gold, .hero-btn--warm, .btn-hno--violet) { background: var(--rd-primary-700) !important; color: #fff !important; }
html.rd .btn-hno::after { display: none !important; }
/* Animated link underline: replace the coral wipe with a plain underline on hover. */
html.rd a:not(.btn-hno) { background-image: none !important; }
html.rd main a:not([class]):hover { text-decoration: underline; }

/* Old quick-stats gradient band → quiet strip. */
html.rd .quick-stats { background: var(--rd-card) !important; border-block: 1px solid var(--rd-border); }
html.rd .quick-stats::before, html.rd .quick-stats::after { display: none !important; }
html.rd .qs-num { color: var(--rd-primary-800) !important; }
html.rd .qs-label { color: var(--rd-muted) !important; }
html.rd .qs-item { border-color: var(--rd-border) !important; }

/* Underline tabs (§11.4) for the common legacy tab/pill patterns. */
html.rd :is(.nav-tabs .nav-link, .nav-pills .nav-link) {
  border: 0 !important; border-bottom: 3px solid transparent !important; border-radius: 0 !important;
  background: none !important; color: var(--rd-text-2) !important; font-weight: 600;
}
html.rd :is(.nav-tabs .nav-link.active, .nav-pills .nav-link.active) { color: var(--rd-primary-800) !important; border-bottom-color: var(--rd-primary-800) !important; }

/* Guest login banner — flat navy, no gradient. */
html.rd #hno-login-banner { background: var(--rd-primary-900) !important; }

/* Back-to-top */
html.rd .ft-btt { background: var(--rd-primary-800) !important; border-radius: 10px !important; box-shadow: var(--rd-shadow-hover) !important; }
html.rd .ft-btt svg { animation: none !important; }

/* Status colours (spec §2.3 PillarProgressBar) — legacy classes. */
html.rd :is(.status-completed, .badge-success) { background: #ecfdf5 !important; color: var(--rd-emerald) !important; }
html.rd :is(.status-in_progress, .badge-warning) { background: #fffbeb !important; color: var(--rd-amber) !important; }
html.rd :is(.status-broken, .status-stalled, .badge-danger) { background: #fef2f2 !important; color: var(--rd-crimson) !important; }

/* Mobile: 375px baseline, no sideways scroll. */
@media (max-width: 640px) {
  html.rd .sec { width: calc(100% - 2 * var(--rd-gutter)); padding: 20px var(--rd-gutter) !important; margin: 16px auto !important; }
  html.rd main :is(img, video, iframe, table) { max-width: 100%; }
}

/* 7. FOOTER ─────────────────────────────────────────────────────────────── */
html.rd :is(.hno-footer, .footer-section) { background: var(--rd-primary-900) !important; }
html.rd .footer-section::before { display: none !important; }
html.rd :is(.hno-ft-col h6, .ft-heading) { color: rgba(255, 255, 255, .6) !important; letter-spacing: .08em; }
html.rd :is(.hno-ft-col a, .ft-pill) { color: rgba(255, 255, 255, .82) !important; background: none !important; border: 0 !important; padding-left: 0 !important; }
html.rd :is(.hno-ft-col a, .ft-pill):hover { color: #fff !important; text-decoration: underline; }

/* 8. SHARED COMPONENTS (rd-*) ─────────────────────────────────────────── */
.rd-wrap { max-width: var(--rd-max); margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .rd-wrap { padding: 0 var(--rd-gutter); } }
.rd-eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--rd-crimson); }
.rd-muted { color: var(--rd-muted); }
.rd-secondary-name { display: block; font-size: 14px; font-weight: 500; color: var(--rd-muted); }

/* MetricCounterCard / summary strip */
.rd-metrics { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--rd-border); border-radius: var(--rd-radius); background: var(--rd-card); overflow: hidden; }
.rd-metric { padding: 16px 20px; border-left: 1px solid var(--rd-border); text-decoration: none; color: inherit !important; }
.rd-metric:first-child { border-left: 0; }
.rd-metric:hover { background: var(--rd-primary-50); }
.rd-metric-n { display: block; font-size: 28px; font-weight: 800; color: var(--rd-primary-800); line-height: 1.1; font-variant-numeric: tabular-nums; }
.rd-metric-l { display: block; margin-top: 4px; font-size: 14px; color: var(--rd-muted); }
@media (max-width: 640px) {
  .rd-metrics { grid-template-columns: repeat(2, 1fr); }
  .rd-metric:nth-child(3) { border-left: 0; }
  .rd-metric:nth-child(n+3) { border-top: 1px solid var(--rd-border); }
  .rd-metric-n { font-size: 22px; }
}

/* Chips (horizontally swipeable on mobile, bleeding to the edge) */
.rd-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.rd-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--rd-border); background: var(--rd-card); color: var(--rd-text-2) !important;
  font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.rd-chip:hover { border-color: var(--rd-primary-800); color: var(--rd-primary-800) !important; }
.rd-chip.is-on { background: var(--rd-primary-800); border-color: var(--rd-primary-800); color: #fff !important; }
@media (max-width: 640px) {
  .rd-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--rd-gutter)); padding: 0 var(--rd-gutter) 4px; scrollbar-width: none; }
  .rd-chips::-webkit-scrollbar { display: none; }
}

/* Underline tabs */
.rd-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rd-border); overflow-x: auto; scrollbar-width: none; }
.rd-tab {
  min-height: 44px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; background: none;
  font-size: 15px; font-weight: 600; color: var(--rd-muted) !important; cursor: pointer; white-space: nowrap; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.rd-tab:hover { color: var(--rd-text) !important; }
.rd-tab.is-on, .rd-tab[aria-selected="true"] { color: var(--rd-primary-800) !important; border-bottom-color: var(--rd-primary-800); }

/* Section header */
.rd-sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.rd-sec-head h2 { margin: 4px 0 0; font-size: clamp(22px, 2.6vw, 30px); }
.rd-sec-head a { font-weight: 600; font-size: 15px; }

/* Progress (PillarProgressBar) + seats (SeatDistributionBar) */
.rd-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: #f1f5f9; gap: 2px; }
.rd-bar > span { display: block; height: 100%; min-width: 2px; }
.rd-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 14px; color: var(--rd-text-2); }
.rd-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.rd-c-done { background: var(--rd-emerald); } .rd-c-prog { background: var(--rd-amber); }
.rd-c-pend { background: var(--rd-pending); } .rd-c-stall { background: var(--rd-crimson); }

.rd-seats { position: relative; }
.rd-bar-wrap { position: relative; }
.rd-seats .rd-bar { height: 28px; border-radius: 6px; gap: 1px; }
.rd-seats .rd-bar > span { cursor: default; position: relative; }
.rd-seats .rd-bar > span:hover { filter: brightness(1.08); }
.rd-majority { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--rd-primary-900); }
.rd-majority::after {
  content: attr(data-label); position: absolute; top: -22px; left: 50%; transform: translateX(-50%);
  font-size: 12px; font-weight: 700; color: var(--rd-primary-900); white-space: nowrap;
}

/* Status pill */
.rd-pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.rd-pill--done { background: #ecfdf5; color: var(--rd-emerald); }
.rd-pill--prog { background: #fffbeb; color: #b45309; }
.rd-pill--pend { background: #f1f5f9; color: #475569; }
.rd-pill--stall { background: #fef2f2; color: var(--rd-crimson); }

/* Swakiya FAB — navy, square-ish, no glow (spec §3 V1 / bible §11.8) */
html.rd #hnChatFab { background: var(--rd-primary-800) !important; box-shadow: 0 6px 16px rgba(19, 62, 135, .3) !important; }
html.rd #hnChatFab::before, html.rd #hnChatFab::after { animation: none !important; }

/* Parliament (Stitch V2) */
html[data-lang="en"] .rd-majority::after { content: attr(data-label-en); }
.rd-parl { margin-top: 24px; display: grid; gap: 16px; }
.rd-parl-card { background: var(--rd-card); border: 1px solid var(--rd-border); border-radius: var(--rd-radius-lg); padding: 20px 24px 16px; }
.rd-parl-card .rd-seats { margin: 34px 0 0; }
.rd-party-filter .rd-chip i { display: inline-block; }
html.rd .fp-hero { background: var(--rd-primary-900); }
html.rd .fp-stats { background: var(--rd-card); border-bottom-color: var(--rd-border); }
html.rd .fp-stat-num { color: var(--rd-primary-800); font-weight: 800; }
html.rd .fp-card { border-color: var(--rd-border); }
html.rd .fp-search-bar { border: 1px solid var(--rd-border); box-shadow: none; border-radius: 10px; }
html.rd .fp-search-bar:focus-within { border-color: var(--rd-primary-800); box-shadow: 0 0 0 3px var(--rd-primary-50); }
html.rd .fp-vnav-item.is-active, html.rd .fp-vnav-item:hover { background: var(--rd-primary-50); }
@media (max-width: 640px) { .rd-parl-card { padding: 16px; } }

/* Preview fixes: legacy page CSS forces img{height:auto} and wide tracking. */
html.rd .rd-header .rd-logo img { height: 36px !important; width: auto !important; max-width: 160px !important; }
@media (max-width: 960px) { html.rd .rd-header .rd-logo img { height: 30px !important; } }
html.rd .rd-drawer-head img { height: 30px !important; width: auto !important; }
/* Letter-spacing breaks Devanagari conjuncts — never track Nepali text. */
html.rd[data-lang="np"] body * { letter-spacing: normal !important; }
html.rd .hero-byline { text-transform: none !important; }

/* HOME HERO (Stitch V1) ─────────────────────────────────────────────────── */
.rd-hero { padding: 40px 0 8px; background: var(--rd-card); border-bottom: 1px solid var(--rd-border); }
.rd-hero-grid { display: grid; grid-template-columns: 7fr 5fr; gap: 48px; align-items: center; }
.rd-hero-copy h1 {
  margin: 10px 0 12px; color: var(--rd-primary-900); font-weight: 800;
  font-size: clamp(30px, 4vw, 48px) !important; line-height: 1.15;
}
.rd-hero-sub { margin: 0 0 24px; font-size: 18px; line-height: 1.6; color: var(--rd-text-2); max-width: 60ch; }
.rd-hero-search {
  display: flex; align-items: center; gap: 12px; width: 100%; height: 60px; padding: 0 12px 0 18px;
  border: 1.5px solid #cbd5e1; border-radius: 12px; background: #fff; cursor: text; text-align: left;
  font-size: 17px; color: var(--rd-muted); box-shadow: 0 1px 2px rgba(15,23,42,.04);
  transition: border-color .15s, box-shadow .15s;
}
.rd-hero-search:hover, .rd-hero-search:focus-visible { border-color: var(--rd-primary-800); box-shadow: 0 0 0 4px var(--rd-primary-50); outline: 0; }
.rd-hero-search svg { color: var(--rd-primary-800); flex-shrink: 0; }
.rd-hero-search span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-hero-chips { margin-top: 14px; }
.rd-chip-ai {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--rd-primary-800); color: #fff; font-size: 11px; font-weight: 700;
}
.rd-hero-photo { margin: 0; border-radius: var(--rd-radius-lg); overflow: hidden; background: var(--rd-base); }
.rd-hero-photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.rd-hero-photo figcaption { padding: 8px 12px; font-size: 14px; color: var(--rd-muted); background: var(--rd-card); border: 1px solid var(--rd-border); border-top: 0; border-radius: 0 0 var(--rd-radius-lg) var(--rd-radius-lg); }
.rd-hero .rd-metrics { margin: 32px 0 24px; }
.rd-sponsor {
  display: flex; align-items: center; gap: 12px; margin: 0 0 24px; padding: 8px 12px;
  border: 1px solid var(--rd-border); border-radius: var(--rd-radius); background: var(--rd-base); text-decoration: none;
}
.rd-sponsor img { max-height: 72px; width: auto; max-width: calc(100% - 90px); object-fit: contain; }
.rd-sponsor-tag { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--rd-muted); border: 1px solid var(--rd-border); border-radius: 4px; padding: 1px 6px; flex-shrink: 0; }
@media (max-width: 900px) {
  .rd-hero { padding-top: 0; }
  .rd-hero-grid { grid-template-columns: 1fr; gap: 20px; }
  .rd-hero-photo { order: -1; margin: 0 calc(-1 * var(--rd-gutter)); border-radius: 0; }
  .rd-hero-photo img { aspect-ratio: 16 / 9; }
  .rd-hero-photo figcaption { border-radius: 0; border-left: 0; border-right: 0; font-size: 13px; }
  .rd-hero-sub { font-size: 16px; margin-bottom: 18px; }
  .rd-hero-search { height: 52px; font-size: 15px; }
  .rd-hero-search .rd-kbd { display: none; }
  .rd-hero .rd-metrics { margin-top: 24px; }
}
/* Homepage legacy: .sky-page::before is a fixed cream sheet at z-index 0 that
   paints over any section not given its own stacking. */
html.rd .sky-page::before { display: none !important; }
.rd-hero { position: relative; z-index: 1; }
.rd-hero-copy > .rd-eyebrow, .rd-hero-copy > h1, .rd-hero-copy > p { display: block !important; }
.rd-hero-photo figcaption { display: block !important; }
/* Drawer + command bar sit above the floating Feedback / Swakiya widgets. */
.rd-drawer-scrim { z-index: 2147483000; }
.rd-drawer { z-index: 2147483001; }
html.rd .rd-cmd-field input, html.rd .rd-cmd-field input:focus { border: 0 !important; box-shadow: none !important; outline: 0 !important; padding: 0 !important; }

/* COUNCIL OF MINISTERS (Stitch V3) — round table → PM hero + portfolio grid ─ */
html.rd .com-rt-wrap { aspect-ratio: auto !important; min-height: 0 !important; max-width: 100% !important;
  display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 24px 0 !important; }
html.rd .com-rt-ring, html.rd .com-rt-center { display: none !important; }
html.rd .com-seat {
  position: static !important; width: auto !important; transform: none !important; cursor: default;
  display: grid !important; grid-template-columns: 64px 1fr; grid-template-areas: "av name" "av role" "av pop" "av shadow";
  column-gap: 14px; align-items: start; text-align: left;
  background: var(--rd-card); border: 1px solid var(--rd-border); border-radius: var(--rd-radius); padding: 16px;
}
html.rd .com-seat:hover { box-shadow: var(--rd-shadow-hover); border-color: #cbd5e1; }
html.rd .com-av { grid-area: av; width: 64px !important; height: 64px !important; margin: 0 !important; border: 1px solid var(--rd-border) !important; box-shadow: none !important; border-radius: 50%; }
html.rd .com-crown { display: none; }
html.rd .com-seat-name { grid-area: name; white-space: normal !important; font-size: 17px !important; font-weight: 700 !important; color: var(--rd-text) !important; }
html.rd .com-seat-role { grid-area: role; white-space: normal !important; opacity: 1 !important; font-size: 15px !important; color: var(--rd-primary-800) !important; font-weight: 600 !important; margin-top: 2px; }
html.rd .com-seat-shadow { grid-area: shadow; justify-self: start; font-size: 13px !important; margin-top: 8px; }
/* The hover popup's useful bits (English name, party, profile link) become inline card rows. */
html.rd .com-popup {
  grid-area: pop; position: static !important; opacity: 1 !important; pointer-events: auto !important; transform: none !important;
  display: block !important; background: none; border: 0; box-shadow: none; padding: 0; min-width: 0; text-align: left; margin-top: 4px;
}
html.rd .com-popup::before, html.rd .com-popup-photo, html.rd .com-popup-name, html.rd .com-popup-role { display: none !important; }
html.rd .com-popup-en { font-size: 14px; color: var(--rd-muted); }
html.rd .com-popup-party { display: inline-block; margin-top: 6px; font-size: 13px; font-weight: 600; color: var(--rd-text-2); background: var(--rd-base); border: 1px solid var(--rd-border); border-radius: 999px; padding: 1px 10px; }
html.rd .com-popup-link { display: inline-block; margin-top: 8px; font-size: 14px; font-weight: 600; }
html.rd .com-popup .vote-row { justify-content: flex-start !important; }
/* PM hero card */
html.rd .com-seat-pm { grid-column: 1 / -1; grid-template-columns: 120px 1fr; padding: 24px; border-top: 4px solid var(--rd-primary-800); }
html.rd .com-seat-pm .com-av { width: 120px !important; height: 120px !important; border-radius: var(--rd-radius); }
html.rd .com-seat-pm .com-seat-name { font-size: 26px !important; }
html.rd .com-seat-pm .com-seat-role { font-size: 17px !important; }
html.rd .com-seat-empty { border-style: dashed; background: var(--rd-base); }
@media (max-width: 900px) { html.rd .com-rt-wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  html.rd .com-rt-wrap { grid-template-columns: 1fr; gap: 12px; }
  html.rd .com-seat-pm { grid-template-columns: 88px 1fr; padding: 16px; }
  html.rd .com-seat-pm .com-av { width: 88px !important; height: 88px !important; }
  html.rd .com-seat-pm .com-seat-name { font-size: 21px !important; }
}
html.rd .com-lb-fill { background: var(--rd-primary-800) !important; }

/* PEOPLE'S MINISTRY — tabs as underline tabs */
html.rd .pm-tabs { border-bottom: 1px solid var(--rd-border); gap: 4px !important; background: none !important; padding: 0 !important; border-radius: 0 !important; }
html.rd .pm-tab { border-radius: 0 !important; background: none !important; border: 0 !important; border-bottom: 3px solid transparent !important; color: var(--rd-muted) !important; box-shadow: none !important; min-height: 44px; }
html.rd .pm-tab.active, html.rd .pm-tab.is-active, html.rd .pm-tab[aria-selected="true"] { color: var(--rd-primary-800) !important; border-bottom-color: var(--rd-primary-800) !important; }
html.rd .pm-stat .num { color: var(--rd-primary-800) !important; }

/* TRACKERS LANDING */
html.rd .tl-card { border: 1px solid var(--rd-border) !important; border-radius: var(--rd-radius) !important; box-shadow: none !important; }
html.rd .tl-card:hover { box-shadow: var(--rd-shadow-hover) !important; transform: none !important; }
html.rd .tl-chip { border-radius: 999px !important; }

/* PETITIONS */
html.rd .pit-progress-fill { background: var(--rd-emerald) !important; }
html.rd .pit-btn-primary { background: var(--rd-primary-800) !important; border-color: var(--rd-primary-800) !important; color: #fff !important; border-radius: 8px !important; box-shadow: none !important; }
html.rd .pit-btn-ghost { border-radius: 8px !important; }
html.rd .fp-hero h1, html.rd .fp-hero .fp-hero-sub { color: #fff !important; display: block; }
html.rd .com-header > :is(.com-badge, .com-title, .com-sub) { display: block !important; margin-left: auto; margin-right: auto; }
html.rd .com-header .hno-share { justify-content: center; }
html.rd .com-header .com-badge { display: inline-block !important; background: var(--rd-primary-50) !important; color: var(--rd-primary-800) !important; border: 0 !important; }
html.rd .com-title { color: var(--rd-primary-900) !important; }
html.rd .com-seat .vote-btn {
  background: #fff !important; color: var(--rd-text-2) !important; border: 1px solid var(--rd-border) !important;
  box-shadow: none !important; border-radius: 999px !important; min-height: 36px; padding: 0 12px !important; font-weight: 600;
}
html.rd .com-seat .vote-btn:hover { border-color: var(--rd-primary-800) !important; color: var(--rd-primary-800) !important; }

/* Warm cream surfaces from rev-12 pages → slate (rev 13 §11.3). */
html.rd :is(.sky-page, .pm-hero, .pm-body, .prat, .prat-rail) { background-color: var(--rd-base) !important; }
html.rd :is(.hero-meter, .feat-img, .themecard-img, .themecard-bar, .prat-search-x, .prat-group-bar, .fp-card-photo) { background-color: #eef2f7 !important; }
html.rd .pm-hero { border-bottom: 1px solid var(--rd-border); }
html.rd .pit-page-header { background: var(--rd-primary-900) !important; }
html.rd .tl-card-ov { background: linear-gradient(180deg, transparent 30%, rgba(11, 37, 69, .92) 100%) !important; }
/* Strict locale: English sub-titles that merely repeat a Nepali page title go
   in ने mode (proper-name secondary lines such as *-name-en stay). */
html.rd[data-lang="np"] :is(.pit-title-en, .pm-subtitle-en) { display: none !important; }
html.rd .tl-hero :is(h1, h2, p) { color: #fff !important; }
html.rd .tl-hero-ov { background: linear-gradient(0deg, rgba(11, 37, 69, .82) 0%, rgba(11, 37, 69, .35) 55%, rgba(11, 37, 69, .1) 100%) !important; }
html.rd .hero-rule { background: var(--rd-crimson) !important; }

/* Guest sign-in banner: wraps cleanly on phones, close button clear of text. */
@media (max-width: 640px) {
  html.rd #hno-login-banner { padding: 10px 44px 10px 16px !important; font-size: 15px !important; text-align: left !important; line-height: 1.5; }
  html.rd #hno-login-banner a { display: inline-block; margin: 6px 0 0 !important; }
}

/* HOME 2026 — Sansad-first homepage (/2026) ─────────────────────────────── */
.rd-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 10px; font: 700 16px var(--rd-font); text-decoration: none; cursor: pointer; border: 1.5px solid transparent; }
.rd-btn--primary { background: var(--rd-primary-800); color: #fff !important; }
.rd-btn--primary:hover { background: var(--rd-primary-900); }
.rd-btn--ghost { background: #fff; color: var(--rd-primary-800) !important; border-color: var(--rd-primary-800); }
.rd-btn--ghost:hover { background: var(--rd-primary-50); }
.rd-hm-hero { background: var(--rd-card); border-bottom: 1px solid var(--rd-border); padding: 36px 0 40px; }
.rd-hm-hero-grid { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; }
.rd-hm-hero-copy h1 { margin: 10px 0 12px; color: var(--rd-primary-900); font-weight: 800; font-size: clamp(30px, 5vw, 50px) !important; line-height: 1.15; }
.rd-hm-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.rd-hm-note { margin: 14px 0 0; font-size: 14px; color: var(--rd-muted); max-width: 56ch; }
.rd-hm-seatcard { background: var(--rd-base); border: 1px solid var(--rd-border); border-radius: var(--rd-radius-lg); padding: 20px; }
.rd-hm-seatcard-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; color: var(--rd-primary-900); }
.rd-hm-empty { margin: 0; color: var(--rd-muted); }
.rd-hm-adrow { margin-top: 20px; }
.rd-ad { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--rd-border); border-radius: var(--rd-radius); background: var(--rd-base); text-decoration: none; min-height: 60px; }
.rd-ad img { display: block; max-width: 100%; height: auto; max-height: 120px; object-fit: contain; }
.rd-ad .rd-sponsor-tag { position: absolute; top: 6px; left: 8px; background: var(--rd-card); }
.rd-ad--home_feed { flex-direction: column; min-height: 250px; }
.rd-hm-section { padding-top: 40px; padding-bottom: 8px; }
.rd-hm-sechead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.rd-hm-sechead h2 { margin: 0; font-size: 24px !important; font-weight: 800; color: var(--rd-primary-900); }
.rd-hm-sechead a { font-weight: 600; color: var(--rd-primary-800); text-decoration: none; }
.rd-hm-cards { display: grid; grid-template-columns: 1fr; gap: 14px; }
.rd-hm-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; background: var(--rd-card); border: 1px solid var(--rd-border); border-radius: var(--rd-radius-lg); box-shadow: var(--rd-shadow); text-decoration: none; color: var(--rd-text); transition: box-shadow .18s, border-color .18s; }
.rd-hm-card:hover { box-shadow: var(--rd-shadow-hover); border-color: var(--rd-primary-800); }
.rd-hm-card b { font-size: 18px; color: var(--rd-primary-900); }
.rd-hm-card p { margin: 0; color: var(--rd-text-2); font-size: 15px; }
.rd-hm-card small { color: var(--rd-muted); font-size: 14px; margin-top: auto; }
.rd-hm-status { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; margin-top: 10px; background: #f1f5f9; }
.rd-hm-timely { display: grid; grid-template-columns: 1fr; gap: 16px; }
.rd-hm-list { background: var(--rd-card); border: 1px solid var(--rd-border); border-radius: var(--rd-radius-lg); }
.rd-hm-row { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 14px 18px; border-top: 1px solid var(--rd-border); text-decoration: none; color: var(--rd-text-2); font-size: 14px; }
.rd-hm-row:first-child { border-top: 0; }
.rd-hm-row:hover b { color: var(--rd-primary-800); }
.rd-hm-row b { font-size: 16px; color: var(--rd-text); }
.rd-hm-kind { font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--rd-primary-800); }
.rd-hm-swakiya { display: flex; flex-direction: column; gap: 14px; padding: 20px; background: var(--rd-primary-50); border: 1px solid var(--rd-border); border-radius: var(--rd-radius-lg); margin-bottom: 48px; }
.rd-hm-swakiya b { font-size: 18px; color: var(--rd-primary-900); }
.rd-hm-swakiya p { margin: 4px 0 0; color: var(--rd-text-2); }
@media (min-width: 900px) {
  .rd-hm-hero-grid { grid-template-columns: 6fr 5fr; gap: 48px; }
  .rd-hm-cards { grid-template-columns: repeat(4, 1fr); }
  .rd-hm-timely.has-ad { grid-template-columns: 2fr 1fr; align-items: start; }
  .rd-hm-row { grid-template-columns: 90px 1fr auto; align-items: center; gap: 16px; }
  .rd-hm-swakiya { flex-direction: row; justify-content: space-between; align-items: center; }
}

/* HOME 2026 — branding, MP strip, explainers, motion ─────────────────────────
   Party colours are inline custom properties fed from hno_parties (never hard-coded here).
   Motion is gated on html.rd-motion (set only when the visitor has not asked for reduced motion and the
   browser has IntersectionObserver). Without it everything is simply visible. Transform/opacity only. */
.rd-legend--logos { gap: 8px 14px; }
.rd-legend--logos > span { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; }
.rd-legend--logos i { margin-right: 0; flex-shrink: 0; width: 12px; height: 12px; border-radius: 3px; vertical-align: 0; }
.rd-legend--logos img { width: 20px; height: 20px; object-fit: contain; border-radius: 4px; background: #fff; border: 1px solid var(--rd-border); padding: 1px; }
.rd-legend--logos b { font-weight: 700; color: var(--rd-text); }
.rd-hm-gapnote { margin: 12px 0 0; font-size: 14px; color: var(--rd-muted); }
.rd-hm-gapnote a { font-weight: 700; text-decoration: none; }
.rd-hm-hero { background: linear-gradient(180deg, var(--rd-card) 0%, var(--rd-base) 100%); }
.rd-hm-seatcard { box-shadow: var(--rd-shadow-hover); background: var(--rd-card); }
.rd-hm-seatcard .rd-seats { padding-top: 26px; }
.rd-hm-seatcard .rd-seats .rd-bar { height: 36px; }
.rd-hm-adrow { min-height: 100px; }
.rd-ad--home_top { min-height: 90px; }

/* controls */
.rd-ico { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--rd-border); background: var(--rd-card); color: var(--rd-primary-800); cursor: pointer; transition: transform .15s ease, background-color .15s ease; }
.rd-ico:hover { background: var(--rd-primary-50); }
.rd-ico:active { transform: scale(.94); }
.rd-ico[hidden] { display: none; }
.rd-strip-ctl { display: flex; gap: 8px; }
.rd-strip-toggle .rd-i-play { display: none; }
.rd-strip-toggle.is-paused .rd-i-pause { display: none; }
.rd-strip-toggle.is-paused .rd-i-play { display: block; }
.rd-strip-toggle .rd-lp-play, .rd-strip-toggle.is-paused .rd-lp-pause { display: none; }
.rd-strip-toggle.is-paused .rd-lp-play { display: block; }
.rd-btn { transition: transform .15s ease, background-color .15s ease; }
.rd-btn:active, .rd-chip:active, .rd-lp-btn:active { transform: scale(.97); }

/* MP photo strip: native horizontal scroll by default; drifting (transform) only in motion mode */
.rd-strip { overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; padding: 4px 2px 14px; margin: 0 -2px; }
.rd-strip.is-drift { overflow: hidden; scroll-snap-type: none; }
.rd-strip-track { display: flex; gap: 14px; list-style: none; margin: 0; padding: 0; width: max-content; }
.rd-strip.is-drift .rd-strip-track { will-change: transform; }
.rd-mp { flex: 0 0 176px; scroll-snap-align: start; }
.rd-mp > a { position: relative; display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 12px 12px 14px; background: var(--rd-card); border: 1px solid var(--rd-border); border-top: 4px solid var(--party, var(--rd-pending)); border-radius: var(--rd-radius-lg); text-decoration: none; color: var(--rd-text); transition: transform .2s ease; }
.rd-mp > a::after, .rd-hm-card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: var(--rd-shadow-hover); opacity: 0; transition: opacity .2s ease; pointer-events: none; }
.rd-mp > a:hover, .rd-mp > a:focus-visible { transform: translateY(-3px); }
.rd-mp > a:hover::after, .rd-mp > a:focus-visible::after, .rd-hm-card:hover::after { opacity: 1; }
.rd-mp-ph { position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: #eef2f7; margin-bottom: 8px; }
.rd-mp-ph::before { content: ''; position: absolute; inset: 0; background: var(--party, #94a3b8); opacity: .14; }
.rd-mp-ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 22%; display: block; }
.rd-mp-ini { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 38px; color: var(--party, var(--rd-muted)); }
.rd-mp-name { font-weight: 800; font-size: 16px; line-height: 1.25; color: var(--rd-primary-900); }
.rd-mp-alt { font-size: 13px; color: var(--rd-muted); line-height: 1.3; }
.rd-mp-party { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--rd-text-2); }
.rd-mp-party img { width: 18px; height: 18px; object-fit: contain; background: #fff; border-radius: 3px; }
.rd-mp-party i { width: 10px; height: 10px; border-radius: 2px; background: var(--party, var(--rd-pending)); }
.rd-mp-seat { font-size: 13px; color: var(--rd-muted); }

/* cards: lift on hover (transform), shadow layer fades in */
.rd-hm-card { position: relative; transition: transform .2s ease, border-color .18s; }
.rd-hm-card:hover { transform: translateY(-3px); box-shadow: var(--rd-shadow); }
.rd-hm-row { transition: background-color .15s ease; }
.rd-hm-row:hover { background: var(--rd-primary-50); }
.rd-hm-row[hidden] { display: none; }

/* tabs: underline style, the ink slides between tabs */
.rd-tabs { position: relative; display: flex; gap: 4px; margin: -4px 0 14px; border-bottom: 1px solid var(--rd-border); overflow-x: auto; scrollbar-width: none; }
.rd-tabs[hidden] { display: none; }
.rd-tabs button { min-height: 44px; padding: 0 16px; border: 0; background: none; font: 600 15px var(--rd-font); color: var(--rd-text-2); cursor: pointer; white-space: nowrap; }
.rd-tabs button[aria-selected="true"], .rd-tabs button:hover { color: var(--rd-primary-800); }
.rd-tab-ink { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--rd-primary-800); transition: transform .28s cubic-bezier(.3,.7,.2,1), width .28s cubic-bezier(.3,.7,.2,1); }

/* explainer loops */
.rd-loops { display: grid; grid-template-columns: 1fr; gap: 16px; }
.rd-loop { margin: 0; padding: 18px; background: var(--rd-card); border: 1px solid var(--rd-border); border-radius: var(--rd-radius-lg); display: flex; flex-direction: column; gap: 14px; }
.rd-loop-title { font-size: 18px; font-weight: 800; color: var(--rd-primary-900); }
.rd-loop-stage { display: flex; justify-content: center; background: var(--rd-base); border-radius: 10px; padding: 12px; }
.rd-loop-svg { width: 100%; max-width: 360px; height: auto; aspect-ratio: 320 / 210; display: block; }
.lp-card { fill: #fff; stroke: var(--rd-border); stroke-width: 1.5; }
.lp-av { fill: var(--rd-primary-50); stroke: var(--rd-primary-800); stroke-width: 2; }
.lp-ln { fill: #cbd5e1; }
.lp-ln--s { fill: #e2e8f0; }
.lp-hl { fill: var(--rd-primary-50); opacity: 0; }
.lp-track { fill: #e2e8f0; }
.lp-bar { fill: var(--rd-primary-800); transform-box: fill-box; transform-origin: left; transform: scaleX(.82); }
.lp-chip { fill: #dbeafe; }
.lp-arrow { fill: none; stroke: var(--rd-primary-800); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.rd-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 8px; }
.rd-steps li { counter-increment: s; position: relative; padding: 8px 10px 8px 42px; border-radius: 8px; font-size: 15px; line-height: 1.45; color: var(--rd-text-2); }
.rd-steps li::before { content: counter(s); position: absolute; left: 8px; top: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--rd-primary-800); color: #fff; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.rd-steps li b { color: var(--rd-primary-900); }
.rd-lp-btn { align-self: flex-start; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--rd-border); background: var(--rd-card); color: var(--rd-primary-800); font: 700 15px var(--rd-font); cursor: pointer; transition: transform .15s ease, background-color .15s ease; }
.rd-lp-btn:hover { background: var(--rd-primary-50); }
.rd-lp-btn[hidden] { display: none; }
.rd-lp-btn .rd-lp-play, .rd-loop.is-paused .rd-lp-btn .rd-lp-pause { display: none; }
.rd-loop.is-paused .rd-lp-btn .rd-lp-play { display: inline; }
html:not(.rd-motion) .rd-lp-btn, html:not(.rd-motion) .rd-strip-toggle { display: none; }

/* flow (loop 2): four HTML nodes on a vertical track; a dot travels down it */
.rd-flow { position: relative; display: grid; grid-template-columns: 1fr; gap: 10px; height: 202px; box-sizing: border-box; padding: 14px 14px 14px 52px; background: var(--rd-base); border-radius: 10px; overflow: hidden; }
.rd-flow-track { position: absolute; left: 25px; top: 32px; bottom: 32px; width: 2px; background: var(--rd-border); }
.rd-flow-dot { position: absolute; left: 14px; top: 0; width: 24px; height: 100%; pointer-events: none; transform: translateY(9.9%);
  background: radial-gradient(circle 8px at 12px 12px, var(--rd-primary-800) 0 7.5px, transparent 8px), radial-gradient(circle 12px at 12px 12px, var(--rd-primary-50) 0 11.5px, transparent 12px); }
.rd-flow-node { position: relative; display: flex; align-items: center; min-height: 36px; font-weight: 700; color: var(--rd-primary-900); font-size: 15px; white-space: nowrap; }
.rd-flow-node em { font-style: normal; display: inline-flex; position: absolute; left: -38px; width: 24px; height: 24px; align-items: center; justify-content: center; border-radius: 50%; background: #fff; border: 2px solid var(--rd-border); font-size: 12px; color: var(--rd-text-2); }
@media (min-width: 760px) { .rd-loops { grid-template-columns: 1fr 1fr; } }

/* ── motion (only when html.rd-motion) ───────────────────────────────────────── */
.rd-motion .rd-rv { opacity: 0; transform: translateY(14px); transition: opacity .6s ease var(--d, 0s), transform .6s cubic-bezier(.2,.7,.2,1) var(--d, 0s); }
.rd-motion .rd-rv.is-in { opacity: 1; transform: none; }
.rd-motion .rd-rv.rd-hm-card.is-in:hover { transform: translateY(-3px); transition-delay: 0s; }
.rd-motion .rd-fill-seg { transform-origin: left center; transition: transform .9s cubic-bezier(.2,.7,.2,1) calc(var(--i, 0) * 80ms + .15s); }
.rd-motion .rd-fill:not(.is-in) .rd-fill-seg { transform: scaleX(0); }
.rd-motion .rd-fill .rd-majority { transition: opacity .4s ease 1s; }
.rd-motion .rd-fill:not(.is-in) .rd-majority { opacity: 0; }

.rd-motion .rd-loop:not(.is-playing) *, .rd-motion .rd-loop:not(.is-playing) *::before,
.rd-motion .rd-loop.is-paused *, .rd-motion .rd-loop.is-paused *::before { animation-play-state: paused !important; }
.rd-motion .lp-st { animation: lp-on 12s linear infinite both; animation-delay: calc(var(--s) * 3s); }
.rd-motion .lp-st .lp-hl { animation: lp-hl 12s linear infinite both; animation-delay: calc(var(--s) * 3s); }
.rd-motion .lp-st .lp-bar { animation: lp-bar 12s linear infinite both; }
.rd-motion .rd-steps:not(.rd-steps--plain) li { animation: lp-li 12s linear infinite both; animation-delay: calc(var(--s) * 3s); }
@keyframes lp-on { 0% { opacity: .4; } 3%, 24% { opacity: 1; } 28%, 100% { opacity: .4; } }
@keyframes lp-hl { 0% { opacity: 0; } 3%, 24% { opacity: 1; } 28%, 100% { opacity: 0; } }
@keyframes lp-bar { 0%, 2% { transform: scaleX(0); } 14%, 100% { transform: scaleX(.82); } }
@keyframes lp-li { 0% { opacity: .55; } 3%, 24% { opacity: 1; } 28%, 100% { opacity: .55; } }

.rd-motion .rd-flow-dot { animation: lp-dot 12s cubic-bezier(.5,0,.3,1) infinite both; }
.rd-motion .rd-flow-node { animation: lp-node1 12s linear infinite both; }
.rd-motion .rd-flow-node.n1 { animation-name: lp-node2; }
.rd-motion .rd-flow-node.n2 { animation-name: lp-node3; }
.rd-motion .rd-flow-node.n3 { animation-name: lp-node4; }
@keyframes lp-dot { 0%, 6% { transform: translateY(9.9%); } 28%, 34% { transform: translateY(32.7%); } 56%, 62% { transform: translateY(55.4%); } 84%, 92% { transform: translateY(78.2%); } 100% { transform: translateY(9.9%); } }
@keyframes lp-node1 { 0%, 4% { opacity: 1; } 90% { opacity: 1; } 96%, 100% { opacity: .55; } }
@keyframes lp-node2 { 0%, 24% { opacity: .55; } 30%, 90% { opacity: 1; } 96%, 100% { opacity: .55; } }
@keyframes lp-node3 { 0%, 52% { opacity: .55; } 58%, 90% { opacity: 1; } 96%, 100% { opacity: .55; } }
@keyframes lp-node4 { 0%, 80% { opacity: .55; } 86%, 94% { opacity: 1; } 98%, 100% { opacity: .55; } }

/* the preference always wins, even if the class was set before it changed */
@media (prefers-reduced-motion: reduce) {
  .rd-rv, .rd-fill-seg, .rd-fill .rd-majority, .rd-mp > a, .rd-hm-card, .rd-btn, .rd-ico, .rd-tab-ink, .lp-st, .lp-hl, .lp-bar, .rd-steps li, .rd-flow-dot, .rd-flow-node {
    animation: none !important; transition: none !important;
  }
  .rd-rv { opacity: 1 !important; transform: none !important; }
  .rd-fill-seg { transform: none !important; }
  .rd-mp > a:hover, .rd-hm-card:hover { transform: none; }
}
@media print { .rd-rv { opacity: 1 !important; transform: none !important; } .rd-fill-seg { transform: none !important; } }
html:not(.rd-motion) .rd-flow-dot { display: none; }
