:root, [data-theme="light"] {
  --bg: #f3f5f8; --surface: #ffffff; --surface-2: #f8f9fb; --offset: #eceff4;
  --border: #d9dee6; --divider: #e5e8ee;
  --text: #18212d; --muted: #5a6675; --faint: #98a2b0; --inverse: #ffffff;
  --primary: #24578a; --primary-hover: #1b4570; --primary-soft: #e2ecf6;
  --ok: #287346; --ok-soft: #e1f1e7; --err: #b03140; --err-soft: #f7e2e5;
  --warn: #9a5b00; --warn-soft: #f7ecd9; --info: #5a6675; --info-soft: #eceff4;
  /* week types C, D, E, F of the week cycle (A = primary, B = warn) */
  --wt-c: #287346; --wt-c-soft: #e1f1e7; --wt-d: #6b4fa0; --wt-d-soft: #ece6f6;
  --wt-e: #1f7373; --wt-e-soft: #dcefee; --wt-f: #a33d6c; --wt-f-soft: #f6e3ec;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 2px 6px rgba(16, 24, 40, .05);
  --shadow-lift: 0 4px 14px rgba(16, 24, 40, .10);
  --radius: 10px; --radius-sm: 6px;
  --text-xs: clamp(.75rem, .72rem + .1vw, .8125rem);
  --text-sm: clamp(.8125rem, .8rem + .1vw, .875rem);
  --text-base: clamp(.875rem, .85rem + .15vw, .9375rem);
  --text-lg: clamp(1rem, .95rem + .3vw, 1.125rem);
  --text-xl: clamp(1.25rem, 1.1rem + .6vw, 1.5rem);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
[data-theme="dark"] {
  --bg: #0f141b; --surface: #161d27; --surface-2: #1b2430; --offset: #222c3a;
  --border: #2e3a4a; --divider: #263141;
  --text: #e4e9f0; --muted: #9aa6b5; --faint: #66727f; --inverse: #0f141b;
  --primary: #7fb0e3; --primary-hover: #a3c7ee; --primary-soft: #1d2f45;
  --ok: #6cc08e; --ok-soft: #173326; --err: #ef8792; --err-soft: #3a1c22;
  --warn: #e2a95a; --warn-soft: #3a2a12; --info: #9aa6b5; --info-soft: #222c3a;
  --wt-c: #6cc08e; --wt-c-soft: #173326; --wt-d: #b49ae6; --wt-d-soft: #2b2340;
  --wt-e: #6cc5c2; --wt-e-soft: #15302f; --wt-f: #ec8fb8; --wt-f-soft: #3a1d2b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lift: 0 4px 14px rgba(0, 0, 0, .45);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: var(--text-base); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; line-height: 1.45; }
button, input, select { font: inherit; color: inherit; }
[v-cloak] { display: none; }
.app { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; transition: grid-template-columns .18s ease; }
/* collapsed sidebar: symbols only, names as tooltips */
.app.nav-collapsed { grid-template-columns: 64px 1fr; }
.nav-collapsed .side { padding: 16px 8px; }
.nav-collapsed .brand { justify-content: center; padding: 4px 0 16px; }
.nav-collapsed .brand-text, .nav-collapsed .nav-label, .nav-collapsed .me { display: none; }
.nav-collapsed .nav-group { font-size: 0; padding: 8px 0 4px; margin: 0 8px; border-top: 1px solid var(--border); }
.nav-collapsed .nav-group:first-of-type { border-top: 0; padding-top: 0; }
.nav-collapsed .nav { justify-content: center; padding: 9px 0; position: relative; }
.nav-collapsed .nav .dot { position: absolute; top: 5px; right: 9px; margin: 0; }
.nav-toggle { margin-top: auto; color: var(--muted); }
.nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side { background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px; display: flex;
  flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto; overscroll-behavior: contain; }
/* on a low screen the navigation scrolls on its own instead of being cut off at the bottom */
.side > * { flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 650; font-size: var(--text-base); }
.brand small { display: block; font-weight: 450; color: var(--muted); font-size: var(--text-xs); }
.nav { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border: 0;
  background: none; border-radius: var(--radius-sm); color: var(--muted); cursor: pointer; font-size: var(--text-sm); }
.nav:hover { background: var(--offset); color: var(--text); }
.nav.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav svg { width: 17px; height: 17px; flex: none; }
.nav .dot { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; }
.side .foot { margin-top: auto; font-size: var(--text-xs); color: var(--muted); padding: 8px; }
main { min-width: 0; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--border);
  background: var(--surface); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.top h1 { font-size: var(--text-lg); margin: 0; font-weight: 650; }
.top .spacer { flex: 1; }
.content { padding: 24px; max-width: 1400px; }
.grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.grid > * { min-width: 0; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 16px; }
.card h2 { font-size: var(--text-base); margin: 0 0 12px; font-weight: 650; }
.card h2 .sub { font-weight: 450; color: var(--muted); font-size: var(--text-sm); margin-left: 6px; }
.kpi .label { color: var(--muted); font-size: var(--text-xs); text-transform: none; }
.kpi .value { font-size: var(--text-xl); font-weight: 650; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi .note { color: var(--muted); font-size: var(--text-xs); margin-top: 2px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.two > * { min-width: 0; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface);
  padding: 7px 14px; border-radius: var(--radius-sm); cursor: pointer; font-size: var(--text-sm); font-weight: 550; }
.btn:hover { background: var(--offset); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--inverse); }
.btn.primary:hover { background: var(--primary-hover); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.small { padding: 4px 10px; font-size: var(--text-xs); }
.icon-btn { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm); width: 34px; height: 34px;
  display: grid; place-items: center; cursor: pointer; }
select, input[type=text], input[type=search], input[type=password] { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm);
  padding: 6px 10px; font-size: var(--text-sm); min-height: 34px; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: var(--text-xs); color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: var(--text-xs); padding: 8px 10px;
  border-bottom: 1px solid var(--border); background: var(--surface-2); position: sticky; top: 0; }
td { padding: 7px 10px; border-bottom: 1px solid var(--divider); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; }
.link { background: none; border: 0; padding: 0; color: var(--primary); font: inherit; text-align: left; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link:hover { color: var(--primary-hover); }
.scroll { overflow: auto; max-height: 560px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: var(--text-xs);
  font-weight: 600; white-space: nowrap; }
.b-ok { background: var(--ok-soft); color: var(--ok); } .b-err { background: var(--err-soft); color: var(--err); }
.b-warn { background: var(--warn-soft); color: var(--warn); } .b-info { background: var(--info-soft); color: var(--info); }
.b-pri { background: var(--primary-soft); color: var(--primary); }
.muted { color: var(--muted); } .small { font-size: var(--text-xs); }
.callout { border: 1px solid var(--border); border-left: 3px solid var(--primary); background: var(--surface-2); padding: 10px 14px;
  border-radius: var(--radius-sm); font-size: var(--text-sm); }
.callout.warn { border-left-color: var(--warn); } .callout.err { border-left-color: var(--err); } .callout.ok { border-left-color: var(--ok); }
.drop { display: block; border: 1.5px dashed var(--border); border-radius: var(--radius); padding: 20px; text-align: center; color: var(--muted);
  cursor: pointer; transition: border-color .15s, background .15s; font-size: var(--text-sm); }
.drop:hover, .drop.over { border-color: var(--primary); background: var(--primary-soft); color: var(--text); }
.log { font-family: var(--mono); font-size: var(--text-xs); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; max-height: 220px; overflow: auto; white-space: pre-wrap; }
.bar { height: 6px; border-radius: 3px; background: var(--offset); position: relative; min-width: 80px; }
.bar > span { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--primary); }
.bar.over > span { background: var(--warn); }
.progress { height: 4px; background: var(--offset); border-radius: 2px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); transition: width .5s linear; }

/* timetable grid */
.tt { --rh: 54px; display: grid; grid-template-columns: 78px repeat(var(--days, 5), minmax(118px, 1fr)); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; background: var(--surface); min-width: 700px; }
.tt .col { border-left: 1px solid var(--divider); min-width: 0; }
.tt .head { height: 44px; background: var(--surface-2); border-bottom: 1px solid var(--border); display: flex; flex-direction: column;
  justify-content: center; align-items: center; font-weight: 650; font-size: var(--text-sm); }
.tt .head .t { font-weight: 450; font-size: var(--text-xs); color: var(--muted); }
.tt .body { position: relative; height: calc(var(--rh) * var(--hours)); }
.tt .slot { height: var(--rh); border-bottom: 1px solid var(--divider); }
.tt .slot.lunch { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--offset) 6px 8px); }
.tt .col.off .body { background: var(--surface-2); }
.tt .hr { height: var(--rh); border-bottom: 1px solid var(--divider); font-size: var(--text-xs); color: var(--muted); padding: 5px 8px;
  background: var(--surface-2); }
.tt .hr b { display: block; color: var(--text); font-size: var(--text-sm); }
.ev { position: absolute; }
/* moving a lesson by hand (ADR-047): drop cells over the day while dragging */
.move-slot { position: absolute; left: 2px; right: 2px; height: calc(var(--rh) - 2px); z-index: 5; border-radius: var(--radius-sm);
  border: 1px dashed var(--border); background: color-mix(in srgb, var(--surface) 70%, transparent); }
.move-slot.ok { background: color-mix(in srgb, var(--ok-soft) 85%, transparent); border-color: var(--ok); }
.move-slot.warn { background: color-mix(in srgb, var(--warn-soft) 85%, transparent); border-color: var(--warn); }
.move-slot.conflict { background: color-mix(in srgb, var(--err-soft) 80%, transparent); border-color: var(--err); }
.move-slot.off { background: repeating-linear-gradient(135deg, var(--surface-2) 0 5px, var(--offset) 5px 7px); border-color: transparent; }
.move-slot.current { border: 2px solid var(--primary); background: transparent; }
.move-slot.over { outline: 2px solid var(--primary); outline-offset: -2px; }
.ev[draggable="true"] { cursor: grab; }
/* ranking of the quality goals: rows moved by drag and drop */
.goal-row { cursor: grab; }
.goal-row .grip { color: var(--muted); width: 14px; padding-right: 0; user-select: none; }
.goal-row.dragging { opacity: .45; }
.goal-row.drop-before td { box-shadow: inset 0 2px 0 var(--primary); }
.goal-row.drop-after td { box-shadow: inset 0 -2px 0 var(--primary); }
/* cooperation time in teacher timetables: a labelled, hatched block behind the lessons */
.coop, .legend i.coop-mark { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--offset) 6px 8px); border: 1px dashed var(--border); }
.coop { position: absolute; left: 3px; right: 3px; border-radius: var(--radius-sm); padding: 3px 6px; font-size: var(--text-xs); color: var(--muted); overflow: hidden; }
.coop b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev { min-width: 0; border-radius: var(--radius-sm); padding: 4px 6px; font-size: var(--text-xs); cursor: pointer;
  border: 1px solid transparent; border-left: 3px solid var(--c); background: color-mix(in oklab, var(--c) 14%, var(--surface));
  overflow: hidden; line-height: 1.3; transition: transform .1s, box-shadow .1s; text-align: left; color: var(--text); }
.ev:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.ev:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.ev b { font-size: var(--text-sm); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev span { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.one { padding: 3px 6px; }
.ev.one b { font-size: var(--text-xs); }
.ev.pinned::after, .legend i.pin-mark { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--text);
  box-shadow: 0 0 0 2px var(--surface); }
.ev.pinned::after { position: absolute; top: 5px; right: 5px; }
.legend i.pin-mark { width: 7px; height: 7px; vertical-align: 0; }
.ev.pinned b { padding-right: 10px; }
.tt-wrap { overflow-x: auto; }
.tt-area.with-side { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 12px; align-items: start; }
@media (max-width: 1100px) { .tt-area.with-side { grid-template-columns: 1fr; } }
/* blocks not in the shown plan (pre-planning, FIX-001): a list beside the grid, pinned ones dashed in the grid */
.unplaced { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
.unplaced.target { outline: 2px dashed var(--primary); outline-offset: -2px; }
.ev.unplaced-block span { white-space: normal; }
.ev.unplaced-block { position: relative; display: block; width: 100%; margin-bottom: 6px; cursor: grab; min-height: calc(var(--n) * 22px + 14px); }
.ev.pending { border-style: dashed; border-color: var(--c); border-left-style: solid; background: color-mix(in oklab, var(--c) 6%, var(--surface)); cursor: grab; }
.alt-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 6px; }
.alt-switch .tabs button { padding: 2px 8px; font-size: var(--text-xs); }
.legend i.pending-mark { border: 1px dashed var(--text); background: var(--surface); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--text-xs); color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; vertical-align: -1px; margin-right: 5px; }

/* school days */
.days td.d { text-align: center; }
.chip { display: inline-block; min-width: 72px; padding: 3px 8px; border-radius: var(--radius-sm); font-size: var(--text-xs); font-weight: 600; }
.chip.T { background: var(--primary-soft); color: var(--primary); } .chip.P { background: var(--warn-soft); color: var(--warn); }
.chip.X { color: var(--faint); font-weight: 450; }
.weeks { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 2px; min-width: 360px; }
.weeks i { height: 14px; border-radius: 2px; background: var(--offset); }
.weeks i.on { background: var(--primary); }

/* Drawer */
.scrim { position: fixed; inset: 0; background: rgba(10, 15, 25, .35); z-index: 20; }
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(420px, 100%); background: var(--surface); z-index: 21;
  border-left: 1px solid var(--border); padding: 20px; overflow: auto; box-shadow: -8px 0 24px rgba(0, 0, 0, .12);
  animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer h3 { margin: 0 0 4px; font-size: var(--text-lg); }
.drawer dl { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; font-size: var(--text-sm); margin: 16px 0; }
.drawer dt { color: var(--muted); }
.drawer dd { margin: 0; }
.drawer .weeks { min-width: 0; }
.drawer .pinbox { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--divider); display: grid; gap: 10px; }
.drawer h4 { margin: 0; font-size: var(--text-sm); }
.skeleton { background: linear-gradient(90deg, var(--offset) 25%, var(--surface-2) 50%, var(--offset) 75%); background-size: 200% 100%;
  animation: shimmer 1.4s infinite; border-radius: var(--radius-sm); height: 14px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.tabs { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.tabs button { border: 0; background: var(--surface); padding: 6px 12px; cursor: pointer; font-size: var(--text-sm); }
.tabs button + button { border-left: 1px solid var(--border); }
.tabs button.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
details summary { cursor: pointer; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; color: var(--faint); margin-bottom: 8px; }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { max-width: 100vw; }
  td, th { padding: 6px 8px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .side { position: static; height: auto; flex-direction: row; overflow-x: auto; padding: 8px; gap: 2px; border-right: 0;
    border-bottom: 1px solid var(--border); }
  .brand { display: none; } .side .foot { display: none; }
  .nav { width: auto; white-space: nowrap; }
  .app.nav-collapsed { grid-template-columns: minmax(0, 1fr); }
  .nav-toggle { display: none; }
  .nav-collapsed .nav-label { display: inline; } .nav-collapsed .nav-group { display: none; } .nav-collapsed .side { padding: 8px; }
  .nav .dot { margin-left: 4px; }
  .top { position: static; padding: 12px 16px; }
  .content { padding: 16px; }
  .two { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- v0.3: editing views ---------- */
.nav-group { font-size: var(--text-xs); color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 12px 10px 4px; }
.nav-group:first-of-type { padding-top: 0; }
input[type=number], input[type=date], input[type=password], textarea { border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius-sm);
  padding: 6px 10px; font-size: var(--text-sm); min-height: 34px; font: inherit; font-size: var(--text-sm); color: inherit; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
input:disabled, select:disabled { background: var(--surface-2); color: var(--muted); }
.field { display: flex; flex-direction: column; gap: 4px; font-size: var(--text-xs); color: var(--muted); min-width: 0; }
.field > input, .field > select, .field > textarea { color: var(--text); width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.box + .form-grid { margin-top: 12px; }
/* error message in a dialog footer, next to the save button */
.foot-err { max-width: 45%; text-align: right; line-height: 1.3; }
/* curriculum of the previous class while the chosen one loads (inert) */
.switching > :not(p) { opacity: .5; transition: opacity .15s; }
.master-bar { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.master-bar .tabs { align-self: flex-start; }
.span2 { grid-column: span 2; } .span3 { grid-column: 1 / -1; }
.box { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; margin: 12px 0 0; background: var(--surface-2); min-width: 0; }
.box legend { font-size: var(--text-xs); font-weight: 600; color: var(--muted); padding: 0 4px; }
.box summary { font-size: var(--text-sm); font-weight: 550; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.checks.weeks { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); max-height: 320px; overflow: auto; min-width: 0; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-sm); color: var(--text); cursor: pointer; }
.check.inline { margin-right: 10px; }
.combo { position: relative; display: flex; flex-direction: column; }
.combo-list { position: fixed; z-index: 50; margin: 0; padding: 4px 0; list-style: none; max-width: 480px;
  max-height: 260px; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); font-size: var(--text-sm); color: var(--text); }
.combo-list li { padding: 5px 10px; cursor: pointer; }
.combo-list li.sel { font-weight: 600; }
.combo-list li.on { background: var(--offset); }
.check input { accent-color: var(--primary); width: 16px; height: 16px; margin: 0; }
.nowrap { white-space: nowrap; }
.warn { color: var(--warn); }
.err, td.err { color: var(--err); }
p.err { color: var(--err); }
.cnt { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: var(--offset);
  color: var(--muted); font-size: var(--text-xs); font-weight: 600; text-align: center; }
.tabs button.on .cnt { background: var(--surface); color: var(--primary); }
.tag { display: inline-block; padding: 1px 7px; margin: 1px 4px 1px 0; border-radius: 4px; background: var(--offset); font-size: var(--text-xs);
  white-space: nowrap; border: 0; color: var(--text); }
.btn-tag { cursor: pointer; font-family: var(--mono); }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin-top: 4px; }
.tag.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 8px; font-size: var(--text-sm); font-family: var(--mono); }
.tag.chip.bad { background: var(--warn-soft); color: var(--warn); }
.chip-x { border: 0; background: none; padding: 0 3px; cursor: pointer; color: var(--muted); font-size: var(--text-xs); line-height: 1; }
.chip-x:hover { color: var(--err); }
/* curriculum quick edit: inputs in the cells, selection column, bar of the bulk actions */
table.quick th, table.quick td { padding: 6px 7px; }
table.quick .chip { min-width: 0; padding: 2px 7px; }
table.quick input.cell { width: 54px; padding: 3px 5px; font-size: var(--text-sm); border: 1px solid transparent; background: transparent; }
/* two digits must stay visible: no spin buttons in the narrow cell (arrow keys still count up and down) */
table.quick td.num input.cell { width: 48px; text-align: right; appearance: textfield; -moz-appearance: textfield; }
table.quick td.num input.cell::-webkit-inner-spin-button, table.quick td.num input.cell::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
table.quick tr:hover input.cell, table.quick input.cell:focus { border-color: var(--border); background: var(--surface); }
/* master data lists (ADR-079): text, codes and selects in the row */
table.quick input.cell.wide { width: 100%; min-width: 140px; }
table.quick select.cell { padding: 3px 5px; font-size: var(--text-sm); border: 1px solid transparent; background: transparent; max-width: 230px; }
/* fields in the rows of the master data lists: a faint line at rest shows they can be edited; a short green flash when saved */
table.rows-edit input.cell, table.rows-edit select.cell { border-bottom-color: var(--border); }
table.rows-edit td { vertical-align: middle; }
table.quick input.cell.saved { border-color: var(--ok, #2e7d32); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ok, #2e7d32) 25%, transparent); transition: box-shadow .3s; }
table.quick tr:hover select.cell, table.quick select.cell:focus { border-color: var(--border); background: var(--surface); }
/* multiple selection in a table: checkbox column and chosen rows (curriculum, block periods) */
table.quick th.sel, table.quick td.sel, table.selectable th.sel, table.selectable td.sel { width: 28px; padding-right: 0; }
table.quick tr.picked td, table.selectable tr.picked td { background: var(--primary-soft); }
table.quick .chips { margin-top: 0; gap: 4px; }
table.quick .chips .tag.chip { margin: 0; }
.bulkbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; position: sticky; top: 0; z-index: 5; border-color: var(--primary); }
.btn-tag:hover { background: var(--primary-soft); color: var(--primary); }
.sugg { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px; }
/* weeks a lesson lies in: one cell per school week of its classes (lesson form) */
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.plain > legend { padding: 0; font-weight: inherit; }
/* class form: one section per day kind inside „Berufsschultage“ */
fieldset.plain.day-kind { margin: 4px 0 12px; }
.box fieldset.plain.day-kind > legend { font-size: var(--text-sm); font-weight: 600; color: var(--text); margin-bottom: 6px; }
.day-kind-reason { border-top: 1px solid var(--border); padding-top: 10px; }
/* hours per day as one pair „von – bis“ (proposal 31) */
.hour-range .row { gap: 6px; align-items: center; flex-wrap: nowrap; }
.hour-range input { width: 8.5rem; min-width: 0; }
.weeks-result { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; }
.week-strip { display: flex; gap: 2px; flex-wrap: wrap; }
.week-strip span { width: 8px; height: 12px; border-radius: 2px; background: var(--offset); box-shadow: inset 0 0 0 1px var(--border); }
.week-strip span.on { background: var(--primary); box-shadow: none; }
table.hover tbody tr { cursor: pointer; }
table.hover tbody tr:hover td { background: var(--surface-2); }
table.mini td, table.mini th { padding: 5px 6px; }
table.mini input, table.mini select { min-height: 30px; padding: 4px 8px; width: 100%; }
table.mini input[type=checkbox], table.mini input[type=radio] { width: 16px; height: 16px; min-height: 0; padding: 0; margin: 0; accent-color: var(--primary); }
.tall { max-height: calc(100vh - 260px); }
.actions { white-space: nowrap; text-align: right; }
.icon-btn.sm { width: 28px; height: 28px; font-size: var(--text-xs); }
.btn.danger { background: var(--err); border-color: var(--err); color: var(--inverse); }
.btn.danger:hover { filter: brightness(1.08); background: var(--err); }
.btn.danger-ghost { color: var(--err); border-color: color-mix(in oklab, var(--err) 40%, var(--border)); }
.btn.danger-ghost:hover { background: var(--err-soft); }
.blocker li { color: var(--err); }
.kpis > .kpi:not(.card) { background: var(--surface-2); border: 1px solid var(--divider); border-radius: var(--radius-sm); padding: 10px 12px; }
.add-card { border-style: dashed; background: transparent; color: var(--muted); cursor: pointer; font-weight: 550; min-height: 120px; }
.add-card:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.dl { display: grid; grid-template-columns: 110px 1fr; gap: 4px 10px; margin: 10px 0 0; }
.dl dt { color: var(--muted); } .dl dd { margin: 0; }

/* segmented control, day toggle */
.seg { flex-wrap: wrap; }
.seg button { padding: 5px 10px; font-size: var(--text-xs); color: var(--text); white-space: nowrap; }
.seg button:disabled { color: var(--faint); cursor: not-allowed; }
.daytoggle { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.daytoggle button { width: 40px; height: 32px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  cursor: pointer; font-size: var(--text-xs); font-weight: 600; color: var(--muted); }
.daytoggle button.on { background: var(--primary); border-color: var(--primary); color: var(--inverse); }
/* weekdays never · possibly · always a school day of a kind (ADR-088): state by mark and style, not by colour alone */
.daystates { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.daystates button { min-width: 48px; height: 32px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  cursor: pointer; font-size: var(--text-xs); font-weight: 600; color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 3px; }
.daystates button.always { background: var(--primary); border-color: var(--primary); color: var(--inverse); }
.daystates button.never { color: var(--muted); text-decoration: line-through; border-style: dashed; }
.daystates button:disabled { opacity: .6; cursor: default; }
.daystates .mark { font-size: .9em; }
/* week picker laid out as the school year */
.week-picker { display: grid; gap: 4px; }
.wp-tools { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.wp-month { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.wp-label { width: 72px; font-size: var(--text-xs); color: var(--muted); }
.wp-week { width: 34px; height: 26px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); font-size: var(--text-xs); cursor: pointer; }
.wp-week.on { background: var(--primary); border-color: var(--primary); color: var(--inverse); font-weight: 600; }
.wp-week.off { background: repeating-linear-gradient(135deg, transparent 0 3px, var(--border) 3px 4px); color: var(--faint); cursor: default; }
.wp-week:not(:disabled):hover { outline: 1px solid var(--primary); }
/* date picker over the school year */
.date-picker { display: grid; gap: 2px; max-height: 360px; overflow: auto; }
.dp-head, .dp-week { display: grid; grid-template-columns: 56px repeat(var(--days, 5), 34px); gap: 4px; align-items: center; }
.dp-head span { font-size: var(--text-xs); color: var(--muted); text-align: center; }
.dp-wd { height: 22px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface-2); font-size: var(--text-xs); font-weight: 600; cursor: pointer; }
.dp-wd:not(:disabled):hover { outline: 1px solid var(--primary); }
.dp-wd:disabled { color: var(--faint); cursor: default; }
/* a chosen week or day outside the possible ones: still shown so it can be removed */
.wp-week.bad, .dp-day.bad { background: var(--warn); border-color: var(--warn); color: var(--inverse); }
.dp-month { font-size: var(--text-xs); color: var(--muted); font-weight: 600; margin-top: 6px; }
.dp-kw { font-size: var(--text-xs); color: var(--faint); }
.dp-day { height: 24px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); font-size: var(--text-xs); cursor: pointer; }
.dp-day.on { background: var(--primary); border-color: var(--primary); color: var(--inverse); font-weight: 600; }
.dp-day.off { background: repeating-linear-gradient(135deg, transparent 0 3px, var(--border) 3px 4px); color: var(--faint); cursor: default; }
.dp-day.busy:not(.on) { text-decoration: line-through; }
.dp-day:not(:disabled):hover { outline: 1px solid var(--primary); }

/* Modal */
.modal-scrim { position: fixed; inset: 0; background: rgba(10, 15, 25, .45); z-index: 40; display: grid; place-items: center; padding: 16px;
  animation: fade .12s ease-out; }
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); width: min(560px, 100%);
  max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 16px 48px rgba(0, 0, 0, .25); }
.modal:focus { outline: none; }
.modal.wide { width: min(880px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--divider); }
.modal-head h3 { margin: 0; font-size: var(--text-lg); font-weight: 650; }
.modal-body { padding: 16px 18px; overflow: auto; min-height: 0; }
.modal-foot { display: flex; gap: 8px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--divider); background: var(--surface-2);
  border-radius: 0 0 var(--radius) var(--radius); flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 60; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--text); color: var(--inverse); padding: 10px 14px; border-radius: var(--radius-sm); font-size: var(--text-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2); border-left: 4px solid var(--ok); animation: fade .15s ease-out; }
.toast.err { border-left-color: var(--err); }
.toast.warn { border-left-color: var(--warn); }

/* curriculum */
/* help page: rendered user manual */
.manual { line-height: 1.6; max-width: 900px; scroll-margin-top: 76px; }
.manual :is(h1, h2, h3) { scroll-margin-top: 76px; line-height: 1.3; }
.manual h1 { font-size: var(--text-xl); margin: 0 0 12px; }
.manual h2 { font-size: var(--text-lg); margin: 24px 0 8px; }
.manual h3 { font-size: var(--text-base); margin: 18px 0 6px; }
.manual p, .manual ul, .manual ol { margin: 0 0 10px; }
.manual li { margin: 2px 0; }
.manual table { margin: 8px 0 14px; }
.manual code { font-family: 'JetBrains Mono', monospace; font-size: .9em; background: var(--surface-2); padding: 1px 4px; border-radius: 4px; }
.manual blockquote { margin: 10px 0; padding: 8px 12px; border-left: 3px solid var(--primary); background: var(--primary-soft); border-radius: 4px; }
.manual blockquote p:last-child { margin: 0; }
.manual a { color: var(--primary); }
.curriculum-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; align-items: start; }
.class-list { position: sticky; top: 76px; display: flex; flex-direction: column; max-height: calc(100vh - 100px); overflow: hidden; }
.class-list-scroll { overflow: auto; padding: 0 6px 8px; }
.class-list-group { font-size: var(--text-xs); color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 10px 8px 4px; }
.class-list-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; border: 0; background: none; text-align: left;
  padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer; font-size: var(--text-sm); }
.class-list-item small { display: block; color: var(--muted); font-size: var(--text-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.class-list-item:hover { background: var(--offset); }
.class-list-item.on { background: var(--primary-soft); color: var(--primary); }
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; max-height: 380px; overflow: auto; }
.course-class { border: 1px solid var(--divider); border-radius: var(--radius-sm); padding: 8px 10px; display: grid; gap: 4px; align-content: start; background: var(--surface-2); }

/* school year calendar */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.cal-side { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; }
table.cal td { padding: 4px 8px; vertical-align: middle; }
table.cal th.c, table.cal td.c { text-align: center; padding: 3px 2px; }
table.cal tr.month td { background: var(--surface-2); font-weight: 600; font-size: var(--text-xs); color: var(--muted); padding: 6px 8px; }
table.cal tr.off td { color: var(--faint); }
table.cal tr.half-year-start td { border-top: 2px solid var(--primary); }
/* block periods of a week: a few block class tags plus a counter, one line per week */
table.cal td.blocks { white-space: nowrap; }
table.cal td.blocks .tag { margin: 0 4px 0 0; }
.btn-tag.on { background: var(--primary); color: var(--surface); }
.btn-tag.more { font-family: inherit; color: var(--muted); background: transparent; border: 1px dashed var(--border); }
table.cal tr.hl td { background: var(--primary-soft); }
table.cal tr.hl td:first-child { box-shadow: inset 3px 0 0 var(--primary); }
.hl-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 16px 10px; padding: 6px 10px; border-radius: var(--radius-sm);
  background: var(--primary-soft); color: var(--text); }
.hl-swatch { width: 10px; height: 10px; border-radius: 2px; background: var(--primary); }
.th-sort { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.th-sort.on { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
table.hover tr.group td { background: var(--surface-2); font-weight: 600; font-size: var(--text-sm); }
.caret { display: inline-block; width: 1em; color: var(--muted); }
.calday { width: 34px; height: 24px; border-radius: 4px; border: 1px solid transparent; font-size: 10px; font-weight: 700; cursor: pointer;
  display: inline-grid; place-items: center; padding: 0; }
i.calday { display: inline-block; width: 14px; height: 10px; vertical-align: -1px; margin-right: 5px; cursor: default; }
.calday.SCHOOL { background: var(--ok-soft); color: var(--ok); }
.calday.HOLIDAYS { background: var(--offset); color: var(--muted); }
.calday.FEIERTAG { background: var(--err-soft); color: var(--err); }
.calday.BEWEGLICHER_FERIENTAG { background: var(--warn-soft); color: var(--warn); }
.calday.UNTERRICHTSFREI { background: var(--info-soft); color: var(--info); border-color: var(--border); }
.calday.NONE { background: transparent; cursor: default; }
.calday.has { box-shadow: inset 0 0 0 2px var(--warn); }
.calday:not(:disabled):hover { filter: brightness(.95); outline: 1px solid var(--primary); }
.calday-dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; background: var(--offset); }
.calday-dot.SCHOOL { background: var(--ok); } .calday-dot.FEIERTAG { background: var(--err); } .calday-dot.BEWEGLICHER_FERIENTAG { background: var(--warn); }
.calday-dot.UNTERRICHTSFREI, .calday-dot.PRUEFUNG { background: var(--info); } .calday-dot.HOLIDAYS { background: var(--faint); }
.ab { min-width: 30px; height: 24px; border-radius: 4px; border: 1px dashed var(--border); background: var(--surface); font-weight: 700;
  font-size: var(--text-xs); cursor: pointer; color: var(--muted); }
.ab.typed { color: var(--text); background: var(--offset); border-color: transparent; }
.ab[class*="wt"] { border-color: transparent; }   /* one colour per week type, repeating after six (calendar.js weekTypeClass) */
.ab.wt0 { color: var(--primary); background: var(--primary-soft); } .ab.wt1 { color: var(--warn); background: var(--warn-soft); }
.ab.wt2 { color: var(--wt-c); background: var(--wt-c-soft); } .ab.wt3 { color: var(--wt-d); background: var(--wt-d-soft); }
.ab.wt4 { color: var(--wt-e); background: var(--wt-e-soft); } .ab.wt5 { color: var(--wt-f); background: var(--wt-f-soft); }
.ab.fixed { border: 1.5px solid currentColor; }

@media (max-width: 1100px) {
  .cal-layout { grid-template-columns: minmax(0, 1fr); }
  .cal-side { position: static; max-height: none; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}
@media (max-width: 900px) {
  .curriculum-layout { grid-template-columns: minmax(0, 1fr); }
  .class-list { position: static; max-height: 260px; }
  .form-grid, .form-grid.three, .form-grid.four { grid-template-columns: minmax(0, 1fr); }
  .foot-err { max-width: none; flex-basis: 100%; text-align: left; }
  .span2, .span3 { grid-column: auto; }
  .nav-group { display: none; }
  .modal-scrim { padding: 0; place-items: end stretch; }
  .modal, .modal.wide { width: 100%; max-height: 92vh; border-radius: var(--radius) var(--radius) 0 0; }
}

/* print: one timetable per page (A4 landscape) */
.print-area { display: none; }
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; }
  .app, .drawer, .scrim, .modal-scrim, .toasts { display: none !important; }
  .print-area { display: block; }
  .print-page { break-after: page; }
  .print-page:last-child { break-after: auto; }
  .print-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12mm; margin-bottom: 4mm; font-size: 9pt; }
  .print-head h1 { margin: 0 0 1mm; font-size: 16pt; }
  .print-area .tt { --rh: calc(148mm / var(--hours)); grid-template-columns: 20mm repeat(var(--days, 5), 1fr); box-shadow: none;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-area .ev { transition: none; cursor: default; }
  .print-area .ev span { color: #333; }
  .print-foot { margin-top: 3mm; font-size: 8pt; color: #666; }
}
.warn-text { color: var(--warn); }
tr[tabindex]:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

/* ---------- guidance: way to the timetable, clickable key figures (0.34.0) ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; counter-reset: s; }
.steps li { position: relative; }
.steps li + li::before { content: ''; position: absolute; left: -8px; top: 26px; width: 8px; height: 2px; background: var(--divider); }
.step { display: flex; gap: 10px; align-items: flex-start; width: 100%; height: 100%; text-align: left; padding: 12px; border: 1px solid var(--divider);
  border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); cursor: pointer; font: inherit;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease, transform .15s ease; }
.step:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-1px); }
.step-dot { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 650; font-size: var(--text-sm);
  background: var(--offset); color: var(--muted); }
.step-dot svg { width: 15px; height: 15px; }
.step-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.step-body b { font-weight: 600; font-size: var(--text-sm); }
.step-body span { font-size: var(--text-xs); color: var(--muted); }
.step.done .step-dot { background: var(--ok-soft); color: var(--ok); }
.step.warn .step-dot { background: var(--warn-soft); color: var(--warn); }
.step.warn .step-body span { color: var(--warn); }
.step.err .step-dot { background: var(--err-soft); color: var(--err); }
.step.err .step-body span { color: var(--err); }
.step.next { border-color: var(--primary); background: var(--primary-soft); }
.step.next .step-dot { background: var(--primary); color: var(--inverse); }
.step.next.err .step-dot { background: var(--err); }
.step.next.warn .step-dot { background: var(--warn); }
@media (max-width: 1100px) { .steps { grid-template-columns: minmax(0, 1fr); } .steps li + li::before { display: none; } }
.kpi-link { display: block; position: relative; text-align: left; font: inherit; color: inherit; cursor: pointer; width: 100%;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.kpi-link:hover { border-color: var(--primary); box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.kpi-link:focus-visible, .step:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.kpi-icon { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); }
.kpi-icon svg { width: 16px; height: 16px; }
.kpi .note.warn { color: var(--warn); }
.row > .spacer { flex: 1; }
.btn.large { padding: 10px 20px; font-size: var(--text-base); font-weight: 600; }
details.advanced { margin-top: 14px; border-top: 1px solid var(--divider); padding-top: 10px; }
details.advanced > summary { cursor: pointer; color: var(--muted); font-size: var(--text-sm); width: fit-content; }
details.advanced > summary:hover { color: var(--text); }
/* row actions: quiet until the row is pointed at, so long tables stay calm */
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
tr:hover .btn.ghost, .btn.ghost:focus-visible { border-color: var(--border); background: var(--surface); color: var(--primary); }
.btn { transition: background .12s ease, border-color .12s ease, color .12s ease, box-shadow .12s ease; }
.btn.primary { box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
/* calmer motion: views fade in, the active navigation entry gets an accent bar */
.content > section, .content > div > section { animation: view-in .18s ease-out; }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.nav { position: relative; transition: background .12s ease, color .12s ease; }
.nav.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--primary); }
.nav-collapsed .nav.active::before { left: -8px; }
@media (max-width: 900px) { .nav.active::before { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
/* statistics (ADR-057) */
table.stats th .sort { font: inherit; font-weight: 600; color: inherit; text-decoration: none; padding: 0; }
table.stats th.num, table.stats td.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar { display: inline-block; width: 70px; height: 6px; border-radius: 3px; background: var(--offset); margin-right: 8px; vertical-align: middle; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--primary); }
.bar > span.low { background: var(--faint); } .bar > span.high { background: var(--warn); }

/* text for screen readers only */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* login page of own user accounts (ADR-077, login.html) */
.login-page { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; box-sizing: border-box; }
.login-card { width: 100%; max-width: 380px; box-sizing: border-box; }
.login-card form { display: grid; gap: 12px; }
.login-card [hidden] { display: none !important; }
.login-card h1 { font-size: var(--text-lg, 1.2rem); margin: 4px 0; }
.login-card p { margin: 0; }
.login-brand { display: flex; align-items: center; gap: 10px; font-weight: 650; margin-bottom: 8px; }
.login-error { color: var(--err); font-size: var(--text-sm); min-height: 1em; }
.login-error:empty { display: none; }
.me-actions { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 2px 12px; }
.nav-logout { display: none; }
.nav-collapsed .nav-logout { display: flex; }
.me-actions .link { font-size: inherit; }

/* second factor (ADR-078): QR code, secret, recovery codes */
.factor-qr svg, .factor-qr-svg { display: block; width: 200px; height: 200px; margin: 6px auto; border-radius: var(--radius-sm); }
.factor-secret { word-break: break-all; font-size: var(--text-sm); }
.factor-codes { columns: 2; column-gap: 24px; margin: 4px 0; padding-left: 1.6em; font-size: 1.05rem; }
@media print { .login-page .btn, .login-page .check, .login-brand { display: none !important; } }
@media print {
  body.print-codes .app, body.print-codes .print-area { display: none !important; }
  body.print-codes .modal-scrim { display: block !important; position: static; background: none; }
  body.print-codes .modal { box-shadow: none; border: 0; max-height: none; }
  body.print-codes .modal-foot, body.print-codes .modal-head .icon-btn, body.print-codes .check { display: none !important; }
}
.row-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.b-off { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.login-panel { display: grid; gap: 12px; }
.factor-codes:focus { outline: 2px solid var(--primary); outline-offset: 4px; }
.print-only { display: none; }
@media print {
  .print-only { display: block; font-weight: 600; }
  body.print-codes .print-only { display: block; }
  .login-page .login-error, .login-page .muted { display: none !important; }
}

/* change feed (ADR-076): a quiet state next to the dataset */
.live { display: inline-flex; align-items: center; gap: 5px; font-size: var(--text-xs); color: var(--muted); }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: inline-block; }

/* several planners (ADR-076): lessons moved by others since the own last move – outline and symbol, not colour only */
.ev.moved-other { outline: 2px dashed var(--text); outline-offset: -3px; }
.moved-mark { position: absolute; bottom: 2px; right: 4px; font-size: 11px; line-height: 1; }   /* the pin dot sits top right */
.ev.moved-other:focus-visible { outline: 3px solid var(--primary); outline-offset: 1px; }
.moved-legend { font-style: normal; display: inline-block; width: 14px; height: 12px; border: 1.5px dashed var(--text); font-size: 9px; line-height: 10px; text-align: center; }
.callout a { color: var(--primary); }
.moves-list { flex-basis: 100%; }
.moves-list ul { margin: 4px 0 0; padding-left: 18px; }
/* presence (ADR-076): who else works in the dataset */
.presence { color: var(--muted); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.presence { position: relative; max-width: none; overflow: visible; white-space: normal; }
details.presence > summary { cursor: pointer; white-space: nowrap; list-style: none; }
details.presence > summary::-webkit-details-marker { display: none; }
details.presence > summary::before { content: "●"; color: var(--ok); margin-right: 5px; font-size: 9px; vertical-align: middle; }
.presence-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 240px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.12); color: var(--text); }
.presence-list ul { margin: 4px 0 0; padding-left: 18px; }

/* read-only values (e.g. hours and blocking of a rotation part, proposal 45): no field look, so nobody tries to type */
input.cell[readonly], input.cell[readonly]:hover { border-color: transparent; background: transparent; color: var(--muted); box-shadow: none; }
.field input[readonly] { background: var(--surface-2); color: var(--muted); }

/* option groups in a searchable list (proposal 23): a heading, not selectable */
.combo-list .combo-group { padding: 6px 10px 2px; font-size: var(--text-xs, .75rem); font-weight: 600; color: var(--muted); text-transform: none;
  cursor: default; border-top: 1px solid var(--border); }
.combo-list .combo-group:first-child { border-top: 0; }
.combo-list .combo-group { position: sticky; top: 0; z-index: 1; background: var(--surface); }
/* the Zeitraum in narrow blocked-time tables: short chips that wrap, the other columns keep their width */
table.mini td:has(> .chips) { width: 9.75rem; max-width: 9.75rem; }
table.mini .chips { margin-top: 0; gap: 3px; }
table.mini .tag.chip { max-width: 100%; font-family: inherit; white-space: normal; }
table.mini td:has(> .chips) .combo { width: 8.75rem !important; }   /* the placeholder stays readable */
table.mini select { min-width: 4.25rem; }

/* demo mode (ADR-095): the notice above every page */
.demo-banner { margin: 0 0 12px; border-radius: 0; }
.demo-logins { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.demo-logins .btn { white-space: normal; text-align: left; height: auto; }
