/* WBkart brand layer on top of Bootstrap 5. No build step: plain CSS with custom properties. */
:root {
    --brand: #0F766E;          /* deep teal */
    --brand-dark: #115E59;
    --brand-soft: #CCFBF1;
    --accent: #F59E0B;         /* warm amber */
    --text: #0F172A;
    --bg: #F8FAFC;
    --border: #E2E8F0;
    --success: #16A34A;
    --danger: #DC2626;
    --muted: #64748B;
    --sidebar-w: 248px;

    --bs-body-color: var(--text);
    --bs-body-bg: var(--bg);
    --bs-border-color: var(--border);
    --bs-primary: var(--brand);
    --bs-primary-rgb: 15, 118, 110;
    --bs-success: var(--success);
    --bs-danger: var(--danger);
    --bs-link-color: var(--brand);
    --bs-link-color-rgb: 15, 118, 110;
    --bs-link-hover-color: var(--brand-dark);
    --bs-link-hover-color-rgb: 17, 94, 89;
    --bs-focus-ring-color: rgba(15, 118, 110, .25);
}

body { background: var(--bg); color: var(--text); }
.text-brand { color: var(--brand) !important; }
.bg-brand { background: var(--brand) !important; color: #fff; }

.btn-brand { --bs-btn-color: #fff; --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark);
    --bs-btn-active-bg: var(--brand-dark); --bs-btn-active-border-color: var(--brand-dark); --bs-btn-disabled-bg: var(--brand); }
.btn-outline-brand { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand);
    --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand-dark); }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .2rem rgba(15, 118, 110, .2); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }

/* ---- banners ---- */
.banner { padding: .4rem 1rem; text-align: center; font-size: .875rem; font-weight: 600; }
.banner-sandbox { background: var(--accent); color: #1F1300; letter-spacing: .02em; }
.banner-restricted { background: #FEE2E2; color: #7F1D1D; }
.banner-impersonate { background: var(--text); color: #fff; }

/* ---- app shell ---- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { background: var(--brand-dark); color: #E6FFFA; }
/* Bootstrap's .offcanvas-lg sets background-color: transparent !important from lg up, which left the light
   menu text on the light page (invisible menus). Keep the brand background at every width. */
.sidebar.offcanvas-lg { background-color: var(--brand-dark) !important; }
@media (min-width: 992px) {
    .sidebar { width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
}
@media (max-width: 991.98px) {
    .sidebar.offcanvas-lg { --bs-offcanvas-bg: var(--brand-dark); --bs-offcanvas-width: 270px; }
}
.sidebar-brand { display: flex; align-items: center; gap: .65rem; padding: 1.1rem 1rem; border-bottom: 1px solid rgba(255,255,255,.1); }
.brand-mark { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
    background: var(--accent); color: #1F1300; font-weight: 800; font-size: 1.1rem; flex: 0 0 36px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text small { opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.sidebar-nav { display: flex; flex-direction: column; padding: .75rem .5rem; gap: 2px; width: 100%; }
.sidebar-nav .nav-item { color: #E6FFFA; text-decoration: none; padding: .55rem .75rem; border-radius: 8px; font-weight: 500; }
.sidebar-nav .nav-item:hover { background: rgba(255,255,255,.08); }
.sidebar-nav .nav-item.active { background: rgba(255,255,255,.16); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.sidebar-nav .nav-item.disabled { opacity: .45; cursor: default; }
.sidebar-nav .nav-item.disabled:hover { background: none; }
.nav-section { text-transform: uppercase; font-size: .7rem; letter-spacing: .08em; opacity: .6; padding: .9rem .75rem .3rem; }

.main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.page-title { font-size: 1.15rem; font-weight: 600; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.content { padding: 1rem; }
@media (min-width: 768px) { .content { padding: 1.5rem; } }
.avatar { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .8rem; font-weight: 700; }
.user-menu { display: inline-flex; align-items: center; gap: .4rem; }

/* ---- cards / tables ---- */
.card { border-color: var(--border); border-radius: 12px; }
.card-header { background: #fff; border-bottom-color: var(--border); font-weight: 600; }
.stat-card .stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1.1; }
.stat-card .stat-label { color: var(--muted); font-size: .85rem; }
.table > :not(caption) > * > * { padding: .65rem .75rem; }
.table thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; border-bottom-color: var(--border); }
.table-responsive { border-radius: 12px; }
.badge-status { font-weight: 600; }
.status-trial, .status-trialing, .status-invited, .status-sandbox { background: #FEF3C7; color: #92400E; }
.status-active, .status-live, .status-ok { background: #DCFCE7; color: #166534; }
.status-pending, .status-cancelled, .status-expired, .status-disabled { background: #F1F5F9; color: #475569; }
.status-grace, .status-past_due { background: #FFEDD5; color: #9A3412; }
.status-restricted, .status-suspended, .status-failed, .status-degraded, .status-down { background: #FEE2E2; color: #991B1B; }

.meter { height: 8px; background: var(--border); border-radius: 99px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--brand); }
.meter.warn > span { background: var(--accent); }
.meter.full > span { background: var(--danger); }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.checklist li:last-child { border-bottom: 0; }
.check-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); flex: 0 0 22px; display: grid; place-items: center; font-size: .75rem; }
.check-dot.done { background: var(--success); border-color: var(--success); color: #fff; }

/* ---- auth pages ---- */
.auth-body { background: linear-gradient(160deg, #F0FDFA 0%, var(--bg) 45%, #FFFBEB 100%); min-height: 100vh; }
.auth-wrap { max-width: 460px; margin: 0 auto; padding: 2.5rem 1rem; }
.auth-brand { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem; }
.auth-brand div { display: flex; flex-direction: column; line-height: 1.2; }
.auth-brand small { color: var(--muted); }
.auth-card { box-shadow: 0 10px 30px rgba(15, 23, 42, .06); }
.auth-lang { margin-top: 1rem; max-width: 160px; }
.qr { width: 200px; height: 200px; image-rendering: pixelated; border: 1px solid var(--border); border-radius: 8px; }
.secret-key { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .08em; word-break: break-all; }
.code-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; font-family: ui-monospace, Consolas, monospace; }
.code-grid span { background: var(--bg); border: 1px dashed var(--border); border-radius: 6px; padding: .4rem; text-align: center; }

.otp-input { font-size: 1.5rem; letter-spacing: .4em; text-align: center; font-family: ui-monospace, Consolas, monospace; }

/* ---- CRM (M2) ---- */
.status-open, .status-unknown, .status-queued, .status-uploaded, .status-processing { background: #E0F2FE; color: #075985; }
.status-won, .status-opted_in, .status-done { background: #DCFCE7; color: #166534; }
.status-lost, .status-opted_out { background: #FEE2E2; color: #991B1B; }
.tag-badge { background: color-mix(in srgb, var(--tag, #0F766E) 14%, white); color: color-mix(in srgb, var(--tag, #0F766E) 85%, black);
    border: 1px solid color-mix(in srgb, var(--tag, #0F766E) 35%, white); font-weight: 600; }
.tag-remove { border: 0; background: none; padding: 0 0 0 .2rem; line-height: 1; color: inherit; opacity: .6; }
.tag-remove:hover { opacity: 1; }
button.check-dot { padding: 0; background: #fff; cursor: pointer; }
.note-body { white-space: normal; word-break: break-word; }

.timeline { position: relative; }
.timeline-item { position: relative; padding: 0 0 .9rem 1.4rem; border-left: 2px solid var(--border); margin-left: .4rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ""; position: absolute; left: -7px; top: .2rem; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; }
.tl-tag::before { background: #7C3AED; }
.tl-deal::before { background: var(--accent); }
.tl-note::before, .tl-task::before { background: #2563EB; }
.tl-opt_out::before { background: var(--danger); }

/* Kanban */
.kanban { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: .5rem; align-items: flex-start; }
.kanban-col { flex: 0 0 272px; background: #EEF2F6; border-radius: 12px; display: flex; flex-direction: column; max-height: calc(100vh - 220px); }
.kanban-col header { padding: .6rem .75rem; display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.kanban-col header strong { font-size: .9rem; }
.kanban-list { padding: 0 .5rem .5rem; overflow-y: auto; min-height: 60px; flex: 1; }
.kanban-col.drop-target { outline: 2px dashed var(--brand); outline-offset: -2px; }
.deal-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: .55rem .65rem; margin-bottom: .5rem; cursor: grab; font-size: .875rem; }
.deal-card:active { cursor: grabbing; }
.deal-card.dragging { opacity: .5; }
.deal-card .meta { color: var(--muted); font-size: .78rem; }
.deal-card.overdue .follow { color: var(--danger); font-weight: 600; }
.kanban-col.won header { color: var(--success); }
.kanban-col.lost header { color: var(--danger); }

/* Segment builder */
.rule-row { display: grid; grid-template-columns: 1.3fr 1fr 1.3fr auto; gap: .5rem; align-items: center; margin-bottom: .5rem; }
@media (max-width: 575.98px) { .rule-row { grid-template-columns: 1fr 1fr; } }

.progress-big { height: 14px; }
.map-table td, .map-table th { vertical-align: middle; }
.sample-cell { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Inbox (M3) ---- */
.content:has(> .inbox) { padding: 0; }
.inbox { display: grid; grid-template-columns: 320px 1fr; height: calc(100vh - 57px); background: #fff; }
@media (min-width: 1200px) { .inbox { grid-template-columns: 320px 1fr 260px; } }
.inbox-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.inbox-list-head { padding: .6rem; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: .5rem; }
.inbox-views { display: flex; gap: 2px; overflow-x: auto; }
.inbox-views .btn { white-space: nowrap; color: var(--muted); border: 0; }
.inbox-views .btn.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.inbox-items { overflow-y: auto; flex: 1; }
.conv-item { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--border); background: #fff; padding: .6rem .75rem; }
.conv-item:hover { background: var(--bg); }
.conv-item.active { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.conv-item.unread .conv-name { font-weight: 700; }
.conv-top { display: flex; justify-content: space-between; gap: .5rem; }
.conv-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { font-size: .75rem; color: var(--muted); white-space: nowrap; }
.conv-preview { font-size: .85rem; color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-meta { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-top: .2rem; font-size: .72rem; color: var(--muted); }
.conv-wait { color: #B45309; font-weight: 600; }
.conv-assignee { margin-left: auto; }
.conv-label { font-size: .7rem; padding: .05rem .4rem; border-radius: 99px; background: color-mix(in srgb, var(--c, #475569) 15%, white); color: color-mix(in srgb, var(--c, #475569) 85%, black); font-weight: 600; }

.inbox-thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: #EFEAE2; }
.thread-empty { flex: 1; display: grid; place-items: center; padding: 1rem; }
.thread { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.thread-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .5rem .75rem; background: #fff; border-bottom: 1px solid var(--border); }
.thread-title { min-width: 0; flex: 1; }
.thread-actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.thread-messages { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .35rem; }
.msg { max-width: min(75%, 560px); padding: .4rem .6rem; border-radius: 10px; box-shadow: 0 1px 1px rgba(0,0,0,.06); font-size: .9rem; word-break: break-word; }
.msg-in { align-self: flex-start; background: #fff; border-top-left-radius: 2px; }
.msg-out { align-self: flex-end; background: #D9FDD3; border-top-right-radius: 2px; }
.msg-note { align-self: flex-end; background: #FEF3C7; border: 1px dashed #F59E0B; }
.msg-system { align-self: center; background: rgba(255,255,255,.8); color: var(--muted); font-size: .75rem; padding: .2rem .6rem; border-radius: 99px; box-shadow: none; max-width: 90%; text-align: center; }
.msg-failed { background: #FEE2E2; }
.msg-who { font-size: .72rem; font-weight: 600; color: var(--brand-dark); margin-bottom: .1rem; }
.msg-text { white-space: pre-wrap; }
.msg-img { max-width: 100%; max-height: 280px; border-radius: 6px; display: block; }
.msg-doc { display: inline-flex; gap: .3rem; padding: .3rem .5rem; background: rgba(0,0,0,.04); border-radius: 6px; text-decoration: none; }
.msg-buttons { display: flex; flex-direction: column; gap: 2px; margin-top: .35rem; }
.msg-buttons span, .msg-buttons button { text-align: center; color: #0284C7; background: rgba(255,255,255,.7); border-radius: 6px; padding: .25rem; font-size: .85rem; border: 0; }
.msg-foot { display: flex; justify-content: flex-end; gap: .3rem; font-size: .68rem; color: var(--muted); margin-top: .1rem; }
.msg-error { font-size: .72rem; color: var(--danger); }
.tick-read { color: #0EA5E9; font-weight: 700; }
.tick-failed { color: var(--danger); }
.window-bar { font-size: .78rem; padding: .3rem .75rem; background: #F0FDFA; color: var(--brand-dark); border-top: 1px solid var(--border); }
.window-bar.closed { background: #FEF3C7; color: #92400E; }
.window-bar.warn { background: #FEE2E2; color: #991B1B; }
.composer { background: #fff; border-top: 1px solid var(--border); padding: .5rem .75rem; position: relative; }
.composer.note-mode textarea { background: #FFFBEB; border-color: #F59E0B; }
.composer-tabs { display: flex; gap: .25rem; margin-bottom: .35rem; align-items: center; }
.composer-tabs button { border: 0; background: none; font-size: .8rem; padding: .15rem .5rem; border-radius: 6px; color: var(--muted); }
.composer-tabs button.active { background: var(--bg); color: var(--text); font-weight: 600; }
.composer-actions { display: flex; align-items: center; gap: .5rem; margin-top: .35rem; min-width: 0; }
.quick-replies { position: absolute; bottom: 100%; left: .75rem; right: .75rem; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.08); max-height: 240px; overflow-y: auto; z-index: 5; }
.quick-reply { display: block; width: 100%; text-align: left; border: 0; background: none; padding: .45rem .6rem; font-size: .85rem; }
.quick-reply:hover { background: var(--bg); }
.inbox-contact { border-left: 1px solid var(--border); overflow-y: auto; }
.inbox-toast { position: fixed; bottom: 1rem; right: 1rem; z-index: 2000; max-width: 360px; }

/* Mobile: one pane at a time (list, or thread with a back button). */
@media (max-width: 991.98px) {
    .inbox { grid-template-columns: 1fr; height: calc(100vh - 57px); }
    .inbox .inbox-thread { display: none; }
    .inbox.show-thread .inbox-list { display: none; }
    .inbox.show-thread .inbox-thread { display: flex; }
    .msg { max-width: 88%; }
}

/* ---- Simulator phone ---- */
.phone { max-width: 400px; margin: 0 auto; height: min(720px, calc(100vh - 140px)); border: 10px solid #111827; border-radius: 34px; overflow: hidden; display: flex; flex-direction: column; background: #EFEAE2; box-shadow: 0 20px 40px rgba(15,23,42,.18); }
.phone-bar { background: #075E54; color: #fff; display: flex; align-items: center; gap: .6rem; padding: .6rem .75rem; }
.phone-avatar { width: 34px; height: 34px; flex: 0 0 34px; }
.min-w-0 { min-width: 0; }
.phone-chat { flex: 1; overflow-y: auto; padding: .75rem; display: flex; flex-direction: column; gap: .35rem; }
.phone-note { align-self: center; font-size: .7rem; background: #FFF7D6; color: #6B5B1E; padding: .3rem .6rem; border-radius: 8px; text-align: center; max-width: 90%; }
.phone-input { display: flex; gap: .35rem; padding: .5rem; background: #F0F2F5; align-items: center; }
.phone-input .form-control { border-radius: 99px; }
.phone-send { width: 38px; height: 38px; flex: 0 0 38px; padding: 0; }
.phone-buttons { display: flex; flex-direction: column; gap: 2px; margin-top: .4rem; border-top: 1px solid rgba(0,0,0,.06); padding-top: .3rem; }
.phone-buttons button { border: 0; background: none; color: #0284C7; font-weight: 600; padding: .3rem; }
.phone-buttons button:disabled { color: var(--muted); }
.phone-list { background: #fff; border-radius: 8px; margin-top: .35rem; border: 1px solid var(--border); }
.phone-list button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--border); background: none; padding: .45rem .6rem; }

/* ---- Templates & campaigns (M4) ---- */
.template-picker { background: #fff; border-top: 1px solid var(--border); padding: .6rem .75rem; max-height: 45vh; overflow-y: auto; }
.template-preview { white-space: pre-wrap; background: #F0FDF4; border-radius: 8px; padding: .5rem; }
.msg-template-tag { font-size: .68rem; color: var(--muted); margin-bottom: .15rem; }
.wa-preview { background: #EFEAE2; border-radius: 12px; padding: 1rem; min-height: 220px; }
.wa-bubble { background: #fff; border-radius: 8px; border-top-left-radius: 2px; padding: .5rem .6rem; max-width: 320px; box-shadow: 0 1px 1px rgba(0,0,0,.08); font-size: .9rem; }
.wa-bubble .wa-media { background: #CBD5E1; color: #475569; border-radius: 6px; height: 120px; display: grid; place-items: center; margin-bottom: .4rem; font-size: 1.6rem; }
.wa-bubble .wa-header { font-weight: 700; margin-bottom: .2rem; }
.wa-bubble .wa-body { white-space: pre-wrap; word-break: break-word; }
.wa-bubble .wa-footer { color: var(--muted); font-size: .78rem; margin-top: .25rem; }
.wa-buttons { max-width: 320px; display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.wa-buttons span { background: #fff; border-radius: 8px; text-align: center; padding: .4rem; color: #0284C7; font-weight: 600; font-size: .88rem; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.wa-var { background: #FEF3C7; border-radius: 3px; padding: 0 2px; }
.button-row { display: grid; grid-template-columns: 130px 1fr 1fr auto; gap: .4rem; margin-bottom: .4rem; }
@media (max-width: 575.98px) { .button-row { grid-template-columns: 1fr 1fr; } }
.funnel { display: flex; flex-direction: column; gap: .5rem; }
.funnel-row { display: grid; grid-template-columns: 110px 1fr 90px; gap: .5rem; align-items: center; font-size: .875rem; }
.library-card { height: 100%; }
.library-card .wa-bubble { max-width: none; font-size: .82rem; }
.status-draft { background: #F1F5F9; color: #475569; }
.status-approved, .status-completed, .status-sending { background: #DCFCE7; color: #166534; }
.status-rejected, .status-paused { background: #FEE2E2; color: #991B1B; }
.status-scheduled, .status-preparing { background: #E0F2FE; color: #075985; }
.status-replied { background: #EDE9FE; color: #5B21B6; }
.status-sent, .status-delivered, .status-read { background: #DCFCE7; color: #166534; }

/* ---- Flow editor (M5) ---- */
.content:has(> .flow-editor) { padding: 0; }
.flow-editor { display: flex; flex-direction: column; height: calc(100vh - 57px); background: #fff; }
.flow-toolbar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding: .5rem .75rem; border-bottom: 1px solid var(--border); }
.flow-name { max-width: 240px; font-weight: 600; }
.flow-errors { background: #FEF2F2; color: #991B1B; font-size: .82rem; padding: .5rem .75rem; border-bottom: 1px solid #FECACA; max-height: 120px; overflow-y: auto; }
.flow-body { flex: 1; display: grid; grid-template-columns: 180px 1fr 300px; min-height: 0; }
.flow-palette { border-right: 1px solid var(--border); overflow-y: auto; padding: .5rem; display: flex; flex-direction: column; gap: 4px; }
.fp-item { text-align: left; border: 1px solid var(--border); background: #fff; border-radius: 8px; padding: .35rem .5rem; font-size: .82rem; }
.fp-item:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); }
.fp-item.locked { opacity: .55; }
.flow-canvas { position: relative; background: #F8FAFC; background-image: radial-gradient(#CBD5E1 1px, transparent 1px); background-size: 22px 22px; overflow: hidden; }
.flow-panel { border-left: 1px solid var(--border); overflow-y: auto; }
.fp-head { display: flex; justify-content: space-between; align-items: center; padding: .6rem .75rem; border-bottom: 1px solid var(--border); }
.fp-body { padding: .75rem; }
.fp-field { display: block; margin-bottom: .6rem; font-size: .82rem; }
.fp-field > span { display: block; font-weight: 600; margin-bottom: .2rem; }
.drawflow .drawflow-node { width: 220px; border-radius: 10px; border: 1px solid var(--border); background: #fff; padding: 8px 10px; box-shadow: 0 2px 6px rgba(15,23,42,.06); }
.drawflow .drawflow-node.selected { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(15,118,110,.25); background: #fff; color: inherit; }
.drawflow .drawflow-node.start { border-color: var(--accent); background: #FFFBEB; }
.drawflow .drawflow-node .input, .drawflow .drawflow-node .output { width: 14px; height: 14px; border: 2px solid var(--brand); background: #fff; }
.drawflow .connection .main-path { stroke: var(--brand); stroke-width: 3px; }
.fn-title { font-weight: 700; font-size: .82rem; margin-bottom: 2px; }
.fn-line { font-size: .74rem; color: #475569; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 991.98px) { .flow-body { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; } .flow-palette { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); } .fp-item { white-space: nowrap; } .flow-panel { max-height: 40vh; border-left: 0; border-top: 1px solid var(--border); } }

/* ---- M6: AI reply footer in the inbox ---- */
.msg-ai { display: flex; align-items: center; flex-wrap: wrap; margin-top: .25rem; padding-top: .25rem; border-top: 1px dashed rgba(0, 0, 0, .1); font-size: .75rem; }
.msg-ai .btn-link { text-decoration: none; line-height: 1; }

/* ---- M9: feedback button, NPS card, guided tours ---- */
.feedback-fab { position: fixed; right: 18px; bottom: 18px; z-index: 1030; border-radius: 999px; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
.nps-card { position: fixed; left: 18px; bottom: 18px; z-index: 1031; width: min(360px, calc(100vw - 36px)); }
.nps-score.active { background: var(--bs-success); color: #fff; border-color: var(--bs-success); }
.tour-pop { position: absolute; z-index: 1060; width: 320px; max-width: calc(100vw - 16px); }
.tour-target { position: relative; z-index: 1050; outline: 3px solid #0F766E; outline-offset: 3px; border-radius: 6px; }
.readiness-ring { width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.4rem; }
.help-body h3, .help-body h4 { margin-top: 1.2rem; font-size: 1.1rem; }
.help-body code { background: rgba(0, 0, 0, .06); padding: 0 .25rem; border-radius: 3px; }
.roadmap-vote { min-width: 64px; }

/* M11: WhatsApp Form inside the simulator phone */
.phone-form { position: absolute; inset: 0; background: var(--bs-body-bg); z-index: 5; display: flex; flex-direction: column; padding: .75rem; gap: .5rem; overflow-y: auto; }
.phone-form-head { display: flex; align-items: center; gap: .25rem; border-bottom: 1px solid var(--bs-border-color); padding-bottom: .25rem; }
.phone-form-body { flex: 1; }
.phone { position: relative; }

/* ---- Commerce (M12) ---- */
.phone-product { display: flex; gap: .5rem; align-items: center; padding: .35rem 0; border-top: 1px solid var(--bs-border-color); }
.phone-product img, .phone-product-img { width: 44px; height: 44px; border-radius: .375rem; object-fit: cover; background: #F1F5F9; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.msg-products { display: flex; flex-direction: column; gap: .25rem; }
.msg-products .msg-product { display: flex; gap: .5rem; align-items: center; font-size: .85rem; }
.msg-products img { width: 36px; height: 36px; border-radius: .25rem; object-fit: cover; }
.badge.order-pending { background: #FEF3C7; color: #92400E; }
.badge.order-confirmed, .badge.order-packed { background: #CCFBF1; color: #115E59; }
.badge.order-shipped { background: #DBEAFE; color: #1E40AF; }
.badge.order-delivered { background: #DCFCE7; color: #166534; }
.badge.order-cancelled, .badge.order-returned { background: #FEE2E2; color: #991B1B; }

/* ---- Instagram sandbox (M13) ---- */
.ig-post-img { height: 140px; border-radius: .5rem; background: linear-gradient(135deg, #FDE68A, #F9A8D4, #A5B4FC); display: flex; align-items: center; justify-content: center; font-size: 2.5rem; }
.ig-dm-thread { height: 420px; overflow-y: auto; display: flex; flex-direction: column; gap: .35rem; background: var(--bs-body-bg); }
.ig-dm-thread .msg { max-width: 80%; }
.ig-dm-thread .msg-out { align-self: flex-end; }

/* ---- Voice calls (M14) ---- */
.call-bar { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 1080; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap;
    background: #0F766E; color: #fff; padding: .5rem .85rem; border-radius: 999px; box-shadow: 0 6px 20px rgba(15, 23, 42, .25); max-width: calc(100vw - 2rem); }
.phone-call { background: #134E4A; color: #fff; padding: .6rem .75rem; text-align: center; }
.phone-call .small { opacity: .9; }
.receptionist-log { height: 360px; overflow-y: auto; display: flex; flex-direction: column; gap: .4rem; }
.receptionist-log .turn-caller { align-self: flex-end; background: #DCFCE7; border-radius: .75rem; padding: .35rem .6rem; max-width: 80%; }
.receptionist-log .turn-assistant { align-self: flex-start; background: #F1F5F9; border-radius: .75rem; padding: .35rem .6rem; max-width: 80%; }

/* ---- Analytics trend charts (M15) ---- */
.trend-plot { position: relative; }
.trend-grid { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.trend-line { fill: none; stroke: var(--brand); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.trend-area { fill: var(--brand); opacity: .08; }
.trend-hit { fill: transparent; cursor: crosshair; }
.trend-dot { fill: var(--brand); stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.trend-cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.trend-tip { position: absolute; top: 0; background: var(--text); color: #fff; font-size: .75rem; padding: .2rem .45rem; border-radius: .25rem; pointer-events: none; white-space: nowrap; }
.brand-logo { border-radius: .5rem; object-fit: contain; background: #fff; }
.brand-icon { flex: none; display: block; }

/* ---- public landing page ("/" for guests) ---- */
.landing-body { background: #fff; }
.lp-header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.lp-nav { display: flex; align-items: center; gap: 1.5rem; min-height: 64px; }
.lp-logo { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; }
.lp-logo small { display: block; color: var(--muted); font-size: .8rem; }
.lp-links { display: flex; gap: 1.5rem; list-style: none; margin: 0 auto; padding: 0; }
.lp-links a { color: var(--muted); text-decoration: none; font-weight: 500; }
.lp-links a:hover { color: var(--brand); }
.lp-actions { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.lp-login { color: var(--text); text-decoration: none; font-weight: 500; }
@media (max-width: 767.98px) {
    .lp-links { display: none; }
    .lp-nav { gap: .5rem; }
    .lp-actions .btn { padding: .35rem .7rem; font-size: .9rem; }
}

.lp-hero { background: linear-gradient(160deg, #F0FDFA 0%, #fff 50%, #FFFBEB 100%); padding: 4.5rem 0 4rem; }
.lp-hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3.5rem; align-items: center; }
@media (max-width: 991.98px) { .lp-hero-grid { grid-template-columns: 1fr; gap: 2.5rem; } .lp-hero { padding: 3rem 0; } }
.lp-eyebrow { display: inline-block; background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; font-size: .8rem;
    letter-spacing: .03em; padding: .3rem .75rem; border-radius: 999px; margin-bottom: 1.1rem; }
.lp-h1 { font-size: clamp(2rem, 4.2vw, 3.25rem); font-weight: 800; line-height: 1.08; letter-spacing: -.02em; margin-bottom: 1.1rem; text-wrap: balance; }
.lp-lead { font-size: 1.15rem; color: #334155; max-width: 36rem; margin-bottom: 1.75rem; }
.lp-cta-row { display: flex; flex-wrap: wrap; gap: .75rem; }
.lp-center { justify-content: center; }
.lp-note { color: var(--muted); font-size: .9rem; margin: 1rem 0 0; }

.lp-phone { max-width: 360px; width: 100%; justify-self: center; background: #fff; border: 1px solid var(--border); border-radius: 28px;
    box-shadow: 0 30px 60px -20px rgba(15, 23, 42, .25); overflow: hidden; }
.lp-phone-head { display: flex; align-items: center; gap: .65rem; padding: .85rem 1rem; background: var(--brand-dark); color: #fff; }
.lp-phone-head .brand-mark { background: #fff; color: var(--brand-dark); }
.lp-phone-head small { display: flex; align-items: center; gap: .35rem; opacity: .85; font-size: .78rem; }
.lp-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ADE80; }
.lp-chat { display: flex; flex-direction: column; gap: .55rem; padding: 1.1rem .9rem 1.4rem; background: #F1F5F4; min-height: 300px; }
.lp-msg { max-width: 82%; margin: 0; padding: .5rem .7rem 1.1rem; border-radius: 14px; font-size: .9rem; line-height: 1.4; position: relative; }
.lp-msg time { position: absolute; right: .6rem; bottom: .25rem; font-size: .68rem; color: var(--muted); }
.lp-in { align-self: flex-start; background: #fff; border-top-left-radius: 4px; }
.lp-out { align-self: flex-end; background: #D9F6EE; border-top-right-radius: 4px; }
.lp-pay { display: block; margin-top: .5rem; text-align: center; background: var(--brand); color: #fff; border-radius: 8px; padding: .35rem; font-weight: 600; }

.lp-strip { margin: 0; padding: 1rem; text-align: center; color: var(--muted); font-size: .9rem; border-bottom: 1px solid var(--border); }

.lp-section { padding: 5rem 0; }
.lp-alt { background: var(--bg); }
.lp-h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 800; letter-spacing: -.015em; text-align: center; margin-bottom: .6rem; text-wrap: balance; }
.lp-sub { color: var(--muted); text-align: center; max-width: 40rem; margin: 0 auto 3rem; }
.lp-small { font-size: .9rem; margin: 2rem auto 0; }

.lp-features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
@media (max-width: 991.98px) { .lp-features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 575.98px) { .lp-features { grid-template-columns: 1fr; } }
.lp-feature { border: 1px solid var(--border); border-radius: 16px; padding: 1.4rem; transition: border-color .15s, box-shadow .15s; }
.lp-feature:hover { border-color: #99E0D5; box-shadow: 0 10px 25px -12px rgba(15, 118, 110, .35); }
.lp-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-dark); margin-bottom: 1rem; }
.lp-feature h3, .lp-steps h3, .lp-plan h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: .4rem; }
.lp-feature p, .lp-steps p { color: var(--muted); font-size: .93rem; margin: 0; }

.lp-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; list-style: none; padding: 0; margin: 3rem 0 0; counter-reset: none; }
@media (max-width: 767.98px) { .lp-steps { grid-template-columns: 1fr; } }
.lp-step-n { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; margin-bottom: 1rem; }

.lp-plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; max-width: 980px; margin: 0 auto; align-items: stretch; }
@media (max-width: 767.98px) { .lp-plans { grid-template-columns: 1fr; max-width: 420px; } }
.lp-plan { position: relative; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 18px; padding: 1.75rem; background: #fff; }
.lp-plan ul { list-style: none; padding: 0; margin: 0 0 1.5rem; flex: 1; }
.lp-plan li { display: flex; gap: .5rem; align-items: flex-start; padding: .3rem 0; font-size: .95rem; }
.lp-plan li svg { flex: none; color: var(--brand); margin-top: .15rem; }
.lp-plan-popular { border: 2px solid var(--brand); box-shadow: 0 20px 40px -20px rgba(15, 118, 110, .45); }
.lp-badge { position: absolute; top: -.8rem; left: 50%; transform: translateX(-50%); background: var(--accent); color: #1F1300; font-size: .75rem;
    font-weight: 700; padding: .25rem .75rem; border-radius: 999px; white-space: nowrap; }
.lp-price { font-size: 2.1rem; font-weight: 800; margin-bottom: 1.25rem; letter-spacing: -.02em; }
.lp-price small { font-size: .95rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }

.lp-cta { background: var(--brand-dark); color: #fff; text-align: center; padding: 4.5rem 0; }
.lp-cta h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 800; margin-bottom: .6rem; }
.lp-cta p { opacity: .85; margin-bottom: 1.75rem; }
.lp-cta .btn-light { color: var(--brand-dark); font-weight: 600; }

.lp-footer { padding: 2.5rem 0 2rem; border-top: 1px solid var(--border); }
.lp-footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.25rem; }
.lp-footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; }
.lp-footer-links a { color: var(--muted); text-decoration: none; font-size: .9rem; }
.lp-footer-links a:hover { color: var(--brand); }
.lp-copy { width: 100%; color: var(--muted); font-size: .82rem; margin: .5rem 0 0; }

/* ---- legal pages (/privacy, /terms) ---- */
.lp-legal { max-width: 760px; margin: 0 auto; padding: 3.5rem 1rem 4rem; }
.lp-legal h1 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); font-weight: 800; letter-spacing: -.015em; margin-bottom: .35rem; }
.lp-legal .lp-updated { color: var(--muted); font-size: .9rem; margin-bottom: 2rem; }
.lp-legal h2 { font-size: 1.2rem; font-weight: 700; margin: 2.2rem 0 .7rem; scroll-margin-top: 80px; }
.lp-legal p, .lp-legal li { color: #334155; line-height: 1.7; }
.lp-legal ul { padding-left: 1.25rem; }
.lp-legal .lp-callout { background: var(--brand-soft); border-radius: 12px; padding: 1rem 1.25rem; color: var(--brand-dark); }
