/* Kalmora Desk: eigenes Designsystem, von Hand geschrieben (kein Build, keine fremden Adressen).
   Tokens oben, dann Grundlagen, dann Bausteine, dann Seiten. Hell und dunkel ueber light-dark(). Orange nur als Akzent. */

@font-face {
  font-family: "Inter";
  src: url("/static/fonts/Inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --bg: light-dark(#f5f4f1, #101113);
  --surface: light-dark(#ffffff, #17191c);
  --surface-2: light-dark(#faf9f7, #1c1f23);
  --surface-3: light-dark(#f0eee9, #23272c);
  --line: light-dark(#e6e3dc, #2a2e34);
  --line-strong: light-dark(#d3cfc5, #3a3f47);
  --text: light-dark(#1d1f23, #eceef0);
  --text-2: light-dark(#4a4e55, #b9bec5);
  --muted: light-dark(#6f747c, #8d939c);

  --accent: light-dark(#ff6b2b, #ff7b3f);
  --accent-ink: light-dark(#b5420c, #ff9b70);
  --accent-soft: light-dark(#fff0e8, #2b1b12);
  --ink: light-dark(#1d1f23, #eceef0);
  --on-ink: light-dark(#ffffff, #101113);

  --green: light-dark(#17803f, #5ac98f);
  --green-solid: light-dark(#1b8a4b, #2f9d62);
  --green-soft: light-dark(#e5f4ea, #12261c);
  --amber: light-dark(#9a5b00, #e8b04f);
  --amber-soft: light-dark(#fff2d6, #2a2112);
  --red: light-dark(#bf3030, #f27c7c);
  --red-soft: light-dark(#fce8e8, #2d1619);
  --blue: light-dark(#2459c9, #86a9f5);
  --blue-soft: light-dark(#e7eefc, #17213b);
  --gray-soft: light-dark(#edeae4, #262a30);

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px light-dark(rgb(20 20 20 / 5%), rgb(0 0 0 / 30%)), 0 1px 1px light-dark(rgb(20 20 20 / 3%), rgb(0 0 0 / 20%));
  --sidebar-w: 284px;
  --focus: 0 0 0 3px light-dark(rgb(255 107 43 / 28%), rgb(255 123 63 / 35%));
}

html[data-theme="light"] { color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--font);
  font-feature-settings: "cv11", "ss03";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.mb-10 { margin-bottom: 10px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.mono { font-family: var(--mono); font-size: 0.92em; }
.nowrap { white-space: nowrap; }

.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon--sm { width: 15px; height: 15px; }
.icon--lg { width: 22px; height: 22px; }

/* ---------------------------------------------------------------- Rahmen */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column;
  padding: 22px 14px 16px; border-right: 1px solid var(--line); background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 22px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 17px; letter-spacing: -0.02em;
}
.brand-name { font-weight: 650; font-size: 16px; letter-spacing: -0.01em; line-height: 1.1; }
.brand-name small { display: block; margin-top: 2px; font-weight: 500; font-size: 12px; color: var(--muted); letter-spacing: 0; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { padding: 18px 12px 6px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.nav-item {
  display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 7px 10px; border-radius: 10px; color: var(--text-2);
  font-weight: 500; font-size: 14.5px; white-space: nowrap; border: 1px solid transparent;
}
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.is-active { background: var(--surface); border-color: var(--line); color: var(--text); box-shadow: var(--shadow); }
.nav-item.is-active .icon { color: var(--accent); }
.nav-item .count { margin-left: auto; font-size: 12.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.nav-item .count--warn { color: var(--amber); background: var(--amber-soft); border-radius: 999px; padding: 1px 8px; }
.nav-spacer { flex: 1; }
.nav-foot { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--line); padding-top: 12px; }
.nav-foot form { margin: 0; }
.nav-foot button.nav-item { width: 100%; background: none; cursor: pointer; text-align: left; }

.main { width: 100%; max-width: 1280px; margin: 0 auto; padding: 30px 36px 72px; }
.tabbar { display: none; }

/* ---------------------------------------------------------------- Seitenkopf */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; }
.page-head .sub { margin-top: 4px; color: var(--muted); font-size: 14px; }

.stand { display: flex; align-items: center; gap: 8px; margin: 0 0 18px; font-size: 13px; color: var(--muted); }
.stand .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-solid); flex: none; }
.card + .stand, .moreitems + .stand { margin-top: 16px; }
.stand--alt {
  padding: 11px 14px; border-radius: var(--radius-sm); background: var(--amber-soft); color: var(--amber); font-weight: 500; line-height: 1.4;
}
.stand--alt .dot { background: var(--amber); }

.banner { display: flex; gap: 11px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: 14px; line-height: 1.45; }
.banner .icon { margin-top: 2px; }
.banner--warn { background: var(--amber-soft); color: var(--amber); }
.banner--rot { background: var(--red-soft); color: var(--red); }
.banner--info { background: var(--blue-soft); color: var(--blue); }
.banner--ok { background: var(--green-soft); color: var(--green); }
.banner form { margin-left: auto; }
.banner b { font-weight: 650; }

/* ---------------------------------------------------------------- Bausteine */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 13px; font-weight: 650; letter-spacing: 0.01em; color: var(--text); display: flex; align-items: center; gap: 8px; }
.card-head h2 .icon { color: var(--muted); }
.card-body { padding: 16px 18px; }
.card-body--flush { padding: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 550;
  line-height: 1; white-space: nowrap; background: var(--gray-soft); color: var(--text-2);
}
.badge .icon { width: 12px; height: 12px; stroke-width: 2.2; }
.badge--gruen { background: var(--green-soft); color: var(--green); }
.badge--gelb { background: var(--amber-soft); color: var(--amber); }
.badge--rot { background: var(--red-soft); color: var(--red); }
.badge--blau { background: var(--blue-soft); color: var(--blue); }
.badge--grau { background: var(--gray-soft); color: var(--text-2); }
.badge--mono { font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; }
.badge--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); color: var(--text-2); }
.pdot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 15px; border-radius: 10px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-weight: 550; font-size: 14px; cursor: pointer; line-height: 1;
  transition: background 0.12s, border-color 0.12s, transform 0.05s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.btn--ink { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.btn--ink:hover { background: var(--ink); filter: brightness(1.12); }
.btn--ok { background: var(--green-solid); color: #fff; border-color: var(--green-solid); }
.btn--ok:hover { background: var(--green-solid); filter: brightness(1.08); }
.btn--warn { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--line-strong)); }
.btn--warn:hover { background: var(--red-soft); }
.btn--ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-3); }
.btn--sm { min-height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input, .textarea {
  width: 100%; min-height: 44px; padding: 10px 13px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--text); font: inherit; font-size: 15px;
}
.textarea { min-height: 110px; line-height: 1.55; resize: vertical; }
.input:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.hint { font-size: 13px; color: var(--muted); line-height: 1.45; }

.avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 13.5px; font-weight: 650; flex: none;
  letter-spacing: 0.01em; user-select: none;
}
.avatar--sm { width: 30px; height: 30px; font-size: 11.5px; }
.avatar--lg { width: 48px; height: 48px; font-size: 16px; }
.av0 { background: light-dark(#e8eefc, #1a2442); color: light-dark(#2f4fa0, #9db6f2); }
.av1 { background: light-dark(#e6f3ec, #15291f); color: light-dark(#23744a, #77d1a1); }
.av2 { background: light-dark(#fdeee3, #2f1e14); color: light-dark(#a9531d, #f0a574); }
.av3 { background: light-dark(#f3e8f8, #28193a); color: light-dark(#7a3f96, #c79be0); }
.av4 { background: light-dark(#e3f3f5, #12292c); color: light-dark(#21717c, #75cbd6); }
.av5 { background: light-dark(#f7ecd9, #2b2312); color: light-dark(#8c6212, #e3bd6a); }

.empty { padding: 56px 24px; text-align: center; color: var(--muted); }
.empty .icon { margin: 0 auto 14px; width: 30px; height: 30px; color: var(--line-strong); }
.empty h2 { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty p { max-width: 460px; margin: 0 auto; line-height: 1.55; }

/* ---------------------------------------------------------------- Filter und Suche */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.search { position: relative; flex: 1 1 280px; max-width: 520px; }
.toolbar-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; width: 100%; }
.toolbar-row .sortsel { margin-left: auto; }
.search .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 38px; min-height: 40px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: transparent; font-size: 13.5px; font-weight: 550; color: var(--text-2); cursor: pointer;
}
.chip:hover { background: var(--surface-3); }
.chip.is-active { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.chip .n { font-size: 12px; opacity: 0.7; font-variant-numeric: tabular-nums; }
.select {
  min-height: 34px; padding: 0 28px 0 12px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; color: var(--text-2);
  font: inherit; font-size: 13.5px; font-weight: 550;
}

.kpis { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); margin-left: auto; flex-wrap: wrap; }
.kpi { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.kpi b { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Ticketliste */
.list { overflow: hidden; }
.row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); align-items: start; position: relative; }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--surface-2); }
.row .stretch { position: absolute; inset: 0; z-index: 1; }
.row .stretch:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); border-radius: 0; }
.row-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row-top { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.row-name { font-weight: 650; white-space: nowrap; }
.row-subject { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.row-preview { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.row-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; padding-top: 2px; }
.row.is-done { opacity: 0.62; }
.rate-mark { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.rate-mark--passt { color: var(--green); }
.rate-mark--angepasst { color: var(--blue); }
.rate-mark--falsch { color: var(--red); }
.track { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 550; color: var(--text-2); }
.track .pdot { width: 8px; height: 8px; }
.track--gruen .pdot { color: var(--green-solid); }
.track--blau .pdot { color: var(--blue); }
.track--rot .pdot { color: var(--red); }
.track--gelb .pdot { color: var(--amber); }
.track--grau .pdot { color: var(--muted); }

/* ---------------------------------------------------------------- Ticket */
.crumb { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; color: var(--muted); font-weight: 550; font-size: 14px; }
.crumb:hover { color: var(--text); }
.ticket-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; }
.ticket-head .who { flex: 1 1 320px; min-width: 0; display: flex; gap: 14px; align-items: center; }
.ticket-head h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.015em; line-height: 1.25; overflow-wrap: anywhere; }
.ticket-head .subj { color: var(--text-2); margin-top: 3px; overflow-wrap: anywhere; }
.ticket-head .badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ticket-grid { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 24px; align-items: start; }
.col-main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.col-main > .card + .card { margin-top: 0; }
.col-side { display: flex; flex-direction: column; gap: 16px; }
.col-side > .card + .card { margin-top: 0; }

.draft-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pruef { margin: 0 0 14px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; line-height: 1.5; }
.pruef--gelb { background: var(--amber-soft); color: var(--amber); }
.pruef--rot { background: var(--red-soft); color: var(--red); }
.pruef--gruen { background: var(--green-soft); color: var(--green); }
.pruef--grau { background: var(--gray-soft); color: var(--text-2); }
.pruef b { font-weight: 650; }
.pruef ul { margin: 6px 0 0; padding-left: 18px; }
.pruef li { margin: 2px 0; }
.geld { margin: 0 0 14px; border: 1px solid color-mix(in srgb, var(--amber) 45%, var(--line)); border-radius: var(--radius-sm); overflow: hidden; }
.geld-head { display: flex; align-items: center; gap: 8px; padding: 9px 13px; background: var(--amber-soft); color: var(--amber); font-weight: 650; font-size: 13.5px; }
.geld blockquote { margin: 0; padding: 10px 13px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.5; }
.geld blockquote small { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.editor-wrap { position: relative; }
.editor {
  width: 100%; min-height: 200px; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface-2);
  color: var(--text); font: 400 15.5px/1.65 var(--font); resize: vertical; display: block;
}
.editor:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); background: var(--surface); }
.editor-info { display: flex; justify-content: space-between; gap: 12px; margin: 8px 2px 14px; font-size: 12.5px; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.actions .grow { flex: 1; }
.falsch-panel { margin-top: 14px; padding: 16px; border: 1px solid color-mix(in srgb, var(--red) 35%, var(--line)); border-radius: var(--radius-sm); background: var(--surface-2); }
.falsch-panel h3 { font-size: 14px; font-weight: 650; margin-bottom: 10px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.check { position: relative; }
.check input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.check span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 14px; font-weight: 550; color: var(--text-2); background: var(--surface); }
.check input:checked + span { background: var(--red-soft); border-color: var(--red); color: var(--red); }
.check input:focus-visible + span { box-shadow: var(--focus); }
.rated { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 14px; font-weight: 550; }
.rated--passt { background: var(--green-soft); color: var(--green); }
.rated--angepasst { background: var(--blue-soft); color: var(--blue); }
.rated--falsch { background: var(--red-soft); color: var(--red); }
.rated small { font-weight: 450; opacity: 0.85; }
.versions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--muted); }
.versions a { padding: 3px 9px; border-radius: 999px; background: var(--gray-soft); color: var(--text-2); font-weight: 550; }
.versions .cur { background: var(--ink); color: var(--on-ink); }
.kein-entwurf { display: flex; gap: 14px; align-items: flex-start; color: var(--text-2); }
.kein-entwurf .icon { color: var(--muted); margin-top: 2px; }

.thread { display: flex; flex-direction: column; gap: 12px; }
.msg { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.msg-head { display: flex; align-items: center; gap: 11px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.msg-who { min-width: 0; flex: 1; }
.msg-who b { font-weight: 650; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-who span { font-size: 12.5px; color: var(--muted); }
.msg-body { padding: 16px 18px; }
.mailtext { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.65; color: var(--text); }
.mailtext a.ext { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; word-break: break-all; }
.ext-host { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; background: var(--gray-soft); color: var(--text-2); font-size: 11.5px; font-weight: 600; vertical-align: 1px; white-space: nowrap; }
.blockiert-bild { color: var(--muted); font-style: italic; }
.msg--aus .msg-head { background: var(--blue-soft); }
.quote summary { cursor: pointer; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--muted); list-style: none; display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--gray-soft); }
.quote summary::-webkit-details-marker { display: none; }
.quote[open] summary { margin-bottom: 10px; }
.quote .mailtext { color: var(--muted); font-size: 14px; border-left: 3px solid var(--line-strong); padding-left: 14px; }
.thread-note { font-size: 13px; color: var(--muted); padding: 2px 4px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 14px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; font-weight: 500; }
.kv dd.left { text-align: left; }
.side-block + .side-block { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.items { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.items li { display: flex; gap: 8px; }
.items .q { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 22px; }
.ext-btn { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 14px; }
.log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }
.log b { color: var(--text-2); font-weight: 600; }
.sticky-actions { display: none; }

/* ---------------------------------------------------------------- Quarantaene, Laeufe */
.qrow { padding: 16px 18px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.qrow:last-child { border-bottom: 0; }
.score { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--gray-soft); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; text-align: center; }
.score small { display: block; font-size: 10px; font-weight: 600; color: var(--muted); margin-top: 2px; letter-spacing: 0.04em; }
.qrow h3 { font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.qrow .from { color: var(--muted); font-size: 13.5px; margin-top: 2px; overflow-wrap: anywhere; }
.qrow .why { margin: 8px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--text-2); }
.qrow .why li { margin: 1px 0; }
.qrow .prev { margin-top: 8px; font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.qrow.is-spam-ok { opacity: 0.7; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding: 11px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.table td { padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { font-variant-numeric: tabular-nums; text-align: right; }
details.befunde summary { cursor: pointer; font-weight: 550; color: var(--text-2); }
details.befunde ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); font-size: 13.5px; }
.exit { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 24px; padding: 0 8px; border-radius: 8px; font-family: var(--mono); font-weight: 700; font-size: 13px; }
.exit--0 { background: var(--green-soft); color: var(--green); }
.exit--4 { background: var(--amber-soft); color: var(--amber); }
.exit--2, .exit--3, .exit--5 { background: var(--red-soft); color: var(--red); }
.exit--u { background: var(--gray-soft); color: var(--muted); }

/* ---------------------------------------------------------------- Anmeldung */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 408px; }
.auth-card .brand { justify-content: center; padding-bottom: 26px; }
.auth-card .card { padding: 28px 28px 24px; }
.auth-card h1 { font-size: 20px; font-weight: 650; letter-spacing: -0.015em; margin-bottom: 4px; }
.auth-card .lead { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
.auth-card .btn { width: 100%; min-height: 46px; margin-top: 4px; }
.auth-foot { margin-top: 16px; text-align: center; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.err { padding: 10px 13px; border-radius: 10px; background: var(--red-soft); color: var(--red); font-size: 14px; margin-bottom: 16px; font-weight: 500; }

.moreitems { display: flex; flex-direction: column; }
.moreitems .nav-item { padding: 14px 16px; border-radius: 0; border: 0; border-bottom: 1px solid var(--line); min-height: 54px; }
.moreitems form { margin: 0; }
.moreitems button.nav-item { width: 100%; background: none; cursor: pointer; text-align: left; border-bottom: 1px solid var(--line); }
.moreitems form:last-child button.nav-item { border-bottom: 0; }

/* ---------------------------------------------------------------- Handy */
@media (max-width: 860px) {
  .app { display: block; }
  .sidebar { display: none; }
  .main { padding: 18px 16px calc(92px + env(safe-area-inset-bottom)); }
  .page-head h1 { font-size: 22px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-top: 1px solid var(--line);
  }
  .tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px 5px; border-radius: 10px; font-size: 10.5px; font-weight: 600; color: var(--muted); min-height: 52px; white-space: nowrap; justify-content: center; }
  .tab .icon { width: 22px; height: 22px; }
  .tab.is-active { color: var(--text); }
  .tab.is-active .icon { color: var(--accent); }
  .tab .count { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; background: var(--ink); color: var(--on-ink); font-size: 10.5px; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
  .tab .count--warn { background: var(--amber); color: #fff; }
  .toolbar { gap: 10px; }
  .search { flex-basis: 100%; max-width: none; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; flex-basis: 100%; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .kpis { margin-left: 0; }
  .row { grid-template-columns: 40px minmax(0, 1fr); padding: 14px 14px; gap: 12px; }
  .row-meta { grid-column: 2; flex-direction: row; align-items: center; gap: 10px; padding-top: 0; justify-content: flex-start; margin-top: -2px; }
  .row-top { flex-direction: column; gap: 1px; }
  .ticket-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .col-side { order: 2; }
  .ticket-head h1 { font-size: 20px; }
  .editor { min-height: 260px; font-size: 16px; }
  .btn { min-height: 46px; }
  .btn--sm { min-height: 38px; }
  .actions .btn { flex: 1 1 auto; }
  .qrow { grid-template-columns: 48px minmax(0, 1fr); }
  .qrow .qact { grid-column: 2; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .table td { padding: 3px 0; border: 0; }
  .table td[data-l]::before { content: attr(data-l) ": "; color: var(--muted); font-size: 12.5px; }
  .table .num { text-align: left; }
  .auth-card .card { padding: 24px 20px 20px; }
}

@media (min-width: 861px) and (max-width: 1180px) {
  .ticket-grid { grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; }
  .main { padding: 26px 24px 64px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .sidebar, .tabbar { display: none; } }

/* Bestell- und Sendungsdaten (Schema 2) */
.items--preise li { align-items: flex-start; }
.items--preise .item-titel { flex: 1; min-width: 0; }
.items--preise .item-sub { display: block; font-size: 12.5px; }
.item-preis { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; padding-left: 10px; }
.items li .item-preis { margin-left: auto; }
.item-entfernt .item-titel { text-decoration: line-through; color: var(--muted); }
.card-body h3 { font-size: 13px; margin: 14px 0 6px; color: var(--text-2); text-transform: none; letter-spacing: 0; font-weight: 600; }
.adresse { margin: 0; font-size: 14px; line-height: 1.5; }
details.stationen summary { cursor: pointer; font-weight: 550; color: var(--text-2); }
.station-liste { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--text-2); display: flex; flex-direction: column; gap: 6px; }

.mb-16 { margin-bottom: 16px; }
.waechter-titel { margin: 0 0 6px; }
