:root {
  color-scheme: light;
  --surface-0: #f4f3f0;
  --surface-1: #fcfcfb;
  --surface-2: #ffffff;
  --surface-sunken: #eeedea;
  --border: #dedcd6;
  --border-strong: #c6c3ba;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #85837c;
  --accent: #6d28d9;
  --accent-ink: #ffffff;
  --accent-fg: #6d28d9;
  --accent-soft: #f2ecff;
  --series-1: #6d28d9;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --series-6: #008300;
  --series-7: #2a78d6;
  --series-8: #e34948;
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --shadow: 0 1px 2px rgba(11,11,11,.06), 0 4px 16px rgba(11,11,11,.05);
  --radius: 12px;
  --sidebar-w: 250px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-0: #100e16;
  --surface-1: #191622;
  --surface-2: #221e2e;
  --surface-sunken: #14121c;
  --border: #322c42;
  --border-strong: #463e5c;
  --text-primary: #ffffff;
  --text-secondary: #c2bdd2;
  --text-muted: #8d879d;
  --accent: #7c3aed;
  --accent-ink: #ffffff;
  --accent-fg: #c4b5fd;
  --accent-soft: #241a3d;
  --series-1: #8b5cf6;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --series-6: #008300;
  --series-7: #3987e5;
  --series-8: #e66767;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--surface-0);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: .9rem; }
a { color: var(--accent-fg); }
button, input, select, textarea { font: inherit; color: inherit; }

.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.sec { color: var(--text-secondary); }

/* ---------- Auth ---------- */
.auth-wrap {
  min-height: 100dvh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), var(--surface-0));
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 16px; padding: 28px; box-shadow: var(--shadow);
}
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.auth-logo svg { width: 32px; height: 32px; }
.auth-tabs { display: flex; gap: 4px; background: var(--surface-sunken); padding: 4px; border-radius: 10px; margin-bottom: 18px; }
.auth-tabs button {
  flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 7px;
  cursor: pointer; font-weight: 550; color: var(--text-secondary);
}
.auth-tabs button.active { background: var(--surface-2); color: var(--text-primary); box-shadow: var(--shadow); }

/* ---------- App shell ---------- */
.app { display: none; min-height: 100dvh; }
.app.ready { display: block; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: var(--surface-1); border-right: 1px solid var(--border);
  padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 4px 6px 18px; }
.brand svg { width: 27px; height: 27px; flex: none; }
.brand b { font-size: .95rem; letter-spacing: -.015em; white-space: nowrap; }
.navbtn {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 0; background: transparent; padding: 9px 10px; border-radius: 9px;
  cursor: pointer; color: var(--text-secondary); font-weight: 520;
}
.navbtn:hover { background: var(--surface-sunken); color: var(--text-primary); }
.navbtn.active { background: var(--accent-soft); color: var(--accent-fg); font-weight: 600; }
.navbtn svg { width: 18px; height: 18px; flex: none; }
.nav-spacer { flex: 1; }
.side-foot { border-top: 1px solid var(--border); padding-top: 10px; font-size: .82rem; }

main { margin-left: var(--sidebar-w); padding: 24px 28px 80px; max-width: 1180px; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.topbar .grow { flex: 1; }

/* ---------- Buttons / inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  text-decoration: none; color: inherit;
  border: 1px solid var(--border-strong); background: var(--surface-2);
  padding: 8px 14px; border-radius: 9px; cursor: pointer; font-weight: 550;
  white-space: nowrap; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-sunken); }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--critical); border-color: var(--border); }
.btn.danger:hover { background: color-mix(in srgb, var(--critical) 10%, transparent); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-sunken); }
.btn.sm { padding: 5px 10px; font-size: .85rem; border-radius: 8px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-size: .82rem; font-weight: 600; color: var(--text-secondary); }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=datetime-local], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border-strong);
  border-radius: 9px; background: var(--surface-2); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; min-height: 92px; line-height: 1.55; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

.card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }

/* ---------- Filter bar ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters input, .filters select { width: auto; padding: 7px 10px; border-radius: 8px; font-size: .9rem; }
.filters .search { flex: 1; min-width: 190px; }

/* ---------- Report list ---------- */
.rlist { display: flex; flex-direction: column; gap: 10px; }
.ritem {
  background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid var(--border-strong);
  border-radius: var(--radius); padding: 13px 15px; cursor: pointer; box-shadow: var(--shadow);
  transition: transform .1s, border-color .12s;
}
.ritem:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.ritem[data-prio="kritisch"] { border-left-color: var(--critical); }
.ritem[data-prio="hoch"] { border-left-color: var(--serious); }
.ritem[data-prio="mittel"] { border-left-color: var(--warning); }
.ritem[data-prio="niedrig"] { border-left-color: var(--good); }
.ritem-head { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.ritem-head .ref { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .76rem; color: var(--text-muted); }
.ritem-title { font-weight: 620; }
.ritem-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: .82rem; color: var(--text-muted); margin-top: 5px; }
.ritem-excerpt { font-size: .88rem; color: var(--text-secondary); margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 620;
  padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface-sunken); color: var(--text-secondary); white-space: nowrap;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.p-kritisch { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 45%, transparent); background: color-mix(in srgb, var(--critical) 10%, transparent); }
.chip.p-hoch { color: var(--serious); border-color: color-mix(in srgb, var(--serious) 45%, transparent); background: color-mix(in srgb, var(--serious) 10%, transparent); }
.chip.p-mittel { color: #8a6100; border-color: color-mix(in srgb, var(--warning) 55%, transparent); background: color-mix(in srgb, var(--warning) 14%, transparent); }
:root[data-theme="dark"] .chip.p-mittel { color: var(--warning); }
.chip.p-niedrig { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); background: color-mix(in srgb, var(--good) 10%, transparent); }
.chip.s-erledigt { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.chip.s-offen { color: var(--accent-fg); border-color: color-mix(in srgb, var(--accent-fg) 45%, transparent); }

.empty { text-align: center; padding: 56px 20px; color: var(--text-muted); }
.empty svg { width: 44px; height: 44px; opacity: .4; margin-bottom: 10px; }

/* ---------- Dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow); }
.kpi .label { font-size: .78rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 2rem; font-weight: 680; letter-spacing: -.02em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.kpi .value.warn { color: var(--critical); }
.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.chart-card h3 { margin-bottom: 14px; }
.bar-row { display: grid; grid-template-columns: 116px 1fr 34px; align-items: center; gap: 10px; margin-bottom: 9px; font-size: .85rem; }
.bar-row .track { display: block; background: var(--surface-sunken); border-radius: 4px; height: 14px; overflow: hidden; }
.bar-row .fill { display: block; height: 14px; border-radius: 4px; transition: width .4s ease; min-width: 3px; }
.bar-row .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-secondary); font-weight: 600; }
.spark { width: 100%; height: auto; display: block; }
.ic { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Detail / Modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(11,11,11,.45); backdrop-filter: blur(3px); z-index: 50; display: grid; place-items: center; padding: 20px; }
.sheet {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 16px;
  width: 100%; max-width: 780px; max-height: 92dvh; overflow: auto; box-shadow: 0 24px 60px rgba(0,0,0,.3);
}
.sheet-head { position: sticky; top: 0; background: var(--surface-1); border-bottom: 1px solid var(--border); padding: 16px 20px; display: flex; align-items: center; gap: 10px; z-index: 2; }
.sheet-body { padding: 20px; }
.sheet-foot { position: sticky; bottom: 0; background: var(--surface-1); border-top: 1px solid var(--border); padding: 13px 20px; display: flex; gap: 8px; justify-content: flex-end; }

.dl { display: grid; grid-template-columns: 152px 1fr; gap: 9px 16px; font-size: .93rem; }
.dl dt { color: var(--text-muted); font-weight: 600; font-size: .84rem; }
.dl dd { margin: 0; }
.prose { white-space: pre-wrap; line-height: 1.6; }
.block { margin-top: 18px; }
.block h3 { color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-size: .76rem; margin-bottom: 6px; }

.thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.thumb { position: relative; width: 104px; }
.thumb img, .thumb .pdf {
  width: 104px; height: 104px; object-fit: cover; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface-sunken); display: grid; place-items: center;
}
.thumb .del {
  position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; line-height: 1; padding: 0;
}
.thumb .cap { font-size: .7rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--text-primary); color: var(--surface-1); padding: 10px 18px;
  border-radius: 10px; z-index: 100; box-shadow: var(--shadow); font-size: .9rem; font-weight: 550;
}
.toast.err { background: var(--critical); color: #fff; }
.err-msg { color: var(--critical); font-size: .87rem; margin-bottom: 10px; }

.switch-row { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch-row input { width: 44px; height: 25px; appearance: none; background: var(--border-strong); border-radius: 999px; position: relative; cursor: pointer; transition: background .18s; flex: none; }
.switch-row input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch-row input:checked { background: var(--good); }
.switch-row input:checked::after { transform: translateX(19px); }

.tpl-list { display: flex; flex-direction: column; gap: 8px; }
.tpl-item { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }

.fab { display: none; }

/* ---------- Mobile ---------- */
@media screen and (max-width: 860px) {
  body { font-size: 16px; }
  .sidebar {
    inset: auto 0 0 0; width: auto; height: 62px; flex-direction: row; border-right: 0;
    border-top: 1px solid var(--border); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    justify-content: space-around; align-items: center;
  }
  .brand, .nav-spacer, .side-foot { display: none; }
  .navbtn {
    flex-direction: column; gap: 3px; font-size: .66rem; padding: 6px 2px;
    justify-content: center; align-items: center; text-align: center; font-weight: 600;
    min-width: 0; flex: 1;
  }
  .navbtn span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  /* Kurzbezeichnung auf dem Handy */
  .navbtn[data-short] span { font-size: 0; }
  .navbtn[data-short] span::after { content: attr(data-label); font-size: .66rem; }
  /* "Neu" liegt auf dem Handy auf dem runden Knopf unten rechts */
  .navbtn[data-view="new"] { display: none; }
  .navbtn svg { width: 21px; height: 21px; }
  .navbtn.active { background: transparent; }
  main { margin-left: 0; padding: 16px 14px calc(86px + env(safe-area-inset-bottom)); }
  .row, .row-3, .charts { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dd { margin-bottom: 9px; }
  .sheet { max-width: none; max-height: 100dvh; height: 100dvh; border-radius: 0; border: 0; }
  .overlay { padding: 0; }
  .sheet-foot { padding-bottom: calc(13px + env(safe-area-inset-bottom)); }
  .fab {
    display: grid; place-items: center; position: fixed; right: 16px;
    bottom: calc(76px + env(safe-area-inset-bottom)); width: 56px; height: 56px; border-radius: 50%;
    background: var(--accent); color: #fff; border: 0; box-shadow: 0 6px 20px rgba(109,40,217,.45);
    z-index: 25; cursor: pointer;
  }
  .fab svg { width: 26px; height: 26px; }
  .topbar h1 { font-size: 1.2rem; }
  .kpis { grid-template-columns: 1fr 1fr; }
}

/* ---------- Druck / PDF ---------- */
@media print {
  .sidebar, .topbar, .filters, .fab, .sheet-head .btn, .sheet-foot, .thumb .del, .no-print { display: none !important; }
  /* Ist ein Rapport geöffnet, wird NUR dieser gedruckt – nicht die Liste dahinter. */
  body.modal-open .app { display: none !important; }
  html, body { height: auto !important; overflow: visible !important; background: #fff; }
  body { font-size: 10.5pt; }
  main { margin: 0; padding: 0; max-width: none; }
  .overlay { position: static; background: none; padding: 0; backdrop-filter: none; display: block; }
  .sheet { max-width: none; max-height: none; height: auto; box-shadow: none; border: 0; overflow: visible; background: #fff; }
  .sheet-head { position: static; border-bottom: 2px solid #000; padding: 0 0 8px; background: none; }
  .sheet-body { padding: 12px 0 0; }
  .dl { gap: 6px 16px; }
  .block { margin-top: 12px; }
  .card, .ritem, .chart-card, .kpi { box-shadow: none; border: 1px solid #bbb; break-inside: avoid; }
  .ritem { page-break-inside: avoid; }
  .thumb img { width: 150px; height: auto; }
  .print-head { display: block !important; border-bottom: 2px solid #000; margin-bottom: 14px; padding-bottom: 8px; }
  a[href]:after { content: ""; }
  @page { margin: 14mm; }
}
.print-head { display: none; }

/* ---------- Nachträge / Verlauf ---------- */
.ritem-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--border); }
.disclose {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent;
  color: var(--text-secondary); font-size: .82rem; font-weight: 600; cursor: pointer;
  padding: 3px 7px; border-radius: 7px;
}
.disclose:hover { background: var(--surface-sunken); color: var(--text-primary); }
.disclose .caret { transition: transform .18s; display: inline-block; }
.disclose[aria-expanded="true"] .caret { transform: rotate(90deg); }
.quick { display: flex; gap: 5px; margin-left: auto; flex-wrap: wrap; }

.entries { margin: 10px 0 0 14px; padding-left: 14px; border-left: 2px solid var(--border); display: none; }
.entries.open { display: block; }
.entry { padding: 7px 0; font-size: .85rem; }
.entry + .entry { border-top: 1px solid var(--border); }
.entry-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.entry-kind { font-weight: 650; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--accent-fg); }
.entry-time { color: var(--text-muted); font-size: .76rem; }
.entry-text { color: var(--text-secondary); white-space: pre-wrap; margin-top: 2px; }
.entry-status { font-size: .76rem; color: var(--text-muted); }
.entry-del { border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: .8rem; padding: 0 4px; margin-left: auto; }
.entry-del:hover { color: var(--critical); }
.entry-add { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.entry-add input { flex: 1; min-width: 180px; padding: 6px 10px; font-size: .87rem; }
.entry-add select { width: auto; padding: 6px 8px; font-size: .87rem; }

/* ---------- Dienste ---------- */
.shift-day { margin-bottom: 18px; }
.shift-day h3 { color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-size: .76rem; margin-bottom: 7px; }
.shift {
  display: flex; align-items: center; gap: 12px; background: var(--surface-2);
  border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 10px; padding: 11px 14px; margin-bottom: 7px; box-shadow: var(--shadow);
}
.shift-time { font-variant-numeric: tabular-nums; font-weight: 650; min-width: 116px; font-size: .9rem; }
.shift-body { flex: 1; min-width: 0; }
.shift-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shift-meta { font-size: .8rem; color: var(--text-muted); }
.shift.now { border-left-width: 6px; background: var(--accent-soft); }
.shift-badge { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent-fg); }

.cal-item { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); margin-bottom: 8px; }
.cal-swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.steps { padding-left: 18px; line-height: 1.75; font-size: .89rem; }
.steps code { background: var(--surface-sunken); padding: 1px 5px; border-radius: 4px; font-size: .85em; }

@media print {
  .ritem-foot, .disclose, .quick, .entry-add, .entry-del { display: none !important; }
  .entries { display: block !important; }
}

@media screen and (max-width: 860px) {
  .entry-add { flex-direction: column; align-items: stretch; }
  .entry-add select, .entry-add input, .entry-add .btn { width: 100%; }
  .entries.open { padding-bottom: 6px; }
  .filters input[type=date] { flex: 1; min-width: 0; }
  .quick { width: 100%; margin-left: 0; }
  .quick .btn { flex: 1; }
  .ritem-foot { gap: 8px; }
}

@media screen and (max-width: 860px) {
  .shift { flex-wrap: wrap; row-gap: 4px; padding: 12px 14px; }
  .shift-time { order: 1; width: auto; min-width: 0; font-size: .88rem; }
  .shift-badge { order: 2; margin-left: auto; }
  .shift-body { order: 4; flex-basis: 100%; min-width: 100%; }
  .shift-title { white-space: normal; }
  .shift .btn { order: 5; margin-left: auto; }
}

/* Live-Anzeige */
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--good); margin-right: 7px; vertical-align: 1px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent);
  transition: background .2s, box-shadow .2s;
}
.live-dot.off { background: var(--text-muted); box-shadow: none; }

/* ================= Homepage ================= */
.landing { min-height: 100dvh; background: var(--surface-0); }
.landing.hidden { display: none !important; }

.lp-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px clamp(16px, 5vw, 56px); max-width: 1200px; margin: 0 auto;
}
.lp-brand { display: flex; align-items: center; gap: 10px; }
.lp-brand svg { width: 34px; height: 34px; }
.lp-brand b { font-size: 1.05rem; letter-spacing: -.015em; }

.lp-hero {
  max-width: 1200px; margin: 0 auto; padding: clamp(24px, 6vw, 72px) clamp(16px, 5vw, 56px) 40px;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(24px, 5vw, 64px); align-items: center;
}
.lp-hero h1 {
  font-size: clamp(2rem, 5.2vw, 3.4rem); line-height: 1.08; letter-spacing: -.03em;
  margin-bottom: 18px; font-weight: 700;
}
.lp-lead { font-size: clamp(1rem, 1.6vw, 1.12rem); color: var(--text-secondary); max-width: 46ch; line-height: 1.6; }
.lp-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.lp-cta { padding: 13px 22px; font-size: 1rem; border-radius: 11px; }
.lp-cta svg { width: 19px; height: 19px; }
.lp-cta small { display: block; font-size: .75rem; opacity: .8; font-weight: 500; }
.lp-note { font-size: .84rem; margin-top: 14px; max-width: 46ch; }

/* Handy-Mockup */
.lp-shot { display: grid; place-items: center; }
.lp-phone {
  width: min(290px, 80vw); border-radius: 34px; padding: 12px;
  background: linear-gradient(160deg, #2a2340, #14111d);
  box-shadow: 0 24px 60px rgba(60, 20, 130, .28), 0 2px 8px rgba(0,0,0,.2);
  border: 1px solid #3b3355;
}
.lp-phone-inner {
  background: var(--surface-2); border-radius: 24px; padding: 18px 16px; min-height: 380px;
  border: 1px solid var(--border);
}
.lp-row { display: flex; gap: 6px; margin-bottom: 9px; }
.lp-chip {
  font-size: .68rem; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--border-strong); color: var(--text-secondary);
}
.lp-chip.crit { color: var(--critical); border-color: color-mix(in srgb, var(--critical) 45%, transparent); background: color-mix(in srgb, var(--critical) 10%, transparent); }
.lp-title { font-weight: 680; font-size: 1rem; letter-spacing: -.01em; }
.lp-meta { font-size: .76rem; color: var(--text-muted); margin-top: 3px; }
.lp-line { height: 1px; background: var(--border); margin: 13px 0; }
.lp-sub { font-size: .8rem; font-weight: 650; color: var(--accent-fg); }
.lp-entry {
  font-size: .72rem; color: var(--text-secondary); margin: 9px 0 0 10px;
  padding-left: 10px; border-left: 2px solid var(--border); line-height: 1.5;
}
.lp-entry b { color: var(--accent-fg); font-size: .64rem; letter-spacing: .05em; }
.lp-shift {
  font-size: .78rem; background: var(--accent-soft); color: var(--text-primary);
  border-left: 3px solid var(--accent); border-radius: 8px; padding: 9px 11px;
}

.lp-features {
  max-width: 1200px; margin: 0 auto; padding: 20px clamp(16px, 5vw, 56px) 40px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px;
}
.lp-feat {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
.lp-feat h3 { font-size: .98rem; margin-bottom: 7px; }
.lp-feat p { font-size: .89rem; color: var(--text-secondary); margin: 0; line-height: 1.55; }

.lp-install { max-width: 1200px; margin: 0 auto; padding: 8px clamp(16px, 5vw, 56px) 48px; }
.lp-install h2 { font-size: 1.3rem; margin-bottom: 18px; }
.lp-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.lp-steps b { display: block; margin-bottom: 5px; }
.lp-steps p { font-size: .89rem; color: var(--text-secondary); margin: 0; line-height: 1.55; }

.lp-foot {
  border-top: 1px solid var(--border); padding: 22px clamp(16px, 5vw, 56px);
  font-size: .84rem; color: var(--text-muted); max-width: 1200px; margin: 0 auto;
}

@media (max-width: 820px) {
  .lp-hero { grid-template-columns: 1fr; padding-top: 18px; }
  .lp-shot { order: -1; }
  .lp-phone { width: min(250px, 70vw); }
  .lp-actions .btn { flex: 1; justify-content: center; }
}

/* ---------- Anmeldung / Zwei-Faktor ---------- */
.tfa-icon { display: grid; place-items: center; margin: 4px 0 12px; color: var(--accent-fg); }
.tfa-icon svg { width: 42px; height: 42px; }
.tfa-lead { text-align: center; color: var(--text-secondary); font-size: .9rem; margin: 0 0 16px; }
.tfa-input {
  font-size: 1.5rem; letter-spacing: .35em; text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 600;
}

/* ---------- Sicherheit ---------- */
.sec-block { padding: 16px 0; border-top: 1px solid var(--border); }
.sec-block:first-of-type { border-top: 0; padding-top: 8px; }
.sec-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.sec-row > div:first-child { flex: 1; min-width: 200px; }

.badge-on, .badge-off {
  display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 700;
  padding: 2px 9px; border-radius: 999px;
}
.badge-on { color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); }
.badge-off { color: var(--text-muted); background: var(--surface-sunken); }

.codes-warn {
  background: color-mix(in srgb, var(--warning) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--warning) 45%, transparent);
  border-radius: 10px; padding: 12px 14px; font-size: .87rem; line-height: 1.55;
}
.codes-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-top: 12px;
}
.codes-grid span {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1rem; font-weight: 600;
  background: var(--surface-sunken); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 10px; text-align: center; letter-spacing: .04em;
}

.act-row {
  display: grid; grid-template-columns: 20px 160px 1fr auto; gap: 10px; align-items: center;
  font-size: .84rem; padding: 6px 0; border-bottom: 1px solid var(--border);
}
.act-row:last-child { border-bottom: 0; }
.act-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.act-dot.bad { background: var(--critical); }

.user-item {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 9px; box-shadow: var(--shadow);
}
.user-item.off { opacity: .55; }
.user-main { flex: 1; min-width: 190px; }
.user-name { font-weight: 650; }
.user-meta { font-size: .82rem; color: var(--text-muted); }
.pw-result {
  background: var(--surface-sunken); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 12px 14px; font-size: .88rem;
}
.pw-result code {
  font-size: 1.05rem; font-weight: 700; letter-spacing: .04em;
  background: var(--surface-2); padding: 3px 8px; border-radius: 6px; user-select: all;
}

@media print {
  body.printing-codes .app > *:not(main),
  body.printing-codes main > section:not(#view-settings),
  body.printing-codes #view-settings > *:not(#cardSecurity),
  body.printing-codes #cardSecurity > *:not(#tfaCodes),
  body.printing-codes #tfaCodes button { display: none !important; }
}
