/* ChaseLetter. Warm cream surfaces, one teal-green accent, marigold and coral only in dots and tone bars.
   Values follow the design kit's tokens.css. Fonts are self-hosted so nothing loads from another site. */

@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/figtree.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/instrument-serif.woff2") format("woff2");
}

@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/instrument-serif-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/geist-mono.woff2") format("woff2");
}

:root {
  --font-sans: "Figtree", system-ui, sans-serif;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-mono: "Geist Mono", ui-monospace, monospace;

  --canvas: #FBF7F0;
  --hero: #FFFCF5;
  --surface: #FFFFFF;
  --surface-hover: #FAF5EA;
  --fill-subtle: #F2ECDF;
  --track: #EFE8DA;
  --border: #EBE3D6;
  --border-control: #D5CCBA;

  --ink: #1E2B28;
  --ink-2: #2F3E3A;
  --text-body: #4A5753;
  --text-muted: #5E6A66;

  --accent: #2A9D7F;
  --accent-text: #17705A;
  --accent-deep: #0F5644;
  --accent-light: #8FD3B8;

  --night: #123A31;
  --night-text: #E6F4EC;
  --night-accent: #BFE8D6;
  --night-line: rgba(255, 255, 255, .14);

  --marigold: #E9A23B;
  --amber: #D98A1E;
  --coral: #D2573C;

  --positive: #23753A;
  --positive-bg: #EEF8F0;
  --danger: #A8321D;
  --danger-bg: #FBEDE8;
  --warn: #7A4A0B;
  --warn-bg: #FBF0DC;

  --r-hero: 32px;
  --r-night: 28px;
  --r-card: 20px;
  --r-input: 12px;
  --r-pill: 999px;
  --r-chip: 6px;

  --container: 1200px;
  --gutter: 24px;
  --section-gap: 88px;

  --shadow-hover: 0 6px 20px rgba(60, 90, 70, .10);
  --shadow-glass: 0 4px 20px rgba(60, 90, 70, .08);
  --glass-bg: rgba(255, 255, 255, .78);

  color-scheme: light;
}

/* ---------- Base ---------- */

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

[hidden] { display: none !important; }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .lift { transition: none; }
}

body {
  margin: 0;
  padding-bottom: 40px;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  text-wrap: pretty;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent-text); text-decoration: none; }
a:hover { color: var(--accent-deep); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[role="tabpanel"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: #fff;
  font-weight: 500;
}

.skip-link:focus { top: 12px; color: #fff; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.section {
  margin-top: var(--section-gap);
  scroll-margin-top: 24px;
}

.section:focus { outline: none; }

.eyebrow {
  color: var(--accent-text);
  font-size: 13.5px;
  font-weight: 600;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.section-head h2 {
  font-family: var(--font-serif);
  font-size: 42px;
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.015em;
}

.section-head-split {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.section-head-split > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-lede {
  max-width: 360px;
  color: var(--text-body);
  font-size: 13.5px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
}

.lift { transition: box-shadow .15s ease, transform .15s ease; }
.lift:hover { box-shadow: var(--shadow-hover); }

/* ---------- Buttons and links ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.btn-sm { height: 36px; padding: 0 16px; font-size: 12.5px; }
.btn-lg { height: 44px; padding: 0 22px; font-size: 14px; }

.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-2); color: #fff; }

.btn-white { background: #fff; color: var(--ink); }
.btn-white:hover { background: var(--night-text); color: var(--ink); }

.btn-line { background: #fff; border-color: var(--border-control); color: var(--ink); }
.btn-line:hover { background: var(--surface-hover); color: var(--ink); }

.text-link { font-size: 13.5px; font-weight: 500; }

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-text);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}

.link-button:hover { color: var(--accent-deep); }

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

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  max-width: var(--container);
  margin: 0 auto;
  padding: 20px var(--gutter);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.brand:hover { color: var(--ink); }

.brand-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
}

.brand-tile img { width: 26px; height: 26px; }

.brand-name {
  min-width: 6em;
  font-family: var(--font-serif);
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.01em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  font-size: 13.5px;
  font-weight: 500;
}

.nav a { color: var(--text-body); }
.nav a:hover { color: var(--ink); }

.header-end {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mono-chip {
  padding: 6px 9px;
  border-radius: var(--r-chip);
  background: var(--fill-subtle);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr));
  overflow: hidden;
  background: var(--hero);
  border: 1px solid var(--border);
  border-radius: var(--r-hero);
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  padding: 56px 48px 52px;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(46px, 6.2vw, 72px);
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.hero h1 em { color: var(--accent-text); }

.hero-lede {
  max-width: 440px;
  color: var(--text-body);
  font-size: 16px;
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin-top: 4px;
}

.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.trust li { display: flex; align-items: center; gap: 8px; }

.trust li::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-art {
  position: relative;
  min-height: 440px;
  overflow: hidden;
}

.hero-dots {
  position: absolute;
  right: -150px;
  top: -10px;
  width: 980px;
  height: 560px;
  max-width: none;
}

.hero-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #FFFCF5 0%, rgba(255, 252, 245, .55) 18%, rgba(255, 252, 245, 0) 52%);
}

.glass-chip {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(320px, calc(100% - 48px));
  padding: 16px 18px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid #fff;
  border-radius: 20px;
  box-shadow: var(--shadow-glass);
}

.glass-top { display: flex; align-items: center; gap: 14px; }

.glass-figure {
  font-family: var(--font-serif);
  font-size: 46px;
  line-height: 1;
  letter-spacing: -0.01em;
}

.glass-caption {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.glass-caption strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.glass-foot {
  padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* On narrow screens the dot field sits under the copy and the chip sits on it. */
@media (max-width: 899px) {
  .hero-copy { padding: 40px 24px 28px; }
  .hero-art { min-height: 300px; }
  .hero-dots { right: -260px; }
  .hero-fade { background: linear-gradient(180deg, #FFFCF5 0%, rgba(255, 252, 245, 0) 40%); }
}

/* ---------- Calculator ---------- */

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(480px, 100%), 1fr));
  gap: 16px;
  align-items: stretch;
}

.form-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field label,
.radios legend {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 500;
}

.optional { color: var(--text-muted); font-weight: 400; }

.field-hint,
.form-note {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.form-note { margin-top: -6px; }

.error {
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
}

input[type="text"],
input[type="date"],
textarea {
  width: 100%;
  border: 1px solid var(--border-control);
  border-radius: var(--r-input);
  background: #fff;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 14px;
}

input[type="text"],
input[type="date"] {
  height: 44px;
  padding: 0 12px;
}

textarea { padding: 10px 12px; line-height: 1.45; resize: vertical; }

input:focus,
textarea:focus { border-color: var(--accent); }

input::placeholder { color: #8C9692; }

.field.has-error input { border-color: var(--danger); }

.affix { position: relative; }

.affix-text {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 14px;
  pointer-events: none;
}

.affix-left { left: 12px; }
.affix-right { right: 12px; }
.affix:has(.affix-left) input { padding-left: 28px; }
.affix:has(.affix-right) input { padding-right: 28px; }
.affix:has(.affix-word) input { padding-right: 52px; }

.helper {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.helper > summary {
  color: var(--accent-text);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

.helper > summary::-webkit-details-marker { display: none; }
.helper > summary::after { content: " +"; font-family: var(--font-mono); }
.helper[open] > summary::after { content: " \2013"; }

.helper-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 14px;
}

.radios {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.radios legend { margin-bottom: 6px; padding: 0; }

.radio,
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
}

.radio input,
.check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent-text);
}

.helper-default { display: flex; flex-direction: column; gap: 12px; }

.form-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.voice { display: flex; align-items: center; gap: 12px; }

.voice-label { color: var(--ink-2); font-size: 12px; font-weight: 500; }

.toggle {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  background: var(--fill-subtle);
}

.toggle-btn {
  min-width: 44px;
  height: 30px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}

.toggle-btn[aria-pressed="true"] {
  border-color: var(--border);
  background: #fff;
  color: var(--ink);
  font-weight: 600;
}

/* ---------- Results (the one dark card) ---------- */

.night-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--r-night);
  background: var(--night);
  color: var(--night-text);
}

.night-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 28px 28px 24px;
}

.night-label {
  color: var(--night-accent);
  font-size: 13.5px;
  font-weight: 600;
}

.night-total {
  margin-top: 6px;
  color: #fff;
  font-family: var(--font-serif);
  font-size: clamp(56px, 8vw, 76px);
  line-height: 1;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.night-total.is-empty { color: rgba(255, 255, 255, .55); }

.night-note { color: var(--night-text); font-size: 13px; }

.night-rows {
  display: flex;
  flex-direction: column;
  margin: 18px 0 0;
}

.night-rows > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid var(--night-line);
}

.night-rows dt { font-size: 13px; }

.night-rows dd {
  margin: 0;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
}

.night-formula {
  margin-top: 4px;
  color: var(--night-accent);
  font-family: var(--font-mono);
  font-size: 11px;
}

.night-action { margin-top: 16px; }

.night-dots {
  position: relative;
  height: 130px;
  margin-top: auto;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 70%);
  mask-image: linear-gradient(to bottom, transparent, #000 70%);
}

.night-dots img {
  position: absolute;
  right: -60px;
  bottom: -150px;
  width: 640px;
  max-width: none;
  opacity: .8;
  mix-blend-mode: screen;
}

.caption {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 12px;
}

.notice {
  padding: 12px 16px;
  border-radius: var(--r-input);
  background: var(--fill-subtle);
  color: var(--ink);
  font-size: 12.5px;
}

.notice-warn { margin-top: 16px; background: var(--warn-bg); color: var(--warn); }
.notice-success { margin-top: 16px; background: var(--positive-bg); color: var(--positive); }

/* ---------- Letters ---------- */

.cover-grid,
.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 16px;
}

.cover-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
}

.cover {
  position: relative;
  height: 96px;
  overflow: hidden;
  background: var(--canvas);
}

.cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-chip {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 3px 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-chip);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

.status-chip {
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 3px 8px;
  border-radius: var(--r-chip);
  background: var(--fill-subtle);
  color: var(--text-body);
  font-size: 11.5px;
  font-weight: 500;
}

.status-free,
.status-chip.is-unlocked {
  background: var(--positive-bg);
  color: var(--positive);
}

.cover-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 18px 18px 20px;
}

.cover-body h3 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.1;
}

.cover-body > p { color: var(--text-body); font-size: 13px; }

.tone { display: flex; align-items: center; gap: 10px; margin-top: 4px; }

.tone-track {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--track);
}

.tone-fill { height: 100%; border-radius: 2px; }
.tone-1 { width: 33%; background: var(--accent); }
.tone-2 { width: 66%; background: var(--amber); }
.tone-3 { width: 100%; background: var(--coral); }

.tone span {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.cover-action { margin-top: auto; padding-top: 10px; }

.unlock-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin-top: 16px;
  padding: 18px 20px;
}

.unlock-copy { display: flex; flex-direction: column; gap: 2px; }

.unlock-title { font-size: 13.5px; font-weight: 600; }

.unlock-sub { color: var(--text-muted); font-size: 12.5px; }

.unlock-end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.unlock-note { color: var(--text-body); font-size: 12.5px; }

/* Letter workspace */

.workspace {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 16px;
  padding: 24px;
  scroll-margin-top: 24px;
}

.workspace-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-self: flex-start;
  max-width: 100%;
  padding: 3px;
  border-radius: 10px;
  background: var(--fill-subtle);
}

.tab {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text-body);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}

.tab[aria-selected="true"] {
  border-color: var(--border);
  background: #fff;
  color: var(--ink);
  font-weight: 600;
}

.disclaimer { color: var(--ink-2); font-size: 12.5px; font-weight: 600; }

.workspace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 24px;
  align-items: start;
}

@media (min-width: 900px) {
  .workspace-grid { grid-template-columns: 300px minmax(0, 1fr); }
}

.workspace-side { display: flex; flex-direction: column; gap: 12px; }

.side-group {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--hero);
}

.side-group > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 14px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.side-group > summary::-webkit-details-marker { display: none; }

.summary-meta {
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.side-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px 16px;
}

.side-body input[type="text"] { height: 40px; font-family: var(--font-sans); }
.side-body textarea { font-family: var(--font-sans); }

.field-inline { flex-direction: row; align-items: center; justify-content: space-between; }

input[type="color"] {
  width: 52px;
  height: 34px;
  padding: 3px;
  border: 1px solid var(--border-control);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

input[type="file"] { max-width: 100%; font-family: var(--font-sans); font-size: 12px; }

input[type="file"]::file-selector-button {
  height: 32px;
  margin-right: 10px;
  padding: 0 14px;
  border: 1px solid var(--border-control);
  border-radius: var(--r-pill);
  background: #fff;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.logo-preview {
  align-self: flex-start;
  max-width: 180px;
  max-height: 48px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.workspace-main { min-width: 0; }

.tabpanel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.letter-purpose { color: var(--text-body); font-size: 13px; }

.letter-tip {
  padding: 12px 16px;
  border-radius: var(--r-input);
  background: var(--fill-subtle);
  color: var(--ink-2);
  font-size: 12.5px;
}

.letter-blocked {
  padding: 16px 18px;
  border: 1px dashed var(--border-control);
  border-radius: 14px;
  color: var(--text-body);
  font-size: 13px;
}

.letter-locked {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 20px;
  border-radius: 14px;
  background: var(--hero);
  border: 1px solid var(--border);
}

.letter-locked .btn { margin-top: 4px; }

.letter-editor { display: flex; flex-direction: column; gap: 12px; }

.letter-toolbar { display: flex; flex-wrap: wrap; gap: 8px; }

.action-status { color: var(--positive); font-size: 12.5px; font-weight: 600; }
.action-status:empty { display: none; }

.edited-note {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  color: var(--text-muted);
  font-size: 12.5px;
}

.sheet {
  --brand: #17705a;
  display: flex;
  flex-direction: column;
  padding: 36px 40px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(60, 90, 70, .06), 0 10px 28px rgba(60, 90, 70, .08);
}

@media (max-width: 599px) {
  .sheet { padding: 22px 18px; }
}

.sheet-head {
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--brand);
}

.sheet-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 60%;
  max-height: 52px;
}

.letter-text {
  display: block;
  width: 100%;
  min-height: 18rem;
  padding: 2px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.65;
  resize: vertical;
}

.letter-text:focus-visible { outline: 2px dashed var(--brand); outline-offset: 6px; }

.sheet-foot {
  margin-top: 22px;
  padding-top: 8px;
  border-top: 1px solid var(--brand);
  color: var(--text-muted);
  font-size: 12px;
}

.print-copy { display: none; }

/* ---------- Rules ---------- */

.rule-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
}

.rule-figure {
  color: var(--accent-text);
  font-family: var(--font-serif);
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.015em;
}

.rule-card h3 { font-size: 13.5px; font-weight: 600; }

.rule-card > p:not(.rule-figure):not(.rule-source) { color: var(--text-body); font-size: 13px; }

.rule-source {
  margin-top: auto;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.rule-source a { font-family: var(--font-sans); font-size: 12.5px; font-weight: 500; }

.rule-dots {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  height: 56px;
}

.dot-item {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
}

.dot { border-radius: 50%; }
.dot-s { width: 12px; height: 12px; background: var(--accent-light); }
.dot-m { width: 22px; height: 22px; background: var(--accent); }
.dot-l { width: 36px; height: 36px; background: var(--accent-deep); }

/* ---------- Questions ---------- */

.faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr));
  gap: 0 48px;
}

.faq-item {
  padding: 18px 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: 24px;
}

.faq-item > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

.faq-item > summary::-webkit-details-marker { display: none; }

.faq-item > summary::after {
  content: "+";
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: 16px;
  line-height: 1;
}

.faq-item[open] > summary::after { content: "\2013"; }

.faq-item > p {
  max-width: 460px;
  margin-top: 10px;
  color: var(--text-body);
  font-size: 13.5px;
}

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

.site-footer {
  max-width: var(--container);
  margin: var(--section-gap) auto 0;
  padding: 28px var(--gutter) 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 32px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1;
}

.footer-brand img { width: 24px; height: 24px; }

.footer-note {
  max-width: 480px;
  color: var(--text-muted);
  font-size: 12.5px;
}

.footer-links {
  display: flex;
  gap: 22px;
  font-size: 12.5px;
  font-weight: 500;
}

/* ---------- Privacy page ---------- */

.prose {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 680px;
  margin-top: 24px;
  padding: 40px 44px;
  font-size: 15px;
  color: var(--text-body);
}

@media (max-width: 599px) {
  .prose { padding: 28px 22px; }
}

.prose h1 {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(40px, 6vw, 56px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.015em;
}

.prose h2 {
  margin-top: 12px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
}

.prose ul { display: flex; flex-direction: column; gap: 6px; margin: 0; padding-left: 20px; }

.prose code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--fill-subtle);
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.prose .small { color: var(--text-muted); font-size: 12.5px; }

/* ---------- Print: only the chosen letter, on plain A4 ---------- */

@media print {
  @page { size: A4; margin: 20mm 20mm 22mm; }

  body { padding: 0; background: #fff; color: #000; font-size: 11pt; }

  .skip-link,
  .site-header,
  .site-footer,
  .hero,
  .section:not(#letters),
  #letters > .section-head,
  .cover-grid,
  .unlock-bar,
  .notice,
  .workspace-head,
  .workspace-side,
  .letter-purpose,
  .letter-tip,
  .letter-blocked,
  .letter-locked,
  .letter-editor {
    display: none !important;
  }

  .container,
  #letters,
  .workspace,
  .workspace-grid,
  .workspace-main,
  .tabpanel {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
  }

  .print-copy {
    display: block;
    color: #000;
    font-family: var(--font-sans);
    font-size: 11pt;
    line-height: 1.5;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .print-head {
    margin-bottom: 9mm;
    padding-bottom: 4mm;
    border-bottom: 1.2pt solid var(--brand, #17705a);
  }

  .print-head img { display: block; max-width: 70mm; max-height: 16mm; }

  .print-body { white-space: pre-wrap; overflow-wrap: anywhere; }

  .print-foot {
    margin-top: 10mm;
    padding-top: 2mm;
    border-top: 0.6pt solid var(--brand, #17705a);
    color: #555;
    font-size: 8pt;
    break-inside: avoid;
  }
}

/* ---------- Guide pages ---------- */

.guide {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 760px;
  margin-top: 24px;
  color: var(--text-body);
  font-size: 15px;
  line-height: 1.65;
}

.crumbs { color: var(--text-muted); font-size: 12.5px; }

.guide h1 {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: clamp(40px, 6vw, 60px);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.015em;
}

.guide h2 {
  margin-top: 20px;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 400;
  line-height: 1.1;
}

.guide ul { display: flex; flex-direction: column; gap: 6px; margin: 0; padding-left: 20px; }

.answer {
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-input);
  background: var(--hero);
  color: var(--ink);
  font-size: 16px;
}

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-input); background: #fff; }

.guide table { width: 100%; border-collapse: collapse; font-size: 14px; }
.guide caption { padding: 12px 14px; color: var(--text-muted); font-size: 12.5px; text-align: left; caption-side: top; }
.guide th, .guide td { padding: 10px 14px; border-top: 1px solid var(--border); text-align: left; white-space: nowrap; }
.guide th { color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.guide td { font-family: var(--font-mono); font-size: 13px; color: var(--ink); }
.guide td:first-child { font-family: var(--font-sans); font-size: 14px; }

.calc-line {
  padding: 12px 16px;
  border-radius: var(--r-input);
  background: var(--fill-subtle);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13.5px;
}

.letter-sample {
  margin: 0;
  padding: 28px 30px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.guide-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 24px;
  margin-top: 16px;
  padding: 20px 22px;
}

.guide-cta > div { display: flex; flex-direction: column; gap: 4px; max-width: 460px; }

.guide-faq { display: flex; flex-direction: column; }
.guide-faq .faq-item > p { max-width: none; }

.sources { font-size: 13.5px; }

.guide-meta { color: var(--text-muted); font-size: 12.5px; }

.guide-list { display: grid; gap: 12px; margin: 0; padding: 0 !important; list-style: none; }

.guide-list a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  color: var(--ink);
}

.guide-list a:hover { color: var(--ink); background: var(--surface-hover); border-radius: var(--r-card); }

.guide-list-title { font-family: var(--font-serif); font-size: 24px; line-height: 1.15; }
.guide-list-desc { color: var(--text-body); font-size: 13.5px; }
