/* ==========================================================================
   CalcLedger Design System — Refined Light Financial Editorial Aesthetic
   Zero dependencies · Pure Vanilla CSS · Mobile-first & Zero-CLS
   ========================================================================== */

:root {
  --bg-canvas: #f8f7f4;
  --bg-surface: #ffffff;
  --bg-subtle: #f2f0ea;
  --bg-tint: #ecf5f1;
  --bg-tint-strong: #d9ede5;
  --bg-loss: #fdf1ef;

  --ink-primary: #13202c;
  --ink-secondary: #4a5a6a;
  --ink-muted: #6b7a88;

  --accent: #0f5c48;
  --accent-hover: #0a4636;
  --accent-ring: rgba(15, 92, 72, 0.18);

  --seg-emerald: #0f5c48;
  --seg-navy: #1e4e79;
  --seg-amber: #c2781f;
  --seg-terra: #b84a39;
  --seg-slate: #748494;

  --border: #e4e0d7;
  --border-strong: #cfc9bc;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(19, 32, 44, 0.05);
  --shadow-md: 0 6px 20px rgba(19, 32, 44, 0.06);
  --shadow-lg: 0 14px 36px rgba(19, 32, 44, 0.12);

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --container-max: 1120px;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink-primary);
  background: var(--bg-canvas);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 1000;
  font-weight: 600;
}

.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
  border-radius: var(--radius-sm);
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.125rem;
}

.page-narrow {
  max-width: 820px;
}

.site-main {
  flex: 1 0 auto;
  padding-bottom: 3.5rem;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

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

.brand:hover {
  text-decoration: none;
}

.brand__mark {
  display: inline-flex;
  line-height: 0;
}

.site-nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
}

.site-nav__link {
  color: var(--ink-secondary);
  font-size: 0.86rem;
  font-weight: 500;
  padding: 0.42rem 0.58rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.site-nav__link:hover {
  color: var(--ink-primary);
  background: var(--bg-subtle);
  text-decoration: none;
}

.site-nav__link.is-active {
  color: var(--accent);
  background: var(--bg-tint);
  font-weight: 600;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.finder-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--ink-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.finder-trigger:hover {
  border-color: var(--accent);
  background: var(--bg-tint);
  color: var(--accent);
}

.finder-trigger:active {
  transform: scale(0.95);
}

.lang-switch {
  display: inline-flex;
  background: var(--bg-subtle);
  padding: 2px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.lang-switch__item {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-secondary);
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-switch__item:hover {
  color: var(--ink-primary);
  text-decoration: none;
}

.lang-switch__item.is-active {
  background: var(--bg-surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.menu-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  cursor: pointer;
}

.menu-toggle__bar {
  width: 17px;
  height: 1.8px;
  background: var(--ink-primary);
  border-radius: 2px;
}

.mobile-drawer {
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  padding: 0.75rem 0 1rem;
  box-shadow: var(--shadow-md);
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.mobile-nav .site-nav__link {
  padding: 0.65rem 0.75rem;
  font-size: 0.95rem;
}

@media (min-width: 960px) {
  .site-nav {
    display: flex;
  }
  .menu-toggle,
  .mobile-drawer {
    display: none !important;
  }
}

/* ==========================================================================
   Breadcrumbs & Page Headers
   ========================================================================== */

.breadcrumbs {
  margin-top: 1rem;
  margin-bottom: 0.45rem;
}

.breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.81rem;
  color: var(--ink-muted);
}

.breadcrumbs__item + .breadcrumbs__item::before {
  content: '/';
  margin-right: 0.35rem;
  color: var(--border-strong);
}

.breadcrumbs__item a {
  color: var(--ink-secondary);
}

.page-head {
  padding: 0.25rem 0 1.25rem;
  max-width: 780px;
}

.page-head__meta {
  margin-bottom: 0.45rem;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 0.01em;
}

.status-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.page-head h1,
.hero__title {
  margin: 0;
  font-size: clamp(1.55rem, 3.1vw, 2.35rem);
  line-height: 1.16;
  letter-spacing: -0.028em;
  color: var(--ink-primary);
}

.page-head__sub,
.hero__subtitle {
  margin: 0.55rem 0 0;
  font-size: 0.98rem;
  color: var(--ink-secondary);
  line-height: 1.56;
}

/* Home Hero */
.hero {
  background: linear-gradient(180deg, #ffffff 0%, var(--bg-canvas) 100%);
  border-bottom: 1px solid var(--border);
  padding: 2.25rem 0 2rem;
}

.hero__inner {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.hero__eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-shortcuts,
.quick-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  margin-top: 1.1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.hero-shortcuts::-webkit-scrollbar,
.quick-strip::-webkit-scrollbar {
  display: none;
}

.quick-strip {
  margin-top: 0.85rem;
}

@media (min-width: 640px) {
  .hero-shortcuts,
  .quick-strip {
    flex-wrap: wrap;
    overflow-x: visible;
  }
}

.quick-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  min-height: 34px;
  padding: 0.32rem 0.72rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.quick-link:hover {
  border-color: var(--accent);
  background: var(--bg-tint);
  color: var(--accent);
  text-decoration: none;
}

.quick-link:active {
  transform: scale(0.97);
}

.quick-link.is-current {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ==========================================================================
   Calculator Workspace Shell
   ========================================================================== */

.calc-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  box-shadow: var(--shadow-md);
  max-width: 100%;
}

.calc-shell > * {
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 840px) {
  .calc-shell {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 2rem;
    padding: 1.75rem;
    align-items: start;
  }

  .calc-results {
    position: sticky;
    top: 82px;
  }
}

.calc-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  min-width: 0;
  max-width: 100%;
}

.calc-results {
  display: flex;
  flex-direction: column;
  gap: 1.05rem;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  min-width: 0;
  max-width: 100%;
}

/* Currency & Segmented Controls */
.currency-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.currency-bar__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-secondary);
}

.seg-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  max-width: 100%;
}

.seg-group--full {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
}

.seg-btn {
  border: 0;
  background: transparent;
  color: var(--ink-secondary);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.48rem 0.62rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  min-height: 36px;
}

.seg-btn:hover {
  color: var(--ink-primary);
}

.seg-btn:active {
  transform: scale(0.98);
}

.seg-btn.is-active {
  background: var(--bg-surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

/* Inputs */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  max-width: 100%;
}

.field-group-title {
  margin-top: 0.35rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.875rem;
  min-width: 0;
}

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

.field__label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink-primary);
}

.input {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.78rem;
  font-size: 1rem;
  color: var(--ink-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.input:hover {
  border-color: #b7b0a2;
}

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

/* Remove distracting native number spin arrows */
input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.textarea {
  font-family: var(--font-sans);
  min-height: 120px;
  resize: vertical;
}

.field--checkbox {
  padding-top: 0.2rem;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink-primary);
  cursor: pointer;
}

.check-row input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.2rem;
}

.pill-btn {
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  font-family: var(--font-mono);
  font-size: 0.77rem;
  font-weight: 600;
  padding: 0.3rem 0.62rem;
  border-radius: 999px;
  cursor: pointer;
  min-height: 32px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.pill-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-surface);
}

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

.pill-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Custom Minimalist Financial Range Slider */
.range-input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  margin: 0.15rem 0 0;
  background: transparent;
  cursor: pointer;
}

.range-input:focus {
  outline: none;
}

.range-input::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: var(--border);
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -7.5px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2.2px solid var(--accent);
  box-shadow: 0 1px 4px rgba(19, 32, 44, 0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.range-input:hover::-webkit-slider-thumb,
.range-input:focus-visible::-webkit-slider-thumb {
  transform: scale(1.1);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.range-input::-moz-range-track {
  height: 5px;
  border-radius: 999px;
  background: var(--border);
}

.range-input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2.2px solid var(--accent);
  box-shadow: 0 1px 4px rgba(19, 32, 44, 0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.badge-best {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.12rem 0.48rem;
  border-radius: 999px;
  background: var(--bg-tint-strong);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  vertical-align: middle;
  white-space: nowrap;
}

.is-negative {
  color: var(--seg-terra);
}

/* Results Panel */
.result-hero {
  background: var(--bg-tint);
  border: 1px solid var(--bg-tint-strong);
  border-radius: var(--radius-md);
  padding: 0.95rem 1.05rem;
  min-width: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.result-hero.is-loss,
.result-hero--alt.is-loss {
  background: var(--bg-loss);
  border-color: #f2ccc6;
}

.result-hero.is-loss .result-hero__value,
.result-hero--alt.is-loss .result-hero__value {
  color: var(--seg-terra);
}

.result-hero--alt {
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.result-hero-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.7rem;
}

@media (min-width: 480px) {
  .result-hero-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.result-hero__label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-secondary);
  margin-bottom: 0.25rem;
}

.result-hero__value {
  display: block;
  font-size: clamp(1.38rem, 3.2vw, 1.9rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1.15;
  word-break: break-word;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.kpi {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.72rem 0.78rem;
  min-width: 0;
  overflow-wrap: break-word;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.is-copyable {
  cursor: pointer;
}

.is-copyable:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.is-copyable:active {
  transform: scale(0.985);
}

.kpi--wide {
  grid-column: 1 / -1;
}

.kpi__label {
  display: block;
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin-bottom: 0.2rem;
}

.kpi__value {
  display: block;
  font-size: clamp(0.88rem, 3.6vw, 1rem);
  font-weight: 600;
  color: var(--ink-primary);
  word-break: break-word;
}

/* Breakdown Bars */
.split-bar-block {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.split-bar-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-secondary);
}

.split-bar {
  display: flex;
  width: 100%;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--border);
}

.split-bar__seg {
  height: 100%;
  transition: width 0.22s ease;
}

.seg-emerald { background: var(--seg-emerald); }
.seg-navy { background: var(--seg-navy); }
.seg-amber { background: var(--seg-amber); }
.seg-terra { background: var(--seg-terra); }
.seg-slate { background: var(--seg-slate); }

.split-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.78rem;
  color: var(--ink-secondary);
}

.split-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

/* Buttons */
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 42px;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  text-decoration: none;
}

.btn:hover {
  text-decoration: none;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-hover);
}

.btn--secondary {
  background: var(--bg-surface);
  color: var(--ink-primary);
  border-color: var(--border-strong);
}

.btn--secondary:hover {
  background: var(--bg-subtle);
}

.btn--ghost {
  background: transparent;
  color: var(--ink-secondary);
}

.btn--ghost:hover {
  background: var(--bg-subtle);
  color: var(--ink-primary);
}

/* ==========================================================================
   Content Sections, Cards, Tables & SVG Chart
   ========================================================================== */

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

.section-head {
  margin-bottom: 1.125rem;
}

.section-heading {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--ink-primary);
}

.section-heading--sm {
  font-size: 1.12rem;
  margin-bottom: 0;
}

.section-sub {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 0.95rem;
}

.prose {
  color: var(--ink-secondary);
  max-width: 74ch;
  margin: 0 0 1rem;
}

.bullet-list {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--ink-secondary);
  max-width: 74ch;
}

.bullet-list li {
  margin-bottom: 0.45rem;
}

.formula-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.formula-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  overflow-x: auto;
}

.formula-box code {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--ink-primary);
}

/* Tool & Programmatic SEO Grids */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.tool-grid--4 {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.tool-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  color: inherit;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.tool-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}

.tool-card__tag {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  background: var(--bg-tint);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.7rem;
}

.tool-card__title {
  margin: 0 0 0.4rem;
  font-size: 1.08rem;
  color: var(--ink-primary);
}

.tool-card__desc {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-secondary);
  flex: 1;
}

.tool-card__cta {
  margin-top: 0.9rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--accent);
}

.chip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

@media (min-width: 560px) {
  .chip-grid {
    grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
    gap: 0.75rem;
  }
}

.mp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 0.75rem;
}

.chip-card {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.8rem 0.9rem;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.chip-card:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.chip-card:active {
  transform: scale(0.985);
}

.chip-card.is-current {
  border-color: var(--accent);
  background: var(--bg-tint);
}

.chip-card__code {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--accent);
}

.chip-card__name {
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--ink-primary);
}

.chip-card__meta {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-secondary);
}

.chip-card__desc {
  font-size: 0.82rem;
  color: var(--ink-secondary);
  line-height: 1.45;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.feature-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.feature-item__num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
}

.feature-item h3 {
  margin: 0.35rem 0 0.45rem;
  font-size: 1.02rem;
}

.feature-item p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-secondary);
}

/* Tables */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th,
.data-table td {
  padding: 0.72rem 0.88rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th.num,
.data-table td.num {
  text-align: right;
  white-space: nowrap;
}

.data-table td:first-child.num,
.data-table th:first-child {
  text-align: left;
}

.data-table thead th {
  background: var(--bg-subtle);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-secondary);
  white-space: nowrap;
}

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

.clickable-row {
  cursor: pointer;
  transition: background 0.12s ease;
}

.clickable-row:hover,
.clickable-row:focus-visible {
  background: var(--bg-tint);
}

.clickable-row.is-selected {
  background: var(--bg-tint-strong);
}

.meta-note {
  margin-top: 0.75rem;
  font-size: 0.86rem;
  color: var(--ink-secondary);
}

/* SVG Chart Card */
.chart-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}

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

.svg-chart-wrap {
  width: 100%;
  overflow-x: auto;
}

.svg-chart {
  width: 100%;
  height: auto;
  min-width: 320px;
  display: block;
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.faq-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.1rem 1.125rem;
}

.faq-item__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0;
  font-weight: 600;
  font-size: 0.96rem;
  cursor: pointer;
  list-style: none;
}

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

.faq-item__icon {
  position: relative;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.faq-item__icon::before,
.faq-item__icon::after {
  content: '';
  position: absolute;
  top: 7px;
  left: 0;
  width: 16px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: transform 0.15s ease;
}

.faq-item__icon::after {
  transform: rotate(90deg);
}

.faq-item[open] .faq-item__icon::after {
  transform: rotate(0deg);
}

.faq-item__a {
  padding-bottom: 1rem;
  color: var(--ink-secondary);
  font-size: 0.92rem;
}

.faq-item__a p {
  margin: 0;
}

/* Legal & Contact Pages */
.legal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.legal-block + .legal-block {
  margin-top: 1.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--border);
}

.legal-block h2,
.legal-card h2 {
  margin: 0 0 0.65rem;
  font-size: 1.18rem;
}

.legal-actions {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

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

@media (min-width: 720px) {
  .contact-grid {
    grid-template-columns: 0.85fr 1.15fr;
    align-items: start;
  }
}

.contact-email {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1rem 0;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Empty / 404 */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
}

.empty-state__code {
  font-family: var(--font-mono);
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0;
}

.empty-state__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.625rem;
  margin-top: 1.5rem;
}

/* ==========================================================================
   Zero-CLS AdSense Slots
   ========================================================================== */

.ad-slot {
  margin: 1.5rem auto;
  text-align: center;
  background: var(--bg-subtle);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  overflow: hidden;
}

.ad-slot--banner {
  min-height: 100px;
}

.ad-slot--rect {
  min-height: 250px;
}

.ad-slot--inactive {
  display: none;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.ad-slot__label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  margin-bottom: 0.35rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 2.75rem 0 2rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 2rem 1.5rem;
}

.footer-brand {
  grid-column: 1 / -1;
}

@media (min-width: 960px) {
  .footer-brand {
    grid-column: span 2;
  }
  .footer-grid {
    grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr;
  }
}

.footer-brand__desc {
  margin: 0.75rem 0 0.5rem;
  font-size: 0.88rem;
  color: var(--ink-secondary);
  max-width: 34ch;
}

.footer-brand__meta {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.footer-col__title {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
}

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  font-size: 0.88rem;
}

.footer-col a {
  color: var(--ink-secondary);
}

.footer-col a:hover {
  color: var(--accent);
}

.footer-link-btn {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--ink-secondary);
  cursor: pointer;
  text-align: left;
}

.footer-link-btn:hover {
  color: var(--accent);
  text-decoration: underline;
}

.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.footer-disclaimer {
  margin: 0 0 0.4rem;
}

.footer-copy {
  margin: 0;
}

/* ==========================================================================
   Cookie Consent Banner (Consent Mode v2) & Toast
   ========================================================================== */

.consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  padding: 1.1rem 0;
}

.consent-banner__inner {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.consent-banner__title {
  margin: 0 0 0.3rem;
  font-size: 1rem;
}

.consent-banner__text {
  margin: 0;
  font-size: 0.86rem;
  color: var(--ink-secondary);
}

.consent-banner__panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.consent-option {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
}

.consent-option p {
  margin: 0.2rem 0 0;
  color: var(--ink-secondary);
}

.consent-option input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  margin-top: 2px;
  flex-shrink: 0;
}

.consent-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn:active {
  transform: scale(0.985);
}

/* Quick Finder Modal (Cmd/Ctrl+K) */
.finder-backdrop {
  position: fixed;
  inset: 0;
  z-index: 400;
  background: rgba(19, 32, 44, 0.36);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(1rem, 9vh, 5.5rem) 1rem 1rem;
}

.finder-backdrop[hidden] {
  display: none;
}

.finder-dialog {
  width: 100%;
  max-width: 540px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.finder-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--ink-muted);
}

.finder-input {
  flex: 1;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 0.98rem;
  color: var(--ink-primary);
  outline: none;
  min-width: 0;
}

.finder-input::placeholder {
  color: var(--ink-muted);
}

.finder-close {
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.22rem 0.45rem;
  border-radius: 5px;
  cursor: pointer;
}

.finder-close:hover {
  color: var(--ink-primary);
  border-color: var(--border-strong);
}

.finder-list {
  max-height: min(56vh, 380px);
  overflow-y: auto;
  padding: 0.4rem;
}

.finder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--ink-primary);
  text-decoration: none;
  font-size: 0.92rem;
  transition: background 0.1s ease;
}

.finder-item:hover,
.finder-item.is-active {
  background: var(--bg-tint);
  color: var(--accent);
  text-decoration: none;
}

.finder-item__title {
  font-weight: 600;
}

.finder-item__cat {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--ink-muted);
  white-space: nowrap;
}

.finder-item.is-active .finder-item__cat {
  color: var(--accent);
}

.finder-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--ink-muted);
}

/* Mobile Sticky Live Result Dock */
.mobile-result-dock {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  z-index: 180;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  width: calc(100% - 1.5rem);
  max-width: 440px;
  padding: 0.65rem 0.95rem;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid var(--bg-tint-strong);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(19, 32, 44, 0.14);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease;
}

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

.mobile-result-dock:active {
  transform: translateX(-50%) scale(0.985);
}

.mobile-result-dock.is-loss {
  border-color: #f2ccc6;
  background: rgba(253, 241, 239, 0.97);
}

.mobile-result-dock__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mobile-result-dock__label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-result-dock__value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.mobile-result-dock.is-loss .mobile-result-dock__value {
  color: var(--seg-terra);
}

.mobile-result-dock__cta {
  flex-shrink: 0;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--bg-tint);
  padding: 0.32rem 0.68rem;
  border-radius: 999px;
  white-space: nowrap;
}

.mobile-result-dock.is-loss .mobile-result-dock__cta {
  color: var(--seg-terra);
  background: rgba(184, 74, 57, 0.1);
}

@media (min-width: 840px) {
  .mobile-result-dock {
    display: none !important;
  }
}

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 450;
  background: var(--ink-primary);
  color: #fff;
  padding: 0.65rem 1.05rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
  max-width: calc(100vw - 2rem);
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Discreet ? Field Hints & Floating Popover */
.hint-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  margin-left: 0.32rem;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: middle;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.hint-btn:hover,
.hint-btn[aria-expanded='true'] {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-tint);
}

.hint-popover {
  position: fixed;
  z-index: 460;
  width: max-content;
  max-width: min(275px, calc(100vw - 24px));
  padding: 0.65rem 0.8rem;
  background: var(--ink-primary);
  color: #f8f7f4;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  line-height: 1.45;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
}

.hint-popover[hidden] {
  display: none;
}

/* 1-on-1 Platform Comparison Calculator */
.vs-fee-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.85rem;
}

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

.vs-fee-col {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem;
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 0;
}

.vs-fee-col__title {
  font-size: 0.84rem;
  color: var(--ink-primary);
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

.vs-winner-sub {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: var(--ink-secondary);
}

.vs-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
}

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

.vs-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.95rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.vs-card.is-winner {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-ring);
}

.vs-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

.vs-metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--ink-secondary);
}

.vs-metric strong {
  color: var(--ink-primary);
  font-size: 0.88rem;
  text-align: right;
}

.vs-metric--em {
  margin-top: 0.2rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border);
  font-weight: 600;
  color: var(--ink-primary);
}

.vs-metric--em strong {
  color: var(--accent);
  font-size: 0.96rem;
}

.vs-card__link {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
}
