/* CompuMac Serviceportal — dieselbe Sprache wie die Website (cm-hig): Systemschrift wie SF Pro, Karten auf #f5f5f7,
   Glas nur in Kopfzeile und Tab-Leiste, eine farbige Hauptaktion je Ansicht, Dunkelmodus, „Bewegung reduzieren“.
   Mobil zuerst: die meisten kommen vom Handy aus der Status-Mail. */

:root {
  --label: #1d1d1f;
  --label-2: #6e6e73;
  --label-3: #86868b;
  --bg: #f5f5f7;
  --card: #ffffff;
  --fill: rgba(118, 118, 128, 0.12);
  --separator: rgba(60, 60, 67, 0.14);
  --blue: #0071e3;
  --blue-press: #0062c4;
  --green: #1f8f3a;
  --orange: #b25000;
  --red: #c4281c;
  --glass: rgba(255, 255, 255, 0.72);
  --blur: saturate(190%) blur(22px);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 28px -12px rgba(15, 23, 42, 0.14);
  --radius: 18px;
  --radius-s: 12px;
  --spring: cubic-bezier(0.2, 0.9, 0.25, 1.05);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --label: #f5f5f7;
    --label-2: #a1a1a6;
    --label-3: #8e8e93;
    --bg: #000000;
    --card: #1c1c1e;
    --fill: rgba(118, 118, 128, 0.24);
    --separator: rgba(84, 84, 88, 0.6);
    --blue: #2997ff;
    --blue-press: #0a84ff;
    --green: #30d158;
    --orange: #ff9f0a;
    --red: #ff453a;
    --glass: rgba(28, 28, 30, 0.72);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
body { margin: 0; background: var(--bg); color: var(--label); font: 17px/1.47 var(--font); letter-spacing: -0.022em; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0 0 0.4em; }
h1 { font-size: 32px; line-height: 1.12; letter-spacing: -0.03em; font-weight: 700; }
h1.display { font-size: 40px; }
h2 { font-size: 21px; letter-spacing: -0.02em; font-weight: 650; }
p { margin: 0 0 0.8em; text-wrap: pretty; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }

/* Kopfzeile: Glas */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: inset 0 -0.5px 0 var(--separator); padding-top: env(safe-area-inset-top); }
.topbar-inner { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; }
.wordmark { display: inline-flex; align-items: baseline; gap: 8px; color: var(--label); text-decoration: none !important; }
.wordmark-name { font: 700 21px/1 var(--font-display); letter-spacing: -0.03em; }
.wordmark-sub { font-size: 15px; color: var(--label-2); font-weight: 500; }
.top-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who { color: var(--label-2); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }

/* Tab-Leiste: unten auf dem Handy, oben auf dem Rechner */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-around; background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: inset 0 0.5px 0 var(--separator); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tabbar[hidden] { display: none; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--label-3); padding: 4px 0; text-decoration: none !important; }
.tab.is-active { color: var(--blue); }
.tab-icon { width: 24px; height: 24px; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; background: currentColor; }
.tab-icon--house { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 2.5 11h2.7v9.5h5.3v-6h3v6h5.3V11h2.7z'/%3E%3C/svg%3E"); }
.tab-icon--plus { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm1 15h-2v-4H7v-2h4V7h2v4h4v2h-4z'/%3E%3C/svg%3E"); }
.tab-icon--bubble { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3C6.5 3 2 6.6 2 11c0 2.4 1.3 4.6 3.4 6.1L4.5 21l4.4-2.3c1 .2 2 .3 3.1.3 5.5 0 10-3.6 10-8s-4.5-8-10-8z'/%3E%3C/svg%3E"); }
.tab-icon--person { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4.5'/%3E%3Cpath d='M3 21c0-4.4 4-7 9-7s9 2.6 9 7z'/%3E%3C/svg%3E"); }
.tab-icon--box { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2 3 6.5v11L12 22l9-4.5v-11zm0 2.2 6.5 3.2L12 10.6 5.5 7.4zM5 9l6 3v7.6l-6-3z'/%3E%3C/svg%3E"); }

.main { flex: 1; width: 100%; outline: none; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.page { max-width: 1120px; margin: 0 auto; padding: 24px 16px 32px; animation: rise 0.42s var(--spring); }
.page--narrow { max-width: 640px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.eyebrow { color: var(--label-2); font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.lead { font-size: 19px; color: var(--label-2); max-width: 38em; }
.muted { color: var(--label-2); }
.small { font-size: 14px; }
.footer { color: var(--label-3); font-size: 12px; text-align: center; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
.footer a { color: var(--label-2); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Karten */
.card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card--quiet { background: transparent; box-shadow: none; border: 1px solid var(--separator); }
.card--action { border: 2px solid var(--blue); }
.card--success { text-align: center; }
.card--confirm { border: 2px solid var(--orange); }
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2--tight { gap: 0 12px; grid-template-columns: 1fr 1fr; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.row--between { justify-content: space-between; }
.row--stack { flex-direction: column; align-items: stretch; }
.toolbar { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }

/* Knöpfe: eine farbige Hauptaktion je Ansicht */
.btn { -webkit-appearance: none; appearance: none; border: 0; border-radius: 980px; padding: 12px 22px; font: 600 17px/1.2 var(--font); letter-spacing: -0.02em; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none !important; transition: transform 0.18s var(--spring), background 0.2s; min-height: 44px; }
.btn:active { transform: scale(0.97); }
.btn--primary { background: var(--blue); color: #fff; }
.btn--primary:hover { background: var(--blue-press); }
.btn--secondary { background: var(--fill); color: var(--blue); }
.btn--plain { background: transparent; color: var(--blue); padding-left: 8px; padding-right: 8px; }
.btn--small { padding: 8px 14px; font-size: 15px; min-height: 36px; }
.btn--wide { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.5); border-top-color: #fff; animation: spin 0.8s linear infinite; }
.btn--secondary.is-busy::after, .btn--plain.is-busy::after { border-color: var(--fill); border-top-color: var(--blue); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Felder */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field--inline { margin-bottom: 0; }
.field--grow { flex: 1; min-width: 200px; }
.field-label { font-size: 14px; font-weight: 600; color: var(--label-2); }
.field-hint { font-size: 13px; color: var(--label-3); }
.field-error { font-size: 14px; color: var(--red); }
input, select, textarea { font: 17px/1.35 var(--font); color: var(--label); background: var(--card); border: 1px solid var(--separator); border-radius: var(--radius-s); padding: 12px 14px; width: 100%; min-height: 44px; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 25%, transparent); }
.is-invalid input, .is-invalid select, .is-invalid textarea { border-color: var(--red); }
.code-input { font-size: 28px; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; min-height: 0; accent-color: var(--blue); flex: none; margin: 0; }
.choice { border: 0; padding: 0; margin: 0 0 14px; }
.choice legend { font-weight: 600; margin-bottom: 8px; }
.choice-item { display: flex; gap: 10px; align-items: center; padding: 8px 0; }
.choice-item--card { align-items: flex-start; padding: 14px; border: 1px solid var(--separator); border-radius: var(--radius-s); margin-bottom: 8px; }
.choice-item--card > span { display: flex; flex-direction: column; gap: 2px; }
.consent { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; }
.question { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--separator); }
.question > span { flex-basis: 100%; font-weight: 500; }

/* Hinweise */
.notice { background: var(--fill); border-radius: var(--radius-s); padding: 12px 14px; }
.notice--error { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--label); border-left: 4px solid var(--red); }
.notice--ok { background: color-mix(in srgb, var(--green) 14%, transparent); border-left: 4px solid var(--green); }
.pill { display: inline-block; border-radius: 980px; padding: 4px 12px; font-size: 14px; font-weight: 600; }
.pill--blue { background: color-mix(in srgb, var(--blue) 14%, transparent); color: var(--blue); }
.pill--orange { background: color-mix(in srgb, var(--orange) 16%, transparent); color: var(--orange); }
.pill--gray { background: var(--fill); color: var(--label-2); }
.status-line { margin-bottom: 16px; }

/* Auftragskarten */
.group { margin-bottom: 24px; }
.group-title { font-size: 17px; color: var(--label-2); font-weight: 600; margin: 0 0 8px; cursor: default; }
details.group > summary { cursor: pointer; list-style: none; }
.count { display: inline-block; min-width: 22px; text-align: center; border-radius: 11px; background: var(--fill); font-size: 13px; padding: 1px 7px; margin-left: 4px; }
.group--action .group-title { color: var(--orange); }
.order-list { display: grid; gap: 10px; grid-template-columns: 1fr; }
.order-card { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; background: var(--card); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); color: var(--label); text-decoration: none !important; transition: transform 0.2s var(--spring); }
.order-card:hover { transform: translateY(-1px); }
.order-card.is-action { box-shadow: inset 0 0 0 2px var(--orange), var(--shadow); }
.order-thumb img, .device-glyph { width: 56px; height: 56px; border-radius: 12px; object-fit: contain; background: var(--bg); display: block; }
.device-glyph { background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2386868b'%3E%3Cpath d='M7 2h10a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm0 3v13h10V5z'/%3E%3C/svg%3E") center / 26px no-repeat; }
.order-body { display: flex; flex-direction: column; min-width: 0; }
.order-device { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.order-status { color: var(--label); font-size: 15px; }
.order-meta { color: var(--label-3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps { display: inline-flex; gap: 4px; }
.steps-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fill); }
.steps-dot.is-done { background: var(--green); }
.steps-dot.is-current { background: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 25%, transparent); }

/* Zeitstrahl */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.tl-step { display: flex; gap: 14px; position: relative; padding: 0 0 22px; }
.tl-step:last-child { padding-bottom: 0; }
.tl-step::before { content: ""; position: absolute; left: 10px; top: 24px; bottom: 0; width: 2px; background: var(--fill); }
.tl-step:last-child::before { display: none; }
.tl-done::before { background: var(--green); }
.tl-dot { width: 22px; height: 22px; border-radius: 50%; flex: none; background: var(--card); border: 2px solid var(--fill); margin-top: 1px; position: relative; z-index: 1; }
.tl-done .tl-dot { background: var(--green); border-color: var(--green); }
.tl-done .tl-dot::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.tl-current .tl-dot { border-color: var(--blue); background: var(--blue); box-shadow: 0 0 0 5px color-mix(in srgb, var(--blue) 22%, transparent); animation: pulse 2.4s ease-in-out infinite; }
.tl-skipped .tl-label { text-decoration: line-through; color: var(--label-3); }
.tl-todo .tl-label { color: var(--label-3); }
.tl-text { display: flex; flex-direction: column; }
.tl-label { font-weight: 600; }
.tl-current .tl-label { color: var(--blue); }
.tl-when { font-size: 13px; color: var(--label-3); }
@keyframes pulse { 50% { box-shadow: 0 0 0 9px color-mix(in srgb, var(--blue) 8%, transparent); } }

/* Fakten, Listen */
.facts { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 8px 16px; margin: 0; }
.facts dt { color: var(--label-2); font-size: 15px; }
.facts dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.link-list { display: flex; flex-direction: column; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 16px; }
.link-list a { padding: 14px 18px; border-bottom: 1px solid var(--separator); color: var(--label); display: flex; justify-content: space-between; text-decoration: none; }
.link-list a::after { content: "›"; color: var(--label-3); font-size: 20px; line-height: 1; }
.link-list a:last-child { border-bottom: 0; }
.doc-list { list-style: none; margin: 0 0 16px; padding: 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.doc-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--separator); }
.doc-list li:last-child { border-bottom: 0; }
.doc-list li > span { display: flex; flex-direction: column; min-width: 0; }

/* Kostenvoranschlag */
.options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.option { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--separator); border-radius: var(--radius-s); }
.option-text { flex: 1; display: flex; flex-direction: column; }
.option-price { font-weight: 700; font-variant-numeric: tabular-nums; }

/* Nachrichten */
.thread { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 18px; display: flex; flex-direction: column; gap: 2px; }
.bubble--them { background: var(--card); box-shadow: var(--shadow); align-self: flex-start; border-bottom-left-radius: 6px; }
.bubble--me { background: var(--blue); color: #fff; align-self: flex-end; border-bottom-right-radius: 6px; }
.bubble-from { font-size: 12px; opacity: 0.75; }
.bubble-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble-state { font-size: 12px; opacity: 0.85; }
.bubble-state.is-failed { font-weight: 700; }

/* Schritte des Formulars */
.stepper { list-style: none; padding: 0; margin: 0 0 16px; display: flex; gap: 6px; counter-reset: s; }
.stepper li { flex: 1; font-size: 12px; color: var(--label-3); text-align: center; padding-top: 10px; border-top: 4px solid var(--fill); border-radius: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stepper li.is-done { border-color: var(--green); color: var(--label-2); }
.stepper li.is-current { border-color: var(--blue); color: var(--blue); font-weight: 600; }
.big-number { font: 700 28px/1.2 var(--font-display); letter-spacing: -0.02em; margin: 12px 0; }
.sign-pad { width: 100%; height: auto; aspect-ratio: 600 / 220; background: var(--card); border: 1px dashed var(--label-3); border-radius: var(--radius-s); touch-action: none; display: block; margin-bottom: 4px; }

/* Druck */
.print-sheet { background: #fff; color: #000; border-radius: 12px; padding: 24px; margin: 16px 0; box-shadow: var(--shadow); }
.print-label { max-width: 380px; text-align: center; }
.pl-brand { font: 700 18px/1 var(--font-display); letter-spacing: -0.03em; }
.pl-brand span { font-weight: 500; color: #555; font-size: 13px; margin-left: 6px; }
.pl-number { font: 800 34px/1.1 var(--font-display); margin: 10px 0 6px; letter-spacing: 0.02em; }
.pl-device { font-weight: 600; margin-top: 6px; }
.pl-meta { font-size: 13px; color: #444; }
.barcode { max-width: 100%; height: auto; }
.ps-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid #000; margin-bottom: 12px; padding-bottom: 6px; }
.ps-head h1 { font-size: 22px; margin: 0; }
.ps-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin-bottom: 12px; }
.ps-grid span { display: block; font-size: 12px; color: #555; }
.print-slip h2 { font-size: 15px; margin-top: 14px; }
.ps-terms { list-style: none; padding: 0; font-size: 14px; }
.ps-terms li { margin: 4px 0; }
.ps-sign { display: flex; gap: 24px; margin-top: 36px; }
.ps-sign > div { flex: 1; border-top: 1px solid #000; padding-top: 4px; font-size: 12px; }
.ps-note { font-size: 12px; color: #444; margin-top: 18px; }
.ps-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ps-table th, .ps-table td { text-align: left; border-bottom: 1px solid #ccc; padding: 6px 4px; }

/* Versand einer Einsendung (05.10.2026): zwei Wege nebeneinander, auf dem Telefon untereinander. */
.ship-options { display: grid; gap: 12px; grid-template-columns: 1fr; margin: 12px 0; }
.ship-option { border: 1px solid var(--separator); border-radius: var(--radius-s); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.ship-option h3 { margin: 0; font-size: 17px; }
.ship-option p { margin: 0; }
.ship-address { white-space: pre-line; }
.ship-tips { margin: 8px 0 0; padding-left: 20px; }
.ship-tips li { margin: 4px 0; }
.label-list { list-style: none; padding: 0; margin: 8px 0 12px; }
.label-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--separator); }
.label-list li > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

@media (min-width: 760px) {
  .ship-options { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-2--wide-left { grid-template-columns: 1.2fr 1fr; }
  .order-list { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 960px) {
  .main { padding-bottom: 32px; }
  .footer { padding-bottom: 24px; }
  .tabbar { position: sticky; top: 52px; bottom: auto; justify-content: center; gap: 8px; padding: 6px; box-shadow: inset 0 -0.5px 0 var(--separator); }
  .tab { flex: 0 0 auto; flex-direction: row; gap: 6px; font-size: 15px; padding: 6px 14px; border-radius: 980px; }
  .tab.is-active { background: var(--fill); }
  .tab-icon { width: 18px; height: 18px; }
  h1 { font-size: 40px; }
  h1.display { font-size: 56px; }
}

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

@media print {
  body { background: #fff; }
  .topbar, .tabbar, .footer, .no-print, .skip { display: none !important; }
  .main { padding: 0; }
  .page { padding: 0; animation: none; }
  .print-sheet { box-shadow: none; margin: 0; padding: 0; border-radius: 0; }
}
