:root { --bg:#f3f5f7; --card:#fff; --fg:#16222c; --muted:#5a6b79; --line:#d5dce2; --accent:#0b6e7a; --err:#b3261e; }
@media (prefers-color-scheme: dark) {
  :root { --bg:#0f171d; --card:#16222b; --fg:#e3eaef; --muted:#93a4b1; --line:#2a3a46; --accent:#4fc3cf; --err:#f2877f; }
}
* { box-sizing: border-box; }
body { margin:0; min-height:100vh; display:grid; place-items:center; padding:16px; background:var(--bg); color:var(--fg); font:16px/1.5 system-ui,-apple-system,"Segoe UI",sans-serif; }
.card { width:100%; max-width:26rem; background:var(--card); border:1px solid var(--line); border-radius:8px; padding:24px; }
h1 { margin:0 0 16px; font-size:1.4rem; }
form { display:flex; flex-direction:column; gap:6px; }
label { margin-top:8px; font-size:.9rem; color:var(--muted); }
input { padding:9px 10px; border:1px solid var(--line); border-radius:4px; background:transparent; color:inherit; font:inherit; }
input:focus-visible, button:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
button { margin-top:14px; padding:10px; border:0; border-radius:4px; background:var(--accent); color:var(--card); font:inherit; font-weight:600; cursor:pointer; }
.error { margin:2px 0 0; color:var(--err); font-size:.85rem; }
.hint { color:var(--muted); font-size:.9rem; margin:14px 0 0; }
a { color:var(--accent); }

/* Block editor */
.notice { padding: 8px 12px; border-radius: 4px; background: #e6f4ea; color: #1e5e32; }
.errors { padding: 8px 12px 8px 28px; border-radius: 4px; background: #fbe3e1; color: #8c1d18; }
details.add { margin: 6px 0; }
details.add summary { cursor: pointer; font-weight: 600; }
details.add form, .block-edit { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.block { border: 1px solid #d5dce2; border-radius: 6px; padding: 12px; margin: 10px 0; }
.block.off { opacity: .55; }
.block-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.block-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.block-actions form { margin: 0; }
form.settings { display: flex; flex-direction: column; gap: 8px; }
form.settings label { display: flex; gap: 8px; align-items: center; }
.color-row { display: flex; gap: 12px; align-items: center; }
.color-row input[type=color] { width: 48px; height: 32px; padding: 0; border: 1px solid #d5dce2; border-radius: 4px; background: none; }
form.settings select { padding: 8px; font: inherit; }

/* Statistics */
.stats-nav { display: flex; gap: 14px; margin: 12px 0; }
.totals { display: flex; flex-wrap: wrap; gap: 12px; margin: 16px 0 8px; }
.totals div { flex: 1 1 7rem; padding: 10px 12px; border: 1px solid rgba(128, 128, 128, .35); border-radius: 6px; }
.totals span { display: block; font-size: 1.6rem; font-weight: 600; }
table.stats { width: 100%; border-collapse: collapse; margin: 8px 0 20px; }
table.stats th, table.stats td { text-align: left; padding: 6px 8px; border-bottom: 1px solid rgba(128, 128, 128, .3); }
table.stats th.n, table.stats td.n { text-align: right; }

/* Statistics chart */
main.card:has(.viz) { max-width: 40rem; }
.viz { --viz-surface: var(--card); --viz-ink: var(--muted); --viz-grid: var(--line); --s1: #2a78d6; --s2: #eb6834;
       border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin: 8px 0 20px; }
@media (prefers-color-scheme: dark) {
  .viz { --s1: #3987e5; --s2: #d95926; }
}
.viz-legend { display: flex; gap: 16px; font-size: .9rem; margin-bottom: 6px; color: var(--viz-ink); }
.viz .key { display: inline-block; width: 16px; height: 2px; margin-right: 6px; vertical-align: middle; }
.viz .k1 { background: var(--s1); }
.viz .k2 { background: var(--s2); }
.viz-svg { display: block; width: 100%; height: auto; }
.viz .grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz .axis { fill: var(--viz-ink); font-size: 12px; }
.viz .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz .l1 { stroke: var(--s1); }
.viz .l2 { stroke: var(--s2); }
.viz .dot { stroke: var(--viz-surface); stroke-width: 2; }
.viz .d1 { fill: var(--s1); }
.viz .d2 { fill: var(--s2); }

/* Avatar in the dashboard */
.avatar-settings { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.avatar-preview { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-empty { display: flex; align-items: center; justify-content: center; background: #dfe5ea; color: #51606c; font-size: 2rem; font-weight: 600; }
.avatar-forms { display: flex; flex-direction: column; gap: 12px; min-width: 0; flex: 1; }

/* Report form */
select, textarea { padding:9px 10px; border:1px solid var(--line); border-radius:4px; background:transparent; color:inherit; font:inherit; }
select:focus-visible, textarea:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
textarea { resize:vertical; }
.hp { position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden; }
