/* AIDialer: modern UI. Dark navy sidebar, glass top bar, soft-shadow cards, teal→blue brand gradient.
   Brand colors come from the logo (logo.svg / logo-mark.svg). Change the --brand-* / --primary* tokens to re-skin. */
:root {
  --brand-900: #07111F; --brand-800: #0B1A2E; --brand-700: #13263F;
  --accent: #2DD4BF; --accent-2: #1D6FD8;
  --grad: linear-gradient(135deg, #14B8A6 0%, #0E9AA0 50%, #1D6FD8 100%);
  --page: #F3F6FA; --surface: #FFFFFF; --surface-2: #F8FAFC; --text: #0F1B2D; --text2: #556378;
  --primary: #0F766E; --primary-dark: #0B5E58; --primary-soft: #E7F6F4;
  --border: #E2E8F0; --border-strong: #CBD5E1;
  --error: #B42318; --error-soft: #FEF3F2; --warn: #B54708; --warn-soft: #FFFAEB; --ok: #067647; --ok-soft: #ECFDF3;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15,27,45,.04), 0 4px 16px rgba(15,27,45,.05);
  --shadow-hover: 0 2px 4px rgba(15,27,45,.06), 0 12px 28px rgba(15,27,45,.09);
  --shadow-lg: 0 24px 60px rgba(7,17,31,.28);
  --ring: 0 0 0 3px rgba(20,184,166,.22);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--text); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
body { background: radial-gradient(1200px 380px at 70% -120px, rgba(45,212,191,.10), transparent 70%), var(--page); background-attachment: fixed; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid #5FD3C5; outline-offset: 2px; border-radius: 6px; }
h1 { font-size: 27px; line-height: 1.2; margin: 0; font-weight: 750; letter-spacing: -.025em; }
h2 { font-size: 18px; margin: 0 0 12px; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 15.5px; margin: 0 0 8px; font-weight: 700; }
.muted { color: var(--text2); }
.small { font-size: 13.5px; }
.boot { padding: 48px; color: var(--text2); }
#app > .boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; font-weight: 500; }
#app > .boot img { animation: bootpulse 1.4s ease-in-out infinite; filter: drop-shadow(0 8px 18px rgba(20,184,166,.3)); }
@keyframes bootpulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.92); opacity: .75; } }
@media (prefers-reduced-motion: reduce) { #app > .boot img { animation: none; } }
.ico { width: 19px; height: 19px; flex: none; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.shell > * { min-width: 0; }   /* wide content (pipeline board, tables) scrolls inside the page, not the whole page */
.side { background: linear-gradient(180deg, var(--brand-800) 0%, var(--brand-900) 100%); color: #C7D3E3; padding: 20px 14px 16px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; z-index: 6; }
.side::after { content: ""; position: absolute; inset: 0 0 auto 0; height: 220px; background: radial-gradient(260px 160px at 20% 0%, rgba(45,212,191,.16), transparent 70%); pointer-events: none; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 0; color: #fff; font-weight: 800; position: relative; z-index: 1; }
a.brand:hover { text-decoration: none; }
.brand-mark { width: 38px; height: 38px; flex: none; display: grid; place-items: center; filter: drop-shadow(0 6px 14px rgba(20,184,166,.35)); }
.brand-mark .mark { width: 38px; height: 38px; display: block; }
.brand-text { font-size: 21px; letter-spacing: -.03em; line-height: 1; color: #fff; }
.brand-text b { background: linear-gradient(90deg, #5EEAD4, #60A5FA); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 800; }
.brand-text small { font-size: 12.5px; font-weight: 600; color: #8EA0BA; letter-spacing: 0; margin-left: 1px; }
.ws-switch { margin: 18px 4px 14px; padding: 10px 12px; font-size: 13.5px; color: #E6EDF7; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; text-align: left; font-family: inherit; position: relative; z-index: 1; }
.ws-label { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #7A8DA9; margin-bottom: 2px; }
.ws-name { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-switch select { font: inherit; font-weight: 600; color: #fff; border: 1px solid rgba(255,255,255,.14); border-radius: 8px; padding: 4px 6px; background: var(--brand-700); width: 100%; max-width: 100%; }
.nav { position: relative; z-index: 1; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 2px 0; border-radius: 10px; color: #B4C2D6; font-size: 15px; font-weight: 500; transition: background .15s, color .15s; }
.nav a .ico { opacity: .85; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a.on { background: linear-gradient(90deg, rgba(45,212,191,.18), rgba(29,111,216,.10)); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.nav a.on .ico { color: var(--accent); opacity: 1; }
.nav .soon { margin-left: auto; font-size: 11px; color: #8EA0BA; border: 1px solid rgba(255,255,255,.15); border-radius: 999px; padding: 0 6px; }
.side .grow { flex: 1; min-height: 16px; }
.side nav[aria-label="Settings"] { border-top: 1px solid rgba(255,255,255,.08); padding-top: 10px; }
.side nav[aria-label="Settings"]:empty { display: none; }
.top { display: flex; align-items: center; gap: 16px; padding: 12px 32px; min-height: 64px; background: rgba(255,255,255,.82); backdrop-filter: saturate(180%) blur(10px); -webkit-backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5; }
.crumb { color: var(--text2); font-size: 14.5px; font-weight: 500; }
.crumb a { color: var(--text2); }
.crumb a:hover { color: var(--primary); }
.top .search { margin-left: auto; width: 360px; max-width: 40vw; position: relative; }
.top .search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: #8A98AC; pointer-events: none; }
.top .search input { width: 100%; background: var(--surface-2); border-radius: 999px; padding-left: 38px; }
.top .search input:focus { background: #fff; }
.me { position: relative; }
.me button#meBtn { display: flex; align-items: center; gap: 9px; background: none; border: 1px solid transparent; font: inherit; font-size: 14.5px; font-weight: 600; color: var(--text); cursor: pointer; padding: 4px 10px 4px 4px; border-radius: 999px; }
.me button#meBtn:hover { background: var(--surface); border-color: var(--border); }
.me .caret { color: var(--text2); font-size: 12px; }
.avatar.sm { width: 32px; height: 32px; font-size: 12.5px; background: var(--grad); color: #fff; }
.menu { position: absolute; right: 0; top: 46px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(15,27,45,.14); min-width: 230px; padding: 6px; display: none; }
.menu.open { display: block; animation: pop .14s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; color: var(--text); font-size: 14.5px; }
.menu a:hover, .menu button:hover { background: var(--page); text-decoration: none; }
.main { padding: 30px 36px 72px; max-width: 1320px; }
.pagehead { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 26px; }
.pagehead .sub { margin-top: 6px; color: var(--text2); max-width: 760px; }
.pagehead .actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card > h2:first-child, .card > h3:first-child { letter-spacing: -.01em; }
.card .card { box-shadow: none; border-color: #E6EBF2; border-radius: 12px; transition: border-color .15s, background .15s; }
.card .card:hover { border-color: var(--border-strong); }
.card .card:has(input[data-f$=".enabled"]:checked) { border-color: #A7DCD4; background: #F6FCFB; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.metric { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px 18px 22px; display: block; color: var(--text); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; }
.metric::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--grad); }
a.metric:hover { text-decoration: none; border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.metric .label { color: var(--text2); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.metric .value { font-size: 34px; font-weight: 750; margin-top: 4px; letter-spacing: -.03em; line-height: 1.15; }
.metric .na { font-size: 14px; color: var(--text2); margin-top: 14px; }
.row-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.row-item:last-child { border-bottom: 0; }
.row-item .end { margin-left: auto; }
.check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; flex: none; }
.check.done { background: var(--grad); border-color: transparent; color: #fff; }

/* ---------- controls ---------- */
input, select, textarea { font: inherit; color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 9px 12px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: #B3C0D0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #14B8A6; box-shadow: var(--ring); }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }
input[type=range] { accent-color: #0E9488; padding: 0; border: 0; box-shadow: none; background: none; }
/* On/off settings (agent actions etc.) render as switches; still a real checkbox underneath. */
input[type=checkbox][data-f$=".enabled"] { -webkit-appearance: none; appearance: none; width: 38px; height: 22px; border-radius: 999px; background: #CBD5E1; border: 0; padding: 0; margin: 0 6px 0 0; position: relative; cursor: pointer; vertical-align: middle; flex: none; transition: background .18s; }
input[type=checkbox][data-f$=".enabled"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15,27,45,.3); transition: transform .18s; }
input[type=checkbox][data-f$=".enabled"]:checked { background: linear-gradient(135deg, #14B8A6, #0F766E); }
input[type=checkbox][data-f$=".enabled"]:checked::after { transform: translateX(16px); }
input[type=checkbox][data-f$=".enabled"]:focus-visible { box-shadow: var(--ring); outline: none; }
input[type=checkbox][data-f$=".enabled"]:disabled { opacity: .5; cursor: not-allowed; }
textarea { width: 100%; min-height: 80px; resize: vertical; }
label { display: block; font-weight: 600; font-size: 13.5px; margin: 14px 0 6px; color: #24324A; }
label .opt { font-weight: 400; color: var(--text2); }
.field input, .field select, .field textarea { width: 100%; }
.btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 600; font-size: 14.5px; border-radius: var(--radius-sm); padding: 10px 18px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap; box-shadow: 0 1px 2px rgba(15,27,45,.05); transition: background .15s, box-shadow .15s, transform .1s, border-color .15s; }
.btn:hover { background: var(--surface-2); border-color: #B3C0D0; text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #129488 0%, #0F766E 100%); border-color: #0D6B64; color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 2px rgba(15,118,110,.25), 0 4px 12px rgba(15,118,110,.22); }
.btn.primary:hover { background: linear-gradient(180deg, #0F857A 0%, #0B5E58 100%); border-color: #0B5E58; box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 2px 4px rgba(15,118,110,.3), 0 8px 18px rgba(15,118,110,.26); }
.btn.danger { color: var(--error); border-color: #F3B8B3; }
.btn.danger:hover { background: var(--error-soft); }
.btn.small { padding: 6px 12px; font-size: 13.5px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.linkbtn { background: none; border: 0; color: var(--primary); font: inherit; cursor: pointer; padding: 0; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 22px; }
.tabs a { padding: 10px 16px; color: var(--text2); font-weight: 500; border-bottom: 2.5px solid transparent; margin-bottom: -1px; border-radius: 8px 8px 0 0; transition: color .15s, background .15s; }
.tabs a.on { color: var(--primary); border-color: var(--primary); font-weight: 650; }
/* Narrow desktop windows (761-1100 px wide) too: a long tab row scrolls sideways inside itself, page-header buttons wrap,
   and two-column grids never grow wider than the page (a file input or long word used to push the page sideways). */
.tabs { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs a { white-space: nowrap; }
.pagehead { flex-wrap: wrap; }
.pagehead > div { min-width: 0; }
.pagehead .actions { flex-wrap: wrap; }
.grid2 > *, .grid4 > *, .detail > * { min-width: 0; }
.card .btn { max-width: 100%; white-space: normal; text-align: left; }   /* a long button label wraps instead of pushing the card wider */
.sayrow { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; }
.sayrow input { min-width: 0; width: 100%; box-sizing: border-box; }
input[type="file"] { max-width: 100%; }
.tscroll { overflow-x: auto; }   /* a table inside an ordinary card scrolls sideways on its own on a phone */
.tabs a:hover { text-decoration: none; color: var(--text); background: rgba(15,27,45,.03); }
.filters { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: #66758A; font-weight: 650; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 11px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
td { padding: 13px 12px; border-bottom: 1px solid #EDF1F6; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #F5FBFA; }
.tablecard { padding: 0; overflow-x: auto; }
.tablecard table th:first-child, .tablecard table td:first-child { padding-left: 22px; }
.tablecard table th:last-child, .tablecard table td:last-child { padding-right: 22px; }
.tablecard > h2:first-child, .tablecard > h3:first-child { padding: 18px 22px 0; }
.pager { display: flex; gap: 8px; align-items: center; padding: 12px 22px; color: var(--text2); font-size: 14px; border-top: 1px solid var(--border); }

/* ---------- badges / statuses (always text + color) ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text2); white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.ok { color: var(--ok); background: var(--ok-soft); border-color: #ABEFC6; }
.badge.warn { color: var(--warn); background: var(--warn-soft); border-color: #FEDF89; }
.badge.err { color: var(--error); background: var(--error-soft); border-color: #FECDCA; }
.badge.teal { color: var(--primary); background: var(--primary-soft); border-color: #B5DDD8; }
.badge.plain::before { display: none; }

/* ---------- notices ---------- */
.notice { border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; border: 1px solid var(--border); background: var(--surface); border-left-width: 4px; }
.notice.err { background: var(--error-soft); border-color: #FECDCA; border-left-color: var(--error); color: var(--error); }
.notice.warn { background: var(--warn-soft); border-color: #FEDF89; border-left-color: #F79009; color: #93370D; }
.notice.ok { background: var(--ok-soft); border-color: #ABEFC6; border-left-color: #17B26A; color: var(--ok); }
.empty { text-align: center; padding: 52px 20px; color: var(--text2); }
.empty h3 { color: var(--text); font-size: 18px; }
.unavailable { max-width: 640px; margin: 40px auto; text-align: center; }
.unavailable .icon { font-size: 40px; margin-bottom: 8px; }

/* ---------- contact detail ---------- */
.detail { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.detail.wide { grid-template-columns: 1fr 420px; }
.detail.mid { grid-template-columns: 1fr 360px; }
.idhead { display: flex; align-items: center; gap: 16px; }
.avatar { width: 54px; height: 54px; border-radius: 50%; background: linear-gradient(135deg, #CCFBF1, #DBEAFE); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 750; font-size: 19px; flex: none; box-shadow: inset 0 0 0 1px rgba(15,118,110,.12); }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 12px; font-size: 14.5px; }
.kv dt { color: var(--text2); }
.kv dd { margin: 0; word-break: break-word; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.timeline li > * { min-width: 0; }
.tl-title, .tl-meta, .tl-detail { overflow-wrap: anywhere; min-width: 0; max-width: 100%; }
.drawer { overflow-x: hidden; }
.drawer img, .drawer iframe, .drawer table { max-width: 100%; }
.timeline li:last-child { border-bottom: 0; }
.tl-icon { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 15px; }
.tl-icon.ai { background: var(--primary-soft); border-color: #B5DDD8; }
.tl-title { font-weight: 600; }
.tl-meta { color: var(--text2); font-size: 13px; }
.tl-detail { white-space: pre-wrap; font-size: 14px; margin-top: 6px; color: #2B3A55; background: var(--surface-2); border: 1px solid #EDF1F6; border-radius: 10px; padding: 8px 10px; }
.transcript { font-size: 14px; }
.transcript .line { padding: 6px 0; }
.transcript .who { font-weight: 600; margin-right: 6px; }
.transcript .agent .who { color: var(--primary); }
.tag { display: inline-block; font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 0 6px; margin: 0 4px 4px 0; }

/* ---------- dialogs / drawer ---------- */
.overlay { position: fixed; inset: 0; background: rgba(7,17,31,.45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 25; animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.dialog { background: var(--surface); border-radius: 18px; padding: 26px 28px; width: 520px; max-width: calc(100vw - 32px); max-height: calc(100vh - 48px); overflow: auto; box-shadow: var(--shadow-lg); animation: rise .18s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.dialog .buttons { display: flex; gap: 8px; justify-content: flex-end; margin-top: 22px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 560px; max-width: 100vw; background: var(--surface); box-shadow: -16px 0 48px rgba(7,17,31,.2); z-index: 21; overflow: auto; padding: 24px 26px; border-left: 1px solid var(--border); }
#toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 8px); background: var(--brand-800); color: #fff; padding: 11px 20px; border-radius: 999px; font-size: 14.5px; font-weight: 500; box-shadow: 0 12px 30px rgba(7,17,31,.3); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 30; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- sign-in ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-art { position: relative; overflow: hidden; background: radial-gradient(600px 400px at 15% 10%, rgba(45,212,191,.28), transparent 60%), radial-gradient(500px 420px at 90% 95%, rgba(29,111,216,.35), transparent 60%), linear-gradient(160deg, var(--brand-800), var(--brand-900)); color: #DCE6F2; display: flex; align-items: center; justify-content: center; padding: 48px; }
.auth-art::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.08) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent); }
.auth-art-in { position: relative; max-width: 440px; }
.auth-art-logo { width: 236px; height: auto; display: block; margin-bottom: 36px; }
.auth-art h2 { color: #fff; font-size: 30px; line-height: 1.2; letter-spacing: -.025em; font-weight: 750; margin: 0 0 22px; }
.auth-art ul { list-style: none; margin: 0; padding: 0; }
.auth-art li { position: relative; padding: 8px 0 8px 32px; color: #B9C8DA; font-size: 15.5px; }
.auth-art li::before { content: "✓"; position: absolute; left: 0; top: 8px; width: 22px; height: 22px; border-radius: 50%; background: rgba(45,212,191,.18); color: #5EEAD4; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: 32px 24px; }
.auth .card { width: 420px; max-width: 100%; padding: 36px 34px; border-radius: 18px; box-shadow: 0 2px 4px rgba(15,27,45,.04), 0 20px 50px rgba(15,27,45,.08); }
.auth .brand { padding: 0; margin-bottom: 22px; }
.auth-logo img { display: block; height: 52px; width: auto; }
.auth-title { font-size: 25px; }
.auth .btn.primary { padding: 12px 18px; font-size: 15.5px; }
@media (min-width: 901px) { .auth-logo { display: none; } }
@media (max-width: 900px) { .auth { grid-template-columns: minmax(0, 1fr); } .auth-art { display: none; } .auth-panel { min-height: 100vh; } }

/* ---------- import mapping / steps ---------- */
.mapgrid { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 8px 14px; align-items: center; font-size: 14px; }
.mapgrid .h { color: var(--text2); font-weight: 600; }
.steps { display: flex; gap: 8px; margin-bottom: 20px; font-size: 14px; color: var(--text2); }
.steps span { padding: 5px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-weight: 500; }
.steps span.on { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(15,118,110,.22); }
.steps span.done { color: var(--primary); border-color: #B5DDD8; background: var(--primary-soft); }
[hidden] { display: none !important; }
.grid4.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metric .delta { color: var(--text2); font-size: 13px; }

/* ---------- charts ---------- */
.ch-wrap { position: relative; }
.ch-wrap svg { width: 100%; display: block; overflow: visible; }
.ch-grid { stroke: #EDF1F5; stroke-width: 1; vector-effect: non-scaling-stroke; }
.ch-base { stroke: #C9D2DC; stroke-width: 1; vector-effect: non-scaling-stroke; }
.ch-ax { position: absolute; color: var(--text2); font-size: 11px; line-height: 1; white-space: nowrap; pointer-events: none; }
.ch-y { transform: translateY(-50%); }
.ch-x { transform: translateX(-50%); }
@media (max-width: 760px) { .ch-x.alt { display: none; } }
.ch-hit.on { fill: rgba(20,33,61,.05); }
.ch-tip { position: absolute; pointer-events: none; background: var(--brand-800); color: #fff; font-size: 13px; line-height: 1.4; padding: 6px 10px; border-radius: 8px; white-space: nowrap; z-index: 2; box-shadow: 0 8px 20px rgba(7,17,31,.25); }
.ch-legend { display: flex; gap: 16px; font-size: 13px; color: var(--text2); margin: -4px 0 8px; flex-wrap: wrap; }
.ch-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
details summary { cursor: pointer; color: var(--primary); margin-top: 8px; font-weight: 500; }
details table { margin-top: 8px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 14px; padding: 5px 0; }
.hb-track { height: 10px; background: #EEF2F6; border-radius: 999px; overflow: hidden; }
.hb-track i { display: block; height: 100%; background: linear-gradient(90deg, #14B8A6, #1D8FD8); border-radius: 999px; }
.hb-v { white-space: nowrap; }
mark.mf { background: var(--primary-soft); color: var(--primary); border-radius: 4px; padding: 0 3px; }
mark.mf.bad { background: #FEE4E2; color: #B42318; text-decoration: wavy underline; }

/* ---------- misc components ---------- */
button.chip { font: inherit; font-size: 13px; }
.steps { flex-wrap: wrap; }
.steps a:hover { text-decoration: none; }
.steps a span { display: inline-block; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn.big { font-size: 17px; padding: 12px 20px; }
.bar { height: 8px; background: #EEF2F6; border: 0; border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--grad); border-radius: 999px; }
.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.checks label, .chip { font-weight: 400; display: inline-flex; gap: 6px; align-items: center; margin: 0; }
.chip { padding: 5px 13px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 13.5px; cursor: pointer; transition: border-color .15s, background .15s; }
.chip:hover { text-decoration: none; border-color: #9FB0C4; }
.chip.mini { padding: 1px 9px; font-size: 12.5px; }
.chip.static { cursor: default; }
.chip.static:hover { border-color: var(--border-strong); }
.chip .n { color: var(--muted); font-size: 12px; }
.sayrow { display: grid; grid-template-columns: 1fr 1fr auto auto; gap: 8px; align-items: center; margin-bottom: 6px; }
.chip.on, .chip:has(input:checked) { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.bulkbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: linear-gradient(90deg, #E7F6F4, #EAF2FD); border: 1px solid #C7E6E1; border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; position: sticky; top: 72px; z-index: 3; box-shadow: var(--shadow); }
.bulkbar select { width: auto; }
.selcol { width: 40px; padding-right: 0 !important; }
.selcol input { width: 18px; height: 18px; margin: 0; cursor: pointer; }
.scriptprev { white-space: pre-wrap; background: var(--surface-2); border: 1px solid #EDF1F6; border-radius: 10px; padding: 12px 14px; margin-top: 10px; }
.aisum { position: relative; background: linear-gradient(135deg, #EEFAF8, #EEF4FD); border: 1px solid #CDE9E4; border-radius: 12px; padding: 10px 14px 10px 16px; margin: 8px 0 12px; }
.aisum::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--grad); }
.sumcell { max-width: 340px; color: var(--text2); }
.actrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.actrow select, .actrow input { width: auto; flex: 1 1 160px; min-width: 0; }
.actparam { display: contents; }
.chip input { margin: 0 4px 0 0; vertical-align: -2px; width: auto; flex: none; }
label.chip { white-space: nowrap; }
.actrow .aType { flex: 0 0 210px; }
@media (max-width: 600px) { .actrow .aType { flex: 1 1 100%; } }
.choice { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 15px; margin: 0 0 10px; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.choice:hover { border-color: var(--border-strong); }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: var(--ring); }
.choice.off { opacity: .6; cursor: not-allowed; }
.choice input { margin-top: 4px; }
.tabs a.alert { color: #B42318; }
.pick { display: block; width: 100%; text-align: left; background: none; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; margin-bottom: 6px; cursor: pointer; font: inherit; transition: border-color .15s, background .15s; }
.pick:hover { border-color: var(--primary); background: #F5FBFA; }
.mobile-only { display: none; }

/* ---------- inbox ---------- */
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr) 290px; gap: 16px; align-items: start; }
.inbox:not(.has-sel) { grid-template-columns: 340px minmax(0, 1fr); }
.inbox .card { margin: 0; }
.ibx-list { padding: 14px 10px; }
.ibx-list .filters { padding: 0 6px; }
.ibx-item { display: flex; gap: 10px; padding: 10px 8px; border-radius: 10px; color: var(--text); border-bottom: 1px solid var(--border); }
.ibx-item:hover { text-decoration: none; background: var(--surface-2); }
.ibx-item.on { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.ibx-item.unread b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-right: 6px; vertical-align: middle; }
.ibx-main { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.ibx-top { display: flex; justify-content: space-between; gap: 8px; }
.ibx-latest { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text2); }
.ibx-item.unread .ibx-latest { color: var(--text); }
.ibx-head { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.ibx-head .end { margin-left: auto; }
.ibx-side h3 { margin: 16px 0 6px; }
.ibx-det summary { cursor: pointer; }
.timeline li.ev .tl-title { color: var(--text2); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .inbox, .inbox:not(.has-sel) { grid-template-columns: 300px minmax(0, 1fr); }
  .grid4.g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ibx-side { grid-column: 2; }
  .detail, .detail.wide, .detail.mid { grid-template-columns: minmax(0, 1fr); }
  .main { padding: 26px 24px 64px; }
  .top { padding: 12px 24px; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 60px minmax(0, 1fr); }
  .shell > * { min-width: 0; }
  .side { padding: 14px 8px; }
  .side::after { display: none; }
  .brand { padding: 0; justify-content: center; }
  .brand-mark, .brand-mark .mark { width: 36px; height: 36px; }
  .brand-text, .ws-switch, .nav a span.t, .nav .soon { display: none; }
  .nav:first-of-type { margin-top: 16px; }
  .nav a { justify-content: center; padding: 10px 0; }
  .nav a.on { box-shadow: inset 0 -2px 0 var(--accent); }
  .top { padding: 10px 14px; gap: 10px; min-height: 56px; }
  .top .search { display: none; }
  .crumb { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .me { margin-left: auto; }
  .me .me-name, .me .caret { display: none; }
  .me button#meBtn { padding: 2px; }
  .main { padding: 18px 12px 48px; }
  h1 { font-size: 23px; }
  .pagehead { flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
  .pagehead > div { min-width: 0; }
  .pagehead .actions { margin-left: 0; flex-wrap: wrap; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .datechip { flex-wrap: wrap; border-radius: 12px; max-width: 100%; box-sizing: border-box; }
  .datechip input { flex: 1 1 120px; min-width: 0; width: auto; }
  .tabs a { padding: 10px 12px; white-space: nowrap; }
  .card { padding: 16px 14px; border-radius: 12px; }
  .tablecard { padding: 0; }
  .grid4, .grid2, .detail, .detail.wide, .detail.mid, .mapgrid { grid-template-columns: minmax(0, 1fr); }
  .detail > *, .grid2 > * { min-width: 0; }
  .metric .value { font-size: 28px; }
  .grid4:has(> .metric) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric { padding: 14px 14px 12px; }
  .metric .label { font-size: 11.5px; letter-spacing: .04em; }
  .kv { grid-template-columns: 100px minmax(0, 1fr); }
  pre { white-space: pre-wrap; word-break: break-word; }
  .filters input, .filters select { max-width: 100%; }
  .idhead { flex-wrap: wrap; }
  .idhead > div { min-width: 0; }
  .dialog { padding: 22px 18px; border-radius: 16px; }
  .dialog .grid2 { grid-template-columns: minmax(0, 1fr); }
  .dialog input, .dialog select { max-width: 100%; min-width: 0; }
  .inbox, .inbox:not(.has-sel) { grid-template-columns: minmax(0, 1fr); }
  .ibx-side { grid-column: auto; }
  .inbox.has-sel .ibx-list { display: none; }
  .inbox:not(.has-sel) .ibx-conv { display: none; }
  .mobile-only { display: inline-flex; }
  .ibx-head .end { margin-left: 0; }
  .tablecard td .btnrow { flex-wrap: nowrap; }
  .grid4.g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hbar { grid-template-columns: minmax(0, 1fr) auto; }
  .hb-track { grid-column: 1 / -1; grid-row: 2; }
  .bulkbar { top: 64px; }
  .auth .card { padding: 28px 22px; }
}

/* ---------- Pipeline board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.bcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; min-height: 180px; transition: border-color .15s, background .15s; }
.bcol.closed { background: #F1F4F8; }
.bcol.over { border-color: var(--accent); background: var(--primary-soft); }
.bcol > header { display: flex; flex-direction: column; gap: 2px; padding: 2px 4px 10px; }
.bcards { display: flex; flex-direction: column; gap: 8px; }
.dcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 3px; }
.dcard[draggable="true"] { cursor: grab; }
.dcard .dname { font-weight: 700; text-align: left; padding: 0; }
.dcard select { margin-top: 6px; font-size: 13px; padding: 4px 6px; }
.bnote { padding: 4px; }
/* Live calls: listen-in panel */
.live-panel { margin-top: 16px; }
.live-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.live-head h2 { margin: 0 0 2px; }
.live-ctl { display: flex; align-items: center; gap: 10px; }
.live-ctl input[type=range] { width: 120px; }
.live-events { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.live-events:empty { display: none; }
.live-tr { max-height: 360px; overflow-y: auto; margin-top: 10px; border-top: 1px solid var(--line, #e3e7ee); padding-top: 10px; }
.live-sup { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 6px; }
.live-sup.on { background: #fff7ed; border: 1px solid #fdba74; border-radius: 8px; padding: 10px 12px; }
.live-note { display: flex; gap: 8px; flex: 1 1 360px; }
.live-note input { flex: 1; min-width: 0; }
.mic-meter { display: inline-block; width: 70px; height: 8px; border-radius: 4px; background: #e3e7ee; overflow: hidden; }
.mic-meter i { display: block; height: 100%; width: 0; background: #0d9488; transition: width .15s; }
.live-notes { margin: 6px 0; display: grid; gap: 2px; }
.live-notes:empty { display: none; }
#liveList tr.on td { background: var(--ok-soft); }
/* ---------- campaign calendar ---------- */
.cal-card { padding: 16px; }
.cal-bar-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav h2 { margin: 0 0 0 8px; font-size: 18px; }
.cal-views { display: inline-flex; border: 1px solid var(--line, #e3e7ee); border-radius: 8px; overflow: hidden; }
.cal-views a { padding: 6px 12px; color: inherit; text-decoration: none; font-size: 13px; }
.cal-views a + a { border-left: 1px solid var(--line, #e3e7ee); }
.cal-views a.on { background: #eef2ff; font-weight: 600; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 14px; margin: 12px 0; font-size: 12px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 14px; height: 10px; border-radius: 3px; display: inline-block; }
/* status: fill + a darker edge; the name and status are always in text too */
.st-scheduled { background: #dbeafe; border-left: 3px solid #2563eb !important; }
.st-active { background: #ccfbf1; border-left: 3px solid #0d9488 !important; }
.st-paused { background: #fef3c7; border-left: 3px solid #d97706 !important; }
.st-completed { background: #e5e7eb; border-left: 3px solid #6b7280 !important; }
.st-draft { background: #ede9fe; border-left: 3px solid #7c3aed !important; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); font-size: 12px; color: var(--muted, #667085); text-align: center; padding: 6px 0; border: 1px solid var(--line, #e3e7ee); border-bottom: 0; border-radius: 8px 8px 0 0; background: #f8fafc; }
.cal-month { border-bottom: 1px solid var(--line, #e3e7ee); }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); border-left: 1px solid var(--line, #e3e7ee); min-height: 104px; }
.cal-day { grid-row: 1 / -1; border-right: 1px solid var(--line, #e3e7ee); border-top: 1px solid var(--line, #e3e7ee); padding: 4px 6px; }
.cal-day.out { background: #f8fafc; }
.cal-day.out .cal-num { color: #98a2b3; }
.cal-num { font-size: 12px; color: inherit; text-decoration: none; display: inline-block; min-width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 11px; }
.cal-num:hover { background: #eef2ff; }
.cal-day.today .cal-num { background: #4f46e5; color: #fff; font-weight: 600; }
.cal-bar { position: relative; z-index: 1; margin: 1px 3px; padding: 0 6px; border-radius: 4px; font-size: 12px; line-height: 22px; color: #1f2937; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-bar:hover { filter: brightness(0.96); outline: 1px solid rgba(0,0,0,.15); }
.cal-bar.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-bar.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.cal-hgrid { border: 1px solid var(--line, #e3e7ee); border-radius: 8px; overflow: hidden; }
.cal-hhead, .cal-allday, .cal-hours { display: grid; }
.cal-hhead { background: #f8fafc; border-bottom: 1px solid var(--line, #e3e7ee); }
.cal-hhead a { text-align: center; padding: 6px 0; color: inherit; text-decoration: none; font-size: 12px; display: flex; flex-direction: column; }
.cal-hhead a b { font-size: 16px; }
.cal-hhead a.today b { color: #4f46e5; }
.cal-allday { border-bottom: 1px solid var(--line, #e3e7ee); padding: 4px 0; align-items: start; }
.cal-allday > div:first-child { padding: 4px 6px; }
.cal-alldaybars { display: grid; }
.cal-scroll { max-height: 520px; overflow-y: auto; }
.cal-gutter div { font-size: 11px; color: var(--muted, #667085); text-align: right; padding-right: 6px; border-top: 1px solid #f1f3f6; box-sizing: border-box; }
.cal-col { position: relative; border-left: 1px solid var(--line, #e3e7ee); background-image: repeating-linear-gradient(to bottom, #f1f3f6 0 1px, transparent 1px 32px); }
.cal-col.today { background-color: #f5f7ff; }
.cal-block { position: absolute; margin-left: 2px; border-radius: 4px; padding: 3px 6px; font-size: 12px; color: #1f2937; text-decoration: none; overflow: hidden; display: flex; flex-direction: column; box-sizing: border-box; }
.cal-block b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-block span { font-size: 11px; color: #475467; }
.cal-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.cal-mini { border: 1px solid var(--line, #e3e7ee); border-radius: 8px; padding: 8px; }
.cal-mini-t { font-weight: 600; color: inherit; text-decoration: none; display: block; margin-bottom: 4px; }
.cal-mini-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: 11px; }
.cal-mini-g a { position: relative; color: inherit; text-decoration: none; padding: 3px 0; border-radius: 4px; }
.cal-mini-g a.has { background: #ccfbf1; font-weight: 600; }
.cal-mini-g a.today { outline: 2px solid #4f46e5; }
.cal-mini-g a i { position: absolute; top: -4px; right: -2px; font-style: normal; font-size: 9px; background: #0f766e; color: #fff; border-radius: 6px; padding: 0 3px; line-height: 12px; }
.cal-foot { margin: 10px 0 0; }
/* Campaign funnel + runs (campaign page) */
.fnl-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.fnl-head h2 { margin: 0; flex: 1; }
.fnl-head .chips { margin: 0; }
.fnl { display: grid; gap: 8px; margin-bottom: 14px; }
.fnl-row { display: grid; grid-template-columns: minmax(130px, 190px) 1fr minmax(150px, 230px); align-items: center; gap: 12px; }
.fnl-l { font-weight: 600; font-size: 14px; }
.fnl-t { height: 22px; background: #EEF2F6; border-radius: 4px; overflow: hidden; }
.fnl-t span { display: block; height: 100%; background: var(--primary); border-radius: 0 4px 4px 0; min-width: 0; transition: width .3s; }
.fnl-v b { font-size: 16px; }
.fnl-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; border-top: 1px solid var(--border); padding-top: 12px; }
.fnl-stat b { font-size: 17px; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
.run-note { max-width: 260px; white-space: normal; }
@media (max-width: 700px) { .fnl-row { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- Dark mode (Nov 17): <html data-theme="dark">, picked in the account menu (theme.js) ---------- */
html[data-theme="dark"] {
  color-scheme: dark;
  --page: #0A111D; --surface: #121B2A; --surface-2: #0F1724; --text: #E4EBF5; --text2: #9AA8BC;
  --primary: #2DD4BF; --primary-dark: #5EEAD4; --primary-soft: rgba(45,212,191,.12);
  --border: #23314A; --border-strong: #33445F;
  --error: #F97066; --error-soft: rgba(240,68,56,.13); --warn: #FDB022; --warn-soft: rgba(247,144,9,.12); --ok: #47CD89; --ok-soft: rgba(23,178,106,.13);
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 4px 16px rgba(0,0,0,.25);
  --shadow-hover: 0 2px 4px rgba(0,0,0,.4), 0 12px 28px rgba(0,0,0,.35);
  --ring: 0 0 0 3px rgba(45,212,191,.3);
  --line: #23314A; --muted: #9AA8BC; --err: #F97066; --bg-soft: #0F1724;
}
html[data-theme="dark"] body { background: radial-gradient(1200px 380px at 70% -120px, rgba(45,212,191,.06), transparent 70%), var(--page); }
html[data-theme="dark"] .top { background: rgba(14,22,35,.85); }
html[data-theme="dark"] .top .search input:focus { background: var(--surface); }
html[data-theme="dark"] .menu { box-shadow: 0 12px 32px rgba(0,0,0,.5); }
html[data-theme="dark"] .card .card, html[data-theme="dark"] td, html[data-theme="dark"] .tl-detail, html[data-theme="dark"] .scriptprev { border-color: var(--border); }
html[data-theme="dark"] .card .card:has(input[data-f$=".enabled"]:checked) { border-color: rgba(45,212,191,.45); background: rgba(45,212,191,.05); }
html[data-theme="dark"] input:hover, html[data-theme="dark"] select:hover, html[data-theme="dark"] textarea:hover, html[data-theme="dark"] .btn:hover { border-color: #46597A; }
html[data-theme="dark"] input[type=checkbox][data-f$=".enabled"] { background: #33445F; }
html[data-theme="dark"] label, html[data-theme="dark"] .tl-detail { color: var(--text); }
html[data-theme="dark"] th { color: var(--text2); }
html[data-theme="dark"] tr.click:hover td, html[data-theme="dark"] .pick:hover { background: rgba(45,212,191,.06); }
html[data-theme="dark"] .tabs a:hover { background: rgba(255,255,255,.04); }
html[data-theme="dark"] .tabs a.alert { color: #F97066; }
html[data-theme="dark"] .btn.danger { border-color: rgba(240,68,56,.45); }
html[data-theme="dark"] .badge.ok, html[data-theme="dark"] .notice.ok { border-color: rgba(71,205,137,.35); }
html[data-theme="dark"] .badge.warn, html[data-theme="dark"] .notice.warn { border-color: rgba(253,176,34,.35); }
html[data-theme="dark"] .badge.err, html[data-theme="dark"] .notice.err { border-color: rgba(249,112,102,.4); }
html[data-theme="dark"] .notice.warn { color: #FEC84B; }
html[data-theme="dark"] .badge.teal, html[data-theme="dark"] .tl-icon.ai, html[data-theme="dark"] .steps span.done { border-color: rgba(45,212,191,.35); }
html[data-theme="dark"] .avatar { background: linear-gradient(135deg, #134E4A, #1E3A8A); color: #CCFBF1; }
html[data-theme="dark"] .avatar.sm { background: var(--grad); color: #fff; }
html[data-theme="dark"] .ch-grid { stroke: #1D2A3E; }
html[data-theme="dark"] .ch-base { stroke: #3A4C68; }
html[data-theme="dark"] .ch-hit.on { fill: rgba(255,255,255,.05); }
html[data-theme="dark"] .ch-tip, html[data-theme="dark"] #toast { background: #24344F; }
html[data-theme="dark"] .hb-track, html[data-theme="dark"] .bar, html[data-theme="dark"] .fnl-t, html[data-theme="dark"] .mic-meter { background: #1D2A3E; }
html[data-theme="dark"] mark.mf.bad { background: rgba(240,68,56,.2); color: #FDA29B; }
html[data-theme="dark"] .chip:hover { border-color: #5A6E8E; }
html[data-theme="dark"] .bulkbar { background: linear-gradient(90deg, rgba(45,212,191,.1), rgba(29,111,216,.1)); border-color: rgba(45,212,191,.3); }
html[data-theme="dark"] .aisum { background: linear-gradient(135deg, rgba(45,212,191,.08), rgba(29,111,216,.08)); border-color: rgba(45,212,191,.28); }
html[data-theme="dark"] .bcol.closed { background: #0F1724; }
html[data-theme="dark"] .live-sup.on { background: rgba(251,146,60,.1); border-color: rgba(251,146,60,.45); }
html[data-theme="dark"] .cal-views a.on, html[data-theme="dark"] .cal-num:hover { background: rgba(99,102,241,.22); }
html[data-theme="dark"] .st-scheduled { background: rgba(37,99,235,.22); }
html[data-theme="dark"] .st-active { background: rgba(13,148,136,.25); }
html[data-theme="dark"] .st-paused { background: rgba(217,119,6,.22); }
html[data-theme="dark"] .st-completed { background: rgba(107,114,128,.25); }
html[data-theme="dark"] .st-draft { background: rgba(124,58,237,.22); }
html[data-theme="dark"] .cal-day.out, html[data-theme="dark"] .cal-hhead, html[data-theme="dark"] .cal-head { background: #0F1724; }
html[data-theme="dark"] .cal-day.out .cal-num { color: #5F6F87; }
html[data-theme="dark"] .cal-bar, html[data-theme="dark"] .cal-block { color: var(--text); }
html[data-theme="dark"] .cal-block span { color: var(--text2); }
html[data-theme="dark"] .cal-gutter div { border-top-color: #1D2A3E; }
html[data-theme="dark"] .cal-col { background-image: repeating-linear-gradient(to bottom, #1D2A3E 0 1px, transparent 1px 32px); }
html[data-theme="dark"] .cal-col.today { background-color: rgba(99,102,241,.08); }
html[data-theme="dark"] .cal-mini-g a.has { background: rgba(13,148,136,.3); }
html[data-theme="dark"] .auth-logo img { content: url("/logo-dark.svg"); }
/* Theme picker (account menu) */
.theme-pick { display: flex; gap: 4px; padding: 4px 10px 8px; }
.theme-pick button { flex: 1; font: inherit; font-size: 12.5px; padding: 5px 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text2); cursor: pointer; }
.theme-pick button[aria-pressed="true"] { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); font-weight: 600; }
