/* ============ AI Call Platform design system ============ */
:root {
  /* Zang AI palette: night, lime, electric blue, bone */
  --bg: #f4f3ee; --bg-2: #eae8e1; --surface: #ffffff; --surface-2: #f8f7f3;
  --text: #14171c; --text-2: #4b5058; --muted: #858b95; --line: #e2e0d8; --line-2: #cfcdc4;
  --night: #101418; --lime: #c8f04a; --lime-ink: #2f3d05; --lime-soft: #eef7c9;
  --brand: #4f6212; --brand-2: #3e4d0e; --brand-soft: #eef7c9; --brand-ink: #2f3d05;   /* olive: lime for light backgrounds */
  --grad: #101418;
  --ok: #16a34a; --ok-soft: #e8f8ee; --err: #dc2626; --err-soft: #feecec; --warn: #d97706; --warn-soft: #fff4e0;
  --info-soft: #eef7c9; --info-ink: #2f3d05;
  --shadow-s: 0 1px 2px rgba(20,23,28,.06), 0 1px 1px rgba(20,23,28,.03);
  --shadow: 0 6px 24px -8px rgba(20,23,28,.14), 0 2px 6px -2px rgba(20,23,28,.06);
  --shadow-l: 0 30px 60px -24px rgba(20,23,28,.35);
  --r: 14px; --r-s: 10px; --sidebar: 248px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.015em; line-height: 1.2; }
h1 { font-size: clamp(34px, 5vw, 56px); font-weight: 800; letter-spacing: -.03em; }
h2 { font-size: 24px; font-weight: 700; } h3 { font-size: 16px; font-weight: 650; } h4 { font-size: 14px; font-weight: 650; color: var(--text-2); }
p { margin: 0 0 12px; } code { font-family: ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace; font-size: .92em; background: var(--bg-2); padding: 2px 6px; border-radius: 6px; }
pre { background: var(--night); color: #dfe3ea; padding: 16px 18px; border-radius: var(--r-s); overflow: auto; font-size: 13px; line-height: 1.55; margin: 8px 0 0; }
pre.example { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); max-height: 360px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .mt { margin-top: 16px; } .mb0 { margin-bottom: 0; }
svg.i { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -3px; }

/* ---------- public layout ---------- */
.pub-top { position: sticky; top: 0; z-index: 20; backdrop-filter: saturate(160%) blur(10px); background: rgba(244,243,238,.82); border-bottom: 1px solid var(--line); }
.pub-top .wrap, .pub main .wrap, .pub footer .wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.pub-top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; color: var(--text); letter-spacing: -.02em; }
.brand .logo-mark { width: 32px; height: 32px; border-radius: 9px; flex: none; }
.brand .brand-ai { color: var(--brand); margin-left: 3px; font-weight: 700; }
.side .brand .brand-ai { color: var(--lime); }
.brand .logo svg { width: 17px; height: 17px; }
.pub-nav { display: flex; gap: 8px; align-items: center; } .pub-nav a { color: var(--text-2); padding: 8px 12px; border-radius: 8px; font-weight: 500; } .pub-nav a:hover { background: var(--bg-2); text-decoration: none; }
.pub-nav a.btn { color: var(--lime); margin-left: 6px; } .pub-nav a.btn:hover { background: #1c2229; }
.cta .btn.ghost { color: var(--text); } .cta-band .btn.light { background: var(--lime); color: var(--lime-ink); }
.pub main { padding: 24px 0 60px; }
.pub footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 28px 0; }
.pub footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding: 56px 0 40px; }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 8px; background: var(--night); color: var(--lime); font-weight: 600; font-size: 13px; padding: 6px 12px; border-radius: 999px; margin-bottom: 18px; }
.hero .eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); }
.hero .grad-text { background: var(--lime); color: var(--night); padding: 0 .12em; border-radius: 8px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.hero .lead { font-size: 18px; color: var(--text-2); margin: 18px 0 26px; max-width: 560px; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.hero .langs { display: flex; gap: 8px; margin-top: 26px; flex-wrap: wrap; } .hero .langs span { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--text-2); box-shadow: var(--shadow-s); }

.phone { position: relative; margin: 0 auto; width: 340px; }
.phone .glow { position: absolute; inset: -30px -40px 30px; background: var(--lime-soft); border-radius: 40px; z-index: 0; }
.phone .screen { position: relative; z-index: 1; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow-l); padding: 18px 16px 16px; }
.phone .status { display: flex; align-items: center; gap: 10px; padding: 8px 6px 14px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.phone .status .av { width: 36px; height: 36px; border-radius: 50%; background: var(--night); display: grid; place-items: center; color: var(--lime); }
.phone .status b { display: block; font-size: 14px; } .phone .status span { font-size: 12px; color: var(--ok); }
.phone .status .timer { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
.bubbles { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 86%; padding: 9px 12px; border-radius: 16px; font-size: 13.5px; line-height: 1.4; animation: pop .5s ease both; }
.bubble.ai { background: var(--bg-2); border-bottom-left-radius: 6px; align-self: flex-start; }
.bubble.me { background: var(--night); color: #fff; border-bottom-right-radius: 6px; align-self: flex-end; }
.bubble:nth-child(2) { animation-delay: .35s } .bubble:nth-child(3) { animation-delay: .7s } .bubble:nth-child(4) { animation-delay: 1.05s } .bubble:nth-child(5) { animation-delay: 1.4s }
.phone .wave { display: flex; gap: 4px; align-items: flex-end; height: 26px; justify-content: center; margin-top: 14px; }
.phone .wave i { width: 4px; border-radius: 3px; background: var(--night); animation: wave 1.1s ease-in-out infinite; opacity: .85; }
.phone .wave i:nth-child(2n) { animation-delay: .15s } .phone .wave i:nth-child(3n) { animation-delay: .3s } .phone .wave i:nth-child(4n) { animation-delay: .45s }
@keyframes wave { 0%,100% { height: 6px } 50% { height: 24px } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }
.phone .crm { position: absolute; right: -60px; bottom: 40px; z-index: 2; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); font-size: 12.5px; display: flex; gap: 10px; align-items: center; animation: pop .6s 1.8s ease both; }
.phone .crm .ok { width: 26px; height: 26px; border-radius: 8px; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; }

.section { padding: 34px 0; } .section h2 { text-align: center; margin-bottom: 8px; } .section .sub { text-align: center; color: var(--text-2); margin-bottom: 28px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow-s); transition: transform .2s, box-shadow .2s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature .ic { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 14px; background: var(--night); color: var(--lime); }
.feature .ic.pink { background: #fdf2f8; color: #db2777; } .feature .ic.green { background: var(--ok-soft); color: var(--ok); } .feature .ic.amber { background: var(--warn-soft); color: var(--warn); } .feature .ic.blue { background: var(--info-soft); color: var(--info-ink); } .feature .ic.slate { background: var(--bg-2); color: var(--text-2); }
.feature h3 { margin-bottom: 6px; } .feature p { color: var(--text-2); margin: 0; font-size: 14px; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: step; }
.step { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 20px 20px; }
.step::before { counter-increment: step; content: counter(step); display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--lime); color: var(--lime-ink); font-weight: 700; font-size: 14px; margin-bottom: 12px; }
.step b { display: block; margin-bottom: 4px; } .step span { color: var(--text-2); font-size: 14px; }
.cta-band { background: var(--night); border-radius: 22px; padding: 44px 40px; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; box-shadow: var(--shadow-l); }
.cta-band h2 { color: var(--lime); margin: 0 0 6px; } .cta-band p { margin: 0; color: #c6cbd3; }
.cta-band .btn.light { background: var(--lime); color: var(--lime-ink); }

/* ---------- auth ---------- */
.auth { min-height: calc(100vh - 64px - 90px); display: grid; place-items: center; padding: 30px 0; }
.auth .card { width: 100%; max-width: 440px; padding: 32px; }
.auth .card h2 { margin-bottom: 4px; } .auth .card .muted { margin-bottom: 22px; }
.auth .foot { text-align: center; margin: 18px 0 0; color: var(--text-2); font-size: 14px; }

/* ---------- app layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.side { background: var(--night); color: #c6cbd3; padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.side .brand { color: #fff; padding: 6px 10px 18px; }
.side a.nav { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: #a7adb8; font-weight: 500; transition: background .15s, color .15s; }
.side a.nav:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.side a.nav.active { background: rgba(200,240,74,.14); color: var(--lime); box-shadow: inset 0 0 0 1px rgba(200,240,74,.35); }
.side a.nav.admin { color: #a7adb8; } .side a.nav.admin.active { background: rgba(200,240,74,.14); color: var(--lime); box-shadow: inset 0 0 0 1px rgba(200,240,74,.35); }
.price .badge, .partner-badge { background: var(--lime) !important; color: var(--lime-ink) !important; }
.price.hl { background: var(--surface); border: 2px solid var(--night) !important; box-shadow: var(--shadow-l); }
.meter i { background: var(--lime); }
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.price { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px 24px; display: flex; flex-direction: column; box-shadow: var(--shadow-s); position: relative; }
.price.hl { border: 2px solid var(--night); box-shadow: var(--shadow-l); }
.price .badge { position: absolute; top: -12px; left: 24px; background: var(--lime); color: var(--lime-ink); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.price h3 { font-size: 20px; } .price .tag-line { color: var(--muted); font-size: 14px; margin: 4px 0 14px; }
.price .amount { font-size: 34px; font-weight: 800; letter-spacing: -.03em; } .price .amount small { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.price ul { list-style: none; padding: 0; margin: 16px 0 22px; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); font-size: 14px; }
.price li { display: flex; gap: 8px; align-items: flex-start; } .price li svg { color: var(--ok); margin-top: 3px; }
.price .btn { margin-top: auto; justify-content: center; }
.plan-card .amount { font-size: 22px; font-weight: 800; } .meter { height: 8px; background: var(--bg-2); border-radius: 999px; overflow: hidden; margin: 8px 0 4px; }
.meter i { display: block; height: 100%; background: var(--lime); border-radius: 999px; } .meter.low i { background: var(--err); }
.model-note { margin: 6px 0 12px !important; line-height: 1.4; }
.usage-grid { margin-bottom: 14px; } .usage-box h4 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--text); }
.usage-big { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; } .usage-big b { font-size: 24px; letter-spacing: -.02em; }
.usage-stats { margin-bottom: 12px; } .usage-stats .stat b { font-size: 20px; } .usage-stats .stat span { overflow-wrap: anywhere; }
@media (max-width: 900px) { .pricing { grid-template-columns: 1fr; } }
.side .sep { height: 1px; background: rgba(255,255,255,.08); margin: 8px 6px; }
.side .grow { flex: 1; }
.side .tenant { padding: 12px; border-radius: 12px; background: rgba(255,255,255,.05); font-size: 13px; }
.side .tenant b { display: block; color: #fff; font-size: 14px; margin-bottom: 2px; word-break: break-word; } .side .tenant span { color: #8a919c; word-break: break-all; }
.side form { margin: 6px 0 0; } .side button.link { color: #a7adb8; display: flex; gap: 8px; align-items: center; padding: 6px 12px; }
.content { padding: 28px 36px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--text-2); margin: 4px 0 0; }

/* ---------- components ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px; margin-bottom: 20px; box-shadow: var(--shadow-s); }
.card > h3 { display: flex; align-items: center; gap: 9px; margin-bottom: 14px; } .card > h3 .muted { font-weight: 500; font-size: 13px; }
.card .hint { color: var(--muted); font-size: 13.5px; margin: -6px 0 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; } .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow-s); }
.stat .ic { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--night); color: var(--lime); flex: none; }
.stat .ic.green { background: var(--ok-soft); color: var(--ok); } .stat .ic.amber { background: var(--warn-soft); color: var(--warn); } .stat .ic.pink { background: #fdf2f8; color: #db2777; }
.stat b { display: block; font-size: 26px; line-height: 1.1; letter-spacing: -.02em; } .stat span { color: var(--muted); font-size: 13px; }

label { display: block; margin: 12px 0 0; font-size: 13.5px; font-weight: 500; color: var(--text-2); }
label > input, label > select, label > textarea { margin-top: 6px; }
input, select, textarea { width: 100%; max-width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-s); font: inherit; color: var(--text); background: #fff; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--night); box-shadow: 0 0 0 3px rgba(200,240,74,.45); }
input::placeholder, textarea::placeholder { color: #a9b1c2; }
textarea.code { font-family: ui-monospace, "JetBrains Mono", Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5; tab-size: 2; }
label.check { display: flex; gap: 10px; align-items: center; font-weight: 500; color: var(--text); margin-top: 14px; }
label.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
label.check.inline { display: inline-flex; margin: 0 0 0 12px; }
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--night); color: var(--lime); border: 0; border-radius: var(--r-s); padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; box-shadow: none; transition: transform .12s, background .15s; }
.btn:hover { background: #1c2229; transform: translateY(-1px); text-decoration: none; color: var(--lime); }
.btn.grad { background: var(--lime); color: var(--lime-ink); } .btn.grad:hover { background: #d6f56b; color: var(--lime-ink); }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line-2); box-shadow: var(--shadow-s); } .btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.lg { padding: 13px 22px; font-size: 16px; } .btn.sm { padding: 7px 12px; font-size: 13px; } .btn.danger { background: var(--err); color: #fff; }
button.link { background: none; border: 0; color: var(--brand); cursor: pointer; font: inherit; font-weight: 500; padding: 0; } button.link.danger { color: var(--err); }
form.inline { display: inline; margin: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; } .row > input, .row > select { margin: 0; flex: 1; min-width: min(160px, 100%); }
label.check input { flex: none; }
.actions { margin-top: 18px; display: flex; gap: 10px; align-items: center; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:hover td, tr:hover td { background: var(--surface-2); } tr:last-child td { border-bottom: 0; }
table.kv th { width: 170px; text-transform: none; letter-spacing: 0; font-size: 13.5px; color: var(--text-2); } table.kv tr:hover td { background: none; }
.table-wrap { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }

.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg-2); color: var(--text-2); white-space: nowrap; }
.side .tag { background: var(--lime); color: var(--lime-ink); } .side .tag::before { display: none; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
.tag.booked, .tag.confirmed, .tag.completed, .tag.rescheduled { background: var(--ok-soft); color: #15803d; }
.tag.failed, .tag.declined, .tag.cancelled { background: var(--err-soft); color: #b91c1c; }
.tag.queued, .tag.calling, .tag.callback_later, .tag.in_progress { background: var(--warn-soft); color: #b45309; }
.tag.info, .tag.message, .tag.transferred { background: var(--lime-soft); color: var(--lime-ink); }
.dir { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; } .dir svg { width: 15px; height: 15px; }
.dir.in { color: #15803d; } .dir.out { color: var(--brand); }

.flash { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-s); margin-bottom: 16px; background: var(--ok-soft); border: 1px solid #b7ebc9; color: #14532d; font-size: 14px; }
.flash.err { background: var(--err-soft); border-color: #f7c4c4; color: #7f1d1d; } .flash.warn { background: var(--warn-soft); border-color: #f8ddb0; color: #7c2d12; }
.flash a { font-weight: 600; }
.tabs { display: inline-flex; gap: 4px; background: var(--bg-2); padding: 4px; border-radius: 10px; margin-bottom: 16px; }
.tabs a { padding: 6px 14px; border-radius: 8px; color: var(--text-2); font-weight: 500; font-size: 14px; } .tabs a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-s); } .tabs a:hover { text-decoration: none; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); } .empty .ic { width: 52px; height: 52px; border-radius: 14px; background: var(--bg-2); display: grid; place-items: center; margin: 0 auto 12px; color: var(--muted); }
.empty b { display: block; color: var(--text-2); margin-bottom: 4px; }

.transcript { display: flex; flex-direction: column; gap: 10px; max-height: 480px; overflow: auto; padding: 4px 2px; }
.line { display: flex; gap: 10px; max-width: 82%; align-items: flex-end; }
.line .av { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.line .txt { padding: 9px 13px; border-radius: 16px; font-size: 14px; line-height: 1.45; }
.line.assistant { align-self: flex-start; } .line.assistant .av { background: var(--night); color: var(--lime); } .line.assistant .txt { background: var(--bg-2); border-bottom-left-radius: 6px; }
.line.caller { align-self: flex-end; flex-direction: row-reverse; } .line.caller .av { background: var(--lime); color: var(--lime-ink); } .line.caller .txt { background: var(--night); color: #fff; border-bottom-right-radius: 6px; }
.chatbox { display: flex; flex-direction: column; min-height: 520px; } .chatbox .transcript { flex: 1; min-height: 360px; }
.chatbox form { display: flex; gap: 10px; margin-top: 12px; } .chatbox form input { margin: 0; flex: 1; }
.result { margin-top: 10px; padding: 10px 12px; border-radius: var(--r-s); background: var(--lime-soft); color: var(--lime-ink); font-size: 13.5px; }
.result:empty { display: none; }
.msg { background: var(--warn-soft); padding: 10px 12px; border-radius: var(--r-s); color: #7c2d12; }
.key { display: inline-block; background: var(--night); color: var(--lime); padding: 6px 10px; border-radius: 8px; font-size: 13px; user-select: all; word-break: break-all; }
details { margin-top: 12px; } details summary { cursor: pointer; color: var(--brand); font-weight: 500; } details .body { margin-top: 10px; color: var(--text-2); font-size: 14px; }
.endpoint { display: grid; grid-template-columns: 250px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; } .endpoint:last-child { border: 0; }
.endpoint code { white-space: nowrap; } .method { display: inline-block; font-weight: 700; font-size: 11px; padding: 2px 6px; border-radius: 5px; margin-right: 6px; background: var(--ok-soft); color: #15803d; }
.method.post { background: var(--lime-soft); color: var(--lime-ink); } .method.put { background: var(--warn-soft); color: #b45309; } .method.del { background: var(--err-soft); color: #b91c1c; }
@media (max-width: 700px) { .endpoint { grid-template-columns: 1fr; } }

/* partner block */
.partner { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px 28px; box-shadow: var(--shadow-s); }
.partner-badge { position: absolute; top: -12px; left: 24px; background: var(--night); color: var(--lime); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.partner h3 { font-size: 20px; margin-bottom: 8px; } .partner p { color: var(--text-2); margin-bottom: 6px; }
.partner-cta { display: flex; flex-direction: column; gap: 10px; min-width: 260px; }
.partner.mini { grid-template-columns: 1fr; padding: 16px 18px 14px; margin: 4px 0 14px; font-size: 14px; background: var(--lime-soft); border-color: #dbe9a3; }
.partner.mini .partner-body { color: var(--text-2); } .partner.mini b { color: var(--text); }
@media (max-width: 900px) { .partner { grid-template-columns: 1fr; } .partner-cta { min-width: 0; } }

.period-toggle { display: flex; justify-content: center; gap: 4px; background: var(--bg-2); padding: 4px; border-radius: 12px; width: max-content; margin: -8px auto 22px; }
.period-toggle button { border: 0; background: transparent; font: inherit; font-weight: 600; padding: 8px 16px; border-radius: 9px; cursor: pointer; color: var(--text-2); }
.period-toggle button.active { background: var(--night); color: #fff; }
.period-toggle .save { background: var(--lime); color: var(--lime-ink); font-size: 11px; padding: 2px 6px; border-radius: 999px; margin-left: 6px; }

/* ---- voice catalog: listen buttons, landing cards, picker ---- */
.play { position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--night); color: var(--lime); cursor: pointer; display: inline-grid; place-items: center; transition: transform .12s, background .15s; }
.play:hover { transform: scale(1.06); background: #1c2229; }
.play.sm { width: 28px; height: 28px; vertical-align: middle; margin-right: 6px; }
.play > span { grid-area: 1 / 1; display: none; }
.play .ic-play { display: block; width: 0; height: 0; border-left: 12px solid currentColor; border-top: 7px solid transparent; border-bottom: 7px solid transparent; margin-left: 3px; }
.play.sm .ic-play { border-left-width: 9px; border-top-width: 5px; border-bottom-width: 5px; margin-left: 2px; }
.play .ic-stop { width: 12px; height: 12px; background: currentColor; border-radius: 2px; }
.play.sm .ic-stop { width: 9px; height: 9px; }
.play .ic-wait { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
.play.playing .ic-play, .play.loading .ic-play { display: none; }
.play.playing .ic-stop { display: block; } .play.loading .ic-wait { display: block; }
.play.playing { background: var(--lime); color: var(--lime-ink); }
.play.failed { background: var(--err); color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.voice-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; background: var(--bg-2); padding: 4px; border-radius: 12px; width: max-content; max-width: 100%; margin: 0 auto 22px; }
.voice-tabs button { border: 0; background: transparent; font: inherit; font-weight: 600; padding: 8px 16px; border-radius: 9px; cursor: pointer; color: var(--text-2); }
.voice-tabs button.active { background: var(--night); color: #fff; }
.voice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.voice-card { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow-s); }
.voice-card b { display: block; font-size: 16px; } .voice-card .muted { font-size: 13px; }
.voice-block { margin: 14px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--bg-2); }
.voice-block > b { display: block; margin-bottom: 2px; } .voice-block > .muted { display: block; margin-bottom: 8px; }
.voice-picker { display: flex; flex-direction: column; gap: 8px; }
.voice-row { display: flex; align-items: flex-end; gap: 10px; } .voice-row label { flex: 1; margin: 0; } .voice-row select { margin: 0; }
.voice-row .play { margin-bottom: 1px; }
.voice-line { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
@media (max-width: 900px) { .voice-grid { grid-template-columns: 1fr; } }
.voice-grid[hidden] { display: none; }
.cost-breakdown { background: var(--bg-2); border-radius: var(--r-s); padding: 12px 14px; margin: -4px 0 16px; color: var(--text-2); line-height: 1.6; }
/* staff with read-only role: server rejects writes; hide the controls too (except explicitly allowed forms) */
.readonly form:not(.allow) { display: none; }
/* tariff editor on /admin/platform */
.plans-edit { min-width: 1080px; }
.plan-row { display: grid; grid-template-columns: 70px 1.4fr .8fr .6fr .6fr .7fr 1fr 1.6fr 110px; gap: 8px; align-items: start; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.plan-row.head { padding: 4px 8px 8px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.plan-row input, .plan-row textarea { margin: 0 0 6px; width: 100%; font-size: 13px; padding: 6px 8px; }
.plan-row textarea { resize: vertical; min-height: 64px; }
.plan-row .flags { display: flex; flex-direction: column; gap: 4px; } .plan-row .flags .check { margin: 0; font-size: 12.5px; }
.plan-row .acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
form[hidden] { display: none; }
/* client phone page: forwarding number and dial codes */
.fwd-number { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; } .fwd-number b { font-size: 24px; letter-spacing: .01em; }
.fwd-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 10px 0; }
.fwd-grid > div { background: var(--bg-2); border-radius: var(--r-s); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.fwd-grid code { font-size: 15px; font-weight: 700; background: transparent; padding: 0; }
.btn[hidden] { display: none; }
.voice-status.ok { color: #15803d; font-weight: 600; }
.voice-status.ok::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #15803d; margin-right: 6px; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }

/* ---------- phones: kept last so these rules win over the component defaults above ---------- */
.side-nav { display: contents; }
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); } .side { min-width: 0; }   /* the nav strip must not widen the page */
  /* phone: the sidebar becomes a top bar (brand + logout) with a horizontally scrollable strip of sections */
  .side { position: sticky; top: 0; z-index: 30; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0; padding: 8px 10px 0; }
  .side .brand { padding: 4px 6px; font-size: 16px; flex: 1; } .side .brand .tag { font-size: 11px; }
  .side .tenant, .side .sep, .side .grow { display: none; }
  .side form { margin: 0; order: 1; } .side button.link { padding: 6px 8px; font-size: 13px; }
  .side-nav { display: flex; order: 2; flex: 0 0 100%; min-width: 0; width: 100%; overflow-x: auto; gap: 2px; padding: 6px 0 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side a.nav { flex: 0 0 auto; flex-direction: column; gap: 3px; padding: 6px 9px; font-size: 11px; line-height: 1.1; min-width: 60px; text-align: center; border-radius: 8px; }
  .side a.nav svg.i { width: 20px; height: 20px; }
  .content { padding: 16px 14px 40px; } .card { padding: 16px 16px; } .page-head { margin-bottom: 16px; } .page-head .btn { width: 100%; justify-content: center; }
  h2 { font-size: 21px; }
  .hero { grid-template-columns: 1fr; gap: 28px; padding: 28px 0 24px; } .phone { width: min(340px, 100%); margin: 0 auto; } .phone .crm { right: 0; } .phone .glow { inset: -10px 0 10px; }
  .features, .steps { grid-template-columns: 1fr; } .grid2, .grid3 { grid-template-columns: 1fr !important; } .grid4 { grid-template-columns: 1fr 1fr !important; margin-bottom: 16px; } .fwd-grid { grid-template-columns: 1fr 1fr; }
  .stat { padding: 14px 14px; gap: 10px; } .stat b { font-size: 20px; } .stat .ic { width: 36px; height: 36px; }
  .tabs { display: flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; } .tabs a { white-space: nowrap; }
  .actions { flex-wrap: wrap; } .row > input, .row > select { min-width: 0; flex-basis: 100%; } .row label.check { flex: 1 1 100%; margin: 4px 0; }
  .endpoint code, .hint code, .card p code, td code { white-space: normal; overflow-wrap: anywhere; word-break: break-word; }
  pre { font-size: 12px; padding: 12px; }
  .pub-top .wrap { padding: 0 14px; height: 56px; } .pub-nav { gap: 2px; } .pub-nav a { padding: 8px 8px; font-size: 14px; } .pub-nav .hide-m { display: none; }
  .pub main .wrap, .pub footer .wrap { padding: 0 14px; } .auth { min-height: calc(100vh - 56px - 90px); padding: 16px 0; } .auth .card { padding: 22px 18px; }
  .cta-band { padding: 26px 18px; } .cta-band .btn { width: 100%; justify-content: center; }
  .plans-edit .plan-row { min-width: 980px; }
  .voice-line { flex-wrap: wrap; }
}
@media (max-width: 520px) {
  .fwd-grid { grid-template-columns: 1fr !important; } .fwd-grid code { white-space: normal; overflow-wrap: anywhere; font-size: 14px; }
  .fwd-number b { font-size: 20px; } .grid4 { grid-template-columns: 1fr !important; gap: 10px; } .stat, .stat > div { min-width: 0; } .stat b { overflow-wrap: anywhere; }
  .chatbox { min-height: 420px; } .chatbox .transcript { min-height: 260px; max-height: 50vh; } .line { max-width: 92%; }
  .transcript { max-height: 50vh; }
  table { font-size: 13px; } th, td { padding: 9px 8px; }
}

/* ---------- economics: chart and cost groups ---------- */
.period-card { padding: 14px 18px; } .period-form input[type=date] { max-width: 165px; }
.chart-wrap { position: relative; width: 100%; overflow: hidden; margin: 6px 0 12px; } .chart-wrap svg { width: 100%; height: 320px; display: block; }
#chart-svg .grid { stroke: var(--line); stroke-width: 1; } #chart-svg .zero { stroke: var(--text-2); stroke-width: 1.2; }
#chart-svg .lbl { font: 11.5px Inter, system-ui, sans-serif; fill: var(--muted); }
#chart-svg .rev { fill: var(--lime); } #chart-svg .cost { fill: #f4b6c8; }
#chart-svg .profit { fill: none; stroke: var(--night); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
#chart-svg .profit-area { fill: url(#profit-fill); }
#chart-svg .profit-dot { fill: #fff; stroke: var(--night); stroke-width: 2; } #chart-svg .profit-dot.neg { stroke: var(--err); }
#chart-svg .hit { fill: transparent; } #chart-svg .hit:hover { fill: rgba(16,20,24,.04); }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--night); color: #e8ebef; border-radius: 10px; padding: 8px 12px; font-size: 12.5px; line-height: 1.5; display: flex; flex-direction: column; gap: 1px; box-shadow: 0 8px 24px rgba(0,0,0,.25); white-space: nowrap; }
.chart-tip[hidden] { display: none; } .chart-tip b { font-size: 13px; margin-bottom: 2px; } .chart-tip span { display: inline-flex; align-items: center; gap: 6px; } .chart-tip .muted { color: #9aa3ad; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; pointer-events: none; } .chart-empty[hidden] { display: none; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-2); margin-bottom: 4px; } .chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; } .sw.rev { background: var(--lime); } .sw.cost { background: #f4b6c8; } .sw.profit { background: var(--night); height: 3px; border-radius: 2px; } .chart-tip .sw.profit { background: #c8f04a; }
.chart-totals .stat b { font-size: 20px; }
.cost-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 20px; }
.cost-groups fieldset { border: 1px solid var(--line); border-radius: var(--r-s); padding: 6px 14px 14px; margin: 0; min-width: 0; }
.cost-groups legend { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 0 6px; }
@media (max-width: 900px) { .cost-groups { grid-template-columns: 1fr; } .chart-wrap svg { height: 230px; } .period-form input, .period-form select { flex-basis: 100%; max-width: none; } .period-form .btn { flex: 1; justify-content: center; } }
.auto-note { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--lime-ink); background: var(--lime-soft); border-radius: 8px; padding: 6px 10px; margin: 6px 0 0; } .auto-note.warn { background: var(--warn-soft); color: #b45309; } .auto-note svg.i { width: 14px; height: 14px; margin-top: 2px; }
input.readonly, input[readonly] { background: var(--surface-2); color: var(--text-2); }
.mic-meter { display: flex; align-items: center; gap: 10px; margin-top: 10px; } .mic-meter .meter { flex: 1; margin: 0; } .mic-meter[hidden] { display: none; }
.danger-zone { border-color: #f3c4c4; } .danger-zone > h3 { color: var(--err); }
