/* ═══════════════════════════════════════════════════════════════
   LIQUID GLASS — Design System
   1:1 translation of fm-glass-light.html — English class names only
   ───────────────────────────────────────────────────────────────
   Source of truth: dev.liquid-layout project (markattack.ch repo),
     file: mockups/liquid-glass.css
   Imported into dev.layout on 2026-04-23 (branch feature/liquid-layout, Sprint 3)
   Any change should be upstreamed to the liquid-layout repo first,
     then re-synced here — do NOT diverge silently.
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@300;400;500;600;900&display=swap');

/* ─── TOKENS ─────────────────────────────────────────────────── */
:root {
  --teal:      #008290;
  --teal-2:    #0095A9;
  --teal-dim:  rgba(0,130,144,.12);
  --teal-glow: rgba(0,130,144,.22);
  --yellow:    #ffcb05;
  --yellow-dark: #c79500; /* darker variant for low-opacity contexts where --yellow becomes invisible */
  --field-bg:    #f3f6f7; /* form input background */
  --track-bg:    #e6eef0; /* slider/progress track */
  --red:       #EC627E;
  --green:     #00A85E;

  --glass-white:  rgba(255,255,255,.72);
  --glass-white2: rgba(255,255,255,.55);
  --glass-white3: rgba(255,255,255,.38);
  --glass-teal:   rgba(0,130,144,.10);
  --glass-active: rgba(0,130,144,.14);
  --spec:         rgba(255,255,255,.90);
  --spec-dim:     rgba(255,255,255,.60);

  --ink:   #0f2427;
  --ink-2: #2d4347;
  --ink-3: #5c7478;
  --ink-4: #97b0b3;

  --blur-sm: blur(12px);
  --blur-md: blur(20px);
  --blur-lg: blur(32px);

  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-pill:999px;

  --sb-w: 256px;
  --sb-c: 68px;
  --hh:   67px;

  --ff: 'Inter Tight', sans-serif;

  --sh-glass: 0 8px 32px rgba(0,60,80,.10), 0 2px 8px rgba(0,60,80,.06);
  --sh-card:  0 4px 20px rgba(0,60,80,.08), 0 1px 4px rgba(0,60,80,.05);
  --sh-glow:  0 0 20px var(--teal-glow);
}

/* ─── BASE ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--ff);
  font-size: 13px;
  color: var(--ink);
  display: flex;
  position: relative;
}

/* ─── MESH BACKGROUND ────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 70% 60% at 0%   0%,   #e0f5f7 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 100% 0%,   #d4f0f5 0%, transparent 55%),
    radial-gradient(ellipse 50% 60% at 50%  100%, #e8f8fa 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 80%  60%,  #f0fafb 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 20%  70%,  #e6f7f9 0%, transparent 55%);
  background-color: #f4f9fa;
}
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(circle 400px at 10% 20%, rgba(0,130,144,.07) 0%, transparent 70%),
    radial-gradient(circle 300px at 90% 75%, rgba(0,149,169,.06) 0%, transparent 70%),
    radial-gradient(circle 250px at 55% 90%, rgba(0,130,144,.05) 0%, transparent 70%),
    radial-gradient(circle 200px at 30% 55%, rgba(255,203,5,.04) 0%, transparent 70%);
  animation: orbs 22s ease-in-out infinite alternate;
}
@keyframes orbs {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(-15px, 12px) scale(1.04); }
}

/* ─── SIDEBAR (.sb → .sidebar) ───────────────────────────────── */
.sidebar {
  width: var(--sb-w); min-width: var(--sb-w);
  height: 100vh; flex-shrink: 0;
  position: relative; z-index: 20;
  display: flex; flex-direction: column;
  overflow: hidden;
  background: var(--glass-white);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border-right: 1px solid rgba(0,130,144,.1);
  box-shadow: 2px 0 20px rgba(0,60,80,.06);
  transition: width .25s cubic-bezier(.4,0,.2,1), min-width .25s cubic-bezier(.4,0,.2,1);
}
.sidebar::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--spec), transparent);
  pointer-events: none;
}
/* .sb.col → .sidebar.collapsed */
.sidebar.collapsed { width: var(--sb-c); min-width: var(--sb-c); }

/* ── Logo (.logo → .sidebar-logo) ── */
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px 16px;
  flex-shrink: 0; overflow: hidden; cursor: pointer;
  border-bottom: 1px solid rgba(0,130,144,.08);
}
.sidebar-logo-mark { width: 34px; height: 30px; flex-shrink: 0; }
.sidebar-logo-mark svg { width: 34px; height: 30px; }
.sidebar-logo-text { white-space: nowrap; transition: opacity .15s; }
.sidebar.collapsed .sidebar-logo-text { opacity: 0; pointer-events: none; }
/* .lf → .logo-fast */
.logo-fast { font-size: 16px; font-weight: 900; color: var(--ink); letter-spacing: -.4px; }
/* .lm → .logo-mkt */
.logo-mkt { font-size: 16px; font-weight: 400; color: var(--teal); letter-spacing: -.2px; }

/* ── Nav (.nav → .sidebar-nav) ── */
.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 10px 10px; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(0,130,144,.15); border-radius: 2px; }

/* .nt → .nav-section-title */
.nav-section-title {
  font-size: 9px; font-weight: 900; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--ink-4);
  padding: 12px 10px 4px; white-space: nowrap; transition: opacity .15s;
}
.sidebar.collapsed .nav-section-title { opacity: 0; }

/* .ni → .nav-item */
.nav-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--r-md);
  cursor: pointer; color: var(--ink-3);
  white-space: nowrap; margin-bottom: 1px;
  transition: background .14s, color .14s;
  position: relative;
}
.nav-item:hover { background: var(--glass-white); color: var(--ink); }
/* .ni.on → .nav-item.active */
.nav-item.active {
  background: var(--glass-active);
  color: var(--teal);
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(0,130,144,.12);
  border: 1px solid rgba(0,130,144,.18);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 2.5px; border-radius: 2px;
  background: var(--teal);
  box-shadow: 0 0 6px var(--teal-glow);
}

/* .nic → .nav-icon */
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.nav-icon svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* .nlb → .nav-label */
.nav-label { font-size: 13px; font-weight: 500; flex: 1; transition: opacity .15s; }
.sidebar.collapsed .nav-label { opacity: 0; pointer-events: none; }

/* .nar → .nav-arrow */
.nav-arrow { font-size: 10px; color: var(--ink-4); transition: opacity .15s, transform .2s; }
.nav-item.open .nav-arrow { transform: rotate(90deg); }
.sidebar.collapsed .nav-arrow { opacity: 0; }

/* .nba → .nav-badge */
.nav-badge { font-size: 9px; font-weight: 900; padding: 2px 7px; border-radius: var(--r-pill); flex-shrink: 0; transition: opacity .15s; }
.sidebar.collapsed .nav-badge { opacity: 0; }
/* .nba-t → .nav-badge-teal */
.nav-badge-teal { background: var(--glass-teal); color: var(--teal); border: 1px solid rgba(0,180,204,.2); }

/* .ndot → .nav-dot */
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); flex-shrink: 0; box-shadow: 0 0 6px rgba(255,203,5,.5); }

/* ── Subnav (.nsub → .subnav) ── */
.subnav { overflow: hidden; max-height: 220px; padding-left: 27px; transition: max-height .22s ease, opacity .15s; }
.subnav.closed { max-height: 0; opacity: 0; pointer-events: none; }
.sidebar.collapsed .subnav { max-height: 0 !important; opacity: 0; pointer-events: none; }
.subnav .nav-item { font-size: 12.5px; padding: 6px 10px; }
.subnav .nav-item::before { display: none; }
.subnav .nav-item.active { box-shadow: none; }
.subnav .nav-item::after {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  border: 1.5px solid currentColor; flex-shrink: 0;
  margin-right: -2px; order: -1; opacity: .4;
}
.subnav .nav-item.active::after { background: var(--teal); border-color: var(--teal); opacity: 1; box-shadow: 0 0 6px var(--teal-glow); }

/* .ni.parent-on → .nav-item.parent-active */
.nav-item.parent-active { color: var(--teal); font-weight: 900; }
.nav-item.parent-active .nav-icon svg { stroke: var(--teal); }
.nav-item.parent-active .nav-arrow { color: var(--teal); }

/* .sdiv → .nav-divider */
.nav-divider { height: 1px; background: rgba(0,130,144,.08); margin: 6px 10px; }

/* ── Workspace (.ws-wrap, .ws → .workspace-wrap, .workspace) ── */
.workspace-wrap { padding: 6px 10px; border-top: 1px solid rgba(0,130,144,.08); }
.workspace {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--r-md);
  cursor: pointer; overflow: hidden; white-space: nowrap;
  transition: background .14s;
}
.workspace:hover { background: var(--glass-white); }
/* .ws-ico → .workspace-icon */
.workspace-icon {
  width: 26px; height: 26px; border-radius: 7px;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-2) 100%);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 900; flex-shrink: 0;
  box-shadow: 0 2px 8px var(--teal-glow);
}
/* .ws-nm → .workspace-name */
.workspace-name { font-size: 12px; font-weight: 600; color: var(--ink-2); flex: 1; }
/* .ws-ar → .workspace-arrow */
.workspace-arrow { font-size: 10px; color: var(--ink-4); }
.sidebar.collapsed .workspace-name, .sidebar.collapsed .workspace-arrow { opacity: 0; }

/* ── Tooltip (.ni[data-t] → .nav-item[data-tooltip]) ── */
.nav-item[data-tooltip] { position: relative; }
.nav-item[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: rgba(6,43,49,.9); color: #fff;
  backdrop-filter: var(--blur-md);
  border: 1px solid var(--spec-dim);
  font-size: 11px; font-weight: 500; padding: 4px 10px;
  border-radius: var(--r-sm); white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 100;
}
.sidebar.collapsed .nav-item[data-tooltip]:hover::after { opacity: 1; }

/* ─── MAIN (.main → .main) ───────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100vh; overflow: hidden; position: relative; z-index: 10; }

/* ─── HEADER (.hdr → .header) ────────────────────────────────── */
.header {
  height: var(--hh);
  background: var(--glass-white);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border-bottom: 1px solid rgba(0,130,144,.1);
  box-shadow: 0 2px 16px rgba(0,60,80,.07);
  display: flex; align-items: center; gap: 8px;
  padding: 0 18px 0 20px; flex-shrink: 0; z-index: 20;
  position: relative;
}
.header::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 5%, rgba(0,130,144,.08) 30%, rgba(0,130,144,.12) 50%, rgba(0,130,144,.08) 70%, transparent 95%);
  pointer-events: none;
}

/* .hdr-tog → .header-toggle */
.header-toggle {
  width: 30px; height: 30px; border-radius: var(--r-md);
  background: var(--glass-white2);
  border: 1px solid var(--spec-dim);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; color: var(--ink-3);
  transition: background .12s, color .12s;
  backdrop-filter: var(--blur-sm);
}
.header-toggle:hover { background: var(--glass-white); color: var(--ink); }
.header-toggle svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .22s; }
.sidebar.collapsed ~ .main .header-toggle svg { transform: rotate(180deg); }

/* .bc → .breadcrumb */
.breadcrumb { flex: 1; display: flex; align-items: center; gap: 5px; font-size: 12px; min-width: 0; }
.breadcrumb-parent { color: var(--ink-4); cursor: pointer; white-space: nowrap; transition: color .12s; }
.breadcrumb-parent:hover { color: var(--teal); }
.breadcrumb-sep { color: var(--ink-4); font-size: 13px; }
.breadcrumb-current { color: var(--ink-2); font-weight: 600; white-space: nowrap; }

/* .hib → .header-icon-btn */
.header-icon-btn {
  width: 32px; height: 32px; border-radius: var(--r-md);
  border: 1px solid var(--spec-dim);
  background: var(--glass-white2);
  backdrop-filter: var(--blur-sm);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--ink-3); position: relative; flex-shrink: 0;
  transition: background .13s, color .13s, border-color .13s;
}
.header-icon-btn:hover { background: var(--glass-white); color: var(--ink); border-color: var(--spec); }
.header-icon-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* .yd → .dot-yellow */
.header-icon-btn .dot-yellow { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); border: 2px solid rgba(0,0,0,.3); box-shadow: 0 0 6px rgba(255,203,5,.6); }
/* .cr-dot → .dot-teal */
.header-icon-btn .dot-teal { position: absolute; bottom: 5px; right: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); border: 2px solid rgba(0,0,0,.2); box-shadow: 0 0 6px var(--teal-glow); }

/* .hdr-sep → .header-sep */
.header-sep { width: 1px; height: 20px; background: rgba(0,130,144,.1); flex-shrink: 0; margin: 0 2px; }

/* ── Header dropdown (.hdd → .header-dropdown) ── */
.header-dropdown { position: relative; flex-shrink: 0; }
/* .hdd-btn → .header-dropdown-btn */
.header-dropdown-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 11px 6px 9px;
  background: var(--glass-white2);
  backdrop-filter: var(--blur-sm);
  border: 1px solid var(--spec-dim);
  border-radius: var(--r-pill); cursor: pointer;
  font-family: var(--ff); font-size: 12px; font-weight: 600;
  color: var(--ink-2); white-space: nowrap;
  transition: all .12s;
}
.header-dropdown-btn:hover { background: var(--glass-white); border-color: var(--spec); color: var(--ink); }
.header-dropdown-btn.open { background: var(--glass-white); border-color: rgba(0,180,204,.35); color: var(--teal); }
/* .hdd-ar → .dropdown-arrow */
.dropdown-arrow { font-size: 9px; color: var(--ink-4); transition: transform .15s; }
.header-dropdown-btn.open .dropdown-arrow { transform: rotate(180deg); }
/* .env-dot */
.env-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.env-dot.setup { background: var(--teal); box-shadow: 0 0 6px var(--teal-glow); }
.env-dot.prod  { background: var(--green); box-shadow: 0 0 6px rgba(48,217,122,.5); }
.env-dot.live  { background: var(--red); box-shadow: 0 0 6px rgba(255,107,138,.5); }
/* .acc-ico → .account-icon */
.account-icon { width: 20px; height: 20px; border-radius: 6px; background: linear-gradient(135deg, var(--teal) 0%, var(--teal-2) 100%); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 900; flex-shrink: 0; box-shadow: 0 1px 4px var(--teal-glow); }

/* .hdd-panel → .dropdown-panel */
.dropdown-panel {
  display: none; position: absolute; top: calc(100% + 8px); right: 0;
  background: rgba(240,250,252,.88);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border: 1px solid var(--spec-dim);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-glass), 0 0 0 1px rgba(255,255,255,.04) inset;
  min-width: 180px; z-index: 200; overflow: hidden;
  animation: ddFade .14s ease;
}
.dropdown-panel::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--spec), transparent);
  pointer-events: none;
}
.dropdown-panel.show { display: block; }
@keyframes ddFade { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
/* .dd-item → .dropdown-item */
.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; cursor: pointer; font-size: 12.5px; color: var(--ink-2); transition: background .1s, color .1s; white-space: nowrap; }
.dropdown-item:hover { background: rgba(0,130,144,.08); color: var(--teal); }
.dropdown-item.active { color: var(--teal); font-weight: 600; }
.dropdown-item .dd-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.dropdown-item .dd-check { width: 14px; height: 14px; stroke: var(--teal); fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; margin-left: auto; flex-shrink: 0; filter: drop-shadow(0 0 4px var(--teal-glow)); }
/* .dd-sep → .dropdown-sep */
.dropdown-sep { height: 1px; background: rgba(0,130,144,.1); margin: 4px 0; }
/* .dd-head → .dropdown-head */
.dropdown-head { padding: 8px 14px 4px; font-size: 9.5px; font-weight: 900; letter-spacing: .8px; text-transform: uppercase; color: var(--ink-4); }

/* .hav → .header-avatar */
.header-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--teal) 0%, var(--teal-2) 100%); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 900; cursor: pointer; box-shadow: 0 2px 12px var(--teal-glow), 0 0 0 1.5px rgba(255,255,255,.15); transition: box-shadow .13s; flex-shrink: 0; }
.header-avatar:hover { box-shadow: 0 4px 20px var(--teal-glow), 0 0 0 2px rgba(255,255,255,.25); }

/* ─── CONTENT (.cnt → .content) ──────────────────────────────── */
.content { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 22px 40px; display: flex; flex-direction: column; gap: 18px; }
/* Prevent direct children from shrinking — otherwise tall cards get squashed and overflow never scrolls */
.content > * { flex-shrink: 0; }
.content::-webkit-scrollbar { width: 4px; }
.content::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }

/* ─── PAGE HEADER (.ph, .pt, .ps) ────────────────────────────── */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-title { font-size: 24px; font-weight: 900; color: var(--ink); letter-spacing: -.6px; line-height: 1; }
.page-subtitle { font-size: 12px; color: var(--ink-4); margin-top: 4px; }

/* ─── PAGES (.pg) ────────────────────────────────────────────── */
.page { display: none; flex-direction: column; gap: 18px; animation: fadeIn .18s ease; }
.page.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ─── GLASS CARD (.card) ─────────────────────────────────────── */
.glass-card {
  background: var(--glass-white2);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-card);
  overflow: hidden;
  position: relative;
}
.glass-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 10%, rgba(255,255,255,.8) 30%, rgba(255,255,255,.95) 50%, rgba(255,255,255,.8) 70%, transparent 90%);
  pointer-events: none; z-index: 1;
}
/* .ch → .card-head */
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid rgba(0,130,144,.08); }
/* .ct → .card-title */
.card-title { font-size: 13.5px; font-weight: 900; color: var(--ink); }
/* .cs → .card-subtitle */
.card-subtitle { font-size: 11.5px; color: var(--ink-4); margin-top: 2px; }

/* ─── BUTTONS (.btn) ─────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border-radius: var(--r-pill); font-family: var(--ff); font-size: 13px; font-weight: 600; cursor: pointer; border: none; transition: all .13s; }
.btn:active { transform: scale(.97); }
.btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
/* .btn-p → .btn-primary */
.btn-primary {
  background: linear-gradient(135deg, rgba(0,180,204,.8) 0%, rgba(0,204,232,.7) 100%);
  color: #fff; border: 1px solid rgba(255,255,255,.2);
  box-shadow: 0 4px 16px var(--teal-glow), inset 0 1px 0 rgba(255,255,255,.25);
  backdrop-filter: var(--blur-sm);
}
.btn-primary:hover { box-shadow: 0 6px 24px var(--teal-glow), inset 0 1px 0 rgba(255,255,255,.3); transform: translateY(-1px); }
/* .btn-secondary — dark ink glass fill */
.btn-secondary {
  background: rgba(15,36,39,.75); color: #fff;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 4px 16px rgba(15,36,39,.2), inset 0 1px 0 rgba(255,255,255,.08);
  backdrop-filter: var(--blur-sm);
}
.btn-secondary:hover { background: rgba(15,36,39,.85); box-shadow: 0 6px 24px rgba(15,36,39,.3), inset 0 1px 0 rgba(255,255,255,.12); transform: translateY(-1px); }
/* .btn-o → .btn-outline */
.btn-outline {
  background: var(--glass-white2); color: var(--ink-2);
  border: 1px solid var(--spec-dim);
  backdrop-filter: var(--blur-sm);
}
.btn-outline:hover { background: var(--glass-white); color: var(--ink); border-color: var(--spec); }
/* .btn-outline-primary — outline with teal border and text */
.btn-outline-primary {
  background: transparent; color: var(--teal);
  border: 1.5px solid var(--teal);
  backdrop-filter: var(--blur-sm);
}
.btn-outline-primary:hover { background: var(--glass-teal); border-color: var(--teal-2); transform: translateY(-1px); }
/* .btn-outline-secondary — outline with ink border and text */
.btn-outline-secondary {
  background: transparent; color: var(--ink-2);
  border: 1.5px solid var(--ink-2);
  backdrop-filter: var(--blur-sm);
}
.btn-outline-secondary:hover { background: rgba(15,36,39,.06); color: var(--ink); border-color: var(--ink); transform: translateY(-1px); }
/* .btn-warning — yellow filled */
.btn-warning {
  background: linear-gradient(135deg, rgba(255,203,5,.85) 0%, rgba(255,215,50,.75) 100%);
  color: #5c4300; border: 1px solid rgba(255,255,255,.2);
  box-shadow: 0 4px 16px rgba(255,203,5,.25), inset 0 1px 0 rgba(255,255,255,.3);
  backdrop-filter: var(--blur-sm);
}
.btn-warning:hover { box-shadow: 0 6px 24px rgba(255,203,5,.35), inset 0 1px 0 rgba(255,255,255,.4); transform: translateY(-1px); }
/* .btn-outline-warning */
.btn-outline-warning {
  background: transparent; color: #7a5f00;
  border: 1.5px solid var(--yellow);
  backdrop-filter: var(--blur-sm);
}
.btn-outline-warning:hover { background: rgba(255,203,5,.1); border-color: #e6b800; transform: translateY(-1px); }
/* .btn-danger — red filled */
.btn-danger {
  background: linear-gradient(135deg, rgba(236,98,126,.8) 0%, rgba(255,107,138,.7) 100%);
  color: #fff; border: 1px solid rgba(255,255,255,.15);
  box-shadow: 0 4px 16px rgba(236,98,126,.25), inset 0 1px 0 rgba(255,255,255,.2);
  backdrop-filter: var(--blur-sm);
}
.btn-danger:hover { box-shadow: 0 6px 24px rgba(236,98,126,.35), inset 0 1px 0 rgba(255,255,255,.25); transform: translateY(-1px); }
/* .btn-outline-danger */
.btn-outline-danger {
  background: transparent; color: #b03550;
  border: 1.5px solid var(--red);
  backdrop-filter: var(--blur-sm);
}
.btn-outline-danger:hover { background: rgba(236,98,126,.08); border-color: #d4556e; transform: translateY(-1px); }
/* ── Button Dropdown ── */
.btn-dropdown { position: relative; display: inline-flex; }
.btn-dropdown .btn { border-radius: var(--r-pill); }
.btn-dropdown .btn .btn-arrow { font-size: 9px; margin-left: 2px; transition: transform .15s; }
.btn-dropdown.open .btn .btn-arrow { transform: rotate(180deg); }
.btn-dropdown-panel {
  display: none; position: absolute; top: calc(100% + 6px); left: 0;
  background: rgba(240,250,252,.88);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border: 1px solid var(--spec-dim);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-glass);
  min-width: 160px; z-index: 9999; overflow: hidden;
  animation: ddFade .14s ease;
}
/* When teleported to body for stacking context escape */
.btn-dropdown-panel.panel-teleported {
  position: fixed;
}
.btn-dropdown-panel::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--spec), transparent);
  pointer-events: none;
}
.btn-dropdown.open .btn-dropdown-panel { display: block; }
.btn-dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; cursor: pointer;
  font-family: var(--ff); font-size: 12.5px; color: var(--ink-2);
  transition: background .1s, color .1s; white-space: nowrap;
  /* Reset native button styling so <button> looks identical to <div> */
  background: none; border: none; width: 100%; text-align: left;
}
.btn-dropdown-item:hover { background: rgba(0,130,144,.08); color: var(--teal); }
.btn-dropdown-item:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }
.btn-dropdown-item svg {
  width: 13px; height: 13px; stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0;
}
.btn-dropdown-item-danger { color: var(--red); }
.btn-dropdown-item-danger:hover { color: #b03550; background: rgba(236,98,126,.06); }
.btn-dropdown-sep { height: 1px; background: rgba(0,130,144,.1); margin: 4px 0; }
/* ── Button Split (button + dropdown trigger) ── */
.btn-split { display: inline-flex; border-radius: var(--r-pill); overflow: visible; position: relative; }
.btn-split .btn-split-action { border-radius: var(--r-pill) 0 0 var(--r-pill); border-right: none; }
.btn-split .btn-split-toggle {
  border-radius: 0 var(--r-pill) var(--r-pill) 0;
  padding: 8px 10px; border-left: 1px solid rgba(255,255,255,.2);
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-split .btn-split-toggle .btn-arrow { font-size: 9px; transition: transform .15s; }
.btn-split.open .btn-split-toggle .btn-arrow { transform: rotate(180deg); }
.btn-split .btn-dropdown-panel { left: 0; }
.btn-split.open .btn-dropdown-panel { display: block; }
/* .btn-disabled — state modifier, works on any variant */
.btn[disabled], .btn.btn-disabled {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}
/* .btn-sm → .btn-sm */
.btn-sm { padding: 6px 13px; font-size: 12px; }
/* .btn-w → .btn-white */
.btn-white { background: rgba(255,255,255,.9); color: #006d7a; font-weight: 900; box-shadow: 0 2px 12px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.8); }
.btn-white:hover { background: #fff; }
/* .btn-gst → .btn-ghost */
.btn-ghost { background: rgba(255,255,255,.08); color: rgba(255,255,255,.8); border: 1px solid rgba(255,255,255,.15); backdrop-filter: var(--blur-sm); }
.btn-ghost:hover { background: rgba(255,255,255,.14); color: #fff; }

/* ─── STAT CARDS (.sc) ───────────────────────────────────────── */
/* .stats → .stats-grid */
.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
@media (max-width: 1199px) { .stats-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 599px) {
  .stats-grid { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  /* Toolbar — stack: search full-width on top, buttons below */
  .toolbar { flex-wrap: wrap; padding: 12px 16px; }
  .toolbar .search-box { flex: 1 1 100%; min-width: 0; }
  .toolbar-right { margin-left: auto; }
  /* Tabs scrollable */
  .tabs { padding: 0 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
  /* Card head + pagination tighter */
  .card-head { padding: 14px 16px; }
  .pagination { flex-wrap: wrap; gap: 8px; padding: 11px 16px; }
  .pagination-nav { width: 100%; justify-content: space-between; }
  /* Page header — actions full width below title */
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; justify-content: center; }
  /* Data table — hide non-essential columns: Lead (3), Conversione (4), Modificato (5) */
  .data-table th:nth-child(3),
  .data-table td:nth-child(3),
  .data-table th:nth-child(4),
  .data-table td:nth-child(4),
  .data-table th:nth-child(5),
  .data-table td:nth-child(5) { display: none; }
  /* Tighter cells */
  .data-table th, .data-table td { padding: 11px 12px; font-size: 12px; }
  .data-table th:first-child, .data-table td:first-child { padding-left: 16px; }
  .data-table th:last-child, .data-table td:last-child { padding-right: 16px; }
  /* Row content compact */
  .row-icon { width: 28px; height: 28px; }
  .row-icon svg { width: 12px; height: 12px; }
  .cell-flex { gap: 9px; }
  .row-name { font-size: 12px; }
  .row-meta { font-size: 10.5px; }
  /* Row actions: keep only the more (3-dots) trigger, hide redundant edit/copy */
  .row-actions > .row-action-btn:not([aria-haspopup]) { display: none; }
}
/* .sc → .stat-card */
.stat-card {
  background: var(--glass-white2);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-xl);
  padding: 20px 20px 16px;
  position: relative; overflow: hidden;
  cursor: pointer; transition: transform .14s, box-shadow .14s;
  box-shadow: var(--sh-card);
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--spec), transparent);
  pointer-events: none;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 12px 40px rgba(0,0,0,.3), 0 2px 8px rgba(0,0,0,.2); }
/* .sc-deco → .stat-deco */
.stat-deco { position: absolute; right: -16px; top: -16px; width: 80px; height: 80px; border-radius: 50%; opacity: .12; pointer-events: none; }
/* .sc-row → .stat-row */
.stat-row { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
/* .sc-ico → .stat-icon */
.stat-icon { width: 40px; height: 40px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.15); }
.stat-icon svg { width: 18px; height: 18px; stroke: var(--teal); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stat-icon.icon-green svg { stroke: var(--green); }
.stat-icon.icon-yellow svg { stroke: var(--yellow-dark); }
.stat-icon.icon-red svg { stroke: var(--red); }
.icon-teal   { background: rgba(0,130,144,.18);  box-shadow: 0 4px 12px var(--teal-glow); }
.icon-green  { background: rgba(0,168,94,.15);    box-shadow: 0 4px 12px rgba(0,168,94,.25); }
.icon-yellow { background: rgba(255,203,5,.18);   box-shadow: 0 4px 12px rgba(255,203,5,.2); }
.icon-red    { background: rgba(236,98,126,.16);   box-shadow: 0 4px 12px rgba(236,98,126,.22); }
/* .sc-badge → .stat-badge */
.stat-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--r-pill); }
/* .d-u, .d-d, .d-n → .delta-up, .delta-down, .delta-neutral */
.delta-up { background: rgba(0,168,94,.12); color: #007a43; border: 1px solid rgba(0,168,94,.18); }
.delta-down { background: rgba(236,98,126,.12); color: #b03550; border: 1px solid rgba(236,98,126,.18); }
.delta-neutral { background: var(--glass-teal); color: var(--teal); border: 1px solid rgba(0,130,144,.15); }
/* .sc-val → .stat-value */
.stat-value { font-size: 30px; font-weight: 900; color: var(--ink); letter-spacing: -1px; line-height: 1; margin-bottom: 3px; }
/* .sc-lbl → .stat-label */
.stat-label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-4); }
/* ── Variant: stat-card-bg — large background icon as watermark ── */
.stat-card-bg { padding: 22px 22px 18px; }
.stat-card-bg .stat-bg-icon {
  position: absolute;
  right: -10px; bottom: -14px;
  width: 110px; height: 110px;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  opacity: .14;
  transition: opacity .2s, transform .2s;
}
.stat-card-bg .stat-bg-icon svg {
  width: 100%; height: 100%;
  stroke: currentColor; fill: none;
  stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round;
}
.stat-card-bg:hover .stat-bg-icon {
  opacity: .22;
  transform: translate(-4px, -4px) scale(1.04);
}
.stat-card-bg.bg-teal { color: var(--teal); }
.stat-card-bg.bg-green { color: var(--green); }
.stat-card-bg.bg-yellow { color: var(--yellow-dark); }
.stat-card-bg.bg-red { color: var(--red); }
.stat-card-bg .stat-value,
.stat-card-bg .stat-label { color: var(--ink); position: relative; z-index: 1; }
.stat-card-bg .stat-label { color: var(--ink-4); }
/* Extra breathing room (16 vs base 12) to compensate for the larger 22px padding of bg variant */
.stat-card-bg .stat-row { position: relative; z-index: 1; margin-bottom: 16px; }
/* ── Variant: stat-card-horizontal — compact, icon left, content right ── */
.stat-card-h {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px;
}
.stat-card-h .stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--r-lg);
  flex-shrink: 0;
}
.stat-card-h .stat-icon svg { width: 22px; height: 22px; }
.stat-card-h .stat-content { flex: 1; min-width: 0; }
.stat-card-h .stat-value { font-size: 24px; margin-bottom: 2px; }
.stat-card-h .stat-label { font-size: 10px; }
.stat-card-h .stat-badge { margin-left: auto; flex-shrink: 0; align-self: flex-start; }

/* ─── DASHBOARD GRID (.dash-grid) ────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
@media (max-width: 991px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-left { display: flex; flex-direction: column; gap: 16px; }
.dash-right { display: flex; flex-direction: column; gap: 16px; }

/* ─── WELCOME BANNER (.welcome) ──────────────────────────────── */
.welcome {
  border-radius: var(--r-xl);
  background: linear-gradient(120deg, rgba(0,80,100,.65) 0%, rgba(0,130,144,.5) 100%);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid rgba(255,255,255,.12);
  padding: 24px 26px;
  display: flex; align-items: center; gap: 20px;
  position: relative; overflow: hidden;
  box-shadow: var(--sh-card), 0 0 0 1px rgba(0,180,204,.1) inset;
}
.welcome::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent);
}
.welcome-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.welcome-bg svg { position: absolute; right: -20px; top: -20px; width: 280px; height: 220px; opacity: .06; }
.welcome-circle1 { position: absolute; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.2) 0%, transparent 70%); right: 60px; top: -80px; }
.welcome-circle2 { position: absolute; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(255,203,5,.12) 0%, transparent 70%); right: 10px; bottom: -20px; }
.welcome-img { width: 100px; height: 80px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: var(--r-lg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; z-index: 1; box-shadow: inset 0 1px 0 rgba(255,255,255,.15); }
.welcome-img svg { width: 34px; height: 34px; stroke: rgba(255,255,255,.4); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.welcome-body { flex: 1; z-index: 1; }
.welcome-tag { font-size: 9.5px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; color: rgba(0,200,220,.8); margin-bottom: 6px; }
.welcome-heading { font-size: 20px; font-weight: 900; color: #fff; letter-spacing: -.4px; margin-bottom: 5px; }
.welcome-text { font-size: 12px; color: rgba(255,255,255,.5); margin-bottom: 14px; line-height: 1.5; }
.welcome-actions { display: flex; gap: 8px; }

/* ─── CHART (.chart-wrap) ────────────────────────────────────── */
.chart-wrap { padding: 18px 20px 14px; }
.chart-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.chart-value { font-size: 32px; font-weight: 900; color: var(--ink); letter-spacing: -1.2px; }
.chart-delta { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--r-pill); background: rgba(48,217,122,.18); color: #30d97a; border: 1px solid rgba(48,217,122,.2); }
.chart-svg { width: 100%; }
.bar-rest { fill: rgba(0,130,144,.1); transition: fill .12s; }
.bar-rest:hover { fill: rgba(0,130,144,.2); }
.bar-highlight { fill: rgba(0,130,144,.85); filter: drop-shadow(0 0 8px var(--teal-glow)); }
.bar-label { font-size: 9px; fill: rgba(0,60,80,.35); font-family: 'Inter Tight', sans-serif; }

/* ─── NEW CUSTOMERS (.nc) ────────────────────────────────────── */
.new-customers { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid rgba(0,130,144,.07); background: rgba(0,130,144,.04); }
.new-customers-info { flex: 1; }
.new-customers-big { font-size: 13.5px; font-weight: 900; color: var(--ink); }
.new-customers-sub { font-size: 11.5px; color: var(--ink-4); margin-top: 2px; }
.new-customers-avatars { display: flex; }
.avatar-stack { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--teal) 0%, var(--teal-2) 100%); border: 2px solid rgba(255,255,255,.8); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 900; margin-left: -7px; flex-shrink: 0; box-shadow: 0 2px 6px rgba(0,60,80,.15); }
.avatar-stack:first-child { margin-left: 0; }
.avatar-stack-more { background: rgba(0,130,144,.1); color: var(--ink-3); border-color: rgba(0,130,144,.1); }

/* ─── RIGHT COLUMN (.rc) ─────────────────────────────────────── */
.right-card { background: var(--glass-white2); backdrop-filter: var(--blur-md); -webkit-backdrop-filter: var(--blur-md); border: 1px solid rgba(255,255,255,.1); border-radius: var(--r-xl); overflow: hidden; position: relative; box-shadow: var(--sh-card); }
.right-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--spec), transparent); pointer-events: none; }
.right-card-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.06); }
.right-card-title { font-size: 13px; font-weight: 900; color: var(--ink); }
.right-card-link { font-size: 12px; font-weight: 600; color: var(--teal); cursor: pointer; }
.right-card-link:hover { text-decoration: underline; }

/* Campaign rows */
.campaign-row { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid rgba(255,255,255,.04); cursor: pointer; transition: background .1s; }
.campaign-row:last-child { border-bottom: none; }
.campaign-row:hover { background: var(--glass-white2); }
.campaign-icon { width: 30px; height: 30px; border-radius: var(--r-md); background: rgba(0,130,144,.12); display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 1px solid rgba(0,130,144,.15); }
.campaign-icon svg { width: 13px; height: 13px; stroke: var(--teal); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.campaign-name { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.campaign-sub { font-size: 10.5px; color: var(--ink-4); margin-top: 1px; }
.campaign-pct { font-size: 12.5px; font-weight: 600; color: #007a43; text-align: right; }
.campaign-badge { display: inline-block; padding: 1px 7px; border-radius: var(--r-pill); font-size: 9.5px; font-weight: 900; margin-top: 2px; }
.campaign-badge-active { background: rgba(0,168,94,.1); color: #007a43; border: 1px solid rgba(0,168,94,.15); }
.campaign-badge-paused { background: rgba(255,203,5,.12); color: #7a5f00; border: 1px solid rgba(255,203,5,.18); }
.campaign-right { margin-left: auto; text-align: right; flex-shrink: 0; }
.campaign-pct-paused { color: var(--ink-4); }
.campaign-icon-yellow { background: rgba(255,203,5,.2); border-color: rgba(255,203,5,.2); }
.campaign-icon-yellow svg { stroke: var(--yellow); }
/* Right card footer link */
.right-card-footer { padding: 11px 16px; border-top: 1px solid rgba(0,130,144,.06); }

/* ─── ALERT (.alert) ─────────────────────────────────────────── */
.alert-card {
  background: rgba(236,98,126,.07);
  backdrop-filter: var(--blur-md);
  border: 1px solid rgba(236,98,126,.15);
  border-radius: var(--r-xl); padding: 14px 16px;
  display: flex; gap: 11px; align-items: flex-start;
  box-shadow: var(--sh-card);
  position: relative; overflow: hidden;
}
.alert-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(236,98,126,.3), transparent); }
.alert-icon { width: 32px; height: 32px; border-radius: var(--r-md); background: rgba(255,107,138,.25); display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 1px solid rgba(236,98,126,.15); }
.alert-icon svg { width: 14px; height: 14px; stroke: #b03550; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.alert-text { font-size: 12px; color: var(--ink-3); line-height: 1.55; flex: 1; }
.alert-text strong { color: var(--ink); }
.alert-btn { display: inline-flex; margin-top: 8px; padding: 4px 12px; border-radius: var(--r-pill); background: rgba(255,107,138,.25); color: #ff6b8a; font-size: 11.5px; font-weight: 600; cursor: pointer; border: 1px solid rgba(236,98,126,.15); font-family: var(--ff); }

/* ─── TABS (.tabs) ───────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 1px solid rgba(0,130,144,.08); padding: 0 20px; }
.tab { padding: 11px 14px; font-size: 12.5px; font-weight: 500; color: var(--ink-4); cursor: pointer; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: color .12s; display: flex; align-items: center; gap: 5px; white-space: nowrap; background: none; font-family: var(--ff); }
.tab:hover { color: var(--ink-2); }
.tab.active { color: var(--teal); font-weight: 900; border-bottom-color: var(--teal); text-shadow: 0 0 12px var(--teal-glow); }
.tab-count { background: var(--glass-teal); color: var(--teal); font-size: 10px; font-weight: 900; padding: 1px 6px; border-radius: var(--r-pill); border: 1px solid rgba(0,180,204,.2); }
.tab.active .tab-count { background: rgba(0,180,204,.3); }

/* ─── TOOLBAR (.tb) ──────────────────────────────────────────── */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 20px; }
/* Inside toolbar: search box grows to fill remaining space, buttons stay right-aligned */
.toolbar .search-box { flex: 1; min-width: 0; }
/* .sbox → .search-box */
.search-box { display: flex; align-items: center; gap: 8px; padding: 7px 13px; background: var(--glass-white2); border: 1px solid rgba(255,255,255,.1); border-radius: var(--r-md); transition: border-color .12s, background .12s; min-width: 200px; backdrop-filter: var(--blur-sm); }
.search-box:focus-within { border-color: rgba(0,180,204,.4); background: rgba(255,255,255,.06); box-shadow: 0 0 0 3px rgba(0,180,204,.1); }
.search-box svg { width: 13px; height: 13px; stroke: var(--ink-4); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.search-box input { border: none; outline: none; background: none; font-family: var(--ff); font-size: 13px; color: var(--ink); flex: 1; min-width: 0; }
.search-box input::placeholder { color: var(--ink-4); }
/* .fbt → .filter-btn */
.filter-btn { display: flex; align-items: center; gap: 6px; padding: 7px 13px; background: var(--glass-white2); border: 1px solid rgba(255,255,255,.1); border-radius: var(--r-md); font-family: var(--ff); font-size: 12px; font-weight: 500; color: var(--ink-3); cursor: pointer; white-space: nowrap; backdrop-filter: var(--blur-sm); transition: all .12s; }
.filter-btn:hover { background: var(--glass-white); color: var(--ink); border-color: var(--spec); }
.filter-btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* .vt → .view-toggle */
.view-toggle { display: flex; background: var(--glass-white2); border: 1px solid rgba(255,255,255,.1); border-radius: var(--r-md); overflow: hidden; backdrop-filter: var(--blur-sm); }
/* .vb → .view-btn */
.view-btn { padding: 7px 10px; border: none; background: none; cursor: pointer; color: var(--ink-4); transition: background .12s, color .12s; }
.view-btn.active { background: var(--glass-teal); color: var(--teal); }
.view-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; }

/* ─── TABLE (.tbl) ───────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 9px 20px; font-size: 10px; font-weight: 900; letter-spacing: .7px; text-transform: uppercase; color: var(--ink-4); text-align: left; background: rgba(255,255,255,.03); border-bottom: 1px solid rgba(0,130,144,.08); }
.data-table td { padding: 11px 20px; border-bottom: 1px solid rgba(0,130,144,.07); font-size: 12.5px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { cursor: pointer; transition: background .1s, box-shadow .15s; }
.data-table tbody tr:hover { background: rgba(0,130,144,.05); }
.data-table tbody tr.row-selected,
.data-table tbody tr.row-selected:hover { background: var(--glass-active); box-shadow: inset 3px 0 0 var(--teal); }
/* Common cell layout helpers */
.cell-flex { display: flex; align-items: center; gap: 11px; }
.cell-muted { color: var(--ink-4); font-size: 11.5px; }
/* Page header actions group */
.page-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
/* Pagination nav (right side of .pagination) */
.pagination-nav { display: flex; align-items: center; gap: 8px; }
/* Filter button compact (used in pagination) */
.filter-btn-compact { padding: 3px 10px; }
/* SVG sprite — keeps icons in DOM but invisible */
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
/* Row action dropdown wrapper — used inside .row-actions for the more (3-dots) trigger */
.row-action-dropdown { position: relative; display: inline-flex; }
/* Always show row actions (no hover required) — useful in mobile/touch + dense tables */
.row-actions.row-actions-static { opacity: 1; }
/* .rn → .row-name */
.row-name { font-size: 12.5px; font-weight: 600; color: var(--ink); }
/* .rm → .row-meta */
.row-meta { font-size: 11px; color: var(--ink-4); margin-top: 1px; }
/* .rnum → .row-number */
.row-number { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.text-good { color: #007a43; font-weight: 500; }
.text-bad  { color: #b03550; font-weight: 500; }
.text-neutral  { color: var(--ink-4); font-weight: 500; }
/* .row-ico → .row-icon */
.row-icon { width: 30px; height: 30px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.row-icon-teal { background: rgba(0,180,204,.2); color: var(--teal); border: 1px solid rgba(0,180,204,.15); }
.row-icon-yellow { background: rgba(255,203,5,.15); color: var(--yellow); border: 1px solid rgba(255,203,5,.15); }
.row-icon svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* .st → .status */
.status { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: var(--r-pill); font-size: 10.5px; font-weight: 900; }
.status::before { content: ''; width: 5px; height: 5px; border-radius: 50%; }
.status-active { background: rgba(0,168,94,.1); color: #007a43; border: 1px solid rgba(0,168,94,.18); } .status-active::before { background: #00A85E; }
.status-draft { background: rgba(0,60,80,.06); color: var(--ink-4); border: 1px solid rgba(0,60,80,.1); } .status-draft::before { background: var(--ink-4); }
.status-paused { background: rgba(255,203,5,.12); color: #7a5f00; border: 1px solid rgba(255,203,5,.2); } .status-paused::before { background: var(--yellow); }
/* .ract → .row-actions */
.row-actions { display: flex; gap: 3px; opacity: 0; transition: opacity .1s; }
tr:hover .row-actions { opacity: 1; }
/* .rb → .row-action-btn */
.row-action-btn { width: 26px; height: 26px; border-radius: 6px; border: 1px solid rgba(0,130,144,.1); background: rgba(0,130,144,.04); display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink-4); transition: all .1s; }
.row-action-btn:hover { background: rgba(0,130,144,.1); color: var(--teal); border-color: rgba(0,130,144,.2); }
.row-action-btn svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* .pill → .pill */
.pill { font-size: 9.5px; font-weight: 900; padding: 2px 7px; border-radius: var(--r-pill); }
.pill-teal { background: var(--glass-teal); color: var(--teal); border: 1px solid rgba(0,180,204,.2); }
.pill-red { background: rgba(255,107,138,.15); color: #ff6b8a; border: 1px solid rgba(236,98,126,.15); }
.pill-yellow { background: rgba(255,203,5,.12); color: var(--yellow); border: 1px solid rgba(255,203,5,.2); }
/* .rfm → .rfm */
.rfm { display: inline-flex; padding: 2px 7px; border-radius: var(--r-pill); font-size: 10px; font-weight: 900; }
.rfm-recency { background: rgba(0,168,94,.1); color: #007a43; }
.rfm-frequency { background: var(--glass-teal); color: var(--teal); }
.rfm-monetary { background: rgba(255,203,5,.12); color: var(--yellow); }
/* .tav → .table-avatar */
.table-avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(0,130,144,.12); color: var(--teal); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 900; flex-shrink: 0; border: 1.5px solid rgba(0,130,144,.15); }

/* ─── FOLDER CHIPS (.fc) ─────────────────────────────────────── */
.folder-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.folder-chip { display: flex; align-items: center; gap: 6px; padding: 5px 12px; background: var(--glass-white2); border: 1px solid rgba(255,255,255,.1); border-radius: var(--r-pill); font-size: 12px; font-weight: 500; color: var(--ink-3); cursor: pointer; backdrop-filter: var(--blur-sm); transition: all .12s; white-space: nowrap; }
.folder-chip:hover, .folder-chip.active { border-color: rgba(0,180,204,.35); color: var(--teal); background: var(--glass-teal); }
.folder-chip svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ─── OUTPUT GRID (.og) ──────────────────────────────────────── */
.output-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(168px,1fr)); gap: 14px; }
/* When the grid is nested inside a glass-card with toolbar/tabs above and pagination below */
.output-grid-padded { padding: 0 20px 20px; }
.output-card { background: var(--glass-white2); backdrop-filter: var(--blur-md); border: 1px solid rgba(255,255,255,.1); border-radius: var(--r-xl); overflow: hidden; cursor: pointer; transition: transform .14s, box-shadow .14s; position: relative; box-shadow: var(--sh-card); }
.output-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--spec-dim), transparent); pointer-events: none; z-index: 1; }
.output-card:hover { transform: translateY(-3px); box-shadow: 0 16px 40px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.12); }
.output-thumb { height: 104px; background: rgba(0,180,204,.06); display: flex; align-items: center; justify-content: center; }
.output-thumb svg { width: 28px; height: 28px; stroke: var(--teal); fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 8px var(--teal-glow)); }
.output-body { padding: 12px 14px; }
.output-name { font-size: 12.5px; font-weight: 900; color: var(--ink); }
.output-type { font-size: 11px; color: var(--ink-4); margin-top: 3px; }
.output-bar { width: 30px; height: 2px; border-radius: 2px; margin-top: 10px; }
.output-bar-teal { background: var(--teal); box-shadow: 0 0 6px var(--teal-glow); }
.output-bar-red { background: var(--red); box-shadow: 0 0 6px rgba(255,107,138,.4); }
.output-new { background: var(--glass-white2); border: 1.5px dashed rgba(255,255,255,.12); border-radius: var(--r-xl); min-height: 168px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; color: var(--ink-4); transition: all .13s; backdrop-filter: var(--blur-sm); }
.output-new:hover { border-color: rgba(0,180,204,.4); color: var(--teal); background: var(--glass-teal); }
.output-new svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.output-new-label { font-size: 12.5px; font-weight: 600; }
/* Output card menu trigger — visible on hover */
.output-card-menu {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 26px; height: 26px;
  border-radius: var(--r-sm);
  background: rgba(255,255,255,.85);
  backdrop-filter: var(--blur-sm);
  border: 1px solid rgba(255,255,255,.4);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3);
  opacity: 0; transition: opacity .14s, background .14s, color .14s;
  cursor: pointer;
}
.output-card-menu svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.output-card:hover .output-card-menu { opacity: 1; }
.output-card-menu:hover { background: #fff; color: var(--teal); }
/* Output thumbnail variants (different background colors) */
.output-thumb-teal { background: rgba(0,180,204,.08); }
.output-thumb-yellow { background: rgba(255,203,5,.08); }
.output-thumb-yellow svg { stroke: var(--yellow); filter: drop-shadow(0 0 8px rgba(255,203,5,.4)); }
.output-thumb-red { background: rgba(236,98,126,.08); }
.output-thumb-red svg { stroke: var(--red); filter: drop-shadow(0 0 8px rgba(236,98,126,.4)); }
.output-thumb-green { background: rgba(0,168,94,.08); }
.output-thumb-green svg { stroke: var(--green); filter: drop-shadow(0 0 8px rgba(0,168,94,.4)); }
/* Output card meta row (date + size badge) */
.output-meta-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 10.5px; color: var(--ink-4); }
.output-meta-badge { background: var(--glass-teal); color: var(--teal); padding: 1px 6px; border-radius: var(--r-pill); font-weight: 700; border: 1px solid rgba(0,180,204,.2); font-size: 9.5px; }

/* ─── PERSONA DETAIL (.det-grid) ─────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 262px 1fr; gap: 16px; align-items: start; }
.detail-card { background: var(--glass-white2); backdrop-filter: var(--blur-md); border: 1px solid rgba(255,255,255,.1); border-radius: var(--r-xl); overflow: hidden; position: relative; box-shadow: var(--sh-card); }
.detail-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--spec), transparent); pointer-events: none; }
.detail-avatar { width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(135deg, var(--teal) 0%, var(--teal-2) 100%); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 900; margin: 0 auto; box-shadow: 0 4px 20px var(--teal-glow), 0 0 0 2px rgba(255,255,255,.15); }
/* .ir → .info-row */
.info-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 12.5px; }
.info-row:last-child { border-bottom: none; }
.info-row-label { color: var(--ink-4); }
.info-row-value { font-weight: 600; color: var(--ink); }
.info-row-value.link { color: var(--teal); }
/* RFM bars */
.rfm-bar-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.rfm-bar-row:last-child { margin-bottom: 0; }
.rfm-bar-label { font-size: 12px; color: var(--ink-4); }
.rfm-bars { display: flex; gap: 3px; }
.rfm-bar { width: 9px; height: 9px; border-radius: 2px; }
.fill-green { background: #00A85E; }
.fill-teal { background: var(--teal); box-shadow: 0 0 4px var(--teal-glow); }
.fill-yellow { background: var(--yellow); }
.fill-empty { background: rgba(255,255,255,.1); }

/* ─── TIMELINE (.tl) ─────────────────────────────────────────── */
.timeline { padding: 18px 20px; }
.timeline-item { display: flex; gap: 12px; position: relative; padding-bottom: 18px; }
.timeline-item:not(:last-child)::after { content: ''; position: absolute; left: 17px; top: 34px; bottom: 0; width: 1.5px; background: rgba(0,130,144,.12); }
.timeline-dot { width: 34px; height: 34px; border-radius: 50%; background: rgba(0,130,144,.1); border: 1px solid rgba(0,130,144,.15); display: flex; align-items: center; justify-content: center; flex-shrink: 0; z-index: 1; }
.timeline-dot svg { width: 13px; height: 13px; stroke: var(--teal); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.timeline-body { flex: 1; padding-top: 4px; }
.timeline-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.timeline-date { font-size: 11px; color: var(--ink-4); margin-top: 2px; }
.timeline-tag { display: inline-flex; margin-top: 5px; padding: 2px 8px; border-radius: var(--r-pill); font-size: 10px; font-weight: 900; background: var(--glass-teal); color: var(--teal); border: 1px solid rgba(0,180,204,.2); }

/* ─── PAGINATION (.pag) ──────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 11px 20px; border-top: 1px solid rgba(0,130,144,.08); font-size: 12px; color: var(--ink-4); }
.pagination strong { color: var(--ink-2); font-weight: 600; }

/* ─── DATE RANGE (.dr) ───────────────────────────────────────── */
.date-range { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: var(--r-pill); background: var(--glass-white2); font-size: 12px; font-weight: 500; color: var(--ink-3); cursor: pointer; backdrop-filter: var(--blur-sm); transition: all .12s; }
.date-range:hover { border-color: var(--spec); color: var(--ink); }
.date-range svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ═══════════════════════════════════════════════════════════════
   FORMS — input, label, validation, picker, range, progress, wizard
   ═══════════════════════════════════════════════════════════════ */
.form-field { margin-bottom: 18px; }
.form-field label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--ink-2); margin-bottom: 7px; letter-spacing: .1px;
}
.form-field label .required,
.required { color: var(--red); margin-left: 2px; font-weight: 700; }
/* ── Validation states (specificity-driven, no !important) ── */
.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea,
.form-field.has-error input:focus,
.form-field.has-error select:focus,
.form-field.has-error textarea:focus { border-color: var(--red); background: rgba(236,98,126,.04); }
.form-field.has-error input:focus,
.form-field.has-error select:focus,
.form-field.has-error textarea:focus { box-shadow: 0 0 0 3px rgba(236,98,126,.12); }
.form-field.has-error .field-wrapper svg.field-icon { stroke: var(--red); }
.form-field.has-success input,
.form-field.has-success select,
.form-field.has-success textarea,
.form-field.has-success input:focus,
.form-field.has-success select:focus,
.form-field.has-success textarea:focus { border-color: var(--green); background: rgba(0,168,94,.04); }
.form-field.has-success input:focus,
.form-field.has-success select:focus,
.form-field.has-success textarea:focus { box-shadow: 0 0 0 3px rgba(0,168,94,.12); }
.form-field.has-success .field-wrapper svg.field-icon { stroke: var(--green); }
/* ── Field messages ── */
.form-field-msg { display: flex; align-items: flex-start; gap: 6px; margin-top: 6px; font-size: 11.5px; line-height: 1.4; }
.form-field-msg svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; margin-top: 1px; }
.form-field-help { color: var(--ink-4); }
.form-field-error { color: var(--red); font-weight: 600; }
.form-field-success { color: var(--green); font-weight: 600; }
/* ── Field wrapper + input with icon ── */
.field-wrapper { position: relative; }
.field-wrapper svg.field-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px;
  stroke: var(--ink-4); fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  pointer-events: none; transition: stroke .13s;
}
.field-wrapper:focus-within svg.field-icon { stroke: var(--teal); }
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 11px 14px 11px 40px;
  font-family: var(--ff);
  font-size: 13.5px; font-weight: 400;
  color: var(--ink);
  background: var(--field-bg);
  border: 1.5px solid rgba(0,130,144,.12);
  border-radius: 10px;
  outline: none;
  transition: border-color .13s, background .13s, box-shadow .13s;
}
.form-field textarea { padding-left: 14px; resize: vertical; min-height: 90px; font-family: var(--ff); }
.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--ink-4); }
.form-field input:focus,
.form-field textarea:focus { background: #fff; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,130,144,.1); }
/* When the field has no .field-wrapper icon: input goes flush left */
.form-field > input,
.form-field > textarea { padding-left: 14px; }
/* ── Password toggle ── */
.eye-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 4px;
  color: var(--ink-4); transition: color .12s;
}
.eye-toggle:hover { color: var(--teal); }
.eye-toggle svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }
.form-field input[type="password"] { padding-right: 42px; }
/* ── Checkbox / remember ── */
.form-remember { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; color: var(--ink-3); }
.form-remember input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--teal); cursor: pointer; }
/* ── Login + SSO buttons (for login form) ── */
.btn-login {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-2) 100%);
  color: #fff; border: none; border-radius: 10px;
  font-family: var(--ff); font-size: 14px; font-weight: 900;
  cursor: pointer; letter-spacing: .2px;
  box-shadow: 0 4px 18px rgba(0,130,144,.28);
  transition: box-shadow .13s, transform .1s;
}
.btn-login:hover { box-shadow: 0 6px 24px rgba(0,130,144,.36); transform: translateY(-1px); }
.btn-login:active { transform: scale(.98); }
.btn-sso {
  width: 100%; padding: 11px;
  background: #fff; border: 1.5px solid rgba(0,130,144,.15);
  border-radius: 10px; font-family: var(--ff);
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 9px;
  box-shadow: 0 2px 8px rgba(6,43,49,.06);
  transition: border-color .13s, box-shadow .13s;
}
.btn-sso:hover { border-color: var(--teal); box-shadow: 0 4px 14px rgba(0,130,144,.14); }
.btn-sso svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
/* ── Radio ── */
.form-radio-group { display: flex; flex-direction: column; gap: 10px; }
.form-radio { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 12.5px; color: var(--ink-3); }
.form-radio input[type="radio"],
.form-radio input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--teal); cursor: pointer; }
.form-radio-inline { display: flex; gap: 18px; }
.form-radio-inline .form-radio { flex-direction: row; }
/* ── Select ── */
.form-select {
  width: 100%;
  padding: 11px 36px 11px 14px;
  font-family: var(--ff);
  font-size: 13.5px; font-weight: 400;
  color: var(--ink);
  background: var(--field-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2397b0b3' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 13px center;
  border: 1.5px solid rgba(0,130,144,.12);
  border-radius: 10px;
  outline: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color .13s, background-color .13s, box-shadow .13s;
}
.form-select:focus { background-color: #fff; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,130,144,.1); }
.form-select-icon { padding-left: 40px; }
/* ── Numeric ── */
.form-field input[type="number"] { -moz-appearance: textfield; }
.form-field input[type="number"]::-webkit-outer-spin-button,
.form-field input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.form-numeric-wrap { position: relative; }
.form-numeric-wrap input { padding-right: 60px; padding-left: 14px; }
.form-numeric-btns { position: absolute; right: 2px; top: 2px; bottom: 2px; display: flex; gap: 1px; }
.form-numeric-btn {
  width: 28px; border: none; cursor: pointer;
  background: rgba(0,130,144,.06);
  color: var(--teal); font-size: 16px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.form-numeric-btn:first-child { border-radius: 0; }
.form-numeric-btn:last-child { border-radius: 0 8px 8px 0; }
.form-numeric-btn:hover { background: rgba(0,130,144,.12); }
/* ── Color picker ── */
.form-color-wrap { display: flex; align-items: center; gap: 10px; }
.form-color-input {
  width: 40px; height: 40px;
  border: 1.5px solid rgba(0,130,144,.12);
  border-radius: 10px;
  cursor: pointer; background: none; padding: 3px;
  -webkit-appearance: none;
}
.form-color-input::-webkit-color-swatch-wrapper { padding: 0; }
.form-color-input::-webkit-color-swatch { border: none; border-radius: 7px; }
.form-color-input::-moz-color-swatch { border: none; border-radius: 7px; }
.form-color-input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,130,144,.1); }
.form-color-hex {
  font-family: var(--ff);
  font-size: 13px; font-weight: 500;
  color: var(--ink-2);
  background: var(--field-bg);
  border: 1.5px solid rgba(0,130,144,.12);
  border-radius: 10px;
  padding: 11px 14px;
  width: 120px;
  outline: none;
  transition: border-color .13s, background .13s, box-shadow .13s;
}
.form-color-hex:focus { background: #fff; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,130,144,.1); }
.form-color-hex.is-invalid,
.form-color-hex.is-invalid:focus { border-color: var(--red); background: rgba(236,98,126,.04); box-shadow: 0 0 0 3px rgba(236,98,126,.12); }
/* ── Font preview ── */
.form-font-preview { font-size: 14px; color: var(--ink); margin-top: 6px; padding: 8px 0; border-top: 1px solid rgba(0,130,144,.06); }
/* ── Range / Slider ── */
.form-range-wrap { position: relative; padding: 8px 0; }
.form-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px;
  background: var(--track-bg);
  border-radius: 999px;
  outline: none; cursor: pointer;
}
.form-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-2) 100%);
  border: 2px solid #fff; border-radius: 50%;
  cursor: pointer; box-shadow: 0 2px 8px rgba(0,130,144,.35);
  transition: transform .12s, box-shadow .12s;
}
.form-range::-webkit-slider-thumb:hover { transform: scale(1.15); box-shadow: 0 4px 12px rgba(0,130,144,.5); }
.form-range::-moz-range-thumb {
  width: 20px; height: 20px;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-2) 100%);
  border: 2px solid #fff; border-radius: 50%;
  cursor: pointer; box-shadow: 0 2px 8px rgba(0,130,144,.35);
}
.form-range::-moz-range-track { height: 6px; background: var(--track-bg); border-radius: 999px; }
.form-range-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-4); margin-top: 6px; }
.form-range-value {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; padding: 2px 8px;
  background: var(--teal-dim); color: var(--teal);
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
/* ── Progress Bar ── */
.progress { width: 100%; height: 8px; background: var(--track-bg); border-radius: 999px; overflow: hidden; position: relative; }
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--teal) 0%, var(--teal-2) 100%);
  border-radius: 999px;
  transition: width .4s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 0 8px rgba(0,130,144,.4);
}
.progress-lg { height: 14px; }
.progress-sm { height: 4px; }
.progress-bar-yellow { background: linear-gradient(90deg, var(--yellow) 0%, #ffd732 100%); box-shadow: 0 0 8px rgba(255,203,5,.4); }
.progress-bar-red { background: linear-gradient(90deg, var(--red) 0%, #ff6b8a 100%); box-shadow: 0 0 8px rgba(236,98,126,.4); }
.progress-bar-green { background: linear-gradient(90deg, var(--green) 0%, #00c570 100%); box-shadow: 0 0 8px rgba(0,168,94,.4); }
.progress-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 12px; }
.progress-label { color: var(--ink-2); font-weight: 600; }
.progress-value { color: var(--teal); font-weight: 700; }
.progress-indeterminate .progress-bar {
  width: 30%;
  animation: progressSlide 1.4s ease-in-out infinite;
  background: linear-gradient(90deg, transparent 0%, var(--teal) 50%, transparent 100%);
  box-shadow: none;
}
@keyframes progressSlide { 0% { transform: translateX(-100%); } 100% { transform: translateX(400%); } }
.progress-segmented { display: flex; gap: 4px; }
.progress-segment { flex: 1; height: 6px; background: var(--track-bg); border-radius: 999px; }
.progress-segment.done { background: linear-gradient(90deg, var(--teal) 0%, var(--teal-2) 100%); box-shadow: 0 0 6px rgba(0,130,144,.35); }
/* ── Wizard ── */
.wizard { display: flex; align-items: flex-start; gap: 0; width: 100%; }
.wizard-step { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; text-align: center; }
.wizard-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 18px;
  left: calc(50% + 22px);
  right: calc(-50% + 22px);
  height: 2px;
  background: var(--track-bg);
  z-index: 0;
}
.wizard-step.done::after { background: linear-gradient(90deg, var(--teal) 0%, var(--teal-2) 100%); }
.wizard-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--track-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  color: var(--ink-4);
  position: relative; z-index: 1;
  transition: all .2s;
}
.wizard-step.done .wizard-circle {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-2) 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0,130,144,.3);
}
.wizard-step.active .wizard-circle {
  background: #fff;
  border-color: var(--teal);
  color: var(--teal);
  box-shadow: 0 0 0 4px rgba(0,130,144,.12), 0 4px 12px rgba(0,130,144,.2);
}
.wizard-circle svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.wizard-label { margin-top: 10px; font-size: 12px; color: var(--ink-4); font-weight: 500; }
.wizard-step.done .wizard-label,
.wizard-step.active .wizard-label { color: var(--ink-2); font-weight: 600; }
.wizard-step.active .wizard-label { color: var(--teal); }
.wizard-sublabel { font-size: 10px; color: var(--ink-4); margin-top: 2px; }
.wizard-compact .wizard-circle { width: 24px; height: 24px; font-size: 11px; }
.wizard-compact .wizard-step:not(:last-child)::after { top: 12px; left: calc(50% + 16px); right: calc(-50% + 16px); }
.wizard-compact .wizard-label { font-size: 11px; margin-top: 6px; }

/* ── Dropdown / utility helpers (universal — not demo-only) ── */
.nav-item-disabled { opacity: .6; }
.dd-dot-teal { background: var(--teal); box-shadow: 0 0 6px var(--teal-glow); }
.dd-dot-green { background: var(--green); }
.dd-dot-red { background: var(--red); }
.account-icon-alt { background: linear-gradient(135deg,#ff6b8a,#f07e94); }
.dropdown-item-icon { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.dropdown-item-teal { color: var(--teal); }
.dropdown-item-danger { color: #ff6b8a; }
.hidden { display: none; }

/* ═══════════════════════════════════════════════════════════════
   KANBAN BOARD — tactical flow / pipeline
   ═══════════════════════════════════════════════════════════════ */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.kanban-board::-webkit-scrollbar { height: 8px; }
.kanban-board::-webkit-scrollbar-track { background: transparent; }
.kanban-board::-webkit-scrollbar-thumb { background: rgba(0,130,144,.2); border-radius: 4px; }
.kanban-board::-webkit-scrollbar-thumb:hover { background: rgba(0,130,144,.4); }

.kanban-col {
  flex: 0 0 300px;
  scroll-snap-align: start;
  background: var(--glass-white2);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-card);
  display: flex;
  flex-direction: column;
  max-height: 100%;
  position: relative;
  overflow: hidden;
}
.kanban-col::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 10%, var(--spec) 50%, transparent 90%);
  pointer-events: none;
  z-index: 2;
}
/* Column accent — colored top bar (clipped by parent's border-radius via overflow:hidden) */
.kanban-col-accent { height: 3px; flex-shrink: 0; }
.kanban-col-accent.accent-teal { background: var(--teal); box-shadow: 0 0 8px var(--teal-glow); }
.kanban-col-accent.accent-yellow { background: var(--yellow); box-shadow: 0 0 8px rgba(255,203,5,.4); }
.kanban-col-accent.accent-green { background: var(--green); box-shadow: 0 0 8px rgba(0,168,94,.4); }
.kanban-col-accent.accent-red { background: var(--red); box-shadow: 0 0 8px rgba(236,98,126,.4); }
.kanban-col-accent.accent-gray { background: var(--ink-4); }

.kanban-col-head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px 10px;
}
.kanban-col-title { font-size: 12.5px; font-weight: 900; color: var(--ink); text-transform: uppercase; letter-spacing: .5px; }
.kanban-col-count {
  font-size: 10px; font-weight: 900;
  background: var(--glass-teal); color: var(--teal);
  border: 1px solid rgba(0,180,204,.2);
  padding: 1px 7px;
  border-radius: var(--r-pill);
}
.kanban-col-head .row-action-btn { margin-left: auto; }

/* ── Stage actions row (quick actions per column, e.g. "Nuovo lead", "Import") ── */
.kanban-col-actions {
  display: flex; flex-wrap: wrap; gap: 5px;
  padding: 0 12px 10px;
  flex-shrink: 0;
}
.kanban-col-action-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 9px;
  background: var(--field-bg);
  border: 1px solid rgba(0,130,144,.12);
  border-radius: var(--r-sm);
  font-family: var(--ff);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-3);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.kanban-col-action-btn:hover {
  background: rgba(0,180,204,.08);
  border-color: var(--teal);
  color: var(--teal);
}
.kanban-col-action-btn svg {
  width: 11px; height: 11px;
  stroke: currentColor; fill: none;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}

.kanban-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 80px;
}
.kanban-col-body::-webkit-scrollbar { width: 4px; }
.kanban-col-body::-webkit-scrollbar-thumb { background: rgba(0,130,144,.15); border-radius: 2px; }

.kanban-add-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px;
  margin: 0 12px 12px;
  background: transparent;
  border: 1.5px dashed rgba(0,130,144,.2);
  border-radius: var(--r-md);
  color: var(--ink-4);
  font-family: var(--ff); font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: all .14s;
}
.kanban-add-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: rgba(0,130,144,.04);
}
.kanban-add-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Kanban card ── */
.kanban-card {
  background: #fff;
  border: 1px solid rgba(0,130,144,.08);
  border-radius: var(--r-md);
  padding: 12px 14px;
  cursor: grab;
  box-shadow: 0 2px 6px rgba(0,60,80,.04);
  transition: transform .14s, box-shadow .14s, border-color .14s;
  position: relative;
}
.kanban-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,60,80,.1);
  border-color: rgba(0,130,144,.18);
}
.kanban-card:active { cursor: grabbing; }
/* Left border accent (priority indicator) */
.kanban-card-priority-high { border-left: 3px solid var(--red); }
.kanban-card-priority-medium { border-left: 3px solid var(--yellow); }
.kanban-card-priority-low { border-left: 3px solid var(--green); }

.kanban-card-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.kanban-card-tag {
  font-size: 9.5px; font-weight: 900;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--glass-teal);
  color: var(--teal);
  border: 1px solid rgba(0,180,204,.2);
  text-transform: uppercase; letter-spacing: .3px;
}
.kanban-card-tag.tag-yellow { background: rgba(255,203,5,.12); color: var(--yellow-dark); border-color: rgba(255,203,5,.25); }
.kanban-card-tag.tag-red { background: rgba(236,98,126,.1); color: #b03550; border-color: rgba(236,98,126,.18); }
.kanban-card-tag.tag-green { background: rgba(0,168,94,.1); color: #007a43; border-color: rgba(0,168,94,.18); }
.kanban-card-tag.tag-purple { background: rgba(139,92,246,.1); color: #6d28d9; border-color: rgba(139,92,246,.2); }

.kanban-card-title { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.35; }
.kanban-card-desc { font-size: 11.5px; color: var(--ink-4); margin-top: 4px; line-height: 1.5; }

.kanban-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,130,144,.06);
}
.kanban-card-meta { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--ink-4); }
.kanban-card-meta-item { display: flex; align-items: center; gap: 4px; }
.kanban-card-meta-item svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kanban-card-meta-item.due-soon { color: var(--yellow-dark); font-weight: 600; }
.kanban-card-meta-item.due-overdue { color: var(--red); font-weight: 700; }

.kanban-card-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-2) 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 900;
  flex-shrink: 0;
  border: 1.5px solid #fff;
  box-shadow: 0 1px 3px rgba(0,60,80,.15);
}

/* Progress bar inside card */
.kanban-card-progress {
  margin-top: 10px;
  display: flex; align-items: center; gap: 8px;
}
.kanban-card-progress-bar {
  flex: 1; height: 4px;
  background: var(--track-bg);
  border-radius: 999px;
  overflow: hidden;
}
.kanban-card-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal) 0%, var(--teal-2) 100%);
  border-radius: 999px;
}
.kanban-card-progress-pct { font-size: 10px; font-weight: 700; color: var(--ink-3); flex-shrink: 0; }

/* ── Card actions (transfer, edit, archive, delete — top-right of card) ── */
.kanban-card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity .14s;
  pointer-events: none;
}
.kanban-card:hover .kanban-card-actions,
.kanban-card:focus-within .kanban-card-actions {
  opacity: 1;
  pointer-events: auto;
}
.kanban-card-action-btn {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(0,130,144,.12);
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink-3);
  transition: background .12s, color .12s, border-color .12s;
  box-shadow: 0 1px 3px rgba(0,60,80,.08);
}
.kanban-card-action-btn:hover {
  background: rgba(0,180,204,.1);
  border-color: var(--teal);
  color: var(--teal);
}
.kanban-card-action-btn.danger:hover {
  background: rgba(236,98,126,.1);
  border-color: var(--red);
  color: var(--red);
}
.kanban-card-action-btn svg {
  width: 12px; height: 12px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
/* Reserve right padding when actions overlay the title area */
.kanban-card-title { padding-right: 4px; }

/* Empty column state */
.kanban-empty {
  text-align: center;
  padding: 24px 16px;
  font-size: 11.5px;
  color: var(--ink-4);
  border: 1.5px dashed rgba(0,130,144,.12);
  border-radius: var(--r-md);
}

/* Mobile: stack cards larger and snap one column at a time */
@media (max-width: 599px) {
  .kanban-col { flex: 0 0 88%; }
  .kanban-board { gap: 12px; }
}

/* ═══════════════════════════════════════════════════════════════
   ERROR / EMPTY STATES (404, 403, 500, 503)
   ═══════════════════════════════════════════════════════════════ */

.error-frame {
  background: var(--glass-white2);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-card);
  padding: 60px 40px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
  gap: 18px;
  position: relative;
  overflow: hidden;
  min-height: 480px;
  justify-content: center;
}
.error-frame::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 10%, var(--spec) 50%, transparent 90%);
  pointer-events: none;
}
/* Decorative background blob — colored by tone */
.error-frame::after {
  content: '';
  position: absolute;
  width: 460px; height: 460px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .35;
  pointer-events: none;
  z-index: 0;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.error-frame.tone-info::after { background: radial-gradient(circle, rgba(0, 180, 204, .5) 0%, transparent 70%); }
.error-frame.tone-warning::after { background: radial-gradient(circle, rgba(255, 203, 5, .5) 0%, transparent 70%); }
.error-frame.tone-danger::after { background: radial-gradient(circle, rgba(236, 98, 126, .5) 0%, transparent 70%); }
.error-frame > * { position: relative; z-index: 1; }

/* Big icon + code combo */
.error-glyph {
  display: flex; align-items: center; gap: 20px;
}
.error-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, .4);
  background: rgba(255, 255, 255, .5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 60, 80, .12);
  flex-shrink: 0;
}
.error-icon svg { width: 36px; height: 36px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.error-icon.tone-info { color: var(--teal); }
.error-icon.tone-warning { color: var(--yellow-dark); }
.error-icon.tone-danger { color: #b03550; }
.error-code {
  font-size: 96px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -3px;
  color: var(--ink);
  font-family: var(--ff);
  text-shadow: 0 2px 16px rgba(0, 60, 80, .08);
}
.error-code.tone-info { background: linear-gradient(135deg, var(--teal) 0%, var(--teal-2) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.error-code.tone-warning { background: linear-gradient(135deg, var(--yellow-dark) 0%, var(--yellow) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.error-code.tone-danger { background: linear-gradient(135deg, #b03550 0%, var(--red) 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.error-title {
  font-size: 24px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -.5px;
  margin: 0;
}
.error-desc {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.55;
  max-width: 480px;
  margin: 0;
}
.error-actions {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  margin-top: 6px;
}
.error-meta {
  font-size: 11px;
  color: var(--ink-4);
  margin-top: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: rgba(255, 255, 255, .4);
  padding: 4px 10px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(0, 130, 144, .08);
}

/* Mobile */
@media (max-width: 599px) {
  .error-frame { padding: 40px 20px; min-height: 420px; }
  .error-glyph { flex-direction: column; gap: 12px; }
  .error-icon { width: 64px; height: 64px; }
  .error-icon svg { width: 28px; height: 28px; }
  .error-code { font-size: 72px; letter-spacing: -2px; }
  .error-title { font-size: 20px; }
  .error-desc { font-size: 13px; }
}

/* ═══════════════════════════════════════════════════════════════
   COMING SOON
   ═══════════════════════════════════════════════════════════════ */

.coming-frame {
  background: var(--glass-white2);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-card);
  padding: 56px 48px;
  text-align: center;
  display: flex; flex-direction: column; align-items: center;
  gap: 22px;
  position: relative;
  overflow: hidden;
  min-height: 600px;
  justify-content: center;
}
.coming-frame::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 10%, var(--spec) 50%, transparent 90%);
  pointer-events: none;
}
.coming-frame::after {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: .3;
  pointer-events: none;
  z-index: 0;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(0, 180, 204, .55) 0%, rgba(139, 92, 246, .35) 50%, transparent 75%);
}
.coming-frame > * { position: relative; z-index: 1; }

.coming-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, .55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 180, 204, .25);
  border-radius: var(--r-pill);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--teal);
}
.coming-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 10px var(--teal-glow);
  animation: coming-pulse 2s ease-in-out infinite;
}
@keyframes coming-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .5; transform: scale(.85); }
}

.coming-icon {
  width: 88px; height: 88px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, .5);
  background: linear-gradient(135deg, rgba(255, 255, 255, .7) 0%, rgba(255, 255, 255, .4) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 32px rgba(0, 60, 80, .15), inset 0 1px 0 rgba(255, 255, 255, .6);
  color: var(--teal);
}
.coming-icon svg { width: 40px; height: 40px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.coming-title {
  font-size: 32px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -.8px;
  margin: 0;
  background: linear-gradient(135deg, var(--ink) 0%, var(--teal) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.coming-desc {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.6;
  max-width: 520px;
  margin: 0;
}

/* Countdown timer */
.countdown {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.countdown-block {
  background: rgba(255, 255, 255, .55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: var(--r-md);
  padding: 14px 18px;
  min-width: 72px;
  box-shadow: 0 4px 14px rgba(0, 60, 80, .08), inset 0 1px 0 rgba(255, 255, 255, .8);
}
.countdown-num {
  font-size: 30px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.countdown-label {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--ink-4);
  margin-top: 6px;
}

/* Roadmap inline list (done / wip / planned) */
.coming-roadmap {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 4px;
  padding: 18px 22px;
  background: rgba(255, 255, 255, .4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: var(--r-md);
  max-width: 440px;
  width: 100%;
  text-align: left;
}
.coming-roadmap-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.coming-roadmap-icon {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border: 1.5px solid;
}
.coming-roadmap-icon svg { width: 10px; height: 10px; stroke: currentColor; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.coming-roadmap-item.done .coming-roadmap-icon { background: rgba(0, 168, 94, .15); border-color: rgba(0, 168, 94, .4); color: #007a43; }
.coming-roadmap-item.done { color: var(--ink); font-weight: 600; }
.coming-roadmap-item.wip .coming-roadmap-icon { background: rgba(0, 180, 204, .15); border-color: rgba(0, 180, 204, .45); color: var(--teal); }
.coming-roadmap-item.wip { color: var(--ink); font-weight: 700; }
.coming-roadmap-item.wip .coming-roadmap-icon::after {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 6px var(--teal-glow);
  animation: coming-pulse 2s ease-in-out infinite;
}
.coming-roadmap-item.wip .coming-roadmap-icon svg { display: none; }
.coming-roadmap-item.next .coming-roadmap-icon { background: rgba(0, 130, 144, .04); border-color: rgba(0, 130, 144, .15); color: var(--ink-4); }
.coming-roadmap-item.next .coming-roadmap-icon svg { display: none; }

/* Notify me form */
.coming-notify {
  display: flex; gap: 8px; align-items: stretch;
  width: 100%; max-width: 440px;
  margin-top: 4px;
}
.coming-notify-field {
  flex: 1;
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  background: rgba(255, 255, 255, .65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: var(--r-md);
  transition: border-color .12s, box-shadow .12s;
}
.coming-notify-field:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 180, 204, .12);
}
.coming-notify-field svg { width: 14px; height: 14px; stroke: var(--ink-4); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.coming-notify-field input {
  flex: 1; min-width: 0;
  border: none; outline: none; background: none;
  padding: 11px 0;
  font-family: var(--ff);
  font-size: 13px;
  color: var(--ink);
}
.coming-notify-field input::placeholder { color: var(--ink-4); }

/* Mobile */
@media (max-width: 599px) {
  .coming-frame { padding: 40px 22px; min-height: 540px; gap: 16px; }
  .coming-icon { width: 72px; height: 72px; }
  .coming-icon svg { width: 32px; height: 32px; }
  .coming-title { font-size: 24px; }
  .coming-desc { font-size: 13px; }
  .countdown { gap: 6px; }
  .countdown-block { padding: 10px 12px; min-width: 60px; }
  .countdown-num { font-size: 24px; }
  .coming-notify { flex-direction: column; }
}

/* ═══════════════════════════════════════════════════════════════
   ONBOARDING WIZARD (full-screen takeover)
   ═══════════════════════════════════════════════════════════════ */

.onboarding-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.onboarding-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px;
  flex-shrink: 0;
}
.onboarding-topbar-left {
  display: flex; align-items: center; gap: 14px;
}
.onboarding-topbar-logo {
  display: flex; align-items: center; gap: 10px;
}
.onboarding-topbar-logo svg { width: 30px; height: auto; }
.onboarding-topbar-logo-text {
  font-weight: 900; font-size: 14px;
  letter-spacing: -.3px;
}
.onboarding-topbar-logo-text .lf { color: var(--ink); }
.onboarding-topbar-logo-text .lm { color: var(--teal); }
.onboarding-topbar-counter {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-4);
  padding: 5px 12px;
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: var(--r-pill);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.onboarding-topbar-counter strong { color: var(--teal); font-weight: 900; }
.onboarding-topbar-exit {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-4);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  transition: background .12s, color .12s;
}
.onboarding-topbar-exit:hover { background: rgba(255, 255, 255, .5); color: var(--ink); }

.onboarding-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 32px 40px;
}

.onboarding-card {
  width: 100%;
  max-width: 720px;
  background: var(--glass-white2);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--r-xl);
  box-shadow: 0 30px 80px rgba(0, 60, 80, .12), 0 8px 24px rgba(0, 60, 80, .06);
  position: relative;
  overflow: hidden;
}
.onboarding-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 10%, var(--spec) 50%, transparent 90%);
  pointer-events: none;
}

.onboarding-wizard-wrap {
  padding: 28px 40px 16px;
  border-bottom: 1px solid rgba(0, 130, 144, .06);
}

.onboarding-step {
  padding: 36px 40px 32px;
  text-align: center;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.onboarding-step.active { display: flex; }

.onboarding-step-icon {
  width: 72px; height: 72px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, .5);
  background: linear-gradient(135deg, rgba(0, 180, 204, .15) 0%, rgba(0, 130, 144, .08) 100%);
  color: var(--teal);
  margin-bottom: 4px;
  box-shadow: 0 8px 24px rgba(0, 130, 144, .15), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.onboarding-step-icon svg { width: 32px; height: 32px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.onboarding-step-icon.tone-success {
  background: linear-gradient(135deg, rgba(0, 168, 94, .2) 0%, rgba(0, 168, 94, .08) 100%);
  color: #007a43;
}

.onboarding-step-title {
  font-size: 24px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: -.5px;
  margin: 0;
}
.onboarding-step-desc {
  font-size: 13.5px;
  color: var(--ink-3);
  line-height: 1.6;
  max-width: 480px;
  margin: 0;
}
.onboarding-step-body {
  width: 100%;
  margin-top: 12px;
  text-align: left;
}

/* Choice grid (workspace type selection) */
.onboarding-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.onboarding-choice-card {
  background: rgba(255, 255, 255, .55);
  border: 1.5px solid rgba(255, 255, 255, .5);
  border-radius: var(--r-md);
  padding: 18px 16px;
  cursor: pointer;
  text-align: left;
  font-family: var(--ff);
  display: flex; align-items: flex-start; gap: 12px;
  transition: background .14s, border-color .14s, transform .14s;
}
.onboarding-choice-card:hover {
  background: rgba(0, 180, 204, .06);
  border-color: rgba(0, 180, 204, .3);
  transform: translateY(-1px);
}
.onboarding-choice-card.selected {
  background: rgba(0, 180, 204, .1);
  border-color: var(--teal);
  box-shadow: 0 4px 14px rgba(0, 180, 204, .15);
}
.onboarding-choice-icon {
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  background: rgba(0, 180, 204, .12);
  color: var(--teal);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.onboarding-choice-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.onboarding-choice-card.selected .onboarding-choice-icon { background: var(--teal); color: #fff; }
.onboarding-choice-text { flex: 1; min-width: 0; }
.onboarding-choice-title { font-size: 13px; font-weight: 800; color: var(--ink); margin: 0; }
.onboarding-choice-desc { font-size: 11.5px; color: var(--ink-4); margin-top: 3px; line-height: 1.4; }

/* Integration grid (connect services) */
.onboarding-integration-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.onboarding-integration-card {
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: var(--r-md);
  padding: 14px;
  display: flex; align-items: center; gap: 12px;
  font-family: var(--ff);
}
.onboarding-integration-logo {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 900;
  color: #fff;
  flex-shrink: 0;
}
.onboarding-integration-logo.logo-meta { background: linear-gradient(135deg, #1877f2 0%, #6750e8 100%); }
.onboarding-integration-logo.logo-google { background: linear-gradient(135deg, #ea4335 0%, #fbbc04 50%, #34a853 100%); }
.onboarding-integration-logo.logo-stripe { background: linear-gradient(135deg, #635bff 0%, #4f46e5 100%); }
.onboarding-integration-logo.logo-mailchimp { background: linear-gradient(135deg, #ffe01b 0%, #ffb500 100%); color: #241c15; }
.onboarding-integration-text { flex: 1; min-width: 0; }
.onboarding-integration-name { font-size: 12.5px; font-weight: 800; color: var(--ink); }
.onboarding-integration-desc { font-size: 10.5px; color: var(--ink-4); margin-top: 1px; }
.onboarding-integration-btn {
  font-size: 10.5px;
  font-weight: 700;
  padding: 5px 11px;
  border: 1px solid rgba(0, 130, 144, .2);
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .6);
  color: var(--teal);
  cursor: pointer;
  font-family: var(--ff);
  transition: background .12s, border-color .12s, color .12s;
  flex-shrink: 0;
}
.onboarding-integration-btn:hover { background: rgba(0, 180, 204, .12); border-color: var(--teal); }
.onboarding-integration-btn.connected {
  background: rgba(0, 168, 94, .12);
  border-color: rgba(0, 168, 94, .3);
  color: #007a43;
  display: inline-flex; align-items: center; gap: 4px;
}
.onboarding-integration-btn.connected svg { width: 10px; height: 10px; stroke: currentColor; fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

/* Footer actions */
.onboarding-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 18px 40px 24px;
  border-top: 1px solid rgba(0, 130, 144, .06);
  background: rgba(255, 255, 255, .25);
}
.onboarding-actions-skip {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-4);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 8px 4px;
  font-family: var(--ff);
}
.onboarding-actions-skip:hover { color: var(--ink-2); }
.onboarding-actions-buttons { display: flex; gap: 8px; }
.onboarding-actions .is-hidden { visibility: hidden; }

/* Mobile */
@media (max-width: 599px) {
  .onboarding-topbar { padding: 14px 18px; }
  .onboarding-content { padding: 12px 16px 24px; }
  .onboarding-wizard-wrap { padding: 20px 22px 14px; }
  .onboarding-step { padding: 24px 22px 26px; }
  .onboarding-step-title { font-size: 20px; }
  .onboarding-step-desc { font-size: 12.5px; }
  .onboarding-choice-grid,
  .onboarding-integration-grid { grid-template-columns: 1fr; }
  .onboarding-actions { padding: 14px 22px 18px; }
}

/* ═══════════════════════════════════════════════════════════════
   CHAT / THREAD (AI agent conversations)
   ═══════════════════════════════════════════════════════════════ */

.chat-grid {
  display: grid;
  grid-template-columns: 300px 1fr 290px;
  gap: 16px;
  flex: 1;
  min-height: 0;
}

/* ── Conversations sidebar (left) ── */
.chat-sidebar {
  background: var(--glass-white2);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-card);
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
  min-height: 0;
}
.chat-sidebar::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 10%, var(--spec) 50%, transparent 90%);
  pointer-events: none;
  z-index: 2;
}
.chat-sidebar-head {
  padding: 16px 16px 12px;
  display: flex; flex-direction: column; gap: 10px;
  flex-shrink: 0;
}
.chat-sidebar-title-row {
  display: flex; align-items: center; justify-content: space-between;
}
.chat-sidebar-title { font-size: 13px; font-weight: 900; color: var(--ink); text-transform: uppercase; letter-spacing: .5px; }
.chat-sidebar-search { min-width: 0; width: 100%; }
.chat-conv-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 8px 12px;
  display: flex; flex-direction: column;
  gap: 2px;
}
.chat-conv-list::-webkit-scrollbar { width: 4px; }
.chat-conv-list::-webkit-scrollbar-thumb { background: rgba(0, 130, 144, .15); border-radius: 2px; }
.chat-conv-item {
  display: flex; gap: 10px;
  padding: 10px 10px;
  border-radius: var(--r-md);
  cursor: pointer;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--ff);
  position: relative;
  transition: background .12s;
  align-items: flex-start;
}
.chat-conv-item:hover { background: rgba(0, 180, 204, .06); }
.chat-conv-item.active { background: rgba(0, 180, 204, .12); }
.chat-conv-item.active::before {
  content: '';
  position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--teal);
  box-shadow: 0 0 8px var(--teal-glow);
}
.chat-conv-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-2) 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900;
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, .6);
  box-shadow: 0 2px 6px rgba(0, 60, 80, .12);
  position: relative;
}
.chat-conv-status {
  position: absolute;
  bottom: -1px; right: -1px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid #fff;
  box-shadow: 0 0 6px rgba(0, 168, 94, .5);
}
.chat-conv-text { flex: 1; min-width: 0; }
.chat-conv-name-row { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.chat-conv-name { font-size: 12.5px; font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-conv-time { font-size: 10px; color: var(--ink-4); flex-shrink: 0; font-weight: 600; }
.chat-conv-preview {
  font-size: 11.5px;
  color: var(--ink-4);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.chat-conv-item.unread .chat-conv-preview { color: var(--ink-2); font-weight: 600; }
.chat-conv-item.unread .chat-conv-time { color: var(--teal); font-weight: 800; }
.chat-conv-unread {
  display: inline-block;
  min-width: 16px; height: 16px;
  padding: 0 5px;
  background: var(--teal);
  color: #fff;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 900;
  text-align: center;
  line-height: 16px;
  margin-left: 6px;
  box-shadow: 0 2px 6px rgba(0, 180, 204, .35);
  flex-shrink: 0;
  align-self: center;
}

/* ── Chat thread (right main) ── */
.chat-thread {
  background: var(--glass-white2);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-card);
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
}
.chat-thread::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 10%, var(--spec) 50%, transparent 90%);
  pointer-events: none;
  z-index: 2;
}
.chat-thread-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(0, 130, 144, .06);
  flex-shrink: 0;
}
.chat-thread-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-2) 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 900;
  border: 1.5px solid rgba(255, 255, 255, .6);
  box-shadow: 0 2px 8px rgba(0, 60, 80, .15);
  flex-shrink: 0;
  position: relative;
}
.chat-thread-info { flex: 1; min-width: 0; }
.chat-thread-title { font-size: 14px; font-weight: 900; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chat-thread-status { font-size: 11px; color: var(--ink-4); margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.chat-thread-status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px rgba(0, 168, 94, .5);
}
.chat-thread-actions { display: flex; gap: 6px; }
.chat-thread-action-btn {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .4);
  border: 1px solid rgba(0, 130, 144, .08);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--ink-3);
  transition: background .12s, color .12s, border-color .12s;
}
.chat-thread-action-btn:hover { background: rgba(0, 180, 204, .08); border-color: var(--teal); color: var(--teal); }
.chat-thread-action-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── Messages body ── */
.chat-thread-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
  display: flex; flex-direction: column;
  gap: 16px;
}
.chat-thread-body::-webkit-scrollbar { width: 5px; }
.chat-thread-body::-webkit-scrollbar-thumb { background: rgba(0, 130, 144, .18); border-radius: 3px; }

.chat-day-sep {
  display: flex; align-items: center; gap: 12px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--ink-4);
  margin: 4px 0;
}
.chat-day-sep::before, .chat-day-sep::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 130, 144, .15), transparent);
}

.chat-msg {
  display: flex; gap: 10px;
  max-width: 78%;
}
.chat-msg.outgoing { align-self: flex-end; flex-direction: row-reverse; }
.chat-msg.incoming { align-self: flex-start; }

.chat-msg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-2) 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900;
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, .6);
  box-shadow: 0 2px 6px rgba(0, 60, 80, .12);
}

.chat-msg-content {
  display: flex; flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.chat-msg.outgoing .chat-msg-content { align-items: flex-end; }

.chat-msg-bubble {
  padding: 11px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  background: rgba(255, 255, 255, .65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .5);
  box-shadow: 0 2px 8px rgba(0, 60, 80, .05);
  word-wrap: break-word;
}
.chat-msg.incoming .chat-msg-bubble { border-top-left-radius: var(--r-sm); }
.chat-msg.outgoing .chat-msg-bubble {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-2) 100%);
  color: #fff;
  border-color: rgba(255, 255, 255, .25);
  box-shadow: 0 4px 14px rgba(0, 180, 204, .25);
  border-top-right-radius: var(--r-sm);
}
.chat-msg.outgoing .chat-msg-bubble strong { color: #fff; }
.chat-msg-bubble p { margin: 0 0 8px; }
.chat-msg-bubble p:last-child { margin: 0; }
.chat-msg-bubble strong { color: var(--ink); font-weight: 700; }
.chat-msg-bubble ul {
  margin: 6px 0;
  padding-left: 20px;
}
.chat-msg-bubble li { margin: 3px 0; }
.chat-msg-bubble code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: rgba(0, 130, 144, .08);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--teal);
}
.chat-msg.outgoing .chat-msg-bubble code {
  background: rgba(255, 255, 255, .2);
  color: #fff;
}
.chat-msg-bubble pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  background: rgba(6, 43, 49, .92);
  color: #d4f0f5;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  margin: 8px 0 4px;
  overflow-x: auto;
  line-height: 1.5;
}
.chat-msg-bubble pre::-webkit-scrollbar { height: 4px; }
.chat-msg-bubble pre::-webkit-scrollbar-thumb { background: rgba(212, 240, 245, .25); border-radius: 2px; }
.chat-msg-bubble a { color: var(--teal); text-decoration: none; font-weight: 600; border-bottom: 1px dashed rgba(0, 180, 204, .4); }
.chat-msg.outgoing .chat-msg-bubble a { color: #fff; border-bottom-color: rgba(255, 255, 255, .5); }
/* Message sender label (e.g. "Aurora · AI") above the bubble for outgoing AI messages */
.chat-msg-sender {
  font-size: 10px;
  font-weight: 800;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 0 6px;
  display: flex; align-items: center; gap: 4px;
}
.chat-msg-sender svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.chat-msg-meta {
  font-size: 10px;
  color: var(--ink-4);
  display: flex; align-items: center; gap: 5px;
  padding: 0 6px;
}
.chat-msg-meta svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chat-msg-meta.read { color: var(--teal); }

/* Quick actions / suggestion chips inside agent message */
.chat-quick-actions {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 8px;
}
.chat-quick-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, .8);
  border: 1px solid rgba(0, 130, 144, .18);
  border-radius: var(--r-pill);
  font-family: var(--ff);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--teal);
  cursor: pointer;
  transition: background .12s, border-color .12s, transform .12s;
}
.chat-quick-btn:hover {
  background: rgba(0, 180, 204, .1);
  border-color: var(--teal);
  transform: translateY(-1px);
}
.chat-quick-btn svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* Typing indicator */
.chat-typing {
  display: flex; align-items: center; gap: 4px;
  padding: 13px 16px;
  background: rgba(255, 255, 255, .65);
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: var(--r-md);
  border-top-left-radius: var(--r-sm);
  width: fit-content;
}
.chat-typing-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--teal);
  animation: chat-typing-bounce 1.4s ease-in-out infinite;
}
.chat-typing-dot:nth-child(2) { animation-delay: .15s; }
.chat-typing-dot:nth-child(3) { animation-delay: .3s; }
@keyframes chat-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* ── Composer (input area) ── */
.chat-composer {
  border-top: 1px solid rgba(0, 130, 144, .08);
  padding: 14px 18px 16px;
  background: rgba(255, 255, 255, .3);
  flex-shrink: 0;
}
.chat-composer-field {
  display: flex; align-items: flex-end; gap: 8px;
  background: rgba(255, 255, 255, .8);
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: var(--r-md);
  padding: 8px 8px 8px 14px;
  transition: border-color .12s, box-shadow .12s;
}
.chat-composer-field:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0, 180, 204, .12);
}
.chat-composer-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: none;
  resize: none;
  font-family: var(--ff);
  font-size: 13px;
  color: var(--ink);
  line-height: 1.5;
  padding: 6px 0;
  max-height: 120px;
  /* Modern textarea auto-grow without JS — Chrome 123+, Safari 17.4+ */
  field-sizing: content;
}
.chat-composer-input::placeholder { color: var(--ink-4); }
.chat-composer-actions { display: flex; gap: 4px; align-items: center; }
.chat-composer-icon-btn {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  background: none;
  border: none;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--ink-4);
  transition: background .12s, color .12s;
}
.chat-composer-icon-btn:hover { background: rgba(0, 180, 204, .1); color: var(--teal); }
.chat-composer-icon-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chat-composer-send {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-2) 100%);
  border: none;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 180, 204, .35);
  transition: transform .12s, box-shadow .12s;
}
.chat-composer-send:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0, 180, 204, .5); }
.chat-composer-send svg { width: 16px; height: 16px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chat-composer-hint {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10.5px;
  color: var(--ink-4);
  margin-top: 8px;
  padding: 0 4px;
}
.chat-composer-hint kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
  background: rgba(255, 255, 255, .65);
  border: 1px solid rgba(0, 130, 144, .12);
  border-bottom-width: 1.5px;
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--ink-3);
}

/* ── Channel badge (WA / Web / Email / Instagram) ── */
.chat-channel {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .4px;
  border: 1px solid;
  flex-shrink: 0;
}
.chat-channel svg {
  width: 9px; height: 9px;
  stroke: currentColor; fill: none;
  stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
}
.chat-channel.ch-wa { background: rgba(37, 211, 102, .12); color: #0c8c43; border-color: rgba(37, 211, 102, .35); }
.chat-channel.ch-web { background: rgba(0, 180, 204, .12); color: var(--teal); border-color: rgba(0, 180, 204, .35); }
.chat-channel.ch-email { background: rgba(139, 92, 246, .12); color: #6d28d9; border-color: rgba(139, 92, 246, .35); }
.chat-channel.ch-ig { background: rgba(244, 114, 182, .12); color: #be185d; border-color: rgba(244, 114, 182, .35); }
.chat-channel.ch-msg { background: rgba(0, 132, 255, .12); color: #0064cc; border-color: rgba(0, 132, 255, .35); }

/* Channel pill larger variant for thread header */
.chat-channel.ch-lg {
  padding: 4px 10px;
  font-size: 10px;
}
.chat-channel.ch-lg svg { width: 11px; height: 11px; }

/* ── Conversation item channel placement ── */
.chat-conv-channel-row {
  display: flex; align-items: center; gap: 6px;
  margin-top: 4px;
}
.chat-conv-handler {
  font-size: 10px;
  color: var(--ink-4);
  font-weight: 600;
}

/* ── CRM panel (right side) ── */
.chat-crm-panel {
  background: var(--glass-white2);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-card);
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
}
.chat-crm-panel::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 10%, var(--spec) 50%, transparent 90%);
  pointer-events: none;
  z-index: 2;
}
.chat-crm-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0 8px;
}
.chat-crm-scroll::-webkit-scrollbar { width: 4px; }
.chat-crm-scroll::-webkit-scrollbar-thumb { background: rgba(0, 130, 144, .15); border-radius: 2px; }

.chat-crm-head {
  padding: 22px 18px 16px;
  text-align: center;
  border-bottom: 1px solid rgba(0, 130, 144, .06);
}
.chat-crm-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-2) 100%);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 900;
  border: 2px solid rgba(255, 255, 255, .7);
  box-shadow: 0 6px 18px rgba(0, 60, 80, .15);
  margin-bottom: 12px;
}
.chat-crm-name { font-size: 14px; font-weight: 900; color: var(--ink); }
.chat-crm-sub { font-size: 11.5px; color: var(--ink-4); margin-top: 3px; }

.chat-crm-score-row {
  display: flex; gap: 6px; justify-content: center;
  margin-top: 12px;
}
.chat-crm-score {
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(255, 255, 255, .5);
  min-width: 60px;
}
.chat-crm-score-num {
  font-size: 18px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1;
}
.chat-crm-score-num.tone-grade-a { color: #007a43; }
.chat-crm-score-label {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--ink-4);
  margin-top: 4px;
}

.chat-crm-section {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(0, 130, 144, .06);
}
.chat-crm-section:last-child { border-bottom: none; }
.chat-crm-section-title {
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--ink-4);
  margin-bottom: 10px;
}

.chat-crm-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
  font-size: 11.5px;
}
.chat-crm-row:last-child { margin-bottom: 0; }
.chat-crm-row-icon {
  width: 26px; height: 26px;
  border-radius: var(--r-sm);
  background: rgba(0, 180, 204, .08);
  color: var(--teal);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.chat-crm-row-icon svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chat-crm-row-text { flex: 1; min-width: 0; }
.chat-crm-row-label { font-size: 9.5px; color: var(--ink-4); font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.chat-crm-row-value {
  font-size: 11.5px;
  color: var(--ink);
  font-weight: 600;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-crm-row-value.link { color: var(--teal); }

.chat-crm-tags { display: flex; flex-wrap: wrap; gap: 4px; }

.chat-crm-activity {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 11px;
  color: var(--ink-3);
  padding: 6px 0;
}
.chat-crm-activity-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--teal);
  flex-shrink: 0;
  margin-top: 5px;
}
.chat-crm-activity-text { flex: 1; min-width: 0; line-height: 1.45; }
.chat-crm-activity-time { font-size: 10px; color: var(--ink-4); margin-top: 1px; }

.chat-crm-actions {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(0, 130, 144, .06);
}
.chat-crm-action-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(0, 130, 144, .12);
  border-radius: var(--r-sm);
  font-family: var(--ff);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  text-align: left;
}
.chat-crm-action-btn:hover { background: rgba(0, 180, 204, .08); border-color: var(--teal); color: var(--teal); }
.chat-crm-action-btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* Tablet: hide CRM panel, narrower sidebar */
@media (max-width: 1199px) {
  .chat-grid { grid-template-columns: 280px 1fr; }
  .chat-crm-panel { display: none; }
}
@media (max-width: 991px) {
  .chat-grid { grid-template-columns: 240px 1fr; }
  .chat-msg { max-width: 88%; }
}

/* Mobile: single column, sidebar hidden by default */
@media (max-width: 599px) {
  .chat-grid { grid-template-columns: 1fr; }
  .chat-sidebar { display: none; }
  .chat-thread-head { padding: 14px 16px; }
  .chat-thread-body { padding: 16px; gap: 12px; }
  .chat-msg { max-width: 92%; }
  .chat-composer { padding: 12px 14px 14px; }
}

/* ═══════════════════════════════════════════════════════════════
   FULLSCREEN EDITOR (T08)
   ═══════════════════════════════════════════════════════════════ */

.editor-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Top bar ── */
.editor-topbar {
  display: flex; align-items: center;
  gap: 14px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, .55);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border-bottom: 1px solid rgba(0, 130, 144, .08);
  flex-shrink: 0;
}
.editor-topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.editor-topbar-center { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: center; }
.editor-topbar-right { display: flex; align-items: center; gap: 8px; }
.editor-exit-btn {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--field-bg);
  border: 1px solid rgba(0, 130, 144, .1);
  border-radius: var(--r-sm);
  color: var(--ink-3);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .12s, color .12s, border-color .12s;
}
.editor-exit-btn:hover { background: rgba(0, 180, 204, .08); border-color: var(--teal); color: var(--teal); }
.editor-exit-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.editor-doc-info { display: flex; flex-direction: column; min-width: 0; }
.editor-doc-name { font-size: 13px; font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.editor-doc-meta { font-size: 10.5px; color: var(--ink-4); display: flex; align-items: center; gap: 6px; }
.editor-doc-meta-sep { opacity: .5; }
.editor-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px;
  font-weight: 700;
  color: #007a43;
  padding: 3px 9px;
  background: rgba(0, 168, 94, .1);
  border: 1px solid rgba(0, 168, 94, .25);
  border-radius: var(--r-pill);
}
.editor-status svg { width: 10px; height: 10px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.editor-status.saving {
  color: var(--yellow-dark);
  background: rgba(255, 203, 5, .1);
  border-color: rgba(255, 203, 5, .3);
}
.editor-history-group {
  display: flex; gap: 2px;
  background: var(--field-bg);
  padding: 3px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(0, 130, 144, .1);
}
.editor-history-btn {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--ink-3);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.editor-history-btn:hover:not(:disabled) { background: rgba(0, 180, 204, .12); color: var(--teal); }
.editor-history-btn:disabled { opacity: .4; cursor: not-allowed; }
.editor-history-btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.editor-device-toggle {
  display: flex; gap: 2px;
  background: var(--field-bg);
  padding: 3px;
  border-radius: var(--r-sm);
  border: 1px solid rgba(0, 130, 144, .1);
}
.editor-device-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 26px;
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--ink-4);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.editor-device-btn:hover { color: var(--ink-2); }
.editor-device-btn.active { background: #fff; color: var(--teal); box-shadow: 0 1px 3px rgba(0, 60, 80, .12); }
.editor-device-btn svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.editor-zoom {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  padding: 5px 10px;
  background: var(--field-bg);
  border: 1px solid rgba(0, 130, 144, .1);
  border-radius: var(--r-sm);
}

/* ── Main grid (palette + canvas + properties) ── */
.editor-grid {
  display: grid;
  grid-template-columns: 290px 1fr 280px;
  grid-template-rows: minmax(0, 1fr); /* required: bounds the row to available height so items can scroll */
  flex: 1;
  min-height: 0;
  gap: 0;
}

/* ── Left dock (tabbed library) ── */
.editor-palette {
  background: rgba(255, 255, 255, .35);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(0, 130, 144, .08);
  display: flex; flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* Tabs row at the top of the dock */
.editor-palette-tabs {
  display: flex;
  flex-shrink: 0;
  background: rgba(255, 255, 255, .25);
  border-bottom: 1px solid rgba(0, 130, 144, .08);
}
.editor-palette-tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px 8px;
  background: none;
  border: none;
  font-family: var(--ff);
  font-size: 9.5px;
  font-weight: 800;
  color: var(--ink-4);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .12s, border-color .12s, background .12s;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.editor-palette-tab:hover { color: var(--ink-2); background: rgba(0, 180, 204, .04); }
.editor-palette-tab.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
  background: rgba(255, 255, 255, .4);
}
.editor-palette-tab svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* Tab panel containers */
.editor-palette-panel {
  display: none;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.editor-palette-panel.active { display: flex; flex-direction: column; }
.editor-palette-panel::-webkit-scrollbar { width: 4px; }
.editor-palette-panel::-webkit-scrollbar-thumb { background: rgba(0, 130, 144, .15); border-radius: 2px; }

/* Panel sub-section (used inside Elementi tab) */
.editor-palette-section {
  padding: 12px;
}
.editor-palette-section + .editor-palette-section {
  border-top: 1px solid rgba(0, 130, 144, .06);
}
.editor-palette-section-title {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--ink-4);
  padding: 0 4px 8px;
}
.editor-palette-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.editor-palette-block {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: var(--r-sm);
  cursor: grab;
  font-family: var(--ff);
  transition: background .12s, border-color .12s, transform .12s;
}
.editor-palette-block:hover {
  background: rgba(0, 180, 204, .08);
  border-color: rgba(0, 180, 204, .3);
  transform: translateY(-1px);
}
.editor-palette-block:active { cursor: grabbing; }

/* ── Palette block states during drag ── */
.editor-palette-block.is-dragging {
  opacity: .35;
  outline: 2px dashed var(--teal);
  outline-offset: -2px;
  transform: scale(.94);
  pointer-events: none;
}
.editor-palette-block.drag-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  opacity: .9;
  box-shadow: 0 12px 32px rgba(0, 60, 80, .2), 0 4px 12px rgba(0, 180, 204, .25);
  transform: rotate(-2deg) scale(1.04);
  border-color: var(--teal);
  background: rgba(255, 255, 255, .95);
}
.editor-palette-block svg {
  width: 18px; height: 18px;
  stroke: var(--teal);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.editor-palette-block-name {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-2);
}

/* ── BLOCCHI tab — visual block gallery (mini-rendered previews) ── */
.editor-block-gallery {
  display: flex; flex-direction: column;
  gap: 10px;
  padding: 12px;
}
.editor-gallery-group-title {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--ink-4);
  margin: 4px 4px 0;
}
.editor-block-preview {
  background: #fff;
  border: 1px solid rgba(0, 130, 144, .12);
  border-radius: 6px;
  cursor: grab;
  overflow: hidden;
  transition: border-color .12s, transform .12s, box-shadow .12s;
  position: relative;
}
.editor-block-preview:hover {
  border-color: var(--teal);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 180, 204, .15);
}
.editor-block-preview:active { cursor: grabbing; }
.editor-block-preview-thumb {
  height: 80px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--ff);
  position: relative;
}
.editor-block-preview-label {
  padding: 6px 10px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-2);
  border-top: 1px solid rgba(0, 130, 144, .08);
  background: rgba(0, 130, 144, .03);
  display: flex; align-items: center; justify-content: space-between;
}
.editor-block-preview-label .preview-cat {
  font-size: 9px;
  font-weight: 600;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: .3px;
}

/* Mini-renderings of block types (visual hints, not full email blocks) */
.preview-hero {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-2) 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff;
  gap: 4px;
}
.preview-hero-title { font-size: 11px; font-weight: 900; }
.preview-hero-btn {
  font-size: 8px; font-weight: 800;
  padding: 3px 9px;
  background: rgba(255, 255, 255, .25);
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 3px;
}
.preview-pricing {
  width: 100%; height: 100%;
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  gap: 3px; padding: 6px;
  background: #fafbfc;
}
.preview-pricing-col {
  background: #fff;
  border: 1px solid rgba(0, 130, 144, .15);
  border-radius: 3px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 800;
  color: var(--ink-3);
}
.preview-pricing-col.featured { background: var(--teal); color: #fff; border-color: var(--teal); }
.preview-testimonial {
  width: 100%; height: 100%;
  background: #fff;
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
}
.preview-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-2) 100%);
  flex-shrink: 0;
}
.preview-testimonial-text {
  font-size: 8px;
  color: var(--ink-3);
  line-height: 1.4;
}
.preview-testimonial-text strong { display: block; color: var(--ink); font-weight: 800; font-size: 9px; margin-top: 1px; }
.preview-cta {
  width: 100%; height: 100%;
  background: #f4f9fa;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
}
.preview-cta-line {
  width: 60%; height: 4px;
  background: var(--ink-4);
  border-radius: 2px;
  opacity: .3;
}
.preview-cta-btn {
  font-size: 8px; font-weight: 800;
  padding: 4px 12px;
  background: var(--teal);
  color: #fff;
  border-radius: 3px;
}
.preview-features {
  width: 100%; height: 100%;
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4px; padding: 8px;
  background: #fff;
}
.preview-features-cell {
  display: flex; flex-direction: column; gap: 2px;
}
.preview-features-icon {
  width: 14px; height: 14px;
  border-radius: 3px;
  background: rgba(0, 180, 204, .15);
}
.preview-features-line {
  width: 80%; height: 3px;
  background: var(--ink-4);
  opacity: .3;
  border-radius: 2px;
}
.preview-footer {
  width: 100%; height: 100%;
  background: #f0f0f0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  color: #888;
  font-size: 8px;
}
.preview-footer-social {
  display: flex; gap: 4px;
}
.preview-footer-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #c0c0c0;
}

/* ── IMMAGINI tabs (tenant + pexels) — image grids ── */
.editor-img-search {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(0, 130, 144, .08);
  flex-shrink: 0;
}
.editor-img-search .search-box { min-width: 0; width: 100%; padding: 6px 11px; }
.editor-img-search .search-box input { font-size: 12px; }
.editor-img-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 12px;
}
.editor-img-thumb {
  aspect-ratio: 1;
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  border: 1px solid rgba(0, 130, 144, .08);
  transition: border-color .12s, transform .12s;
}
.editor-img-thumb:hover {
  border-color: var(--teal);
  transform: translateY(-1px);
}
.editor-img-thumb::after {
  content: '+';
  position: absolute; inset: 0;
  background: rgba(0, 180, 204, .75);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 22px;
  font-weight: 300;
  opacity: 0;
  transition: opacity .12s;
}
.editor-img-thumb:hover::after { opacity: 1; }
/* Synthetic gradient placeholders so demo has visual variety */
.editor-img-thumb.img-1 { background: linear-gradient(135deg, #00b4cc 0%, #6750e8 100%); }
.editor-img-thumb.img-2 { background: linear-gradient(135deg, #ffb500 0%, #ff6b6b 100%); }
.editor-img-thumb.img-3 { background: linear-gradient(135deg, #34d399 0%, #00b4cc 100%); }
.editor-img-thumb.img-4 { background: linear-gradient(135deg, #f472b6 0%, #db2777 100%); }
.editor-img-thumb.img-5 { background: linear-gradient(135deg, #475569 0%, #1e293b 100%); }
.editor-img-thumb.img-6 { background: linear-gradient(135deg, #fbbf24 0%, #c79500 100%); }
.editor-img-thumb.img-7 { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); }
.editor-img-thumb.img-8 { background: linear-gradient(135deg, #00b4cc 0%, #34d399 100%); }
.editor-img-thumb.img-9 { background: linear-gradient(135deg, #ec627e 0%, #b03550 100%); }
.editor-img-thumb.img-10 { background: linear-gradient(135deg, #475569 0%, #00b4cc 100%); }

.editor-img-upload {
  margin: 4px 12px 12px;
  padding: 14px 8px;
  border: 1.5px dashed rgba(0, 130, 144, .25);
  border-radius: 4px;
  text-align: center;
  cursor: pointer;
  font-family: var(--ff);
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
  background: rgba(0, 180, 204, .04);
  transition: background .12s, border-color .12s;
}
.editor-img-upload:hover { background: rgba(0, 180, 204, .1); border-color: var(--teal); }

.editor-pexels-credit {
  font-size: 9px;
  color: var(--ink-4);
  text-align: center;
  padding: 0 12px 12px;
}

/* ── Inspector level tabs (Generale / Riga / Elemento — port from existing editor) ── */
.editor-level-tabs {
  display: flex;
  flex-shrink: 0;
  padding: 0 12px;
  background: rgba(255, 255, 255, .25);
  border-bottom: 1px solid rgba(0, 130, 144, .08);
}
.editor-level-tab {
  flex: 1;
  background: none;
  border: none;
  font-family: var(--ff);
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink-4);
  padding: 10px 4px 9px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .12s, border-color .12s, background .12s;
}
.editor-level-tab:hover { color: var(--ink-2); }
.editor-level-tab.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}
.editor-level-panel {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  flex-direction: column;
}
.editor-level-panel.active { display: flex; }
.editor-level-panel::-webkit-scrollbar { width: 4px; }
.editor-level-panel::-webkit-scrollbar-thumb { background: rgba(0, 130, 144, .15); border-radius: 2px; }

/* ── Column ratio picker (visual presets for row layout) ── */
.editor-col-ratio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.editor-col-ratio-btn {
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(0, 130, 144, .12);
  border-radius: 4px;
  padding: 9px 6px 6px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  font-family: var(--ff);
  transition: background .12s, border-color .12s, transform .12s;
}
.editor-col-ratio-btn:hover {
  background: rgba(0, 180, 204, .06);
  border-color: rgba(0, 180, 204, .35);
}
.editor-col-ratio-btn.active {
  background: rgba(0, 180, 204, .12);
  border-color: var(--teal);
}
.editor-col-ratio-vis {
  display: flex;
  width: 100%;
  height: 20px;
  gap: 2px;
}
.editor-col-ratio-vis span {
  background: var(--ink-4);
  opacity: .3;
  border-radius: 2px;
  flex: 1;
}
.editor-col-ratio-vis span.ratio-2 { flex: 2; }
.editor-col-ratio-vis span.ratio-3 { flex: 3; }
.editor-col-ratio-btn.active .editor-col-ratio-vis span {
  background: var(--teal);
  opacity: 1;
}
.editor-col-ratio-label {
  font-size: 9px;
  font-weight: 800;
  color: var(--ink-4);
  letter-spacing: .2px;
}
.editor-col-ratio-btn.active .editor-col-ratio-label { color: var(--teal); }

/* ── Row that contains columns: no padding, content fills edge-to-edge ── */
.editor-block:has(> .editor-cols-wrap) {
  padding: 0;
}

/* ── Column inside row (no gap — emails use HTML tables; top-aligned) ── */
.editor-cols-wrap {
  position: relative;
  display: flex;
  gap: 0;
  align-items: flex-start;
}
.editor-col {
  flex: 1;
  min-width: 0;
  position: relative;
  padding: 8px;
  outline: 1.5px dashed transparent;
  cursor: pointer;
  transition: outline-color .12s, background .12s;
}
.editor-col:hover { outline-color: rgba(0, 180, 204, .35); background: rgba(0, 180, 204, .03); }
.editor-col.focused {
  outline-color: var(--teal);
  outline-style: solid;
  background: rgba(0, 180, 204, .06);
}
.editor-col.focused::after {
  content: attr(data-col-name);
  position: absolute;
  bottom: -16px; right: 0;
  background: var(--teal);
  color: #fff;
  font-size: 8.5px;
  font-weight: 800;
  line-height: 10px;
  padding: 2px 6px;
  border-radius: 0 0 3px 3px;
  text-transform: uppercase;
  letter-spacing: .3px;
  z-index: 3;
  white-space: nowrap;
}
/* label height = line-height 10 + padding 2+2 = 14px. Outline = 1.5px ≈ 2px. bottom = -16px → flush */

/* ── Column width icon button (top-right of column, opens inline popover) ── */
.editor-col-width-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--teal);
  border: 1px solid var(--teal);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 4;
  box-shadow: 0 2px 6px rgba(0, 180, 204, .35);
}
.editor-col:hover > .editor-col-width-btn,
.editor-col.focused > .editor-col-width-btn { display: inline-flex; }
.editor-col-width-btn:hover { transform: scale(1.08); }
.editor-col-width-btn svg {
  width: 12px; height: 12px;
  stroke: currentColor; fill: none;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}

/* Highlight the column width row in the right inspector when triggered from canvas icon */
@keyframes editor-flash {
  0%, 100% { background: transparent; }
  30% { background: rgba(0, 180, 204, .25); }
}
.editor-stepper.flash { animation: editor-flash 1.4s ease-out; }

/* Subtle visual marker for the column sub-section inside Riga panel */
.editor-col-subsection { background: rgba(0, 180, 204, .04); border-left: 2px solid var(--teal); }

/* ── Stepper input (port from existing input-group with ± icons) ── */
.editor-stepper {
  display: flex;
  align-items: stretch;
  background: rgba(255, 255, 255, .6);
  border: 1px solid rgba(0, 130, 144, .12);
  border-radius: 4px;
  overflow: hidden;
}
.editor-stepper:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(0, 180, 204, .12);
}
.editor-stepper-btn {
  width: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 130, 144, .04);
  border: none;
  border-right: 1px solid rgba(0, 130, 144, .12);
  cursor: pointer;
  color: var(--ink-3);
  font-family: var(--ff);
  transition: background .12s, color .12s;
}
.editor-stepper-btn:last-child { border-right: none; border-left: 1px solid rgba(0, 130, 144, .12); }
.editor-stepper-btn:hover { background: rgba(0, 180, 204, .12); color: var(--teal); }
.editor-stepper-btn svg {
  width: 11px; height: 11px;
  stroke: currentColor; fill: none;
  stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}
.editor-stepper input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: none;
  text-align: center;
  font-family: var(--ff);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  padding: 6px 4px;
}
.editor-stepper-suffix {
  display: inline-flex;
  align-items: center;
  padding-right: 8px;
  font-size: 10px;
  color: var(--ink-4);
  font-weight: 700;
}

/* ── Drop indicator (inserted dynamically by JS during drag — shows block preview) ── */
.editor-drop-indicator {
  margin: 4px 0;
  animation: editor-drop-in .25s cubic-bezier(.2, .8, .25, 1);
}
.editor-drop-indicator .editor-block-placeholder {
  border-color: var(--teal);
  box-shadow: 0 0 16px var(--teal-glow), 0 0 32px rgba(0, 180, 204, .12);
  animation: editor-drop-pulse 1.5s ease-in-out infinite;
}
@keyframes editor-drop-pulse {
  0%, 100% { box-shadow: 0 0 16px var(--teal-glow), 0 0 32px rgba(0, 180, 204, .12); }
  50% { box-shadow: 0 0 24px var(--teal-glow), 0 0 48px rgba(0, 180, 204, .2); }
}

/* ── Drop zone highlight (column or empty area ready to receive a drop) ── */
.editor-drop-zone {
  transition: background .15s, outline-color .15s;
}
.editor-drop-zone.drag-over {
  background: rgba(0, 180, 204, .06);
  outline: 2px dashed var(--teal);
}

/* ── Dropped block placeholder (new block just inserted via drag & drop) ── */
.editor-block-placeholder {
  min-height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 2px dashed rgba(0, 180, 204, .35);
  border-radius: 4px;
  background: rgba(0, 180, 204, .04);
  animation: editor-drop-in .35s cubic-bezier(.2, .8, .25, 1);
}
.editor-block-placeholder-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0, 180, 204, .12);
  display: flex; align-items: center; justify-content: center;
  color: var(--teal);
}
.editor-block-placeholder-icon svg {
  width: 18px; height: 18px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.editor-block-placeholder-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
}
@keyframes editor-drop-in {
  0% { opacity: 0; transform: scaleY(.85); }
  100% { opacity: 1; transform: scaleY(1); }
}

/* ── Canvas-wide drag-active state (subtle feedback that a drag is in progress) ── */
.editor-canvas.drag-active .editor-block {
  outline-color: rgba(0, 180, 204, .12);
}

/* ── Insert "+" buttons (top + bottom of each block, Notion-style) ── */
.editor-block-insert {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity .14s, transform .14s;
  z-index: 5;
  box-shadow: 0 4px 12px rgba(0, 180, 204, .35);
}
.editor-block-insert.top { top: -12px; }
.editor-block-insert.bottom { bottom: -12px; }
.editor-block:hover > .editor-block-insert {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}
.editor-block-insert:hover { transform: translateX(-50%) scale(1.15); }
.editor-block-insert svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* ── Nested editor-block context (inside .editor-col): smaller everything ── */
.editor-col {
  padding-top: 32px; /* reserve space for the column-width button */
}
.editor-col .editor-block {
  padding: 10px 14px;
  margin-bottom: 4px;
}
.editor-col .editor-block:last-child { margin-bottom: 0; }
.editor-col .editor-block-move,
.editor-col .editor-block-toolbar-btn {
  width: 24px; height: 24px;
}
.editor-col .editor-block-move svg,
.editor-col .editor-block-toolbar-btn svg {
  width: 11px; height: 11px;
}
.editor-col .editor-block-toolbar { gap: 4px; right: 6px; }
.editor-col .editor-block-move { left: 6px; }
.editor-col .editor-block-insert {
  width: 18px; height: 18px;
}
.editor-col .editor-block-insert svg { width: 10px; height: 10px; }
.editor-col .editor-block-insert.top { top: -10px; }
.editor-col .editor-block-insert.bottom { bottom: -10px; }
.editor-col .editor-block:hover:not(.selected)::after {
  font-size: 8.5px;
  padding: 2px 6px;
  line-height: 10px;
  bottom: -16px;
}
/* nested label height = line-height 10 + padding 2+2 = 14px. Outline = 2px. bottom = -16px → flush */
/* Smaller renderings for nested elements */
.editor-col .editor-block-h { font-size: 16px; margin-bottom: 4px; }
.editor-col .editor-block-text { font-size: 12px; line-height: 1.5; }
.editor-col .editor-block-cta { padding: 8px 16px; font-size: 11px; margin-top: 0; }
.editor-col .editor-block-hero-img { height: 80px; font-size: 9px; }

/* ── Center canvas area ── */
.editor-canvas-wrap {
  background:
    radial-gradient(circle 600px at 50% 50%, rgba(0, 130, 144, .04) 0%, transparent 70%),
    rgba(0, 130, 144, .02);
  overflow-y: auto;
  min-height: 0; /* required: grid items default to min-height: auto, blocking overflow scroll */
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 24px;
}
.editor-canvas-wrap::-webkit-scrollbar { width: 6px; }
.editor-canvas-wrap::-webkit-scrollbar-thumb { background: rgba(0, 130, 144, .18); border-radius: 3px; }

/* The visual canvas (an email being designed) — flat, no rounded corners.
   IMPORTANT: do NOT set overflow:hidden — that changes flex min-height from auto
   to 0, causing the canvas to shrink to the wrap's bounded height and CLIP the
   email content instead of letting the wrap scroll. */
.editor-canvas {
  width: 100%;
  max-width: 600px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 60, 80, .12), 0 4px 12px rgba(0, 60, 80, .06);
  position: relative;
  flex-shrink: 0;
}
.editor-canvas[data-device="mobile"] { max-width: 360px; }
.editor-canvas[data-device="tablet"] { max-width: 480px; }

/* Each block inside the canvas */
.editor-block {
  position: relative;
  padding: 24px 32px;
  cursor: pointer;
  outline: 2px solid transparent;
  transition: outline-color .12s, background .12s;
}
.editor-block:hover:not(.selected) {
  background: rgba(0, 180, 204, .04);
  outline-color: rgba(0, 180, 204, .35);
}
.editor-block:hover:not(.selected)::after {
  content: attr(data-block-name);
  position: absolute;
  bottom: -20px; right: 0;
  background: var(--teal);
  color: #fff;
  padding: 3px 9px;
  border-radius: 0 0 4px 4px;
  font-size: 9.5px;
  font-weight: 800;
  line-height: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
  z-index: 4;
  white-space: nowrap;
  pointer-events: none;
}
/* label height = line-height 12 + padding 3+3 = 18px. Outline = 2px. bottom = -(18+2) = -20px → flush */
.editor-block.selected {
  outline-color: var(--teal);
  background: rgba(0, 180, 204, .05);
}

/* ── Move handle (circular, inside-left of block, port from .editor-contents-row-move) ── */
.editor-block-move {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--teal);
  border: 1px solid var(--teal);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: move;
  z-index: 5;
  box-shadow: 0 4px 12px rgba(0, 180, 204, .35);
}
.editor-block:hover > .editor-block-move,
.editor-block.selected > .editor-block-move { display: flex; }
.editor-block-move svg {
  width: 13px; height: 13px;
  stroke: currentColor; fill: none;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}

/* ── Block functions toolbar (circular buttons inside-right, port from .editor-contents-row-functions) ── */
.editor-block-toolbar {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  gap: 6px;
  z-index: 5;
}
.editor-block:hover > .editor-block-toolbar,
.editor-block.selected > .editor-block-toolbar { display: flex; }
.editor-block-toolbar-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--teal);
  border: 1px solid var(--teal);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .1s, border-color .1s, transform .1s;
  box-shadow: 0 4px 12px rgba(0, 180, 204, .35);
}
.editor-block-toolbar-btn:hover { transform: scale(1.08); }
.editor-block-toolbar-btn.danger {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 4px 12px rgba(236, 98, 126, .4);
}
.editor-block-toolbar-btn svg {
  width: 13px; height: 13px;
  stroke: currentColor; fill: none;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}

/* ── Inline rich-text toolbar (TinyMCE/Tiptap-style bubble menu) ── */
.editor-inline-toolbar {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 1px;
  padding: 4px;
  background: rgba(15, 30, 35, .96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3), 0 2px 6px rgba(0, 0, 0, .18);
  z-index: 4;
  white-space: nowrap;
}
.editor-block.selected .editor-inline-toolbar { display: inline-flex; }
.editor-inline-toolbar::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(15, 30, 35, .96);
}
.editor-inline-btn {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  border-radius: 4px;
  color: rgba(255, 255, 255, .8);
  cursor: pointer;
  font-family: var(--ff);
  font-size: 12px;
  font-weight: 800;
  transition: background .1s, color .1s;
}
.editor-inline-btn:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.editor-inline-btn.active { background: rgba(0, 180, 204, .25); color: var(--teal); }
.editor-inline-btn svg {
  width: 13px; height: 13px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.editor-inline-btn em { font-style: italic; font-weight: 800; }
.editor-inline-btn u { text-decoration: underline; font-weight: 700; }
.editor-inline-toolbar-sep {
  width: 1px; height: 16px;
  background: rgba(255, 255, 255, .15);
  margin: 0 2px;
}
.editor-inline-select {
  background: none;
  border: none;
  color: rgba(255, 255, 255, .85);
  font-family: var(--ff);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
}
.editor-inline-select:hover { background: rgba(255, 255, 255, .1); }
.editor-inline-select option { background: #0f1e23; color: #fff; }

/* When inside a selected block, the editable text shows a faint teal underline */
.editor-block.selected .editor-block-h,
.editor-block.selected .editor-block-text {
  outline: none;
  cursor: text;
}

/* Canvas mock content (email blocks) */
.editor-block-header {
  padding: 18px 32px;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-2) 100%);
  color: #fff;
  text-align: center;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: .5px;
}
.editor-block-hero-img {
  height: 180px;
  background: linear-gradient(135deg, rgba(0, 180, 204, .25) 0%, rgba(139, 92, 246, .2) 100%);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, .95);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  border-radius: var(--r-sm);
}
.editor-block-h {
  font-size: 22px;
  font-weight: 900;
  color: #1a1a1a;
  margin: 0 0 8px;
  line-height: 1.2;
  letter-spacing: -.4px;
}
.editor-block-text {
  font-size: 14px;
  color: #4a4a4a;
  line-height: 1.6;
  margin: 0;
}
.editor-block-cta {
  display: inline-block;
  padding: 12px 28px;
  background: var(--teal);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  border-radius: 8px;
  text-decoration: none;
  margin-top: 4px;
  box-shadow: 0 4px 12px rgba(0, 180, 204, .35);
}
.editor-block-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .12), transparent);
}
.editor-block-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.editor-block-cols .col-img {
  height: 100px;
  background: rgba(0, 130, 144, .12);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--teal);
  font-size: 10px; font-weight: 700; text-transform: uppercase;
}
.editor-block-cols h4 { margin: 6px 0 4px; font-size: 13px; color: #1a1a1a; }
.editor-block-cols p { margin: 0; font-size: 11.5px; color: #6a6a6a; line-height: 1.5; }
.editor-block-footer {
  background: #f4f4f4;
  text-align: center;
  font-size: 10px;
  color: #888;
  line-height: 1.6;
}

/* ── Right properties panel ── */
.editor-properties {
  background: rgba(255, 255, 255, .35);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-left: 1px solid rgba(0, 130, 144, .08);
  display: flex; flex-direction: column;
  overflow: hidden;
  min-height: 0; /* required: grid items default to min-height: auto */
}
.editor-properties::-webkit-scrollbar { width: 4px; }
.editor-properties::-webkit-scrollbar-thumb { background: rgba(0, 130, 144, .15); border-radius: 2px; }
.editor-properties-head {
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(0, 130, 144, .08);
  flex-shrink: 0;
}
.editor-properties-title { font-size: 13px; font-weight: 900; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.editor-properties-title svg { width: 14px; height: 14px; stroke: var(--teal); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.editor-properties-sub { font-size: 10.5px; color: var(--ink-4); margin-top: 2px; }

.editor-property-section {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(0, 130, 144, .08);
}
.editor-property-section:last-child { border-bottom: none; }
.editor-property-section-title {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--teal);
  margin-bottom: 12px;
  padding-left: 10px;
  border-left: 2px solid var(--teal);
  line-height: 1;
}
.editor-property-row { margin-bottom: 10px; }
.editor-property-row:last-child { margin-bottom: 0; }
.editor-property-row label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-3);
  margin-bottom: 5px;
}
.editor-property-row input[type="text"],
.editor-property-row input[type="url"],
.editor-property-row input[type="number"],
.editor-property-row select,
.editor-property-row textarea {
  width: 100%;
  padding: 6px 9px;
  font-family: var(--ff);
  font-size: 11.5px;
  color: var(--ink);
  background: rgba(255, 255, 255, .6);
  border: 1px solid rgba(0, 130, 144, .12);
  border-radius: 4px;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.editor-property-row input:focus,
.editor-property-row select:focus,
.editor-property-row textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(0, 180, 204, .12);
}
.editor-property-row textarea { resize: vertical; min-height: 60px; line-height: 1.5; }
.editor-property-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.editor-color-row {
  display: flex; align-items: center; gap: 6px;
}
.editor-color-swatch {
  width: 24px; height: 24px;
  border-radius: 3px;
  border: 1px solid rgba(0, 130, 144, .15);
  background: var(--teal);
  flex-shrink: 0;
  cursor: pointer;
}
.editor-align-group {
  display: flex; gap: 2px;
  background: var(--field-bg);
  padding: 2px;
  border-radius: 4px;
  border: 1px solid rgba(0, 130, 144, .12);
}
.editor-align-btn {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center;
  height: 26px;
  background: none;
  border: none;
  border-radius: 3px;
  color: var(--ink-4);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.editor-align-btn:hover { color: var(--ink-2); }
.editor-align-btn.active { background: #fff; color: var(--teal); box-shadow: 0 1px 2px rgba(0, 60, 80, .12); }
.editor-align-btn svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ═══════════════════════════════════════════════════════════════
   VISUAL BUILDER / FLOW EDITOR (T09 — node graph for funnels & automations)
   Reuses: .editor-topbar, .editor-property-*, .editor-level-*
   ═══════════════════════════════════════════════════════════════ */

.flow-grid {
  display: grid;
  grid-template-columns: 240px 1fr 280px;
  grid-template-rows: minmax(0, 1fr);
  flex: 1;
  min-height: 0;
  gap: 0;
}

/* ── Flow canvas (infinite pannable area with dot grid) ── */
.flow-canvas-wrap {
  overflow: auto;
  min-height: 0;
  position: relative;
  background:
    radial-gradient(circle, rgba(0, 130, 144, .15) 1px, transparent 1px),
    rgba(0, 130, 144, .02);
  background-size: 24px 24px;
}
.flow-canvas-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.flow-canvas-wrap::-webkit-scrollbar-thumb { background: rgba(0, 130, 144, .2); border-radius: 4px; }

.flow-canvas {
  position: relative;
  width: 2400px;
  height: 1600px;
  min-width: 100%;
  min-height: 100%;
}

/* ── SVG connections layer ── */
.flow-connections {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}
.flow-connection {
  fill: none;
  stroke: rgba(0, 130, 144, .35);
  stroke-width: 2;
  stroke-linecap: round;
}
.flow-connection.active {
  stroke: var(--teal);
  stroke-width: 2.5;
  filter: drop-shadow(0 0 6px var(--teal-glow));
}
.flow-connection-arrow {
  fill: rgba(0, 130, 144, .35);
  stroke: none;
}
.flow-connection.active + .flow-connection-arrow,
.flow-connection.active ~ .flow-connection-arrow { fill: var(--teal); }

/* ── Flow node ── */
.flow-node {
  position: absolute;
  width: 220px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(255, 255, 255, .6);
  border-radius: var(--r-md);
  box-shadow: 0 4px 16px rgba(0, 60, 80, .1), 0 1px 4px rgba(0, 60, 80, .06);
  cursor: grab;
  z-index: 2;
  transition: box-shadow .15s, border-color .15s;
  display: flex;
  flex-direction: column;
}
.flow-node:hover {
  box-shadow: 0 8px 28px rgba(0, 60, 80, .14), 0 2px 6px rgba(0, 60, 80, .08);
  border-color: rgba(0, 180, 204, .3);
}
.flow-node.selected {
  border-color: var(--teal);
  box-shadow: 0 8px 28px rgba(0, 180, 204, .2), 0 0 0 3px rgba(0, 180, 204, .12);
}

/* Node accent stripe (top) — color by type */
.flow-node-accent {
  height: 3px;
  border-radius: var(--r-md) var(--r-md) 0 0;
  flex-shrink: 0;
}
.flow-node.type-trigger .flow-node-accent { background: var(--green); box-shadow: 0 0 8px rgba(0, 168, 94, .4); }
.flow-node.type-action .flow-node-accent { background: var(--teal); box-shadow: 0 0 8px var(--teal-glow); }
.flow-node.type-condition .flow-node-accent { background: var(--yellow); box-shadow: 0 0 8px rgba(255, 203, 5, .4); }
.flow-node.type-wait .flow-node-accent { background: var(--ink-4); }
.flow-node.type-integration .flow-node-accent { background: #8b5cf6; box-shadow: 0 0 8px rgba(139, 92, 246, .4); }

/* Node header */
.flow-node-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}
.flow-node-icon {
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.flow-node-icon svg {
  width: 16px; height: 16px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.flow-node.type-trigger .flow-node-icon { background: rgba(0, 168, 94, .12); color: #007a43; }
.flow-node.type-action .flow-node-icon { background: rgba(0, 180, 204, .12); color: var(--teal); }
.flow-node.type-condition .flow-node-icon { background: rgba(255, 203, 5, .15); color: var(--yellow-dark); }
.flow-node.type-wait .flow-node-icon { background: rgba(0, 130, 144, .06); color: var(--ink-4); }
.flow-node.type-integration .flow-node-icon { background: rgba(139, 92, 246, .12); color: #6d28d9; }
.flow-node-text { flex: 1; min-width: 0; }
.flow-node-title { font-size: 12px; font-weight: 800; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-node-subtitle { font-size: 10.5px; color: var(--ink-4); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Node body (optional — stats, preview, config summary) */
.flow-node-body {
  padding: 0 14px 12px;
  font-size: 10.5px;
  color: var(--ink-3);
  line-height: 1.5;
  border-top: 1px solid rgba(0, 130, 144, .06);
  padding-top: 8px;
  margin-top: -2px;
}
.flow-node-stat {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 0;
}
.flow-node-stat-value { font-weight: 800; color: var(--ink); }

/* ── Ports (connection points on nodes) ── */
.flow-port {
  position: absolute;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid rgba(0, 130, 144, .4);
  cursor: crosshair;
  z-index: 3;
  transition: transform .12s, border-color .12s, box-shadow .12s;
}
.flow-port:hover {
  transform: scale(1.3);
  border-color: var(--teal);
  box-shadow: 0 0 8px var(--teal-glow);
}
/* Horizontal ports (T09 left→right) */
.flow-port.port-in { left: -6px; top: 50%; margin-top: -6px; }
.flow-port.port-out { right: -6px; top: 50%; margin-top: -6px; }
.flow-port.port-out-yes { right: -6px; top: 35%; margin-top: -6px; border-color: rgba(0, 168, 94, .5); }
.flow-port.port-out-no { right: -6px; top: 65%; margin-top: -6px; border-color: rgba(236, 98, 126, .5); }
.flow-port.port-out-yes:hover { border-color: var(--green); box-shadow: 0 0 8px rgba(0, 168, 94, .4); }
.flow-port.port-out-no:hover { border-color: var(--red); box-shadow: 0 0 8px rgba(236, 98, 126, .4); }
.flow-port-label {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}
.flow-port-label.label-yes { color: #007a43; }
.flow-port-label.label-no { color: #b03550; }
/* Vertical ports (T16 top→bottom funnel) */
.flow-port.port-top { top: -6px; left: 50%; margin-left: -6px; right: auto; }
.flow-port.port-bottom { bottom: -6px; left: 50%; margin-left: -6px; right: auto; top: auto; }
.flow-port.port-out-yes-v { bottom: -6px; left: 35%; margin-left: -6px; right: auto; top: auto; border-color: rgba(0, 168, 94, .5); }
.flow-port.port-out-no-v { bottom: -6px; left: 65%; margin-left: -6px; right: auto; top: auto; border-color: rgba(236, 98, 126, .5); }
.flow-port.port-out-yes-v:hover { border-color: var(--green); box-shadow: 0 0 8px rgba(0, 168, 94, .4); }
.flow-port.port-out-no-v:hover { border-color: var(--red); box-shadow: 0 0 8px rgba(236, 98, 126, .4); }
.flow-port-label-v {
  position: absolute;
  top: 16px;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}
.flow-port-label-v.label-yes { color: #007a43; left: -10px; }
.flow-port-label-v.label-no { color: #b03550; left: -8px; }

/* ── Add node floating button (+ between nodes) ── */
.flow-add-btn {
  position: absolute;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
  cursor: pointer;
  z-index: 4;
  box-shadow: 0 4px 12px rgba(0, 180, 204, .4);
  transition: transform .12s;
}
.flow-add-btn:hover { transform: scale(1.12); }
.flow-add-btn svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none;
  stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
}

/* ── Flow palette (left panel — reuses editor-palette pattern) ── */
.flow-palette-node {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: var(--r-sm);
  cursor: grab;
  font-family: var(--ff);
  transition: background .12s, border-color .12s, transform .12s;
  margin-bottom: 6px;
}
.flow-palette-node:hover {
  background: rgba(0, 180, 204, .08);
  border-color: rgba(0, 180, 204, .3);
  transform: translateX(2px);
}
.flow-palette-node:active { cursor: grabbing; }
.flow-palette-node-icon {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.flow-palette-node-icon svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.flow-palette-node-name { font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
.flow-palette-node-icon.pal-trigger { background: rgba(0, 168, 94, .12); color: #007a43; }
.flow-palette-node-icon.pal-action { background: rgba(0, 180, 204, .12); color: var(--teal); }
.flow-palette-node-icon.pal-condition { background: rgba(255, 203, 5, .15); color: var(--yellow-dark); }
.flow-palette-node-icon.pal-wait { background: rgba(0, 130, 144, .06); color: var(--ink-4); }
.flow-palette-node-icon.pal-integration { background: rgba(139, 92, 246, .12); color: #6d28d9; }

/* ── Minimap (top-right of canvas, port from #minimap / DrawflowMinimap) ── */
.flow-minimap {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 180px;
  height: 120px;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 130, 144, .2);
  border-radius: var(--r-sm);
  box-shadow: 0 4px 16px rgba(0, 60, 80, .12);
  z-index: 10;
  overflow: hidden;
  cursor: move;
}
.flow-minimap-canvas {
  width: 100%;
  height: 100%;
  position: relative;
  background:
    radial-gradient(circle, rgba(0, 130, 144, .12) 0.5px, transparent 0.5px),
    #fff;
  background-size: 4px 4px;
}
.flow-minimap-viewport {
  position: absolute;
  border: 1.5px solid var(--teal);
  border-radius: 2px;
  background: rgba(0, 180, 204, .1);
  pointer-events: none;
}
.flow-minimap-node {
  position: absolute;
  border-radius: 2px;
  background: var(--teal);
  opacity: .6;
}
.flow-minimap-node.mini-trigger { background: var(--green); }
.flow-minimap-node.mini-condition { background: var(--yellow); }
.flow-minimap-node.mini-wait { background: var(--ink-4); }
.flow-minimap-node.mini-integration { background: #8b5cf6; }

/* ── Zoom bar (bottom-center of canvas, port from .bar-zoom) ── */
.flow-zoom-bar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 130, 144, .15);
  border-radius: var(--r-sm);
  box-shadow: 0 4px 12px rgba(0, 60, 80, .1);
  z-index: 10;
}
.flow-zoom-btn {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none;
  border: none;
  border-radius: 4px;
  color: var(--ink-3);
  cursor: pointer;
  font-family: var(--ff);
  transition: background .12s, color .12s;
}
.flow-zoom-btn:hover { background: rgba(0, 180, 204, .1); color: var(--teal); }
.flow-zoom-btn svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.flow-zoom-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-3);
  padding: 0 6px;
  min-width: 36px;
  text-align: center;
}

/* ── Node action buttons (settings, duplicate, delete — top-right, hover-reveal) ── */
.flow-node-actions {
  position: absolute;
  top: -14px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .14s;
  z-index: 4;
}
.flow-node:hover .flow-node-actions,
.flow-node.selected .flow-node-actions { opacity: 1; }
.flow-node-action-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .95);
  border: 1px solid rgba(0, 130, 144, .2);
  color: var(--ink-3);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 60, 80, .1);
  transition: background .12s, color .12s, border-color .12s;
}
.flow-node-action-btn:hover { background: rgba(0, 180, 204, .1); border-color: var(--teal); color: var(--teal); }
.flow-node-action-btn.danger:hover { background: rgba(236, 98, 126, .1); border-color: var(--red); color: var(--red); }
.flow-node-action-btn svg {
  width: 12px; height: 12px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

/* ── Connection hover actions (delete + add — floating on the connection midpoint) ── */
.flow-conn-actions {
  position: absolute;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .14s;
  z-index: 5;
  pointer-events: none;
}
.flow-conn-actions.show { opacity: 1; pointer-events: auto; }
.flow-conn-action-btn {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .95);
  border: 1px solid rgba(0, 130, 144, .2);
  color: var(--ink-3);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 60, 80, .12);
  transition: background .12s, color .12s, border-color .12s;
}
.flow-conn-action-btn:hover { background: rgba(0, 180, 204, .1); border-color: var(--teal); color: var(--teal); }
.flow-conn-action-btn.danger:hover { background: rgba(236, 98, 126, .1); border-color: var(--red); color: var(--red); }
.flow-conn-action-btn svg {
  width: 11px; height: 11px;
  stroke: currentColor; fill: none;
  stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}

/* Wide invisible hit area on connections for easier hover */
.flow-connection-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 20;
  cursor: pointer;
  pointer-events: stroke;
}

/* ── Node insight badge (KPI strip at the bottom of node) ── */
.flow-node-insights {
  display: flex;
  gap: 0;
  border-top: 1px solid rgba(0, 130, 144, .08);
}
.flow-node-insight {
  flex: 1;
  padding: 8px 10px;
  text-align: center;
  border-right: 1px solid rgba(0, 130, 144, .06);
}
.flow-node-insight:last-child { border-right: none; }
.flow-node-insight-value {
  font-size: 13px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1;
}
.flow-node-insight-label {
  font-size: 8.5px;
  font-weight: 700;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: .3px;
  margin-top: 3px;
}

/* Responsive */
@media (max-width: 1199px) {
  .flow-grid { grid-template-columns: 200px 1fr; }
  .flow-grid > .editor-properties { display: none; }
}
@media (max-width: 599px) {
  .flow-grid { grid-template-columns: 1fr; }
  .flow-grid > .editor-palette { display: none; }
}

/* Tablet: hide right properties panel */
@media (max-width: 1199px) {
  .editor-grid { grid-template-columns: 220px 1fr; }
  .editor-properties { display: none; }
}
@media (max-width: 991px) {
  .editor-grid { grid-template-columns: 200px 1fr; }
  .editor-canvas-wrap { padding: 20px 16px; }
}
/* Mobile: hide both side panels, show only canvas */
@media (max-width: 599px) {
  .editor-grid { grid-template-columns: 1fr; }
  .editor-palette { display: none; }
  .editor-canvas-wrap { padding: 16px 12px; }
  .editor-topbar { padding: 10px 12px; gap: 8px; }
  .editor-topbar-center { display: none; }
  .editor-doc-meta { display: none; }
}

/* ═══════════════════════════════════════════════════════════════
   MODAL / DIALOG
   ═══════════════════════════════════════════════════════════════ */

/* Overlay — full-screen blurred backdrop */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 60, 80, .35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s, visibility .18s;
}
.modal-overlay.show { opacity: 1; visibility: visible; }

/* Dialog card — glass morphism */
.modal-dialog {
  background: rgba(255, 255, 255, .85);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: var(--r-xl);
  box-shadow: 0 30px 80px rgba(0, 60, 80, .25), 0 8px 24px rgba(0, 60, 80, .12);
  width: 100%;
  max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
  transform: scale(.96) translateY(8px);
  transition: transform .22s cubic-bezier(.2, .8, .25, 1);
}
.modal-overlay.show .modal-dialog { transform: scale(1) translateY(0); }
.modal-dialog::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 10%, var(--spec) 50%, transparent 90%);
  pointer-events: none;
}

/* Width variants */
.modal-sm { max-width: 420px; }
.modal-md { max-width: 560px; }
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 980px; }

/* Header */
.modal-header {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 20px 24px 14px;
  border-bottom: 1px solid rgba(0, 130, 144, .08);
  flex-shrink: 0;
}
.modal-title-wrap { flex: 1; min-width: 0; }
.modal-title {
  font-size: 16px; font-weight: 900; color: var(--ink);
  margin: 0; line-height: 1.3;
}
.modal-subtitle {
  font-size: 12px; color: var(--ink-4);
  margin-top: 4px; line-height: 1.4;
}
.modal-close {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--field-bg);
  border: 1px solid rgba(0, 130, 144, .1);
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--ink-3);
  flex-shrink: 0;
  transition: background .12s, color .12s, border-color .12s;
}
.modal-close:hover { background: rgba(236, 98, 126, .08); border-color: var(--red); color: var(--red); }
.modal-close svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Body — scrollable */
.modal-body {
  padding: 18px 24px;
  overflow-y: auto;
  flex: 1;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.55;
}
.modal-body::-webkit-scrollbar { width: 6px; }
.modal-body::-webkit-scrollbar-thumb { background: rgba(0, 130, 144, .15); border-radius: 3px; }
.modal-body p { margin: 0 0 10px; }
.modal-body p:last-child { margin-bottom: 0; }
.modal-body strong { color: var(--ink); font-weight: 700; }

/* Footer — actions row */
.modal-footer {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; flex-wrap: wrap;
  padding: 14px 24px 18px;
  border-top: 1px solid rgba(0, 130, 144, .08);
  background: rgba(255, 255, 255, .3);
  flex-shrink: 0;
}
.modal-footer.modal-footer-split { justify-content: space-between; }
.modal-footer-info { font-size: 11.5px; color: var(--ink-4); }

/* Icon header (confirm / destructive / info / success) */
.modal-icon-wrap {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.modal-icon-wrap svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.modal-icon-wrap.tone-info { background: rgba(0, 180, 204, .12); color: var(--teal); }
.modal-icon-wrap.tone-success { background: rgba(0, 168, 94, .15); color: #007a43; }
.modal-icon-wrap.tone-warning { background: rgba(255, 203, 5, .18); color: var(--yellow-dark); }
.modal-icon-wrap.tone-danger { background: rgba(236, 98, 126, .15); color: #b03550; }

/* Sectioned form body — fields grouped in cards */
.modal-body-sectioned {
  background: rgba(0, 130, 144, .03);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-form-card {
  background: #fff;
  border: 1px solid rgba(0, 130, 144, .1);
  border-radius: var(--r-md);
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(0, 60, 80, .04);
}
.modal-form-card-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0, 130, 144, .06);
}
.modal-form-card-icon {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  background: rgba(0, 180, 204, .1);
  color: var(--teal);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.modal-form-card-icon svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.modal-form-card-title { font-size: 13px; font-weight: 900; color: var(--ink); }
.modal-form-card-desc { font-size: 11px; color: var(--ink-4); margin-top: 1px; }
.modal-form-card .form-field:last-child { margin-bottom: 0; }

/* Picker / list inside body */
.modal-picker-search { min-width: 0; width: 100%; margin-bottom: 12px; }
.modal-picker-list { display: flex; flex-direction: column; gap: 4px; }
.modal-picker-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 130, 144, .08);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .5);
  cursor: pointer;
  text-align: left;
  font-family: var(--ff);
  transition: background .12s, border-color .12s;
}
.modal-picker-item:hover { background: rgba(0, 180, 204, .06); border-color: rgba(0, 180, 204, .3); }
.modal-picker-item.selected { background: rgba(0, 180, 204, .1); border-color: var(--teal); }
.modal-picker-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-2) 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900;
  border: 1.5px solid #fff;
  flex-shrink: 0;
}
.modal-picker-text { flex: 1; min-width: 0; }
.modal-picker-name { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.modal-picker-meta { font-size: 11px; color: var(--ink-4); margin-top: 2px; }
.modal-picker-check {
  width: 18px; height: 18px;
  color: var(--teal);
  flex-shrink: 0;
  opacity: 0;
}
.modal-picker-check svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.modal-picker-item.selected .modal-picker-check { opacity: 1; }

/* Image preview body (no padding) */
.modal-body-image { padding: 0; background: rgba(0, 30, 40, .85); }
.modal-image-frame {
  display: flex; align-items: center; justify-content: center;
  min-height: 360px;
  padding: 24px;
}
.modal-image-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, rgba(0, 180, 204, .25) 0%, rgba(0, 130, 144, .15) 50%, rgba(139, 92, 246, .2) 100%);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255, 255, 255, .9);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, .15);
}

/* Trigger demo grid (only for the T12 demo page) */
.modal-trigger-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.modal-trigger-card {
  background: var(--glass-white2);
  backdrop-filter: var(--blur-md);
  -webkit-backdrop-filter: var(--blur-md);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 10px;
  position: relative;
  overflow: hidden;
}
.modal-trigger-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 10%, var(--spec) 50%, transparent 90%);
  pointer-events: none;
}
.modal-trigger-head { display: flex; align-items: center; gap: 10px; }
.modal-trigger-title { font-size: 13.5px; font-weight: 900; color: var(--ink); }
.modal-trigger-desc { font-size: 11.5px; color: var(--ink-4); line-height: 1.5; min-height: 32px; }
.modal-trigger-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }

/* No-scroll lock when modal open */
body.modal-open { overflow: hidden; }

/* Responsive */
@media (max-width: 599px) {
  .modal-overlay { padding: 12px; align-items: flex-end; }
  .modal-dialog { max-height: calc(100vh - 24px); }
  .modal-sm, .modal-md, .modal-lg, .modal-xl { max-width: 100%; }
  .modal-header { padding: 16px 18px 12px; }
  .modal-body { padding: 14px 18px; }
  .modal-footer { padding: 12px 18px 14px; }
}
