/* HaWart ERP V2 — Visual System v0.1 implementation (docs/ux/VISUAL_SYSTEM_V0.1.md).
   ~90 % neutral surface, ~10 % semantic colour. Colour = operational meaning only.
   Owner decision 2026-10-03: brand colours of the website (black / yellow) as accents — black
   navigation, yellow main buttons and active markers. Yellow is a fill or a marker, never text
   on white (--accInk stays near-black). Green = ok and red = stop are unchanged; warnings moved
   to orange so they cannot be mistaken for the brand yellow. */
@import url("fonts.css");

:root {
  --canvas: oklch(0.980 0.002 250); --surface: oklch(1 0 0);
  --surface2: oklch(0.976 0.002 250); --surface3: oklch(0.955 0.003 250);
  --ink: oklch(0.215 0.010 255); --ink2: oklch(0.435 0.010 255); --ink3: oklch(0.53 0.009 255);
  --line: oklch(0.912 0.003 255); --line2: oklch(0.858 0.005 255); --fieldLine: oklch(0.64 0.005 255);
  --nav: #0b0b0b; --navUp: #1e1e1e; --navInk: oklch(0.925 0 0);
  --navInk2: oklch(0.700 0 0); --navLine: #262626;
  --acc: #f9c22e; --accHover: #f0b70f; --accOn: #0b0b0b; --accInk: #0b0b0b; --accDeep: #8a6a00;
  --accBg: oklch(0.975 0.022 95); --accLine: oklch(0.870 0.095 92);
  --ok: oklch(0.455 0.082 152); --okBg: oklch(0.963 0.024 152); --okLine: oklch(0.855 0.050 152);
  --warn: oklch(0.500 0.135 45); --warnBg: oklch(0.958 0.040 55); --warnLine: oklch(0.850 0.085 52);
  --stop: oklch(0.475 0.135 27); --stopBg: oklch(0.965 0.024 30); --stopLine: oklch(0.868 0.052 30);
  --wait: oklch(0.450 0.040 288); --waitBg: oklch(0.962 0.016 292); --waitLine: oklch(0.868 0.030 292);
  --r: 8px; --rc: 6px; --rowH: 54px; --fld: 36px;
  --sidebarW: 224px; --ctxW: clamp(320px, 22vw, 420px); --ctxGrip: 30px;
  --sans: 'IBM Plex Sans', system-ui, sans-serif; --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
/* Component display rules must not override the native hidden state. */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; background: var(--canvas); color: var(--ink); -webkit-font-smoothing: antialiased; }
body { font-family: var(--sans); font-size: 13.5px; line-height: 1.5; min-height: 100vh; overflow-wrap: anywhere; }
a { color: var(--accInk); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--accDeep); }
button, input, textarea, select { font-family: inherit; font-size: 13.5px; color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.mono { font-family: var(--mono); }
.muted { color: var(--ink3); }
.small { font-size: 12.5px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 6px 10px; border-radius: var(--rc); z-index: 100; }
.skip-link:focus { left: 8px; }

/* ---------- Shell: sidebar | main flex:1 | context ---------- */
.shell { display: grid; grid-template-columns: var(--sidebarW) minmax(0, 1fr) auto; min-height: 100vh; }
.shell.ctx-collapsed { --ctxW: var(--ctxGrip); }
.sidebar { background: var(--nav); color: var(--navInk); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 14px 24px; font-weight: 600; font-size: 15px; letter-spacing: .01em; border-bottom: 1px solid var(--navLine); }
.sidebar nav { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px 9px 14px; color: var(--navInk); text-decoration: none; border-radius: var(--rc); font-size: 13.5px; position: relative; }
.sidebar nav a:hover { background: var(--navUp); color: var(--navInk); }
.sidebar nav a[aria-current="page"] { background: var(--navUp); }
.sidebar nav a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; background: var(--acc); border-radius: 2px; }
.sidebar nav a .count { margin-left: auto; font-family: var(--mono); font-size: 12px; background: var(--navUp); border-radius: 10px; padding: 0 7px; color: var(--navInk); }
.sidebar .sidebar-foot { margin-top: auto; padding: 12px 16px; border-top: 1px solid var(--navLine); font-size: 12px; color: var(--navInk2); }
.sidebar svg { width: 18px; height: 18px; flex: 0 0 18px; }
/* Owner decision T13 (2026-10-04): „Einstellungen“ opens its sub-options inside the sidebar.
   A long menu scrolls there instead of pushing entries below a low screen. */
#main-nav { min-height: 0; overflow-y: auto; }
.nav-group > summary { display: flex; align-items: center; gap: 10px; padding: 9px 12px 9px 14px; border-radius: var(--rc); font-size: 13.5px; cursor: pointer; list-style: none; user-select: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary:hover { background: var(--navUp); }
.nav-group > summary svg:last-child { margin-left: auto; width: 16px; height: 16px; flex-basis: 16px; }
.nav-group[open] > summary svg:last-child { transform: rotate(180deg); }
.sidebar .nav-group nav { padding: 2px 0 4px; }
.sidebar .nav-group nav a { padding: 7px 12px 7px 42px; font-size: 13px; color: var(--navInk2); }
.sidebar .nav-group nav a:hover, .sidebar .nav-group nav a[aria-current="page"] { color: var(--navInk); }
/* Owner decision D38-8 (E-44): thin lines between the blocks of the settings; a block without a visible entry takes no line. */
.sidebar .nav-group nav .nav-block:empty { display: none; }
.sidebar .nav-group nav .nav-block:not(:empty) ~ .nav-block:not(:empty) { border-top: 1px solid var(--navLine); margin-top: 4px; padding-top: 4px; }
/* The global focus ring is dark and would vanish on the dark sidebar. */
.sidebar :focus-visible { outline-color: var(--navInk); }
.nav-toggle, .nav-search { display: none; }
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 10px 24px; background: var(--surface); border-bottom: 1px solid var(--line); min-height: 56px; }
.topbar form.search { flex: 1 1 320px; max-width: 520px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--fieldLine); border-radius: var(--r); padding: 0 10px; height: var(--fld); background: var(--surface); }
.topbar form.search input { border: 0; flex: 1; height: 100%; background: transparent; outline: none; }
.topbar form.search kbd { font-family: var(--mono); font-size: 11px; color: var(--ink3); border: 1px solid var(--line2); border-radius: 4px; padding: 0 5px; }
.topbar .user { margin-left: auto; display: flex; align-items: center; gap: 12px; text-align: right; }
.topbar .user .name { font-weight: 600; font-size: 13px; }
.topbar .user .roles { font-size: 12px; color: var(--ink3); }
.sidebar .env, .topbar .env { font-family: var(--mono); font-size: 11px; color: var(--warn); border: 1px solid var(--warnLine); background: var(--warnBg); border-radius: 4px; padding: 1px 6px; }
.workspace { padding: 20px clamp(24px, 2.2vw, 56px) 40px; flex: 1; min-width: 0; }
.workspace.narrow { max-width: 1180px; }
.workspace.list { max-width: 2400px; }
.context { width: var(--ctxW); border-left: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; height: 100vh; overflow: auto; }
.context .ctx-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); }
.context .ctx-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 14px; }
.shell.ctx-collapsed .context .ctx-body, .shell.ctx-collapsed .context .ctx-head span { display: none; }
.shell.ctx-collapsed .context .ctx-head { writing-mode: vertical-rl; padding: 12px 6px; }
.ctx-toggle { border: 1px solid var(--line); background: var(--surface); border-radius: var(--rc); width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.ctx-section h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink3); font-weight: 600; }
.ctx-section dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 12.5px; }
.ctx-section dt { color: var(--ink3); }
.ctx-section dd { margin: 0; }

/* ---------- Typography ---------- */
h1.page-title { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.25; }
.page-head { margin-bottom: 18px; }
.page-head .sub { color: var(--ink2); font-size: 12.5px; margin-top: 2px; }
h2.section { margin: 0; font-size: 15px; font-weight: 600; }
.label { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink3); font-weight: 600; }

/* ---------- Surfaces ---------- */
.surface { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.surface > header { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--surface2); border-radius: var(--r) var(--r) 0 0; }
.surface > header .spacer { flex: 1; }
.surface .body { padding: 12px 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- Notices (semantic, restrained) ---------- */
.notice { border: 1px solid var(--line2); border-radius: var(--rc); background: var(--surface); padding: 10px 14px; display: flex; gap: 10px; align-items: flex-start; }
.notice svg { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; }
.notice .t { font-weight: 600; }
.notice.ok { border-color: var(--okLine); background: var(--okBg); color: var(--ink); }
.notice.ok svg { color: var(--ok); }
.notice.warn { border-color: var(--warnLine); background: var(--warnBg); }
.notice.warn svg { color: var(--warn); }
.session-warning { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 560px; margin: 0 auto; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }
.notice.stop { border-color: var(--stopLine); background: var(--stopBg); }
.notice.stop svg { color: var(--stop); }
.notice.info { border-color: var(--line2); background: var(--surface2); }
.notice.info svg { color: var(--ink2); }
/* Flash messages keep their severity (F-07): icon + leading word, never colour alone. */
.notice.flash { margin-bottom: 14px; }
.notice .lead { font-weight: 600; margin-right: 6px; }
.notice.embedded { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.next-step { border: 1px solid var(--line2); border-radius: var(--rc); background: var(--surface2); padding: 8px 14px; }
.next-step .label { color: var(--ink2); margin-right: 8px; }

/* ---------- Badges: exactly seven coloured badges exist; only EXPRESS/BLOCKIERT used here ---------- */
.badge { display: inline-flex; align-items: center; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .05em; padding: 1px 7px; border-radius: 4px; border: 1px solid var(--line2); background: var(--surface2); color: var(--ink2); vertical-align: middle; }
.badge.express { color: var(--warn); border-color: var(--warnLine); background: var(--warnBg); }
.badge.blockiert { color: var(--stop); border-color: var(--stopLine); background: var(--stopBg); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface2); color: var(--ink2); }
.chip.ok { color: var(--ok); border-color: var(--okLine); background: var(--okBg); }
.chip.warn { color: var(--warn); border-color: var(--warnLine); background: var(--warnBg); }
.chip.stop { color: var(--stop); border-color: var(--stopLine); background: var(--stopBg); }
.chip svg { width: 14px; height: 14px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--fld); padding: 0 16px; border-radius: var(--rc); border: 1px solid var(--line2); background: var(--surface); color: var(--ink); font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--ink); background: var(--accBg); color: var(--accInk); }
.btn.primary { background: var(--acc); border-color: var(--acc); color: var(--accOn); font-weight: 700; }
.btn.primary:hover { background: var(--accHover); border-color: var(--accHover); color: var(--accOn); }
.btn.stop { background: var(--stop); border-color: var(--stop); color: #fff; font-weight: 600; }
.btn.stop:hover { background: oklch(0.420 0.135 27); border-color: oklch(0.420 0.135 27); color: #fff; }
.btn.sm { height: 28px; padding: 0 11px; font-size: 12.5px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-link { background: none; border: 0; padding: 0; color: var(--accInk); text-decoration: underline; cursor: pointer; font-size: inherit; }
.seg { display: inline-flex; gap: 6px; }
.seg .btn.on { background: var(--acc); border-color: var(--acc); color: var(--accOn); font-family: var(--mono); font-weight: 600; }
.seg .btn.mono { font-family: var(--mono); }

/* ---------- Filters (navigation, not business state) ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 14px; }
.filters a { text-decoration: none; color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; background: var(--surface); font-size: 13px; }
.filters a[aria-current="true"] { background: var(--nav); color: var(--navInk); border-color: var(--nav); }
.filters a:hover { border-color: var(--ink); }
.filters { align-items: center; }
.filters a .n { margin-left: 6px; font-family: var(--mono); font-size: 12px; color: var(--ink3); }
.filters a[aria-current="true"] .n { color: var(--navInk2); }
.filters a.late { border-color: var(--warnLine); background: var(--warnBg); color: var(--warn); }
.filters a.late .n { color: var(--warn); }
.filters a.late[aria-current="true"] { background: var(--nav); color: var(--navInk); border-color: var(--nav); }
.filters .sort { margin-left: auto; color: var(--ink3); font-size: 12px; }

/* ---------- Worklist / tables ---------- */
.table-wrap { overflow-x: auto; }
/* Owner decision T15 (2026-10-05, P-05): a table never breaks a word or an amount. The page-wide
   `overflow-wrap: anywhere` let a column shrink below its longest word („Reparatu|r“, „420,|00 €“);
   `break-word` keeps the column as wide as that word and the wrapper scrolls if it must. */
table.worklist { width: 100%; border-collapse: collapse; font-size: 13.5px; overflow-wrap: break-word; }
table.worklist .money { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.worklist time, .nowrap { white-space: nowrap; }
table.worklist th { text-align: left; font-size: 12px; color: var(--ink3); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface2); white-space: nowrap; }
table.worklist td { padding: 8px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; height: var(--rowH); }
table.worklist tr:last-child td { border-bottom: 0; }
table.worklist tbody tr:hover td { background: var(--surface2); }
table.worklist .primary { font-weight: 600; }
table.worklist .sub { color: var(--ink2); font-size: 12.5px; }
table.worklist a.nr { font-family: var(--mono); font-weight: 500; }
/* Owner decision T20 (2026-10-05, P-04): two lines per row at most — the age first, the date under
   it; one bold link per row, underlined on hover and keyboard focus only. */
table.worklist td.since time { display: block; color: var(--ink2); font-size: 12.5px; }
table.worklist td a { text-decoration: none; }
table.worklist td a:hover, table.worklist td a:focus-visible { text-decoration: underline; }
.empty { padding: 28px 14px; text-align: center; color: var(--ink2); }
.empty .t { font-weight: 600; color: var(--ink); margin-bottom: 4px; }

/* ---------- Auftrag head ---------- */
.auftrag-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.auftrag-head .nr { font-family: var(--mono); font-size: 22px; font-weight: 600; letter-spacing: .02em; margin: 0; line-height: 1.25; }
.auftrag-head .head-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.auftrag-meta { color: var(--ink2); font-size: 13px; margin-top: 4px; display: flex; gap: 4px 8px; flex-wrap: wrap; align-items: center; }
.auftrag-meta strong { color: var(--ink); font-weight: 600; }
a.chip { text-decoration: none; }
/* Owner decision T15 (2026-10-05, P-02): a finished step is one line; what belongs to it opens on
   demand, so the work of the current step starts right under the tabs. */
.fold { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
div.fold, .fold > summary { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; padding: 9px 14px; font-size: 13px; }
.fold > summary { list-style: none; cursor: pointer; }
.fold > summary::-webkit-details-marker { display: none; }
.fold svg { width: 16px; height: 16px; flex: 0 0 16px; }
div.fold > svg:first-child, .fold > summary > svg:first-child { color: var(--ok); }
div.fold.wait > svg:first-child { color: var(--ink2); }
.fold .s { color: var(--ink2); }
.fold .more { margin-left: auto; color: var(--ink2); font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; }
.fold[open] > summary { border-bottom: 1px solid var(--line); }
.fold[open] > summary .more svg { transform: rotate(180deg); }
.fold > .surface { border: 0; border-radius: 0 0 var(--r) var(--r); }
.fold > .fold-body { padding: 14px; }
.fold a.more { text-decoration: underline; }
.fold a.more:hover { color: var(--ink); }
/* Before the diagnosis (T15, P-02): what the customer reports, the device and the parcel, side
   by side; one column on phones. */
.brief { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.brief > div { padding: 10px 14px; border-left: 1px solid var(--line); min-width: 0; overflow-wrap: break-word; }
.brief > div:first-child { border-left: 0; }
.brief .k { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink3); font-weight: 600; }
.brief .v { font-size: 13.5px; }
.brief .v.big { font-size: 15px; font-weight: 600; }
.brief .cap { color: var(--ink2); font-size: 12.5px; }
.brief .miss { color: var(--stop); font-weight: 500; }
.brief .damaged { color: var(--warn); font-weight: 500; }
@media (max-width: 900px) { .brief { grid-template-columns: minmax(0, 1fr); } .brief > div { border-left: 0; border-top: 1px solid var(--line); } .brief > div:first-child { border-top: 0; } }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); margin-top: 14px; overflow: hidden; }
.facts > div { padding: 8px 12px; border-right: 1px solid var(--line); min-width: 0; }
.facts > div:last-child { border-right: 0; }
.facts .k { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink3); font-weight: 600; }
.facts .v { font-size: 13px; overflow-wrap: break-word; }
.facts .v.muted { color: var(--ink3); }
/* D30 / E-20: the order tabs stand in one row on every width and scroll sideways when they do
   not fit, as on phones (T15, P-03); their order is unchanged (D38-8). The grey line is an
   inset shadow, not a border: inside the scroll box an overlapping border would clip the
   active underline and add a vertical scroll. nowrap because body breaks words anywhere. */
.tabs { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 4px; box-shadow: inset 0 -1px 0 var(--line); margin: 14px 0 16px; }
.tabs a { padding: 8px 12px; text-decoration: none; color: var(--ink2); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; }
/* The focus ring is drawn inside the tab, or the scroll box would cut it off. */
.tabs a:focus-visible { outline-offset: -2px; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--acc); }
.tabs a:hover { color: var(--ink); }
.tabs a .n { margin-left: 2px; font-family: var(--mono); font-size: 12px; color: var(--ink3); }

/* ---------- Items grid (P02) ---------- */
.items { display: grid; grid-template-columns: minmax(200px, 1.2fr) minmax(200px, 1fr) minmax(220px, 1fr); }
.items > div { padding: 8px 14px; border-bottom: 1px solid var(--line); min-height: var(--rowH); display: flex; flex-direction: column; justify-content: center; }
.items .h { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink3); font-weight: 600; background: var(--surface2); min-height: 36px; }
.items .role { color: var(--ink3); font-size: 12px; }
.items .miss { color: var(--stop); font-weight: 500; }
.items .damaged { color: var(--warn); font-weight: 500; }
.items form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.photos { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px 14px; }
.photo { margin: 0; width: 168px; border: 1px solid var(--line); border-radius: var(--rc); overflow: hidden; background: var(--surface2); font-size: 12px; }
.photo .thumb { height: 110px; display: flex; align-items: center; justify-content: center; background: var(--surface3); color: var(--ink3); }
.photo .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .meta { padding: 6px 8px; }
.photo .st { color: var(--ink3); }
.photo .st.pending { color: var(--warn); }
.photo .st.blocked { color: var(--stop); }
.photo .st.clean { color: var(--ink2); }
/* „Reklamation online“ (O5 = A): a photo's name is the customer's own text — never wider than its card. */
.customer-photos .photo .meta { overflow-wrap: anywhere; }

/* ---------- Forms ---------- */
.field { display: block; }
.field > span { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink2); margin-bottom: 5px; }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field select, .field textarea { width: 100%; min-height: var(--fld); padding: 0 9px; border: 1px solid var(--fieldLine); border-radius: var(--rc); background: var(--surface); }
.field textarea { min-height: 76px; padding: 7px 9px; resize: vertical; line-height: 1.5; }
/* The few text fields and selects that sit outside a .field wrapper (deadline table, print filter)
   get the same edge instead of the browser's own look. */
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input:not([type]), select, textarea { min-height: var(--fld); padding: 0 9px; border: 1px solid var(--fieldLine); border-radius: var(--rc); background: var(--surface); }
textarea { padding: 7px 9px; }
.field .help { font-size: 12px; color: var(--ink3); margin-top: 4px; }
/* Owner D54 (2026-10-24): a refused field is plainly red — its edge, not only the sentence under it.
   The aria-invalid selectors reach fields marked by the action’s refusal, inside and outside a .field. */
.field.error input, .field.error textarea, .field.error select,
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"],
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--stop); box-shadow: 0 0 0 1px var(--stop); background: var(--stopBg); }
.field .err { color: var(--stop); font-size: 12.5px; margin-top: 4px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
fieldset.finding { margin: 0; padding: 11px 12px; border: 1px solid var(--line2); border-radius: var(--rc); background: var(--surface2); }
fieldset.finding legend { padding: 0 5px; font-weight: 600; font-size: 12.5px; }
fieldset.finding.blocked { border-color: var(--stopLine); background: var(--stopBg); }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline-form { display: inline; }
/* Form groups keep a readable width inside the full-width object shell (F-08, VS widths). */
.form-block { max-width: 1180px; }
.form-block.compact { max-width: 900px; }
.field.grow { flex: 1 1 260px; max-width: 420px; }
.row.end { align-items: flex-end; }
/* D54/D57: every staff photo field is also a drop zone; the frame appears only once its script runs. */
.dropzone.on { padding: 10px 12px; border: 1px dashed var(--fieldLine); border-radius: var(--rc); background: var(--surface2); }
.dropzone.over { border-color: var(--ink); background: var(--accBg); }
.dropzone > .dropzone-hint, .dropzone > .dropzone-files { flex-basis: 100%; }
/* D57: the camera's small live preview and the list of chosen photos with thumbnails and „×“
   (foto-picker.js). Thumbnails are data: images (CSP img-src 'self' data:), sized here only. */
.dropzone > .foto-kamera, .dropzone > .foto-kamera-hinweis { flex-basis: 100%; }
.foto-kamera { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.foto-kamera-bild { display: block; width: 240px; max-width: 100%; aspect-ratio: 16 / 9; background: var(--nav); border-radius: var(--rc); object-fit: contain; }
.foto-kamera-wahl { min-height: 28px; max-width: 100%; border: 1px solid var(--fieldLine); border-radius: var(--rc); background: var(--surface); }
.foto-item { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.foto-item > .mono { flex: 0 1 auto; min-width: 0; }
.foto-thumb { flex: 0 0 48px; width: 48px; height: 48px; object-fit: cover; border: 1px solid var(--line2); border-radius: 4px; background: var(--surface3); color: var(--ink3); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.btn.sm.foto-weg { flex: 0 0 auto; width: 28px; padding: 0; font-size: 16px; }
/* Owner 2026-10-25: a listed photo's thumbnail is a picture to click (foto-gross.js), not a
   button like „ד beside it; a stored photo's link shows the same hint once the script runs. */
.foto-gross-auf { flex: 0 0 auto; display: inline-flex; padding: 0; border: 0; border-radius: 4px; background: none; cursor: zoom-in; }
html.js a[data-foto-gross] { cursor: zoom-in; }
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; }
.rule { font-weight: 600; font-size: 12.5px; color: var(--ink2); }
.rule.unmet { color: var(--stop); }
.action-head { flex: 1 1 260px; min-width: 0; }
.action-head .title { font-weight: 600; font-size: 14px; }
.action-head .sub { color: var(--ink2); margin-top: 3px; }
.surface.attention { border-color: var(--line2); }
.facts.embedded { margin: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
details.body { padding: 8px 14px; }
details.body > summary { cursor: pointer; color: var(--accInk); }
.list-compact { margin: 4px 0 0; padding-left: 18px; }
.extra-row { padding: 4px 0; }
.page-title .nr-small { font-size: 15px; }
.kunde-grid { max-width: 1720px; }
.surface.scan { max-width: 640px; }

/* ---------- Spacing utilities (the CSP forbids inline style attributes) ---------- */
.pre { white-space: pre-wrap; }
.pt-0 { padding-top: 0; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mb-6 { margin-bottom: 6px; }
.ml-auto { margin-left: auto; }
.mail-preview { width: 100%; height: 480px; border: 1px solid var(--line, #d9dde3); border-radius: 8px; background: #fff; }
.profile-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; align-items: start; max-width: 1500px; }
.profile-card.profile-wide { grid-column: span 2; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; align-items: end; }
.profile-grid .field input:not([type=checkbox]), .profile-grid .field select, .profile-grid .field textarea { width: 100%; }
.profile-grid .field.check { align-self: center; }
.profile-card.profile-new { background: var(--surface2); border-style: dashed; }
@media (max-width: 760px) { .profile-card.profile-wide { grid-column: auto; } .profile-grid { grid-template-columns: minmax(0, 1fr); } }
.profile-save { position: sticky; bottom: 0; background: var(--canvas); padding: 10px 0; }
/* Order path (Owner 2026-10-04): the same card, labels and lines as the facts below it; the
   current step carries the brand accent like the active tab. Wraps to two rows when narrow. */
.progress { container-type: inline-size; margin-top: 14px; }
.progress-path { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: hidden; }
/* Lines between cells and rows that never double at the card edge: each cell draws its left line
   one pixel outside itself and its top line above itself; the card clips both at its border. */
.progress-path li { padding: 7px 10px 8px; margin-left: -1px; border-left: 1px solid var(--line); border-top: 3px solid transparent; box-shadow: 0 -1px 0 var(--line); min-width: 0; color: var(--ink3); }
.progress-path .k { display: flex; align-items: center; gap: 5px; font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress-path .v { display: block; font-size: 13px; line-height: 1.35; }
.progress-path li.done { border-top-color: var(--ink); color: var(--ink2); }
.progress-path li.current { border-top-color: var(--acc); background: var(--accBg); color: var(--ink); }
.progress-path li.current .v { font-weight: 700; }
.progress-path li.current.attention { border-top-color: var(--warn); background: var(--warnBg); }
@container (max-width: 820px) { .progress-path { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.progress-line { display: none; }
@container (max-width: 420px) { .progress-path { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.task-note { margin-top: 6px; } .task-note input { flex: 1 1 220px; min-width: 0; }
.span-all { grid-column: 1 / -1; }
h2.section.gap { margin: 20px 0 10px; }

/* ---------- Verlauf ---------- */
.verlauf { list-style: none; margin: 0; padding: 0; }
.verlauf li { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.verlauf li:last-child { border-bottom: 0; }
.verlauf time { font-family: var(--mono); font-size: 12px; color: var(--ink3); }
.verlauf .who { color: var(--ink3); font-size: 12.5px; }
.verlauf dl { margin: 4px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 1px 10px; font-size: 12.5px; color: var(--ink2); }
.verlauf dd { margin: 0; }
.verlauf-text { margin: 6px 0 0; font-size: 12.5px; }
.verlauf-text summary { cursor: pointer; color: var(--ink3); }
.verlauf-text .pre { margin: 6px 0 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface2); color: var(--ink2); }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(100%, 400px); }
.login-card .brand { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.login-card .brand small { display: block; font-weight: 400; color: var(--ink3); font-size: 12.5px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Save state (autosave) ---------- */
.save-state { font-size: 12.5px; color: var(--ink3); display: inline-flex; align-items: center; gap: 6px; }
.save-state.saving { color: var(--ink2); }
.save-state.saved { color: var(--ink2); }
.save-state.error { color: var(--stop); font-weight: 500; }

/* ---------- Print/labels ---------- */
.labels { display: flex; flex-direction: column; }
.labels > div { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(160px, 1.2fr) minmax(200px, 1fr) auto; gap: 12px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line); min-height: var(--rowH); }
.labels > div:last-child { border-bottom: 0; }
.outcome { color: var(--ink2); }
.outcome.not-attempted { color: var(--warn); }
.outcome.failed { color: var(--stop); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) { .shell { grid-template-columns: var(--sidebarW) minmax(0, 1fr); } .context { display: none; } }
@media (max-width: 900px) { .shell { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } .sidebar nav { flex-direction: row; flex-wrap: wrap; } .workspace { padding: 16px; } .items { grid-template-columns: 1fr; } .items > div { min-height: 0; } .facts { grid-template-columns: repeat(2, 1fr); } .verlauf li { grid-template-columns: 1fr; } }
@media print { .sidebar, .topbar, .context { display: none; } }

/* ---------- Angebot workspace (P04, IMPLEMENTATION-02) ---------- */
.subtabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.subtabs a { padding: 7px 12px; text-decoration: none; color: var(--ink2); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; font-size: 13.5px; }
.subtabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--acc); }
.subtabs a:hover { color: var(--ink); }
table.options td.pt-0 { padding-top: 0; padding-bottom: 0; height: auto; }
.option-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: end; padding: 10px 0; border-bottom: 1px solid var(--line); }
.option-row.new { border-bottom: 0; background: var(--surface2); padding: 10px 14px; border-radius: var(--rc); border: 1px dashed var(--line2); }
.options-edit { table-layout: fixed; }
.option-row > .letter, .option-row > .row { grid-column: 1 / -1; }
.option-row > .field { min-width: 0; }
.option-row .letter { font-weight: 600; font-size: 15px; height: var(--fld); display: flex; align-items: center; }
.option-row .field > span { font-size: 12px; }
.option-row .field input[type=text] { min-width: 0; }
/* D54: with „Andere …“ the name's choice and its own text are two fields, not one double box;
   the name and the description beside it start level, however tall the name gets. */
.field[data-titel] select:not([hidden]) + input:not([hidden]) { margin-top: 6px; }
.option-row > .field[data-titel], .option-row > .field[data-titel] + .field { align-self: start; }
table.options tr.chosen td { background: var(--accBg); }
.publish-box { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; border: 1px solid var(--accLine); background: var(--accBg); border-radius: var(--r); padding: 12px 14px; }
.publish-box.blocked { border-color: var(--line2); background: var(--surface2); }
.publish-box form { margin-left: auto; }
.link-once { padding: 10px 12px; border: 1px solid var(--accLine); background: var(--accBg); border-radius: var(--rc); overflow-wrap: anywhere; font-size: 13px; }
.action-bar { gap: 12px; }
.facts.actions-facts { border: 1px solid var(--line); border-radius: var(--rc); }
.choice-row { display: flex; align-items: center; gap: 8px; min-height: 32px; font-size: 13.5px; }
.seg label.btn { position: relative; }
.seg label.btn:has(input:checked) { background: var(--acc); border-color: var(--acc); color: var(--accOn); }
.field .err { display: block; }
@media (max-width: 900px) { .option-row { grid-template-columns: minmax(0, 1fr); } }

/* Repair notes may contain long identifiers; wrap without losing content. */
.repair-work, .repair-work .body, .repair-work dd { min-width: 0; }
.repair-work .pre, .repair-work dd { overflow-wrap: anywhere; }

/* Keep search and account controls inside narrow employee screens. */
@media (max-width: 600px) {
  .topbar { flex-wrap: wrap; padding: 12px 16px; gap: 8px; }
  .topbar form.search { flex-basis: 100%; max-width: none; min-width: 0; }
  .topbar form.search input { min-width: 0; width: 100%; }
  .topbar .user { max-width: 100%; }
}

/* Repair evidence uses the existing surfaces and controls; long file names remain readable. */
#repair-evidence-form .field { display: grid; gap: 8px; min-width: 0; }
#repair-evidence-file { width: 100%; min-width: 0; font: inherit; }
#repair-evidence-file::file-selector-button { height: var(--fld); margin-right: 10px; padding: 0 12px; border: 1px solid var(--line2); border-radius: var(--rc); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.repair-work .photo .meta { overflow-wrap: anywhere; }

.repair-result-fields { border: 0; padding: 0; margin: 0; min-width: 0; }
#repair-result-form .field { display: grid; gap: 8px; min-width: 0; }

#repair-followup-offer .btn { white-space: normal; height: auto; min-height: var(--fld); max-width: 100%; padding-top: 7px; padding-bottom: 7px; }

.order-pagination { margin: 14px 0; }

/* Search and account screens share the existing form/surface vocabulary. */
.field > label { display: block; font-size: 12.5px; font-weight: 500; color: var(--ink2); margin-bottom: 5px; }
.field input[type=date] { width: 100%; min-width: 0; min-height: var(--fld); padding: 0 9px; border: 1px solid var(--fieldLine); border-radius: var(--rc); background: var(--surface); }
.search-filters { margin-bottom: 16px; }
/* „Alle“ (Owner decision T23, P-06): the search field stays in view, the other filters fold. */
.search-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search-row input { flex: 1 1 180px; min-width: 0; }
.search-row .reset { font-size: 13px; color: var(--ink2); }
.search-row .err { flex-basis: 100%; color: var(--stop); font-size: 12.5px; }
.more-filters { border-top: 1px solid var(--line); }
.more-filters > summary { padding: 9px 14px; font-size: 13px; color: var(--ink2); cursor: pointer; }
.more-filters > summary:hover { color: var(--ink); }
.more-filters > summary .n { margin-left: 4px; font-family: var(--mono); font-size: 12px; background: var(--nav); color: var(--navInk); border-radius: 10px; padding: 1px 7px; }
.more-filters[open] > summary { border-bottom: 1px solid var(--line); }
.more-filters .form-actions { padding-top: 0; }
.settings-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.archive-box { margin-bottom: 14px; }
.archive-box + .settings-nav, .notice + .settings-nav { margin-top: 14px; }
.settings-nav a[aria-current=page] { background: var(--nav); color: var(--navInk); }
.settings-list { list-style: none; margin: 0; padding: 0; }
.settings-list > li { padding: 12px 14px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.settings-list > li:last-child { border-bottom: 0; }
.settings-facts { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(0, 2fr); gap: 10px 18px; margin: 0; }
.settings-facts dt { color: var(--ink2); }
.settings-facts dd { margin: 0; overflow-wrap: anywhere; }
.settings-card { display: block; color: inherit; text-decoration: none; padding: 18px; }
.settings-card:hover { border-color: var(--ink); }

/* The header remains an ordinary search form when JavaScript is unavailable. */
.search-shell { flex: 1 1 320px; max-width: 560px; min-width: 0; position: relative; }
.topbar .search-shell form.search { max-width: none; width: 100%; }
.topbar form.search input { min-width: 0; }
.search-submit { border: 0; background: transparent; cursor: pointer; display: flex; padding: 6px; }
.search-popup { position: absolute; z-index: 50; left: 0; top: calc(100% + 6px); width: min(640px, calc(100vw - 48px)); min-width: 100%; max-height: min(65vh, 600px); overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: 0 8px 24px #0002; }
.search-feedback, .search-group-title { padding: 9px 12px; color: var(--ink2); font-size: 12px; }
.search-group-title { background: var(--surface2); font-weight: 600; border-top: 1px solid var(--line); }
.search-option { display: block; padding: 9px 12px; text-decoration: none; color: var(--ink); overflow-wrap: anywhere; }
.search-option small { display: block; color: var(--ink2); }
.search-option:hover, .search-option[aria-selected=true] { background: var(--accBg); color: var(--accInk); }
@media (max-width: 600px) { .search-shell { flex-basis: 100%; max-width: none; } .search-popup { width: 100%; max-height: 60vh; } }

/* Übersicht: KPI cards with a server-rendered sparkline (no script). */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin: 14px 0; }
.kpi .body { display: grid; gap: 6px; }
.kpi-value strong { font-size: 30px; font-weight: 600; line-height: 1; }
.spark { width: 100%; height: 60px; color: var(--ink); display: block; }
.ctx-section ul.plain { list-style: none; margin: 4px 0 8px; padding: 0; font-size: 12.5px; }

/* Narrow screens (bench phone/tablet). The approved visual system describes the desktop
   shell only; these rules change no content: the navigation stops stretching to the
   viewport height, the order context moves below the work instead of disappearing, and
   the work list shows every cell of a row stacked instead of scrolling sideways. */
@media (max-width: 1100px) {
  .context { display: block; grid-column: 2; width: auto; position: static; height: auto; overflow: visible; border-left: 0; border-top: 1px solid var(--line); }
  .ctx-toggle { display: none; }
  .shell.ctx-collapsed .context .ctx-body { display: flex; }
  .shell.ctx-collapsed .context .ctx-head span { display: inline; }
  .shell.ctx-collapsed .context .ctx-head { writing-mode: horizontal-tb; padding: 10px 12px; }
}
@media (max-width: 900px) {
  .shell { display: block; min-height: 0; }
  .sidebar .sidebar-foot { display: none; }
  .sidebar .brand { padding: 10px 16px; }
  .sidebar nav { padding: 6px 8px 8px; }
  .sidebar nav a { padding: 7px 10px; }
  /* UX-1 (Owner, 2026-10-03): on narrow screens the navigation opens from one "Menü" button. */
  .sidebar.nav-collapsible nav { display: none; }
  .sidebar.nav-collapsible.nav-open nav { display: flex; }
  /* Owner decision T15 (2026-10-05, P-03): one dark bar. Search and account sit behind it
     and appear together with the menu, whose entries stand one under another; the path of an
     order is one line; the tabs' one sideways-scrolling row is the base rule (E-20). Without
     script nothing is hidden. */
  .sidebar.nav-collapsible:not(.nav-open) ~ .main > .topbar { display: none; }
  .sidebar.nav-collapsible nav { flex-direction: column; flex-wrap: nowrap; }
  .sidebar.nav-collapsible nav a, .sidebar.nav-collapsible .nav-group > summary { padding: 11px 12px; }
  .sidebar.nav-collapsible .nav-group nav { padding: 0 0 4px; }
  .sidebar.nav-collapsible .nav-group nav a { padding: 10px 12px 10px 40px; }
  .nav-search { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; width: 38px; height: 32px; background: transparent; color: var(--navInk); border: 1px solid var(--navLine); border-radius: var(--rc); cursor: pointer; }
  .nav-search + .nav-toggle { margin-left: 8px; }
  .progress-path { display: none; }
  .progress-line { display: block; }
  .progress-line .bar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; }
  .progress-line .bar i { height: 4px; border-radius: 2px; background: var(--line2); }
  .progress-line .bar i.done { background: var(--ink); }
  .progress-line .bar i.current { background: var(--acc); }
  .progress-line .bar i.current.attention { background: var(--warn); }
  .progress-line .t { margin-top: 6px; font-size: 13px; color: var(--ink2); }
  .progress-line .t b { color: var(--ink); }
  /* Item lists: three columns have no room here, and stacked header cells said nothing — each
     item is a small block, its two answers named in words. */
  .items .h { display: none; }
  .items > div { min-height: 0; padding: 3px 14px; border-bottom: 0; }
  .items > div:nth-child(3n+1) { padding-top: 10px; font-weight: 600; }
  .items > div:nth-child(3n+1) .role { font-weight: 400; }
  .items > div:nth-child(3n+2)::before { content: "Laut Anmeldung"; color: var(--ink3); font-size: 12px; }
  .items > div:nth-child(3n)::before { content: "Eingang"; color: var(--ink3); font-size: 12px; }
  .items > div:nth-child(3n) { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .auftrag-head .head-actions { display: contents; }
  .auftrag-head .nr { flex: 1 1 auto; }
  .auftrag-head .head-actions > .menu { order: 1; }
  .auftrag-head .head-actions > form, .auftrag-head .head-actions > a.btn { order: 3; flex: 1 1 100%; }
  .auftrag-head .head-actions > form .btn, .auftrag-head .head-actions > a.btn { width: 100%; height: 44px; }
  .auftrag-head > .badge, .auftrag-head > .chip { order: 2; }
  /* The settings group takes a row of its own; its sub-options wrap beneath it. */
  .sidebar .nav-group { flex: 1 1 100%; }
  .nav-group > summary { padding: 7px 10px; }
  .sidebar .nav-group nav { padding: 0 0 2px 28px; }
  .sidebar .nav-group nav a { padding: 8px 10px; }
  .nav-toggle { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; background: transparent; color: var(--navInk); border: 1px solid var(--navLine); border-radius: var(--rc); padding: 5px 10px; font: inherit; font-size: 13px; cursor: pointer; }
  .sidebar .brand .env { margin-left: 8px; }
  /* Label rows had four minimum-width columns and widened the whole order page on phones. */
  .labels > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  /* Two columns leave no room for one line: the next step must stay readable. */
  .facts .v { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
}
@media (max-width: 600px) {
  table.worklist.stack-rows thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.worklist.stack-rows, table.worklist.stack-rows tbody, table.worklist.stack-rows tr, table.worklist.stack-rows td { display: block; }
  table.worklist.stack-rows tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.worklist.stack-rows tr:last-child { border-bottom: 0; }
  table.worklist.stack-rows td { height: auto; padding: 2px 14px; border-bottom: 0; }
  table.worklist.stack-rows td[data-label]::before { content: attr(data-label) ": "; color: var(--ink3); font-size: 12px; }
  /* Owner decision T20 (2026-10-05, P-04): on a phone a row of the work list is a card of three
     lines — the task, then order · customer · device, then who and since when — instead of five
     stacked cells. The stage under the number repeats the task and is left out here. */
  table.worklist.cards tr { padding: 10px 14px; }
  table.worklist.cards td { padding: 0; }
  table.worklist.cards td:nth-child(n+2) { display: inline; color: var(--ink2); font-size: 13px; }
  table.worklist.cards td:nth-child(n+2) .sub, table.worklist.cards td.since > div { display: inline; font-size: 13px; }
  table.worklist.cards td:nth-child(2) .sub, table.worklist.cards td.since time { display: none; }
  table.worklist.cards td:nth-child(3)::before, table.worklist.cards td:nth-child(3) .sub::before, table.worklist.cards td.since::before { content: " · "; }
  table.worklist.cards td:nth-child(4)::before { content: "\A"; white-space: pre; }
  table.worklist.cards td[colspan] { display: block; }
}
.chip.age-warn { background: var(--warnBg); border-color: var(--warnLine); color: var(--warn); }
.chip.age-alert { background: var(--stopBg); border-color: var(--stopLine); color: var(--stop); }
/* Access editor (Owner, 2026-10-03): roles and rights as toggle buttons. */
.toggle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.toggle-grid.small { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.toggle { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line2); border-radius: var(--rc); padding: 10px 12px; cursor: pointer; background: var(--surface); }
.toggle:hover { border-color: var(--ink); }
.toggle input { margin-top: 3px; accent-color: var(--ink); }
.toggle:has(input:checked) { border-color: var(--ink); background: var(--accBg); box-shadow: inset 3px 0 0 var(--acc); }
.toggle.covered { opacity: .85; cursor: default; }
.toggle-body { display: grid; gap: 2px; min-width: 0; }
#wirksame-rechte > summary, #verlauf > summary { cursor: pointer; }
/* Rights as buttons side by side, grouped by area; pressed = active; hover/focus explains. */
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; display: inline-flex; align-items: center; min-height: 36px; padding: 6px 12px; border: 1px solid var(--line2); border-radius: 18px; background: var(--surface); cursor: pointer; font-weight: 500; user-select: none; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill:hover { border-color: var(--ink); }
.pill:has(input:checked) { background: var(--acc); border-color: var(--acc); color: var(--accOn); font-weight: 600; }
.pill.covered { cursor: default; background: var(--accBg); border: 1px dashed var(--accLine); color: var(--ink); }
.pill:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.pill-tip { display: none; position: absolute; left: 0; top: calc(100% + 6px); z-index: 20; width: max-content; max-width: min(340px, 80vw); padding: 8px 10px; border-radius: var(--rc); background: var(--nav); color: var(--navInk); font-size: 12.5px; font-weight: 400; line-height: 1.4; box-shadow: 0 6px 18px oklch(0 0 0 / .25); pointer-events: none; white-space: normal; }
.pill:hover .pill-tip, .pill:focus-within .pill-tip { display: block; }
.pill-via { display: block; margin-top: 4px; color: var(--acc); font-weight: 600; }
.pill-via:empty { display: none; }
.subhead { margin: 4px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink3); font-weight: 600; }

/* Order actions (Owner 2026-10-04): a menu at the top right of the order; each entry opens its own
   window. Without script the menu still opens and a chosen window shows as a panel (:target). */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary { border-color: var(--ink); background: var(--accBg); }
.menu[open] > summary svg:last-child { transform: rotate(180deg); }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 300px; max-width: calc(100vw - 32px); padding: 6px; background: var(--surface); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: 0 12px 32px oklch(0.215 0.010 255 / .16); }
.menu-list ul { list-style: none; margin: 0; padding: 0; }
.menu-list ul + ul { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.menu-list a, .menu-list .off { display: block; padding: 7px 10px; border-radius: var(--rc); color: var(--ink); text-decoration: none; }
.menu-list a:hover, .menu-list a:focus-visible { background: var(--accBg); outline: none; }
.menu-list a.danger { color: var(--stop); }
.menu-list a.danger:hover, .menu-list a.danger:focus-visible { background: var(--stopBg); }
.menu-list .off { color: var(--ink3); cursor: default; }
.menu-list .off small { display: block; font-size: 12px; line-height: 1.35; margin-top: 2px; }
.menu-list .menu-head { padding: 4px 10px 2px; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink3); font-weight: 600; }
dialog.dialog { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid var(--line2); border-radius: var(--r); background: var(--surface); color: var(--ink); box-shadow: 0 24px 64px oklch(0.215 0.010 255 / .28); overflow: auto; }
dialog.dialog::backdrop { background: oklch(0.215 0.010 255 / .38); }
html:not(.js) dialog.dialog:target, html:not(.js) dialog.dialog[data-show] { display: block; position: fixed; inset: 0; margin: auto; height: fit-content; z-index: 50; }
.dialog > form > header, .dialog > header { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface2); }
.dialog > form > header h2, .dialog > header h2 { margin: 0; font-size: 15px; font-weight: 600; }
.dialog .dialog-x { margin-left: auto; display: inline-flex; padding: 6px; border-radius: var(--rc); color: var(--ink2); }
.dialog .dialog-x:hover { background: var(--surface3); color: var(--ink); }
.dialog .body { padding: 14px 16px; }
.dialog .body p { margin: 0; }
.dialog .body textarea, .dialog .body input[type=text], .dialog .body input[type=password] { width: 100%; }
/* D59-9: „Kunde ändern“ — the found customers as a list of choices inside the window, the
   chosen one marked like a chosen search suggestion; the sentence above the button says who the
   order goes to. */
.dialog .body input[type=search] { width: 100%; }
.kunde-wahl-liste { list-style: none; margin: 6px 0 0; padding: 0; max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--rc); }
.kunde-wahl-liste:empty { display: none; }
.kunde-wahl-option { display: block; width: 100%; padding: 9px 12px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); font: inherit; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.kunde-wahl-liste li:first-child .kunde-wahl-option { border-top: 0; }
.kunde-wahl-option:hover, .kunde-wahl-option:focus-visible { background: var(--accBg); color: var(--accInk); outline: none; }
.kunde-wahl-option[aria-pressed=true] { background: var(--accBg); color: var(--accInk); font-weight: 600; box-shadow: inset 3px 0 0 var(--acc); }
.dialog .body p.kunde-wechsel { padding: 8px 10px; border-left: 3px solid var(--acc); background: var(--accBg); }
/* The buttons wrap rather than run out past the window's edge on a phone, where nothing scrolls
   them back into view (review D58: the leave question's two long labels at 320–375 px). */
.dialog > form > footer, .dialog > footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); }
/* Owner 2026-10-25: the photo window (foto-gross.js) is as wide as its picture and never wider
   than the screen, so a phone never scrolls sideways; the picture keeps its proportions within
   the screen less the window's frame (16 px padding, 2 px border, the head of about 50 px). The
   head is one line, so it never takes more: a long name (a customer's „WhatsApp Image … (1).jpeg“
   on a phone) is cut with „…“ rather than wrapped onto a second line that would push the bottom
   of a tall picture out of the window (review 2026-10-25); „ד stays at the top. */
dialog.dialog.foto-gross { width: fit-content; min-width: min(320px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
.foto-gross > header { position: sticky; top: 0; }
.foto-gross > header h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foto-gross button.dialog-x { border: 0; background: transparent; cursor: pointer; }
.foto-gross-bild { display: flex; align-items: center; justify-content: center; padding: 8px; }
.foto-gross-bild img { display: block; max-width: calc(100vw - 50px); max-height: calc(100vh - 100px); max-height: calc(100dvh - 100px); }
.foto-gross-text { margin: 0; padding: 24px 8px; }

/* Plan P10b, approved UX-039: the complaint review compares then (QUELLE) and now (AKTUELL) side
   by side, stacked on narrow screens; the five results are rows with meaning, condition and
   consequence. */
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(430px, 100%), 1fr)); gap: 16px; }
.compare .k, .p-block .k, .rek-form .k { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--ink3); font-weight: 600; }
.result-rows { display: grid; gap: 8px; }
.result-row { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; cursor: pointer; }
.result-row > span { display: grid; gap: 2px; }
.result-row:has(input:checked) { border-color: var(--acc); background: var(--surface2); }
/* UX-039: the chosen row's edge says the kind — warranty green, exclusion red, clarification amber. */
.result-row.r-GARANTIEFALL:has(input:checked) { border-color: var(--ok); }
.result-row.r-AUSGESCHLOSSEN:has(input:checked) { border-color: var(--stop); }
.result-row.r-KLAERUNG:has(input:checked) { border-color: var(--warn); }
.result-row.blocked { opacity: .75; cursor: not-allowed; }
.stop-text { color: var(--stop); }
.warn-text { color: var(--warn); }

/* Plan P9 §5a (D43): „Auch in dieses Paket“ in the DHL window — one row per order of the
   customer, stacked on every width; a greyed row says why, a ticked row opens what goes back
   with it (CSS only, so the window works without script). */
fieldset.paket { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 6px; }
fieldset.paket legend { padding: 0; margin-bottom: 4px; font-weight: 600; }
.paket-wahl { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.paket-wahl > li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; padding: 8px 10px; border: 1px solid var(--line2); border-radius: var(--rc); min-width: 0; overflow-wrap: anywhere; }
.paket-wahl > li.off { color: var(--ink3); background: var(--surface2); }
.paket-wahl > li > small, .paket-wahl > li > .notice { flex-basis: 100%; }
.paket-wahl > li > small { font-size: 12px; line-height: 1.35; }
.paket-wahl > li > input[name=mit] { margin: 0; }
.paket-wahl .paket-kopf { flex: 1 1 0; min-width: 0; }
.paket-wahl .paket-teile { display: none; flex-basis: 100%; gap: 6px; margin-top: 4px; }
.paket-wahl > li > input[name=mit]:checked ~ .paket-teile { display: grid; }
.paket-wahl > li:has(> input[name=mit]:checked) { border-color: var(--acc); }
