/* assets/css/cpx.css — Concept Plus design system (Daylight + Midnight).
   Adapted verbatim from design-ref/design_handoff_concept_plus/concept.css.
   Scoped under .cpx so it coexists with the legacy style.css. Fonts loaded in app.html. */

/* ============================================================
   CONCEPT PLUS — unified design system
   One product, two atmospheres: Daylight (light) + Midnight (dark).
   Shared layout/type/components; palette + glow swap by [data-theme].
   Through-line: a warm-metal accent (bronze ⇄ amber) + Cam command spine.
   Type: Bodoni Moda (display) · Hanken Grotesk (UI) · JetBrains Mono (keys/data)
   ============================================================ */

.cpx {
  --serif: "Bodoni Moda", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", monospace;
  --r: 12px;
  --nav-w: 248px;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  height: 100%;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01";
}
.cpx * { box-sizing: border-box; }

/* ---------- THEME: DAYLIGHT ---------- */
.cpx[data-theme="light"] {
  /* Brand: Porcelain canvas, White surface, Graphite ink, Burnt Sienna accent */
  --bg: #eae8e3;            /* Porcelain */
  --surface: #ffffff;       /* White */
  --surface-2: #f3f1ed;
  --surface-3: #e7e4dd;
  --line: #d8d5cd;
  --line-soft: #e4e1da;
  --line-2: #c6c2b8;        /* ~Stone Grey */
  --text: #33312f;          /* deep Graphite */
  --text-2: #4d4b4a;        /* Graphite */
  --text-3: #837f79;
  --accent: #9f561c;        /* Burnt Sienna */
  --accent-strong: #7e4415;
  --accent-ink: #ffffff;
  --accent-tint: rgba(159,86,28,.12);
  --accent-glow: 0 0 0 rgba(0,0,0,0);
  --hot: #9f561c;           /* Sienna */
  --warm: #97907a;          /* Pale Sage, deepened for legibility */
  --cold: #9aa09b;          /* Stone Grey, deepened */
  --won: #6e7b5c;           /* derived muted sage-green */
  --shadow: 0 1px 2px rgba(48,45,43,.05), 0 8px 24px rgba(48,45,43,.06);
  --shadow-pop: 0 12px 40px rgba(48,45,43,.13);
  --nav-bg: var(--surface);
  --topbar-bg: color-mix(in srgb, var(--bg) 82%, transparent);
}
/* ---------- THEME: MIDNIGHT ---------- */
.cpx[data-theme="dark"] {
  /* Brand: warm-graphite surfaces, Porcelain text, lifted Sienna accent */
  --bg: #1a1918;            /* deep Graphite */
  --surface: #232221;
  --surface-2: #2a2826;
  --surface-3: #302e2c;
  --line: #38352f;
  --line-soft: #423f3a;
  --line-2: #4a4742;
  --text: #eae8e3;          /* Porcelain */
  --text-2: #b2b4b2;        /* Stone Grey */
  --text-3: #837f79;
  --accent: #c97a2e;        /* Sienna, lifted to glow on dark */
  --accent-strong: #d2843a;
  --accent-ink: #20130a;
  --accent-tint: rgba(201,122,46,.16);
  --accent-glow: 0 0 22px rgba(201,122,46,.20);
  --hot: #c97a2e;
  --warm: #a69f88;          /* Pale Sage */
  --cold: #837f79;
  --won: #8a9a6f;           /* lifted sage-green */
  --shadow: 0 1px 2px rgba(0,0,0,.45);
  --shadow-pop: 0 20px 60px rgba(0,0,0,.55);
  --nav-bg: var(--surface);
  --topbar-bg: color-mix(in srgb, var(--bg) 78%, transparent);
}

.cpx .serif { font-family: var(--serif); }
.cpx .mono { font-family: var(--mono); }
.cpx .eyebrow { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--text-3); font-weight: 700; }

/* ---------- APP SHELL ---------- */
.cp-app { display: grid; grid-template-columns: var(--nav-w) 1fr; height: 100%; min-height: 0; background: var(--bg); transition: background .35s ease, color .35s ease; }
.cp-nav { background: var(--nav-bg); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 26px 18px 18px; min-height: 0; transition: background .35s ease, border-color .35s ease; }
.cp-brand { display: flex; align-items: baseline; gap: 9px; padding: 0 10px; }
.cp-brand .wm { font-family: var(--serif); font-size: 23px; font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
.cp-brand .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: var(--accent-glow); }
.cp-brand small { display: block; font-family: var(--sans); font-size: 9.5px; letter-spacing: .26em; text-transform: uppercase; color: var(--accent-strong); margin-top: 7px; font-weight: 700; padding: 0 10px; }
.cp-navlist { margin-top: 26px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; min-height: 0; }
.cp-navsec { font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--text-3); padding: 0 12px; margin: 18px 0 7px; font-weight: 700; }
.cp-navitem { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 9px; border: 0; background: transparent; cursor: pointer; color: var(--text-2); font-family: var(--sans); font-size: 14px; font-weight: 500; text-align: left; width: 100%; transition: background .2s, color .2s; }
.cp-navitem .lbl { display: flex; align-items: center; gap: 12px; }
.cp-navitem .mk { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: background .2s; }
.cp-navitem .ct { font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.cp-navitem:hover { background: var(--surface-2); color: var(--text); }
.cp-navitem.on { background: var(--surface-3); color: var(--text); font-weight: 600; }
.cp-navitem.on .mk { background: var(--accent); box-shadow: var(--accent-glow); }
.cp-navfoot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.cp-profile { display: flex; align-items: center; gap: 11px; padding: 6px 8px; }
.cp-ava { width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--serif); font-size: 15px; box-shadow: var(--accent-glow); }
.cp-profile .nm { font-size: 13px; font-weight: 600; } .cp-profile .rl { font-size: 11px; color: var(--text-3); }

/* theme toggle */
.cp-theme { display: flex; gap: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin: 14px 8px 4px; }
.cp-theme button { flex: 1; border: 0; background: transparent; cursor: pointer; font-family: var(--sans); font-size: 11.5px; font-weight: 600; color: var(--text-3); padding: 7px 8px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 6px; transition: all .2s; }
.cp-theme button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.cp-theme .ic { width: 12px; height: 12px; }

/* ---------- MAIN ---------- */
.cp-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.cp-spine { display: flex; align-items: center; gap: 14px; padding: 14px 26px; border-bottom: 1px solid var(--line); background: var(--topbar-bg); backdrop-filter: blur(8px); position: relative; z-index: 5; }
.cp-cmd { flex: 1; display: flex; align-items: center; gap: 11px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 10px 14px; max-width: 540px; cursor: text; transition: border-color .2s, box-shadow .2s; }
.cp-cmd:hover { border-color: var(--accent); }
.cp-cmd .pr { color: var(--accent-strong); font-family: var(--mono); font-size: 13px; font-weight: 600; }
.cp-cmd .ph { color: var(--text-3); font-size: 13.5px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cp-cmd kbd { font-family: var(--mono); font-size: 10.5px; background: var(--surface-3); border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; color: var(--text-2); }
.cp-spine-spacer { flex: 1; }
.cp-content { flex: 1; min-height: 0; overflow-y: auto; }
.cp-page { padding: 30px 36px 40px; max-width: 1480px; }

/* ---------- BUTTONS ---------- */
.cp-btn { font-family: var(--sans); font-size: 13.5px; font-weight: 600; border-radius: 9px; padding: 11px 18px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; transition: transform .12s, box-shadow .2s, background .2s; }
.cp-btn:hover { transform: translateY(-1px); }
.cp-btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: var(--accent-glow); }
.cp-btn.ink { background: var(--text); color: var(--bg); border-color: var(--text); }
.cp-btn.ghost { background: transparent; }
.cp-btn.sm { padding: 7px 12px; font-size: 12px; border-radius: 8px; }

/* ---------- INPUT ---------- */
.cp-input { width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-family: var(--sans); font-size: 14px; color: var(--text); }
.cp-input::placeholder { color: var(--text-3); }
.cp-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }

/* ---------- PILLS ---------- */
.cp-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .04em; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); background: var(--surface); text-transform: uppercase; white-space: nowrap; }
.cp-dot { width: 6px; height: 6px; border-radius: 50%; }
.cp-dot.hot { background: var(--hot); } .cp-dot.warm { background: var(--warm); } .cp-dot.cold { background: var(--cold); } .cp-dot.won { background: var(--won); }
.cp-pill.hot { color: var(--hot); border-color: color-mix(in srgb, var(--hot) 40%, var(--line)); background: color-mix(in srgb, var(--hot) 8%, var(--surface)); }
.cpx[data-theme="dark"] .cp-pill.hot { background: var(--accent-tint); }

/* ---------- LEAD CARD ---------- */
.cp-lead { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 15px; cursor: pointer; transition: transform .12s, box-shadow .2s, border-color .2s; }
.cp-lead:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.cp-lead .lh { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.cp-lead .who { min-width: 0; }
.cp-lead .nm { font-size: 14.5px; font-weight: 600; letter-spacing: -.01em; }
.cp-lead .loc { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.cp-lead .pr { font-family: var(--serif); font-size: 17px; font-weight: 600; white-space: nowrap; flex: none; }
.cp-lead .meta { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line-soft); font-size: 11px; color: var(--text-3); }
.cp-lead .meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--line); flex: none; }
.cp-lead.mini { padding: 12px 13px; }
.cp-lead.mini .nm { font-size: 13.5px; } .cp-lead.mini .pr { font-size: 15px; } .cp-lead.mini .loc { font-size: 11.5px; }

/* ---------- CHAT BUBBLE ---------- */
.cp-bub { max-width: 78%; padding: 13px 16px; font-size: 14px; line-height: 1.58; border-radius: 15px; white-space: pre-line; }
.cp-bub.cam { background: var(--surface); border: 1px solid var(--line); border-left: 2px solid var(--accent); border-top-left-radius: 5px; color: var(--text); }
.cp-bub.user { background: var(--accent); color: var(--accent-ink); border-top-right-radius: 5px; align-self: flex-end; box-shadow: var(--accent-glow); }
.cpx[data-theme="light"] .cp-bub.user { background: var(--text); color: var(--bg); }

/* ---------- placeholder ---------- */
.cp-ph { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--text) 6%, transparent) 0 2px, transparent 2px 13px), var(--surface-2); display: grid; place-items: center; color: var(--text-3); font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; border-radius: 10px; }

/* ============ HOME ============ */
.cp-greet-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.cp-greet { font-family: var(--serif); font-size: 38px; font-weight: 600; line-height: 1; letter-spacing: -.01em; }
.cp-home { display: grid; grid-template-columns: 1.55fr 1fr; gap: 32px; align-items: start; }
.cp-note { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px 26px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.cp-note::before { content: ""; position: absolute; left: 0; top: 22px; bottom: 22px; width: 3px; background: var(--accent); border-radius: 3px; box-shadow: var(--accent-glow); }
.cpx[data-theme="dark"] .cp-note::after { content: ""; position: absolute; left: -50px; top: -50px; width: 180px; height: 180px; background: radial-gradient(circle, var(--accent-tint), transparent 70%); pointer-events: none; }
.cp-note .from { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; position: relative; }
.cp-ai { width: 27px; height: 27px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-family: var(--serif); font-size: 14px; flex: none; box-shadow: var(--accent-glow); }
.cp-note p { font-size: 14.5px; line-height: 1.62; margin: 0 0 11px; position: relative; } .cp-note p:last-of-type { margin-bottom: 0; }
.cp-pri { display: flex; align-items: center; gap: 14px; padding: 13px 12px; border-radius: 11px; transition: background .2s; cursor: pointer; }
.cp-pri:hover { background: var(--surface-2); }
.cp-pri .tk { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.cp-pri .tt { font-size: 14px; font-weight: 600; } .cp-pri .ss { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.cp-pri .tm { margin-left: auto; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.cp-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.cp-stat { background: var(--surface); padding: 16px 17px; }
.cp-stat .v { font-family: var(--serif); font-size: 27px; font-weight: 600; line-height: 1; }
.cp-stat .k { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-top: 8px; font-weight: 600; }

/* ============ PIPELINE ============ */
.cp-board { display: grid; grid-template-columns: repeat(5, minmax(178px,1fr)) .82fr; gap: 14px; align-items: start; overflow-x: auto; padding-bottom: 10px; }
.cp-colh { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.cp-colh .nm { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.cp-colh .ct { font-family: var(--serif); font-size: 15px; color: var(--text-3); }
.cp-col .topline { height: 2px; background: var(--text); margin-bottom: 12px; border-radius: 2px; }
.cp-col.first .topline { background: var(--accent); box-shadow: var(--accent-glow); }
.cp-col.closed .topline { background: var(--line); }
.cp-cards { display: flex; flex-direction: column; gap: 10px; }

/* ============ CHAT ============ */
.cp-chat { display: grid; grid-template-columns: 1fr 320px; grid-template-rows: minmax(0,1fr); flex: 1; min-height: 0; }
.cp-chat-main { display: flex; flex-direction: column; min-height: 0; overflow: hidden; border-right: 1px solid var(--line); }
.cp-chat-head { padding: 18px 28px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 13px; }
.cp-chat-head .big { width: 42px; height: 42px; border-radius: 50%; font-size: 19px; }
.cp-chat-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 26px 28px; display: flex; flex-direction: column; gap: 16px; }
.cp-chat-composer { padding: 16px 28px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
.cp-suggest { display: flex; gap: 8px; margin-bottom: 13px; flex-wrap: wrap; }
.cp-suggest .s { font-size: 12px; color: var(--text-2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; background: var(--surface); cursor: pointer; transition: border-color .2s, color .2s; }
.cp-suggest .s:hover { border-color: var(--accent); color: var(--text); }
.cp-cbox { display: flex; gap: 10px; align-items: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 7px 7px 7px 16px; }
.cp-cbox input,
.cp-cbox textarea { flex: 1; border: 0; background: transparent; font-family: var(--sans); font-size: 14px; outline: none; color: var(--text); }
.cp-cbox textarea { resize: none; line-height: 1.4; max-height: 160px; overflow-y: auto; padding: 6px 0; }
.cp-cbox #cpc-send { flex: 0 0 auto; align-self: flex-end; }
.cp-chat-rail { background: var(--surface-2); padding: 24px; overflow-y: auto; min-height: 0; }
.cp-kv { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.cp-kv .k { color: var(--text-3); } .cp-kv .v { font-weight: 600; text-align: right; }

/* ============ EMPTY STATE ============ */
.cp-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 80px 24px; gap: 8px; max-width: 460px; margin: 40px auto; }
.cp-empty .ico { width: 54px; height: 54px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; margin-bottom: 10px; color: var(--accent-strong); font-family: var(--serif); font-size: 24px; }
.cp-empty h3 { font-family: var(--serif); font-size: 24px; font-weight: 600; margin: 0; }
.cp-empty p { font-size: 14px; color: var(--text-2); margin: 0; line-height: 1.55; }

/* ---------- mobile bits hidden on desktop ---------- */
.cp-tabbar, .cp-mobtop { display: none; }

/* ============ RESPONSIVE ============ */
@media (max-width: 980px) {
  .cp-home { grid-template-columns: 1fr; gap: 22px; }
  .cp-chat { grid-template-columns: 1fr; }
  .cp-chat-rail { display: none; }
}
@media (max-width: 760px) {
  .cp-app { grid-template-columns: 1fr; }
  .cp-nav { display: none; }
  .cp-mobtop { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--nav-bg); }
  .cp-mobtop .wm { font-family: var(--serif); font-size: 19px; font-weight: 600; display: flex; align-items: baseline; gap: 7px; }
  .cp-mobtop .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: var(--accent-glow); }
  .cp-spine { padding: 12px 18px; }
  .cp-cmd kbd { display: none; }
  .cp-page { padding: 20px 18px 100px; }
  .cp-greet { font-size: 30px; }
  .cp-greet-row .cp-btn { display: none; }
  .cp-board { display: flex; flex-direction: column; gap: 22px; }
  .cp-board .cp-col { }
  .cp-stats { grid-template-columns: 1fr 1fr; }
  .cp-tabbar { display: grid; grid-template-columns: repeat(4,1fr); position: fixed; bottom: 0; left: 0; right: 0; background: var(--nav-bg); border-top: 1px solid var(--line); padding: 9px 8px calc(9px + env(safe-area-inset-bottom)); z-index: 20; }
  .cp-tab { border: 0; background: transparent; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 5px; font-family: var(--sans); font-size: 11px; font-weight: 600; color: var(--text-3); }
  .cp-tab .mk { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
  .cp-tab.on { color: var(--text); } .cp-tab.on .mk { background: var(--accent); box-shadow: var(--accent-glow); }
  .cp-fab { position: fixed; right: 18px; bottom: 78px; z-index: 21; box-shadow: var(--shadow-pop), var(--accent-glow); }
}
.cp-fab { display: none; }
@media (max-width: 760px) { .cp-fab { display: inline-flex; } }

/* ============ SEGMENTED CONTROL ============ */
.cp-seg { display: inline-flex; gap: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.cp-seg button { border: 0; background: transparent; cursor: pointer; font-family: var(--sans); font-size: 12.5px; font-weight: 600; color: var(--text-3); padding: 7px 14px; border-radius: 7px; transition: all .2s; white-space: nowrap; }
.cp-seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ============ LOGIN ============ */
.cp-login { display: grid; grid-template-columns: 1.1fr 1fr; height: 100%; min-height: 0; }
.cp-login .art { position: relative; overflow: hidden; }
.cp-login .art .cp-ph { position: absolute; inset: 0; border-radius: 0; }
.cp-login .art .quote { position: absolute; left: 52px; bottom: 52px; right: 52px; color: #f4efe6; }
.cp-login .art .quote .serif { font-family: var(--serif); font-size: 34px; line-height: 1.16; font-weight: 500; text-shadow: 0 2px 40px rgba(0,0,0,.5); }
.cp-login .art .quote .cap { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; margin-top: 18px; opacity: .85; }
.cp-login .panel { background: var(--surface); display: flex; flex-direction: column; justify-content: center; padding: 0 9% ; position: relative; }
.cp-login .panel .top { position: absolute; top: 28px; right: 32px; }
.cp-login .lbrand { display: flex; align-items: baseline; gap: 8px; }
.cp-login .lbrand .wm { font-family: var(--serif); font-size: 28px; font-weight: 600; white-space: nowrap; }
.cp-login .lbrand .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: var(--accent-glow); }
.cp-login .lbrand small { display: block; font-size: 9.5px; letter-spacing: .26em; text-transform: uppercase; color: var(--accent-strong); margin-top: 7px; font-weight: 700; }
.cp-login h2 { font-family: var(--serif); font-size: 29px; font-weight: 600; margin: 42px 0 5px; }
.cp-login .sub { font-size: 14px; color: var(--text-2); margin-bottom: 28px; }
.cp-field { margin-bottom: 16px; }
.cp-field label { display: block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); font-weight: 700; margin-bottom: 7px; }
.cp-login .row { display: flex; justify-content: space-between; margin-top: 16px; font-size: 12.5px; color: var(--text-3); }
.cp-login .row span { white-space: nowrap; }

/* ============ SARA ============ */
.cp-sara { display: grid; grid-template-columns: 1fr 326px; gap: 26px; align-items: start; }
.cp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.cp-card .hd { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.cp-card .bd { padding: 20px 22px; }
.cp-check { display: flex; align-items: center; gap: 13px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.cp-check .tick { width: 22px; height: 22px; border-radius: 50%; background: var(--won); color: #fff; display: grid; place-items: center; font-size: 12px; flex: none; }
.cpx[data-theme="dark"] .cp-check .tick { background: color-mix(in srgb, var(--won) 88%, black); }
.cp-check .q { font-size: 13.5px; color: var(--text-2); } .cp-check .a { font-size: 14px; font-weight: 600; margin-left: auto; }
.cp-slot { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 11px; padding: 13px 15px; margin-bottom: 9px; cursor: pointer; transition: border-color .2s, background .2s; }
.cp-slot:hover { border-color: var(--accent); background: var(--accent-tint); }
.cp-slot .t { font-weight: 600; font-size: 14px; }
.cp-saraq { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.cp-saraq .st { width: 9px; height: 9px; border-radius: 50%; margin-top: 4px; flex: none; }
.cp-saraq .st.active { background: var(--accent); box-shadow: var(--accent-glow); } .cp-saraq .st.wait { background: var(--warm); } .cp-saraq .st.done { background: var(--won); }
.cp-saraq .nm { font-size: 14px; font-weight: 600; } .cp-saraq .ss { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.cp-saraq .badge { margin-left: auto; font-size: 10.5px; font-weight: 600; color: var(--text-3); white-space: nowrap; }

/* ============ WHATSAPP ============ */
.cp-wa-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 26px 0; }
.cp-wa { display: grid; grid-template-columns: 326px 1fr; grid-template-rows: minmax(0,1fr); flex: 1; min-height: 0; margin-top: 16px; border-top: 1px solid var(--line); }
.cp-wa-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.cp-wa-search { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cp-wa-convos { overflow-y: auto; min-height: 0; }
.cp-conv { display: flex; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line-soft); cursor: pointer; transition: background .2s; }
.cp-conv:hover { background: var(--surface-2); } .cp-conv.on { background: var(--surface-3); }
.cp-conv .av { width: 42px; height: 42px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--serif); font-size: 15px; flex: none; }
.cp-conv .cmid { min-width: 0; flex: 1; }
.cp-conv .crow { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.cp-conv .nm { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-conv .tm { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.cp-conv .pv { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.cp-conv .unread { background: var(--accent); color: var(--accent-ink); font-size: 10.5px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 5px; box-shadow: var(--accent-glow); }
.cp-wa-thread { display: flex; flex-direction: column; min-height: 0; }
.cp-wa-thread .thd { padding: 15px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.cp-wa-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 24px; display: flex; flex-direction: column; gap: 10px; }
.cp-wamsg { max-width: 72%; padding: 10px 14px; font-size: 13.5px; line-height: 1.5; border-radius: 14px; position: relative; }
.cp-wamsg .t { display: block; font-size: 10px; color: var(--text-3); margin-top: 4px; text-align: right; }
.cp-wamsg.them { background: var(--surface); border: 1px solid var(--line); border-top-left-radius: 4px; }
.cp-wamsg.me { background: var(--accent); color: var(--accent-ink); border-top-right-radius: 4px; align-self: flex-end; box-shadow: var(--accent-glow); }
.cpx[data-theme="light"] .cp-wamsg.me { background: #3c462f; color: #eef0e6; }
.cp-wamsg.me .t { color: inherit; opacity: .7; }
.cp-wa-composer { padding: 14px 24px 18px; border-top: 1px solid var(--line); background: var(--surface-2); }
.cp-camp { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 13px; margin-bottom: 11px; background: var(--surface); }
.cp-camp .nm { font-size: 14.5px; font-weight: 600; } .cp-camp .sg { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.cp-camp .stat { text-align: right; } .cp-camp .stat .v { font-family: var(--serif); font-size: 18px; font-weight: 600; } .cp-camp .stat .k { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); }
.cp-funnel { display: flex; flex-direction: column; gap: 12px; max-width: 620px; }
.cp-funnel .fr { display: grid; grid-template-columns: 130px 1fr 64px; align-items: center; gap: 14px; }
.cp-funnel .fl { font-size: 13px; font-weight: 600; }
.cp-funnel .bar { height: 30px; border-radius: 7px; background: var(--accent); box-shadow: var(--accent-glow); }
.cp-funnel .fn { font-family: var(--serif); font-size: 16px; font-weight: 600; text-align: right; }

/* ============ LISTINGS ============ */
.cp-listings { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 18px; }
.cp-listing { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); transition: transform .12s, box-shadow .2s; cursor: pointer; }
.cp-listing:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); }
.cp-listing .img { height: 150px; border-radius: 0; position: relative; }
.cp-listing .st { position: absolute; top: 12px; left: 12px; }
.cp-listing .bd { padding: 15px 16px; }
.cp-listing .ar { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); font-weight: 700; }
.cp-listing .tw { font-size: 15px; font-weight: 600; margin: 4px 0 2px; }
.cp-listing .pr { font-family: var(--serif); font-size: 21px; font-weight: 600; }
.cp-listing .ft { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--text-2); }
.cp-listing .ft .m { color: var(--accent-strong); font-weight: 600; }

@media (max-width: 980px) { .cp-sara { grid-template-columns: 1fr; } .cp-login { grid-template-columns: 1fr; } .cp-login .art { display: none; } }
@media (max-width: 760px) { .cp-wa { grid-template-columns: 1fr; } .cp-wa-list.hide-mobile { display: none; } }

/* ============ TAGS ============ */
.cp-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.cp-tag { font-size: 10.5px; font-weight: 600; letter-spacing: .02em; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
.cp-lead.mini .cp-tags { margin-top: 9px; }

/* ============ CAM SUBNAV (memory surfaces) ============ */
.cp-subnav { display: flex; gap: 6px; padding: 14px 26px 0; overflow-x: auto; align-items: center; }
.cp-subnav .pill { border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer; font-family: var(--sans); font-size: 12.5px; font-weight: 600; padding: 8px 14px; border-radius: 999px; white-space: nowrap; transition: all .2s; }
.cp-subnav .pill.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: var(--accent-glow); }
.cp-subnav .grow { flex: 1; }
.cp-cam-surface { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 28px 30px; }

/* memory cards */
.cp-mlist { display: flex; flex-direction: column; gap: 11px; max-width: 880px; }
.cp-mrow { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 15px 17px; box-shadow: var(--shadow); }
.cp-mrow .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cp-mrow .nm { font-size: 14.5px; font-weight: 600; } .cp-mrow .lc { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.cp-mrow .pr { font-family: var(--serif); font-size: 16px; font-weight: 600; white-space: nowrap; }
.cp-nudge { margin-top: 12px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-left: 2px solid var(--accent); border-radius: 9px; font-size: 13px; line-height: 1.5; color: var(--text); }
.cp-nudge .lab { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.cp-nudge .lab .ai { width: 20px; height: 20px; font-size: 11px; border-radius: 50%; }
.cp-rowacts { display: flex; gap: 8px; margin-top: 11px; }

/* score bar (predictions) */
.cp-score { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.cp-score .track { flex: 1; height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.cp-score .fill { height: 100%; background: var(--accent); box-shadow: var(--accent-glow); border-radius: 4px; }
.cp-score .n { font-family: var(--serif); font-size: 16px; font-weight: 600; width: 30px; text-align: right; }

/* performance */
.cp-perf-bars { display: flex; flex-direction: column; gap: 18px; max-width: 620px; margin-top: 8px; }
.cp-perf .pl { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 7px; }
.cp-perf .pl .now { font-weight: 700; } .cp-perf .pl .prev { color: var(--text-3); }
.cp-perf .track { height: 12px; border-radius: 6px; background: var(--surface-3); position: relative; }
.cp-perf .prevbar { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--line-2); }
.cp-perf .nowbar { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--accent); box-shadow: var(--accent-glow); }

/* ============ LEAD DETAIL DRAWER ============ */
.cp-drawer-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.42); z-index: 40; opacity: 0; animation: cpfade .2s forwards; }
@keyframes cpfade { to { opacity: 1; } }
.cp-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 92vw; background: var(--surface); border-left: 1px solid var(--line); z-index: 41; display: flex; flex-direction: column; box-shadow: var(--shadow-pop); transform: translateX(100%); animation: cpslide .26s cubic-bezier(.2,.8,.2,1) forwards; }
@keyframes cpslide { to { transform: translateX(0); } }
.cp-drawer .dh { padding: 22px 24px; border-bottom: 1px solid var(--line); }
.cp-drawer .dh .x { position: absolute; top: 18px; right: 20px; border: 0; background: transparent; color: var(--text-3); font-size: 20px; cursor: pointer; line-height: 1; }
.cp-drawer .db { flex: 1; overflow-y: auto; padding: 22px 24px; }
.cp-drawer .acts { padding: 16px 24px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 9px; background: var(--surface-2); }
.cp-hist { position: relative; padding-left: 18px; }
.cp-hist .hi { position: relative; padding: 0 0 16px 0; }
.cp-hist .hi::before { content: ""; position: absolute; left: -14px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.cp-hist .hi::after { content: ""; position: absolute; left: -11px; top: 13px; bottom: -3px; width: 1px; background: var(--line); }
.cp-hist .hi:last-child::after { display: none; }
.cp-hist .hw { font-size: 12px; color: var(--text-3); } .cp-hist .ht { font-size: 13.5px; margin-top: 2px; line-height: 1.45; }

/* ============ DRAFT / SEND-CONFIRM CARD ============ */
.cp-draft { border: 1px solid color-mix(in srgb, var(--won) 45%, var(--line)); background: color-mix(in srgb, var(--won) 7%, var(--surface)); border-radius: 13px; padding: 14px 16px; }
.cpx[data-theme="dark"] .cp-draft { background: color-mix(in srgb, var(--won) 14%, var(--surface)); }
.cp-draft .lab { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--won); margin-bottom: 9px; }
.cp-draft .msg { font-size: 13.5px; line-height: 1.55; }
.cp-draft .acts { display: flex; gap: 8px; margin-top: 12px; }
.cp-confirm { background: var(--won); color: #fff; border-color: var(--won); }

/* ============ WHATSAPP ENGAGEMENT BOARD ============ */
.cp-waboard { display: grid; grid-template-columns: repeat(6, minmax(150px,1fr)); gap: 12px; align-items: start; overflow-x: auto; padding: 0 26px 24px; }
.cp-wacol .ch { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 9px; }
.cp-wacol .ch .nm { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.cp-wacol .ch .ct { font-family: var(--serif); font-size: 14px; color: var(--text-3); }
.cp-wacol .bar { height: 2px; background: var(--accent); border-radius: 2px; margin-bottom: 11px; box-shadow: var(--accent-glow); }
.cp-wacard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; margin-bottom: 9px; cursor: pointer; }
.cp-wacard .nm { font-size: 13px; font-weight: 600; } .cp-wacard .sb { font-size: 11.5px; color: var(--text-2); margin-top: 3px; }

/* ============ TEAM / CONNECT ============ */
.cp-two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; max-width: 900px; }
.cp-qr { width: 168px; height: 168px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; }
.cp-qr svg { width: 130px; height: 130px; }
.cp-setrow { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.cp-setrow .l { font-size: 13.5px; } .cp-setrow .l small { display: block; color: var(--text-3); font-size: 12px; margin-top: 2px; }

/* ============ ADMIN ============ */
.cp-scope { display: inline-flex; gap: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.cp-scope button { border: 0; background: transparent; cursor: pointer; font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--text-3); padding: 6px 12px; border-radius: 6px; }
.cp-scope button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.cp-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.cp-table th { text-align: left; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); font-weight: 700; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.cp-table td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; }
.cp-table tr:last-child td { border-bottom: 0; }
.cp-table .serif { font-family: var(--serif); font-size: 15px; }
.cp-log { font-family: var(--mono); font-size: 12px; }
.cp-log .st-Delivered { color: var(--won); } .cp-log .st-Read { color: var(--accent-strong); } .cp-log .st-Failed { color: var(--hot); } .cp-log .st-Replied { color: var(--text); }

/* role switch in nav */
.cp-role { display: flex; gap: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; margin: 0 8px 10px; }
.cp-role button { flex: 1; border: 0; background: transparent; cursor: pointer; font-family: var(--sans); font-size: 11px; font-weight: 600; color: var(--text-3); padding: 6px; border-radius: 999px; }
.cp-role button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

@media (max-width: 980px) { .cp-two { grid-template-columns: 1fr; } }

/* ── Workspace additions (live app; not in the static prototype) ─────── */
.cp-login .err { color: var(--hot); font-size: 13px; margin-top: 14px; min-height: 16px; }
.cp-btn[disabled] { opacity: .55; cursor: default; transform: none; }
.cp-content .cp-loading { padding: 60px 24px; text-align: center; color: var(--text-3); font-size: 14px; }

/* ── Lead-detail drawer: pin header+footer, scroll body, full-width on mobile ── */
.cp-drawer .dh, .cp-drawer .acts { flex: none; }      /* never shrink — body (.db) is the only scroller */
@media (max-width: 760px) { .cp-drawer { width: 100vw; max-width: 100vw; border-left: 0; } }

/* ── Cam chat history (rail) ─────────────────────────────────────────── */
.cp-cam-hist { display: flex; flex-direction: column; gap: 4px; }
.cp-cam-hist .row { padding: 8px 10px; border-radius: 9px; cursor: pointer; border: 1px solid transparent; transition: background .15s, border-color .15s; }
.cp-cam-hist .row:hover { background: var(--surface-2); }
.cp-cam-hist .row.on { background: var(--surface-3); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.cp-cam-hist .row .t { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-cam-hist .row .m { font-family: var(--mono); font-size: 10.5px; color: var(--text-3); margin-top: 2px; }

/* ── Cam memory layer (Phase 4): follow-up clock badge + Today strip ── */
.cp-fubadge { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; padding: 3px 8px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); white-space: nowrap; }
.cp-fubadge.overdue { background: color-mix(in srgb, var(--hot) 13%, var(--surface)); border-color: color-mix(in srgb, var(--hot) 45%, var(--line)); color: var(--hot); }

.cp-today { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 28px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cp-today-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer; white-space: nowrap; transition: border-color .15s, color .15s; }
.cp-today-pill:hover { border-color: var(--accent); color: var(--text); }
.cp-today-pill .n { font-family: var(--serif); font-size: 14px; font-weight: 600; color: var(--text); }
.cp-today-pill.overdue { color: var(--hot); border-color: color-mix(in srgb, var(--hot) 40%, var(--line)); }
.cp-today-pill.overdue .n { color: var(--hot); }

/* ── Lead detail (reference-style): wider drawer, editable grid, temp pills ── */
.cp-drawer.wide { width: 820px; }
@media (max-width: 900px) { .cp-drawer.wide { width: 100vw; max-width: 100vw; } }
.cp-detgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
@media (max-width: 560px) { .cp-detgrid { grid-template-columns: 1fr; } }
.cp-ef.ef-ok  { border-color: #2e7d32 !important; box-shadow: 0 0 0 3px color-mix(in srgb,#2e7d32 16%,transparent); }
.cp-ef.ef-bad { border-color: var(--hot) !important; }
.cp-temps { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.cp-temp { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 4px 12px; color: var(--text-3); }
.cp-temp.on.cold { background: #3b82f6; color: #fff; }
.cp-temp.on.warm { background: #f59e0b; color: #fff; }
.cp-temp.on.hot  { background: var(--hot); color: #fff; }
.cp-icon-btn { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text-2); cursor: pointer; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; }
.cp-icon-btn:hover { border-color: var(--accent); color: var(--text); }
.cp-note { font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; }

/* ── Automation page (n8n / Concept Plus look — Drawflow reskinned via tokens) ──
   cpx.css now loads AFTER drawflow.min.css, so these win without !important.
   Each node has a per-type accent stripe on a NEUTRAL body; no neon, no red. ── */
.cpx-auto { display: flex; flex-direction: column; height: 100%; }
.cpx-auto-bar { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--surface); flex: none; flex-wrap: wrap; }
.cpx-auto-pal { display: flex; gap: 6px; flex-wrap: wrap; }
.cpx-auto-main { flex: 1; display: flex; min-height: 0; }
.cpx-df { flex: 1; position: relative; background: var(--surface-2);
  background-image: radial-gradient(color-mix(in srgb, var(--text-3) 28%, transparent) 1px, transparent 1px);
  background-size: 22px 22px; overflow: hidden; }
.cpx-auto-cfg { width: 320px; flex: none; border-left: 1px solid var(--line); background: var(--surface); overflow-y: auto; padding: 18px; }
.cpx-cfg-empty { font-size: 13px; color: var(--text-3); padding: 30px 6px; text-align: center; }
.cpx-cfg-hd { display: flex; justify-content: space-between; align-items: center; font-family: var(--serif); font-size: 17px; font-weight: 600; margin-bottom: 16px; }

/* ── resolved-audience confirmation block + preview roster ── */
.cpx-aud-ok { background: var(--accent-tint); border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  border-radius: 10px; padding: 10px 12px; font-size: 13.5px; color: var(--text); margin-bottom: 10px; }
.cpx-aud-ok strong { color: var(--accent-strong); }
.cpx-aud-ok .cpx-aud-drop { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.cpx-aud-list { border: 1px solid var(--line); border-radius: 10px; max-height: 230px; overflow-y: auto;
  margin-bottom: 14px; background: var(--surface); }
.cpx-aud-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; font-size: 12.5px;
  border-bottom: 1px solid var(--line-soft); }
.cpx-aud-row:last-child { border-bottom: 0; }
.cpx-aud-nm { flex: 1; color: var(--text); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cpx-aud-ph { color: var(--text-3); font-family: var(--mono, monospace); font-size: 11.5px; white-space: nowrap; }
.cpx-aud-ph.none { color: #b4561c; font-style: italic; }
.cpx-aud-x { border: 0; background: transparent; color: var(--text-3); cursor: pointer; font-size: 16px;
  line-height: 1; padding: 0 2px; border-radius: 5px; }
.cpx-aud-x:hover { color: #c0392b; background: color-mix(in srgb, #c0392b 12%, transparent); }
.cpx-aud-more { padding: 7px 10px; font-size: 11.5px; color: var(--text-3); text-align: center; background: var(--surface-2); }
.cpx-aud-empty { padding: 12px; font-size: 12px; color: var(--text-3); text-align: center; }
.cpx-aud-warn { background: color-mix(in srgb, #c0612a 12%, transparent); border-color: color-mix(in srgb, #c0612a 36%, transparent); }
.cpx-aud-warn strong { color: #c0612a; }
/* filter "why 0 matched" diagnostic */
.cpx-diag { border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; background: var(--surface-2); font-size: 12px; }
.cpx-diag-hd { font-weight: 600; margin-bottom: 5px; color: var(--text); }
.cpx-diag-row { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; color: var(--text-2); }
.cpx-diag-row.zero { color: #c0612a; font-weight: 500; }
.cpx-diag-hint { margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--line-soft); color: var(--text-3); font-size: 11.5px; line-height: 1.5; }
.cpx-diag-hint div { margin-bottom: 3px; }

/* node body — neutral surface, thin border, left accent stripe (per type) */
.cpx-df .drawflow .drawflow-node {
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--text-3);
  border-radius: 11px; box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 6px 18px rgba(0,0,0,.05);
  padding: 0; min-width: 184px; color: var(--text); width: auto; }
.cpx-df .drawflow .drawflow-node:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
/* quiet selected state — accent border + soft glow, NEVER a fill */
.cpx-df .drawflow .drawflow-node.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.cpx-df .drawflow .drawflow-node .drawflow_content_node { width: auto; }
.cpx-node-inner { padding: 11px 14px; }
.cpx-node-hd { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; color: var(--text); }
.cpx-node-ic { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 6px; background: var(--accent-tint); color: var(--accent-strong); font-size: 13px; }
.cpx-node-sum { font-size: 12px; color: var(--text-2); margin-top: 6px; line-height: 1.4; }
/* per-type accent stripe (muted, brand-aligned) */
.cpx-df .drawflow .drawflow-node.cpx-audience  { border-left-color: #3b82f6; }
.cpx-df .drawflow .drawflow-node.cpx-audience  .cpx-node-ic { background: color-mix(in srgb,#3b82f6 14%,transparent); color: #3b82f6; }
.cpx-df .drawflow .drawflow-node.cpx-channel   { border-left-color: var(--accent); }
.cpx-df .drawflow .drawflow-node.cpx-send      { border-left-color: var(--accent); }
.cpx-df .drawflow .drawflow-node.cpx-wait      { border-left-color: #8b8b8b; }
.cpx-df .drawflow .drawflow-node.cpx-wait      .cpx-node-ic { background: color-mix(in srgb,var(--text-2) 12%,transparent); color: var(--text-2); }
.cpx-df .drawflow .drawflow-node.cpx-condition { border-left-color: #d99a2b; }
.cpx-df .drawflow .drawflow-node.cpx-condition .cpx-node-ic { background: color-mix(in srgb,#d99a2b 16%,transparent); color: #d99a2b; }
.cpx-df .drawflow .drawflow-node.cpx-end       { border-left-color: var(--text-3); }
.cpx-df .drawflow .drawflow-node.cpx-end       .cpx-node-ic { background: color-mix(in srgb,var(--text-3) 18%,transparent); color: var(--text-3); }
/* ports — small, neutral, accent ring (override Drawflow's cyan) */
.cpx-df .drawflow .drawflow-node .input,
.cpx-df .drawflow .drawflow-node .output {
  background: var(--surface); border: 2px solid color-mix(in srgb, var(--accent) 60%, var(--line));
  width: 11px; height: 11px; }
.cpx-df .drawflow .drawflow-node .input:hover,
.cpx-df .drawflow .drawflow-node .output:hover { border-color: var(--accent); background: var(--accent-tint); }
.cpx-df .drawflow .drawflow-node .outputs { display: flex; flex-direction: column; gap: 16px; }
/* wires — subtle, accent (override Drawflow's bright teal) */
.cpx-df .drawflow .connection .main-path { stroke: color-mix(in srgb, var(--accent) 55%, var(--line)); stroke-width: 2.4px; fill: none; }
.cpx-df .drawflow .connection .main-path:hover,
.cpx-df .drawflow .connection .main-path.selected { stroke: var(--accent); }
.cpx-df .drawflow .connection .point { stroke: var(--accent); fill: var(--surface); }

/* ── Ali — photo enhancement ───────────────────────────────────────── */
.ali-drop{border:2px dashed var(--line);border-radius:12px;padding:26px;text-align:center;cursor:pointer;transition:border-color .15s,background .15s}
.ali-drop.on{border-color:var(--accent,#b4753a);background:color-mix(in srgb,var(--accent,#b4753a) 6%,transparent)}
.ali-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:14px}
.ali-card{border:1px solid var(--line);border-radius:12px;padding:10px;background:var(--surface,transparent)}
.ali-ba{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.ali-ba figure{margin:0}
.ali-ba figcaption{font-size:10.5px;letter-spacing:.04em;text-transform:uppercase;color:var(--text-3);margin-bottom:3px}
.ali-ba img{width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:8px;background:color-mix(in srgb,var(--text-3) 12%,transparent);display:block}

/* Ali — virtual staging additions */
.ali-modes{display:flex;gap:8px}
.ali-tag{display:inline-block;font-size:10px;font-weight:600;letter-spacing:.03em;color:#fff;background:rgba(0,0,0,.62);padding:1px 6px;border-radius:5px;vertical-align:middle}
.ali-tag.warn{background:var(--hot)}
