/* ==========================================================================
   Deposit Rates — modern design system
   Hand-built, dependency-free. Calm-premium aesthetic, auto dark mode.
   ========================================================================== */

:root {
  color-scheme: light dark;

  /* Brand */
  --brand: #2563EB; /* deep royal blue */
  --brand-2: #38BDF8; /* cyan accent */
  --accent: #64748B; /* slate gray */
  --accent-2: #94A3B8;

  /* Light theme surfaces */
  --bg: #f7f8fc;
  --bg-2: #eef1f9;
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --surface-hover: #f9fafe;
  --ink: #0b1020;
  --ink-2: #3f4763;
  --muted: #8a93ac;
  --line: #e7eaf3;
  --line-2: #eef1f8;

  --good: #10b981;
  --good-bg: #ecfdf5;
  --good-line: #a7f3d0;
  --info: #4f46e5;
  --info-bg: #eef2ff;
  --info-line: #c7d2fe;
  --warn-bg: #fff7ed;
  --warn-line: #fdba74;
  --warn-ink: #9a3412;

  --gold: #f5b301;
  --silver: #9aa6b8;
  --bronze: #cd7f32;

  --shadow-sm:
    0 1px 2px rgba(11, 16, 32, 0.05), 0 1px 3px rgba(11, 16, 32, 0.04);
  --shadow:
    0 2px 4px rgba(11, 16, 32, 0.04), 0 12px 32px rgba(11, 16, 32, 0.08);
  --shadow-lg:
    0 8px 24px rgba(11, 16, 32, 0.1), 0 30px 60px rgba(11, 16, 32, 0.12);
  --shadow-brand: 0 10px 30px rgba(37, 99, 235, 0.35);

  --radius: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  --font:
    "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-display: "Sora", "Inter", ui-sans-serif, system-ui, sans-serif;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  font-synthesis: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #070a14;
    --bg-2: #0b1020;
    --surface: #10142400;
    --surface: #121829;
    --surface-2: #0e1322;
    --surface-hover: #161d31;
    --ink: #eef1fa;
    --ink-2: #b6c0da;
    --muted: #7a86a3;
    --line: #222a41;
    --line-2: #1a2136;
    --good-bg: #052e22;
    --good-line: #0f5c43;
    --info-bg: #1a1f43;
    --info-line: #33407a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 16px 40px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.6);
  }
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
  overflow-x: clip;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 22px;
}

/* Entrance animations */
@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.82);
  }
}
.rise {
  animation: riseIn 0.6s var(--ease) both;
}
.rise-1 {
  animation-delay: 0.05s;
}
.rise-2 {
  animation-delay: 0.12s;
}
.rise-3 {
  animation-delay: 0.19s;
}
.rise-4 {
  animation-delay: 0.26s;
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

.loading {
  padding: 120px 22px;
  color: var(--muted);
  text-align: center;
  font-weight: 500;
}

/* ==========================================================================
   Top nav
   ========================================================================== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid transparent;
  transition:
    border-color 0.3s,
    background 0.3s;
}
.nav.scrolled {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
  text-decoration: none;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  padding: 7px;
  color: #fff;
  background: linear-gradient(
    135deg,
    var(--brand),
    var(--brand-2) 60%,
    var(--accent)
  );
  box-shadow: var(--shadow-brand);
  flex: none;
}
.brand-mark svg {
  display: block;
}
.brand-word {
  font-family: var(--font-display);
}
.bank-hero-row {
  display: flex;
  align-items: center;
  gap: 18px;
}
.bank-logo {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.03em;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.bank-logo::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 50%, transparent 100%);
  opacity: 0.6;
  pointer-events: none;
}
.bank-logo:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
@media (max-width: 560px) {
  .bank-logo {
    width: 52px;
    height: 52px;
    font-size: 18px;
  }
}
.brand-accent {
  color: var(--brand);
}
.brand-tld {
  color: var(--muted);
  font-size: 0.72em;
  letter-spacing: 0.01em;
  font-weight: 600;
}
@media (prefers-color-scheme: dark) {
  .brand-accent {
    color: var(--accent-2);
  }
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Primary nav links (desktop) */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  margin-right: 0;
}
.nav-search-container {
  margin-left: 12px;
  margin-right: 10px;
}
.nav-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  transition: all 0.15s var(--ease);
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--ink);
  background: var(--surface-2);
}
.nav-link.nav-active {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
}
@media (prefers-color-scheme: dark) {
  .nav-link.nav-active {
    color: var(--accent-2);
  }
}

/* Nav dropdowns (desktop hover/focus) */
.nav-dd {
  position: relative;
}
.nav-dd-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition:
    opacity 0.16s var(--ease),
    transform 0.16s var(--ease),
    visibility 0.16s;
  z-index: 60;
}
.nav-dd:hover .nav-dd-menu,
.nav-dd:focus-within .nav-dd-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dd-menu-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: 380px;
}
.nav-dd-item {
  display: block;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.13s var(--ease);
}
.nav-dd-item:hover {
  background: var(--surface-2);
  color: var(--brand);
}

/* Hamburger + mobile drawer */
.nav-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  cursor: pointer;
  margin-left: auto;
}
.nav-burger span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 0 auto;
  background: var(--ink);
  border-radius: 2px;
  transition:
    transform 0.25s var(--ease),
    opacity 0.2s;
}
.nav.drawer-open .nav-burger span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav.drawer-open .nav-burger span:nth-child(2) {
  opacity: 0;
}
.nav.drawer-open .nav-burger span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}
.nav-drawer {
  display: none;
  flex-direction: column;
  gap: 0;
  /* Fixed so it escapes the nav's backdrop-filter stacking context and
     covers full viewport width on all mobile browsers */
  position: fixed;
  top: 66px;
  left: 0;
  right: 0;
  z-index: 49;
  max-height: calc(100vh - 66px);
  overflow-y: auto;
  padding: 8px 0 32px;
  border-top: 1px solid var(--line);
  background: var(--bg);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.nav.drawer-open .nav-drawer {
  display: flex;
  animation: fadeIn 0.2s var(--ease) both;
}
.nav-drawer .nav-link {
  padding: 15px 24px;
  font-size: 16px;
  border-radius: 0;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}
.nav-drawer .nav-link:hover {
  background: var(--surface-2);
}
.nav-drawer .nav-sub {
  padding: 12px 24px 12px 44px;
  font-size: 15px;
  color: var(--muted);
  border-radius: 0;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}
.drawer-group {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 20px 24px 6px;
}

/* Breadcrumbs */
.breadcrumbs {
  border-bottom: 1px solid var(--line-2);
  font-size: 13px;
}
.breadcrumbs .container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  padding-bottom: 12px;
  flex-wrap: wrap;
}
.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
.breadcrumbs a:hover {
  color: var(--brand);
}
.crumb-sep {
  color: var(--muted);
  opacity: 0.6;
}
.crumb-current {
  color: var(--ink);
  font-weight: 700;
}

@media (max-width: 760px) {
  .nav-links {
    display: none;
  }
  .nav-burger {
    display: flex;
  }
  .nav-search-container {
    flex: 1;
    min-width: 0;
  }
  /* hide the informational pills on mobile so the burger fits */
  .nav-right .nav-pill.hide-sm {
    display: none;
  }
}
.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent);
  animation: pulse 2.4s ease-in-out infinite;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  padding: 40px 0 28px;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 640px;
  z-index: 0;
  background:
    radial-gradient(
      60% 55% at 18% 8%,
      color-mix(in srgb, var(--brand) 34%, transparent),
      transparent 70%
    ),
    radial-gradient(
      50% 50% at 88% 0%,
      color-mix(in srgb, var(--accent) 30%, transparent),
      transparent 65%
    ),
    radial-gradient(
      45% 60% at 60% 40%,
      color-mix(in srgb, var(--brand-2) 22%, transparent),
      transparent 70%
    );
  filter: blur(30px) saturate(120%);
  opacity: 0.9;
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 780px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  border: 1px solid var(--info-line);
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  margin-bottom: 12px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 4.4vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  margin: 0 0 12px;
}
.hero h1 .grad {
  background: linear-gradient(100deg, var(--brand), var(--accent) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  font-size: clamp(15px, 2.2vw, 18px);
  color: var(--ink-2);
  max-width: 620px;
  margin: 0;
}

/* Hero customer toggle (General / Senior / Super senior) */
.hero-customer-seg {
  display: inline-flex;
  max-width: 100%;
  overflow-x: auto;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 4px;
  margin: 14px 0 4px;
  box-shadow: var(--shadow-sm);
  scrollbar-width: none;
}
.hero-customer-seg::-webkit-scrollbar {
  display: none;
}
.hero-cust-btn {
  border: 0;
  flex: none;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font);
  font-weight: 600;
  font-size: 14px;
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.18s var(--ease);
  white-space: nowrap;
}
.hero-cust-btn:hover {
  color: var(--ink);
  background: var(--surface-2, var(--surface));
}
.hero-cust-btn.active {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
@media (max-width: 480px) {
  .hero-cust-btn {
    font-size: 12px;
    padding: 7px 10px;
  }
}

/* Profile page customer-category toggle (inside FD section, not in hero) */
.profile-cat-seg {
  display: inline-flex;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 3px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  scrollbar-width: none;
}
.profile-cat-seg::-webkit-scrollbar { display: none; }
.profile-cat-seg .hero-cust-btn {
  font-size: 13px;
  padding: 7px 16px;
}
@media (max-width: 480px) {
  .profile-cat-seg .hero-cust-btn {
    font-size: 11.5px;
    padding: 6px 10px;
  }
}

/* FD chart variants — only the active one is shown */
.cat-chart { display: none; }
.cat-chart.active { display: block; }

/* Fallback note when a category falls back to a lower tier */
.cat-fallback-note {
  font-size: 13px;
  margin: 0 0 8px;
  padding: 6px 12px;
  background: var(--surface);
  border-left: 3px solid var(--line);
  border-radius: 0 4px 4px 0;
}

/* Highlight active category column header in FD rate table */
.rate-table th[data-cat-col] { position: relative; }
.rate-table th[data-cat-col]::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: transparent;
  transition: background 0.18s;
}
section[data-active-cat="GENERAL"] .rate-table th[data-cat-col="GENERAL"]::after,
section[data-active-cat="SENIOR"] .rate-table th[data-cat-col="SENIOR"]::after,
section[data-active-cat="SUPER_SENIOR"] .rate-table th[data-cat-col="SUPER_SENIOR"]::after {
  background: var(--brand);
}

/* Hero actions (share button, compare button) */
.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* Secondary "Compare banks" button in the hero */
.compare-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--ink);
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-family: var(--font);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  transition:
    background 0.15s var(--ease),
    border-color 0.15s var(--ease),
    transform 0.15s var(--ease);
}
.compare-hero-btn:hover {
  background: var(--surface-2, var(--surface));
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-1px);
}

/* Bank profile hero actions */
.bank-hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.bank-hero-actions .share-btn {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: var(--shadow-brand);
}

@media (max-width: 560px) {
  .bank-hero-actions {
    margin-top: 12px;
  }
}

/* Hero movements strip */
.movements-strip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 0;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--ink);
  font-size: 13px;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
  align-self: flex-start;
}
.movements-strip:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
@media (max-width: 640px) {
  /* A fully round pill radius only reads as a "pill" on a single line — once
     the strip's own content wraps inside a narrow flex item, that same
     radius shrinks the effective box to a bubble that clips the text near
     its corners. Give the strip the full row width (so it wraps to fewer,
     wider lines) and a normal card radius instead of a pill once it does. */
  .movements-strip {
    width: 100%;
    align-self: stretch;
    border-radius: 14px;
    row-gap: 6px;
  }
}
.mv-badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  padding: 4px 9px;
  border-radius: var(--radius-pill);
}
.mv-text {
  color: var(--ink-2);
}
.mv-nums {
  font-weight: 700;
  font-family: var(--font-display);
}
.mv-up {
  color: #10b981;
}
.mv-down {
  color: #ef4444;
}
.mv-go {
  color: var(--brand);
  font-weight: 700;
}
@media (prefers-color-scheme: dark) {
  .mv-go {
    color: var(--accent-2);
  }
}

/* Headline best-rate card */
.headline-card {
  position: relative;
  z-index: 1;
  margin-top: 20px;
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hl-cell {
  background: var(--surface);
  padding: 15px 18px;
  position: relative;
}
.hl-cell.feature {
  background: linear-gradient(
    135deg,
    var(--brand),
    var(--brand-2) 55%,
    #7c3aed
  );
  color: #fff;
}
.hl-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.hl-cell.feature .hl-label {
  color: rgba(255, 255, 255, 0.82);
}
.hl-value {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 32px;
  line-height: 1.05;
  margin: 4px 0 2px;
}
.hl-cell.feature .hl-value {
  font-size: 38px;
}
.hl-sub {
  font-size: 13.5px;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.hl-cell.feature .hl-sub {
  color: rgba(255, 255, 255, 0.9);
}
.hl-caveat {
  font-size: 11.5px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 6px;
}
.hl-maturity-note {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
  margin-left: 4px;
  opacity: 0.8;
}
.hl-maturity-val {
  font-size: 22px !important;
  color: #10b981 !important;
}

/* Maturity calculator tile inputs */
.hl-calc-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.calc-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.calc-input {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--surface-2, var(--surface));
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s;
}
.calc-input:focus {
  border-color: var(--brand);
}
.calc-amt { width: 110px; }
.calc-ten { width: 58px; }
.calc-sep {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

/* ==========================================================================
   Tenure-rate bar chart (bank profile FD section)
   ========================================================================== */
.tenure-chart-wrap {
  margin: 0 0 20px;
  padding: 12px 0 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}
.tenure-chart-svg {
  display: block;
  width: 100%;
  max-width: 560px;
  height: auto;
}
.tenure-chart-note {
  margin: 6px 12px 2px;
  font-size: 11.5px;
  line-height: 1.4;
}

/* ==========================================================================
   Bank profile overview (intro + institution snapshot + compare strip)
   ========================================================================== */
.overview-panel {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
}
.bank-intro {
  margin: 4px 0 18px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 68ch;
}
.inst-snapshot {
  margin: 0 0 20px;
}
.inst-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.inst-item {
  background: var(--surface);
  padding: 14px 16px;
}
.inst-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.inst-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
}
.inst-approx {
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 1px 7px;
  vertical-align: 1px;
  margin-left: 2px;
}
.inst-note {
  font-size: 12px;
  margin: 10px 0 0;
}

/* ---- Bank health panel ---- */
.bank-health-panel {
  margin: 0 0 20px;
}
.health-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}
.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.health-item {
  background: var(--surface);
  padding: 12px 14px;
}
.health-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.health-agency {
  font-size: 9.5px;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 1px 5px;
  color: var(--muted);
  text-transform: none;
  letter-spacing: 0;
}
.health-value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.health-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.health-good { color: #10b981; }
.health-ok   { color: var(--warn-ink); }
.health-warn { color: #ef4444; }

/* Part B: how this bank compares */
.compare-strip {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.compare-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 14px;
}
.compare-item {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.compare-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.compare-value {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 28px;
  line-height: 1.1;
  color: var(--ink);
}
.compare-sub {
  font-size: 13px;
  margin-top: 4px;
  color: var(--ink-2);
}
.compare-sub.delta-up {
  color: #10b981;
  font-weight: 600;
}
.compare-sub.delta-down {
  color: #ef4444;
  font-weight: 600;
}
.compare-sub.delta-flat {
  color: var(--muted);
}
.compare-move {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.move-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
}
.move-pill.move-rose {
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.35);
}
.move-pill.move-fell {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.35);
}
.move-pill.move-flat,
.move-pill.move-new {
  color: var(--muted);
}
.trust-line {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.trust-strong {
  font-weight: 700;
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  .move-pill.move-rose {
    background: rgba(16, 185, 129, 0.16);
  }
  .move-pill.move-fell {
    background: rgba(239, 68, 68, 0.16);
  }
}
@media (max-width: 560px) {
  .compare-value {
    font-size: 24px;
  }
  .bank-intro {
    font-size: 15px;
  }
}

/* ==========================================================================
   Controls card
   ========================================================================== */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.controls {
  margin: 8px 0 0;
  padding: 14px 16px;
}

@media (max-width: 560px) {
  .controls {
    padding: 10px 12px;
  }
}

/* 2-column grid — mobile default: all controls share equal width across 3 rows */
.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
}

/* Desktop: collapse to one horizontal row -------------------------------- */
@media (min-width: 561px) {
  .controls-grid {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 10px 14px;
    align-items: end;
  }
}

@media (max-width: 560px) {
  .controls-grid {
    gap: 8px 10px;
  }
}

/* Maturity calculator inputs row ----------------------------------------- */
/* Mobile-first: 2-col grid (Amount+Rate top, Tenure+Result bottom)          */
.calc-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  align-items: end;
}
/* Desktop: all four fields on one line */
@media (min-width: 561px) {
  .calc-controls {
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 10px 18px;
  }
  .calc-controls .amount-row {
    display: flex;
    width: 100%;
    max-width: none;
  }
}
@media (max-width: 560px) {
  .calc-controls {
    gap: 8px 10px;
  }
  .calc-controls .amount-row {
    max-width: none;
    width: 100%;
    display: flex;
  }
}

/* Every control in the grid fills its cell */
.controls-grid .control {
  min-width: 0;
}

.controls-grid .control-select {
  width: 100%;
}

.control label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 6px;
}

@media (max-width: 480px) {
  .control label {
    font-size: 10px;
    margin-bottom: 4px;
  }
}
.segment {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 4px;
  gap: 3px;
  flex-wrap: nowrap;
  width: 100%;
  justify-content: flex-start;
}
.seg-btn {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  font-weight: 600;
  font-size: 13.5px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-family: var(--font);
  flex: 0 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mobile: reduce button padding and size */
@media (max-width: 560px) {
  .seg-btn {
    padding: 8px 12px;
    font-size: 12px;
  }
}
.seg-btn:hover {
  color: var(--ink);
}
.seg-btn.active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}
@media (prefers-color-scheme: dark) {
  .seg-btn.active {
    background: color-mix(in srgb, var(--brand) 28%, var(--surface));
    color: #fff;
  }
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 13px;
  padding: 9px 15px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.18s var(--ease);
  font-family: var(--font);
}
.chip:hover {
  border-color: var(--brand);
  color: var(--ink);
  transform: translateY(-1px);
}
.chip.active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: var(--shadow-brand);
}

/* ==========================================================================
   Sections
   ========================================================================== */
/* ==========================================================================
   Feedback
   ========================================================================== */
.feedback-section {
  margin-top: 48px;
}
.feedback-panel {
  max-width: 760px;
  margin: 0 auto;
  padding: 22px;
}
.feedback-panel .section-head {
  margin-bottom: 14px;
}
.feedback-form {
  display: grid;
  gap: 12px;
}
.feedback-textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
  box-sizing: border-box;
}
.feedback-textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--brand) 35%, transparent);
  outline-offset: 1px;
  border-color: var(--brand);
}
.feedback-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.feedback-submit {
  margin: 0;
}
.feedback-submit:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}
.feedback-status {
  margin: 0;
  min-height: 1.5em;
}
.feedback-success {
  color: var(--good);
}
.feedback-error {
  color: #b42318;
}
@media (prefers-color-scheme: dark) {
  .feedback-error {
    color: #fda29b;
  }
}

section.block {
  margin-top: 46px;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
@media (max-width: 640px) {
  .section-head {
    flex-wrap: wrap;
  }
}
.section-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.section-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

/* Podium (top 3) */
.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.podium-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition:
    transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}
.podium-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--bank, var(--brand));
}
.podium-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.podium-card.first {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--gold) 12%, var(--surface)),
    var(--surface) 60%
  );
}
.podium-rank {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.medal {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 12px;
  color: #3a2c00;
}
.medal-1 {
  background: linear-gradient(135deg, #ffe08a, var(--gold));
}
.medal-2 {
  background: linear-gradient(135deg, #e8edf3, var(--silver));
  color: #2a3446;
}
.medal-3 {
  background: linear-gradient(135deg, #e6b988, var(--bronze));
  color: #3a1e00;
}
.podium-bank {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 6px;
}
.bank-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bank, #888) 22%, transparent);
  background: var(--bank, #888);
}
.podium-bankname {
  font-weight: 700;
  font-size: 15px;
}
.podium-rate {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 40px;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-top: 6px;
  color: var(--bank, var(--ink));
}
/* Maturity calculator output reuses .podium-rate but needs to stay contained */
#mc-out {
  font-size: clamp(22px, 5vw, 40px);
  overflow-wrap: break-word;
  word-break: break-all;
}
.podium-detail {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}

/* "View all rates" button on podium cards */
.podium-cta-link {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  border: 1.5px solid var(--brand);
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: all 0.15s var(--ease);
  cursor: pointer;
  white-space: nowrap;
}
.podium-cta-link:hover {
  background: var(--brand);
  color: #fff;
  transform: translateY(-1px);
}
.podium-cta-link:active {
  transform: translateY(0);
}
@media (prefers-color-scheme: dark) {
  .podium-cta-link {
    background: color-mix(in srgb, var(--accent-2) 16%, transparent);
    border-color: var(--accent-2);
    color: var(--accent-2);
  }
  .podium-cta-link:hover {
    background: var(--accent-2);
    color: #0b1020;
  }
}

/* Tenure strip */
.tenure-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
}
.tenure-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.2s var(--ease),
    border-color 0.2s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tenure-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
}
.tenure-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.tenure-card-share {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.tenure-card-share .share-btn {
  padding: 8px 12px;
  font-size: 12px;
}

.tenure-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  min-height: 30px;
  display: grid;
  align-items: center;
}
.tenure-rate {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.tenure-bank {
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 600;
  margin-top: 2px;
}

/* ==========================================================================
   Comparison table
   ========================================================================== */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  background: var(--surface);
}
.rate-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 640px;
}
.rate-table th,
.rate-table td {
  padding: 15px 18px;
  text-align: left;
  border-bottom: 1px solid var(--line-2);
  vertical-align: middle;
}
.rate-table thead th {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--surface-2);
}
.rate-table tbody tr {
  transition: background 0.15s;
}
.rate-table tbody tr:last-child td {
  border-bottom: 0;
}
.rate-table tbody tr:hover {
  background: var(--surface-hover);
}
.rate-table .top-row {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--gold) 10%, transparent),
    transparent 60%
  );
}
.num {
  text-align: right;
}
.rate-cell {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.bank-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bank-name {
  font-weight: 700;
}
/* Keep the displayed bank name on a single line so it never wraps to two
   rows. The Bank column widens to fit it (min-content on the cell below). */
.rate-table .bank-name,
.rate-table a.bank-link {
  white-space: nowrap;
}

/* Main-page "All banks compared" table (`.rate-table--main`) only: shrink the
   Bank column by ~25%. Two complementary trims, scoped so the shared profile /
   leaderboard `.rate-table`s are untouched:
   (1) tighter horizontal padding (18px -> 13px), vertical 15px unchanged; and
   (2) a max-width cap (~200px vs the ~260-270px natural width) that clips a
   long bank name (e.g. "Bank of Maharashtra") with an ellipsis instead of
   letting the column grow. Because `.bank-cell` is a flexbox, the text block
   needs `min-width:0`/`overflow:hidden` to actually shrink, and the color dot
   must not shrink (`flex:0 0 auto`). The existing name `white-space:nowrap`
   stays; ellipsis kicks in when the name exceeds the cap. */
.rate-table--main th:nth-child(2),
.rate-table--main td:nth-child(2) {
  padding-left: 13px;
  padding-right: 13px;
}
.rate-table--main td:nth-child(2) {
  max-width: 200px;
}
.rate-table--main .bank-cell {
  min-width: 0;
}
.rate-table--main .bank-cell > .bank-dot {
  flex: 0 0 auto;
}
.rate-table--main .bank-cell > div {
  min-width: 0;
  overflow: hidden;
}
.rate-table--main .bank-name,
.rate-table--main a.bank-link {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* "Applies to" column on the main table — capped width, two-line layout */
.rate-table--main td:nth-child(4) {
  max-width: 220px;
}
/* "As of" column — date + badge never needs much room */
.rate-table--main th:nth-child(5),
.rate-table--main td:nth-child(5) {
  white-space: nowrap;
  width: 1%;
  padding-left: 10px;
  padding-right: 10px;
}
.detail-cell {
  min-width: 0;
}
.detail-tenure {
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-meta {
  font-size: 11.5px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.7;
}

a.bank-link {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.15s;
}
a.bank-link:hover {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.bank-short {
  font-size: 12px;
}
.rank {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-weight: 700;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface-2);
}
.muted {
  color: var(--muted);
}
.spark-cell {
  width: 110px;
}
.spark {
  display: inline-block;
  vertical-align: middle;
}

/* --------------------------------------------------------------------------
   Main-page "All banks compared" table — mobile layout (iPhone 14 = 390px).
   All columns (rank #, Bank, Rate, Applies-to, Effective) stay present and
   remain reachable via horizontal scroll: the base `.rate-table` 640px
   min-width inside the scrollable `.table-wrap` applies on narrow screens.
   The `.bank-short` "Category · Product · DICGC" subtitle stays visible and
   renders on a second line under the bank name (the name link and the
   subtitle are block-level siblings inside the bank cell). The bank name
   itself stays on one line via `.rate-table .bank-name` white-space: nowrap.
   -------------------------------------------------------------------------- */

/* Static-table sort headers reuse the shared th.sortable / th.sort-active
   rules (see "Sortable table headers" below), matching the main-page SPA.
   The shared th.sortable rule sets `white-space: nowrap` (needed by the main
   SPA header). On the generated profile / leaderboard tables that live inside
   a fixed `min-width` .rate-table, nowrap made the text tenure/bank header
   (plus its appended ↑/↓ sort arrow) bleed past its cell's right edge and
   overflow the table boundary. Scope those static-table text headers back to
   normal wrapping so the label always stays inside its cell; numeric (.num)
   headers keep nowrap so short right-aligned labels don't wrap awkwardly. */
.rate-table.sortable thead th {
  white-space: normal;
}
.rate-table.sortable thead th.num {
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Sortable/profile table — mobile layout (iPhone 14 = 390 px logical px).

   The profile table has 5 columns: Tenure, General, Senior, Trend, Applies-to.
   All columns are reachable by horizontal scroll (`.table-wrap` already has
   `overflow-x: auto`). The problem is that the Tenure column monopolises the
   initial viewport because its labels are long prose like
   "Above 400 days and upto 2 Years (except 444 and 555 Days)" and are forced
   to one line by the global `.rate-table .bank-name { white-space: nowrap }`.

   Fix: give the Tenure column a fixed narrow width and clamp its label to
   2 lines with an ellipsis. The full label is in the `title` attribute on the
   <td> (accessible via long-press on mobile). Every other column stays nowrap
   so it takes only the width it needs. The table stays wide enough for all
   5 columns to be reachable by scrolling right.

   Scoped to `.rate-table.sortable:has(td:first-child .bank-name)` so it
   only fires on profile/leaderboard tables (Tenure in col 1), never on the
   main-page table (`.rate-table--main`) or the compare modal.
   -------------------------------------------------------------------------- */
@media (max-width: 430px) {
  .rate-table.sortable {
    /* Wide enough for all 5 columns; .table-wrap handles horizontal scroll. */
    min-width: 520px;
    table-layout: auto;
  }
  /* Tenure column: fixed width, clamp to 2 lines with ellipsis. */
  .rate-table.sortable:has(td:first-child .bank-name) th:first-child,
  .rate-table.sortable:has(td:first-child .bank-name) td:first-child {
    width: 110px;
    max-width: 110px;
  }
  /* Override the global nowrap on .bank-name; clamp to 2 lines. */
  .rate-table.sortable:has(td:first-child .bank-name) td:first-child .bank-name {
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 12px;
    line-height: 1.4;
    word-break: normal;
    overflow-wrap: break-word;
  }
  /* Tighter row padding on mobile — reduces row height significantly. */
  .rate-table.sortable th,
  .rate-table.sortable td {
    padding: 10px 12px;
  }
  .rate-table.sortable td.num,
  .rate-table.sortable th.num {
    white-space: nowrap;
  }
  /* Scheme subtitle (e.g. "bob Square Drive 444 days") — 1-line ellipsis. */
  .rate-table.sortable:has(td:first-child .bank-name) td:first-child .bank-short {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
  }
}

/* Tags */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  border: 1px solid var(--line);
}
.tag-official {
  background: var(--good-bg);
  border-color: var(--good-line);
  color: var(--good);
}
.tag-official::before {
  content: "✓";
  font-size: 10px;
}
/* Source column */
.rate-table .source-cell { white-space: nowrap; }

/* Compact health badge in main table bank cell */
.health-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
}
.hb-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}
.hb-good { background: #10b981; }
.hb-ok   { background: var(--warn-ink); }
.hb-warn { background: #ef4444; }
.hb-rating {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.03em;
}

/* Copy-rate button — always visible below bank name */
.copy-rate-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface-2, var(--surface));
  color: var(--muted);
  font-size: 11px;
  font-family: var(--font);
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.copy-rate-btn:hover {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--info-bg);
}
.copy-rate-btn--ok {
  color: #10b981 !important;
  border-color: #10b981 !important;
  background: #f0fdf4 !important;
}
.source-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.verified-line {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--good);
  font-weight: 600;
  white-space: nowrap;
}
.verified-check { font-size: 10px; }
.aggregator-label { font-size: 11px; font-style: italic; }

/* Applies to column — never wrap */
.rate-table--main td:nth-child(4) {
  white-space: nowrap;
  font-size: 12.5px;
}
.tag-aggregator {
  background: var(--info-bg);
  border-color: var(--info-line);
  color: var(--brand);
}
.tag-stale {
  background: var(--warn-bg);
  border-color: var(--warn-line);
  color: var(--warn-ink);
}
.tag-stale::before {
  content: "⚠";
  font-size: 10px;
}
.tag-under-verification {
  background: #fffbeb;
  border-color: #fcd34d;
  color: #92400e;
}
.tag-under-verification::before {
  content: "○";
  font-size: 9px;
}
@media (prefers-color-scheme: dark) {
  .tag-under-verification {
    background: #1c1500;
    border-color: #78500a;
    color: #fcd34d;
  }
}
.tag-category {
  margin-left: 0;
  background: var(--surface-2, var(--surface));
  border-color: var(--line);
  color: var(--muted);
}

/* Reveal-all button */
.reveal-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s var(--ease);
  font-family: var(--font);
}
.reveal-btn:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.reveal-wrap {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
/* CSV download button — muted secondary style */
.csv-btn {
  background: var(--surface);
  color: var(--muted);
  border-color: var(--line);
  box-shadow: none;
}
.csv-btn:hover {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--info-bg);
  box-shadow: none;
  transform: translateY(-1px);
}
.src-btn {
  text-decoration: none;
  background: var(--surface);
  color: var(--muted);
  border-color: var(--line);
  box-shadow: none;
}
.src-btn:hover {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--info-bg);
  box-shadow: none;
  transform: translateY(-1px);
}

.empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
}

/* Banner */
.banner {
  margin: 18px 0 0;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.banner-warn {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  color: var(--warn-ink);
}

/* Freshness (inline in nav) */
.freshness-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
}
.freshness-aging .freshness-dot {
  background: var(--gold);
}
.freshness-stale .freshness-dot {
  background: #ef4444;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: 72px;
  padding: 40px 0 60px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
}
.footer-grid {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.site-footer .muted {
  margin-top: 6px;
  max-width: 640px;
}
.legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 560px) {
  .controls .control {
    flex: 1 1 100%;
    min-width: 0;
  }
  
  /* On mobile, keep 2-column layout for controls-row */
  .controls-row {
    flex-wrap: wrap;
  }
  
  .controls-row .control {
    flex: 1 1 calc(50% - 6px);
    min-width: 0; /* Remove min-width constraint on mobile */
  }
  
  /* Amount control shares the row width */
  .controls-row .control-amount {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }
  
  /* Override the old mobile rules that made things full width */
  .controls .amount-row {
    width: auto;
    max-width: 100%;
  }
  .controls .control-select {
    width: auto;
    max-width: 100%;
  }
  
  .controls .control-pair {
    flex: 1 1 100%;
  }
  .control-pair .control {
    flex: 1 1 0;
    min-width: 0;
  }
}
@media (max-width: 900px) {
  .headline-card {
    grid-template-columns: 1fr;
  }
  .podium {
    grid-template-columns: 1fr;
  }
  .tenure-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 560px) {
  .tenure-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero {
    padding: 40px 0 24px;
  }
  .nav-pill.hide-sm {
    display: none;
  }
}

/* ==========================================================================
   Explore section (links to landing/profile pages)
   ========================================================================== */
.explore-products {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.explore-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.2s var(--ease),
    box-shadow 0.2s var(--ease),
    border-color 0.2s;
}
.explore-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
}
.explore-card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
}
.explore-card-sub {
  font-size: 13px;
  margin-top: 2px;
}
.explore-card-rate {
  margin-top: 12px;
  font-weight: 700;
  color: var(--brand);
  font-size: 14px;
}
@media (prefers-color-scheme: dark) {
  .explore-card-rate {
    color: var(--accent-2);
  }
}
.explore-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 24px 0 10px;
}
.chips a.chip {
  text-decoration: none;
}
.explore-banks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.explore-bank {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
  transition: all 0.15s var(--ease);
}
.explore-bank:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--bank) 55%, var(--line));
  transform: translateY(-1px);
}
.explore-bank-all {
  font-weight: 700;
  color: var(--brand);
  border-color: var(--info-line);
  background: var(--info-bg);
}
@media (prefers-color-scheme: dark) {
  .explore-bank-all {
    color: var(--accent-2);
  }
}
@media (max-width: 700px) {
  .explore-products {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Compare two banks
   ========================================================================== */
.compare-launch {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.compare-card {
  width: min(680px, 100%);
}
/* Compare table must fit the modal (no horizontal scroll hiding column 2). */
.compare-card .table-wrap {
  overflow-x: visible;
}
.compare-card .rate-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}
.compare-card .rate-table th.num,
.compare-card .rate-table td.num {
  width: 26%;
}
.compare-card .rate-table th:first-child,
.compare-card .rate-table td:first-child {
  width: 48%;
}
.cmp-pickers {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.cmp-select {
  min-width: 0;
  width: 100%;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  cursor: pointer;
}
.cmp-select:focus {
  border-color: var(--brand);
}
.cmp-vs {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--muted);
  font-size: 13px;
}
.cmp-prod {
  margin-bottom: 16px;
}
.cmp-win {
  position: relative;
}
.cmp-win::after {
  content: "★";
  font-size: 10px;
  margin-left: 5px;
  color: var(--gold);
  vertical-align: 2px;
}

/* Health section inside compare modal */
.cmp-health {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}
.cmp-health-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cmp-health-asof {
  font-size: 10px;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 1px 7px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
}
.health-sub-label {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
  text-transform: none;
  letter-spacing: 0;
}
.cmp-health-note {
  font-size: 11px;
  margin-top: 8px;
}
/* Maturity value line inside compare rate table cells */
.cmp-maturity {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.72;
  margin-top: 2px;
  font-family: var(--font);
  letter-spacing: 0;
}
.health-not-reported {
  font-size: 12.5px;
  font-style: italic;
  padding: 12px 0 4px;
}
.nr-cell {
  font-size: 11px;
  font-style: italic;
  text-align: center;
}

/* ==========================================================================
   Rate movements
   ========================================================================== */
.move-delta {
  font-weight: 800;
  font-family: var(--font-display);
  font-size: 14px;
  white-space: nowrap;
}
.move-up {
  color: #10b981;
}
.move-down {
  color: #ef4444;
}
.move-empty-emoji {
  font-size: 44px;
}

/* ==========================================================================
   Banks directory page
   ========================================================================== */
.dir-search-wrap {
  margin-bottom: 20px;
}
.dir-search {
  width: 100%;
  max-width: 460px;
  font-family: var(--font);
  font-size: 15px;
  padding: 13px 18px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
  box-shadow: var(--shadow-sm);
}
.dir-search:focus {
  border-color: var(--brand);
}
.dir-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.dir-card {
  position: relative;
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.2s var(--ease),
    box-shadow 0.2s var(--ease),
    border-color 0.2s;
  overflow: hidden;
}
.dir-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--bank, var(--brand));
}
.dir-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--bank) 45%, var(--line));
}
.dir-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dir-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}
.dir-meta {
  font-size: 12.5px;
  margin: 6px 0 12px;
}
.dir-rate {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.02em;
  color: var(--bank, var(--ink));
}
.dir-rate-label {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
}
.dir-category {
  margin: 0 0 12px;
}
.dir-tag {
  margin-top: 10px;
}

/* ==========================================================================
   Amount control (text input)
   ========================================================================== */
.amount-row {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  transition: border-color 0.2s;
  max-width: 260px;
  height: 32px;
}
.amount-row:focus-within {
  border-color: var(--brand);
}
.amount-prefix {
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  flex-shrink: 0;
}
.amount-input {
  border: 0;
  outline: none;
  background: transparent;
  font-family: var(--font);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  width: 100%;
  letter-spacing: 0;
  padding: 0;
  margin: 0;
  height: 100%;
  line-height: 1;
}
.control-select {
  /* Styled to match the segmented pill controls (.segment / .seg-btn): same
     pill radius, surface-2 fill, 1px hairline border, muted-ink label text and
     the soft shadow, so the filter row reads as one cohesive control set. */
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  background: var(--surface-2)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%233f4763' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>")
    no-repeat right 14px center;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  color: var(--ink-2);
  font-family: var(--font);
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 36px 9px 16px;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  height: 32px;
  line-height: 1;
}
.control-select:hover {
  background-color: var(--surface);
  color: var(--ink);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--line));
}
.control-select:focus-visible {
  outline: none;
  background-color: var(--surface);
  color: var(--ink);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent);
}
@media (prefers-color-scheme: dark) {
  /* Lighter chevron so it stays visible on the dark surface (matches the
     dark-mode --ink-2). */
  .control-select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%23b6c0da' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  }
}

/* Mobile: reduce padding for more compact dropdowns */
@media (max-width: 800px) {
  .control-select {
    padding: 8px 32px 8px 12px;
    font-size: 13px;
  }
  .amount-input {
    padding: 8px 12px;
    font-size: 13px;
  }
}

/* Very small screens (iPhone): extra compact */
@media (max-width: 480px) {
  .control-select {
    padding: 7px 28px 7px 10px;
    font-size: 12px;
  }
  .amount-input {
    padding: 7px 10px;
    font-size: 12px;
  }
}

/* Sector + Tenure share one wrapper so the two compact dropdowns sit on the
   same line and wrap together as a unit, using space more efficiently. */
.control-pair {
  display: flex;
  align-items: flex-end;
  gap: 12px 14px;
  flex-wrap: wrap;
}
.control-pair .control {
  flex: 1 1 auto;
}
.control-pair .control-select {
  width: 100%;
}

/* Clickable affordances */
.clickable,
.row-clickable {
  cursor: pointer;
}
.podium-card.clickable:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

/* ==========================================================================
   Modal (per-bank detail)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: color-mix(in srgb, #05070f 62%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn 0.2s var(--ease) both;
}
.modal-card {
  width: min(560px, 100%);
  max-height: 86vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 22px;
  animation: riseIn 0.28s var(--ease) both;
}
.modal-card::before {
  content: "";
  display: block;
  height: 4px;
  margin: -22px -22px 18px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--bank, var(--brand));
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.modal-bank {
  display: flex;
  align-items: center;
  gap: 12px;
}
.modal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.modal-sub {
  font-size: 13px;
  margin-top: 2px;
}
.modal-close {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  flex: none;
  transition: all 0.15s var(--ease);
}
.modal-close:hover {
  background: var(--surface-hover);
  color: var(--ink);
}
.modal-table {
  min-width: 0;
  table-layout: fixed;
  width: 100%;
}
.modal-table th:nth-child(1),
.modal-table td:nth-child(1) { width: 50%; }
.modal-table th:nth-child(2),
.modal-table td:nth-child(2) { width: 30%; }
.modal-table th:nth-child(3),
.modal-table td:nth-child(3) { width: 20%; }
/* Clamp tenure label to 2 lines then ellipsis */
.modal-table td:nth-child(1) .bank-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}
.modal-source {
  margin-top: 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.modal-link {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}
.modal-link:hover {
  text-decoration: underline;
}
.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.modal-share {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s var(--ease);
}
.modal-share:hover {
  background: color-mix(in srgb, var(--brand) 12%, var(--surface-2));
  color: var(--brand);
  border-color: var(--info-line);
}

/* ==========================================================================
   Search input and autocomplete
   ========================================================================== */
.nav-search-container {
  position: relative;
  margin-left: 12px;
  flex: 0 1 auto;
}
.nav-search-input {
  width: 200px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  transition: all 0.2s var(--ease);
}
.nav-search-input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent);
}
.nav-search-input::placeholder {
  color: var(--muted);
}

.nav-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.2s var(--ease);
  z-index: 100;
}
.nav-search-results.show {
  max-height: 400px;
  opacity: 1;
  overflow-y: auto;
}

.search-result-item {
  display: block;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line-2);
  text-decoration: none;
  color: var(--ink);
  transition: all 0.15s var(--ease);
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
}
.search-result-item:last-child {
  border-bottom: none;
}
.search-result-item:hover,
.search-result-item.selected {
  background: var(--surface-hover);
  color: var(--brand);
}
.search-result-name {
  font-weight: 600;
  font-size: 14px;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}
.search-result-category {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}
.search-no-results {
  padding: 16px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

/* Mobile responsive search */
@media (max-width: 900px) {
  .nav-search-input {
    width: 160px;
  }
}
@media (max-width: 720px) {
  .nav-search-container {
    margin-left: 8px;
    flex: 0 1 100%;
  }
  .nav-search-input {
    width: 100%;
    /* Set font-size to 16px to prevent iOS Safari from auto-zooming on focus.
       iOS zooms in when input font-size < 16px. This maintains readability
       without triggering unwanted zoom. */
    font-size: 16px;
  }
  .nav-search-results {
    position: fixed;
    top: auto;
    left: var(--search-left, 0);
    right: var(--search-right, 0);
    bottom: auto;
    width: 90vw;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
    /* Ensure content doesn't overflow on narrow phones */
    box-sizing: border-box;
  }
  .search-result-item {
    /* Prevent text overflow in search results on mobile */
    max-width: 100%;
  }
  .search-result-name {
    max-width: 100%;
  }
}

/* ==========================================================================
   Share button + toast
   ========================================================================== */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #fff;
  border: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: var(--shadow-brand);
  font-family: var(--font);
  font-weight: 600;
  font-size: 14px;
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  transition:
    transform 0.15s var(--ease),
    box-shadow 0.15s var(--ease);
}
.share-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 34px rgba(79, 70, 229, 0.42);
}
.share-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.share-btn.copied {
  background: linear-gradient(135deg, var(--good), var(--accent-2));
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.32);
}
.share-btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.share-label {
  display: inline;
}
@media (max-width: 560px) {
  .share-label {
    display: none;
  }
  .share-btn {
    padding: 10px 14px;
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 90vw;
  padding: 13px 18px;
  border-radius: var(--radius-pill);
  background: #0b1020;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition:
    opacity 0.28s var(--ease),
    transform 0.28s var(--ease);
  white-space: pre-line;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast-check {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--good);
  color: #fff;
  font-size: 12px;
  flex: none;
}

/* Sortable table headers */
th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.15s;
}
th.sortable:hover {
  color: var(--ink);
}
th.sort-active {
  color: var(--brand);
}
th.sortable:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
  border-radius: 6px;
}
