:root {
    --ink: #0f172a;
    --ink-2: #475569;
    --ink-3: #94a3b8;
    --line: #e2e8f0;
    --bg: #f6f7f9;
    --card: #ffffff;
    --brand: #0f766e;
    --brand-ink: #0b4f4a;
    --brand-soft: #e6f4f2;
    --side: #0c1f1e;
    --side-2: #123331;
    --hot: #dc2626;
    --warm: #d97706;
    --cold: #64748b;
    --ok: #15803d;
    --radius: 10px;
}

html, body { background: var(--bg); color: var(--ink); font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 14px; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-ink); text-decoration: underline; }
h1, .h1 { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
h2, .h2 { font-size: 1rem; font-weight: 600; margin: 0 0 .75rem; }
.text-muted, .muted { color: var(--ink-2) !important; }
.small-muted { color: var(--ink-3); font-size: .8rem; }
.btn { border-radius: 8px; font-weight: 500; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover, .btn-primary:focus { background: var(--brand-ink); border-color: var(--brand-ink); }
.btn-outline-primary { color: var(--brand); border-color: var(--brand); }
.btn-outline-primary:hover { background: var(--brand); border-color: var(--brand); }
.form-control, .form-select { border-radius: 8px; border-color: #cbd5e1; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 118, 110, .15); }
.form-label { font-weight: 500; font-size: .85rem; color: var(--ink-2); margin-bottom: .25rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side { width: 232px; flex: 0 0 232px; background: var(--side); color: #cbd5e1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { display: flex; align-items: center; gap: .6rem; padding: 1.1rem 1.1rem .9rem; color: #fff; font-weight: 700; font-size: 1.05rem; }
.side .brand img { width: 28px; height: 28px; }
.side .brand small { display: block; font-weight: 500; font-size: .72rem; color: #5eead4; letter-spacing: .02em; }
.side nav { padding: .25rem .6rem 1rem; }
.side .group { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #64807d; padding: .9rem .6rem .35rem; }
.side a.nav-link { display: flex; align-items: center; gap: .6rem; color: #cbd5e1; padding: .45rem .6rem; border-radius: 8px; font-weight: 500; }
.side a.nav-link i { font-size: 1rem; width: 1.1rem; text-align: center; opacity: .85; }
.side a.nav-link:hover { background: var(--side-2); color: #fff; text-decoration: none; }
.side a.nav-link.active { background: var(--brand); color: #fff; }
.side .count { margin-left: auto; background: #dc2626; color: #fff; border-radius: 999px; font-size: .7rem; padding: 0 .45rem; font-weight: 600; }
.side .foot { margin-top: auto; padding: .9rem 1.1rem; border-top: 1px solid var(--side-2); font-size: .8rem; }
.side .foot .who { color: #fff; font-weight: 600; }
.side .foot button { background: none; border: 0; color: #94a3b8; padding: 0; font-size: .8rem; }
.side .foot button:hover { color: #fff; }

.main { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 1rem; padding: .7rem 1.5rem; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar .ws { font-weight: 600; }
.topbar .ws small { color: var(--ink-3); font-weight: 500; margin-left: .35rem; }
.topbar .search { max-width: 360px; }
.page { padding: 1.4rem 1.5rem 3rem; max-width: 1400px; }
.page-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.page-head .sub { color: var(--ink-2); font-size: .85rem; margin-top: .15rem; }
.page-head .actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.menu-btn { display: none; }

/* ---------- cards & tables ---------- */
.card-x { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.card-x + .card-x { margin-top: 1rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1rem; }
.kpi .v { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em; }
.kpi .l { color: var(--ink-2); font-size: .8rem; }
.kpi.alert-k .v { color: var(--hot); }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tbl th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); font-weight: 600; background: #f8fafc; padding: .55rem .75rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover td { background: #f8fafc; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-wrap { overflow-x: auto; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .9rem; align-items: center; }
.filters .form-control, .filters .form-select { width: auto; min-width: 150px; }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: #f1f5f9; color: var(--ink-2); white-space: nowrap; }
.pill.hot { background: #fee2e2; color: #b91c1c; }
.pill.warm { background: #fef3c7; color: #b45309; }
.pill.cold { background: #f1f5f9; color: #475569; }
.pill.ok { background: #dcfce7; color: #166534; }
.pill.bad { background: #fee2e2; color: #b91c1c; }
.pill.info { background: var(--brand-soft); color: var(--brand-ink); }
.score { display: inline-flex; align-items: center; justify-content: center; width: 2.1rem; height: 1.5rem; border-radius: 6px; font-weight: 700; font-size: .8rem; }
.score.hot { background: #fee2e2; color: #b91c1c; }
.score.warm { background: #fef3c7; color: #b45309; }
.score.cold { background: #f1f5f9; color: #475569; }

/* ---------- detail pages ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; align-items: start; }
.facts { display: grid; grid-template-columns: 130px 1fr; gap: .35rem .75rem; font-size: .9rem; }
.facts dt { color: var(--ink-2); font-weight: 500; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.reasons { list-style: none; padding: 0; margin: .5rem 0 0; }
.reasons li { padding: .2rem 0; color: var(--ink-2); font-size: .85rem; }
.reasons li::before { content: "•"; color: var(--brand); margin-right: .45rem; }

/* timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.timeline .ico { flex: 0 0 32px; height: 32px; border-radius: 8px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; color: var(--ink-2); }
.timeline .ico.due { background: #fef3c7; color: #b45309; }
.timeline .ico.late { background: #fee2e2; color: #b91c1c; }
.timeline .body { flex: 1; min-width: 0; }
.timeline .t { font-weight: 600; }
.timeline .m { color: var(--ink-3); font-size: .78rem; }
.timeline .txt { white-space: pre-wrap; color: var(--ink-2); font-size: .88rem; margin-top: .2rem; }

/* stage path */
.stagepath { display: flex; gap: 4px; margin: .25rem 0 1rem; flex-wrap: wrap; }
.stagepath button { flex: 1 1 0; min-width: 110px; border: 0; background: #eef2f6; color: var(--ink-2); padding: .5rem .6rem; font-size: .8rem; font-weight: 600; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); }
.stagepath button:first-child { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); border-radius: 6px 0 0 6px; }
.stagepath button.done { background: #ccebe7; color: var(--brand-ink); }
.stagepath button.current { background: var(--brand); color: #fff; }
.stagepath button:disabled { cursor: default; }

/* board */
.board { display: flex; gap: .75rem; overflow-x: auto; padding-bottom: 1rem; align-items: flex-start; }
.col { flex: 0 0 260px; background: #eef2f6; border-radius: var(--radius); padding: .6rem; min-height: 120px; }
.col.drop { outline: 2px dashed var(--brand); background: var(--brand-soft); }
.col .ch { display: flex; justify-content: space-between; align-items: baseline; padding: .15rem .25rem .55rem; }
.col .ch b { font-size: .85rem; }
.col .ch span { color: var(--ink-2); font-size: .75rem; }
.col.won { background: #e7f6ec; }
.col.lost { background: #f6eaea; }
.dcard { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .7rem; margin-bottom: .5rem; cursor: grab; box-shadow: 0 1px 1px rgba(15, 23, 42, .03); }
.dcard:hover { border-color: #94a3b8; }
.dcard .t { font-weight: 600; font-size: .85rem; line-height: 1.25; }
.dcard .a { color: var(--ink-2); font-size: .78rem; margin-top: .15rem; }
.dcard .f { display: flex; justify-content: space-between; align-items: center; margin-top: .45rem; font-size: .78rem; }
.dcard.stalled { border-left: 3px solid var(--warm); }

/* today */
.today { list-style: none; padding: 0; margin: 0; }
.today li { display: flex; align-items: center; gap: .75rem; padding: .65rem .2rem; border-bottom: 1px solid var(--line); }
.today li:last-child { border-bottom: 0; }
.today .k { flex: 0 0 120px; }
.today .x { flex: 1; min-width: 0; }
.today .x .d { color: var(--ink-3); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* bars */
.bars .row-b { display: grid; grid-template-columns: 140px 1fr 70px; gap: .6rem; align-items: center; padding: .25rem 0; font-size: .85rem; }
.bars .track { background: #eef2f6; border-radius: 4px; height: 10px; }
.bars .fill { background: var(--brand); height: 10px; border-radius: 4px; }

/* public pages */
.pub { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 3rem 1rem; background: linear-gradient(180deg, #e6f4f2 0, var(--bg) 320px); }
.pub.embed { padding: 0; background: #fff; min-height: 0; }
.pub-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 2rem; width: 100%; max-width: 520px; box-shadow: 0 10px 30px rgba(15, 23, 42, .06); }
.pub.embed .pub-card { border: 0; box-shadow: none; max-width: none; padding: 1rem; }
.pub-logo { display: flex; align-items: center; gap: .6rem; font-weight: 700; margin-bottom: 1.25rem; }
.pub-logo img { width: 30px; }
.notice { font-size: .78rem; color: var(--ink-2); background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: .65rem .75rem; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; background: #0f172a; color: #e2e8f0; padding: .6rem .75rem; border-radius: 8px; word-break: break-all; font-size: .85rem; }
pre.code { background: #0f172a; color: #e2e8f0; padding: .75rem; border-radius: 8px; font-size: .78rem; white-space: pre-wrap; }

.empty { text-align: center; color: var(--ink-3); padding: 2rem 1rem; }
.empty i { font-size: 1.6rem; display: block; margin-bottom: .4rem; }

@media (max-width: 1100px) { .detail { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
    .side { position: fixed; left: -240px; z-index: 30; transition: left .2s; }
    .side.open { left: 0; }
    .menu-btn { display: inline-flex; }
    .page { padding: 1rem 1rem 3rem; }
    .topbar { padding: .6rem 1rem; }
    .topbar .search { display: none; }
    .today .k { flex-basis: 90px; }
    .facts { grid-template-columns: 110px 1fr; }
}

/* polish */
h1:focus, h1:focus-visible { outline: none; }
.page-head .actions .form-select, .page-head .actions .form-control { width: auto; min-width: 150px; }
.nav-tabs .nav-link { color: var(--ink-2); font-weight: 500; }
.nav-tabs .nav-link.active { color: var(--ink); font-weight: 600; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.pub.embed { min-height: 100vh; }
html:has(.pub.embed), body:has(.pub.embed) { background: #fff; }
.col { flex-basis: 240px; }

/* in-app help drawer */
.help-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .25); z-index: 60; }
.help-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: #fff; z-index: 61; padding: 1rem 1.1rem; overflow-y: auto; box-shadow: -12px 0 30px rgba(15, 23, 42, .12); }
.help-body { font-size: .9rem; line-height: 1.55; }
.help-body ol, .help-body ul { padding-left: 1.2rem; }
.help-body pre { background: #0f172a; color: #e2e8f0; padding: .6rem; border-radius: 8px; font-size: .78rem; white-space: pre-wrap; }
.help-body code { background: #f1f5f9; padding: 0 .3rem; border-radius: 4px; }
.help-body pre code { background: none; }
.notice a { text-decoration: underline; }
.invoice { max-width: 820px; margin: 2rem auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 2rem; }
/* --- Invoice v2 --- */
.inv { max-width: 860px; margin: 1.75rem auto; padding: 0 1rem; }
.inv-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.inv-back { color: var(--ink-2); font-weight: 500; font-size: .85rem; }
.inv-back:hover { color: var(--brand-ink); text-decoration: none; }
.inv-sheet { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 18px 48px rgba(15, 23, 42, .08); }
.inv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; padding: 2rem 2.25rem; color: #fff;
    background: linear-gradient(135deg, var(--brand-ink) 0%, var(--brand) 62%, #11998e 100%); position: relative; }
.inv-head::after { content: ""; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255,255,255,.07); }
.inv-brand { display: flex; align-items: center; gap: .85rem; z-index: 1; }
.inv-logo { width: 46px; height: 46px; border-radius: 12px; background: rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center; }
.inv-logo img { width: 28px; height: 28px; }
.inv-brand-name { font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.inv-brand-sub { font-size: .8rem; opacity: .85; margin-top: .1rem; }
.inv-title { text-align: right; z-index: 1; }
.inv-kind { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; opacity: .9; }
.inv-no { font-size: 1.5rem; font-weight: 700; margin-top: .15rem; letter-spacing: -.01em; }
.inv-date { font-size: .82rem; opacity: .9; margin-top: .1rem; }
.inv-paid { display: inline-flex; align-items: center; gap: .3rem; margin-top: .6rem; padding: .22rem .6rem; border-radius: 999px;
    background: rgba(255,255,255,.95); color: var(--brand-ink); font-size: .74rem; font-weight: 700; letter-spacing: .02em; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.inv-party { background: #fff; padding: 1.35rem 2.25rem; }
.inv-party-label { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); margin-bottom: .4rem; }
.inv-party-name { font-weight: 700; color: var(--ink); font-size: 1rem; }
.inv-party-line { color: var(--ink-2); font-size: .86rem; margin-top: .15rem; }
.inv-table-wrap { padding: 1.5rem 2.25rem 0; }
.inv-table { width: 100%; border-collapse: collapse; }
.inv-table thead th { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--ink-3);
    text-align: left; padding: .6rem .75rem; border-bottom: 2px solid var(--line); }
.inv-table th.n, .inv-table td.n { text-align: right; white-space: nowrap; }
.inv-table th.c, .inv-table td.c { text-align: center; }
.inv-table tbody td { padding: .95rem .75rem; border-bottom: 1px solid var(--line); color: var(--ink-2); font-size: .9rem; vertical-align: top; }
.inv-desc { color: var(--ink); font-weight: 600; }
.inv-foot { display: flex; justify-content: space-between; gap: 2rem; padding: 1.5rem 2.25rem 2rem; flex-wrap: wrap; }
.inv-note { flex: 1 1 240px; min-width: 220px; }
.inv-paidby { font-size: .85rem; color: var(--ink-2); }
.inv-note-label { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .2rem; }
.inv-fine { font-size: .78rem; color: var(--ink-3); margin-top: .75rem; max-width: 320px; }
.inv-totals { flex: 0 0 300px; max-width: 300px; background: var(--brand-soft); border: 1px solid #cfe9e4; border-radius: 12px; padding: 1rem 1.15rem; align-self: flex-start; }
.inv-row { display: flex; justify-content: space-between; align-items: center; font-size: .88rem; color: var(--ink-2); padding: .3rem 0; }
.inv-row span:last-child { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--ink); }
.inv-grand { margin-top: .4rem; padding-top: .7rem; border-top: 1px solid #cfe9e4; }
.inv-grand span { font-size: 1.15rem; font-weight: 700; color: var(--brand-ink) !important; }
.inv-footer { padding: 1.1rem 2.25rem; border-top: 1px solid var(--line); background: #f8fafc; color: var(--ink-3); font-size: .78rem; text-align: center; }
@media (max-width: 640px) {
    .inv-head { flex-direction: column; gap: 1rem; padding: 1.5rem; }
    .inv-title { text-align: left; }
    .inv-parties { grid-template-columns: 1fr; }
    .inv-party, .inv-table-wrap, .inv-foot { padding-left: 1.5rem; padding-right: 1.5rem; }
    .inv-totals { flex-basis: 100%; max-width: none; }
}
@media print {
    .no-print { display: none !important; }
    .invoice { border: 0; margin: 0; padding: 0; }
    .inv { margin: 0; padding: 0; max-width: none; }
    .inv-sheet { border: 0; border-radius: 0; box-shadow: none; }
    .inv-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .inv-totals { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.access-bar { padding: .55rem 1rem; font-size: .88rem; display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.access-bar.trial { background: var(--brand-soft); color: var(--brand-ink); }
.access-bar.warn { background: #fef3c7; color: #78350f; }
.access-bar.stop { background: #fee2e2; color: #7f1d1d; }
.access-bar a { color: inherit; font-weight: 600; text-decoration: underline; }
.meter { height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; margin-top: .25rem; }
.meter > div { height: 100%; background: var(--brand); }
.meter.full > div { background: #dc2626; }
.plan-pick { display: block; border: 1px solid var(--line); border-radius: 8px; padding: .6rem .75rem; cursor: pointer; height: 100%; }
.plan-pick.on { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.checklist li { display: flex; gap: .6rem; align-items: flex-start; }
.checklist li i { color: var(--ink-2); margin-top: .15rem; }
.checklist li.done i { color: var(--brand); }
.checklist li.done a { color: var(--ink-2); text-decoration: line-through; }

/* ---------- e-mail marketing ---------- */
.mail-preview { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: var(--radius); background: #f3f5f7; }
.mail-preview.short { height: 420px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.editor-grid .sticky { position: sticky; top: 4.2rem; }
@media (max-width: 1100px) { .editor-grid { grid-template-columns: 1fr; } .editor-grid .sticky { position: static; } }
.mail-body { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; min-height: 320px; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chips button, .chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .1rem .6rem; font-size: .78rem; color: var(--ink-2); }
.chips button:hover { border-color: var(--brand); color: var(--brand-ink); }
.block-row { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .7rem; margin-bottom: .5rem; background: #fff; }
.block-row.dragging { opacity: .5; }
.block-row.over { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.block-row .bh { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.block-row .bh .grip { cursor: grab; color: var(--ink-3); }
.block-row .bh .tools { margin-left: auto; display: flex; gap: .25rem; }
.check-item { display: flex; gap: .5rem; padding: .35rem 0; font-size: .88rem; border-bottom: 1px dashed var(--line); }
.check-item:last-child { border-bottom: 0; }
.check-item.problem i { color: #b91c1c; }
.check-item.warning i { color: #b45309; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; }
.img-card { border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.img-card .thumb { height: 130px; background: #f3f5f7 center/contain no-repeat; display: flex; align-items: center; justify-content: center; }
.img-card .thumb img { max-width: 100%; max-height: 130px; }
.img-card .meta { padding: .5rem .6rem; font-size: .8rem; }
.hbar { height: 8px; border-radius: 4px; background: var(--brand); min-width: 2px; }
.send-state { display: flex; gap: .75rem; align-items: flex-start; }
.send-state i { font-size: 1.3rem; }
.step-card { border-left: 3px solid var(--brand); }
.tabs-x { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: .75rem; flex-wrap: wrap; }
.tabs-x button { border: 0; background: none; padding: .45rem .8rem; font-size: .88rem; color: var(--ink-2); border-bottom: 2px solid transparent; }
.tabs-x button.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--brand); }

/* ---------- growth pack: talk card, quotes, next actions, automations ---------- */
.tab-btn { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: .2rem .7rem; font-size: .82rem; color: var(--ink-2); }
.tab-btn.on { background: var(--brand-soft); color: var(--brand-ink); border-color: transparent; font-weight: 600; }
.ai-out { white-space: pre-wrap; background: var(--brand-soft); border-radius: 10px; padding: .7rem .85rem; margin-top: .5rem; font-size: .9rem; line-height: 1.5; }
.wa-thread { max-height: 340px; overflow: auto; display: flex; flex-direction: column; gap: .4rem; padding: .25rem 0; }
.wa-msg { max-width: 85%; padding: .45rem .65rem; border-radius: 12px; font-size: .9rem; }
.wa-msg.in { background: #f1f5f9; align-self: flex-start; border-bottom-left-radius: 4px; }
.wa-msg.out { background: #dcfce7; align-self: flex-end; border-bottom-right-radius: 4px; }
.wa-meta { font-size: .72rem; color: var(--ink-3, #64748b); margin-top: .15rem; }
.call-row { border-top: 1px solid var(--line); padding: .45rem 0; font-size: .9rem; }
.quote-row { display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: center; padding: .5rem 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.quote-row:hover { background: var(--brand-soft); }
.next-list { list-style: none; margin: 0; padding: 0; }
.next-list li { display: flex; gap: .7rem; align-items: flex-start; padding: .55rem 0; border-top: 1px solid var(--line); }
.next-list li:first-child { border-top: 0; }
.next-list .ico { width: 2rem; height: 2rem; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-ink); flex: none; }
.next-list a { font-weight: 600; }
.rule-step { border: 1px solid var(--line); border-radius: 10px; padding: .6rem .7rem; margin-bottom: .5rem; }
.kv { display: grid; grid-template-columns: max-content minmax(0,1fr); gap: .25rem 1rem; font-size: .9rem; }
.kv dt { color: var(--ink-2); font-weight: 500; }
.copy-box { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: .4rem .6rem; word-break: break-all; }
.health { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.health .tile { border: 1px solid var(--line); border-radius: 12px; padding: .7rem .8rem; }
.health .tile .v { font-size: 1.4rem; font-weight: 700; }
.health .tile.ok .v { color: #166534; } .health .tile.warm .v { color: #b45309; } .health .tile.bad .v { color: #b91c1c; }
.slot-grid { display: flex; flex-wrap: wrap; gap: .4rem; }
.slot-grid label { border: 1px solid var(--line); border-radius: 8px; padding: .35rem .6rem; cursor: pointer; font-size: .9rem; }
.slot-grid input { display: none; }
.slot-grid input:checked + span { color: var(--brand-ink); font-weight: 700; }
.slot-grid label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.q-table td, .q-table th { padding: .35rem .4rem; vertical-align: top; }
.q-table input, .q-table select { font-size: .85rem; }

/* Quote lines: keep numbers readable on a laptop (the table scrolls sideways rather than squashing the inputs) */
.q-table td:nth-child(2) .form-control { min-width: 72px; }
.q-table td:nth-child(3) .form-control { min-width: 56px; }
.q-table td:nth-child(4) .form-control { min-width: 52px; }
.q-table td:nth-child(5) .form-control { min-width: 90px; }
.q-table td:nth-child(6) .form-control { min-width: 52px; }
.q-table td:nth-child(7) .form-select { min-width: 68px; }
.q-table td.num { white-space: nowrap; }
