/* Honest Count app styles. System fonts, no framework, WCAG AA contrast, visible focus. */
:root {
  --bg: #f6f6f3; --surface: #fff; --text: #1c1c1a; --muted: #5a5a54; --line: #e2e2dc;
  --brand: #1f5f4a; --brand-ink: #fff; --brand-soft: #e6f0ec;
  --warn: #8a5a00; --warn-bg: #fff4dc; --high: #9a3b00; --high-bg: #ffe8d9;
  --crit: #a31d1d; --crit-bg: #fde4e4; --ok: #1d6b3a; --ok-bg: #e2f4e8;
  --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.04);
  font-synthesis: none;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141413; --surface: #1d1d1b; --text: #ececE6; --muted: #a8a8a0; --line: #33332f;
    --brand: #5fb894; --brand-ink: #0d1f18; --brand-soft: #1e2d27;
    --warn: #f0c060; --warn-bg: #2e2612; --high: #ffa36b; --high-bg: #33200f;
    --crit: #ff8a8a; --crit-bg: #3a1717; --ok: #7fd49d; --ok-bg: #16301f; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
header.top { background: var(--surface); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; gap: 20px; min-height: 60px; flex-wrap: wrap; }
.brand { font-weight: 750; color: var(--text); text-decoration: none; font-size: 18px; letter-spacing: -.01em; }
.brand span { color: var(--brand); }
nav.main { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
nav.main a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; }
nav.main a[aria-current="page"] { color: var(--text); background: var(--brand-soft); font-weight: 600; }
nav.main a:hover { color: var(--text); }
.top .who { color: var(--muted); font-size: 14px; display: flex; gap: 10px; align-items: center; }
main { padding: 28px 0 60px; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 8px; letter-spacing: -.015em; }
h2 { font-size: 20px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 0 0 8px; }
p.lead { color: var(--muted); margin: 0 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 20px; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.auth { max-width: 440px; margin: 40px auto; }
.auth .card { padding: 28px; }
label { display: block; font-weight: 600; margin: 14px 0 6px; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 14px; margin-top: 2px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid #b9b9b0; border-radius: 8px; }
input[aria-invalid="true"] { border-color: var(--crit); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: 5px; width: 18px; height: 18px; }
.field-error { color: var(--crit); font-size: 14px; margin-top: 4px; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600;
  padding: 10px 18px; border-radius: 8px; border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink);
  cursor: pointer; text-decoration: none; min-height: 44px; }
button:hover, .btn:hover { filter: brightness(1.08); }
button.secondary, .btn.secondary { background: transparent; color: var(--brand); }
button.danger, .btn.danger { background: var(--crit); border-color: var(--crit); color: #fff; }
button.link { background: none; border: 0; color: var(--brand); padding: 0; min-height: 0; font-weight: 500; text-decoration: underline; }
button[disabled] { opacity: .55; cursor: not-allowed; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; }
form.inline { display: inline; }
.notice { border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; border: 1px solid transparent; }
.notice strong { display: block; margin-bottom: 2px; }
.notice.info { background: var(--brand-soft); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.warning { background: var(--warn-bg); color: var(--warn); }
.notice.high { background: var(--high-bg); color: var(--high); }
.notice.critical, .notice.error { background: var(--crit-bg); color: var(--crit); }
.notice p { margin: 4px 0 0; color: var(--text); }
.usage-bar { height: 14px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 10px 0 6px; }
.usage-bar svg { display: block; } .usage-bar rect { fill: var(--brand); }
.usage-bar.warning rect { fill: #c98a00; } .usage-bar.high rect { fill: #d0601a; } .usage-bar.critical rect { fill: var(--crit); }
.plan[data-highlight] { outline: 3px solid var(--brand); outline-offset: 2px; }
.big { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--line); color: var(--text); }
.tag.ok { background: var(--ok-bg); color: var(--ok); } .tag.warn { background: var(--warn-bg); color: var(--warn); }
.tag.crit { background: var(--crit-bg); color: var(--crit); } .tag.brand { background: var(--brand-soft); color: var(--brand); }
.plans { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.plan { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--surface); display: flex; flex-direction: column; }
.plan.current { border: 2px solid var(--brand); }
.plan .price { font-size: 26px; font-weight: 700; margin: 4px 0; }
.plan ul { padding-left: 18px; margin: 8px 0 14px; color: var(--muted); font-size: 15px; flex: 1; }
pre.code { background: #111; color: #e8e8e0; padding: 14px 16px; border-radius: 8px; overflow-x: auto; font-size: 13.5px; line-height: 1.5; margin: 8px 0; white-space: pre; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.copy-row { display: flex; justify-content: flex-end; }
details.guide { border: 1px solid var(--line); border-radius: var(--radius); padding: 0 16px; margin-bottom: 12px; background: var(--surface); }
details.guide > summary { cursor: pointer; padding: 14px 0; font-weight: 600; }
details.guide[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.kv dt { color: var(--muted); } dl.kv dd { margin: 0; }
.danger-zone { border-color: var(--crit); }
footer.foot { color: var(--muted); font-size: 14px; padding: 24px 0 40px; border-top: 1px solid var(--line); }
footer.foot a { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pager { display: flex; gap: 12px; margin-top: 12px; }
@media (max-width: 640px) { h1 { font-size: 24px; } .card { padding: 18px; } dl.kv { grid-template-columns: 1fr; } }
.spacer { flex: 1; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 14px 0 0; padding: 8px 14px 14px; } legend { font-weight: 600; padding: 0 4px; } hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
