:root { color-scheme: dark; background: #000; color: #e8e8e8; font: 16px/1.6 system-ui, sans-serif; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
:host { display: block; }
body { max-width: 68rem; margin: auto; padding: 1.5rem; }
main { padding-block: 1.5rem 3rem; }
h1, h2, h3 { line-height: 1.25; font-weight: 600; margin: 0 0 1rem; }
h1 { font-size: 1.8rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1rem; }
a { color: #d6e6ff; text-underline-offset: .2em; }
nav, .account-tabs, .math-modes, .actions, .timer-controls, .med-actions, .med-settings, .rp-views { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
nav { gap: 1.25rem; padding-block: .5rem 1rem; border-bottom: 1px solid #333; }
nav a { color: #aaa; text-decoration: none; }
nav a[aria-current] { color: #fff; text-decoration: underline; }
hr { border: 0; border-top: 1px solid #333; }
button, input, select, textarea { font: inherit; color: inherit; background: #111; border: 1px solid #555; border-radius: .3rem; padding: .45rem .7rem; max-width: 100%; }
button, summary { cursor: pointer; }
button:hover:not(:disabled) { background: #222; border-color: #aaa; }
button:disabled { opacity: .5; cursor: default; }
button[aria-selected="true"], button[aria-pressed="true"], button.primary { background: #e8e8e8; color: #111; border-color: #e8e8e8; }
button[aria-selected="true"]:hover, button[aria-pressed="true"]:hover, button.primary:hover { background: #ccc; }
:focus-visible { outline: 2px solid #b6d3ff; outline-offset: 3px; }
textarea { display: block; width: 100%; min-height: 12rem; resize: vertical; }
input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: #ddd; }
label { font-weight: 500; }
form > div, form > label { margin-block: .75rem; }
fieldset { border: 1px solid #444; border-radius: .3rem; }
small, .muted, .status, .timer-label, .rp-note, .rp-method, .med-footnote { color: #aaa; }
small { display: block; }
.error:not(:empty), [role="alert"]:not(:empty) { margin-block: 1rem; color: #ffb5b5; }
pre, .rp-ascii { white-space: pre-wrap; overflow-wrap: anywhere; font-family: monospace; }
.rp-top, .rp-foundation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; max-width: 44rem; margin-inline: auto; }
.layout > section[aria-label="Leestimer"] { text-align: center; }
.layout .book-row, .layout .timer-controls { justify-content: center; }
.layout .book-row { flex-wrap: nowrap; }
.layout #add-book { flex-shrink: 0; white-space: nowrap; }
.layout .book-field { flex: 0 1 24rem; }
.book-row, .notepad-heading { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.book-field { flex: 1; min-width: 0; }
.book-field select { width: 100%; }
#ascii-timer, #med-clock { font-size: clamp(2rem, 7vw, 3.5rem); font-variant-numeric: tabular-nums; line-height: 1.2; }
.timer-panel, .med-panel, .math-question-panel { margin-block: 1.5rem; }
.focus-training, .dossier-overview, .account-panel, .rp-history, .rp-foundation, .med-plan, details { margin-top: 2rem; }
.account-tabs, .math-modes { margin-block: 1.25rem; }
.rp-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-block: 2rem; }
dd { margin: .25rem 0 0; }
.rp-big, .rp-target, .rp-total { font-size: 1.8rem; margin-block: .75rem; }
table { width: 100%; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
caption { text-align: left; margin-bottom: .5rem; }
th, td { padding: .65rem .5rem; border-bottom: 1px solid #333; vertical-align: top; overflow-wrap: anywhere; }
.table-wrap, .rp-table-wrap, #rp-chart-content { overflow-x: auto; }
.sessions, .dossier-books { padding: 0; list-style: none; }
.session-row, .dossier-books li, .dossier-session { padding-block: 1rem; border-bottom: 1px solid #333; }
.session-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.med-settings { margin-block: 1.25rem; }
.med-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .75rem; list-style: none; padding: 0; }
.med-step { padding: .75rem; border: 1px solid #333; border-radius: .3rem; }
.med-step span, .med-step progress { display: block; }
progress { max-width: 100%; accent-color: #ddd; }
dialog { width: min(36rem, calc(100% - 2rem)); max-height: 85vh; overflow: auto; padding: 1.5rem; background: #111; color: #eee; border: 1px solid #666; border-radius: .4rem; }
dialog::backdrop { background: #000b; }
#login { max-width: 24rem; margin: 10vh auto 0; }
#login input, #login button { width: 100%; }
@media (max-width: 650px) {
  body { padding: 1rem; }
  main { padding-top: 1.25rem; }
  .layout, .rp-top, .rp-foundation { grid-template-columns: 1fr; gap: 1.5rem; }
  nav { gap: .75rem 1rem; }
  th, td { padding: .5rem .35rem; }
  #login { margin-top: 4vh; }
}
