/* Lead Console web app (v2).
   VOICE a shipped product, calm and exact.
   IDEA journeys drawn as a transit map; the rest of the app is a quiet, well-lit workspace.
   COLOUR deep ink sidebar, soft paper work area, white raised cards; green = did something, amber = waited,
   red = failed, cobalt = selection and primary actions.
   TYPE Schibsted Grotesk throughout, tabular figures for numbers. */
:root{color-scheme:light dark;
--bg:light-dark(#f5f6fa,#0d131b);--panel:light-dark(#f1f3f8,#16202b);--card:light-dark(#ffffff,#121a24);--ink:light-dark(#141b2d,#e8edf4);--quiet:light-dark(#5d6680,#98a4b5);
--rule:light-dark(#e4e7ef,#243140);--bar:#0b1120;--barink:#e9eef6;--side:#0b1120;--sideink:#aab4c6;--sidehi:#ffffff;
--good:light-dark(#0f7b63,#3fc4a2);--wait:light-dark(#b26a00,#e5a94c);--bad:light-dark(#c03a2b,#f07563);--sig:light-dark(#3b4fe0,#8c9bff);
--goodbg:light-dark(#e3f5ef,#11342c);--waitbg:light-dark(#fdf1de,#3a2c14);--badbg:light-dark(#fdecea,#3d1d18);--sigbg:light-dark(#ebedfd,#1f2754);
--grid:light-dark(#eceff5,#17212c);--radius:12px;
--shadow:light-dark(0 1px 2px #1018280d,0 1px 3px #1018281a,0 1px 2px #0000004d);
--shadow-lg:light-dark(0 12px 32px -8px #1018282e,0 12px 32px #0008);
--s1:light-dark(#257de0,#338ced);--s2:light-dark(#f47230,#e76624);--s3:light-dark(#00b894,#00a888)}
*{box-sizing:border-box;min-width:0}
html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--ink);font:15px/1.5 "Schibsted Grotesk",system-ui,sans-serif;-webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--sig);outline-offset:2px}
h1,h2,h3{line-height:1.2;margin:0;font-weight:600}
h1{font-size:26px;letter-spacing:-.02em;font-weight:700}h2{font-size:18px;letter-spacing:-.01em}h3{font-size:15px}
p{margin:0}
a{color:var(--sig)}
code,.mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px}
.num{font-variant-numeric:tabular-nums}
.boot{padding:40px;color:var(--quiet)}
.quiet{color:var(--quiet)}
.small{font-size:13px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}

/* app shell: sidebar + work area */
.shell{display:grid;grid-template-columns:248px minmax(0,1fr);min-height:100vh}
.side{background:var(--side);color:var(--sideink);display:flex;flex-direction:column;gap:6px;padding:18px 14px;position:sticky;top:0;height:100vh;overflow:auto}
.side .brand{color:#fff;padding:4px 8px 14px}
.brand{font-weight:800;letter-spacing:-.02em;font-size:17px;display:flex;align-items:center;gap:10px;color:inherit;text-decoration:none}
.brand i{width:26px;height:26px;border-radius:8px;display:inline-block;background:conic-gradient(from 210deg,#22c3a6,#3b82f6,#7c5cff,#22c3a6);box-shadow:inset 0 0 0 6px #0b1120}
.side select{width:100%;background:#ffffff0f;border:1px solid #ffffff22;color:#fff;border-radius:10px;padding:8px 10px;min-height:40px}
.side select option{color:#141b2d}
.side .lbl{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:#6f7b91;padding:14px 10px 4px;font-weight:600}
.nav{display:flex;flex-direction:column;gap:2px}
.nav a{color:var(--sideink);text-decoration:none;padding:9px 10px;border-radius:9px;display:flex;align-items:center;gap:10px;font-weight:500}
.nav a svg{width:18px;height:18px;flex:none;opacity:.8}
.nav a:hover{background:#ffffff0d;color:#fff}
.nav a[aria-current=page]{background:linear-gradient(90deg,#3b4fe033,#3b4fe014);color:#fff;box-shadow:inset 2px 0 0 #8c9bff}
.side .foot{margin-top:auto;display:flex;flex-direction:column;gap:8px;padding-top:16px}
.side .link{background:none;border:0;color:var(--sideink);cursor:pointer;padding:8px 10px;text-align:left;border-radius:8px}
.side .link:hover{background:#ffffff0d;color:#fff}
.sp{flex:1}
.pill{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:4px 12px;font-size:13px;font-weight:500;white-space:nowrap;text-decoration:none}
.side .pill.test{background:#e5a94c1f;color:#ffd99a;border:1px solid #e5a94c66;justify-content:center}
.work{min-width:0}
.mtop{display:none}
@media (max-width:860px){
  .shell{grid-template-columns:1fr}
  .side{position:fixed;inset:0 auto 0 0;width:272px;z-index:40;transform:translateX(-100%);transition:transform .2s}
  .shell.open .side{transform:none;box-shadow:var(--shadow-lg)}
  .mtop{display:flex;align-items:center;gap:12px;background:var(--side);color:#fff;padding:10px 16px;position:sticky;top:0;z-index:30}
  .mtop button{background:none;border:1px solid #ffffff33;color:#fff;border-radius:8px;padding:6px 10px}
}

/* page */
.page{max-width:1200px;margin:0 auto;padding:32px max(18px,3vw) 72px}
.page.wide{max-width:none;padding:0}
.head{display:flex;align-items:flex-end;gap:16px;flex-wrap:wrap;margin-bottom:24px}
.eyebrow{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--sig);font-weight:600;margin-bottom:6px}
.head .sub{color:var(--quiet);margin-top:6px;max-width:62ch}
.stack>*+*{margin-top:16px}

/* buttons and fields */
.btn{border:1px solid var(--rule);background:var(--card);border-radius:10px;padding:8px 14px;cursor:pointer;min-height:40px;box-shadow:var(--shadow);font-weight:500;transition:border-color .15s,background .15s;display:inline-flex;align-items:center;gap:6px;white-space:nowrap;text-decoration:none;color:var(--ink)}
.btn:hover{border-color:var(--quiet)}
.btn.pri{background:var(--sig);color:#fff;border-color:var(--sig);font-weight:600}
.btn.pri:hover{filter:brightness(1.08);border-color:var(--sig)}
.btn.danger{color:var(--bad)}
.btn.ghost{border-color:transparent;background:none;box-shadow:none}
.btn.small{min-height:32px;padding:4px 10px;font-size:13px}
.btn:disabled{opacity:.45;cursor:not-allowed}
.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.field{display:flex;flex-direction:column;gap:5px}
.field>label,.lbl{font-weight:500;font-size:14px}
.field .help{font-size:13px;color:var(--quiet)}
.field .err{font-size:13px;color:var(--bad)}
input[type=text],input[type=password],input[type=number],input[type=time],input[type=url],input[type=email],input:not([type]),select,textarea{
  border:1px solid var(--rule);background:var(--card);border-radius:10px;padding:8px 11px;min-height:40px;width:100%}
input[type=search],input[type=tel],input[type=date]{border:1px solid var(--rule);background:var(--card);border-radius:10px;padding:8px 11px;min-height:40px;width:100%}
textarea{min-height:88px;resize:vertical;line-height:1.45}
input:focus,select:focus,textarea:focus{border-color:var(--sig);outline:none;box-shadow:0 0 0 3px var(--sigbg)}
.check{display:flex;gap:8px;align-items:flex-start;cursor:pointer}
.check input{width:18px;height:18px;margin:2px 0 0}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:14px}
@media (max-width:640px){.grid2{grid-template-columns:1fr}}

/* cards and status */
.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:16px}
.card{background:var(--card);border:1px solid var(--rule);border-radius:16px;padding:20px;display:flex;flex-direction:column;gap:12px;box-shadow:var(--shadow)}
.card .ctop{display:flex;gap:12px;align-items:center}
.logo{width:42px;height:42px;border-radius:12px;display:grid;place-items:center;font-weight:800;color:#fff;flex:none}
.chip{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:2px 10px;font-size:13px;font-weight:500;white-space:nowrap}
.chip::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
.chip.ok{background:var(--goodbg);color:var(--good)}
.chip.warn{background:var(--waitbg);color:var(--wait)}
.chip.bad{background:var(--badbg);color:var(--bad)}
.chip.off{background:var(--panel);color:var(--quiet)}
.chip.sig{background:var(--sigbg);color:var(--sig)}
.copy{display:flex;gap:6px;align-items:center;background:var(--panel);border:1px solid var(--rule);border-radius:8px;padding:6px 6px 6px 10px}
.copy code{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.note{background:var(--panel);border-radius:var(--radius);padding:12px 14px;font-size:14px}
.note.warn{background:var(--waitbg)}
.note.bad{background:var(--badbg);color:var(--bad)}
.empty{border:1px dashed var(--rule);border-radius:16px;padding:40px;background:var(--card);text-align:center;color:var(--quiet)}
.empty .btn{margin-top:12px}

/* tables */
.table{width:100%;border-collapse:collapse}
.table th{text-align:left;font-weight:600;color:var(--quiet);font-size:12px;letter-spacing:.04em;text-transform:uppercase;padding:11px 14px;border-bottom:1px solid var(--rule);background:var(--panel)}
.table th.r,.table td.r{text-align:right}
.table td{padding:12px 14px;border-bottom:1px solid var(--rule);vertical-align:middle}
.table tr.click{cursor:pointer}
.table tr.click:hover td{background:var(--panel)}
.tablewrap{overflow-x:auto;border:1px solid var(--rule);border-radius:16px;background:var(--card);box-shadow:var(--shadow)}
.tablewrap .table tr:last-child td{border-bottom:0}

/* dialog */
dialog{border:0;border-radius:14px;padding:0;width:min(560px,calc(100vw - 24px));max-height:calc(100vh - 40px);background:var(--card);color:var(--ink);box-shadow:0 20px 60px #0004}
dialog::backdrop{background:#0b111880}
dialog form{display:flex;flex-direction:column;max-height:calc(100vh - 40px)}
dialog .dh{padding:18px 20px 6px;display:flex;align-items:center;gap:8px}
dialog .db{padding:10px 20px 18px;overflow:auto;display:flex;flex-direction:column;gap:14px}
dialog .df{padding:14px 20px;border-top:1px solid var(--rule);display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}

/* toasts */
#toasts{position:fixed;bottom:16px;left:50%;transform:translateX(-50%);display:flex;flex-direction:column;gap:8px;z-index:50;width:min(460px,calc(100vw - 24px))}
.toast{background:var(--bar);color:#fff;border-radius:10px;padding:10px 14px;box-shadow:0 8px 30px #0003;font-size:14px}
.toast.bad{background:var(--bad)}

/* sign in */
.signin{max-width:440px;margin:0 auto;padding:12vh 16px 40px}
body:has(.signin){background:radial-gradient(1200px 600px at 20% -10%,#3b4fe02e,transparent),radial-gradient(900px 500px at 110% 10%,#22c3a626,transparent),var(--bg)}
.signin .card{padding:32px;box-shadow:var(--shadow-lg)}

/* builder */
.bbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px max(16px,2vw);border-bottom:1px solid var(--rule);background:var(--card)}
.bbar .jn{font-size:17px;font-weight:600;border:1px solid transparent;background:none;padding:6px 8px;border-radius:8px;min-height:40px;width:auto;max-width:360px}
.bbar .jn:hover{border-color:var(--rule)}
.builder{display:grid;grid-template-columns:minmax(0,1fr) 420px;height:calc(100vh - 62px)}
@media (max-width:900px){.builder{grid-template-columns:1fr;height:auto}.map{height:60vh}}
.map{position:relative;overflow:auto;background:
  linear-gradient(var(--grid) 1px,transparent 1px) 0 0/28px 28px,linear-gradient(90deg,var(--grid) 1px,transparent 1px) 0 0/28px 28px,var(--bg)}
.map svg{display:block}
.map .station{cursor:pointer}
.map .station circle.ring{fill:var(--card);stroke:var(--ink);stroke-width:4}
.map .station.sel circle.ring{stroke:var(--sig);stroke-width:6}
.map .station text{fill:var(--ink);font-size:14px;font-weight:600}
.map .station text.kind{fill:var(--quiet);font-size:12px;font-weight:500}
.map .station .probdot{fill:var(--bad)}
.map .line{fill:none;stroke-width:5;stroke-linecap:round}
.map .line.good{stroke:var(--good)}.map .line.wait{stroke:var(--wait)}.map .line.bad{stroke:var(--bad)}
.map .lbl{font-size:12px;font-weight:500}
.map .lbl.good{fill:var(--good)}.map .lbl.wait{fill:var(--wait)}.map .lbl.bad{fill:var(--bad)}
.map .stub{stroke-dasharray:2 8}
.map .plus{cursor:pointer}
.map .plus circle{fill:var(--card);stroke-width:2}
.map .plus text{font-size:16px;font-weight:600;text-anchor:middle;dominant-baseline:central}
.inspector{border-left:1px solid var(--rule);background:var(--card);overflow:auto;padding:18px 20px 40px}
@media (max-width:900px){.inspector{border-left:0;border-top:1px solid var(--rule)}}
.inspector section{border-top:1px solid var(--rule);padding-top:16px;margin-top:18px}
.inspector section>h3{margin-bottom:10px}
.exitrow{display:grid;grid-template-columns:12px 1fr minmax(0,180px);gap:10px;align-items:center;padding:6px 0}
.dot{width:12px;height:12px;border-radius:50%}
.dot.good{background:var(--good)}.dot.wait{background:var(--wait)}.dot.bad{background:var(--bad)}
.listed{display:flex;flex-direction:column;gap:8px}
.listed .item{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:start;background:var(--panel);border-radius:10px;padding:10px}
.listed .item .inner{display:flex;flex-direction:column;gap:8px}
.kv{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr) auto;gap:6px;align-items:center}
.cond{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr) minmax(0,1fr) auto;gap:6px;align-items:center}
.fieldins{position:relative}
.fieldins .ins{position:absolute;right:6px;top:6px}
.fieldins textarea,.fieldins input{padding-right:78px}
.menu{position:absolute;z-index:20;background:var(--card);border:1px solid var(--rule);border-radius:10px;box-shadow:0 12px 30px #0002;padding:6px;min-width:220px;max-height:320px;overflow:auto}
.menu button{display:block;width:100%;text-align:left;background:none;border:0;padding:8px 10px;border-radius:6px;cursor:pointer}
.menu button:hover{background:var(--panel)}
.menu .mh{font-size:12px;color:var(--quiet);padding:6px 10px 2px}
.preview{border:1px solid var(--rule);border-radius:12px;padding:14px;background:var(--panel)}
.preview .pt{font-weight:600;font-size:16px}
.wa{background:light-dark(#e7f6dc,#1f3a2a);border-radius:12px 12px 12px 4px;padding:10px 12px;white-space:pre-wrap;font-size:14px}
.wa .wab{display:block;text-align:center;color:var(--sig);border-top:1px solid #0001;margin-top:8px;padding-top:6px;font-weight:500}
.problems{display:flex;flex-direction:column;gap:6px}
.problems button{text-align:left;background:var(--badbg);color:var(--bad);border:0;border-radius:8px;padding:8px 10px;cursor:pointer}

/* timeline */
.tl{list-style:none;margin:0;padding:0;border-left:2px solid var(--rule);margin-left:8px}
.tl li{position:relative;padding:0 0 18px 20px}
.tl li::before{content:"";position:absolute;left:-7px;top:5px;width:12px;height:12px;border-radius:50%;background:var(--card);border:3px solid var(--quiet)}
.tl li.good::before{border-color:var(--good)}.tl li.wait::before{border-color:var(--wait)}.tl li.bad::before{border-color:var(--bad)}.tl li.sig::before{border-color:var(--sig)}
.tl .when{font-size:13px;color:var(--quiet)}

/* v2: tabs, KPI tiles, charts, guides, templates */
.tabs{display:flex;gap:4px;border-bottom:1px solid var(--rule);margin-bottom:20px;flex-wrap:wrap}
.tabs button,.tabs a{background:none;border:0;border-bottom:2px solid transparent;padding:10px 14px;cursor:pointer;color:var(--quiet);font-weight:500;text-decoration:none;margin-bottom:-1px}
.tabs [aria-selected=true],.tabs [aria-current=page]{color:var(--ink);border-bottom-color:var(--sig)}
.seg{display:inline-flex;background:var(--panel);border:1px solid var(--rule);border-radius:10px;padding:3px;gap:2px}
.seg button{border:0;background:none;padding:5px 12px;border-radius:8px;cursor:pointer;color:var(--quiet);font-weight:500}
.seg button[aria-pressed=true]{background:var(--card);color:var(--ink);box-shadow:var(--shadow)}
.kpis{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:14px;margin-bottom:18px}
.kpi{background:var(--card);border:1px solid var(--rule);border-radius:16px;padding:16px 18px;box-shadow:var(--shadow)}
.kpi .k{font-size:13px;color:var(--quiet);font-weight:500}
.kpi .v{font-size:30px;font-weight:700;letter-spacing:-.02em;font-variant-numeric:tabular-nums;margin-top:4px}
.kpi .d{font-size:12px;margin-top:2px;color:var(--quiet)}
.kpi .d.up{color:var(--good)}.kpi .d.down{color:var(--bad)}
.kpi.hero{background:linear-gradient(135deg,#3b4fe0,#6d4ae6 60%,#22a891);color:#fff;border:0}
.kpi.hero .k,.kpi.hero .d{color:#e6e9ff}
.grid-2{display:grid;grid-template-columns:repeat(auto-fit,minmax(380px,1fr));gap:16px}
.chart{position:relative}
.chart svg{display:block;width:100%;height:auto;overflow:visible}
.chart .ax{fill:var(--quiet);font-size:11px}
.chart .gl{stroke:var(--grid);stroke-width:1}
.chart .base{stroke:var(--rule);stroke-width:1}
.chart .hit{fill:transparent;cursor:crosshair}
.chart .hit:hover+.mk,.chart .bar:hover{opacity:.85}
.tip{position:absolute;pointer-events:none;background:var(--card);border:1px solid var(--rule);border-radius:10px;padding:8px 10px;font-size:13px;box-shadow:var(--shadow-lg);white-space:nowrap;z-index:5;transform:translate(-50%,calc(-100% - 10px))}
.tip b{display:block;margin-bottom:2px}
.legend{display:flex;gap:14px;flex-wrap:wrap;font-size:13px;color:var(--quiet)}
.legend span{display:inline-flex;align-items:center;gap:6px}
.legend i{width:12px;height:3px;border-radius:2px;display:inline-block}
.funnel{display:flex;flex-direction:column;gap:10px}
.frow{display:grid;grid-template-columns:190px minmax(0,1fr) 140px;gap:12px;align-items:center}
.frow .fbar{height:22px;background:var(--panel);border-radius:8px;overflow:hidden;position:relative}
.frow .fbar i{display:block;height:100%;border-radius:0 4px 4px 0;background:var(--s1)}
.frow .fbar i.won{background:var(--good)}
.frow .fbar span{position:absolute;left:10px;top:50%;transform:translateY(-50%);font-size:13px;font-weight:600;font-variant-numeric:tabular-nums}
.frow .mv{font-size:13px;font-variant-numeric:tabular-nums;text-align:right}
.mv .in{color:var(--good)}.mv .out{color:var(--quiet)}
@media (max-width:640px){.frow{grid-template-columns:100px 1fr}.frow .mv{grid-column:2;text-align:left}}
.guide{counter-reset:g;display:flex;flex-direction:column;gap:12px;margin:0;padding:0;list-style:none}
.guide>li{counter-increment:g;position:relative;padding-left:38px}
.guide>li::before{content:counter(g);position:absolute;left:0;top:0;width:26px;height:26px;border-radius:50%;background:var(--sigbg);color:var(--sig);font-weight:700;font-size:13px;display:grid;place-items:center}
.platforms{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:10px}
.platforms button{display:flex;flex-direction:column;align-items:flex-start;gap:8px;text-align:left;background:var(--card);border:1px solid var(--rule);border-radius:14px;padding:14px;cursor:pointer;box-shadow:var(--shadow)}
.platforms button[aria-pressed=true]{border-color:var(--sig);box-shadow:0 0 0 3px var(--sigbg)}
.platforms button .logo{width:34px;height:34px;border-radius:10px;font-size:14px}
pre.code{background:var(--panel);border:1px solid var(--rule);border-radius:10px;padding:12px;overflow:auto;font-size:12.5px;margin:0;white-space:pre-wrap;word-break:break-word}
.tgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:14px}
.tcard{background:var(--card);border:1px solid var(--rule);border-radius:16px;box-shadow:var(--shadow);display:flex;flex-direction:column;overflow:hidden}
.tcard .phone{background:light-dark(#efe7dd,#0f1a16);padding:14px;flex:1}
.tcard .bubble{background:var(--card);border-radius:4px 12px 12px 12px;padding:8px 10px;font-size:13.5px;white-space:pre-wrap;box-shadow:0 1px 1px #0000001a;max-width:100%}
.tcard .media{height:120px;border-radius:8px;margin:-2px -4px 8px;display:grid;place-items:center;font-size:13px;color:var(--quiet);background:light-dark(#dfe4ec,#1c2733) center/cover no-repeat}
.tcard .hdr{font-weight:700;margin-bottom:4px}
.tcard .ftr{color:var(--quiet);font-size:12px;margin-top:6px}
.tcard .btns{display:flex;flex-direction:column;gap:4px;margin-top:6px}
.tcard .btns span{background:var(--card);border-radius:8px;text-align:center;color:var(--sig);font-size:13px;padding:6px;box-shadow:0 1px 1px #0000001a}
.tcard .meta{padding:12px 14px;display:flex;flex-direction:column;gap:6px;border-top:1px solid var(--rule)}
.toolbar{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-bottom:16px}
.toolbar input[type=search]{max-width:300px}
.toolbar select{width:auto}
.stagepick{display:flex;gap:6px;flex-wrap:wrap}
.chips-edit{display:flex;flex-wrap:wrap;gap:8px}
.chips-edit .chip{padding:4px 6px 4px 12px}
.chips-edit .chip::before{display:none}
.chips-edit .chip button{border:0;background:none;cursor:pointer;color:inherit;padding:0 4px}
.recipe{border:1px dashed var(--sig);background:var(--sigbg);border-radius:12px;padding:12px 14px}
.page.dash{max-width:1320px}
.grid-2{margin-bottom:16px}
.card .tablewrap{box-shadow:none;border-radius:10px}
.card>.stack>.legend{margin-bottom:-6px}
.tcard .media img{width:100%;height:100%;object-fit:cover;border-radius:8px;display:block}
.numcard .phone{font-size:20px;font-weight:700;letter-spacing:-.01em;font-variant-numeric:tabular-nums}
.numcard .stats{display:flex;gap:18px}
.numcard .stats b{display:block;font-size:20px;font-variant-numeric:tabular-nums}
details.adv summary{cursor:pointer;color:var(--sig);font-weight:500;padding:4px 0}
details.adv[open] summary{margin-bottom:10px}
.kpis{grid-template-columns:repeat(auto-fit,minmax(160px,1fr))}
.toolbar select,.toolbar input:not([type=search]){width:auto;min-width:0}
.head .toolbar{flex-wrap:nowrap}
@media (max-width:860px){.head .toolbar{flex-wrap:wrap}}
.frow .fname{display:flex;justify-content:space-between;gap:8px}
.frow .fname span{font-variant-numeric:tabular-nums;color:var(--quiet);font-weight:600}
.head>div:first-child{min-width:min(100%,320px)}
.grid-2{grid-template-columns:repeat(auto-fit,minmax(min(380px,100%),1fr))}
.tgrid{grid-template-columns:repeat(auto-fill,minmax(min(290px,100%),1fr))}
@media (max-width:640px){.page{padding:20px 14px 60px}.frow{grid-template-columns:1fr}.frow .mv{grid-column:auto;text-align:left}}

/* ---------- v2.1 CRM ---------- */
:root{--r0:light-dark(#cfe3fb,#1b3557);--r1:light-dark(#9cc6f5,#22477a);--r2:light-dark(#5fa2ec,#2c62a8);--r3:light-dark(#257de0,#338ced);--r4:light-dark(#1659a8,#62a6f2);
--rlost:light-dark(#c4cad6,#3a4556);--rwon:light-dark(#0f9f7a,#2cc29a)}
.work{background:var(--bg)}
.wbar{display:flex;align-items:center;gap:10px;padding:12px max(18px,3vw);border-bottom:1px solid var(--rule);background:light-dark(#ffffffcc,#0d131bcc);backdrop-filter:blur(8px);position:sticky;top:0;z-index:20}
.gsearch{display:flex;align-items:center;gap:8px;background:var(--panel);border:1px solid var(--rule);border-radius:12px;padding:0 12px;min-height:40px;width:min(460px,100%)}
.gsearch svg{width:18px;height:18px;color:var(--quiet);flex:none}
.gsearch input{border:0;background:none;outline:none;box-shadow:none;padding:8px 0;min-height:0;flex:1}
.me{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;font-weight:700;font-size:13px;color:#fff;background:linear-gradient(135deg,#3b4fe0,#22a891)}
@media (max-width:860px){.wbar{position:static}.wbar .btn,.wbar .me{display:none}}
.av{width:34px;height:34px;border-radius:50%;display:inline-grid;place-items:center;flex:none;font-weight:700;font-size:12.5px;letter-spacing:.02em;color:var(--sig);background:var(--sigbg)}
.av.lg{width:56px;height:56px;font-size:20px}
.lead-head{align-items:center}
.ell{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.stchip{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:3px 10px 3px 8px;font-size:12.5px;font-weight:600;white-space:nowrap;background:var(--panel);color:var(--ink)}
.stchip::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--sc,var(--quiet))}
.st-0{--sc:var(--r0)}.st-1{--sc:var(--r1)}.st-2{--sc:var(--r2)}.st-3{--sc:var(--r3)}.st-4{--sc:var(--r4)}.st-won{--sc:var(--rwon)}.st-lost{--sc:var(--rlost)}.st-none{--sc:transparent}
.stchip.st-none::before{border:1.5px dashed var(--quiet)}
.stchip.st-won{background:var(--goodbg);color:var(--good)}
.pillbda{display:inline-flex;align-items:center;gap:6px;border-radius:999px;padding:2px 10px;font-size:12.5px;font-weight:500;background:var(--sigbg);color:var(--sig);white-space:nowrap}
.pillbda.none{background:var(--panel);color:var(--quiet)}
.stagebar{display:flex;gap:8px;overflow-x:auto;padding-bottom:4px;margin-bottom:14px}
.stagebar button{flex:1 0 120px;display:flex;flex-direction:column;align-items:flex-start;gap:2px;background:var(--card);border:1px solid var(--rule);border-radius:14px;padding:10px 14px;cursor:pointer;box-shadow:var(--shadow);text-align:left;position:relative;overflow:hidden}
.stagebar button::before{content:"";position:absolute;left:0;top:0;bottom:0;width:4px;background:var(--sc,var(--sig))}
.stagebar button b{font-size:20px;font-variant-numeric:tabular-nums;letter-spacing:-.01em}
.stagebar button span{font-size:12.5px;color:var(--quiet);white-space:nowrap}
.stagebar button[aria-pressed=true]{border-color:var(--sig);box-shadow:0 0 0 3px var(--sigbg)}
.table.crm td{padding:10px 14px}
select.inline{min-height:32px;padding:4px 8px;font-size:13px;border-radius:8px;width:auto;max-width:180px}
.board{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(260px,1fr);gap:12px;overflow-x:auto;padding-bottom:8px;align-items:start}
.bcol{background:var(--panel);border:1px solid var(--rule);border-radius:16px;padding:10px;min-height:200px;transition:box-shadow .15s}
.bcol.over{box-shadow:0 0 0 3px var(--sigbg);border-color:var(--sig)}
.bcol header{display:flex;align-items:center;gap:8px;padding:4px 4px 10px}
.bcol header i{width:10px;height:10px;border-radius:50%;background:var(--sc,var(--quiet))}
.bcol header .n{margin-left:auto;font-size:12.5px;color:var(--quiet);background:var(--card);border-radius:999px;padding:1px 8px;font-variant-numeric:tabular-nums}
.bcol-list{display:flex;flex-direction:column;gap:8px;max-height:68vh;overflow:auto}
.lcard{background:var(--card);border:1px solid var(--rule);border-radius:12px;padding:10px 12px;box-shadow:var(--shadow);cursor:grab;display:flex;flex-direction:column;gap:8px}
.lcard:hover{border-color:light-dark(#c9cfe0,#33435a)}
.lcard.drag{opacity:.5}
.lcard .meta{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.lcard .demo{color:var(--sig);font-weight:500}
.empty-col{padding:8px 4px}
.cal{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));border:1px solid var(--rule);border-radius:16px;overflow:hidden;background:var(--card);box-shadow:var(--shadow)}
.cwh{padding:10px 12px;font-size:12px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--quiet);background:var(--panel);border-bottom:1px solid var(--rule)}
.cday{min-height:118px;padding:6px;border-right:1px solid var(--rule);border-bottom:1px solid var(--rule);display:flex;flex-direction:column;gap:3px}
.cday:nth-child(7n){border-right:0}
.cday.out{background:light-dark(#fafbfd,#0f161f)}.cday.out .dn{color:var(--quiet);opacity:.6}
.cday .dn{font-size:12.5px;font-weight:600;padding:2px 4px;align-self:flex-start;border-radius:999px;font-variant-numeric:tabular-nums}
.cday.today .dn{background:var(--sig);color:#fff;padding:2px 8px}
.dpill{border:0;text-align:left;font-size:12px;padding:3px 6px;border-radius:6px;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background:var(--sigbg);color:var(--sig);border-left:3px solid var(--sig)}
.dpill.d-done{background:var(--goodbg);color:var(--good);border-left-color:var(--good)}
.dpill.d-no_show{background:var(--badbg);color:var(--bad);border-left-color:var(--bad)}
.dpill.d-cancelled{background:var(--panel);color:var(--quiet);border-left-color:var(--rule);text-decoration:line-through}
.cday .more{border:0;background:none;color:var(--quiet);font-size:12px;cursor:pointer;text-align:left;padding:0 4px}
.legend i.d-booked{background:var(--sig)}.legend i.d-done{background:var(--good)}.legend i.d-no_show{background:var(--bad)}.legend i.d-cancelled{background:var(--rule)}
.monthname{font-size:17px;min-width:150px;text-align:center}
@media (max-width:760px){.cday{min-height:70px}.dpill{font-size:0;padding:4px;height:8px}.cwh{padding:8px 4px;font-size:10px}}
.agenda{display:flex;flex-direction:column;gap:18px}
.aday h3{margin-bottom:8px}
.aday.today h3{color:var(--sig)}
.hbars{display:flex;flex-direction:column;gap:8px}
.hb{display:grid;grid-template-columns:minmax(0,150px) minmax(0,1fr) 56px;gap:10px;align-items:center;font-size:13.5px}
.hb .track{height:10px;background:var(--panel);border-radius:999px;overflow:hidden}
.hb .track i{display:block;height:100%;background:var(--s1);border-radius:999px}
.hb b{text-align:right}
.stack-bar{display:flex;gap:2px;height:12px;border-radius:4px;overflow:hidden;min-width:180px}
.stack-bar i{display:block;background:var(--sc,var(--quiet));min-width:3px}
.legend i.sw{width:10px;height:10px;border-radius:3px;background:var(--sc,var(--quiet))}
.legend i.sw.st-none{border:1.5px dashed var(--quiet);background:none}
.mlist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.mlist li{display:grid;grid-template-columns:1fr auto;gap:2px 8px;padding:10px 12px;background:var(--panel);border-radius:10px}
.mlist li .quiet{grid-column:1/-1}
/* premium polish */
.side{background:radial-gradient(120% 60% at 0% 0%,#1b2550 0%,#0b1120 55%)}
.head h1{font-size:28px}
.card h2{font-size:17px}
.kpi{transition:transform .15s,box-shadow .15s}
.kpi:hover{transform:translateY(-1px);box-shadow:var(--shadow-lg)}
.table th:first-child{border-top-left-radius:0}
.btn.pri{box-shadow:0 1px 2px #1018281a,inset 0 1px 0 #ffffff26}
.stack-bar i.st-none{background:var(--rule)}
