:root {
    --fg: #1a1a1a;
    --bg: #fff;
    --muted: #666;
    --accent: #0a58ca;
    --rule: #ddd;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font: 1rem/1.5 system-ui, sans-serif;
    color: var(--fg);
    background: var(--bg);
}

a { color: var(--accent); }

/* Text colours: --fg 16.9:1, --muted 5.7:1, --accent 7:1 on white (WCAG AA needs 4.5:1). */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.skip-link { position: absolute; left: -999rem; background: var(--bg); padding: .5rem 1rem; z-index: 1; }
.skip-link:focus { left: 1rem; top: 1rem; }

.site-header, main, .site-footer {
    width: 100%;
    max-width: 64rem;
    margin: 0 auto;
    padding: 1rem;
}

.site-header { border-bottom: 1px solid var(--rule); }
.site-name { font-weight: 700; font-size: 1.125rem; color: var(--fg); text-decoration: none; }

main { flex: 1; }

.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.site-nav { display: flex; align-items: center; gap: 1rem; }
.site-nav a, .link-button { padding: .25rem 0; }
.site-nav form, form p { margin: 0; }

form p { margin: .75rem 0; }
.field { display: flex; flex-direction: column; gap: .25rem; max-width: 24rem; }
input:not([type=checkbox]) { font: inherit; padding: .5rem; border: 1px solid #767676; border-radius: .25rem; }
input[aria-invalid=true] { border-color: #b02a37; }
.error { color: #b02a37; font-size: .875rem; } /* 6.3:1 on white */
.status { padding: .5rem .75rem; border: 1px solid var(--rule); border-left: .25rem solid var(--accent); }
button { font: inherit; padding: .5rem 1rem; color: #fff; background: var(--accent); border: 0; border-radius: .25rem; cursor: pointer; }
button.link-button { padding: .25rem 0; color: var(--accent); background: none; text-decoration: underline; }
button.danger { background: #b02a37; }
.codes { list-style: none; padding: 0; columns: 2; max-width: 20rem; }
.qr { width: 12rem; height: 12rem; }
.qr svg { width: 100%; height: 100%; }

.site-footer { border-top: 1px solid var(--rule); color: var(--muted); font-size: .875rem; }

h1 { margin-top: 0; font-size: 1.5rem; }
h2 { font-size: 1.125rem; }

.with-sidebar { display: grid; gap: 1.5rem; }
.sidebar { order: 2; font-size: .875rem; border-top: 1px solid var(--rule); padding-top: 1rem; }
.sidebar h2 { margin: 0 0 .5rem; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar ul ul { padding-left: .75rem; }
.sidebar li a { display: inline-block; padding: .25rem 0; } /* >= 24px tap target */
.sidebar .maker { margin-top: .5rem; font-weight: 600; }
.sidebar a[aria-current] { font-weight: 700; color: var(--fg); }

.answer { font-size: 1.125rem; font-weight: 600; }

.day h2 { margin: 1.5rem 0 .5rem; padding-bottom: .25rem; border-bottom: 1px solid var(--rule); }
.item { margin: 0 0 1.25rem; }
.item h3 { margin: 0; font-size: 1rem; }
.item p { margin: .25rem 0; }
.item h4 { margin: .5rem 0 0; font-size: .875rem; }
.item .notes { white-space: pre-line; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: .875rem; }
.badge, .ai-label { border: 1px solid var(--rule); border-radius: .25rem; padding: 0 .375rem; font-size: .75rem; white-space: nowrap; }
.badge-camera_tested { border-color: #198754; color: #146c43; }
.tags { list-style: none; margin: .25rem 0; padding: 0; display: flex; flex-wrap: wrap; gap: .375rem; font-size: .8125rem; }
.pager { display: flex; gap: 1rem; margin: 1.5rem 0; }

@media (min-width: 48rem) {
    .site-header, main, .site-footer { padding: 1.5rem; }
    .with-sidebar { grid-template-columns: 1fr 14rem; }
    .sidebar { order: 0; border-top: 0; padding-top: 0; }
}
