/*
Theme Name: Rich Direction
Theme URI: https://richdirection.com
Author: Rich Direction, LLC
Description: Accessible production theme for Rich Direction financial education, calculators, and downloads.
Version: 1.2.12
Requires at least: 6.5
Requires PHP: 8.0
Text Domain: richdirection
*/

:root {
  --ink: #101112;
  --charcoal: #242628;
  --muted: #5d6266;
  --line: #d8dbdd;
  --soft: #f3f3f1;
  --paper: #fff;
  --positive: #126b45;
  --warning: #8a4b08;
  --error: #a02020;
  --focus: #3978ff;
  --shell: 1200px;
  --radius: 4px;
  --shadow: 0 18px 48px rgb(16 17 18 / 9%);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }

a { color: inherit; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }

img { max-width: 100%; height: auto; }

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

button,
a,
input,
select,
summary { outline-color: transparent; }

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

h1,
h2,
h3,
p { margin-top: 0; }

h1,
h2,
h3 {
  line-height: 1.05;
  letter-spacing: -.035em;
}

h1 { font-size: clamp(2.7rem, 7vw, 6rem); max-width: 12ch; margin-bottom: 1.5rem; }
h2 { font-size: clamp(2rem, 4vw, 3.5rem); max-width: 16ch; margin-bottom: 1.25rem; }
h3 { font-size: clamp(1.3rem, 2vw, 1.7rem); }

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

.site-main { min-height: 60vh; }
.section { padding-block: clamp(4rem, 8vw, 8rem); }
.section-dark { color: var(--paper); background: var(--ink); }
.section-neutral { background: var(--soft); }
.narrow-left { max-width: 900px; margin-left: max(1rem, calc((100vw - var(--shell)) / 2)); margin-right: 1rem; }

.eyebrow {
  margin-bottom: .85rem;
  color: inherit;
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.skip-link {
  position: fixed;
  z-index: 9999;
  top: .75rem;
  left: .75rem;
  padding: .75rem 1rem;
  color: var(--paper);
  background: var(--ink);
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  border-bottom: 1px solid rgb(16 17 18 / 14%);
  background: rgb(255 255 255 / 94%);
  backdrop-filter: blur(14px);
}

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

.wordmark {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -.045em;
  text-decoration: none;
}
.wordmark span { color: var(--muted); }

.primary-navigation .menu,
.footer-links {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2.25rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.primary-navigation a {
  font-size: .86rem;
  font-weight: 750;
  text-decoration: none;
}
.primary-navigation a:hover { text-decoration: underline; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: .65rem;
  padding: .5rem;
  border: 0;
  background: transparent;
  font-weight: 750;
}

.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  content: "";
}
.nav-toggle-icon { position: relative; }
.nav-toggle-icon::before { position: absolute; top: -6px; }
.nav-toggle-icon::after { position: absolute; top: 6px; }

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .7rem 1.15rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, color .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: wait; opacity: .6; transform: none; }
.button-primary { color: var(--paper); background: var(--ink); }
.button-primary:hover { background: var(--charcoal); }
.button-secondary { color: var(--ink); background: var(--paper); }
.button-light { color: var(--ink); border-color: var(--paper); background: var(--paper); }
.button-dark-outline { color: var(--paper); border-color: #74787b; background: transparent; }
.button-disabled { color: var(--muted); border-color: var(--line); background: var(--soft); cursor: not-allowed; }
.button-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

.link-button {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: .2em;
  cursor: pointer;
}

.text-link {
  font-weight: 800;
  text-decoration: none;
}
.text-link:hover { text-decoration: underline; }

.hero { min-height: min(780px, calc(100vh - 76px)); display: grid; align-items: center; padding-block: clamp(5rem, 10vw, 9rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(270px, .65fr); gap: clamp(3rem, 9vw, 9rem); align-items: end; }
.hero-copy { max-width: 720px; color: #c9ccce; font-size: clamp(1.12rem, 2vw, 1.45rem); }
.hero .button-row { margin-top: 2.25rem; }
.hero-proof { padding-top: 2rem; border-top: 1px solid #5c6063; }
.proof-number { margin-bottom: .4rem; font-size: clamp(1.7rem, 3vw, 2.5rem); font-weight: 850; letter-spacing: -.04em; }
.hero-proof > p:not(.proof-number), .check-list { color: #c9ccce; }
.check-list { margin: 1.5rem 0 0; padding: 0; list-style: none; }
.check-list li { position: relative; padding: .45rem 0 .45rem 1.5rem; }
.check-list li::before { position: absolute; left: 0; content: "✓"; color: var(--paper); font-weight: 900; }

.section-heading { margin-bottom: 3rem; }
.split-heading { display: grid; grid-template-columns: 1.35fr .65fr; gap: 3rem; align-items: end; }
.split-heading > p { max-width: 520px; color: var(--muted); }

.tool-grid { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.tool-card { min-height: 310px; display: flex; flex-direction: column; padding: clamp(1.5rem, 4vw, 3rem); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-decoration: none; transition: background .2s ease; }
.tool-card:hover { background: var(--soft); }
.tool-number { margin-bottom: auto; color: var(--muted); font-size: .75rem; font-weight: 800; }
.tool-card h3 { max-width: 15ch; margin-top: 2.5rem; margin-bottom: .8rem; }
.tool-card p { max-width: 54ch; color: var(--muted); }
.tool-card .text-link { margin-top: auto; padding-top: 1rem; }
.section-action { margin: 2rem 0 0; text-align: right; }

.feature-grid,
.confidence-grid,
.about-grid,
.explanation-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(3rem, 9vw, 9rem); align-items: center; }
.feature-grid > div:first-child p:not(.eyebrow) { max-width: 55ch; color: var(--muted); }
.feature-panel { padding: clamp(2rem, 5vw, 4rem); color: var(--paper); background: var(--ink); box-shadow: var(--shadow); }
.feature-panel h3 { max-width: 16ch; font-size: clamp(1.6rem, 3vw, 2.3rem); }
.feature-kicker { color: #bfc3c6; font-size: .8rem; font-weight: 750; text-transform: uppercase; letter-spacing: .1em; }
.plain-list { padding-left: 1.2rem; }
.plain-list li { margin-block: .45rem; }
.confidence-grid p { max-width: 60ch; color: var(--muted); }

.disclaimer-band { padding-block: 1.5rem; border-block: 1px solid var(--line); background: var(--soft); }
.disclaimer-band p { max-width: 1000px; margin: 0; font-size: .9rem; }

.page-hero,
.calculator-hero { padding-block: clamp(5rem, 10vw, 9rem); }
.page-hero h1,
.calculator-hero h1 { font-size: clamp(2.7rem, 6.5vw, 5.4rem); }
.page-hero p:last-child,
.calculator-hero > div > p:last-of-type { max-width: 760px; color: #c9ccce; font-size: 1.2rem; }

.directory-grid { display: grid; grid-template-columns: repeat(2, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.directory-card { min-height: 300px; display: flex; flex-direction: column; padding: clamp(1.5rem, 4vw, 3rem); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.directory-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.directory-card h2 { margin-top: 3.5rem; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.directory-card h2 a { text-decoration: none; }
.directory-card p { color: var(--muted); }
.directory-card .text-link { margin-top: auto; }

.calculator-hero { color: var(--paper); background: var(--ink); }
.calculator-promises { display: flex; flex-wrap: wrap; gap: .65rem 1.5rem; margin: 2rem 0 0; padding: 0; list-style: none; color: #c9ccce; font-size: .85rem; font-weight: 700; }
.calculator-promises li::before { content: "✓"; margin-right: .45rem; color: var(--paper); }
.calculator-shell { padding-block: clamp(2rem, 5vw, 5rem); }
.calculator-instructions { max-width: 850px; margin: 0 0 1.5rem; color: var(--muted); }
.calculator-layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: start; }
.calculator-form { padding: clamp(1.25rem, 3.5vw, 2.5rem); border: 1px solid var(--line); background: var(--paper); box-shadow: 0 10px 36px rgb(16 17 18 / 5%); }
.calculator-results { position: sticky; top: 100px; min-width: 0; }
.calculator-layout.has-wide-results .calculator-results { position: static; top: auto; align-self: start; }
.calculator-wide-results { grid-column: 1 / -1; min-width: 0; }
.calculator-wide-results:empty { display: none; }
.calculator-form-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: start; margin-bottom: 2rem; }
.calculator-form-heading h2 { margin: 0; font-size: 2rem; }
.local-badge { padding: .35rem .55rem; border: 1px solid var(--line); color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.inline-note,
.result-disclaimer,
.calculation-error,
.warning-list { padding: 1rem 1.1rem; border-left: 3px solid var(--ink); background: var(--soft); font-size: .88rem; }
.inline-note { margin-bottom: 1.5rem; color: var(--charcoal); }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
.field { min-width: 0; }
.field label { display: block; margin-bottom: .42rem; font-size: .8rem; font-weight: 800; line-height: 1.35; }
.field small { display: block; margin-top: .35rem; color: var(--muted); font-size: .73rem; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > span { position: absolute; right: .8rem; color: var(--muted); font-size: .85rem; pointer-events: none; }
input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: .62rem .75rem;
  border: 1px solid #8e9498;
  border-radius: 2px;
  color: var(--ink);
  background: var(--paper);
}
input:hover,
select:hover { border-color: var(--ink); }
input:invalid:not(:focus):not(:placeholder-shown) { border-color: var(--error); }
.tooltip { position: relative; width: 1.1rem; height: 1.1rem; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #8e9498; border-radius: 50%; color: var(--muted); font-size: .67rem; cursor: help; }
.tooltip::after { position: absolute; z-index: 10; bottom: calc(100% + .55rem); left: 50%; width: 230px; padding: .7rem; color: var(--paper); background: var(--ink); content: attr(data-tooltip); font-size: .75rem; font-weight: 500; line-height: 1.4; transform: translateX(-50%); opacity: 0; pointer-events: none; }
.tooltip:hover::after,
.tooltip:focus::after { opacity: 1; }

.advanced-inputs,
.result-details,
.expense-group { margin-top: 1.25rem; border-top: 1px solid var(--line); }
.advanced-inputs > summary,
.result-details > summary,
.expense-group > summary { padding: 1rem 0; font-weight: 850; cursor: pointer; }
.advanced-inputs > summary::marker,
.result-details > summary::marker,
.expense-group > summary::marker { color: var(--muted); }
.calculator-toolbar { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.checkbox-row { display: flex; gap: .65rem; align-items: start; font-size: .88rem; }
.checkbox-row input { width: 1.05rem; min-height: 1.05rem; margin-top: .2rem; flex: 0 0 auto; }
.checkbox-row.compact { max-width: 360px; }

.results-heading { padding-bottom: 1.5rem; border-bottom: 2px solid var(--ink); }
.results-heading h2 { max-width: none; margin-bottom: .5rem; font-size: clamp(2.4rem, 5vw, 4rem); overflow-wrap: anywhere; }
.results-heading p:last-child { color: var(--muted); }
.result-grid,
.target-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); margin-top: 1.5rem; }
.result-card { min-height: 130px; display: flex; flex-direction: column; justify-content: space-between; padding: 1rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.result-card p { margin-bottom: .75rem; color: var(--muted); font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.result-card strong { display: block; font-size: clamp(1.25rem, 2.5vw, 1.75rem); line-height: 1.1; overflow-wrap: anywhere; }
.result-card small { display: block; margin-top: .5rem; color: var(--muted); font-size: .72rem; }
.summary-list { margin: 0; }
.summary-list > div { display: flex; justify-content: space-between; gap: 1.5rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.summary-list dt { color: var(--muted); }
.summary-list dd { margin: 0; font-weight: 800; text-align: right; }
.result-disclaimer { margin-top: 1.5rem; border-left-color: #6e7478; }
.calculation-error { border-left-color: var(--error); color: var(--error); }
.warning-list { margin: 1rem 0; border-left-color: var(--warning); }
.warning-list p { margin: 0; }
.warning-list p + p { margin-top: .5rem; }
.fine-print { color: var(--muted); font-size: .78rem; line-height: 1.5; }

.table-scroll { max-width: 100%; overflow: auto; border: 1px solid var(--line); }
.schedule-scroll-shell { width: 100%; max-width: 100%; min-width: 0; }
.schedule-scroll-top { height: 1rem; margin-bottom: .25rem; border: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; }
.schedule-scroll-spacer { height: 1px; }
.schedule-viewport { width: 100%; max-width: 100%; height: 24rem; min-height: 18rem; max-height: min(80vh, 70rem); border: 1px solid var(--line); overflow: auto; resize: vertical; }
.schedule-viewport:focus { outline: 3px solid var(--focus); outline-offset: 2px; }
.data-table { width: 100%; border-collapse: collapse; font-size: .78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table th,
.data-table td { padding: .65rem .7rem; border-bottom: 1px solid var(--line); text-align: right; }
.data-table th { position: sticky; top: 0; z-index: 1; color: var(--paper); background: var(--ink); font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; }
.data-table th:first-child,
.data-table td:first-child,
.data-table th:nth-child(2),
.data-table td:nth-child(2) { text-align: left; }
.data-table tbody tr:nth-child(even) { background: var(--soft); }
.schedule-table tbody th { top: auto; color: var(--ink); background: var(--paper); font-size: .78rem; letter-spacing: normal; text-transform: none; }
.schedule-table th:first-child,
.schedule-table td:first-child { position: sticky; left: 0; z-index: 2; background: var(--paper); box-shadow: 1px 0 0 var(--line); }
.schedule-table thead th:first-child { z-index: 4; color: var(--paper); background: var(--ink); }
.schedule-table tbody tr:nth-child(even) > :first-child { background: var(--soft); }
.highlight-row { background: #fff2bd !important; }
.schedule-details[open] { grid-column: 1 / -1; }
.sensitivity-details[open] { grid-column: 1 / -1; }
.sensitivity-table tbody th { position: sticky; left: 0; color: var(--ink); background: var(--soft); text-align: left; }
.schedule-controls { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.schedule-controls label { display: flex; align-items: center; gap: .5rem; font-size: .8rem; font-weight: 800; }
.schedule-controls select { min-width: 130px; }
.segmented-control { display: inline-flex; border: 1px solid var(--ink); }
.segmented-control button { min-height: 40px; padding: .5rem .8rem; border: 0; background: var(--paper); font-weight: 800; cursor: pointer; }
.segmented-control button[aria-pressed="true"] { color: var(--paper); background: var(--ink); }

.explanation-grid { align-items: start; }
.explanation-grid p:not(.eyebrow) { color: var(--muted); }
.definition-list { margin: 0; }
.definition-list > div { padding: 1rem 0; border-top: 1px solid #c9ccce; }
.definition-list dt { font-weight: 850; }
.definition-list dd { margin: .35rem 0 0; color: var(--muted); }
.related-tools h2 { font-size: 2.6rem; }

.expense-section { grid-column: 1 / -1; margin-top: 2rem; }
.expense-title { margin-bottom: .75rem; }
.expense-title h3 { margin-bottom: 0; font-size: 1.6rem; }
.expense-group > summary { display: flex; justify-content: space-between; gap: 1rem; }
.expense-group > summary small { color: var(--muted); font-weight: 600; }
.expense-table { border: 1px solid var(--line); border-bottom: 0; }
.expense-head,
.expense-row { display: grid; grid-template-columns: minmax(190px, 1.6fr) minmax(110px, .75fr) minmax(90px, .55fr) minmax(90px, .55fr); gap: .65rem; align-items: center; padding: .65rem; border-bottom: 1px solid var(--line); }
.expense-head { color: var(--muted); background: var(--soft); font-size: .65rem; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.expense-row > label:first-child { font-size: .78rem; font-weight: 700; }
.expense-row input { min-height: 40px; }
.icon-check { display: flex; gap: .3rem; align-items: center; font-size: .68rem; }
.icon-check input { width: 1rem; min-height: 1rem; }
.custom-expense > input:first-child { font-size: .78rem; }
.optional-expense .icon-check:last-child { grid-column: span 1; }
.progress-block { margin: 1.5rem 0; padding: 1.25rem; background: var(--soft); }
.progress-label { display: flex; justify-content: space-between; }
.progress-block progress { width: 100%; height: 14px; accent-color: var(--ink); }
.progress-block p { margin: .45rem 0 0; color: var(--muted); font-size: .78rem; }
.print-summary { margin-top: 1.25rem; }

.download-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.download-card { min-height: 470px; display: flex; flex-direction: column; padding: clamp(1.5rem, 4vw, 3rem); border: 1px solid var(--line); }
.download-card-muted { background: var(--soft); }
.download-card h2 { margin-top: 2.5rem; font-size: clamp(2rem, 4vw, 3rem); }
.download-card > p { color: var(--muted); }
.download-card .button { align-self: flex-start; margin-top: auto; }
.resource-label { display: flex; justify-content: space-between; color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }

dialog { width: min(620px, calc(100% - 2rem)); max-height: calc(100vh - 2rem); padding: 0; border: 1px solid var(--ink); background: var(--paper); box-shadow: 0 30px 100px rgb(0 0 0 / 35%); overflow: auto; }
dialog::backdrop { background: rgb(16 17 18 / 72%); backdrop-filter: blur(3px); }
dialog form { padding: clamp(1.25rem, 5vw, 2.5rem); }
.dialog-heading { display: flex; justify-content: space-between; gap: 1.5rem; align-items: start; }
.dialog-heading h2 { margin-bottom: 1rem; font-size: 2.2rem; }
.icon-button { width: 42px; height: 42px; flex: 0 0 auto; border: 1px solid var(--line); background: var(--paper); font-size: 1.8rem; line-height: 1; cursor: pointer; }
.download-dialog .field { margin-block: 1rem; }
.optional { color: var(--muted); font-size: .7rem; font-weight: 500; }
.form-message { min-height: 1.5rem; margin-block: 1rem; font-weight: 750; }
.form-message[data-state="success"] { color: var(--positive); }
.form-message[data-state="error"] { color: var(--error); }
.form-trap { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.rd-privacy-panel { position: fixed; z-index: 500; right: 1rem; bottom: 1rem; left: 1rem; width: min(1050px, calc(100% - 2rem)); max-height: min(45vh, 26rem); margin-inline: auto; display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; padding: .75rem 1rem; border: 1px solid #74787b; color: var(--paper); background: var(--ink); box-shadow: 0 18px 70px rgb(0 0 0 / 30%); overflow-y: auto; }
.rd-privacy-panel h2 { margin-bottom: .25rem; font-size: 1.05rem; }
.rd-privacy-panel p:last-child { max-width: 680px; margin: 0; color: #c9ccce; font-size: .76rem; line-height: 1.45; }
.rd-choice-controls,
.rd-dialog-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.rd-choice-button { min-width: 132px; color: var(--paper); border-color: #8f9498; background: transparent; }
.rd-choice-button:hover { border-color: var(--paper); background: #292c2e; }
.rd-preference-list { margin-block: 1.25rem; border-top: 1px solid var(--line); }
.rd-preference-row { display: flex; justify-content: space-between; gap: 2rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.rd-preference-row strong,
.rd-preference-row small { display: block; }
.rd-preference-row small { color: var(--muted); }
.rd-preference-row input { width: 1.2rem; min-height: 1.2rem; }

.article-grid,
.principle-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.article-grid article,
.principle-grid article { min-height: 330px; display: flex; flex-direction: column; padding: clamp(1.5rem, 3vw, 2.5rem); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.article-grid h2,
.principle-grid h2 { font-size: 2rem; }
.article-grid article > p:not(.eyebrow),
.principle-grid article > p { color: var(--muted); }
.article-grid .text-link { margin-top: auto; }
.principle-grid article > span { margin-bottom: 3rem; color: var(--muted); font-size: .75rem; font-weight: 800; }
.callout { display: flex; justify-content: space-between; gap: 2rem; align-items: center; padding: clamp(2rem, 5vw, 4rem); color: var(--paper); background: var(--ink); }
.callout h2 { margin: 0; }
.callout .button { color: var(--ink); border-color: var(--paper); background: var(--paper); }

.policy-page,
.prose-page { max-width: 880px; padding-block: clamp(4rem, 8vw, 8rem); }
.policy-page header { padding-bottom: 2rem; border-bottom: 2px solid var(--ink); }
.policy-page h1,
.prose-page h1 { font-size: clamp(2.8rem, 7vw, 5rem); }
.policy-lead { color: var(--muted); font-size: 1.15rem; }
.policy-page section { padding-block: 2rem; border-bottom: 1px solid var(--line); }
.policy-page section h2 { font-size: 1.7rem; }
.policy-page section p { color: var(--charcoal); }
.policy-header { margin-bottom: 1.5rem; }
.policy-toc { margin: 1.5rem 0 2rem; padding: 1.25rem 1.5rem; border: 1px solid var(--line); background: var(--soft); }
.policy-toc ul { columns: 2; margin-bottom: 0; }
.policy-toc a { text-underline-offset: .2em; }
.compliance-draft,
.legal-draft-note,
.compliance-warning,
.compliance-launch-warning,
.owner-input-required { padding: 1rem 1.25rem; border-left: 4px solid var(--warning); background: #fff3e6; }
.compliance-warning,
.compliance-launch-warning { margin: 0; border-bottom: 1px solid #d79b5a; }
.owner-input-required { display: inline-block; font-weight: 800; }
.calculator-privacy-note,
.contextual-disclaimer { margin: 1rem 0; padding: 1rem 1.25rem; border-left: 4px solid var(--positive); background: var(--soft); }
.print-copyright { display: none; }
.policy-page table { width: 100%; border-collapse: collapse; }
.policy-page th,
.policy-page td { padding: .75rem; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.adsense-slot,
.advertisement { min-height: 90px; margin-block: 2rem; padding: 1rem; border: 1px dashed var(--line); text-align: center; }
.adsense-label,
.advertisement-label { display: block; margin-bottom: .5rem; color: var(--muted); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }

.error-page { min-height: min(62vh, 38rem); padding-block: clamp(4rem, 10vw, 8rem); }
.error-page h1 { margin-bottom: 1rem; font-size: clamp(3rem, 8vw, 6rem); }
.error-page > p:not(.eyebrow) { max-width: 52ch; color: var(--muted); font-size: 1.1rem; }
.error-recovery { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 2rem; }

.site-footer { padding-block: 4rem 2rem; color: var(--paper); background: var(--ink); }
.footer-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr; gap: 3rem; }
.wordmark-footer { display: inline-block; margin-bottom: .8rem; font-size: 1.55rem; }
.footer-grid p { color: #abb0b3; }
.footer-links { display: flex; align-items: flex-start; flex-direction: column; gap: .65rem; }
.footer-links a,
.footer-links button { color: var(--paper); font-size: .82rem; }
.footer-legal { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid #494d50; display: flex; justify-content: space-between; gap: 2rem; color: #abb0b3; font-size: .72rem; }
.footer-legal p:first-child { max-width: 800px; }

@media (max-width: 960px) {
  .calculator-layout { grid-template-columns: 1fr; }
  .calculator-results { position: static; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-proof { max-width: 520px; }
  .article-grid,
  .principle-grid { grid-template-columns: 1fr; }
  .article-grid article,
  .principle-grid article { min-height: 240px; }
  .rd-privacy-panel { grid-template-columns: 1fr; gap: .65rem; }
}

@media (max-width: 760px) {
  h1 { max-width: 14ch; }
  .nav-toggle { display: flex; }
  .primary-navigation { display: none; position: absolute; top: 76px; right: 0; left: 0; padding: 1rem; border-bottom: 1px solid var(--line); background: var(--paper); }
  .primary-navigation[data-open] { display: block; }
  .primary-navigation .menu { align-items: stretch; flex-direction: column; gap: 0; }
  .primary-navigation a { display: block; padding: .85rem; }
  .split-heading,
  .feature-grid,
  .confidence-grid,
  .about-grid,
  .explanation-grid,
  .download-grid,
  .footer-grid { grid-template-columns: 1fr; }
  .tool-grid,
  .directory-grid { grid-template-columns: 1fr; }
  .tool-card,
  .directory-card { min-height: 260px; }
  .field-grid { grid-template-columns: 1fr; }
  .calculator-form-heading,
  .calculator-toolbar { align-items: stretch; flex-direction: column; }
  .result-grid,
  .target-grid { grid-template-columns: 1fr 1fr; }
  .expense-head { display: none; }
  .expense-row { grid-template-columns: minmax(0, 1fr) minmax(110px, .65fr); }
  .icon-check { min-height: 36px; }
  .footer-links { justify-content: flex-start; }
  .policy-toc ul { columns: 1; }
  .footer-legal { flex-direction: column; }
  .callout { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 520px) {
  .shell { width: min(calc(100% - 1.25rem), var(--shell)); }
  .narrow-left { margin-inline: .625rem; }
  .hero { min-height: auto; }
  .page-hero,
  .calculator-hero { padding-block: 4rem; }
  .calculator-shell { width: 100%; padding-top: 0; }
  .calculator-form { border-right: 0; border-left: 0; box-shadow: none; }
  .calculator-results { padding-inline: .625rem; }
  .result-grid,
  .target-grid { grid-template-columns: 1fr; }
  .result-card { min-height: 100px; }
  .rd-privacy-panel { right: .5rem; bottom: .5rem; left: .5rem; width: calc(100% - 1rem); padding: .75rem; }
  .rd-choice-controls,
.rd-dialog-actions { align-items: stretch; flex-direction: column; }
  .rd-choice-controls .button,
.rd-dialog-actions .button { width: 100%; }
  .expense-row { grid-template-columns: 1fr; }
  .optional-expense .icon-check:last-child { grid-column: auto; }
  .schedule-controls { align-items: stretch; flex-direction: column; }
}

/* 1.2.6 narrow-screen refinements */
@media (max-width: 520px) {
  .rd-privacy-panel { max-height: 64vh; gap: .45rem; padding: .55rem .65rem; }
  .rd-privacy-panel h2 { margin-bottom: .15rem; font-size: .96rem; }
  .rd-privacy-panel p:last-child { font-size: .7rem; line-height: 1.35; }
  .rd-choice-controls,
.rd-dialog-actions { gap: .4rem; }
  .rd-choice-controls .button,
.rd-dialog-actions .button { min-height: 42px; padding: .5rem .65rem; }

  .sensitivity-table { table-layout: auto; font-size: .72rem; }
  .sensitivity-table th,
  .sensitivity-table td { padding: .5rem .45rem; }
  .sensitivity-table thead th:first-child,
  .sensitivity-table tbody th { width: 5.35rem; min-width: 5.35rem; max-width: 5.35rem; white-space: normal; line-height: 1.15; }
  .sensitivity-table thead th:not(:first-child),
  .sensitivity-table td { min-width: 4.75rem; }

  .schedule-details { margin-inline: -.15rem; }
  .schedule-controls { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin-bottom: .65rem; }
  .schedule-controls .segmented-control,
  .schedule-controls label { grid-column: 1 / -1; width: 100%; }
  .schedule-controls label { justify-content: space-between; gap: .4rem; }
  .schedule-controls select { min-width: 0; width: min(68%, 12rem); }
  .schedule-controls .button { width: 100%; min-height: 42px; padding: .5rem .35rem; }
  .segmented-control { width: 100%; }
  .segmented-control button { flex: 1 1 50%; min-height: 38px; padding: .45rem .55rem; }
  .schedule-scroll-top { height: .8rem; margin-bottom: .15rem; }
  .schedule-viewport { min-height: 20rem; height: 24rem; }
  .schedule-table { font-size: .68rem; }
  .schedule-table th,
  .schedule-table td { padding: .45rem .48rem; }
  .schedule-table th:first-child,
  .schedule-table td:first-child { min-width: 3.5rem; }

  .target-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 360px) {
  .rd-privacy-panel { max-height: 60vh; }
  .rd-privacy-panel p:last-child { font-size: .68rem; }
  .sensitivity-table thead th:first-child,
  .sensitivity-table tbody th { width: 4.8rem; min-width: 4.8rem; max-width: 4.8rem; }
  .sensitivity-table thead th:not(:first-child),
  .sensitivity-table td { min-width: 4.4rem; }
}

@media print {
  .site-header,
  .site-footer,
  .calculator-hero,
  .calculator-form,
  .section-neutral,
  .related-tools,
  .rd-privacy-panel,
  .schedule-controls,
  .print-summary,
  .result-disclaimer { display: none !important; }
  .calculator-shell { width: 100%; padding: 0; }
  .calculator-layout { display: block; }
  .calculator-results { position: static; }
  .result-details { break-inside: auto; }
  .result-details:not([open]) > *:not(summary) { display: block; }
  .table-scroll { overflow: visible; border: 0; }
  .schedule-scroll-top { display: none !important; }
  .schedule-viewport { width: 100%; height: auto !important; min-height: 0; max-height: none !important; border: 0; overflow: visible !important; resize: none; }
  .data-table { font-size: 7pt; white-space: normal; }
  .data-table th { position: static; color: var(--ink); background: var(--soft); }
  .schedule-table th:first-child,
  .schedule-table td:first-child { position: static; box-shadow: none; }
  .print-copyright { display: block; }
  a { text-decoration: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* 1.2.7 founder story and annual schedule refinements */
.founder-story {
  max-width: 940px;
}
.founder-story article {
  padding-block: clamp(2.25rem, 5vw, 4rem);
  border-top: 1px solid var(--line);
}
.founder-story article:first-child {
  padding-top: 0;
  border-top: 0;
}
.founder-story article:last-child {
  padding-bottom: 0;
}
.founder-story article > p,
.founder-story article > ul {
  max-width: 76ch;
}
.founder-quote {
  margin: 1.5rem 0 0;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--ink);
  background: var(--paper);
}
.founder-quote p {
  margin: 0;
  color: var(--ink) !important;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 800;
  line-height: 1.35;
}
.annual-schedule-viewport {
  position: relative;
}
.annual-schedule-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
}
.annual-schedule-table thead th:first-child {
  z-index: 5;
}


/* 1.2.8 mobile consent, legal, and launch-readiness refinements */
.rd-privacy-copy { min-width: 0; }
.rd-choice-controls { flex: 0 0 auto; }

@supports (height: 100dvh) {
  dialog { max-height: calc(100dvh - 2rem); }
}

@media (max-width: 520px) {
  .rd-privacy-panel {
    right: max(.5rem, env(safe-area-inset-right));
    bottom: max(.5rem, env(safe-area-inset-bottom));
    left: max(.5rem, env(safe-area-inset-left));
    width: auto;
    max-height: min(72svh, 34rem);
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: .55rem;
    padding: .65rem;
    overflow: hidden;
  }

  @supports (height: 100dvh) {
    .rd-privacy-panel { max-height: min(72dvh, 34rem); }
  }

  .rd-privacy-copy {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .rd-choice-controls {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: .4rem;
    padding-top: .1rem;
    background: var(--ink);
  }

  .rd-choice-controls .button {
    min-height: 44px;
    width: 100%;
  }

  .rd-preference-dialog {
    width: calc(100% - 1rem);
    max-height: calc(100svh - 1rem);
    margin: auto;
    overflow: hidden;
  }

  @supports (height: 100dvh) {
    .rd-preference-dialog { max-height: calc(100dvh - 1rem); }
  }

  .rd-preference-dialog form {
    max-height: inherit;
    display: flex;
    flex-direction: column;
    padding: .9rem;
    overflow: hidden;
  }

  .rd-preference-dialog .rd-preference-list {
    flex: 1 1 auto;
    min-height: 0;
    margin-block: .75rem;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .rd-preference-dialog .rd-dialog-actions {
    flex: 0 0 auto;
    padding-top: .5rem;
    background: var(--paper);
  }
}
/* 1.2.9 Brave Shields and privacy-control resilience */
.rd-privacy-panel,
.rd-choice-controls,
.rd-choice-button,
.rd-preference-dialog,
.rd-preference-list,
.rd-preference-row,
.rd-dialog-actions {
  box-sizing: border-box;
}
.rd-choice-controls,
.rd-dialog-actions {
  visibility: visible;
  opacity: 1;
}
.rd-choice-button {
  visibility: visible;
  opacity: 1;
}
.rd-preference-dialog .rd-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
}
@media (max-width: 520px) {
  .rd-choice-controls {
    display: grid;
    grid-template-columns: 1fr;
  }
  .rd-dialog-actions {
    display: flex;
    align-items: stretch;
    flex-direction: column;
  }
  .rd-dialog-actions .button {
    width: 100%;
  }
}
.rd-privacy-panel[hidden] { display: none !important; }


/* 1.2.10 final legal-readiness corrections */
