/* Reset and base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  color: #1a1a1a;
  background: #fafafa;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 0.5rem 1rem;
  background: #1a1a1a;
  color: #fff;
  z-index: 1000;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.page-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 2rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .page-layout {
    flex-direction: row;
  }

  main {
    flex: 1;
    min-width: 0;
  }

  .sidebar {
    width: 300px;
    flex-shrink: 0;
  }
}

/* Site search bar (injected by main.js above .site-header) */
.site-search-bar {
  background: #f8f9fb;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.5rem 0;
}
.site-search {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}
.site-search__input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  border: 1px solid #d0d4da;
  border-radius: 6px;
  background: #fff;
  box-sizing: border-box;
}
.site-search__input:focus {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
  border-color: #2563eb;
}
.site-search__results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #d0d4da;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  list-style: none;
  margin: 0;
  padding: 0.25rem;
  max-height: 60vh;
  overflow-y: auto;
  z-index: 50;
}
.site-search__results li {
  margin: 0;
  border-radius: 4px;
}
.site-search__results li a {
  display: block;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  color: #1a1a1a;
  line-height: 1.3;
}
.site-search__results li a strong {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
}
.site-search__results li a:hover,
.site-search__results li.is-highlighted a {
  background: #eef2ff;
}
.site-search__cat {
  display: inline-block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
  margin-top: 0.1rem;
}
.site-search__summary {
  display: block;
  font-size: 0.8rem;
  color: #4b5563;
  margin-top: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-search__empty {
  padding: 0.75rem;
  color: #6b7280;
  font-size: 0.9rem;
}
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 1rem 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1a1a;
  text-decoration: none;
}

.site-header nav a {
  color: #444;
  text-decoration: none;
  font-size: 0.9rem;
}

.site-header nav a:hover {
  color: #1a1a1a;
}

/* Primary nav with dropdowns */
.primary-nav__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin: 0;
  padding: 0;
  align-items: center;
}
.primary-nav__item { position: relative; }
.primary-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #444;
  text-decoration: none;
  font-size: 0.95rem;
  padding: 0.35rem 0.1rem;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}
.primary-nav__link:hover,
.primary-nav__link:focus { color: #1a1a1a; }
.primary-nav__caret { font-size: 0.75rem; color: #888; }

.primary-nav__submenu {
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 20rem;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  display: none;
  z-index: 50;
}
.primary-nav__item--has-menu:hover > .primary-nav__submenu,
.primary-nav__item--has-menu:focus-within > .primary-nav__submenu,
.primary-nav__link[aria-expanded="true"] + .primary-nav__submenu {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.primary-nav__submenu li { margin: 0; }
.primary-nav__submenu a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: #333;
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: 4px;
  white-space: nowrap;
}
.primary-nav__submenu a:hover,
.primary-nav__submenu a:focus {
  background: #f4f6fa;
  color: #1a1a1a;
}
.primary-nav__submenu-sep {
  grid-column: 1 / -1;
  border-top: 1px solid #eef0f3;
  margin-top: 0.25rem;
  padding-top: 0.25rem;
}

/* Hamburger toggle button: hidden by default, shown on narrow viewports.
   Injected by main.js so per-page HTML doesn't need to change. */
.site-header__nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid #d4d8e0;
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  margin-left: auto;
}
.site-header__nav-toggle:focus-visible {
  outline: 2px solid #4f46e5;
  outline-offset: 2px;
}
.site-header__nav-toggle-bars {
  display: inline-block;
  width: 22px;
  height: 16px;
  position: relative;
}
.site-header__nav-toggle-bars span {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #1a1a1a;
  border-radius: 2px;
  transition: transform 0.18s ease, opacity 0.18s ease, top 0.18s ease;
}
.site-header__nav-toggle-bars span:nth-child(1) { top: 2px; }
.site-header__nav-toggle-bars span:nth-child(2) { top: 7px; }
.site-header__nav-toggle-bars span:nth-child(3) { top: 12px; }
.site-header__nav-toggle[aria-expanded="true"] .site-header__nav-toggle-bars span:nth-child(1) {
  top: 7px;
  transform: rotate(45deg);
}
.site-header__nav-toggle[aria-expanded="true"] .site-header__nav-toggle-bars span:nth-child(2) {
  opacity: 0;
}
.site-header__nav-toggle[aria-expanded="true"] .site-header__nav-toggle-bars span:nth-child(3) {
  top: 7px;
  transform: rotate(-45deg);
}

@media (max-width: 720px) {
  .site-header__nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .site-header .container {
    flex-wrap: nowrap;
  }
  /* Collapse nav by default on mobile; expand when header has data-nav-open. */
  .site-header .primary-nav {
    display: none;
    flex-basis: 100%;
    width: 100%;
    order: 3;
  }
  .site-header[data-nav-open] .primary-nav {
    display: block;
  }
  .site-header[data-nav-open] .container {
    flex-wrap: wrap;
  }
  .primary-nav__list {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding-top: 0.5rem;
  }
  .primary-nav__item { width: 100%; }
  .primary-nav__link {
    width: 100%;
    padding: 0.6rem 0.25rem;
    font-size: 1rem;
  }
  .primary-nav__submenu {
    position: static;
    display: block;
    box-shadow: none;
    border: 0;
    padding: 0 0 0 0.75rem;
    min-width: 0;
  }
  /* keep shown submenu as single column on small screens */
  .primary-nav__item--has-menu:hover > .primary-nav__submenu,
  .primary-nav__item--has-menu:focus-within > .primary-nav__submenu,
  .primary-nav__link[aria-expanded="true"] + .primary-nav__submenu {
    display: block;
  }
  .primary-nav__submenu-sep { grid-column: auto; }
  .primary-nav__submenu a {
    white-space: normal;
    padding: 0.55rem 0.75rem;
    font-size: 0.95rem;
  }
}

/* Category hub + all-calculators listing */
.hub-intro { margin-bottom: 2rem; }

.category-grid {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 1rem;
}
.category-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.category-card h2,
.category-card h3 {
  font-size: 1.1rem;
  margin: 0;
}
.category-card a {
  color: #1d4ed8;
  text-decoration: none;
}
.category-card a:hover { text-decoration: underline; }
.category-card p {
  font-size: 0.9rem;
  color: #555;
  margin: 0;
  line-height: 1.45;
}
.category-card__count {
  font-size: 0.8rem;
  color: #888;
  margin-top: auto;
}
.category-card--empty {
  background: #fafafa;
  border-style: dashed;
  color: #888;
}
.category-card--empty h2,
.category-card--empty h3 { color: #666; }

.category-section { margin-bottom: 2rem; }
.category-section h2 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}
.category-section__tagline {
  color: #666;
  font-size: 0.95rem;
  margin: 0 0 0.75rem;
}

/* Main content */
h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: #1a1a1a;
}

.intro {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 2rem;
}

/* Calculator card */
.calculator-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.calculator-card h2 {
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

.calculator-card p {
  color: #555;
  margin-bottom: 1rem;
}

.calculator-inputs {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.calculator-inputs label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
}

.calculator-inputs input,
.calculator-inputs select {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  width: 120px;
}

.calculator-inputs input:focus,
.calculator-inputs select:focus {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
  border-color: #2563eb;
}

button[data-calculate],
button[type="submit"] {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 0.6rem 1.5rem;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
}

button[data-calculate]:hover,
button[type="submit"]:hover {
  background: #1d4ed8;
}

.calculator-results {
  background: #f0f7ff;
  border-radius: 4px;
  padding: 1rem;
  margin-top: 1rem;
}

.result-display {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a1a;
}

/* CTA block */
.cta-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  margin: 2rem 0;
}

.cta-block h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.cta-block p {
  color: #555;
  margin-bottom: 1rem;
}

.cta-link {
  display: inline-block;
  background: #16a34a;
  color: #fff;
  padding: 0.6rem 1.5rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
}

.cta-link:hover {
  background: #15803d;
}

/* Ad slots */
.ad-slot {
  min-height: 1px;
  text-align: center;
  margin: 1rem 0;
}

/* Footer */
.site-footer {
  background: #1a1a1a;
  color: #aaa;
  padding: 2rem 0 1.5rem;
  font-size: 0.85rem;
  margin-top: 2rem;
}

.site-footer .site-disclaimer {
  text-align: left;
  max-width: 60rem;
  margin: 0 auto 1.5rem;
}

.site-footer .site-disclaimer h2 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  color: #ddd;
}

.site-footer .site-disclaimer p {
  margin: 0 0 0.75rem;
  line-height: 1.55;
}

.site-footer-nav {
  border-top: 1px solid #2a2a2a;
  padding-top: 1rem;
  margin-bottom: 1rem;
}

.site-footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  justify-content: center;
}

.site-footer-nav a {
  color: #ccc;
  text-decoration: none;
}

.site-footer-nav a:hover,
.site-footer-nav a:focus {
  color: #fff;
  text-decoration: underline;
}

.site-footer-nav__cookie-link {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: #ccc;
  cursor: pointer;
}

.site-footer-nav__cookie-link:hover,
.site-footer-nav__cookie-link:focus {
  color: #fff;
  text-decoration: underline;
}

.site-copyright {
  text-align: center;
  margin: 0;
  color: #888;
}

/* Cookie consent banner */
.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 1000;
  background: #1a1a1a;
  color: #f5f5f5;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 44rem;
  margin-inline: auto;
}
.cookie-banner[hidden] { display: none; }

.cookie-banner__inner {
  padding: 1.25rem 1.5rem;
}

.cookie-banner__heading {
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
}

.cookie-banner__text {
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0 0 1rem;
}

.cookie-banner__text a {
  color: #7dd3fc;
  text-decoration: underline;
}

.cookie-banner__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.cookie-banner__btn {
  flex: 0 0 auto;
  min-width: 7.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  border: 1px solid #4b5563;
  background: transparent;
  color: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.cookie-banner__btn--accept {
  background: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
}

.cookie-banner__btn--reject {
  background: transparent;
  color: #f5f5f5;
}

.cookie-banner__btn:hover {
  filter: brightness(1.1);
}

@media (max-width: 480px) {
  .cookie-banner__actions { justify-content: stretch; }
  .cookie-banner__btn { flex: 1 1 auto; }
}

/* Breadcrumbs */
.breadcrumbs ol {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  font-size: 0.85rem;
  color: #666;
}
.breadcrumbs li + li::before {
  content: "›";
  margin-right: 0.5rem;
  color: #aaa;
}
.breadcrumbs a { color: #555; text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: #111; }

/* Calculator form polish */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] { width: auto; margin: 0; }

/* Result summary */
.result-summary p { margin: 0.25rem 0; }
.result-summary strong { font-size: 1.15rem; }

/* Prove it panel */
.prove-it {
  margin-top: 1rem;
  border-top: 1px solid #e0e0e0;
  padding-top: 1rem;
}
.prove-it summary {
  cursor: pointer;
  font-weight: 600;
  color: #333;
  padding: 0.25rem 0;
}
.prove-it[open] summary { margin-bottom: 0.75rem; }
.prove-it ul {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0;
}
.prove-it li {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  border-bottom: 1px dotted #e5e5e5;
  font-size: 0.9rem;
}
.prove-it-source {
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.75rem;
}

/* Button-based Prove it (newer retrofits) */
button.prove-it {
  margin-top: 1rem;
  padding: 0.5rem 0.9rem;
  font-size: 0.95rem;
  font-weight: 600;
  background: #f5f5f5;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  cursor: pointer;
  color: #222;
}
button.prove-it:hover { background: #ececec; }
button.prove-it[aria-expanded="true"] { background: #ececec; }
.prove-it-body {
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  background: #fafafa;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
  font-size: 0.92rem;
}
.prove-it-body ol {
  margin: 0;
  padding-left: 1.25rem;
}
.prove-it-body ol li { margin: 0.35rem 0; }
.prove-it-body p.prove-it-source {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: #666;
}

/* Long-form and FAQ sections */
.long-form { margin: 2rem 0; }
.long-form h2 { margin-top: 1.5rem; }
.faq details {
  border-bottom: 1px solid #e5e5e5;
  padding: 0.75rem 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
}
.faq p { margin: 0.5rem 0 0; }

/* Calculator form layout (stacked rows, uniform control alignment) */
.calc-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.calc-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #eef0f3;
}
.calc-row:last-child { border-bottom: none; }
.calc-row label {
  font-size: 0.95rem;
  font-weight: 500;
  color: #222;
  line-height: 1.35;
  margin: 0;
}
.calc-row input[type="number"],
.calc-row select {
  width: 11rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  background: #fff;
}
.calc-row--checkbox input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  justify-self: end;
  cursor: pointer;
}
.calc-row--checkbox label { cursor: pointer; }

/* Fieldset wrapper for grouped calc rows (e.g. period: years + months) */
.calc-fieldset {
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 0.5rem 0.75rem 0.25rem;
  margin: 0.5rem 0;
}
.calc-fieldset legend {
  font-size: 0.9rem;
  font-weight: 500;
  color: #475569;
  padding: 0 0.25rem;
}
/* Two-column inline row for short pairs (e.g. years + months) */
.calc-row--inline {
  grid-template-columns: auto 7rem auto 7rem;
}
.calc-row--inline input[type="number"] { width: 100%; }

/* Radio row: stacks the label above a column of radio options */
.calc-row--radio {
  grid-template-columns: 1fr;
  align-items: start;
}
.calc-row--radio .calc-radio-options {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.25rem 0 0;
}
.calc-row--radio .calc-radio-options label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400;
  cursor: pointer;
}
.calc-row--radio .calc-radio-options input[type="radio"] {
  width: 1.05rem;
  height: 1.05rem;
  margin: 0;
  cursor: pointer;
}

/* Inline hint text inside a label (short clarifier) */
.calc-hint {
  display: block;
  font-size: 0.82rem;
  font-weight: 400;
  color: #64748b;
  margin-top: 0.15rem;
  line-height: 1.35;
}

/* Form-level error message under the calculate button */
.calc-error {
  margin: 0.5rem 0 0;
  padding: 0.55rem 0.8rem;
  border-left: 3px solid #dc2626;
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.9rem;
  border-radius: 0 4px 4px 0;
}

/* Scrollable wrapper for wide scenario tables */
.table-scroll { overflow-x: auto; margin: 0.5rem 0; }
.scenarios-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.scenarios-table th,
.scenarios-table td {
  padding: 0.45rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid #eef0f3;
}
.scenarios-table th { color: #475569; font-weight: 600; background: #f8fafc; }
.scenarios-table tbody tr:last-child td { border-bottom: none; }

/* Inline notices inside a calculator card */
.calc-notice {
  margin: 0.75rem 0;
  padding: 0.7rem 0.9rem;
  border-left: 3px solid #2563eb;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 0.9rem;
  border-radius: 0 4px 4px 0;
  line-height: 1.45;
}
.calc-notice--warn {
  border-left-color: #d97706;
  background: #fffbeb;
  color: #92400e;
}
.calc-notice strong { color: inherit; }

@media (max-width: 540px) {
  .calc-row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  .calc-row input[type="number"],
  .calc-row select { width: 100%; }
  .calc-row--checkbox {
    grid-template-columns: auto 1fr;
    direction: rtl;
  }
  .calc-row--checkbox label { direction: ltr; }
  .calc-row--checkbox input[type="checkbox"] { justify-self: start; }
}

/* ELI5 block */
.eli5 {
  background: #fffaf0;
  border-left: 3px solid #f59e0b;
  padding: 1rem 1.25rem;
  margin: 0 0 1.5rem;
  border-radius: 0 6px 6px 0;
}
.eli5 h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #92400e;
  margin: 0 0 0.4rem;
  text-transform: none;
  letter-spacing: 0;
}
.eli5 p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: #333;
}

/* Site legal line (trading-name notice) */
.site-legal {
  text-align: center;
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  color: #888;
  line-height: 1.4;
}
.site-legal a { color: #bbb; text-decoration: underline; }
.site-legal a:hover { color: #fff; }

/* Bookmark nudge */
.bookmark-nudge {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.9rem;
  font-size: 0.9rem;
  color: #333;
  background: #f5f9ff;
  border: 1px dashed #c7d7f0;
  border-radius: 4px;
}
.bookmark-nudge kbd {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border: 1px solid #b0b8c4;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 1px 0 #b0b8c4;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  color: #222;
  min-width: 1.4rem;
  text-align: center;
}

/* The hidden attribute must beat any display rule (flex/grid/block on forms
   and containers that start out hidden). Without this, .calc-form[hidden]
   still renders as a flex column because display: flex beats hidden. */
[hidden] { display: none !important; }

/* Photo Resizer specific UI */
.resizer-dropzone {
  display: block;
  border: 2px dashed #c7d7f0;
  border-radius: 8px;
  padding: 2rem 1.25rem;
  background: #f5f9ff;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.resizer-dropzone:hover,
.resizer-dropzone.is-drag-over {
  background: #eaf2ff;
  border-color: #2563eb;
}
.resizer-dropzone p { margin: 0 0 0.5rem; color: #333; }
.resizer-dropzone__hint { font-size: 0.85rem; color: #666; margin: 0; }
.resizer-dropzone input[type="file"] {
  position: absolute;
  left: -9999px;
}

.resizer-status {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
}
.resizer-status--error {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}

.resizer-preview {
  margin-top: 1.25rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 540px) {
  .resizer-preview { grid-template-columns: 1fr; }
}
.resizer-preview figure {
  margin: 0;
  background: #f6f7f9;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0.75rem;
}
.resizer-preview img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 0.5rem;
  background: repeating-conic-gradient(#f0f0f0 0% 25%, #fff 0% 50%) 50% / 20px 20px;
}
.resizer-preview figcaption {
  font-size: 0.85rem;
  color: #444;
  text-align: center;
}
.resizer-preview figcaption strong { color: #111; }

.resizer-download {
  display: inline-block;
  margin-top: 0.75rem;
  background: #16a34a;
  color: #fff;
  padding: 0.55rem 1.25rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
}
.resizer-download:hover { background: #15803d; }

.resizer-quality output {
  margin-left: 0.5rem;
  font-variant-numeric: tabular-nums;
  color: #333;
}

/* Long-form lists on info pages */
.long-form ul {
  margin: 0.75rem 0 1rem 1.25rem;
  padding: 0;
}
.long-form ul li { margin: 0.3rem 0; }
.long-form h3 {
  font-size: 1rem;
  margin-top: 1.25rem;
}
.long-form code {
  background: #f1f3f5;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  font-size: 0.9em;
}

/* BMI calculator: imperial height row (feet + inches side by side) */
.bmi-height-imperial {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-self: end;
}
.bmi-height-imperial input[type="number"] {
  width: 4.5rem;
}
.bmi-height-imperial span {
  color: #555;
  font-size: 0.9rem;
}

/* BMI result category pill */
.bmi-category {
  display: inline-block;
  margin: 0.5rem 0 0;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
}
.bmi-category--underweight { background: #e0f2fe; color: #075985; }
.bmi-category--normal      { background: #dcfce7; color: #166534; }
.bmi-category--overweight  { background: #fef3c7; color: #854d0e; }
.bmi-category--obese       { background: #fee2e2; color: #991b1b; }

/* Mortgage calculator: down payment combo (amount + $/% toggle) */
.mort-dp-input {
  display: flex;
  gap: 0.4rem;
  justify-self: end;
}
.mort-dp-input input[type="number"] { width: 7.5rem; }
.mort-dp-input select { width: 4rem; }

/* Mortgage result breakdown */
.mort-breakdown {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}
.mort-breakdown h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: #334155;
}
.mort-breakdown h3 + ul { margin-bottom: 1rem; }
.mort-breakdown ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.mort-breakdown li {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  border-bottom: 1px solid #e2e8f0;
  font-variant-numeric: tabular-nums;
}
.mort-breakdown li:last-child { border-bottom: none; }
.mort-breakdown li span { color: #475569; }
.mort-breakdown li strong { color: #0f172a; }
.mort-breakdown__total {
  margin-top: 0.25rem;
  font-size: 1.05rem;
}
.mort-breakdown__total span,
.mort-breakdown__total strong { color: #0f172a; font-weight: 700; }

/* Year-by-year table used by savings/compound calculators */
.year-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.5rem 0 1rem;
  font-size: 0.95rem;
}
.year-table th,
.year-table td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #e2e8f0;
}
.year-table thead th {
  font-weight: 600;
  color: #0f172a;
  background: #f8fafc;
}
.year-table tbody th {
  font-weight: 600;
  color: #0f172a;
  width: 4rem;
}
.year-table tbody td { color: #0f172a; }
.year-table tbody tr:last-child th,
.year-table tbody tr:last-child td { border-bottom: none; }

/* Country-variant switch link at the top of country-specific calculators */
.country-switch {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}
.country-switch a {
  display: inline-block;
  padding: 0.35rem 0.7rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  color: #1e40af;
  text-decoration: none;
}
.country-switch a:hover,
.country-switch a:focus { background: #dbeafe; }

/* Indicative-estimate notice for regulated-topic calculators (mortgages etc) */
.indicative-notice {
  margin: 0 0 1.25rem;
  padding: 0.9rem 1.1rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #f59e0b;
  border-radius: 4px;
  font-size: 0.95rem;
  color: #713f12;
}
.indicative-notice strong { color: #78350f; }

/* Broker / professional-referral CTA block */
.broker-cta {
  margin: 1.5rem 0 0;
  padding: 1rem 1.25rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
}
.broker-cta h3 {
  margin: 0 0 0.4rem;
  color: #14532d;
  font-size: 1.05rem;
}
.broker-cta p { margin: 0.3rem 0; color: #166534; }
.broker-cta a { color: #14532d; font-weight: 600; }

/* LLM token calculator price-history chart */
.price-history { margin: 2rem 0; }
.price-history__intro { color: #444; }
.price-history__controls fieldset { border: 0; padding: 0; margin: 0 0 0.75rem; }
.price-history__controls label { margin-right: 1.25rem; font-size: 0.95rem; }
.price-history__chart-wrap {
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0.75rem;
  overflow-x: auto;
}
.price-history__chart {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
}
.price-history__caption {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: #666;
}
.price-history__raw { margin-top: 1rem; }
.price-history__raw summary { cursor: pointer; font-size: 0.95rem; color: #1d4ed8; }

/* ---------- SERP Snippet Preview Tool ---------- */
.serp-previews { display: grid; gap: 1.25rem; margin-top: 1rem; }
.serp-card {
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.serp-card--mobile { max-width: 420px; }
.serp-card__head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.85rem; color: #5f6368; margin-bottom: 0.5rem;
  border-bottom: 1px solid #ececec; padding-bottom: 0.5rem;
}
.serp-card__device { font-weight: 600; color: #202124; }
.serp-card__body { font-family: arial, sans-serif; }
.serp-snippet__url {
  color: #5f6368; font-size: 0.78rem; line-height: 1.3; margin-bottom: 0.15rem;
}
.serp-snippet__title {
  color: #1a0dab; font-size: 1.25rem; line-height: 1.3; font-weight: 400;
  margin: 0 0 0.25rem 0; cursor: pointer;
}
.serp-snippet__title:hover { text-decoration: underline; }
.serp-snippet--mobile .serp-snippet__title { font-size: 1.1rem; }
.serp-snippet__description {
  color: #4d5156; font-size: 0.875rem; line-height: 1.45;
}
.serp-card__foot { margin-top: 0.75rem; display: grid; gap: 0.4rem; }
.serp-meter {
  display: flex; justify-content: space-between; gap: 1rem;
  font-size: 0.8rem; color: #555;
}
.serp-meter__label { font-weight: 500; }
.serp-meter__value { font-variant-numeric: tabular-nums; }
.serp-warning {
  margin-top: 0.5rem; padding: 0.5rem 0.75rem;
  background: #fff8e1; border-left: 3px solid #f9a825;
  font-size: 0.85rem; color: #5d4037; border-radius: 3px;
}

/* ---------- Project Deadline Countdown ---------- */
.pdc-results-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem; margin-top: 1rem;
}
.pdc-results-grid > div {
  background: #f8f9fa; border-radius: 6px; padding: 0.75rem 1rem;
}
.pdc-results-grid__label {
  display: block; font-size: 0.78rem; color: #666; text-transform: uppercase;
  letter-spacing: 0.04em; margin-bottom: 0.25rem;
}
.pdc-results-grid__value {
  display: block; font-size: 1.3rem; font-weight: 600; color: #1d4ed8;
  font-variant-numeric: tabular-nums;
}
.pdc-progress {
  margin: 1rem 0; background: #e9ecef; border-radius: 4px; overflow: hidden; height: 8px;
}
.pdc-progress > div {
  height: 100%; background: linear-gradient(90deg, #4ade80, #1d4ed8);
  transition: width 0.3s ease;
}
.pdc-calendar-wrap { margin-top: 1.25rem; overflow-x: auto; }
.pdc-mini-cal {
  display: grid; grid-template-columns: repeat(7, minmax(34px, 1fr));
  gap: 2px; max-width: 360px; font-size: 0.75rem;
}
.pdc-mini-cal__cell {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  background: #f1f3f5; border-radius: 3px; color: #333;
}
.pdc-mini-cal__cell--weekend { background: #e9ecef; color: #888; }
.pdc-mini-cal__cell--working { background: #d0ebff; color: #0b3d6b; font-weight: 500; }
.pdc-mini-cal__cell--holiday { background: #ffe0e6; color: #8b1c2c; font-weight: 500; }
.pdc-mini-cal__cell--start { background: #c5f6c8; color: #1b4d22; font-weight: 700; outline: 2px solid #2f9e44; }
.pdc-mini-cal__cell--deadline { background: #ffd6a5; color: #6b3a00; font-weight: 700; outline: 2px solid #e8590c; }
.pdc-mini-cal__legend {
  display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.75rem;
  font-size: 0.78rem; color: #555;
}
.pdc-mini-cal__legend > span { display: inline-flex; align-items: center; gap: 0.35rem; }
.pdc-mini-cal__swatch {
  display: inline-block; width: 12px; height: 12px; border-radius: 2px; background: #f1f3f5;
}
.pdc-mini-cal__swatch--weekend { background: #e9ecef; }
.pdc-mini-cal__swatch--working { background: #d0ebff; }
.pdc-mini-cal__swatch--holiday { background: #ffe0e6; }
.pdc-mini-cal__swatch--start { background: #c5f6c8; outline: 2px solid #2f9e44; }
.pdc-mini-cal__swatch--deadline { background: #ffd6a5; outline: 2px solid #e8590c; }
.pdc-mini-cal__note { margin-top: 0.5rem; font-size: 0.8rem; color: #777; font-style: italic; }

/* ---------- Fuel Economy Converter source-of-truth highlight ---------- */
.fec-card--source {
  outline: 2px solid #1d4ed8;
  outline-offset: 2px;
  background: #eff6ff;
}

/* Related calculators block */
.related-calcs {
  max-width: 64rem;
  margin: 3rem auto 1rem;
  padding: 1.5rem;
  border-top: 1px solid #e5e7eb;
}
.related-calcs h2 {
  font-size: 1.25rem;
  margin: 0 0 1rem;
}
.related-calcs__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.related-calcs__list li {
  margin: 0;
}
.related-calcs__list a {
  display: block;
  padding: 0.75rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background-color 0.15s;
}
.related-calcs__list a:hover,
.related-calcs__list a:focus {
  border-color: #1d4ed8;
  background: #f8fafc;
}

/* Author byline on calc pages */
.author-byline {
  text-align: center;
  font-size: 0.85rem;
  color: #6b7280;
  margin: 2rem 0 1rem;
}
.author-byline a {
  color: inherit;
  text-decoration: none;
}
.author-byline a:hover,
.author-byline a:focus {
  text-decoration: underline;
}
