:root {
  font-family: system-ui, -apple-system, sans-serif;
  color: #172b23;
  background: #fff;
  line-height: 1.5;
  --green: #20543e;
  --muted: #50635a;
  --line: #dce7e0;
  --surface: #f1f7f3;
  --error: #a22120;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 24px; }
body { margin: 0; }
[hidden] { display: none !important; }
.shell { width: min(1100px, calc(100% - 40px)); margin: auto; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
nav { display: flex; align-items: center; gap: clamp(10px, 3vw, 26px); }
a { color: var(--green); text-underline-offset: 4px; }
nav a { font-size: .9rem; font-weight: 650; text-decoration: none; padding: 10px 0; }
nav a:hover, nav a[aria-current] { text-decoration: underline; }
.brand { color: inherit; font-size: clamp(1rem, 4vw, 1.35rem); font-weight: 800; text-decoration: none; }
h1, h2, h3, p { margin: 0 0 12px; }
h1, h2 { line-height: 1.05; letter-spacing: -.045em; }
h1 { font-size: clamp(3rem, 8vw, 6.25rem); font-weight: 800; }
h2 { font-size: clamp(2rem, 4.2vw, 3.4rem); font-weight: 750; }
h3 { font-size: 1.125rem; }
.muted, .lead, .steps p, .pricing p, .write-intro p { color: var(--muted); }
.lead { max-width: 34ch; font-size: clamp(1.125rem, 2vw, 1.35rem); margin: 20px 0 26px; }
.button, button {
  display: inline-flex; justify-content: center; align-items: center; min-height: 52px;
  padding: 12px 22px; border-radius: 8px; border: 1px solid transparent;
  background: var(--green); color: white; text-decoration: none;
  font: inherit; font-weight: 700; cursor: pointer; text-align: center;
}
.button:hover, button:hover { background: #163c2c; }
button:disabled { opacity: .6; cursor: wait; }
:focus-visible { outline: 3px solid #378461; outline-offset: 3px; }
.hero, .pricing, .write { display: grid; gap: clamp(24px, 6vw, 72px); padding: clamp(36px, 7vw, 84px) 0; }
.hero { grid-template-columns: 1.25fr 1fr; align-items: center; }
.hero-note { background: var(--surface); border-radius: 16px; padding: clamp(20px, 4vw, 34px); }
.hero-note h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); margin-bottom: 20px; }
.steps { padding-left: 22px; margin: 0; }
.steps li + li { margin-top: 14px; }
.steps h3, .steps p { margin-bottom: 3px; }
.pricing, .write { border-top: 1px solid var(--line); grid-template-columns: 1fr 1.65fr; }
.price-options, .contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.price-options > div { display: flex; flex-direction: column; align-items: start; background: var(--surface); border-radius: 14px; padding: clamp(12px, 3vw, 24px); }
.price-options .amount { color: inherit; font-size: clamp(2.2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1; }
.price-options .button { margin-top: auto; width: 100%; padding-inline: 8px; }
form { min-width: 0; }
form h3 { margin-top: 22px; }
.form-panel:first-of-type { margin-bottom: 22px; }
label { display: block; font-weight: 650; margin: 14px 0 6px; }
input, textarea, select { width: 100%; min-height: 50px; border: 1px solid #a9bdb0; border-radius: 8px; padding: 11px 12px; background: white; color: inherit; font: inherit; }
textarea { min-height: 160px; resize: vertical; }
#address-help, .address-status { font-size: .9rem; }
.address-status { color: var(--muted); margin-top: 6px; }
.address-suggestions { border: 1px solid var(--line); border-radius: 8px; margin-top: 6px; }
.address-suggestions button { display: block; width: 100%; border: 0; border-radius: 0; background: white; color: inherit; text-align: left; font-weight: 500; }
.address-suggestions button + button { border-top: 1px solid var(--line); }
.address-suggestions button:hover, .address-suggestions button:focus-visible { background: var(--surface); }
[aria-invalid="true"] { border: 2px solid var(--error); }
.field-error, .error-panel { color: var(--error); font-weight: 650; }
.field-error { font-size: .9rem; margin: 6px 0 0; }
.error-panel { background: #fff1ef; border: 1px solid #e6b4ae; border-radius: 8px; padding: 12px; }
#pay { width: 100%; margin-top: 22px; }
#status { margin-top: 10px; }
footer { border-top: 1px solid var(--line); padding: 20px 0 28px; }
@media (max-width: 740px) {
  .hero, .pricing, .write { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .shell { width: calc(100% - 32px); }
  .contact-grid { grid-template-columns: 1fr; gap: 0; }
  nav a { font-size: .8rem; }
}

.price-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bundle-picker { border: 0; padding: 0; margin: 0 0 12px; }
.bundle-picker legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.bundle-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bundle-options button, .secondary {
  background: white; color: var(--green); border-color: #a9bdb0;
}
.bundle-options button { padding-inline: 6px; }
.bundle-options button:hover, .secondary:hover { background: var(--surface); color: var(--green); }
.bundle-options button[aria-pressed="true"] { background: var(--green); color: white; }
#preview-letter { width: 100%; margin-top: 22px; }
#preview-letter + #pay { margin-top: 8px; }
#letter-preview {
  width: min(640px, calc(100% - 24px)); max-height: calc(100% - 24px);
  border: 1px solid var(--line); border-radius: 16px; color: inherit;
  padding: clamp(14px, 3vw, 26px);
}
#letter-preview::backdrop { background: #10261eb3; }
.preview-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.preview-header h2 { font-size: clamp(1.5rem, 5vw, 2.35rem); margin: 0; }
#preview-frame { width: 100%; height: min(52vh, 480px); border: 1px solid var(--line); border-radius: 8px; }
@media (max-width: 540px) {
  .price-options { grid-template-columns: 1fr; }
  .price-options > div { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 4px 12px; }
  .price-options h3, .price-options p { margin: 0; grid-column: 1; }
  .price-options .button { grid-column: 2; grid-row: 1 / span 3; margin: 0; }
}

#packs:not(:empty) { margin-bottom: 16px; }

/* Compact privacy choices: radio controls should never inherit full-width text input styling. */
.privacy-options { border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-top: 12px; }
.privacy-options legend { font-size: .9rem; font-weight: 650; padding: 0 4px; }
.privacy-options label { display: flex; align-items: center; gap: 9px; font-size: .94rem; font-weight: 500; margin: 8px 0; cursor: pointer; }
.privacy-options input[type="radio"] { width: 17px; height: 17px; min-height: 0; flex: 0 0 17px; padding: 0; margin: 0; accent-color: var(--green); }
.privacy-options p { font-size: .85rem; margin: 10px 0 0; }
.pack-panel { align-self: start; padding: clamp(16px, 4vw, 30px); border: 1px solid var(--line); border-radius: 14px; }
.pack-panel .pack-total { margin: 18px 0; font-size: 1.25rem; font-weight: 700; }
.pack-panel #pack-checkout { width: 100%; }
.pack-panel #pack-error { margin: 12px 0 0; }

.skip-link { position: absolute; top: 12px; left: 12px; z-index: 1; padding: 10px 14px; color: white; background: var(--green); transform: translateY(-150%); }
.skip-link:focus { transform: none; }
.page-title { font-size: clamp(2rem, 4.2vw, 3.4rem); }
.hero-price, #checkout-help { margin-top: 12px; }
.hero-price { color: var(--muted); }
.pack-panel .bundle-options button { display: flex; flex-direction: column; gap: 2px; }
.option-price { font-size: .9rem; font-weight: 500; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { margin: 8px 0 0; }
.payment-page { padding-block: clamp(40px, 8vw, 88px); }

.hero-home h1 { font-size: clamp(2.5rem, 6.5vw, 4.9rem); max-width: 14ch; }
.sample-letter { margin: 0; padding: clamp(18px, 4vw, 32px); border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.sample-letter figcaption { margin-bottom: 14px; color: var(--muted); font-size: .9rem; font-weight: 650; }
.sample-letter blockquote { margin: 0; }
.sample-letter blockquote p { color: inherit; }
.sample-letter blockquote p:last-child { margin-bottom: 0; }

/* Compact signed-in account menu, consistent across pages. */
.account-menu { position: relative; max-width: min(42vw, 240px); }
.account-menu > summary { cursor: pointer; font-size: .9rem; font-weight: 650; color: var(--green); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-options { position: absolute; z-index: 20; right: 0; top: calc(100% + 10px); width: 190px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: 0 8px 28px #172b231a; }
.account-menu-options a, .account-menu-options button { display: block; width: 100%; min-height: 38px; padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--green); font: inherit; font-size: .9rem; font-weight: 600; text-align: left; text-decoration: none; }
.account-menu-options a:hover, .account-menu-options button:hover { background: var(--surface); }
