/*
  Gestaltung: Regieraum bei Nacht.
  Pult-Schiefer als Grund, Dialogbuch-Papier für Schrift und Hauptaktionen,
  Rotlicht nur für „jetzt“ und „überfällig“. Farbe gehört den Kunden – wie Regionen in einer Schnittspur.
  Schrift: DIN Condensed (Gerätebeschriftung) für Überschriften und Summen, Avenir Next für alles andere.
*/

:root {
  color-scheme: dark;
  --bg: #1a1f25;
  --rail: #14181d;
  --surface: #222931;
  --raised: #2b343e;
  --rule: #35404b;
  --paper: #f1ece1;
  --ink: #171b20;
  --text: #e9e5dc;
  --muted: #98a2ad;
  --red: #ff5442;
  --green: #6fd39a;
  --amber: #f0b34a;
  --radius: 6px;
  --display: "DIN Condensed", "Bahnschrift", "Roboto Condensed", "Arial Narrow", sans-serif;
  --body: "Avenir Next", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
h1, h2, .pipe-sum, .brand { font-family: var(--display); font-stretch: condensed; font-weight: 700; letter-spacing: 0.01em; }
h1 { font-size: 46px; line-height: 1; }
h2 { font-size: 24px; line-height: 1.1; }
h3 { font-size: 15.5px; font-weight: 600; }

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; }

.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.icon { flex: none; }
.spacer { flex: 1; }

/* ------------------------------------------------------------ Bausteine */

.brand { display: flex; align-items: center; gap: 10px; font-size: 24px; line-height: 1; color: var(--paper); }
.brand span:last-child { padding-top: 4px; }
.brand-logo { display: block; width: 128px; height: auto; }
.brand-mark { display: block; height: 24px; width: auto; }
.auth-hero .brand-logo { width: 150px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: var(--radius);
  border: 1px solid var(--rule); background: var(--raised); font-weight: 600; white-space: nowrap;
}
.btn:hover { background: #33404c; }
.btn.primary { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.btn.primary:hover { background: #fffaf0; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn.block { width: 100%; }
.btn.danger-ghost { background: transparent; border-color: transparent; color: var(--red); padding: 0 10px; }
.btn.danger-ghost:hover { background: color-mix(in srgb, var(--red) 12%, transparent); }
.btn:disabled { opacity: 0.6; cursor: default; }

.icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  border: 1px solid transparent; border-radius: var(--radius); background: transparent; color: var(--muted);
}
.icon-btn:hover:not(:disabled) { background: var(--raised); color: var(--text); }
.icon-btn:disabled { opacity: 0.3; cursor: default; }

.link { background: none; border: 0; padding: 6px 0; color: var(--paper); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.field { display: grid; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field-hint { font-size: 13px; color: var(--muted); }

input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="search"], textarea {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--rule); border-radius: var(--radius); background: var(--rail);
  font-size: 16px;
}
textarea { resize: vertical; min-height: 84px; }
input::placeholder, textarea::placeholder { color: #6b7682; }
input:focus, textarea:focus { outline: none; border-color: var(--paper); box-shadow: 0 0 0 3px color-mix(in srgb, var(--paper) 16%, transparent); }

.form-error { color: var(--red); font-size: 14px; }
.form-error:empty { display: none; }

.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }

.badge { display: inline-block; font-size: 14px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.badge.warn { color: var(--amber); font-weight: 600; }
.badge.danger { color: var(--red); font-weight: 600; }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; background: var(--c); flex: none; }

.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); z-index: 50;
  max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: var(--radius);
  background: var(--paper); color: var(--ink); font-weight: 600; border-left: 4px solid var(--red);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* ------------------------------------------------------------- Anmeldung */

.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, 1fr); }

.auth-hero {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  padding: 36px 44px; min-height: 100dvh;
  background:
    linear-gradient(180deg, rgba(20, 24, 29, 0.6) 0%, rgba(20, 24, 29, 0.1) 35%, rgba(20, 24, 29, 0.94) 100%),
    url("assets/studio-monitor.jpg") center 40% / cover no-repeat;
}
.auth-claim { max-width: 520px; margin-top: auto; }
.auth-claim h2 { font-size: clamp(44px, 5.2vw, 76px); line-height: 0.95; margin-bottom: 14px; color: var(--paper); }
.auth-claim p { color: #d3d6da; font-size: 16px; max-width: 420px; }
.credit { margin-top: 28px; font-size: 12px; color: rgba(255, 255, 255, 0.45); }

.auth-panel { display: grid; place-items: center; padding: 32px 24px; }
.auth-form { width: 100%; max-width: 380px; display: grid; gap: 16px; }
.auth-form h1 { margin-bottom: -6px; }
.auth-form .btn { margin-top: 4px; min-height: 46px; }
.auth-form .link { justify-self: center; }

/* ------------------------------------------------------------ Grundgerüst */

.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100dvh; }

.sidebar {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 30px;
  padding: 24px 0 18px; background: var(--rail); border-right: 1px solid var(--rule);
}
.sidebar .brand { padding: 0 22px; }
.nav { display: grid; }
.nav-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 22px;
  color: var(--muted); font-weight: 600; border-left: 3px solid transparent;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--paper); border-left-color: var(--paper); background: var(--bg); }

.sidebar-foot {
  margin: auto 14px 0; display: flex; align-items: center; gap: 8px;
  padding: 14px 0 0 8px; border-top: 1px solid var(--rule);
}
.who { min-width: 0; flex: 1; display: grid; }
.who strong, .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who span { font-size: 13px; color: var(--muted); }

.topbar, .tabbar { display: none; }

.main { padding: 38px clamp(20px, 3.4vw, 52px) 64px; max-width: 1420px; width: 100%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.page-head p { margin-top: 8px; }
.next { color: var(--muted); }
.next strong { color: var(--text); font-weight: 600; }
.next.urgent { color: var(--red); }
.next.urgent strong { color: var(--red); }

/* ---------------------------------------------------------------- Aufträge */

/* Durchlauf: vier Stufen, die ineinander übergehen */
.pipeline {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 22px;
  border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; background: var(--surface);
}
.pipe {
  position: relative; display: grid; gap: 2px; align-content: start; padding: 16px 18px 16px 30px; text-align: left;
  border: 0; border-right: 1px solid var(--rule); border-radius: 0; background: var(--surface);
}
.pipe:first-child { padding-left: 20px; }
.pipe:last-child { border-right: 0; }
.pipe:not(:last-child)::after {
  content: ""; position: absolute; z-index: 1; right: -9px; top: 50%; width: 17px; height: 17px;
  transform: translateY(-50%) rotate(45deg); background: inherit;
  border-top: 1px solid var(--rule); border-right: 1px solid var(--rule);
}
.pipe:hover { background: var(--raised); }
.pipe-label { font-size: 13.5px; font-weight: 600; color: var(--muted); }
.pipe-sum { font-size: 38px; line-height: 1; padding-top: 6px; color: var(--paper); font-variant-numeric: tabular-nums; }
.pipe-count { font-size: 13px; color: var(--muted); }
.pipe.active, .pipe.active:hover { background: var(--paper); }
.pipe.active .pipe-label, .pipe.active .pipe-count { color: #4c545d; }
.pipe.active .pipe-sum { color: var(--ink); }
.pipe:focus-visible { outline-offset: -3px; z-index: 2; }

.toolbar { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 24px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 13px;
  border: 1px solid var(--rule); border-radius: var(--radius); background: transparent; color: var(--muted); font-weight: 600; font-size: 14px;
}
.chip:hover { color: var(--text); background: var(--surface); }
.chip.active { background: var(--paper); border-color: var(--paper); color: var(--ink); }

.search { position: relative; flex: 1 1 260px; max-width: 360px; color: var(--muted); }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search input { padding-left: 38px; min-height: 40px; font-size: 15px; background: var(--surface); }

.group { margin-bottom: 30px; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 2px 8px; }
.group-head span { font-size: 14px; }

/* Aufträge als Zeilen einer Liste; der farbige Rand ist die Kundenfarbe */
.rows { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; align-items: center;
  padding: 15px 16px 15px 20px; cursor: pointer; box-shadow: inset 4px 0 0 var(--c);
}
.row + .row { border-top: 1px solid var(--rule); }
.row:hover { background: var(--raised); }
.row:focus-visible { outline-offset: -2px; }
.row-main { grid-column: 1 / -1; min-width: 0; }
.row-main h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-client { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 2px; font-size: 14px; color: var(--muted); }
.row-cell { min-width: 0; font-size: 14.5px; }
.row-cell::before { content: attr(data-label); display: block; font-size: 12.5px; color: var(--muted); }
.row-money { display: grid; }
.row-money strong { font-variant-numeric: tabular-nums; }
.row-money .muted { font-size: 13px; }
.row.stage-3 h3 { color: var(--muted); }
.tag { padding: 1px 7px; border-radius: 3px; background: var(--paper); color: var(--ink); font-size: 12px; font-weight: 600; }

.stepper { grid-column: 1 / -1; display: flex; gap: 6px; }
.step {
  flex: 1; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 0 10px; border: 1px solid var(--rule); border-radius: var(--radius);
  background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.step:hover { border-color: #55626f; color: var(--text); }
.step-box {
  display: grid; place-items: center; width: 17px; height: 17px; flex: none;
  border: 1.5px solid #5a6672; border-radius: 50%; color: transparent;
}
.step.on { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, var(--rule)); }
.step.on .step-box { background: var(--green); border-color: var(--green); color: #0d2a1a; }

@media (min-width: 1180px) {
  .rows:not(.compact) .row {
    grid-template-columns: minmax(0, 1fr) 70px 108px 150px 112px 284px;
    gap: 18px; padding: 12px 14px 12px 20px;
  }
  .rows:not(.compact) .row-main,
  .rows:not(.compact) .stepper { grid-column: auto; }
  .rows:not(.compact) .row-cell::before { display: none; }
  .rows:not(.compact) .row-main h3 { white-space: normal; }
  .rows:not(.compact) .row-money { text-align: right; }
  .rows:not(.compact) .step { min-height: 34px; padding: 0 8px; }
}

.empty { padding: 44px 24px; text-align: center; border: 1px dashed var(--rule); border-radius: var(--radius); }
.hero-empty {
  display: grid; justify-items: center; gap: 12px; padding: 96px 24px; border-style: solid;
  background:
    linear-gradient(180deg, rgba(26, 31, 37, 0.5), rgba(26, 31, 37, 0.92)),
    url("assets/studio-mikrofon.jpg") center 38% / cover no-repeat;
}
.hero-empty h2 { font-size: 40px; color: var(--paper); }
.hero-empty p { max-width: 380px; color: #cfd3d8; margin-bottom: 6px; }

/* ---------------------------------------------------------------- Kalender */

.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.cal-side { display: grid; gap: 16px; min-width: 0; }
@media (min-width: 1280px) {
  .cal-layout { grid-template-columns: minmax(0, 1fr) 380px; }
}

.cal { overflow: hidden; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 12px 18px; }
.cal-head h2 { font-size: 30px; padding-top: 4px; }
.cal-nav { display: flex; align-items: center; gap: 4px; }

.weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--rule); background: var(--rail); }
.weekdays span { padding: 7px 10px; font-size: 13px; font-weight: 600; color: var(--muted); }

.week {
  --head: 32px; --lane: 23px;
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-template-rows: var(--head) repeat(var(--lanes), var(--lane)) minmax(10px, 1fr);
  row-gap: 3px; min-height: 108px; border-top: 1px solid var(--rule);
}

.day {
  grid-row: 1 / -1; display: flex; align-items: flex-start; justify-content: flex-start; padding: 7px 10px;
  border: 0; border-right: 1px solid var(--rule); border-radius: 0; background: transparent;
}
.day:nth-child(7) { border-right: 0; }
.day.weekend { background: rgba(0, 0, 0, 0.14); }
.day.outside .day-num { color: #5d6873; }
.day:hover { background: var(--raised); }
.day.selected { box-shadow: inset 0 0 0 2px var(--paper); }
.day:focus-visible { outline-offset: -3px; }
.day-num { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; color: #c5c9cd; }
.day.today .day-num { color: var(--red); font-weight: 700; }

/* Abspielkopf auf dem heutigen Tag */
.playhead { grid-row: 1 / -1; z-index: 2; justify-self: start; position: relative; width: 2px; background: var(--red); pointer-events: none; }
.playhead::before {
  content: ""; position: absolute; top: 0; left: -5px;
  border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid var(--red);
}

.bar {
  position: relative; z-index: 1; min-width: 0; height: var(--lane); padding: 0 8px;
  border: 0; border-radius: 0; text-align: left;
  font-size: 12.5px; font-weight: 600; line-height: var(--lane);
}
.bar.is-start { margin-left: 4px; border-top-left-radius: 3px; border-bottom-left-radius: 3px; }
.bar.is-end { margin-right: 4px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; }
.bar-label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Status im Kalender: gefüllt → getönt → gestrichelt → verblasst */
.bar.stage-0 { background: var(--c); color: var(--ink); }
.bar.stage-1 { background: color-mix(in srgb, var(--c) 26%, var(--surface)); color: color-mix(in srgb, var(--c) 70%, white); box-shadow: inset 0 0 0 1.5px var(--c); }
.bar.stage-2 { background: transparent; color: color-mix(in srgb, var(--c) 70%, white); outline: 1.5px dashed var(--c); outline-offset: -1.5px; }
.bar.stage-3 { background: color-mix(in srgb, var(--c) 13%, var(--surface)); color: color-mix(in srgb, var(--c) 45%, var(--muted)); }
.bar.stage-3 .bar-label { text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--c) 45%, transparent); }
.bar.overdue { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--red); }
.bar:not(.sample):hover { filter: brightness(1.12); }
.bar:focus-visible { outline: 2px solid var(--paper); outline-offset: 1px; }

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 10px 10px 18px; }
.panel-head h2 { padding-top: 4px; }
.day-panel > .muted { padding: 0 18px 18px; }
.day-panel .rows { border-width: 1px 0 0; border-radius: 0; background: transparent; }
.compact .step { padding: 0 5px; gap: 5px; font-size: 12.5px; }

.legend { padding: 16px 18px 18px; }
.legend h2 { font-size: 20px; margin-bottom: 8px; }
.legend ul + h2 { margin-top: 18px; }
.legend ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.bar.sample { --c: #c9cdd2; display: inline-block; width: 34px; height: 15px; padding: 0; border-radius: 3px; }

/* ------------------------------------------------------------------ Kunden */

.inline-form { display: flex; gap: 10px; margin-bottom: 22px; max-width: 620px; }
.clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.client {
  display: grid; gap: 12px; padding: 16px 16px 16px 20px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: inset 4px 0 0 var(--c);
}
.client-top { display: flex; align-items: center; gap: 6px; }
.swatch { display: none; }
input.ghost-input { border-color: transparent; background: transparent; padding: 6px 8px; margin-left: -8px; min-height: 38px; font-weight: 600; }
input.ghost-input:hover { border-color: var(--rule); }
.client p { font-size: 14px; }
.palette { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch-btn { width: 28px; height: 28px; border-radius: 4px; border: 2px solid var(--surface); background: var(--c); padding: 0; }
.swatch-btn.active { box-shadow: 0 0 0 2px var(--paper); }

/* ------------------------------------------------------------------- Konto */

.account { display: grid; gap: 16px; max-width: 560px; justify-items: start; }
.form-card { width: 100%; display: grid; gap: 14px; padding: 20px; }
.form-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.form-note { font-size: 14px; color: var(--green); }
.form-note.error { color: var(--red); }
.switch { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--green); }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-size: 14px; color: var(--muted); }
.checks { display: grid; gap: 10px; margin: 0; padding: 0; border: 0; }
.checks legend { margin-bottom: 10px; padding: 0; }
.checks .switch { font-weight: 500; }
.field-hint .link { padding: 0; font-size: inherit; }
.text-link { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.text-link:hover { color: var(--paper); }
.invite { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.invite code { padding: 8px 12px; border-radius: var(--radius); background: var(--rail); border: 1px solid var(--rule); font: 15px ui-monospace, Menlo, Consolas, monospace; user-select: all; }

/* ------------------------------------------------------------------ Dialog */

.dialog {
  width: min(580px, calc(100vw - 24px)); max-height: min(92dvh, 860px); padding: 0;
  border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); color: var(--text);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}
.dialog::backdrop { background: rgba(12, 15, 18, 0.74); }
.dialog form { display: flex; flex-direction: column; max-height: inherit; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 14px 10px 22px; }
.dialog-head h2 { font-size: 30px; padding-top: 4px; }
.dialog-body { display: grid; gap: 14px; padding: 6px 22px 20px; overflow-y: auto; }
.dialog-foot { display: flex; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--rule); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.total-line {
  display: flex; align-items: baseline; justify-content: space-between; padding: 2px 2px 0; margin-top: -4px;
  color: var(--muted); font-size: 14px; font-weight: 600;
}
.total-line output { font: 700 28px/1 var(--display); font-stretch: condensed; color: var(--paper); font-variant-numeric: tabular-nums; }
.segmented { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--rail); }
.seg { min-height: 36px; padding: 0 6px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.seg.active { background: var(--paper); color: var(--ink); }

/* ------------------------------------------------------------------ Mobil */

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-hero { min-height: 0; padding: 22px 20px 26px; gap: 44px; }
  .auth-hero .brand-logo { width: 104px; }
  .auth-claim p, .credit { display: none; }
  .auth-claim h2 { margin-bottom: 0; }
  .auth-panel { place-items: start center; padding: 28px 20px 40px; }

  .shell { display: block; }
  .sidebar { display: none; }
  .topbar {
    display: flex; align-items: center; position: sticky; top: 0; z-index: 10;
    padding: calc(12px + env(safe-area-inset-top)) 16px 10px;
    background: var(--rail); border-bottom: 1px solid var(--rule);
  }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; inset: auto 0 0 0; z-index: 10;
    padding: 0 8px env(safe-area-inset-bottom);
    background: var(--rail); border-top: 1px solid var(--rule);
  }
  .tabbar .nav-link { flex-direction: column; gap: 3px; padding: 9px 4px 8px; font-size: 12px; border-left: 0; border-top: 3px solid transparent; }
  .tabbar .nav-link.active { background: transparent; border-top-color: var(--paper); }

  .main { padding: 22px 16px calc(96px + env(safe-area-inset-bottom)); }
  h1 { font-size: 38px; }
  .page-head { margin-bottom: 20px; align-items: flex-start; }
  .page-head .btn { padding: 0 14px; }

  .pipeline { grid-template-columns: 1fr; }
  .pipe, .pipe:first-child {
    grid-template-columns: 1fr auto; align-items: center; gap: 0 12px; padding: 11px 16px;
    border-right: 0; border-bottom: 1px solid var(--rule);
  }
  .pipe:last-child { border-bottom: 0; }
  .pipe:not(:last-child)::after { display: none; }
  .pipe-sum { grid-column: 2; grid-row: 1 / span 2; font-size: 30px; padding-top: 4px; }

  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .search { max-width: none; flex-basis: 100%; }

  .step { padding: 0 6px; font-size: 13px; gap: 5px; }

  .cal-head { padding: 10px 8px 8px 14px; }
  .weekdays span { padding: 6px 0; text-align: center; }
  .week { --head: 28px; --lane: 7px; row-gap: 3px; min-height: 62px; }
  .day { padding: 5px 0; justify-content: center; }
  .bar { padding: 0; pointer-events: none; }
  .bar.is-start { margin-left: 3px; border-top-left-radius: 2px; border-bottom-left-radius: 2px; }
  .bar.is-end { margin-right: 3px; border-top-right-radius: 2px; border-bottom-right-radius: 2px; }
  .bar-label { display: none; }
  .bar.overdue { box-shadow: 0 0 0 1.5px var(--red); }

  .inline-form { flex-direction: column; }
  .clients { grid-template-columns: 1fr; }

  .dialog { width: 100%; max-width: 100%; max-height: 94dvh; margin: auto 0 0; border-radius: 12px 12px 0 0; border-width: 1px 0 0; }
  .dialog-body { padding: 4px 16px 18px; }
  .dialog-head { padding: 14px 8px 8px 16px; }
  .dialog-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .segmented { grid-template-columns: 1fr 1fr; }
}
