:root {
  color-scheme: dark;
  --bg: #000;
  --card: #111;
  --card-hover: #1a1a1a;
  --ink: #f4f4f4;
  --muted: #9a9a9a;
  --line: #2a2a2a;
  --on-ink: #000;
  --field: #000;
  --tile: #000;
  --track: #000;
  --plus: #3dcc7a;
  --minus: #e15b5b;
  --error-bg: #1a0d0d;
  --warn: #e6c200;
  --live: #f08a24;
  --work-bg: #3a3a3a;
  --off-bg: #12304f;
  --off-ink: #f4f8ff;
  --off-stripe: rgba(255, 255, 255, 0.32);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { max-width: 100%; overflow-x: hidden; touch-action: pan-x pan-y; }

html.popup-open,
html.popup-open body {
  overflow: hidden;
  height: 100%;
}
html.popup-open body {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 ui-sans-serif, system-ui, sans-serif;
}

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

.bar, main, footer {
  width: min(52rem, calc(100% - 2rem));
  margin: 0 auto;
}

.bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
  max-width: 100%;
  min-width: 0;
}

.brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 560;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
}

.nav {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}
.nav a {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}
.nav a:hover { color: var(--ink); }
.nav a.icon-button { color: var(--ink); }
.edited-mark { margin-left: 0.35rem; color: var(--muted); font-size: 0.75rem; }
.report-switch { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0 0 0.75rem; min-width: 0; }
.report-switch a { color: var(--muted); text-decoration: none; }
.report-switch a[aria-current="page"] { color: var(--ink); font-weight: 650; }

.header-end {
  margin-left: auto;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
}

.logout { margin: 0; display: flex; align-items: center; }

.header-end button.quiet {
  padding: 0;
  border: 0;
  line-height: 1;
  background: transparent;
  color: var(--ink);
  white-space: nowrap;
}

.choice {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.7rem;
}
.choice form { margin: 0; }
a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.7rem;
  background: var(--ink);
  color: var(--on-ink);
  text-decoration: none;
  border: 1px solid var(--ink);
}

.day-block { border-top: 1px solid var(--line); padding: 1rem 0; }
.day-block h3 { margin: 0 0 0.55rem; font-size: 1rem; font-weight: 560; }
.weekend-tag {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.4rem;
  background: var(--off-bg);
  color: var(--off-ink);
  font-size: 0.72rem;
  font-weight: 560;
  letter-spacing: 0.02em;
  vertical-align: middle;
}
.stack { display: flex; flex-direction: column; gap: 0.9rem; margin-top: 0.8rem; }
.year-nav { display: flex; flex-wrap: wrap; gap: 0.85rem 1.1rem; align-items: center; margin: 0 0 0.9rem; }
.year-nav a { text-decoration: none; min-height: 2.75rem; display: inline-flex; align-items: center; }
.year-nav strong { font-size: 1.2rem; }
.overview-label { margin: 0.8rem 0 0.15rem; color: var(--muted); }

a.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
}

.settings form { margin: 0; }
.settings a,
.settings button.quiet {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  font-size: 1rem;
}

main { padding: 1.4rem 0 2rem; }

footer {
  padding: 0 0 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

h1, h2 { font-weight: 560; letter-spacing: -0.03em; }
h1 { margin: 0 0 0.8rem; font-size: 1.8rem; }
h2 { margin: 0 0 0.7rem; font-size: 1.25rem; }

.card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 1.35rem 1.35rem 1.5rem;
  margin-bottom: 1.15rem;
  overflow-wrap: break-word;
}

.narrow { max-width: 32rem; }

.row, .stamp-edit, .plain li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: end;
}

.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  gap: 0.7rem;
  align-items: end;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 0.8rem;
}

.filters label { min-width: 0; }
.filters input, .filters select, .filters button { width: 100%; min-width: 0; }

.row { align-items: center; justify-content: space-between; }

label, fieldset { display: flex; flex-direction: column; gap: 0.45rem; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; max-width: 100%; }
code { overflow-wrap: anywhere; }
legend { color: var(--muted); margin-bottom: 0.3rem; }

input, select, textarea, button {
  font: inherit;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0.55rem 0.7rem;
}

textarea { width: 100%; resize: vertical; }

button { cursor: pointer; background: var(--ink); color: var(--on-ink); }
button.quiet { background: transparent; color: var(--ink); }
.twice-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sure-question { color: var(--minus); font-weight: 650; margin: 0.6rem 0; }
button.sure-yes { background: var(--minus); color: #fff; border-color: var(--minus); }
button:disabled { opacity: 0.35; cursor: not-allowed; }

.checks { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; }
.check { flex-direction: row; align-items: center; gap: 0.45rem; }
.switch {
  position: relative;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  cursor: pointer;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.switch-ui {
  width: 2.8rem;
  height: 1.6rem;
  border-radius: 999px;
  background: var(--track);
  border: 1px solid var(--line);
  position: relative;
  flex: 0 0 auto;
}
.switch-ui::after {
  content: "";
  position: absolute;
  top: 0.14rem;
  left: 0.14rem;
  width: 1.22rem;
  height: 1.22rem;
  border-radius: 50%;
  background: var(--muted);
}
.switch input:checked + .switch-ui { background: var(--ink); border-color: var(--ink); }
.switch input:checked + .switch-ui::after { left: auto; right: 0.14rem; background: var(--on-ink); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--ink); outline-offset: 3px; }
fieldset:disabled .switch { opacity: 0.4; }

.steps { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1.1rem; }
.step { margin-top: 1.1rem; }
.steps .step { margin-top: 0; }
.step button {
  width: 100%;
  min-height: 3.4rem;
  font-size: 1.15rem;
}

.presence-line {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.6rem;
  align-items: flex-end;
  margin: 0.85rem 0 0;
}
.clock-block { display: flex; flex-direction: column; gap: 0.2rem; }
.clock-label { color: var(--muted); font-size: 0.8rem; }
.presence, .pause-clock {
  font-variant-numeric: tabular-nums;
  font-size: clamp(2.4rem, 12vw, 4.2rem);
  line-height: 1;
  letter-spacing: -0.04em;
  font-weight: 560;
  max-width: 100%;
}
.pause-clock { color: #f08a24; }

.step-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.4rem;
  font-size: 1.15rem;
  text-decoration: none;
  background: var(--ink);
  color: var(--on-ink);
}
.step-link.secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.endbox {
  margin-top: 1.1rem;
  border: 1px solid var(--line);
  padding: 1rem;
}
.endbox h2 { margin: 0 0 0.7rem; font-size: 1.2rem; }
.endbox dl {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.25rem 0.6rem;
  margin: 0;
}
.endbox dt { color: var(--muted); }
.endbox dd { margin: 0; }
.endbox .result {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
}
.pauses {
  margin-top: 1.1rem;
  background: var(--tile);
  border: 1px solid var(--line);
  padding: 0.9rem 1rem;
}
.pauses h2 { margin: 0 0 0.65rem; font-size: 1rem; }
.pause-row {
  display: grid;
  grid-template-columns: 5.5em minmax(0, 1fr) auto;
  gap: 0.15rem 0.75rem;
  align-items: baseline;
}
.pause-row .t, .pause-row .m { font-variant-numeric: tabular-nums; }
.pause-row .m { color: var(--muted); }
.pause-row.live .t { color: var(--live); }
.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.9rem;
}
.tile {
  background: var(--tile);
  border: 1px solid var(--line);
  padding: 0.7rem 0.75rem;
  min-width: 0;
}
.tile .l, .tile .s { display: block; color: var(--muted); font-size: 0.75rem; }
.tile .v { font-variant-numeric: tabular-nums; font-size: 1.15rem; }
.pausehint { color: var(--warn); margin: 0.75rem 0 0; }
.vacation-low { color: var(--warn); }
.vacation-out { color: var(--minus); }

.soll-bar {
  --soll: 0%;
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  height: 0.5rem;
  margin-top: 0.85rem;
  border: 1px solid var(--line);
  background: linear-gradient(to right, var(--ink) var(--soll), var(--track) var(--soll));
  overflow: hidden;
}
.soll-bar.met {
  background: linear-gradient(to right, var(--plus) var(--soll), var(--track) var(--soll));
}
.soll-fill {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.plus { color: var(--plus); }
.minus { color: var(--minus); }
.saldo {
  margin: 0.15rem 0 0;
  font-size: clamp(1.8rem, 8vw, 2.8rem);
  line-height: 1;
  font-weight: 560;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.scroll { overflow-x: auto; max-width: 100%; min-width: 0; }
.sheet { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.sheet th, .sheet td {
  text-align: left;
  padding: 0.45rem 0.4rem;
  border-top: 1px solid var(--line);
  vertical-align: top;
  white-space: nowrap;
}
.sheet th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 560;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sheet tr.is-weekend td {
  background: var(--off-bg);
  color: var(--off-ink);
}
.sheet tr.is-weekend .plus { color: #8ee0b0; }
.sheet tr.is-weekend .minus { color: #ffb4b4; }
.sheet tr.is-weekend .meta,
.sheet tr.is-weekend .edited-mark { color: var(--off-ink); }

.nav form { margin: 0; }
body.simple .nav button { min-height: 2.75rem; }
.simple-label { margin: 1rem 0 0.2rem; font-size: 1.05rem; }
.simple-number {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-size: clamp(3.4rem, 18vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-weight: 560;
}
.simple-when { margin: 0.7rem 0 0.2rem; font-size: 1.35rem; }
body.simple .simple-now .step button,
body.simple .simple-now .step-link {
  min-height: 4.6rem;
  font-size: 1.65rem;
}

.accounts li { align-items: center; }
.account-actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; }

.clock {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.25rem, 6vw, 1.8rem);
  letter-spacing: -0.03em;
  max-width: 100%;
}

.status { margin: 0.8rem 0 0.2rem; }
.meta, footer p { color: var(--muted); }
.hint, .error { padding: 0.7rem 0.85rem; border: 1px solid var(--line); }
.hint { background: var(--card); }
.error { background: var(--error-bg); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
}
.timeline time { min-width: 3.2rem; font-variant-numeric: tabular-nums; }

.plain { list-style: none; margin: 0.8rem 0 0; padding: 0; }
.plain li { justify-content: space-between; padding: 0.85rem 0; border-top: 1px solid var(--line); gap: 0.75rem; }
.plain.jobs li { align-items: center; }

.figures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.15rem;
  margin: 1rem 0 0;
}
.figures div { margin: 0; }
.figures dt { color: var(--muted); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; }
.figures dd { margin: 0.15rem 0 0; font-size: 1.35rem; overflow-wrap: anywhere; }

.danger { margin-top: 1.4rem; }

.import-columns { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.import-columns li {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 0.6rem;
  align-items: baseline;
  padding: 0.4rem 0;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.import-columns .letter { color: var(--muted); }

.plan-legend { display: flex; flex-wrap: wrap; gap: 0.7rem 1.15rem; margin: 0.4rem 0 0; padding: 0; list-style: none; }
.plan-legend li { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.swatch, .bars i { background: var(--swatch); }
.swatch { width: 0.95rem; height: 0.95rem; border-radius: 0.2rem; flex: 0 0 auto; }
.swatch.plan-beantragt, .bars i.plan-beantragt {
  background: repeating-linear-gradient(-45deg, var(--swatch) 0 4px, rgba(255, 255, 255, 0.45) 4px 7px);
}
.swatch.fill-voll, .bars i.fill-voll { background: var(--swatch); }
.swatch.fill-gestreift, .bars i.fill-gestreift {
  background: repeating-linear-gradient(-45deg, var(--swatch) 0 4px, rgba(255, 255, 255, 0.45) 4px 7px);
}
.swatch.fill-pastell, .bars i.fill-pastell {
  background: color-mix(in srgb, var(--swatch) 42%, #fff);
}
.swatch.plan-abgelehnt, .bars i.plan-abgelehnt { background: #f3b7b7; }
.swatch.plan-off { background: var(--off-bg); }
.swatch.plan-holiday { background: #e6b325; }
.swatch.plan-ferien { background: #1f7a74; }
.swatch.plan-school { background: #8b74d6; }
.year { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 0.8rem; margin-top: 0.8rem; }
.month-card { min-width: 0; }
.month-card h2 { margin: 0 0 0.35rem; font-size: 1rem; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.month-grid .dow, .month-grid .day {
  min-width: 0;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  font-size: 0.78rem;
}
.month-grid .dow { color: var(--muted); aspect-ratio: auto; padding: 0.2rem 0; }
.month-grid .dow.is-weekend { color: var(--off-ink); background: var(--off-bg); border-radius: 0.25rem; }
.month-grid button.day {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 0;
  font: inherit;
  line-height: 1;
  border: 0;
  background: var(--work-bg);
  color: var(--ink);
  cursor: pointer;
}
.month-grid button.day.is-off {
  background-color: var(--off-bg);
  color: var(--off-ink);
  background-image: repeating-linear-gradient(-45deg, transparent, transparent 3px, var(--off-stripe) 3px, var(--off-stripe) 4px);
}
.month-grid button.day.is-holiday {
  background: #e6b325;
  color: #1c1400;
  background-image: none;
}
.month-grid button.day.is-ferien {
  background: #1f7a74;
  color: #f4fffe;
  background-image: none;
}
.month-grid button.day.is-school { box-shadow: inset 0 3px 0 #8b74d6; }
.month-grid button.day.is-selected { outline: 2px solid var(--ink); outline-offset: -2px; }
.month-grid button.day.is-selected::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  box-shadow: inset 0 0 0 3px var(--ink);
  pointer-events: none;
}
.month-grid .day b { position: relative; z-index: 3; font-weight: 560; }
.bars { position: absolute; inset: 0; display: flex; }
.bars i { flex: 1 1 0; min-width: 0; }
.plan-forms { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-top: 0.85rem; }
.plan-forms form { margin: 0; }
.mini-pencil { width: 1.05rem; height: 1.05rem; }
.settings-pencil { display: none; }
.nachtragen { margin: 0.25rem 0 0; }
.nachtragen-note { margin: 0 0 0.25rem; }
.card:has(+ .nachtragen-note) { margin-bottom: 0.35rem; }
body:has(p.nachtragen) main { padding-bottom: 0.25rem; }
body:has(p.nachtragen) footer .detail { display: none; }
details.report-job > summary,
details.plan-month > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-weight: 560;
  list-style: none;
}
details.report-job > summary { font-size: 1.25rem; margin: 0 0 0.7rem; }
details.plan-month > summary { font-size: 1rem; margin: 0 0 0.35rem; }
details.report-job > summary::-webkit-details-marker,
details.plan-month > summary::-webkit-details-marker { display: none; }
details.report-job > summary::after,
details.plan-month > summary::after { content: "›"; color: var(--muted); font-weight: 400; }
details.report-job[open] > summary::after,
details.plan-month[open] > summary::after { content: "⌄"; }
.color-job { margin: 0.8rem 0; }
.color-job .job-name { margin: 0 0 0.35rem; font-weight: 560; }

@media (min-width: 720px) {
  .figures { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.tabbar { display: none; }

@media (max-width: 40rem) {
  .bar, main, footer { width: min(52rem, calc(100% - 1.25rem)); }
  .bar { gap: 0.4rem 0.65rem; padding: 0.6rem 0; }
  .brand { order: 1; font-size: 1.15rem; }
  .header-end { order: 2; }
  .nav { order: 3; flex-basis: 100%; gap: 0.35rem 0.65rem; }
  .nav a { min-height: 2.75rem; }
  a.icon-button { width: 2.75rem; height: 2.75rem; }
  h1 { font-size: 1.55rem; }
  .card { padding: 1rem; }
  .filters { grid-template-columns: 1fr; }
  main button,
  main a.button,
  main .step-link,
  label input:not([type="checkbox"]):not([type="radio"]),
  label select,
  label textarea,
  .stamp-edit input,
  .stamp-edit select,
  .stamp-edit button,
  .choice button,
  .choice a.button {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  input[type="date"],
  input[type="time"],
  input[type="month"],
  input[type="datetime-local"] {
    min-width: 0;
    max-width: 100%;
  }
  button, a.button, .step-link { min-height: 2.75rem; }
  .row, .stamp-edit, .plain li, .day-block .row { flex-direction: column; align-items: stretch; }
  .row.title-line {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: baseline;
  }
  .row.title-line h1,
  .row.title-line .clock { margin: 0; }
  .row.title-line .clock { white-space: nowrap; }
  .settings-pencil {
    display: inline-flex;
    flex: 0 0 auto;
    width: 2.75rem;
    height: 2.75rem;
  }
  .choice { flex-direction: row; width: 100%; }
  .choice form, .choice a.button { flex: 1 1 0; width: auto; min-width: 0; }
  .account-actions { flex-direction: column; align-items: stretch; }
  .account-actions button { width: 100%; text-align: left; }
  .report-switch { flex-direction: row; align-items: center; gap: 0.75rem; }
  .report-switch a { min-height: 2.75rem; display: inline-flex; align-items: center; }
  .scroll { overflow: visible; }
  .sheet, .sheet tbody, .sheet td { display: block; width: auto; }
  .sheet thead { display: none; }
  .sheet tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 0.65rem;
    width: auto;
    padding: 0.18rem 0 0.22rem;
    border-top: 1px solid var(--line);
  }
  .sheet td {
    display: flex;
    justify-content: space-between;
    gap: 0.4rem;
    border: 0;
    padding: 0.02rem 0;
    line-height: 1.2;
    white-space: normal;
  }
  .sheet td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .sheet td[data-label="Datum"] { display: block; grid-column: 1 / -1; font-weight: 560; padding-bottom: 0.04rem; }
  .sheet td[data-label="Datum"]::before { content: none; }
  .sheet tr.is-weekend { background: var(--off-bg); }
  .sheet tr.is-weekend td::before { color: var(--off-ink); }
  body.simple .nav { flex-basis: 100%; }
  body.simple .nav form,
  body.simple .nav button { width: 100%; }
  .tiles { gap: 0.4rem; }
  .tile { padding: 0.55rem 0.4rem; }
  .tile .v { font-size: 1rem; }
  .school-row { grid-template-columns: 1fr; }
  nav.nav[aria-label="Eigentime"] { display: none; }
  body.has-tabs { padding-bottom: calc(6.4rem + env(safe-area-inset-bottom)); }
  .tabbar {
    display: flex;
    justify-content: flex-start;
    flex-wrap: nowrap;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    background: var(--bg);
    border-top: 1px solid var(--line);
    padding: 0.7rem 0.2rem calc(1rem + env(safe-area-inset-bottom));
  }
  .tabbar a {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-width: 0;
    min-height: 3.6rem;
    padding: 0.35rem 0.05rem 0.15rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.68rem;
    line-height: 1.1;
  }
  .tabbar a[aria-current="page"] { color: var(--ink); }
  .tabbar svg { width: 1.35rem; height: 1.35rem; }
  .toolbar > label,
  .toolbar-even > label { flex: 1 1 100%; min-width: 100%; max-width: 100%; }
  .toolbar-actions { flex: 1 0 100%; min-width: 100%; margin-left: 0; }
  .toolbar-actions button,
  .toolbar-actions .quiet-link { flex: 1 1 0; justify-content: center; }
  .toolbar > button { flex: 1 1 100%; }
  .edits > li { grid-template-columns: auto minmax(0, 1fr) auto; }
  .edits .picker-open { width: 100%; }
  .edits-text > li { grid-template-columns: minmax(0, 1fr) auto; }
  .edits button,
  .stamp-line button,
  .stamp-line .stamp-edit input,
  .stamp-line .stamp-edit select,
  .toolbar button { width: auto; }
  .stamp-line,
  .stamp-line .stamp-edit { flex-direction: row; flex-wrap: nowrap; align-items: center; }
  .jobs li { grid-template-columns: minmax(0, 1fr) auto; }
  .jobs li .meta { grid-column: 1 / -1; }
  .segment span { font-size: 0.78rem; padding: 0.3rem 0.2rem; }
  .calendar {
    width: calc(100vw - 1rem);
    max-width: calc(100vw - 1rem);
    height: auto;
    max-height: calc(100dvh - 1rem);
    margin: auto;
  }
  .calendar-card {
    min-height: 0;
    max-height: calc(100dvh - 1rem);
    overflow: auto;
    box-sizing: border-box;
  }
  #plan-actions:not([hidden]) {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(6.4rem + env(safe-area-inset-bottom));
    z-index: 24;
    margin: 0;
    max-height: 42vh;
    overflow: auto;
    border-width: 1px 0 0;
  }
  #plan-actions .meta { display: none; }
}

.picker { display: block; min-width: 0; max-width: 100%; }
.picker-open {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
  background: var(--field);
  color: var(--ink);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: end;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 0.85rem;
}
.toolbar > label { flex: 0 1 auto; min-width: 0; }
.toolbar-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.5rem;
  align-items: end;
}
.toolbar > button,
.toolbar button,
.toolbar .quiet-link {
  flex: 0 0 auto;
  width: auto;
  white-space: nowrap;
}
.quiet-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.edits { list-style: none; margin: 0.5rem 0 0.8rem; padding: 0; }
.edits > li {
  display: grid;
  grid-template-columns: auto auto auto;
  justify-content: start;
  gap: 0.7rem;
  align-items: center;
  padding: 0.4rem 0;
  border-top: 1px solid var(--line);
}
.edits .picker-open { width: auto; min-width: 9rem; }
.edits-text > li { grid-template-columns: minmax(0, 1fr) auto; }
.edit-line { display: contents; }
.edit-when { font-variant-numeric: tabular-nums; }
.edit-field { margin: 0; min-width: 0; }
.edits button { width: auto; white-space: nowrap; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.stamp-line {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.35rem 0;
  min-width: 0;
}
.stamp-line > form { margin: 0; }
.stamp-line .stamp-edit {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  gap: 0.5rem;
  align-items: center;
  min-width: 0;
}
.stamp-line .stamp-edit input,
.stamp-line .stamp-edit select { flex: 1 1 0; width: auto; min-width: 0; }
.stamp-line button { flex: 0 0 auto; width: auto; white-space: nowrap; }

.fold { border-top: 1px solid var(--line); margin: 0; }
.fold summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 2.75rem;
  padding: 0.35rem 0;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 560;
  list-style: none;
}
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: "›"; color: var(--muted); font-weight: 400; }
.fold[open] summary::after { content: "⌄"; }
.fold > :not(summary) { margin-top: 0.55rem; }

.segment {
  display: flex;
  width: 100%;
  min-width: 0;
  margin: 0.35rem 0 0.7rem;
  border: 1px solid var(--line);
}
.segment label {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
}
.segment input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.segment span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.35rem 0.4rem;
  border-left: 1px solid var(--line);
  text-align: center;
  line-height: 1.2;
  cursor: pointer;
}
.segment label:first-child span { border-left: 0; }
.segment input:checked + span { background: var(--ink); color: var(--on-ink); }
.segment input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: -2px; }

.jobs li {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
  gap: 0.35rem 0.8rem;
  align-items: center;
}
.jobs .job-name { font-weight: 560; }
.jobs .meta { min-width: 0; }
.feierabend { margin: 0.7rem 0 0; font-variant-numeric: tabular-nums; }
.countdown-box { margin-top: 1rem; text-align: center; max-width: 100%; }
.countdown-label { margin: 0; color: var(--muted); }
.countdown {
  margin: 0.1rem 0;
  font-size: clamp(4.5rem, 24vw, 7.5rem);
  line-height: 0.9;
  font-weight: 560;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
}
button.stop {
  width: 100%;
  min-height: 3.4rem;
  font-size: 1.35rem;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.school-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.7rem;
  align-items: end;
  margin: 0.35rem 0 0.7rem;
}
.calendar {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  width: min(24rem, calc(100vw - 1.25rem));
  max-width: calc(100vw - 1.25rem);
  max-height: calc(100dvh - 1.25rem);
  overflow: auto;
}
.calendar::backdrop { background: rgba(0, 0, 0, 0.62); }
.calendar-card {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0.9rem;
  max-width: 100%;
  max-height: calc(100dvh - 1.25rem);
  overflow: auto;
}
.calendar-bar, .calendar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  min-width: 0;
}
#calendar-title {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  background: transparent;
  color: var(--ink);
  border: 0;
  font: inherit;
  font-weight: 560;
  text-align: center;
  overflow-wrap: anywhere;
}
.calendar-actions form { margin: 0; }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.2rem;
  margin: 0.7rem 0;
  max-width: 100%;
}
.calendar-grid.months, .calendar-grid.years { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.downloads { display: flex; flex-wrap: wrap; gap: 0.5rem; max-width: 100%; }
.downloads button { max-width: 100%; }
.calendar-grid button, .calendar-grid span {
  min-width: 0;
  max-width: 100%;
  padding: 0.45rem 0.1rem;
  text-align: center;
  background: transparent;
  color: var(--ink);
}
.calendar-grid .dow { color: var(--muted); font-size: 0.75rem; }
.calendar-grid .is-outside { color: var(--muted); }
.calendar-grid button.is-weekend { background: var(--off-bg); color: var(--off-ink); }
.calendar-grid button.is-weekend.is-selected { background: var(--ink); color: var(--on-ink); }
.calendar-grid .is-today { outline: 1px solid var(--ink); }
.calendar-grid .is-selected { background: var(--ink); color: var(--on-ink); }

html[data-theme="hell"] {
  color-scheme: light;
  --bg: #f4f4f4;
  --card: #fff;
  --card-hover: #ececec;
  --ink: #111;
  --muted: #5c5c5c;
  --line: #d9d9d9;
  --on-ink: #fff;
  --field: #fff;
  --tile: #f4f4f4;
  --track: #e6e6e6;
  --plus: #0d7a3f;
  --minus: #b42318;
  --error-bg: #fdecec;
  --warn: #8a6400;
  --live: #b45309;
  --work-bg: #fff;
  --off-bg: #3f6284;
  --off-ink: #f7fbff;
  --off-stripe: rgba(255, 255, 255, 0.28);
}

@media (prefers-color-scheme: light) {
  html[data-theme="system"] {
    color-scheme: light;
    --bg: #f4f4f4;
    --card: #fff;
    --card-hover: #ececec;
    --ink: #111;
    --muted: #5c5c5c;
    --line: #d9d9d9;
    --on-ink: #fff;
    --field: #fff;
    --tile: #f4f4f4;
    --track: #e6e6e6;
    --plus: #0d7a3f;
    --minus: #b42318;
    --error-bg: #fdecec;
    --warn: #8a6400;
    --live: #b45309;
    --work-bg: #fff;
    --off-bg: #3f6284;
    --off-ink: #f7fbff;
    --off-stripe: rgba(255, 255, 255, 0.28);
  }
}
