/* ============================================================
   App layout — shell, ledger, message center, automations,
   rails, overlays, and the identity-explorer chrome.
   All visual values come from tokens.css custom properties.
   ============================================================ */

/* ---------- EXPLORER CHROME (meta UI, intentionally neutral) ---------- */
html, body { margin:0; height:100%; }
body { background:#0c0d10; }
.xp {
  position:fixed; inset:0; display:flex; flex-direction:column;
  font-family:"Public Sans", system-ui, sans-serif; color:#e7e9ee;
}
.xp-bar {
  height:54px; flex:none; display:flex; align-items:center; gap:18px; padding:0 16px;
  background:#15171c; border-bottom:1px solid #262a31; z-index:50;
}
.xp-brand { display:flex; align-items:center; gap:9px; font-weight:700; font-size:13px; letter-spacing:.02em; }
.xp-brand b { color:#fff; } .xp-brand span { color:#8a90a0; font-weight:600; }
.xp-phase { font-size:10.5px; text-transform:uppercase; letter-spacing:.12em; color:#6f7689; padding:3px 8px; border:1px solid #2c313b; border-radius:4px; }
.xp-seg { display:flex; background:#1e2128; border:1px solid #2c313b; border-radius:8px; padding:3px; gap:2px; }
.xp-seg button {
  border:0; background:transparent; color:#aab0c0; font-size:12.5px; font-weight:600;
  padding:6px 12px; border-radius:6px; white-space:nowrap;
}
.xp-seg button:hover { color:#fff; }
.xp-seg button.on { background:#3a4150; color:#fff; }
.xp-spacer { flex:1; }
.xp-dirs { display:flex; gap:6px; }
.xp-dir {
  display:flex; align-items:center; gap:8px; border:1px solid #2c313b; background:#1e2128;
  color:#c4c9d6; font-size:12.5px; font-weight:600; padding:5px 11px 5px 7px; border-radius:8px;
}
.xp-dir:hover { border-color:#454c5b; }
.xp-dir.on { border-color:#7d8595; background:#262b34; color:#fff; }
.xp-sw { display:flex; border-radius:4px; overflow:hidden; box-shadow:0 0 0 1px rgba(255,255,255,.12); }
.xp-sw i { width:9px; height:16px; display:block; }
.xp-iconbtn {
  width:34px; height:34px; border-radius:8px; border:1px solid #2c313b; background:#1e2128;
  color:#c4c9d6; display:flex; align-items:center; justify-content:center;
}
.xp-iconbtn:hover { color:#fff; border-color:#454c5b; }
.xp-iconbtn.on { background:#3a4150; color:#fff; }

.xp-stagewrap { flex:1; position:relative; overflow:auto; display:flex; align-items:flex-start; justify-content:center; }
.xp-stage { transform-origin:top center; }
.canvas {
  width:1440px; height:900px; overflow:hidden; position:relative;
  box-shadow:0 24px 70px -20px rgba(0,0,0,.7); border-radius:6px;
}

/* identity rationale sheet */
.xp-sheet {
  position:absolute; top:0; right:0; bottom:0; width:380px; z-index:60;
  background:#15171c; border-left:1px solid #262a31; padding:22px 22px 28px; overflow:auto;
  transform:translateX(100%); transition:transform .28s cubic-bezier(.4,0,.2,1);
}
.xp-sheet.open { transform:translateX(0); box-shadow:-20px 0 50px -20px rgba(0,0,0,.6); }
.xp-sheet h3 { margin:0 0 2px; font-size:20px; color:#fff; }
.xp-sheet .tl { color:#9aa1b2; font-size:13px; margin-bottom:18px; font-style:italic; }
.xp-sheet .blk { margin-bottom:16px; }
.xp-sheet .lab { font-size:10.5px; text-transform:uppercase; letter-spacing:.1em; color:#6f7689; font-weight:700; margin-bottom:6px; }
.xp-sheet p { margin:0; font-size:13px; line-height:1.6; color:#c4c9d6; }
.xp-sheet .swrow { display:flex; gap:8px; margin-top:4px; }
.xp-sheet .swrow i { width:34px; height:34px; border-radius:6px; box-shadow:inset 0 0 0 1px rgba(255,255,255,.1); }
.xp-sheet .close { position:absolute; top:16px; right:16px; }
.xp-sheet hr { border:0; border-top:1px solid #262a31; margin:18px 0; }
.xp-sheet .others b { color:#e7e9ee; }

/* ============================================================
   APP SHELL
   ============================================================ */
.rz-root { width:100%; height:100%; display:flex; flex-direction:column; overflow:hidden; }
.app-header {
  height:58px; flex:none; display:flex; align-items:center; gap:14px; padding:0 18px;
  background:var(--header-bg); color:var(--header-text); border-bottom:var(--chrome-border) solid var(--header-line);
}
.rz-crest { display:flex; align-items:center; justify-content:center; }
.hd-school { display:flex; flex-direction:column; line-height:1.15; white-space:nowrap; flex:none; margin-right:2px; }
.hd-school b { font-family:var(--font-display); font-weight:var(--fw-display); font-size:15px; color:var(--header-text); }
.hd-school span { font-size:11px; color:var(--header-text); opacity:.62; }
.hd-div { width:1px; height:26px; background:currentColor; opacity:.18; flex:none; }
.hd-sub { font-size:12px; opacity:.7; flex:none; }
.hd-spacer { flex:1; }
.hd-saved { display:flex; align-items:center; gap:6px; font-size:12px; opacity:.78; }
.hd-saved .dot { width:7px; height:7px; border-radius:50%; background:var(--st-good); }
.seg-lang { display:flex; border-radius:var(--radius-ctrl); overflow:hidden; border:1px solid rgba(255,255,255,.18); }
.seg-lang button { border:0; background:transparent; color:var(--header-text); opacity:.62; font-size:11.5px; font-weight:700; padding:5px 10px; }
.seg-lang button.on { background:rgba(255,255,255,.16); opacity:1; }
.hd-toggle {
  width:34px; height:34px; border-radius:var(--radius-ctrl); border:1px solid rgba(255,255,255,.18);
  background:transparent; color:var(--header-text); display:flex; align-items:center; justify-content:center; opacity:.85;
}
.hd-toggle:hover { opacity:1; background:rgba(255,255,255,.08); }
/* light-chrome direction (registro): header borders/buttons need darker contrast */
[data-direction="registro"] .seg-lang { border-color:var(--line-strong); }
[data-direction="registro"] .hd-toggle { border-color:var(--line-strong); }
[data-direction="registro"] .seg-lang button.on { background:var(--accent-soft); color:var(--accent-dark); opacity:1; }

.app-body { flex:1; display:flex; min-height:0; }

/* ---------- LEFT NAV ---------- */
.leftnav {
  width:220px; flex:none; background:var(--sidebar-bg); color:var(--sidebar-text);
  display:flex; flex-direction:column; transition:width .2s ease; overflow:hidden;
  border-right:var(--chrome-border) solid var(--line);
}
.leftnav.collapsed { width:58px; }
.nav-scroll { flex:1; overflow:auto; padding:10px 10px 8px; }
.nav-item {
  display:flex; align-items:center; gap:11px; padding:9px 10px; border-radius:var(--radius-ctrl);
  color:var(--sidebar-text); font-size:13px; font-weight:600; white-space:nowrap; cursor:pointer; position:relative;
}
.nav-item:hover { background:var(--sidebar-hover); }
.nav-item.on { background:var(--sidebar-active); color:var(--sidebar-active-text); }
.nav-item.on::before { content:""; position:absolute; left:0; top:6px; bottom:6px; width:3px; border-radius:2px; background:var(--sidebar-edge, var(--accent)); }
.nav-item .ico { color:currentColor; opacity:.92; }
.nav-item .dotlive { width:7px; height:7px; border-radius:50%; background:var(--st-good); margin-left:auto; }
.collapsed .nav-item span, .collapsed .nav-sec, .collapsed .today-feed { display:none; }
.today-feed-c { display:flex; flex-direction:column; align-items:center; gap:5px; padding:2px 0; }
.today-feed-c .tc-label { width:30px; height:22px; display:flex; align-items:center; justify-content:center; color:var(--sidebar-muted); }
.today-c { display:flex; flex-direction:column; align-items:center; gap:3px; cursor:pointer; width:46px; padding:5px 0; border-radius:9px; }
.today-c:hover { background:var(--sidebar-hover); }
.tc-ic { width:30px; height:30px; border-radius:50%; display:flex; align-items:center; justify-content:center; }
.tc-amt { font-family:var(--font-money); font-size:9.5px; font-weight:700; color:var(--sidebar-text); line-height:1; }
.nav-sec { font-size:10px; text-transform:uppercase; letter-spacing:.1em; color:var(--sidebar-muted); font-weight:700; padding:14px 10px 6px; }
.nav-divider { height:1px; background:var(--line); opacity:.5; margin:8px 6px; }
.today-feed { padding:0 4px; display:flex; flex-direction:column; gap:1px; }
.today-row { padding:7px 8px; border-radius:var(--radius-input); cursor:pointer; }
.today-row:hover { background:var(--sidebar-hover); }
.today-row .tr-top { display:flex; justify-content:space-between; gap:8px; align-items:baseline; }
.today-row b { font-size:11.5px; font-weight:700; color:var(--sidebar-text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; flex:1; min-width:0; }
.today-row .amt { font-family:var(--font-money); font-weight:700; font-size:12px; color:var(--st-good); flex:none; }
.today-row .meta { font-size:10.5px; color:var(--sidebar-muted); display:flex; gap:6px; align-items:center; margin-top:3px; }
.nav-foot { padding:8px 10px 12px; border-top:1px solid var(--line); }
.nav-collapse {
  display:flex; align-items:center; gap:10px; padding:8px 10px; color:var(--sidebar-muted);
  font-size:12px; font-weight:600; border-radius:var(--radius-ctrl); cursor:pointer; width:100%; border:0; background:transparent;
}
.nav-collapse:hover { background:var(--sidebar-hover); color:var(--sidebar-text); }

/* ---------- MAIN ---------- */
.app-main { flex:1; min-width:0; display:flex; flex-direction:column; overflow:hidden; }
.page-scroll { flex:1; overflow:auto; }
.page-head { padding:18px 24px 14px; display:flex; align-items:flex-end; gap:16px; }
.page-title { font-family:var(--font-display); font-weight:var(--fw-display); font-size:25px; letter-spacing:-.01em; }
.page-sub { font-size:12.5px; color:var(--text-muted); margin-top:3px; }
.btn {
  display:inline-flex; align-items:center; gap:8px; border-radius:var(--radius-ctrl); font-size:13px; font-weight:600;
  padding:9px 14px; border:1px solid var(--line-strong); background:var(--surface); color:var(--text-soft);
}
.btn:hover { border-color:var(--text-muted); }
.btn--primary { background:var(--accent); border-color:var(--accent); color:var(--on-accent); }
.btn--primary:hover { background:var(--accent-dark); border-color:var(--accent-dark); }
.btn--wa { background:var(--wa); border-color:var(--wa); color:#fff; }

/* ---------- KPI STRIP ---------- */
.kpi-strip {
  display:grid; grid-template-columns:repeat(5,1fr); gap:1px; margin:0 24px;
  background:var(--line); border:1px solid var(--line); border-radius:var(--radius-card); overflow:hidden;
}
.kpi { background:var(--surface); padding:13px 16px; }
.kpi .lab { font-size:10.5px; text-transform:uppercase; letter-spacing:.09em; color:var(--text-muted); font-weight:700; }
.kpi .val { font-family:var(--font-money); font-weight:700; font-size:22px; margin-top:5px; letter-spacing:-.01em; }
.kpi .val small { font-size:12px; color:var(--text-muted); font-weight:600; margin-left:3px; }
.kpi.alert .val { color:var(--st-mora2); }
.kpi .trend { font-size:11px; color:var(--text-muted); margin-top:3px; }

/* ---------- TOOLBAR ---------- */
.toolbar { display:flex; align-items:center; gap:10px; padding:14px 24px 10px; flex-wrap:wrap; }
.search {
  display:flex; align-items:center; gap:8px; background:var(--surface); border:1px solid var(--line-strong);
  border-radius:var(--radius-input); padding:8px 12px; min-width:250px; color:var(--text-muted);
}
.search input { border:0; background:transparent; outline:none; color:var(--text); font-size:13px; flex:1; }
.sel {
  display:flex; align-items:center; gap:8px; background:var(--surface); border:1px solid var(--line-strong);
  border-radius:var(--radius-input); padding:8px 11px; font-size:13px; color:var(--text-soft); font-weight:600;
}
.tool-pills { display:flex; gap:6px; align-items:center; }
.tpill {
  border:1px solid var(--line-strong); background:var(--surface); color:var(--text-soft);
  border-radius:var(--radius-pill); padding:7px 13px; font-size:12.5px; font-weight:700; display:flex; gap:7px; align-items:center;
}
.tpill .cnt { font-family:var(--font-money); font-size:11.5px; padding:1px 7px; border-radius:var(--radius-pill); background:var(--surface-2); color:var(--text-muted); }
.tpill.on { background:var(--accent); border-color:var(--accent); color:var(--on-accent); }
.tpill.on .cnt { background:rgba(255,255,255,.22); color:var(--on-accent); }
.legend { display:flex; gap:14px; align-items:center; padding:8px 24px; color:var(--text-muted); font-size:11.5px; }
.legend .lk { display:flex; align-items:center; gap:6px; font-weight:600; }
.legend .sq { width:12px; height:12px; border-radius:3px; border:1px solid var(--line-strong); }

/* ---------- LEDGER TABLE ---------- */
.tablewrap { margin:0 24px 18px; border:1px solid var(--line); border-radius:var(--radius-card); overflow:auto; background:var(--surface); box-shadow:var(--shadow-card); }
table.ledger { border-collapse:separate; border-spacing:0; width:max-content; min-width:100%; font-size:12.5px; }
.ledger thead th {
  position:sticky; top:0; z-index:3; background:var(--surface-2); color:var(--text-muted);
  font-size:10px; text-transform:uppercase; letter-spacing:.07em; font-weight:700; text-align:left;
  padding:9px 12px; border-bottom:1px solid var(--line-strong); white-space:nowrap;
}
.ledger thead th.grp { text-align:center; color:var(--text-soft); border-left:1px solid var(--line); }
.ledger thead th.mo { text-align:center; padding:8px 8px; min-width:46px; }
.ledger thead th.mo.cur { color:var(--accent); }
.ledger tbody td { padding:0 12px; height:var(--row-h); border-bottom:1px solid var(--line-rule); white-space:nowrap; color:var(--text-soft); }
.ledger tbody tr:hover td { background:var(--surface-2); }
.ledger .c-no { color:var(--text-muted); font-family:var(--font-money); font-size:11.5px; text-align:right; width:38px; }
.ledger .c-name { color:var(--text); font-weight:600; }
.ledger .c-name .fam { color:var(--text-muted); font-weight:600; font-size:11px; margin-left:6px; }
.ledger .c-grade { color:var(--text-soft); font-weight:600; }
.ledger td.money-h { font-family:var(--font-money); text-align:right; color:var(--text-soft); border-left:1px solid var(--line-rule); }
.sticky-l { position:sticky; left:0; z-index:2; background:var(--surface); }
.ledger tbody tr:hover .sticky-l { background:var(--surface-2); }
.cellbox {
  display:flex; align-items:center; justify-content:center; height:calc(var(--row-h) - 9px); margin:4px 2px;
  border-radius:3px; font-family:var(--font-money); font-size:11px; font-weight:600; min-width:42px;
}
.cell--paid { background:var(--cell-paid); color:var(--st-good); }
.cell--mora { background:var(--cell-mora); color:var(--st-mora2); cursor:pointer; }
.cell--future { color:var(--text-muted); opacity:.5; }
.cell--cur { box-shadow:inset 0 0 0 1.5px var(--cell-current); }
.avatar { width:24px; height:24px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; color:#fff; font-size:10px; font-weight:700; flex:none; }
.namecell { display:flex; align-items:center; gap:9px; }
.table-foot { display:flex; align-items:center; justify-content:space-between; padding:11px 24px; font-size:12px; color:var(--text-muted); border-top:1px solid var(--line); background:var(--surface); }
.pager { display:flex; gap:4px; align-items:center; }
.pager button { border:1px solid var(--line-strong); background:var(--surface); color:var(--text-soft); border-radius:var(--radius-input); padding:5px 11px; font-size:12px; font-weight:600; }
.pager .cur { background:var(--accent); border-color:var(--accent); color:var(--on-accent); }

/* ---------- FAB ---------- */
.fab {
  position:absolute; bottom:22px; z-index:20; right:354px; transition:right .2s ease;
  display:flex; align-items:center; gap:9px; background:var(--accent); color:var(--on-accent);
  border:0; border-radius:var(--radius-pill); padding:13px 20px; font-size:14px; font-weight:700;
  box-shadow:var(--shadow-pop);
}
.fab.rail-closed { right:78px; }
.fab .pin { width:26px; height:26px; border-radius:50%; background:rgba(255,255,255,.22); display:flex; align-items:center; justify-content:center; }

/* ---------- WHATSAPP RAIL ---------- */
.warail { width:330px; flex:none; background:var(--surface); border-left:1px solid var(--line); display:flex; flex-direction:column; box-shadow:var(--shadow-rail); }
.warail.collapsed { width:58px; }
.wa-head { padding:14px 16px; border-bottom:1px solid var(--line); display:flex; align-items:center; gap:9px; }
.wa-head .wd { width:9px; height:9px; border-radius:50%; background:var(--wa); }
.wa-head b { font-family:var(--font-display); font-size:15px; font-weight:var(--fw-display); }
.wa-head .sub { font-size:11.5px; color:var(--text-muted); margin-top:2px; }
.wa-body { flex:1; overflow:auto; padding:14px 16px; display:flex; flex-direction:column; gap:14px; }
.wa-step { border:1px solid var(--line); border-radius:var(--radius-card); padding:13px 14px; background:var(--surface); }
.wa-step .st-h { display:flex; align-items:center; gap:8px; font-size:11px; text-transform:uppercase; letter-spacing:.08em; color:var(--text-muted); font-weight:700; margin-bottom:10px; }
.wa-step .st-h .n { width:18px; height:18px; border-radius:50%; background:var(--accent-soft); color:var(--accent-dark); display:flex; align-items:center; justify-content:center; font-size:10px; }
.wa-recip { display:flex; flex-direction:column; gap:2px; }
.wa-recip b { font-size:13px; } .wa-recip .meta { font-size:11.5px; color:var(--text-muted); }
.wa-recip .ok { font-size:11.5px; color:var(--st-good); font-weight:600; margin-top:6px; display:flex; gap:6px; align-items:center; }
.seg2 { display:flex; background:var(--surface-2); border-radius:var(--radius-ctrl); padding:3px; }
.seg2 button { flex:1; border:0; background:transparent; color:var(--text-muted); font-size:12px; font-weight:700; padding:7px; border-radius:6px; }
.seg2 button.on { background:var(--accent); color:var(--on-accent); }
.wa-templatesel { width:100%; border:1px solid var(--line-strong); border-radius:var(--radius-input); padding:9px 11px; background:var(--surface); color:var(--text); font-size:12.5px; font-weight:600; margin-top:9px; }
.wa-msg { margin-top:9px; border:1px solid var(--line-strong); border-radius:var(--radius-input); padding:11px; background:var(--surface-2); font-size:12.5px; color:var(--text-soft); line-height:1.5; }
.wa-paylink { margin-top:9px; border:1px dashed var(--line-strong); border-radius:var(--radius-input); padding:10px 12px; display:flex; flex-direction:column; gap:1px; }
.wa-paylink b { font-size:12px; color:var(--accent); } .wa-paylink span { font-size:11px; color:var(--text-muted); font-family:var(--font-money); }
.wa-check { display:flex; align-items:center; gap:9px; margin-top:11px; font-size:12px; color:var(--text-soft); }
.wa-check .box { width:18px; height:18px; border-radius:4px; background:var(--accent); color:var(--on-accent); display:flex; align-items:center; justify-content:center; }
.wa-foot { border-top:1px solid var(--line); padding:13px 16px; }
.wa-cost { font-size:11.5px; color:var(--text-muted); display:flex; justify-content:space-between; margin-bottom:9px; }
.wa-send { width:100%; border:0; border-radius:var(--radius-ctrl); padding:12px; font-size:13.5px; font-weight:700; background:var(--wa); color:#fff; }
.wa-send.disabled { background:var(--surface-3); color:var(--text-muted); }
.wa-note { text-align:center; font-size:11px; color:var(--text-muted); margin-top:8px; }
.rail-collapsed-strip { display:flex; flex-direction:column; align-items:center; gap:16px; padding:16px 0; color:var(--text-muted); }
.rail-collapsed-strip .ric { width:36px; height:36px; border-radius:var(--radius-ctrl); display:flex; align-items:center; justify-content:center; background:var(--surface-2); color:var(--accent); }

/* ============================================================
   MESSAGE CENTER (3-pane)
   ============================================================ */
.mc { display:flex; flex:1; min-height:0; }
.mc-list { width:330px; flex:none; border-right:1px solid var(--line); display:flex; flex-direction:column; background:var(--surface); }
.mc-list-h { padding:15px 16px 12px; border-bottom:1px solid var(--line); }
.mc-list-h b { font-family:var(--font-display); font-size:17px; font-weight:var(--fw-display); }
.mc-list-h .sub { font-size:11.5px; color:var(--text-muted); margin-top:2px; }
.mc-filter { display:flex; gap:6px; margin-top:11px; }
.mc-filter .f { font-size:11.5px; font-weight:700; padding:5px 10px; border-radius:var(--radius-pill); border:1px solid var(--line-strong); color:var(--text-soft); background:var(--surface); }
.mc-filter .f.on { background:var(--accent); border-color:var(--accent); color:var(--on-accent); }
.mc-convos { flex:1; overflow:auto; }
.convo { display:flex; gap:11px; padding:12px 16px; border-bottom:1px solid var(--line-rule); cursor:pointer; align-items:flex-start; }
.convo:hover { background:var(--surface-2); }
.convo.on { background:var(--accent-soft); }
.convo.on::before { content:""; position:absolute; }
.convo .av { width:38px; height:38px; border-radius:50%; flex:none; display:flex; align-items:center; justify-content:center; color:#fff; font-weight:700; font-size:13px; }
.convo .cmain { flex:1; min-width:0; }
.convo .crow1 { display:flex; justify-content:space-between; align-items:baseline; gap:8px; }
.convo .cname { font-weight:700; font-size:13px; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.convo .ctime { font-size:10.5px; color:var(--text-muted); flex:none; }
.convo .csub { font-size:11.5px; color:var(--text-muted); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:1px; }
.convo .clast { font-size:12px; color:var(--text-soft); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:3px; }
.convo .unread { width:8px; height:8px; border-radius:50%; background:var(--accent); flex:none; margin-top:6px; }

.mc-thread { flex:1; min-width:0; display:flex; flex-direction:column; background:var(--page); }
.mc-thread-h { padding:13px 18px; border-bottom:1px solid var(--line); background:var(--surface); display:flex; align-items:center; gap:11px; }
.mc-thread-h b { font-size:14px; } .mc-thread-h .sub { font-size:11.5px; color:var(--text-muted); }
.mc-msgs { flex:1; overflow:auto; padding:20px 22px; display:flex; flex-direction:column; gap:10px; }
.daydot { align-self:center; font-size:10.5px; text-transform:uppercase; letter-spacing:.08em; color:var(--text-muted); font-weight:700; background:var(--surface-2); padding:3px 11px; border-radius:var(--radius-pill); }
.bub { max-width:74%; padding:9px 13px; border-radius:12px; font-size:13px; line-height:1.45; position:relative; }
.bub .bt { font-size:10px; color:var(--text-muted); margin-top:5px; text-align:right; }
.bub.in { align-self:flex-start; background:var(--surface); border:1px solid var(--line); color:var(--text); border-bottom-left-radius:4px; }
.bub.out { align-self:flex-end; background:var(--wa-bg); color:var(--text); border-bottom-right-radius:4px; }
.bub.out .bt { color:var(--wa); }
.paylinkbub { align-self:flex-end; max-width:74%; border:1px solid var(--line-strong); background:var(--surface); border-radius:12px; padding:11px 14px; }
.paylinkbub b { font-size:12.5px; color:var(--accent); display:flex; gap:7px; align-items:center; }
.paylinkbub span { font-size:11.5px; color:var(--text-muted); font-family:var(--font-money); }
.mc-composer { border-top:1px solid var(--line); padding:13px 18px; background:var(--surface); }
.mc-quick { display:flex; gap:7px; margin-bottom:10px; }
.mc-quick button { font-size:11.5px; font-weight:700; padding:6px 12px; border-radius:var(--radius-pill); border:1px solid var(--line-strong); background:var(--surface); color:var(--text-soft); }
.mc-tpl { width:100%; border:1px solid var(--line-strong); border-radius:var(--radius-input); padding:9px 11px; font-size:12.5px; font-weight:600; color:var(--text); background:var(--surface); margin-bottom:9px; }
.mc-text { width:100%; min-height:54px; border:1px solid var(--line-strong); border-radius:var(--radius-input); padding:10px 12px; font-size:13px; color:var(--text); background:var(--surface); resize:none; font-family:inherit; }
.mc-warn { margin-top:10px; padding:9px 12px; border-radius:var(--radius-input); background:var(--st-mora2-bg); color:var(--st-mora2); font-size:12px; font-weight:600; }
.mc-sendbar { display:flex; gap:10px; margin-top:11px; }
.mc-profile { width:300px; flex:none; border-left:1px solid var(--line); background:var(--surface); overflow:auto; padding:18px; }
.mc-profile h4 { font-family:var(--font-display); font-size:16px; font-weight:var(--fw-display); margin:0 0 2px; }
.mc-profile .sub { font-size:11.5px; color:var(--text-muted); margin-bottom:16px; }
.pf-stat { display:flex; justify-content:space-between; align-items:center; padding:11px 0; border-bottom:1px solid var(--line-rule); }
.pf-stat .l { font-size:10.5px; text-transform:uppercase; letter-spacing:.07em; color:var(--text-muted); font-weight:700; }
.pf-stat .v { font-family:var(--font-money); font-weight:700; font-size:14px; }
.pf-card { margin-top:16px; border:1px solid var(--line); border-radius:var(--radius-card); padding:14px; }
.pf-card .ttl { font-size:10.5px; text-transform:uppercase; letter-spacing:.08em; color:var(--text-muted); font-weight:700; margin-bottom:11px; }
.pf-student { display:flex; align-items:center; gap:10px; padding:7px 0; }
.pf-student .av { width:30px; height:30px; border-radius:50%; display:flex; align-items:center; justify-content:center; color:#fff; font-weight:700; font-size:11px; flex:none; }
.pf-student b { font-size:12.5px; flex:1; } .pf-student .g { font-size:11px; color:var(--text-muted); }

/* ============================================================
   AUTOMATIONS (3-column journey studio)
   ============================================================ */
.au { display:flex; flex:1; min-height:0; }
.au-list { width:300px; flex:none; border-right:1px solid var(--line); background:var(--surface); display:flex; flex-direction:column; }
.au-list-h { padding:15px 16px 13px; border-bottom:1px solid var(--line); }
.au-list-h b { font-family:var(--font-display); font-size:17px; font-weight:var(--fw-display); }
.au-list-h .sub { font-size:11.5px; color:var(--text-muted); margin-top:2px; }
.au-tags { display:flex; gap:6px; margin-top:11px; }
.au-tags .t { font-size:11px; font-weight:700; padding:4px 9px; border-radius:var(--radius-pill); }
.au-tags .t.a { background:var(--st-good-bg); color:var(--st-good); }
.au-tags .t.d { background:var(--st-mora1-bg); color:var(--st-mora1); }
.au-tags .t.p { background:var(--surface-2); color:var(--text-muted); }
.au-journeys { flex:1; overflow:auto; padding:10px; display:flex; flex-direction:column; gap:6px; }
.jcard { border:1px solid var(--line); border-radius:var(--radius-card); padding:12px 13px; cursor:pointer; display:flex; gap:11px; align-items:center; background:var(--surface); }
.jcard:hover { border-color:var(--line-strong); }
.jcard.on { border-color:var(--accent); background:var(--accent-soft); box-shadow:var(--shadow-card); }
.jcard .ji { width:34px; height:34px; border-radius:var(--radius-ctrl); background:var(--surface-2); color:var(--accent); display:flex; align-items:center; justify-content:center; flex:none; }
.jcard.on .ji { background:var(--accent); color:var(--on-accent); }
.jcard .jm { flex:1; min-width:0; }
.jcard b { font-size:12.5px; font-weight:700; display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.jcard .jmeta { font-size:11px; color:var(--text-muted); margin-top:2px; }
.jcard .jdot { width:8px; height:8px; border-radius:50%; flex:none; }
.jcard .jdot.live { background:var(--st-good); } .jcard .jdot.draft { background:var(--st-mora1); }

.au-canvas { flex:1; min-width:0; overflow:auto; background:var(--page); position:relative; padding:22px 26px; }
.canvas-head { display:flex; align-items:center; gap:12px; margin-bottom:18px; }
.canvas-head b { font-family:var(--font-display); font-size:18px; font-weight:var(--fw-display); }
.canvas-head .meta { font-size:12px; color:var(--text-muted); }
.toggle { width:42px; height:24px; border-radius:999px; background:var(--accent); position:relative; flex:none; }
.toggle::after { content:""; position:absolute; top:3px; left:21px; width:18px; height:18px; border-radius:50%; background:#fff; }
.flow { display:flex; flex-direction:column; align-items:center; gap:0; }
.fnode { display:flex; align-items:center; gap:13px; width:440px; }
.fnode .fic { width:42px; height:42px; border-radius:var(--radius-card); display:flex; align-items:center; justify-content:center; color:#fff; flex:none; box-shadow:var(--shadow-raise); }
.fic.start { background:var(--st-good); } .fic.wait { background:var(--accent-2); } .fic.msg { background:var(--accent); } .fic.branch { background:var(--st-special); }
.fcard { flex:1; border:1px solid var(--line); border-radius:var(--radius-card); padding:11px 14px; background:var(--surface); box-shadow:var(--shadow-card); }
.fcard.sel { border-color:var(--accent); box-shadow:0 0 0 2px var(--accent-soft), var(--shadow-card); }
.fcard .tags { display:flex; gap:6px; margin-bottom:5px; }
.fcard .tags .tg { font-size:9.5px; text-transform:uppercase; letter-spacing:.05em; font-weight:700; padding:2px 7px; border-radius:var(--radius-pill); background:var(--accent-soft); color:var(--accent-dark); }
.fcard b { font-size:13px; } .fcard .fd { font-size:11.5px; color:var(--text-muted); margin-top:2px; }
.fwait { background:var(--st-mora1-bg); color:var(--st-mora1); font-size:11.5px; font-weight:700; padding:6px 12px; border-radius:var(--radius-pill); display:inline-flex; gap:7px; align-items:center; }
.fwait input { width:30px; border:1px solid currentColor; background:transparent; color:inherit; border-radius:4px; text-align:center; font-weight:700; font-family:var(--font-money); }
.fconn { width:2px; height:18px; background:var(--line-strong); margin:0 0 0 20px; align-self:flex-start; margin-left:20px; }
.flow .fconn { align-self:center; margin-left:-400px; }
.fbranch { display:flex; gap:12px; width:440px; }
.fbranch .opt { flex:1; border:1px solid var(--line); border-radius:var(--radius-card); padding:10px 12px; background:var(--surface); }
.fbranch .opt.yes { border-color:var(--st-good); background:var(--st-good-bg); }
.fbranch .opt .ol { font-size:11px; font-weight:700; } .fbranch .opt .od { font-size:11px; color:var(--text-muted); }

.au-side { width:330px; flex:none; border-left:1px solid var(--line); background:var(--surface); overflow:auto; }
.au-side-h { padding:15px 16px; border-bottom:1px solid var(--line); }
.au-side-h b { font-family:var(--font-display); font-size:15px; font-weight:var(--fw-display); }
.perf-grid { display:grid; grid-template-columns:1fr 1fr; gap:1px; background:var(--line); border-bottom:1px solid var(--line); }
.perf { background:var(--surface); padding:13px 15px; }
.perf .pv { font-family:var(--font-money); font-weight:700; font-size:20px; }
.perf .pl { font-size:10px; text-transform:uppercase; letter-spacing:.07em; color:var(--text-muted); font-weight:700; margin-top:3px; }
.perf.good .pv { color:var(--st-good); } .perf.warn .pv { color:var(--st-mora2); }
.funnel { padding:16px; }
.funnel .fr { margin-bottom:13px; }
.funnel .frow { display:flex; justify-content:space-between; font-size:11.5px; margin-bottom:5px; }
.funnel .frow .fl { color:var(--text-soft); font-weight:600; } .funnel .frow .fp { font-family:var(--font-money); font-weight:700; color:var(--text); }
.funnel .bar { height:7px; border-radius:4px; background:var(--surface-3); overflow:hidden; }
.funnel .bar i { display:block; height:100%; background:var(--accent); border-radius:4px; }

/* node editor sidebar mode */
.ne-sec { padding:14px 16px; border-bottom:1px solid var(--line); }
.ne-sec .nl { font-size:10.5px; text-transform:uppercase; letter-spacing:.08em; color:var(--text-muted); font-weight:700; margin-bottom:9px; }
.ne-imgs { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.ne-img { border:1px solid var(--line-strong); border-radius:var(--radius-input); padding:9px; display:flex; align-items:center; gap:8px; font-size:11.5px; font-weight:600; color:var(--text-soft); }
.ne-img.on { border-color:var(--accent); background:var(--accent-soft); color:var(--accent-dark); }
.ne-preview { border:1px solid var(--line); border-radius:var(--radius-card); padding:13px; background:var(--surface-2); }
.ne-preview b { font-size:13px; } .ne-preview p { font-size:12px; color:var(--text-soft); margin:6px 0 11px; line-height:1.5; }
.ne-preview .pvbtns { display:flex; gap:8px; }
.ne-preview .pvbtns .pb { flex:1; text-align:center; font-size:11.5px; font-weight:700; padding:7px; border-radius:var(--radius-input); background:var(--accent-soft); color:var(--accent-dark); }

/* placeholder image slot */
.imgslot { background:repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 7px, var(--surface-3) 7px, var(--surface-3) 14px); border:1px dashed var(--line-strong); border-radius:var(--radius-input); display:flex; align-items:center; justify-content:center; color:var(--text-muted); font-family:var(--font-money); font-size:10.5px; }
