/* PlainReply – system fonts only, no third-party assets */
:root {
  --brand: #0f5c4d;
  --brand-ink: #0a3d33;
  --text: #1c1917;
  --muted: #44403c;
  --bg: #f7f4ef;
  --card: #ffffff;
  --line: #d6d3d1;
  --red: #b42318;
  --red-bg: #fde8e6;
  --amber: #b54708;
  --amber-bg: #fef0c7;
  --green: #067647;
  --green-bg: #e6f4ed;
  --focus: #0f5c4d;
  --max-home: 960px;
  --max-guide: 720px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a { color: var(--brand); }
a:hover { color: var(--brand-ink); }
img { max-width: 100%; height: auto; }

.wrap { width: min(var(--max-home), calc(100% - 2rem)); margin: 0 auto; }
.guide .wrap, body.guide main { width: min(var(--max-guide), calc(100% - 2rem)); margin-inline: auto; }
body.guide main { padding-bottom: 3rem; }

/* Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
  padding: 0.5rem 0;
  flex-wrap: wrap;
}
.wordmark {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--brand);
  text-decoration: none;
  letter-spacing: -0.02em;
}
.wordmark:hover { color: var(--brand-ink); }
.nav { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.4rem 0.75rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  border-radius: 8px;
}
.nav a:hover { background: var(--bg); color: var(--brand); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  margin-top: 3rem;
  padding: 1.5rem 0 2rem;
  font-size: 0.95rem;
  color: var(--muted);
}
.site-footer .wrap { display: grid; gap: 0.75rem; }
.disclaimer { font-weight: 550; color: var(--text); }

/* Typography */
h1 { font-size: 2rem; line-height: 1.2; margin: 1.5rem 0 0.75rem; letter-spacing: -0.02em; }
h2 { font-size: 1.35rem; line-height: 1.3; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.1rem; margin: 1.25rem 0 0.5rem; }
p, li { max-width: 65ch; }
.lead { font-size: 1.15rem; color: var(--muted); margin-top: 0; }
ul, ol { padding-left: 1.25rem; }
blockquote {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  background: #fff;
  border-left: 4px solid var(--brand);
  border-radius: 0 8px 8px 0;
}

/* Notice */
.notice {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  padding: 0.9rem 1rem;
  border-radius: 8px;
  margin: 1rem 0 1.25rem;
}

/* Tabs and tool */
.tabs { display: flex; gap: 0.5rem; margin: 1rem 0; }
.tab {
  min-height: 44px;
  padding: 0.5rem 1rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
}
.tab[aria-selected="true"] {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.tab-panels { background: #fff; border: 1px solid var(--line); border-radius: 0 8px 8px 8px; padding: 1.25rem; }
.panel[hidden] { display: none; }

label { display: block; font-weight: 600; margin: 0.85rem 0 0.35rem; }
.helper { font-weight: 400; color: var(--muted); font-size: 0.95rem; }
.field-count { float: right; font-weight: 400; color: var(--muted); font-size: 0.9rem; }
input[type="text"], input[type="email"], input[type="tel"], textarea, select {
  width: 100%;
  font: inherit;
  font-size: 16px;
  padding: 0.7rem 0.8rem;
  border: 1px solid #a8a29e;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  min-height: 44px;
}
textarea { min-height: 8rem; resize: vertical; }
.radio-row, .choice-list { display: grid; gap: 0.5rem; margin: 0.5rem 0 1rem; }
.choice {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  font-weight: 500;
  cursor: pointer;
}
.choice input { width: 1.15rem; height: 1.15rem; accent-color: var(--brand); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  font: inherit;
  font-weight: 700;
  border-radius: 8px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--brand-ink); border-color: var(--brand-ink); color: #fff; }
.btn:disabled, .btn[aria-disabled="true"] {
  background: #a8a29e;
  border-color: #a8a29e;
  cursor: not-allowed;
}
.btn-secondary {
  background: #fff;
  color: var(--brand);
}
.btn-secondary:hover { background: var(--green-bg); color: var(--brand-ink); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }

/* Results */
.results { margin-top: 1.25rem; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-weight: 700;
}
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-green { background: var(--green-bg); color: var(--green); }
.icon { font-style: normal; }
.highlighted {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 8px;
  white-space: pre-wrap;
}
.hl-red, .hl-amber {
  border-radius: 3px;
  padding: 0 0.15em;
  cursor: help;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}
.hl-red { background: var(--red-bg); text-decoration-color: var(--red); }
.hl-amber { background: var(--amber-bg); text-decoration-color: var(--amber); }
.findings { list-style: none; padding: 0; margin: 1rem 0; }
.finding {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin: 0.6rem 0;
  background: #fff;
}
.finding-red { border-left: 4px solid var(--red); }
.finding-amber { border-left: 4px solid var(--amber); }
.finding-head { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: baseline; margin-bottom: 0.35rem; }
.sev { font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; }
.sev-red { color: var(--red); }
.sev-amber { color: var(--amber); }
.match { font-family: inherit; background: #f5f5f4; padding: 0.1em 0.35em; border-radius: 4px; }
.flag-note, .green-note, .form-note { color: var(--muted); font-size: 0.95rem; }
.policy-note { color: var(--muted); font-style: italic; }

/* Drafts */
.drafts { display: grid; gap: 1rem; margin-top: 1rem; }
.draft {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: #fafafa;
}
.draft-top { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.draft pre {
  white-space: pre-wrap;
  font: inherit;
  margin: 0 0 0.75rem;
  background: #fff;
  padding: 0.85rem;
  border-radius: 6px;
  border: 1px solid var(--line);
}

/* Cards / guides */
.cards { display: grid; gap: 1rem; margin: 1rem 0 2rem; }
@media (min-width: 720px) {
  .cards { grid-template-columns: 1fr 1fr; }
}
.card {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: inherit;
  min-height: 44px;
}
.card:hover { border-color: var(--brand); }
.card h3 { margin: 0 0 0.35rem; color: var(--brand); }
.card p { margin: 0; color: var(--muted); }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.5rem;
  margin: 0.75rem 0;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* FAQ */
details {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.9rem;
  margin: 0.6rem 0;
}
summary {
  cursor: pointer;
  font-weight: 700;
  min-height: 44px;
  display: flex;
  align-items: center;
}
details p { margin-top: 0.25rem; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 1rem 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.98rem; }
th, td { border: 1px solid var(--line); padding: 0.6rem 0.7rem; text-align: left; vertical-align: top; }
th { background: #efece6; }

.sources {
  margin-top: 2.5rem;
  padding: 1rem;
  background: #efece6;
  border-radius: 8px;
  font-size: 0.95rem;
  color: var(--muted);
}

.hp { position: absolute; left: -9999px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hero { padding: 1.25rem 0 0.5rem; }
section { margin: 2.25rem 0; }

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

.error { color: var(--red); font-weight: 600; }

@media print {
  body.print-page .site-header,
  body.print-page .site-footer,
  body.print-page .nav,
  body.print-page .related,
  body.print-page .print-hide { display: none !important; }
  body.print-page { background: #fff; }
  body.print-page main { width: auto; margin: 0; }
}
