:root {
  --bg: #f6f8f7;
  --panel: #ffffff;
  --ink: #1c2420;
  --muted: #6b7a73;
  --line: #e3e9e6;
  --accent: #2f7d4f;
  --accent-soft: #e7f3ec;
  --warn: #b3261e;
  --radius: 12px;
}
:root { color-scheme: light; }
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 14px; }
.error { color: var(--warn); min-height: 20px; margin-top: 8px; }
button { background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px; font-size: 14px; cursor: pointer; }
button:hover { filter: brightness(1.08); }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font: inherit; background: var(--panel); color: var(--ink); }
textarea { resize: vertical; }
h2 { margin: 0 0 6px; } h3 { margin: 18px 0 6px; font-size: 15px; }

.login { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; width: 320px; text-align: center; }
.login-card h1 { margin: 0; }
.login-card input { margin: 16px 0 10px; }

.app { display: flex; flex-direction: column; min-height: 100vh; }
nav { display: flex; align-items: center; gap: 6px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--line); flex-wrap: wrap; position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; margin-right: 12px; }
.navbtn { background: transparent; color: var(--ink); }
.navbtn.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.spacer { flex: 1; }
.conn { font-size: 12px; color: var(--muted); }
.badge { background: var(--warn); color: #fff; border-radius: 10px; padding: 1px 7px; font-size: 11px; }

main { flex: 1; padding: 16px; max-width: 1280px; width: 100%; margin: 0 auto; }

.inbox { display: grid; grid-template-columns: 290px 1fr 260px; gap: 12px; height: calc(100vh - 100px); }
.contact-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow-y: auto; }
.contact-item { padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.contact-item:hover { background: var(--accent-soft); }
.contact-item.active { background: var(--accent-soft); border-left: 3px solid var(--accent); }
.contact-item .cname { font-weight: 600; font-size: 14px; display: flex; justify-content: space-between; gap: 6px; }
.contact-item .clast { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip { font-size: 10px; border-radius: 8px; padding: 1px 6px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.chip.off { background: #f3e8e8; color: var(--warn); }

.chat { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.chat-head { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 75%; padding: 8px 12px; border-radius: 14px; font-size: 14px; white-space: pre-wrap; }
.bubble.in { align-self: flex-start; background: var(--bg); border: 1px solid var(--line); }
.bubble.out { align-self: flex-end; background: var(--accent); color: #fff; }
.bubble.out.human { background: #2e5d8f; }
.bubble .who { display: block; font-size: 10px; opacity: .75; margin-top: 4px; }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-input textarea { flex: 1; }

.contact-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; overflow-y: auto; font-size: 14px; }
.contact-panel label { display: block; margin: 10px 0 4px; color: var(--muted); font-size: 12px; }
.fu-quick { display: flex; gap: 6px; margin-top: 6px; }
.fu-quick button { padding: 4px 10px; font-size: 12px; }
.task a { text-decoration: none; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; margin: 8px 0; }
.switch { appearance: none; width: 42px; height: 24px; background: #ccc; border-radius: 12px; position: relative; cursor: pointer; transition: .2s; }
.switch:checked { background: var(--accent); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: .2s; }
.switch:checked::after { left: 21px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 14px 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card .num { font-size: 28px; font-weight: 700; color: var(--accent); }
.card .lbl { color: var(--muted); font-size: 13px; }

table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }

.task { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; display: flex; gap: 12px; align-items: flex-start; }
.task.done { opacity: .5; }
.task .t-title { font-weight: 600; }
.task .t-sum { color: var(--muted); font-size: 13px; margin-top: 2px; }

.welcome-row { display: flex; gap: 8px; max-width: 560px; margin: 12px 0; }
.welcome-out { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; max-width: 560px; }
.welcome-out div { white-space: pre-wrap; margin-bottom: 10px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.filterbar { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.fbtn { background: var(--panel); color: var(--ink); border: 1px solid var(--line); font-size: 13px; }
.fbtn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

button.secondary { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.kw-row { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.kw-grid { display: grid; grid-template-columns: 140px 1fr 1fr 150px; gap: 12px; align-items: start; }
.kw-grid label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.kw-side { display: flex; flex-direction: column; gap: 10px; }
@media (max-width: 900px) { .kw-grid { grid-template-columns: 1fr; } }

.insight { background: #1f2a24; color: #f1efe6; border-radius: var(--radius); padding: 18px 20px; margin: 14px 0; white-space: pre-wrap; line-height: 1.5; }
.wd-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.wd-row .wd-tag { width: 34px; font-weight: 600; font-size: 13px; }
.wd-row .wd-bar { flex: 1; height: 20px; background: var(--bg); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.wd-row .wd-bar div { height: 100%; background: var(--accent); }
.wd-row.schwach .wd-bar div { background: #c9b458; }
.wd-row .wd-val { width: 120px; font-size: 12px; color: var(--muted); }
.top-post { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; }
.top-post .tp-head { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.top-post .tp-rank { font-weight: 700; color: var(--accent); font-size: 16px; }

.sale-form { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }

.outreach-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; max-width: 560px; margin-bottom: 20px; display: flex; align-items: center; gap: 16px; }
.outreach-bar { flex: 1; height: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.outreach-bar div { height: 100%; background: var(--accent); width: 0; transition: width .3s; }
.outreach-box button { white-space: nowrap; }

.comments-grid { display: grid; grid-template-columns: 340px 1fr; gap: 24px; }
.comments-grid select, .comments-grid textarea, .comments-grid input { margin-bottom: 8px; }
.profile-item { display: flex; justify-content: space-between; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; font-size: 14px; gap: 8px; }
.profile-item .pnote { color: var(--muted); font-size: 12px; }
.profile-item button { background: transparent; color: var(--warn); padding: 2px 6px; }
.draft-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 8px; }
.draft-box div { white-space: pre-wrap; margin-bottom: 10px; }
@media (max-width: 900px) { .comments-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .inbox { grid-template-columns: 1fr; height: auto; }
  .contact-panel { order: 3; }
  .grid2 { grid-template-columns: 1fr; }
}

.bubble audio { display: block; margin-top: 6px; max-width: 260px; height: 36px; }
#pitchAudioBox audio { vertical-align: middle; height: 36px; }

.row { display: flex; gap: 8px; align-items: center; }
#calStatus select { margin-left: 6px; }

.bubble a { color: inherit; text-decoration: underline; word-break: break-all; }

.btn-action { display: inline-block; margin: 6px 0 2px; padding: 6px 12px; border-radius: 8px; background: #25D366; color: #fff; text-decoration: none; font-weight: 600; font-size: 14px; }
.task input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 3px; padding: 0; }
.task > div { flex: 1; min-width: 0; }
.task .t-sum { overflow-wrap: anywhere; }
.task .btn-action { display: inline-block; width: auto; }
input[type="checkbox"], input[type="radio"] { width: auto; }

/* Follower Outreach */
.or-seg { display: flex; gap: 4px; background: var(--line); padding: 4px; border-radius: 10px; width: max-content; max-width: 100%; flex-wrap: wrap; margin-bottom: 12px; }
.or-seg button { background: transparent; color: var(--muted); border: 0; font-weight: 600; }
.or-seg button.active { background: var(--panel); color: var(--ink); }
.or-prog { margin-bottom: 10px; }
.or-prog-top { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.or-prog-top b { font-size: 1.2rem; }
#orFill { height: 100%; background: var(--accent, #2f6b45); width: 0; border-radius: inherit; transition: width .3s; }
.or-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.or-controls select { width: auto; }
.or-toggle { display: flex; align-items: center; gap: 6px; color: var(--muted); cursor: pointer; }
.or-how { margin: 10px 0; }
.or-dayhead { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 6px; }
.or-dayhead h3 { margin: 0; }
.or-dayhead span { color: var(--muted); }
.or-list { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.or-row { display: grid; grid-template-columns: auto 3rem 1fr auto; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); }
.or-row:first-child { border-top: 0; }
.or-row input[type="checkbox"] { width: 24px; height: 24px; margin: 0; cursor: pointer; }
.or-row.is-done { opacity: .55; }
.or-row.is-done .or-name { text-decoration: line-through; }
.or-row.is-opened:not(.is-done) { box-shadow: inset 3px 0 0 #2f6b45; }
.or-nr { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.or-who { min-width: 0; }
.or-name { font-weight: 700; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.or-name:hover { text-decoration: underline; }
.or-meta { color: var(--muted); font-size: .85rem; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.or-open { white-space: nowrap; padding: 6px 10px; border-radius: 8px; background: #e3efe6; color: #2f6b45; font-weight: 700; text-decoration: none; }
.or-open.copied { background: #2f6b45; color: #fff; }
.or-empty { padding: 24px; text-align: center; }
@media (max-width: 600px) { .or-row { grid-template-columns: auto 1fr auto; } .or-nr { display: none; } }
@media (max-width: 700px) {
  nav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  nav .navbtn { flex: 0 0 auto; }
  .outreach-box { flex-wrap: wrap; }
}

.or-daydone { margin-left: 8px; padding: 4px 10px; font-size: .85rem; }

/* Kommentar-Freigabe */
.cd-mode { display: flex; gap: 18px; flex-wrap: wrap; margin: 6px 0 4px; }
.cd-mode label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.cd-mode input { width: auto; }
.cd-item { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.cd-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.cd-comment { background: var(--bg, #f5f6f4); border-radius: 8px; padding: 8px 10px; margin: 6px 0 8px; }
.cd-dm { display: flex; gap: 6px; align-items: center; margin: 6px 0; color: var(--muted); font-size: .9rem; }
.cd-dm input { width: auto; }
.cd-actions { display: flex; gap: 8px; }
.cd-replyrow { display: flex; gap: 6px; align-items: flex-start; }
.cd-at { color: #2b5fae; font-weight: 600; padding-top: 9px; white-space: nowrap; }

/* INFO-Angebote */
.offer-row { display: grid; grid-template-columns: 1.2fr 2fr 2fr 1fr 0.8fr auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.of-actions { display: flex; gap: 4px; }
.of-note { grid-column: 1 / -1; font-size: .8rem; margin-top: -2px; }
.offer-preview { white-space: pre-wrap; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-family: inherit; max-width: 520px; }
.info-post { display: grid; grid-template-columns: 1fr 260px; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.info-post .muted { grid-column: 1 / -1; font-size: .8rem; }
.info-cap { font-size: .9rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (max-width: 800px) { .offer-row, .info-post { grid-template-columns: 1fr; } }

/* Dashboard: Termine, Ziele, Funnel */
.dash-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; margin-bottom: 8px; }
.tm-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 6px; }
.tm-when { font-weight: 700; font-variant-numeric: tabular-nums; }
.tm-art { cursor: pointer; border: 0; margin-left: 6px; }
.tm-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tm-actions button { padding: 5px 10px; font-size: .85rem; }
.tm-btn { padding: 5px 10px; border-radius: 8px; background: #e3ebf7; color: #2b5fae; text-decoration: none; font-weight: 600; font-size: .85rem; }
.tm-btn.wa { background: #25D366; color: #fff; }
#termineOffen h4 { margin: 14px 0 6px; color: #b4462a; }
.zl { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.zl-top { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.zl-bar, .fn-bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.zl-bar div, .fn-bar div { height: 100%; background: #2f6b45; border-radius: 4px; }
.fu-seg { display: inline-flex; gap: 4px; margin-left: 10px; vertical-align: middle; }
.fu-seg button { padding: 3px 10px; font-size: .8rem; background: var(--panel); color: var(--muted); border: 1px solid var(--line); }
.fu-seg button.active { background: #2f6b45; color: #fff; border-color: #2f6b45; }
.engpass { background: #fff4e5; border: 1px solid #f0c98a; border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; }
.engpass.ok { background: #eef6f0; border-color: #b9d8c2; }
.funnel-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; margin-bottom: 16px; }
.fn-row { display: grid; grid-template-columns: 170px 1fr 50px; gap: 10px; align-items: center; margin-bottom: 6px; }
.fn-row b { text-align: right; font-variant-numeric: tabular-nums; }
.fn-q { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 6px; }
.fn-q .muted { grid-column: 1 / -1; font-size: .8rem; }
.fn-q.fn-low b { color: #b4462a; }
.fn-q.fn-ok b { color: #2f6b45; }
@media (max-width: 900px) { .dash-grid, .funnel-grid { grid-template-columns: 1fr; } .tm-row { grid-template-columns: 1fr; } .tm-actions { justify-content: flex-start; } }

/* Raten, Einwände, Inkonsistenzen */
.sale-raten { display: flex; gap: 10px; flex-wrap: wrap; }
.sale-raten label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin: 0; }
.sale-raten input { width: auto; max-width: 150px; margin: 0; }
.rt-row { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rt-row.ueber { border-color: var(--warn); }
.rt-row .rt-main { flex: 1; min-width: 200px; }
.rt-row .rt-name { font-weight: 600; }
.rt-row .rt-sub { color: var(--muted); font-size: 13px; }
.rt-row .rt-bar { height: 6px; background: var(--line); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.rt-row .rt-bar div { height: 100%; background: var(--accent); }
.rt-row button { padding: 6px 10px; font-size: 13px; }
.rt-edit { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; width: 100%; font-size: 13px; }
.rt-edit input { width: 90px; margin: 0; }
.rt-edit input[type="month"] { width: 150px; }
.ink-row { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; }
.ink-row .ink-btns { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ink-row .ink-btns button { padding: 5px 10px; font-size: 13px; }
.ew-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 8px; align-items: center; margin-bottom: 6px; font-size: 14px; }
.ew-bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.ew-bar div { height: 100%; background: var(--accent); }
.stage-chip { font-size: 11px; padding: 1px 6px; border-radius: 8px; background: var(--line); }

/* Instagram verbinden */
.ig-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.ig-box .copy { display: flex; gap: 8px; align-items: center; margin: 4px 0 10px; }
.ig-box code { background: var(--accent-soft); padding: 6px 8px; border-radius: 6px; flex: 1; word-break: break-all; font-size: 13px; }
.ig-box .live { font-weight: 700; }
/* Pilzwanderungen */
.wd-ev { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; }
.wd-ev summary { cursor: pointer; padding: 10px 12px; display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; list-style: none; }
.wd-ev summary::-webkit-details-marker { display: none; }
.wd-d { font-weight: 600; min-width: 150px; }
.wd-n { flex: 1; min-width: 160px; }
.wd-k { color: var(--muted); font-size: 14px; }
.wd-g { margin: 0 12px 12px; width: calc(100% - 24px); font-size: 14px; }

.nh-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 14px 0; }
.nh-box summary { cursor: pointer; }
.nh-t { font-size: 13px; margin-top: 10px; }
.nh-t tr.muted td { color: var(--muted); }

.cd-post { display: flex; gap: 10px; align-items: center; background: var(--accent-soft); border-radius: 8px; padding: 6px; margin: 6px 0; text-decoration: none; color: inherit; font-size: 13px; }
.cd-post img { width: 48px; height: 60px; object-fit: cover; border-radius: 6px; flex: 0 0 auto; }
.cd-post span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
