/* ==========================================================================
   DealerStation Journal — CRM layer (Today, Leads, Email, Insights, lead file)
   Loaded after styles.css and ds-ui.css; uses only the --ds-* tokens from ds-ui.css.
   CSP is style-src 'self': no inline style attributes anywhere (widths come from
   data-w / data-h, applied by applyDynamicStyles() in js/util.js).
   ========================================================================== */

/* helpers */
body .grow{flex:1}
body .tiny{font-size:11.5px}
body .count{display:inline-grid;place-items:center;min-width:18px;height:18px;padding:0 5px;margin-left:4px;border-radius:999px;background:var(--ds-brand);color:#fff;font-size:11px;font-weight:600}
body .linkbtn{border:0;background:none;color:var(--ds-brand);font-weight:550;font-size:inherit;padding:0 2px;cursor:pointer}
body .linkbtn:hover{text-decoration:underline}
body .danger-text{color:var(--ds-danger)}
body .warn-text{color:var(--ds-warning)}
body .pad{padding:10px 4px}
body .inline{display:flex;align-items:center;gap:6px}
body .inline select{flex:1}
body .sm{min-height:30px;padding:0 11px;font-size:12.5px;border-radius:var(--ds-r-sm)}
body a.btn{display:inline-flex;align-items:center;text-decoration:none}
body .top-actions{display:flex;gap:8px;align-items:center}
body .scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;white-space:nowrap}
body .scroll::-webkit-scrollbar{display:none}
body .page{padding-bottom:12px}
body .notice{padding:11px 14px;border-radius:var(--ds-r);font-size:13px;line-height:1.5;margin:0 0 14px;border:1px solid var(--ds-border);background:var(--ds-surface-2);color:var(--ds-text-2)}
body .notice.good{background:var(--ds-success-soft);border-color:#bfe5d3;color:#0b5c40}
body .notice.warn{background:var(--ds-warning-soft);border-color:#f0d8a8;color:#7a4a0a}
body .notice.bad{background:var(--ds-danger-soft);border-color:#f3c3ca;color:#8e2433}

/* nav icons for the new tabs (mobile bottom bar) */
:root{
  --ds-i-today:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='m12 7 0 5 3 2'/%3E%3C/svg%3E");
  --ds-i-mail:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E");
  --ds-i-chart:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20V10M10 20V4M16 20v-7M22 20H2'/%3E%3C/svg%3E");
}
@media(max-width:760px){
  body .nav[data-page=today]:before{-webkit-mask-image:var(--ds-i-today);mask-image:var(--ds-i-today)}
  body .nav[data-page=campaigns]:before{-webkit-mask-image:var(--ds-i-mail);mask-image:var(--ds-i-mail)}
  body .nav[data-page=insights]:before{-webkit-mask-image:var(--ds-i-chart);mask-image:var(--ds-i-chart)}
  body .nav{font-size:10px;min-width:0}
  body .top-actions .ghost{display:none}
  body .leads-bar{grid-template-columns:1fr auto auto}
}

/* score badge, chips, dots */
body .score{display:inline-grid;place-items:center;min-width:34px;height:26px;padding:0 7px;border-radius:999px;font-size:12.5px;font-weight:650;font-variant-numeric:tabular-nums;border:1px solid transparent}
body .score-top{background:var(--ds-success-soft);color:var(--ds-success);border-color:#bfe5d3}
body .score-good{background:var(--ds-brand-soft);color:var(--ds-brand-press);border-color:var(--ds-brand-soft-2)}
body .score-fair{background:var(--ds-warning-soft);color:var(--ds-warning);border-color:#f0d8a8}
body .score-low,body .score-none{background:var(--ds-surface-3);color:var(--ds-muted);border-color:var(--ds-border)}
body .chips{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
body .chip{display:inline-flex;align-items:center;min-height:22px;padding:0 8px;border-radius:999px;background:var(--ds-surface-3);color:var(--ds-text-2);font-size:11.5px;font-weight:550;white-space:nowrap}
body .chip.good{background:var(--ds-success-soft);color:var(--ds-success)}
body .chip.warn{background:var(--ds-warning-soft);color:var(--ds-warning)}
body .chip.bad{background:var(--ds-danger-soft);color:var(--ds-danger)}
body a.chip.link{text-decoration:none;color:var(--ds-brand);background:var(--ds-brand-soft)}
body .dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-left:6px;background:var(--ds-faint)}
body .dot.open{background:var(--ds-accent);box-shadow:0 0 0 3px var(--ds-accent-soft)}
body .bar{height:8px;border-radius:999px;background:var(--ds-surface-3);overflow:hidden}
body .bar>i{display:block;height:100%;width:0;border-radius:999px;background:linear-gradient(90deg,var(--ds-brand),var(--ds-accent));transition:width .3s}

/* lead rows */
body .lead-list{display:grid;gap:8px}
body .lead-row{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1.2fr) 52px 130px minmax(0,1.1fr) 40px 16px;align-items:center;gap:14px;padding:12px 14px;border:1px solid var(--ds-border);border-radius:var(--ds-r-lg);background:var(--ds-surface);box-shadow:var(--ds-sh-xs);cursor:pointer;transition:border-color .12s,box-shadow .12s}
body .lead-row:has(.pick){grid-template-columns:28px minmax(0,1.6fr) minmax(0,1.2fr) 52px 130px minmax(0,1.1fr) 40px 16px}
body .lead-row:hover,body .lead-row:focus-visible{border-color:var(--ds-brand);box-shadow:var(--ds-sh-sm);outline:0}
body .lead-row.is-selected{border-color:var(--ds-brand);background:var(--ds-brand-soft)}
body .lead-row.is-due{border-left:3px solid var(--ds-warning)}
body .lead-row h3{font-size:14.5px;margin:0 0 2px;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body .lead-row .muted{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px}
body .lead-row .contact>div:first-child{font-size:13.5px;font-weight:550;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body .lead-row .followup .due{color:var(--ds-warning);font-weight:600}
body .lead-row .pick{display:grid;place-items:center;height:36px;cursor:pointer}
body .call-btn-ph{width:36px}
@media(max-width:900px){
  body .lead-row,body .lead-row:has(.pick){grid-template-columns:minmax(0,1fr) auto 36px;grid-template-areas:"main score call" "contact stage stage" "follow follow follow";gap:6px 10px;padding:12px}
  body .lead-row:has(.pick){grid-template-columns:28px minmax(0,1fr) auto 36px;grid-template-areas:"pick main score call" "pick contact stage stage" "pick follow follow follow"}
  body .lead-row .pick{grid-area:pick}
  body .lead-row .lead-main{grid-area:main}body .lead-row .contact{grid-area:contact}body .lead-row .lead-score{grid-area:score}body .lead-row .stage{grid-area:stage;justify-self:end}body .lead-row .followup{grid-area:follow}body .lead-row .call-btn,body .lead-row .call-btn-ph{grid-area:call}body .lead-row .chev{display:none}
}

/* leads toolbar + filters */
body .leads-bar{display:grid;grid-template-columns:minmax(0,1fr) 170px auto;gap:10px;margin-bottom:10px}
body .leads-meta{display:flex;align-items:center;gap:8px;margin:12px 0 10px;flex-wrap:wrap}
body .toggle{display:inline-flex;border:1px solid var(--ds-border-strong);border-radius:var(--ds-r);overflow:hidden}
body .toggle button{border:0;background:var(--ds-surface);padding:0 12px;min-height:30px;font-size:12.5px;font-weight:550;color:var(--ds-muted)}
body .toggle button.on{background:var(--ds-brand-soft);color:var(--ds-brand)}
body .filter-panel{border:1px solid var(--ds-border);border-radius:var(--ds-r-lg);background:var(--ds-surface);padding:16px;margin:0 0 12px;display:grid;gap:14px}
body .fgroup{display:grid;gap:7px}
body .fgroup>span{font-size:12px;font-weight:600;color:var(--ds-text-2)}
body .fchips{display:flex;flex-wrap:wrap;gap:6px}
body .fchip{min-height:28px;padding:0 10px;border:1px solid var(--ds-border-strong);border-radius:999px;background:var(--ds-surface);color:var(--ds-text-2);font-size:12.5px;font-weight:550;cursor:pointer}
body .fchip:hover{border-color:var(--ds-brand);color:var(--ds-brand)}
body .fchip.on{background:var(--ds-brand);border-color:var(--ds-brand);color:#fff}
body .fgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px 12px}
body .fchecks{display:flex;flex-wrap:wrap;gap:6px 18px}
body .fbar{display:flex;gap:8px;justify-content:flex-end}
body .check{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:500;color:var(--ds-text-2);margin:0}
body .check input{width:auto;min-height:0}
body .checks{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:8px 16px;margin-bottom:8px}
body .bulkbar{position:sticky;top:0;z-index:5;display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:10px 14px;margin:0 0 10px;border:1px solid var(--ds-brand);border-radius:var(--ds-r-lg);background:var(--ds-brand-soft)}
body .bulk-actions{display:flex;gap:8px;flex-wrap:wrap;margin-left:auto}
body .bulk-actions select{min-height:30px;font-size:12.5px;padding:0 8px;width:auto}
body .more{text-align:center;padding:14px 0}

/* board */
body .board{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(250px,1fr);gap:12px;overflow-x:auto;padding-bottom:10px;align-items:start}
body .board-col{background:var(--ds-surface-3);border-radius:var(--ds-r-lg);padding:10px;min-height:200px;border:2px dashed transparent}
body .board-col.drop{border-color:var(--ds-brand);background:var(--ds-brand-soft)}
body .board-col>header{display:flex;justify-content:space-between;align-items:center;padding:2px 4px 8px;font-size:13px;position:static;height:auto;background:none;border:0}
body .board-body{display:grid;gap:8px}
body .board-card{background:var(--ds-surface);border:1px solid var(--ds-border);border-radius:var(--ds-r);padding:10px 11px;cursor:grab;box-shadow:var(--ds-sh-xs);display:grid;gap:3px}
body .board-card:hover{border-color:var(--ds-brand)}
body .bc-top{display:flex;justify-content:space-between;gap:8px;align-items:flex-start;font-size:13.5px}
body .bc-foot{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:4px}
body .bc-foot select{width:auto;min-height:26px;font-size:11.5px;padding:0 6px}

/* today */
body .today-top{display:grid;grid-template-columns:1.4fr 1fr;gap:14px;margin:6px 0 4px}
body .callwin{display:inline-flex;gap:8px;align-items:center;padding:4px 10px;border-radius:999px;font-size:12px;font-weight:550;background:var(--ds-surface-3);color:var(--ds-text-2)}
body .callwin.big{display:grid;gap:2px;padding:14px 16px;border-radius:var(--ds-r-lg);font-size:13px;border:1px solid var(--ds-border)}
body .callwin.big b{font-size:15px}
body .callwin.tier-best{background:var(--ds-success-soft);color:#0b5c40;border-color:#bfe5d3}
body .callwin.tier-ok{background:var(--ds-brand-soft);color:var(--ds-brand-press);border-color:var(--ds-brand-soft-2)}
body .callwin.tier-poor{background:var(--ds-warning-soft);color:#7a4a0a;border-color:#f0d8a8}
body .callwin.tier-closed{background:var(--ds-surface-3);color:var(--ds-muted)}
body .goalbox{padding:14px 16px;border:1px solid var(--ds-border);border-radius:var(--ds-r-lg);background:var(--ds-surface);display:grid;gap:8px;align-content:center}
body .goal-head{display:flex;justify-content:space-between;align-items:center;font-size:13px;color:var(--ds-muted)}
body .goal-head b{color:var(--ds-text);font-size:15px;display:inline-flex;align-items:center;gap:4px}
body .goal-head input{width:62px;min-height:28px;padding:0 6px;font-size:14px;text-align:center}
body .kpis{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;margin:12px 0 16px}
body .queue{display:grid;grid-template-columns:repeat(auto-fill,minmax(360px,1fr));gap:12px}
body .qcard{background:var(--ds-surface);border:1px solid var(--ds-border);border-radius:var(--ds-r-lg);padding:14px;display:grid;gap:9px;box-shadow:var(--ds-sh-xs);cursor:pointer}
body .qcard:hover{border-color:var(--ds-brand)}
body .q-top{display:flex;gap:10px;align-items:flex-start}
body .q-rank{flex:0 0 auto;display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:var(--ds-surface-3);font-size:12px;font-weight:650;color:var(--ds-muted)}
body .q-title{flex:1;min-width:0}
body .q-title h3{margin:0;font-size:15px;line-height:1.3}
body .q-who{font-size:13.5px;display:flex;align-items:center}
body .q-next{display:grid;gap:1px;padding:9px 11px;border-radius:var(--ds-r);background:var(--ds-surface-2);border-left:3px solid var(--ds-border-strong);font-size:12.5px;color:var(--ds-muted)}
body .q-next b{color:var(--ds-text);font-size:13.5px}
body .q-next.call{border-left-color:var(--ds-brand);background:var(--ds-brand-soft)}
body .q-next.email{border-left-color:var(--ds-accent);background:var(--ds-accent-soft)}
body .q-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
body .q-actions select{width:auto;min-height:34px;font-size:12.5px;padding:0 8px}
body .q-actions .primary,body .q-actions .ghost{min-height:36px;padding:0 12px;font-size:13px}

/* lead dialog */
body .crm-dialog{width:min(1120px,calc(100% - 20px))}
body .crm-dialog.wide{width:min(1060px,calc(100% - 20px))}
body #modalDialog:not(.wide){width:min(560px,calc(100% - 20px))}
body .crm-form{padding:20px 24px;max-height:inherit;overflow:auto;overscroll-behavior:contain}
body .crm-form .dialog-head{margin:-20px -24px 16px}
body .crm-form .dialog-actions{margin:18px -24px -20px}
body .dialog-actions.wrap{flex-wrap:wrap}
body .dialog-actions.flush{margin:12px 0;padding:0;border:0;background:none}
body .head-meta{display:flex;gap:8px;align-items:center;margin-top:6px;flex-wrap:wrap}
body .action-bar{display:flex;gap:8px;flex-wrap:wrap;margin:-4px 0 12px}
body .action-bar .primary,body .action-bar .ghost{min-height:34px}
body .suggest{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;padding:11px 14px;border-radius:var(--ds-r);background:var(--ds-brand-soft);border:1px solid var(--ds-brand-soft-2);margin-bottom:16px;font-size:13px}
body .suggest>div{display:grid;gap:1px}
body .suggest.none{background:var(--ds-surface-2);border-color:var(--ds-border)}
body .lead-cols{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:24px}
body .tabs-inline{display:flex;gap:4px;border-bottom:1px solid var(--ds-border);margin-bottom:16px}
body .tab{border:0;background:none;padding:9px 12px;font-size:13.5px;font-weight:550;color:var(--ds-muted);border-bottom:2px solid transparent;margin-bottom:-1px;cursor:pointer}
body .tab.on{color:var(--ds-brand);border-bottom-color:var(--ds-brand)}
body .lead-left h3,body .timeline-panel h3,body .crm-form h3{font-size:13px;font-weight:600;margin:14px 0 10px}
body .lead-left h3:first-child{margin-top:0}
body .timeline-panel{border-left:1px solid var(--ds-border);padding-left:24px}
body .tl-sub{margin-top:18px}
body .note-item.audit{opacity:.8;font-size:12.5px}
body .intel-scores{display:grid;grid-template-columns:1fr 1fr;gap:12px}
body .intel-card{border:1px solid var(--ds-border);border-radius:var(--ds-r);padding:12px;display:grid;gap:8px}
body .intel-head{display:flex;gap:10px;align-items:center}
body .intel-head>div{display:grid}
body .reasons{list-style:none;margin:0;padding:0;display:grid;gap:4px;font-size:12.5px;color:var(--ds-text-2)}
body .reasons li b{display:inline-block;min-width:30px;color:var(--ds-success)}
body .reasons li.neg b{color:var(--ds-danger)}
body .mini-table{display:grid;border:1px solid var(--ds-border);border-radius:var(--ds-r);overflow:hidden}
body .mt-row{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1.2fr) auto;gap:10px;align-items:center;padding:9px 12px;border-top:1px solid var(--ds-divider);font-size:13px}
body .mt-row:first-child{border-top:0}
body .mt-row .muted{overflow:hidden;text-overflow:ellipsis}
body .facts{display:grid;grid-template-columns:150px 1fr;gap:6px 12px;margin:0;font-size:13px}
body .facts dt{color:var(--ds-muted)}body .facts dd{margin:0}
body .email-state{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:12px}
body .step{border:1px solid var(--ds-border);border-radius:var(--ds-r);padding:12px 14px;margin:0 0 12px;display:grid;gap:8px}
body .step legend{font-size:12.5px;font-weight:650;padding:0 6px}
body .merge-row{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
body .preview .pv{background:var(--ds-surface-2);border-radius:var(--ds-r);padding:10px 12px;font-size:12.5px}
body .pv-subj{font-weight:600;margin:4px 0}
body .pv pre{white-space:pre-wrap;font-family:inherit;margin:0;color:var(--ds-text-2)}

/* outcome sheet */
body .outcome-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:8px;margin-bottom:14px}
body .outcome{min-height:46px;padding:0 12px;border:1px solid var(--ds-border-strong);border-radius:var(--ds-r);background:var(--ds-surface);font-size:13.5px;font-weight:600;color:var(--ds-text-2);text-align:left;cursor:pointer}
body .outcome.good:hover{border-color:var(--ds-success)}body .outcome.bad:hover{border-color:var(--ds-danger)}body .outcome:hover{border-color:var(--ds-brand)}
body .outcome.on{background:var(--ds-brand);border-color:var(--ds-brand);color:#fff}
body .oc-extra{display:grid;gap:10px;margin-bottom:12px}
body #outcomeDialog{width:min(620px,calc(100% - 20px))}

/* campaigns */
body .camp-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:12px}
body .camp-card{background:var(--ds-surface);border:1px solid var(--ds-border);border-radius:var(--ds-r-lg);padding:14px;display:grid;gap:12px;box-shadow:var(--ds-sh-xs);cursor:pointer}
body .camp-card:hover{border-color:var(--ds-brand)}
body .cc-top{display:flex;justify-content:space-between;gap:8px;align-items:flex-start}
body .cc-top h3{margin:0;font-size:15px}
body .cc-stats{display:grid;grid-template-columns:repeat(5,1fr);gap:6px;text-align:center}
body .cc-stats.big{grid-template-columns:repeat(4,1fr);margin:0 0 12px}
body .cc-stats div{display:grid;padding:8px 4px;background:var(--ds-surface-2);border-radius:var(--ds-r-sm)}
body .cc-stats b{font-size:17px}body .cc-stats span{font-size:11px;color:var(--ds-muted)}
body .cc-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}

/* import + settings */
body .drop{display:grid;place-items:center;min-height:90px;border:2px dashed var(--ds-border-strong);border-radius:var(--ds-r-lg);background:var(--ds-surface-2);color:var(--ds-muted);cursor:pointer;margin:0 0 14px;padding:14px;text-align:center}
body .drop.over{border-color:var(--ds-brand);background:var(--ds-brand-soft)}
body .drop input{display:none}
body .panel{border:1px solid var(--ds-border);border-radius:var(--ds-r-lg);padding:16px;background:var(--ds-surface);margin-bottom:14px}
body .panel h3{margin:0 0 10px;font-size:14px}
body .checklist{list-style:none;margin:0 0 14px;padding:0;display:grid;gap:8px}
body .checklist li{display:flex;gap:10px;font-size:13px}
body .checklist li>span{flex:0 0 auto;display:grid;place-items:center;width:20px;height:20px;border-radius:50%;font-size:12px;font-weight:700;background:var(--ds-surface-3);color:var(--ds-muted)}
body .checklist li.ok>span{background:var(--ds-success-soft);color:var(--ds-success)}
body .inline-form{display:flex;gap:8px;margin-bottom:10px}
body .supp{max-height:260px;overflow:auto}

/* insights */
body .insight-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(340px,1fr));gap:14px}
body .bars{display:grid;gap:8px}
body .barrow{display:grid;grid-template-columns:120px 1fr 56px;gap:10px;align-items:center;font-size:12.5px}
body .barrow .bl{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ds-text-2)}
body .barrow b{text-align:right;font-variant-numeric:tabular-nums}
body .bt{height:10px;border-radius:999px;background:var(--ds-surface-3);overflow:hidden}
body .bt>i{display:block;height:100%;width:0;background:var(--ds-brand);border-radius:999px}
body .spark{display:flex;align-items:flex-end;gap:6px;height:140px;margin-top:8px}
body .sp{flex:1;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:4px;font-size:10.5px;color:var(--ds-muted)}
body .sp>i{display:block;width:100%;max-width:26px;min-height:3px;background:var(--ds-brand);border-radius:4px 4px 0 0}

@media(max-width:900px){
  body .today-top{grid-template-columns:1fr}
  body .kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  body .lead-cols{grid-template-columns:1fr}
  body .timeline-panel{border-left:0;padding-left:0;border-top:1px solid var(--ds-border);padding-top:14px}
  body .intel-scores{grid-template-columns:1fr}
  body .queue{grid-template-columns:1fr}
  body .mt-row{grid-template-columns:1fr auto}
  body .mt-row>div:nth-child(2){grid-column:1/-1;order:3}
  body .facts{grid-template-columns:110px 1fr}
  body .cc-stats{grid-template-columns:repeat(3,1fr)}
  body .barrow{grid-template-columns:90px 1fr 48px}
  body .crm-form{padding:14px}
  body .crm-form .dialog-head{margin:-14px -14px 12px}
  body .crm-form .dialog-actions{margin:14px -14px -14px}
  body #modalDialog:not(.wide){width:calc(100% - 20px)}
}

/* ---- polish pass (from the browser run) ---- */
/* baseline .muted is nowrap+ellipsis for tight list rows; long help text elsewhere must wrap */
body .muted{white-space:normal;overflow:visible;text-overflow:clip}
body .lead-row .muted,body .board-card .muted,body .q-title .muted,body .mt-row .mt-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body .checklist li>div{min-width:0;overflow-wrap:anywhere}
body .board{grid-auto-columns:minmax(210px,1fr)}
body .crm-form label.check{margin:12px 0}
body .crm-form .step{margin-top:14px}
body .tiny.pre-actions{margin:0 0 6px}
body .mt-row>div{min-width:0}
@media(max-width:760px){
  body .leads-bar{grid-template-columns:1fr 1fr}
  body .leads-bar .searchbox{grid-column:1/-1}
  body .board{grid-auto-columns:minmax(240px,86%)}
}
/* Email sequences, simplified */
body .cc-stats.three{grid-template-columns:repeat(3,1fr)}
body .send-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
body .send-bar>span{flex:1 1 220px;min-width:0}
body details.adv{margin:12px 0;border:1px solid var(--ds-border);border-radius:var(--ds-r);padding:0 12px;background:var(--ds-surface-2)}
body details.adv>summary{cursor:pointer;padding:12px 0;font-weight:600;font-size:14px;list-style-position:inside}
body details.adv[open]>summary{border-bottom:1px solid var(--ds-border);margin-bottom:10px}
body details.adv.more{background:transparent}
/* Desktop: a navy top bar so the logo, user and Settings stand out (phones keep the iOS look) */
@media(min-width:761px){
  html body header{background:#0e2541;border-bottom:0;box-shadow:0 4px 14px -6px rgba(14,37,65,.5);backdrop-filter:none;-webkit-backdrop-filter:none}
  html body .brand img{content:url("brand/dealerstation-logo-white.svg")}
  html body .brand span{color:rgba(255,255,255,.75);border-left-color:rgba(255,255,255,.3)}
  html body .header-actions{color:rgba(255,255,255,.8)}
  html body .header-actions .ghost{background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.25);color:#fff}
  html body .header-actions .ghost:hover{background:rgba(255,255,255,.22)}
  html body .avatar-btn{background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.3);box-shadow:none}
  html body .avatar-btn:before{background:#fff}
  html body .avatar-btn:hover{background:rgba(255,255,255,.22)}
}
body #campaignsPage .section-head{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;flex-wrap:wrap}
/* Email leads wizard */
body .head-btns{display:flex;gap:8px;flex-wrap:wrap}
body .cmp-steps{display:flex;gap:6px;list-style:none;margin:4px 0 14px;padding:0}
body .cmp-steps li{display:flex;align-items:center;gap:8px;flex:1;padding:8px 10px;border-radius:var(--ds-r);background:var(--ds-surface-2);color:var(--ds-muted);font-size:13px;font-weight:600}
body .cmp-steps li span{display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--ds-border);font-size:12px}
body .cmp-steps li.on{background:var(--ds-brand);color:#fff}body .cmp-steps li.on span{background:rgba(255,255,255,.25)}
body .cmp-steps li.done span{background:var(--ds-success-soft);color:#0b5c40}
body .cmp-opts{display:grid;gap:8px;margin:0 0 14px}
body .cmp-opt{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid var(--ds-border);border-radius:var(--ds-r);cursor:pointer;background:var(--ds-surface)}
body .cmp-opt.on{border-color:var(--ds-brand);box-shadow:0 0 0 1px var(--ds-brand)}
body .cmp-opt span{display:grid;gap:2px}body .cmp-opt small{color:var(--ds-muted);font-size:12.5px}
body .cmp-opt input{width:auto;min-height:0}
body .cmp-count b{font-size:18px}
body .cmp-review{display:grid;gap:8px;margin:0 0 14px}
body .cmp-review div{display:grid;gap:2px;padding:10px 12px;background:var(--ds-surface-2);border-radius:var(--ds-r)}
body .compose select{width:100%}
body .cmp-opt{position:relative}
body .cmp-opt input{position:absolute;opacity:0;width:1px;height:1px;pointer-events:none}
body .cmp-opt:before{content:"";flex:0 0 auto;width:20px;height:20px;border-radius:50%;border:2px solid var(--ds-border-strong,#c3c9d4);box-sizing:border-box}
body .cmp-opt.on:before{border-color:var(--ds-brand);background:radial-gradient(circle,var(--ds-brand) 0 40%,transparent 45%)}
body .compose .dialog-actions button{flex:1 1 auto;padding-left:14px;padding-right:14px;white-space:nowrap}
body .compose .dialog-actions>span:empty{flex:0 0 0}
/* toast as a popover: undo the browser's default popover box so it keeps its bottom-centre position */
body .toast[popover]{top:auto;right:auto;margin:0;border:0;width:max-content;height:auto}
/* Email: sending status panel */
body .send-panel{background:var(--ds-surface);border:1px solid var(--ds-border);border-radius:var(--ds-r-lg);padding:14px;margin:0 0 16px;display:grid;gap:10px}
body .send-panel p{margin:0}
body .send-panel .sp-line{font-size:14px;color:var(--ds-text-2)}
body .send-panel .sp-actions{display:flex;gap:8px}
body .send-panel .sp-actions button{flex:1;min-height:44px}

/* Settings > Outbound email: login check row and the Send switch */
body .checklist li.bad>span{background:var(--ds-danger-soft);color:var(--ds-danger,#b3261e)}
body .checklist li.bad>div>b{color:var(--ds-danger,#b3261e)}
body .sw-row{margin:6px 0 4px}
body .sw-row label.sw{display:flex;align-items:center;gap:12px;margin:0}
body .sw-row label.sw input{flex:0 0 auto;margin:0}
body .sw-row p{margin:6px 0 0}
body .crm-form.settings .panel form{padding:0}
