body { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: #222; background: #fff; margin: 0; }
header, main, footer { max-width: 960px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
header { border-bottom: 1px solid #ccc; padding-top: calc(12px + env(safe-area-inset-top)); padding-bottom: 8px; }
.brand { margin: 0 0 4px; font-weight: 600; font-size: 17px; }
.brand a { color: inherit; text-decoration: none; }
nav a { margin-right: 14px; white-space: nowrap; }
nav a.on { font-weight: 600; color: #222; text-decoration: none; }
.who { float: right; color: #555; }
footer { border-top: 1px solid #ccc; margin-top: 32px; padding-top: 8px; padding-bottom: calc(16px + env(safe-area-inset-bottom)); color: #666; font-size: 13px; }
h1 { font-size: 22px; margin: 20px 0 12px; }
.sec { font-size: 17px; margin: 24px 0 8px; }
a { color: #1a4f9c; }
.back { margin: 12px 0 0; }

/* Listen */
.list { list-style: none; margin: 0; padding: 0; border: 1px solid #ccc; }
.list li + li { border-top: 1px solid #e3e3e3; }
.row { display: flex; align-items: center; gap: 12px; padding: 6px 10px; color: inherit; text-decoration: none; }
a.row:hover { background: #f5f7fb; }
.row .body { flex: 1; min-width: 0; }
.row .title { display: block; font-weight: 600; }
.row .sub { display: block; font-size: 13px; color: #666; }
.row .trail { flex: none; display: flex; align-items: center; gap: 8px; }
.row form { margin: 0; }
.date { flex: none; width: 44px; color: #555; font-size: 13px; line-height: 1.2; }
.date b { display: block; font-size: 15px; color: #222; }
.foot { margin: 6px 0 0; font-size: 13px; color: #666; }

/* Noten */
.pill { display: inline-block; min-width: 36px; text-align: center; font-weight: 700; font-size: 16px; }
.num { font-weight: 700; min-width: 40px; text-align: right; font-variant-numeric: tabular-nums; }
.tag { font-size: 13px; color: #666; white-space: nowrap; }
.tag.warn { color: #a00; }
.tag.soon { color: #8a5a00; font-weight: 600; }
.tag.ex { color: #555; border: 1px solid #aaa; padding: 0 4px; font-size: 11px; font-weight: 600; }

/* Kennzahlen */
.hero { display: block; border: 1px solid #ccc; padding: 12px 16px; margin: 12px 0; }
.hero .k { display: block; color: #555; }
.hero .v { display: block; font-size: 36px; font-weight: 700; font-variant-numeric: tabular-nums; }
.hero .s { display: block; color: #666; font-size: 13px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 12px 0; }
.tile { border: 1px solid #ccc; padding: 8px 12px; display: grid; }
.tile .k { color: #555; font-size: 13px; }
.tile .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tiles.two .tile .v { font-size: 17px; }
.tile .s { color: #666; font-size: 12px; }

/* Diagramme */
.chartcard { border: 1px solid #ccc; padding: 8px; }
svg.chart { display: block; width: 100%; height: auto; }
.chart .grid { stroke: #e3e3e3; }
.chart .axis { fill: #666; font-size: 12px; }
.chart .val { fill: #222; font-size: 13px; font-weight: 600; }
.chart .avg { fill: none; stroke: #1a4f9c; stroke-width: 2; }
.chart .pt { fill: #222; }
.chart .pt.ex { fill: #fff; stroke: #222; stroke-width: 2; }
.chart .bar { fill: #1a4f9c; }
.legend { font-size: 12px; color: #666; margin: 4px 0 0; }
.legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #222; }
.legend .dot.ex { background: #fff; border: 2px solid #222; width: 6px; height: 6px; }
.legend .line { display: inline-block; width: 14px; height: 2px; background: #1a4f9c; vertical-align: middle; }
.meter { width: 64px; height: 6px; }
.meter .track { fill: #e3e3e3; }
.meter .fill { fill: #1a4f9c; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Formulare */
.card { border: 1px solid #ccc; padding: 12px; margin: 12px 0; }
.card.meta .title { display: block; font-weight: 600; font-size: 17px; }
.card.meta .sub { color: #666; font-size: 13px; }
.form { max-width: 560px; display: grid; gap: 12px; }
fieldset { border: 0; margin: 0; padding: 0; }
.field { display: grid; gap: 3px; }
.field > span, .field > legend { font-weight: 600; padding: 0; }
.field small { color: #666; font-size: 13px; }
input, select, button { font: inherit; }
input:not([type=radio]), select { padding: 5px 7px; border: 1px solid #aaa; max-width: 100%; font-size: 16px; }
.segs label { margin-right: 14px; white-space: nowrap; }
.inline { display: inline; }
form.center { margin: 12px 0; }
.btn { display: inline-block; padding: 4px 14px; border: 1px solid #888; background: #f4f4f4; color: #222; text-decoration: none; font-size: 15px; cursor: pointer; }
.btn.primary { background: #1a4f9c; border-color: #1a4f9c; color: #fff; }
.btn.danger { color: #a00; }
.btn.small { padding: 1px 10px; font-size: 13px; }
.actions { margin: 12px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.seg { margin: 8px 0; }
.seg a { margin-right: 12px; }
.seg a.on { font-weight: 600; color: #222; text-decoration: none; }

.msg { padding: 8px 12px; border-left: 4px solid; background: #f7f7f7; }
.msg.ok { border-color: #2a7a2a; }
.msg.err { border-color: #b00; }
.msg.info { border-color: #888; }
.profile { display: block; margin: 8px 0; }
.avatar { display: none; }
.profile .title { font-weight: 600; margin-right: 8px; }
.profile .sub { color: #666; }
.code { font: 600 24px/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 2px; margin: 4px 0; }
.danger-zone summary { color: #a00; cursor: pointer; }
.lede { color: #444; }
.hint { color: #666; font-size: 13px; }
.center { text-align: center; }

/* Stundenplan */
.weeknav { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.weeknav .mid { text-align: center; color: #222; text-decoration: none; }
.weeknav small { display: block; color: #666; }
.scroll { overflow-x: auto; }
table.plan { border-collapse: collapse; width: 100%; }
table.plan th, table.plan td { border: 1px solid #ccc; padding: 4px 6px; text-align: center; vertical-align: top; }
table.plan th { background: #f2f2f2; font-weight: 600; }
table.plan small { display: block; color: #666; font-size: 12px; font-weight: 400; }
table.plan th.today { background: #e3ecf8; }
table.plan td.exam { background: #fff6d6; }
table.plan td.frei { background: #fafafa; }
table.plan td.ferien { color: #555; background: #f2f2f2; }
table.plan tr.pause td { color: #777; font-size: 13px; background: #fafafa; }

@media (max-width: 640px) {
  .who { float: none; display: block; margin-top: 4px; }
  table.plan th, table.plan td { font-size: 12px; padding: 2px 4px; }
}
