/* treehouse digital crm v2. Layout + components after the bionis / tallie dashboards and watermelon ui
   (card, badge, breadcrumb, tabs, data table), in treehouse colours. Helvetica Neue only. */
:root{
  --bg:#FFFFFF; --fg:#202124; --ink:#202124; --ink-2:#3C4043;
  --muted:#5F6368; --muted-2:#80868B; --secondary:#F1F3F4; --field:#F1F3F4;
  --line:#E8EAED; --line-2:#DADCE0; --grid:#F1F3F4;
  --side:#F8F9FA; --side-line:#E8EAED;
  --olive:#1E8E3E; --olive-ink:#137333; --olive-soft:#E6F4EA; --olive-fill:#CEEAD6; /* v2.12: "olive" = positive / ok (google green) */
  --primary:#1A73E8; --primary-ink:#185ABC; --primary-soft:#E8F0FE; --primary-ring:rgba(26,115,232,.18);
  --yellow:#F9AB00; --yellow-ink:#B06000; --yellow-soft:#FEF7E0; --sand:#F5F0E4; --tundra:#E0EAE7;
  --terra:#D93025; --terra-ink:#B3261E; --terra-soft:#FCE8E6; /* v2.12: "terra" = negative / error (google red) */
  --r:16px; --r-md:12px; --r-sm:10px; --r-xs:8px;
  --font:"Helvetica Neue",Helvetica,Arial,sans-serif;
  --shadow-xs:0 1px 2px rgba(0,0,0,.04); --shadow-sm:0 1px 3px rgba(0,0,0,.06),0 1px 2px rgba(0,0,0,.03);
  --shadow:1px 2px 12px rgba(158,158,158,.08);
}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;font-family:var(--font);font-size:14px;line-height:1.5;color:var(--ink);background:var(--bg);-webkit-font-smoothing:antialiased;text-transform:none}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}
h1,h2,h3{margin:0;font-weight:500;letter-spacing:-.025em;line-height:1.15}
p{margin:0}
code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;background:var(--field);padding:2px 6px;border-radius:6px;word-break:break-all}
button,input,select,textarea{font:inherit;color:inherit}
::selection{background:var(--olive-soft)}
.muted{color:var(--muted)} .small{font-size:12px} .block{display:block} .right{text-align:right} .terra{color:var(--terra)} .strong{font-weight:500}
.eyebrow{font-size:11px;font-weight:500;color:var(--muted);margin-bottom:6px}
.hint{font-size:12px;color:var(--muted);margin-top:10px}
.link{color:var(--olive);font-weight:600}.link:hover{text-decoration:underline}
.link.danger,.danger{color:var(--terra);background:none;border:0;padding:0;cursor:pointer;font-weight:600;font-size:13px}

/* layout */
.app{display:grid;grid-template-columns:248px 1fr;min-height:100vh}
.sidebar{position:sticky;top:0;height:100vh;display:flex;flex-direction:column;background:var(--side);border-right:1px solid var(--line);padding:22px 14px 14px;overflow-y:auto}
.brand{display:block;padding:2px 10px 22px}.brand img{height:38px;width:auto}
.nav{display:flex;flex-direction:column;gap:1px;flex:1}
.nav-group{font-size:11px;font-weight:500;color:#9AA0A6;padding:18px 12px 6px}
.nav-item{display:flex;align-items:center;gap:10px;padding:8px 12px;border-radius:10px;color:var(--ink-2);font-weight:600;transition:background .15s,color .15s}
.nav-item i{width:6px;height:6px;border-radius:50%;background:#DADCE0;flex:none;transition:background .15s}
.nav-item:hover{background:#F1F3F4;color:var(--ink)}
.nav-item.active{background:#fff;color:var(--ink);box-shadow:0 0 0 1px var(--line),0 2px 6px rgba(32,33,36,.04)}
.nav-item.active i{background:var(--terra)}
.sidebar-foot{border-top:1px solid var(--line);padding-top:10px;margin-top:14px}
.me{display:flex;align-items:center;gap:10px;padding:10px 6px 0}
.me-copy{flex:1;min-width:0}.me-copy strong{display:block;font-size:13px}.me-copy span{display:block;font-size:11px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.avatar{width:32px;height:32px;border-radius:50%;background:var(--olive);color:#fff;display:grid;place-items:center;font-size:12px;font-weight:500;flex:none}
.avatar.lg{width:44px;height:44px;font-size:15px}
.main{min-width:0;display:flex;flex-direction:column}
.topbar{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:16px;padding:16px 36px;background:rgba(255,255,255,.86);backdrop-filter:saturate(180%) blur(16px);-webkit-backdrop-filter:saturate(180%) blur(16px);border-bottom:1px solid var(--line)}
.topbar-title{flex:1;min-width:0;display:flex;align-items:baseline;gap:14px}
.topbar-title h1{font-size:20px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.live-dot{font-size:12px;color:var(--muted);display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.live-dot::before{content:"";width:7px;height:7px;border-radius:50%;background:#DADCE0}
.live-dot.on::before{background:var(--olive);box-shadow:0 0 0 3px var(--olive-soft)}
.topbar-actions{display:flex;align-items:center;gap:8px}

.menu-btn{display:none}
.body{padding:32px 36px 80px;max-width:1360px;width:100%;display:flex;flex-direction:column;gap:22px}

/* buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:38px;padding:0 16px;border-radius:999px;border:1px solid transparent;font-weight:500;font-size:13px;cursor:pointer;white-space:nowrap;transition:transform .12s,background .15s,border-color .15s,box-shadow .15s;background:none}
.btn:active{transform:scale(.98)}
.btn-dark{background:var(--ink);color:#fff}.btn-dark:hover{background:#000}
.btn-ghost{background:#fff;border-color:var(--line-2);color:var(--ink)}.btn-ghost:hover{border-color:#BDC1C6}
.btn-olive{background:var(--olive);color:#fff}.btn-olive:hover{background:var(--olive-ink)}
.btn-terra{background:var(--terra);color:#fff}.btn-terra:hover{background:#B3261E}
.btn-sm{height:32px;padding:0 12px;font-size:12px}
.btn-wide{width:100%;height:46px;font-size:14px}
.btn[disabled],.is-busy .btn{opacity:.6;pointer-events:none}
.is-busy .spin{display:inline-block;animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.icon-btn{width:32px;height:32px;border-radius:50%;border:1px solid var(--line-2);background:#fff;cursor:pointer;display:inline-grid;place-items:center;font-size:14px;color:var(--ink-2);flex:none;list-style:none}
.icon-btn::-webkit-details-marker{display:none}
.icon-btn:hover{border-color:#BDC1C6;color:var(--ink)}
.inline-form{display:inline-flex;margin:0}
.row-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}

/* forms */
input:not([type=checkbox]):not([type=radio]):not([type=file]),select,textarea{width:100%;height:40px;padding:0 12px;border:1px solid transparent;border-radius:var(--r-sm);background:var(--field);outline:none;transition:border-color .15s,background .15s,box-shadow .15s;font-size:14px}
textarea{height:auto;padding:10px 12px;resize:vertical;min-height:72px;line-height:1.5}
select{appearance:none;-webkit-appearance:none;padding-right:32px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238B8B86' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;cursor:pointer}
.topbar select{background-color:#fff;border-color:var(--line-2);height:38px;border-radius:999px}
input:focus,select:focus,textarea:focus{background:#fff;border-color:var(--olive);box-shadow:0 0 0 4px var(--olive-soft)}
input[readonly]{color:var(--ink-2);font-size:12px}
input[type=file]{font-size:12px;padding:8px 0}
.field{display:flex;flex-direction:column;gap:6px;min-width:0}
.field>span,.field-label{font-size:12px;font-weight:600;color:var(--ink-2)}
.field em.saved{font-style:normal;color:var(--olive);font-weight:500;margin-left:4px}
.check{display:flex;align-items:flex-start;gap:10px;cursor:pointer;font-weight:500;margin-top:14px}
.check input{width:18px;height:18px;accent-color:var(--olive);margin:1px 0 0;flex:none}
.stack{display:flex;flex-direction:column;gap:14px}.stack-sm{display:flex;flex-direction:column;gap:8px}.stack-lg{display:flex;flex-direction:column;gap:22px}
.grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px}
.grid-3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
.grid-2.tight{gap:14px}
.grid-side{display:grid;grid-template-columns:minmax(300px,380px) 1fr;gap:22px;align-items:start}
.grid-side.rev{grid-template-columns:1fr minmax(280px,360px)}
.grid-cal{display:grid;grid-template-columns:1fr 320px;gap:22px;align-items:start}
.divider{height:1px;background:var(--line);margin:20px 0}

/* cards */
.card{background:#fff;border:1px solid var(--line);border-radius:var(--r);padding:24px;min-width:0}
.card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:18px}
.card-head h3{font-size:16px}.card-head h3.big{font-size:22px}
.card-head p{font-size:13px;color:var(--muted);margin-top:4px}
.table-card{padding:6px 8px}
.section-title{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;flex-wrap:wrap}
.section-title h2{font-size:30px}
.section-title p{color:var(--muted);margin-top:6px}
.hero-line{padding:6px 0 2px}
.display{font-size:clamp(30px,3.6vw,46px);letter-spacing:-.04em;font-weight:600}
.title-input{font-size:30px!important;font-weight:600;letter-spacing:-.03em;height:auto!important;padding:2px 0!important;background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0!important;min-width:min(560px,80vw)}
.title-input:focus{border-bottom:2px solid var(--olive)!important}
.meta-row{display:flex;align-items:center;gap:12px;margin-top:8px;font-size:13px}

/* metrics */
.metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px}
.metrics.small .metric{padding:16px}
.metrics.small .metric-value{font-size:22px}
.metric{border:1px solid var(--line);border-radius:var(--r);padding:20px;display:flex;flex-direction:column;gap:4px;background:#fff}
.metric-label{font-size:12px;font-weight:600;color:var(--muted)}
.metric-value{font-size:28px;font-weight:600;letter-spacing:-.03em}
.metric small{font-size:12px;color:var(--muted)}
.metric.olive .metric-value{color:var(--olive)}
.metric.terra .metric-value{color:var(--terra)}

/* pills, chips */
.pill{display:inline-flex;align-items:center;gap:6px;height:24px;padding:0 10px;border-radius:999px;font-size:11px;font-weight:500;white-space:nowrap;background:#F1F3F4;color:var(--ink-2)}
.pill::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;opacity:.7}
.pill-olive{background:var(--olive-soft);color:var(--olive-ink)}
.pill-terra{background:var(--terra-soft);color:var(--terra)}
.pill-ink{background:var(--ink);color:#fff}
.pill-soft{background:#F5F0E4;color:#7A6A3A}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chip{display:inline-flex;align-items:center;height:24px;padding:0 10px;border-radius:999px;background:var(--field);font-size:11px;font-weight:600;color:var(--ink-2)}
.chip-btn{border:0;cursor:pointer}.chip-btn:hover{background:var(--terra-soft);color:var(--terra)}

/* tables */
.table{width:100%;border-collapse:collapse}
.table th{font-size:11px;font-weight:500;letter-spacing:.06em;color:var(--muted);text-align:left;padding:12px 14px;border-bottom:1px solid var(--line);white-space:nowrap}
.table td{padding:14px;border-bottom:1px solid var(--line);vertical-align:middle}
.table tr:last-child td{border-bottom:0}
.table tbody tr{transition:background .12s}.table tbody tr:hover{background:#F8F9FA}
.table.compact td,.table.compact th{padding:8px 10px;font-size:13px}
.table .empty,.empty-block{text-align:center;color:var(--muted);padding:40px 16px}
.table-card{overflow-x:auto}

/* toasts / notes */
.toast{position:relative;margin:18px 36px 0;padding:12px 44px 12px 16px;border-radius:var(--r-sm);background:var(--olive-soft);color:var(--olive-ink);font-weight:600;animation:in .25s ease}
.toast-error{background:var(--terra-soft);color:var(--terra)}
.toast-x{position:absolute;right:10px;top:8px;border:0;background:none;font-size:18px;cursor:pointer;color:inherit;opacity:.6}
@keyframes in{from{opacity:0;transform:translateY(-4px)}}
.note{border-radius:var(--r-sm);padding:14px 16px;background:var(--field)}
.note strong{display:block;font-size:13px}.note p{font-size:13px;color:var(--ink-2);margin-top:2px}
.note.olive{background:var(--olive-soft)}.note.terra{background:var(--terra-soft)}.note.terra strong{color:var(--terra)}

/* dashboard */
.bars{display:flex;flex-direction:column;gap:12px;margin-bottom:20px}
.bar-row{display:grid;grid-template-columns:90px 1fr 90px;align-items:center;gap:12px;font-size:13px}
.bar-row strong{text-align:right}
.bar{height:8px;border-radius:999px;background:#F1F3F4;overflow:hidden}
.bar i{display:block;height:100%;border-radius:inherit;background:var(--ink);transition:width .6s cubic-bezier(.2,.7,.2,1)}
.bar.olive i{background:var(--olive)}
.channel-list{display:flex;flex-direction:column}
.warnings{display:flex;flex-direction:column;gap:10px}
.warning{display:flex;gap:12px;padding:12px 14px;border-radius:var(--r-sm);background:var(--field)}
.warning i{width:8px;height:8px;border-radius:50%;margin-top:6px;flex:none;background:var(--muted)}
.warning.ok i{background:var(--olive)}.warning.crit i,.warning.warn i{background:var(--terra)}.warning.info i{background:var(--ink)}
.warning.crit{background:var(--terra-soft)}
.warning p{font-size:12px;color:var(--muted)}

/* campaign editor */
.flow{display:flex;gap:6px;overflow-x:auto;padding-bottom:2px}
.flow-step{flex:1;min-width:110px;display:flex;flex-direction:column;gap:8px;font-size:12px;font-weight:600;color:var(--muted)}
.flow-step i{height:4px;border-radius:999px;background:#E8EAED}
.flow-step.done i{background:var(--olive)}.flow-step.done{color:var(--ink-2)}
.flow-step.now i{background:var(--terra)}.flow-step.now{color:var(--ink)}
.creatives{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:16px}
.creative{display:grid;grid-template-columns:132px 1fr;gap:14px;border:1px solid var(--line);border-radius:var(--r);padding:12px}
.creative-media{position:relative;aspect-ratio:4/5;border-radius:10px;overflow:hidden;background:var(--field)}
.creative-media img,.creative-media iframe{width:100%;height:100%;object-fit:cover;border:0}
.creative-media .count{position:absolute;left:8px;top:8px;background:rgba(255,255,255,.92);border-radius:999px;font-size:11px;font-weight:500;padding:2px 8px}
.creative-fields{display:flex;flex-direction:column;gap:10px;min-width:0}
.no-preview{height:100%;min-height:120px;display:grid;place-items:center;text-align:center;font-size:12px;color:var(--muted);padding:12px}
details.more{border-top:1px solid var(--line);padding-top:10px}
details.more summary{cursor:pointer;font-size:12px;font-weight:500;color:var(--ink-2);list-style:none}
details.more summary::before{content:"+ "}details.more[open] summary::before{content:"– "}
details.more[open]>*:not(summary){margin-top:10px}
.kpis{display:flex;flex-direction:column;gap:8px}
.kpi-row{display:grid;grid-template-columns:1.3fr 1fr .6fr 32px;gap:8px;align-items:center}
.strategy-box{border:1px dashed var(--line-2);border-radius:var(--r);padding:14px;display:flex;flex-direction:column;gap:10px}
.strategy-box iframe{width:100%;height:340px;border:0;border-radius:10px;background:var(--field)}
.strategy-box img{max-height:340px;width:100%;object-fit:contain;border-radius:10px;background:var(--field)}
.snapshot{margin-top:22px;padding:18px;border-radius:var(--r);background:var(--olive-soft)}
.plan-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-top:8px}
.plan-grid span{display:block;font-size:11px;color:var(--muted);font-weight:600}
.workflow-actions{display:flex;flex-wrap:wrap;gap:8px}
.sticky-save{position:sticky;bottom:18px;display:flex;justify-content:flex-end;pointer-events:none}
.sticky-save .btn{pointer-events:auto;box-shadow:0 10px 30px rgba(32,33,36,.18);height:44px;padding:0 22px}
.link-rows{display:flex;flex-direction:column;gap:8px;margin-bottom:16px}
.link-row{display:flex;align-items:center;gap:8px}
.link-row strong{min-width:150px;font-size:13px}
.link-row input{flex:1;min-width:0}
.send-row{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.send-row>*{flex:1 1 160px}.send-row .btn{flex:0 0 auto}
.log-row{padding:10px 0;border-bottom:1px solid var(--line);display:flex;flex-direction:column;gap:2px}
.log-row:last-child{border-bottom:0}.log-row p{font-size:13px;color:var(--ink-2)}.log-row span{font-size:12px}
/* v2.10.1: team rows stay on one line — badges sit next to the name, no column stretch gap */
.team-list .team-row,.team-list .log-row{flex-direction:row;align-items:center;flex-wrap:wrap;gap:12px}
.team-list .team-who{flex:1 1 220px;min-width:180px;display:flex;flex-direction:column;gap:2px}
.team-list .team-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;flex:0 1 auto;margin-left:auto}
.danger-zone{margin-top:18px;padding-top:14px;border-top:1px solid var(--line)}

/* campaign dashboard */
.dash-card{display:flex;flex-direction:column;gap:18px}
.dash-card .card-head{margin-bottom:0}
.progress-pair{display:grid;grid-template-columns:1fr 1fr;gap:22px}
.progress-pair span{display:block;font-size:12px;color:var(--muted);font-weight:600;margin-bottom:6px}
.opt-box{border:1px solid var(--line);border-radius:var(--r);padding:16px;display:flex;flex-direction:column;gap:10px}
.opt-box.due{border-color:var(--terra);background:#FEF7F6}
.opt-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
.inline-grid{display:flex;align-items:flex-end;gap:8px;flex-wrap:wrap}
.inline-grid .field{flex:1 1 150px}.inline-grid .field.wide{flex:3 1 260px}
.ad-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:12px;margin-top:14px}
.ad{border:1px solid var(--line);border-radius:12px;padding:8px;font-size:12px;display:flex;flex-direction:column;gap:4px}
.ad img{aspect-ratio:1;object-fit:cover;border-radius:8px;width:100%}.ad span{color:var(--muted)}

/* clients */
.client-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px}
.client-card{display:flex;flex-direction:column;gap:10px;transition:border-color .15s,box-shadow .15s,transform .15s}
.client-card:hover{border-color:var(--line-2);box-shadow:var(--shadow);transform:translateY(-1px)}
.client-top{display:flex;justify-content:space-between;align-items:center}
.client-card h3{font-size:18px}
.client-foot{display:flex;justify-content:space-between;font-size:12px;color:var(--muted);border-top:1px solid var(--line);padding-top:10px;margin-top:auto}
.list-row{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--line)}
.list-row:last-child{border-bottom:0}.list-row>div{display:flex;flex-direction:column;min-width:0}
.list-row strong{flex:1}.list-row:hover strong{color:var(--olive)}

/* tabs */
.tabs{display:flex;gap:4px;flex-wrap:wrap;background:var(--field);padding:4px;border-radius:999px;width:max-content;max-width:100%}
.tab{border:0;background:none;padding:7px 14px;border-radius:999px;font-weight:600;font-size:13px;color:var(--ink-2);cursor:pointer}
.tab b{font-weight:500;color:var(--muted);margin-left:4px}
.tab.active{background:#fff;color:var(--ink);box-shadow:0 1px 3px rgba(32,33,36,.08)}

.dot{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:6px;vertical-align:-1px;flex:none}


/* settings */
.test-grid{display:flex;flex-direction:column}
.test-row{display:grid;grid-template-columns:140px 130px 1fr auto;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--line)}
.test-row:last-child{border-bottom:0}
.kv{margin:0;display:flex;flex-direction:column}
.kv>div{display:grid;grid-template-columns:170px 1fr;gap:16px;padding:12px 0;border-bottom:1px solid var(--line)}
.kv>div:last-child{border-bottom:0}
.kv dt{font-size:12px;font-weight:500;color:var(--muted)}.kv dd{margin:0;word-break:break-word}

/* auth */
.auth{min-height:100vh;display:grid;place-items:center;background:radial-gradient(1200px 600px at 10% -10%,var(--olive-soft),transparent 60%),radial-gradient(900px 500px at 110% 110%,var(--terra-soft),transparent 60%),#fff;padding:24px}
.auth-card{width:100%;max-width:400px;background:#fff;border:1px solid var(--line);border-radius:24px;padding:36px;box-shadow:var(--shadow);display:flex;flex-direction:column;gap:14px}
.auth-card.wide{max-width:620px}
.auth-logo{height:40px;width:auto;margin-bottom:10px;align-self:flex-start;object-fit:contain}
.auth-card h1{font-size:34px;letter-spacing:-.04em}
.auth-card .toast{margin:0}
.checklist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;font-size:13px}
.checklist li::before{content:"○";display:inline-block;width:20px;font-weight:500}
.checklist li.ok::before{content:"✓";color:var(--olive)}.checklist li.bad::before{content:"×";color:var(--terra)}
.checklist li.bad{color:var(--terra)}

/* client filter */


/* responsive */
@media (max-width:1180px){.grid-3{grid-template-columns:1fr 1fr}}
@media (max-width:960px){
  .app{grid-template-columns:1fr}
  .sidebar{position:fixed;left:0;top:0;z-index:50;width:260px;transform:translateX(-100%);transition:transform .25s ease;box-shadow:0 0 40px rgba(0,0,0,.08)}
  .sidebar.open{transform:none}
  .menu-btn{display:inline-grid}
  .topbar{padding:12px 18px;flex-wrap:wrap}
  .topbar-actions{width:100%;overflow-x:auto}
  .body{padding:22px 18px 80px}
  .toast{margin:14px 18px 0}
  .grid-2,.grid-3,.grid-side,.grid-side.rev,.progress-pair{grid-template-columns:1fr}
  .test-row{grid-template-columns:1fr auto}
  .test-row .muted{grid-column:1/-1}
  .creative{grid-template-columns:100px 1fr}
  .link-row{flex-wrap:wrap}.link-row strong{min-width:100%}
  .kv>div{grid-template-columns:1fr;gap:4px}
  .title-input{min-width:0;width:100%}
}
@media (prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* ======================================================================= v2 layer (wins over legacy) */
body{font-family:var(--font);font-size:14px;letter-spacing:0;color:var(--fg)}
h1,h2,h3{font-weight:500;letter-spacing:-.01em}
.num,td.n,th.n,.kpi-value,.badge{font-variant-numeric:tabular-nums}
.muted{color:var(--muted)}
.eyebrow{font-size:12px;font-weight:500;letter-spacing:0;color:var(--muted);text-transform:none;margin-bottom:4px}
.hero-line,.display{display:none}
.section-title h2{font-size:20px}
.title-input{font-size:22px!important;font-weight:500}

/* shell: sidebar (bionis) + topbar */
.app{grid-template-columns:240px minmax(0,1fr);background:var(--bg)}
.sidebar{background:var(--side);border-right:1px solid var(--side-line);padding:0}
.side-head{height:64px;display:flex;align-items:center;padding:0 18px;border-bottom:1px solid var(--side-line);flex:none}
.side-head img{height:26px;width:auto}
.nav{padding:14px 12px;gap:2px}
.nav-group{font-size:13px;font-weight:400;letter-spacing:0;color:var(--muted);padding:14px 12px 6px}
.nav-group:first-child{padding-top:2px}
.nav-item{height:40px;gap:10px;padding:0 12px;border-radius:var(--r-md);border:1px solid transparent;color:var(--muted);font-weight:400;font-size:14px}
.nav-item svg{width:18px;height:18px;flex:none;stroke:currentColor;fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.nav-item:hover{background:#fff;color:var(--fg)}
.nav-item.active{background:#fff;border-color:var(--line);color:var(--fg);font-weight:500;box-shadow:var(--shadow)}
.nav-item .count{margin-left:auto;font-size:12px;color:var(--muted);background:#fff;border:1px solid var(--line);border-radius:6px;padding:1px 6px}
.sidebar-foot{border-top:1px solid var(--side-line);margin:0;padding:10px 12px 12px}
.me{padding:8px 4px 0}
.avatar{width:32px;height:32px;border-radius:var(--r-sm);background:var(--olive);font-weight:500}
.topbar{height:64px;padding:0 24px;gap:12px;background:rgba(255,255,255,.92);border-bottom:1px solid var(--line)}
.crumbs{flex:1;min-width:0}
.crumbs ol{list-style:none;margin:0;padding:0;display:flex;align-items:center;gap:8px;font-size:14px;color:var(--muted);white-space:nowrap;overflow:hidden}
.crumbs li{display:inline-flex;align-items:center;gap:8px;min-width:0}
.crumbs li a:hover{color:var(--fg)}
.crumbs li[aria-current]{color:var(--fg);overflow:hidden;text-overflow:ellipsis;display:block}
.crumbs .sep svg{width:14px;height:14px;stroke:var(--muted-2);fill:none;stroke-width:2}
.topbar-actions{gap:8px;flex:none}
.body{max-width:none;padding:24px 28px 72px;gap:20px}

/* controls */
.btn{height:36px;padding:0 14px;border-radius:var(--r-sm);font-weight:500;font-size:13px;gap:6px}
.btn svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.btn-ghost,.btn-outline{background:#fff;border-color:var(--line-2);color:var(--fg);box-shadow:0 2px 4px rgba(0,0,0,.04)}
.btn-ghost:hover,.btn-outline:hover{background:var(--secondary);border-color:var(--line-2)}
.btn-dark{background:var(--fg);color:#fff}.btn-dark:hover{background:#000}
.btn-olive{background:var(--olive)}.btn-olive:hover{background:var(--olive-ink)}
.btn-sm{height:30px;padding:0 10px;font-size:12px}
.icon-btn{border-radius:var(--r-sm)}
body:not(.th-login) input:not([type=checkbox]):not([type=radio]):not([type=file]),body:not(.th-login) select,body:not(.th-login) textarea{border-radius:var(--r-sm);background:var(--field);height:36px;font-size:14px}
textarea{height:auto}
.topbar select,.select-pill{background-color:#fff;border:1px solid var(--line-2);height:36px;border-radius:var(--r-sm);box-shadow:0 2px 4px rgba(0,0,0,.04);font-size:13px;width:auto;min-width:0;max-width:220px}
body:not(.th-login) input:focus,body:not(.th-login) select:focus,body:not(.th-login) textarea:focus{border-color:var(--olive);box-shadow:0 0 0 3px var(--olive-soft)}

/* dropdown (range picker, column visibility) */
.dd{position:relative}
.dd>summary{list-style:none}
.dd>summary::-webkit-details-marker{display:none}
.dd-menu{position:absolute;right:0;top:calc(100% + 6px);z-index:60;min-width:220px;background:#fff;border:1px solid var(--line);border-radius:var(--r-md);box-shadow:0 10px 30px rgba(0,0,0,.08),0 2px 6px rgba(0,0,0,.04);padding:6px}
.dd-item{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 10px;border-radius:var(--r-xs);font-size:13px;color:var(--muted);cursor:pointer;white-space:nowrap}
.dd-item:hover{background:var(--secondary);color:var(--fg)}
.dd-item.on{color:var(--fg);font-weight:500}
.dd-item small{color:var(--muted-2);font-size:12px;font-weight:400}
.dd-sep{height:1px;background:var(--line);margin:6px 0}
.dd-form{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:6px 4px 2px}
.dd-form label{font-size:12px;color:var(--muted);display:flex;flex-direction:column;gap:4px}
.dd-form input{height:32px!important;font-size:13px!important}
.dd-form .btn{grid-column:1/-1;height:32px}
.dd-check{display:flex;align-items:center;gap:8px;padding:7px 10px;font-size:13px;border-radius:var(--r-xs);cursor:pointer}
.dd-check:hover{background:var(--secondary)}
.dd-check input{accent-color:var(--olive);width:15px;height:15px;margin:0}

/* badge (watermelon ui): rounded-full, px-2 py-0.5, text-xs, medium */
.badge,.pill{display:inline-flex;align-items:center;gap:5px;height:auto;padding:2px 8px;border:1px solid transparent;border-radius:999px;font-size:12px;line-height:16px;font-weight:500;white-space:nowrap;background:var(--secondary);color:var(--ink-2);width:fit-content}
.pill::before{display:none}
.badge-dot::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;flex:none}
.badge-olive,.pill-olive{background:var(--olive-soft);color:var(--olive-ink)}
.badge-terra,.pill-terra{background:var(--terra-soft);color:var(--terra-ink)}
.badge-neutral,.pill-soft{background:var(--secondary);color:var(--muted)}
.badge-outline{background:#fff;border-color:var(--line-2);color:var(--fg)}
.badge-dark,.pill-ink{background:var(--fg);color:#fff}
.badge svg{width:12px;height:12px;stroke:currentColor;fill:none;stroke-width:2}

/* tabs (watermelon ui): muted track, white active pill */
.tabs,.seg{display:inline-flex;align-items:center;gap:0;height:36px;padding:3px;background:var(--secondary);border-radius:var(--r-sm);width:max-content;max-width:100%;overflow-x:auto}
.tab,.seg a,.seg button,.seg label{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:100%;padding:0 12px;border:1px solid transparent;border-radius:7px;font-size:13px;font-weight:500;color:var(--muted);background:none;cursor:pointer;white-space:nowrap}
.tab.active,.seg .on{background:#fff;color:var(--fg);box-shadow:var(--shadow-sm)}
.tab b,.seg b{font-weight:500;color:var(--muted-2)}

/* card (watermelon ui) */
.card{border-radius:var(--r);border-color:var(--line);box-shadow:var(--shadow-xs);padding:20px}
.card-head{margin-bottom:16px;align-items:center}
.card-head h3{font-size:15px;font-weight:500;line-height:1.3}
.card-head p{font-size:13px;color:var(--muted);margin-top:2px}
.card-flush{padding:0;overflow:hidden}
.card-flush>.card-head{padding:16px 20px 0;margin-bottom:12px}

/* period strip under the top bar */
.period{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.period-text{font-size:13px;color:var(--muted);display:flex;flex-wrap:wrap;gap:6px 14px;align-items:center}
.period-text strong{color:var(--fg);font-weight:500}
.period-tools{display:flex;gap:8px;align-items:center;flex-wrap:wrap}

/* kpi tiles (bionis key metric card / tallie metric) */
.kpis-v2{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:12px}
.kpi{display:flex;flex-direction:column;justify-content:space-between;gap:14px;min-height:122px;padding:16px;border:1px solid var(--line);border-radius:var(--r);background:#fff;box-shadow:var(--shadow-xs);min-width:0}
.kpi-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.kpi-label{font-size:13px;font-weight:500;color:var(--fg)}
.kpi-value{font-size:26px;line-height:1;font-weight:500;letter-spacing:-.02em;white-space:nowrap}
.kpi-foot{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:12px;color:var(--muted)}
.kpi.primary{background:#F8F9FA}

/* chart card */
.chart-card .card-head{flex-wrap:wrap}
.legend-v2{display:flex;flex-wrap:wrap;gap:14px;font-size:12px;color:var(--muted);align-items:center}
.legend-v2 span{display:inline-flex;align-items:center;gap:6px;cursor:pointer;user-select:none}
.legend-v2 span.off{opacity:.4}
.legend-v2 i{display:inline-block;width:10px;height:10px;border-radius:3px}
.legend-v2 i.line{height:2px;border-radius:2px;width:14px}
.chart{position:relative;width:100%;height:var(--h,300px)}
.chart svg{display:block;width:100%;height:100%;overflow:visible}
.chart .grid line{stroke:var(--grid);stroke-dasharray:4 4}
.chart .tick{fill:var(--muted);font-size:11px;font-family:var(--font)}
.chart-tip{position:absolute;pointer-events:none;z-index:5;min-width:170px;background:#F8F9FA;border:1px solid var(--line);border-radius:var(--r-xs);box-shadow:0 6px 18px rgba(0,0,0,.08);padding:6px;font-size:12px;display:none}
.chart-tip .t{padding:2px 6px 4px;color:var(--muted);font-size:11px}
.chart-tip .r{display:flex;justify-content:space-between;gap:12px;align-items:center;background:#fff;border:1px solid rgba(0,0,0,.04);border-radius:6px;padding:4px 6px;margin-top:3px}
.chart-tip .r span{display:inline-flex;align-items:center;gap:6px;color:var(--fg)}
.chart-tip .r i{width:6px;height:6px;border-radius:2px;display:inline-block}
.chart-empty{display:grid;place-items:center;height:100%;color:var(--muted);font-size:13px;border:1px dashed var(--line-2);border-radius:var(--r-md)}

/* data table (watermelon ui) */
.dt-wrap{background:#fff;border:1px solid var(--line);border-radius:var(--r);box-shadow:var(--shadow-xs);overflow:hidden;min-width:0}
.dt-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:14px 16px}
.dt-title h3{font-size:15px;font-weight:500}
.dt-title p{font-size:13px;color:var(--muted);margin-top:2px}
.dt-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.dt-search{position:relative}
.dt-search input{width:220px!important;height:34px!important;padding-left:32px!important;font-size:13px!important}
.dt-search svg{position:absolute;left:10px;top:50%;transform:translateY(-50%);width:15px;height:15px;stroke:var(--muted);fill:none;stroke-width:1.8}
.dt-scroll{overflow-x:auto;border-top:1px solid var(--line)}
table.dt{width:100%;border-collapse:collapse;font-size:13px}
table.dt th{height:40px;padding:0 12px;text-align:left;font-weight:500;color:var(--muted);background:#F8F9FA;white-space:nowrap;border-bottom:1px solid var(--line);user-select:none}
table.dt th.sortable{cursor:pointer}
table.dt th.sortable:hover{color:var(--fg)}
table.dt th .arr{display:inline-block;width:10px;margin-left:4px;color:var(--muted-2);font-size:10px}
table.dt th[aria-sort] {color:var(--fg)}
table.dt td{padding:10px 12px;border-bottom:1px solid var(--line);white-space:nowrap;vertical-align:middle}
table.dt tbody tr:last-child td{border-bottom:0}
table.dt tbody tr:hover td{background:#F8F9FA}
table.dt tbody tr.clickable{cursor:pointer}
table.dt .n{text-align:right}
table.dt tfoot td{background:#F8F9FA;font-weight:500;border-top:1px solid var(--line);border-bottom:0}
table.dt .name{white-space:normal;min-width:220px;max-width:420px}
table.dt .name a{font-weight:500}
table.dt .name a:hover{color:var(--olive)}
table.dt .sub{display:block;font-size:12px;color:var(--muted);margin-top:2px}
table.dt td.neg{color:var(--terra-ink)}
table.dt td.pos{color:var(--olive-ink)}
.dt-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px;border-top:1px solid var(--line);font-size:12px;color:var(--muted)}
.dt-foot .pager{display:flex;gap:6px;align-items:center}
.dt-empty{padding:28px;text-align:center;color:var(--muted)}
.thumb{width:40px;height:40px;border-radius:var(--r-xs);object-fit:cover;background:var(--secondary);border:1px solid var(--line);flex:none}
.cell-media{display:flex;align-items:center;gap:10px}
.bar-mini{display:block;height:4px;border-radius:2px;background:var(--secondary);margin-top:6px;overflow:hidden;min-width:80px}
.bar-mini i{display:block;height:100%;background:var(--olive)}

/* notices */
.notice{display:flex;align-items:flex-start;gap:10px;padding:12px 14px;border-radius:var(--r-md);border:1px solid var(--line);background:#fff;font-size:13px}
.notice svg{width:16px;height:16px;flex:none;margin-top:1px;stroke:currentColor;fill:none;stroke-width:1.8}
.notice.err{border-color:rgba(217,48,37,.3);background:#FCE8E6;color:var(--terra-ink)}
.notice.info{background:#F8F9FA;color:var(--ink-2)}
.notice b{font-weight:500}
.notice .list{display:flex;flex-direction:column;gap:2px}
.demo-flag{background:var(--fg);color:#fff}
.grid-main{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr);gap:20px;align-items:start}
.grid-halves{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;align-items:start}
.facts{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:0;border:1px solid var(--line);border-radius:var(--r);overflow:hidden;background:#fff}
.facts>div{padding:12px 16px;border-right:1px solid var(--line);border-bottom:1px solid var(--line);margin:-0 -1px -1px 0}
.facts .fact-l{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--muted);margin-bottom:4px}
.facts strong{display:block;font-weight:500;margin-top:3px;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.map-form{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;align-items:end}
.map-form label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--muted)}
.toast{border-radius:var(--r-md);margin:16px 28px 0}
.sync-btn .spin{display:inline-flex}
.status-line{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--muted);white-space:nowrap}

@media (max-width:1180px){.grid-main{grid-template-columns:1fr}}
@media (max-width:960px){
  .app{grid-template-columns:1fr}
  .sidebar{width:260px}
  .topbar{height:auto;min-height:56px;padding:10px 14px;flex-wrap:wrap;row-gap:8px}
  .crumbs{order:1;flex:1}
  .menu-btn{order:0}
  .topbar-actions{order:2;width:100%;overflow-x:auto;padding-bottom:2px}
  .topbar-actions .status-line{display:none}
  .body{padding:16px 14px 64px;gap:16px}
  .toast{margin:12px 14px 0}
  .grid-halves{grid-template-columns:1fr}
  .kpis-v2{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .kpi{min-height:104px;padding:14px}
  .kpi-value{font-size:22px}
  .chart{height:240px}
  .dt-head{padding:12px}
  .dt-search input{width:100%!important}
  .dt-search{flex:1 1 160px}
  .map-form{grid-template-columns:1fr}
  .dd-menu{right:auto;left:0}
  .period{align-items:flex-start}
}

/* ---- v2 pages (overview, campaigns, store, connections) ---- */
.body{display:flex;flex-direction:column;gap:20px}
.body>.tabs-block,.tabs-block>[data-panel]{display:flex;flex-direction:column;gap:12px}
.tabs-block>[data-panel][hidden]{display:none}
.tabs-block>.seg{align-self:flex-start}
.chart-svg{width:100%;height:100%}
.chart .ax{stroke:var(--line)}
.chart .grid{stroke:var(--grid,#F1F3F4);stroke-dasharray:4 4}
.chart .cursor{stroke:var(--muted-2,#9AA0A6);stroke-dasharray:3 3}
.chart .cbar{opacity:.92}
.chart-tip .r b{font-weight:500;font-variant-numeric:tabular-nums}
.legend-v2 .lg{display:inline-flex;align-items:center;gap:6px;background:none;border:0;padding:2px 0;font:inherit;color:var(--muted);cursor:pointer}
.legend-v2 .lg:hover{color:var(--fg)}
.legend-v2 .lg.off{opacity:.4;text-decoration:line-through}
.legend-v2 .lg i{display:inline-block;width:10px;height:10px;border-radius:3px}
.legend-v2 .lg i.ln{height:2px;width:14px;border-radius:2px}
.logo{display:inline-block;flex:none;vertical-align:-2px;object-fit:contain}
.seg .logo{margin-right:2px}
.cell-main{display:flex;align-items:center;gap:10px;min-width:0;max-width:440px;color:var(--fg)}
.cell-main>span{display:flex;flex-direction:column;min-width:0}
.cell-main small{font-size:12px}
a.cell-main:hover .trunc{text-decoration:underline;text-underline-offset:2px}
.trunc{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;display:block}
.trunc-cell{max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
table.dt tbody tr[data-href]{cursor:pointer}
table.dt th.asc::after{content:" ↑";color:var(--muted)}
table.dt th.desc::after{content:" ↓";color:var(--muted)}
table.dt tr.dt-none td{text-align:center;color:var(--muted);padding:28px}
table.dt td.neg{color:var(--terra)}
.dt-pager{display:flex;gap:8px;align-items:center}
.dt-foot[hidden]{display:none}
.thumb-empty{display:inline-block}
.empty-v2{display:flex;flex-direction:column;align-items:flex-start;gap:8px;padding:28px 20px;color:var(--muted);font-size:13px}
.empty-v2 strong{color:var(--fg);font-weight:500;font-size:15px}
.empty-v2 p{max-width:560px}
.rank{list-style:none;margin:0;padding:0}
.rank li+li{border-top:1px solid var(--line)}
.rank a{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;color:var(--fg)}
.rank a:hover .trunc{text-decoration:underline;text-underline-offset:2px}
.rank-name{display:flex;align-items:center;gap:8px;min-width:0;font-size:13px}
.rank-meta{display:flex;align-items:center;gap:10px;font-size:13px;flex:none}
.facts-card{padding:0;overflow:hidden}
.facts-card .facts{border:0;border-radius:0}
.facts .fact-name{grid-column:span 2}
.facts .fact-name strong{white-space:normal}
.facts .link{font-size:14px;display:inline-flex;align-items:center;gap:4px}
.facts .link svg{width:12px;height:12px}
.bars{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.bars li{display:grid;grid-template-columns:150px minmax(0,1fr) 48px 80px;gap:12px;align-items:center;font-size:13px}
.bars-track{height:8px;background:var(--secondary,#F1F3F4);border-radius:99px;overflow:hidden}
.bars-track i{display:block;height:100%;background:var(--muted-2,#BDC1C6);border-radius:99px}
.bars-track i.on{background:var(--olive)}
.bars-v,.bars-v2{text-align:right}
.group-title{font-size:13px;font-weight:500;color:var(--muted);margin:8px 0 -8px}
.conn-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(320px,1fr));gap:12px;align-items:start}
.conn{display:flex;flex-direction:column;gap:12px;padding:16px}
.conn-head{display:grid;grid-template-columns:36px minmax(0,1fr);gap:4px 12px;align-items:start}
.conn-logo{width:36px;height:36px;border:1px solid var(--line);border-radius:10px;display:grid;place-items:center;background:#fff}
.conn-title h3{font-size:14px;font-weight:500}
.conn-title p{font-size:12px;margin-top:2px;line-height:1.4}
.conn-badges{grid-column:2;display:flex;gap:6px;flex-wrap:wrap;margin-top:4px}
.conn-soon{background:#F8F9FA;box-shadow:none}
.conn-soon .conn-logo{filter:grayscale(1);opacity:.55}
.conn-soon h3{color:var(--muted)}
.conn-meta:empty{display:none}
.err-text{color:var(--terra-ink,#B3261E);margin-top:4px;word-break:break-word}
.conn-form summary{cursor:pointer;color:var(--fg);font-weight:500;list-style:none;display:inline-flex;align-items:center;gap:6px}
.conn-form summary::-webkit-details-marker{display:none}
.conn-form summary::before{content:"+";color:var(--muted);width:10px}
.conn-form[open] summary::before{content:"–"}
.conn-form form{display:flex;flex-direction:column;gap:10px;margin-top:10px}
.conn-form label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--muted)}
.conn-form label em{font-style:normal}
.conn-form input{width:100%}
.conn-actions{display:flex;gap:8px}
.inline-form{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.inline-form input{max-width:280px}
.small{font-size:12px}
code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.92em;background:var(--secondary,#F1F3F4);padding:1px 5px;border-radius:5px}
@media (max-width:960px){
  .grid-main,.grid-halves{grid-template-columns:minmax(0,1fr)}
  .facts .fact-name{grid-column:1/-1}
  .bars li{grid-template-columns:110px minmax(0,1fr) 36px 64px;gap:8px}
  .conn-grid{grid-template-columns:minmax(0,1fr)}
  .cell-main{max-width:240px}
  .period-tools{width:100%;overflow-x:auto}
  .seg{flex:none}
  .tabs-block>.seg{max-width:100%;overflow-x:auto}
}

/* ---- progressive disclosure ---- */
.kpis-main{grid-template-columns:repeat(5,minmax(0,1fr))}
@media (max-width:1280px){.kpis-main{grid-template-columns:repeat(3,minmax(0,1fr))}}
.more-kpis{display:flex;flex-direction:column;gap:12px}
.more-kpis>summary,.disclose{list-style:none;cursor:pointer;display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:500;color:var(--muted);width:fit-content;padding:4px 2px;border-radius:6px}
.more-kpis>summary::-webkit-details-marker,.acc>summary::-webkit-details-marker,.row-ads>summary::-webkit-details-marker{display:none}
.disclose:hover{color:var(--fg)}
.disclose svg,.acc-c svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2;transition:transform .15s}
.more-kpis:not([open]) .disclose svg{transform:rotate(-90deg)}
.more-kpis .open-l,.more-kpis[open] .closed-l{display:none}
.more-kpis[open] .open-l{display:inline}
.more-kpis .muted{font-weight:400}
.acc{padding:0}
.acc>summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:12px;padding:14px 20px;min-height:52px}
.acc>summary:hover{background:#F8F9FA;border-radius:var(--r)}
.acc-t{font-size:15px;font-weight:500}
.acc-m{font-size:13px;color:var(--muted);margin-left:auto;text-align:right}
.acc-c{display:grid;place-items:center;width:24px;height:24px;color:var(--muted);flex:none}
.acc-m+.acc-c{margin-left:0}
.acc-t+.acc-c{margin-left:auto}
.acc:not([open]) .acc-c svg{transform:rotate(-90deg)}
.acc-b{padding:0 20px 20px;display:flex;flex-direction:column;gap:12px}
.acc-b>.dt-wrap{margin:0 -20px -20px;border-left:0;border-right:0;border-bottom:0;border-radius:0 0 var(--r) var(--r);box-shadow:none}
.acc-b>.dt-wrap .dt-head{padding-top:12px}
.row-ads{margin-top:4px}
.row-ads>summary{list-style:none;cursor:pointer;display:inline-flex;align-items:center;gap:4px;font-size:12px;color:var(--muted)}
.row-ads>summary:hover{color:var(--fg)}
.row-ads>summary svg{width:12px;height:12px;stroke:currentColor;fill:none;stroke-width:2;transition:transform .15s}
.row-ads:not([open])>summary svg{transform:rotate(-90deg)}
.row-ads ul{list-style:none;margin:8px 0 2px;padding:0;display:flex;flex-direction:column;gap:6px;min-width:340px}
.row-ads li{display:grid;grid-template-columns:28px minmax(0,1fr) auto auto;gap:8px;align-items:center;font-size:12px}
.row-ads .thumb{width:28px;height:28px}
.facts-more{border-top:1px solid var(--line)}
.facts-more>summary{padding:10px 16px}
.soon-acc .conn-grid{padding-top:4px}
@media (max-width:960px){
  .kpis-main{grid-template-columns:repeat(2,minmax(0,1fr))}
  .acc>summary{padding:12px 16px}
  .acc-b{padding:0 16px 16px}
  .acc-b>.dt-wrap{margin:0 -16px -16px}
  .acc-m{display:none}
}
.err-details>summary{list-style:none;cursor:pointer}
.err-details>summary::-webkit-details-marker{display:none}
.err-details .list{margin-top:8px}
.err-details[open]>summary .link{display:none}

/* ======================================================================
   leon's tokens (table-20 / date range picker reference)
   ====================================================================== */
:root{
  --radius:.7rem;
  --t-bg:#F8F9FA; --t-bg:oklch(0.986 0 0);
  --t-fg:#202124; --t-fg:oklch(0.2435 0 0);
  --t-muted:#EFEFEF; --t-muted:oklch(0.9521 0 0);
  --t-muted-fg:#5F6368; --t-muted-fg:oklch(0.5032 0 0);
  --t-border:#E8E8E8; --t-border:oklch(0.932 0 0);
  --t-input:#D9D9D9; --t-input:oklch(0.8822 0 0);
  --t-accent:#E7E7E7; --t-accent:oklch(0.931 0 0);
  --t-primary:#1A73E8; --t-destructive:#D93025;
}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ---- data table (shadcn table-20 port) ---- */
.dt-wrap{background:transparent;border:0;box-shadow:none;padding:0;display:flex;flex-direction:column;gap:16px}
.dt-wrap .dt-head{padding:0;border:0}
.dt-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px}
.dt-filter{width:100%;max-width:20rem;height:36px;border:1px solid var(--t-input);border-radius:calc(var(--radius) - 2px);background:#fff;padding:0 12px;font-size:14px;box-shadow:0 1px 2px rgba(0,0,0,.04)}
.dt-filter:focus{outline:none;border-color:var(--t-primary);box-shadow:0 0 0 3px rgba(26,115,232,.18)}
.dt-tools{display:flex;gap:8px;align-items:center;margin-left:auto}
.dt-tools .btn-outline{height:36px;border-color:var(--t-input);border-radius:calc(var(--radius) - 2px);box-shadow:0 1px 2px rgba(0,0,0,.04)}
.dt-tools .btn svg{width:16px;height:16px}
.dd-right .dd-menu{right:0;left:auto}
.dd-label{padding:6px 8px;font-size:12px;font-weight:500;color:var(--t-muted-fg)}
.dd-cols{min-width:200px;max-height:60vh;overflow:auto}
.dd-cols .dd-check{text-transform:none;gap:8px;padding:6px 8px;border-radius:6px;font-size:14px}
.dd-check input{accent-color:var(--t-primary)}
.dt-box{border:1px solid var(--t-border);border-radius:var(--radius);background:#fff;overflow:hidden}
.dt-box-empty{border-style:dashed}
.dt-scroll{overflow-x:auto}
table.dt{width:100%;border-collapse:collapse;font-size:14px;color:var(--t-fg)}
table.dt th{height:48px;padding:0 16px;background:transparent;color:var(--t-muted-fg);font-weight:500;text-align:left;border-bottom:1px solid var(--t-border);white-space:nowrap}
table.dt th.n{text-align:right}
table.dt td{padding:16px;border-bottom:1px solid var(--t-border);vertical-align:middle;white-space:nowrap}
table.dt tbody tr:last-child td{border-bottom:0}
table.dt tbody tr:hover td{background:color-mix(in oklab,var(--t-muted) 50%,transparent)}
table.dt tbody tr.is-sel td{background:var(--t-muted)}
table.dt tfoot td{border-top:1px solid var(--t-border);border-bottom:0;background:color-mix(in oklab,var(--t-muted) 50%,transparent);font-weight:500}
table.dt .n,table.dt td.num{font-variant-numeric:tabular-nums}
table.dt td.n{text-align:right}
table.dt th::after{content:none!important}
.dt-sort{display:inline-flex;align-items:center;gap:8px;height:32px;margin:0 -10px;padding:0 10px;border:0;border-radius:calc(var(--radius) - 2px);background:transparent;color:inherit;font:inherit;font-weight:500;cursor:pointer;white-space:nowrap}
.dt-sort:hover{background:var(--t-accent);color:var(--t-fg)}
.dt-sort svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2;opacity:.6}
th[aria-sort=ascending] .dt-sort,th[aria-sort=descending] .dt-sort{color:var(--t-fg)}
th[aria-sort=ascending] .dt-sort svg,th[aria-sort=descending] .dt-sort svg{opacity:1}
th.n .dt-sort{flex-direction:row}
.dt-sel{width:40px;padding-right:0!important}
.dt-sel input{width:16px;height:16px;accent-color:var(--t-primary)}
.dt-act{width:48px;text-align:right;padding:8px 12px!important}
.icon-ghost{list-style:none;display:inline-grid;place-items:center;width:32px;height:32px;border-radius:calc(var(--radius) - 2px);color:var(--t-muted-fg);cursor:pointer}
.icon-ghost::-webkit-details-marker{display:none}
.icon-ghost:hover,.row-menu[open] .icon-ghost{background:var(--t-accent);color:var(--t-fg)}
.icon-ghost svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2}
.row-menu .dd-menu{min-width:210px;text-align:left}
.row-menu .dd-item{display:flex;align-items:center;gap:8px;width:100%;background:none;border:0;font:inherit;font-size:14px;cursor:pointer;text-align:left;padding:6px 8px;border-radius:6px;color:var(--t-fg)}
.row-menu .dd-item svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2;color:var(--t-muted-fg)}
.dt-foot{border:0;padding:0;display:flex;align-items:center;justify-content:space-between;font-size:14px;color:var(--t-muted-fg)}
.dt-pager{display:flex;align-items:center;gap:8px}
.dt-page{font-size:13px;margin-right:4px}
.icon-outline{display:inline-grid;place-items:center;width:32px;height:32px;border:1px solid var(--t-input);border-radius:calc(var(--radius) - 2px);background:#fff;color:var(--t-fg);cursor:pointer;box-shadow:0 1px 2px rgba(0,0,0,.04)}
.icon-outline:hover:not(:disabled){background:var(--t-accent)}
.icon-outline:disabled{opacity:.5;cursor:not-allowed}
.icon-outline svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2}
/* badges mapped to secondary / outline / destructive */
.badge-neutral{background:var(--t-muted);color:var(--t-fg)}
.badge-outline{background:transparent;border-color:var(--t-border);color:var(--t-fg)}
.badge-terra{background:var(--terra-soft);color:var(--t-destructive)}
.badge-olive{background:var(--olive-soft);color:var(--olive-ink)}

/* ---- drill-down tree ---- */
.tree-cell{display:flex;align-items:center;gap:8px;padding-left:calc(var(--d,0) * 24px);min-width:0;max-width:380px}
.tree-toggle{display:inline-grid;place-items:center;width:24px;height:24px;flex:none;border:0;border-radius:6px;background:transparent;color:var(--t-muted-fg);cursor:pointer}
.tree-toggle:hover{background:var(--t-accent);color:var(--t-fg)}
.tree-toggle svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2;transition:transform .15s}
.tree-toggle[aria-expanded=true] svg{transform:rotate(90deg)}
.tree-spacer{width:24px;flex:none}
.tree-name{display:flex;flex-direction:column;min-width:0}
.tree-name a{color:var(--t-fg)}
.tree-name a:hover{text-decoration:underline;text-underline-offset:2px}
.tree-name small{font-size:12px}
.thumb-sm{width:32px;height:32px;border-radius:6px}
table.dt-tree tr.lv-1 td{background:#F8F9FA}
table.dt-tree tr.lv-2 td{background:#F8F9FA}
table.dt-tree tr.lv-1 td,table.dt-tree tr.lv-2 td{padding-top:10px;padding-bottom:10px}
.logos{display:inline-flex;gap:4px;flex:none}
@media (prefers-reduced-motion:reduce){.tree-toggle svg{transition:none}}

/* ---- sidebar sync ---- */
.side-sync{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px;margin-bottom:8px;border:1px solid var(--line);border-radius:12px;background:#fff}
.side-sync-l{display:flex;flex-direction:column;gap:4px;min-width:0}
.side-sync-t{font-size:11px;color:var(--muted)}
.side-sync .badge{max-width:150px;overflow:hidden;text-overflow:ellipsis}

/* ---- date range picker ---- */
.drp{position:relative;height:40px;min-width:240px;display:flex;justify-content:flex-end}
.drp-shell{position:absolute;top:0;right:0;z-index:60;background:#fff;border:1px solid var(--t-border);border-radius:18px;overflow:hidden;box-shadow:0 1px 2px rgba(0,0,0,.04);
  transition:width .26s cubic-bezier(.2,.8,.2,1),height .26s cubic-bezier(.2,.8,.2,1),border-radius .26s cubic-bezier(.2,.8,.2,1),box-shadow .2s}
.drp.is-open .drp-shell{border-radius:26px;box-shadow:0 24px 60px -12px rgba(0,0,0,.18),0 8px 20px -8px rgba(0,0,0,.10)}
.drp-trigger{display:inline-flex;align-items:center;gap:8px;height:40px;padding:0 14px;border:0;background:transparent;color:var(--t-fg);font:inherit;font-size:14px;font-weight:500;cursor:pointer;white-space:nowrap;border-radius:18px}
.drp-trigger:hover{background:var(--t-bg)}
.drp-trigger svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.8}
.drp-trigger svg:last-child{color:var(--t-muted-fg);transition:transform .2s}
.drp.is-open .drp-trigger{position:absolute;opacity:0;pointer-events:none}
.drp-panel{opacity:0;transition:opacity .18s .08s}
.drp.is-open .drp-panel{opacity:1}
.drp-body{display:flex}
.drp-rail{display:flex;flex-direction:column;gap:2px;padding:14px 10px;border-right:1px solid var(--t-border);min-width:150px}
.drp-preset{border:0;background:transparent;text-align:left;font:inherit;font-size:13px;color:var(--t-fg);padding:7px 10px;border-radius:10px;cursor:pointer;white-space:nowrap}
.drp-preset:hover{background:var(--t-muted)}
.drp-preset.on{background:var(--olive-soft);color:var(--olive-ink);font-weight:500}
.drp-cal{position:relative;padding:14px 16px 8px}
.drp-nav{position:absolute;top:12px;left:12px;right:12px;display:flex;justify-content:space-between;pointer-events:none}
.drp-arrow{pointer-events:auto;display:grid;place-items:center;width:30px;height:30px;border:1px solid var(--t-border);border-radius:10px;background:#fff;color:var(--t-fg);cursor:pointer}
.drp-arrow:hover:not(:disabled){background:var(--t-muted)}
.drp-arrow:disabled{opacity:.35;cursor:default}
.drp-arrow svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2}
.drp-months{display:flex;gap:24px}
.drp-month{width:252px}
.drp-title{height:30px;display:grid;place-items:center;font-size:14px;font-weight:500;margin-bottom:6px}
.drp-row{display:grid;grid-template-columns:repeat(7,36px);margin-top:2px}
.drp-dow span{height:28px;display:grid;place-items:center;font-size:11px;color:var(--t-muted-fg)}
.drp-cell{position:relative;height:36px;display:grid;place-items:center}
.drp-cell.in::before{content:"";position:absolute;inset:3px 0;background:var(--olive-soft)}
.drp-cell.in.rl::before{left:3px;border-top-left-radius:15px;border-bottom-left-radius:15px}
.drp-cell.in.rr::before{right:3px;border-top-right-radius:15px;border-bottom-right-radius:15px}
.drp-cell.s::before{left:50%;border-radius:0}
.drp-cell.e::before{right:50%;border-radius:0}
.drp-cell.s.e::before{display:none}
.drp-cell.s.rr::before,.drp-cell.e.rl::before{display:none}
.drp-cell button{position:relative;width:30px;height:30px;border:0;border-radius:50%;background:transparent;font:inherit;font-size:13px;color:var(--t-fg);cursor:pointer;font-variant-numeric:tabular-nums}
.drp-cell button:hover:not(:disabled){background:var(--t-muted)}
.drp-cell.in button:hover:not(:disabled){background:rgba(26,115,232,.18)}
.drp-cell.s button,.drp-cell.e button{background:var(--t-primary)!important;color:#fff;font-weight:500}
.drp-cell.preview.e button{background:rgba(26,115,232,.55)!important}
.drp-cell.today button::after{content:"";position:absolute;left:50%;bottom:3px;width:4px;height:4px;margin-left:-2px;border-radius:50%;background:var(--t-primary)}
.drp-cell.today.s button::after,.drp-cell.today.e button::after{background:#fff}
.drp-cell button:disabled{color:var(--t-input);cursor:not-allowed}
.drp-cell button:focus-visible{outline:2px solid var(--t-primary);outline-offset:1px}
.drp-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;border-top:1px solid var(--t-border)}
.drp-sum{display:flex;align-items:baseline;gap:10px;font-size:13px;min-width:0}
.drp-sum strong{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.drp-sum span{color:var(--t-muted-fg);white-space:nowrap}
.drp-btns{display:flex;gap:8px;flex:none}
.drp-btns .btn{border-radius:12px;height:34px}
.btn-olive{background:var(--t-primary);color:#fff;border-color:var(--t-primary)}
.btn-olive:hover:not(:disabled){background:#185ABC}
.btn-olive:disabled{opacity:.45;cursor:not-allowed}
@media (max-width:711px){
  .drp{min-width:0}
  .drp-body{flex-direction:column}
  .drp-rail{flex-direction:row;overflow-x:auto;border-right:0;border-bottom:1px solid var(--t-border);padding:10px;gap:6px;min-width:0;scrollbar-width:none}
  .drp-rail::-webkit-scrollbar{display:none}
  .drp-preset{flex:none;border:1px solid var(--t-border);border-radius:999px;padding:6px 12px}
  .drp-preset.on{border-color:transparent}
  .drp-cal{padding:12px 8px 6px}
  .drp-month{width:100%}
  .drp-row{grid-template-columns:repeat(7,minmax(0,1fr))}
  .drp-foot{flex-wrap:wrap;padding:12px}
  .drp-trigger .drp-label{max-width:46vw;overflow:hidden;text-overflow:ellipsis}
}
@media (prefers-reduced-motion:reduce){.drp-shell,.drp-panel,.drp-trigger svg{transition:none!important}}
@media (max-width:960px){
  .topbar-actions{overflow:visible!important;justify-content:flex-start}
  .drp{justify-content:flex-start}
  .drp-shell{right:auto;left:0}
}
.cell-main>.logos{flex-direction:row;align-items:center}
table.dt td:first-child .trunc{max-width:340px}
table.dt td:first-child{min-width:200px}
.body{max-width:none}
.dt-box,.dt-scroll{position:relative}

/* breadcrumb: never overlap. separators keep their size; middle crumbs truncate with an ellipsis first on narrow screens */
.crumbs ol{overflow:hidden}
.crumbs li{flex:0 1 auto;min-width:0}
.crumbs li.sep{flex:none}
.crumbs li>a{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.crumbs li[aria-current]{flex:0 1 auto;min-width:0}
@media (max-width:720px){
  .crumbs ol{gap:6px;font-size:13.5px}
  .crumbs li{gap:6px}
  .crumbs li:first-child{flex:none}
  .crumbs li:not(:first-child):not(.sep):not([aria-current]){flex:0 3 auto;min-width:2.6em;max-width:32%}
  .crumbs li[aria-current]{flex:1 1 0;min-width:3.5em}
}

/* v2.1 · revenue + cumulative spend chart pair */
.chart-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;align-items:stretch}
.chart-pair>.card{margin:0;min-width:0}
.chart-total{display:flex;flex-direction:column;align-items:flex-end;gap:4px}
.chart-total strong{font-size:20px;font-weight:600;letter-spacing:-.01em}
.chart-empty{display:grid;place-items:center;height:240px;color:var(--t-muted-fg);font-size:13px;border:1px dashed var(--t-border);border-radius:calc(var(--radius) - 2px)}
.legend-v2 i.ln.dash,.lg i.dash{background:transparent!important;border-top:2px dashed #80868B;height:0}
@media (max-width:960px){.chart-pair{grid-template-columns:1fr}}

/* v2.1 · client logos + letter avatars */
.clogo{display:inline-grid;place-items:center;flex:none;border-radius:6px;overflow:hidden;background:#fff;box-shadow:inset 0 0 0 1px rgba(0,0,0,.06);vertical-align:middle}
.clogo img{width:100%;height:100%;object-fit:contain;display:block}
.clogo-letter{font-weight:600;letter-spacing:.01em;line-height:1;box-shadow:none;font-family:inherit}
.clogo-all{background:var(--t-muted);color:var(--t-muted-fg);box-shadow:none}
.clogo-all svg{width:62%;height:62%;stroke:currentColor;fill:none;stroke-width:1.8}
.crumbs li.has-logo>a,.crumbs li.has-logo[aria-current]{display:inline-flex;align-items:center;gap:8px;min-width:0}
.crumbs li.has-logo span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.crumbs li.has-logo .clogo{border-radius:5px}

/* v2.1 · client switcher (top bar, left of the date range) */
.csw{position:relative;flex:none}
.csw-trigger{display:inline-flex;align-items:center;gap:8px;height:40px;max-width:240px;padding:0 12px 0 10px;border:1px solid var(--t-border);border-radius:18px;background:#fff;color:var(--t-fg);font:inherit;font-size:14px;font-weight:500;cursor:pointer;box-shadow:0 1px 2px rgba(0,0,0,.04)}
.csw-trigger:hover{background:var(--t-bg,#F8F9FA)}
.csw-trigger>svg{width:16px;height:16px;stroke:var(--t-muted-fg);fill:none;stroke-width:1.8;flex:none;transition:transform .2s}
.csw.is-open .csw-trigger>svg{transform:rotate(180deg)}
.csw-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.csw-panel{position:absolute;top:calc(100% + 8px);right:0;z-index:70;width:288px;background:#fff;border:1px solid var(--t-border);border-radius:var(--radius);box-shadow:0 24px 60px -12px rgba(0,0,0,.18),0 8px 20px -8px rgba(0,0,0,.10);overflow:hidden}
.csw-search{display:flex;align-items:center;gap:8px;padding:0 12px;border-bottom:1px solid var(--t-border)}
.csw-search svg{width:16px;height:16px;stroke:var(--t-muted-fg);fill:none;stroke-width:1.8;flex:none}
body:not(.th-login) .csw-search input{border:0!important;background:transparent!important;box-shadow:none!important;height:44px;padding:0;font-size:14px;width:100%}
.csw-list{max-height:min(360px,60vh);overflow-y:auto;padding:4px}
.csw-opt{display:flex;align-items:center;gap:10px;min-height:40px;padding:8px;border-radius:calc(var(--radius) - 4px);color:var(--t-fg);text-decoration:none;font-size:14px}
.csw-opt>span:not(.clogo){flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.csw-opt small{font-size:11px;color:var(--t-muted-fg)}
.csw-opt svg{width:16px;height:16px;stroke:var(--t-primary,var(--primary));fill:none;stroke-width:2;flex:none}
.csw-opt:hover,.csw-opt.kb{background:var(--t-muted)}
.csw-opt.on{font-weight:600}
.csw-opt.is-muted span{color:var(--t-muted-fg)}
.csw-sep{height:1px;margin:4px 8px;background:var(--t-border)}
.csw-empty{padding:16px 8px;margin:0;color:var(--t-muted-fg);font-size:13px;text-align:center}
@media (max-width:960px){.csw-panel{right:auto;left:0}}
@media (max-width:711px){
  .topbar-actions{gap:8px}
  .csw-trigger{max-width:42vw}
  .csw-panel{position:fixed;left:12px;right:12px;top:auto;width:auto;margin-top:8px}
}

/* ================================================================ v2.1 · editor screens (client edit, campaign planning edit)
   8px rhythm: gaps 8 / 16 / 24 / 32. sticky stepper on the left, sticky actions at the bottom, long blocks folded. */
.ed{display:grid;grid-template-columns:200px minmax(0,1fr);gap:32px;align-items:start;max-width:1120px;margin:0 auto;width:100%}
.ed-nav{position:sticky;top:88px}
.ed-nav ol{list-style:none;margin:0;padding:0;display:grid;gap:0;position:relative}
.ed-nav ol::before{content:"";position:absolute;left:15px;top:16px;bottom:16px;width:1px;background:var(--t-border)}
.ed-nav a{position:relative;display:flex;align-items:center;gap:12px;height:40px;padding:0 8px 0 4px;border-radius:calc(var(--radius) - 2px);color:var(--t-muted-fg);font-size:14px;text-decoration:none}
.ed-nav a b{display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:#fff;border:1px solid var(--t-border);font-size:12px;font-weight:600;color:var(--t-muted-fg);flex:none;font-variant-numeric:tabular-nums}
.ed-nav a:hover{color:var(--t-fg)}
.ed-nav a.on{color:var(--t-fg);font-weight:500}
.ed-nav a.on b{background:var(--t-primary,var(--primary));border-color:var(--t-primary,var(--primary));color:#fff}
.ed-nav .ed-nav-meta{margin-top:16px;padding:16px 8px 0;border-top:1px solid var(--t-border);display:grid;gap:8px;font-size:12px;color:var(--t-muted-fg)}
.ed-main{display:grid;gap:24px;min-width:0}
.ed-main>form{display:grid;gap:24px;min-width:0}
.ed-sec{padding:24px;scroll-margin-top:88px}
.ed-head{display:flex;align-items:flex-start;gap:16px;margin-bottom:24px}
.ed-head>div{flex:1;min-width:0}
.ed-head h3{font-size:16px;font-weight:600;line-height:24px}
.ed-head p{font-size:13px;color:var(--t-muted-fg);margin-top:0;line-height:20px}
.ed-head .btn{flex:none}
.ed-n{display:grid;place-items:center;width:24px;height:24px;border-radius:8px;background:var(--t-muted);font-size:12px;font-weight:600;color:var(--t-muted-fg);flex:none;font-variant-numeric:tabular-nums}
.ed-grid{display:grid;gap:16px 16px}
.ed-grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.ed-grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.ed-grid .span-2{grid-column:span 2}
.ed-grid .span-all{grid-column:1/-1}
.ed-eq{align-items:stretch}
.ed-eq>.field textarea{flex:1;min-height:128px}
.ed .field>span{font-size:13px;font-weight:500;color:var(--t-fg)}
.ed .field>span small{font-weight:400;color:var(--t-muted-fg);margin-left:4px}
.ed .check{margin-top:0}
.ed .check.sm{font-size:13px;font-weight:500;gap:8px}
.ed .check.sm small{display:block;font-weight:400;color:var(--t-muted-fg);font-size:12px;margin-top:2px}
.ed .hint{margin-top:8px}
.ed-profile{display:grid;grid-template-columns:160px minmax(0,1fr);gap:24px;align-items:start}
.logo-up{display:grid;gap:16px;justify-items:start}
.logo-up-prev .clogo{border-radius:16px}
.logo-up-prev .clogo-letter{font-size:32px!important}
.logo-up-ctl{display:grid;gap:8px;justify-items:start}
.logo-up-ctl .btn{cursor:pointer}
.logo-up-ctl .hint{margin:0;font-size:12px;line-height:16px}
.logo-up-err{margin:0;font-size:12px;color:var(--terra,#D93025)}
.conn-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.conn-row{display:flex;align-items:center;gap:12px;min-height:56px;padding:8px 16px;border:1px solid var(--t-border);border-radius:calc(var(--radius) - 2px);min-width:0}
.conn-row .logo{flex:none}
.conn-row.is-off .logo{filter:grayscale(1);opacity:.5}
.conn-t{display:flex;flex-direction:column;min-width:0;flex:1}
.conn-t strong{font-size:14px;font-weight:500}
.conn-t span{font-size:12px;color:var(--t-muted-fg)}
.conn-note{display:none}
.ed-fold{border:1px solid var(--t-border);border-radius:calc(var(--radius) - 2px);margin-top:16px}
.ed-fold+.ed-fold{margin-top:8px}
.ed-sec>.ed-fold:first-of-type{margin-top:0}
.ed-sec>.conn-list+.ed-fold{margin-top:16px}
.ed-fold>summary{display:flex;align-items:center;gap:8px;min-height:48px;padding:8px 16px;cursor:pointer;list-style:none;font-size:14px;font-weight:500;flex-wrap:wrap}
.ed-fold>summary::-webkit-details-marker{display:none}
.ed-fold>summary svg{width:16px;height:16px;stroke:var(--t-muted-fg);fill:none;stroke-width:2;transform:rotate(-90deg);transition:transform .15s;flex:none}
.ed-fold[open]>summary svg{transform:none}
.ed-fold>summary small{font-size:12px;font-weight:400;color:var(--t-muted-fg);margin-left:auto}
.ed-fold>summary:hover{background:var(--t-bg,#F8F9FA)}
.ed-fold-body{padding:8px 16px 16px;border-top:1px solid var(--t-border);display:grid;gap:16px;padding-top:16px}
.ed-grp{display:grid;gap:8px;align-content:start;padding:16px;border-radius:calc(var(--radius) - 2px);background:var(--t-bg,#F8F9FA)}
.ed-grp-t{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600;margin:0}
.ed-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.ed .mail-preview{background:#F8F9FA;border:1px solid #E8EAED;border-radius:calc(var(--radius) - 2px);padding:16px;font-size:13.5px;line-height:1.55;white-space:pre-wrap;color:#333;max-height:320px;overflow:auto}
.ed-bar{position:sticky;bottom:16px;z-index:15;display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:8px 8px 8px 16px;background:rgba(255,255,255,.96);border:1px solid var(--t-border);border-radius:var(--radius);box-shadow:0 12px 32px -12px rgba(0,0,0,.18)}
.ed-bar-state{margin-right:auto;font-size:13px;color:var(--t-muted-fg);display:flex;align-items:center;gap:8px}
.ed-bar-state::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--t-primary,var(--primary))}
form.is-dirty .ed-bar-state{color:var(--t-fg)}
form.is-dirty .ed-bar-state::before{background:var(--terra,#D93025)}
.ed-bar .btn{height:40px}
.ed .danger-zone{margin-top:16px;padding-top:16px;border-top:1px solid var(--t-border)}
.ed .list-row{min-height:48px}
/* switch */
.switch{position:relative;display:inline-block;width:40px;height:24px;flex:none;cursor:pointer}
.switch input{position:absolute;opacity:0;width:100%;height:100%;margin:0;cursor:pointer;z-index:1}
.switch span{position:absolute;inset:0;border-radius:999px;background:#DADCE0;transition:background .15s}
.switch span::after{content:"";position:absolute;top:2px;left:2px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.2);transition:transform .15s}
.switch input:checked+span{background:var(--t-primary,var(--primary))}
.switch input:checked+span::after{transform:translateX(16px)}
.switch input:focus-visible+span{outline:2px solid var(--t-primary,var(--primary));outline-offset:2px}
/* reports */
.rep-form{display:grid;gap:16px}
.rep-card{display:grid;gap:16px;align-content:start;padding:16px;border:1px solid var(--t-border);border-radius:calc(var(--radius) - 2px);background:#fff}
.rep-card.is-on{border-color:rgba(26,115,232,.45);box-shadow:inset 0 0 0 1px rgba(26,115,232,.15)}
.rep-card:not(.is-on) .rep-fields{opacity:.55}
.rep-top{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.rep-top>div{display:grid;gap:0}
.rep-top strong{font-size:14px;font-weight:600;line-height:24px}
.rep-fields{display:grid;gap:16px}
.rep-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-top:16px;border-top:1px solid var(--t-border);flex-wrap:wrap}
.rep-save{display:flex;justify-content:flex-end}
.rep-hist{margin-top:24px;padding-top:24px;border-top:1px solid var(--t-border)}
.rep-hist-h{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:8px}
.rep-hist-h h4{font-size:14px;font-weight:600}
.rep-list{list-style:none;margin:0;padding:0;display:grid}
.rep-list a{display:grid;grid-template-columns:104px 152px minmax(0,1fr) 88px 80px;align-items:center;gap:16px;min-height:48px;padding:0 8px;border-bottom:1px solid var(--t-border);color:var(--t-fg);text-decoration:none;font-size:13px}
.rep-list li:last-child a{border-bottom:0}
.rep-list a:hover{background:var(--t-bg,#F8F9FA)}
.rep-list .badge{justify-self:end}
.rep-kind{display:inline-flex;align-items:center;gap:8px;font-weight:500}
.rep-kind svg{width:16px;height:16px;stroke:var(--t-muted-fg);fill:none;stroke-width:1.8}
.rep-empty{margin:8px 0 0}
@media (max-width:1100px){.ed{grid-template-columns:1fr;gap:16px}
  .ed-nav{position:sticky;top:64px;z-index:14;margin:0;padding:8px 0;background:rgba(255,255,255,.94);border-bottom:1px solid var(--t-border);backdrop-filter:blur(12px)}
  .ed-nav ol{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none}.ed-nav ol::-webkit-scrollbar{display:none}
  .ed-nav ol::before{display:none}
  .ed-nav a{height:32px;padding:0 12px 0 4px;border:1px solid var(--t-border);border-radius:999px;white-space:nowrap;font-size:13px;flex:none}
  .ed-nav a b{width:22px;height:22px;font-size:11px;border:0;background:var(--t-muted)}
  .ed-nav .ed-nav-meta{display:none}
  .ed-sec{scroll-margin-top:128px}}
@media (max-width:720px){
  .ed-nav{margin:0;padding:8px 0}
  .ed-sec{padding:16px}
  .ed-head{margin-bottom:16px;gap:8px;flex-wrap:wrap}
  .ed-head>.btn{width:100%;justify-content:center}
  .ed-grid-2,.ed-grid-3,.conn-list,.ed-profile{grid-template-columns:1fr}
  .ed-grid .span-2{grid-column:auto}
  .ed-profile{gap:16px}
  .logo-up{grid-template-columns:auto 1fr;align-items:center}
  .logo-up-prev .clogo{width:72px!important;height:72px!important}
  .ed-bar{bottom:8px;padding:8px}
  .ed-bar .btn{flex:1;justify-content:center}
  .ed-bar-state{display:none}
  .rep-list a{grid-template-columns:1fr auto;grid-template-areas:"k b" "p w" "t t";gap:4px 8px;padding:8px}
  .rep-kind{grid-area:k}.rep-per{grid-area:p}.rep-to{grid-area:t}.rep-when{grid-area:w;justify-self:end}.rep-list .badge{grid-area:b}
  .ed-fold>summary small{margin-left:24px;width:100%}
}
.ed>*{min-width:0}
@media (max-width:480px){
  .topbar-actions{min-width:0;max-width:100%}
  .csw{min-width:0;flex:0 1 auto}
  .csw-trigger{max-width:40vw;padding:0 10px 0 8px;gap:6px}
  .drp{min-width:0;flex:1 1 auto}
  .drp-trigger{padding:0 10px;gap:6px}
  .drp-trigger .drp-label{max-width:calc(60vw - 112px)}
}
/* v2.1 · campaign planning editor */
.ed-title-card{display:grid;gap:24px}
.ed-title-row{display:flex;align-items:center;gap:16px}
body:not(.th-login) input.ed-title{flex:1;min-width:0;height:48px;font-size:24px;font-weight:600;letter-spacing:-.02em;background:transparent!important;border:1px solid transparent;padding:0 8px;margin-left:-8px}
body:not(.th-login) input.ed-title:hover{border-color:var(--t-border)}
.wf-stepper{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:0;counter-reset:wf}
.wf-stepper li{position:relative;display:grid;justify-items:center;gap:8px;text-align:center;min-width:0}
.wf-stepper li::before{content:"";position:absolute;top:12px;left:calc(-50% + 16px);right:calc(50% + 16px);height:2px;background:var(--t-border)}
.wf-stepper li:first-child::before{display:none}
.wf-stepper li.done::before,.wf-stepper li.now::before{background:var(--t-primary,var(--primary))}
.wf-dot{display:grid;place-items:center;width:24px;height:24px;border-radius:50%;border:1px solid var(--t-border);background:#fff;font-size:12px;font-weight:600;color:var(--t-muted-fg);font-variant-numeric:tabular-nums}
.wf-dot svg{width:14px;height:14px;stroke:#fff;fill:none;stroke-width:2.5}
.wf-stepper li.done .wf-dot{background:var(--t-primary,var(--primary));border-color:var(--t-primary,var(--primary))}
.wf-stepper li.now .wf-dot{border:2px solid var(--t-primary,var(--primary));color:var(--t-primary,var(--primary));box-shadow:0 0 0 4px rgba(26,115,232,.14)}
.wf-l{font-size:12px;color:var(--t-muted-fg);line-height:16px;overflow:hidden;text-overflow:ellipsis;max-width:100%;white-space:nowrap}
.wf-stepper li.now .wf-l{color:var(--t-fg);font-weight:600}
.wf-stepper li.done .wf-l{color:var(--t-fg)}
.wf-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.wf-actions .btn{justify-content:center;height:40px}
.btn-terra-outline{color:var(--terra,#D93025)!important;border-color:rgba(217,48,37,.35)!important}
.btn-terra-outline:hover{background:rgba(217,48,37,.06)!important}
.ed-grid>.ed-grow{flex:1}
.ed-eq>.ed-sec{display:flex;flex-direction:column}
.ed-eq>.ed-sec>.ed-grid{flex:1;align-content:start}
.ed-camp .creatives{display:grid;gap:16px}
.ed-camp .goals-grid>.stack{display:grid;gap:16px;align-content:start}
.ed-camp .link-rows{display:grid;gap:8px}
.ed-camp .send-row{display:flex;flex-wrap:wrap;gap:8px}
.ed-camp .snapshot{margin-top:24px}
@media (max-width:720px){
  .wf-stepper{display:flex;overflow-x:auto;gap:0;scrollbar-width:none;padding-bottom:4px}
  .wf-stepper li{flex:0 0 88px}
  body:not(.th-login) input.ed-title{font-size:20px;height:40px}
  .ed-title-row{flex-wrap:wrap;gap:8px}
  .wf-actions{grid-template-columns:1fr}
  .ed-bar{flex-wrap:wrap}
  .ed-bar .btn-ghost{flex:0 0 auto}
}
/* v2.1 · report view */
.rv{display:grid;grid-template-columns:minmax(0,380px) minmax(0,1fr);gap:24px;align-items:start;max-width:1200px;margin:0 auto;width:100%}
.rv-head{position:sticky;top:88px;display:grid;gap:24px}
.rv-t{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:16px;align-items:start}
.rv-t h2{font-size:18px;font-weight:600;line-height:24px}
.rv-t p{margin-top:4px;line-height:18px}
.rv-meta{display:grid;gap:8px;margin:0}
.rv-meta>div{display:grid;grid-template-columns:128px minmax(0,1fr);gap:8px;font-size:13px;padding-bottom:8px;border-bottom:1px solid var(--t-border)}
.rv-meta dt{color:var(--t-muted-fg)}.rv-meta dd{margin:0;overflow-wrap:anywhere}
.terra-t{color:var(--terra,#D93025)}
.rv-send{display:grid;gap:16px}
.rv-send .btn{height:44px;justify-content:center}
.rv-head .hint{margin:-8px 0 0}
.rv-prev{padding:0;overflow:hidden}
.rv-prev-h{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid var(--t-border)}
.rv-prev iframe{display:block;width:100%;height:calc(100vh - 160px);min-height:640px;border:0;background:#F1F3F4}
@media (max-width:960px){.rv{grid-template-columns:1fr}.rv-head{position:static}.rv-prev iframe{height:80vh}}
/* v2.1 · client dashboard (public /p/dash.php) */
body.cdash{display:block}
.cdash .main{margin:0;min-height:100vh}
.cd-top{justify-content:space-between}
.cd-brand{display:flex;align-items:center;gap:12px;min-width:0}
.cd-brand>div{display:flex;flex-direction:column;min-width:0;line-height:18px}
.cd-brand strong{font-size:15px;font-weight:600}
.cd-brand span{font-size:12px}
.cdash .body{max-width:1440px;margin:0 auto}
.cd-camps{display:grid;gap:16px}
.cd-camps-h{display:flex;align-items:flex-end;justify-content:space-between;gap:16px}
.cd-camps-h h3{font-size:16px;font-weight:600}
.cd-camps-h p{font-size:13px;margin-top:2px}
.cd-foot{display:flex;align-items:center;gap:8px;justify-content:center;padding:24px 0 8px;color:var(--t-muted-fg);font-size:12px}
.map-open{white-space:nowrap}
@media (max-width:720px){.cd-top{height:auto;min-height:64px;flex-wrap:wrap;padding:8px 16px}.cd-top .topbar-actions{width:100%}.cd-camps-h{flex-wrap:wrap;align-items:flex-start}}
.dash-link{display:grid;gap:8px;padding:16px;margin-bottom:16px;border:1px solid rgba(26,115,232,.35);border-radius:calc(var(--radius) - 2px);background:#E8F0FE}
.dash-link-t{display:flex;flex-direction:column}
.dash-link-t strong{font-size:14px;font-weight:600}
.dash-link .link-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.dash-link .link-row input{flex:1 1 240px;min-width:0;background:#fff!important}
.dash-link .inline-form{display:inline-flex}
.fact-act{display:flex;align-items:center;justify-content:flex-end}
.facts:has(.basis-dd){overflow:visible}
.fact-name-row{display:flex;align-items:center;justify-content:space-between;gap:8px;min-width:0}
.fact-name-row strong{min-width:0;margin-top:0}
.fact-name-row .btn{flex:none}
.facts-card:has(.basis-dd){overflow:visible}.facts-card:has(.basis-dd[open]){z-index:40;position:relative}
/* v2.2: current status + "delivered in period" */
.st-wrap{display:inline-flex;flex-direction:column;align-items:flex-start;gap:3px}
.st-hint{font-size:11px;line-height:1.2;color:var(--muted);white-space:nowrap}
.rank-meta .st-wrap{flex-direction:row;align-items:center;gap:6px}
.rank-meta .st-hint{display:none}
/* v2.2: comparison toggle (period strip + date picker) */
.seg-xs{height:28px;padding:2px;vertical-align:middle}
.seg-xs a,.seg-xs button{padding:0 10px;font-size:12px;border-radius:6px}
.cmp{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap}
.drp-cmp{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px;border-top:1px solid var(--t-border);font-size:13px;color:var(--t-muted-fg)}
@media (max-width:711px){.drp-cmp{flex-wrap:wrap;padding:10px 12px}.drp-cmp .seg{max-width:100%}}
/* v2.2: full history */
.hist .card-head{align-items:flex-start}
.hist-list{display:grid;gap:8px}
.hist-row{display:grid;grid-template-columns:minmax(160px,1.1fr) 2fr minmax(180px,1fr);gap:8px 24px;align-items:center;padding:16px;border:1px solid var(--line);border-radius:calc(var(--radius) - 2px)}
.hist-name{display:flex;align-items:center;gap:8px;min-width:0}
.hist-name>div{display:flex;flex-direction:column;min-width:0}
.hist-name strong{font-weight:600;font-size:14px}
.hist-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:0}
.hist-facts dt{font-size:12px;color:var(--muted)}
.hist-facts dd{margin:2px 0 0;font-size:14px;font-weight:500}
.hist-prog{display:flex;align-items:center;gap:8px}
.hist-prog .bar{flex:1;height:8px;border-radius:99px;background:var(--secondary);overflow:hidden}
.hist-prog .bar i{display:block;height:100%;background:var(--primary);border-radius:99px}
.hist-prog>span{min-width:44px;text-align:right;font-size:13px;font-weight:500}
.hist-note{grid-column:1/-1;margin:0;font-size:12px;color:var(--muted)}
.hist-note.warn{color:#D93025}
.hist-db{margin-top:16px}
.dt-mini{font-size:13px}
.dt-mini td,.dt-mini th{padding:6px 8px}
.side-hist{display:flex;align-items:center;gap:6px;margin-top:6px;font-size:11px;color:var(--muted);white-space:nowrap}
.side-hist .bar{flex:1;min-width:24px;height:4px;border-radius:99px;background:var(--secondary);overflow:hidden}
.side-hist .bar i{display:block;height:100%;background:var(--primary)}
.side-hist:hover{color:var(--fg)}
@media (max-width:860px){.hist-row{grid-template-columns:1fr}.hist-facts{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:480px){.hist-facts{grid-template-columns:1fr 1fr}}
.hist-db .dt td,.hist-db .dt th{padding:6px 8px;height:auto}

/* ── v2.2 · mobile: client dashboard, crm overview + campaigns ───────────────────── */
.cd-camps-h{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:16px;row-gap:2px}
.cd-camps-h p{grid-column:1/-1;margin:0}
.drp-label-m{display:none}
.ads-cards{display:none}
.cd-foot{padding-bottom:calc(16px + env(safe-area-inset-bottom,0px))}
@media (max-width:640px){
  html,body{overflow-x:hidden}
  .main{min-width:0;max-width:100vw}
  /* header: not sticky, compact, full date range on its own row */
  .topbar,.cd-top{position:relative;top:auto;backdrop-filter:none;-webkit-backdrop-filter:none;background:#fff;height:auto;min-height:0;padding:10px 16px;gap:8px;flex-wrap:wrap}
  .ed-nav{top:0}
  .topbar .topbar-actions{width:100%;flex-wrap:wrap;gap:8px}
  .topbar .csw{flex:1 1 100%;max-width:none;min-width:0}
  .topbar .csw-trigger{width:100%;max-width:none}
  .topbar .csw-label{flex:1;text-align:left}
  .topbar .csw-panel{left:0;right:0;width:auto}
  .cm-entry{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
  .cm-entry .btn{height:36px}
  .topbar .drp{flex:1 1 100%;min-width:0;height:40px;justify-content:flex-start}
  .topbar .drp-shell{left:0;right:0;width:auto}
  .topbar .drp:not(.is-open) .drp-trigger{width:100%;justify-content:flex-start}
  .topbar .drp-trigger .drp-label{display:none}
  .topbar .drp-label-m{display:inline;flex:1;text-align:left;white-space:nowrap}
  .cd-brand strong{font-size:14px}
  .cd-brand span{font-size:11px}
  .body{padding:16px 16px calc(32px + env(safe-area-inset-bottom,0px))}
  .period{flex-wrap:wrap;gap:8px}
  .period-text{flex-wrap:wrap;row-gap:6px}
  /* kpis 2 per row, odd last one full width; charts stacked */
  .kpis-v2,.kpis-main{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px}
  .kpis-main>:last-child:nth-child(odd){grid-column:1/-1}
  .kpi-v2 .kpi-value{font-size:20px}
  .chart-pair{grid-template-columns:1fr}
  .chart-pair>.card,.card{min-width:0;max-width:100%}
  /* table toolbars: full-width filter + icon-only buttons on one row; no column picker */
  .dt-toolbar{display:flex;flex-wrap:nowrap;align-items:center;gap:8px;padding:1px}
  .kpi{min-height:0;gap:8px;padding:12px}
  .dt-toolbar .dt-filter{flex:1 1 auto;min-width:0;width:auto;max-width:none}
  .dt-tools{flex:none;gap:6px;flex-wrap:nowrap}
  .dt-tools [data-dt-cols]{display:none}
  .dt-tools .btn-sm{font-size:0;width:36px;height:36px;padding:0;justify-content:center;gap:0}
  .dt-tools .btn-sm svg{width:16px;height:16px;margin:0}
  /* section header: title + open map on one row */
  .cd-camps-h h3{font-size:15px}
  .cd-camps-h p{font-size:12px}
  .hide-m{display:none}
  .cd-note{font-size:11px;line-height:16px}
  /* campaign tree → cards */
  .ads-wrap.has-cards .dt-box,.ads-wrap.has-cards .dt-foot{display:none}
  .ads-cards{display:grid;gap:8px;margin-top:8px}
  .ac{background:#fff;border:1px solid var(--t-border);border-radius:var(--radius);padding:12px 12px 8px;display:grid;gap:12px;min-width:0}
  .ac[hidden]{display:none}
  .ac-head{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:8px;row-gap:6px;align-items:start}
  .ac-logo{padding-top:1px}
  .ac-title{display:grid;gap:2px;min-width:0}
  .ac-name{font-size:14px;font-weight:600;line-height:19px;color:var(--t-fg);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere;text-decoration:none}
  .ac-title small{font-size:11px}
  .ac-st{grid-column:2;display:flex;flex-wrap:wrap;gap:4px;align-items:center}
  .ac-st .ac-map{margin-left:auto;height:28px;padding:0 10px;font-size:12px}
  .ac-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;margin:0;background:var(--t-border);border:1px solid var(--t-border);border-radius:var(--r-sm,.5rem);overflow:hidden}
  .ac-grid>div{background:#fff;padding:8px;min-width:0}
  .ac-grid dt{font-size:11px;color:var(--t-muted-fg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .ac-grid dd{margin:2px 0 0;display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:0}
  .ac-grid dd .num{font-size:14px;font-weight:600;white-space:nowrap}
  .ac-grid dd .delta,.ac-grid dd .badge{font-size:10px}
  .ac-foot{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;flex-wrap:wrap}
  .ac-kids{flex:1 1 100%;min-width:0}
  .ac-kids>summary{display:inline-flex;align-items:center;gap:4px;min-height:32px;font-size:13px;font-weight:500;color:var(--olive,var(--primary));cursor:pointer;list-style:none}
  .ac-kids>summary::-webkit-details-marker{display:none}
  .ac-kids>summary svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2;transition:transform .15s}
  .ac-kids[open]>summary svg{transform:rotate(90deg)}
  .ac-kids[open]>summary span{font-size:0}
  .ac-kids[open]>summary span::after{content:'hide ad sets and ads';font-size:13px}
  .ac-list{list-style:none;margin:4px 0 0;padding:0;display:grid;border-top:1px solid var(--t-border)}
  .ac-row{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:8px;row-gap:2px;align-items:center;padding:8px 0;border-bottom:1px solid var(--t-border)}
  .ac-row:last-child{border-bottom:0}
  .ac-row:has(.thumb){grid-template-columns:28px minmax(0,1fr) auto}
  .ac-row .thumb{grid-row:span 2;width:28px;height:28px;border-radius:6px;object-fit:cover}
  .ac-row.sub{padding-left:16px;background:linear-gradient(var(--t-border),var(--t-border)) 6px 0/1px 100% no-repeat}
  .ac-row-t{display:grid;min-width:0}
  .ac-row-n{font-size:13px;line-height:17px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .ac-row-t small{font-size:10px}
  .ac-row-s{justify-self:end}
  .ac-row-s .st-hint{display:none}
  .ac-row-m{grid-column:1/-1;display:flex;gap:8px;align-items:baseline;font-size:12px}
  .ac-row:has(.thumb) .ac-row-m{grid-column:2/-1}
  .ac-row-m span{color:var(--t-muted-fg);font-size:11px}
  .ac-none{padding:16px;text-align:center}
  .cd-foot{padding:16px 0 calc(16px + env(safe-area-inset-bottom,0px))}
}
.chart-single>.card{margin:0;min-width:0}
/* v2.4 · google analytics block: two kpis + traffic-by-channel fold */
.ga4-block{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;align-items:start}
.ga4-block>.ga4-fold{grid-column:span 3;margin:0;min-width:0}
.ga4-fold[open]{grid-column:1/-1}
.ga4-t td,.ga4-t th{padding:8px 10px}
.ga4-t .badge{margin-left:6px;vertical-align:1px}
@media (max-width:1280px){.ga4-block{grid-template-columns:repeat(3,minmax(0,1fr))}.ga4-block>.ga4-fold{grid-column:span 1}}
@media (max-width:720px){.ga4-block{grid-template-columns:1fr 1fr}.ga4-block>.ga4-fold{grid-column:1/-1}}
.ga4-fold .acc-b{overflow-x:auto}

/* v2.9 · mailerlite email kpis + campaigns table */
.ml-block{margin:8px 0 24px}
.ml-block>.kpis-v2{margin-bottom:16px}
.ml-camps{margin:0}
.ml-t td,.ml-t th{padding:8px 10px}
.ml-camps .table-wrap{overflow-x:auto}

/* v2.5 · connectors in use + "add connector" library */
.conn-title-row{align-items:center;margin-top:8px}
.conn-title-row h2{font-size:18px}
.conn-title-row p{margin-top:2px;font-size:13px}
.conn-title-row .btn svg{width:14px;height:14px;margin-right:4px}
.conn-foot{margin-top:-4px;display:flex;justify-content:flex-end}
.conn-foot button{background:none;border:0;padding:0;cursor:pointer;color:var(--muted-2);font-size:12px}
.conn-foot button:hover{color:var(--terra)}
dialog.lib{border:0;border-radius:var(--r);padding:0;width:min(880px,calc(100vw - 32px));max-height:calc(100vh - 48px);box-shadow:var(--shadow);color:var(--fg);background:var(--bg,#fff)}
dialog.lib::backdrop{background:rgba(20,20,18,.32)}
.lib-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;padding:20px 22px 12px;position:sticky;top:0;background:inherit;border-bottom:1px solid var(--line)}
.lib-head h3{font-size:18px;margin-bottom:4px}
.lib-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:12px;padding:16px 22px 22px}
.lib-card{display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto 1fr auto;gap:8px 12px;padding:14px;border:1px solid var(--line);border-radius:var(--r-md);background:#fff}
.lib-card .conn-logo{grid-row:1}
.lib-t{display:flex;flex-direction:column;min-width:0}
.lib-d{grid-column:1/-1;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;line-height:1.45}
.lib-a{grid-column:1/-1;display:flex;justify-content:space-between;align-items:center;gap:8px}
.lib-a form{margin:0}
.lib-a .btn svg{width:13px;height:13px;margin-right:4px}
.lib-card.is-on{border-color:var(--olive-soft);background:var(--olive-fill,#fff)}
.lib-card.is-soon{opacity:.6}
@media (max-width:640px){.lib-grid{grid-template-columns:minmax(0,1fr);padding:12px}.lib-head{padding:16px 14px 10px}}

/* ---- v2.11 · sidebar analytics dropdown ---- */
.nav{overflow-y:auto;min-height:0;scrollbar-width:thin}
.nav-dd{display:flex;flex-direction:column}
.nav-dd-t{width:100%;background:none;cursor:pointer;font:inherit;text-align:left}
.nav-dd-t > span:not(.nav-dd-c){flex:1}
.nav-dd-c{display:inline-flex;margin-left:auto;transition:transform .18s ease}
.nav-dd-c svg{width:14px!important;height:14px!important}
.nav-dd-t[aria-expanded="false"] .nav-dd-c{transform:rotate(-90deg)}
.nav-dd-t.is-parent{color:var(--fg)}
.nav-dd-b{position:relative;display:flex;flex-direction:column;gap:1px;margin:2px 0 6px 21px;padding-left:10px;border-left:1px solid var(--side-line)}
.nav-dd-b[hidden]{display:none}
.nav-sub-g{font-size:11px;color:#9AA0A6;padding:9px 10px 3px;letter-spacing:.01em}
.nav-sub-g:first-child{padding-top:4px}
.nav-sub{position:relative;display:flex;align-items:center;gap:9px;height:32px;padding:0 10px;border-radius:var(--r-sm);border:1px solid transparent;color:var(--muted);font-size:13.5px;line-height:1;transition:background .15s,color .15s}
.nav-sub:hover{background:#fff;color:var(--fg)}
.nav-sub.active{background:#fff;border-color:var(--line);color:var(--fg);font-weight:500;box-shadow:var(--shadow)}
.nav-sub.active::before{content:"";position:absolute;left:-11px;top:8px;bottom:8px;width:2px;border-radius:2px;background:var(--olive,var(--primary))}
.nav-sub-i{display:inline-grid;place-items:center;width:16px;height:16px;flex:none}
.nav-sub-i img,.nav-sub-i svg{width:14px;height:14px}
.nav-sub-i svg{stroke:currentColor;fill:none;stroke-width:1.6}
.nav-sub-l{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nav-sub-n{margin-left:auto;font-size:11px;color:var(--muted);border:1px solid var(--line);background:#fff;border-radius:6px;padding:2px 5px}
.nav-sub.is-muted{opacity:.62}
.nav-sub.is-muted .nav-sub-n{border-style:dashed}
.nav-sub-empty{font-size:12px;color:var(--muted);padding:6px 10px;margin:0}
.nav-sub-empty a{text-decoration:underline}

/* ---- v2.11 · analytics pages ---- */
.an-status{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;margin-bottom:16px}
.an-status-l{display:flex;align-items:center;gap:12px;min-width:0}
.an-status-l strong{font-weight:500}
.an-status-l p{margin:2px 0 0}
.an-status-r{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.an-status-r form{margin:0}
.an-status.is-err{border-color:rgba(217,48,37,.35)}
.an-status-err{flex-basis:100%;border-top:1px solid var(--line);padding-top:10px;font-size:13px;color:var(--terra-ink,#B3261E);display:grid;gap:8px}
.an-status-err p{margin:3px 0 0;color:var(--ink-2,#444);word-break:break-word}
.an-note{margin:-6px 0 14px}
.an-grid{margin:20px 0;align-items:start}
.an-grid > .dt-wrap{margin:0}
.an-grant{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:18px;padding:22px}
.an-grant-l{display:flex;gap:14px;max-width:760px}
.an-grant h3{margin:0 0 6px;font-weight:500}
.an-grant p{margin:0}
.an-steps{margin:10px 0 0;padding-left:18px;display:grid;gap:3px}
.an-grant .btn img{margin-right:6px}
@media (max-width:900px){.an-grid{grid-template-columns:1fr}}
.nav-sub-dot{margin-left:auto;width:7px;height:7px;border-radius:50%;border:1px dashed var(--muted);flex:none}
.an-stack{display:grid;gap:20px;margin:20px 0}
.an-stack > .dt-wrap{margin:0}
/* v2.11.1 · GA4 quota pause (amber, not an error) */
.badge-amber{background:#FEF0C3;color:#B06000}
.an-status-pause{flex-basis:100%;margin-top:4px;padding:10px 12px;border-radius:10px;background:#FEF7E0;color:#6f4a00;font-size:13px;display:grid;gap:4px}
.pause-text{margin-top:6px;color:#B06000}
/* v2.11.1 · lead form webhook url */
.hook-url{margin-top:8px;display:grid;gap:4px;color:var(--fg)}
.hook-url input{font:12px/1.4 ui-monospace,monospace;padding:6px 8px;border:1px solid var(--line-2,#ddd);border-radius:8px;background:#F8F9FA;width:100%}
.hook-url small{color:var(--muted)}


/* ============================================================== v2.12 · google palette + minimal overview
   neutral greys for chrome, blue = primary / spend, green = revenue / positive, red = negative, yellow = accent / roas.
   colours from palette-ref.png (google material tones). */
::selection{background:var(--primary-soft)}
.link,.list-row:hover strong,table.dt .name a:hover{color:var(--primary)}
.btn-olive,.btn-primary{background:var(--primary)!important;border-color:var(--primary)!important;color:#fff}
.btn-olive:hover:not(:disabled),.btn-primary:hover{background:var(--primary-ink)!important}
.avatar{background:var(--primary)}
.nav-item.active i{background:var(--primary)}
.check input,.dd-check input,.dt-sel input{accent-color:var(--primary)}
input:focus,select:focus,textarea:focus,body:not(.th-login) input:focus,body:not(.th-login) select:focus,body:not(.th-login) textarea:focus{border-color:var(--primary);box-shadow:0 0 0 3px var(--primary-ring)}
.title-input:focus{border-bottom-color:var(--primary)!important}
.drp-preset.on{background:var(--primary-soft);color:var(--primary-ink)}
.drp-cell.in::before{background:var(--primary-soft)}
.nav-sub.active::before{background:var(--primary)}
.lib-card.is-on{border-color:var(--primary-soft);background:#F8FBFF}
.ac-kids>summary{color:var(--primary)}
.badge-amber,.pill-amber{background:var(--yellow-soft);color:var(--yellow-ink)}
.badge-dark{background:#202124;color:#fff}
.seg a.on,.seg button.on{color:var(--fg)}
.chart .grid,.chart .grid line{stroke:#F1F3F4;stroke-dasharray:none}
.chart .ax{stroke:#DADCE0}
.chart .tick{fill:#80868B}
.chart-tip{background:#fff;border-color:#E8EAED;box-shadow:0 4px 16px rgba(60,64,67,.12);padding:8px 10px;min-width:200px}
.chart-tip .r{background:none;border:0;padding:3px 0;margin:0}
.chart-tip .r.tip{color:var(--muted)}
.chart-tip .r.tip span{color:var(--muted)}
.chart-tip .t{padding:0 0 4px;font-weight:500;color:var(--fg)}

/* kpi tiles everywhere: numbers without boxes */
.kpis-v2{gap:28px 32px}
.kpi{border:0;background:none;box-shadow:none;padding:0;min-height:0;gap:6px}
.kpi.primary{background:none}
.kpi-top{justify-content:flex-start;gap:10px}
.kpi-label{color:var(--muted);font-weight:400}
.kpi-value{font-size:28px}
.kpi .badge{background:none;padding:0;height:auto;border:0}
.kpi .badge-olive{color:var(--olive-ink)}.kpi .badge-terra{color:var(--terra-ink)}.kpi .badge-neutral{color:var(--muted)}
.more-kpis{margin-top:4px}

/* overview */
.is-overview .body{gap:0;max-width:1440px}
.is-overview .period{margin-bottom:8px}
.ov{padding:28px 0 8px}
.ov-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:32px}
.ov-k{display:flex;flex-direction:column;gap:6px;min-width:0}
.ov-l{font-size:13px;color:var(--muted);letter-spacing:0}
.ov-v{font-size:44px;line-height:1.02;font-weight:500;letter-spacing:-.035em;color:var(--fg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ov-wait{color:#DADCE0}
.ov-d{font-size:13px;color:var(--muted);font-variant-numeric:tabular-nums;min-height:19px}
.ov-d.is-pos,.ov-sd.is-pos{color:#137333}
.ov-d.is-neg,.ov-sd.is-neg{color:#C5221F}
.ov-sub{display:flex;flex-wrap:wrap;gap:8px 28px;margin-top:28px;font-size:13px;color:var(--muted)}
.ov-s b{font-weight:500;color:var(--fg)}
.ov-sd{font-style:normal;font-size:12px;color:var(--muted);margin-left:2px}
.ov-chart{margin-top:40px}
.ov-chart-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:14px}
.ov-chart-per{font-size:12px;color:#9AA0A6;white-space:nowrap}
.ov-chart .legend-v2{gap:6px 18px}
.ov-chart .legend-v2 .lg i{width:8px;height:8px;border-radius:50%}
.ov-chart .legend-v2 .lg i.ln{width:14px;height:2px;border-radius:2px}
.ov-top{margin-top:48px;max-width:760px}
.ov-top-head{display:flex;justify-content:space-between;align-items:baseline;padding-bottom:10px}
.ov-top-head a{font-size:13px;color:var(--primary)}
.ov-list{list-style:none;margin:0;padding:0}
.ov-list a{display:grid;grid-template-columns:minmax(0,1fr) 90px 64px;gap:16px;align-items:center;padding:11px 0;border-top:1px solid #F1F3F4;font-size:14px}
.ov-list a:hover .trunc{color:var(--primary)}
.ov-list-n{display:flex;align-items:center;gap:10px;min-width:0}
.ov-list-v,.ov-list-r{text-align:right;font-variant-numeric:tabular-nums}
.ov-list-r{color:var(--muted)}
.ov-empty{padding:40px 0}
@media (max-width:1100px){.ov-v{font-size:36px}}
@media (max-width:760px){
  .ov{padding-top:16px}
  .ov-kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 20px}
  .ov-v{font-size:30px}
  .ov-sub{gap:6px 18px;margin-top:20px;font-size:12px}
  .ov-chart{margin-top:28px}
  .ov-chart .chart{--h:280px!important}
  .ov-chart-head{flex-direction:column;align-items:flex-start;gap:6px}
  .ov-top{margin-top:32px}
  .ov-list a{grid-template-columns:minmax(0,1fr) 72px 52px;gap:10px;font-size:13px}
}

/* reporting: titles and numbers only */
.is-reporting .an-note,.is-reporting .card-head p.muted,.is-reporting .dt-title p{display:none}
.is-overview .cmp>.num{display:none}
.is-overview .period{flex-wrap:wrap;row-gap:10px}
@media (max-width:760px){.ov-chart .chart{height:var(--h)!important;border:0}}

/* v2.12.2: creative map button in the period strip */
.cm-btn svg{margin-right:6px}.cm-dd .dd-menu{max-height:60vh;overflow:auto}.cm-dd summary{list-style:none}.cm-dd summary::-webkit-details-marker{display:none}

/* v2.12.2 · client dashboard, minimal (same language as the v2.12 overview) */
.cd2 .cd-top{border-bottom:0;background:#fff;width:100%;max-width:1160px;margin:0 auto;padding-left:40px;padding-right:40px;box-sizing:border-box;justify-content:space-between!important}
.cd2 .main{display:block}
.cd2 .cd-brand strong{font-size:15px;font-weight:500;letter-spacing:-.01em}
.cd2-body{max-width:1160px!important;padding:8px 40px 24px!important}
.cd2 .ov{padding-top:36px}
.cd2 .ov-sub{margin-top:24px}
.cd2 .ov-chart{margin-top:56px}
.cd2-sec{margin-top:64px;max-width:820px}
.cd2-h{display:flex;justify-content:space-between;align-items:baseline;padding-bottom:12px}
.cd2-h a{font-size:13px;color:var(--primary)}
.cd2-list{list-style:none;margin:0;padding:0}
.cd2-row{display:grid;grid-template-columns:minmax(0,1fr) 84px 92px 60px 40px;gap:16px;align-items:center;padding:12px 0;border-top:1px solid #F1F3F4;font-size:14px}
.cd2-row.no-roas{grid-template-columns:minmax(0,1fr) 84px 92px 40px}
.cd2-row>.num{text-align:right;font-variant-numeric:tabular-nums}
.cd2-row-h{border-top:0;padding:0 0 6px;font-size:12px;color:#9AA0A6}
.cd2-row-h span{text-align:right}.cd2-row-h>.num{font-variant-numeric:normal}
.cd2-mail{grid-template-columns:minmax(0,1fr) 60px 72px 84px}
.cd2-mail.no-rev{grid-template-columns:minmax(0,1fr) 60px 72px}
.cd2-n{display:flex;align-items:center;gap:10px;min-width:0}
.cd2-dot{flex:none;width:7px;height:7px;border-radius:50%;background:#DADCE0}
.cd2-dot.on{background:#1E8E3E}
.cd2-q{color:#9AA0A6}
.cd2-map{justify-self:end;font-size:13px;color:var(--primary)}
.cd2-foot{gap:14px;margin-top:72px;color:#9AA0A6}
@media (max-width:720px){
  .cd2-body{padding:4px 20px 16px!important}
  .cd2 .cd-top{padding-left:20px;padding-right:20px;justify-content:flex-start!important}
  .cd2-n svg,.cd2-n img{display:none}
  .cd2 .ov{padding-top:20px}
  .cd2 .ov-chart{margin-top:36px}
  .cd2-sec{margin-top:44px}
  .cd2-row{grid-template-columns:minmax(0,1fr) 64px 50px 34px;gap:10px;font-size:13px}
  .cd2-row>.num:nth-child(3){display:none}
  .cd2-row.no-roas{grid-template-columns:minmax(0,1fr) 64px 72px 34px}
  .cd2-row.no-roas>.num:nth-child(3){display:block}
  .cd2-mail{grid-template-columns:minmax(0,1fr) 44px 60px 64px}
  .cd2-mail>.num:nth-child(3){display:block}
  .cd2-mail.no-rev{grid-template-columns:minmax(0,1fr) 44px 60px}
}
