:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f0f3f6;
  --border: #dde3e9;
  --text: #17202a;
  --muted: #5d6b7a;
  --accent: #e8590c;
  --accent-hover: #c94b08;
  --accent-soft: #fff0e6;
  --danger: #c92a2a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);

  --st-eingegangen: #1971c2;
  --st-rueckfrage: #e67700;
  --st-angenommen: #0c8599;
  --st-abgelehnt: #c92a2a;
  --st-in_druck: #7048e8;
  --st-abgeschlossen: #2f9e44;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11151a;
    --surface: #1a2027;
    --surface-2: #222a33;
    --border: #2e3843;
    --text: #e6ebf0;
    --muted: #94a1b0;
    --accent: #ff7a2f;
    --accent-hover: #ff914f;
    --accent-soft: #3a2416;
    --danger: #ff6b6b;
    --shadow: none;

    --st-eingegangen: #4dabf7;
    --st-rueckfrage: #ffa94d;
    --st-angenommen: #3bc9db;
    --st-abgelehnt: #ff6b6b;
    --st-in_druck: #9775fa;
    --st-abgeschlossen: #51cf66;

    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #11151a;
    --surface: #1a2027;
    --surface-2: #222a33;
    --border: #2e3843;
    --text: #e6ebf0;
    --muted: #94a1b0;
    --accent: #ff7a2f;
    --accent-hover: #ff914f;
    --accent-soft: #3a2416;
    --danger: #ff6b6b;
    --shadow: none;

    --st-eingegangen: #4dabf7;
    --st-rueckfrage: #ffa94d;
    --st-angenommen: #3bc9db;
    --st-abgelehnt: #ff6b6b;
    --st-in_druck: #9775fa;
    --st-abgeschlossen: #51cf66;

    color-scheme: dark;
  }

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  /* iPhone quer: Inhalt nicht unter Kamera-Aussparung/runde Ecken (viewport-fit=cover) */
  padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right);
}

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

.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1000px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap;
}
.brand { font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.brand .logo { font-size: 1.4rem; }
.tabs { display: flex; gap: 4px; margin-left: auto; }
.tab {
  background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600;
  padding: 8px 14px; border-radius: 8px; cursor: pointer;
}
.tab:hover { background: var(--surface-2); color: var(--text); }
.tab.active { background: var(--accent-soft); color: var(--accent); }

main { max-width: 1000px; margin: 0 auto; padding: 24px 16px 64px; }
main.narrow { max-width: 720px; }

h1 { font-size: 1.6rem; margin: 0 0 4px; letter-spacing: -.02em; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
.subtitle { color: var(--muted); margin: 0 0 24px; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
}
.stack > * + * { margin-top: 12px; }
.section { margin-top: 32px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.hidden { display: none !important; }

/* Formulare */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; width: 100%;
}
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; cursor: pointer; }
.check input { width: auto; }

.material-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.material-picker label { cursor: pointer; position: relative; }
.material-picker input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; margin: 0; padding: 0; }
.material-picker span {
  display: inline-block; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border); font-weight: 600; font-size: .9rem; background: var(--surface);
}
.material-picker input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.material-picker input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.qty { display: flex; align-items: stretch; }
.qty button { width: 44px; border-radius: 8px 0 0 8px; padding: 0; }
.qty button:last-child { border-radius: 0 8px 8px 0; }
.qty input { border-radius: 0; text-align: center; border-left: 0; border-right: 0; }
.qty .qty-unit { display: flex; align-items: center; padding: 0 10px 0 2px; border: 1px solid var(--border); border-left: 0; border-right: 0; background: var(--surface); color: var(--muted); font-size: .82rem; font-weight: 600; }
.qty input { text-align: right; }

/* Buttons */
.btn {
  font: inherit; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 6px 10px; font-size: .85rem; }
.btn.ghost { border-color: transparent; background: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.status { border-color: var(--c); color: var(--c); }
.btn.status:hover { background: color-mix(in srgb, var(--c) 12%, transparent); }
.btn.status.current { background: var(--c); color: #fff; }

/* Status */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
}
.chip .count { color: var(--muted); font-weight: 500; margin-left: 4px; }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip.active .count { color: inherit; opacity: .7; }

/* Auftragsliste */
.jobs { display: flex; flex-direction: column; gap: 10px; }
.job {
  display: grid; grid-template-columns: 4px 1fr auto; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px 14px 0; box-shadow: var(--shadow); cursor: pointer; text-align: left;
  font: inherit; color: inherit; width: 100%;
}
.job:hover { border-color: var(--c); }
.job .stripe { align-self: stretch; background: var(--c); border-radius: 0 4px 4px 0; }
.job .title { font-weight: 700; overflow-wrap: anywhere; }
.job .meta { color: var(--muted); font-size: .875rem; display: flex; gap: 6px 14px; flex-wrap: wrap; margin-top: 2px; }
.job .side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.job .attention { font-size: .78rem; font-weight: 700; color: var(--st-rueckfrage); }
@media (max-width: 560px) {
  .job { grid-template-columns: 4px 1fr; }
  .job .side { grid-column: 2; flex-direction: row; align-items: center; }
}

.swatch {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  border: 1px solid var(--border); vertical-align: -1px; margin-right: 4px;
}

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty .big { font-size: 2.5rem; }

/* Verlauf */
.timeline { display: flex; flex-direction: column; gap: 10px; }
.msg { padding: 10px 14px; border-radius: 10px; background: var(--surface-2); max-width: 90%; }
.msg.admin { align-self: flex-start; }
.msg.friend { align-self: flex-end; background: var(--accent-soft); }
.msg.internal { border: 1px dashed var(--muted); background: transparent; }
.msg .head { font-size: .78rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 2px; }
.msg .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.status-only { background: none; padding: 0; align-self: center; font-size: .85rem; color: var(--muted); }

.callout {
  border-left: 4px solid var(--c); background: color-mix(in srgb, var(--c) 10%, transparent);
  padding: 12px 14px; border-radius: 8px;
}
.callout .text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Dialog */
dialog {
  border: 0; padding: 0; border-radius: 16px; background: var(--surface); color: var(--text);
  width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
dialog::backdrop { background: rgba(10, 14, 20, .55); }
.dlg-head {
  position: sticky; top: 0; background: var(--surface); z-index: 1;
  display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.dlg-head h2 { margin: 0; flex: 1; font-size: 1.1rem; overflow-wrap: anywhere; }
.dlg-body { padding: 20px; }
.dlg-body > section + section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.dlg-body h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 12px; }

/* Profile */
.profiles { display: grid; gap: 12px; }
.profile { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-weight: 800; flex: none;
}
.profile .info { flex: 1; min-width: 160px; }
.linkbox { display: flex; gap: 6px; width: 100%; }
.linkbox input { font-family: ui-monospace, monospace; font-size: .8rem; background: var(--surface-2); }

/* Login */
.login { max-width: 360px; margin: 12vh auto; }

/* Toast */
#toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px;
  font-weight: 600; opacity: 0; transition: .2s; pointer-events: none; z-index: 100;
  max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.error { background: var(--danger); color: #fff; }

/* Fotos */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.photos figure { margin: 0; position: relative; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; border: 1px solid var(--border); }
.photos [data-del-photo] { position: absolute; top: 4px; right: 4px; background: var(--surface); }
.job .thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }

.due-urgent { color: var(--danger); font-weight: 700; }
.model-hints:empty { display: none; }
/* Drucke eines Auftrags (Fehldruck) */
.prints { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.prints li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: .88rem; min-height: 32px; }
.prints .pr-when { color: var(--muted); white-space: nowrap; }
.prints .pr-what { min-width: 0; overflow-wrap: anywhere; }
.prints li.failed .pr-what { text-decoration: line-through; color: var(--muted); }
.prints .pr-st { color: var(--danger); font-weight: 600; white-space: nowrap; }
/* Filament-Vorhersage */
.fil-fc { font-size: .8rem; color: var(--muted); white-space: nowrap; }
.fil-fc.warn, .fd-fc.warn { color: var(--st-rueckfrage); font-weight: 600; }
.dot-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px;
  background: var(--st-rueckfrage); color: #fff; font-size: .72rem; font-weight: 700; }
.sug-list { display: grid; gap: 8px; }
.sug-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.sug-name { display: grid; min-width: 0; }
.sug-name small { overflow-wrap: anywhere; }
.model-hints { display: grid; gap: 4px; margin-top: 6px; }
.model-hint { font-size: .85rem; padding: 6px 10px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.tag.fit { border-color: color-mix(in srgb, var(--st-abgeschlossen) 55%, transparent); background: color-mix(in srgb, var(--st-abgeschlossen) 12%, transparent); }
.due-soon { color: var(--st-rueckfrage); font-weight: 600; }
.queue { font-size: .78rem; font-weight: 700; color: var(--st-angenommen); }

.stat .value { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.stat .label { color: var(--muted); font-size: .85rem; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

/* Einstellungen */
.settings-section + .settings-section { margin-top: 20px; }
.settings-section h2 { display: flex; align-items: center; gap: 8px; }
.ok { color: var(--st-abgeschlossen); font-weight: 700; }
.warn { color: var(--st-rueckfrage); font-weight: 700; }
.steps { margin: 0 0 12px; padding-left: 20px; }
.steps li + li { margin-top: 4px; }
details.help summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.icons { display: inline-flex; gap: 6px; font-size: .85rem; }

/* Menü: am PC oben (nur Namen), am Handy als feste Leiste unten mit Symbol + kurzem Namen (24.11.2026) */
.tab .ti, .tab .ts { display: none; }
@media (max-width: 640px) {
  .topbar-inner .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0; width: auto;
    display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; padding: 6px max(14px, env(safe-area-inset-right)) max(8px, calc(env(safe-area-inset-bottom) - 6px)) max(14px, env(safe-area-inset-left));
    background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(0,0,0,.08); }
  .tabs.hidden { display: none !important; }
  .tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 5px; font-size: .62rem; line-height: 1.1;
    border-radius: 10px; min-width: 0; }
  .tab .ti { display: block; font-size: 1.3rem; line-height: 1; }
  .tab .tl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab:has(.ts) .tl { display: none; }
  .tab .ts { display: block; white-space: nowrap; }
  body.admin main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  body.admin #toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  body.admin #toast[popover] { inset: auto auto calc(84px + env(safe-area-inset-bottom)) 50%; }
}

#notifyBtn { margin-left: auto; }
@media (max-width: 420px) { .notify-label { display: none; } }

/* Hilfe-Chat */
.help-messages { max-height: 45vh; overflow-y: auto; padding: 4px 2px; }
.typing { color: var(--muted); font-style: italic; }

/* Feedback-Auswertung */
.insights h3 { margin: 16px 0 6px; font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--text); }
.insights p { margin: 4px 0; }
.insights .li { margin: 4px 0 4px 8px; }

/* Material-Erklärung & Anforderungen */
.mat-i { display: inline-grid; place-items: center; width: 17px; height: 17px; margin-left: 4px; border-radius: 50%;
  border: 1.5px solid currentColor; font: 700 11px/1 Georgia, serif; font-style: italic; opacity: .75; cursor: pointer; vertical-align: 1px; }
.mat-i:hover { opacity: 1; }
.material-info { font-size: .875rem; color: var(--muted); background: var(--surface-2); border-radius: 8px; padding: 8px 12px; margin-top: 8px; font-weight: 400; }
.material-info:empty { display: none; }
.req-box { margin-top: 10px; font-weight: 400; }
.req-box summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: .9rem; }
.req-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.req-chip { cursor: pointer; position: relative; }
.req-chip input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; margin: 0; }
.req-chip span { display: inline-block; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); font-size: .875rem; background: var(--surface); }
.req-chip input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.req-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.req-result { margin-top: 10px; font-size: .9rem; }
.req-result:empty { display: none; }

/* Geführte Tour */
#tour { position: fixed; inset: 0; z-index: 200; }
#tour.center { background: rgba(10, 14, 20, .6); }
.tour-spot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(10, 14, 20, .6); outline: 3px solid var(--accent);
  transition: all .25s ease; pointer-events: none; }
.tour-bubble { position: fixed; background: var(--surface); color: var(--text); border-radius: 14px; padding: 14px 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.35); width: min(340px, calc(100vw - 24px)); transition: top .25s ease, left .25s ease; }
#tour.center .tour-bubble { left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; }
#tour.center .tour-head { justify-content: center; flex-direction: column; }
#tour.center .tour-icon { font-size: 2.6rem; }
.tour-head { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; }
.tour-icon { font-size: 1.6rem; line-height: 1; }
.tour-bubble p { margin: 8px 0 12px; color: var(--muted); }
.tour-bubble .tut-dots { margin: 0; }

/* Hilfe-Knopf unten rechts */
.help-fab { position: fixed; right: calc(16px + env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 50; border: 0; cursor: pointer;
  background: var(--accent); color: #fff; font: inherit; font-weight: 700; padding: 12px 18px; border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.help-fab:hover { background: var(--accent-hover); }
body:has(.help-fab:not(.hidden)) main { padding-bottom: 90px; }

/* Umschalter im Hilfe-Fenster */
.seg { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 10px; margin-bottom: 14px; }
.seg button { flex: 1; border: 0; background: none; font: inherit; font-weight: 600; font-size: .9rem; padding: 8px 6px;
  border-radius: 8px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tut-new { display: inline-block; font-size: .8rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px; margin-bottom: 8px; }
.tut-dots { display: inline-flex; align-items: center; gap: 5px; }
.tut-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.tut-dots span.on { background: var(--accent); width: 18px; border-radius: 4px; }
.tour-foot { display: flex; align-items: center; gap: 8px; }
.tour-foot .tut-dots { margin-right: auto; }
.req-chip span { font-size: .82rem; white-space: nowrap; }

/* Link-Vorschau */
.link-field { gap: 6px; }
.link-field > label { font-weight: 600; font-size: .9rem; }
.link-field .hint a { color: var(--accent); white-space: nowrap; }
.preview-card { display: flex; gap: 12px; align-items: center; margin-top: 8px; padding: 8px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface-2); font-weight: 400; }
.preview-card img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; flex: none; background: var(--surface); }
.preview-card .preview-title { font-weight: 600; overflow-wrap: anywhere; }
.preview-card.loading { color: var(--muted); font-size: .875rem; }
.link-preview:empty { display: none; }
.preview-card .preview-icon { font-size: 1.4rem; width: 32px; text-align: center; flex: none; }

/* ================= Auftrags-Board (Verwaltung) ================= */
main:has(#board) { max-width: none; padding-left: 24px; padding-right: 24px; }
.board-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.board-filter { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.board-filter input { flex: 2; min-width: 180px; }
.board-filter select { flex: 1; min-width: 150px; }

.board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; align-items: start;
  overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.col { background: var(--surface-2); border-radius: 14px; padding: 10px; min-height: 160px; scroll-snap-align: start;
  border-top: 4px solid var(--c); transition: background .15s, box-shadow .15s; }
.col.over { background: color-mix(in srgb, var(--c) 12%, var(--surface-2)); box-shadow: inset 0 0 0 2px var(--c); }
.col header { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 2px 4px 10px; }
.col-icon { font-size: 1.1rem; }
.col-count { margin-left: auto; background: var(--surface); border-radius: 999px; padding: 1px 9px; font-size: .8rem; font-weight: 700; color: var(--muted); }
.col-hint { width: 100%; font-size: .75rem; color: var(--muted); }
.col-body { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.col-empty { border: 2px dashed var(--border); border-radius: 10px; padding: 18px 10px; text-align: center; color: var(--muted); font-size: .85rem; }
.col-body .more { align-self: center; }

.kcard { position: relative; display: flex; gap: 10px; background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--c); border-radius: 10px; padding: 10px; cursor: grab; box-shadow: var(--shadow);
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; transition: transform .12s, box-shadow .12s; }
.kcard:hover { box-shadow: 0 4px 14px rgba(16, 24, 40, .12); transform: translateY(-1px); }
.kcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kcard.pressing { transform: scale(.98); }
.kcard.dragging { opacity: .3; }
.kcard.ghost { position: fixed; left: 0; top: 0; z-index: 300; pointer-events: none; opacity: .95;
  box-shadow: 0 16px 40px rgba(0,0,0,.3); cursor: grabbing; }
.drop-marker { height: 4px; border-radius: 2px; background: var(--accent); margin: -2px 0; }
.qnum { position: absolute; top: -8px; left: -8px; min-width: 24px; height: 24px; border-radius: 999px; background: var(--st-angenommen);
  color: #fff; font-weight: 800; font-size: .8rem; display: grid; place-items: center; padding: 0 6px; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.kc-thumb { width: 52px; height: 52px; flex: none; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font-size: 1.5rem; overflow: hidden; }
.kc-thumb .thumb { width: 52px; height: 52px; border-radius: 0; }
.kc-body { min-width: 0; flex: 1; }
.kc-title { font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kc-meta { font-size: .8rem; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 5px; }
.kc-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tag { font-size: .72rem; background: var(--surface-2); border-radius: 6px; padding: 2px 6px; white-space: nowrap; }
.tag.hot { background: var(--st-rueckfrage); color: #fff; font-weight: 700; }
.avatar.xs { width: 18px; height: 18px; font-size: .6rem; display: inline-grid; vertical-align: middle; margin-right: 2px; }

.rejected { margin-top: 18px; }
.rejected summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 8px; max-width: 260px; }
.rejected-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin-top: 10px; }

@media (max-width: 900px) {
  .board { grid-template-columns: repeat(5, 82vw); margin: 0 -16px; padding: 0 16px 8px; scroll-padding: 0 16px; }
}

/* ================= Seitenfenster (Auftragsdetails) ================= */
dialog.drawer { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; width: min(580px, 100vw); border-radius: 18px 0 0 18px;
  display: flex; flex-direction: column; padding: 0; }
dialog.drawer:not([open]) { display: none; }
dialog.drawer[open] { animation: drawer-in .2s ease-out; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 600px) { dialog.drawer { border-radius: 0; } }
.dr-head { display: flex; gap: 12px; align-items: center; padding: 16px 18px 10px; }
.dr-title { flex: 1; min-width: 0; }
.dr-title h2 { margin: 0 0 2px; font-size: 1.15rem; overflow-wrap: anywhere; }
.step { font-size: .78rem; font-weight: 600; padding: 4px 9px; border-radius: 999px; color: var(--muted); background: var(--surface-2); }
.step.done { color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); }
.step.on { color: #fff; background: var(--c); }
.dr-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 12px; }
.btn.big { padding: 12px 20px; font-size: 1rem; }
.btn.danger-fill { background: var(--danger); border-color: var(--danger); color: #fff; }
.action-panel { margin: 0 18px 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.dr-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 12px; }
.dr-tabs button { border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); padding: 10px 12px; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.dr-tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.pill { font-size: .72rem; background: var(--surface-2); border-radius: 999px; padding: 1px 7px; margin-left: 4px; }
.pill.hot { background: var(--st-rueckfrage); color: #fff; }
.dr-body { padding: 16px 18px 28px; overflow-y: auto; flex: 1; }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
@media (max-width: 480px) { .facts { grid-template-columns: 1fr; } }
.fact { display: flex; gap: 10px; align-items: flex-start; }
.notes { background: color-mix(in srgb, var(--accent) 8%, transparent); border-left: 3px solid var(--accent); border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; margin-bottom: 14px; }
.photo-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 10px; }
.photo-head h3 { margin: 0; }
.composer { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }

dialog.drawer { max-width: 100vw; }
#toast[popover] { margin: 0; inset: auto auto 24px 50%; border: 0; overflow: visible; }
.col-nav { display: none; }
@media (max-width: 900px) {
  .col-nav { display: flex; gap: 6px; margin-bottom: 10px; position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 4px 0; }
  .col-nav button { flex: 1; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 6px 0; font: inherit;
    font-size: 1rem; display: flex; flex-direction: column; align-items: center; gap: 1px; cursor: pointer; color: var(--text); }
  .col-nav button span { font-size: .75rem; font-weight: 700; color: var(--muted); }
  .col-nav button.on { border-color: var(--c); box-shadow: inset 0 -3px 0 var(--c); }
  .board-head .btn.primary { margin-left: auto; }
}

/* ===== Auftragsdetails: vereinfachtes Seitenfenster ===== */
.dr-head { padding: 18px 18px 6px; }
.dr-status { margin: 4px 18px 14px; }
.dr-status-line { font-weight: 600; color: var(--c); font-size: .95rem; }
.progress { display: flex; gap: 4px; margin-top: 8px; }
.progress span { flex: 1; height: 5px; border-radius: 3px; background: var(--border); }
.progress span.on { background: var(--c); }
.dr-actions { flex-wrap: nowrap; align-items: stretch; }
.dr-actions .btn.big { flex: 1; }
.btn.icon { padding: 0 14px; font-size: 1.05rem; }
.more-menu { position: relative; }
.more-menu summary { list-style: none; height: 100%; }
.more-menu summary::-webkit-details-marker { display: none; }
.more-menu .menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 10; min-width: 230px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.18); padding: 6px; display: flex; flex-direction: column; }
.more-menu .menu button { text-align: left; border: 0; background: none; font: inherit; padding: 10px 12px; border-radius: 8px; cursor: pointer; color: var(--text); }
.more-menu .menu button:hover { background: var(--surface-2); }

.model-card { display: flex; gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: 14px;
  text-decoration: none; color: inherit; background: var(--surface); margin-bottom: 14px; }
.model-card:hover { border-color: var(--accent); }
.mc-img { width: 84px; height: 84px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-size: 2.2rem; overflow: hidden; flex: none; }
.mc-img img { width: 100%; height: 100%; object-fit: cover; }
.mc-label { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.mc-title { font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.mc-link { color: var(--accent); font-size: .85rem; font-weight: 600; margin-top: 2px; }

.notes { white-space: pre-wrap; }
.notes-label { font-size: .78rem; color: var(--muted); margin-bottom: 4px; white-space: normal; }
.add-photo { margin-top: 4px; }

.composer.sticky { position: sticky; bottom: -28px; background: var(--surface); padding-bottom: 12px; }

.section-box { border: 1px solid var(--border); border-radius: 12px; padding: 0 14px; margin-bottom: 10px; }
.section-box > summary { cursor: pointer; font-weight: 700; padding: 12px 0; }
.section-box[open] { padding-bottom: 14px; }
.save-bar { position: sticky; bottom: -28px; background: var(--surface); padding: 10px 0; display: flex; justify-content: flex-end; }

/* Profilbilder */
img.avatar { object-fit: cover; padding: 0; }
.avatar.xs { width: 20px; height: 20px; }
.avatar.sm { width: 28px; height: 28px; font-size: .75rem; display: inline-grid; place-items: center; border-radius: 50%; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.4rem; }
.avatar-upload { position: relative; cursor: pointer; flex: none; }
.avatar-cam { position: absolute; right: -4px; bottom: -4px; background: var(--surface); border-radius: 50%; font-size: .75rem;
  width: 22px; height: 22px; display: grid; place-items: center; box-shadow: var(--shadow); border: 1px solid var(--border); }
.dr-who { display: flex; align-items: center; gap: 8px; margin-top: 4px; }

/* Aktualisieren */
.refresh-btn { order: 3; border: 1px solid var(--border); background: var(--surface); color: var(--text); width: 38px; height: 38px;
  border-radius: 10px; font-size: 1.25rem; line-height: 1; cursor: pointer; display: grid; place-items: center; flex: none; }
.refresh-btn:hover { background: var(--surface-2); }
.refresh-btn.spinning { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) {
  .topbar-inner .brand { order: 0; }
  .refresh-btn { order: 1; margin-left: auto; }
  .topbar-inner .tabs { order: 2; }
}
#ptr { position: fixed; top: 0; left: 50%; transform: translate(-50%, -70px); z-index: 60; opacity: 0;
  display: flex; align-items: center; gap: 8px; background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 999px; padding: 8px 14px; box-shadow: 0 6px 20px rgba(0,0,0,.15); font-size: .85rem; font-weight: 600; pointer-events: none; }
#ptr .ptr-arrow { display: inline-block; transition: transform .15s; font-size: 1.1rem; }
#ptr.ready .ptr-arrow { transform: rotate(180deg); }
#ptr.ready { color: var(--accent); }
#ptr { white-space: nowrap; }

/* Duplizieren */
.friend-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.friend-chip { cursor: pointer; position: relative; }
.friend-chip input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; margin: 0; }
.friend-chip > span { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); font-weight: 600; }
.friend-chip input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.friend-chip input:checked + span::after { content: "✓"; margin-left: 2px; }
.friend-chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.dup-info { margin-top: 16px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: .875rem; display: grid; gap: 4px; }

/* Übergeben */
:root { --st-uebergeben: #5f6b7a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --st-uebergeben: #9aa7b6; } }
:root[data-theme="dark"] { --st-uebergeben: #9aa7b6; }

.tag.spot { background: color-mix(in srgb, var(--st-abgeschlossen) 14%, transparent); font-weight: 600; }
button.tag.spot { font-family: inherit; font-size: .72rem; color: inherit; border: 1px solid transparent; cursor: pointer; }
button.tag.spot:hover { border-color: var(--st-abgeschlossen); }
.tag.spot.missing { background: none; border: 1px dashed var(--border); color: var(--muted); font-weight: 400; }
.tag.age-old { color: var(--danger); font-weight: 700; }
.archive-lists { display: flex; flex-direction: column; gap: 4px; }
.archive-lists details + details { margin-top: 0; }
.spot-panel input { width: 100%; }
.dr-actions .more-menu { margin-left: auto; }

/* Druckbereit (echte Warteschlange) */
:root { --st-druckbereit: #1098ad; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --st-druckbereit: #66d9e8; } }
:root[data-theme="dark"] { --st-druckbereit: #66d9e8; }

:root { --st-angenommen: #74b816; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --st-angenommen: #a9e34b; } }
:root[data-theme="dark"] { --st-angenommen: #a9e34b; }

.qnum.prep { background: var(--st-angenommen); }
.board { grid-template-columns: repeat(6, minmax(210px, 1fr)); }
@media (max-width: 900px) { .board { grid-template-columns: repeat(6, 82vw); } }
.kcard .qnum { background: var(--c); }

/* ===== Desktop: volle Breite, leere Spalten schmal ===== */
body.admin .topbar-inner { max-width: none; padding: 0 24px; }
.board { grid-template-columns: var(--cols, repeat(6, minmax(210px, 1fr))); }
.col.is-empty .col-hint { display: none; }
.col.is-empty header { gap: 4px; }
.col.is-empty header strong { font-size: .9rem; }
.col.is-empty .col-empty { padding: 14px 6px; font-size: .78rem; }
@media (max-width: 900px) {
  /* Handy: jede Spalte gleich breit zum Wischen */
  .board { grid-template-columns: repeat(6, 82vw); }
  .col.is-empty .col-hint { display: block; }
  main:has(#board) { padding-left: 16px; padding-right: 16px; }
  body.admin .topbar-inner { padding: 0 16px; }
}
.col.is-empty .col-count { display: none; }
@media (max-width: 900px) { .col.is-empty .col-count { display: inline-block; } }

/* Farbe & Lager im Formular */
.color-field > label { font-weight: 600; font-size: .9rem; }
.color-swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; font-weight: 400; }
.color-swatches:empty { display: none; }
.sw-label { font-size: .8rem; color: var(--muted); width: 100%; }
.sw-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 5px 10px 5px 6px; font: inherit; font-size: .85rem; cursor: pointer; }
.sw-btn:hover { border-color: var(--accent); }
.sw-btn .swatch { width: 16px; height: 16px; margin: 0; }
.color-check { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; font-size: .875rem; font-weight: 400; }
.color-check:empty { display: none; }
.cc .swatch { margin-right: 4px; }
.cc.empty { color: var(--danger); text-align: inherit; padding: 0; } /* nicht die Leer-Zustand-Regel (.empty) erben */
.cc.low { color: var(--st-rueckfrage); }
.cc.hint { color: var(--muted); font-size: .8rem; }
.tag.cs-ok { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--st-abgeschlossen) 50%, transparent); }
.tag.cs-low { box-shadow: inset 0 0 0 1px var(--st-rueckfrage); }
.tag.cs-empty { box-shadow: inset 0 0 0 1px var(--danger); }

/* Filament-Lager */
.fil-group { margin-top: 18px; }
.fil-group h2 { margin-bottom: 10px; }
.fil { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.fil-head { display: flex; align-items: center; gap: 10px; }
.fil-swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--border); flex: none; }
.fil-name { flex: 1; min-width: 0; }
.fil-status { font-size: .78rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.fil-status.ok { color: var(--st-abgeschlossen); background: color-mix(in srgb, var(--st-abgeschlossen) 12%, transparent); }
.fil-status.low { color: var(--st-rueckfrage); background: color-mix(in srgb, var(--st-rueckfrage) 12%, transparent); }
.fil-status.empty { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.fil-counter { display: flex; align-items: center; gap: 10px; }
.fil-counter strong { min-width: 22px; text-align: center; font-size: 1.1rem; }
.fil-counter .btn { width: 36px; padding: 6px 0; }

/* ===== Auftragsformular in Schritten ===== */
.step-box { background: var(--surface-2); border-radius: 14px; padding: 14px 16px 16px; border: 1px solid transparent; transition: border-color .2s; }
.step-box:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.step-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.step-num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--accent); color: #fff; font-weight: 800; font-size: .9rem; transition: background .2s; }
.step-box.done .step-num { background: var(--st-abgeschlossen); font-size: 0; }
.step-box.done .step-num::after { content: "✓"; font-size: .95rem; }
.step-box.who .step-num { background: var(--surface); font-size: 1rem; }
.step-title { font-weight: 700; font-size: 1rem; }
.step-hint { color: var(--muted); font-size: .82rem; }
.step-opt { margin-left: auto; font-size: .72rem; font-weight: 600; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.step-box .grid { gap: 12px; }
.step-box input, .step-box select, .step-box textarea, .step-box .sw-btn { background: var(--surface); }
.grid > .step-box + .step-box { margin-top: 2px; }
.edit-steps { margin-bottom: 10px; }
@media (max-width: 560px) { .step-box { padding: 12px 12px 14px; } }

.readkey { padding: 8px 0; border-bottom: 1px solid var(--border); gap: 8px 12px; }
.readkey code { font-size: .8rem; }

/* ===== Kosten ===== */
.cost-box { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 4px 0 14px; display: grid; gap: 8px; }
.cost-label { font-weight: 700; font-size: .9rem; }
.cost-calc { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.cost-calc strong { font-size: 1.1rem; }
.cost-row { gap: 8px; }
.cost-panel { display: grid; gap: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.cost-panel input { max-width: 160px; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
/* STL statt Link: bewusst unauffällig (Ausnahme) */
.stl-toggle { align-self: flex-start; margin-top: 2px; font-size: .8rem; font-weight: 400; color: var(--muted); text-align: left; }
.stl-file:empty { display: none; }
.stl-pick { align-self: flex-start; cursor: pointer; }
.price { font-size: .78rem; font-weight: 700; color: var(--text); }

/* ===== Freunde-Übersicht ===== */
.friend-list { padding: 4px 0; overflow: hidden; }
.friend-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 210px 350px; align-items: center; gap: 8px 14px;
  padding: 10px 16px; border-top: 1px solid var(--border); }
.friend-row:first-child, .friend-headrow + .friend-row { border-top: 0; }
.friend-headrow > :nth-child(3) { padding-left: 2px; }
.friend-headrow { padding-top: 8px; padding-bottom: 4px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.friend-main { all: unset; cursor: pointer; display: grid; gap: 2px; min-width: 0; }
.friend-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-main:hover strong, .friend-main:focus-visible strong { color: var(--accent); }
.friend-main:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.open-count { color: var(--accent); font-weight: 700; }
.friend-notify { display: flex; gap: 6px; flex-wrap: wrap; }
.friend-actions { display: flex; gap: 6px; justify-content: flex-end; }
.npill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; border: 1px solid var(--border); }
.npill b { font-weight: 800; }
.npill.on { background: color-mix(in srgb, var(--st-abgeschlossen) 14%, transparent); border-color: color-mix(in srgb, var(--st-abgeschlossen) 45%, transparent); color: var(--text); }
.npill.on b { color: var(--st-abgeschlossen); }
.npill.off { color: var(--muted); background: transparent; opacity: .75; }
.npill.wait { background: color-mix(in srgb, var(--st-rueckfrage) 12%, transparent); border-color: color-mix(in srgb, var(--st-rueckfrage) 45%, transparent); }
.npill.wait b { color: var(--st-rueckfrage); }
@media (max-width: 760px) {
  .friend-headrow { display: none; }
  .friend-row { grid-template-columns: 44px minmax(0, 1fr); padding: 12px 14px; }
  .friend-notify, .friend-actions { grid-column: 2; justify-content: flex-start; }
  .friend-row:first-child, .friend-headrow + .friend-row { border-top: 0; }
}

/* Antworten des Hilfe-Assistenten */
.msg .text.md { white-space: normal; }
.msg .text.md p { margin: 0 0 6px; }
.msg .text.md p:last-child { margin-bottom: 0; }
.msg .text.md .li { margin: 2px 0 2px 4px; }
.msg .text.md h3 { font-size: .95rem; margin: 6px 0 4px; }

.me-badge { font-size: .7rem; font-weight: 700; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 999px; padding: 1px 7px; margin-left: 4px; vertical-align: middle; }

/* Schalter „Freunde sehen die Verfügbarkeit“ */
.fil-public { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 16px; cursor: pointer; }
.switch-row { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; }
.fil-public input, .switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-row .switch, .fil-public .switch { flex: none; width: 44px; height: 26px; border-radius: 999px; background: var(--border); position: relative; transition: background .2s; }
.fil-public .switch::after, .switch-row .switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.fil-public input:checked + .switch, .switch-row input:checked + .switch { background: var(--st-abgeschlossen); }
.fil-public input:checked + .switch::after, .switch-row input:checked + .switch::after { transform: translateX(18px); }
.fil-public input:focus-visible + .switch, .switch-row input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Farb-Chips (mehrere Farben in einem Freitext) */
.cchips { display: inline-flex; flex-wrap: wrap; gap: 4px; vertical-align: middle; }
.cchip { display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px 1px 5px; white-space: nowrap; }
.cchip .swatch { margin: 0; }
.tag .swatch { margin: 0 3px 0 0; }
.cchip.cs-ok { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--st-abgeschlossen) 50%, transparent); }
.cchip.cs-low { box-shadow: inset 0 0 0 1px var(--st-rueckfrage); }
.cchip.cs-empty { box-shadow: inset 0 0 0 1px var(--danger); }
.cc.recognized { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }

/* iPhone/iPad zoomen beim Antippen von Eingabefeldern unter 16 px Schriftgröße ran und
   bleiben danach vergrößert – auf Touch-Geräten daher mindestens 16 px (Zoomen mit zwei
   Fingern bleibt erlaubt). */
@media (hover: none) and (pointer: coarse) {
  input, select, textarea { font-size: 16px !important; }
}

/* Kleines Fenster nach dem Ziehen einer Karte */
dialog.quick { width: min(440px, calc(100vw - 32px)); }
.quick-form { display: grid; gap: 12px; padding: 20px; }
.quick-form h2 { margin: 0; font-size: 1.15rem; }
.quick-form > .muted, .quick-form p { margin: 0; }

/* Portal: Abholung fertiger Teile */
.pickup-card { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px;
  border-left: 4px solid var(--st-abgeschlossen); background: color-mix(in srgb, var(--st-abgeschlossen) 8%, var(--surface)); }
.pickup-text { flex: 1 1 220px; min-width: 0; display: grid; gap: 4px; }
.pickup-text .muted { overflow-wrap: anywhere; }
.pickup-card .btn { flex: 0 0 auto; }
@media (max-width: 600px) { .pickup-card .btn { width: 100%; } }

/* Verwaltung: Abhol-Liste (je Freund) */
.pu-list { display: grid; gap: 10px; }
.pu-friend { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; }
.pu-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pu-head strong { flex: 1 1 auto; min-width: 0; }
.pu-jobs { margin: 0; padding-left: 18px; font-size: .88rem; }
.pu-jobs li { overflow-wrap: anywhere; }
.pu-plan { font-size: .88rem; }
.pu-plan.none { color: var(--muted); }
.pu-edit { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pu-edit input[type=date] { flex: 0 0 auto; }
.pu-edit input[name=note] { flex: 1 1 120px; min-width: 0; }
.pu-actions { display: flex; gap: 8px; justify-content: space-between; align-items: center; }
.pu-actions .btn { min-width: 0; white-space: normal; }
.quick-form p .info-i, .prints-box summary .info-i { display: inline-grid; width: 18px; height: 18px; font-size: .7rem; vertical-align: middle; margin-left: 4px; }
.pu-friend, .pu-list { min-width: 0; }
.col-head-btn { margin-top: 6px; }

/* Tipp über dem Board (blendet sich aus) */
.board-tip { font-size: .85rem; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; transition: opacity .5s, transform .5s; }
.board-tip.fade { opacity: 0; transform: translateY(-4px); }
/* Status-Symbole als Ziel beim Ziehen */
.col-nav button.drop-over { border-color: var(--c); background: color-mix(in srgb, var(--c) 18%, var(--surface)); transform: scale(1.08); box-shadow: 0 0 0 2px var(--c); }
.col-nav button { transition: transform .12s, background .12s; }
.kcard.ghost.mini { opacity: .35; }

/* Benachrichtigungen: 3 Möglichkeiten als Karten */
.nm-lead { margin: 0 0 10px; }
.nm-list { display: grid; gap: 10px; }
.nm { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; }
.nm.on { border-color: color-mix(in srgb, var(--st-abgeschlossen) 55%, transparent); background: color-mix(in srgb, var(--st-abgeschlossen) 7%, transparent); }
.nm p { margin: 0; }
.nm-head { display: flex; align-items: center; gap: 8px; }
.nm-num { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 800; background: var(--surface-2); color: var(--muted); flex: none; }
.nm.on .nm-num { background: var(--st-abgeschlossen); color: #fff; }
.nm-icon { font-size: 1.1rem; }
.nm-state, .nm-tag { margin-left: auto; font-size: .75rem; font-weight: 700; }
.nm-tag { color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 999px; padding: 1px 8px; }
.nm .btn.primary { justify-self: start; }

/* Restspulen als Chips mit Füllbalken */
.spool { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px 3px 6px; color: var(--text); }
.spool:hover { border-color: var(--accent); }
.spool-bar { width: 26px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--st-abgeschlossen) var(--lvl), var(--surface-2) var(--lvl));
  box-shadow: inset 0 0 0 1px var(--border); }
.spool.big { flex-direction: column; justify-content: center; padding: 10px 4px; border-radius: 12px; font-size: .95rem; }
.spool.big .spool-bar { width: 36px; height: 10px; }
.spool.big.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }

/* ===== Inventur ===== */
dialog.inventory { width: min(560px, calc(100vw - 24px)); }
.inv-progress { height: 4px; background: var(--surface-2); }
.inv-progress span { display: block; height: 100%; background: var(--accent); transition: width .25s; }
.inv-choices { display: grid; gap: 8px; }
.inv-choices .btn.big { justify-content: space-between; display: flex; padding: 12px 16px; font-size: 1rem; }
.inv-choices .count { opacity: .7; font-weight: 600; }
.inv-step { display: grid; gap: 18px; }
.inv-title { display: flex; gap: 14px; align-items: center; }
.inv-title .fil-swatch { width: 48px; height: 48px; }
.inv-title h2 { margin: 2px 0; font-size: 1.4rem; }
.inv-block { display: grid; gap: 8px; }
.inv-label { font-weight: 700; }
.inv-counter { display: flex; align-items: center; gap: 16px; }
.inv-counter .btn { width: 52px; height: 48px; font-size: 1.4rem; padding: 0; }
.inv-counter strong { font-size: 1.8rem; min-width: 40px; text-align: center; }
.inv-spool { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.inv-spool .spool.on { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.inv-nav { border-top: 1px solid var(--border); padding-top: 14px; }
.inv-changes { margin: 10px 0 0; padding-left: 0; list-style: none; display: grid; gap: 4px; font-size: .9rem; }
.inv-changes .swatch { margin-right: 6px; }

.mini-spool { flex: none; width: 20px; height: 8px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--border);
  background: linear-gradient(90deg, var(--pc, var(--st-abgeschlossen)) var(--lvl), var(--surface) var(--lvl)); }
.rests-form .inv-spool { gap: 5px; }
.rest-num { width: 18px; color: var(--muted); font-size: .8rem; }
.rests-empty { color: var(--muted); font-size: .9rem; padding: 10px 0; }
/* Fensterinhalt bekommt beim Öffnen den Fokus – ohne sichtbaren Rahmen */
dialog [tabindex="-1"]:focus { outline: none; }

/* Kleiner Schalter „Für Freunde sichtbar“ im Filament-Kopf */
.fil-public-mini { display: flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; }
.fil-public-mini label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.fil-public-mini input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fil-public-mini .switch { flex: none; width: 38px; height: 22px; border-radius: 999px; background: var(--border); position: relative; transition: background .2s; }
.fil-public-mini .switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.fil-public-mini input:checked + .switch { background: var(--st-abgeschlossen); }
.fil-public-mini input:checked + .switch::after { transform: translateX(16px); }
.fil-public-mini input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.info-i { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  font: italic 700 .8rem/1 Georgia, serif; cursor: pointer; display: grid; place-items: center; padding: 0; }
.info-i:hover { color: var(--accent); border-color: var(--accent); }

/* ===== Einstellungen: auf-/zuklappbare Kacheln ===== */
.settings-section.collapsible > h2 { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 8px; margin-bottom: 0; }
.settings-section.collapsible > h2::after { content: "›"; margin-left: auto; font-size: 1.4rem; color: var(--muted); transition: transform .15s; transform: rotate(90deg); }
.settings-section.collapsible:not(.open) > h2::after { transform: rotate(0deg); }
.settings-section.collapsible.open > h2 { margin-bottom: 12px; }
@media (max-width: 899px) { .settings-section.collapsible:not(.open) > :not(h2) { display: none !important; } }
.settings-section.collapsible > h2:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }

/* ===== Statistik-Dashboard ===== */
main:has(#dash) { max-width: 1400px; }
.dash { position: relative;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .dash { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; }
}
:root[data-theme="dark"] .dash { --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; font: inherit; font-size: .85rem; font-weight: 600; color: var(--muted); padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 6px 0 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.kpi-icon { font-size: 1.1rem; }
.kpi-value { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.kpi-label { font-size: .8rem; color: var(--muted); }
.kpi-sub { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.dash-card { padding: 16px 18px; min-width: 0; }
.dash-card.wide { grid-column: 1 / -1; }
.dash-card h2 { font-size: 1rem; margin: 0 0 12px; display: flex; gap: 8px; align-items: baseline; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .82rem; color: var(--muted); margin-top: 10px; }
.legend.vertical { flex-direction: column; gap: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend strong { color: var(--text); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
/* Säulen */
.cols-chart { display: grid; grid-template-columns: 28px 1fr; grid-template-rows: auto 18px; column-gap: 6px; }
.cols-y { display: flex; flex-direction: column; justify-content: space-between; font-size: .7rem; color: var(--muted); text-align: right; }
.cols-plot { position: relative; border-bottom: 1px solid var(--border); }
.cols-grid { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--border); opacity: .6; }
.cols-group { position: absolute; bottom: 0; top: 0; display: flex; align-items: flex-end; justify-content: center; gap: 2px; padding: 0 3px; box-sizing: border-box; }
.col-bar { flex: 1; max-width: 18px; border-radius: 4px 4px 0 0; min-height: 0; }
.cols-x { grid-column: 2; position: relative; font-size: .7rem; color: var(--muted); }
.cols-x span { position: absolute; transform: translateX(-50%); top: 2px; white-space: nowrap; }
/* Waagerechte Balken */
.hbars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(80px, 38%) 1fr auto; align-items: center; gap: 10px; font-size: .85rem; }
.hbar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.hbar-label .swatch { margin: 0; flex: none; }
.hbar-track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; border-radius: 0 5px 5px 0; }
.hbar-value { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 2.5em; text-align: right; }
/* Ring */
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { width: 140px; height: 140px; flex: none; }
.donut circle { cursor: default; }
.donut-num { font-size: 26px; font-weight: 800; fill: var(--text); }
.donut-sub { font-size: 11px; fill: var(--muted); }
/* Stand */
.pipe { display: flex; gap: 2px; height: 16px; border-radius: 8px; overflow: hidden; }
/* Wochentage */
.wd { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 130px; align-items: end; }
.wd-col { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 4px; }
.wd-bar { width: 60%; max-width: 26px; background: var(--s1); border-radius: 4px 4px 0 0; min-height: 2px; }
.wd-label { font-size: .75rem; color: var(--muted); }
/* Hinweis */
.dash-tip { position: absolute; z-index: 20; pointer-events: none; background: var(--text); color: var(--bg); font-size: .8rem; font-weight: 600;
  padding: 6px 10px; border-radius: 8px; max-width: 260px; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.dash-tables { margin-top: 16px; }
@media (max-width: 560px) { .dash-grid { grid-template-columns: 1fr; } .seg { width: 100%; } .seg button { flex: 1; padding: 6px 4px; } }
.seg button { white-space: nowrap; }

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

/* ===== Einstellungen: PC = Menü links + Inhalt rechts, Handy = aufklappbare Kacheln ===== */
.set-nav { display: none; }
.pref-list { display: grid; gap: 4px; }
.pref { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--border); }
.pref:first-child { border-top: 0; }
@media (min-width: 900px) {
  main:has(.set-layout) { max-width: 1180px; }
  .set-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
  .set-nav { display: grid; gap: 2px; position: sticky; top: 76px; }
  .set-nav-group { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 14px 12px 4px; }
  .set-nav-group:first-child { padding-top: 0; }
  .set-nav-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; text-align: left; font: inherit; font-size: .95rem; font-weight: 600;
    background: none; border: 0; border-radius: 10px; padding: 9px 12px; color: var(--text); cursor: pointer; }
  .set-nav-item .small { font-size: .72rem; }
  .set-nav-item:hover { background: var(--surface-2); }
  .set-nav-item.on { background: var(--accent-soft); color: var(--accent); }
  .set-pane .settings-section { display: none; margin: 0; }
  .set-pane .settings-section.active { display: block; }
  .set-pane .settings-section.collapsible > h2 { cursor: default; margin-bottom: 12px; }
  .set-pane .settings-section.collapsible > h2::after { display: none; }
}

/* ===== Transparent-Variante ===== */
.clear-tag { font-size: .7rem; font-weight: 700; color: var(--muted); border: 1px dashed var(--border); border-radius: 999px; padding: 0 6px; margin-left: 4px; vertical-align: middle; white-space: nowrap; }
.fil-swatch.clear, .swatch.clear { opacity: .55; box-shadow: inset 0 0 0 2px rgba(255,255,255,.7); border-style: dashed; }

/* ===== Statistik: am PC genau eine Seite ===== */
.dash-table-btn { display: none; }
@media (min-width: 1100px) and (min-height: 640px) {
  main:has(#dash) { padding-bottom: 16px; }
  .dash { height: var(--dash-h, calc(100dvh - 120px)); display: flex; flex-direction: column; overflow: hidden; }
  .dash > .board-head { margin-bottom: 10px; }
  .dash-table-btn { display: inline-flex; }
  .dash-tables { display: none; }
  .kpis { grid-template-columns: repeat(8, 1fr); margin: 0 0 12px; gap: 10px; }
  .kpi { padding: 8px 12px; display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: baseline; }
  .kpi-icon { grid-row: span 2; font-size: 1rem; }
  .kpi-value { font-size: 1.35rem; margin: 0; }
  .kpi-sub { display: none; }
  .dash-grid { flex: 1; min-height: 0; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  .dash-card { display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding: 12px 14px; }
  .dash-card h2 { margin-bottom: 8px; font-size: .95rem; }
  .dash-card.wide { grid-column: span 3; }
  .dash-card > p.muted { display: none; }
  .c-time .cols-chart { flex: 1; min-height: 0; grid-template-rows: minmax(0, 1fr) 18px; }
  .c-time .cols-plot { height: auto !important; }
  .c-time .legend { margin-top: 6px; }
  .hbars { gap: 4px; overflow: hidden; }
  .hbar { font-size: .8rem; gap: 8px; }
  .hbar:nth-child(n+7) { display: none; }
  .donut-wrap { flex: 1; min-height: 0; flex-wrap: nowrap; gap: 12px; }
  .donut { width: auto; height: 100%; max-height: 150px; aspect-ratio: 1; }
  .wd { flex: 1; height: auto; min-height: 0; }
  .legend.vertical { gap: 3px; margin-top: 8px; font-size: .78rem; }
}

/* Ausgeblendet heißt ausgeblendet – auch wenn eine Klasse display setzt */
[hidden] { display: none !important; }
.legend.vertical span { white-space: nowrap; }
@media (min-width: 1100px) and (min-height: 640px) {
  .donut { max-height: 124px; }
  .donut-wrap .legend.vertical { min-width: 0; }
  .hbar { grid-template-columns: minmax(64px, 42%) 1fr auto; }
}

/* ===== Filament bearbeiten: aufgeräumtes Formular ===== */
dialog.fil-dlg { width: min(560px, calc(100vw - 24px)); }
.fil-form { display: grid; gap: 0; }
.ff-section { padding: 14px 0; border-top: 1px solid var(--border); display: grid; gap: 8px; }
.ff-section:first-child { padding-top: 0; border-top: 0; }
.ff-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ff-hint { font-size: .8rem; color: var(--muted); }
.ff-color { display: flex; gap: 10px; align-items: center; }
.ff-color input[name=name] { flex: 1; }
.ff-swatch { position: relative; flex: none; width: 44px; height: 44px; cursor: pointer; }
.ff-swatch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; padding: 0; border: 0; }
.ff-swatch span { display: block; width: 100%; height: 100%; border-radius: 50%; border: 2px solid var(--border); box-shadow: inset 0 0 0 3px var(--surface); pointer-events: none; }
.ff-swatch span.clear { opacity: .55; border-style: dashed; }
.ff-swatch:hover span { border-color: var(--accent); }
.ff-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-top: 4px; }
.ff-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ff-switch .switch { flex: none; width: 38px; height: 22px; border-radius: 999px; background: var(--border); position: relative; transition: background .2s; }
.ff-switch .switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.ff-switch input:checked + .switch { background: var(--st-abgeschlossen); }
.ff-switch input:checked + .switch::after { transform: translateX(16px); }
.ff-switch input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.ff-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; align-items: end; }
.ff-actions { padding-top: 14px; border-top: 1px solid var(--border); gap: 8px; }
.danger-text { color: var(--danger); }

.fil-form .field { margin: 0; gap: 6px; }
.ff-grid { align-items: start; }
.ff-grid .field input, .ff-grid .field select, .fil-form input[name=name], .fil-form input[name=note] { height: 44px; box-sizing: border-box; }
.ff-actions { flex-wrap: nowrap; }
@media (max-width: 480px) { .ff-cancel { display: none; } }

/* ===== Kostenschätzung: kompakte Zahlenfelder mit Einheit ===== */
.cost-form { display: grid; gap: 10px; }
.cost-form .ff-label { margin-top: 6px; }
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 24px; }
.unit-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; font-weight: 600; font-size: .92rem; }
.unit-input { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); overflow: hidden; flex: none; }
.unit-input:focus-within { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.unit-input input { width: 64px; border: 0; border-radius: 0; padding: 7px 6px 7px 10px; text-align: right; font-variant-numeric: tabular-nums; background: transparent; }
.unit-input input:focus { outline: none; }
.unit { padding: 0 10px 0 6px; color: var(--muted); font-size: .82rem; font-weight: 600; white-space: nowrap; min-width: 46px; }
.cost-example { font-size: .88rem; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; margin-top: 6px; }
.unit { min-width: 54px; text-align: left; }
.unit { min-width: 60px; }
.unit-name { white-space: nowrap; }

/* Pro Farbe „transparent“ wählen (PETG) */
.cc.clear-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.clear-btn { font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer; border: 1px dashed var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 3px 10px; }
.clear-btn.on { border-style: solid; border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

/* Mitteilungen (Push): Anleitung „Zum Home-Bildschirm“ */
.nm-steps { margin: 4px 0 0; padding-left: 20px; display: grid; gap: 3px; }

/* Freunde-Liste: Häkchen kompakt (nur Symbol), Legende in der Kopfzeile */
.friend-notify .npill .nl { display: none; }
.friend-notify { flex-wrap: nowrap; gap: 4px; }
.friend-notify .npill { padding: 3px 7px; }
.nlegend { display: block; font-weight: 500; text-transform: none; letter-spacing: 0; font-size: .7rem; opacity: .85; margin-top: 2px; }
.nlegend-m { display: none; margin: -4px 0 10px; }
@media (max-width: 760px) { .nlegend-m { display: block; } }
/* Freunde-Liste am Handy: Aufträge · Kopieren · Teilen gleich breit in einer Zeile (Bearbeiten = Name antippen) */
@media (max-width: 760px) {
  .friend-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); width: 100%; }
  .friend-actions .btn { padding-left: 6px; padding-right: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; justify-content: center; }
  .friend-actions [data-act=edit] { display: none; }
}

/* Drucker-Leiste über dem Board (Anycubic, nur Anzeige) */
.cloudfile { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 10px; }
.cloudfile .cf-label { font-weight: 600; }

/* ⓘ-Erklärung in Feldern (infoHtml): kleiner Knopf, Text klappt darunter auf */
label .info-i, .field .info-i, .cloudfile .info-i { display: inline-grid; width: 18px; height: 18px; font-size: .7rem; vertical-align: middle; margin-left: 4px; }
.info-pop { display: block; flex-basis: 100%; margin: 4px 0 2px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2);
  color: var(--muted); font-size: .82rem; font-weight: 400; line-height: 1.4; }
.info-pop[hidden] { display: none; }

/* Rückfrage-Fenster (ask) */
dialog.ask { width: min(400px, calc(100vw - 32px)); }
.ask-body { display: grid; gap: 10px; padding: 20px; margin: 0; }
.ask-body p { margin: 0; }
.ask-q { font-weight: 600; font-size: 1.02rem; }
.ask-body .row { margin-top: 6px; }

/* Knopf, dessen Anfrage gerade läuft */
button[aria-busy="true"] { opacity: .6; cursor: progress; }

/* Kopieren / Teilen nebeneinander */
.copy-share { display: inline-flex; gap: 6px; flex-wrap: wrap; }
time[title] { cursor: help; }

/* Farbkreise einheitlich: etwas größer, helle Farben mit sichtbarem Rand; Ring = steckt im ACE */
.swatch { width: 14px; height: 14px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }

/* Feste Spalten: nichts springt, Listen bleiben bündig */
.fb-row .fb-who { width: 140px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-row .fb-when { width: 130px; flex: none; }
.dash-tables table { table-layout: fixed; }
.dash-tables th:first-child, .dash-tables td:first-child { width: 34%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-tables td:not(:first-child), .dash-tables th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.own-link { margin: 18px 0 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* Felder mit ⓘ: Überschrift, Hinweis und ⓘ in einer Zeile, darunter Erklärung und Eingabe */
.field:has(> .info-i) { display: grid; grid-template-columns: auto auto 1fr; align-items: center; column-gap: 6px; row-gap: 6px; }
.field:has(> .info-i) > :not(.hint):not(.info-i) { grid-column: 1 / -1; }
.field:has(> .info-i) > .info-i { justify-self: start; margin-left: 0; }
.field > .unit-input { align-self: flex-start; justify-self: start; }
.field > .unit-input input { width: 90px; }

/* Druckdatei am Auftrag */
.cloudfile.has-file { display: grid; grid-template-columns: auto 1fr; align-items: center; }
.cf-current { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.cf-img { width: 72px; height: 72px; flex: none; border-radius: 10px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; font-size: 1.6rem; }
.cf-img img { width: 100%; height: 100%; object-fit: cover; }
.cf-text { display: grid; gap: 4px; min-width: 0; }
.cf-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-btns { display: flex; gap: 6px; margin-top: 2px; }

/* Fenster „Druckdatei wählen“ */
dialog.picker { width: min(960px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; }
.picker-wrap { display: flex; flex-direction: column; max-height: calc(100dvh - 24px); }
.pk-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 8px; }
.pk-head h2 { margin: 0; font-size: 1.1rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-tools { display: grid; gap: 8px; padding: 0 18px 10px; border-bottom: 1px solid var(--border); }
.pk-body { overflow-y: auto; padding: 6px 18px 12px; }
.pk-body section h3 { font-size: .95rem; margin: 14px 0 8px; }
.pk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pk-tile { display: grid; gap: 3px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); text-align: left; cursor: pointer; color: inherit; font: inherit; }
.pk-tile:hover, .pk-tile:focus-visible { border-color: var(--accent); }
.pk-tile.current { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.pk-tile.taken { opacity: .55; }
.pk-img { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.pk-img img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.pk-ph { font-size: 1.8rem; opacity: .5; }
.pk-badge { position: absolute; z-index: 2; left: 6px; bottom: 6px; max-width: calc(100% - 12px); padding: 2px 7px; border-radius: 999px; background: rgba(0, 0, 0, .7); color: #fff;
  font-size: .72rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-name { font-weight: 600; font-size: .85rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.pk-meta { color: var(--muted); font-size: .76rem; }
.pk-foot { padding: 8px 18px 14px; margin: 0; border-top: 1px solid var(--border); }
@media (max-width: 600px) {
  dialog.picker { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .picker-wrap { max-height: 100dvh; height: 100%; }
  .pk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Kamera-Fenster */
dialog.camera { width: min(760px, calc(100vw - 24px)); padding: 0; }
.cam-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding-bottom: 16px; }
dialog.camera { overflow-x: hidden; }
/* langer Titel („Auftrag … starten“) bricht um, statt das Fenster breiter zu machen */
dialog.camera .pk-head { align-items: flex-start; }
dialog.camera .pk-head h2 { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.cam-box { position: relative; aspect-ratio: 16 / 9; margin: 0; border-radius: 12px; overflow: hidden; background: #000; display: grid; place-items: center; }
.cam-box > div:not(.cam-msg) { position: absolute !important; inset: 0; }
.cam-msg { color: #ddd; padding: 16px; text-align: center; font-size: .9rem; max-width: 520px; }
.cam-check { margin: 0 18px; min-height: 1.4em; }
.cam-check.st-leer { color: var(--st-abgeschlossen); font-weight: 600; }
.cam-check.st-belegt { color: var(--danger); font-weight: 600; }
.cam-actions { padding: 0 18px; }

/* Spulenwahl im Start-Fenster */
.cam-spools { margin: 0 18px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; display: grid; gap: 8px; }
.cam-spool-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cam-spool { display: flex; align-items: center; gap: 8px; font-weight: 400; }
.cam-spool select { flex: 1; min-width: 0; }
.cam-spool .swatch { width: 18px; height: 18px; margin: 0; }
.cam-spool-warn { color: var(--danger); }
@media (max-width: 600px) {
  .cam-actions { flex-wrap: wrap; }
  .cam-actions #camCheckBtn { flex: 1 1 100%; }
  .cam-actions .spacer { display: none; }
  .cam-actions [data-close], .cam-actions #camStart { flex: 1; }
}

/* Licht-Knopf im Kamerabild */
.cam-stage { position: relative; margin: 0 18px; }
.cam-light { position: absolute; top: 10px; right: 10px; z-index: 5; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(0, 0, 0, .55); font-size: 1.2rem; line-height: 1; cursor: pointer; filter: grayscale(1) brightness(.85); }
.cam-light:hover { border-color: #fff; }
.cam-light.on { background: rgba(255, 214, 10, .9); border-color: #ffd60a; filter: none; box-shadow: 0 0 14px rgba(255, 214, 10, .7); }

/* Drucker-Leiste: gleich hohe Karten über die volle Breite */
.printer-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin: 0 0 14px; }
.printer-card { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); border-left: 4px solid var(--pc-c, var(--muted)); min-width: 0; }
.printer-card.st-printing { --pc-c: var(--st-in_druck); }
.printer-card.st-idle { --pc-c: var(--st-abgeschlossen); }
.printer-card.st-offline { opacity: .7; }
.pc-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pc-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--pc-c, var(--muted)); flex: none; }
.pc-name { font-size: 1.02rem; }
.pc-state { margin-left: auto; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap;
  color: var(--pc-c, var(--muted)); background: color-mix(in srgb, var(--pc-c, var(--muted)) 14%, transparent); }
.pc-cam { width: 32px; height: 32px; flex: none; border-radius: 50%; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-size: .95rem; line-height: 1; padding: 0; }
.pc-cam:hover { border-color: var(--accent); }
.pc-cam.on { background: #ffe680; border-color: #e0b800; }
.pc-main { display: flex; gap: 12px; align-items: center; min-width: 0; }
.pc-thumb { position: relative; width: 56px; height: 56px; flex: none; border-radius: 10px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; font-size: 1.4rem; }
.pc-thumb img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.pc-info { flex: 1; min-width: 0; display: grid; gap: 6px; }
.pc-file { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-progress { height: 7px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.pc-progress span { display: block; height: 100%; border-radius: 4px; background: var(--st-in_druck); }
.pc-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.pc-job-row { display: grid; gap: 6px; min-height: 22px; align-content: center; }
.pc-link { text-decoration: none; text-align: left; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pc-pick, .pc-start { font-size: .88rem; padding: 6px 10px; width: 100%; }
.pc-pieces { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pc-pieces select { width: auto; font-size: .85rem; padding: 3px 8px; }
.pc-starting { color: var(--st-in_druck); font-weight: 600; }
.pc-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.pc-foot-label { font-size: .72rem; font-weight: 700; letter-spacing: .06em; color: var(--muted); }
.pc-slot { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.pc-slot .swatch { width: 20px; height: 20px; margin: 0; border: 1px solid var(--border); }
.pc-slot.used .swatch { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--st-in_druck); }
.pc-slot-n { font-size: .68rem; color: var(--muted); line-height: 1; }
.pc-warn { grid-column: 1 / -1; }
@media (max-width: 600px) { .printer-strip { grid-template-columns: 1fr; } }
.pc-link:hover { text-decoration: underline; }


/* Bild groß anzeigen */
.pc-thumb img, .kc-thumb img, .mc-img img, .cf-img img, .photos img, .preview-card img, img.thumb { cursor: zoom-in; }
dialog.lightbox { width: 100vw; height: 100dvh; max-width: 100vw; max-height: 100dvh; margin: 0; padding: 0; border: 0; border-radius: 0;
  background: transparent; display: none; place-items: center; cursor: zoom-out; }
dialog.lightbox[open] { display: grid; }
dialog.lightbox::backdrop { background: rgba(0, 0, 0, .88); }
dialog.lightbox img { width: 94vw; height: 88dvh; object-fit: contain; image-rendering: auto; }
.lb-close { position: fixed; top: max(14px, env(safe-area-inset-top)); right: 14px; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .4); background: rgba(0, 0, 0, .6); color: #fff; font-size: 1.2rem; cursor: pointer; }

/* Bestellung / Wareneingang */
.order-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 600; }
.order-row { flex-wrap: wrap; }
.order-row .fil-counter { flex: none; }
.quick-form .btn.big { width: 100%; white-space: normal; }
dialog.quick .quick-form { min-width: 0; overflow-wrap: anywhere; }

/* ACE-Fach umstellen */
button.pc-slot { border: 0; background: none; padding: 2px; cursor: pointer; border-radius: 8px; color: inherit; font: inherit; }
button.pc-slot:hover .swatch { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.slot-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; max-height: 50vh; overflow-y: auto; }
.slot-pick { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: inherit; font: inherit; cursor: pointer; }
.slot-pick:hover { border-color: var(--accent); }
.slot-pick .swatch { grid-row: 1 / 3; width: 22px; height: 22px; margin: 0; }
.slot-pick .slot-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-free input[type=color] { width: 44px; height: 36px; padding: 2px; }
.slot-free select { width: auto; }

/* Leeres ACE-Fach: hohler, gestrichelter Kreis */
.swatch.slot-empty { background: transparent !important; border: 2px dashed var(--muted); box-shadow: none; }

/* Rest-Rolle in Prozent: Akku-Balken, Schieberegler, Zahlenfeld */
.pct-ctl { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "batt num" "range range"; gap: 6px 10px; align-items: center; }
.pct-batt { grid-area: batt; position: relative; height: 26px; border-radius: 7px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.pct-batt::after { content: ""; position: absolute; right: -5px; top: 8px; width: 4px; height: 10px; border-radius: 0 2px 2px 0; background: var(--border); }
.pct-batt span { position: absolute; inset: 0 auto 0 0; width: var(--lvl); background: var(--pc); opacity: .85; transition: width .1s; }
.pct-batt b { position: relative; display: block; text-align: center; line-height: 26px; font-size: .85rem; color: var(--text); text-shadow: 0 0 3px var(--surface); }
.pct-ctl input[type=range] { grid-area: range; width: 100%; accent-color: var(--pc); margin: 0; }
.pct-num { grid-area: num; }
.pct-num input { width: 48px; }
.inv-spool { align-items: flex-start; }
.inv-spool .btn.ghost.sm { margin-top: 2px; }

/* Rest-Rolle: Platz im Drucker */
.rest-main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.rest-place { display: flex; align-items: center; gap: 8px; }
.rest-place select { width: auto; flex: 1; min-width: 0; font-size: .85rem; padding: 4px 8px; }

/* Drucker-Karte: Füllstand der zugeordneten Rolle unter dem Fach; Fach-Fenster: Rolle wählen */
.pc-slot-lvl { font-size: .62rem; line-height: 1; font-weight: 600; min-height: .62rem; font-variant-numeric: tabular-nums; }
.slot-sec { display: grid; gap: 8px; margin: 4px 0 10px; }
.slot-sec h3 { margin: 0; font-weight: 600; }
.slot-rest { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface); color: inherit; font: inherit; cursor: pointer; }
.slot-rest:hover { border-color: var(--accent); }
.slot-rest.current { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.slot-rest .mini-spool { grid-row: 1 / 3; }
.slot-rest .slot-name { font-weight: 600; }

/* Rest per Foto schätzen: Anleitung mit 3D-Spule im Handy-Sucher */
.sg-wrap { display: grid; grid-template-columns: 150px 1fr; gap: 12px; align-items: center; margin: 6px 0 10px; }
.sg-steps { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.sg-phone { position: relative; width: 150px; height: 170px; border-radius: 18px; border: 3px solid var(--border); background: var(--bg-soft, rgba(127,127,127,.08)); overflow: hidden; }
.sg-corner { position: absolute; width: 14px; height: 14px; border: 2px solid var(--accent); }
.sg-corner.tl { top: 14px; left: 14px; border-right: 0; border-bottom: 0; }
.sg-corner.tr { top: 14px; right: 14px; border-left: 0; border-bottom: 0; }
.sg-corner.bl { bottom: 30px; left: 14px; border-right: 0; border-top: 0; }
.sg-corner.br { bottom: 30px; right: 14px; border-left: 0; border-top: 0; }
.sg-scene { position: absolute; inset: 18px 18px 34px; perspective: 500px; display: grid; place-items: center; }
.sg-spool { position: relative; width: 96px; height: 96px; transform-style: preserve-3d; animation: sg-turn 5s ease-in-out infinite alternate; }
.sg-flange, .sg-fil { position: absolute; border-radius: 50%; transform: translateZ(var(--z)); }
.sg-flange { inset: 0; background: radial-gradient(circle, transparent 0 13%, rgba(150,150,150,.25) 14%); border: 2px solid #8a8a8a; }
.sg-flange.front { background: radial-gradient(circle, transparent 0 13%, rgba(190,190,190,.18) 14%); }
.sg-fil { inset: 14px; background: radial-gradient(circle, #b08a5a 0 38%, var(--fc) 40%); box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
  animation: sg-use 5s ease-in-out infinite alternate; }
.sg-gap { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 10px; color: var(--muted); }
.sg-shutter { position: absolute; right: 8px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; border: 2px solid var(--accent); }
@keyframes sg-turn { from { transform: rotateY(-38deg) rotateX(14deg); } to { transform: rotateY(28deg) rotateX(22deg); } }
@keyframes sg-use { from { inset: 10px; } to { inset: 24px; } }
@media (prefers-reduced-motion: reduce) { .sg-spool, .sg-fil { animation: none; transform: rotateY(-25deg) rotateX(16deg); } .sg-fil { transform: translateZ(var(--z)); } }
.sg-actions { flex-wrap: wrap; gap: 8px; }
.sg-actions .btn.busy { opacity: .5; pointer-events: none; }
.sp-wait { margin: 8px 0; }
.sp-res { display: grid; grid-template-columns: 72px 1fr; gap: 10px; align-items: start; margin: 8px 0; }
.sp-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; cursor: zoom-in; }
.sp-big { font-size: 1.4em; font-weight: 700; }
.sp-apply { display: grid; gap: 8px; width: 100%; }
.sp-apply .btn { white-space: normal; text-align: center; }
@media (max-width: 420px) { .sg-wrap { grid-template-columns: 1fr; justify-items: center; } }

/* ===== Filament-Lager (aufgeräumt 11.11.2026) =====
   Kopf: Titel + „⋯ Mehr“ + „＋ Filament“. Handy: Filter-Chips in einer wischbaren Zeile, Materialgruppen aufklappbar.
   PC: Filter-Menü links, Farben als Kacheln rechts. Jede Farbe: Zeile 1 Name/Fach/Bestellung, Zeile 2 Reste + volle Rollen. */
.fil-top { flex-wrap: nowrap; }
.fil-top > div:first-child { flex: 1; min-width: 0; }
.fil-top h1, .fil-top p { margin: 0; }
.fil-top p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .92rem; }
.fil-btns { display: flex; gap: 8px; flex: none; }
@media (max-width: 400px) { .fil-btns .lbl { display: none; } }
.fil-nav { display: none; }
.fil-nav .set-nav-item { justify-content: space-between; }
.fil-toolbar { display: flex; align-items: center; gap: 8px; }
.fil-chips { flex: 1; min-width: 0; flex-wrap: nowrap; overflow-x: auto; margin: 0; padding: 2px 0 6px; scrollbar-width: none; }
.fil-chips::-webkit-scrollbar { display: none; }
.fil-chips .chip { flex: none; }
.fil-expand { flex: none; white-space: nowrap; margin-bottom: 4px; }

.fil-group { margin-top: 10px; }
.fil-group-head { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 10px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.fil-group-head:hover { border-color: var(--accent); }
.fil-group-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fil-group-head .chev { font-size: 1.4rem; color: var(--muted); transition: transform .15s; line-height: 1; }
.fil-group.open .fil-group-head .chev { transform: rotate(90deg); }
.fil-group-name { font-size: 1.05rem; font-weight: 800; white-space: nowrap; }
.fil-sum { margin-left: auto; font-size: .8rem; font-weight: 600; color: var(--muted); text-align: right; }
.fil-sum .s-ok { color: var(--st-abgeschlossen); } .fil-sum .s-low { color: var(--st-rueckfrage); } .fil-sum .s-empty { color: var(--danger); }
@media (max-width: 480px) { .fil-sum-n { display: none; } }
.fil-group.open .fil-group-head { border-radius: 12px 12px 0 0; }
.fil-group:not(.open) .fil-list { display: none; }
.fil-list { background: var(--surface); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 12px 12px; overflow: hidden; }

/* Eine Farbe: ganze Zeile antippbar (unsichtbarer Knopf darunter), nur ± und 🛒 liegen darüber */
.fil { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 10px;
  grid-template-areas: "sw l1 l1 chev" "sw l2 step chev"; align-items: center; gap: 4px 12px; padding: 10px 12px 10px 14px; border-top: 1px solid var(--border); }
.fil:first-child { border-top: 0; }
.fil-hit { position: absolute; inset: 0; width: 100%; border: 0; padding: 0; margin: 0; background: transparent; cursor: pointer; border-radius: inherit; }
.fil-hit:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.fil-hit:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.fil > :not(.fil-hit) { position: relative; pointer-events: none; }
.fil .fil-step, .fil .fil-tag.order { pointer-events: auto; }
.fil .fil-swatch { grid-area: sw; width: 28px; height: 28px; }
.fil.st-low .fil-swatch { outline: 2px solid var(--st-rueckfrage); outline-offset: 2px; }
.fil.st-empty .fil-swatch { outline: 2px solid var(--danger); outline-offset: 2px; }
.fil.st-empty .fil-l1 strong { opacity: .65; }
.fil-l1 { grid-area: l1; display: flex; align-items: center; gap: 6px; min-width: 0; height: 24px; }
.fil-l1 strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fil-tag { flex: none; font: inherit; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; white-space: nowrap;
  color: var(--muted); background: var(--surface-2); border: 1px solid transparent; }
.fil-tag.order { color: var(--st-druckbereit); background: color-mix(in srgb, var(--st-druckbereit) 10%, transparent); border: 1px dashed var(--st-druckbereit); cursor: pointer; }
.fil-tag.order:hover { border-style: solid; }
.fil-l2 { grid-area: l2; display: flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; white-space: nowrap; font-size: .82rem; }
.fil-rest { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.fil-st { font-weight: 700; }
.fil-st.s-low { color: var(--st-rueckfrage); } .fil-st.s-empty { color: var(--danger); }
.fil-step { grid-area: step; display: flex; align-items: center; gap: 4px; }
.fil-step .btn { width: 30px; height: 30px; padding: 0; justify-content: center; }
.fil-step-n { display: grid; justify-items: center; min-width: 32px; line-height: 1.05; }
.fil-step-n b { font-size: 1rem; }
.fil-step-n small { font-size: .66rem; color: var(--muted); }
.fil-chev { grid-area: chev; color: var(--muted); font-size: 1.2rem; }

@media (min-width: 900px) {
  main:has(.fil-layout) { max-width: 1400px; }
  .fil-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
  .fil-nav { display: grid; gap: 2px; position: sticky; top: 76px; }
  .fil-toolbar { display: none; }
  .fil-group { margin-top: 0; }
  .fil-group + .fil-group { margin-top: 22px; }
  .fil-group-head, .fil-group.open .fil-group-head { pointer-events: none; background: none; border: 0; border-radius: 0; padding: 2px 2px 8px; }
  .fil-group-head .chev { display: none; }
  .fil-sum { margin-left: 8px; text-align: left; }
  .fil-group:not(.open) .fil-list, .fil-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px;
    background: none; border: 0; border-radius: 0; overflow: visible; }
  .fil, .fil:first-child { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
}

/* „⋯ Mehr“-Fenster */
.fil-menu .menu-item { display: flex; align-items: center; gap: 12px; text-align: left; font: inherit; color: inherit; background: var(--surface-2);
  border: 1px solid transparent; border-radius: 12px; padding: 12px 14px; }
.fil-menu button.menu-item { cursor: pointer; }
.fil-menu button.menu-item:hover { border-color: var(--accent); }
.fil-menu .mi-ic { font-size: 1.3rem; }
.fil-menu .menu-item small { display: block; font-size: .8rem; }
.fil-menu .fil-public-mini { flex-wrap: wrap; font-size: .95rem; }

/* Farb-Fenster: einklappbare Abschnitte */
dialog.fil-detail { width: min(560px, calc(100vw - 24px)); }
.fil-detail .dlg-head .fil-swatch { width: 34px; height: 34px; }
.fd-head { flex: 1; min-width: 0; }
.fd-head h2 { margin: 0 0 2px; }
.fd-head .fil-status { font-size: .72rem; padding: 1px 7px; }
.fd-facts { margin: 0 0 8px; }
.fd-sec { border-top: 1px solid var(--border); }
.fd-sec > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 13px 0; cursor: pointer; font-weight: 700; }
.fd-sec > summary::-webkit-details-marker { display: none; }
.fd-sec > summary::after { content: "›"; color: var(--muted); font-size: 1.3rem; line-height: 1; transition: transform .15s; }
.fd-sec[open] > summary::after { transform: rotate(90deg); }
.fd-t { white-space: nowrap; }
.fd-sum { margin-left: auto; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fd-body { display: grid; gap: 10px; padding: 0 0 16px; }
.fd-body p { margin: 0; }
.fd-body .row { margin: 0; }
.fd-sub { font-weight: 600; margin-top: 4px; }
.fd-body .rests-form { display: grid; gap: 8px; }
.fd-props { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.fd-props dt { color: var(--muted); }
.fd-props dd { margin: 0; overflow-wrap: anywhere; }

/* Kleine Fenster: Kopf (Titel + ✕) bleibt oben, Knopfleiste bleibt unten – nichts muss gesucht werden */
.qf-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px;
  margin: -20px -20px 0; padding: 14px 12px 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.qf-head h2 { flex: 1; min-width: 0; }
.qf-x { flex: none; font-size: 1.05rem; line-height: 1; padding: 6px 10px; }
.qf-foot { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0 -20px -20px; padding: 10px 20px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--border); }
.sp-foot { display: grid; }
.sp-foot .sg-actions { margin: 0; }
.rest-btns { display: flex; gap: 2px; }
.sp-back { margin-left: auto; }
.sp-guide { justify-self: start; }
#spResult:empty { display: none; }

/* Farb-Fenster v2: Rollen direkt sichtbar; je Rest eine Karte – der Balken IST der Schieberegler */
.fd-rolls { display: grid; gap: 10px; padding-bottom: 14px; }
.fd-row { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.fd-lbl { flex: 1; min-width: 0; }
.fd-lbl small { display: block; color: var(--muted); font-size: .78rem; }
.fd-link { all: unset; color: var(--accent); font-weight: 600; cursor: pointer; }
.fd-link:hover { text-decoration: underline; }
.fd-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.fd-rolls .rests-form { display: grid; gap: 8px; }
.fd-rolls p { margin: 0; }
.fd-rolls .rests-empty { padding: 4px 0; }
.rest-card { background: var(--surface-2); border-radius: 12px; padding: 10px; display: grid; gap: 6px; }
.rest-bar { position: relative; display: block; height: 32px; cursor: pointer; }
.rest-bar b { position: absolute; left: 12px; top: 0; line-height: 32px; font-size: .9rem; pointer-events: none; color: var(--text);
  text-shadow: 0 0 3px var(--surface), 0 0 3px var(--surface); font-variant-numeric: tabular-nums; }
.rest-bar input[type=range] { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 32px; margin: 0; border-radius: 8px; cursor: pointer;
  background: linear-gradient(90deg, color-mix(in srgb, var(--pc) 85%, transparent) var(--lvl), var(--surface) var(--lvl)); box-shadow: inset 0 0 0 1px var(--border); }
.rest-bar input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 10px; height: 26px; border-radius: 5px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.rest-bar input[type=range]::-moz-range-thumb { width: 10px; height: 26px; border: 0; border-radius: 5px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.rest-bar input[type=range]::-moz-range-track { background: transparent; }
.rest-bar input[type=range]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rest-foot { display: flex; align-items: center; gap: 2px; }
.rest-foot .rest-where { flex: 1; min-width: 0; margin-right: 4px; }
.rest-foot select.rest-where { width: auto; height: 34px; font-size: .85rem; padding: 4px 8px; background-color: var(--surface); }
.rest-foot span.rest-where { padding-left: 2px; }
.fil-detail .fd-sec:first-of-type { border-top: 1px solid var(--border); }

/* Einstellungen → KI (Claude) */
.set-sub { font-size: .95rem; margin: 18px 0 8px; display: flex; align-items: center; gap: 4px; }
.ai-tasks { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.ai-task { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px; }
.ai-task + .ai-task { border-top: 1px solid var(--border); }
.ai-task-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.set-sub .info-i { display: inline-grid; width: 18px; height: 18px; font-size: .7rem; }
.set-sub { flex-wrap: wrap; }
.ai-balance-label { display: inline-flex; align-items: center; gap: 8px; }
.ai-task-icon { font-size: 1.1rem; text-align: center; }
.ai-task-use { white-space: nowrap; font-variant-numeric: tabular-nums; text-align: right; }
.ai-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 8px; }
.ai-stat { display: flex; flex-direction: column; gap: 2px; background: var(--surface-2); border-radius: 10px; padding: 8px 12px; }
.ai-stat strong { font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.ai-stat.ai-low strong { color: var(--danger); }
#aiBalanceForm { margin-bottom: 12px; }
.ai-source { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 30px; margin: 0; }
.ai-source .btn.sm { padding: 2px 10px; }
.ai-key { min-height: 44px; gap: 8px; }
.ai-key + .ai-key, .ai-key + details { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }
@media (max-width: 599px) {
  .ai-task { grid-template-columns: 28px 1fr; }
  .ai-task-use { grid-column: 2; text-align: left; }
  .ai-balance-label { width: 100%; justify-content: space-between; }
}

/* Auftrags-Vorschlag im Hilfe-Chat */
.draft-card { margin-top: 8px; padding: 10px; border: 1px solid var(--border, rgba(127,127,127,.3)); border-radius: 10px; }
.draft-rows { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; }
.draft-rows > span:nth-child(2n) { overflow-wrap: anywhere; }
.draft-actions { margin-top: 10px; gap: 8px; flex-wrap: wrap; }

/* Fenster „🖨️ Druck starten“: Drucker-Auswahl, darunter „✋ Anders gestartet“ */
.start-dlg .sd-list { display: grid; gap: 8px; }
.start-dlg .sd-row { display: flex; align-items: center; min-height: 40px; }
.start-dlg .sd-btn { width: 100%; justify-content: flex-start; text-align: left; white-space: normal; }
.start-dlg .sd-manual { border-top: 1px solid var(--border); padding-top: 10px; }
.start-dlg .sd-manual summary { cursor: pointer; padding: 6px 0; }
.start-dlg .sd-manual[open] { display: grid; gap: 10px; }

/* Druckdatei wählen: 🔄 dreht sich, solange die Cloud abgefragt wird */
#pkRefresh.spin { animation: pk-spin 1s linear infinite; }
@keyframes pk-spin { to { transform: rotate(360deg); } }
.pk-printer { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Auftrag → Bearbeiten → Platten & Farben */
.split-label { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 600; font-size: .9rem; margin: 14px 0 6px; }
.split-cols, .split-row { display: grid; grid-template-columns: minmax(0, 1fr) 88px 88px 34px; gap: 8px; align-items: center; }
.split-cols { margin-bottom: 4px; padding-left: 4px; }
.split-row { margin-bottom: 6px; }
.split-color { display: flex; align-items: center; gap: 6px; min-width: 0; }
.split-color input { flex: 1; min-width: 0; }
.split-color .swatch { flex: none; margin: 0; }
.split-row .unit-input { width: 100%; }
.split-row .unit-input input { width: auto; flex: 1; min-width: 0; }
.split-foot { gap: 10px; flex-wrap: wrap; margin-top: 4px; }
@media (max-width: 560px) {
  .split-cols, .split-row { grid-template-columns: minmax(0, 1fr) 52px 52px 28px; gap: 6px; }
  .split-row .unit-input .unit { display: none; } /* Spaltenüberschrift sagt „Stück“ – Platz für den Farbnamen */
  .split-row .unit-input input { padding-right: 10px; text-align: center; }
  .split-row [data-sp-del] { padding: 4px; }
}

/* Kamera: Hinweis, wenn das Bild schwarz bleibt */
.cam-hint { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--st-rueckfrage); font-size: .85rem; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Platten & Farben: „Wie werden die Farben gedruckt?“ */
.mode-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mode-opt { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: var(--surface); }
.mode-opt:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.mode-opt input { width: auto; flex: none; margin: 3px 0 0; }
.mode-opt { justify-content: flex-start; text-align: left; }
.mode-opt > span { display: flex; flex-direction: column; gap: 2px; font-size: .9rem; }
.mode-why { margin: 6px 0 0; min-height: 1em; }
@media (max-width: 560px) { .mode-pick { grid-template-columns: 1fr; } }

/* Teil-Platten im Auftrag (Überblick) und im Start-Fenster */
.parts-box { display: block; }
.parts-box > .cf-label { display: inline-block; margin-bottom: 6px; }
.part-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }
.part-row .cf-img { width: 48px; height: 48px; border-radius: 8px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.part-row .cf-img img { width: 100%; height: 100%; object-fit: cover; }
.part-row .cf-img .swatch { width: 18px; height: 18px; margin: 0; }
.part-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.part-text > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.part-btns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
@media (max-width: 560px) { .part-row { grid-template-columns: 40px minmax(0, 1fr); } .part-row .cf-img { width: 40px; height: 40px; } .part-btns { grid-column: 1 / -1; justify-content: flex-start; } }
.cam-part { display: flex; align-items: center; gap: 10px; margin: 8px 18px 0; }
.cam-part select { flex: 1; min-width: 0; }

/* Teil-Platten: mehrere Vorschaubilder in einer Kachel (2 nebeneinander, 3 = eins groß + zwei klein, 4 = 2×2) */
.part-thumbs { display: grid; width: 100%; height: 100%; gap: 1px; background: var(--border); }
.part-thumbs img { width: 100%; height: 100%; object-fit: cover; min-width: 0; min-height: 0; background: var(--surface-2); }
.part-thumbs.n2 { grid-template-columns: 1fr 1fr; }
.part-thumbs.n3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.part-thumbs.n3 img:first-child { grid-row: 1 / 3; }
.part-thumbs.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.part-row .cf-img { width: 56px; height: 56px; }

/* ---- Auftrag: Überblick direkt bearbeitbar (Bestellung, Druckplan, Kosten) – docs/druckplan.md ---- */
.dr-body .card.order, .dr-body .card.plan, .model-form { padding: 12px 14px; margin: 0 0 12px; box-shadow: none; border-radius: 12px; }
.order h3, .plan h3 { margin: 0; font-size: .95rem; }
.order h3 { margin-bottom: 10px; }
.order-grid { display: grid; gap: 10px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.order-grid .full { grid-column: 1 / -1; }
.order-grid select, .order-grid input[type=date] { width: 100%; }
.order-grid textarea { min-height: 54px; resize: vertical; }
.order-grid .field > .hint { font-weight: 400; }
@media (max-width: 560px) { .order-grid { grid-template-columns: 1fr; } }
.model-wrap { display: flex; gap: 8px; align-items: stretch; margin-bottom: 12px; }
.model-wrap .model-card { flex: 1; min-width: 0; margin: 0; }
.model-wrap .model-edit { align-self: flex-start; }
.model-form { display: grid; gap: 10px; }
/* gespeichert / fehlerhaft */
.just-saved { animation: saved-flash 1.4s ease-out; }
@keyframes saved-flash { 0% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--st-abgeschlossen) 70%, transparent); } 100% { box-shadow: 0 0 0 3px transparent; } }
.invalid-field, .plan-row.invalid .pl-color { outline: 2px solid var(--danger); outline-offset: -1px; }

/* Druckplan */
.plan-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.plan-head .plan-sum { margin-left: auto; }
.plan .plan-kind { display: flex; width: 100%; margin: 0 0 6px; }
.plan .plan-kind button { flex: 1; padding: 8px 4px; }
.plan-why { margin: 0 0 10px; }
.plan-rows { display: grid; gap: 8px; }
.plan-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto auto 32px; grid-template-areas: "sw color n step del" "file file file file file";
  gap: 6px 8px; align-items: center; }
.plan-row:not(.with-file) { grid-template-areas: "sw color n step del"; }
.plan-row .pl-sw { grid-area: sw; width: 18px; height: 18px; }
.plan-row .pl-color { grid-area: color; min-width: 0; width: 100%; }
.plan-row .pl-n { grid-area: n; justify-self: start; }
.plan-row .pl-n input, .plan-foot .unit-input input { width: 46px; }
.plan-row .pl-step { grid-area: step; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.plan-row .pl-step b { min-width: 40px; text-align: center; font-variant-numeric: tabular-nums; }
.plan-row .pl-step .pl-unit { display: none; }
.plan-row .pl-del { grid-area: del; }
.plan-row.with-file { border-top: 1px solid var(--border); padding-top: 8px; }
.plan-row.with-file:first-child { border-top: 0; padding-top: 0; }
.pl-file { grid-area: file; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding-left: 28px; }
.pl-thumb img { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; display: block; }
.pl-fname { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.pl-fbtns { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.plan-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 10px 0 0; }
.plan-field { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 600; }
.plan .cloudfile { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--border); }
@media (max-width: 560px) {
  .plan-row { grid-template-columns: 20px minmax(0, 1fr) auto 32px; grid-template-areas: "sw color color del" ". n step step" "file file file file"; }
  .plan-row:not(.with-file) { grid-template-areas: "sw color color del" ". n step step"; }
  .plan-row .pl-step { justify-self: end; }
  .pl-file { padding-left: 0; }
}
.cost-inputs { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.cost-inputs .field { flex-direction: row; align-items: center; gap: 8px; }
.tag.plan-count { color: var(--muted); }
.kc-plan { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.plan-why.ask { color: var(--text); background: color-mix(in srgb, var(--st-rueckfrage) 10%, transparent); border-radius: 8px; padding: 8px 10px; }
.plan-ask { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pl-no { font-size: .85rem; white-space: nowrap; }

/* Kosten: offen / bezahlt (Board, Bereich „Offene Kosten“, Abholung) – 22.11.2026 */
.tag.money.open { border-color: color-mix(in srgb, var(--st-rueckfrage) 55%, transparent); background: color-mix(in srgb, var(--st-rueckfrage) 12%, transparent); }
.tag.money.paid { color: var(--muted); }
.money-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; margin-bottom: 14px; }
.money-panel > summary { cursor: pointer; padding: 10px 14px; display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; list-style: none; }
.money-panel > summary::-webkit-details-marker { display: none; }
.money-panel > summary::before { content: '›'; font-weight: 700; color: var(--muted); transition: transform .15s; }
.money-panel[open] > summary::before { transform: rotate(90deg); }
.money-panel[open] > summary { border-bottom: 1px solid var(--border); }
.mp-title { display: inline-flex; gap: 8px; align-items: baseline; white-space: nowrap; }
.mp-total { color: var(--st-rueckfrage); font-variant-numeric: tabular-nums; }
.mp-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 200px; min-width: 0; }
.mp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; background: var(--surface-2);
  font-size: .85rem; white-space: nowrap; }
.mp-chip b { font-variant-numeric: tabular-nums; }
.mp-hint { margin-left: auto; }
.mp-body { padding: 10px 14px 14px; }
.mp-help { margin: 0 0 10px; }
.mp-groups { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); align-items: start; }
.money-friend { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.mf-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface-2); }
.mf-name { display: grid; flex: 1; min-width: 0; }
.mf-rows { display: grid; }
.mf-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto 72px; gap: 10px; align-items: center; padding: 7px 12px;
  border-top: 1px solid var(--border); font-weight: 400; font-size: .9rem; cursor: pointer; min-height: 38px; }
.mf-row:first-child { border-top: 0; }
.mf-row input { width: 18px; height: 18px; margin: 0; }
.mf-row:has(input:not(:checked)) { opacity: .55; }
.mf-title { text-align: left; padding: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mf-state { white-space: nowrap; }
.mf-amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 560px) {
  .mf-row { grid-template-columns: 20px minmax(0, 1fr) 68px; grid-template-areas: "cb t a" "cb s a"; row-gap: 0; }
  .mf-row input { grid-area: cb; } .mf-title { grid-area: t; } .mf-state { grid-area: s; } .mf-amt { grid-area: a; }
  .mp-hint { display: none; }
}
.money-job { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; font-weight: 400; font-size: .88rem; cursor: pointer; min-height: 32px; }
.money-job input { width: 18px; height: 18px; margin: 0; }
.mj-title { display: grid; min-width: 0; overflow-wrap: anywhere; }
.mj-title .linklike { text-align: left; padding: 0; }
.mj-amt { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.mj-amt.paid { color: var(--muted); font-weight: 400; }
.pu-pick { list-style: none; padding-left: 0; }
.pu-money { margin-top: -2px; }
.pay-row.paid { color: var(--st-abgeschlossen); }
.pu-head .mf-sum { flex: none; margin-left: auto; font-variant-numeric: tabular-nums; }
.pu-actions { flex-wrap: wrap; }
.pu-actions .btn { white-space: nowrap; }

/* Warteschlange sortieren + Hinweis „Stück pro Platte“ (24.11.2026) */
.q-sort-open { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.qs-levels, .qs-friends ol, .qs-preview ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.qs-level { display: grid; grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.qs-level select { min-width: 0; width: 100%; min-height: 36px; }
.qs-no { color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.qs-btns { display: inline-flex; gap: 2px; }
.qs-btns .btn { min-width: 32px; padding: 4px 6px; }
.qs-friends { border: 1px solid var(--border); border-radius: 10px; padding: 10px; display: grid; gap: 8px; }
.qs-friends li { display: grid; grid-template-columns: 22px auto minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.qs-fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.qs-preview ol { counter-reset: qs; max-height: 40vh; overflow: auto; margin-top: 6px; }
.qs-preview li { counter-increment: qs; display: grid; grid-template-columns: 26px minmax(0, 1fr); column-gap: 6px; font-size: .85rem; }
.qs-preview li::before { content: counter(qs) "."; color: var(--muted); grid-row: span 2; }
.qs-ptitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .qs-level { grid-template-columns: 22px minmax(0, 1fr) auto; } .qs-level [data-qs-dir], .qs-level .qs-dirtext { grid-column: 2 / span 2; grid-row: 2; } .qs-level .qs-dirtext { display: none; } .qs-level .qs-btns { grid-row: 1; grid-column: 3; } .qs-level + .qs-level { border-top: 1px solid var(--border); padding-top: 6px; } }
.tag.warn-tag { border-color: color-mix(in srgb, var(--st-rueckfrage) 55%, transparent); color: var(--st-rueckfrage); }
.quiet-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.quiet-form label { display: inline-flex; align-items: center; gap: 8px; }

/* Profilbild vom Freund eingereicht: roter Punkt, Vergleich jetzt/neu (24.11.2026) */
button.avatar-upload { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: inherit; }
.avatar-new { position: relative; }
.avatar-dot { position: absolute; top: -2px; right: -2px; width: 14px; height: 14px; border-radius: 50%; background: var(--danger);
  border: 2px solid var(--surface); box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 60%, transparent); animation: dot-pulse 1.8s ease-out infinite; }
@keyframes dot-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 55%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.avatar-compare { display: flex; align-items: center; justify-content: center; gap: 18px; }
.avatar-compare figure { margin: 0; display: grid; justify-items: center; gap: 6px; }
.avatar.xl { width: 96px; height: 96px; font-size: 2rem; }
.avatar-arrow { font-size: 1.6rem; color: var(--muted); }
/* Portal: eigenes Profilbild */
.me-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.me-head h1 { margin: 0; }
.me-avatar { position: relative; cursor: pointer; flex: none; }
.me-avatar .avatar { width: 52px; height: 52px; font-size: 1.2rem; }
.me-avatar .avatar-cam { position: absolute; right: -4px; bottom: -4px; font-size: .8rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; }
.me-pending { font-size: .8rem; }
.pc-no { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px; background: var(--surface-2);
  color: var(--muted); font-size: .72rem; font-weight: 700; margin-left: 4px; }
.tag.wish-tag { border-color: color-mix(in srgb, #f5b301 60%, transparent); background: color-mix(in srgb, #f5b301 14%, transparent); }

/* Portal: Kosten, Filter, Wunsch (24.11.2026) */
.cost-card { margin-bottom: 20px; border-left: 4px solid var(--st-rueckfrage); display: grid; gap: 6px; }
.cost-card.all-paid { border-left-color: var(--st-abgeschlossen); }
.cost-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.cost-list summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: .9rem; }
.cost-list ul { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; }
.cost-list li { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; }
.cost-list li b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.job-filter { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-bottom: 12px; }
.job-filter .chips { margin: 0; flex: 1 1 auto; }
.job-filter select { width: auto; }
.job .wish { font-size: .8rem; color: #b98300; font-weight: 600; }
.wish-row { margin-top: 10px; display: flex; align-items: center; gap: 6px; }
.wish-row .btn.on { border-color: #f5b301; background: color-mix(in srgb, #f5b301 14%, transparent); }
.mp-help .info-i { display: inline-grid; width: 18px; height: 18px; font-size: .7rem; vertical-align: middle; margin-left: 4px; }
@media (max-width: 560px) {
  .mf-head { flex-wrap: wrap; }
  .mf-head [data-pay] { flex: 1 1 100%; }
}
dialog.quick:has(.qs-form) { width: min(600px, calc(100vw - 24px)); max-width: min(600px, calc(100vw - 24px)); }
.qs-preview li .muted { grid-column: 2; }
@media (min-width: 561px) { .qs-preview li { grid-template-columns: 26px minmax(0, 1fr) auto; } .qs-preview li::before { grid-row: auto; } .qs-preview li .muted { grid-column: 3; text-align: right; } }
