:root {
  --bg: #ffffff; --ink: #18181b; --ink-2: #52525b; --ink-3: #a1a1aa;
  --line: #ececee; --tint: #f6f6f7; --accent: #1c1917;
  --ok: #16a34a; --warn: #d97706; --bad: #dc2626; --info: #2563eb; --violet: #7c3aed;
  --r: 16px; --pad: 16px;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 500 18px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button, input, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }
a { color: var(--ink); }

.screen { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); }

/* Top */
.top { padding: calc(var(--safe-top) + 10px) var(--pad) 10px; background: var(--bg); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.top-row { display: flex; align-items: center; justify-content: space-between; }
.top-title { font-size: 24px; letter-spacing: -0.02em; }
.top-sub { color: var(--ink-3); font-size: 15px; margin-left: 8px; }
.top-detail { flex-direction: row; align-items: center; justify-content: space-between; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--tint); font-size: 20px; display: grid; place-items: center; }
.back { font-size: 18px; padding: 8px 4px; min-height: 44px; color: var(--ink-2); }
.seg { display: flex; background: var(--tint); border-radius: 14px; padding: 4px; gap: 4px; }
.seg-b { flex: 1; height: 44px; border-radius: 11px; font-size: 17px; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg-b.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.seg-b b { font-weight: 500; color: var(--ink-3); font-size: 15px; }
.seg-b.on b { color: var(--ink-2); }
.fcard { flex: none; width: 100%; text-align: left; border-radius: var(--r); background: var(--tint); padding: 16px 18px; }
.fcard.overdue { border: 1.5px solid var(--warn); background: #fff; }
.fcard .name { font-size: 20px; line-height: 1.25; }
.fcard .owner { font-size: 18px; color: var(--ink-2); margin-top: 3px; }
.fcard .meta { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; font-size: 15px; color: var(--ink-3); }
.fcard .meta .warn { color: var(--warn); }
.fcard .frow { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 12px; }
.fcard .fbtn { height: 52px; border-radius: 12px; background: #fff; border: 1px solid var(--line); font-size: 15px; }
.fcard .fbtn.ok { color: var(--ok); } .fcard .fbtn.bad { color: var(--bad); }
.fcard .open { display: block; width: 100%; text-align: left; }
.search { width: 100%; height: 46px; border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; background: var(--tint); outline: none; -webkit-appearance: none; }
.chips { display: flex; gap: 8px; padding-bottom: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad); }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 42px; padding: 0 15px; border-radius: 21px; background: var(--tint); color: var(--ink-2); font-size: 16px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--ink); color: #fff; }
.chip b { font-weight: 500; opacity: .7; }
.filter-row { display: flex; align-items: center; justify-content: space-between; }
.filter-btn { height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); font-size: 15px; color: var(--ink-2); }
.filter-btn span { color: var(--ink); }
.sync { font-size: 13px; color: var(--ink-3); }
.sync.bad { color: var(--bad); }
.sync.pending { color: var(--warn); }

/* Cards */
.cards { flex: 1; overflow-y: auto; padding: 12px var(--pad) calc(var(--safe-bottom) + 24px); display: flex; flex-direction: column; gap: 10px; -webkit-overflow-scrolling: touch; }
.card { display: block; flex: none; width: 100%; text-align: left; min-height: 96px; padding: 16px 18px; border-radius: var(--r); background: var(--tint); border: 1.5px solid transparent; position: relative; }
.card:active { transform: scale(.985); }
.card.next { border-color: var(--ink); background: #fff; }
.card.next::before { content: 'Nächster Anruf'; display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.card .name { font-size: 20px; letter-spacing: -0.01em; line-height: 1.25; }
.card .owner { font-size: 18px; color: var(--ink-2); margin-top: 3px; }
.card .meta { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 15px; color: var(--ink-3); }
.stag { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 14px; font-size: 14px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.stag.nicht_erreicht { color: var(--warn); } .stag.mail_raus { color: var(--violet); } .stag.whatsapp { color: var(--ok); } .stag.geantwortet { color: var(--info); } .stag.kein_interesse { color: var(--bad); } .stag.kunde { color: var(--ok); }
.empty { text-align: center; color: var(--ink-3); padding: 60px 20px; }
.empty b { display: block; color: var(--ink); font-size: 19px; margin-bottom: 6px; }

/* Detail */
.detail { flex: 1; overflow-y: auto; padding: 14px var(--pad) 12px; -webkit-overflow-scrolling: touch; }
.d-head { padding: 4px 2px 0; }
.d-name { font-size: 19px; color: var(--ink-2); letter-spacing: -0.01em; }
.d-owner { font-size: 32px; line-height: 1.12; letter-spacing: -0.025em; margin-top: 6px; }
.d-sub { font-size: 15px; color: var(--ink-3); margin-top: 8px; }
.d-status { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; padding: 12px 14px; border-radius: var(--r); background: #fff; border: 1px solid var(--line); font-size: 16px; }
.d-status-text { flex: 1 1 100%; color: var(--ink-2); }
.chip.reset { background: var(--ink); color: #fff; height: 46px; padding: 0 18px; }
.d-status.nicht_erreicht .d-status-text { color: var(--warn); } .d-status.kein_interesse .d-status-text { color: var(--bad); } .d-status.mail_raus .d-status-text { color: var(--violet); } .d-status.whatsapp .d-status-text { color: var(--ok); }
.greet { font-size: 21px; line-height: 1.35; letter-spacing: -0.01em; }
.facts .pills { margin-bottom: 8px; }
.facts-row { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--ink-2); font-size: 16px; }
.more-body { padding-top: 6px; }
.price-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.price-l { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.price-v { font-size: 30px; letter-spacing: -0.02em; margin-top: 2px; }
.steppers { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
@media (min-width: 900px) { .steppers { flex-direction: row; } }
.step { flex: 1; display: grid; grid-template-columns: 1fr 48px 44px 48px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 4px 6px 4px 12px; }
.step-l { font-size: 15px; color: var(--ink-2); }
.step-v { text-align: center; font-size: 19px; }
.step-b { height: 44px; border-radius: 10px; background: var(--tint); font-size: 22px; }
.price-fach { margin-top: 10px; font-size: 15px; color: var(--ink-3); }
.price-pitch { margin: 12px 0 0; font-size: 18px; line-height: 1.4; }
.price-why { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 6px; font-size: 16px; color: var(--ink-2); }
.price-why h4 { margin: 12px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 500; }
.price-why p { margin: 0 0 6px; }
.call { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; height: 76px; margin: 18px 0 4px; border-radius: var(--r); background: var(--ink); color: #fff; font-size: 23px; text-decoration: none; }
.call small { font-size: 15px; opacity: .7; }
.call.alt { height: 54px; background: var(--tint); color: var(--ink); font-size: 17px; margin-top: 0; }
.block { background: var(--tint); border-radius: var(--r); padding: 16px 18px; margin-top: 12px; }
.block h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 500; }
.kv { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 17px; }
.kv:first-of-type { border-top: 0; }
.kv .k { flex: 0 0 96px; color: var(--ink-3); font-size: 15px; padding-top: 2px; }
.kv .v { flex: 1; word-break: break-word; }
.kv .v a { text-decoration: none; color: var(--info); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { height: 34px; padding: 0 13px; border-radius: 17px; background: #fff; border: 1px solid var(--line); font-size: 15px; display: inline-flex; align-items: center; }
.hook { font-size: 18px; line-height: 1.45; }
.guide { font-size: 20px; line-height: 1.5; padding-top: 6px; }
.guide h4 { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 500; }
.guide h4:first-child { margin-top: 0; }
.guide p { margin: 0 0 10px; }
.guide .q { padding: 10px 14px; border-left: 3px solid var(--ink); background: #fff; border-radius: 0 12px 12px 0; margin: 0 0 10px; }
.guide .note { color: var(--ink-2); font-size: 16px; }
.toggle { width: 100%; display: flex; justify-content: space-between; align-items: center; min-height: 44px; font-size: 18px; }
.toggle span { color: var(--ink-3); font-size: 26px; line-height: 1; }
textarea.notes { width: 100%; min-height: 84px; border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: #fff; resize: vertical; outline: none; font-size: 17px; }
input.line { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 14px; padding: 0 12px; background: #fff; outline: none; font-size: 17px; }
.more { color: var(--ink-3); font-size: 15px; padding: 10px 0; text-align: center; width: 100%; }

/* Aktionen */
.actions { padding: 10px var(--pad) calc(var(--safe-bottom) + 10px); border-top: 1px solid var(--line); background: var(--bg); display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.act { height: 64px; border-radius: var(--r); background: var(--tint); font-size: 18px; display: flex; align-items: center; justify-content: center; }
.act small { font-size: 12px; color: var(--ink-3); }
.act.primary { background: var(--ink); color: #fff; } .act.primary small { color: rgba(255,255,255,.65); }
.act.warn { color: var(--warn); } .act.bad { color: var(--bad); } .act.ok { color: var(--ok); }
.act:active { transform: scale(.97); }
.act[disabled] { opacity: .45; }
.act.done { color: var(--ok); }

/* Sheet */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92%; background: #fff; border-radius: 24px 24px 0 0; padding: 8px var(--pad) calc(var(--safe-bottom) + 16px); overflow-y: auto; animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-close { position: absolute; right: 12px; top: 10px; width: 40px; height: 40px; border-radius: 50%; background: var(--tint); font-size: 24px; line-height: 1; color: var(--ink-2); display: grid; place-items: center; z-index: 2; }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 14px; }
.sheet h2 { margin: 0 0 12px; font-size: 22px; letter-spacing: -0.02em; font-weight: 500; }
.sheet label { display: block; font-size: 13px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; margin: 14px 0 6px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { min-height: 52px; padding: 8px 12px; border-radius: 14px; background: var(--tint); font-size: 16px; text-align: left; display: flex; align-items: center; justify-content: space-between; }
.tile b { font-weight: 500; color: var(--ink-3); font-size: 14px; }
.tile.on { background: var(--ink); color: #fff; } .tile.on b { color: rgba(255,255,255,.65); }
.big { width: 100%; height: 60px; display: flex; align-items: center; justify-content: center; text-decoration: none; box-sizing: border-box; border-radius: 18px; background: var(--ink); color: #fff; font-size: 19px; margin-top: 16px; }
.big.ghost { background: var(--tint); color: var(--ink); }
.big[disabled], .big.disabled { opacity: .5; pointer-events: none; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mail-preview { white-space: pre-wrap; font-size: 16px; line-height: 1.5; background: var(--tint); border-radius: 14px; padding: 12px; max-height: 40vh; overflow-y: auto; }

/* Lock */
.lock-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; gap: 14px; }
.lock-brand { font-size: 28px; letter-spacing: -0.02em; }
.lock-title { color: var(--ink-3); }
.pin-dots { display: flex; gap: 14px; height: 20px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--ink-3); }
.pin-dots i.on { background: var(--ink); border-color: var(--ink); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 84px); gap: 14px; margin-top: 10px; }
.pin-pad button { width: 84px; height: 84px; border-radius: 50%; background: var(--tint); font-size: 30px; }
.pin-pad button:active { background: var(--line); }
.lock-msg { min-height: 24px; color: var(--bad); }

/* Settings */
.settings { flex: 1; overflow-y: auto; padding: 14px var(--pad) calc(var(--safe-bottom) + 24px); }
.settings textarea { width: 100%; min-height: 160px; border: 1px solid var(--line); border-radius: 14px; padding: 12px; font-size: 16px; line-height: 1.5; background: #fff; outline: none; }
.settings .block h3 { margin-bottom: 10px; }
.learn { padding: 8px 0; border-top: 1px solid var(--line); font-size: 16px; }
.learn small { display: block; color: var(--ink-3); font-size: 13px; }
table.inc { width: 100%; border-collapse: collapse; font-size: 14px; }
table.inc td, table.inc th { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.inc input { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font-size: 14px; }

/* Toast */
.toast { position: fixed; left: 50%; top: calc(var(--safe-top) + 12px); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 16px; z-index: 60; max-width: 90vw; text-align: center; }
.toast.bad { background: var(--bad); }
.toast.has-action { display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 18px; }
.toast-btn { height: 40px; padding: 0 14px; border-radius: 12px; background: #fff; color: var(--ink); font-size: 16px; }

/* Desktop / Tablet quer: zweispaltig, Liste links, Inhalt rechts */
.pane-empty { display: none; }
@media (min-width: 900px) {
  body { display: grid; grid-template-columns: minmax(360px, 420px) minmax(0, 1fr); height: 100vh; background: var(--bg); }
  .screen { position: relative; inset: auto; height: 100vh; min-height: 0; }
  #lock { grid-column: 1 / -1; }
  #list { grid-column: 1; border-right: 1px solid var(--line); }
  #detail, #settings, #incomplete, #empty { grid-column: 2; }
  .pane-empty { display: flex; align-items: center; justify-content: center; color: var(--ink-3); font-size: 17px; }
  .pane-empty b { display: block; color: var(--ink); font-size: 22px; margin-bottom: 6px; font-weight: 500; letter-spacing: -0.02em; }
  .top { padding-top: 18px; }
  .top-detail .back { display: none; }
  .top-detail { justify-content: flex-end; min-height: 61px; }
  .detail, .settings { padding: 24px 32px 20px; }
  .detail > *, .settings > *, .actions { max-width: 720px; margin-left: auto; margin-right: auto; }
  .detail > .call, .detail > .block { width: 100%; }
  .actions { width: 100%; max-width: none; margin: 0; grid-template-columns: repeat(4, 1fr); padding: 12px max(32px, calc((100% - 784px) / 2)) 16px; }
  .actions .act { height: 58px; }
  .card { min-height: 84px; }
  .card:hover { border-color: var(--line); background: #fff; }
  .card.sel { border-color: var(--ink); background: #fff; }
  .card.next::before { display: none; }
  .cards { padding-bottom: 24px; }
  .sheet-panel { left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%); width: min(560px, 92vw); max-height: 88vh; border-radius: 24px; padding: 12px 24px 24px; animation: pop .18s ease-out; }
  @keyframes pop { from { transform: translate(-50%, -48%); opacity: 0; } to { transform: translate(-50%, -50%); opacity: 1; } }
  .sheet-grip { display: none; }
  .toast { top: 16px; }
  .lock-wrap { max-width: 420px; margin: 0 auto; }
}
