/* Senior-friendly, mobile-first. Large type, high contrast, big targets. */
:root {
  --primary: #1f5c99;
  --accent: #2e7d32;
  --ink: #16191d;
  --muted: #444b55;
  --bg: #f4f6f8;
  --card: #ffffff;
  --line: #9aa3ad;
  --soft: #e6edf4;
  --danger: #a31515;
  --ok-bg: #e5f4e7;
  --err-bg: #fde9e9;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 1.125rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}
a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 3px; }
:focus-visible { outline: 4px solid #ffb300; outline-offset: 2px; }
h1 { font-size: 2rem; line-height: 1.2; margin: 0.4em 0 0.5em; }
h2 { font-size: 1.5rem; line-height: 1.25; margin: 1.4em 0 0.5em; }
h3 { font-size: 1.2rem; margin: 1em 0 0.4em; }
p { margin: 0.6em 0; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

.skip { position: absolute; left: -999px; top: 0; background: #000; color: #fff; padding: 12px 16px; z-index: 100; }
.skip:focus { left: 0; }

/* header */
.topbar { background: var(--primary); color: #fff; }
.topbar .inner { max-width: 1000px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; min-width: 0; }
.brand img { height: 48px; width: auto; max-width: 120px; object-fit: contain; background: #fff; border-radius: 8px; padding: 3px; }
.brand .name { font-weight: 800; font-size: 1.25rem; line-height: 1.15; }
.brand .sub { font-size: 0.8rem; opacity: 0.95; }
.topbar .spacer { flex: 1; }
.nav { background: #fff; border-bottom: 3px solid var(--primary); }
.nav .inner { max-width: 1000px; margin: 0 auto; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.nav a.pill, .nav summary {
  display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 8px 16px;
  border-radius: 12px; border: 2px solid var(--primary); color: var(--primary); font-weight: 700; text-decoration: none;
  background: #fff; cursor: pointer; list-style: none;
}
.nav summary::-webkit-details-marker { display: none; }
.nav a.pill[aria-current='page'] { background: var(--primary); color: #fff; }
.nav details { position: relative; }
.nav details[open] summary { background: var(--soft); }
.nav .more-links { position: absolute; z-index: 20; right: 0; top: 58px; min-width: 230px; background: #fff; border: 2px solid var(--primary); border-radius: 12px; padding: 8px; display: grid; gap: 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); }
.nav .more-links a, .nav .more-links button { display: block; width: 100%; text-align: left; padding: 12px 14px; border-radius: 8px; font-size: 1.05rem; font-weight: 600; color: var(--ink); text-decoration: none; background: #fff; border: 0; cursor: pointer; font-family: inherit; min-height: 48px; }
.nav .more-links a:hover, .nav .more-links button:hover { background: var(--soft); }
.nav .grow { flex: 1; }

main { max-width: 1000px; margin: 0 auto; padding: 8px 16px 48px; }
footer.site { max-width: 1000px; margin: 0 auto; padding: 16px 16px 40px; color: var(--muted); font-size: 0.95rem; border-top: 2px solid var(--line); }

/* cards and layout */
.card { background: var(--card); border: 2px solid #c9d0d8; border-radius: var(--radius); padding: 18px; margin: 14px 0; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 14px; }
@media (min-width: 700px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } .grid.four { grid-template-columns: repeat(4, 1fr); } }
.stat { text-align: center; }
.stat .num { font-size: 2.4rem; font-weight: 800; line-height: 1.1; color: var(--primary); }
.stat .label { font-size: 1rem; color: var(--muted); font-weight: 600; }

.welcome { border-left: 10px solid var(--accent); }
.gallery { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.gallery figure { margin: 0; flex: 0 0 auto; max-width: 280px; }
.gallery img { width: 100%; height: 180px; object-fit: cover; border-radius: 10px; border: 2px solid #c9d0d8; }
.gallery figcaption { font-size: 0.95rem; color: var(--muted); }

/* buttons and forms */
.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 10px 24px;
  font: inherit; font-weight: 800; font-size: 1.15rem; color: #fff; background: var(--primary);
  border: 3px solid var(--primary); border-radius: 12px; cursor: pointer; text-decoration: none; text-align: center;
}
.btn:hover { filter: brightness(1.12); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--primary); }
.btn.good { background: var(--accent); border-color: var(--accent); }
.btn.danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.btn.small { min-height: 44px; padding: 6px 14px; font-size: 1rem; }
.btn.block { display: flex; width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }

label { display: block; font-weight: 700; margin: 16px 0 6px; }
.hint { font-weight: 400; color: var(--muted); font-size: 0.95rem; display: block; margin-top: 2px; }
input[type='text'], input[type='email'], input[type='password'], input[type='number'], input[type='date'], input[type='month'], input[type='file'], select, textarea {
  width: 100%; min-height: 56px; padding: 10px 14px; font: inherit; color: var(--ink); background: #fff; border: 3px solid #5b6570; border-radius: 12px;
}
textarea { min-height: 120px; }
input[type='color'] { width: 100px; height: 56px; padding: 4px; border: 3px solid #5b6570; border-radius: 12px; background: #fff; }
.check { display: flex; align-items: flex-start; gap: 12px; font-weight: 600; margin: 16px 0; }
.check input { width: 28px; height: 28px; flex: 0 0 auto; margin-top: 2px; }
.row-inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

.flash { padding: 14px 18px; border-radius: 12px; margin: 14px 0; font-weight: 700; border: 3px solid; }
.flash.ok { background: var(--ok-bg); border-color: #2e7d32; color: #14391a; }
.flash.error { background: var(--err-bg); border-color: var(--danger); color: #5c0a0a; }

/* progress */
.progress { background: #dde3ea; border: 2px solid #5b6570; border-radius: 999px; height: 34px; overflow: hidden; position: relative; margin: 8px 0; }
.progress .fill { height: 100%; background: var(--accent); min-width: 2px; }
.progress .pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; color: #000; text-shadow: 0 0 4px #fff, 0 0 4px #fff, 0 0 4px #fff; }

.streak { display: inline-block; background: #fff4d6; border: 3px solid #b26a00; color: #5a3500; border-radius: 12px; padding: 6px 14px; font-weight: 800; }
.badge { display: inline-block; background: var(--soft); border: 2px solid #8da2b8; padding: 2px 10px; border-radius: 999px; font-size: 0.9rem; font-weight: 700; }
.badge.warn { background: #fff4d6; border-color: #b26a00; }

/* lists */
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 14px 0; border-bottom: 2px solid #dde3ea; }
.list li:last-child { border-bottom: 0; }
.feed li .who { font-weight: 800; }
.feed li .when { color: var(--muted); font-size: 0.9rem; display: block; }
.board { counter-reset: rank; }
.board li { display: flex; gap: 12px; align-items: center; }
.board li::before { counter-increment: rank; content: counter(rank); font-weight: 800; background: var(--primary); color: #fff; width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.board .nm { flex: 1; font-weight: 700; }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 10px 10px; border-bottom: 2px solid #dde3ea; vertical-align: top; }
th { background: var(--soft); font-size: 0.95rem; }
.tablewrap { overflow-x: auto; border: 2px solid #c9d0d8; border-radius: var(--radius); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* tiny bar charts (no JavaScript) */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.bars .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.bars .bar { width: 100%; background: var(--primary); border-radius: 6px 6px 0 0; min-height: 3px; }
.bars .val { font-weight: 800; font-size: 0.95rem; }
.bars .lab { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }

.cat-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.cat-tabs a { padding: 10px 16px; border: 2px solid var(--primary); border-radius: 999px; font-weight: 700; text-decoration: none; background: #fff; min-height: 44px; display: inline-flex; align-items: center; }
.cat-tabs a[aria-current='true'] { background: var(--primary); color: #fff; }

.resource-card { display: flex; flex-direction: column; gap: 6px; }
.step-img { width: 100%; max-height: 520px; object-fit: contain; background: #fff; border: 2px solid #c9d0d8; border-radius: 12px; }
.step { counter-increment: step; }
.step h2::before { content: 'Step ' counter(step) ': '; color: var(--primary); }
.steps { counter-reset: step; }
.swatch { display: inline-block; width: 28px; height: 28px; border-radius: 6px; border: 2px solid #000; vertical-align: middle; }
.big-link { display: block; padding: 16px; border: 3px solid var(--primary); border-radius: var(--radius); background: #fff; font-weight: 800; font-size: 1.2rem; text-decoration: none; text-align: center; }
.copybox { word-break: break-all; background: #fff; border: 3px dashed #5b6570; padding: 12px; border-radius: 10px; font-family: ui-monospace, Consolas, monospace; font-size: 1rem; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 1.6rem; font-weight: 800; letter-spacing: 0.15em; background: #fff; border: 3px solid var(--primary); border-radius: 10px; padding: 6px 14px; display: inline-block; }

.auth { max-width: 520px; margin: 24px auto; }

@media print {
  .topbar, .nav, .skip, .no-print, footer.site .no-print { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .card { break-inside: avoid; border-color: #888; }
  .print-title { display: block !important; }
}
.print-title { display: none; }
