/* =====================================================================
   Wills For Texas — site styles
   Palette from the Texas flag in the existing logo; Libre Caslon for the
   document voice, Atkinson Hyperlegible for everything people fill in.
   ===================================================================== */

:root {
  --ink: #14233f;          /* flag navy — text, headings */
  --ink-soft: #2b3a55;
  --red: #b4162c;          /* flag red — primary actions */
  --red-dark: #8e1023;
  --paper: #ffffff;
  --ground: #f2f4f7;       /* page background */
  --rule: #cdd4df;
  --rule-soft: #e3e8ef;
  --muted: #556074;
  --ok: #2f6b4f;
  --ok-bg: #e9f4ee;
  --warn: #7a4f00;
  --warn-bg: #fff4d6;
  --err: #a1121f;
  --err-bg: #fdecee;
  --info-bg: #eaf0f8;
  --focus: #1b66c9;

  --serif: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --sans: "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif;

  --radius: 4px;
  --wrap: 1160px;
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.6;
}

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

a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--red); }

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

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.2; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: 2.5rem; letter-spacing: -.01em; }
h2 { font-size: 1.85rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.05rem; margin: 0 0 .4em; }
p { margin: 0 0 1em; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }
.center { text-align: center; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------- Header */

.site-header { background: var(--paper); border-bottom: 1px solid var(--rule); }
.site-header::before { content: ""; display: block; height: 5px; background: linear-gradient(90deg, var(--ink) 0 33.33%, var(--red) 33.33% 100%); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 72px; }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 42px; height: 28px; flex: none; border: 1px solid var(--rule); }
.brand-name { font-family: var(--serif); font-size: 1.45rem; white-space: nowrap; }
.brand:hover { color: var(--ink); }

.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a { text-decoration: none; font-size: 1rem; }
.site-nav a:hover { text-decoration: underline; }
.site-nav form { margin: 0; }
.nav-menu { display: none; }

@media (max-width: 860px) {
  .site-nav { display: none; }
  .nav-menu { display: block; position: relative; }
  .nav-menu summary { list-style: none; cursor: pointer; border: 1px solid var(--rule); border-radius: var(--radius); padding: 6px 14px; font-size: 1rem; }
  .nav-menu summary::-webkit-details-marker { display: none; }
  .nav-menu[open] .site-nav {
    display: flex; flex-direction: column; align-items: stretch; gap: 0;
    position: absolute; right: 0; top: calc(100% + 8px); width: 240px; z-index: 50;
    background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 6px 0;
    box-shadow: 0 8px 24px rgba(20, 35, 63, .12);
  }
  .nav-menu[open] .site-nav a, .nav-menu[open] .site-nav button.linklike { padding: 10px 16px; text-align: left; }
  .nav-menu[open] .site-nav .btn { margin: 8px 16px; }
}

/* ---------------------------------------------------------- Buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 20px;
  border: 2px solid transparent; border-radius: var(--radius);
  font-family: var(--sans); font-size: 1rem; font-weight: 700; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-secondary { background: var(--paper); color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--ink); color: #fff; }
.btn-quiet { background: transparent; color: var(--ink); border-color: transparent; text-decoration: underline; padding-left: 6px; padding-right: 6px; }
.btn-quiet:hover { color: var(--red); }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn-danger { background: var(--paper); color: var(--err); border-color: var(--err); }
.btn-danger:hover { background: var(--err); color: #fff; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

button.linklike { background: none; border: none; padding: 0; font: inherit; font-size: 1rem; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
button.linklike:hover { color: var(--red); }

/* ---------------------------------------------------------- Page sections */

.page { padding: 48px 0 72px; }
.page-head { margin-bottom: 28px; }
.page-head .lede { font-size: 1.15rem; color: var(--ink-soft); max-width: 60ch; }

.panel { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 28px; }
.panel + .panel { margin-top: 20px; }
.panel h2 { font-size: 1.45rem; }

.prose { max-width: 70ch; }
.prose h2 { margin-top: 1.6em; font-size: 1.5rem; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .4em; }

/* ---------------------------------------------------------- Notices */

.notice { border-left: 4px solid var(--ink); background: var(--info-bg); padding: 14px 18px; margin: 0 0 20px; border-radius: 0 var(--radius) var(--radius) 0; }
.notice p:last-child, .notice ul:last-child { margin-bottom: 0; }
.notice ul { margin: .4em 0 0; padding-left: 1.2em; }
.notice-warn { border-color: #c98a00; background: var(--warn-bg); color: #4a3200; }
.notice-error { border-color: var(--err); background: var(--err-bg); color: #5e0a12; }
.notice-ok { border-color: var(--ok); background: var(--ok-bg); color: #173a2a; }

.disclaimer-line { font-size: .9rem; color: var(--muted); border-top: 1px solid var(--rule); padding-top: 12px; margin-top: 24px; }

.validation-summary-valid { display: none; }
.validation-summary-errors { border-left: 4px solid var(--err); background: var(--err-bg); color: #5e0a12; padding: 12px 18px; margin-bottom: 20px; }
.validation-summary-errors ul { margin: 0; padding-left: 1.2em; }

/* ---------------------------------------------------------- Forms */

fieldset { border: none; margin: 0 0 28px; padding: 0; min-width: 0; }
legend { font-family: var(--serif); font-size: 1.3rem; padding: 0; margin-bottom: 6px; }
fieldset > .hint:first-of-type { margin-top: -2px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }
@media (max-width: 680px) {
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-weight: 700; font-size: 1rem; }
.optional { font-weight: 400; color: var(--muted); }
.hint { font-size: .92rem; color: var(--muted); margin: 0; }

input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="number"], input[type="tel"], input[type="search"],
select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px;
  border: 1.5px solid #9aa6b8; border-radius: var(--radius); background: #fff;
  font-family: var(--sans); font-size: 1.05rem; color: var(--ink);
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); outline: 3px solid rgba(27, 102, 201, .25); outline-offset: 0; }
input[readonly] { background: var(--ground); }
.input-error, .input-validation-error { border-color: var(--err) !important; }
.field-validation-error, .field-error { color: var(--err); font-size: .92rem; font-weight: 700; }
.field-validation-valid { display: none; }

.check { display: flex; align-items: flex-start; gap: 12px; padding: 4px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 3px; flex: none; accent-color: var(--red); }
.check span { flex: 1; }

/* Radio choices presented as selectable rows */
.choices { display: grid; gap: 10px; }
.choice { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid var(--rule); border-radius: var(--radius); background: #fff; cursor: pointer; }
.choice input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--red); }
.choice > span { min-width: 0; overflow-wrap: break-word; }
.choice strong { display: block; }
.choice .hint { margin-top: 2px; }
.choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 4px 0 0 var(--red); }
.choices.inline { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* Repeating rows (children, gifts, beneficiaries) */
.repeater { display: grid; gap: 14px; margin-bottom: 12px; }
.repeater-row { position: relative; border: 1px solid var(--rule); border-left: 4px solid var(--ink); border-radius: var(--radius); padding: 18px 18px 14px; background: #fbfcfd; }
.repeater-row .row-title { font-weight: 700; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.repeater-empty { color: var(--muted); font-style: italic; margin: 0 0 10px; }

.conditional[hidden] { display: none !important; }

/* ---------------------------------------------------------- Wizard */

.wizard { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 36px; align-items: start; padding: 36px 0 80px; }
.wizard-side { position: sticky; top: 20px; }
.wizard-side .will-name { font-family: var(--serif); font-size: 1.1rem; margin: 0 0 14px; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; border-left: 2px solid var(--rule); }
.steps li { counter-increment: step; margin: 0; }
.steps a, .steps span.step-link {
  display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center;
  padding: 8px 0 8px 14px; margin-left: -2px; border-left: 2px solid transparent;
  text-decoration: none; color: var(--ink-soft); font-size: 1rem; line-height: 1.3;
}
.steps a::before, .steps span.step-link::before {
  content: counter(step); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid #9aa6b8; font-size: .85rem; font-weight: 700; color: var(--ink-soft); background: #fff;
}
.steps li.is-done a::before { content: "✓"; background: var(--ok); border-color: var(--ok); color: #fff; }
.steps li.is-current a { border-left-color: var(--red); color: var(--ink); font-weight: 700; }
.steps li.is-current a::before { border-color: var(--red); color: var(--red); }
.steps a:hover { color: var(--red); }
.wizard-side .side-note { font-size: .88rem; color: var(--muted); margin-top: 18px; }

.step-progress { display: none; }

.step-panel { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); padding: 32px 36px; }
.step-panel > h1 { font-size: 2.1rem; margin-bottom: .3em; }
.step-panel > .lede { color: var(--ink-soft); font-size: 1.08rem; margin-bottom: 26px; max-width: 62ch; }

.step-actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  margin: 32px -36px -32px; padding: 18px 36px; border-top: 1px solid var(--rule); background: #f8f9fb;
  position: sticky; bottom: 0; border-radius: 0 0 var(--radius) var(--radius);
}
.step-actions .left, .step-actions .right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.readonly-banner { margin-bottom: 20px; }

@media (max-width: 900px) {
  .wizard { grid-template-columns: 1fr; gap: 16px; padding-top: 20px; }
  .wizard-side { position: static; }
  .wizard-side .steps, .wizard-side .side-note { display: none; }
  .step-progress { display: block; font-size: .95rem; color: var(--ink-soft); }
  .step-progress progress { width: 100%; height: 8px; accent-color: var(--red); }
  .step-panel { padding: 22px 18px; }
  .step-actions { margin: 28px -18px -22px; padding: 14px 18px; position: static; }
  .step-panel > h1 { font-size: 1.75rem; }
}

/* Review page */
.review-section { border-top: 1px solid var(--rule); padding: 18px 0; }
.review-section:first-of-type { border-top: none; }
.review-section header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.review-section h2 { font-size: 1.3rem; margin: 0 0 8px; }
.kv { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 6px 18px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
@media (max-width: 600px) { .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: 8px; } }

/* ---------------------------------------------------------- The will on paper */

.doc-frame { background: #dfe4eb; padding: 28px; border-radius: var(--radius); overflow-x: auto; }
.doc-paper {
  position: relative; overflow: hidden;
  max-width: 8.5in; margin: 0 auto; padding: 0.9in 0.9in 1in;
  background: #fff; color: #111;
  font-family: var(--serif); font-size: 15px; line-height: 1.65;
  box-shadow: 0 1px 2px rgba(20, 35, 63, .18), 0 10px 30px rgba(20, 35, 63, .12);
}
.doc-watermark {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  font-family: var(--sans); font-weight: 700; font-size: 3.2rem; line-height: 1.1; text-align: center;
  color: rgba(180, 22, 44, .10); transform: rotate(-30deg);
}
.doc-title { font-family: var(--serif); text-align: center; font-size: 1.3rem; font-weight: 700; margin: 0; letter-spacing: .02em; }
.doc-heading { font-family: var(--serif); text-align: center; font-size: 1rem; font-weight: 700; margin: 1em 0 .2em; }
.doc-subheading { font-family: var(--serif); font-size: 1.05rem; font-weight: 700; margin: 1.2em 0 .4em; }
.doc-p { text-align: justify; margin: 0 0 .8em; hyphens: auto; }
.doc-center { text-align: center; }
.doc-bullet { margin: 0 0 .5em 1.4em; position: relative; }
.doc-bullet::before { content: "•"; position: absolute; left: -1em; }
.doc-callout { background: #f3f4f6; border-left: 3px solid var(--red); padding: 10px 14px; margin: .8em 0; }
.doc-sig { display: flex; flex-direction: column; width: 300px; max-width: 100%; margin: 1.6em 0 .4em; }
.doc-sig-line { border-bottom: 1px solid #111; height: 1.6em; }
.doc-sig-caption { font-size: .85em; }
.doc-pagebreak { border: none; border-top: 2px dashed #b9c1cc; margin: 2.2em -0.9in; }
.doc-group { break-inside: avoid; }

@media (max-width: 700px) {
  .doc-frame { padding: 10px; margin: 0 -10px; }
  .doc-paper { padding: 28px 22px; font-size: 14px; }
  .doc-pagebreak { margin: 2em -22px; }
}

/* ---------------------------------------------------------- Home page */

.hero { background: var(--paper); border-bottom: 1px solid var(--rule); }
.hero-inner { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 56px; align-items: center; padding: 64px 20px 72px; }
.hero h1 { font-size: 3.1rem; line-height: 1.08; margin-bottom: .45em; }
.hero .lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 18px; }
.hero-note { font-size: .92rem; color: var(--muted); max-width: 48ch; }

.sheet-stage { position: relative; }
.sheet-stage::before { /* the page beneath */
  content: ""; position: absolute; inset: 10px -10px -10px 10px;
  background: #f7f8fa; border: 1px solid #d7dde6; transform: rotate(1.6deg);
}
.sheet {
  position: relative;
  background: #fff; border: 1px solid #d7dde6; padding: 44px 46px 40px;
  font-family: var(--serif); color: #121a2b; font-size: 15.5px; line-height: 1.7;
  box-shadow: 0 2px 3px rgba(20, 35, 63, .08), 0 18px 40px rgba(20, 35, 63, .14);
  transform: rotate(-1.2deg);
}
.sheet-title { text-align: center; font-weight: 700; letter-spacing: .03em; margin: 0 0 2px; }
.sheet-name { text-align: center; font-weight: 700; margin: 0 0 18px; min-height: 1.7em; }
.sheet p { text-align: justify; margin: 0 0 12px; }
.sheet .fill {
  background: linear-gradient(transparent 62%, rgba(180, 22, 44, .16) 62%);
  padding: 0 2px; font-weight: 700; transition: background-color .2s;
}
.sheet .fill.is-blank { font-weight: 400; color: #8a93a3; background: none; border-bottom: 1px solid #8a93a3; }
.sheet-faded { color: #8a93a3; }
.sheet-sig { margin-top: 26px; width: 58%; border-bottom: 1px solid #121a2b; height: 26px; }
.sheet-sig-cap { font-size: .8rem; }

.try-it { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 30px; }
.try-it label { font-size: .9rem; font-weight: 700; display: block; margin-bottom: 4px; }
.try-it input { min-height: 42px; font-size: 1rem; }

@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; padding-top: 40px; }
  .hero h1 { font-size: 2.4rem; }
  .sheet { transform: none; padding: 28px 22px; }
  .sheet-stage::before { display: none; }
}
@media (max-width: 520px) { .try-it { grid-template-columns: 1fr; } }

.band { padding: 64px 0; }
.band + .band { border-top: 1px solid var(--rule); }
.band-white { background: var(--paper); }
.band h2 { font-size: 2rem; }
.band .intro { max-width: 62ch; color: var(--ink-soft); margin-bottom: 30px; }

.how { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; counter-reset: how; border-top: 2px solid var(--ink); }
.how li { counter-increment: how; padding: 22px 22px 0 0; }
.how li + li { padding-left: 22px; border-left: 1px solid var(--rule); }
.how li::before { content: counter(how); display: block; font-family: var(--serif); font-size: 2.6rem; line-height: 1; color: var(--red); margin-bottom: 12px; }
.how h3 { font-size: 1.2rem; }
.how p { font-size: 1rem; color: var(--ink-soft); }
@media (max-width: 900px) {
  .how { grid-template-columns: 1fr 1fr; }
  .how li:nth-child(3) { padding-left: 0; border-left: none; }
}
@media (max-width: 560px) {
  .how { grid-template-columns: 1fr; }
  .how li + li { padding-left: 0; border-left: none; border-top: 1px solid var(--rule); }
}

.compare { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--rule); }
.compare th, .compare td { padding: 14px 18px; border-bottom: 1px solid var(--rule-soft); text-align: left; vertical-align: top; }
.compare thead th { font-family: var(--serif); font-weight: 400; font-size: 1.25rem; border-bottom: 2px solid var(--ink); }
.compare thead th .price { display: block; font-family: var(--sans); font-weight: 700; font-size: 2rem; color: var(--ink); margin-top: 4px; }
.compare td.yes::before { content: "✓ "; color: var(--ok); font-weight: 700; }
.compare td.no { color: var(--muted); }
.compare tfoot td { border-bottom: none; padding-top: 20px; padding-bottom: 22px; }
.compare .col-feature { width: 44%; }
.compare .featured { background: #fbf6f7; }
@media (max-width: 700px) {
  .compare th, .compare td { padding: 10px 8px; font-size: .95rem; }
  .compare thead th .price { font-size: 1.4rem; }
  .compare .col-feature { width: 40%; }
  .compare tfoot .btn { white-space: normal; padding: 8px 10px; }
}

.provisions { columns: 2; column-gap: 48px; padding: 0; list-style: none; margin: 0; }
.provisions li { break-inside: avoid; padding: 10px 0; border-bottom: 1px solid var(--rule-soft); }
.provisions strong { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.15rem; }
.provisions span { color: var(--ink-soft); font-size: 1rem; }
@media (max-width: 760px) { .provisions { columns: 1; } }

.faq details { border-bottom: 1px solid var(--rule); padding: 4px 0; }
.faq summary { cursor: pointer; font-family: var(--serif); font-size: 1.2rem; padding: 14px 32px 14px 0; position: relative; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font-family: var(--sans); font-size: 1.5rem; color: var(--red); }
.faq details[open] summary::after { content: "–"; }
.faq details > div { padding: 0 0 16px; max-width: 70ch; color: var(--ink-soft); }

/* ---------------------------------------------------------- Dashboard & tables */

.will-list { display: grid; gap: 14px; }
.will-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; background: var(--paper); border: 1px solid var(--rule); border-left: 4px solid var(--ink); border-radius: var(--radius); padding: 20px 22px; }
.will-row h2 { font-size: 1.35rem; margin: 0 0 4px; }
.will-row .meta { font-size: .92rem; color: var(--muted); margin: 0; }
.will-row .actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 680px) { .will-row { grid-template-columns: 1fr; } .will-row .actions { justify-content: flex-start; } }

.status { display: inline-block; font-size: .82rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; border: 1px solid currentColor; vertical-align: middle; }
.status-draft { color: var(--muted); }
.status-purchased { color: var(--ok); }
.status-review { color: #8a5a00; }
.status-changes { color: var(--err); }
.status-approved { color: var(--ok); background: var(--ok-bg); }

.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: .97rem; }
table.data th, table.data td { padding: 12px 14px; border-bottom: 1px solid var(--rule-soft); text-align: left; vertical-align: top; }
table.data th { font-size: .9rem; color: var(--muted); font-weight: 700; background: #f8f9fb; }
table.data tr:last-child td { border-bottom: none; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs a { text-decoration: none; padding: 8px 14px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); font-size: .95rem; }
.tabs a.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
@media (max-width: 980px) { .two-col { grid-template-columns: 1fr; } }

.downloads { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.downloads li { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: var(--radius); background: #fbfcfd; flex-wrap: wrap; }
.downloads .file-name { font-weight: 700; }
.downloads .file-desc { display: block; font-size: .9rem; color: var(--muted); font-weight: 400; }

/* Messages */
.thread { display: grid; gap: 12px; margin-bottom: 18px; }
.msg { border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 16px; background: #fff; }
.msg-staff { border-left: 4px solid var(--red); }
.msg-client { border-left: 4px solid var(--ink); background: #fbfcfd; }
.msg-internal { border-left: 4px dashed #c98a00; background: var(--warn-bg); }
.msg header { font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.msg .body { white-space: pre-wrap; }

/* ---------------------------------------------------------- Auth */

.auth { max-width: 480px; margin: 0 auto; }
.auth .panel { padding: 32px; }
.auth .form-stack { display: grid; gap: 16px; }
.auth .alt { margin-top: 18px; font-size: .97rem; }

/* ---------------------------------------------------------- Footer */

.site-footer { background: var(--ink); color: #dfe5ee; padding: 44px 0 36px; font-size: .95rem; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: #ffd6dc; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer-grid h2 { color: #fff; font-size: 1.15rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-legal { border-top: 1px solid rgba(255, 255, 255, .18); margin-top: 28px; padding-top: 18px; font-size: .88rem; color: #c3cbd8; }
.footer-legal strong { color: #fff; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------------------------------------------------------- Print (document preview) */

/* ------------------------------------------------------------------ Documents beyond the will */

.wizard-side .side-docs { font-size: .88rem; color: var(--muted); margin: -8px 0 14px; }
.wizard-side .side-docs a { margin-left: 4px; }

/* "Use someone you've already named" */
.person-pick { margin: 4px 0 14px; }
.person-pick select { max-width: 100%; min-height: 40px; font-size: .95rem; }

.power-list { margin: 14px 0 0 4px; padding-left: 14px; border-left: 3px solid var(--rule); }

/* Optional sections tucked away behind a summary line */
.fieldset-details { border-top: 1px solid var(--rule-soft); padding: 16px 0 6px; margin: 8px 0 18px; }
.fieldset-details > summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; }

.name-list { margin: 10px 0 0; padding-left: 1.2em; }

/* Document chooser (start page, add documents) */
.doc-chooser { display: grid; gap: 10px; }
.doc-choice > span { flex: 1; min-width: 0; }   /* fill the row so the price sits at the right edge */
.doc-choice strong { display: flex; justify-content: space-between; gap: 12px; }
.doc-choice .doc-price { font-weight: 700; color: var(--ink); white-space: nowrap; }
.doc-choice.is-owned { background: var(--ground); cursor: default; }
.doc-choice.is-owned .doc-price { color: var(--ok); }
.bundle-note { margin: 14px 0 0; font-size: .95rem; color: var(--ink-soft); }
.bundle-note [data-bundle-summary] { display: block; margin-top: 4px; font-weight: 700; color: var(--ink); }

/* Checkout summary */
.order-summary { margin: 24px 0 18px; padding: 18px 20px; border: 1.5px solid var(--ink); border-radius: var(--radius); background: #fff; }
.order-summary h2 { font-size: 1.2rem; margin: 0 0 10px; }
.order-summary dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 18px; margin: 0; }
.order-summary dt { color: var(--ink-soft); }
.order-summary dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.order-total { display: flex; justify-content: space-between; align-items: baseline; margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 1.1rem; }
.order-total strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }

/* Several document previews on one page */
.doc-preview { margin-top: 28px; }
.doc-preview > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.doc-preview > summary::-webkit-details-marker { display: none; }
.doc-preview > summary::before { content: "+"; font-weight: 700; width: 1em; color: var(--red); }
.doc-preview[open] > summary::before { content: "–"; }
.doc-preview > summary h2, .doc-preview > summary h3 { margin: 0; }

.downloads .file-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.addon-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }

.settings-sub { font-size: 1.05rem; margin: 22px 0 10px; }
.settings-sub:first-of-type { margin-top: 8px; }

/* Crossed-out choices in the statutory forms */
.doc-paper s { text-decoration-thickness: 1.5px; color: #4b5563; }

/* Pricing component */
.price-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; align-items: start; }
.price-list { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--rule); }
.price-list th, .price-list td { padding: 14px 18px; border-bottom: 1px solid var(--rule-soft); text-align: left; vertical-align: top; }
.price-list thead th { font-family: var(--serif); font-weight: 400; font-size: 1.15rem; border-bottom: 2px solid var(--ink); }
.price-list tbody th { font-weight: 400; }
.price-list tbody th strong { display: block; font-size: 1.05rem; }
.price-list tbody th span { display: block; color: var(--muted); font-size: .92rem; margin-top: 2px; }
.price-list .num { text-align: right; white-space: nowrap; font-weight: 700; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.price-side { display: grid; gap: 16px; }
.bundle-card { background: var(--paper); border: 1px solid var(--rule); border-top: 4px solid var(--red); border-radius: var(--radius); padding: 20px 22px; }
.bundle-card h3 { margin: 0 0 12px; font-size: 1.2rem; display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.bundle-card .price-tag { font-family: var(--sans); font-weight: 700; color: var(--ink); }
.review-card { border-top-color: var(--ink); }
.tiers { list-style: none; margin: 0 0 12px; padding: 0; }
.tiers li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--rule); }
.tiers li strong { color: var(--red); }
.bundle-example { margin: 0 0 6px; }
@media (max-width: 900px) { .price-grid { grid-template-columns: 1fr; } }

@media print {
  .site-header, .site-footer, .no-print, .wizard-side, .step-actions { display: none !important; }
  body { background: #fff; }
  .doc-frame { background: none; padding: 0; }
  .doc-paper { box-shadow: none; padding: 0; max-width: none; }
  .doc-pagebreak { break-after: page; border: none; margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Outer wrapper fieldset on interview steps (disabled when the will is locked). */
fieldset.step-fields { margin: 0; }
fieldset.step-fields > fieldset:last-child { margin-bottom: 0; }
