:root {
  --bg: #f2f4f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --border: #dde2e9;
  --border-strong: #c3cad4;
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #6b7280;
  --appbar: #17202b;
  --appbar-text: #ffffff;
  --appbar-text-2: #a9b4c2;
  --primary: #b84d06;
  --primary-hover: #9f4205;
  --primary-text: #ffffff;
  --brand: #f07d1a;
  --brand-2: #e0421b;
  --focus: #f07d1a;
  --success: #15803d;
  --success-bg: #dcfce7;
  --warning: #92400e;
  --warning-bg: #fef3c7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --info: #1d4ed8;
  --info-bg: #dbeafe;
  --zone-off: #e2e6ec;
  --zone-on: #f5ae70;
  --shadow: 0 1px 2px rgba(17, 24, 39, 0.06), 0 4px 16px rgba(17, 24, 39, 0.06);
  --shadow-up: 0 -1px 0 var(--border), 0 -8px 24px rgba(17, 24, 39, 0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --tap: 48px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1218;
    --surface: #161d26;
    --surface-2: #1c2530;
    --border: #2a3542;
    --border-strong: #3a4757;
    --text: #e8edf3;
    --text-2: #b2bcc8;
    --text-3: #8d99a8;
    --appbar: #0a0e13;
    --appbar-text: #f3f6f9;
    --appbar-text-2: #93a0b0;
    --primary: #f08a2e;
    --primary-hover: #f5a052;
    --primary-text: #1a1204;
    --focus: #f5a052;
    --success: #4ade80;
    --success-bg: rgba(74, 222, 128, 0.14);
    --warning: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.14);
    --danger: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.15);
    --info: #93c5fd;
    --info-bg: rgba(147, 197, 253, 0.14);
    --zone-off: #253140;
    --zone-on: #a3561a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-up: 0 -1px 0 var(--border), 0 -8px 24px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

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

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- App-Rahmen ---------- */

.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: calc(60px + var(--safe-top));
  padding: var(--safe-top) 8px 0;
  background: var(--appbar);
  color: var(--appbar-text);
}
.appbar__title {
  flex: 1;
  min-width: 0;
  padding: 0 8px;
}
.appbar__title h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.appbar__title p {
  margin: 1px 0 0;
  font-size: 13px;
  color: var(--appbar-text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.appbar__btn {
  display: inline-grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.appbar__btn:active {
  background: rgba(255, 255, 255, 0.12);
}
.appbar__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 8px;
}
.appbar__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--appbar-text-2);
  white-space: nowrap;
}
.appbar__status--offline {
  background: rgba(251, 191, 36, 0.18);
  color: #fcd34d;
}

.brandmark {
  width: 30px;
  height: 30px;
  flex: none;
}

.stepbar {
  position: sticky;
  top: calc(60px + var(--safe-top));
  z-index: 15;
  padding: 10px 16px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.stepbar__inner {
  max-width: 760px;
  margin: 0 auto;
}
.stepbar__segments {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 6px;
}
.stepbar__seg {
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 99px;
  background: var(--border);
  cursor: pointer;
  position: relative;
}
.stepbar__seg::after {
  content: '';
  position: absolute;
  inset: -12px 0;
}
.stepbar__seg--done {
  background: var(--brand);
}
.stepbar__seg--current {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}
.stepbar__label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-2);
}
.stepbar__label b {
  color: var(--text);
}

.view {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 16px calc(112px + var(--safe-bottom));
  outline: none;
}
.view--no-actions {
  padding-bottom: calc(32px + var(--safe-bottom));
}

.actionbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 12px 16px calc(12px + var(--safe-bottom));
  background: var(--surface);
  box-shadow: var(--shadow-up);
}
.actionbar__inner {
  display: flex;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto;
}
.actionbar__inner > .btn {
  flex: 1;
}
.actionbar__inner > .btn--secondary {
  flex: 0 0 auto;
  min-width: 112px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 20px;
  border: 1.5px solid transparent;
  border-radius: 12px;
  background: var(--primary);
  color: var(--primary-text);
  font-size: 17px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease, transform 120ms ease, border-color 150ms ease;
  user-select: none;
}
.btn:hover {
  background: var(--primary-hover);
}
.btn:active {
  transform: scale(0.98);
}
.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.btn--secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--secondary:hover {
  background: var(--surface-2);
}
.btn--ghost {
  background: transparent;
  color: var(--primary);
  border-color: transparent;
}
.btn--ghost:hover {
  background: var(--surface-2);
}
.btn--danger {
  background: var(--danger);
  color: #fff;
}
.btn--small {
  min-height: 44px;
  padding: 0 14px;
  font-size: 15px;
}
.btn--block {
  width: 100%;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.card + .card,
.card + .section,
.section + .card,
.section + .section {
  margin-top: 16px;
}
.card__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
}
.card__title .icon {
  color: var(--brand);
}

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 4px 10px;
}
.section__head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.section__head span {
  font-size: 13px;
  color: var(--text-3);
}

.field {
  display: block;
}
.field + .field,
.field + .row,
.row + .field,
.row + .row {
  margin-top: 18px;
}
.field__label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 15px;
  font-weight: 650;
}
.field__label small {
  font-weight: 500;
  color: var(--text-3);
}
.field__hint {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-3);
}
.field__error {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--danger);
}
.field--invalid .field__error {
  display: flex;
}
.field--invalid .input,
.field--invalid .textarea,
.field--invalid .sigpad {
  border-color: var(--danger);
}

.input,
.textarea {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 17px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent);
}
.textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.45;
}
/* iOS Safari gibt Datums-/Zeitfeldern eine eigene Mindestbreite, die width:100% ignoriert und
   auf schmalen Handys über den Rand ragt. appearance:none + min-width:0 hebt das auf; der native
   Picker öffnet sich weiterhin. */
input[type='date'].input,
input[type='time'].input {
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
  max-width: 100%;
}
input[type='date'].input::-webkit-date-and-time-value {
  text-align: left;
}
input[type='time'].input::-webkit-date-and-time-value {
  text-align: center;
}
.input--time {
  font-size: 22px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.input-group {
  display: flex;
  gap: 8px;
}
.input-group .input {
  flex: 1;
  min-width: 0;
}

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}
.row > .field + .field {
  margin-top: 0;
}
@media (max-width: 559px) {
  .row--stack {
    grid-template-columns: minmax(0, 1fr);
  }
  .row--stack > .field + .field {
    margin-top: 0;
  }
}
@media (max-width: 339px) {
  .row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.chip[aria-pressed='true'] {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--brand) 14%, var(--surface));
  color: var(--text);
}
.chip[aria-pressed='true'] .icon {
  color: var(--primary);
}
.chip--small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
}
.chips--scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  margin: 0 -16px;
  padding: 2px 16px 6px;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chips--scroll::-webkit-scrollbar {
  display: none;
}
.chips--scroll .chip {
  flex: none;
  white-space: nowrap;
  scroll-snap-align: start;
}
.chip > .icon.chk {
  display: none;
}
.chip[aria-pressed='true'] > .icon.chk {
  display: inline-block;
}
.chip--removable {
  padding-left: 6px;
  padding-right: 6px;
  cursor: default;
}
.chip .avatar {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-text);
}
.chip__x {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}
.chip__x:active {
  background: var(--surface-2);
}

.segmented {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.segmented button {
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
}
.segmented button[aria-pressed='true'] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.segmented--big button {
  min-height: 56px;
  font-size: 16px;
}
.segmented--big button[aria-pressed='true'].is-yes {
  background: var(--success-bg);
  color: var(--success);
}
.segmented--big button[aria-pressed='true'].is-no {
  background: var(--warning-bg);
  color: var(--warning);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--tap);
  cursor: pointer;
}
.switch-row__text b {
  display: block;
  font-size: 16px;
}
.switch-row__text span {
  font-size: 14px;
  color: var(--text-3);
}
.switch {
  position: relative;
  flex: none;
  width: 56px;
  height: 32px;
  border-radius: 99px;
  background: var(--border-strong);
  transition: background-color 150ms ease;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 180ms ease;
}
.switch-row {
  position: relative;
}
.switch-row input:checked + .switch {
  background: var(--primary);
}
.switch-row input:checked + .switch::after {
  transform: translateX(24px);
}
.switch-row input:focus-visible + .switch {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.reveal {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stepper__btn {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}
.stepper__btn:active {
  background: var(--surface-2);
}
.stepper__value {
  flex: 1;
  min-width: 64px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stepper__value small {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-3);
}

.timefield {
  display: grid;
  gap: 8px;
}
.timefield .btn {
  min-height: 40px;
  font-size: 14px;
}

.total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.total span {
  font-size: 15px;
  color: var(--text-2);
}
.total b {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}
.total--error {
  background: var(--danger-bg);
  border-color: transparent;
}
.total--error b,
.total--error span {
  color: var(--danger);
}

.badge {
  --c: #64748b;
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: color-mix(in srgb, var(--c) 15%, var(--surface));
  color: color-mix(in srgb, var(--c) 78%, #000);
}
@media (prefers-color-scheme: dark) {
  .badge {
    background: color-mix(in srgb, var(--c) 28%, var(--surface));
    color: color-mix(in srgb, var(--c) 35%, #fff);
  }
}
.badge[data-line='EMH'] { --c: #2563eb; }
.badge[data-line='EHN'] { --c: #16a34a; }
.badge[data-line='GDC'] { --c: #0d9488; }
.badge[data-line='ESB'] { --c: #dc2626; }
.badge[data-line='HGB'] { --c: #ca8a04; }
.badge[data-line='DNR'] { --c: #65a30d; }
.badge[data-line='EFS'] { --c: #9333ea; }
.badge[data-line='HDH'] { --c: #e11d48; }
.badge[data-line='TGT'] { --c: #ea580c; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
  background: var(--surface-2);
  color: var(--text-2);
}
.pill .icon {
  width: 15px;
  height: 15px;
}
.pill--draft { background: var(--info-bg); color: var(--info); }
.pill--queued { background: var(--warning-bg); color: var(--warning); }
.pill--sent { background: var(--success-bg); color: var(--success); }
.pill--error { background: var(--danger-bg); color: var(--danger); }

.banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 15px;
}
.banner + .banner,
.banner + .card,
.card + .banner {
  margin-top: 12px;
}
.banner b {
  display: block;
}
.banner__body {
  flex: 1;
  min-width: 0;
}
.banner--info { background: var(--info-bg); color: var(--info); }
.banner--warning { background: var(--warning-bg); color: var(--warning); }
.banner--danger { background: var(--danger-bg); color: var(--danger); }
.banner--success { background: var(--success-bg); color: var(--success); }
.banner .btn {
  margin-top: 10px;
}

.howto {
  margin-bottom: 16px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand) 9%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--border));
}
.howto summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--tap);
  padding: 0 14px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}
.howto summary::-webkit-details-marker {
  display: none;
}
.howto summary .icon {
  color: var(--primary);
}
.howto summary .chev {
  margin-left: auto;
  transition: transform 180ms ease;
}
.howto[open] summary .chev {
  transform: rotate(90deg);
}
.howto ul {
  margin: 0;
  padding: 0 16px 14px 44px;
  color: var(--text-2);
  font-size: 15px;
}
.howto li + li {
  margin-top: 4px;
}

/* ---------- Listen ---------- */

.search {
  position: relative;
}
.search .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  pointer-events: none;
}
.search .input {
  padding-left: 46px;
}

.toolbar {
  display: grid;
  gap: 12px;
}

.order-card {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  color: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 150ms ease, transform 120ms ease;
}
.order-card + .order-card {
  margin-top: 10px;
}
.order-card:active {
  transform: scale(0.99);
  border-color: var(--border-strong);
}
.order-card__top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.order-card__no {
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.order-card__date {
  margin-left: auto;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}
.order-card__date--overdue {
  color: var(--danger);
}
.order-card__name {
  margin-top: 6px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
}
.order-card__meta {
  margin-top: 2px;
  font-size: 14px;
  color: var(--text-2);
}
.order-card__comm {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.order-card__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.order-card__chev {
  color: var(--text-3);
}

.kv {
  display: grid;
  grid-template-columns: minmax(110px, auto) 1fr;
  gap: 8px 16px;
  margin: 0;
  font-size: 15px;
}
.kv dt {
  color: var(--text-3);
}
.kv dd {
  margin: 0;
  font-weight: 550;
  min-width: 0;
  overflow-wrap: anywhere;
}

.list-plain {
  margin: 0;
  padding: 0;
  list-style: none;
}
.list-plain li {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  font-size: 15px;
}
.list-plain li:first-child {
  border-top: 0;
  padding-top: 0;
}
.list-plain .grow {
  flex: 1;
  min-width: 0;
}
.list-plain small {
  display: block;
  color: var(--text-3);
  font-size: 13px;
}
.mono {
  font-family: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;
  font-size: 0.95em;
}

.hero {
  display: grid;
  gap: 6px;
}
.hero__name {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 750;
  line-height: 1.25;
}
.hero__addr {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-2);
}
.hero__addr .icon {
  margin-top: 2px;
  color: var(--text-3);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.empty {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 40px 16px;
  text-align: center;
  color: var(--text-3);
}
.empty .icon {
  width: 44px;
  height: 44px;
  color: var(--border-strong);
}
.empty b {
  color: var(--text);
  font-size: 17px;
}

.skeleton {
  height: 118px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  border: 1px solid var(--border);
}
.skeleton + .skeleton {
  margin-top: 10px;
}
@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

/* ---------- Material ---------- */

.material {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.material + .material {
  margin-top: 12px;
}
.material__head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}
.material__head .icon {
  margin-top: 2px;
  color: var(--brand);
}
.material__title {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  line-height: 1.3;
}
.material__title small {
  display: block;
  font-weight: 500;
  color: var(--text-3);
}
.material--muted {
  opacity: 0.72;
}

/* ---------- Fotos ---------- */

.photo-drop {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}
.photo-drop label {
  position: relative;
  overflow: hidden;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  min-height: 120px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-weight: 650;
  cursor: pointer;
}
.photo-drop label:active {
  background: var(--surface-2);
}
.photo-drop label .icon {
  width: 32px;
  height: 32px;
  color: var(--brand);
}
.photo-drop input,
.switch-row input {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.photo-drop label:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.photo {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo__del {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.72);
  color: #fff;
  cursor: pointer;
}
.photo__del::after {
  content: '';
  position: absolute;
  inset: -6px;
}

/* ---------- Unterschrift ---------- */

.sigpad {
  position: relative;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  touch-action: none;
}
.sigpad canvas {
  display: block;
  width: 100%;
  height: 190px;
  cursor: crosshair;
}
.sigpad__line {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 44px;
  border-bottom: 1.5px dashed #c3cad4;
  pointer-events: none;
}
.sigpad__hint {
  position: absolute;
  left: 20px;
  bottom: 16px;
  font-size: 13px;
  color: #6b7280;
  pointer-events: none;
}
.sigpad__clear {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #dde2e9;
  border-radius: 10px;
  background: #fff;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.sigpad--empty .sigpad__clear {
  display: none;
}
.sig-preview {
  display: block;
  max-width: 100%;
  height: 90px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* ---------- Zusammenfassung / Senden ---------- */

.summary .card__title {
  justify-content: space-between;
}
.summary .card__title .btn {
  margin: -8px -8px -8px 0;
}
.summary__mail {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.summary__mail .icon {
  margin-top: 2px;
  color: var(--text-3);
}
.issues li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.progress-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  font-size: 16px;
}
.progress-list .state {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-3);
}
.progress-list .is-done .state {
  background: var(--success-bg);
  color: var(--success);
}
.progress-list .is-active .state {
  background: color-mix(in srgb, var(--brand) 18%, var(--surface));
  color: var(--primary);
}
.progress-list .is-error .state {
  background: var(--danger-bg);
  color: var(--danger);
}
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.result {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 28px 8px 8px;
  text-align: center;
}
.result__icon {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
}
.result__icon .icon {
  width: 44px;
  height: 44px;
  stroke-width: 2.5;
}
.result h2 {
  margin: 8px 0 0;
  font-size: 22px;
}
.result p {
  margin: 0;
  color: var(--text-2);
}

/* ---------- Login ---------- */

.login {
  display: grid;
  gap: 20px;
  max-width: 440px;
  margin: 0 auto;
  padding-top: 24px;
}
.login__brand {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}
.login__brand .brandmark {
  width: 64px;
  height: 64px;
}
.login__brand h1 {
  margin: 8px 0 0;
  font-size: 26px;
}
.login__brand p {
  margin: 0;
  color: var(--text-2);
}
.tech-list {
  overflow: auto;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.tech-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 0 16px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  font-size: 16px;
  font-weight: 550;
  cursor: pointer;
}
.tech-option:last-child {
  border-bottom: 0;
}
.tech-option[aria-pressed='true'] {
  background: color-mix(in srgb, var(--brand) 12%, var(--surface));
}
.tech-option .avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
}
.tech-option[aria-pressed='true'] .avatar {
  background: var(--primary);
  color: var(--primary-text);
}
.tech-option .check {
  margin-left: auto;
  color: var(--primary);
  visibility: hidden;
}
.tech-option[aria-pressed='true'] .check {
  visibility: visible;
}

/* ---------- Dialog & Toast ---------- */

dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}
dialog::backdrop {
  background: rgba(10, 14, 19, 0.55);
}
.dialog__body {
  padding: 20px;
}
.dialog__body h2 {
  margin: 0 0 8px;
  font-size: 19px;
}
.dialog__body p {
  margin: 0;
  color: var(--text-2);
}
.dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 20px 20px;
}

#toasts {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--safe-bottom));
  z-index: 50;
  display: grid;
  gap: 8px;
  width: min(520px, calc(100vw - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: #1f2937;
  color: #fff;
  font-size: 15px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  pointer-events: auto;
  animation: toast-in 200ms ease;
}
.toast--error {
  background: #991b1b;
}
.toast--success .icon {
  color: #4ade80;
}
.toast .btn {
  margin-left: auto;
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

.saved-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--appbar-text-2);
  opacity: 0;
  transition: opacity 200ms ease;
}
.saved-indicator.is-visible {
  opacity: 1;
}
@media (max-width: 400px) {
  .saved-indicator__text {
    display: none;
  }
}

.muted {
  color: var(--text-3);
}
.center {
  text-align: center;
}
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.stack-8 > * + * { margin-top: 8px; }
.stack-12 > * + * { margin-top: 12px; }

/* ---------- Techniker-Info ---------- */

.ti-text {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.5;
}
.ti-text--clamped {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ti-more {
  margin: 4px -14px 0;
}
.ti-meta {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  font-size: 15px;
}
.ti-meta span {
  flex: none;
  color: var(--text-3);
}
.ti-sub {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 650;
  color: var(--text-2);
}
.ti-visit {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.ti-visit__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ti-visit .ti-text {
  margin-top: 6px;
}
.photo--btn {
  padding: 0;
  cursor: zoom-in;
}
.info-shortcut {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
}
.info-shortcut .icon {
  color: var(--primary);
}
.info-shortcut b {
  display: block;
  font-size: 15px;
}
.info-shortcut small {
  color: var(--text-3);
  font-size: 13px;
}

.sheet {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  animation: sheet-in 220ms ease;
}
.sheet__bar {
  position: static;
}
.sheet__body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px calc(24px + var(--safe-bottom));
}
.sheet__body > * {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
body.sheet-open {
  overflow: hidden;
}
@keyframes sheet-in {
  from { transform: translateY(24px); opacity: 0; }
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  background: #080b0f;
  color: #fff;
  padding: var(--safe-top) 0 var(--safe-bottom);
}
.lightbox__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px 4px 16px;
  font-size: 15px;
}
.lightbox__stage {
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 8px;
}
.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  touch-action: pan-y;
  user-select: none;
}
.lightbox__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px 12px;
}
.lightbox__caption {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: 13px;
  color: #cbd5e1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tastatur offen (Touch-Geräte): Button-Leiste weg, damit sie nicht über dem Eingabefeld hängt */
body.kb-open .actionbar {
  display: none;
}
body.kb-open .view {
  padding-bottom: 24px;
}
body.kb-open #toasts {
  bottom: 16px;
}

.sigpad__full {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid #dde2e9;
  border-radius: 10px;
  background: #fff;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.sig-full {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: calc(10px + var(--safe-top)) 12px calc(12px + var(--safe-bottom));
  background: var(--appbar);
}
.sig-full__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--appbar-text);
}
.sig-full__bar b {
  flex: 1;
  font-size: 17px;
}
.sig-full .sigpad {
  flex: 1;
  min-height: 0;
}
.sig-full .sigpad canvas {
  height: 100%;
}
.sig-full .sigpad__full {
  display: none;
}

.install {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--border));
  box-shadow: var(--shadow);
}
.install .brandmark {
  width: 36px;
  height: 36px;
}
.install__body {
  flex: 1;
  min-width: 0;
  font-size: 15px;
}
.install__body b {
  display: block;
  font-size: 16px;
}
.install__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.kbd-icon {
  display: inline-flex;
  vertical-align: -4px;
}

/* ---------- Filter: Regionen & zugewiesene Aufträge ---------- */

.filterbar {
  gap: 8px;
}
.filterbar .chip .icon {
  color: var(--text-3);
}
.filterbar .chip[aria-pressed='true'] .icon {
  color: var(--primary);
}
.banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.order-card__who {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}
.order-card__who .icon {
  width: 16px;
  height: 16px;
  color: var(--text-3);
}
.order-card__who--mine,
.order-card__who--mine .icon {
  color: var(--primary);
}
.section--mine .order-card {
  border-left: 4px solid var(--primary);
}

.list-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 8px;
  margin-top: 20px;
  padding: 12px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text-2);
  text-align: center;
}
.list-note .icon {
  color: var(--text-3);
}
.link-btn {
  min-height: 36px;
  padding: 0 8px;
  border: 0;
  background: none;
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.tech-more {
  display: block;
  width: 100%;
  margin: 6px 0 2px;
  text-align: center;
}

.sheet__foot {
  padding: 12px 16px calc(12px + var(--safe-bottom));
  background: var(--surface);
  box-shadow: var(--shadow-up);
}
.sheet__foot-inner {
  max-width: 760px;
  margin: 0 auto;
}

.plzmap-card {
  padding-bottom: 12px;
}
.plzmap {
  display: block;
  width: 100%;
  max-width: 400px;
  height: auto;
  margin: 0 auto;
  -webkit-user-select: none;
  user-select: none;
}
.plzmap__zone {
  cursor: pointer;
  outline: none;
}
.plzmap__zone path {
  fill: var(--zone-off);
  stroke: var(--zone-off);
  stroke-width: 1;
  transition: fill 160ms ease, stroke 160ms ease;
}
.plzmap__zone[aria-checked='true'] path {
  fill: var(--zone-on);
  stroke: var(--zone-on);
}
.plzmap__zone:focus-visible path {
  stroke: var(--focus);
  stroke-width: 3;
}
.plzmap__borders {
  fill: none;
  stroke: var(--surface);
  stroke-width: 2;
  stroke-linejoin: round;
  pointer-events: none;
}
.plzmap__outline {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 1.5;
  stroke-linejoin: round;
  pointer-events: none;
}
.plzmap__outline-halo {
  fill: none;
  stroke: var(--surface);
  stroke-width: 3.5;
  stroke-linejoin: round;
  pointer-events: none;
}
.plzmap__foreign {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 1.2;
  stroke-dasharray: 4 3;
  stroke-linejoin: round;
  pointer-events: none;
}
.plzmap__labels text[data-zone='AT'] {
  font-size: 22px;
}
.plzmap__cities,
.plzmap__labels {
  pointer-events: none;
}
.plzmap__cities circle {
  fill: var(--text-2);
}
.plzmap__cities text {
  font-size: 10.5px;
  font-weight: 600;
  fill: var(--text-2);
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 3px;
  stroke-linejoin: round;
}
.plzmap__labels text {
  font-size: 26px;
  font-weight: 800;
  fill: var(--text-3);
  text-anchor: middle;
  dominant-baseline: central;
}
.plzmap__labels text.is-on {
  fill: var(--text);
}
.plzmap-card__actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}
.zone-summary {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--text-2);
  text-align: center;
}

.zone-list {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.zone-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 8px 14px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.zone-row:last-child {
  border-bottom: 0;
}
.zone-row:active {
  background: var(--surface-2);
}
.zone-row__no {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--zone-off);
  font-size: 19px;
  font-weight: 800;
  color: var(--text-2);
}
.zone-row[aria-pressed='true'] .zone-row__no {
  background: var(--zone-on);
  color: var(--text);
}
.zone-row__text {
  display: grid;
  flex: 1;
  min-width: 0;
  line-height: 1.3;
}
.zone-row__text b {
  font-size: 15px;
}
.zone-row__text span {
  font-size: 13.5px;
  color: var(--text-2);
}
.zone-row__count {
  flex: none;
  min-width: 28px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-2);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.zone-row__chk {
  flex: none;
  color: var(--primary);
  visibility: hidden;
}
.zone-row[aria-pressed='true'] .zone-row__chk {
  visibility: visible;
}
.zone-note {
  margin: 12px 4px 0;
  font-size: 14px;
}

@media (min-width: 720px) {
  .view {
    padding-left: 24px;
    padding-right: 24px;
  }
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
  .sigpad canvas {
    height: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
