:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-muted: #f7f9fc;
  --text: #122035;
  --text-soft: #52627a;
  --border: #d8e1ed;
  --primary: #0d6efd;
  --primary-soft: #dce9ff;
  --success: #1f8f5f;
  --danger: #c73939;
  --shadow-sm: 0 2px 6px rgba(15, 32, 62, 0.06);
  --shadow-md: 0 12px 30px rgba(15, 32, 62, 0.1);
  --radius: 16px;
  --radius-sm: 12px;
  --container: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", -apple-system, sans-serif;
  background: radial-gradient(circle at top right, #edf4ff 0%, var(--bg) 32%, #f1f5fb 100%);
  color: var(--text);
  line-height: 1.6;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #94b6ff;
  outline-offset: 2px;
}

img {
  max-width: 100%;
}

.container {
  width: min(var(--container), calc(100% - 2rem));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 1rem;
  background: #000;
  color: #fff;
  z-index: 1000;
  padding: 0.5rem 1rem;
  border-radius: 8px;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
  background: rgba(244, 247, 251, 0.92);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  font-weight: 700;
  font-size: 1.05rem;
}

.menu-toggle {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 10px;
  display: grid;
  place-content: center;
  gap: 4px;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
}

.primary-nav {
  position: absolute;
  left: 0;
  right: 0;
  top: 68px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: none;
  flex-direction: column;
  padding: 0.5rem 1rem 1rem;
  gap: 0.35rem;
}

.primary-nav.is-open {
  display: flex;
}

.primary-nav a {
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  color: var(--text-soft);
  font-weight: 600;
}

.primary-nav a.is-active,
.primary-nav a:hover {
  background: var(--primary-soft);
  color: var(--text);
}

main {
  padding: 1.5rem 0 5.5rem;
}

.hero {
  padding: 2rem 0 1rem;
}

.hero-card {
  background: linear-gradient(130deg, #112b57 0%, #1f3f74 42%, #2559a4 100%);
  color: #f5f8ff;
  border-radius: 24px;
  padding: 2rem 1.2rem;
  box-shadow: var(--shadow-md);
}

.hero-card h1 {
  font-size: clamp(1.8rem, 6vw, 3.2rem);
  line-height: 1.1;
  margin: 0;
}

.hero-card p {
  color: #d9e7ff;
  margin: 0.8rem 0 1.4rem;
  max-width: 54ch;
}

.hero-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.75rem 1.15rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: #fff;
  color: #133364;
}

.btn-secondary {
  border-color: rgba(255, 255, 255, 0.5);
  color: #ecf3ff;
}

.section {
  margin-top: 2rem;
}

.section h2 {
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.tool-card h3 {
  margin-top: 0.3rem;
}

.tool-card p {
  color: var(--text-soft);
}

.form-grid {
  display: grid;
  gap: 0.85rem;
}

.form-row {
  display: grid;
  gap: 0.35rem;
}

label {
  font-size: 0.92rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.button {
  border: 0;
  min-height: 44px;
  border-radius: 12px;
  padding: 0.7rem 1rem;
  font-weight: 700;
}

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

.button-neutral {
  border: 1px solid var(--border);
  background: #fff;
}

.result-box {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.result-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.result-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.95rem;
}

.result-list strong {
  font-size: 1.05rem;
}

.chart-wrap {
  min-height: 240px;
  margin-top: 1rem;
}

.status {
  min-height: 1.4rem;
  font-weight: 600;
  font-size: 0.92rem;
}

.status.error {
  color: var(--danger);
}

.status.success {
  color: var(--success);
}

.content-page h1,
.calculator-page h1 {
  line-height: 1.15;
  margin-bottom: 0.7rem;
}

.content-page p,
.content-page li {
  color: var(--text-soft);
}

.site-footer {
  border-top: 1px solid var(--border);
  background: #f9fbfe;
  padding: 2rem 0 5rem;
}

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

.footer-title {
  margin: 0 0 0.2rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  margin-top: 1rem;
  padding-top: 0.8rem;
  color: var(--text-soft);
}

.mobile-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(6px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 60;
}

.mobile-nav a {
  min-height: 52px;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-soft);
}

.mobile-nav a.is-active {
  color: var(--primary);
}

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

  .primary-nav {
    position: static;
    display: flex;
    flex-direction: row;
    background: transparent;
    border: 0;
    padding: 0;
    gap: 0.25rem;
  }

  main {
    padding-bottom: 2rem;
  }

  .mobile-nav {
    display: none;
  }

  .grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

/* Homepage specific */
.home-page {
  padding-top: 1rem;
}

.home-hero {
  padding-top: 1.3rem;
}

.home-hero-layout {
  display: grid;
  gap: 1rem;
}

.home-hero-card {
  background: linear-gradient(140deg, #102a54 0%, #1f4f8f 45%, #37a0a4 100%);
}

.eyebrow {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: #d8ebff;
}

.subheadline {
  font-size: 1.05rem;
}

.trust-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
  color: #e7f1ff;
  font-weight: 600;
  font-size: 0.9rem;
}

.trust-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.trust-list li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #8bd9c7;
  box-shadow: 0 0 0 4px rgba(139, 217, 199, 0.2);
}

.hero-visual {
  background: linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
  border-radius: 24px;
  padding: 1.2rem;
  display: grid;
  gap: 0.7rem;
}

.visual-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  background: #edf3ff;
  color: #22467d;
  border: 1px solid #c8daf7;
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
}

.visual-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
  align-items: end;
  min-height: 120px;
}

.visual-bars span {
  height: var(--bar);
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, #67a2ff 0%, #1f61c8 100%);
}

.hero-visual p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.lift-card,
.button,
.btn {
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.lift-card:hover,
.lift-card:focus-within {
  transform: translateY(-3px);
  box-shadow: 0 14px 26px rgba(22, 54, 103, 0.12);
}

.btn:hover,
.button:hover {
  transform: translateY(-2px);
}

.home-cards .button {
  margin-top: 0.4rem;
}

.faq-list {
  display: grid;
  gap: 0.75rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
}

.faq-item p {
  color: var(--text-soft);
  margin-bottom: 0;
}

.testimonial {
  margin: 0;
}

.testimonial p {
  margin-top: 0;
  color: var(--text-soft);
}

.testimonial cite {
  display: block;
  font-style: normal;
  font-weight: 700;
  color: var(--text);
}

@media (min-width: 900px) {
  .home-hero-layout {
    grid-template-columns: 1.25fr 0.85fr;
    align-items: stretch;
  }

  .home-hero-card,
  .hero-visual {
    min-height: 100%;
  }
}

/* Mortgage page specific */
.mortgage-page .card h2,
.mortgage-page .card h3 {
  margin-top: 0;
}

.field-error {
  min-height: 1.2rem;
  margin: 0;
  font-size: 0.85rem;
  color: var(--danger);
}

.sticky-mobile-actions {
  position: sticky;
  bottom: 64px;
  z-index: 15;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, #ffffff 34%);
  padding-top: 0.5rem;
}

.button-full {
  width: 100%;
}

.chart-wrap-large {
  min-height: 300px;
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
}

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

.data-table th {
  font-size: 0.9rem;
  color: var(--text-soft);
  font-weight: 700;
}

.data-table td {
  font-size: 0.95rem;
}

@media (min-width: 760px) {
  .sticky-mobile-actions {
    position: static;
    background: transparent;
    padding-top: 0;
  }

  .button-full {
    width: auto;
    min-width: 220px;
  }
}

/* Tax page specific */
.tax-page .card h2,
.tax-page .card h3 {
  margin-top: 0;
}

.checkbox-row {
  gap: 0.2rem;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
}

.inline-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
}

.helper-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-soft);
}

/* ROI page specific */
.roi-page .card h2,
.roi-page .card h3 {
  margin-top: 0;
}

.roi-input-card {
  background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
}

.roi-dashboard {
  background: linear-gradient(160deg, #0f2b57 0%, #1c4f90 100%);
  color: #edf4ff;
}

.roi-dashboard .helper-text {
  color: #d4e6ff;
}

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

.metric-tile {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(196, 221, 255, 0.26);
  border-radius: 12px;
  padding: 0.7rem;
}

.metric-tile h3 {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.3;
  color: #cfe2ff;
}

.metric-tile p {
  margin: 0.35rem 0 0;
  font-weight: 800;
  font-size: 1.12rem;
  color: #ffffff;
}

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

/* Global mobile optimization */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

body {
  font-size: clamp(0.95rem, 2.3vw, 1rem);
}

h1 {
  font-size: clamp(1.7rem, 6.2vw, 2.8rem);
}

h2 {
  font-size: clamp(1.25rem, 4.5vw, 1.95rem);
}

h3 {
  font-size: clamp(1.02rem, 3.3vw, 1.25rem);
}

p,
li {
  font-size: clamp(0.94rem, 2.4vw, 1rem);
}

.section {
  margin-top: clamp(1.4rem, 5vw, 2.2rem);
}

.card {
  padding: clamp(0.85rem, 3.4vw, 1.2rem);
}

button,
.button,
.btn,
.primary-nav a,
.mobile-nav a {
  min-height: 48px;
}

input,
select,
textarea {
  min-height: 48px;
  font-size: 16px;
}

.table-wrap {
  -webkit-overflow-scrolling: touch;
}

.chart-wrap {
  min-height: 220px;
  contain: layout paint;
}

.site-header {
  min-height: 68px;
}

.nav-scrim {
  position: fixed;
  inset: 68px 0 0;
  background: rgba(12, 21, 37, 0.48);
  z-index: 48;
}

.menu-close {
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  border-radius: 10px;
  min-height: 42px;
  padding: 0.55rem 0.75rem;
  font-weight: 700;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: fit-content;
  margin-bottom: 0.35rem;
}

.primary-nav {
  position: fixed;
  top: 68px;
  right: 0;
  left: auto;
  bottom: 0;
  width: min(88vw, 340px);
  border-left: 1px solid var(--border);
  border-bottom: 0;
  box-shadow: -14px 0 35px rgba(10, 25, 49, 0.18);
  transform: translateX(104%);
  transition: transform 0.24s ease;
  will-change: transform;
  padding: 0.8rem;
  gap: 0.25rem;
}

.primary-nav.is-open {
  display: flex;
  transform: translateX(0);
}

body.nav-open {
  overflow: hidden;
}

.mobile-nav {
  padding-bottom: max(0px, env(safe-area-inset-bottom));
}

.mobile-nav a {
  padding: 0.2rem 0.1rem;
}

.actions {
  gap: 0.5rem;
}

.sticky-mobile-actions {
  bottom: calc(62px + env(safe-area-inset-bottom));
}

.result-list li {
  align-items: baseline;
}

@media (max-width: 759px) {
  .container {
    width: min(var(--container), calc(100% - 1.2rem));
  }

  .grid.cols-2,
  .grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    gap: 1.25rem;
  }
}

@media (min-width: 760px) {
  .menu-close,
  .nav-scrim {
    display: none;
  }

  .primary-nav {
    transform: none;
    box-shadow: none;
  }

  .primary-nav {
    position: static;
    width: auto;
    border-left: 0;
    padding: 0;
  }

  .container {
    width: min(var(--container), calc(100% - 2.4rem));
  }
}

@media (min-width: 760px) and (max-width: 1023px) {
  h1 {
    font-size: clamp(2rem, 4.2vw, 2.6rem);
  }

  .grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .container {
    width: min(var(--container), calc(100% - 3rem));
  }

  .grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .chart-wrap {
    min-height: 260px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Pro Theme Refresh */
:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-muted: #f7f9fc;
  --text: #0f1f35;
  --text-soft: #4d5f79;
  --border: #d4deeb;
  --primary: #165dcc;
  --primary-soft: #e6efff;
  --success: #1d8a5b;
  --danger: #c63a3a;
  --shadow-sm: 0 6px 16px rgba(16, 38, 72, 0.08);
  --shadow-md: 0 20px 45px rgba(16, 38, 72, 0.14);
  --radius: 18px;
  --radius-sm: 12px;
}

body {
  background: linear-gradient(180deg, #f7f9fd 0%, #f1f5fb 100%);
  color: var(--text);
}

.site-header {
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 6px 18px rgba(17, 35, 67, 0.06);
}

.brand span {
  letter-spacing: 0.01em;
}

.primary-nav a {
  color: #3f536f;
}

.primary-nav a.is-active,
.primary-nav a:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.hero-card {
  background: linear-gradient(145deg, #0f2a53 0%, #164281 45%, #1d5fb3 100%);
  border-radius: 26px;
  box-shadow: var(--shadow-md);
}

.hero-card p {
  color: #d8e8ff;
}

.btn,
.button {
  border-radius: 12px;
  font-weight: 700;
}

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

.btn-primary:hover,
.button-primary:hover {
  background: #0f4fb7;
}

.btn-secondary,
.button-neutral {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

.result-box {
  background: #f8fbff;
  border-color: #d9e4f3;
}

input,
select,
textarea {
  border-color: #cbd8ea;
  background: #fff;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #6f9ceb;
  box-shadow: 0 0 0 3px rgba(22, 93, 204, 0.12);
}

.site-footer {
  background: #f7faff;
  border-top: 1px solid var(--border);
}

.mobile-nav {
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 18px rgba(16, 38, 72, 0.08);
}

.mobile-nav a {
  color: #50637e;
}

.mobile-nav a.is-active {
  color: var(--primary);
}

.faq-item,
.testimonial,
.metric-tile,
.tool-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.faq-item:hover,
.testimonial:hover,
.tool-card:hover,
.metric-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(18, 45, 84, 0.12);
}

@media (max-width: 759px) {
  .hero-card {
    border-radius: 20px;
  }

  .section {
    margin-top: 1.2rem;
  }

  .card {
    border-radius: 16px;
  }
}

/* Theme Switch + Dark Mode */
html[data-theme="dark"] {
  color-scheme: dark;
}

html[data-theme="dark"] body {
  background: linear-gradient(180deg, #0d1727 0%, #111c2e 100%);
  color: #e4edf9;
}

html[data-theme="dark"] .site-header {
  background: rgba(11, 19, 33, 0.94);
  border-bottom-color: #2b3a55;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .result-box,
html[data-theme="dark"] .hero-visual,
html[data-theme="dark"] .primary-nav,
html[data-theme="dark"] .mobile-nav,
html[data-theme="dark"] .site-footer,
html[data-theme="dark"] .menu-toggle,
html[data-theme="dark"] .menu-close,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .button-neutral,
html[data-theme="dark"] .btn-secondary {
  background: #162338;
  border-color: #2f415f;
  color: #e4edf9;
}

html[data-theme="dark"] .result-box {
  background: #1a2940;
}

html[data-theme="dark"] .content-page p,
html[data-theme="dark"] .content-page li,
html[data-theme="dark"] .tool-card p,
html[data-theme="dark"] .helper-text,
html[data-theme="dark"] .primary-nav a,
html[data-theme="dark"] .mobile-nav a,
html[data-theme="dark"] .site-footer,
html[data-theme="dark"] .hero-visual p {
  color: #bac9df;
}

html[data-theme="dark"] .primary-nav a.is-active,
html[data-theme="dark"] .primary-nav a:hover,
html[data-theme="dark"] .mobile-nav a.is-active {
  color: #8db7ff;
  background: #223757;
}

html[data-theme="dark"] .button-primary,
html[data-theme="dark"] .btn-primary {
  background: #2f6fd9;
}

html[data-theme="dark"] .button-primary:hover,
html[data-theme="dark"] .btn-primary:hover {
  background: #3e7de6;
}

.theme-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
}

.theme-btn {
  border: 0;
  background: transparent;
  color: var(--text-soft);
  min-height: 34px;
  min-width: 62px;
  border-radius: 999px;
  font-weight: 700;
  padding: 0.4rem 0.75rem;
}

.theme-btn.is-active {
  background: var(--primary);
  color: #fff;
}

.theme-switch-mobile {
  margin: 0 0 0.4rem;
  width: fit-content;
}

.menu-toggle {
  border-radius: 12px;
}

.mobile-nav {
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  overflow: hidden;
}

.mobile-nav a {
  position: relative;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

.mobile-nav a.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
}

@media (max-width: 759px) {
  .header-inner {
    gap: 0.5rem;
  }

  .theme-switch {
    order: 2;
    margin-left: auto;
  }

  .menu-toggle {
    order: 3;
  }

  .theme-switch .theme-btn {
    min-width: 56px;
  }
}

@media (min-width: 760px) {
  .theme-switch-mobile {
    display: none;
  }
}

/* Tax tools page */
.tax-tools-page {
  position: relative;
}

.tax-hero {
  background: linear-gradient(145deg, #0f2b57 0%, #1e4d8d 45%, #2675d4 100%);
  color: #eef5ff;
  border-radius: 22px;
}

.tax-hero p {
  color: #dbe9ff;
}

.tax-trust-list {
  color: #ecf3ff;
  margin-top: 0.8rem;
}

.sticky-tax-search {
  position: sticky;
  top: 74px;
  z-index: 20;
}

.search-card {
  display: grid;
  gap: 0.65rem;
}

.tab-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tab {
  border: 1px solid var(--border);
  border-radius: 999px;
  min-height: 40px;
  padding: 0.45rem 0.85rem;
  font-weight: 700;
  background: #fff;
  color: var(--text-soft);
}

.tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.tax-tool-card {
  display: grid;
  gap: 0.7rem;
}

.tax-tool-head {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.tool-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  font-size: 1.2rem;
}

.tax-tool-head h3 {
  margin: 0;
}

.slug {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-soft);
}

.tax-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-soft);
  font-size: 0.85rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  text-transform: capitalize;
}

.tax-tool-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.compare-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-soft);
}

.compare-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.compare-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}

.ad-slot {
  border-style: dashed;
}

.mini-card h3 {
  margin: 0;
  font-size: 0.95rem;
}

.mini-card p {
  margin: 0.15rem 0 0.45rem;
  color: var(--text-soft);
}

.empty-note {
  color: var(--text-soft);
}

.sticky-mobile-cta {
  position: fixed;
  left: 0.8rem;
  right: 0.8rem;
  bottom: calc(66px + env(safe-area-inset-bottom));
  min-height: 46px;
  display: none;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  z-index: 25;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 26px rgba(17, 54, 112, 0.3);
}

@media (max-width: 759px) {
  .tax-tool-actions {
    grid-template-columns: 1fr;
  }

  .sticky-mobile-cta {
    display: flex;
  }
}

@media (min-width: 760px) {
  .sticky-mobile-cta {
    display: none;
  }
}

/* Mobile nav background color override */
.mobile-nav {
  background-color: #ffffff;
}

html[data-theme="dark"] .mobile-nav {
  background-color: #162338;
}

/* Auto ad placeholders */
.ad-wrap {
  margin-top: 1rem;
}

.ad-placeholder {
  border: 1px dashed #b9c7dc;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7ff 100%);
}

.ad-caption {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  font-weight: 700;
}

.ad-box {
  min-height: 120px;
  border-radius: 10px;
  border: 1px dashed #c7d5ea;
  display: grid;
  place-items: center;
  text-align: center;
  color: #6d7f9a;
  background: rgba(255, 255, 255, 0.8);
  padding: 0.85rem;
}

.ad-box span {
  font-size: 0.9rem;
  font-weight: 600;
}

html[data-theme="dark"] .ad-placeholder {
  border-color: #395073;
  background: linear-gradient(180deg, #162338 0%, #152131 100%);
}

html[data-theme="dark"] .ad-box {
  border-color: #355174;
  background: rgba(10, 18, 31, 0.55);
  color: #9fb6d6;
}

html[data-theme="dark"] .ad-caption {
  color: #9bb2d4;
}

.footer-ad-wrap {
  margin-top: 0.8rem;
  padding-bottom: calc(62px + env(safe-area-inset-bottom));
}

@media (min-width: 760px) {
  .footer-ad-wrap {
    padding-bottom: 0;
  }
}

.brand-logo {
  width: 138px;
  height: auto;
  display: block;
}

.footer-logo {
  width: 170px;
  height: auto;
  display: block;
  margin-bottom: 0.4rem;
}

@media (max-width: 759px) {
  .brand-logo {
    width: 122px;
  }

  .footer-logo {
    width: 152px;
  }
}

/* ROI dashboard redesign */
.roi-dash-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}

.dash-kicker {
  margin: 0 0 0.18rem;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #c7dcff;
  font-weight: 700;
}

.dash-note {
  margin: 0;
  max-width: 24ch;
  font-size: 0.83rem;
  color: #d3e6ff;
}

.metric-highlight {
  border: 1px solid rgba(199, 226, 255, 0.32);
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.06) 100%);
  border-radius: 14px;
  padding: 0.85rem;
  margin-bottom: 0.75rem;
}

.metric-highlight h3 {
  margin: 0;
  color: #d9ebff;
  font-size: 0.84rem;
}

.metric-highlight p {
  margin: 0.35rem 0 0;
  color: #fff;
  font-size: clamp(1.55rem, 4.5vw, 2rem);
  font-weight: 800;
  line-height: 1.1;
}

.roi-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-tile {
  padding: 0.8rem;
}

.metric-tile h3 {
  color: #d8e9ff;
}

.metric-tile p {
  font-size: 1.05rem;
}

.dash-subheading {
  margin: 0.95rem 0 0.55rem;
  font-size: 0.9rem;
  color: #d8e9ff;
}

.mortgage-dashboard .roi-metrics + .dash-subheading {
  margin-top: 1rem;
}

.mortgage-metrics,
.tax-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tax-dashboard .chart-wrap {
  margin-top: 0.85rem;
}

html[data-theme="dark"] .dash-kicker {
  color: #b6d0f3;
}

html[data-theme="dark"] .dash-note {
  color: #a8c2e3;
}

html[data-theme="dark"] .metric-highlight {
  border-color: rgba(129, 165, 209, 0.35);
  background: linear-gradient(130deg, rgba(22, 45, 76, 0.75) 0%, rgba(17, 33, 56, 0.56) 100%);
}

html[data-theme="dark"] .dash-subheading {
  color: #c6dbf6;
}

@media (max-width: 759px) {
  .roi-dash-head {
    flex-direction: column;
  }

  .dash-note {
    max-width: none;
  }
}

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

  .mortgage-metrics,
  .tax-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Auth pages */
.auth-wrap {
  display: grid;
  place-items: center;
}

.auth-card {
  width: min(560px, 100%);
}

.auth-page .actions {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 760px) {
  .auth-page .actions {
    grid-template-columns: auto auto;
    justify-content: flex-start;
  }
}

/* Header auth profile UI */
.auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  min-height: 36px;
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
  color: var(--text-soft);
}

.auth-chip strong {
  color: var(--text);
}

.nav-logout {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  border-radius: 10px;
  min-height: 44px;
  padding: 0.55rem 0.8rem;
  font-weight: 700;
}

html[data-theme="dark"] .auth-chip,
html[data-theme="dark"] .nav-logout {
  background: #162338;
  border-color: #2f415f;
  color: #d3e2f8;
}

html[data-theme="dark"] .auth-chip strong {
  color: #fff;
}

@media (max-width: 759px) {
  .auth-chip {
    font-size: 0.8rem;
    padding: 0.28rem 0.6rem;
  }

  .nav-logout {
    width: 100%;
    margin: 0.2rem 0 0.35rem;
  }
}

/* Admin page */
.admin-page .card h2 {
  margin-top: 0;
}

.admin-page .grid.cols-3 p {
  margin: 0.25rem 0 0;
  font-size: clamp(1.2rem, 4vw, 1.65rem);
  font-weight: 800;
}


/* Admin page */
.admin-page .card h2 {
  margin-top: 0;
}

.admin-page .grid.cols-3 p {
  margin: 0.25rem 0 0;
  font-size: clamp(1.2rem, 4vw, 1.65rem);
  font-weight: 800;
}

.admin-filter-grid {
  display: grid;
  gap: 0.65rem;
}

.admin-tablist {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.admin-tab {
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text-soft);
  font-weight: 800;
  padding: 0.55rem 0.8rem;
}

.admin-tab.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.admin-ads-form textarea {
  min-height: 120px;
  resize: vertical;
}

#admin-page-count,
#admin-user-count {
  margin: 0;
}

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

  .admin-tablist {
    width: fit-content;
    min-width: 420px;
  }
}

html[data-theme="dark"] .admin-tab {
  background: #162338;
  border-color: #2f415f;
  color: #cfdef3;
}

html[data-theme="dark"] .admin-tab.is-active {
  background: #2f6fd9;
  border-color: #2f6fd9;
  color: #fff;
}

