/* Trogesa OS back office (F3). Colours are the Trogesa tokens (restoration-platform-planning,
   design-system/tokens.json); test/f3-web.test.ts checks every text/background pair below for
   WCAG 2.2 AA contrast. One meaning per colour (DASHBOARD-PRINCIPLES §1.8): red for blockers,
   amber for deadlines, blue for my actions, grey for waiting; violet only for AI suggestions. */
:root {
  --navy-900: #1d2433; --navy-800: #252e41; --navy-ink: #c9d1e0;
  --bg: #f4f5f7; --surface: #ffffff; --surface-subtle: #fafbfc; --border: #e3e6eb; --border-subtle: #eef0f3; --input-border: #8a92a3;
  --ink: #161c2a; --ink-2: #3a4354; --muted: #5d6678;
  --success-fg: #0b7a72; --success-text: #075e57; --success-bg: #e3f4f1; --success-border: #b4e0d9;
  --danger-fg: #c8102e; --danger-text: #a10d26; --danger-bg: #fdecef; --danger-border: #f5c2cb;
  --warning-fg: #a15c07; --warning-text: #7c4604; --warning-bg: #fef4e2; --warning-border: #f6d9a8;
  --info-fg: #2a56b8; --info-text: #1f4598; --info-bg: #e9effb; --info-border: #c5d4f2;
  --ai-fg: #6232d6; --ai-strong: #4c1fb5; --ai-bg: #f5f1ff;
  --focus: #2a56b8;
  --radius-control: 7px; --radius-card: 10px; --radius-chip: 6px;
  --shadow-card: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.04);
  --shadow-toast: 0 8px 24px rgba(0,0,0,.2);
  --font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --topbar: 56px; --sidebar: 232px; --navstrip: 52px; --noticeslot: 52px;
  --brand-blue: #2f7fd3;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;
  --gutter: clamp(16px, 2vw, 40px);
  --ease: cubic-bezier(.2, 0, 0, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--bg); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
h3 { font-size: 15px; font-weight: 650; }
p { margin: 0; }
a { color: var(--info-text); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.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; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: var(--radius-control); }
.skip-link:focus { left: 8px; }
[hidden] { display: none !important; }

/* Buttons and fields: at least 32 px on desktop, 44 px on phone layouts (WCAG 2.5.8 ≥ 24 px). */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 0 14px; border-radius: var(--radius-control);
  border: 1px solid var(--navy-900); background: var(--navy-900); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--navy-800); }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--input-border); }
.btn.secondary:hover { background: var(--surface-subtle); }
.btn.danger { background: var(--danger-text); border-color: var(--danger-text); }
.btn.link { background: none; border: 0; color: var(--info-text); padding: 0 4px; text-decoration: underline; min-height: 24px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.blocked-why { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
label { display: block; font-weight: 600; color: var(--ink-2); font-size: 13px; margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; min-height: 36px; padding: 6px 10px; border: 1px solid var(--input-border); border-radius: var(--radius-control); background: var(--surface); }
textarea { min-height: 88px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.error { color: var(--danger-text); background: var(--danger-bg); border: 1px solid var(--danger-border); border-radius: var(--radius-control); padding: 8px 10px; margin-bottom: 12px; }

/* Sign-in */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.signin-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 28px; }
.signin-card img { width: 160px; height: auto; margin-bottom: 20px; }
.signin-card h1 { margin-bottom: 16px; }
.signin-card .btn { width: 100%; min-height: 40px; }

/* Shell (W1): a fixed navigation column on the left with its own scroll, a sticky top bar, and the page
   using the whole window. Nothing in the shell moves when the page scrolls or a live update arrives. */
.app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh;
  background: linear-gradient(to right, var(--surface) calc(var(--sidebar) - 1px), var(--border) calc(var(--sidebar) - 1px), var(--border) var(--sidebar), transparent var(--sidebar)); }
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; gap: var(--space-2);
  background: var(--surface); border-right: 1px solid var(--border); padding: 14px 12px 12px; overflow-y: auto; overscroll-behavior: contain; z-index: 25; }
.app-main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar); flex: none; display: flex; align-items: center; gap: var(--space-4); padding: 0 var(--gutter);
  background: rgba(255,255,255,.96); border-bottom: 1px solid var(--border); }
@supports (backdrop-filter: blur(8px)) { .topbar { background: rgba(255,255,255,.86); backdrop-filter: saturate(1.4) blur(8px); } }
.brand { display: flex; align-items: center; flex: none; padding: 4px 8px 14px; }
.brand img { height: 30px; width: auto; display: block; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { position: relative; display: flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: var(--radius-control); color: var(--ink-2); text-decoration: none; font-weight: 600; white-space: nowrap; }
.nav a:hover { background: var(--surface-subtle); color: var(--ink); }
.nav a[aria-current=page] { background: var(--info-bg); color: var(--info-text); }
.nav a[aria-current=page]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand-blue); }
.search { flex: 1; max-width: 640px; position: relative; }
.search-spacer { flex: 1; }
.search input { padding-right: 46px; background: var(--surface-subtle); }
.search input:focus-visible { background: var(--surface); }
.search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: 11px var(--mono); color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; background: var(--surface-subtle); }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-toast); list-style: none; margin: 0; padding: 4px; max-height: 60vh; overflow: auto; }
.search-results li a { display: block; padding: 8px 10px; border-radius: var(--radius-control); color: var(--ink); text-decoration: none; }
.search-results li a:hover, .search-results li a:focus-visible { background: var(--info-bg); }
.search-results .meta { color: var(--muted); font-size: 12px; }
.topbar-end { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { position: relative; min-width: 36px; min-height: 36px; border-radius: var(--radius-control); border: 1px solid var(--border); background: var(--surface); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; font-weight: 600; white-space: nowrap; }
.icon-btn:hover { border-color: var(--input-border); }
.icon-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.badge { min-width: 18px; height: 18px; border-radius: 9px; background: var(--navy-900); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.badge.blocker { background: var(--danger-text); }
.popover { position: absolute; right: 0; top: calc(100% + 6px); width: min(420px, 92vw); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-toast); padding: 8px; z-index: 30; }
.popover h2 { padding: 6px 8px; }
.popover ul { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow: auto; }
.popover li button, .popover li a { width: 100%; text-align: left; display: block; padding: 8px; border: 0; border-radius: var(--radius-control); background: none; cursor: pointer; color: var(--ink); text-decoration: none; }
.popover li button:hover, .popover li button:focus-visible { background: var(--surface-subtle); }
.popover .unread { font-weight: 650; }
.popover .meta { color: var(--muted); font-size: 12px; }
.account-menu dl { margin: 4px 8px 8px; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 13px; }
.account-menu dt { color: var(--muted); }
.account-menu dd { margin: 0; }
.wrap { position: relative; }

/* W1: the page uses the window; only long text keeps a reading width (see .measure). */
main { flex: 1; padding: var(--space-5) var(--gutter) 56px; width: 100%; outline: none; }
.measure { max-width: 78ch; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; letter-spacing: -0.015em; }
.page-head .sub { color: var(--muted); margin-top: 2px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; }
/* Start screen columns: one column up to 1600 px, then the lists and figures move to a side column.
   On one column the order stays Jetzt, Kennzahlen, Abteilungen, Meine Liste, Wartet auf andere. */
.start-grid { display: flex; flex-direction: column; }
.start-grid > .col-main, .start-grid > .col-side { display: contents; }
.start-grid [aria-labelledby=h-now] { order: 1; } .start-grid [aria-labelledby=h-fig] { order: 2; } .start-grid [aria-labelledby=h-dep] { order: 3; }
.start-grid [aria-labelledby=h-list] { order: 4; } .start-grid [aria-labelledby=h-wait] { order: 5; }
@media (min-width: 1600px) {
  /* CMO W1 M2: the grid runs to the right gutter and the side column's tiles fill it, two up. */
  .start-grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(380px, 32%, 760px); gap: 0 28px; align-items: start; width: 100%; }
  .start-grid > .col-main, .start-grid > .col-side { display: block; min-width: 0; }
  .col-side .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .col-side .figures { grid-template-columns: 1fr; }
}

/* Start screen: Jetzt, Meine Liste, Wartet auf andere (always in this order). */
.block { margin-bottom: 22px; }
.block > h2 { margin-bottom: 8px; display: flex; gap: 8px; align-items: baseline; }
.block > h2 .count { color: var(--muted); font-weight: 600; letter-spacing: 0; text-transform: none; }
.rows { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); overflow: hidden; }
.row { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; gap: 0 16px; align-items: center; padding: 13px 16px 13px 0; border-top: 1px solid var(--border-subtle); transition: background-color 120ms var(--ease); }
.row:hover { background: var(--surface-subtle); }
.row:focus-visible { outline-offset: -2px; }
.row:first-child { border-top: 0; }
.row .bar { align-self: stretch; border-radius: 0 3px 3px 0; background: var(--border); }
.row.blocker .bar { background: var(--danger-fg); }
.row.deadline .bar { background: var(--warning-fg); }
.row.mine .bar { background: var(--info-fg); }
.row.waiting .bar { background: #8a92a3; }
.row.highlight { background: var(--info-bg); }
.row .what { font-weight: 650; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.row .ref { font: 600 12px var(--mono); color: var(--muted); white-space: nowrap; }
.row .where { color: var(--ink-2); font-size: 13px; }
.row .why { margin-top: 2px; }
.row .next { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.row .side { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; justify-content: flex-end; }
.row .amount { font-weight: 650; white-space: nowrap; min-width: 9ch; text-align: right; }
.row .links { display: flex; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-chip); border: 1px solid var(--border); background: var(--surface-subtle); color: var(--ink-2); white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.blocker { color: var(--danger-text); background: var(--danger-bg); border-color: var(--danger-border); }
.chip.deadline { color: var(--warning-text); background: var(--warning-bg); border-color: var(--warning-border); }
.chip.mine { color: var(--info-text); background: var(--info-bg); border-color: var(--info-border); }
.chip.waiting { color: var(--ink-2); }
.chip.ok { color: var(--success-text); background: var(--success-bg); border-color: var(--success-border); }
.empty { background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius-card); padding: 16px; color: var(--ink-2); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.tile { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 12px 14px; color: var(--ink); text-decoration: none; }
.tile { transition: border-color 120ms var(--ease), box-shadow 120ms var(--ease); }
.tile:hover { border-color: var(--info-border); box-shadow: 0 2px 8px rgba(16,24,40,.08); }
.tile .n { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
.tile .l { margin-top: 8px; color: var(--ink-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.figure { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 14px; box-shadow: var(--shadow-card); }
.figure .v { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 4px; }
.figure .d { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
table.plain { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; }
table.plain th, table.plain td { text-align: left; padding: 9px 12px; border-top: 1px solid var(--border-subtle); vertical-align: top; }
table.plain thead th { background: var(--surface-subtle); font-size: 12px; color: var(--ink-2); border-top: 0; }
table.plain td.num, table.plain th.num { text-align: right; white-space: nowrap; width: 1%; }
table.plain thead th { white-space: nowrap; }
table.plain tbody tr:hover { background: var(--surface-subtle); }
/* W1: values never break in the middle: amounts, dates, times, references, counts and status chips. */
.nowrap, .amount, .when, .ref, time, .chip, .badge, .clock-time, .sheet-stand, .kv dd.num { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Case detail */
.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); padding: 14px; margin-bottom: 14px; }
.card > h2 { margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.wp { border-top: 1px solid var(--border-subtle); padding: 12px 0; }
.wp:first-of-type { border-top: 0; padding-top: 0; }
.wp .head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.wp .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.history { list-style: none; margin: 0; padding: 0; }
.history > li { padding: 8px 0; border-top: 1px solid var(--border-subtle); }
.history > li:first-child { border-top: 0; }
.history .steps { list-style: none; margin: 4px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--border); color: var(--ink-2); font-size: 13px; }
.ball li { margin-bottom: 6px; }

/* Dialogs, toasts */
dialog { border: 0; border-radius: var(--radius-card); padding: 0; width: min(560px, 94vw); box-shadow: var(--shadow-toast); color: var(--ink); }
dialog::backdrop { background: rgba(22, 28, 42, .45); }
dialog form { padding: 20px; }
dialog h2.title { font-size: 18px; text-transform: none; letter-spacing: -0.01em; color: var(--ink); margin-bottom: 14px; }
dialog .buttons { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
dialog .quote { white-space: pre-wrap; background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--radius-control); padding: 10px; margin-bottom: 12px; }
dialog .deviation { background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning-border); border-radius: var(--radius-control); padding: 8px 10px; margin-bottom: 12px; }
.toasts { margin-top: auto; display: flex; flex-direction: column; }
.toast .more { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.toast { width: 100%; background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--info-fg); border-radius: var(--radius-card); box-shadow: var(--shadow-toast); padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; }
.toast.frist { border-left-color: var(--warning-fg); }
.toast.blocker { border-left-color: var(--danger-fg); }
.toast .level { font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
.toast > div:first-child { grid-column: 1 / -1; }
.toast button.link { grid-column: 2; grid-row: 2; justify-self: end; }
.toast button.open { grid-column: 1; grid-row: 2; justify-self: start; }
@media (prefers-reduced-motion: no-preference) {
  /* W1: the notice fades in its own slot; nothing else moves. */
  .toast { animation: toast-in 160ms var(--ease); }
  @keyframes toast-in { from { opacity: 0; } to { opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* F4 Postfach: requests left, the request with its messages and the AI suggestion right. */
.mail { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2.4fr); gap: 18px; align-items: start; }
.mail-list { list-style: none; margin: 0; padding: 0; }
.mail-list li a { display: grid; transition: background-color 120ms var(--ease); gap: 3px; padding: 10px; border-radius: var(--radius-control); color: var(--ink); text-decoration: none; border-top: 1px solid var(--border-subtle); }
.mail-list li:first-child a { border-top: 0; }
.mail-list li a:hover, .mail-list li a.current { background: var(--info-bg); }
.mail-list .from { display: flex; justify-content: space-between; gap: 8px; font-weight: 650; }
.mail-list .when, .messages .when { color: var(--muted); font-weight: 400; font-size: 12.5px; white-space: nowrap; }
.mail-list li a.current .when { color: var(--ink-2); }
.mail-list .subj { color: var(--ink-2); }
.mail-list .meta-line { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }
.mail-list .ref { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.thread-head { display: grid; gap: 6px; margin-bottom: 12px; }
.thread-head .btn { justify-self: start; }
h2.thread-title { font-size: 18px; text-transform: none; letter-spacing: -0.01em; color: var(--ink); }
.gaps { background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning-border); border-radius: var(--radius-control); padding: 8px 10px; margin: 0 0 12px; }
.gaps ul { margin: 4px 0 0; padding-left: 18px; }
.messages { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.messages li { border: 1px solid var(--border); border-radius: var(--radius-card); padding: 10px 12px; background: var(--surface); }
.messages li.out { background: var(--surface-subtle); margin-left: 32px; }
.messages .msg-head { display: flex; justify-content: space-between; gap: 8px; }
.messages .body { white-space: pre-wrap; margin-top: 6px; }
.ai-card { border: 1px solid var(--border); border-left: 4px solid var(--ai-fg); border-radius: var(--radius-card); padding: 12px; margin: 0 0 12px; background: var(--surface); }
.ai-card h3, .reply-card h3 { margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.ai-card > p { margin-bottom: 8px; }
.ai-card .meta { color: var(--muted); }
.ai-mark { display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--ai-strong); background: var(--ai-bg); border-radius: var(--radius-chip); padding: 2px 7px; }
.ai-card table.units { margin-bottom: 10px; }
.ai-card table.units input { width: 100%; min-width: 0; }
.ai-card .fills { margin: 0 0 10px; padding-left: 18px; }
.reply-card { border: 1px solid var(--border); border-radius: var(--radius-card); padding: 12px; margin: 0 0 12px; background: var(--surface); }
.reply .field { margin-bottom: 10px; }
.reply textarea { width: 100%; }
.field.inline { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.field.inline select, .field.inline input { width: auto; min-width: 200px; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; }
.filled { border: 1px solid var(--success-border); background: var(--success-bg); border-radius: var(--radius-card); padding: 10px 12px; margin: 0 0 12px; }
.filled h3 { color: var(--success-text); margin-bottom: 6px; }
.filled ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.filled li { color: var(--ink); }
.filled .tick { color: var(--success-text); font-weight: 700; margin-right: 6px; }
.filled .new { display: inline-block; margin-left: 6px; font-size: 11.5px; font-weight: 700; color: var(--info-text); background: var(--info-bg); border-radius: var(--radius-chip); padding: 1px 6px; }
.decided { color: var(--ink-2); background: var(--surface-subtle); border: 1px solid var(--border); border-radius: var(--radius-control); padding: 6px 10px; margin: 0 0 8px; }

/* F4 Szenario console (Admin, Vorführumgebung) and the presenter page. */
.console-start { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 8px; }
.console-start .field { margin: 0; }
.clock { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 4px 0 12px; }
.clock-time { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.clock .meta { color: var(--muted); }
.console-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.steps-list { list-style: none; margin: 0; padding: 0; }
.steps-list li { display: grid; grid-template-columns: 120px 84px minmax(0, 1fr) 150px 130px; gap: 4px 10px; align-items: center; padding: 7px 8px; border-top: 1px solid var(--border-subtle); }
.steps-list li.next { background: var(--info-bg); border-radius: var(--radius-control); }
.steps-list .at { color: var(--ink-2); font-size: 12.5px; }
.steps-list .jump { font-size: 11.5px; font-weight: 700; color: var(--warning-text); background: var(--warning-bg); border-radius: var(--radius-chip); padding: 1px 6px; }
.steps-list .meta { color: var(--muted); }
.steps-list .chip { justify-self: start; }
.steps-list li.next .meta { color: var(--ink-2); }
.steps-list .detail { grid-column: 3 / -1; color: var(--ink-2); font-size: 12.5px; }
.how { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
@media (max-width: 1100px) { .mail { grid-template-columns: 1fr; } }

/* Office from 1024 px with the navigation column; below that the navigation is a strip under the
   top bar, both sticky; field roles phone-first with 44 px targets (DASHBOARD-PRINCIPLES §1.9). */
@media (max-width: 1023.98px) {
  .app-shell { display: block; background: none; }
  /* CMO W1 M1: below 1024 px the notice has a fixed-height slot under the navigation strip; both are
     sticky and always the same height, so a notice pushes nothing and never covers the page. */
  .sidebar { position: sticky; top: 0; height: calc(var(--navstrip) + var(--noticeslot)); display: grid; grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: var(--navstrip) var(--noticeslot); align-items: center; column-gap: 12px; row-gap: 0; padding: 0 var(--gutter);
    border-right: 0; border-bottom: 1px solid var(--border); overflow: visible; }
  .brand { padding: 0; }
  .brand img { height: 26px; }
  .nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { min-height: 34px; }
  .nav a[aria-current=page]::before { left: 10px; right: 10px; top: auto; bottom: -9px; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
  .topbar { top: calc(var(--navstrip) + var(--noticeslot)); }
  .toasts { grid-column: 1 / -1; align-self: stretch; height: var(--noticeslot); margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter);
    border-top: 1px solid var(--border-subtle); background: var(--surface-subtle); flex-direction: row; align-items: center; overflow: hidden; }
  .toasts:empty::before { content: "Keine neuen Hinweise"; color: var(--muted); font-size: 12.5px; }
  .toast { display: flex; align-items: center; gap: 8px; height: 100%; padding: 0 4px 0 10px; border-width: 0 0 0 4px; border-radius: var(--radius-control); box-shadow: none; }
  .toast > div:first-child { flex: 1; min-width: 0; display: flex; gap: 6px; align-items: baseline; overflow: hidden; white-space: nowrap; }
  .toast > div:first-child > div:nth-child(2) { overflow: hidden; text-overflow: ellipsis; }
  .toast .more { display: none; }
  .toast button.open { order: 2; }
  .toast button.link { order: 3; }
  .toast .btn { min-height: 36px; }
}
@media (max-width: 760px) {
  .topbar { gap: 8px; }
  .search kbd { display: none; }
  .acct-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  main { padding: 14px 12px 40px; }
  .row { grid-template-columns: 6px minmax(0, 1fr); }
  .row .side { grid-column: 2; justify-content: flex-start; margin-top: 8px; flex-wrap: wrap; }
}
body.field .btn, body.field .icon-btn, body.field input, body.field select { min-height: 44px; }
body.field .row .side .btn { min-width: 44px; }
body.field .brand img { height: 26px; }

/* F6: warehouse and value pages. */
.qty-input { width: 7em; text-align: right; }
.figures.spaced { margin-bottom: 22px; }
.sub.note { margin-top: 12px; color: var(--muted); }
.figure .l { color: var(--ink-2); font-weight: 600; font-size: 13px; }

/* F6 (design review M2): the paper pack as a sheet; printed without the app chrome. */
.sheet { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 20px 24px; max-width: 900px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 12px; }
.sheet-title { font-size: 20px; text-transform: none; letter-spacing: -0.01em; color: var(--ink); margin: 0; }
.sheet-day { color: var(--ink-2); margin-top: 2px; }
.sheet-stand { font-weight: 650; white-space: nowrap; }
.sheet-kv { margin-bottom: 14px; }
table.plain.pack th, table.plain.pack td { padding: 10px 8px; }
table.plain.pack .box-col { width: 34px; }
.box { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border: 2px solid var(--ink); border-radius: 3px; font-weight: 700; }
table.plain.pack td.write { min-width: 90px; border-bottom: 1px solid var(--border); }
.sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin: 34px 0 14px; color: var(--ink-2); font-size: 13px; }
.sign-line { border-bottom: 1px solid var(--ink); height: 34px; margin-bottom: 4px; }
.sheet-foot { border-top: 1px solid var(--border); padding-top: 8px; color: var(--ink-2); }
@media print {
  .topbar, .sidebar, .toasts, .screen-only, .skip-link { display: none !important; }
  .app-shell { display: block; background: none; }
  body { background: #fff; }
  main, #main { padding: 0 !important; }
  .sheet { border: 0; padding: 0; max-width: none; box-shadow: none; }
  table.plain { border-color: #000; }
}

/* F9 Verwaltung (Admin): users, crews, identity log. */
.plain-list { list-style: none; margin: 4px 0 12px; padding: 0; }
.plain-list li { padding: 4px 0; border-top: 1px solid var(--border-subtle); }
.plain-list li:first-child { border-top: 0; }
.muted { color: var(--muted); }
.card h3 { margin: 14px 0 4px; }
.card details { margin-top: 10px; }

/* M1 Stammdaten and the readiness panel. State is never shown by colour alone: a mark and words go with it. */
.small { font-size: 12px; }
.md-tabs ul { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.md-tabs a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--ink-2); text-decoration: none; background: var(--surface); white-space: nowrap; }
.md-tabs a:hover { background: var(--surface-subtle); }
.md-tabs a[aria-current=page] { background: var(--info-bg); color: var(--info-text); border-color: var(--info-border); font-weight: 650; }
.check { display: flex; align-items: baseline; gap: 6px; min-height: 28px; }
.md-checks { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.md-fieldset { border: 1px solid var(--border); border-radius: var(--radius-control); padding: 8px 12px 4px; margin: 0 0 12px; min-width: 0; }
.md-fieldset legend { padding: 0 4px; font-weight: 600; }
.md-row { display: grid; grid-template-columns: 8em minmax(0, 1fr); gap: 0 12px; }
.md-suggest:not(:empty) { background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning-border); border-radius: var(--radius-control); padding: 8px 10px; margin: -4px 0 12px; }
.md-suggest ul { margin: 4px 0 0; padding-left: 18px; }
.md-suggest a { color: inherit; }
.md-pick { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; max-height: 220px; overflow: auto; }
.md-compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
.md-compare legend { font-weight: 600; margin-bottom: 6px; }
.md-side { border: 1px solid var(--border); border-radius: var(--radius-control); padding: 8px 10px; min-width: 0; overflow-wrap: anywhere; }
dialog:has(.md-compare) { width: min(720px, 94vw); }
.readiness .ready-state { font-weight: 650; margin: 0 0 8px; }
.readiness .ready-state.ok { color: var(--success-text); }
.readiness .ready-state.open { color: var(--danger-text); }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; padding: 7px 0; border-top: 1px solid var(--border-subtle); }
.checklist li:first-child { border-top: 0; }
.checklist .mark { font-weight: 700; text-align: center; border-radius: 50%; width: 20px; height: 20px; line-height: 20px; font-size: 12px; }
.checklist li.ok .mark { color: var(--success-text); background: var(--success-bg); }
.checklist li.open .mark { color: var(--danger-text); background: var(--danger-bg); }
.checklist li.optional .mark { color: var(--warning-text); background: var(--warning-bg); }
.checklist .detail { color: var(--ink-2); font-size: 13px; overflow-wrap: anywhere; }
.checklist .btn.link, .checklist a { font-size: 13px; padding-left: 0; }
/* M1b: where the case stands, the unverified records to confirm, and the call form's suggestions. */
.readiness .stage { margin: 0 0 8px; color: var(--ink-2); }
.checklist ul.unverified { list-style: none; margin: 2px 0 0; padding: 0; font-size: 13px; }
/* CMO S1: the unverified records are plain lines ("Name · Bestätigen"), not the checklist's two-column grid. */
.checklist ul.unverified li { display: block; padding: 2px 0; border: 0; }
.readiness .hand { align-items: center; margin-top: 8px; }
.readiness .hand-hint { margin: 0; color: var(--ink-2); font-size: 13px; }
.readiness .hand-hint:empty { display: none; }
.readiness .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.suggest:empty { display: none; }
.suggest { margin: -4px 0 10px; padding: 6px 10px; border-left: 3px solid var(--border-subtle); }
.suggest ul { margin: 2px 0 0; padding-left: 16px; }
.suggest .hint.ok { color: var(--success-text); }
table.md-table .phone-only { display: none; }
table.md-table td, table.md-table th { overflow-wrap: anywhere; }
@media (max-width: 1279.98px) { table.md-table .opt-wide { display: none; } }
@media (max-width: 760px) {
  .md-compare { grid-template-columns: 1fr; } .md-row { grid-template-columns: 1fr; }
  table.md-table .opt { display: none; } table.md-table .phone-only { display: block; }
}
dialog input[id^="md-"]:not([type=checkbox]):not([type=radio]), dialog select[id^="md-"] { width: 100%; min-width: 0; box-sizing: border-box; }
.md-earlier { margin-top: 6px; }
.md-earlier summary { cursor: pointer; color: var(--ink-2); font-size: 13px; min-height: 24px; }
.md-warning { color: var(--warning-text); background: var(--warning-bg); border: 1px solid var(--warning-border); border-radius: var(--radius-control); padding: 8px 10px; margin: 4px 0 0; }
