:root {
  --bg: #f4f7f2;
  --surface: #ffffff;
  --surface-2: #eef3ea;
  --ink: #1c2a20;
  --muted: #566858;
  --line: #d6e0cf;
  --primary: #0b6b3a;
  --primary-ink: #ffffff;
  --accent: #c77a1e;
  --warn: #b23a2c;
  --warn-bg: #fbeee9;
  --ok: #1f6b3a;
  --ok-bg: #e8f3ec;
  --shadow: 0 1px 2px rgba(20, 40, 25, 0.06), 0 6px 24px rgba(20, 40, 25, 0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 1rem 1.25rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand h1 { font-size: 1.05rem; margin: 0; color: var(--primary); }
.brand .tagline { margin: 0; font-size: 0.85rem; color: var(--muted); }
.logo { color: var(--primary); display: inline-flex; }

.topnav { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.topnav a {
  padding: 0.4rem 0.7rem; border-radius: 999px;
  color: var(--ink); font-size: 0.9rem;
}
.topnav a:hover { background: var(--surface-2); text-decoration: none; }

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }

.section-head h2 { margin: 0 0 0.25rem; font-size: 1.35rem; color: var(--ink); }
.section-head p { margin: 0 0 1rem; color: var(--muted); }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}
.panel h3 { margin: 0 0 0.5rem; font-size: 1.05rem; color: var(--ink); }

.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: flex-start; }
.stack { display: flex; flex-direction: column; gap: 0.5rem; min-width: 200px; }

label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.9rem; color: var(--ink); }
label span { color: var(--muted); font-size: 0.82rem; }

input[type="text"], input[type="number"], textarea {
  width: 100%; padding: 0.55rem 0.65rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: 0.95rem;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus {
  outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.55rem 0.9rem; border-radius: var(--radius-sm);
  font-size: 0.9rem; cursor: pointer; border: 1px solid transparent;
  background: var(--surface-2); color: var(--ink);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
}
.btn:hover { background: #e2ebdd; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn.primary:hover { background: #0a5a31; border-color: #0a5a31; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { background: var(--surface-2); }

.count-pill {
  display: inline-block; margin-top: 0.5rem;
  padding: 0.2rem 0.6rem; border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  font-size: 0.8rem;
}

.parse-errors {
  margin-top: 0.5rem; padding: 0.6rem 0.8rem;
  background: var(--warn-bg); color: var(--warn);
  border-radius: var(--radius-sm); font-size: 0.88rem;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem 1rem; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.empty-state {
  margin-top: 1rem; padding: 1.5rem;
  background: var(--surface-2); border: 1px dashed var(--line);
  border-radius: var(--radius); color: var(--muted);
  text-align: center;
}

.scoreboard {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem; margin-bottom: 1.25rem;
}
@media (max-width: 820px) { .scoreboard { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .scoreboard { grid-template-columns: 1fr; } }

.score-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0.9rem 1rem;
  display: flex; flex-direction: column; gap: 0.25rem;
  box-shadow: var(--shadow); position: relative;
}
.score-label { font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.score-value {
  font-size: 1.6rem; font-weight: 700; color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.score-note { font-size: 0.82rem; color: var(--muted); }
.score-card[data-tone="ok"] { border-left: 4px solid var(--ok); }
.score-card[data-tone="warn"] { border-left: 4px solid var(--accent); }
.score-card[data-tone="bad"] { border-left: 4px solid var(--warn); }

.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 640px; }
thead th {
  background: var(--surface-2); text-align: left; padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--line); color: var(--muted); font-weight: 600;
}
tbody td { padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); }
tbody tr:nth-child(even) td { background: #fafcf8; }
tbody tr:hover td { background: #f0f5ea; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

tr.row-warn td { background: #fdf5f2; }
tr.row-ok td { background: #f4faf6; }

.problem-list, .fix-list { padding-left: 1.2rem; margin: 0; display: grid; gap: 0.5rem; }
.problem-list li { background: var(--warn-bg); border-left: 3px solid var(--warn); padding: 0.55rem 0.75rem; border-radius: 6px; color: #3d1a15; }
.fix-list li { background: var(--surface-2); border-left: 3px solid var(--primary); padding: 0.55rem 0.75rem; border-radius: 6px; }

.notes-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.note-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.note-card h3 { margin: 0 0 0.5rem; color: var(--primary); font-size: 1rem; }
.note-card p, .note-card li { color: var(--ink); font-size: 0.93rem; }
.note-card ul { margin: 0; padding-left: 1.1rem; }

.compare-table th, .compare-table td { vertical-align: top; }
.compare-table td:nth-child(2) { color: var(--ok); }
.compare-table td:nth-child(3) { color: var(--warn); }

.footer {
  border-top: 1px solid var(--line); background: var(--surface);
  padding: 1.25rem; margin-top: 2rem;
}
.footer-inner { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; gap: 0.5rem 1rem; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-size: 0.88rem; }
.footer-links a:hover { color: var(--primary); }

@media (max-width: 720px) {
  .topbar { align-items: flex-start; }
  .brand h1 { font-size: 1rem; }
  .topnav a { padding: 0.3rem 0.55rem; font-size: 0.82rem; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
