:root {
  --indigo-50:   #EEEAFF;
  --indigo-100:  #E0D9FF;
  --indigo-200:  #C4B8FD;
  --indigo-500:  #3826E2;
  --indigo-600:  #2a1db8;
  --violet:      #7C6AE8;
  --teal:        #2AC8C8;
  --teal-soft:   #D6F4F4;
  --teal-ink:    #0F7A7A;
  --ink:         #0F1024;
  --ink2:        #3A3D55;
  --ink3:        #6B6F8B;
  --ink4:        #9BA0BC;
  --ash:         #6B6F8B;
  --ash-2:       #9BA0BC;
  --hairline:    #E6E5EE;
  --hairline-2:  #EFEEF5;
  --surface:     #FFFFFF;
  --canvas:      #F5F4FA;
  --surface-2:   #FAFAFE;
  --success:     #0F9D6E;
  --danger:      #E5447A;
  --danger-bg:   #FFF1F2;
  --warn:        #F5B544;
  --amber-bg:    #FEF3C7;
  --amber-ink:   #8B5A0B;
  --sans:        'Inter Tight', 'Outfit', system-ui, sans-serif;
  --mono:        'JetBrains Mono', ui-monospace, monospace;
  --shadow-pop:  0 20px 48px rgba(56,38,226,.14), 0 6px 16px rgba(56,38,226,.09);
  --shadow-md:   0 4px 12px rgba(15,16,36,.06), 0 2px 4px rgba(15,16,36,.04);
  /* legacy aliases */
  --bg:          #F5F4FA;
  --white:       #ffffff;
  --text:        #0F1024;
  --muted:       #6B6F8B;
  --border:      #E6E5EE;
  --primary:     #3826E2;
  --primary-hover:#2a1db8;
  --accent:      #3826E2;
  --accent-dark: #2a1db8;
  --accent-bg:   #EEEAFF;
  --accent-border:#C4B8FD;
  --red:         #E5447A;
  --red-bg:      #FFF1F2;
  --radius:      14px;
  --sidebar-w:   232px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--canvas); color: var(--ink); font-family: var(--sans);
  font-size: 14px; -webkit-font-smoothing: antialiased; min-height: 100vh;
}

/* ── APP SHELL ── */
#app { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--primary); color: #fff;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  padding: 22px 16px 16px; z-index: 20; overflow-y: auto;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 8px;
  padding: 0 6px 22px; text-decoration: none;
}
.sidebar-logo-text {
  font-size: 14px; font-weight: 700; color: #fff; letter-spacing: -0.01em;
}
.logo-dot { color: var(--teal); }
.sidebar-ws {
  padding: 10px 8px 14px; border-top: 1px solid rgba(255,255,255,.10); margin-bottom: 4px;
}
.sidebar-ws-label {
  font-size: 9.5px; letter-spacing: 0.14em; color: rgba(255,255,255,.55); font-weight: 600; text-transform: uppercase;
}
.sidebar-ws-name { font-size: 13.5px; font-weight: 700; margin-top: 6px; word-break: break-all; }
.sidebar-nav { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.sidebar-nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 8px; text-decoration: none;
  background: transparent; color: rgba(255,255,255,.86);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background .15s, color .15s;
}
.sidebar-nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-nav-link.active {
  background: rgba(255,255,255,.10); color: var(--teal); font-weight: 600;
}
.sidebar-nav-link.active::after {
  content: ''; margin-left: auto; width: 4px; height: 16px;
  border-radius: 2px; background: var(--teal); flex-shrink: 0;
}
.sidebar-link-icon { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-bottom {
  padding-top: 14px; border-top: 1px solid rgba(255,255,255,.10); margin-top: 8px;
}
.sidebar-email { display: block; font-size: 11px; color: rgba(255,255,255,.62); margin-bottom: 8px; padding: 0 6px; word-break: break-all; }
.sidebar-back-link {
  display: block; font-size: 12px; color: rgba(255,255,255,.7);
  text-decoration: none; padding: 6px 6px; margin-bottom: 6px;
}
.sidebar-back-link:hover { color: #fff; }
.sidebar-signout {
  width: 100%; background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,.22); border-radius: 999px;
  padding: 7px 10px; font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: var(--sans);
}
.sidebar-signout:hover { border-color: rgba(255,255,255,.5); }

/* ── MAIN CONTENT AREA ── */
.admin-main {
  flex: 1; margin-left: var(--sidebar-w);
  display: flex; flex-direction: column; min-height: 100vh;
}
.body { flex: 1; padding: 0; }

/* ── AUTH WALL ── */
#auth-wall {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; flex-direction: column; gap: 12px;
}
#auth-wall p { font-size: .85rem; color: var(--ash); }
#auth-wall a { font-size: .82rem; color: var(--indigo-500); font-weight: 600; text-decoration: none; }

/* ── APP SHELL ── */
#app { display: none; }

/* ── PAGE FRAME (removed card look) ── */
.page { flex: 1; }

/* ── TOP BAR — hidden, replaced by sidebar ── */
.topbar { display: none; }

/* ── TABS — hidden, replaced by sidebar nav ── */
.tabs {
  display: none;
}
.tab {
  padding: 14px 16px; background: transparent; border: none;
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  color: var(--ash); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
  transition: color .15s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--indigo-500); border-bottom-color: var(--indigo-500); font-weight: 600; }

/* ── BODY ── */
.body { padding: 0; }
.page-loading { text-align: center; padding: 48px 0; color: var(--ash); font-size: .82rem; }

/* ── PANELS ── */
.panel { display: none; }
.panel.active { display: block; }

/* ── PANEL PAGE HEADER ── */
.panel-header.sec {
  padding: 24px 32px 22px; background: var(--surface);
  border-bottom: 1px solid var(--hairline); margin-bottom: 0;
  position: sticky; top: 0; z-index: 10;
}
.panel-eyebrow {
  font-size: 10.5px; letter-spacing: 0.18em; font-weight: 700;
  color: var(--ash-2); text-transform: uppercase; margin-bottom: 6px;
}
.panel-header .sec-label {
  font-family: var(--sans); font-size: 28px; font-weight: 700;
  color: var(--ink); letter-spacing: -0.025em; text-transform: none;
  letter-spacing: -0.02em;
}

/* Panel body padding */
.panel.active > :not(.panel-header):not(.super-strip) { }
#org-content, #workspaces-list, #levels-list, #audit-list, #users-list, .stats {
  padding: 28px 32px;
}
.stats { padding-bottom: 0; }

/* ── BUTTONS ── */
.btn {
  padding: 7px 14px; border-radius: 999px;
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  background: transparent; color: var(--ink);
  border: 1.5px solid var(--hairline); cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none;
  transition: border-color .15s, background .15s, color .15s;
}
.btn:hover { border-color: var(--ink); }
.btn.primary {
  background: var(--indigo-500); color: #fff; border-color: var(--indigo-500);
  box-shadow: var(--shadow-pop); padding: 9px 18px; font-size: 13px;
}
.btn.primary:hover { background: var(--indigo-600); border-color: var(--indigo-600); }
.btn.sm  { padding: 6px 12px; font-size: 11px; }
.btn.xs  { padding: 5px 11px; font-size: 11px; }
.btn-sm  { padding: 6px 12px; font-size: 11px; border-radius: 999px; }
.btn-danger { color: var(--danger); border-color: #fca5a5; }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.btn-group { display: flex; gap: 6px; flex-wrap: wrap; }

/* icon button (▶ ✉ ✎ ×) */
.icon-btn {
  width: 28px; height: 28px; border-radius: 8px; background: transparent;
  border: 1px solid var(--hairline); font-size: 11px; color: var(--ink);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .12s, background .12s;
}
.icon-btn:hover { border-color: var(--ink); background: var(--surface-2); }

/* ── SECTION HEADER ── */
.sec {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px; gap: 12px; flex-wrap: wrap;
}
.sec-left { display: flex; align-items: center; gap: 10px; }
.sec-label {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  color: var(--ash); letter-spacing: 1.2px; text-transform: uppercase;
}
.sec-count {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  padding: 2px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--hairline); color: var(--ink);
}
.sec-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* pill search / select */
.pill-search {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px;
  background: var(--surface); border: 1.5px solid var(--hairline); border-radius: 999px;
  font-size: 12px; font-weight: 500; color: var(--ink); cursor: pointer; min-width: 180px;
}
.pill-search .ph { color: var(--ash); }
.pill-select {
  padding: 7px 30px 7px 14px; background: var(--surface);
  border: 1.5px solid var(--hairline); border-radius: 999px;
  font-size: 12px; font-weight: 500; color: var(--ink);
  font-family: var(--sans); cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236b6b7d' stroke-width='2.5'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
  transition: border-color .15s;
}
.pill-select:focus { outline: none; border-color: var(--indigo-500); }

/* ── STATS ROW ── */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 32px; }
.stat {
  background: var(--surface); border-radius: 14px; padding: 14px 18px;
  border: 1px solid var(--hairline);
}
.stat-label { font-size: 11px; color: var(--ash); font-weight: 500; letter-spacing: .3px; text-transform: uppercase; margin-bottom: 4px; }
.stat-val { font-family: var(--sans); font-weight: 700; font-size: 22px; letter-spacing: -.5px; color: var(--ink); }
.stat-val .thin { font-weight: 500; color: var(--ash); font-size: 16px; }
.stat-trend { font-size: 11px; color: var(--success); margin-top: 2px; font-weight: 500; }
.stat-trend.down { color: var(--danger); }

/* ── ORG CARD ── */
.org-card {
  background: var(--surface); border-radius: 20px; padding: 24px 28px;
  border: 1px solid var(--hairline); margin-bottom: 24px;
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.org-mark {
  width: 56px; height: 56px; border-radius: 16px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--indigo-500), var(--teal));
  color: #fff; font-family: var(--sans); font-weight: 700; font-size: 22px;
  display: flex; align-items: center; justify-content: center; letter-spacing: -.5px;
}
.org-name { font-family: var(--sans); font-weight: 700; font-size: 22px; letter-spacing: -.6px; }
.org-sub  { font-size: 12px; color: var(--ash); font-family: var(--mono); margin-top: 2px; }

/* ── WORKSPACE GROUP (cases tab) ── */
.ws-group { margin-bottom: 32px; }
.ws-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
  padding-bottom: 12px; border-bottom: 1px solid var(--hairline);
}
.ws-icon {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff;
  font-family: var(--sans); font-weight: 700; font-size: 14px;
}
.ws-name { font-family: var(--sans); font-weight: 700; font-size: 16px; letter-spacing: -.3px; }
.ws-count-pill {
  font-family: var(--mono); font-size: 10px; font-weight: 600; padding: 2px 8px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--hairline); color: var(--ash);
}

/* ── CASE TILE GRID ── */
.tile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 1100px) { .tile-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px)  { .tile-grid { grid-template-columns: 1fr; } }

.tile {
  background: var(--surface); border-radius: 16px; padding: 18px;
  border: 1px solid var(--hairline);
  display: flex; flex-direction: column; gap: 10px; min-height: 168px;
  transition: border-color .15s, box-shadow .15s;
}
.tile:hover { border-color: var(--indigo-200); box-shadow: var(--shadow-md); }
.tile-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tile-status {
  font-size: 10px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  letter-spacing: .3px; text-transform: uppercase;
}
.tile-status.published { background: var(--teal-soft); color: var(--teal-ink); }
.tile-status.draft     { background: var(--amber-bg); color: var(--amber-ink); }
.tile-cat { font-size: 11px; color: var(--ash); font-family: var(--mono); }
.tile-title {
  font-family: var(--sans); font-weight: 700; font-size: 15px;
  color: var(--ink); letter-spacing: -.3px; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tile-role { font-size: 11px; color: var(--ash); font-family: var(--mono); line-height: 1.4; }
.tile-spacer { flex: 1; }
.tile-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 10px; border-top: 1px solid var(--hairline);
}
.tile-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ash); }
.tile-meta .dot { color: var(--indigo-500); font-size: 10px; }
.tile-meta .num { font-family: var(--mono); color: var(--ink); font-weight: 600; }
.tile-meta .sep { padding-left: 8px; border-left: 1px solid var(--hairline); font-size: 10px; font-family: var(--mono); }
.tile-btns { display: flex; gap: 4px; }

.tile-new {
  background: transparent; border-radius: 16px; padding: 18px;
  border: 1.5px dashed var(--hairline); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--ash); font-family: var(--sans); font-size: 13px; font-weight: 600;
  min-height: 168px; transition: border-color .15s, color .15s;
}
.tile-new:hover { border-color: var(--indigo-500); color: var(--indigo-500); }
.tile-new .plus {
  width: 32px; height: 32px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--hairline); display: flex; align-items: center;
  justify-content: center; font-size: 16px; color: var(--indigo-500);
}

/* ── WORKSPACE CARDS GRID ── */
.ws-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 900px) { .ws-grid { grid-template-columns: 1fr; } }

.ws-card {
  background: var(--surface); border-radius: 18px; padding: 22px;
  border: 1px solid var(--hairline);
  display: flex; flex-direction: column; gap: 14px;
}
.ws-card-head { display: flex; align-items: center; gap: 14px; }
.ws-card-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; color: #fff;
  font-family: var(--sans); font-weight: 700; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.ws-card-name { font-family: var(--sans); font-weight: 700; font-size: 17px; letter-spacing: -.4px; }
.ws-card-desc { font-size: 12px; color: var(--ash); margin-top: 2px; }
.ws-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  padding: 12px 14px; background: var(--surface-2); border-radius: 12px;
}
.ws-stat-l { font-size: 10px; color: var(--ash); font-weight: 500; letter-spacing: .3px; text-transform: uppercase; }
.ws-stat-v { font-family: var(--sans); font-weight: 700; font-size: 20px; letter-spacing: -.4px; margin-top: 2px; }
.ws-card-actions { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 4px; border-top: 1px solid var(--hairline); }

.ws-new {
  background: transparent; border-radius: 18px; padding: 22px;
  border: 1.5px dashed var(--hairline); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: var(--ash); font-family: var(--sans); font-size: 13px; font-weight: 600;
  min-height: 160px; transition: border-color .15s, color .15s;
}
.ws-new:hover { border-color: var(--indigo-500); color: var(--indigo-500); }
.ws-new .plus {
  width: 40px; height: 40px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--hairline); display: flex; align-items: center;
  justify-content: center; font-size: 20px; color: var(--indigo-500);
}

/* ── MEMBERS TABLE ── */
.members-card {
  background: var(--surface); border-radius: 18px; border: 1px solid var(--hairline); overflow: hidden;
}
.members-head {
  display: grid; grid-template-columns: 1.6fr 140px 100px;
  padding: 12px 20px; gap: 16px; align-items: center;
  background: var(--surface-2); border-bottom: 1px solid var(--hairline);
  font-family: var(--mono); font-size: 10px; color: var(--ash);
  letter-spacing: .5px; text-transform: uppercase; font-weight: 600;
}
.member-row {
  display: grid; grid-template-columns: 1.6fr 140px 100px;
  padding: 13px 20px; gap: 16px; align-items: center;
  border-bottom: 1px solid var(--hairline); font-size: 13px;
}
.member-row:last-child { border-bottom: none; }
.member-ident { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar {
  width: 28px; height: 28px; border-radius: 999px; color: #fff; flex-shrink: 0;
  font-size: 10px; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.member-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.role {
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  justify-self: start; white-space: nowrap; display: inline-block;
}
.role.admin  { background: var(--teal-soft); color: var(--teal-ink); }
.role.member { background: var(--indigo-50); color: var(--indigo-500); }
.role.owner  { background: linear-gradient(135deg, var(--indigo-500), var(--teal)); color: #fff; }
.role.invited { background: var(--surface-2); color: var(--ash); border: 1px solid var(--hairline); }

/* ── AUDIT LOG ── */
.audit-card {
  background: var(--surface); border-radius: 18px; border: 1px solid var(--hairline); overflow: hidden;
}
.audit-row {
  display: grid; grid-template-columns: 36px 1fr 160px 130px;
  padding: 14px 20px; gap: 16px; align-items: center;
  border-bottom: 1px solid var(--hairline);
}
.audit-row:last-child { border-bottom: none; }
.audit-dot {
  width: 28px; height: 28px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.audit-desc { font-size: 13px; color: var(--ink); line-height: 1.5; }
.audit-desc .actor  { font-weight: 600; }
.audit-desc .action { color: var(--ash); }
.audit-target {
  font-family: var(--mono); font-size: 11px; padding: 2px 8px;
  background: var(--surface-2); border-radius: 6px; border: 1px solid var(--hairline);
  white-space: nowrap;
}
.audit-ws { font-size: 12px; color: var(--ash); font-family: var(--mono); }
.audit-t  { font-size: 12px; color: var(--ash); font-family: var(--mono); text-align: right; }
.audit-pagination {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; border-top: 1px solid var(--hairline);
  font-family: var(--mono); font-size: 11px; color: var(--ash);
}

/* ── EMPTY STATE ── */
.empty { text-align: center; padding: 48px 24px; color: var(--ash); font-size: .85rem; }

/* ── FORMS ── */
form { display: grid; gap: 14px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

label {
  display: block; font-size: .75rem; font-weight: 600;
  color: var(--ink); margin-bottom: 5px; letter-spacing: .01em;
}
input, select, textarea {
  width: 100%; padding: 8px 11px;
  font-family: var(--sans); font-size: .85rem;
  border: 1px solid var(--hairline); border-radius: 8px;
  background: var(--surface); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--indigo-500);
  box-shadow: 0 0 0 3px rgba(67,56,202,.12);
}
textarea { resize: vertical; min-height: 80px; }
textarea.tall { min-height: 160px; }
.hint-text { font-size: .72rem; color: var(--ash); margin-top: 4px; }

/* ── USERS TAB (superadmin) ── */
.tab-super { position: relative; }
.super-pill {
  display: inline-flex; align-items: center; gap: 3px;
  margin-left: 6px; padding: 2px 6px; border-radius: 999px;
  background: linear-gradient(135deg, var(--indigo-500), var(--violet));
  color: #fff; font-family: var(--mono); font-size: 9px; font-weight: 700;
  letter-spacing: .5px; text-transform: uppercase; vertical-align: middle;
}
.super-strip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 32px;
  background: linear-gradient(90deg, #1A1230 0%, var(--indigo-500) 100%);
  color: #fff; font-size: 12.5px;
}
.super-strip-l { display: flex; align-items: center; gap: 10px; }
.super-mark {
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--teal); color: var(--indigo-600);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px; flex-shrink: 0;
}
.super-title { font-weight: 700; font-size: 12.5px; }
.super-sub { font-size: 12px; color: rgba(255,255,255,.78); }
.super-strip-r { display: flex; align-items: center; gap: 12px; flex-shrink: 0; margin-left: auto; }
.super-acting { font-size: 12px; color: rgba(255,255,255,.85); font-family: var(--mono); }
.super-acting strong { color: #fff; font-weight: 600; }
.super-strip .btn { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); color: #fff; padding: 6px 12px; }
.super-strip .btn:hover { background: rgba(255,255,255,.24); border-color: rgba(255,255,255,.4); }

/* filter bar / search */
.users-search {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px;
  background: #fff; border: 1.5px solid var(--hairline); border-radius: 999px;
  min-width: 260px; flex: 1; max-width: 420px;
}
.users-search input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: var(--sans); font-size: 12.5px; color: var(--ink);
}
.users-search input::placeholder { color: var(--ash); }

/* bulk action bar */
.bulk-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; margin-bottom: 12px;
  background: #1A1740; color: #fff; border-radius: 12px;
  box-shadow: 0 8px 20px -12px rgba(26,23,64,.5);
}
.bulk-check { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; }
.bulk-check input { accent-color: var(--violet); }
.bulk-divider { width: 1px; height: 18px; background: rgba(255,255,255,.18); flex-shrink: 0; }
.bulk-act {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16);
  color: #fff; font-family: var(--sans); font-size: 12px; font-weight: 500;
  padding: 6px 11px; border-radius: 8px; cursor: pointer; transition: background .12s;
}
.bulk-act:hover { background: rgba(255,255,255,.18); }
.bulk-act.danger { color: #FCA5A5; border-color: rgba(252,165,165,.35); }
.bulk-act.danger:hover { background: rgba(220,38,38,.25); color: #fff; }
.bulk-clear {
  background: transparent; border: none; color: rgba(255,255,255,.65);
  font-size: 11px; font-family: var(--mono); cursor: pointer; letter-spacing: .3px; margin-left: auto;
}
.bulk-clear:hover { color: #fff; }

/* users table */
.users-table {
  background: #fff; border: 1px solid var(--hairline); border-radius: 14px; overflow: hidden;
}
.users-head, .user-row {
  display: grid;
  grid-template-columns: 36px minmax(200px, 1.4fr) minmax(180px, 1.2fr) minmax(200px, 1.4fr) 90px 130px 100px;
  gap: 12px; align-items: center; padding: 12px 16px;
}
.users-head {
  background: var(--surface-2); border-bottom: 1px solid var(--hairline);
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  color: var(--ash); letter-spacing: .8px; text-transform: uppercase;
}
.col-check input { accent-color: var(--indigo-500); }
.col-actions { text-align: right; }
.user-row { border-bottom: 1px solid var(--hairline); transition: background .12s; }
.user-row:last-child { border-bottom: none; }
.user-row:hover { background: #FAFAFB; }
.user-row.selected { background: var(--indigo-50); }
.user-row.dim .u-cell,
.user-row.dim .u-orgs,
.user-row.dim .u-wss { opacity: .6; }

/* user cell */
.u-cell { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.u-av {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  color: #fff; font-family: var(--sans); font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center; letter-spacing: -.3px;
}
.u-meta { min-width: 0; }
.u-name {
  font-family: var(--sans); font-weight: 700; font-size: 13.5px;
  color: var(--ink); letter-spacing: -.2px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.u-email { font-family: var(--mono); font-size: 11px; color: var(--ash); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.u-tags { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }

/* chips */
.chip {
  font-family: var(--mono); font-size: 9.5px; font-weight: 600; padding: 1px 6px;
  border-radius: 4px; letter-spacing: .3px; text-transform: uppercase;
  background: var(--surface-2); color: var(--ash); border: 1px solid var(--hairline);
  display: inline-flex; align-items: center; gap: 3px;
}
.chip.mfa   { background: #ECFDF5; color: #047857; border-color: #A7F3D0; }
.chip.no-mfa{ background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }
.chip.sup   { background: linear-gradient(135deg, var(--indigo-500), var(--violet)); color: #fff; border: none; }
.chip.invited   { background: var(--amber-bg); color: var(--amber-ink); border-color: #FDE68A; }
.chip.suspended { background: #FEF2F2; color: #B91C1C; border-color: #FECACA; }
.chip.dormant   { background: #F1F5F9; color: #475569; border-color: #E2E8F0; }

/* org/workspace chips */
.u-orgs, .u-wss { display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-start; }
.org-chip-u, .ws-chip-u {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 500; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--hairline);
  padding: 3px 7px 3px 4px; border-radius: 8px; max-width: 100%;
}
.org-mark-sm, .ws-mark-sm {
  width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0;
  color: #fff; font-family: var(--sans); font-weight: 700; font-size: 10px;
  display: flex; align-items: center; justify-content: center; letter-spacing: -.3px;
}
.chip-more { font-family: var(--mono); font-size: 10px; color: var(--ash); padding: 3px 8px; }

/* role pills inside chips */
.role-pill {
  font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  padding: 1px 5px; border-radius: 4px; letter-spacing: .4px; text-transform: uppercase;
  margin-left: 2px;
}
.role-pill.rp-owner  { background: var(--indigo-500); color: #fff; }
.role-pill.rp-admin  { background: var(--indigo-50); color: var(--indigo-500); border: 1px solid var(--indigo-200); }
.role-pill.rp-member { background: #fff; color: var(--ash); border: 1px solid var(--hairline); }

/* cases + last-active columns */
.u-cases { display: flex; flex-direction: column; }
.u-cases-num { font-family: var(--sans); font-weight: 700; font-size: 18px; color: var(--ink); letter-spacing: -.4px; }
.u-cases-num.muted { color: var(--ash); font-weight: 500; }
.u-cases-sub { font-family: var(--mono); font-size: 10px; color: var(--ash); margin-top: 1px; }

.u-active { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--ink); }
.u-active-sub { font-size: 10.5px; color: var(--ash); margin-top: 1px; font-family: var(--mono); }

.dot-status {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px;
}
.dot-status.active { background: var(--success); box-shadow: 0 0 0 3px rgba(16,185,129,.15); }
.dot-status.idle   { background: var(--warn); box-shadow: 0 0 0 3px rgba(245,158,11,.15); }
.dot-status.off    { background: #CBD5E1; }

/* action icons */
.u-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* pagination */
.users-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 4px 4px; font-size: 12px; color: var(--ash); flex-wrap: wrap;
}
.users-foot strong { color: var(--ink); font-weight: 600; }
.pager { display: flex; gap: 4px; align-items: center; }
.pager-btn {
  background: #fff; border: 1px solid var(--hairline); border-radius: 8px;
  padding: 6px 10px; font-family: var(--sans); font-size: 12px; font-weight: 500;
  color: var(--ink); cursor: pointer; min-width: 32px;
}
.pager-btn:hover { border-color: var(--ink); }
.pager-btn:disabled { opacity: .4; cursor: default; }
.pager-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.pager-dot { color: var(--ash); padding: 0 4px; }

/* ── MODALS ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.35); z-index: 100;
  overflow-y: auto; padding: 40px 20px;
}
.modal-overlay.open { display: flex; align-items: flex-start; justify-content: center; }
.modal {
  background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 16px; padding: 28px;
  width: 100%; max-width: 780px; position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
}
.modal h2 { font-size: 1rem; font-weight: 700; margin-bottom: 20px; color: var(--ink); }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  font-size: 1.1rem; cursor: pointer; background: none; border: none;
  color: var(--ash); width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px; transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--canvas); color: var(--ink); }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--hairline);
}

/* ── SPINNER ── */
.spinner {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; animation: spin .6s linear infinite;
  vertical-align: middle; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff;
  font-size: .8rem; font-weight: 500;
  padding: 10px 20px; border-radius: 999px; z-index: 200; display: none;
  box-shadow: 0 4px 16px rgba(0,0,0,.2); white-space: nowrap;
}

/* ── DASHBOARD TABLE (workspace dashboard modal) ── */
.dash-table { width: 100%; border-collapse: collapse; font-size: .8rem; }
.dash-table th {
  text-align: left; padding: 8px 12px;
  background: var(--canvas); border-bottom: 2px solid var(--hairline);
  font-size: .72rem; font-weight: 600; color: var(--ash);
  text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
}
.dash-table td { padding: 10px 12px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.dash-table tr:last-child td { border-bottom: none; }
.dash-table tr:hover td { background: var(--surface-2); }
.cell-won      { color: #059669; font-weight: 600; text-align: center; }
.cell-lost     { color: var(--danger); font-weight: 600; text-align: center; }
.cell-empty    { color: var(--ash); text-align: center; }
.cell-assigned { color: var(--accent-dark); font-size: .72rem; font-weight: 600; text-align: center; background: var(--accent-bg); }
.dash-tab-btn.active { color: var(--ink) !important; border-bottom-color: var(--accent) !important; }

/* ── BADGES (legacy, used in some modals) ── */
.badge { display: inline-block; font-size: .7rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.badge-published  { background: #D1FAE5; color: #059669; }
.badge-draft      { background: var(--amber-bg); color: var(--amber-ink); }
.badge-easy, .badge-1, .badge-2 { color: #059669; }
.badge-medium, .badge-3         { color: #C2410C; }
.badge-hard, .badge-4, .badge-5 { color: var(--danger); }
.badge-trial      { background: var(--surface-2); color: var(--ash); border: 1px solid var(--hairline); }
.badge-pro        { background: var(--indigo-50); color: var(--indigo-600); }
.badge-business   { background: #F5F3FF; color: #6D28D9; }
.badge-enterprise { background: #D1FAE5; color: #059669; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .page { margin: 0; border-radius: 0; }
  .topbar { padding: 12px 20px; border-radius: 0; }
  .tabs, .body { padding-left: 20px; padding-right: 20px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .members-head, .member-row { grid-template-columns: 1.6fr 110px; }
  .members-head > *:nth-child(3), .member-row > *:nth-child(3) { display: none; }
  .audit-row { grid-template-columns: 32px 1fr 100px; }
  .audit-row > .audit-ws { display: none; }
  .top-email { display: none; }
}

/* ═══════════════════════════ CASE WIZARD v2 (full-page) ═══════════════════ */

.wiz-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 200;
  background: #fafaf9;
  overflow-y: auto;
  --wiz-surface: #ffffff;
  --wiz-surface-2: #f5f5f4;
  --wiz-surface-3: #efeeec;
  --wiz-ink: #0c0a09;
  --wiz-ink-2: #1c1917;
  --wiz-muted: #78716c;
  --wiz-muted-2: #a8a29e;
  --wiz-border: #e7e5e4;
  --wiz-border-2: #d6d3d1;
  --wiz-accent: #4338CA;
  --wiz-accent-dark: #3730A3;
  --wiz-accent-bg: #EEF2FF;
  --wiz-accent-wash: #F0F4FF;
  --wiz-primary: #4338CA;
  --wiz-danger: #E11D48;
  --wiz-danger-bg: #FFF1F2;
  --wiz-success: #059669;
  --wiz-ai: #7c3aed;
  --wiz-ai-bg: oklch(0.97 0.02 300);
  --wiz-shadow-sm: 0 1px 2px rgba(12,10,9,.04), 0 1px 1px rgba(12,10,9,.02);
  --wiz-shadow: 0 1px 3px rgba(12,10,9,.06), 0 1px 2px rgba(12,10,9,.04);
  --wiz-shadow-lg: 0 10px 30px rgba(12,10,9,.08), 0 2px 6px rgba(12,10,9,.04);
  --wiz-radius-sm: 6px;
  --wiz-radius: 10px;
  --wiz-radius-lg: 14px;
  --wiz-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --wiz-mono: 'JetBrains Mono', 'ui-monospace', 'SFMono-Regular', monospace;
}
.wiz-overlay.open { display: block; }

/* topbar */
.wiz-topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(250,250,249,.9);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--wiz-border);
}
.wiz-topbar-inner {
  max-width: 1280px; margin: 0 auto;
  height: 56px; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.wiz-crumbs { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--wiz-muted); font-family: var(--wiz-sans); }
.wiz-logo { width: 22px; height: 22px; border-radius: 5px; }
.wiz-crumbs a { color: var(--wiz-muted); text-decoration: none; }
.wiz-crumbs a:hover { color: var(--wiz-ink); }
.wiz-sep { color: var(--wiz-muted-2); }
.wiz-cur { color: var(--wiz-ink); font-weight: 600; }
.wiz-top-actions { display: flex; align-items: center; gap: 8px; }
.wiz-status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--wiz-muted); font-family: var(--wiz-sans);
  padding: 5px 10px; border-radius: 20px;
  background: var(--wiz-surface-2); border: 1px solid var(--wiz-border);
}
.wiz-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--wiz-muted-2); }
.wiz-status-pill.saved .wiz-dot { background: var(--wiz-success); }

/* page grid */
.wiz-page {
  max-width: 1280px; margin: 0 auto;
  padding: 28px 24px 80px;
  display: grid; grid-template-columns: minmax(0,1fr) 400px;
  gap: 28px; align-items: start;
  font-family: var(--wiz-sans); font-size: 14px; color: var(--wiz-ink);
}
@media (max-width: 1080px) { .wiz-page { grid-template-columns: 1fr; } .wiz-preview-pane { position: static !important; } }

/* page header */
.wiz-page-head { grid-column: 1 / -1; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 4px; }
.wiz-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--wiz-muted); font-weight: 600; margin-bottom: 6px; font-family: var(--wiz-sans); }
.wiz-eyebrow button { margin-left: 10px; font-size: 11px; color: var(--wiz-muted); text-decoration: underline; background: none; border: none; cursor: pointer; padding: 0; font-weight: 500; font-family: var(--wiz-sans); }
.wiz-eyebrow button:hover { color: var(--wiz-ink); }
.wiz-page-h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; color: var(--wiz-ink); margin: 0; }
.wiz-page-sub { color: var(--wiz-muted); font-size: 14px; max-width: 540px; margin-top: 8px; }
.wiz-meta-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.wiz-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 500; color: var(--wiz-muted); background: var(--wiz-surface-2); border: 1px solid var(--wiz-border); font-family: var(--wiz-sans); }
.wiz-chip .wiz-chip-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--wiz-accent); }

/* stepper */
.wiz-stepper { display: flex; align-items: center; padding: 20px 24px; background: var(--wiz-surface); border: 1px solid var(--wiz-border); border-radius: var(--wiz-radius); box-shadow: var(--wiz-shadow-sm); margin-bottom: 20px; }
.wiz-step { display: flex; align-items: center; gap: 12px; color: var(--wiz-muted); flex-shrink: 0; }
.wiz-step-num {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--wiz-border-2); background: var(--wiz-surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--wiz-muted);
  transition: all .18s; flex-shrink: 0;
}
.wiz-step-text { display: flex; flex-direction: column; line-height: 1.2; }
.wiz-step-label { font-size: 13px; font-weight: 600; }
.wiz-step-sub { font-size: 11px; color: var(--wiz-muted-2); font-weight: 500; margin-top: 1px; }
.wiz-step.active { color: var(--wiz-ink); cursor: default; }
.wiz-step.active .wiz-step-num { background: var(--wiz-accent); border-color: var(--wiz-accent); color: #fff; box-shadow: 0 0 0 4px var(--wiz-accent-wash); }
.wiz-step.done { color: var(--wiz-ink-2); cursor: pointer; }
.wiz-step.done .wiz-step-num { background: var(--wiz-ink); border-color: var(--wiz-ink); color: #fff; }
.wiz-step.clickable:hover .wiz-step-num { opacity: .8; }
.wiz-connector { flex: 1; height: 1.5px; background: var(--wiz-border); margin: 0 16px; border-radius: 2px; min-width: 24px; }
.wiz-connector.done { background: var(--wiz-ink); }

/* form surface */
.wiz-form-surface { background: var(--wiz-surface); border: 1px solid var(--wiz-border); border-radius: var(--wiz-radius-lg); box-shadow: var(--wiz-shadow); }
.wiz-form-head { padding: 24px 28px 18px; border-bottom: 1px solid var(--wiz-border); display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.wiz-form-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; color: var(--wiz-ink); margin: 0; }
.wiz-form-descr { font-size: 13px; color: var(--wiz-muted); margin-top: 4px; }
.wiz-step-counter { font-size: 11.5px; color: var(--wiz-muted); padding: 4px 9px; border-radius: 999px; background: var(--wiz-surface-2); border: 1px solid var(--wiz-border); white-space: nowrap; }
.wiz-form-body { padding: 24px 28px 28px; display: grid; gap: 20px; }
.wiz-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .wiz-form-row { grid-template-columns: 1fr; } }
.wiz-form-foot { padding: 16px 28px; border-top: 1px solid var(--wiz-border); display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--wiz-surface-2); }
.wiz-foot-hint { font-size: 12px; color: var(--wiz-muted); }

/* fields */
.wiz-field { display: flex; flex-direction: column; gap: 6px; }
.wiz-field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wiz-field label { font-size: 12.5px; font-weight: 600; color: var(--wiz-ink-2); letter-spacing: -.005em; margin: 0; }
.wiz-field label .wiz-opt { color: var(--wiz-muted-2); font-weight: 500; }
.wiz-field .wiz-hint { font-size: 12px; color: var(--wiz-muted); }
.wiz-input, .wiz-textarea, .wiz-select {
  width: 100%; border: 1px solid var(--wiz-border-2); background: var(--wiz-surface);
  border-radius: var(--wiz-radius-sm); padding: 10px 12px; font-size: 14px;
  font-family: var(--wiz-sans); color: var(--wiz-ink);
  transition: border-color .12s, box-shadow .12s;
}
.wiz-input:hover, .wiz-textarea:hover { border-color: var(--wiz-muted-2); }
.wiz-input:focus, .wiz-textarea:focus, .wiz-select:focus { outline: none; border-color: var(--wiz-accent); box-shadow: 0 0 0 3px var(--wiz-accent-wash); }
.wiz-textarea { resize: vertical; min-height: 88px; line-height: 1.55; }
.wiz-select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2378716c' stroke-width='2.5'><polyline points='6 9 12 15 18 9'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

/* difficulty segmented */
.wiz-seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; background: var(--wiz-surface-2); padding: 4px; border-radius: 8px; border: 1px solid var(--wiz-border); }
.wiz-seg-btn { padding: 8px 4px; font-size: 12px; font-weight: 600; color: var(--wiz-muted); border-radius: 5px; transition: all .14s; display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: none; cursor: pointer; font-family: var(--wiz-sans); }
.wiz-seg-btn .wiz-seg-n { font-size: 14px; font-weight: 700; }
.wiz-seg-btn:hover { color: var(--wiz-ink); background: var(--wiz-surface); }
.wiz-seg-btn.on { background: var(--wiz-ink); color: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); }

/* resistance slider */
.wiz-slider-row { display: flex; align-items: center; gap: 14px; }
.wiz-slider-row input[type="range"] { flex: 1; -webkit-appearance: none; appearance: none; height: 6px; background: linear-gradient(to right, var(--wiz-accent) 0%, var(--wiz-accent) var(--p, 0%), var(--wiz-border-2) var(--p, 0%), var(--wiz-border-2) 100%); border-radius: 999px; outline: none; }
.wiz-slider-row input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--wiz-accent); cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.wiz-slider-val { font-family: var(--wiz-mono); font-size: 13px; font-weight: 600; color: var(--wiz-ink); min-width: 54px; text-align: right; }
.wiz-slider-val small { color: var(--wiz-muted); font-weight: 400; margin-left: 4px; }

/* AI button */
.wiz-ai-btn { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; color: var(--wiz-ai); padding: 3px 8px; border-radius: 6px; border: 1px solid transparent; background: var(--wiz-ai-bg); transition: all .12s; cursor: pointer; font-family: var(--wiz-sans); }
.wiz-ai-btn:hover { border-color: color-mix(in oklab, var(--wiz-ai) 30%, transparent); }
.wiz-ai-btn:disabled { opacity: .5; cursor: not-allowed; }

/* nav buttons */
.wiz-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; letter-spacing: -.005em; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--wiz-border-2); background: var(--wiz-surface); color: var(--wiz-ink); transition: all .14s; cursor: pointer; font-family: var(--wiz-sans); }
.wiz-btn:hover { background: var(--wiz-surface-2); border-color: var(--wiz-muted-2); }
.wiz-btn-primary { background: var(--wiz-ink); color: #fff; border-color: var(--wiz-ink); }
.wiz-btn-primary:hover { background: #000; border-color: #000; }
.wiz-btn-accent { background: var(--wiz-accent); color: #fff; border-color: var(--wiz-accent); }
.wiz-btn-accent:hover { background: var(--wiz-accent-dark); border-color: var(--wiz-accent-dark); }
.wiz-btn-ghost { border-color: transparent; background: transparent; color: var(--wiz-muted); }
.wiz-btn-ghost:hover { background: var(--wiz-surface-2); color: var(--wiz-ink); }
.wiz-btn:disabled { opacity: .5; cursor: not-allowed; }

/* AI-first variant */
.wiz-ai-first { background: var(--wiz-surface); border: 1px solid var(--wiz-border); border-radius: var(--wiz-radius-lg); box-shadow: var(--wiz-shadow); overflow: hidden; background-image: radial-gradient(ellipse at top right, var(--wiz-ai-bg), transparent 60%); }
.wiz-ai-first-body { padding: 36px; }
.wiz-ai-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--wiz-ai); padding: 4px 10px; border-radius: 999px; background: var(--wiz-ai-bg); border: 1px solid color-mix(in oklab, var(--wiz-ai) 20%, transparent); margin-bottom: 14px; font-family: var(--wiz-sans); }
.wiz-ai-first h2 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 8px; line-height: 1.15; color: var(--wiz-ink); }
.wiz-ai-first-sub { color: var(--wiz-muted); font-size: 14px; max-width: 520px; margin-bottom: 22px; }
.wiz-ai-textarea-wrap { position: relative; border: 1.5px solid var(--wiz-border-2); border-radius: var(--wiz-radius); background: var(--wiz-surface); transition: all .14s; overflow: hidden; }
.wiz-ai-textarea-wrap:focus-within { border-color: var(--wiz-ai); box-shadow: 0 0 0 4px color-mix(in oklab, var(--wiz-ai) 12%, transparent); }
.wiz-ai-textarea-wrap textarea { width: 100%; border: 0; background: transparent; padding: 16px 18px 12px; font-size: 14.5px; line-height: 1.6; min-height: 140px; resize: none; outline: none; font-family: var(--wiz-sans); color: var(--wiz-ink); }
.wiz-ai-textarea-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--wiz-border); background: var(--wiz-surface-2); }
.wiz-ai-textarea-foot .wiz-ai-count { font-size: 11px; color: var(--wiz-muted); font-family: var(--wiz-mono); }
.wiz-ai-examples h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--wiz-muted); font-weight: 600; margin: 20px 0 10px; font-family: var(--wiz-sans); }
.wiz-ai-example-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.wiz-ai-example { text-align: left; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--wiz-border); background: var(--wiz-surface); transition: all .14s; display: flex; gap: 10px; cursor: pointer; }
.wiz-ai-example:hover { border-color: var(--wiz-ai); transform: translateY(-1px); }
.wiz-ai-example-icon { width: 28px; height: 28px; border-radius: 6px; background: var(--wiz-ai-bg); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.wiz-ai-example-t { font-size: 12.5px; font-weight: 600; color: var(--wiz-ink); line-height: 1.3; margin-bottom: 2px; }
.wiz-ai-example-d { font-size: 11.5px; color: var(--wiz-muted); line-height: 1.4; }
.wiz-generating { padding: 28px; border-radius: var(--wiz-radius); border: 1px dashed color-mix(in oklab, var(--wiz-ai) 40%, var(--wiz-border)); background: color-mix(in oklab, var(--wiz-ai) 3%, var(--wiz-surface)); text-align: center; }
.wiz-generating .wiz-spinner { width: 24px; height: 24px; border-radius: 50%; border: 2.5px solid var(--wiz-border); border-top-color: var(--wiz-ai); animation: wiz-spin .8s linear infinite; margin: 0 auto 12px; }
@keyframes wiz-spin { to { transform: rotate(360deg); } }
.wiz-generating h4 { font-size: 14px; font-weight: 600; color: var(--wiz-ink); margin-bottom: 4px; }
.wiz-generating p { font-size: 12.5px; color: var(--wiz-muted); }
.wiz-ai-filled-note { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px; background: var(--wiz-ai-bg); border: 1px solid color-mix(in oklab, var(--wiz-ai) 20%, transparent); margin: 14px 28px 0; color: #5b21b6; font-size: 12.5px; font-weight: 500; font-family: var(--wiz-sans); }

/* mode picker */
.wiz-mode-picker { display: grid; gap: 14px; padding: 36px; }
.wiz-mode-intro { margin-bottom: 24px; }
.wiz-mode-intro h2 { font-size: 22px; font-weight: 700; letter-spacing: -.015em; margin-bottom: 6px; color: var(--wiz-ink); }
.wiz-mode-intro p { font-size: 14px; color: var(--wiz-muted); max-width: 520px; }
.wiz-mode-card { display: grid; grid-template-columns: 56px 1fr auto; gap: 18px; align-items: center; text-align: left; background: var(--wiz-surface); border: 1.5px solid var(--wiz-border); border-radius: var(--wiz-radius-lg); padding: 22px 24px; cursor: pointer; transition: all .14s; width: 100%; font-family: var(--wiz-sans); }
.wiz-mode-card:hover { box-shadow: var(--wiz-shadow); transform: translateY(-1px); }
.wiz-mode-card.ai:hover { border-color: var(--wiz-ai); }
.wiz-mode-card.form:hover { border-color: var(--wiz-accent); }
.wiz-mode-icon { width: 56px; height: 56px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.wiz-mode-card.ai .wiz-mode-icon { background: var(--wiz-ai-bg); color: var(--wiz-ai); }
.wiz-mode-card.form .wiz-mode-icon { background: var(--wiz-accent-wash); color: var(--wiz-accent-dark); border: 1px solid var(--wiz-accent-bg); }
.wiz-mode-title { font-size: 16px; font-weight: 700; letter-spacing: -.01em; color: var(--wiz-ink); margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.wiz-mode-tag { font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: .06em; }
.wiz-mode-card.ai .wiz-mode-tag { background: var(--wiz-ai-bg); color: var(--wiz-ai); }
.wiz-mode-card.form .wiz-mode-tag { background: var(--wiz-surface-2); color: var(--wiz-muted); border: 1px solid var(--wiz-border); }
.wiz-mode-desc { font-size: 13px; color: var(--wiz-muted); line-height: 1.5; }
.wiz-mode-meta { display: flex; gap: 14px; margin-top: 8px; font-size: 11.5px; color: var(--wiz-muted); }
.wiz-mode-cta { font-size: 13px; font-weight: 600; color: var(--wiz-muted-2); transition: all .14s; }
.wiz-mode-card:hover .wiz-mode-cta { color: var(--wiz-ink); transform: translateX(2px); }
.wiz-mode-divider { text-align: center; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--wiz-muted-2); font-weight: 600; padding: 4px 0; font-family: var(--wiz-sans); }

/* personality grid */
.wiz-persona-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 8px; }
.wiz-persona-card { text-align: left; padding: 12px 13px; border-radius: var(--wiz-radius-sm); border: 1px solid var(--wiz-border); background: var(--wiz-surface); cursor: pointer; transition: all .12s; display: grid; gap: 4px; position: relative; width: 100%; font-family: var(--wiz-sans); }
.wiz-persona-card:hover { border-color: var(--wiz-muted-2); background: var(--wiz-surface-2); }
.wiz-persona-card.on { border-color: var(--wiz-ink); background: var(--wiz-ink); color: #fff; }
.wiz-persona-card.on::after { content: '✓'; position: absolute; top: 8px; right: 10px; font-size: 11px; font-weight: 700; color: var(--wiz-accent); }
.wiz-persona-label { font-size: 13px; font-weight: 600; }
.wiz-persona-desc { font-size: 11.5px; line-height: 1.4; color: var(--wiz-muted); }
.wiz-persona-card.on .wiz-persona-desc { color: rgba(255,255,255,.7); }

/* lever list */
.wiz-lever-list { display: grid; gap: 6px; }
.wiz-lever-row { display: grid; grid-template-columns: auto minmax(160px,1fr) minmax(160px,200px) auto; gap: 8px; align-items: center; padding: 7px 9px; border-radius: var(--wiz-radius-sm); background: var(--wiz-surface-2); border: 1px solid var(--wiz-border); }
.wiz-lever-when { font-size: 11.5px; color: var(--wiz-muted); font-weight: 500; padding-left: 4px; white-space: nowrap; }
.wiz-lever-trigger { font-size: 13px; padding: 7px 10px; }
.wiz-lever-effect { font-size: 12px; padding: 7px 28px 7px 10px; font-weight: 600; border-left: 3px solid var(--fx, var(--wiz-muted-2)); }
.wiz-lever-remove { width: 26px; height: 26px; border-radius: 6px; font-size: 18px; line-height: 1; color: var(--wiz-muted-2); background: transparent; border: 1px solid transparent; cursor: pointer; transition: all .12s; display: flex; align-items: center; justify-content: center; }
.wiz-lever-remove:hover { background: var(--wiz-danger-bg); color: var(--wiz-danger); }
.wiz-lever-empty { padding: 14px; text-align: center; font-size: 12.5px; color: var(--wiz-muted-2); border: 1px dashed var(--wiz-border-2); border-radius: var(--wiz-radius-sm); }
.wiz-lever-add { padding: 8px 12px; font-size: 12.5px; font-weight: 600; color: var(--wiz-accent-dark); background: transparent; border: 1px dashed var(--wiz-border-2); border-radius: var(--wiz-radius-sm); cursor: pointer; transition: all .12s; font-family: var(--wiz-sans); }
.wiz-lever-add:hover { background: var(--wiz-accent-wash); border-color: var(--wiz-accent); }

/* advanced prompt viewer */
.wiz-advanced { margin-top: 8px; padding-top: 14px; border-top: 1px dashed var(--wiz-border-2); }
.wiz-advanced-toggle { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; color: var(--wiz-muted); background: transparent; border: none; cursor: pointer; padding: 4px 0; font-family: var(--wiz-sans); }
.wiz-advanced-toggle:hover { color: var(--wiz-ink-2); }
.wiz-advanced-toggle svg { transition: transform .15s; }
.wiz-advanced-toggle.open svg { transform: rotate(90deg); }
.wiz-advanced-sub { font-weight: 400; font-size: 11px; color: var(--wiz-muted-2); margin-left: 4px; }
.wiz-prompt-view { margin-top: 10px; padding: 14px 16px; font-family: var(--wiz-mono); font-size: 11.5px; line-height: 1.65; color: var(--wiz-muted); background: var(--wiz-surface-3); border: 1px solid var(--wiz-border); border-radius: var(--wiz-radius-sm); white-space: pre-wrap; word-break: break-word; max-height: 300px; overflow-y: auto; }

/* review grid */
.wiz-review-grid { border: 1px solid var(--wiz-border); border-radius: var(--wiz-radius); overflow: hidden; }
.wiz-review-row { display: grid; grid-template-columns: 150px 1fr auto; gap: 16px; align-items: start; padding: 12px 16px; border-bottom: 1px solid var(--wiz-border); background: var(--wiz-surface); }
.wiz-review-row:last-child { border-bottom: none; }
.wiz-review-label { font-size: 11px; font-weight: 600; color: var(--wiz-muted); text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; }
.wiz-review-val { font-size: 13.5px; color: var(--wiz-ink); word-break: break-word; line-height: 1.55; white-space: pre-wrap; }
.wiz-review-val.empty { color: var(--wiz-muted-2); font-style: italic; }
.wiz-review-edit { font-size: 11.5px; color: var(--wiz-muted); padding: 3px 7px; border-radius: 5px; background: none; border: none; cursor: pointer; white-space: nowrap; }
.wiz-review-edit:hover { background: var(--wiz-surface-2); color: var(--wiz-ink); }

/* publish card */
.wiz-publish-card { margin-top: 20px; padding: 16px 18px; border-radius: var(--wiz-radius); background: var(--wiz-accent-wash); border: 1px solid var(--wiz-accent-bg); display: flex; align-items: flex-start; gap: 14px; }
.wiz-publish-card h4 { font-size: 13.5px; font-weight: 600; color: var(--wiz-ink-2); margin-bottom: 2px; }
.wiz-publish-card p { font-size: 12.5px; color: var(--wiz-accent-dark); }
.wiz-switch { position: relative; width: 36px; height: 20px; flex-shrink: 0; }
.wiz-switch input { opacity: 0; width: 0; height: 0; }
.wiz-switch-slider { position: absolute; inset: 0; background: var(--wiz-border-2); border-radius: 999px; cursor: pointer; transition: background .16s; }
.wiz-switch-slider::before { content: ''; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.wiz-switch input:checked + .wiz-switch-slider { background: var(--wiz-accent); }
.wiz-switch input:checked + .wiz-switch-slider::before { transform: translateX(16px); }

/* category combobox dropdown */
.wiz-cat-dropdown { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50; background: var(--wiz-surface); border: 1px solid var(--wiz-border-2); border-radius: var(--wiz-radius-sm); box-shadow: var(--wiz-shadow-lg); max-height: 320px; overflow-y: auto; padding: 4px; }
.wiz-cat-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 5px; background: transparent; border: none; cursor: pointer; text-align: left; font-family: var(--wiz-sans); transition: background .1s; }
.wiz-cat-btn:hover { background: var(--wiz-surface-2); }
.wiz-cat-btn.selected { background: var(--wiz-surface-2); }
.wiz-cat-name { font-size: 13px; font-weight: 600; color: var(--wiz-ink); }
.wiz-cat-desc { font-size: 11.5px; color: var(--wiz-muted); }
.wiz-cat-check { color: var(--wiz-accent); font-size: 12px; font-weight: 700; }
.wiz-cat-sep { border: none; border-top: 1px solid var(--wiz-border); margin: 4px 0; }
.wiz-cat-add { display: flex; align-items: center; gap: 6px; width: 100%; padding: 9px 10px; border-radius: 5px; background: transparent; border: none; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--wiz-accent-dark); font-family: var(--wiz-sans); }
.wiz-cat-add:hover { background: var(--wiz-accent-wash); }

/* preview pane */
.wiz-preview-pane { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 14px; }
.wiz-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px; }
.wiz-preview-head h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--wiz-muted); font-weight: 600; font-family: var(--wiz-sans); }
.wiz-preview-tabs { display: inline-flex; padding: 3px; border-radius: 8px; background: var(--wiz-surface-2); border: 1px solid var(--wiz-border); gap: 2px; }
.wiz-preview-tab { font-size: 12px; font-weight: 600; color: var(--wiz-muted); padding: 5px 10px; border-radius: 5px; transition: all .12s; background: none; border: none; cursor: pointer; font-family: var(--wiz-sans); }
.wiz-preview-tab.on { background: var(--wiz-surface); color: var(--wiz-ink); box-shadow: var(--wiz-shadow-sm); }
.wiz-preview-card { background: var(--wiz-surface); border: 1px solid var(--wiz-border); border-radius: var(--wiz-radius); padding: 20px 22px 18px; box-shadow: var(--wiz-shadow); position: relative; overflow: hidden; }
.wiz-preview-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--wiz-accent); }
.wiz-pc-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.wiz-pc-cat { font-size: 10.5px; font-weight: 600; color: var(--wiz-accent-dark); background: var(--wiz-accent-wash); border: 1px solid var(--wiz-accent-bg); padding: 2px 8px; border-radius: 999px; }
.wiz-pc-ws { font-size: 10.5px; font-weight: 500; color: var(--wiz-muted); background: var(--wiz-surface-2); border: 1px solid var(--wiz-border); padding: 2px 8px; border-radius: 999px; }
.wiz-pc-diff { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; color: var(--wiz-ink-2); font-family: var(--wiz-mono); }
.wiz-pc-bars { display: inline-flex; gap: 2px; }
.wiz-pc-bar { width: 3px; height: 10px; background: var(--wiz-border-2); border-radius: 1px; }
.wiz-pc-bar.on { background: var(--wiz-ink); }
.wiz-pc-title { font-weight: 700; font-size: 16px; color: var(--wiz-ink); line-height: 1.3; letter-spacing: -.01em; margin-bottom: 6px; font-family: var(--wiz-sans); }
.wiz-pc-company { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--wiz-muted); font-weight: 500; margin-bottom: 14px; }
.wiz-pc-avatar { width: 18px; height: 18px; border-radius: 4px; background: var(--wiz-ink); color: #fff; font-size: 8px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-family: var(--wiz-mono); flex-shrink: 0; }
.wiz-pc-situation { font-size: 12.5px; color: var(--wiz-ink-2); line-height: 1.55; padding: 12px 14px; background: var(--wiz-surface-2); border: 1px solid var(--wiz-border); border-radius: 8px; }
.wiz-pc-situation.empty { color: var(--wiz-muted-2); font-style: italic; }
.wiz-pc-draft { position: absolute; top: 14px; right: 14px; display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; color: var(--wiz-muted); background: var(--wiz-surface-2); border: 1px solid var(--wiz-border); padding: 3px 8px; border-radius: 999px; }
.wiz-pc-draft .wiz-pc-draft-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--wiz-muted-2); }
.wiz-pc-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--wiz-border); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wiz-pc-stats { display: inline-flex; gap: 14px; font-size: 11.5px; color: var(--wiz-muted); }
.wiz-pc-stats strong { color: var(--wiz-ink-2); font-weight: 600; font-family: var(--wiz-mono); font-size: 12px; }
.wiz-pc-play { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--wiz-accent-dark); background: var(--wiz-accent-wash); border: 1px solid var(--wiz-accent-bg); padding: 5px 10px; border-radius: 6px; font-family: var(--wiz-sans); }
.wiz-preview-chat { background: var(--wiz-surface); border: 1px solid var(--wiz-border); border-radius: var(--wiz-radius); overflow: hidden; box-shadow: var(--wiz-shadow); }
.wiz-chat-head { padding: 12px 16px; background: var(--wiz-primary); color: #fff; display: flex; align-items: center; gap: 10px; }
.wiz-chat-avatar { width: 28px; height: 28px; border-radius: 6px; background: linear-gradient(135deg,#dc2626,#991b1b); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; font-family: var(--wiz-mono); flex-shrink: 0; }
.wiz-chat-name { font-size: 13px; font-weight: 600; font-family: var(--wiz-sans); }
.wiz-chat-subt { font-size: 11px; color: rgba(255,255,255,.65); font-family: var(--wiz-mono); }
.wiz-chat-body { padding: 18px; background: var(--wiz-surface-2); min-height: 100px; }
.wiz-bot-msg { background: var(--wiz-surface); border: 1px solid var(--wiz-border); border-radius: 10px; padding: 12px 14px; font-size: 13px; line-height: 1.55; color: var(--wiz-ink-2); max-width: 85%; box-shadow: var(--wiz-shadow-sm); font-family: var(--wiz-sans); }
.wiz-bot-msg.empty { color: var(--wiz-muted-2); font-style: italic; }
.wiz-chat-foot { padding: 10px 14px; background: var(--wiz-surface); border-top: 1px solid var(--wiz-border); display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--wiz-muted); font-family: var(--wiz-mono); }
.wiz-stats-card { background: var(--wiz-surface); border: 1px solid var(--wiz-border); border-radius: var(--wiz-radius); padding: 14px 16px; display: grid; gap: 10px; box-shadow: var(--wiz-shadow-sm); }
.wiz-stats-title { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--wiz-muted); font-weight: 600; font-family: var(--wiz-sans); }
.wiz-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wiz-stats-cell .v { font-size: 16px; font-weight: 700; color: var(--wiz-ink); letter-spacing: -.01em; font-family: var(--wiz-mono); }
.wiz-stats-cell .k { font-size: 10.5px; color: var(--wiz-muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 500; font-family: var(--wiz-sans); }
.wiz-checklist-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 4px 0; font-family: var(--wiz-sans); }
.wiz-check-circle { width: 14px; height: 14px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: #fff; flex-shrink: 0; }
.wiz-check-circle.done { background: var(--wiz-success); }
.wiz-check-circle.todo { background: transparent; border: 1.5px solid var(--wiz-border-2); color: transparent; }

@keyframes wiz-fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.wiz-fade-up { animation: wiz-fade-up .28s ease both; }

/* ═══════════════════════════════════════════════════════════════
   NEW WORKSPACE MODAL — Socratize design system
═══════════════════════════════════════════════════════════════ */
#workspace-modal .modal {
  padding: 0; max-width: 760px; overflow: hidden;
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(14,14,26,.18), 0 8px 24px rgba(14,14,26,.10);
}

/* Head */
#workspace-modal .wm-head {
  padding: 22px 28px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  border-bottom: 1px solid var(--hairline); background: #fff;
}
#workspace-modal .wm-head-l { display: flex; align-items: center; gap: 14px; min-width: 0; }
#workspace-modal .wm-mark {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--indigo-500), var(--teal));
  color: #fff; display: flex; align-items: center; justify-content: center;
}
#workspace-modal .wm-mark svg { width: 20px; height: 20px; }
#workspace-modal .wm-pre {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  color: var(--ash); letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 3px;
}
#workspace-modal .wm-head h2 {
  font-family: var(--sans); font-weight: 700; font-size: 22px;
  color: var(--ink); letter-spacing: -.5px; line-height: 1.1; margin: 0;
}
#workspace-modal .wm-close {
  width: 36px; height: 36px; border-radius: 999px; flex-shrink: 0;
  background: transparent; border: 1.5px solid var(--hairline);
  cursor: pointer; color: var(--ash); font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: border-color .15s, color .15s; position: static;
}
#workspace-modal .wm-close:hover { border-color: var(--ink); color: var(--ink); background: transparent; }

/* Step rail */
#workspace-modal .wm-steps {
  display: flex; gap: 0; padding: 12px 28px; background: var(--surface-2);
  border-bottom: 1px solid var(--hairline);
  font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--ash);
  letter-spacing: .4px; text-transform: uppercase;
}
#workspace-modal .wm-step {
  display: inline-flex; align-items: center; gap: 8px; padding-right: 18px; margin-right: 18px;
  position: relative;
}
#workspace-modal .wm-step:not(:last-child)::after {
  content: ""; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 8px; height: 1px; background: var(--ash);
}
#workspace-modal .wm-step .wm-num {
  width: 20px; height: 20px; border-radius: 999px; background: #fff;
  border: 1.5px solid var(--hairline); color: var(--ash);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
}
#workspace-modal .wm-step.active { color: var(--indigo-500); }
#workspace-modal .wm-step.active .wm-num { background: var(--indigo-500); color: #fff; border-color: var(--indigo-500); }

/* Body */
#workspace-modal .wm-body {
  max-height: calc(100vh - 240px); overflow: auto; padding: 8px 0 0; background: #fff;
}
#workspace-modal .wm-body h2 { display: none; }

/* Section panels */
#workspace-modal .wm-panel {
  margin: 22px 28px 0;
  border: 1px solid var(--hairline); border-radius: 18px; background: #fff;
}
#workspace-modal .wm-panel:last-of-type { margin-bottom: 22px; }
#workspace-modal .wm-panel-head {
  padding: 14px 20px 12px; border-bottom: 1px solid var(--hairline-2);
  display: flex; align-items: center; gap: 10px;
}
#workspace-modal .wm-panel-num {
  width: 22px; height: 22px; border-radius: 7px;
  background: var(--indigo-50); color: var(--indigo-500);
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
#workspace-modal .wm-panel-title {
  font-family: var(--sans); font-weight: 700; font-size: 14px;
  color: var(--ink); letter-spacing: -.2px;
}
#workspace-modal .wm-panel-sub { font-size: 12px; color: var(--ash); margin-left: auto; }
#workspace-modal .wm-panel-body { padding: 18px 20px 20px; }

/* Field */
#workspace-modal .wm-grid-2 { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
#workspace-modal .wm-field { display: flex; flex-direction: column; gap: 6px; }
#workspace-modal .wm-field-label {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--sans); font-size: 13px; font-weight: 600;
  color: var(--ink); letter-spacing: -.1px;
}
#workspace-modal .wm-field-label .req { color: var(--indigo-500); font-weight: 700; }
#workspace-modal .wm-field-help { font-size: 11.5px; color: var(--ash); line-height: 1.45; }
#workspace-modal .wm-field-help.mono { font-family: var(--mono); }

/* Input wrap (prefix/suffix) */
#workspace-modal .wm-input-wrap {
  display: flex; align-items: center;
  border: 1.5px solid var(--hairline); border-radius: 12px; background: #fff;
  transition: border-color .15s, box-shadow .15s; overflow: hidden;
}
#workspace-modal .wm-input-wrap:focus-within {
  border-color: var(--indigo-500); box-shadow: 0 0 0 4px var(--indigo-50);
}
#workspace-modal .wm-input-wrap .wm-prefix,
#workspace-modal .wm-input-wrap .wm-suffix {
  padding: 0 12px; height: 100%; display: inline-flex; align-items: center;
  font-family: var(--mono); font-size: 12px; color: var(--ash);
  background: var(--surface-2); align-self: stretch;
}
#workspace-modal .wm-input-wrap .wm-prefix { border-right: 1px solid var(--hairline); }
#workspace-modal .wm-input-wrap .wm-suffix { border-left: 1px solid var(--hairline); }
#workspace-modal .wm-input-wrap input {
  flex: 1; border: none; outline: none; background: transparent;
  padding: 10px 12px; font-family: var(--mono); font-size: 13px; color: var(--ink);
}
#workspace-modal .wm-input-wrap.sans input { font-family: var(--sans); }

/* Plain input */
#workspace-modal .wm-input {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--hairline); border-radius: 12px;
  background: #fff; color: var(--ink);
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
#workspace-modal .wm-input::placeholder { color: var(--ash-2, #9A9AAA); font-weight: 400; }
#workspace-modal .wm-input:focus {
  border-color: var(--indigo-500); box-shadow: 0 0 0 4px var(--indigo-50);
}

/* Plan cards */
#workspace-modal .wm-plan-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
#workspace-modal .wm-plan {
  border: 1.5px solid var(--hairline); border-radius: 14px; padding: 14px;
  cursor: pointer; background: #fff; transition: border-color .15s, background .15s;
  display: flex; flex-direction: column; gap: 6px; position: relative;
  font-family: inherit;
}
#workspace-modal .wm-plan:hover { border-color: var(--ash); }
#workspace-modal .wm-plan.selected { border-color: var(--indigo-500); background: var(--indigo-50); }
#workspace-modal .wm-plan.selected::after {
  content: "✓"; position: absolute; top: 10px; right: 12px;
  width: 18px; height: 18px; border-radius: 999px;
  background: var(--indigo-500); color: #fff;
  font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
#workspace-modal .wm-plan-name {
  font-family: var(--sans); font-weight: 700; font-size: 14px;
  color: var(--ink); letter-spacing: -.2px;
}
#workspace-modal .wm-plan-tag {
  font-family: var(--mono); font-size: 9.5px; font-weight: 700; padding: 2px 7px;
  border-radius: 999px; letter-spacing: .4px; text-transform: uppercase;
  display: inline-block; margin-top: 2px;
}
#workspace-modal .wm-plan-tag.trial { background: var(--teal-soft); color: var(--teal-ink); }
#workspace-modal .wm-plan-tag.pro { background: var(--indigo-100); color: var(--indigo-500); }
#workspace-modal .wm-plan-tag.business { background: #FEF3C7; color: #92400E; }
#workspace-modal .wm-plan-tag.enterprise { background: #F3E8FF; color: #6B21A8; }

/* Toggle row */
#workspace-modal .wm-toggle-row {
  display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center;
  padding: 14px; border: 1.5px solid var(--hairline); border-radius: 14px; background: #fff;
}
#workspace-modal .wm-toggle-row + .wm-toggle-row { margin-top: 10px; }
#workspace-modal .wm-toggle-row.on { background: var(--indigo-50); border-color: var(--indigo-500); }
#workspace-modal .wm-tr-title {
  font-family: var(--sans); font-weight: 600; font-size: 13.5px; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
#workspace-modal .wm-tr-title .req-pill {
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  padding: 2px 7px; border-radius: 999px; letter-spacing: .4px; text-transform: uppercase;
  background: var(--surface-2); color: var(--ash); border: 1px solid var(--hairline);
}
#workspace-modal .wm-tr-help { font-size: 12px; color: var(--ash); margin-top: 4px; line-height: 1.5; }

/* Switch */
#workspace-modal .wm-switch {
  width: 38px; height: 22px; border-radius: 999px;
  background: var(--hairline); position: relative; cursor: pointer;
  transition: background .15s; flex-shrink: 0; border: none;
}
#workspace-modal .wm-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 999px; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s;
}
#workspace-modal .wm-switch.on { background: var(--indigo-500); }
#workspace-modal .wm-switch.on::after { transform: translateX(16px); }

/* Color row */
#workspace-modal .wm-color-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; }
#workspace-modal .wm-color-swatch {
  width: 44px; height: 44px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--hairline); flex-shrink: 0;
}
#workspace-modal .wm-color-presets { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
#workspace-modal .wm-color-preset {
  width: 28px; height: 28px; border-radius: 10px; cursor: pointer;
  border: 2px solid transparent; outline: 1px solid var(--hairline); outline-offset: -1px;
  transition: outline-color .15s, transform .15s;
}
#workspace-modal .wm-color-preset:hover { transform: scale(1.08); }
#workspace-modal .wm-color-preset.selected { border-color: #fff; outline: 2px solid var(--ink); outline-offset: 1px; }

/* Upload */
#workspace-modal .wm-upload {
  border: 1.5px dashed var(--hairline); border-radius: 14px; padding: 16px;
  background: var(--surface-2);
  display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center;
  cursor: pointer; transition: border-color .15s, background .15s;
}
#workspace-modal .wm-upload:hover { border-color: var(--indigo-500); background: var(--indigo-50); }
#workspace-modal .wm-upload-thumb {
  width: 48px; height: 48px; border-radius: 10px; background: #fff;
  border: 1px solid var(--hairline); display: flex; align-items: center; justify-content: center;
  color: var(--ash); flex-shrink: 0;
}
#workspace-modal .wm-upload-title { font-weight: 600; font-size: 13px; color: var(--ink); }
#workspace-modal .wm-upload-meta { font-size: 11.5px; color: var(--ash); margin-top: 3px; font-family: var(--mono); }

/* Preview */
#workspace-modal .wm-split-2 { display: grid; grid-template-columns: 1fr 260px; gap: 16px; }
#workspace-modal .wm-preview-label {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  color: var(--ash); letter-spacing: 1px; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
#workspace-modal .wm-live-dot {
  width: 6px; height: 6px; border-radius: 999px; background: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
}
#workspace-modal .wm-preview-url {
  font-family: var(--mono); font-size: 12px; color: var(--ink);
  background: #fff; border: 1px solid var(--hairline); border-radius: 8px;
  padding: 6px 10px; margin-top: 10px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#workspace-modal .wm-preview-url .scheme { color: var(--ash); }
#workspace-modal .wm-preview-url .slug { color: var(--indigo-500); font-weight: 600; }
#workspace-modal .wm-lp-preview {
  background: #fff; border: 1px solid var(--hairline); border-radius: 12px;
  overflow: hidden; margin-top: 10px;
}
#workspace-modal .wm-lp-bar {
  height: 26px; background: var(--surface-2); border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; gap: 6px; padding: 0 10px;
}
#workspace-modal .wm-lp-bar span { width: 8px; height: 8px; border-radius: 999px; background: var(--hairline); }
#workspace-modal .wm-lp-bar .wm-lp-url {
  flex: 1; font-family: var(--mono); font-size: 10px; color: var(--ash);
  background: #fff; border: 1px solid var(--hairline); border-radius: 6px;
  padding: 2px 8px; margin-left: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#workspace-modal .wm-lp-body {
  padding: 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  background: linear-gradient(180deg, #fff, var(--surface-2));
}
#workspace-modal .wm-lp-logo {
  width: 26px; height: 26px; border-radius: 7px; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px;
}
#workspace-modal .wm-lp-h {
  font-family: var(--sans); font-weight: 700; font-size: 15px; color: var(--ink);
  letter-spacing: -.3px; line-height: 1.2;
}
#workspace-modal .wm-lp-cta {
  margin-top: 2px; padding: 6px 12px; border-radius: 999px;
  background: #14532d; color: #fff; font-weight: 600; font-size: 11.5px;
  border: none; cursor: pointer;
}

/* Hint chip */
#workspace-modal .wm-hint {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  padding: 3px 8px; border-radius: 999px; letter-spacing: .3px; white-space: nowrap;
}
#workspace-modal .wm-hint.ok { background: var(--teal-soft); color: var(--teal-ink); }

/* Info strip */
#workspace-modal .wm-meta-strip {
  margin-top: 12px; padding: 10px 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px dashed var(--hairline);
  font-size: 11.5px; color: var(--ash); line-height: 1.5;
  display: flex; gap: 10px; align-items: center;
}
#workspace-modal .wm-meta-strip svg { flex-shrink: 0; }

/* Owner suggestions */
#workspace-modal .wm-owner-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
#workspace-modal .wm-owner-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 6px; border-radius: 999px;
  border: 1.5px solid var(--hairline); background: #fff; cursor: pointer;
  font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--ink);
  transition: border-color .15s;
}
#workspace-modal .wm-owner-pill:hover { border-color: var(--indigo-500); }
#workspace-modal .wm-owner-pill .pill-av {
  width: 22px; height: 22px; border-radius: 999px; color: #fff;
  font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
#workspace-modal .wm-suggestions-label {
  font-family: var(--mono); font-size: 10.5px; font-weight: 700;
  color: var(--ash); text-transform: uppercase; letter-spacing: 1px;
}

/* Footer */
#workspace-modal .wm-foot {
  padding: 16px 28px; background: var(--surface-2);
  border-top: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
#workspace-modal .wm-foot-l { font-size: 12px; color: var(--ash); display: flex; align-items: center; gap: 8px; }
#workspace-modal .wm-foot-l kbd {
  font-family: var(--mono); font-size: 10px; padding: 2px 6px; border-radius: 6px;
  background: #fff; border: 1px solid var(--hairline); color: var(--ink); font-weight: 600;
}
#workspace-modal .wm-foot-r { display: flex; align-items: center; gap: 10px; }
#workspace-modal .wm-foot-r .btn { border-radius: 999px; font-size: 13px; }
#workspace-modal .wm-foot-r .btn.ghost { border-color: transparent; color: var(--ash); }
#workspace-modal .wm-foot-r .btn.ghost:hover { color: var(--ink); background: var(--hairline-2); border-color: transparent; }
#workspace-modal .wm-foot-r .btn.primary { box-shadow: var(--shadow-pop); }

/* spacing utils */
#workspace-modal .mt-12 { margin-top: 12px; }
#workspace-modal .mt-16 { margin-top: 16px; }

/* ══════════════════════════════════════════════════════════════════════════
   EDIT WORKSPACE MODAL — Two-pane settings (Variant A)
   All classes prefixed ew-
   ══════════════════════════════════════════════════════════════════════════ */

#edit-workspace-modal.open {
  overflow-y: auto;
  padding: 32px 24px;
  align-items: flex-start;
}

.ew-modal {
  position: relative; z-index: 2; flex-shrink: 0;
  width: 100%; max-width: 980px; height: 720px; max-height: calc(100vh - 64px);
  background: #fff; border-radius: 22px;
  box-shadow: var(--shadow-modal);
  border: 1px solid var(--hairline);
  display: grid; grid-template-rows: auto 1fr;
  overflow: hidden;
}

/* ── Head ── */
.ew-head {
  padding: 18px 24px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; border-bottom: 1px solid var(--hairline); flex-shrink: 0;
}
.ew-head-l { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ew-mark {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: var(--indigo-500); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -.5px;
}
.ew-head-text { min-width: 0; }
.ew-pre {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  color: var(--ash); letter-spacing: 1.2px; text-transform: uppercase;
  display: flex; align-items: center; gap: 6px; margin-bottom: 3px;
}
.ew-org-dot {
  width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0;
  background: var(--teal); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 700; letter-spacing: 0;
}
.ew-h1 {
  font-family: var(--display); font-weight: 700; font-size: 20px;
  color: var(--ink); letter-spacing: -.5px; line-height: 1.1;
  display: flex; align-items: center; gap: 10px; white-space: nowrap; overflow: hidden;
}
.ew-url-pill {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  background: var(--surface-2); color: var(--ash);
  padding: 2px 8px; border-radius: 6px; border: 1px solid var(--hairline);
  letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 280px;
}
.ew-head-r { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.ew-saved-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  color: var(--green-ink); background: var(--green-bg);
  padding: 5px 10px; border-radius: 999px; letter-spacing: .3px;
}
.ew-saved-dot {
  width: 6px; height: 6px; border-radius: 999px; background: var(--green); flex-shrink: 0;
}
.ew-close-btn {
  width: 32px; height: 32px; border-radius: 999px;
  background: transparent; border: 1.5px solid var(--hairline);
  cursor: pointer; color: var(--ash); font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ew-close-btn:hover { border-color: var(--ink); color: var(--ink); }

/* ── Body grid ── */
.ew-body {
  display: grid; grid-template-columns: 220px 1fr; min-height: 0; overflow: hidden;
}

/* ── Rail ── */
.ew-rail {
  background: var(--surface-2); border-right: 1px solid var(--hairline);
  padding: 14px 12px; overflow-y: auto;
}
.ew-rail-group {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  color: var(--ash-2); letter-spacing: 1px; text-transform: uppercase;
  padding: 10px 10px 6px;
}
.ew-rail-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 10px; width: 100%;
  font-size: 13px; font-weight: 500; color: var(--ink);
  cursor: pointer; background: transparent; border: none; text-align: left;
  transition: background .1s;
}
.ew-rail-item:hover { background: #fff; }
.ew-rail-item.active {
  background: #fff; color: var(--indigo-500); font-weight: 600;
  box-shadow: var(--shadow-md);
}
.ew-rail-item.ew-rail-danger { color: var(--ash); }
.ew-rail-item.ew-rail-danger.active { color: var(--rose-ink); }
.ew-rail-icon { width: 16px; text-align: center; flex-shrink: 0; font-size: 13px; }
.ew-rail-count {
  margin-left: auto;
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  color: var(--ash); padding: 1px 6px; border-radius: 999px;
  background: var(--hairline-2);
}
.ew-rail-item.active .ew-rail-count {
  background: var(--indigo-50); color: var(--indigo-500);
}

/* ── Pane ── */
.ew-pane {
  overflow-y: auto; padding: 24px 28px 32px; background: #fff;
}
.ew-section { min-height: 100%; }
.ew-pane-head { margin-bottom: 18px; }
.ew-pane-title {
  font-family: var(--display); font-weight: 700; font-size: 18px;
  color: var(--ink); letter-spacing: -.4px;
}
.ew-pane-sub { font-size: 12.5px; color: var(--ash); margin-top: 3px; line-height: 1.4; }
.ew-divider { border: none; border-top: 1px solid var(--hairline); margin: 24px 0 0; }

/* ── Fields ── */
.ew-field-grid { display: grid; gap: 14px; }
.ew-cols-2 { grid-template-columns: 1fr 1fr; }
.ew-field { display: flex; flex-direction: column; gap: 6px; }
.ew-field-label {
  font-size: 13px; font-weight: 600; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.ew-opt {
  font-family: var(--mono); font-size: 9.5px; font-weight: 600; color: var(--ash);
  letter-spacing: .4px; text-transform: uppercase;
  padding: 1px 6px; background: var(--surface-2); border-radius: 4px; border: 1px solid var(--hairline);
}
.ew-input, .ew-select, .ew-textarea {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--hairline); border-radius: 10px;
  background: #fff; color: var(--ink);
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  outline: none; transition: border-color .12s, box-shadow .12s;
}
.ew-input:focus, .ew-select:focus, .ew-textarea:focus {
  border-color: var(--indigo-500); box-shadow: 0 0 0 4px var(--indigo-50);
}
.ew-input[readonly] { background: var(--surface-2); color: var(--ash); }
.ew-mono-input { font-family: var(--mono); font-size: 12px; }
.ew-textarea { font-size: 12.5px; line-height: 1.5; resize: vertical; min-height: 80px; }
.ew-select {
  appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M3 4.5l3 3 3-3' stroke='%236B6B7D' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center;
}

/* ── Plan cards ── */
.ew-plan-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ew-plan-card {
  border: 1.5px solid var(--hairline); border-radius: 12px;
  padding: 11px 12px; background: #fff; cursor: pointer;
  display: flex; flex-direction: column; gap: 3px;
  position: relative; text-align: left;
  transition: border-color .12s, background .12s;
}
.ew-plan-card:hover { border-color: var(--indigo-200); }
.ew-plan-card.selected { border-color: var(--indigo-500); background: var(--indigo-50); }
.ew-plan-card.selected::after {
  content: "✓"; position: absolute; top: 7px; right: 9px;
  width: 16px; height: 16px; border-radius: 999px;
  background: var(--indigo-500); color: #fff;
  font-size: 9px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
.ew-plan-name { font-family: var(--display); font-weight: 700; font-size: 12.5px; color: var(--ink); }
.ew-plan-tag {
  display: inline-block; font-size: 10px; font-weight: 600;
  padding: 2px 6px; border-radius: 4px; font-family: var(--mono); letter-spacing: .2px;
}
.ew-plan-tag.trial { background: var(--teal-soft); color: var(--teal-ink); }
.ew-plan-tag.pro { background: var(--indigo-100); color: var(--indigo-500); }
.ew-plan-tag.business { background: #FEF3C7; color: #92400E; }
.ew-plan-tag.enterprise { background: #F3E8FF; color: #6B21A8; }

/* ── Toggles ── */
.ew-toggle-row {
  display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center;
  padding: 13px 14px; border: 1.5px solid var(--hairline); border-radius: 12px;
  background: #fff; transition: background .15s, border-color .15s;
}
.ew-toggle-row + .ew-toggle-row { margin-top: 8px; }
.ew-toggle-row.on { background: var(--indigo-50); border-color: var(--indigo-500); }
.ew-tr-title { font-weight: 600; font-size: 13px; color: var(--ink); }
.ew-tr-help { font-size: 11.5px; color: var(--ash); margin-top: 3px; line-height: 1.45; }
.ew-mono { font-family: var(--mono); }
.ew-switch {
  width: 36px; height: 20px; border-radius: 999px; flex-shrink: 0;
  background: var(--hairline); position: relative; cursor: pointer;
  transition: background .15s; border: none; padding: 0;
}
.ew-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 999px; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s;
}
.ew-switch.on { background: var(--indigo-500); }
.ew-switch.on::after { transform: translateX(16px); }
.ew-switch:disabled { opacity: .4; cursor: not-allowed; }

/* ── Color ── */
.ew-color-row { display: flex; align-items: center; gap: 12px; }
.ew-color-swatch {
  width: 44px; height: 44px; border-radius: 11px; flex-shrink: 0;
  border: 1.5px solid var(--hairline); cursor: pointer;
}
.ew-color-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.ew-color-preset {
  width: 26px; height: 26px; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; outline: 1px solid var(--hairline); outline-offset: -1px;
  transition: transform .12s;
}
.ew-color-preset:hover { transform: scale(1.1); }
.ew-color-preset.selected { border-color: #fff; outline: 2px solid var(--ink); outline-offset: 1px; }
.ew-hex-input {
  flex: 1; padding: 8px 12px;
  border: 1.5px solid var(--hairline); border-radius: 10px;
  font-family: var(--mono); font-size: 12.5px; color: var(--ink);
  text-transform: uppercase; outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.ew-hex-input:focus { border-color: var(--indigo-500); box-shadow: 0 0 0 4px var(--indigo-50); }

/* ── Logo upload ── */
.ew-upload {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center;
  padding: 14px; border: 1.5px dashed var(--hairline); border-radius: 12px;
  background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.ew-upload:hover { border-color: var(--indigo-500); background: var(--indigo-50); }
.ew-upload-thumb {
  width: 56px; height: 56px; border-radius: 12px; flex-shrink: 0;
  background: var(--indigo-500); color: #fff;
  font-family: var(--display); font-weight: 700; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
}
.ew-ut-title { font-weight: 600; font-size: 13px; color: var(--ink); }
.ew-ut-meta { font-family: var(--mono); font-size: 11px; color: var(--ash); margin-top: 3px; }
#ew-logo-preview {
  display: none; margin-top: 10px;
  align-items: center; gap: 10px;
}
#ew-logo-preview.visible { display: flex; }
#ew-logo-img {
  max-height: 40px; max-width: 160px;
  border: 1px solid var(--hairline); border-radius: 6px; padding: 4px; background: #fff;
}

/* ── Buttons ── */
.ew-btn-ghost {
  background: #fff; border: 1.5px solid var(--hairline); border-radius: 10px;
  padding: 7px 12px; font-family: var(--sans); font-size: 12px; font-weight: 600;
  color: var(--ink); cursor: pointer; flex-shrink: 0;
  transition: border-color .12s;
}
.ew-btn-ghost:hover { border-color: var(--ink); }
.ew-btn-primary {
  background: var(--indigo-500); border: 1px solid var(--indigo-500); color: #fff;
  padding: 8px 14px; border-radius: 999px;
  font-family: var(--sans); font-size: 12.5px; font-weight: 600; cursor: pointer;
  flex-shrink: 0; transition: background .12s;
}
.ew-btn-primary:hover { background: var(--indigo-600); }

/* ── Members section ── */
.ew-mem-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ew-mem-search {
  flex: 1; display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; background: #fff; border: 1.5px solid var(--hairline);
  border-radius: 999px;
}
.ew-mem-search input {
  flex: 1; border: none; outline: none;
  font-size: 12.5px; font-family: var(--sans); color: var(--ink);
}
.ew-mem-table {
  border: 1px solid var(--hairline); border-radius: 12px; overflow: hidden;
}
.ew-mem-head, .ew-mem-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.6fr) 80px 100px 130px 110px;
  gap: 12px; align-items: center; padding: 11px 14px;
}
.ew-mem-head {
  background: var(--surface-2); border-bottom: 1px solid var(--hairline);
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  color: var(--ash); letter-spacing: .8px; text-transform: uppercase;
}
.ew-mem-row { border-bottom: 1px solid var(--hairline-2); background: #fff; }
.ew-mem-row:last-child { border-bottom: none; }
.ew-mem-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ew-avatar {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  color: #fff; font-family: var(--display); font-weight: 700; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.ew-mem-email-main {
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ew-mem-joined { font-family: var(--mono); font-size: 11px; color: var(--ash); }
.ew-role-select {
  width: 100%; padding: 5px 24px 5px 9px;
  border: 1px solid var(--hairline); border-radius: 8px; background: #fff;
  font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--ink);
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'><path d='M3 4.5l3 3 3-3' stroke='%236B6B7D' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 7px center;
}
.ew-role-select:disabled { background-color: var(--surface-2); color: var(--ash); cursor: not-allowed; }
.ew-mem-actions { display: flex; justify-content: flex-end; }
.ew-icon-btn {
  width: 26px; height: 26px; border-radius: 7px; padding: 0;
  border: 1px solid var(--hairline); background: #fff;
  cursor: pointer; font-size: 11px; color: var(--ash);
  display: inline-flex; align-items: center; justify-content: center;
}
.ew-icon-btn:hover { border-color: var(--rose); color: var(--rose); }
.ew-chip-owner {
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  padding: 1px 6px; border-radius: 4px; letter-spacing: .3px; text-transform: uppercase;
  background: var(--indigo-500); color: #fff; flex-shrink: 0;
}
.ew-chip-mfa {
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px; letter-spacing: .3px; text-transform: uppercase;
  background: var(--green-bg); color: var(--green-ink); border: 1px solid #A7F3D0;
}
.ew-chip-mfa-off {
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 4px; letter-spacing: .3px; text-transform: uppercase;
  background: var(--rose-bg); color: var(--rose-ink); border: 1px solid #FECACA;
}
.ew-loading {
  padding: 20px 14px; font-family: var(--mono); font-size: 12px; color: var(--ash);
}

/* ── Owner row ── */
.ew-owner-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1.5px solid var(--hairline); border-radius: 12px;
  background: var(--surface-2);
}
.ew-owner-av {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: var(--indigo-500); color: #fff;
  font-family: var(--display); font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.ew-owner-meta { flex: 1; min-width: 0; }
.ew-owner-name { font-family: var(--display); font-weight: 700; font-size: 13.5px; color: var(--ink); }
.ew-owner-email { font-family: var(--mono); font-size: 11px; color: var(--ash); margin-top: 2px; }

/* ── Danger zone ── */
.ew-danger-card {
  border: 1.5px solid var(--hairline); border-radius: 12px;
  padding: 14px 16px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; background: #fff;
}
.ew-danger-card + .ew-danger-card { margin-top: 8px; }
.ew-danger-card.ew-severe { border-color: #FECACA; background: var(--rose-bg); }
.ew-dt {
  font-family: var(--display); font-weight: 700; font-size: 13.5px; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.ew-dt-note { font-size: 11px; font-weight: 500; color: var(--ash); }
.ew-severe .ew-dt { color: var(--rose-ink); }
.ew-dh { font-size: 11.5px; color: var(--ash); margin-top: 4px; line-height: 1.45; max-width: 480px; }
.ew-btn-danger {
  background: #fff; border: 1.5px solid #FECACA; color: var(--rose-ink);
  padding: 8px 14px; border-radius: 10px;
  font-family: var(--sans); font-size: 12px; font-weight: 600; cursor: pointer; flex-shrink: 0;
  transition: border-color .12s;
}
.ew-btn-danger:hover { border-color: var(--rose); }
.ew-btn-danger.ew-solid { background: var(--rose); border-color: var(--rose); color: #fff; }
.ew-btn-danger.ew-solid:hover { background: var(--rose-ink); }

/* ══════════════════════════════════════════════════════════════════════════
   EDIT WORKSPACE — VARIANT B: Single-scroll + sticky sub-nav (820 × 720)
   ══════════════════════════════════════════════════════════════════════════ */

#edit-workspace-modal-b.open { overflow-y: auto; padding: 32px 24px; align-items: flex-start; }

.ewb-modal {
  position: relative; z-index: 2; flex-shrink: 0;
  width: 100%; max-width: 820px; height: 720px; max-height: calc(100vh - 64px);
  background: #fff; border-radius: 22px;
  box-shadow: var(--shadow-modal); border: 1px solid var(--hairline);
  display: grid; grid-template-rows: auto 1fr; overflow: hidden;
}

/* Head */
.ewb-head {
  padding: 18px 24px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; border-bottom: 1px solid var(--hairline); flex-shrink: 0;
  background: linear-gradient(180deg, #fff 0%, var(--surface-2) 100%);
}
.ewb-head-l { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ewb-mark {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: var(--indigo-500); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 700; font-size: 20px; position: relative;
}
.ewb-mark::after {
  content: ""; position: absolute; inset: -2px;
  border: 1.5px solid var(--surface-2); border-radius: 14px; pointer-events: none;
}
.ewb-pre {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  color: var(--ash); letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 2px;
}
.ewb-h1 {
  font-family: var(--display); font-weight: 700; font-size: 20px;
  color: var(--ink); letter-spacing: -.5px; line-height: 1.1;
}
.ewb-sub {
  font-family: var(--mono); font-size: 11px; color: var(--ash); margin-top: 4px;
  display: flex; align-items: center; gap: 8px;
}
.ewb-sub-dot { width: 4px; height: 4px; border-radius: 999px; background: var(--ash-2); flex-shrink: 0; }
.ewb-head-r { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.ewb-saved-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  color: var(--green-ink); background: var(--green-bg);
  padding: 5px 10px; border-radius: 999px; letter-spacing: .3px;
}
.ewb-saved-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--green); }
.ewb-close-btn {
  width: 32px; height: 32px; border-radius: 999px;
  background: transparent; border: 1.5px solid var(--hairline);
  cursor: pointer; color: var(--ash); font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ewb-close-btn:hover { border-color: var(--ink); color: var(--ink); }

/* Body: subnav + pane */
.ewb-body { display: grid; grid-template-columns: 168px 1fr; min-height: 0; overflow: hidden; }
.ewb-subnav { border-right: 1px solid var(--hairline); padding: 24px 14px; background: #fff; overflow-y: auto; }
.ewb-subnav-label {
  font-family: var(--mono); font-size: 9.5px; font-weight: 600;
  color: var(--ash-2); letter-spacing: 1px; text-transform: uppercase; padding: 0 8px 8px;
}
.ewb-subnav-list { display: flex; flex-direction: column; gap: 1px; position: relative; padding-left: 12px; }
.ewb-subnav-list::before {
  content: ""; position: absolute; left: 0; top: 4px; bottom: 4px;
  width: 1.5px; background: var(--hairline);
}
.ewb-subnav-item {
  padding: 6px 10px; font-size: 12.5px; font-weight: 500; color: var(--ash);
  cursor: pointer; border-radius: 6px; position: relative; transition: color .12s;
}
.ewb-subnav-item:hover { color: var(--ink); }
.ewb-subnav-item.active { color: var(--ink); font-weight: 600; }
.ewb-subnav-item.active::before {
  content: ""; position: absolute; left: -12px; top: 4px; bottom: 4px;
  width: 1.5px; background: var(--indigo-500);
}
.ewb-subnav-item.ewb-danger.active::before { background: var(--rose); }
.ewb-subnav-item.ewb-danger.active { color: var(--rose-ink); }
.ewb-subnav-num {
  font-family: var(--mono); font-size: 9.5px; color: var(--ash-2); margin-right: 6px; font-weight: 600;
}
.ewb-pane { overflow-y: auto; padding: 24px 32px 40px; }
.ewb-section { padding-top: 8px; padding-bottom: 28px; border-bottom: 1px solid var(--hairline-2); }
.ewb-section:last-child { border-bottom: none; padding-bottom: 8px; }
.ewb-section-h {
  font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--ink);
  letter-spacing: -.3px; display: flex; align-items: center; gap: 10px; margin-bottom: 4px;
}
.ewb-section-h.ewb-danger-h { color: var(--rose-ink); }
.ewb-section-num {
  font-family: var(--mono); font-size: 10px; font-weight: 700; color: var(--ash);
  width: 22px; height: 22px; border-radius: 6px; background: var(--surface-2);
  border: 1px solid var(--hairline); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ewb-section-num.ewb-danger-num { background: var(--rose-bg); border-color: #FECACA; color: var(--rose-ink); }
.ewb-section-sub { font-size: 12.5px; color: var(--ash); margin-bottom: 14px; line-height: 1.5; padding-left: 32px; }

/* Form atoms */
.ewb-field-grid { display: grid; gap: 12px; }
.ewb-cols-2 { grid-template-columns: 1fr 1fr; }
.ewb-field { display: flex; flex-direction: column; gap: 6px; }
.ewb-field-label { font-size: 12.5px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.ewb-opt { font-family: var(--mono); font-size: 9.5px; font-weight: 600; color: var(--ash); letter-spacing: .4px; text-transform: uppercase; }
.ewb-input, .ewb-textarea {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--hairline); border-radius: 10px;
  background: #fff; color: var(--ink); font-family: var(--sans); font-size: 13px; font-weight: 500;
  outline: none; transition: border-color .12s, box-shadow .12s;
}
.ewb-input:focus, .ewb-textarea:focus { border-color: var(--indigo-500); box-shadow: 0 0 0 4px var(--indigo-50); }
.ewb-input[readonly] { background: var(--surface-2); color: var(--ash); font-family: var(--mono); font-size: 12px; }
.ewb-textarea { font-size: 12.5px; line-height: 1.5; resize: vertical; min-height: 76px; }

/* Plan pills */
.ewb-plan-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.ewb-plan-pill {
  border: 1.5px solid var(--hairline); border-radius: 999px; padding: 8px 14px; cursor: pointer;
  font-family: var(--sans); font-size: 12.5px; font-weight: 600; background: #fff; color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px; transition: border-color .12s, background .12s;
}
.ewb-plan-pill:hover { border-color: var(--indigo-200); }
.ewb-plan-pill.selected { background: var(--indigo-500); border-color: var(--indigo-500); color: #fff; }
.ewb-plan-pill .pp-meta { font-family: var(--mono); font-size: 11px; font-weight: 500; color: var(--ash); }
.ewb-plan-pill.selected .pp-meta { color: rgba(255,255,255,.8); }

/* Color */
.ewb-color-row { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; }
.ewb-color-swatch { width: 56px; height: 56px; border-radius: 12px; border: 1.5px solid var(--hairline); }
.ewb-color-presets { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.ewb-color-preset {
  width: 26px; height: 26px; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; outline: 1px solid var(--hairline); outline-offset: -1px; transition: transform .12s;
}
.ewb-color-preset:hover { transform: scale(1.1); }
.ewb-color-preset.selected { border-color: #fff; outline: 2px solid var(--ink); outline-offset: 1px; }
.ewb-hex-input {
  width: 100%; padding: 8px 12px; border: 1.5px solid var(--hairline); border-radius: 10px;
  font-family: var(--mono); font-size: 12.5px; color: var(--ink); text-transform: uppercase;
  outline: none; transition: border-color .12s;
}
.ewb-hex-input:focus { border-color: var(--indigo-500); box-shadow: 0 0 0 4px var(--indigo-50); }

/* Logo */
.ewb-upload {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center;
  padding: 14px; border: 1.5px dashed var(--hairline); border-radius: 12px;
  background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.ewb-upload:hover { border-color: var(--indigo-500); background: var(--indigo-50); }
.ewb-upload-thumb {
  width: 56px; height: 56px; border-radius: 12px; flex-shrink: 0;
  background: var(--indigo-500); color: #fff;
  font-family: var(--display); font-weight: 700; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
}
.ewb-ut-title { font-weight: 600; font-size: 13px; color: var(--ink); }
.ewb-ut-meta { font-family: var(--mono); font-size: 11.5px; color: var(--ash); margin-top: 2px; }
#ewb-logo-preview { display: none; margin-top: 10px; align-items: center; gap: 10px; }
#ewb-logo-preview.visible { display: flex; }
#ewb-logo-img { max-height: 40px; max-width: 160px; border: 1px solid var(--hairline); border-radius: 6px; padding: 4px; background: #fff; }

/* Buttons */
.ewb-btn-ghost {
  background: #fff; border: 1.5px solid var(--hairline); border-radius: 10px;
  padding: 7px 12px; font-family: var(--sans); font-size: 12px; font-weight: 600;
  color: var(--ink); cursor: pointer; flex-shrink: 0; transition: border-color .12s;
}
.ewb-btn-ghost:hover { border-color: var(--ink); }
.ewb-btn-primary {
  background: var(--indigo-500); border: 1px solid var(--indigo-500); color: #fff;
  padding: 7px 12px; border-radius: 999px;
  font-family: var(--sans); font-size: 12px; font-weight: 600; cursor: pointer; transition: background .12s;
}
.ewb-btn-primary:hover { background: var(--indigo-600); }

/* Toggles */
.ewb-toggle-row {
  display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center;
  padding: 12px 14px; border: 1.5px solid var(--hairline); border-radius: 12px; background: #fff;
  transition: background .15s, border-color .15s;
}
.ewb-toggle-row + .ewb-toggle-row { margin-top: 8px; }
.ewb-toggle-row.on { border-color: var(--indigo-500); background: var(--indigo-50); }
.ewb-tr-title { font-weight: 600; font-size: 13px; color: var(--ink); }
.ewb-tr-help { font-size: 11.5px; color: var(--ash); margin-top: 3px; line-height: 1.45; }
.ewb-switch {
  width: 36px; height: 20px; border-radius: 999px; background: var(--hairline);
  position: relative; cursor: pointer; transition: background .15s; flex-shrink: 0; border: none; padding: 0;
}
.ewb-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 999px; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s;
}
.ewb-switch.on { background: var(--indigo-500); }
.ewb-switch.on::after { transform: translateX(16px); }

/* Members */
.ewb-mem-list { border: 1px solid var(--hairline); border-radius: 12px; overflow: hidden; }
.ewb-mem-list-head {
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--hairline);
  font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--ash);
  letter-spacing: .8px; text-transform: uppercase;
  display: flex; align-items: center; justify-content: space-between;
}
.ewb-mem-row {
  display: grid; grid-template-columns: 1fr 100px 110px;
  gap: 12px; align-items: center; padding: 10px 14px;
  border-bottom: 1px solid var(--hairline-2); background: #fff;
}
.ewb-mem-row:last-child { border-bottom: none; }
.ewb-mem-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ewb-av {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  color: #fff; font-family: var(--display); font-weight: 700; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.ewb-mem-email-main { font-size: 12.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ewb-mem-joined { font-family: var(--mono); font-size: 11px; color: var(--ash); }
.ewb-role-select {
  width: 100%; padding: 5px 24px 5px 9px; border: 1px solid var(--hairline); border-radius: 8px;
  background: #fff; font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--ink);
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'><path d='M3 4.5l3 3 3-3' stroke='%236B6B7D' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 7px center;
}
.ewb-role-select:disabled { background-color: var(--surface-2); color: var(--ash); cursor: not-allowed; }
.ewb-chip-owner {
  font-family: var(--mono); font-size: 9px; font-weight: 700; padding: 1px 6px;
  border-radius: 4px; letter-spacing: .3px; text-transform: uppercase;
  background: var(--indigo-500); color: #fff;
}
.ewb-loading { padding: 20px 14px; font-family: var(--mono); font-size: 12px; color: var(--ash); }

/* Owner row */
.ewb-owner-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1.5px solid var(--hairline); border-radius: 12px; background: var(--surface-2);
}
.ewb-owner-av {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0; background: var(--indigo-500); color: #fff;
  font-family: var(--display); font-weight: 700; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.ewb-owner-meta { flex: 1; }
.ewb-owner-name { font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--ink); }
.ewb-owner-email { font-family: var(--mono); font-size: 11px; color: var(--ash); }

/* Danger */
.ewb-danger-card {
  border: 1.5px solid var(--hairline); border-radius: 12px;
  padding: 13px 16px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; background: #fff;
}
.ewb-danger-card + .ewb-danger-card { margin-top: 8px; }
.ewb-danger-card.ewb-severe { border-color: #FECACA; background: var(--rose-bg); }
.ewb-dt { font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--ink); }
.ewb-dh { font-size: 11.5px; color: var(--ash); margin-top: 3px; line-height: 1.45; max-width: 420px; }
.ewb-severe .ewb-dt { color: var(--rose-ink); }
.ewb-btn-danger {
  background: #fff; border: 1.5px solid #FECACA; color: var(--rose-ink);
  padding: 7px 12px; border-radius: 10px;
  font-family: var(--sans); font-size: 12px; font-weight: 600; cursor: pointer; flex-shrink: 0;
}
.ewb-btn-danger:hover { border-color: var(--rose); }
.ewb-btn-danger.ewb-solid { background: var(--rose); border-color: var(--rose); color: #fff; }
.ewb-btn-danger.ewb-solid:hover { background: var(--rose-ink); }

/* ══════════════════════════════════════════════════════════════════════════
   EDIT WORKSPACE — VARIANT C: Live workspace card (880 × 720)
   ══════════════════════════════════════════════════════════════════════════ */

#edit-workspace-modal-c.open { overflow-y: auto; padding: 32px 24px; align-items: flex-start; }

.ewc-modal {
  position: relative; z-index: 2; flex-shrink: 0;
  width: 100%; max-width: 880px; height: 720px; max-height: calc(100vh - 64px);
  background: #fff; border-radius: 24px;
  box-shadow: var(--shadow-modal); border: 1px solid var(--hairline);
  display: grid; grid-template-rows: auto 1fr; overflow: hidden;
}

/* Top strip */
.ewc-top-strip {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; background: #fff; border-bottom: 1px solid var(--hairline); gap: 16px; flex-shrink: 0;
}
.ewc-crumbs {
  font-family: var(--mono); font-size: 11px; color: var(--ash);
  letter-spacing: .3px; display: flex; align-items: center; gap: 8px;
}
.ewc-crumbs strong { color: var(--ink); font-weight: 600; }
.ewc-sep { color: var(--ash-2); }
.ewc-top-r { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.ewc-saved-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  color: var(--green-ink); background: var(--green-bg);
  padding: 5px 10px; border-radius: 999px; letter-spacing: .3px;
}
.ewc-saved-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--green); }
.ewc-close-btn {
  width: 32px; height: 32px; border-radius: 999px;
  background: transparent; border: 1.5px solid var(--hairline);
  cursor: pointer; color: var(--ash); font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ewc-close-btn:hover { border-color: var(--ink); color: var(--ink); }

/* Body + hero */
.ewc-body { overflow-y: auto; background: var(--surface-2); }
.ewc-hero {
  padding: 28px 32px 32px; color: #fff; position: relative; overflow: hidden;
}
.ewc-hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(40% 60% at 100% 0%, rgba(255,255,255,.18), transparent 70%),
    radial-gradient(50% 80% at 0% 100%, rgba(0,0,0,.25), transparent 70%);
  pointer-events: none;
}
.ewc-edit-pill {
  position: absolute; top: 14px; right: 18px;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  background: rgba(255,255,255,.16); color: #fff;
  padding: 4px 10px; border-radius: 999px; letter-spacing: .5px; text-transform: uppercase;
  border: 1px solid rgba(255,255,255,.22);
}
.ewc-live-dot {
  width: 6px; height: 6px; border-radius: 999px; background: var(--teal);
  box-shadow: 0 0 0 3px rgba(42,200,200,.25);
  animation: ewc-pulse 2s ease-in-out infinite;
}
@keyframes ewc-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.ewc-hero-inner {
  position: relative; display: grid;
  grid-template-columns: 96px 1fr auto; gap: 22px; align-items: center;
}
.ewc-hero-logo {
  width: 96px; height: 96px; border-radius: 22px; flex-shrink: 0;
  background: rgba(255,255,255,.94);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 800; font-size: 44px; letter-spacing: -1px;
  box-shadow: 0 12px 32px -10px rgba(0,0,0,.35);
}
.ewc-hero-pre {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  color: rgba(255,255,255,.75); letter-spacing: 1.4px; text-transform: uppercase;
  margin-bottom: 6px; display: flex; align-items: center; gap: 8px;
}
.ewc-org-mark {
  width: 16px; height: 16px; border-radius: 4px; flex-shrink: 0;
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; letter-spacing: 0;
}
.ewc-hero-name {
  font-family: var(--display); font-weight: 700; font-size: 32px;
  color: #fff; letter-spacing: -.8px; line-height: 1.05;
}
.ewc-hero-desc { font-size: 13px; color: rgba(255,255,255,.78); margin-top: 8px; max-width: 520px; line-height: 1.5; }
.ewc-hero-stats { display: flex; flex-direction: column; gap: 14px; align-items: flex-end; flex-shrink: 0; }
.ewc-hero-url {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  background: rgba(255,255,255,.12); padding: 5px 11px; border-radius: 999px;
  color: rgba(255,255,255,.92); border: 1px solid rgba(255,255,255,.18);
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.ewc-hero-url::before { content: "●"; color: var(--teal); font-size: 8px; }
.ewc-hero-pills { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.ewc-hero-pill {
  font-family: var(--mono); font-size: 9.5px; font-weight: 600;
  background: rgba(255,255,255,.14); color: rgba(255,255,255,.95);
  padding: 4px 9px; border-radius: 6px; letter-spacing: .4px; text-transform: uppercase;
  border: 1px solid rgba(255,255,255,.16);
}

/* Cards */
.ewc-cards { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ewc-card { background: #fff; border: 1px solid var(--hairline); border-radius: 16px; overflow: hidden; }
.ewc-card-head {
  padding: 14px 18px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; cursor: pointer; border-bottom: 1px solid transparent; transition: border-color .15s;
}
.ewc-card.ewc-open .ewc-card-head { border-bottom-color: var(--hairline); }
.ewc-card-head-l { display: flex; align-items: center; gap: 12px; }
.ewc-card-icon {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  background: var(--indigo-50); color: var(--indigo-500);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700; font-size: 12px;
}
.ewc-card.ewc-danger .ewc-card-icon { background: var(--rose-bg); color: var(--rose-ink); }
.ewc-card-title { font-family: var(--display); font-weight: 700; font-size: 14.5px; color: var(--ink); letter-spacing: -.3px; }
.ewc-card.ewc-danger .ewc-card-title { color: var(--rose-ink); }
.ewc-card-summary { font-size: 11.5px; color: var(--ash); margin-top: 2px; font-family: var(--mono); }
.ewc-card-chev { color: var(--ash); font-size: 16px; transition: transform .2s; flex-shrink: 0; }
.ewc-card.ewc-open .ewc-card-chev { transform: rotate(180deg); }
.ewc-card-body { padding: 0 18px 18px; display: none; }
.ewc-card.ewc-open .ewc-card-body { display: block; }

/* Form atoms */
.ewc-field-grid { display: grid; gap: 12px; }
.ewc-cols-2 { grid-template-columns: 1fr 1fr; }
.ewc-field { display: flex; flex-direction: column; gap: 6px; }
.ewc-field-label { font-size: 12.5px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.ewc-opt { font-family: var(--mono); font-size: 9.5px; font-weight: 600; color: var(--ash); letter-spacing: .4px; text-transform: uppercase; }
.ewc-input, .ewc-textarea {
  width: 100%; padding: 9px 12px; border: 1.5px solid var(--hairline); border-radius: 10px;
  background: #fff; color: var(--ink); font-family: var(--sans); font-size: 13px; font-weight: 500;
  outline: none; transition: border-color .12s, box-shadow .12s;
}
.ewc-input:focus, .ewc-textarea:focus { border-color: var(--indigo-500); box-shadow: 0 0 0 4px var(--indigo-50); }
.ewc-input[readonly] { background: var(--surface-2); color: var(--ash); font-family: var(--mono); font-size: 12px; }
.ewc-textarea { font-size: 12.5px; line-height: 1.5; resize: vertical; min-height: 70px; }

/* Plan pills (Variant C — dark selected) */
.ewc-plan-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.ewc-plan-pill {
  border: 1.5px solid var(--hairline); border-radius: 999px; padding: 7px 13px; cursor: pointer;
  font-family: var(--sans); font-size: 12px; font-weight: 600; background: #fff; color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px; transition: background .12s, border-color .12s;
}
.ewc-plan-pill.selected { background: var(--ink); border-color: var(--ink); color: #fff; }
.ewc-plan-pill .pp-meta { font-family: var(--mono); font-size: 10.5px; font-weight: 500; color: var(--ash); }
.ewc-plan-pill.selected .pp-meta { color: rgba(255,255,255,.7); }

/* Color */
.ewc-color-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ewc-color-presets { display: flex; gap: 6px; }
.ewc-color-preset {
  width: 26px; height: 26px; border-radius: 8px; cursor: pointer;
  border: 2px solid transparent; outline: 1px solid var(--hairline); outline-offset: -1px; transition: transform .12s;
}
.ewc-color-preset:hover { transform: scale(1.1); }
.ewc-color-preset.selected { border-color: #fff; outline: 2px solid var(--ink); outline-offset: 1px; }
.ewc-hex-input {
  padding: 8px 12px; min-width: 110px; border: 1.5px solid var(--hairline); border-radius: 10px;
  font-family: var(--mono); font-size: 12.5px; color: var(--ink); text-transform: uppercase;
  outline: none; transition: border-color .12s;
}
.ewc-hex-input:focus { border-color: var(--indigo-500); box-shadow: 0 0 0 4px var(--indigo-50); }

/* Upload */
.ewc-upload {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center;
  padding: 12px; border: 1.5px dashed var(--hairline); border-radius: 12px;
  background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.ewc-upload:hover { border-color: var(--indigo-500); background: var(--indigo-50); }
.ewc-upload-thumb {
  width: 48px; height: 48px; border-radius: 10px; flex-shrink: 0;
  background: var(--indigo-500); color: #fff;
  font-family: var(--display); font-weight: 700; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.ewc-ut-title { font-weight: 600; font-size: 12.5px; color: var(--ink); }
.ewc-ut-meta { font-size: 11px; color: var(--ash); margin-top: 2px; font-family: var(--mono); }
#ewc-logo-preview { display: none; margin-top: 10px; align-items: center; gap: 10px; }
#ewc-logo-preview.visible { display: flex; }
#ewc-logo-img { max-height: 36px; max-width: 140px; border: 1px solid var(--hairline); border-radius: 6px; padding: 4px; background: #fff; }

/* Buttons */
.ewc-btn-ghost {
  background: #fff; border: 1.5px solid var(--hairline); border-radius: 10px;
  padding: 7px 12px; font-family: var(--sans); font-size: 12px; font-weight: 600;
  color: var(--ink); cursor: pointer; flex-shrink: 0; transition: border-color .12s;
}
.ewc-btn-ghost:hover { border-color: var(--ink); }
.ewc-btn-primary {
  background: var(--ink); border: 1px solid var(--ink); color: #fff;
  padding: 7px 12px; border-radius: 10px;
  font-family: var(--sans); font-size: 12px; font-weight: 600; cursor: pointer;
}
.ewc-btn-primary:hover { opacity: .85; }

/* Toggles */
.ewc-toggle-row {
  display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center;
  padding: 12px 14px; border: 1.5px solid var(--hairline); border-radius: 12px; background: #fff;
  transition: background .15s, border-color .15s;
}
.ewc-toggle-row + .ewc-toggle-row { margin-top: 8px; }
.ewc-toggle-row.on { background: var(--indigo-50); border-color: var(--indigo-500); }
.ewc-tr-title { font-weight: 600; font-size: 13px; color: var(--ink); }
.ewc-tr-help { font-size: 11.5px; color: var(--ash); margin-top: 3px; line-height: 1.45; }
.ewc-switch {
  width: 36px; height: 20px; border-radius: 999px; background: var(--hairline);
  position: relative; cursor: pointer; transition: background .15s; flex-shrink: 0; border: none; padding: 0;
}
.ewc-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 999px; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s;
}
.ewc-switch.on { background: var(--indigo-500); }
.ewc-switch.on::after { transform: translateX(16px); }

/* Members */
.ewc-mem-list { border: 1px solid var(--hairline); border-radius: 12px; overflow: hidden; }
.ewc-mem-row {
  display: grid; grid-template-columns: 1fr 90px;
  gap: 12px; align-items: center; padding: 10px 14px;
  border-bottom: 1px solid var(--hairline-2); background: #fff;
}
.ewc-mem-row:last-child { border-bottom: none; }
.ewc-mem-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ewc-av {
  width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  color: #fff; font-family: var(--display); font-weight: 700; font-size: 10.5px;
  display: flex; align-items: center; justify-content: center;
}
.ewc-mem-email-main { font-size: 12px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ewc-role-select {
  width: 100%; padding: 4px 20px 4px 8px; border: 1px solid var(--hairline); border-radius: 7px;
  background: #fff; font-family: var(--sans); font-size: 11.5px; font-weight: 600; color: var(--ink);
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'><path d='M3 4.5l3 3 3-3' stroke='%236B6B7D' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 5px center;
}
.ewc-role-select:disabled { background-color: var(--surface-2); color: var(--ash); cursor: not-allowed; }
.ewc-mem-list-head {
  padding: 8px 14px; background: var(--surface-2); border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--ash);
  letter-spacing: .8px; text-transform: uppercase;
}
.ewc-loading { padding: 16px 14px; font-family: var(--mono); font-size: 12px; color: var(--ash); }

/* Owner row */
.ewc-owner-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border: 1.5px solid var(--hairline); border-radius: 12px; background: var(--surface-2);
}
.ewc-owner-av {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; background: var(--indigo-500); color: #fff;
  font-family: var(--display); font-weight: 700; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.ewc-owner-meta { flex: 1; }
.ewc-owner-name { font-family: var(--display); font-weight: 700; font-size: 12.5px; color: var(--ink); }
.ewc-owner-email { font-family: var(--mono); font-size: 11px; color: var(--ash); }

/* Danger */
.ewc-danger-grid { display: grid; gap: 8px; }
.ewc-danger-card {
  border: 1.5px solid var(--hairline); border-radius: 12px;
  padding: 12px 14px; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; background: #fff;
}
.ewc-danger-card.ewc-severe { border-color: #FECACA; background: var(--rose-bg); }
.ewc-dt { font-family: var(--display); font-weight: 700; font-size: 12.5px; color: var(--ink); }
.ewc-dh { font-size: 11px; color: var(--ash); margin-top: 3px; line-height: 1.4; max-width: 380px; }
.ewc-severe .ewc-dt { color: var(--rose-ink); }
.ewc-btn-danger {
  background: #fff; border: 1.5px solid #FECACA; color: var(--rose-ink);
  padding: 6px 11px; border-radius: 9px;
  font-family: var(--sans); font-size: 11.5px; font-weight: 600; cursor: pointer; flex-shrink: 0;
}
.ewc-btn-danger:hover { border-color: var(--rose); }
.ewc-btn-danger.ewc-solid { background: var(--rose); border-color: var(--rose); color: #fff; }
.ewc-btn-danger.ewc-solid:hover { background: var(--rose-ink); }

/* Workspace card — variant picker group */
.ws-edit-group { display: flex; align-items: center; gap: 2px; }
.ws-edit-group .btn.xs.var { padding: 4px 7px; font-size: .65rem; opacity: .7; }
.ws-edit-group .btn.xs.var:hover { opacity: 1; }
