:root {
    color-scheme: light dark;
    --bg: light-dark(#ffffff, #191b1c);
    --fg: light-dark(#151515, #eceeed);
    --surface: light-dark(#ffffff, #222526);
    --muted: light-dark(#62686b, #a4abad);
    --border: light-dark(#dedfdd, #3a3f41);
    --control-border: light-dark(#858b8e, #747c80);
    --hover: light-dark(#efefef, #2e3335);
    --brand: light-dark(#ed4440, #f45b54);
    --accent: light-dark(#c93430, #f45b54);
    --tint: light-dark(#fff0ef, #432927);
    --red: light-dark(#ff3b30, #ff453a);
    --orange: light-dark(#ff9500, #ff9f0a);
    --yellow: light-dark(#ffcc00, #ffd60a);
    --green: light-dark(#34c759, #30d158);
    font: 16px/1.6 system-ui, sans-serif;
    color: var(--fg);
    background: var(--bg);
}
* { box-sizing: border-box; }
body {
    --page-padding: 2rem;
    max-width: 1120px;
    margin: auto;
    padding: calc(var(--page-padding) + env(safe-area-inset-top, 0px)) max(var(--page-padding), env(safe-area-inset-right, 0px)) calc(var(--page-padding) + env(safe-area-inset-bottom, 0px)) max(var(--page-padding), env(safe-area-inset-left, 0px));
}
header { position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; }
.brand { display: grid; place-items: center; flex-shrink: 0; width: 6rem; height: 6rem; background: var(--hover); color: var(--brand); }
.brand::before { content: ''; width: 2.625rem; aspect-ratio: 7 / 11; background: currentColor; mask: url('/favicon.svg') center / contain no-repeat; }
.brand:hover { color: light-dark(#000000, #ffffff); }
header:not(:has(nav)) .brand { width: 3rem; height: 3rem; }
header:not(:has(nav)) .brand::before { width: 1.3125rem; }
nav, .row { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
header nav { min-width: 0; justify-content: flex-end; gap: 1rem; color: var(--accent); }
nav a, nav summary { min-height: 2.75rem; padding: .5rem; text-decoration-line: none; font-size: 1rem; font-weight: 400; }
header nav > a, header nav summary { font-size: 1.25rem; }
a { color: var(--accent); }
a, nav summary { text-underline-offset: .3em; text-decoration-thickness: 4px; }
nav a { color: inherit; }
.admin-menu { margin: 0; }
.admin-menu summary { position: relative; white-space: nowrap; list-style: none; }
.admin-menu summary::-webkit-details-marker { display: none; }
.admin-menu summary::after { content: '\00a0\00a0\00a0'; }
.admin-menu summary::before { content: ''; position: absolute; right: .55rem; top: 50%; width: .35em; height: .35em; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-75%) rotate(45deg); }
.admin-menu[open] summary::before { transform: translateY(-25%) rotate(-135deg); }
nav a:hover, nav summary:hover, .admin-menu[open] summary, .admin-menu:has(a[aria-current]) summary, header nav a[aria-current], header nav a:active, header nav summary:active { text-decoration-line: underline; }
.admin-links { position: absolute; z-index: 1; right: 0; top: calc(100% + .5rem); min-width: 11rem; max-width: 100%; padding: .5rem; border: 1px solid var(--border); background: var(--surface); }
.admin-links a { display: block; white-space: nowrap; }
main a:hover, a[aria-current='date'] { background: var(--tint); }
a[aria-current='date'] { color: var(--accent); }
main { padding: 4rem 0; overflow-wrap: anywhere; }
h1, h2 { line-height: 1.3; font-weight: 600; }
h1 { margin: 0 0 1rem; font-size: 2rem; }
h2 { margin: 0 0 1rem; font-size: 1.5rem; }
p { margin: .75rem 0 1.25rem; }
h1 + p { color: var(--muted); }
section { margin: 3rem 0; }
section > :first-child { margin-top: 0; }
section > :last-child { margin-bottom: 0; }
form { margin: 1rem 0; }
.row form { margin: 0; }
label { display: block; margin: 0 0 .5rem; }
input:not([type='checkbox']):not([type='hidden']), select { display: block; width: 100%; max-width: 26rem; min-height: 2.75rem; padding: .65rem .75rem; margin-bottom: 1rem; border: 1px solid var(--control-border); border-radius: 0; background: var(--surface); color: var(--fg); font: inherit; }
input[type='checkbox'] { width: 1rem; height: 1rem; vertical-align: middle; accent-color: var(--accent); }
button, .button { min-height: 2.75rem; padding: .55rem 1rem; margin: .25rem 0; border: 1px solid var(--control-border); border-radius: 0; font: inherit; color: var(--fg); background: var(--surface); cursor: pointer; }
.button { display: inline-block; text-decoration-line: none; }
button:hover, .button:hover { background: var(--hover); } button:disabled { opacity: .5; cursor: wait; }
[data-passkey] button, .primary { color: var(--bg); background: var(--accent); border-color: var(--accent); }
[data-passkey] button:hover, .primary:hover { background: var(--fg); border-color: var(--fg); }
.big { display: block; width: 100%; max-width: 32rem; padding: 1rem; font-size: 1.25rem; text-align: center; }
summary.button { list-style: none; } summary.button::-webkit-details-marker { display: none; }
details[open] > summary.button { display: none; }
.flashcard { max-width: 32rem; } .flashcard h1 { font-size: 1.5rem; }
.flashcard > p:first-child { margin: 0; color: var(--muted); }
.flashcard .row { flex-wrap: nowrap; } .flashcard button { border-color: currentColor; }
.answer { font-size: 1.25rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .5rem; padding: 0; list-style: none; }
.cards li { margin: 0; } .cards .button { display: block; height: 100%; margin: 0; }
button[aria-pressed='true'] { background: var(--tint); color: var(--accent); border-color: var(--accent); }
.chip { font-size: .8rem; padding: .4rem .7rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.badge { display: inline-block; background: var(--hover); color: var(--muted); padding: .15rem .5rem; margin: .1rem; font-size: .8rem; }
code { font-size: .8rem; overflow-wrap: anywhere; } pre { white-space: pre-wrap; font-size: .85rem; color: var(--muted); }
#count { display: block; font-size: 3.5rem; line-height: 1.2; font-variant-numeric: tabular-nums; margin: 1rem 0; }
.table-scroll { overflow-x: auto; } table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { border-bottom: 1px solid var(--border); padding: .9rem .65rem; vertical-align: top; }
th { font-weight: 550; }
thead th { color: var(--muted); font-size: .8rem; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
td time { display: block; white-space: nowrap; } time { color: var(--muted); font-size: .85rem; margin: 0 .25rem; }
ul { padding-left: 1.25rem; }
dt { color: var(--muted); } dd { margin: 0 0 .8rem; } li { margin: .6rem 0; }
summary { cursor: pointer; } details { margin-top: 2rem; }
main > details { margin-top: 3rem; }
main > details > summary { color: var(--muted); }
.danger, .error, #auth-error, .level-4, .not-correct { --status: var(--red); }
.level-1, .correct { --status: var(--green); } .level-2 { --status: var(--yellow); } .level-3 { --status: var(--orange); }
.danger, .error, #auth-error, .level-1, .level-2, .level-3, .level-4, .correct, .not-correct { color: light-dark(color-mix(in oklab, var(--status) 65%, black), color-mix(in oklab, var(--status) 75%, white)); }
#auth-error:empty { margin: 0; }
@media (display-mode: standalone), (display-mode: fullscreen) { body { padding-top: calc(2rem + env(safe-area-inset-top, 0px)); } }
