/* ==========================================================================
   NumberPilot — hand-authored stylesheet (replaces Tailwind)
   Token values are carried over verbatim from the old app/globals.css so the
   light/dark palettes are identical to the React build.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Radius scale — inputs 12, buttons 12, cards 16, panels 20 */
  --radius: 0.875rem; /* legacy base kept for derived rules */
  --radius-input: 12px;
  --radius-button: 12px;
  --radius-card: 16px;
  --radius-panel: 20px;
  --radius-pill: 9999px;

  /* Spacing rhythm — a deliberate scale, not everything at 24. Tight inside
     components (16), between related items (24), heading→content (32), and
     generous separation between sections (48 / 72). */
  --space-16: 1rem;
  --space-24: 1.5rem;
  --space-32: 2rem;
  --space-48: 3rem;
  --space-72: 4.5rem;

  /* Light theme — soft slate base + blue accent (#2563EB) */
  --background: 216 43% 98%; /* page #F7F9FC */
  --foreground: 222 47% 11%; /* #0F172A */

  --card: 0 0% 100%; /* surface #FFFFFF */
  --card-foreground: 222 47% 11%;

  --muted: 210 40% 96%; /* secondary surface #F1F5F9 */
  --muted-foreground: 215 19% 47%; /* #64748B */

  --subtle: 210 40% 97%;

  --border: 214 32% 91%; /* #E2E8F0 */
  --input: 214 32% 89%;
  --ring: 221 83% 53%;
  /* Barely-there card hairline — cards rely on shadow for depth, not borders. */
  --card-hairline: 222 20% 20% / 0.06;

  --accent: 221 83% 53%; /* primary #2563EB */
  --accent-hover: 224 71% 47%; /* #1D4ED8 */
  --accent-foreground: 0 0% 100%;
  --accent-muted: 221 83% 96%;

  --success: 142 71% 40%; /* #16A34A */
  --warning: 33 93% 44%; /* #D97706 */
  --danger: 0 72% 51%; /* #DC2626 */

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

  /* Soft, diffuse, low-contrast shadows */
  --shadow-soft: 0 1px 2px 0 rgb(15 23 42 / 0.04);
  --shadow-card: 0 1px 3px 0 rgb(15 23 42 / 0.04), 0 6px 16px -6px rgb(15 23 42 / 0.08);
  --shadow-lift: 0 2px 6px -2px rgb(15 23 42 / 0.06), 0 16px 32px -12px rgb(15 23 42 / 0.14);

  /* Motion — feedback only, 150–250ms */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 180ms var(--ease);

  /* Control sizing */
  --input-height: 3rem; /* 48px */
  --button-height: 3rem;
  --button-height-lg: 3.25rem; /* 52px primary CTA */

  --container: 1160px;
}

.dark {
  /* Deep navy / charcoal — never pure black */
  --background: 222 47% 8%; /* #0B1120 */
  --foreground: 210 40% 98%; /* #F8FAFC */

  --card: 222 41% 11%; /* surface #111827 */
  --card-foreground: 210 40% 98%;

  --muted: 220 33% 16%; /* elevated #172033 */
  --muted-foreground: 215 20% 65%; /* #94A3B8 */

  --subtle: 220 36% 13%;

  --border: 218 27% 21%; /* #263244 */
  --input: 218 24% 26%;
  --ring: 213 94% 68%;
  --card-hairline: 0 0% 100% / 0.06; /* rgba(255,255,255,.06) — near-invisible */

  --accent: 213 94% 68%; /* #60A5FA — vibrant on dark */
  --accent-hover: 213 94% 74%;
  --accent-foreground: 222 47% 11%; /* dark text for contrast on light-blue */
  --accent-muted: 216 50% 22%;

  --success: 142 69% 58%;
  --warning: 33 90% 58%;
  --danger: 0 84% 64%;

  --shadow-soft: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-card: 0 1px 3px 0 rgb(0 0 0 / 0.3), 0 6px 16px -6px rgb(0 0 0 / 0.4);
  --shadow-lift: 0 2px 6px -2px rgb(0 0 0 / 0.4), 0 16px 32px -12px rgb(0 0 0 / 0.55);
}

/* --------------------------------------------------------------------------
   2. Reset + base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  border-color: hsl(var(--border));
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100%;
  background-color: hsl(var(--background));
  /* Light theme: a colorful viewport-fixed wash echoing the hero gradient
     (violet / cyan / blue / rose) so the page feels vivid, not flat white.
     Fixed attachment means every section keeps its tint on scroll. Alphas are
     tuned to stay well under text — dark theme overrides this away below. */
  background-image: radial-gradient(48% 42% at 2% -4%, hsl(262 70% 62% / 0.16) 0%, transparent 58%),
    radial-gradient(46% 40% at 100% 0%, hsl(190 75% 55% / 0.15) 0%, transparent 58%),
    radial-gradient(42% 38% at 82% 40%, hsl(330 70% 62% / 0.1) 0%, transparent 56%),
    radial-gradient(40% 40% at 12% 66%, hsl(160 60% 50% / 0.09) 0%, transparent 56%),
    radial-gradient(68% 50% at 48% 110%, hsl(221 75% 60% / 0.15) 0%, transparent 64%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: hsl(var(--foreground));
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  font-feature-settings: "cv11", "ss01";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

/* Dark theme: the flat navy felt empty, so add a restrained aurora — a few
   soft radial lights fixed to the viewport for depth. Kept low-alpha and
   deliberately sparse so it reads as atmosphere, never a loud gradient. */
.dark body {
  background-image: radial-gradient(38% 30% at 8% -2%, hsl(262 66% 56% / 0.16) 0%, transparent 60%),
    radial-gradient(34% 30% at 94% 4%, hsl(199 78% 52% / 0.13) 0%, transparent 60%),
    radial-gradient(26% 24% at 76% 42%, hsl(330 62% 56% / 0.08) 0%, transparent 58%),
    radial-gradient(30% 26% at 16% 64%, hsl(160 55% 48% / 0.07) 0%, transparent 58%),
    radial-gradient(50% 40% at 48% 108%, hsl(221 76% 54% / 0.16) 0%, transparent 66%);
}

main {
  flex: 1 0 auto;
}

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

svg {
  width: 1em;
  height: 1em;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

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

button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
  padding: 0;
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
  letter-spacing: -0.021em;
  line-height: 1.15;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
  border-radius: 6px;
}

/* Keyboard focus on cards/buttons gets a soft ring halo, not a hard outline */
.calc-card:focus-visible,
.cat-card:focus-visible,
.related-item:focus-visible,
.btn:focus-visible,
.home-search-option:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring) / 0.6);
}

::selection {
  background: hsl(var(--accent) / 0.2);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */
.container-page {
  margin-inline: auto;
  width: 100%;
  max-width: var(--container);
  padding-inline: 1.25rem;
}

@media (min-width: 640px) {
  .container-page {
    padding-inline: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .container-page {
    padding-inline: 2rem;
  }
}

.page {
  padding-block: 2.5rem;
}

.section {
  padding-block: var(--space-48);
}

@media (min-width: 768px) {
  .section {
    padding-block: var(--space-72);
  }
}

.stack > * + * {
  margin-top: var(--space-24);
}

.grid {
  display: grid;
  gap: var(--space-24);
}

@media (min-width: 640px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* --------------------------------------------------------------------------
   4. Typography helpers
   -------------------------------------------------------------------------- */
.title-xl {
  font-size: 1.875rem;
  letter-spacing: -0.025em;
}

.title-lg {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.title-md {
  font-size: 1.25rem;
  font-weight: 600;
}

.title-sm {
  font-size: 1rem;
  font-weight: 600;
}

@media (min-width: 640px) {
  .title-xl {
    font-size: 2.5rem;
  }
  .title-lg {
    font-size: 2.25rem;
  }
}

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

.lead {
  font-size: 1.125rem;
  line-height: 1.65;
  color: hsl(var(--muted-foreground));
  max-width: 42rem;
}

.section-head p,
.why-head p {
  max-width: 46rem;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: hsl(var(--muted-foreground));
}

.small {
  font-size: 0.875rem;
}

.xs {
  font-size: 0.75rem;
}

.balance {
  text-wrap: balance;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.accent-text {
  color: hsl(var(--accent));
}

.tone-success {
  color: hsl(var(--success));
}
.tone-warning {
  color: hsl(var(--warning));
}
.tone-danger {
  color: hsl(var(--danger));
}
.tone-accent {
  color: hsl(var(--accent));
}

/* --------------------------------------------------------------------------
   5. Surfaces
   -------------------------------------------------------------------------- */
.card {
  border-radius: var(--radius-panel);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  box-shadow: var(--shadow-card);
}

.card-pad {
  padding: 1.375rem;
}

@media (min-width: 640px) {
  .card-pad {
    padding: 1.75rem;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 9999px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted));
  padding: 0.1875rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: hsl(var(--muted-foreground));
}

.icon-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: var(--radius-input);
  background-color: hsl(var(--accent-muted));
  color: hsl(var(--accent));
  height: 2.75rem;
  width: 2.75rem;
  font-size: 1.25rem;
}

.icon-tile-lg {
  height: 3.5rem;
  width: 3.5rem;
  border-radius: var(--radius-card);
  font-size: 1.75rem;
}

.icon-tile-sm {
  height: 2.25rem;
  width: 2.25rem;
  border-radius: 10px;
  font-size: 1rem;
}

/* Hue-tinted tiles: the card sets --tile-h (its category hue); saturation and
   lightness are fixed here so tints stay balanced. Each theme gets its own
   lightness for legible contrast. */
.calc-card .icon-tile,
.intent-card .icon-tile,
.why-card .icon-tile {
  background-color: hsl(var(--tile-h, 221) 85% 95%);
  color: hsl(var(--tile-h, 221) 70% 45%);
}

.dark .calc-card .icon-tile,
.dark .intent-card .icon-tile,
.dark .why-card .icon-tile {
  background-color: hsl(var(--tile-h, 221) 45% 20%);
  color: hsl(var(--tile-h, 221) 85% 72%);
}

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: var(--button-height-lg);
  padding-inline: 1.5rem;
  border-radius: var(--radius-button);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition),
    box-shadow var(--transition), transform var(--transition);
}

.btn:active {
  transform: translateY(1px);
}

.btn-accent {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  box-shadow: 0 1px 2px hsl(var(--accent) / 0.3), var(--shadow-soft);
}

.btn-accent:hover {
  background-color: hsl(var(--accent-hover));
  box-shadow: 0 4px 12px -2px hsl(var(--accent) / 0.35);
  transform: translateY(-1px);
}

.btn-accent:active {
  transform: translateY(0);
}

.btn-outline {
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  color: hsl(var(--foreground));
  box-shadow: var(--shadow-soft);
}

.btn-outline:hover {
  background-color: hsl(var(--muted));
  border-color: hsl(var(--border) / 0.7);
}

.btn-sm {
  height: 2.75rem;
  padding-inline: 1.25rem;
}

/* Small icon buttons used in the header */
.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  width: 2.5rem;
  border-radius: var(--radius-button);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card) / 0.6);
  color: hsl(var(--muted-foreground));
  font-size: 1.125rem;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}

.icon-btn:hover {
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border) / 0.7);
}

/* Toolbar buttons (copy / share / print / reset) */
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: calc(var(--radius) - 8px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--background));
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  transition: background-color 0.15s, color 0.15s;
}

.tool-btn:hover {
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
}

.tool-btn.is-done {
  color: hsl(var(--success));
}

.tool-btn svg {
  font-size: 0.875rem;
}

.link-accent {
  color: hsl(var(--accent));
  font-weight: 500;
}

.link-accent:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   7. Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid transparent;
  background-color: hsl(var(--background) / 0);
  transition: background-color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

/* Subtle blended background + hairline border once the page scrolls */
.site-header.is-scrolled {
  border-bottom-color: hsl(var(--border) / 0.7);
  background-color: hsl(var(--background) / 0.72);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 0 hsl(var(--border) / 0.3);
}

.header-bar {
  display: flex;
  height: 3.75rem;
  align-items: center;
  gap: 0.75rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
}

.logo-mark {
  height: 2rem;
  width: 2rem;
  /* The icon already has rounded corners; clip the source's white corners so it
     sits cleanly on both light and dark headers. */
  border-radius: 26%;
  object-fit: cover;
  box-shadow: var(--shadow-soft);
}

.logo-text {
  font-size: 1.125rem;
}

.header-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
  margin-left: 1rem;
}

@media (min-width: 1024px) {
  .header-nav {
    display: flex;
  }
}

.header-nav a {
  border-radius: calc(var(--radius) - 8px);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  transition: color 0.15s;
}

.header-nav a:hover {
  color: hsl(var(--foreground));
}

.header-nav a[aria-current="page"] {
  color: hsl(var(--accent));
}

/* "More" categories dropdown — keeps the top-level nav clean as the library
   grows. Overflow categories (incl. new ones) live here. */
.nav-more {
  position: relative;
}

.nav-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: calc(var(--radius) - 8px);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  font-family: inherit;
  transition: color 0.15s;
}

.nav-more-btn:hover,
.nav-more-btn[aria-expanded="true"] {
  color: hsl(var(--foreground));
}

.nav-more-btn.is-active {
  color: hsl(var(--accent));
}

.nav-more-btn svg {
  width: 0.9rem;
  height: 0.9rem;
  transition: transform 0.2s var(--ease);
}

.nav-more-btn[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.nav-more-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 60;
  min-width: 15rem;
  padding: 0.375rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--card-hairline));
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lift);
}

/* The `hidden` attribute (default + JS-toggled closed state) must win over the
   `display: flex` above, or the menu renders permanently open. */
.nav-more-panel[hidden] {
  display: none;
}

.nav-more-panel a {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.625rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  transition: background-color 0.15s, color 0.15s;
}

.nav-more-panel a:hover {
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
}

.nav-more-panel a[aria-current="page"] {
  color: hsl(var(--accent));
}

.nav-more-panel .icon-tile {
  flex-shrink: 0;
}

.nav-more-all {
  margin-top: 0.125rem;
  padding-top: 0.625rem;
  border-top: 1px solid hsl(var(--card-hairline));
  color: hsl(var(--accent)) !important;
}

.nav-more-all svg {
  width: 1rem;
  height: 1rem;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-trigger {
  display: none;
  align-items: center;
  gap: 0.5rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--background));
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  transition: background-color 0.15s;
}

.search-trigger:hover {
  background-color: hsl(var(--muted));
}

@media (min-width: 640px) {
  .search-trigger {
    display: flex;
  }
  .search-trigger-mobile {
    display: none;
  }
}

kbd {
  border-radius: 4px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--muted));
  padding: 0.125rem 0.375rem;
  font-size: 10px;
  font-family: inherit;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

.menu-btn {
  display: flex;
}

@media (min-width: 1024px) {
  .menu-btn {
    display: none;
  }
}

.mobile-menu {
  border-top: 1px solid hsl(var(--border));
  background-color: hsl(var(--background));
}

.mobile-menu[hidden] {
  display: none;
}

.mobile-menu nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.25rem;
  padding-block: 0.75rem;
}

.mobile-menu a {
  border-radius: calc(var(--radius) - 8px);
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.mobile-menu a:hover {
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
}

.mobile-menu a.all-link {
  grid-column: span 2;
  font-weight: 500;
  color: hsl(var(--foreground));
}

/* --------------------------------------------------------------------------
   8. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
}

/* Layered multi-hue aurora + hairline grid — soft washes, not loud gradients */
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(38% 52% at 16% -6%, hsl(262 83% 60% / 0.18) 0%, transparent 60%),
    radial-gradient(42% 54% at 84% -8%, hsl(190 90% 52% / 0.16) 0%, transparent 62%),
    radial-gradient(56% 62% at 50% -10%, hsl(221 83% 56% / 0.2) 0%, transparent 70%);
}

.hero-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(hsl(var(--foreground) / 0.028) 1px, transparent 1px),
    linear-gradient(90deg, hsl(var(--foreground) / 0.028) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(60% 60% at 50% 0%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(60% 60% at 50% 0%, #000 0%, transparent 75%);
}

/* Floating financial glyphs — a subtle, memorable hero motif. Frosted-glass
   chips (calculator, chart, coins, %) drift around the headline, weighted to
   the top-right. Desktop-only so they never crowd the text; decorative only. */
.hero-decor {
  display: none;
}

@media (min-width: 1080px) {
  .hero-decor {
    display: block;
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
  }

  .hero-chip {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 16px;
    background-color: hsl(var(--card) / 0.55);
    border: 1px solid hsl(var(--border) / 0.9);
    box-shadow: var(--shadow-card);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
    color: hsl(var(--chip-h, 221) 62% 52%);
    opacity: 0.72;
    animation: hero-float 7s var(--ease) infinite;
  }

  .dark .hero-chip {
    background-color: hsl(var(--card) / 0.4);
    color: hsl(var(--chip-h, 221) 72% 68%);
    opacity: 0.6;
  }

  .hero-chip svg {
    width: 1.5rem;
    height: 1.5rem;
  }

  /* Top-right cluster (the primary motif), plus two on the left for balance. */
  .hero-chip--1 { top: 7%; right: 6.5%; width: 3.75rem; height: 3.75rem; --r: -8deg; animation-duration: 6.5s; }
  .hero-chip--1 svg { width: 1.75rem; height: 1.75rem; }
  .hero-chip--2 { top: 30%; right: 3%; --r: 7deg; animation-duration: 8s; animation-delay: 0.8s; }
  .hero-chip--3 { top: 52%; right: 12%; width: 2.75rem; height: 2.75rem; --r: -6deg; animation-duration: 6s; animation-delay: 1.6s; }
  .hero-chip--3 svg { width: 1.25rem; height: 1.25rem; }
  .hero-chip--4 { top: 16%; left: 6%; width: 2.9rem; height: 2.9rem; --r: 8deg; animation-duration: 8.5s; animation-delay: 1.1s; }
  .hero-chip--5 { bottom: 20%; left: 10%; width: 2.6rem; height: 2.6rem; --r: -7deg; animation-duration: 7.5s; animation-delay: 2s; }
  .hero-chip--5 svg { width: 1.2rem; height: 1.2rem; }
  .hero-chip--6 { bottom: 24%; right: 16%; width: 2.6rem; height: 2.6rem; --r: 6deg; animation-duration: 7.2s; animation-delay: 0.4s; }
  .hero-chip--6 svg { width: 1.2rem; height: 1.2rem; }
}

@keyframes hero-float {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-11px) rotate(var(--r, 0deg)); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-chip {
    animation: none;
    transform: rotate(var(--r, 0deg));
  }
}

.hero-inner {
  position: relative;
  z-index: 1;
  margin-inline: auto;
  max-width: 46rem;
  text-align: center;
  padding-block: 4rem 3.5rem;
}

@media (min-width: 768px) {
  .hero-inner {
    padding-block: 6rem 5rem;
  }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card) / 0.7);
  backdrop-filter: blur(8px);
  padding: 0.375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  box-shadow: var(--shadow-soft);
}

.hero-eyebrow::before {
  content: "";
  height: 0.4rem;
  width: 0.4rem;
  border-radius: 9999px;
  background-color: hsl(var(--accent));
}

.hero-title {
  margin-top: 1.5rem;
  font-size: 2.375rem;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

/* Second line rendered as a blue→violet→cyan gradient for a splash of color. */
.hero-title-grad {
  background-image: linear-gradient(100deg, hsl(221 83% 54%) 0%, hsl(262 83% 62%) 52%, hsl(190 90% 46%) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dark .hero-title-grad {
  background-image: linear-gradient(100deg, hsl(213 94% 72%) 0%, hsl(262 92% 76%) 52%, hsl(190 95% 62%) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media (min-width: 640px) {
  .hero-title {
    font-size: 3.25rem;
  }
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 3.75rem;
  }
}

.hero-br {
  display: none;
}

@media (min-width: 640px) {
  .hero-br {
    display: inline;
  }
}

/* Supporting tagline beneath the headline (keeps the hero's vertical rhythm). */
.hero-tagline {
  margin-top: 0.75rem;
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: hsl(var(--foreground));
}

@media (min-width: 640px) {
  .hero-tagline {
    font-size: 1.375rem;
  }
}

.hero-sub {
  margin-inline: auto;
  margin-top: 1.25rem;
  max-width: 34rem;
  font-size: 1.0625rem;
}

@media (min-width: 640px) {
  .hero-sub {
    font-size: 1.1875rem;
  }
}

.hero-search {
  position: relative;
  margin-inline: auto;
  margin-top: 2.25rem;
  max-width: 36rem;
  text-align: left;
}

.home-search-box {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  border-radius: var(--radius-panel);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  padding: 0.25rem 1.25rem;
  box-shadow: var(--shadow-card);
  color: hsl(var(--muted-foreground));
  transition: border-color var(--transition), box-shadow var(--transition);
}

.home-search-box:hover {
  border-color: hsl(var(--border) / 0.6);
  box-shadow: var(--shadow-lift);
}

.home-search-box:focus-within {
  border-color: hsl(var(--accent));
  box-shadow: 0 0 0 4px hsl(var(--ring) / 0.16), var(--shadow-lift);
}

.home-search-box svg {
  font-size: 1.25rem;
  flex-shrink: 0;
  color: hsl(var(--muted-foreground));
}

.home-search-box input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  padding: 1rem 0;
  font-size: 1.0625rem;
  color: hsl(var(--foreground));
}

.home-search-box input::placeholder {
  color: hsl(var(--muted-foreground));
}

.home-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 0.5rem);
  z-index: 30;
  max-height: min(60vh, 26rem);
  overflow-y: auto;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  box-shadow: var(--shadow-lift);
  padding: 0.375rem;
}

.home-search-results[hidden] {
  display: none;
}

.home-search-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.625rem 0.75rem;
  border-radius: calc(var(--radius) - 4px);
  text-align: left;
  color: inherit;
  transition: background-color 0.12s;
}

.home-search-option:hover,
.home-search-option[aria-selected="true"] {
  background-color: hsl(var(--accent-muted));
}

.home-search-option .icon-tile-sm {
  height: 2.25rem;
  width: 2.25rem;
  background-color: hsl(var(--muted));
  font-size: 1rem;
}

.home-search-option .body {
  min-width: 0;
  flex: 1;
}

.home-search-option .name {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.home-search-option .name mark {
  background: transparent;
  color: hsl(var(--accent));
}

.home-search-option .meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
}

.home-search-option .cat {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: hsl(var(--muted-foreground));
}

.home-search-empty {
  padding: 1.25rem 0.75rem;
  text-align: center;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.home-search-empty a {
  color: hsl(var(--accent));
  font-weight: 500;
}

/* "View all N results" footer link in the search dropdown */
.home-search-viewall {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.375rem;
  padding: 0.75rem;
  border-top: 1px solid hsl(var(--border));
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--accent));
}

.home-search-viewall:hover {
  background-color: hsl(var(--accent-muted));
}

.home-search-viewall svg {
  font-size: 0.875rem;
}

/* Helpful no-results panel (shared by inline + ⌘K search) */
.search-noresults {
  padding: 1rem 0.875rem 1.125rem;
}

.nr-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.nr-sub {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
}

.nr-chips {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.nr-chip {
  border-radius: var(--radius-pill);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  padding: 0.3rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.nr-chip:hover {
  border-color: hsl(var(--accent) / 0.5);
  background-color: hsl(var(--accent-muted));
  color: hsl(var(--accent));
}

.nr-pops {
  margin-top: 0.5rem;
  display: grid;
  gap: 0.25rem;
}

.nr-pop {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem;
  border-radius: calc(var(--radius) - 6px);
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  transition: background-color 0.12s;
}

.nr-pop:hover {
  background-color: hsl(var(--muted));
}

.nr-pop svg {
  color: hsl(var(--accent));
  font-size: 1rem;
}

.hero-cta {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.hero-cta .btn {
  width: 100%;
}

@media (min-width: 640px) {
  .hero-cta {
    flex-direction: row;
  }
  .hero-cta .btn {
    width: auto;
  }
}

/* Example-search chips under the hero search — one tap into discovery. */
.hero-examples {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.hero-examples-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

.hero-example {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card) / 0.7);
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  transition: border-color 0.15s, background-color 0.15s, transform 0.15s;
}

.hero-example:hover {
  border-color: hsl(var(--accent) / 0.5);
  background-color: hsl(var(--accent-muted));
  transform: translateY(-1px);
}

.trust-list {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.625rem 1.5rem;
}

.trust-list li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
}

.trust-list svg {
  color: hsl(var(--success));
  font-size: 1rem;
}

.section-head {
  margin-bottom: var(--space-32);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-16);
}

.section-head p {
  margin-top: 0.625rem;
}

.view-all {
  display: none;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--accent));
  white-space: nowrap;
}

.view-all:hover {
  text-decoration: underline;
}

@media (min-width: 640px) {
  .view-all {
    display: inline-flex;
  }
}

/* --------------------------------------------------------------------------
   9. Cards: calculator + category
   -------------------------------------------------------------------------- */
.calc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-card);
  border: 1px solid hsl(var(--card-hairline));
  background-color: hsl(var(--card));
  box-shadow: var(--shadow-card);
  transition: transform 250ms var(--ease), border-color 250ms var(--ease), box-shadow 250ms var(--ease);
  will-change: transform;
}

/* Micro-interactions: on hover the whole card behaves like a live app tile —
   it lifts, its shadow deepens, the banner gradient brightens, the glass icon
   rotates, the button slides, and a sparkle twinkles. All on a 250ms curve. */
.calc-card:hover {
  transform: translateY(-6px);
  border-color: hsl(var(--tile-h, 221) 70% 72%);
  box-shadow: 0 6px 14px -6px hsl(var(--tile-h, 221) 40% 20% / 0.22), 0 26px 44px -16px hsl(var(--tile-h, 221) 45% 22% / 0.32);
}

/* Premium header per category: a deep, desaturated jewel-tone gradient with a
   fine top sheen and a hairline base shadow for real depth — restrained, not a
   bright color block. The icon sits in a frosted-glass tile (the Apple/iOS
   signature): translucent fill, inset top highlight, soft drop shadow. */
.calc-card-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 98px;
  overflow: hidden;
  background-image: linear-gradient(180deg, hsl(0 0% 100% / 0.1) 0%, transparent 42%),
    radial-gradient(130% 130% at 12% -8%, hsl(0 0% 100% / 0.16) 0%, transparent 46%),
    linear-gradient(142deg, hsl(var(--tile-h, 221) 42% 44%) 0%, hsl(calc(var(--tile-h, 221) + 20) 40% 34%) 100%);
  box-shadow: inset 0 -1px 0 hsl(0 0% 100% / 0.09);
}

/* Brighter, hue-shifted gradient that fades in on hover — the "gradient shift". */
.calc-card-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0;
  background-image: linear-gradient(142deg, hsl(var(--tile-h, 221) 58% 50%) 0%, hsl(calc(var(--tile-h, 221) + 30) 54% 40%) 100%);
  transition: opacity 250ms var(--ease);
}

.calc-card:hover .calc-card-banner::after {
  opacity: 0.9;
}

.calc-card-glyph {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 16px;
  background-color: hsl(0 0% 100% / 0.15);
  border: 1px solid hsl(0 0% 100% / 0.28);
  box-shadow: 0 10px 26px -10px hsl(var(--tile-h, 221) 50% 10% / 0.55), inset 0 1px 0 hsl(0 0% 100% / 0.4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: transform 250ms var(--ease), box-shadow 250ms var(--ease);
}

.calc-card-glyph svg {
  width: 1.75rem;
  height: 1.75rem;
  color: hsl(0 0% 100% / 0.98);
  transition: transform 250ms var(--ease);
}

/* Sparkle: a tiny 4-point star that twinkles in at the glass tile's corner. */
.calc-card-glyph::after {
  content: "";
  position: absolute;
  top: -7px;
  right: -7px;
  width: 15px;
  height: 15px;
  background-color: hsl(0 0% 100%);
  clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%);
  filter: drop-shadow(0 0 5px hsl(0 0% 100% / 0.9));
  opacity: 0;
  transform: scale(0) rotate(-90deg);
  transition: opacity 250ms var(--ease), transform 250ms var(--ease);
}

.calc-card:hover .calc-card-glyph {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -12px hsl(var(--tile-h, 221) 50% 10% / 0.6), inset 0 1px 0 hsl(0 0% 100% / 0.45);
}

.calc-card:hover .calc-card-glyph svg {
  transform: rotate(5deg);
}

.calc-card:hover .calc-card-glyph::after {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.calc-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1rem 1.5rem 1.25rem;
}

/* Frosted-glass category pill with its own icon — small, translucent, soft. */
.badge-on-banner {
  position: absolute;
  z-index: 2;
  top: 0.75rem;
  right: 0.75rem;
  gap: 0.3125rem;
  padding: 0.1875rem 0.5rem 0.1875rem 0.4375rem;
  font-size: 0.6875rem;
  border: 1px solid hsl(0 0% 100% / 0.28);
  background-color: hsl(0 0% 100% / 0.16);
  color: hsl(0 0% 100% / 0.96);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.badge-on-banner svg {
  width: 0.8125rem;
  height: 0.8125rem;
  opacity: 0.9;
}

.calc-card h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.calc-card p {
  margin-top: 0.375rem;
  flex: 1;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: hsl(var(--muted-foreground));
  /* Reserve two lines so cards stay the same height whether a description
     wraps to one line or two — keeps titles, descriptions, and the Calculate
     CTA aligned across every card and row. Clamp caps overly long taglines. */
  min-height: calc(0.9375rem * 1.55 * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.calc-card .open {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--accent));
  transition: transform 250ms var(--ease);
}

/* Button slides right, arrow slides a little further, on hover. */
.calc-card:hover .open {
  transform: translateX(4px);
}

.calc-card:hover .open svg {
  transform: translateX(3px);
}

.calc-card .open svg {
  transition: transform 250ms var(--ease);
  font-size: 1rem;
}

/* Honor reduced-motion: keep the color/shadow cues, drop the movement + sparkle. */
@media (prefers-reduced-motion: reduce) {
  .calc-card,
  .calc-card:hover,
  .calc-card:hover .calc-card-glyph,
  .calc-card:hover .calc-card-glyph svg,
  .calc-card:hover .open,
  .calc-card:hover .open svg,
  .cat-card:hover,
  .cat-card:hover .icon-tile,
  .cat-card:hover > svg:last-child,
  .intent-card:hover,
  .intent-card:hover .icon-tile,
  .intent-card:hover > svg:last-child {
    transform: none;
  }
  .calc-card:hover .calc-card-glyph::after {
    opacity: 0;
  }
}

.cat-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  border-radius: var(--radius-card);
  border: 1px solid hsl(var(--card-hairline));
  background-color: hsl(var(--card));
  padding: 1.375rem;
  box-shadow: var(--shadow-card);
  transition: transform 250ms var(--ease), border-color 250ms var(--ease), box-shadow 250ms var(--ease);
}

.cat-card > svg:last-child {
  margin-top: 0.75rem;
}

.cat-card-count {
  display: block;
  margin-top: 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground) / 0.85);
}

.cat-card:hover {
  transform: translateY(-5px);
  border-color: hsl(var(--cat-h, 221) 70% 72%);
  box-shadow: 0 5px 12px -6px hsl(var(--cat-h, 221) 40% 26% / 0.18), 0 20px 38px -14px hsl(var(--cat-h, 221) 45% 28% / 0.26);
}

/* Restrained per-category icon tints — backgrounds stay neutral */
.cat-card .icon-tile {
  height: 3rem;
  width: 3rem;
  background-color: hsl(var(--cat-h, 221) 85% 96%);
  color: hsl(var(--cat-h, 221) 68% 46%);
  transition: transform 250ms var(--ease);
}

.cat-card:hover .icon-tile {
  transform: translateY(-2px) rotate(-5deg);
}

.dark .cat-card .icon-tile {
  background-color: hsl(var(--cat-h, 221) 42% 20%);
  color: hsl(var(--cat-h, 221) 80% 72%);
}

.cat-card-body {
  min-width: 0;
  flex: 1;
}

.cat-card h3 {
  font-size: 0.9375rem;
  font-weight: 600;
}

.cat-card p {
  margin-top: 0.375rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: hsl(var(--muted-foreground));
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cat-card > svg:last-child {
  color: hsl(var(--muted-foreground));
  transition: transform 250ms var(--ease), color 250ms var(--ease);
}

.cat-card:hover > svg:last-child {
  transform: translateX(4px);
  color: hsl(var(--cat-h, 221) 60% 50%);
}

/* Problem-based discovery: "What are you trying to calculate?" */
.intent-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .intent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .intent-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.intent-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  border-radius: var(--radius-card);
  border: 1px solid hsl(var(--card-hairline));
  background-color: hsl(var(--card));
  padding: 1.25rem 1.375rem;
  box-shadow: var(--shadow-card);
  transition: transform 250ms var(--ease), border-color 250ms var(--ease), box-shadow 250ms var(--ease);
}

.intent-card:hover {
  transform: translateY(-5px);
  border-color: hsl(var(--tile-h, 221) 70% 72%);
  box-shadow: 0 5px 12px -6px hsl(var(--tile-h, 221) 40% 26% / 0.18), 0 20px 38px -14px hsl(var(--tile-h, 221) 45% 28% / 0.26);
}

.intent-card .icon-tile {
  height: 2.75rem;
  width: 2.75rem;
  transition: transform 250ms var(--ease);
}

.intent-card:hover .icon-tile {
  transform: translateY(-2px) rotate(-5deg);
}

/* Light theme: give each card a soft wash of its own category hue plus a
   matching tinted border, so the grids read colorful instead of plain white.
   Scoped to :root:not(.dark) so dark cards keep their solid navy surface. */
:root:not(.dark) .intent-card {
  background-image: linear-gradient(157deg, hsl(var(--tile-h, 221) 92% 96%) 0%, hsl(var(--tile-h, 221) 60% 99%) 55%, hsl(0 0% 100%) 100%);
  border-color: hsl(var(--card-hairline));
}

:root:not(.dark) .cat-card {
  background-image: linear-gradient(157deg, hsl(var(--cat-h, 221) 92% 96%) 0%, hsl(var(--cat-h, 221) 60% 99%) 55%, hsl(0 0% 100%) 100%);
  border-color: hsl(var(--card-hairline));
}

:root:not(.dark) .intent-card:hover {
  border-color: hsl(var(--tile-h, 221) 72% 76%);
}

:root:not(.dark) .cat-card:hover {
  border-color: hsl(var(--cat-h, 221) 72% 76%);
}

.intent-body {
  min-width: 0;
  flex: 1;
}

.intent-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.intent-blurb {
  display: block;
  margin-top: 0.1875rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: hsl(var(--muted-foreground));
}

.intent-card > svg:last-child {
  color: hsl(var(--muted-foreground));
  transition: transform 250ms var(--ease), color 250ms var(--ease);
}

.intent-card:hover > svg:last-child {
  transform: translateX(4px);
  color: hsl(var(--tile-h, 221) 60% 50%);
}

/* --------------------------------------------------------------------------
   10. Forms
   -------------------------------------------------------------------------- */
.field-label {
  margin-bottom: 0.375rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
}

.field-label .optional {
  font-size: 0.75rem;
  font-weight: 400;
  color: hsl(var(--muted-foreground));
}

.input {
  display: block;
  width: 100%;
  height: var(--input-height);
  border-radius: var(--radius-input);
  border: 1px solid hsl(var(--input));
  background-color: hsl(var(--card));
  padding: 0 0.9375rem;
  font-size: 0.9375rem;
  color: hsl(var(--foreground));
  box-shadow: var(--shadow-soft);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input::placeholder {
  color: hsl(var(--muted-foreground) / 0.65);
}

.input:hover {
  border-color: hsl(var(--muted-foreground) / 0.35);
}

.input:focus {
  border-color: hsl(var(--accent));
  outline: none;
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.16);
}

select.input {
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, hsl(var(--muted-foreground)) 50%),
    linear-gradient(135deg, hsl(var(--muted-foreground)) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% + 2px), calc(100% - 13px) calc(50% + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.25rem;
}

.input-wrap {
  position: relative;
}

.input-prefix,
.input-suffix {
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.input-prefix {
  left: 0.875rem;
}

.input-suffix {
  right: 0.875rem;
}

.has-prefix {
  padding-left: 1.75rem;
}

.has-suffix {
  padding-right: 2.25rem;
}

.field-help {
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.field-error {
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: hsl(var(--danger));
}

/* Segmented control + money/percent toggle */
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  border-radius: calc(var(--radius) - 4px);
  background-color: hsl(var(--muted));
  padding: 0.25rem;
}

.segmented button {
  flex: 1;
  white-space: nowrap;
  border-radius: calc(var(--radius) - 8px);
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  transition: background-color 0.15s, color 0.15s;
}

.segmented button:hover {
  color: hsl(var(--foreground));
}

.segmented button[aria-checked="true"],
.segmented button[aria-pressed="true"] {
  background-color: hsl(var(--card));
  color: hsl(var(--accent));
  box-shadow: var(--shadow-soft);
}

.money-percent {
  display: flex;
  gap: 0.5rem;
}

.money-percent .input-wrap {
  flex: 1;
}

.unit-toggle {
  display: flex;
  border-radius: calc(var(--radius) - 4px);
  background-color: hsl(var(--muted));
  padding: 0.25rem;
}

.unit-toggle button {
  border-radius: calc(var(--radius) - 8px);
  padding-inline: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  transition: background-color 0.15s, color 0.15s;
}

.unit-toggle button[aria-pressed="true"] {
  background-color: hsl(var(--card));
  color: hsl(var(--accent));
  box-shadow: var(--shadow-soft);
}

.quick-values {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.quick-values button {
  border-radius: calc(var(--radius) - 8px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--background));
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.quick-values button:hover {
  color: hsl(var(--foreground));
}

.quick-values button[aria-pressed="true"] {
  border-color: hsl(var(--accent));
  background-color: hsl(var(--accent-muted));
  color: hsl(var(--accent));
}

/* Info tooltip */
.tooltip-wrap {
  position: relative;
  display: inline-flex;
}

.tooltip-btn {
  color: hsl(var(--muted-foreground) / 0.7);
  font-size: 0.875rem;
  transition: color 0.15s;
}

.tooltip-btn:hover,
.tooltip-btn:focus-visible {
  color: hsl(var(--accent));
}

.tooltip-bubble {
  position: absolute;
  bottom: 100%;
  left: 50%;
  z-index: 30;
  margin-bottom: 0.5rem;
  width: 14rem;
  transform: translateX(-50%);
  border-radius: calc(var(--radius) - 8px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  padding: 0.625rem;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.6;
  color: hsl(var(--muted-foreground));
  box-shadow: var(--shadow-lift);
}

.tooltip-bubble[hidden] {
  display: none;
}

/* --------------------------------------------------------------------------
   11. Calculator layout
   -------------------------------------------------------------------------- */
.calc-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .calc-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .calc-inputs {
    grid-column: span 3;
  }
  .calc-results {
    grid-column: span 2;
  }
  .calc-results-inner {
    position: sticky;
    top: 5rem;
  }
}

.form-head {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-head h2 {
  font-size: 1rem;
  font-weight: 600;
}

/* Quick-start input presets */
.input-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.input-presets[hidden] {
  display: none;
}

.input-presets-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
}

.input-preset {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--background));
  padding: 0.375rem 0.8125rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.input-preset:hover {
  border-color: hsl(var(--accent) / 0.5);
  background-color: hsl(var(--accent-muted));
  color: hsl(var(--accent));
}

.input-preset[aria-pressed="true"] {
  border-color: hsl(var(--accent));
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.field-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .field-grid .span-2 {
    grid-column: span 2;
  }
  .field-grid > .advanced-options {
    grid-column: 1 / -1;
  }
}

/* Progressive disclosure: optional fields tucked under a disclosure so the
   essential form stays uncluttered. */
.advanced-options {
  border-top: 1px solid hsl(var(--card-hairline));
  padding-top: 0.5rem;
}

.advanced-options > summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  list-style: none;
  padding: 0.5rem 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  user-select: none;
}

.advanced-options > summary::-webkit-details-marker {
  display: none;
}

.advanced-options .adv-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.375rem;
  border-radius: var(--radius-pill);
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  font-size: 0.6875rem;
  font-weight: 600;
}

.advanced-options > summary svg:last-child {
  margin-left: auto;
  width: 1.1rem;
  height: 1.1rem;
  color: hsl(var(--muted-foreground));
  transition: transform 0.2s var(--ease);
}

.advanced-options[open] > summary svg:last-child {
  transform: rotate(180deg);
}

.advanced-fields {
  display: grid;
  gap: 1rem;
  margin-top: 0.75rem;
}

@media (min-width: 640px) {
  .advanced-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .advanced-fields .span-2 {
    grid-column: span 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .advanced-options > summary svg:last-child {
    transition: none;
  }
}

.primary-result {
  border-radius: var(--radius-panel);
  border: 1px solid hsl(var(--accent) / 0.28);
  background-image: linear-gradient(160deg, hsl(var(--accent-muted)), hsl(var(--card)) 70%);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: opacity var(--transition);
}

@media (min-width: 640px) {
  .primary-result {
    padding: 1.75rem;
  }
}

.primary-result .label {
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
}

.primary-result .value {
  margin-top: 0.375rem;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  color: hsl(var(--foreground));
  white-space: nowrap; /* JS scales the font down to fit when the value is long */
}

@media (min-width: 640px) {
  .primary-result .value {
    font-size: 3rem;
  }
}

.primary-result .hint {
  margin-top: 0.5rem;
  font-size: 0.9375rem;
  color: hsl(var(--muted-foreground));
}

.is-dimmed {
  opacity: 0.55;
}

.metric-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.metric {
  border-radius: var(--radius-input);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  padding: 0.875rem 1rem;
}

.metric.is-emphasis {
  border-color: hsl(var(--accent) / 0.3);
  background-color: hsl(var(--accent-muted) / 0.5);
}

.metric dt {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.metric dd {
  margin: 0.3rem 0 0;
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

/* Inline principal-vs-interest style split bar */
.result-breakdown {
  margin-top: 1rem;
}

.breakdown-bar {
  display: flex;
  height: 0.625rem;
  width: 100%;
  overflow: hidden;
  border-radius: 9999px;
  background-color: hsl(var(--muted));
}

.breakdown-seg {
  height: 100%;
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.breakdown-legend {
  margin-top: 0.625rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.breakdown-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
}

.breakdown-item i {
  height: 0.625rem;
  width: 0.625rem;
  border-radius: 9999px;
  flex-shrink: 0;
}

.breakdown-item strong {
  color: hsl(var(--foreground));
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.breakdown-item em {
  font-style: normal;
  color: hsl(var(--muted-foreground));
}

.note {
  margin-top: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--subtle) / 0.6);
  padding: 0.75rem;
  font-size: 0.75rem;
  line-height: 1.6;
  color: hsl(var(--muted-foreground));
}

.note svg {
  margin-top: 0.125rem;
  color: hsl(var(--accent));
  font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   12. Result table
   -------------------------------------------------------------------------- */
.table-scroll {
  margin-top: 1rem;
  overflow-x: auto;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.result-table th {
  border-bottom: 1px solid hsl(var(--border));
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: hsl(var(--muted-foreground));
  text-align: right;
}

.result-table th.align-left {
  text-align: left;
}

.result-table td {
  border-bottom: 1px solid hsl(var(--border) / 0.6);
  padding: 0.5rem 0.75rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: hsl(var(--muted-foreground));
}

.result-table td.align-left {
  text-align: left;
  font-weight: 500;
  color: hsl(var(--foreground));
}

.result-table tr:last-child td {
  border-bottom: 0;
}

.table-toggle {
  margin-top: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--accent));
}

.table-toggle:hover {
  text-decoration: underline;
}

.table-toggle svg {
  transition: transform 0.15s;
  font-size: 1rem;
}

.table-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* --------------------------------------------------------------------------
   13. Charts
   -------------------------------------------------------------------------- */
.chart-wrap {
  margin-top: 1rem;
  position: relative;
  width: 100%;
}

.chart-svg {
  width: 100%;
  height: 280px;
  overflow: visible;
  stroke: none;
}

.chart-svg text {
  font-size: 11px;
  fill: hsl(var(--muted-foreground));
  stroke: none;
}

.chart-grid-line {
  stroke: hsl(var(--border));
  stroke-dasharray: 3 3;
  stroke-width: 1;
}

.chart-axis {
  stroke: hsl(var(--border));
  stroke-width: 1;
}

.chart-legend {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.legend-dot {
  height: 0.5rem;
  width: 0.5rem;
  border-radius: 9999px;
}

.chart-tooltip {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  border-radius: calc(var(--radius) - 8px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  padding: 0.625rem;
  font-size: 0.75rem;
  box-shadow: var(--shadow-lift);
  white-space: nowrap;
  transform: translate(-50%, -115%);
}

.chart-tooltip[hidden] {
  display: none;
}

.chart-tooltip .row {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  color: hsl(var(--muted-foreground));
}

.chart-tooltip .row strong {
  color: hsl(var(--foreground));
  font-weight: 500;
}

.chart-tooltip .head {
  margin-bottom: 0.25rem;
  font-weight: 500;
  color: hsl(var(--foreground));
}

/* --------------------------------------------------------------------------
   14. Comparison
   -------------------------------------------------------------------------- */
.compare {
  overflow: hidden;
}

.compare-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
  text-align: left;
}

@media (min-width: 640px) {
  .compare-toggle {
    padding: 1.5rem;
  }
}

.compare-toggle .label-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.compare-toggle .icon-tile {
  height: 2.5rem;
  width: 2.5rem;
  font-size: 1.25rem;
}

.compare-toggle strong {
  display: block;
  font-size: 1rem;
  font-weight: 600;
}

.compare-toggle small {
  display: block;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.compare-toggle > svg {
  color: hsl(var(--muted-foreground));
  transition: transform 0.15s;
  font-size: 1.25rem;
}

.compare-toggle[aria-expanded="true"] > svg {
  transform: rotate(180deg);
}

.compare-body {
  border-top: 1px solid hsl(var(--border));
  padding: 1.25rem;
}

.compare-body[hidden] {
  display: none;
}

@media (min-width: 640px) {
  .compare-body {
    padding: 1.5rem;
  }
}

.scenario-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .scenario-grid[data-count="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .scenario-grid[data-count="3"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.scenario {
  border-radius: calc(var(--radius) + 8px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--subtle) / 0.4);
  padding: 1rem;
}

.scenario-head {
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scenario-name {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.scenario-letter {
  display: flex;
  height: 1.5rem;
  width: 1.5rem;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 8px);
  background-color: hsl(var(--accent));
  font-size: 0.75rem;
  color: hsl(var(--accent-foreground));
}

.scenario-actions {
  display: flex;
  gap: 0.25rem;
}

.scenario-actions button {
  border-radius: calc(var(--radius) - 8px);
  padding: 0.25rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
}

.scenario-actions button:hover {
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
}

.scenario-actions button.danger:hover {
  color: hsl(var(--danger));
}

.scenario-fields > label {
  display: block;
}

.scenario-fields > label + label {
  margin-top: 0.625rem;
}

.scenario-fields span {
  margin-bottom: 0.25rem;
  display: block;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.scenario-fields .input {
  height: 2.25rem;
  padding-block: 0.25rem;
}

.scenario-primary {
  margin-top: 1rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid hsl(var(--accent) / 0.2);
  background-color: hsl(var(--accent-muted) / 0.4);
  padding: 0.75rem;
}

.scenario-primary p:first-child {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.scenario-primary p:last-child {
  margin-top: 0.125rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.scenario-metrics {
  margin-top: 0.5rem;
}

.scenario-metrics > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.75rem;
}

.scenario-metrics > div + div {
  margin-top: 0.25rem;
}

.scenario-metrics dt {
  color: hsl(var(--muted-foreground));
}

.scenario-metrics dd {
  margin: 0;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.add-scenario {
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px dashed hsl(var(--border));
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  transition: border-color 0.15s, color 0.15s;
}

.add-scenario:hover {
  border-color: hsl(var(--accent) / 0.5);
  color: hsl(var(--accent));
}

/* Accent Compare button in the actions bar */
.tool-btn-accent {
  border-color: hsl(var(--accent) / 0.35);
  background-color: hsl(var(--accent-muted));
  color: hsl(var(--accent));
}

.tool-btn-accent:hover {
  background-color: hsl(var(--accent-muted));
  border-color: hsl(var(--accent) / 0.6);
  color: hsl(var(--accent));
}

/* One-tap preset chips */
.compare-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.compare-presets-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
}

.compare-preset {
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  padding: 0.4rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.compare-preset:hover {
  border-color: hsl(var(--accent) / 0.5);
  background-color: hsl(var(--accent-muted));
  color: hsl(var(--accent));
}

/* Side-by-side comparison table */
.compare-summary {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid hsl(var(--border));
}

/* "You save…" plain-language outcome */
.savings-summary {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  margin-top: 1rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(var(--success) / 0.3);
  background-color: hsl(var(--success) / 0.08);
  padding: 0.875rem 1rem;
}

.savings-summary svg {
  flex-shrink: 0;
  margin-top: 0.125rem;
  color: hsl(var(--success));
  font-size: 1.125rem;
}

.savings-summary p {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: hsl(var(--foreground));
}

.savings-summary strong {
  font-weight: 700;
}

.compare-table-wrap {
  margin-top: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid hsl(var(--border));
  border-radius: calc(var(--radius) - 2px);
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.compare-table th,
.compare-table td {
  padding: 0.625rem 0.875rem;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid hsl(var(--border) / 0.7);
}

.compare-table thead th {
  background-color: hsl(var(--subtle));
  font-weight: 600;
  color: hsl(var(--foreground));
  border-bottom: 1px solid hsl(var(--border));
}

.compare-table thead th .scenario-letter {
  margin-right: 0.375rem;
  height: 1.25rem;
  width: 1.25rem;
  font-size: 0.6875rem;
  vertical-align: middle;
}

/* First column: sticky row headers, left-aligned */
.compare-table th[scope="row"],
.compare-table thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  text-align: left;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  background-color: hsl(var(--card));
}

.compare-table thead th:first-child {
  background-color: hsl(var(--subtle));
}

.compare-table tbody tr:last-child th,
.compare-table tbody tr:last-child td {
  border-bottom: 0;
}

.compare-row-primary th,
.compare-row-primary td {
  background-color: hsl(var(--accent-muted) / 0.4);
  font-weight: 600;
  color: hsl(var(--foreground));
  font-size: 0.9375rem;
}

.compare-primary.is-best {
  color: hsl(var(--accent));
}

.best-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: 0.4rem;
  padding: 0.05rem 0.4rem;
  border-radius: 9999px;
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.best-tag svg {
  font-size: 0.75rem;
}

/* --------------------------------------------------------------------------
   14b. Guided journey — "next step" + sequence stepper
   -------------------------------------------------------------------------- */
.journey {
  margin-top: 1.5rem;
}

.journey-inner {
  display: grid;
  gap: 1rem;
}

@media (min-width: 820px) {
  .journey-inner {
    grid-template-columns: 1.15fr 1fr;
    align-items: stretch;
  }
}

.next-step-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid hsl(var(--accent) / 0.25);
  background-image: linear-gradient(135deg, hsl(var(--accent-muted)), hsl(var(--card)));
  padding: 1.25rem 1.375rem;
}

.next-step-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--accent));
}

.next-step-eyebrow svg {
  font-size: 0.875rem;
}

.next-step-text {
  font-size: 1.0625rem;
  line-height: 1.5;
  font-weight: 500;
  color: hsl(var(--foreground));
}

.next-step-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.25rem;
  border-radius: calc(var(--radius) - 4px);
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: filter 0.15s;
}

.next-step-cta:hover {
  filter: brightness(1.08);
}

.next-step-cta svg {
  transition: transform 0.15s;
}

.next-step-cta:hover svg {
  transform: translateX(2px);
}

.journey-steps {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  padding: 1.25rem 1.375rem;
}

.journey-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
}

.journey-track {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.journey-track li {
  display: flex;
}

.journey-track li a,
.journey-track li.is-current {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.5rem 0.5rem;
  border-radius: calc(var(--radius) - 6px);
  font-size: 0.9375rem;
  transition: background-color 0.12s, color 0.12s;
}

.journey-track li a {
  color: hsl(var(--muted-foreground));
}

.journey-track li a:hover {
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
}

.journey-track li.is-current {
  color: hsl(var(--foreground));
  font-weight: 600;
}

.journey-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  height: 1.5rem;
  width: 1.5rem;
  border-radius: 9999px;
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
  font-weight: 600;
}

.journey-track li.is-current .journey-num {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

/* --------------------------------------------------------------------------
   15. Search dialog
   -------------------------------------------------------------------------- */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background-color: hsl(var(--foreground) / 0.3);
  padding: 1rem;
  padding-top: 12vh;
  backdrop-filter: blur(4px);
}

.search-overlay[hidden] {
  display: none;
}

.search-panel {
  width: 100%;
  max-width: 36rem;
  overflow: hidden;
  border-radius: calc(var(--radius) + 8px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  box-shadow: var(--shadow-lift);
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid hsl(var(--border));
  padding-inline: 1rem;
  color: hsl(var(--muted-foreground));
}

.search-input-row input {
  height: 3.5rem;
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1rem;
  color: hsl(var(--foreground));
}

.search-input-row input::placeholder {
  color: hsl(var(--muted-foreground));
}

.search-results {
  max-height: 52vh;
  overflow-y: auto;
  padding: 0.5rem;
}

.search-group-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.75rem 0.5rem 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: hsl(var(--muted-foreground));
}

.recent-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  padding-inline: 0.5rem;
}

.recent-terms button {
  border-radius: calc(var(--radius) - 8px);
  background-color: hsl(var(--muted));
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.recent-terms button:hover {
  color: hsl(var(--foreground));
}

.search-option {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.75rem;
  border-radius: calc(var(--radius) - 4px);
  padding: 0.625rem;
  text-align: left;
  transition: background-color 0.15s;
}

.search-option:hover {
  background-color: hsl(var(--muted));
}

li[aria-selected="true"] .search-option {
  background-color: hsl(var(--accent-muted));
}

.search-option .icon-tile-sm {
  height: 2rem;
  width: 2rem;
  background-color: hsl(var(--muted));
  font-size: 1rem;
}

.search-option .body {
  min-width: 0;
  flex: 1;
}

.search-option .name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 500;
}

.search-option .tagline {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.search-option mark {
  background: transparent;
  color: hsl(var(--accent));
}

.search-empty {
  padding: 1.5rem 0.75rem;
  text-align: center;
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

/* --------------------------------------------------------------------------
   16. Explorer (all-calculators page)
   -------------------------------------------------------------------------- */
.explorer-search {
  position: relative;
}

.explorer-search svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: hsl(var(--muted-foreground));
  font-size: 1rem;
}

.explorer-search .input {
  height: 3rem;
  padding-left: 2.75rem;
  font-size: 1rem;
}

.filter-chips {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-chips button {
  border-radius: calc(var(--radius) - 8px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--background));
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.filter-chips button:hover {
  color: hsl(var(--foreground));
}

.filter-chips button[aria-selected="true"] {
  border-color: hsl(var(--accent));
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

/* --------------------------------------------------------------------------
   17. Breadcrumbs, FAQ, ads, prose sections
   -------------------------------------------------------------------------- */
.breadcrumbs {
  font-size: 0.875rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  color: hsl(var(--muted-foreground));
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.breadcrumbs svg {
  opacity: 0.5;
  font-size: 0.875rem;
}

.breadcrumbs a:hover {
  color: hsl(var(--accent));
}

.breadcrumbs [aria-current="page"] {
  font-weight: 500;
  color: hsl(var(--foreground));
}

.faq-list {
  margin-top: 1.25rem;
  border-radius: calc(var(--radius) + 8px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
}

.faq-list details {
  padding-inline: 1.25rem;
}

.faq-list details + details {
  border-top: 1px solid hsl(var(--border));
}

.faq-list summary {
  display: flex;
  cursor: pointer;
  list-style: none;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list summary svg {
  color: hsl(var(--muted-foreground));
  transition: transform 0.15s;
  font-size: 1rem;
}

.faq-list details[open] summary svg {
  transform: rotate(45deg);
}

.faq-list p {
  padding-bottom: 1rem;
  font-size: 0.875rem;
  line-height: 1.7;
  color: hsl(var(--muted-foreground));
}

.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: calc(var(--radius) - 4px);
  border: 1px dashed hsl(var(--border) / 0.7);
  background-color: hsl(var(--subtle) / 0.5);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground) / 0.5);
}

.ad-leaderboard {
  height: 90px;
}
.ad-in-article {
  height: 120px;
}
.ad-sidebar {
  height: 250px;
}

.prose-section h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.prose-section h2 svg {
  color: hsl(var(--accent));
  font-size: 1.25rem;
}

.prose-section p {
  margin-top: 0.75rem;
  line-height: 1.7;
  color: hsl(var(--muted-foreground));
}

.boxed {
  border-radius: calc(var(--radius) + 8px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  padding: 1.25rem;
}

.boxed-subtle {
  background-color: hsl(var(--subtle) / 0.5);
}

@media (min-width: 640px) {
  .boxed {
    padding: 1.5rem;
  }
}

.disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border-radius: calc(var(--radius) + 8px);
  border: 1px solid hsl(var(--warning) / 0.3);
  background-color: hsl(var(--warning) / 0.05);
  padding: 1rem;
}

.disclaimer svg {
  margin-top: 0.125rem;
  color: hsl(var(--warning));
  font-size: 1.25rem;
}

.disclaimer p {
  font-size: 0.875rem;
  line-height: 1.7;
  color: hsl(var(--muted-foreground));
}

/* Calculator page header + sidebar */
.calc-page-head {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 640px) {
  .calc-page-head {
    flex-direction: row;
    align-items: flex-start;
    gap: 1.25rem;
  }
}

.calc-page-head h1 {
  margin-top: 0.5rem;
  font-size: 1.875rem;
}

@media (min-width: 640px) {
  .calc-page-head h1 {
    font-size: 2.25rem;
  }
}

.calc-page-head p {
  margin-top: 0.5rem;
  max-width: 42rem;
  line-height: 1.7;
  color: hsl(var(--muted-foreground));
}

.content-grid {
  margin-top: 3rem;
  display: grid;
  gap: 2rem;
}

/* Grid items must be allowed to shrink below their content's min-content
   width, or a long formula/word forces the whole column past the viewport. */
.content-grid > * {
  min-width: 0;
}

@media (min-width: 1024px) {
  .content-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .content-main {
    grid-column: span 2;
  }
}

.content-main > * + * {
  margin-top: 2rem;
}

/* Long formulas / tokens wrap instead of overflowing */
.prose-section p,
.legal-section p,
.legal-section li {
  overflow-wrap: break-word;
}

.sidebar > * + * {
  margin-top: 1.5rem;
}

.related-list {
  margin-top: 1rem;
}

.related-list > * + * {
  margin-top: 0.75rem;
}

.related-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  padding: 0.875rem;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.related-item:hover {
  border-color: hsl(var(--accent) / 0.4);
  box-shadow: var(--shadow-lift);
}

.related-item .body {
  min-width: 0;
  flex: 1;
}

.related-item .name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  font-weight: 500;
}

.related-item .tagline {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.related-item > svg:last-child {
  color: hsl(var(--muted-foreground));
  transition: transform 0.15s;
}

.related-item:hover > svg:last-child {
  transform: translateX(2px);
}

.pill-links {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill-links a {
  border-radius: calc(var(--radius) - 8px);
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  transition: border-color 0.15s, color 0.15s;
}

.pill-links a:hover {
  border-color: hsl(var(--accent) / 0.4);
  color: hsl(var(--accent));
}

/* --------------------------------------------------------------------------
   17b. Long-form content pages (about, contact, privacy, terms)
   -------------------------------------------------------------------------- */
.legal {
  margin-top: 1.5rem;
  max-width: 46rem;
}

.legal-head h1 {
  font-size: 1.875rem;
}

@media (min-width: 640px) {
  .legal-head h1 {
    font-size: 2.25rem;
  }
}

.legal-updated {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
}

.legal-head .lead {
  margin-top: 1rem;
}

.legal-section {
  margin-top: 2.5rem;
}

.legal-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  scroll-margin-top: 5rem;
}

.legal-section p,
.legal-section li {
  color: hsl(var(--muted-foreground));
  line-height: 1.75;
}

.legal-section p {
  margin-top: 0.875rem;
}

.legal-section ul {
  margin-top: 0.875rem;
  padding-left: 1.125rem;
  list-style: disc;
}

.legal-section li {
  margin-top: 0.5rem;
  padding-left: 0.25rem;
}

.legal-section li::marker {
  color: hsl(var(--accent));
}

.legal-section strong {
  color: hsl(var(--foreground));
  font-weight: 600;
}

.legal-section a {
  color: hsl(var(--accent));
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-section a:hover {
  text-decoration-thickness: 2px;
}

.contact-email {
  font-size: 1.125rem;
  font-weight: 600;
}

.contact-email a {
  color: hsl(var(--accent));
}

/* --------------------------------------------------------------------------
   18. Why-us grid + 404
   -------------------------------------------------------------------------- */
.why-head {
  margin-inline: auto;
  max-width: 42rem;
  text-align: center;
}

.why-head p {
  margin-top: 0.75rem;
  color: hsl(var(--muted-foreground));
}

.why-grid {
  margin-top: 2.5rem;
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .why-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .why-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.why-card {
  border-radius: calc(var(--radius) + 8px);
  border: 1px solid hsl(var(--card-hairline));
  background-color: hsl(var(--card));
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

/* Four distinct hues for the feature cards + a light-mode wash to match. */
.why-card:nth-child(1) { --tile-h: 221; } /* blue */
.why-card:nth-child(2) { --tile-h: 33; }  /* amber */
.why-card:nth-child(3) { --tile-h: 262; } /* violet */
.why-card:nth-child(4) { --tile-h: 160; } /* emerald */

:root:not(.dark) .why-card {
  background-image: linear-gradient(157deg, hsl(var(--tile-h, 221) 92% 96%) 0%, hsl(var(--tile-h, 221) 60% 99%) 55%, hsl(0 0% 100%) 100%);
  border-color: hsl(var(--tile-h, 221) 52% 89%);
}

.why-card h3 {
  margin-top: 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.why-card p {
  margin-top: 0.375rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: hsl(var(--muted-foreground));
}

.error-page {
  display: flex;
  min-height: 60vh;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-block: 4rem;
  text-align: center;
}

.error-page h1 {
  margin-top: 1.5rem;
  font-size: 1.875rem;
}

.error-page p {
  margin-top: 0.75rem;
  max-width: 28rem;
  color: hsl(var(--muted-foreground));
}

.error-actions {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .error-actions {
    flex-direction: row;
  }
}

/* --------------------------------------------------------------------------
   19. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  margin-top: 5rem;
  border-top: 1px solid hsl(var(--border));
  background-color: hsl(var(--subtle) / 0.4);
}

.footer-grid {
  display: grid;
  gap: 2.5rem;
  padding-block: 3rem;
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr));
  }
}

.footer-about p {
  margin-top: 0.75rem;
  max-width: 20rem;
  font-size: 0.875rem;
  line-height: 1.7;
  color: hsl(var(--muted-foreground));
}

.footer-badge {
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: calc(var(--radius) - 8px);
  background-color: hsl(var(--accent-muted));
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(var(--accent));
}

.site-footer h2 {
  font-size: 0.875rem;
  font-weight: 600;
}

.site-footer nav ul {
  margin-top: 0.75rem;
}

.site-footer nav li + li {
  margin-top: 0.5rem;
}

.site-footer nav a {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  transition: color 0.15s;
}

.site-footer nav a:hover {
  color: hsl(var(--accent));
}

.footer-legal {
  border-top: 1px solid hsl(var(--border));
  padding-block: 1.5rem 3rem;
}

.footer-legal p {
  font-size: 0.75rem;
  line-height: 1.7;
  color: hsl(var(--muted-foreground));
}

.footer-legal p + p {
  margin-top: 0.75rem;
}

/* --------------------------------------------------------------------------
   20. Mobile + touch
   -------------------------------------------------------------------------- */

/* iOS Safari zooms the page whenever a focused input's text is under 16px.
   Every calculator field is a text/number input, so bump them on small
   screens — desktop keeps the tighter 14px. */
@media (max-width: 640px) {
  .input,
  .scenario-fields .input,
  select.input {
    font-size: 16px;
  }

  .scenario-fields .input {
    height: 2.75rem;
  }

  /* Give the amortization table a chance to fit before it scrolls. */
  .result-table th,
  .result-table td {
    padding-inline: 0.5rem;
    font-size: 0.8125rem;
  }

  /* Icon-only actions so Copy/Share/Print/Reset stay on one row instead of
     pushing the first input below the fold. Labels live in aria-label. */
  .tool-btn span {
    display: none;
  }

  .tool-btn {
    min-width: 2.75rem;
    justify-content: center;
    padding-inline: 0.75rem;
  }

  .tool-btn svg {
    font-size: 1.125rem;
  }
}

/* Comfortable hit areas on phones (WCAG 2.5.8 asks for 24px minimum; 44px is
   the platform convention). Keyed on width as well as pointer type — plenty of
   touch devices report a fine pointer, and a narrow window is touch-shaped
   either way. */
@media (max-width: 640px), (pointer: coarse) {
  .tool-btn,
  .quick-values button,
  .filter-chips button,
  .table-toggle,
  .segmented button,
  .unit-toggle button {
    min-height: 2.75rem;
  }

  .quick-values button,
  .filter-chips button {
    padding-inline: 0.875rem;
  }

  .scenario-actions button {
    min-height: 2.25rem;
    min-width: 2.25rem;
  }

  /* The info "?" glyph stays 14px, but its tappable box grows around it. */
  .tooltip-btn {
    position: relative;
    padding: 0.75rem;
    margin: -0.75rem;
  }

  .breadcrumbs li a,
  .site-footer nav a {
    padding-block: 0.25rem;
  }
}

/* Tapping shouldn't flash a grey box over cards and buttons. */
button,
a {
  -webkit-tap-highlight-color: transparent;
}

/* Horizontally scrollable regions get momentum scrolling on iOS. */
.table-scroll {
  -webkit-overflow-scrolling: touch;
}

/**
 * Sticky result bar — on phones the primary figure sits below a tall form, so
 * it is invisible while you type. This mirrors it at the bottom of the screen
 * while the form is on screen and the real panel is not.
 */
.mobile-result {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid hsl(var(--border));
  background-color: hsl(var(--card) / 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 -4px 20px -6px rgb(0 0 0 / 0.15);
  padding: 0.75rem 1.25rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  transform: translateY(110%);
  transition: transform 0.2s ease;
}

.mobile-result[hidden] {
  display: none;
}

.mobile-result.is-visible {
  transform: translateY(0);
}

.mobile-result .label {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-result .value {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.mobile-result button {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: calc(var(--radius) - 4px);
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
}

@media (min-width: 1024px) {
  .mobile-result {
    display: none;
  }
}

@media print {
  .mobile-result {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   21. Motion + print
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .no-print,
  .site-header,
  .site-footer,
  .ad-slot {
    display: none !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .card,
  .calc-card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}
