:root {
  --bg: #f4f5f7; --card: #fff; --text: #1b1d22; --muted: #6b7280; --line: #e5e7eb;
  --primary: #2563eb; --primary-t: #fff; --green: #16a34a; --amber: #d97706; --red: #dc2626; --gray: #6b7280;
  --soft: #f1f3f6; --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0f1115; --card: #181b21; --text: #e7e9ee; --muted: #9aa1ad; --line: #2a2f38; --soft: #20242c; --primary: #3b82f6; }
}
:root[data-theme="dark"] { --bg: #0f1115; --card: #181b21; --text: #e7e9ee; --muted: #9aa1ad; --line: #2a2f38; --soft: #20242c; --primary: #3b82f6; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h2 { margin: 0 0 4px; font-size: 22px; } h3 { margin: 0 0 12px; font-size: 16px; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 13px; } .grow { flex: 1; }
.err { color: var(--red); } .ok { color: var(--green); }
kbd { font: 11px ui-monospace, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--soft); color: var(--muted); }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 20px; padding: 10px 20px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 18px; }
#tabs { display: flex; gap: 4px; flex-wrap: wrap; }
#tabs button { border: 0; background: none; color: var(--muted); padding: 8px 12px; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 500; }
#tabs button.active { background: var(--soft); color: var(--text); }
#tabs .num { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; margin-right: 4px; }
.badge { background: var(--red); color: #fff; border-radius: 10px; padding: 0 7px; font-size: 12px; margin-left: 4px; }
.stats { margin-left: auto; display: flex; gap: 16px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.stats b { color: var(--text); }

main { max-width: 1400px; margin: 0 auto; padding: 20px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }

input, select, textarea { font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 6px; }
label.check input { width: auto; }

.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 9px 14px; border-radius: 8px; cursor: pointer; font: inherit; font-weight: 500; white-space: nowrap; }
.btn:hover { background: var(--soft); text-decoration: none; }
.btn.primary { background: var(--primary); color: var(--primary-t); border-color: var(--primary); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.red-text { color: var(--red); }

.import-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin: 16px 0; }
.import-form label:first-child { width: 120px; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); font-weight: 600; }
.table td, .table th { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr.click { cursor: pointer; } .table tr.click:hover td { background: var(--soft); }
.thumb { width: 72px; height: 45px; object-fit: cover; object-position: top; border-radius: 4px; border: 1px solid var(--line); display: block; }
.thumb.none { background: var(--soft); }

.pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; background: var(--soft); color: var(--muted); }
.pill.blue { background: #dbeafe; color: #1d4ed8; } .pill.green { background: #dcfce7; color: #15803d; }
.pill.amber { background: #fef3c7; color: #b45309; } .pill.red { background: #fee2e2; color: #b91c1c; }

/* Dialer */
.dialer-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.dial-grid { display: grid; grid-template-columns: minmax(320px, 400px) 1fr; gap: 16px; }
.dial-grid > .card { margin-bottom: 0; }
.phone { display: block; font-size: 28px; font-weight: 700; margin: 14px 0; letter-spacing: .02em; }
.phone.none { color: var(--muted); font-size: 18px; }
.rows .row { display: grid; grid-template-columns: 120px 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.rows .row > span { color: var(--muted); }
.rows .row div { word-break: break-word; }
.editable { outline: none; border-bottom: 1px dashed var(--line); min-width: 60px; display: inline-block; }
.editable:empty::before { content: attr(data-ph); color: var(--muted); }
.notes-label { margin-top: 14px; }
.history { margin-top: 12px; font-size: 13px; } .history summary { cursor: pointer; color: var(--muted); }
.history div { padding: 4px 0; border-bottom: 1px solid var(--line); }

.site-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.score { display: inline-block; padding: 3px 10px; border-radius: 8px; font-weight: 700; font-size: 13px; color: #fff; background: var(--gray); margin-right: 6px; }
.score.green { background: var(--green); } .score.amber { background: var(--amber); }
.flag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--soft); margin: 2px 4px 2px 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: none; color: var(--text); padding: 6px 12px; cursor: pointer; font: inherit; font-size: 13px; }
.seg button.active { background: var(--primary); color: #fff; } .seg button:disabled { opacity: .4; }
.shot-wrap { background: var(--soft); border-radius: 8px; overflow: hidden; min-height: 300px; display: grid; place-items: center; }
.shot { display: block; width: 100%; height: auto; }
.shot.mobile { width: 300px; margin: 16px auto; border-radius: 16px; border: 6px solid #222; }
.noshot { padding: 60px 20px; text-align: center; color: var(--muted); }
.noshot.big { font-size: 22px; font-weight: 600; color: var(--green); }
.site-meta { margin-top: 8px; }

.actions { margin-top: 16px; }
.call-row { display: flex; gap: 10px; margin-bottom: 14px; }
.btn.call { background: var(--green); border-color: var(--green); color: #fff; font-size: 17px; padding: 12px 24px; }
.btn.call kbd { background: rgba(255,255,255,.2); color: #fff; border-color: rgba(255,255,255,.3); }
.outcomes { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.btn.out { justify-content: center; padding: 12px 8px; }
.btn.out.amber { border-color: var(--amber); color: var(--amber); }
.btn.out.green { border-color: var(--green); color: var(--green); }
.btn.out.red { color: var(--red); }
.btn.out.selected { background: var(--soft); outline: 2px solid currentColor; }
.when { margin-top: 12px; padding: 12px; background: var(--soft); border-radius: 8px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.when-row { display: flex; gap: 8px; flex-wrap: wrap; }
.when-row input[type=datetime-local] { width: 220px; }
.when-row .grow { min-width: 180px; width: auto; }
.quick-note { margin-top: 10px; }
.empty { text-align: center; padding: 60px; }

.agenda { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.agenda-item { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 8px; cursor: pointer; border-bottom: 1px solid var(--line); }
.agenda-item:hover { background: var(--soft); }
.agenda-item.due .when-col { color: var(--red); font-weight: 600; }
.when-col { width: 120px; font-size: 13px; flex-shrink: 0; }

.leads-bar { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.leads-bar input { flex: 1; min-width: 180px; } .leads-bar select { width: 200px; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; overflow: auto; padding: 30px 16px; }
.modal-inner { max-width: 1250px; margin: 0 auto; position: relative; }
.close { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--muted); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #111; color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 100; }
.spin::before { content: ""; display: inline-block; width: 10px; height: 10px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; margin-right: 6px; animation: r .8s linear infinite; vertical-align: -1px; }
@keyframes r { to { transform: rotate(360deg); } }

.login { display: grid; place-items: center; min-height: 100vh; }
.login-card { width: 320px; display: flex; flex-direction: column; gap: 12px; }

@media (max-width: 900px) {
  .dial-grid, .agenda { grid-template-columns: 1fr; }
  .outcomes { grid-template-columns: repeat(2, 1fr); }
  main { padding: 12px; } .stats { margin-left: 0; }
  .keys { display: none; }
  .table { font-size: 13px; }
}

/* Import: Matrix Branche × Region */
#tab-import { margin: -8px -4px 0; }
.imp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 12px; height: calc(100vh - 92px); min-height: 560px; }
.imp-grid .card { margin-bottom: 0; }
.matrix-card { padding: 0; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.mx-toolbar { display: flex; gap: 8px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.mx-toolbar input { padding: 6px 10px; font-size: 14px; }
.plz-add { width: 64px; font-weight: 600; letter-spacing: .04em; }
.zone-pick { display: flex; align-items: center; gap: 6px; }
.zone-chips { display: flex; gap: 4px; }
.zone-chip { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 6px; padding: 4px 9px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.zone-chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.zone-digit { width: auto; padding: 5px 8px; font-weight: 700; font-size: 14px; }
.zone-chip { position: relative; min-width: 38px; }
.zone-chip:disabled { opacity: .3; cursor: default; }
.zone-chip.used::after { content: ''; position: absolute; top: 3px; right: 3px; width: 5px; height: 5px; border-radius: 50%; background: var(--green); }
.zone-chip:not(:disabled):not(.active):hover { border-color: var(--primary); }
#brFilter { min-width: 160px; width: auto; }
.adv { display: flex; align-items: center; gap: 6px; }
.adv .seg button { padding: 5px 9px; font-size: 12px; }

.mx-scroll { overflow-x: hidden; overflow-y: auto; flex: 1; position: relative; }
.mx { --mx-act: color-mix(in srgb, var(--primary) 10%, transparent); --mx-hov: color-mix(in srgb, var(--text) 5%, transparent);
  width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.mx th, .mx td { background: var(--card); border: 0; }
/* Kopf */
.mx thead th { position: sticky; top: 0; z-index: 3; border-bottom: 2px solid var(--line); vertical-align: bottom; }
.mx .mx-corner { position: sticky; left: 0; z-index: 4; width: 170px; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 12px; }
.mx th.mx-plz { padding: 8px 2px 7px; text-align: center; cursor: pointer; font-weight: 400; overflow: hidden; border-radius: 8px 8px 0 0; }
.mx-plz-n { font-weight: 700; font-size: 13px; white-space: nowrap; }
.mx-plz-n .xx { color: var(--muted); font-weight: 400; font-size: 11px; }
.mx-plz-c { font-size: 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 1px auto 5px; max-width: 100%; }
.mx .mini-progress { width: 70%; max-width: 44px; height: 4px; }
.mx th.mx-plz:hover { background: var(--soft); }
.mx th.mx-plz.colact { background: var(--primary); color: #fff; }
.mx th.mx-plz.colact .xx, .mx th.mx-plz.colact .mx-plz-c { color: rgba(255,255,255,.8); }
.mx th.mx-plz.colact .mini-progress { background: rgba(255,255,255,.3); }
.mx th.mx-plz.colact .mini-progress i { background: #fff; }
/* Summenspalte */
.mx .mx-sum { width: 46px; text-align: center; font-weight: 700; font-size: 12px; color: var(--muted);
  background: var(--soft); border-right: 2px solid color-mix(in srgb, var(--muted) 60%, transparent); }
.mx thead .mx-sum { font-size: 14px; color: var(--text); }
.mx td.mx-sum.has { color: var(--text); }
/* Gruppen */
.mx tr.mx-grp th, .mx tr.mx-grp td { background: var(--soft); height: 32px; cursor: pointer; border-top: 1px solid var(--line); }
.mx tr.mx-gap td { height: 18px; padding: 0; background: var(--bg); border-top: 1px solid var(--line); }
.mx tr.mx-grp th { position: sticky; left: 0; z-index: 2; text-align: left; padding: 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .03em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--primary); }
.mx tr.mx-grp td { text-align: center; font-size: 11px; font-weight: 600; color: var(--muted); }
.mx tr.mx-grp td.colact { background: color-mix(in srgb, var(--primary) 16%, var(--soft)); color: var(--text); }
.caret { display: inline-block; width: 12px; color: var(--muted); }
/* Branchen-Zeilen */
.mx th.mx-br { position: sticky; left: 0; z-index: 2; text-align: left; font-weight: 400; padding: 0 12px; height: 28px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; font-size: 13px; }
.mx tbody tr:not(.mx-grp):nth-child(even) th.mx-br, .mx tbody tr:not(.mx-grp):nth-child(even) td.mc { background-image: linear-gradient(var(--mx-hov), var(--mx-hov)); }
.mx th.mx-br:hover { color: var(--primary); }
.mx tr.rowact th.mx-br { color: var(--primary); font-weight: 700; }
.mx tr.rowact td.mc, .mx tr.rowact th.mx-br { box-shadow: inset 0 1px 0 var(--primary), inset 0 -1px 0 var(--primary); }
/* Zellen */
.mx td.mc { text-align: center; cursor: pointer; height: 28px; padding: 0; overflow: hidden; white-space: nowrap; }
.mx td.mc.colact { background-color: var(--mx-act) !important; }
.mx td.mc .v { display: inline-block; min-width: 30px; padding: 2px 6px; border-radius: 10px; font-size: 12px; font-weight: 700; line-height: 1.3; }
.mx td.mc.imp .v { color: var(--green); font-weight: 600; }
.mx td.mc.seen .v { color: var(--muted); font-weight: 600; }
.mx td.mc.zero .v { color: var(--muted); font-weight: 400; opacity: .6; }
.mx td.mc.open .v { color: var(--line); font-size: 16px; line-height: 1; padding: 0; }
.mx td.mc.open:hover .v { color: var(--primary); font-size: 14px; font-weight: 700; }
.mx td.mc.open:hover .v::after { content: ' suchen'; font-size: 11px; }
.mx td.mc.open:hover .v { font-size: 0; }
.mx td.mc.open:hover .v::before { content: '+'; font-size: 14px; }
.mx td.mc.active { box-shadow: inset 0 0 0 2px var(--primary); }
.mx td.mc .spin::before { margin: 0; }
/* Fadenkreuz beim Drüberfahren */
.mx td.mc.xh, .mx th.mx-br.xh { background-color: var(--mx-hov); }
.mx th.mx-plz.xh:not(.colact) { background: var(--soft); }
.mx td.mc:hover { background-color: var(--mx-hov); }

.mx-legend { display: flex; gap: 14px; flex-wrap: wrap; padding: 6px 10px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); align-items: center; }
.mx-legend b { display: inline-block; min-width: 18px; padding: 0 5px; text-align: center; border-radius: 9px; margin-right: 3px; font-size: 11px; }
.c-imp { color: var(--green); } .c-seen { color: var(--muted); } .c-zero { color: var(--muted); font-weight: 400; }
.c-open { color: var(--muted); }

.imp-side { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.map-col { padding: 0; overflow: hidden; flex: 0 0 38%; position: relative; display: flex; }
#map { flex: 1; min-height: 200px; }
.map-legend { position: absolute; left: 8px; bottom: 22px; display: flex; flex-direction: column; gap: 2px; padding: 5px 8px; font-size: 11px; color: #374151; background: rgba(255,255,255,.9); border-radius: 6px; pointer-events: none; }
.map-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }

.results-col { display: flex; flex-direction: column; padding: 0; overflow: hidden; flex: 1; min-height: 0; }
.res-empty { padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.res-body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.res-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 10px 12px 6px; }
.res-title h3 { margin: 0 0 2px; font-size: 15px; }
.res-filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding: 0 12px 8px; border-bottom: 1px solid var(--line); }
.chip { flex-direction: row; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 14px; padding: 2px 9px; font-size: 12px; color: var(--text); cursor: pointer; }
.chip input { width: auto; margin: 0; }
.res-list { overflow-y: auto; flex: 1; padding: 4px 6px; }
.res-item { display: flex; gap: 8px; align-items: center; padding: 6px; border-radius: 8px; cursor: pointer; }
.res-item:hover, .res-item.hover { background: var(--soft); }
.res-item.known { opacity: .55; }
.res-item input { width: auto; }
.res-name { font-weight: 600; font-size: 13px; }
.res-item .small { font-size: 12px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.res-footer { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--card); }
.res-footer .grow { justify-content: center; }
.res-footer #skipBranche { max-width: 55%; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.pad { padding: 12px; margin: 0; }
.mini-progress { height: 4px; background: var(--soft); border-radius: 2px; overflow: hidden; display: inline-block; }
.mini-progress i { display: block; height: 100%; background: var(--green); }
.iw { color: #1b1d22; font: 14px/1.45 system-ui, sans-serif; max-width: 260px; display: flex; flex-direction: column; gap: 3px; }
.iw .muted { color: #6b7280; }
.iw-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 8px; }
.iw .btn { background: #fff; color: #1b1d22; border-color: #e5e7eb; }
.iw .btn.primary { background: #2563eb; color: #fff; border-color: #2563eb; }

@media (max-width: 1100px) {
  .imp-grid { grid-template-columns: 1fr; height: auto; }
  .matrix-card { height: 60vh; }
  .map-col { flex-basis: 320px; min-height: 320px; }
  .results-col { min-height: 420px; }
}


/* Dialer-Auswahl in der Matrix */
.mode-seg { margin-left: auto; }
.mode-seg button { padding: 6px 12px; font-size: 13px; font-weight: 600; }
.dial-info { width: 100%; font-size: 13px; padding: 2px 2px 0; }
.mx td.mc.dc.none { cursor: default; }
.mx td.mc.dc.none .v { color: var(--line); }
.mx td.mc.dc.off .v { color: var(--text); font-weight: 600; }
.mx td.mc.dc.on { background-color: color-mix(in srgb, var(--primary) 18%, transparent) !important; box-shadow: inset 3px 0 0 var(--primary); }
.mx td.mc.dc.on .v { color: var(--primary); font-weight: 800; }
.c-don { color: var(--primary); font-weight: 800; } .c-doff { color: var(--text); }
.dial-mode .mx th.mx-plz.colact { background: var(--card); color: var(--text); }
.dial-mode .mx th.mx-plz.colact .xx, .dial-mode .mx th.mx-plz.colact .mx-plz-c { color: var(--muted); }
.dial-mode .mx td.mc.colact { background-color: transparent !important; }
.dial-mode .mx-legend .lg-search, .mx-legend .lg-dial { display: none; }
.dial-mode .mx-legend .lg-dial { display: inline; }
.dial-mode .mx-legend > span:not(.lg-dial) { display: none; }
.c-don { background: var(--primary); color: #fff; }
.c-doff { border: 1px solid var(--line) !important; color: var(--muted); }
.dial-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; margin-bottom: 12px; }

/* ===== Dialer: Swipe ===== */
#tab-dialer .dialer-bar { justify-content: center; margin-bottom: 8px; color: var(--muted); }
.sw-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; padding-top: 4px; user-select: none; }
.sw-stack { position: relative; width: min(860px, 100%); height: min(66vh, 600px); }
.sw-card { position: absolute; inset: 0; border-radius: 22px; overflow: hidden; background: var(--card);
  box-shadow: 0 18px 50px rgba(0,0,0,.28), 0 2px 6px rgba(0,0,0,.15); touch-action: none; cursor: grab;
  transition: transform .25s ease, opacity .25s ease; display: flex; flex-direction: column; }
.sw-card.dragging { transition: none; cursor: grabbing; }
.sw-card.fly { transition: transform .26s ease-in, opacity .26s ease-in; }
.sw-behind { transform: scale(.95) translateY(14px); opacity: .5; box-shadow: none; border: 1px solid var(--line); }
.sw-shot { flex: 1; min-height: 0; background: var(--soft); display: flex; align-items: flex-start; justify-content: center; overflow: hidden; }
.sw-img { width: 100%; height: 100%; object-fit: cover; object-position: top; pointer-events: none; }
.sw-img.mobile { width: auto; height: 94%; margin-top: 3%; border-radius: 22px; border: 6px solid #111; object-fit: cover; }
.sw-noshot { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); font-size: 15px; }
.sw-noshot .big { font-size: 46px; }
.sw-noshot b { font-size: 22px; color: var(--text); }
.sw-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 70px 26px 22px; color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.55) 55%, transparent 100%); }
.sw-name { font-size: 28px; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
.sw-meta { font-size: 15px; opacity: .9; margin-top: 4px; }
.sw-link { display: inline-block; margin-top: 8px; font-size: 13px; color: #fff; background: rgba(255,255,255,.18); padding: 3px 10px; border-radius: 12px; backdrop-filter: blur(4px); }
.sw-link:hover { background: rgba(255,255,255,.3); text-decoration: none; }
.sw-seg { position: absolute; top: 14px; right: 14px; display: flex; background: rgba(0,0,0,.55); border-radius: 18px; padding: 3px; backdrop-filter: blur(6px); }
.sw-seg button { border: 0; background: none; color: #fff; font: inherit; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 15px; cursor: pointer; }
.sw-seg button.on { background: #fff; color: #111; }
.sw-stamp { position: absolute; top: 34px; font-size: 34px; font-weight: 900; letter-spacing: .06em; padding: 4px 14px; border: 5px solid; border-radius: 10px; opacity: 0; pointer-events: none; }
.sw-stamp.like { left: 30px; color: #22c55e; border-color: #22c55e; transform: rotate(-14deg); }
.sw-stamp.nope { right: 30px; color: #ef4444; border-color: #ef4444; transform: rotate(14deg); }
.sw-actions { display: flex; align-items: center; gap: 22px; }
.sw-btn { width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--card); font-size: 30px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,.18); transition: transform .12s ease, box-shadow .12s ease; display: grid; place-items: center; color: var(--text); }
.sw-btn:hover:not(:disabled) { transform: scale(1.08); }
.sw-btn:active:not(:disabled) { transform: scale(.95); }
.sw-btn.nope { color: #ef4444; }
.sw-btn.like { color: #fff; background: linear-gradient(135deg, #22c55e, #16a34a); width: 84px; height: 84px; font-size: 34px; }
.sw-btn.small { width: 50px; height: 50px; font-size: 20px; color: var(--muted); }
.sw-btn:disabled { opacity: .35; cursor: default; }
.sw-hint { font-size: 12px; color: var(--muted); }
.sw-empty { text-align: center; padding: 80px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sw-empty .big { font-size: 56px; }

/* ===== Dialer: Anruf-Ansicht ===== */
.cv { display: grid; grid-template-columns: 380px 1fr; gap: 16px; max-width: 1300px; margin: 0 auto; }
.cv .card { margin-bottom: 0; border-radius: 18px; }
.cv-right { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cv-card .phone { display: none; }
.cv-card h2 { font-size: 24px; }
.cv-call { display: flex; flex-direction: column; gap: 14px; }
.cv-callbtn { display: flex; align-items: center; gap: 16px; padding: 16px 22px; border-radius: 16px; color: #fff;
  background: linear-gradient(135deg, #22c55e, #16a34a); box-shadow: 0 8px 24px rgba(22,163,74,.35); }
.cv-callbtn:hover { text-decoration: none; filter: brightness(1.05); }
.cv-callbtn span { font-size: 30px; }
.cv-callbtn b { display: block; font-size: 26px; letter-spacing: .02em; }
.cv-callbtn small { opacity: .85; }
.cv-call .actions { margin-top: 0; }
.cv-call .btn.out { border-radius: 12px; padding: 12px 8px; }
.cv-later { align-self: flex-end; }
.cv-site .shot-wrap { border-radius: 12px; max-height: 52vh; overflow: auto; }
@media (max-width: 900px) {
  .cv { grid-template-columns: 1fr; }
  .sw-stack { height: 62vh; }
  .sw-name { font-size: 22px; }
  .sw-actions { gap: 14px; }
}

/* ===================== Mobil ===================== */
@media (max-width: 760px) {
  /* Kopf */
  .top { padding: 8px 12px; gap: 6px; }
  .brand { font-size: 16px; }
  #tabs { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  #tabs::-webkit-scrollbar { display: none; }
  #tabs button { white-space: nowrap; padding: 7px 10px; font-size: 14px; }
  .stats { display: none; }
  main { padding: 8px; }

  /* Import-Matrix */
  #tab-import { margin: 0; }
  .imp-grid { gap: 8px; }
  .matrix-card { height: auto; max-height: 72vh; border-radius: 12px; }
  .mx-toolbar { padding: 8px; gap: 6px; }
  .zone-pick { width: 100%; min-width: 0; }
  .zone-pick > .muted { display: none; }
  .zone-chips { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; flex: 1; min-width: 0; }
  .zone-chips::-webkit-scrollbar { display: none; }
  .zone-chip { min-width: 40px; padding: 7px 8px; flex-shrink: 0; }
  .mode-seg { margin-left: 0; width: 100%; display: flex; }
  .mode-seg button { flex: 1; padding: 8px; }
  .dial-info { font-size: 12px; }
  .mx-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .mx { table-layout: fixed; width: max(100%, calc(150px + var(--ncols, 8) * 52px)); }
  .mx .mx-corner { width: 112px; padding: 6px 8px; }
  .mx th.mx-br { font-size: 12.5px; padding: 0 8px; height: 34px; max-width: 112px; }
  .mx .mx-sum { width: 38px; font-size: 11px; }
  .mx th.mx-plz { width: 52px; min-width: 52px !important; padding: 6px 1px; }
  .mx-plz-n { font-size: 12px; }
  .mx-plz-n .xx { display: none; }
  .mx-plz-c { font-size: 9px; }
  .mx td.mc { height: 34px; }
  .mx td.mc .v { min-width: 0; padding: 2px 5px; font-size: 11px; }
  .mx tr.mx-grp th { font-size: 11.5px; padding: 0 8px; overflow: visible; z-index: 3; }
  .mx tr.mx-grp th .muted { display: none; }
  .mx tr.mx-grp td { font-size: 10px; }
  .mx tr.mx-gap td { height: 10px; }
  .mx-legend { display: none; }
  .map-col { flex-basis: 240px; min-height: 240px; }
  .results-col { min-height: 60vh; }
  .res-footer { position: sticky; bottom: 0; }

  /* Swipe */
  #tab-dialer .dialer-bar { font-size: 12px; text-align: center; }
  .sw-wrap { gap: 12px; }
  .sw-stack { height: calc(100svh - 270px); min-height: 360px; }
  .sw-card { border-radius: 18px; }
  .sw-info { padding: 60px 18px 16px; }
  .sw-name { font-size: 21px; }
  .sw-meta { font-size: 13px; }
  .sw-img.mobile { height: 100%; margin-top: 0; border: 0; border-radius: 0; width: 100%; object-fit: cover; }
  .sw-stamp { font-size: 26px; top: 60px; }
  .sw-btn { width: 62px; height: 62px; font-size: 26px; }
  .sw-btn.like { width: 74px; height: 74px; }
  .sw-btn.small { width: 46px; height: 46px; }
  .sw-hint { display: none; }

  /* Anruf-Ansicht: Anrufen zuerst */
  .cv { display: flex; flex-direction: column; gap: 10px; }
  .cv-left, .cv-right { display: contents; }
  .cv-call { order: 1; }
  .cv-card { order: 2; }
  .cv-site { order: 3; }
  .cv-callbtn { padding: 14px 16px; }
  .cv-callbtn b { font-size: 22px; }
  .outcomes { grid-template-columns: 1fr 1fr; }
  .cv-call kbd, .cv-callbtn small { display: none; }
}

/* ===== Mobil v2: alles ohne seitliches Wischen ===== */
@media (max-width: 760px) {
  /* Werkzeugleiste: Ziffer + Modus oben, Zonen x0–x9 darunter über volle Breite */
  .mx-toolbar { display: grid; grid-template-columns: auto 1fr; gap: 6px; }
  .zone-pick { display: contents; }
  .zone-digit { grid-column: 1; grid-row: 1; }
  .mode-seg { grid-column: 2; grid-row: 1; }
  .zone-chips { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; overflow: visible; }
  .zone-chip { min-width: 0; padding: 7px 0; font-size: 12.5px; }
  .dial-info { grid-column: 1 / -1; }

  /* Matrix: alle 10 Regionen nebeneinander */
  .mx-scroll { overflow-x: hidden; }
  .mx { table-layout: fixed; width: 100% !important; }
  .mx .mx-corner { width: 92px; font-size: 9.5px; padding: 6px; }
  .mx .mx-sum { width: 0 !important; padding: 0; font-size: 0; border: 0 !important; overflow: hidden; }
  .mx th.mx-plz { width: auto; min-width: 0 !important; padding: 6px 0; }
  .mx-plz-n { font-size: 10.5px; letter-spacing: -.02em; }
  .mx-plz-c, .mx th.mx-plz .mini-progress { display: none; }
  .mx th.mx-br { font-size: 11.5px; padding: 0 6px; max-width: 92px; }
  .mx td.mc .v { padding: 1px 3px; font-size: 10px; border-radius: 7px; }
  .mx td.mc.open .v { font-size: 12px; }
  .mx tr.mx-grp td { font-size: 0; }
  .mx tr.mx-grp th { font-size: 11px; }
}

/* Zahlen-Badges in der Matrix: alle gleich groß */
.mx td.mc.imp .v, .mx td.mc.dc.on .v, .mx td.mc.dc.off .v {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 20px; padding: 0; border-radius: 10px; line-height: 1; box-sizing: border-box;
}
@media (max-width: 760px) {
  .mx td.mc.imp .v, .mx td.mc.dc.on .v, .mx td.mc.dc.off .v { width: 28px; height: 17px; border-radius: 9px; font-size: 10px; }
}

/* Dialer-Matrix: Fortschritt x/gesamt (nur Desktop), ✓ wenn fertig */
.mx td.mc.dc.off .v, .mx td.mc.dc.on .v { width: auto; min-width: 38px; padding: 0 4px; }
.mx td.mc.dc .dn { color: var(--muted); font-weight: 500; }
.mx td.mc.dc.on .dn { color: color-mix(in srgb, var(--primary) 70%, var(--muted)); }
.mx td.mc.dc .ok, .c-fin { color: var(--green); font-weight: 800; font-size: 14px; }
.c-doff .dn { color: var(--muted); font-weight: 500; }
@media (max-width: 760px) {
  .mx td.mc.dc .dn, .mx-legend .dn { display: none; }
  .mx td.mc.dc.off .v, .mx td.mc.dc.on .v { min-width: 28px; padding: 0; }
}

.dial-info { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dial-info .dial-start { margin-left: auto; text-decoration: none; }
@media (max-width: 760px) { .dial-info .dial-start { margin-left: 0; width: 100%; justify-content: center; } }

.mx td.mc.part .v { color: var(--muted); font-weight: 600; }
.c-part { color: var(--muted); font-weight: 600; }

/* Live-Website: Ladeanzeige bis die Seite da ist */
.dev-screen .live-wait { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: var(--soft); color: var(--muted); font-size: 13px; text-align: center; padding: 10px; }
.dev-screen:has(iframe.live.on) .live-wait { display: none; }

.mx td.mc.dc.fin .v { color: var(--green); }
.mx td.mc.dc .ok { margin-right: 3px; }
.dev-screen .live-wait.broken { color: var(--text); }
.dev-screen .live-wait.broken svg { width: 30px; height: 30px; color: #f59e0b; }
.dev-screen .live-wait.broken span { color: var(--muted); font-size: 12px; }

/* Feld-Menü in der Matrix */
.cell-pop { position: fixed; z-index: 50; width: 280px; max-width: calc(100vw - 16px); padding: 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-lg); border-radius: 16px; }
.cp-title { font-weight: 700; font-size: 15px; }
.cp-dist { min-height: 24px; }
.cp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cp-actions .btn { justify-content: center; }
.cp-link { background: none; border: 0; color: var(--muted); font-size: 12px; text-decoration: underline; cursor: pointer; padding: 2px; align-self: center; }
.cp-link:hover { color: var(--primary); }
/* Status-Verteilung */
.dist-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--soft); margin: 4px 0 8px; }
.dist-bar i { display: block; min-width: 3px; }
.dist-list { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.dist-it { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--card2); color: var(--text); cursor: pointer; }
.dist-it b { font-weight: 700; }
.dist-it.on { border-color: var(--primary); color: var(--primary); }
.dist-it .dot { width: 8px; height: 8px; border-radius: 50%; }
.st-blue { background: var(--primary); } .st-green { background: var(--green); } .st-amber { background: var(--amber); }
.st-red { background: var(--red); } .st-gray { background: var(--gray); } .st-black { background: color-mix(in srgb, var(--text) 70%, transparent); }
.lead-dist { padding: 12px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); }
.ld-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ld-head .btn { margin-left: auto; }
.ld-head .tag button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 0 0 4px; }

/* Fertig: Häkchen über der Zahl */
.mx td.mc.dc.fin .v { flex-direction: column; height: auto; line-height: 1; gap: 0; font-size: 10.5px; }
.mx td.mc.dc.fin .ok { margin: 0; font-size: 11px; line-height: .9; }
.mx-legend .c-fin { display: block; font-size: 10px; line-height: .9; }
.mx-legend b:has(.c-fin) { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1; }

/* Dialer-Zellen: Häkchen vorne, Zahl dahinter – in einer Zeile */
.mx td.mc.dc .v { display: inline-flex !important; flex-direction: row !important; flex-wrap: nowrap; align-items: center; justify-content: center;
  gap: 2px; white-space: nowrap; width: auto !important; min-width: 38px; padding: 0 5px; }
.mx td.mc.dc .ok { font-size: 11px; line-height: 1; display: inline; }
@media (max-width: 760px) {
  .mx td.mc.dc .v { min-width: 0; padding: 0 2px; gap: 1px; font-size: 10px; }
  .mx td.mc.dc .ok { font-size: 9px; }
}

/* Fertige Dialer-Felder: Häkchen (vorne) deckungsgleich über der Zahl (hinten) */
.mx td.mc.dc.fin .v { position: relative; gap: 0 !important; }
.mx td.mc.dc.fin .v .ok { position: absolute; inset: 0; display: flex !important; align-items: center; justify-content: center;
  font-size: 18px !important; font-weight: 900; color: var(--green); z-index: 2; pointer-events: none;
  text-shadow: 0 0 3px var(--card), 0 0 6px var(--card); }
.mx td.mc.dc.fin .v { color: color-mix(in srgb, var(--muted) 70%, transparent); }
@media (max-width: 760px) { .mx td.mc.dc.fin .v .ok { font-size: 15px !important; } }

/* Nur die markierte Zelle hervorheben – keine Zeilen/Spalten */
.mx td.mc.dc.on { background-color: color-mix(in srgb, var(--primary) 22%, transparent) !important; box-shadow: inset 0 0 0 2px var(--primary); }

/* Reihenfolge der Felder */
.mx td.mc .qn { font-style: normal; font-size: 9px; font-weight: 800; color: #fff; background: var(--primary); border-radius: 6px; min-width: 13px; height: 13px; line-height: 13px; padding: 0 3px; margin-right: 4px; display: inline-block; text-align: center; }
.mx td.mc.dc.fin .qn { margin: 0 0 1px; }
.queue-info { width: 100%; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; }
.q-list { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.q-it { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 3px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); }
.q-it b { background: var(--primary); color: #fff; border-radius: 999px; min-width: 17px; height: 17px; display: grid; place-items: center; font-size: 10px; }
.queue-info #qClear { color: var(--muted); font-size: 12px; }
.queue-info .btn { margin-left: auto; text-decoration: none; }

/* Anruf-Reihenfolge im rechten Panel */
.res-empty .queue-info { display: flex; flex-direction: column; align-items: stretch; gap: 10px; width: 100%; text-align: left; font-size: 13px; }
.q-head { display: flex; align-items: center; justify-content: space-between; }
.q-head b { font-size: 15px; }
.res-empty .q-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; flex: none; }
.res-empty .q-it { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 10px; background: var(--soft); border: 1px solid var(--line); }
.q-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-x { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 2px; font-size: 12px; }
.q-x:hover { color: var(--red); }
.res-empty .q-call { margin: 4px 0 0; justify-content: center; text-decoration: none; }

.q-grip { cursor: grab; color: var(--muted); font-size: 14px; line-height: 1; padding: 2px 2px; touch-action: none; user-select: none; }
.q-it.dragging { opacity: .85; border-color: var(--primary) !important; box-shadow: var(--shadow); }
.q-it.dragging .q-grip { cursor: grabbing; }

.res-empty .q-it { cursor: grab; touch-action: none; user-select: none; }
.res-empty .q-it.dragging { cursor: grabbing; }
.q-x { cursor: pointer; }

.res-empty .q-list { position: relative; }
.res-empty .q-it.dragging { position: relative; z-index: 5; opacity: 1; background: var(--card); border-color: var(--primary) !important;
  box-shadow: 0 10px 24px -8px rgba(0,0,0,.45), 0 0 0 1px var(--primary); scale: 1.02; }

#leadsTable tr.ld-grp td { background: var(--soft); font-size: 13px; padding-top: 9px; padding-bottom: 9px; border-top: 8px solid var(--card); }
#leadsTable .ld-n { display: inline-grid; place-items: center; min-width: 19px; height: 19px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 11px; margin-right: 8px; }

/* Navigation: Arbeits-Tabs | Termine & Sync abgesetzt */
/* Tab-Gruppen: Import · Anrufen · Leads ‖ Interessenten · Termine ‖ Sync */
#tabs .tab-gap { width: 1px; flex-shrink: 0; align-self: stretch; margin: 6px 22px; background: var(--line2); }
@media (max-width: 760px) { #tabs .tab-gap { margin: 6px 8px; } }
.int-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line2, var(--line)); background: none; color: inherit; font: inherit; font-size: 13px; cursor: pointer; }
.chip-btn b { font-size: 12px; color: var(--muted); }
.chip-btn.on { border-color: var(--amber); color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, transparent); }
#intTable tr.click { cursor: pointer; }
#tabs .tab-sep { width: 1px; align-self: stretch; margin: 6px 8px; background: var(--line2); }
@media (max-width: 760px) { #tabs .tab-sep { display: none; } }

#tabs button.locked { opacity: .38; cursor: not-allowed; }
#tabs button.locked:hover { color: var(--muted); }

/* Fertig (x = y): grünes ✓ sauber ÜBER „x/y“ – ersetzt die Überlagerung */
.mx td.mc.dc.fin .v { position: relative; flex-direction: column !important; gap: 1px !important; height: auto !important; line-height: 1; color: var(--green); }
.mx td.mc.dc.fin .v .ok { position: static !important; display: block !important; font-size: 12px !important; line-height: 1; text-shadow: none; color: var(--green); font-weight: 900; }
.mx td.mc.dc.fin .fx { font-size: 10px; font-weight: 700; color: var(--green); }
.mx td.mc.dc.fin .qn { position: absolute; left: -12px; top: 50%; transform: translateY(-50%); margin: 0; }
@media (max-width: 760px) { .mx td.mc.dc.fin .v .ok { font-size: 10px !important; } .mx td.mc.dc.fin .fx { font-size: 9px; } }

/* ===== Dialer füllt auf PC & iPad den ganzen Bildschirm ===== */
@media (min-width: 761px) {
  body:has(#tab-dialer:not(.hidden)) main { max-width: none; }
  #tab-dialer .sw-stack { width: 100%; height: calc(100svh - 215px); min-height: 420px; }
}
/* iPad hoch / schmalere Fenster: Kopfzeile bricht um → etwas mehr Platz abziehen */
@media (min-width: 761px) and (max-width: 1250px) {
  #tab-dialer .sw-stack { height: calc(100svh - 262px); }
}
@media (min-width: 761px) and (max-width: 900px) {
  #tab-dialer .sw-stack { height: calc(100svh - 300px); }
}

/* ===================== Swipe-Ansicht (neu, PC + Handy) ===================== */
#tab-dialer .sw-card { display: flex; flex-direction: column; }
.sw-top { display: flex; align-items: center; gap: 14px; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); background: var(--card); position: relative; z-index: 3; }
.sw-title { flex: 1; min-width: 0; }
#tab-dialer .sw-top .sw-name { font-size: 20px; font-weight: 800; line-height: 1.2; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tab-dialer .sw-top .sw-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; justify-content: flex-start; overflow: visible; }
#tab-dialer .sw-top .sw-chip { color: var(--text); background: var(--soft); border: 1px solid var(--line); backdrop-filter: none; font-size: 12px; padding: 3px 10px; flex-shrink: 0; }
#tab-dialer .sw-top .sw-chip.link { color: var(--primary); }
.sw-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
#tab-dialer .sw-top .sw-seg { position: static; background: var(--soft); border: 1px solid var(--line); backdrop-filter: none; }
#tab-dialer .sw-top .sw-seg button { color: var(--muted); }
#tab-dialer .sw-top .sw-seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.sw-tool { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--soft);
  color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.live-on .sw-tool { background: var(--primary); border-color: transparent; color: #fff; }
.live-on .sw-tool .lh-dot { background: #fff; box-shadow: none; animation: none; }
#tab-dialer .sw-card .sw-shot > .live-hint { display: none; }
#tab-dialer .sw-card.device-view .sw-shot { padding: 18px 18px 14px !important; }
.sw-usp { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--primary) 9%, var(--card));
  color: var(--primary); font-size: 13.5px; font-weight: 600; text-align: center; }
.sw-usp .ic { flex-shrink: 0; }
/* Aktionen mit Beschriftung */
#tab-dialer .sw-actions { gap: 20px; align-items: flex-start; }
.sw-act { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sw-act > span { font-size: 11.5px; font-weight: 600; color: var(--muted); }
.sw-act:has(.like) > span { color: var(--green); }
.sw-act:has(.nope) > span { color: var(--red); }
.sw-act:has(.small) { padding-top: 11px; }
.sw-act:has(.like) { margin-top: -6px; }
#tab-dialer .sw-hint kbd { font-size: 10.5px; }

@media (min-width: 761px) {
  #tab-dialer .sw-stack { height: calc(100svh - 236px); }
}
@media (min-width: 761px) and (max-width: 1250px) { #tab-dialer .sw-stack { height: calc(100svh - 283px); } }
@media (min-width: 761px) and (max-width: 900px) { #tab-dialer .sw-stack { height: calc(100svh - 320px); } }

/* Handy: kompakter Kopf */
@media (max-width: 760px) {
  .sw-top { padding: 10px 12px 9px; gap: 10px; align-items: flex-start; }
  #tab-dialer .sw-top .sw-name { font-size: 17px; }
  #tab-dialer .sw-top .sw-chips { gap: 5px; margin-top: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  #tab-dialer .sw-top .sw-chips::-webkit-scrollbar { display: none; }
  #tab-dialer .sw-top .sw-chip { font-size: 11.5px; padding: 3px 9px; }
  .sw-tools { flex-direction: column-reverse; align-items: flex-end; gap: 6px; }
  .sw-tool { height: 30px; padding: 0 10px; font-size: 11.5px; }
  #tab-dialer .sw-top .sw-seg button { padding: 4px 9px; }
  #tab-dialer .sw-card.device-view .monitor { padding: 12px; }
  .sw-usp { font-size: 12.5px; padding: 8px 12px; }
  #tab-dialer .sw-actions { gap: 14px; }
  .sw-act > span { font-size: 11px; }
}
@media (max-width: 760px) {
  #tab-dialer .sw-stack { height: calc(100svh - 196px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
}
/* Beschriftungen unter den Aktions-Buttons auf einer Linie */
#tab-dialer .sw-actions { align-items: flex-end; }
.sw-act, .sw-act:has(.small), .sw-act:has(.like) { padding-top: 0; margin-top: 0; justify-content: flex-end; }

/* Swipe-Karte: kein Bedienen-Modus mehr – Website wird über Gesten gesteuert */
#tab-dialer .sw-card .sw-shot > .live-hint { display: none !important; }
#tab-dialer .sw-card .device { cursor: default; }
#tab-dialer .sw-card .sw-shot { cursor: default; }

@media (max-width: 760px) { #tab-dialer .sw-card.device-view .sw-shot { padding: 12px 12px 10px !important; } }

/* Handy: keine Karte bei „Leads importieren“ */
@media (max-width: 760px) { #tab-import .map-col { display: none; } }

/* Direkt eingebettete Website (wie Chrome): scrollen/tippen geht direkt in der Seite */
#tab-dialer .sw-card .dev-screen > iframe.live.direct { pointer-events: auto; }
/* Direkte Website: Browser darf hoch/runter selbst scrollen (sonst blockiert die Karte die Finger-Gesten in der Seite) */
#tab-dialer .sw-card:has(iframe.live.direct) { touch-action: pan-y; }

/* ---------- Website-Entwurf (Codex) ---------- */
/* Entwurf im Handy-Rahmen: Bild in voller Breite, im Bildschirm scrollbar (Mausrad / hoch-runter wischen) */
.pf-screen.mock-scroll { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.pf-screen.mock-scroll::-webkit-scrollbar { display: none; }
.mock-scroll > .mock-img { display: block; width: 100%; height: auto; }
.phone-frame[data-mock] .mock-wait { font-size: 12px; }
.mock-wait { color: var(--muted); text-align: center; padding: 12px; }
.mock-wait > svg { width: 28px; height: 28px; color: var(--primary); }
.mock-wait b { color: var(--text); }
.mock-wait span { font-size: 12px; max-width: 90%; }
.mock-bar { position: absolute; bottom: 22px; right: 50%; transform: translateX(50%); display: flex; gap: 6px; align-items: center; z-index: 2; }
.mock-tag, .mock-btn { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px; border-radius: 999px; border: 0;
  font-family: inherit; font-size: 12px; font-weight: 600; line-height: 1; color: #fff; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); cursor: pointer; text-decoration: none; }
.mock-btn { width: 26px; padding: 0; justify-content: center; }
.mock-btn:hover { background: rgba(0,0,0,.8); }

/* ---------- Zellen: nur offene Leads; Augen-Knopf gedrückt halten → bearbeitet/gesamt ---------- */
.mx td.mc .vd { display: none; }
.mx.peek td.mc .vo { display: none; }
.mx.peek td.mc .vd { display: inline; color: var(--muted); font-weight: 600; }
.peek-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.peek-btn svg { width: 18px; height: 18px; }
.peek-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
@media (max-width: 760px) { .peek-btn span { display: none; } .peek-btn { width: 40px; height: 40px; padding: 0; justify-content: center; } .peek-btn svg { width: 20px; height: 20px; } }
/* Handy: Reihenfolge-Nummer groß und transparent direkt HINTER/auf der Zahl statt daneben – spart Breite in den schmalen Zellen */
@media (max-width: 760px) {
  .mx td.mc.dc .v { position: relative; }
  .mx td.mc.dc .v .vo, .mx td.mc.dc .v .vd { position: relative; z-index: 1; }
  .mx td.mc .qn, .mx td.mc.dc.fin .qn { position: absolute; inset: 0; left: 0; top: 0; transform: none; z-index: 0; margin: 0; padding: 0;
    display: flex; align-items: center; justify-content: center; min-width: 0; height: auto; line-height: 1;
    background: none; border-radius: 0; font-size: 24px; font-weight: 900; color: color-mix(in srgb, var(--primary) 14%, transparent); pointer-events: none; }
  /* Zahl bleibt lesbar: heller Rand um die Ziffern */
  .mx td.mc.dc.on .v .vo, .mx td.mc.dc.on .v .vd { text-shadow: 0 0 2px var(--card), 0 0 2px var(--card), 0 0 3px var(--card); }
}

/* Leads-Tab mobil: Tabelle → Karten */
@media (max-width: 760px) {
  #tab-leads > .card { padding: 12px; }
  #tab-leads .leads-bar { gap: 8px; }
  #tab-leads .leads-bar input { flex: 1 1 100%; min-width: 0; }
  #tab-leads .leads-bar select { flex: 1; width: auto; min-width: 0; }
  #tab-leads .leads-bar .btn { flex: none; }
  #tab-leads .ld-head .btn { margin-left: auto; }
  #leadsTable, #leadsTable tbody { display: block; width: 100%; }
  #leadsTable tr.ld-th { display: none; }
  #leadsTable tr.ld-grp { display: block; margin: 14px 0 6px; }
  #leadsTable tr.ld-grp td { display: block; border: 0; border-radius: 10px; padding: 8px 10px; line-height: 1.4; }
  #leadsTable tr[data-id] { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name st" "ort ort" "tel tel" "web att";
    column-gap: 10px; row-gap: 2px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
  #leadsTable tr[data-id] td { display: block; padding: 0; border: 0; background: none !important; border-radius: 0 !important; min-width: 0; overflow-wrap: anywhere; }
  #leadsTable td.c-name { grid-area: name; font-size: 14.5px; line-height: 1.3; }
  #leadsTable td.c-st { grid-area: st; align-self: start; }
  #leadsTable td.c-ort { grid-area: ort; color: var(--muted); font-size: 12.5px; }
  #leadsTable td.c-tel { grid-area: tel; font-size: 13.5px; font-variant-numeric: tabular-nums; }
  #leadsTable td.c-web { grid-area: web; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #leadsTable td.c-web.empty { visibility: hidden; }
  #leadsTable td.c-att { grid-area: att; color: var(--muted); font-size: 12px; text-align: right; white-space: nowrap; }
  #leadsTable td.c-att b { color: var(--text); font-weight: 600; }
  #leadsTable td.c-att b::after { content: " angerufen"; font-weight: 400; color: var(--muted); }
  #leadsTable td.c-att .c-last { display: inline; }
  #leadsTable td.c-att .c-last::before { content: " · "; }
  #leadsTable tr[data-id]:active { background: var(--soft); }
}

/* ---------- Termine: Kalender (vereinfacht nach 3057 Kalender) ---------- */
.cal-card { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.cal-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: 4px; }
.cal-nav .icon-btn { width: 34px; height: 34px; }
.cal-title { font-weight: 700; font-size: 16px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-views { display: flex; gap: 2px; background: var(--soft); padding: 3px; border-radius: 11px; border: 1px solid var(--line); }
.cal-views button { border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; padding: 5px 10px; border-radius: 8px; cursor: pointer; }
.cal-views button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.cal-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 10px; height: 10px; border-radius: 3px; }
.cal-legend .lg-t { background: var(--primary); } .cal-legend .lg-w { background: var(--amber); }
.cal-nodate { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cal-nodate .tag { cursor: pointer; border: 1px solid var(--line); background: var(--soft); color: var(--text); font: inherit; font-size: 12px; }

.cal-wrap { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card); }
.cal-head { display: grid; border-bottom: 1px solid var(--line2); background: var(--card2); }
.cal-dh { border: 0; background: none; font: inherit; color: var(--muted); padding: 6px 2px 7px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; position: relative; border-left: 1px solid var(--line); }
.cal-dh span { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.cal-dh b { font-size: 17px; color: var(--text); width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; }
.cal-dh.today span { color: var(--primary); }
.cal-dh.today b { background: var(--primary); color: #fff; }
.cal-dh i { position: absolute; top: 5px; right: 6px; font-style: normal; font-size: 10px; font-weight: 700; color: var(--primary); }
.cal-scroll { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; height: calc(100svh - 300px); min-height: 380px; }
.cal-grid { display: grid; position: relative; }
.cal-hours div { height: var(--hh); text-align: right; padding-right: 6px; font-size: 10.5px; color: var(--muted); position: relative; top: -7px; font-variant-numeric: tabular-nums; }
.cal-col { position: relative; border-left: 1px solid var(--line); }
.cal-col.today { background: color-mix(in srgb, var(--primary) 5%, transparent); }
.cal-slot { height: var(--hh); border-bottom: 1px solid var(--line); background-image: linear-gradient(to bottom, transparent calc(50% - .5px), color-mix(in srgb, var(--line) 55%, transparent) calc(50% - .5px), color-mix(in srgb, var(--line) 55%, transparent) calc(50% + .5px), transparent calc(50% + .5px)); }
.cal-ev { position: absolute; border-radius: 7px; padding: 3px 6px; font-size: 11.5px; line-height: 1.25; overflow: hidden; cursor: pointer; color: #fff; z-index: 2;
  box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: filter .15s; }
.cal-ev:hover { filter: brightness(1.08); z-index: 3; }
.cal-ev.termin { background: linear-gradient(160deg, var(--primary), var(--primary2)); }
.cal-ev.wvl { background: var(--amber); color: #1a1205; display: flex; align-items: center; gap: 4px; white-space: nowrap; padding: 0 6px; }
.cal-ev .t { font-weight: 700; font-variant-numeric: tabular-nums; opacity: .9; }
.cal-ev .n { font-weight: 600; }
.cal-ev.termin .t, .cal-ev.termin .n, .cal-ev.termin .p { display: block; }
.cal-ev.termin .n { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.cal-ev .p { font-size: 10.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.wvl .n { overflow: hidden; text-overflow: ellipsis; }
.cal-ev.past { opacity: .55; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: #f43f5e; z-index: 4; pointer-events: none; box-shadow: 0 0 6px rgba(244,63,94,.5); }
.cal-now::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #f43f5e; }

@media (max-width: 760px) {
  #tab-agenda .cal-card { padding: 10px; gap: 8px; }
  .cal-bar { gap: 8px; }
  .cal-title { order: 3; flex-basis: 100%; font-size: 15px; }
  .cal-views { margin-left: auto; }
  .cal-views button { padding: 5px 8px; font-size: 12.5px; }
  .cal-scroll { height: calc(100svh - 290px); min-height: 320px; }
  .cal-ev { font-size: 10.5px; padding: 2px 4px; border-radius: 5px; }
  .cal-ev.wvl { padding: 0 4px; }
  .cal-ev.wvl .t { display: none; }
  .cal-dh b { font-size: 15px; width: 26px; height: 26px; }
}

/* Anruf-Historie: wie oft + wann zuletzt */
#leadsTable td.c-att { white-space: nowrap; }
#leadsTable td.c-att .c-last { display: block; font-size: 11.5px; color: var(--muted); }
#leadsTable td.c-att[data-n="0"] b { color: var(--muted); font-weight: 400; }
.call-stat { display: flex; align-items: center; gap: 14px; margin: 10px 0 4px; padding: 10px 12px; border-radius: 12px;
  background: var(--soft); border: 1px solid var(--line); }
.call-stat.first { gap: 8px; color: var(--muted); font-size: 13px; padding: 8px 12px; }
.call-stat.first b { color: var(--text); }
.call-stat .cs-n { display: flex; flex-direction: column; align-items: center; line-height: 1.05; min-width: 44px; }
.call-stat .cs-n b { font-size: 22px; font-variant-numeric: tabular-nums; }
.call-stat .cs-n span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.call-stat .cs-last { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding-left: 14px; border-left: 1px solid var(--line2); }
.call-stat .cs-last b { font-size: 14px; }
.call-stat .cs-try { margin-left: auto; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap;
  background: color-mix(in srgb, var(--amber) 18%, transparent); color: var(--amber); }
.call-stat.retry { border-color: color-mix(in srgb, var(--amber) 35%, transparent); }
#leadsTable td.c-att .c-never { color: var(--muted); font-size: 12px; }
@media (max-width: 760px) { #leadsTable td.c-att .c-never::after { content: " angerufen"; } }

/* Lead: Interesse + hervorgehobene Kontaktfelder */
.lead-panel .lp-lbl { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 2px 0 8px; }
.lp-int { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.lp-int .btn { justify-content: center; padding: 12px 8px; }
.lp-int .btn.selected { border-color: var(--amber); color: var(--amber); background: color-mix(in srgb, var(--amber) 14%, transparent); outline: 2px solid var(--amber); }
.lead-fields { margin-bottom: 12px; padding: 12px; border-radius: 12px; border: 2px solid var(--amber);
  background: color-mix(in srgb, var(--amber) 10%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--amber) 15%, transparent); }
.lead-fields .lf { display: grid; grid-template-columns: 18px 120px 1fr; align-items: center; gap: 8px; margin-top: 8px; font-weight: 600; font-size: 14px; }
.lead-fields .lf input { width: 100%; min-width: 0; font-size: 15px; padding: 9px 10px; border: 1px solid var(--amber); }
/* Interessent als Popup */
.lp-pop { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 16px; overflow: auto; }
.lp-pop .lead-panel { position: relative; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; margin: 0;
  background: var(--card, var(--bg2, #16161f)); box-shadow: 0 24px 60px rgba(0,0,0,.5); padding: 20px; border-radius: 16px; }
.lp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.lp-head small { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--amber); }
.lp-head b { font-size: 18px; }
.lp-head .close { position: static; }
.lead-panel .req { font-style: normal; color: var(--amber); font-size: 10.5px; margin-left: 6px; }
.lead-fields .lf .req { font-size: 13px; margin-left: 2px; }
.lp-int.need .btn { border-style: dashed; }
.lead-fields .lf input.need { border-style: dashed; }
.lp-mail { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.lp-mail .btn { justify-content: center; padding: 12px; font-weight: 700; border: 2px solid var(--primary); color: var(--primary); }
.lp-mail .btn.done { border-color: var(--green, #22c55e); color: var(--green, #22c55e); }
.lp-mail-hint { font-size: 12.5px; color: var(--muted); text-align: center; }
@media (max-width: 760px) { .lead-fields .lf { grid-template-columns: 18px 1fr; } .lead-fields .lf input { grid-column: 1 / -1; } }

/* Termin-Popup */
.termin-panel .lp-head small { color: var(--green); }
.termin-panel .quick { margin-bottom: 10px; }
.termin-panel .when-row + .lead-fields { margin-top: 12px; }
.termin-panel #whenAt { width: 100%; max-width: 260px; font-size: 15px; }

/* Einstellungen-Tab */
.set-card { max-width: 620px; margin: 0 auto; }
.set-h { font-size: 20px; margin: 0 0 16px; }
.set-sec h3 { font-size: 15px; margin: 0 0 6px; }
.set-sec + .set-sec { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.set-seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line); }
.set-seg button { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 600; font-size: 14px; padding: 8px 16px; border-radius: 9px; cursor: pointer; }
.set-seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 1px var(--line); }
.set-help { margin: 0 0 12px; line-height: 1.45; }
.set-state { display: grid; grid-template-columns: 10px 1fr; column-gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line2, var(--line)); margin-bottom: 14px; }
.set-state i { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); grid-row: span 2; }
.set-state.on i { background: var(--primary); } .set-state.live i { background: var(--green, #22c55e); }
.set-state span { font-size: 12.5px; color: var(--muted); }
.set-lbl { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 6px; }
.set-row { display: flex; gap: 8px; margin-bottom: 14px; }
.set-row input { flex: 1; min-width: 0; font-size: 16px; }
.set-actions .red-text { margin-left: auto; }

/* Accounts */
.acct-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acct-card { display: flex; flex-direction: column; gap: 3px; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line2, var(--line)); background: none; color: inherit; font: inherit; cursor: pointer; }
.acct-card span { font-size: 12.5px; color: var(--muted); }
.acct-card.on { border: 2px solid var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); }
.acct-card[data-acct="test"].on { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 10%, transparent); }
.acct-reset { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
@media (max-width: 520px) { .acct-list { grid-template-columns: 1fr; } }
/* Testaccount aktiv: deutlicher Hinweis oben */
body.acct-test::before { content: "TESTACCOUNT"; position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 90;
  background: var(--amber); color: #1a1205; font-size: 11px; font-weight: 800; letter-spacing: .08em; padding: 2px 12px; border-radius: 0 0 8px 8px; pointer-events: none; }

/* Toggle Neue Leads / Wiedervorlage */
.pool-toggle { margin-left: auto; order: 2; }
.pool-toggle button { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; font-size: 13px; }
.pool-toggle button svg { width: 18px; height: 18px; }
.pool-toggle button.on[data-pool="neu"] { color: var(--primary); }
.pool-toggle button.on[data-pool="rest"] { color: var(--text); }
.pool-toggle button b { font-size: 12px; font-weight: 700; color: inherit; background: none; padding: 0; }
.pool-toggle button b.zero { display: none; }
.pool-toggle button[data-pool="wvl"].on { color: var(--amber); }
.mc.nowvl { cursor: default; opacity: .5; }
@media (max-width: 760px) { .pool-toggle { grid-column: 1 / -1; grid-row: 3; justify-self: start; margin-left: 0; } }
