/* Coco. Designwelt: Offen und Zu, leise Fassung. Tokens zuerst, dann Bausteine, dann Ansichten. */
@font-face { font-family: 'Instrument Sans'; src: url('../assets/fonts/instrument-sans-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('../assets/fonts/instrument-sans-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Instrument Sans'; src: url('../assets/fonts/instrument-sans-latin-600-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }

:root {
  color-scheme: light;
  --ground: #FAFAF8; --surface: #FFFFFF; --sunken: #F3F4F2;
  --ink: #12171A; --ink-2: #4A5359; --ink-3: #6B7378;
  --line: #ECEDEB; --line-2: #DCDFDD; --hatch: rgba(28,34,38,.05); --hatch-load: rgba(28,34,38,.17);
  --accent: #E8542A; --accent-ink: color-mix(in oklab, var(--accent) 72%, #000); --accent-soft: color-mix(in oklab, var(--accent) 20%, #fff); --on-accent: #12171A;
  --primary: #12171A; --on-primary: #FFFFFF; --primary-hover: #2A3136;
  --red-bg: #FDEBEC; --red: #9F2F2D; --blue-bg: #E1F3FE; --blue: #1F6C9F; --green-bg: #EDF3EC; --green: #346538; --yellow-bg: #FBF3DB; --yellow: #856000;
  --chart-a: #E8542A; --chart-b: #12171A;
  --orb-bg: #12171A; --orb-1: var(--accent); --orb-2: #F2A65A; --orb-3: #5A1F0C;
  --shadow: 0 8px 28px rgba(18,23,26,.08), 0 1px 2px rgba(18,23,26,.05);
  --font: 'Instrument Sans', 'Helvetica Neue', Arial, sans-serif; --display: var(--font); --cond: var(--font); --mono: var(--font);
  --ease-out: cubic-bezier(.23, 1, .32, 1); --ease-in-out: cubic-bezier(.77, 0, .175, 1); --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --rail: 232px; --gutter: clamp(20px, 2.6vw, 48px); --r: 14px; --r2: 14px; --r-s: 8px; --r-l: 28px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #12171A; --surface: #1C2226; --sunken: #252C31;
  --ink: #F2F3F2; --ink-2: #BFC6CA; --ink-3: #9AA3A8;
  --line: #2C3439; --line-2: #454F55; --hatch: rgba(233,233,231,.06); --hatch-load: rgba(233,233,231,.16);
  --accent: #E8542A; --accent-ink: color-mix(in oklab, var(--accent) 62%, #fff); --accent-soft: color-mix(in oklab, var(--accent) 26%, #12171A); --on-accent: #12171A;
  --primary: #F2F3F2; --on-primary: #12171A; --primary-hover: #FFFFFF;
  --red-bg: #3A1F1E; --red: #F2A9A5; --blue-bg: #18303E; --blue: #8CC8EC; --green-bg: #1E3022; --green: #A3D0A6; --yellow-bg: #352B12; --yellow: #E6C674;
  --chart-a: #E8542A; --chart-b: #C9CFD2;
  --orb-bg: #0C1012; --orb-1: var(--accent); --orb-2: #F7B070; --orb-3: #4A1A0A;
  --shadow: 0 10px 30px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]):not([data-theme="dark"]) {
  color-scheme: dark;
  --ground: #12171A; --surface: #1C2226; --sunken: #252C31;
  --ink: #F2F3F2; --ink-2: #BFC6CA; --ink-3: #9AA3A8;
  --line: #2C3439; --line-2: #454F55; --hatch: rgba(233,233,231,.06); --hatch-load: rgba(233,233,231,.16);
  --accent: #E8542A; --accent-ink: color-mix(in oklab, var(--accent) 62%, #fff); --accent-soft: color-mix(in oklab, var(--accent) 26%, #12171A); --on-accent: #12171A;
  --primary: #F2F3F2; --on-primary: #12171A; --primary-hover: #FFFFFF;
  --red-bg: #3A1F1E; --red: #F2A9A5; --blue-bg: #18303E; --blue: #8CC8EC; --green-bg: #1E3022; --green: #A3D0A6; --yellow-bg: #352B12; --yellow: #E6C674;
  --chart-a: #E8542A; --chart-b: #C9CFD2;
  --orb-bg: #0C1012; --orb-1: var(--accent); --orb-2: #F7B070; --orb-3: #4A1A0A;
  --shadow: 0 10px 30px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
} }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overscroll-behavior: none; }
body { background: var(--ground); color: var(--ink); font: 400 15px/1.5 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; }
::selection { background: var(--ink); color: var(--surface); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: var(--r-s); }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.ic { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -.2em; }
.grow { flex: 1; }
.muted { color: var(--ink-2); }
.prose { max-width: 62ch; color: var(--ink-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.no { font: 500 12.5px/1 var(--font); color: var(--ink-2); }
.label { font: 500 12.5px/1.2 var(--font); color: var(--ink-3); }

/* Knöpfe */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 500; font-size: 14px; white-space: nowrap; user-select: none; transition: transform 120ms var(--ease-out), background-color 150ms ease, border-color 150ms ease; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.btn-ic { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--ink-2); transition: transform 120ms var(--ease-out), background-color 150ms ease; position: relative; }
.btn-ic:active { transform: scale(.94); }
.btn-ic .ic { width: 19px; height: 19px; }
.link { color: var(--ink); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.badge { position: absolute; top: 2px; right: 1px; min-width: 16px; height: 16px; padding: 0 5px; border-radius: 999px; background: var(--ink); color: var(--surface); font: 500 10px/16px var(--font); text-align: center; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--sunken); }
  .btn-primary:hover { background: var(--primary-hover); }
  .btn-ic:hover { background: var(--sunken); color: var(--ink); }
}

.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; font: 500 12.5px/1 var(--font); white-space: nowrap; background: var(--sunken); color: var(--ink-2); }
.tag-red { background: var(--red-bg); color: var(--red); } .tag-blue { background: var(--blue-bg); color: var(--blue); } .tag-green { background: var(--green-bg); color: var(--green); } .tag-yellow { background: var(--yellow-bg); color: var(--yellow); }

.av { --av: #54707A; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--av); color: #fff; font: 500 11.5px/1 var(--font); flex: none; user-select: none; }
.av.sm { width: 24px; height: 24px; font-size: 10px; }
.av.lg { width: 44px; height: 44px; font-size: 15px; }
.av-empty { background: var(--sunken); color: var(--ink-3); border: 1px dashed var(--line-2); }
.av-coco { background: var(--accent); color: var(--on-accent); }

/* Felder */
.form { display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 5px; min-width: 0; align-content: start; }
.field-label { font: 500 13px/1.2 var(--font); color: var(--ink-2); }
.field-hint { font-size: 13px; color: var(--ink-3); }
.form-error { color: var(--red); font-size: 14px; }
input:not([type=checkbox]):not([type=color]), select, textarea { width: 100%; min-height: 44px; padding: 9px 14px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); font-size: 15px; transition: border-color 150ms ease, box-shadow 150ms ease; }
textarea { resize: vertical; min-height: 76px; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 12%, transparent); }
@media (pointer: coarse) { input:not([type=checkbox]):not([type=color]), select, textarea { font-size: 16px; min-height: 44px; } }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px 14px; }
.checks label { display: flex; align-items: center; gap: 8px; font-size: 14px; min-height: 28px; }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }

/* Grundgerüst: Menü links, Inhalt rechts */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); height: 100dvh; }
.rail { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--surface); padding: 20px 14px 12px; gap: 3px; min-height: 0; }
.brand { display: flex; align-items: center; gap: 9px; padding: 6px 8px 14px; font-weight: 500; font-size: 17px; letter-spacing: -.01em; min-width: 0; }
.brand small { display: block; font: 500 12px/1.2 var(--font); color: var(--ink-3); overflow-wrap: anywhere; }
.brand small[hidden] { display: none; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 12px; border-radius: 10px; color: var(--ink-2); font-weight: 400; font-size: 14.5px; text-decoration: none; position: relative; transition: background-color 120ms ease, color 120ms ease; }
.nav-item .ic { width: 18px; height: 18px; }
.nav-item[aria-current="page"] { background: var(--accent-soft); color: var(--ink); font-weight: 500; }
.nav-item[aria-current="page"] .ic { color: var(--accent-ink); }
.nav-item .count { margin-left: auto; font: 500 12px/1 var(--font); color: var(--ink-2); }
.nav-item[aria-current="page"] .count { color: inherit; }
.nav-item .count.hot { color: var(--red); }
.rail-foot { margin-top: auto; display: flex; align-items: center; gap: 2px; padding-top: 10px; border-top: 1px solid var(--line); min-width: 0; }
.rail-me { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; padding: 4px; border-radius: 999px; text-align: left; }
.rail-me span.t { min-width: 0; line-height: 1.2; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-me small { display: block; color: var(--ink-3); font-size: 12px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (hover: hover) and (pointer: fine) { .nav-item:hover, .rail-me:hover { background: var(--sunken); } }

.main { min-width: 0; min-height: 0; overflow: auto; position: relative; overscroll-behavior: contain; }
.page { padding: 32px var(--gutter) 120px; }
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; min-height: 44px; }
.page-head h1 { font: 500 30px/1.1 var(--font); letter-spacing: -.025em; text-wrap: balance; min-width: 0; overflow-wrap: anywhere; }
.page-head .sub { color: var(--ink-2); font-size: 14px; width: 100%; margin-top: -6px; }
.seg-ctl { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--sunken); }
.seg-ctl button { min-height: 34px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.seg-ctl button[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filter-row select { width: auto; min-height: 38px; padding: 4px 14px; font-size: 14px; border-radius: 999px; }
.panel { border: 1px solid var(--line); border-radius: 20px; background: var(--surface); overflow: hidden; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); min-height: 56px; }
.panel-head h2 { font: 500 16px/1.2 var(--font); letter-spacing: -.01em; }
.panel-body { padding: 18px; }
.empty { padding: 28px 16px; text-align: center; color: var(--ink-2); }
.empty strong { display: block; color: var(--ink); font-weight: 500; margin-bottom: 2px; }
.empty p { font-size: 14px; }
.empty .btn { margin-top: 10px; }

/* Werksplan */
.plan-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; height: 100%; min-height: 0; }
.plan-stage { min-width: 0; min-height: 0; padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 10px; overflow: auto; }
.plan-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-bar h1 { font: 500 24px/1.05 var(--display); letter-spacing: -.025em; }
.sheet-frame { position: relative; flex: 1; min-height: 480px; border-radius: var(--r-l); background-color: var(--sunken); background-image: radial-gradient(circle, var(--line-2) 1.2px, transparent 1.6px); background-size: calc(100% / var(--cols, 24)) calc(100% / var(--rows, 16)); background-position: calc(-50% / var(--cols, 24)) calc(-50% / var(--rows, 16)); margin: 14px 14px 0; }
.zone { position: absolute; display: flex; font: 500 9.5px/1 var(--font); color: var(--ink-3); user-select: none; pointer-events: none; }
.zone-top { left: 0; right: 0; top: -14px; } .zone-top span { flex: 1; text-align: center; }
.zone-left { top: 0; bottom: 0; left: -13px; flex-direction: column; } .zone-left span { flex: 1; display: grid; place-items: center; }
.roads { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.roads path { fill: none; vector-effect: non-scaling-stroke; }
.roads .bed { stroke: var(--line-2); stroke-width: 10px; stroke-linejoin: round; stroke-linecap: round; }
.roads .lane { stroke: var(--sunken); stroke-width: 2px; stroke-dasharray: 1 7; stroke-linecap: round; }
.roads .lane.live { stroke: var(--accent); stroke-width: 4px; stroke-dasharray: none; }
.parcel { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 3.5px solid var(--accent); background: var(--surface); border-radius: 50%; pointer-events: none; z-index: 3; }
.parcel.agent { background: var(--ink); width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; }

.hall { position: absolute; display: flex; flex-direction: column; min-width: 0; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; z-index: 2; transition: border-color 150ms ease, box-shadow 150ms ease; }
.hall.is-hq { border: 0; background: #12171A; color: #FFFFFF; }
.hall.is-hq .hall-code, .hall.is-hq .hall-nums, .hall.is-hq .agent-dot { color: #C9CFD2; }
.hall.is-hq .hall-nums b { color: #FFFFFF; }
.hall.is-active { outline: 2px solid var(--ink); outline-offset: 2px; }
.hall.hit { animation: hall-hit 700ms var(--ease-out); }
@keyframes hall-hit { 0% { background-color: var(--accent-soft); } 100% { background-color: var(--surface); } }
.hall-open { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 12px 14px 10px; text-align: left; width: 100%; }
.hall-top { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.hall-code { font: 500 11.5px/1 var(--font); color: var(--ink-2); flex: none; }
.hall-name { font: 500 16px/1.15 var(--display); letter-spacing: -.01em; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hall-nums { display: flex; gap: 12px; margin-top: 4px; font-size: 12.5px; color: var(--ink-2); flex-wrap: wrap; }
.hall-nums b { font: 500 15px/1 var(--font); color: var(--ink); display: inline-block; margin-right: 3px; }
.hall-nums .late b { color: var(--red); }
.lbl-short { display: none; }
.hall-nums .rolled { animation: roll 420ms var(--ease-out); }
@keyframes roll { from { transform: translateY(70%); opacity: 0; } to { transform: none; opacity: 1; } }
.hall-rooms { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(var(--room-cols, 3), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 4px; margin-top: 8px; overflow: hidden; }
.room { min-width: 0; min-height: 0; padding: 4px 6px; border-radius: 10px; background: var(--sunken); font: 500 11px/1.12 var(--font); color: var(--ink-2); overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 1px; }
.room-name { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: break-word; }
.room b { font: 500 13px/1 var(--font); color: var(--ink); align-self: flex-end; }
.room.load { background: color-mix(in srgb, var(--accent) calc(6% + var(--load) * 26%), var(--surface)); color: var(--ink); }
.room.load b { color: var(--ink); }
.hall-foot { display: flex; align-items: center; gap: 5px; padding-top: 5px; min-height: 26px; }
.hall-people { display: flex; gap: 3px; }
.agent-dot { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; font: 500 11.5px/1 var(--font); color: var(--ink-2); white-space: nowrap; }
.agent-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.agent-dot.on::before { background: var(--green); }
.agent-dot.busy::before { background: var(--accent); animation: blink 1.1s linear infinite; }
@keyframes blink { 50% { opacity: .25; } }
.hq-core { flex: 1; min-height: 0; display: flex; align-items: center; gap: 12px; }
.hq-orb, .coco-core .orb, .auth-orb { background: var(--orb-bg); border-radius: 50%; }
.hq-orb { position: relative; width: clamp(64px, 7vw, 112px); aspect-ratio: 1; flex: none; }
.hq-orb canvas { width: 100%; height: 100%; display: block; -webkit-mask-image: radial-gradient(circle, #000 62%, transparent 70%); mask-image: radial-gradient(circle, #000 62%, transparent 70%); }

.drawn { position: relative; margin-top: 4px; }
.drawn > .zone { display: none; }
.drawn .zone-top { top: -14px; }
.drawn-sheet { padding: 0; }
.drawn-sheet .panel { margin-bottom: 14px; }
.drawn-sheet .kpis { margin: 0 0 14px; }
.page-fill { display: flex; flex-direction: column; height: 100%; padding-bottom: 22px; }
.drawn-fill { flex: 1; min-height: 0; display: flex; }
.drawn-fill .board { flex: 1; min-height: 0; height: 100%; }
.titleblock.strip { position: static; width: auto; min-width: 0; margin: 12px 0 0 auto; max-width: 620px; display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; border: 0; border-radius: 16px; background: var(--sunken); }
.titleblock.strip div, .titleblock.strip div:nth-child(2n) { border-bottom: 0; border-right: 1px solid var(--line); }
.titleblock.strip div:last-child { border-right: 0; }
.titleblock.strip .wide { grid-column: auto; font-size: 13px; }
.titleblock { position: absolute; right: 10px; bottom: 10px; width: 25%; min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; font-size: 12px; z-index: 2; }
.titleblock div { padding: 5px 10px 6px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); min-width: 0; }
.titleblock div:nth-child(2n) { border-right: 0; } .titleblock div:nth-last-child(-n+2) { border-bottom: 0; }
.titleblock .wide { grid-column: 1 / -1; border-right: 0; font: 500 15px/1.2 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titleblock small { display: block; font: 500 10.5px/1.2 var(--font); color: var(--ink-3); }

.plan-edit .hall { cursor: grab; touch-action: none; } .plan-edit .hall:active { cursor: grabbing; }
.plan-edit .hall-open { pointer-events: none; }
.plan-edit .sheet-frame { background-color: var(--accent-soft); }
.resize-h { position: absolute; right: 6px; bottom: 6px; width: 14px; height: 14px; cursor: nwse-resize; border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); border-radius: 0 0 6px 0; touch-action: none; }
.hall-edit { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line-2); border-radius: 50%; }

.plan-side { border-left: 1px solid var(--line); background: var(--surface); min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.side-head { padding: 18px 18px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; min-height: 60px; }
.side-head h2 { font: 500 17px/1.1 var(--display); letter-spacing: -.015em; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.side-scroll { overflow: auto; flex: 1; min-height: 0; overscroll-behavior: contain; }
.side-sect { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.side-sect:last-child { border-bottom: 0; }
.side-sect > .label { display: flex; justify-content: space-between; margin-bottom: 7px; }
.stage-bars { display: grid; gap: 3px; }
.stage-bar { display: grid; grid-template-columns: minmax(0, 1fr) 24px; gap: 8px; align-items: center; font-size: 13.5px; min-height: 22px; }
.stage-bar b { font: 500 13px/1 var(--font); text-align: right; }
.stage-bar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }

/* Aufgabenzeilen */
.tasks { display: grid; }
.task { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 2px; border-bottom: 1px solid var(--line); min-height: 50px; overflow: hidden; }
.task:last-child { border-bottom: 0; }
.check { width: 34px; height: 44px; display: grid; place-items: center; }
.check svg { width: 20px; height: 20px; border: 1.5px solid var(--ink-3); border-radius: 50%; padding: 2px; transition: background-color 150ms ease, border-color 150ms ease, transform 120ms var(--ease-out); }
.check:active svg { transform: scale(.9); }
.check path { fill: none; stroke: var(--on-accent); stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 200ms var(--ease-out); }
.task.is-done .check svg { background: var(--accent); border-color: var(--accent); }
.task.is-done .check path { stroke-dashoffset: 0; }
.task-main { min-width: 0; text-align: left; padding: 7px 8px 7px 2px; display: grid; gap: 2px; }
.task-title { font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.prio { color: var(--red); margin-right: 4px; }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 9px; font-size: 12.5px; color: var(--ink-2); line-height: 1.35; min-width: 0; }
.task-meta > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.meta-agent .ic { margin-right: 3px; }
.task-side { display: flex; align-items: center; gap: 8px; padding-right: 8px; }
.due { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.due.late { color: var(--red); font-weight: 500; }
.task.is-done .task-title { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1px; }
.task.is-void { opacity: .6; }
.stamp { position: absolute; right: 44px; top: 50%; transform: translateY(-50%); background: var(--green-bg); color: var(--green); font: 500 12px/1 var(--font); padding: 5px 10px; border-radius: 999px; pointer-events: none; animation: stamp 260ms var(--ease-out); }
@keyframes stamp { from { transform: translateY(-50%) scale(1.3); opacity: 0; } }
.group-title { display: flex; align-items: center; gap: 8px; padding: 18px 2px 7px; font: 500 13px/1.2 var(--font); color: var(--ink-2); border-bottom: 1px solid var(--line); }
.group-title.hot { color: var(--red); }
.group-title b { font: 500 12px/1 var(--font); }
.quick { display: flex; gap: 8px; margin-bottom: 8px; }

/* Bänder mit Schritten */
.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; }
.seg { display: block; min-width: 0; }
.seg i { display: block; height: 6px; background: var(--sunken); border-radius: 999px; }
.seg.done i { background: var(--accent); }
.seg.now i { background: var(--ink); }
.strip-labels .seg span, button.seg span { display: block; font: 500 12px/1.2 var(--font); color: var(--ink-3); padding-top: 5px; overflow-wrap: anywhere; hyphens: auto; text-align: left; }
.seg.now span { color: var(--ink); font-weight: 500; }
button.seg { padding: 4px 0; text-align: left; }

/* Board */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(168px, 1fr); gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; }
.col { display: flex; flex-direction: column; min-height: 220px; scroll-snap-align: start; border-radius: 20px; background: var(--sunken); overflow: hidden; }
.col.drop { outline: 3px solid var(--accent); outline-offset: -3px; }
.col-head { display: flex; align-items: flex-start; gap: 6px; padding: 12px 12px 6px; font: 500 14px/1.2 var(--font); min-height: 44px; }
.col-head b { font: 500 12px/1 var(--font); color: var(--ink-2); }
.col-body { display: grid; gap: 8px; padding: 6px 8px 10px; align-content: start; flex: 1; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; display: grid; gap: 6px; cursor: grab; touch-action: pan-y; user-select: none; text-align: left; min-width: 0; }
.card.drag { opacity: .35; }
.card-ghost { position: fixed; z-index: 90; pointer-events: none; width: 210px; transform: rotate(1.5deg); box-shadow: var(--shadow); cursor: grabbing; }
.card-title { font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.card-row { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); min-width: 0; }
.card-row .grow { min-width: 0; }

/* Tabellen */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { font: 500 13px/1.2 var(--font); color: var(--ink-2); text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
td.num { font-size: 14px; font-weight: 500; }
tr.click { cursor: pointer; }
@media (hover: hover) and (pointer: fine) { tr.click:hover td { background: var(--sunken); } .card:hover { border-color: var(--line-2); } }

/* Zwei Spalten für Detailansichten */
.split { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 14px; align-items: start; }
.stack { display: grid; gap: 14px; min-width: 0; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px 14px; font-size: 14px; }
.kv dt { color: var(--ink-2); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.timeline { display: grid; gap: 10px; font-size: 13.5px; }
.timeline li { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 9px; }
.timeline li::before { content: ''; width: 10px; height: 10px; margin-top: 5px; border: 2.5px solid var(--ink-3); border-radius: 50%; box-sizing: border-box; }
.timeline small { display: block; color: var(--ink-3); font-size: 12.5px; }

/* Kalender */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--surface); }
.cal-wd { padding: 10px 10px 8px; font: 500 13px/1.2 var(--font); color: var(--ink-2); border-bottom: 1px solid var(--line); }
.cal-day { min-height: 108px; padding: 6px; cursor: pointer; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; text-align: left; }
.cal-day.off { background: var(--sunken); }
.cal-day.off .cal-n { color: var(--ink-3); }
.cal-n { font: 500 12.5px/26px var(--font); width: 26px; height: 26px; text-align: center; border-radius: 50%; }
.cal-day.picked .cal-n { background: var(--ink); color: var(--surface); }
.cal-day.today .cal-n, .cal-n.today { background: var(--accent); color: var(--on-accent); }
.cal-item { display: block; width: 100%; font-size: 12px; line-height: 1.25; padding: 3px 8px; border-radius: 999px; white-space: nowrap; font-style: normal; overflow: hidden; text-overflow: ellipsis; text-align: left; background: var(--sunken); }
.cal-item.kunde { background: var(--blue-bg); color: var(--blue); } .cal-item.frist { background: var(--red-bg); color: var(--red); } .cal-item.produktion { background: var(--yellow-bg); color: var(--yellow); } .cal-item.abwesend { background: var(--green-bg); color: var(--green); } .cal-item.aufgabe { background: none; border: 1px solid var(--line); } .cal-item.schicht { background: var(--accent-soft); color: var(--accent-ink); }
.cal-more { font-size: 11.5px; color: var(--ink-2); padding-left: 5px; }
.agenda { display: grid; }
.agenda-day { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.agenda-date { text-align: center; line-height: 1.1; }
.agenda-date b { display: block; font: 500 21px/1.1 var(--display); }
.agenda-date span { font: 500 12px/1 var(--font); color: var(--ink-2); }
.agenda-date.today b { color: var(--accent-ink); }
.agenda-items { display: grid; gap: 4px; min-width: 0; }
.agenda-item { display: flex; gap: 8px; align-items: baseline; min-height: 40px; padding: 9px 14px; border-radius: 16px; background: var(--sunken); font-size: 14px; text-align: left; width: 100%; min-width: 0; }
.agenda-item span:first-child { font: 500 12.5px/1.3 var(--font); color: var(--ink-2); flex: none; }
.agenda-item.kunde { background: var(--blue-bg); } .agenda-item.frist { background: var(--red-bg); } .agenda-item.produktion { background: var(--yellow-bg); } .agenda-item.abwesend { background: var(--green-bg); } .agenda-item.aufgabe { background: none; border: 1px solid var(--line); } .agenda-item.schicht { background: var(--accent-soft); }
.agenda-item > span:last-child { min-width: 0; overflow-wrap: anywhere; }

/* Chats */
.chat-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: 100%; min-height: 0; }
.chat-list { border-right: 1px solid var(--line); overflow: auto; min-height: 0; background: var(--surface); }
.chat-group { padding: 16px 16px 6px; }
.chat-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 12px; margin: 0 8px; width: calc(100% - 16px); border-radius: 16px; text-align: left; text-decoration: none; min-height: 54px; }
.chat-item[aria-current="true"] { background: var(--sunken); }
.chat-item strong { font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item small { display: block; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.chat-sym { width: 34px; height: 34px; display: grid; place-items: center; font: 500 11px/1 var(--font); background: var(--sunken); color: var(--ink); border-radius: 50%; }
.unread { min-width: 18px; height: 18px; border-radius: 999px; background: var(--ink); color: var(--surface); font: 500 10.5px/18px var(--font); text-align: center; padding: 0 6px; }
.chat-pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); min-height: 54px; background: var(--surface); }
.chat-head h2 { font: 500 17px/1.15 var(--display); letter-spacing: -.015em; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-log { flex: 1; overflow: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-height: 0; overscroll-behavior: contain; }
.msg { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 9px; max-width: 720px; }
.msg b { font-weight: 500; font-size: 14px; } .msg time { color: var(--ink-3); font-size: 12px; margin-left: 6px; }
.msg p { overflow-wrap: anywhere; }
.composer { display: flex; gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.composer input { flex: 1; }
.composer .btn-ic { width: 44px; height: 44px; background: var(--primary); color: var(--on-primary); }

/* Finanzen */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { padding: 16px 18px; border-radius: 20px; background: var(--sunken); min-width: 0; }
.kpi b { display: block; font: 500 22px/1.15 var(--display); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi small { display: block; font-size: 12.5px; color: var(--ink-2); line-height: 1.3; }
.kpi .up { color: var(--green); } .kpi .down { color: var(--red); }
.kpi-lead { background: var(--accent-soft); }
.chart-legend { display: flex; gap: 14px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; vertical-align: -1px; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font: 500 11px var(--font); fill: var(--ink-2); }
.chart .gridline { stroke: var(--line); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: default; }
.chart .hit:hover { fill: var(--hatch); }
.tip { position: absolute; pointer-events: none; z-index: 5; background: var(--primary); color: var(--on-primary); border-radius: 12px; padding: 7px 11px; font-size: 12.5px; line-height: 1.35; white-space: nowrap; transform: translate(-50%, -100%); }
.meter { height: 8px; background: var(--sunken); border-radius: 999px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ink); border-radius: 999px; }
.meter.hot i, .meter.lead i { background: var(--accent); }
.meter.over i { background: var(--red); }

/* Team, Einstellungen */
.people { display: grid; }
.person { display: grid; grid-template-columns: 34px minmax(0, 1fr) 120px 28px; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.person:last-child { border-bottom: 0; }
.person strong { font-weight: 500; display: block; overflow-wrap: anywhere; line-height: 1.25; } .person small { color: var(--ink-2); font-size: 13px; display: block; overflow-wrap: anywhere; }
.matrix td:not(:first-child), .matrix th:not(:first-child) { text-align: center; }
.tabs { display: flex; gap: 4px; margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs a, .tabs button { display: inline-flex; align-items: center; min-height: 38px; padding: 0 16px; border-radius: 999px; font-weight: 500; color: var(--ink-2); text-decoration: none; white-space: nowrap; font-size: 14.5px; background: var(--sunken); }
.tabs [aria-current="page"], .tabs [aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }
.settings-grid { display: grid; gap: 14px;  }
.list-row { display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-bottom: 1px solid var(--line); min-height: 54px; min-width: 0; }
.list-row:last-child { border-bottom: 0; }
.list-row .t { flex: 1; min-width: 0; } .list-row strong { font-weight: 500; display: block; overflow-wrap: anywhere; } .list-row small { color: var(--ink-2); display: block; font-size: 13px; overflow-wrap: anywhere; }
.edit-list { display: grid; gap: 6px; }
.edit-list-row { display: grid; grid-template-columns: minmax(0, 1fr) 36px; gap: 6px; }
.note { padding: 12px 16px; border-radius: 16px; background: var(--yellow-bg); color: var(--yellow); font-size: 14px; }
.tpl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tpl { display: grid; gap: 2px; padding: 12px 16px; border: 1px solid var(--line-2); border-radius: 16px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.tpl strong { color: var(--ink); font-size: 14.5px; font-weight: 500; }
.tpl:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.tpl input { position: absolute; opacity: 0; }

/* Blätter */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end; }
.sheet-back { position: absolute; inset: 0; background: rgba(13,18,21,.4); opacity: 0; transition: opacity 220ms ease; }
.sheet-wrap.in .sheet-back { opacity: 1; }
.sheet { position: relative; width: min(480px, 100%); height: calc(100% - 20px); margin: 10px; background: var(--surface); display: flex; flex-direction: column; border-radius: var(--r-l); box-shadow: var(--shadow); overflow: hidden; transform: translateX(32px); opacity: 0; transition: transform 280ms var(--ease-drawer), opacity 180ms ease; outline: none; }
.sheet-wide { width: min(720px, 100%); }
.sheet-wrap.in .sheet { transform: none; opacity: 1; }
.sheet-grip { display: none; }
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 16px 16px 14px 22px; border-bottom: 1px solid var(--line); min-height: 64px; }
.sheet-head h2 { flex: 1; font: 500 21px/1.1 var(--display); letter-spacing: -.02em; min-width: 0; overflow-wrap: anywhere; }
.sheet-body { flex: 1; overflow: auto; padding: 20px 22px; overscroll-behavior: contain; min-height: 0; }
.sheet-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 22px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }

.toasts { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 80; display: grid; gap: 6px; width: min(420px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 12px; justify-content: space-between; align-items: center; background: var(--primary); color: var(--on-primary); padding: 12px 18px; border-radius: 20px; font-size: 14.5px; box-shadow: var(--shadow); animation: toast-in 240ms var(--ease-out); }
.toast .link { color: inherit; flex: none; }
.toast.out { opacity: 0; transform: translateY(8px); transition: opacity 160ms ease, transform 160ms ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

/* Coco */
.coco-fab { position: fixed; right: 24px; bottom: 24px; z-index: 40; width: 60px; height: 60px; border-radius: 50%; background: var(--surface); border: 0; box-shadow: var(--shadow), 0 0 0 1px var(--line); padding: 0; display: grid; place-items: center; user-select: none; -webkit-touch-callout: none; touch-action: none; transition: transform 160ms var(--ease-out), box-shadow 160ms ease; }
.coco-ring { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 3.6; overflow: visible; animation: coco-breath 5s ease-in-out infinite; }
.coco-fab.busy .coco-ring { stroke-dasharray: 30 77; animation: coco-listen 1.1s linear infinite; }
@keyframes coco-breath { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes coco-listen { to { transform: rotate(360deg); } }
.coco-fab::before { content: 'Sag es Coco'; position: absolute; right: 72px; top: 50%; transform: translateY(-50%); padding: 7px 13px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font: 500 14px var(--font); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 150ms ease; }
@media (hover: hover) and (pointer: fine) { .coco-fab:hover::before { opacity: 1; } .coco-fab:hover { box-shadow: var(--shadow), 0 0 0 1px var(--line-2); } }
.coco-fab:focus-visible::before { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .coco-ring, .coco-fab.busy .coco-ring { animation: none; } }
.coco-fab:active { transform: scale(.95); }
.coco-fab.flat, .orb-flat { background: radial-gradient(circle at 50% 50%, transparent 52%, var(--accent) 54%, var(--accent) 66%, transparent 68%); }
.hold-hint { position: fixed; right: 22px; bottom: 108px; z-index: 41; background: var(--primary); color: var(--on-primary); padding: 10px 16px; border-radius: 20px; font-size: 14px; max-width: min(320px, calc(100vw - 44px)); }
.coco { position: fixed; right: 22px; bottom: 22px; z-index: 50; width: 420px; height: min(680px, calc(100dvh - 44px)); background: var(--surface); border: 0; border-radius: var(--r-l); box-shadow: var(--shadow), 0 0 0 1px var(--line); display: flex; flex-direction: column; overflow: hidden; transform-origin: 100% 100%; animation: coco-in 260ms var(--ease-out); }
.coco.out { animation: coco-out 160ms ease forwards; }
@keyframes coco-in { from { transform: scale(.94) translateY(10px); opacity: 0; } }
@keyframes coco-out { to { transform: scale(.97) translateY(6px); opacity: 0; } }
.coco-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--line); min-height: 60px; }
.coco-head b { font: 500 19px/1.1 var(--display); letter-spacing: -.02em; flex: 1; }
.coco-log { flex: 1; overflow: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; min-height: 0; }
.coco-core { display: grid; place-items: center; gap: 2px; padding: 4px 0 8px; flex: none; text-align: center; }
.coco-core .orb { width: 160px; height: 160px; }
.coco:not(.has-log) .coco-core { flex: 1; align-content: center; }
.coco:not(.has-log) .coco-log { flex: none; padding: 0; }
.coco.has-log .coco-core { display: flex; align-items: center; gap: 10px; padding: 6px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.coco.has-log .coco-core .orb { width: 52px; height: 52px; flex: none; }
.coco-core canvas { width: 100%; height: 100%; display: block; -webkit-mask-image: radial-gradient(circle, #000 62%, transparent 70%); mask-image: radial-gradient(circle, #000 62%, transparent 70%); }
.coco-state { font-size: 14px; color: var(--ink-2); min-height: 21px; max-width: 100%; }
.coco-state.shimmer { color: var(--ink); -webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,.35) 40%, #000 50%, rgba(0,0,0,.35) 60%); mask-image: linear-gradient(90deg, rgba(0,0,0,.35) 40%, #000 50%, rgba(0,0,0,.35) 60%); -webkit-mask-size: 240% 100%; mask-size: 240% 100%; animation: shimmer 1.8s linear infinite; }
@keyframes shimmer { from { -webkit-mask-position: 100% 0; mask-position: 100% 0; } to { -webkit-mask-position: -40% 0; mask-position: -40% 0; } }
.say { align-self: flex-end; max-width: 88%; background: var(--sunken); color: var(--ink); padding: 9px 14px; border-radius: 18px 18px 6px 18px; font-size: 14.5px; overflow-wrap: anywhere; }
.reply { max-width: 96%; font-size: 14.5px; overflow-wrap: anywhere; }
.plan-cards { display: grid; gap: 6px; margin-top: 6px; }
.plan-card { border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; display: grid; gap: 3px; animation: card-in 300ms var(--ease-out) both; animation-delay: calc(var(--i) * 70ms); background: var(--surface); }
@keyframes card-in { from { opacity: 0; transform: translateY(8px); } }
.plan-card.undone { opacity: .5; }
.plan-card-top { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.plan-card-top strong { font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; min-width: 0; flex: 1; }
.plan-card .meta { font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 2px 9px; align-items: center; }
.plan-card .why { font-size: 13px; color: var(--ink-3); }
.plan-card .acts { display: flex; gap: 12px; font-size: 13px; }
.coco-input { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.coco-field { display: flex; align-items: flex-end; gap: 6px; border: 1px solid var(--line-2); border-radius: 24px; padding: 5px 5px 5px 16px; background: var(--surface); position: relative; }
.coco-field:focus-within { border-color: var(--ink); }
.coco-field textarea { flex: 1; border: 0; background: none; padding: 7px 0; min-height: 36px; max-height: 110px; resize: none; font-size: 15px; line-height: 1.4; }
.coco-ph { position: absolute; left: 16px; top: 13px; right: 100px; pointer-events: none; color: var(--ink-3); font-size: 15px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coco-ph.swap { animation: ph 420ms var(--ease-out); }
@keyframes ph { from { opacity: 0; transform: translateY(6px); } }
.coco-mic, .coco-send { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; transition: transform 120ms var(--ease-out), background-color 150ms ease; }
.coco-mic:active, .coco-send:active { transform: scale(.94); }
.coco-mic { background: var(--accent); color: var(--on-accent); }
.coco-mic.on { background: var(--primary); color: var(--on-primary); }
.coco-send { background: var(--primary); color: var(--on-primary); }
.coco-send[hidden] { display: none; }
.coco-wave { width: 100%; height: 26px; display: block; }
.coco-wave[hidden] { display: none; }
.see-plan { display: inline-block; margin-top: 8px; font-size: 14px; }
.coco .link { color: var(--accent-ink); }
.coco-hint { font-size: 12.5px; color: var(--ink-3); padding: 0 3px; }

/* Suche */
.palette-wrap { position: fixed; inset: 0; z-index: 70; background: rgba(13,18,21,.4); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; }
.palette { width: min(560px, calc(100vw - 24px)); background: var(--surface); border: 0; border-radius: 24px; box-shadow: var(--shadow); overflow: hidden; }
.palette input { border: 0 !important; border-bottom: 1px solid var(--line) !important; border-radius: 0; min-height: 56px; padding: 0 20px; font-size: 16px; box-shadow: none !important; }
.palette ul { max-height: 50vh; overflow: auto; padding: 6px 0; }
.palette li button { display: flex; gap: 10px; align-items: baseline; width: calc(100% - 12px); margin: 0 6px; border-radius: 14px; padding: 10px 14px; text-align: left; min-width: 0; }
.palette li button span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette li button[aria-selected="true"] { background: var(--sunken); }

/* Login */
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
.auth-side { padding: 40px clamp(24px, 6vw, 80px); display: flex; flex-direction: column; justify-content: center; gap: 20px; background: var(--surface); min-width: 0; }
.auth-side h1 { font: 500 clamp(31px, 4.4vw, 48px)/1.02 var(--display); letter-spacing: -.03em; text-wrap: balance; }
.auth-form { display: grid; gap: 12px; max-width: 380px; }
.auth-demo { display: grid; gap: 4px; max-width: 380px; }
.auth-demo button { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 9px; align-items: center; text-align: left; padding: 6px 8px; border-radius: var(--r); min-height: 44px; }
.auth-demo small { color: var(--ink-2); font-size: 13px; }
@media (hover: hover) and (pointer: fine) { .auth-demo button:hover { background: var(--sunken); } .chat-item:hover { background: var(--sunken); } }
.auth-plan { position: relative; background: var(--sunken); display: grid; place-items: center; overflow: hidden; min-width: 0; border-radius: 24px; margin: 12px; }
.auth-orb { width: min(420px, 74%); aspect-ratio: 1; }
.auth-orb canvas { width: 100%; height: 100%; display: block; -webkit-mask-image: radial-gradient(circle, #000 62%, transparent 70%); mask-image: radial-gradient(circle, #000 62%, transparent 70%); }

.only-mobile { display: none !important; }
.tabbar { display: none; }

/* Schreibtisch unter 1180: Seitenleiste des Plans klappt nach unten */
@media (max-width: 1180px) {
  .plan-layout { grid-template-columns: minmax(0, 1fr); height: auto; }
  .plan-side { border-left: 0; border-top: 1px solid var(--line); }
  .plan-stage { overflow: visible; }
  .sheet-frame { min-height: 0; aspect-ratio: 24 / 16; flex: none; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); }
}

/* Handy */
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); height: 100dvh; }
  .rail { display: none; }
  .only-mobile { display: revert !important; }
  .only-desktop { display: none !important; }
  .main { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .page { padding: calc(14px + env(safe-area-inset-top)) 14px 160px; max-width: none; }
  .page-head h1 { font-size: 30px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line-2); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a, .tabbar button { display: grid; justify-items: center; gap: 3px; padding: 7px 0 6px; min-height: 58px; font: 500 11px/1.1 var(--font); color: var(--ink-2); text-decoration: none; position: relative; user-select: none; }
  .tabbar .ic { width: 22px; height: 22px; padding: 4px 14px; border-radius: 999px; box-sizing: content-box; transition: background-color 150ms ease; }
  .tabbar [aria-current="page"] { color: var(--ink); }
  .tabbar [aria-current="page"] .ic { background: var(--accent-soft); color: var(--accent-ink); }
  .tabbar .badge { top: 3px; right: calc(50% - 24px); }
  .coco-fab { right: 16px; bottom: calc(env(safe-area-inset-bottom) + 74px); z-index: 41; width: 56px; height: 56px; }
  .hold-hint { right: 12px; left: 12px; max-width: none; bottom: calc(env(safe-area-inset-bottom) + 82px); text-align: center; }
  .coco { inset: 0; width: 100%; height: 100dvh; border: 0; border-radius: 0; box-shadow: none; transform-origin: 50% 100%; padding-top: env(safe-area-inset-top); }
  .coco:not(.has-log) .coco-core .orb { width: min(62vw, 260px); height: min(62vw, 260px); }
  .plan-stage { padding: calc(10px + env(safe-area-inset-top)) 14px 32px; display: block; }
  .plan-stage { overflow: visible; }
  .sheet-frame { margin: 14px 0 0; flex: none; min-height: 0; border-radius: 20px; }
  .hall-open { padding: 7px 8px 6px; }
  .hall-name { font-size: 13.5px; }
  .hall-code { font-size: 10px; }
  .hall-nums { gap: 2px 8px; margin-top: 2px; font-size: 12px; }
  .hall-nums b { font-size: 13px; margin-right: 2px; }
  .nums-projects { display: none; }
  .lbl-long { display: none; }
  .lbl-short { display: inline; }
  .hall-rooms { flex: none; height: 18px; margin-top: 4px; gap: 3px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-columns: none; grid-auto-rows: 18px; }
  .room { grid-column: auto !important; }
  .room { padding: 0; align-items: center; justify-content: center; border-radius: 999px; }
  .room-name { display: none; }
  .room b { font-size: 10.5px; align-self: center; }
  .hall-foot { min-height: 20px; padding-top: 2px; margin-top: auto; }
  .hall-foot .av { width: 20px; height: 20px; font-size: 9px; }
  .agent-dot { font-size: 10.5px; gap: 3px; }
  .hq-orb { width: 74px; }
  .hall.is-hq .hall-open { padding: 6px 10px; }
  .titleblock { width: 62%; min-width: 0; font-size: 11.5px; right: 6px; bottom: 6px; }
  .titleblock .wide { font-size: 13px; }
  .zone { display: none; }
  .drawn { margin-right: 0; }
  .titleblock.strip { max-width: none; margin-left: 0; grid-template-columns: 1.4fr 1fr 1fr 1fr; }
  .page-fill { height: auto; }
  .drawn-fill { display: block; }
  .drawn-fill .board { height: auto; }
  .plan-side { display: none; }
  .plan-today { display: block !important; }
  .plan-bar .btn:not(.plan-shift) { display: none; }
  .board { grid-auto-columns: 78vw; scroll-snap-type: x mandatory; }
  .card { touch-action: pan-x pan-y; cursor: default; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:last-child { grid-column: 1 / -1; }
  .chat-layout { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 56px - env(safe-area-inset-bottom)); }
  .chat-layout.has-open .chat-list { display: none; }
  .chat-layout:not(.has-open) .chat-pane { display: none; }
  .chat-list { border-right: 0; padding-top: env(safe-area-inset-top); }
  .chat-head { padding-top: calc(10px + env(safe-area-inset-top)); }
  .composer { padding-bottom: 28px; }
  .task-meta > span { max-width: 170px; }
  .sheet-wrap { align-items: flex-end; }
  .sheet, .sheet-wide { width: 100%; height: auto; max-height: 92dvh; margin: 0; border-radius: var(--r-l) var(--r-l) 0 0; transform: translateY(40px); }
  .sheet-grip { display: block; height: 22px; flex: none; position: relative; cursor: grab; touch-action: none; }
  .sheet-grip::after { content: ''; position: absolute; left: 50%; top: 8px; width: 40px; height: 5px; margin-left: -20px; border-radius: 999px; background: var(--line-2); }
  .sheet-head { min-height: 44px; padding: 0 12px 10px 16px; }
  .form-row { grid-template-columns: minmax(0, 1fr); }
  .toasts { bottom: calc(env(safe-area-inset-bottom) + 84px); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-plan { order: -1; height: 200px; margin: 12px 12px 0; }
  .auth-orb { width: 180px; }
  .auth-side { padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); justify-content: flex-start; }
  .person { grid-template-columns: 34px minmax(0, 1fr) 28px; } .person .meter-cell { display: none; }
  .tpl-grid { grid-template-columns: minmax(0, 1fr); }
  .btn-ic { width: 44px; height: 44px; }
}
.plan-today { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
@media print { .rail, .tabbar, .coco-fab { display: none; } }

/* Anmeldung mit Apple und Google */
.auth-providers { display: grid; gap: 8px; max-width: 380px; }
.auth-providers .btn { min-height: 44px; justify-content: center; gap: 9px; }
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 13.5px; margin-top: 4px; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Firmenwechsel oben in der Seitenleiste */
.brand-switch { width: 100%; text-align: left; border-radius: 16px; padding: 6px 12px 12px; }
.brand-switch svg { margin-left: auto; flex: none; width: 15px; height: 15px; color: var(--ink-2); }
@media (hover: hover) and (pointer: fine) { .brand-switch:hover { background: var(--sunken); } }

/* Tarife */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; padding: 14px; }
.plan-card-t { display: flex; flex-direction: column; gap: 10px; padding: 20px; border: 1px solid var(--line); border-radius: 24px; min-width: 0; background: var(--surface); }
.plan-card-t.hot { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.plan-card-t header { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 26px; }
.plan-card-t h3 { margin: 0; font: 500 19px/1.1 var(--display); letter-spacing: -.015em; }
.plan-card-t p { margin: 0; font-size: 14.5px; }
.plan-card-t ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: 14.5px; }
.plan-card-t li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 7px; align-items: start; }
.plan-card-t li svg { width: 15px; height: 15px; margin-top: 3px; color: var(--green); }
.plan-card-t footer { margin-top: auto; padding-top: 6px; display: grid; }
.plan-card-t footer .tag { justify-self: start; }
.plan-price { display: grid; gap: 1px; }
.plan-price strong { font: 500 28px/1.1 var(--display); letter-spacing: -.02em; }
.plan-price small { color: var(--ink-2); font-size: 13.5px; }
.usage { display: grid; gap: 10px; }
.usage-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 100px; gap: 12px; align-items: center; font-size: 14.5px; }
.usage-row .meter { display: block; }
.usage-row .no { text-align: right; }
@media (max-width: 560px) { .usage-row { grid-template-columns: minmax(0, 1fr) 90px; } .usage-row .meter { display: none; } }

/* Startbildschirm: Der Ring schließt sich, voll heißt geladen */
#boot { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 24px; background: var(--ground); transition: opacity 350ms ease-out; }
#boot svg { width: min(30vw, 120px); height: auto; color: var(--ink); transition: transform 350ms var(--ease-out); transform-origin: center; }
#boot p { margin: 0; font-size: 20px; font-weight: 500; color: var(--ink); }
#boot circle.boot-ring, #boot circle.boot-glow { transform: rotate(-90deg); transform-origin: 120px 120px; stroke-dasharray: 100; stroke-dashoffset: 100; animation: boot-fill 1.3s cubic-bezier(.2, .7, .2, 1) forwards; transition: stroke-dashoffset 400ms ease-out; }
#boot.done circle.boot-ring, #boot.done circle.boot-glow { animation: none; stroke-dashoffset: 0; }
#boot.done svg { transform: scale(1.05); }
#boot.out { opacity: 0; pointer-events: none; }
@keyframes boot-fill { to { stroke-dashoffset: 12; } }
@media (prefers-reduced-motion: reduce) { #boot circle.boot-ring, #boot circle.boot-glow { animation: none; stroke-dashoffset: 12; } }

/* Kalender */
.cal-tools { flex-wrap: wrap; }
.cal-picked { margin-top: 14px; }
.cal-picked .agenda-items { margin-top: 6px; }
.cal-search { width: 100%; margin-bottom: 8px; }
.agenda-item small { display: block; font-size: 12px; color: var(--ink-2); }
.cal-day:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.tg { border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; height: calc(100dvh - 210px); min-height: 420px; }
.tg-head, .tg-allday { display: grid; border-bottom: 1px solid var(--line); flex: none; }
.tg-day { display: grid; justify-items: center; gap: 2px; min-height: 44px; padding: 4px 0; }
.tg-day span { font: 500 12px/1 var(--font); color: var(--ink-2); }
.tg-day b { font: 500 13px/26px var(--font); width: 26px; height: 26px; border-radius: 50%; }
.tg-day.today b { background: var(--accent); color: var(--on-accent); }
.tg-allday { padding: 3px 0; }
.tg-allday > div { display: grid; gap: 2px; padding: 0 1px; min-width: 0; }
.tg-label { font-size: 10.5px; color: var(--ink-2); text-align: right; padding-right: 6px; }
.tg-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.tg-body { display: grid; position: relative; background-image: repeating-linear-gradient(to bottom, var(--line) 0, var(--line) 1px, transparent 1px, transparent 48px); }
.tg-hours span { display: block; font: 500 10.5px/1 var(--font); color: var(--ink-2); text-align: right; padding: 2px 6px 0 0; }
.tg-col { position: relative; border-left: 1px solid var(--line); min-width: 0; cursor: copy; }
.tg-block { position: absolute; display: block; padding: 4px 6px; border-radius: 10px; background: var(--sunken); overflow: hidden; text-align: left; font-size: 11px; line-height: 1.2; }
.tg-block b { display: block; font-weight: 500; overflow-wrap: anywhere; }
.tg-block span { font: 500 10px/1.2 var(--font); color: var(--ink-2); }
.tg-block.kunde { background: var(--blue-bg); color: var(--blue); } .tg-block.frist { background: var(--red-bg); color: var(--red); } .tg-block.produktion { background: var(--yellow-bg); color: var(--yellow); } .tg-block.aufgabe { background: var(--surface); border: 1px solid var(--line-2); }
.tg-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--accent); pointer-events: none; z-index: 2; }
@media (max-width: 760px) {
  .cal-page .page-head { margin-bottom: 8px; }
  .cal-tools select { flex: 1 1 40%; min-width: 0; }
  .cal-grid { margin: 0 -6px; }
  .cal-wd { padding: 5px 0; text-align: center; font-size: 11px; }
  .cal-day { min-height: 62px; padding: 2px 1px; align-items: stretch; }
  .cal-n { align-self: center; width: 24px; height: 24px; line-height: 24px; border-radius: 50%; }
  .cal-item { font-size: 9.5px; padding: 1px 4px; }
  .cal-item i { display: none; }
  .cal-more { font-size: 9.5px; padding-left: 2px; }
  .tg { margin: 0 -6px; height: calc(100dvh - 240px - env(safe-area-inset-bottom)); }
}

/* Anmeldung: App holen und Rechtliches */
.auth-get { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; font-weight: 500; }
.auth-legal { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-2); }
.auth-legal a { color: inherit; }

/* Schichtplan */
.tg-block.schicht { background: var(--accent-soft); color: var(--ink); }
.sp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.sp-palette { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.sp-brush { flex: none; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 5px 14px 5px 6px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); text-align: left; }
.sp-brush b { width: 34px; height: 34px; line-height: 34px; text-align: center; border-radius: 50%; font-weight: 500; }
.sp-brush span { font-size: 13px; font-weight: 500; line-height: 1.15; }
.sp-brush small { display: block; font: 500 11.5px/1.3 var(--font); color: var(--ink-2); }
.sp-brush[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.sp-brush.blue b, .sp-chip.blue { background: var(--blue-bg); color: var(--blue); }
.sp-brush.yellow b, .sp-chip.yellow { background: var(--yellow-bg); color: var(--yellow); }
.sp-brush.red b, .sp-chip.red { background: var(--red-bg); color: var(--red); }
.sp-brush.green b, .sp-chip.green { background: var(--green-bg); color: var(--green); }
.sp-brush.neutral b, .sp-chip.neutral { background: var(--sunken); color: var(--ink); }
.sp-tip { margin: 6px 0 8px; font-size: 13px; color: var(--ink-2); }
.sp-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); -webkit-overflow-scrolling: touch; }
.sp-grid { border-collapse: separate; border-spacing: 0; min-width: max-content; font-size: 13px; }
.sp-grid th, .sp-grid td { padding: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; background: var(--surface); }
.sp-grid thead th { font: 500 12px/1.2 var(--font); padding: 6px 0; min-width: 34px; }
.sp-grid thead small { display: block; font: 500 10.5px/1.1 var(--font); color: var(--ink-2); }
.sp-grid td { height: 40px; min-width: 34px; }
.sp-grid td[data-act] { cursor: pointer; }
.sp-grid .we { background: var(--sunken); }
.sp-grid .now { box-shadow: inset 2px 0 0 var(--accent), inset -2px 0 0 var(--accent); }
.sp-grid thead .now { color: var(--accent-ink); font-weight: 500; }
.sp-grid .away { background: repeating-linear-gradient(45deg, var(--sunken), var(--sunken) 4px, var(--surface) 4px, var(--surface) 8px); }
.sp-name { position: sticky; left: 0; z-index: 2; min-width: 148px; max-width: 148px; padding: 0 8px !important; text-align: left !important; font: 500 13px/1.2 var(--font) !important; color: var(--ink) !important; }
.sp-name > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; margin-left: 6px; display: inline-block; max-width: 96px; }
.sp-grid tr.mine .sp-name { background: var(--accent-soft); }
.sp-grid tfoot th, .sp-grid tfoot td { height: 30px; font: 500 12px/1 var(--font); color: var(--ink-2); }
.sp-sum { min-width: 72px; padding: 0 8px !important; white-space: nowrap; font: 500 12px/1 var(--font); }
.sp-chip { position: relative; width: 30px; height: 30px; border-radius: 50%; font-weight: 500; font-size: 13px; line-height: 30px; display: inline-block; }
.sp-chip + .sp-chip { margin-left: 1px; }
.sp-chip.warn { outline: 2px solid var(--red); outline-offset: -2px; }
.sp-chip i { position: absolute; right: 1px; bottom: 0; font-size: 9px; font-style: normal; line-height: 1; }
.sp-away { font: 500 11px/1 var(--font); color: var(--ink-2); }
.sp-hints { margin-top: 10px; font-size: 13.5px; }
.sp-hints summary { display: flex; align-items: center; gap: 6px; min-height: 36px; cursor: pointer; color: var(--red); font-weight: 500; }
.sp-hints ul { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.sp-person { display: inline-flex; align-items: center; gap: 8px; }
.sp-mine { margin-top: 14px; }
.sp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 6px 0 12px; }
.sp-kpis > div { background: var(--sunken); border-radius: 20px; padding: 14px 16px; }
.sp-kpis small { display: block; font-size: 12px; color: var(--ink-2); }
.sp-kpis b { font: 500 19px/1.25 var(--display); letter-spacing: -.015em; }
.neg { color: var(--red); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr[aria-selected="true"] td { background: var(--ground); }
.sp-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 20px; overflow: hidden; background: var(--surface); }
.sp-list li + li { border-top: 1px solid var(--line); }
.sp-list button { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) auto; gap: 10px; width: 100%; min-height: 46px; padding: 8px 12px; text-align: left; align-items: center; font-size: 14px; }
.sp-list small { display: block; font-size: 12px; color: var(--ink-2); }
.sp-list b { font: 500 13px/1 var(--font); }
.sp-list-day { color: var(--ink-2); font-size: 13px; }
.sp-type { border: 0; border-bottom: 1px solid var(--line); margin: 0; padding: 0 0 12px; display: grid; gap: 10px; }
.form-warn { display: flex; gap: 6px; align-items: center; margin: 0 0 6px; color: var(--red); font-size: 13.5px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 760px) {
  .sp-scroll { margin: 0 -6px; }
  .sp-name { min-width: 104px; max-width: 104px; padding: 0 5px !important; }
  .sp-name .avatar, .sp-name .av { display: none; }
  .sp-name > span { margin-left: 0; max-width: 92px; }
  .sp-list button { grid-template-columns: minmax(0, 1fr) auto; }
  .sp-list-day { grid-column: 1 / -1; }
  .sp-bar .btn { flex: 1 1 auto; }
}

/* Eigener Bereich Schichtplanung und Ebenen im Kalender */
.cal-switch { display: none; margin-bottom: 12px; width: 100%; padding: 3px; gap: 2px; border-radius: 999px; background: var(--sunken); }
.cal-switch a { flex: 1; text-align: center; min-height: 38px; line-height: 38px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-2); text-decoration: none; }
.cal-switch a[aria-current] { background: var(--primary); color: var(--on-primary); }
.cal-layers { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.cal-layers button { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font-size: 13.5px; font-weight: 500; color: var(--ink-3); }
.cal-layers button i { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.cal-layers button[aria-pressed="true"] { color: var(--ink); }
.cal-layers button[aria-pressed="true"] i { background: var(--dot, var(--ink)); }
.sp-next { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 20px 22px; margin-bottom: 12px; display: grid; gap: 4px; }
.sp-next small { font-size: 13px; color: var(--ink-3); }
.sp-next b { font: 500 24px/1.1 var(--display); letter-spacing: -.02em; }
.sp-duty { background: var(--sunken); border-radius: 20px; padding: 14px 18px; margin-bottom: 12px; }
.sp-duty ul { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; }
.sp-duty li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.sp-duty li span:last-child { margin-left: auto; font: 500 12.5px/1 var(--font); color: var(--ink-2); white-space: nowrap; }
.sp-month { margin-bottom: 12px; }
.sp-month .cal-day { min-height: 74px; cursor: default; }
.sp-month .sp-chip { width: 100%; height: auto; min-height: 22px; line-height: 1.15; padding: 3px 4px; font-size: 11px; border-radius: 10px; }
.sp-month .sp-chip small { display: block; font: 500 9.5px/1.15 var(--font); }
.sp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
@media (max-width: 760px) {
  .cal-switch { display: flex; }
  .sp-month { margin-left: -6px; margin-right: -6px; }
  .sp-month .cal-day { min-height: 58px; }
  .sp-month .sp-chip small { display: none; }
}

/* CI Offen und Zu: Ringe, runde Flächen, kräftige Titel */
.wordmark { display: block; height: 22px; width: auto; fill: none; stroke: currentColor; stroke-width: 3.6; overflow: visible; }
.wordmark .last { stroke: var(--accent); }
.brand-text { display: grid; gap: 5px; min-width: 0; }
.brand-switch .wordmark { width: auto; height: 22px; margin: 0 0 2px; color: var(--ink); }
#boot p { font-family: var(--display); font-weight: 500; }

/* Home */
.page.home { padding: 40px var(--gutter) 120px; display: grid; gap: 14px; }
.home-title { font: 500 clamp(30px, 3.6vw, 40px)/1.1 var(--font); letter-spacing: -.03em; margin-bottom: 14px; overflow-wrap: anywhere; }
.home-row { display: flex; flex-wrap: wrap; gap: 14px; }
.tile { flex: 1 1 220px; min-width: 0; min-height: 196px; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: border-color 160ms ease, box-shadow 160ms ease; }
.tile-head { display: flex; align-items: center; gap: 10px; }
.tile-ic { display: grid; place-items: center; color: var(--ink-3); }
.tile-ic .ic { width: 20px; height: 20px; }
.tile h2 { font: 500 16px/1.2 var(--font); letter-spacing: -.005em; overflow-wrap: break-word; hyphens: auto; }
.tile-foot { display: grid; gap: 4px; min-width: 0; }
.tile-foot strong { font: 400 28px/1.15 var(--font); letter-spacing: -.025em; overflow-wrap: anywhere; }
.tile small { font-size: 14px; line-height: 1.35; color: var(--ink-3); }
.tile-main { flex: 2 1 420px; flex-direction: row; align-items: center; gap: 24px; min-height: 236px; }
.tile-text { align-self: stretch; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; min-width: 0; flex: 1; }
.tile-main .tile-foot strong { font-size: 36px; }
.home-row:first-of-type .tile:not(.tile-main) { flex-basis: 240px; min-height: 236px; }
.tile-wide { flex: none; min-height: 72px; padding: 14px 22px; flex-direction: row; flex-wrap: wrap; align-items: center; }
.home-ring { flex: none; width: clamp(96px, 11vw, 140px); height: clamp(96px, 11vw, 140px); fill: none; stroke-width: 2.4; }
.home-ring .track { stroke: var(--line); }
.home-ring .fill { stroke: var(--accent); stroke-linecap: round; }
@media (hover: hover) and (pointer: fine) { .tile:hover { border-color: var(--line-2); box-shadow: var(--shadow); } }
@media (max-width: 760px) {
  .page.home { padding: calc(18px + env(safe-area-inset-top)) 16px 160px; }
  .tile, .home-row:first-of-type .tile:not(.tile-main) { min-height: 0; }
}

/* Menü als Schublade: drei Punkte oder linker Rand */
.topbar, .rail-edge, .menu-scrim { display: none; }
@media (min-width: 761px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: 60px minmax(0, 1fr); }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 0 20px 0 14px; border-bottom: 1px solid var(--line); background: var(--surface); min-width: 0; }
  .topbar-brand { display: flex; align-items: center; min-width: 0; color: var(--ink); text-decoration: none; }
  .menu-btn .ic { width: 20px; height: 20px; fill: currentColor; }
  .rail { position: fixed; left: 12px; top: 12px; bottom: 12px; width: 264px; z-index: 56; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); transform: translateX(calc(-100% - 24px)); transition: transform 260ms var(--ease-drawer); }
  .shell.menu-open .rail { transform: none; }
  .rail-edge { display: block; position: fixed; left: 0; top: 0; bottom: 0; width: 8px; z-index: 55; }
  .shell.menu-open .menu-scrim { display: block; position: fixed; inset: 0; z-index: 54; }
}
@media (prefers-reduced-motion: reduce) { .rail { transition: none; } }
.firm-logo { display: block; max-height: 28px; max-width: 180px; width: auto; object-fit: contain; }
.brand-switch .firm-logo { max-height: 32px; margin-bottom: 2px; }
.logo-preview { display: flex; align-items: center; min-height: 64px; padding: 16px 20px; border-radius: 16px; background: var(--sunken); color: var(--ink); }
.logo-preview .wordmark { height: 26px; }
.logo-preview .firm-logo { max-height: 48px; max-width: 260px; }

/* Akzentfarben */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.swatch { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px 0 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 14px; color: var(--ink); text-align: left; }
.swatch i { width: 26px; height: 26px; border-radius: 50%; background: var(--sw); flex: none; }
.swatch[aria-checked="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.swatch:disabled { cursor: default; opacity: .75; }

/* Home: Widgets */
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.home-head .home-title { margin: 0; }
.home-hint { color: var(--ink-3); font-size: 14px; margin: -4px 0 8px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); grid-auto-flow: dense; gap: 14px; }
.home-grid .tile { min-height: 196px; }
.home-grid .tile-big { grid-column: span 2; flex-direction: row; align-items: center; gap: 24px; }
.home-grid .tile-progress { background: var(--accent-soft); border-color: transparent; }
.home-grid .tile-progress .home-ring .track { stroke: color-mix(in srgb, var(--accent) 22%, transparent); }
.home-grid .tile-big .tile-foot strong { font-size: 36px; }
.home-grid .tile:not(.tile-big) .home-ring { width: 64px; height: 64px; }
.home-grid .tile:not(.tile-big) { flex-direction: row; align-items: stretch; }
.tile.is-editing { border-style: dashed; flex-wrap: wrap; align-content: space-between; }
.tile-tools { flex: 1 0 100%; display: flex; flex-wrap: wrap; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.tile-tools .btn { min-height: 36px; padding: 0 12px; font-size: 13px; }
.tile-tools .btn-ic { width: 36px; height: 36px; border: 1px solid var(--line-2); }
.tile-tools .btn-ic:disabled { opacity: .35; }
.home-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.home-add .label { margin-right: 6px; }
.firm-name { display: block; font: 500 17px/1.2 var(--font); letter-spacing: -.015em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.logo-preview .firm-name { font-size: 20px; }

/* Einführung */
.tour { position: fixed; inset: 0; z-index: 95; }
.tour-hole { position: fixed; border-radius: 20px; box-shadow: 0 0 0 9999px rgba(12,16,18,.5); transition: left 260ms var(--ease-out), top 260ms var(--ease-out), width 260ms var(--ease-out), height 260ms var(--ease-out); pointer-events: none; }
.tour.free .tour-hole { left: 50% !important; top: 50% !important; width: 0 !important; height: 0 !important; }
.tour-card { position: fixed; width: min(360px, calc(100vw - 28px)); background: var(--surface); color: var(--ink); border-radius: 20px; box-shadow: var(--shadow); padding: 20px 20px 16px; display: grid; gap: 8px; outline: none; transition: left 260ms var(--ease-out), top 260ms var(--ease-out); }
.tour.free .tour-card { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.tour-count { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.tour-card h2 { margin: 0; font: 500 20px/1.2 var(--font); letter-spacing: -.015em; }
.tour-text { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.tour-never { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); margin-top: 4px; min-height: 32px; }
.tour-acts { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.tour-acts [hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .tour-hole, .tour-card { transition: none; } }


/* Volle Breite: Seiten füllen den Bildschirm, auf dem Handy bleibt alles eine Spalte */
@media (max-width: 640px) { .home-grid .tile-big { grid-column: auto; } }

/* Das Feld in Akzentfarbe: wie weit der eigene Tag ist */
.focus-field { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 34%); align-items: center; gap: 12px 24px; padding: 16px 20px; margin: 4px 0 18px; border-radius: 20px; background: var(--accent-soft); color: var(--ink); }
.focus-field small { display: block; font-size: 13px; color: var(--ink-2); }
.focus-field b { display: block; font: 500 21px/1.25 var(--font); letter-spacing: -.015em; }
.focus-field .meter { height: 10px; background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.focus-field .meter i { background: var(--accent); }
@media (max-width: 560px) { .focus-field { grid-template-columns: minmax(0, 1fr); } }

/* Aufgaben: Gruppen nebeneinander, so weit der Platz reicht */
.tasks-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 4px; }
.tasks-top .quick { flex: 1 1 420px; margin: 0; }
.tasks-top .filter-row { margin: 0; }
.task-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 16px; align-items: start; }
@media (min-width: 761px) {
  .task-group { border: 1px solid var(--line); border-radius: 20px; background: var(--surface); padding: 0 6px 4px 14px; }
  .task-group .group-title { padding-top: 14px; }
  .task-group.hot { border-color: color-mix(in srgb, var(--red) 28%, var(--line)); }
}

/* Projekte: auf dem Handy Karten statt Tabelle */
@media (max-width: 760px) {
  .proj-table thead { display: none; }
  .proj-table, .proj-table tbody { display: block; }
  .proj-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .proj-table tr:last-child { border-bottom: 0; }
  .proj-table td { padding: 0; border: 0; }
  .proj-table .p-title { grid-column: 1; grid-row: 1; }
  .proj-table .p-owner { grid-column: 2; grid-row: 1; }
  .proj-table .p-stage { grid-column: 1 / -1; }
  .proj-table .p-no { grid-column: 1; grid-row: 2; }
  .proj-table .p-due { grid-column: 2; grid-row: 2; text-align: right; font-size: 13px; }
  .proj-table .p-hall, .proj-table .p-value { display: none; }
}

/* Kalender: Monat über die ganze Breite, der gewählte Tag rechts daneben */
.cal-month { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 16px; align-items: start; }
.cal-month .cal-picked { margin: 0; position: sticky; top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 2px 14px 14px; }
.cal-month .cal-picked .group-title { border-bottom: 0; padding-top: 14px; }
.cal-day { min-height: max(108px, calc((100dvh - 340px) / 6)); }
.cal-item:nth-of-type(n+4) { display: none; }
.cal-more.more-5 { display: none; }
@media (min-width: 1500px) {
  .cal-item:nth-of-type(n+4) { display: block; }
  .cal-more.more-3 { display: none; }
  .cal-more.more-5 { display: inline; }
}
@media (max-width: 1180px) { .cal-month { grid-template-columns: minmax(0, 1fr); } .cal-month .cal-picked { position: static; background: none; border: 0; padding: 0; } }
@media (max-width: 760px) { .cal-day { min-height: 62px; } }

/* Schichtplanung: das Raster nimmt die ganze Breite, Zeilen mit Luft für 10 bis 20 Leute */
.sp-scroll { overflow-x: auto; }
.sp-grid { width: 100%; }
.sp-grid thead th { min-width: 40px; padding: 8px 0; font-size: 13px; }
.sp-grid td { height: 52px; min-width: 40px; }
.sp-grid tbody tr:nth-child(even) > * { background-color: color-mix(in srgb, var(--sunken) 45%, var(--surface)); }
.sp-grid tbody td.we { background-color: var(--sunken); }
.sp-grid tbody tr.mine > * { background-color: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.sp-grid tbody tr.mine > th.sp-name { box-shadow: inset 3px 0 0 var(--accent); }
@media (hover: hover) and (pointer: fine) { .sp-grid tbody tr:hover > * { background-color: var(--sunken); } }
.sp-name > .sp-who { display: flex; max-width: none; margin-left: 0; }
.sp-grid td.locked { background-image: repeating-linear-gradient(135deg, transparent 0 5px, var(--hatch) 5px 6px); }
.sp-grid td.free { cursor: pointer; }
.sp-grid .sp-plus { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px dashed var(--line-2); color: var(--ink-3); }
.sp-grid .sp-plus .ic { width: 14px; height: 14px; }
@media (hover: hover) and (pointer: fine) { .sp-grid td.free:hover .sp-plus { border-style: solid; border-color: var(--accent); color: var(--accent-ink); } }
.sp-name { min-width: 220px; max-width: 260px; padding: 0 10px !important; }
.sp-who { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; text-align: left; border-radius: 12px; }
button.sp-who { padding: 0 6px; margin-left: -6px; }
@media (hover: hover) and (pointer: fine) { button.sp-who:hover { background: var(--sunken); } }
.sp-who > span:last-child { display: grid; min-width: 0; }
.sp-who b { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-who small { font: 400 12px/1.25 var(--font); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-chip { width: 32px; height: 32px; line-height: 32px; }
.sp-sum { min-width: 88px; }
@media (max-width: 760px) {
  .sp-name { min-width: 128px; max-width: 128px; padding: 0 6px !important; }
  .sp-who .av { display: none; }
  .sp-grid td { height: 46px; min-width: 36px; }
  .sp-grid thead th { min-width: 36px; }
}

/* Mein Plan: nächste Schicht und Wochenlimit nebeneinander, Monat und Wochen daneben */
.sp-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 12px; margin-bottom: 12px; }
.sp-top .sp-next { margin: 0; }
.sp-limit { background: var(--accent-soft); border-color: transparent; }
.sp-limit b span { font-size: 17px; color: var(--ink-2); font-weight: 400; }
.sp-open-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; margin: 0 0 12px; border-radius: 16px; background: var(--green-bg); color: var(--green); font-size: 14px; }
.sp-open-note .ic { margin-top: 2px; }
.sp-open-note b { font-weight: 500; }
.sp-month-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 360px); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .sp-month-wrap { grid-template-columns: minmax(0, 1fr); } }
.sp-month .cal-day { min-height: 92px; }
.sp-month .cal-day.locked { background-image: repeating-linear-gradient(135deg, transparent 0 5px, var(--hatch) 5px 6px); }
.sp-month .cal-day.free { cursor: pointer; }
.sp-month .sp-plus { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: auto; min-height: 28px; border: 1px dashed var(--line-2); border-radius: 10px; font-size: 12px; color: var(--ink-2); }
.sp-month .sp-plus .ic { width: 13px; height: 13px; }
@media (hover: hover) and (pointer: fine) { .sp-month .cal-day.free:hover .sp-plus { border-style: solid; border-color: var(--accent); color: var(--accent-ink); } }
.sp-lock { margin-top: auto; align-self: center; color: var(--ink-3); }
.sp-lock .ic { width: 14px; height: 14px; }
.sp-weeks { display: grid; gap: 4px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); padding: 8px 14px; }
.sp-weeks li { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 40px; font-size: 14px; }
.sp-weeks li > span:first-child { color: var(--ink-2); font-size: 13px; }
.sp-weeks li.now > span:first-child { color: var(--accent-ink); font-weight: 500; }
.sp-weeks .meter i { background: var(--accent); }
.sp-weeks b { font-weight: 500; white-space: nowrap; }
.sp-weeks b small { font-weight: 400; color: var(--ink-2); font-size: 12.5px; }
@media (max-width: 760px) { .sp-month .cal-day { min-height: 58px; } .sp-month .sp-plus span { display: none; } }

/* Selbst eintragen: Schichten zur Wahl */
.sp-pick { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.sp-option { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 16px; cursor: pointer; }
.sp-option input { width: 18px; height: 18px; accent-color: var(--accent); }
.sp-option strong { display: block; font-weight: 500; }
.sp-option small { display: block; font-size: 13px; color: var(--ink-2); }
.sp-option:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.sp-option.is-off { cursor: default; opacity: .6; }
.sp-rules { border: 0; border-top: 1px solid var(--line); margin: 6px 0 0; padding: 14px 0 0; display: grid; gap: 14px; }
.sp-rules legend { padding: 0 0 4px; }
.sp-daypick { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-daypick label { position: relative; }
.sp-daypick input { position: absolute; opacity: 0; }
.sp-daypick span { display: inline-grid; place-items: center; min-width: 46px; height: 40px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.sp-daypick input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.sp-daypick input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Finanzen */
.fin-over { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 14px; margin-bottom: 14px; align-items: start; }
.fin-over .panel { margin: 0 !important; }
.fin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 14px; align-items: start; }
.fin-grid .panel { margin: 0 !important; }
.fin-parts { display: grid; gap: 4px; }
.fin-parts button { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'l v' 'm p'; gap: 6px 12px; width: 100%; padding: 8px 6px; border-radius: 12px; text-align: left; font-size: 14px; }
.fin-parts button > span:first-child { grid-area: l; color: var(--ink-2); }
.fin-parts b { grid-area: v; font-weight: 500; text-align: right; }
.fin-parts .meter { grid-area: m; align-self: center; }
.fin-parts small { grid-area: p; font-size: 12.5px; color: var(--ink-3); text-align: right; min-width: 40px; }
@media (hover: hover) and (pointer: fine) { .fin-parts button:hover { background: var(--sunken); } }
.fin-name { display: block; font-weight: 500; }
td small.muted { display: block; font-size: 12.5px; }
tfoot td { font-weight: 500; border-top: 1px solid var(--line); }
@media (max-width: 1180px) { .fin-over { grid-template-columns: minmax(0, 1fr); } }

/* Einstellungen: Felder nebeneinander, wenn Platz ist */
.settings-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); align-items: start; }
.settings-grid.is-wide { grid-template-columns: minmax(0, 1fr); }
.settings-grid .span-2 { grid-column: 1 / -1; }
.accent-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); gap: 20px; align-items: start; }
@media (max-width: 900px) { .accent-body { grid-template-columns: minmax(0, 1fr); } }
.accent-preview { display: grid; gap: 10px; padding: 14px; border-radius: 16px; background: var(--ground); border: 1px solid var(--line); }
.accent-preview .nav-item { pointer-events: none; }
.accent-preview .focus-field { margin: 0; padding: 12px 14px; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.accent-preview .focus-field b { font-size: 16px; }
.accent-row { display: flex; align-items: center; gap: 14px; padding: 0 4px; }
.accent-row .cal-n { display: inline-block; flex: none; }
.accent-row .strip { flex: 1; }
.accent-row .home-ring { width: 36px; height: 36px; flex: none; fill: none; stroke-width: 3.4; }

/* Einrichtung beim ersten Start: Branche, Funktionen, Firma */
.setup { min-height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--ground); }
.setup-top { display: flex; align-items: center; gap: 16px; padding: 14px var(--gutter); padding-top: calc(14px + env(safe-area-inset-top)); border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 2; }
.setup-mark .wordmark { height: 20px; color: var(--ink); }
.setup-steps { display: flex; gap: 4px; margin-left: 8px; }
.setup-steps li { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px 0 5px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--ink-3); }
.setup-steps li span { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-2); font-size: 12.5px; }
.setup-steps li.now { background: var(--sunken); color: var(--ink); }
.setup-steps li.now span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.setup-steps li.done { color: var(--ink-2); }
.setup-steps li.done span { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.setup-body { padding: 40px var(--gutter) 40px; }
.setup-step { max-width: 1180px; margin: 0 auto; animation: setup-in 260ms var(--ease-out); }
@keyframes setup-in { from { opacity: 0; transform: translateY(8px); } }
.setup-step h1 { font: 500 clamp(28px, 3vw, 40px)/1.1 var(--font); letter-spacing: -.03em; text-wrap: balance; }
.setup-lead { margin: 10px 0 28px; max-width: 62ch; font-size: 16px; color: var(--ink-2); }
.ind-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 10px; }
.ind { display: grid; align-content: start; gap: 4px; min-height: 92px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); text-align: left; transition: border-color 150ms ease, box-shadow 150ms ease, transform 120ms var(--ease-out); }
.ind strong { font-size: 15.5px; font-weight: 500; }
.ind small { font-size: 13.5px; line-height: 1.35; color: var(--ink-2); }
.ind:active { transform: scale(.98); }
.ind[aria-checked="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
@media (hover: hover) and (pointer: fine) { .ind:hover { border-color: var(--line-2); } .ind[aria-checked="true"]:hover { border-color: var(--ink); } }
.setup-other { margin-top: 18px; max-width: 480px; }
.setup-join { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.setup-join .link { font-size: 14.5px; }
.setup-join-form { display: flex; align-items: flex-end; gap: 8px; max-width: 480px; }
.setup-join-form .field { flex: 1; }
.setup-join-form .btn { min-height: 44px; }
.mod-always { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.mod-always .label { margin-right: 4px; }
.mod-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px; background: var(--sunken); font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.mod-chip .ic { width: 15px; height: 15px; }
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 10px; }
.mod-card { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); cursor: pointer; transition: border-color 150ms ease; }
.mod-card input { position: absolute; opacity: 0; pointer-events: none; }
.mod-card:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.mod-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--sunken); color: var(--ink-3); transition: background-color 150ms ease, color 150ms ease; }
.mod-ic .ic { width: 20px; height: 20px; }
.mod-card .t strong { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-weight: 500; font-size: 15px; }
.mod-card .t small { display: block; margin-top: 2px; font-size: 13.5px; line-height: 1.4; color: var(--ink-2); }
.mod-tip { font-size: 12px; font-weight: 500; color: var(--accent-ink); background: var(--accent-soft); padding: 2px 8px; border-radius: 999px; }
.switch { position: relative; width: 42px; height: 26px; border-radius: 999px; background: var(--line-2); transition: background-color 160ms ease; flex: none; }
.switch::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform 200ms var(--ease-out); }
.mod-card.is-on { border-color: var(--line-2); }
.mod-card.is-on .mod-ic { background: var(--accent-soft); color: var(--accent-ink); }
.mod-card.is-on .switch { background: var(--primary); }
.mod-card.is-on .switch::after { transform: translateX(16px); background: var(--on-primary); }
.setup-firm { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 420px); gap: 28px; align-items: start; }
.setup-firm .form { max-width: 520px; }
.setup-sum { padding: 18px 20px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); }
.setup-sum dl { display: grid; gap: 2px; margin: 10px 0 0; }
.setup-sum dt { font-size: 12.5px; color: var(--ink-3); margin-top: 8px; }
.setup-sum dd { margin: 0; font-size: 14.5px; }
.setup-foot { position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.setup-foot .form-error { margin: 0; }
.setup-foot .btn { min-height: 44px; padding: 0 20px; }
.setup-foot .btn:disabled { opacity: .45; cursor: default; }
@media (max-width: 760px) {
  .setup-top { gap: 8px; padding-left: 16px; padding-right: 16px; }
  .setup-top .link { font-size: 14px; }
  .setup-mark .wordmark { height: 15px; }
  .setup-steps { margin-left: 0; min-width: 0; }
  .setup-steps li { padding: 0 4px; font-size: 0; gap: 0; min-height: 30px; }
  .setup-steps li.now { font-size: 13px; padding: 0 10px 0 4px; gap: 6px; }
  .setup-body { padding: 24px 16px 32px; }
  .setup-lead { font-size: 15px; margin-bottom: 20px; }
  .ind { min-height: 0; padding: 14px 16px; }
  .setup-firm { grid-template-columns: minmax(0, 1fr); }
  .setup-foot .btn { flex: 1; }
  .setup-foot .grow { display: none; }
  .setup-foot { flex-wrap: wrap; }
  .setup-foot .form-error { flex-basis: 100%; }
}

/* Kunden und Team: Kontakt mit einem Klick */
.clients { display: grid; }
.client-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 6px 12px 6px 6px; border-bottom: 1px solid var(--line); }
.client-row:last-child { border-bottom: 0; }
.client-main { display: grid; gap: 2px; padding: 8px 10px; border-radius: 12px; text-align: left; min-width: 0; }
.client-main strong { font-weight: 500; overflow-wrap: anywhere; }
.client-main small { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
@media (hover: hover) and (pointer: fine) { button.client-main:not(:disabled):hover { background: var(--sunken); } }
.client-main:disabled { cursor: default; }
.client-reach { display: grid; gap: 2px; min-width: 0; font-size: 14px; }
.client-reach a { color: var(--ink-2); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-reach a:hover { color: var(--ink); text-decoration: underline; }
.client-acts, .person-acts { display: flex; gap: 2px; }
.client-search { width: min(360px, 100%); min-height: 40px; border-radius: 999px; }
.person-row { display: flex; align-items: center; border-bottom: 1px solid var(--line); padding-right: 8px; }
.person-row:last-child { border-bottom: 0; }
.person-row .person { flex: 1; border-bottom: 0; min-width: 0; }
.new-client { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 12px 0 0; display: grid; gap: 12px; }
.new-client[hidden] { display: none; }
@media (max-width: 760px) {
  .client-row { grid-template-columns: minmax(0, 1fr) auto; }
  .client-reach { display: none; }
}

/* Kosten: schnell eintragen und auf einen Blick */
.cost-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; margin-bottom: 14px; overflow: visible; }
.cost-quick input[name=name] { flex: 2 1 220px; min-height: 40px; }
.cost-quick input[name=amount] { flex: 1 1 120px; min-height: 40px; }
.cost-quick select, .cost-quick input[type=date] { flex: 0 1 150px; width: auto; min-height: 40px; }
.cost-quick .btn { min-height: 40px; }
.cost-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; margin-bottom: 14px; }
.posten { display: grid; }
.posten li + li { border-top: 1px solid var(--line); }
.posten-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 18px; text-align: left; }
.posten-row .t { flex: 1; min-width: 0; display: grid; gap: 2px; }
.posten-row strong { font-weight: 500; overflow-wrap: anywhere; }
.posten-row small { font-size: 13px; color: var(--ink-2); }
.posten-row b { font-weight: 500; white-space: nowrap; text-align: right; }
.posten-row b small { font-weight: 400; }
.posten-row.is-ended { opacity: .55; }
@media (hover: hover) and (pointer: fine) { .posten-row:hover { background: var(--sunken); } }
.form-more { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 12px; }
.form-more summary { cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ink-2); min-height: 32px; display: flex; align-items: center; }
.form-more[open] summary { margin-bottom: 4px; }

/* Chat: Anhänge wie im Messenger */
.composer { align-items: flex-end; }
.attach { position: relative; flex: none; }
.composer .attach-btn { width: 44px; height: 44px; background: var(--sunken); color: var(--ink); }
.composer .attach-btn[aria-expanded="true"] { background: var(--primary); color: var(--on-primary); }
.attach-btn[aria-expanded="true"] .ic { transform: rotate(45deg); }
.attach-btn .ic { transition: transform 160ms var(--ease-out); }
.attach-menu { position: absolute; left: 0; bottom: calc(100% + 10px); z-index: 20; display: grid; gap: 2px; min-width: 220px; padding: 6px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow), 0 0 0 1px var(--line); transform-origin: 0 100%; animation: attach-in 180ms var(--ease-out); }
.attach-menu[hidden] { display: none; }
@keyframes attach-in { from { opacity: 0; transform: translateY(6px) scale(.97); } }
.attach-menu label, .attach-menu button { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; font-size: 15px; cursor: pointer; text-align: left; width: 100%; }
.attach-menu .ic { width: 20px; height: 20px; color: var(--ink-2); }
@media (hover: hover) and (pointer: fine) { .attach-menu label:hover, .attach-menu button:hover { background: var(--sunken); } }
.attach-menu .touch-only { display: none; }
@media (pointer: coarse) { .attach-menu .touch-only { display: flex; } }
.composer-field { flex: 1; min-width: 0; display: grid; gap: 8px; }
.composer-field input { width: 100%; }
.pending { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.pending-item { position: relative; flex: none; display: flex; align-items: center; gap: 8px; max-width: 240px; padding: 6px 30px 6px 6px; border-radius: 14px; background: var(--sunken); font-size: 13px; }
.pending-item img, .pending-ic { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; }
.pending-ic { display: grid; place-items: center; background: var(--surface); color: var(--ink-2); }
.pending-item .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pending-item small { display: block; color: var(--ink-3); font-size: 12px; }
.pending-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--ink-2); }
.pending-x .ic { width: 12px; height: 12px; }
.atts { display: grid; gap: 6px; margin-top: 6px; max-width: min(420px, 100%); }
.att-img { display: block; max-height: 360px; border-radius: 14px; overflow: hidden; background: var(--sunken); }
.att-img img { display: block; width: 100%; height: 100%; max-height: 360px; object-fit: cover; }
.att-video { display: block; width: 100%; max-height: 360px; border-radius: 14px; background: #000; }
.att-file, .att-loc { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--sunken); color: var(--ink); text-decoration: none; min-width: 0; }
.att-file .ic, .att-loc .ic { width: 22px; height: 22px; flex: none; color: var(--ink-2); }
.att-file span, .att-loc span { min-width: 0; display: grid; }
.att-file b, .att-loc b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-file small, .att-loc small { font-size: 12px; color: var(--ink-2); }
@media (hover: hover) and (pointer: fine) { .att-file:hover, .att-loc:hover { background: var(--line); } }
/* Coco über dem Senden-Knopf: im offenen Chat ein Stück höher */
body.chat-open .coco-fab { bottom: 96px; }
body.chat-open .hold-hint { bottom: 168px; }
@media (max-width: 760px) {
  body.chat-open .coco-fab { bottom: calc(env(safe-area-inset-bottom) + 142px); }
  body.chat-open .hold-hint { bottom: calc(env(safe-area-inset-bottom) + 210px); }
}

/* Hinweis auf Push in Mein Plan */
.sp-push { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 12px; border-radius: 16px; background: var(--accent-soft); font-size: 14px; }
.sp-push[hidden] { display: none; }
.sp-push > .ic { color: var(--accent-ink); }
.sp-push span { flex: 1 1 240px; }
