/* Mailcreation – "modern zakelijk" layout (design/Mailcreation.pen) in the mailcreation.com house style: Poppins,
   purple #9B30FF, lavender backgrounds, navy #070127, pill buttons (D-063). Class names are shared by all templates. */
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../vendor/poppins/poppins-latin-400-normal.9212f6f9860f.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../vendor/poppins/poppins-latin-ext-400-normal.90926c36b712.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../vendor/poppins/poppins-latin-500-normal.a09f2fccfee3.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("../vendor/poppins/poppins-latin-ext-500-normal.1f24684cbd72.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../vendor/poppins/poppins-latin-600-normal.72993dddf88a.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("../vendor/poppins/poppins-latin-ext-600-normal.a575b6d9df98.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../vendor/poppins/poppins-latin-700-normal.25b0e113ca7c.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../vendor/poppins/poppins-latin-ext-700-normal.367d2aa05bf0.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #F9F5FE; --surface: #FFFFFF; --text: #160F2E; --muted: #6A6483; --border: #ECE5F6; --border-strong: #D9CFEA;
  --sidebar: #070127; --sidebar-text: #D9D4EE; --sidebar-active: #1D1450; --sidebar-muted: #8B85A8;
  --primary: #9B30FF; --primary-dark: #7F26FD; --primary-soft: #F3EAFF; --primary-tint: #E2CCFF;
  --success: #15803D; --success-soft: #E7F6EC; --warning: #B45309; --warning-soft: #FEF3E2;
  --danger: #DC2626; --danger-soft: #FDECEC; --ai: #7C5CFC; --ai-dark: #5B3FD9; --ai-soft: #F3F0FF; --ai-border: #DCD3FF;
  --head: #F8F5FC; --radius: 16px; --radius-sm: 10px; --pill: 999px;
  /* legacy names used by older templates */
  --ok: var(--success); --info-bg: var(--primary-soft); --warn-bg: var(--warning-soft); --error-bg: var(--danger-soft); --success-bg: var(--success-soft);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }  /* the hidden attribute always wins over display rules (.btn etc.) */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.55 "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 26px; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; margin: 0 0 4px; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 12px; } h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 10px; } hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.icon { flex: none; vertical-align: -3px; }

/* ---------- app shell ---------- */
body.has-shell { padding-left: 248px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; padding: 20px 14px 14px; z-index: 30; overflow-y: auto; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 17px; padding: 4px 8px 22px; text-decoration: none; }
.brand-mark { width: 32px; height: 32px; border-radius: 50%; background: var(--primary); display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; } .brand-text small { color: #F0B429; font-size: 11px; font-weight: 600; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a, .side-link { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--sidebar-text); font-weight: 500; text-decoration: none; }
.side-nav a:hover, .side-link:hover { background: rgba(255,255,255,.05); text-decoration: none; }
.side-nav a.active, .side-link.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.side-label { margin: 18px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--sidebar-muted); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 16px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--sidebar-active); border-radius: var(--radius-sm); }
.side-user form { margin: 0 0 0 auto; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--sidebar-active); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex: none; text-decoration: none; }
.who { display: flex; flex-direction: column; min-width: 0; color: #fff; text-decoration: none; } .who:hover { text-decoration: none; }
.who strong { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .who span { font-size: 12px; color: var(--sidebar-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { background: none; border: 0; color: var(--sidebar-muted); cursor: pointer; padding: 4px; border-radius: 6px; display: inline-flex; } .icon-btn:hover { color: #fff; }
.nav-toggle, .nav-burger { display: none; }
.brand-logo { max-height: 32px; max-width: 180px; display: block; } .brand-logo-lg { max-height: 64px; max-width: 260px; }

.container { max-width: 1240px; padding: 28px 36px 64px; } .wide { max-width: none; }
.narrow { max-width: 640px; }

/* ---------- page header ---------- */
.row-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.row-head h1 { margin: 0; } .row-head > div:last-child:not(:first-child), .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.page-sub, .row-head .sub { color: var(--muted); margin: 2px 0 0; font-size: 14px; }
.subnav { display: flex; gap: 24px; flex-wrap: wrap; margin: 0 0 20px; border-bottom: 1px solid var(--border); }
.subnav a { color: var(--muted); font-weight: 500; padding: 0 0 10px; border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
.subnav a:hover { color: var(--text); } .subnav a.active { color: var(--primary); border-color: var(--primary); font-weight: 600; }

/* ---------- cards, grids ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.card > h2:first-child { margin-top: -2px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: -4px 0 14px; } .card-head h2 { margin: 0; }
.card:has(> .table) { overflow-x: auto; }
.card.flush { padding: 0; } .card.flush > h2, .card.flush > .card-head { padding: 16px 20px 0; margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.grid > .card { margin-bottom: 0; } .grid + .card, .grid + .grid { margin-top: 20px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.mt { margin-top: 16px; } .center { text-align: center; } .scroll { overflow-x: auto; }

/* ---------- KPI / stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0; margin-bottom: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--border); background: var(--surface); }
.stat:last-child { border-right: 0; }
.stat span { font-size: 12px; color: var(--muted); font-weight: 500; } .stat strong { font-size: 24px; font-weight: 700; letter-spacing: -.01em; } .stat small { color: var(--muted); font-size: 12px; font-weight: 500; }
.stat small.up { color: var(--success); } .stat small.down { color: var(--danger); }

/* ---------- forms ---------- */
.field { margin-bottom: 14px; } .field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.field-check label { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date], input[type=datetime-local], input[type=time], input[type=search], input[type=tel], input:not([type]), select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit; color: var(--text); background: #fff; min-height: 38px; }
input[type=color] { width: 48px; height: 38px; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
textarea { min-height: 80px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary-soft); border-color: var(--primary); }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); width: 16px; height: 16px; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.help { color: var(--muted); font-size: 12px; margin: 4px 0 0; } .error { color: var(--danger); font-size: 12px; margin: 4px 0 0; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin: 0 0 14px; } legend { font-weight: 600; padding: 0 4px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 18px; min-height: 38px; border: 1px solid var(--border); border-radius: var(--pill); background: #fff; color: var(--text); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--border-strong); background: #FBF9FE; text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; } .btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-ai { background: var(--ai); border-color: var(--ai); color: #fff; } .btn-ai:hover { background: var(--ai-dark); border-color: var(--ai-dark); }
.btn-danger { color: var(--danger); border-color: #F5C2C2; } .btn-danger:hover { background: var(--danger-soft); }
.btn-block { width: 100%; } .btn-sm { padding: 4px 12px; min-height: 30px; font-size: 13px; }
.btn:disabled, .btn[aria-disabled=true] { opacity: .55; cursor: not-allowed; }
button.link { background: none; border: 0; color: var(--primary); cursor: pointer; font: inherit; padding: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--text); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; }
.chip:hover { border-color: var(--border-strong); text-decoration: none; }

/* ---------- messages ---------- */
.messages { list-style: none; padding: 0; margin: 0 0 16px; }
.msg { padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 10px; background: var(--primary-soft); color: var(--text); }
.msg-error { background: var(--danger-soft); } .msg-success { background: var(--success-soft); } .msg-warning { background: var(--warning-soft); } .msg-info { background: var(--primary-soft); }
.muted { color: var(--muted); } .small { font-size: 13px; } .ok { color: var(--success); }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--head); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table td a { font-weight: 500; } .table td small { display: block; color: var(--muted); font-size: 12px; }
.card > .table:first-child th { border-top: 0; }
.card.flush > .table th:first-child, .card.flush > .table td:first-child { padding-left: 20px; }
.card.flush > .table th:last-child, .card.flush > .table td:last-child { padding-right: 20px; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: #F2EEF9; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-success, .status-active, .cstatus-subscribed, .camp-sent, .dom-verified, .flow-active { background: var(--success-soft); color: var(--success); }
.badge-info, .status-pending_approval, .cstatus-unconfirmed, .camp-sending, .camp-queued, .camp-scheduled, .dom-pending { background: var(--primary-soft); color: var(--primary); }
.badge-warning, .status-paused, .camp-paused, .camp-draft, .flow-draft { background: var(--warning-soft); color: var(--warning); }
.badge-danger, .status-suspended, .status-closed, .cstatus-bounced, .cstatus-complained, .camp-failed, .camp-cancelled, .dom-failed, .dom-temporary_failure { background: var(--danger-soft); color: var(--danger); }
.flow-paused, .cstatus-unsubscribed, .cstatus-no_consent { background: #F2EEF9; color: var(--muted); }
.badge-ai { background: var(--ai-soft); color: var(--ai-dark); }

/* ---------- lists / rows ---------- */
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: 0; } .row form, form.inline { margin: 0; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; } .kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); } .kv strong { font-weight: 600; text-align: right; }
.tile { display: flex; gap: 14px; align-items: center; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none; }
.tile:hover { border-color: var(--border-strong); text-decoration: none; } .tile .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tile .t strong { font-size: 15px; } .tile .t span { font-size: 12px; color: var(--muted); }
.icon-box { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.icon-box.ai { background: var(--ai-soft); color: var(--ai); } .icon-box.sm { width: 30px; height: 30px; border-radius: 8px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-bottom: 20px; }

/* ---------- filters, bulk, pager ---------- */
.filterbar, .bulkbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filterbar input, .filterbar select, .bulkbar select { width: auto; min-width: 140px; flex: 1 1 140px; }
.filters a.active { font-weight: 700; } .pager { display: flex; gap: 16px; align-items: center; margin-top: 12px; }
.cond-row { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; } .cond-row select, .cond-row input { width: auto; flex: 1 1 140px; }

/* ---------- meters, bars ---------- */
.progress, .meter { height: 8px; background: #E8E1F4; border-radius: 999px; overflow: hidden; margin-top: 6px; }
.progress-bar, .meter > div, .meter > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width .4s; }
.meter.full > div, .meter.over > span, .meter.full > span { background: var(--danger); } .meter.warn > div, .meter.warn > span { background: var(--warning); }
.meter.ai > div, .meter.ai > span { background: var(--ai); }
.usage { display: flex; flex-direction: column; gap: 14px; } .usage-row .top { display: flex; justify-content: space-between; font-size: 13px; } .usage-row .top strong { font-weight: 600; } .usage-row .top span { color: var(--muted); }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 220px; }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 6px; }
.bar > div { width: 100%; background: var(--primary-tint); border-radius: 4px 4px 0 0; min-height: 2px; } .bar:last-child > div { background: var(--primary); }
.bar span { font-size: 11px; color: var(--muted); }

/* ---------- campaign wizard ---------- */
.wizard { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 20px; flex-wrap: wrap; align-items: center; }
.wizard li a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 500; }
.wizard li a::before { content: counter(step); counter-increment: step; width: 22px; height: 22px; border-radius: 50%; background: #E8E1F4; color: var(--muted); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.wizard { counter-reset: step; } .wizard li.done a { color: var(--text); } .wizard li.done a::before { background: var(--success); color: #fff; content: "✓"; }
.wizard li.active a { background: var(--primary-soft); color: var(--primary); font-weight: 600; } .wizard li.active a::before { background: var(--primary); color: #fff; }
.wizard li + li::before { content: ""; display: inline-block; width: 24px; height: 2px; background: #E8E1F4; vertical-align: middle; margin-right: 6px; }

/* ---------- misc existing components ---------- */
.auth { max-width: 420px; margin: 48px auto; padding: 0 16px; }
.codes { columns: 2; list-style: none; padding: 0; font-size: 1.1rem; } .qr { margin: 8px 0; background: #fff; }
.steps li { margin-bottom: 10px; }
code { background: #F4F0FA; padding: 1px 5px; border-radius: 4px; font-size: .92em; }
pre.embed { background: #F4F0FA; padding: 12px; border-radius: var(--radius-sm); overflow-x: auto; font-size: 12px; white-space: pre-wrap; word-break: break-all; }
iframe.preview { width: 640px; max-width: 100%; height: 640px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; }
textarea.code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
td.url { word-break: break-all; } .inline-form { display: flex; gap: 8px; align-items: center; } .inline-form.wrap { flex-wrap: wrap; }
#gjs { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 12px; overflow: hidden; }
.flow-steps { list-style: none; padding: 0; margin: 0; }
.flow-step { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 8px; background: #fff; }
.flow-step.kind-condition { border-color: #DCC7FF; } .flow-step.kind-email { border-left: 3px solid var(--primary); } .flow-step.kind-wait { background: #FCFAFE; }
.branches { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; } .branch { min-width: 0; } .branch h4 { margin: 4px 0; font-size: 12px; color: var(--muted); }
.step-actions { display: flex; gap: 10px; margin-top: 6px; font-size: 13px; } .add-step { margin: 6px 0 10px; flex-wrap: wrap; }
.flow-step .inline-form select, .flow-step .inline-form input, .add-step select { width: auto; flex: 0 1 auto; }
.flow-step .inline-form input[type=number] { width: 80px; } .add-step button { white-space: nowrap; }
.brand-preview { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; }
.swatch { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border); display: inline-block; }
.dns-box { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-family: ui-monospace, monospace; font-size: 12px; overflow-x: auto; }
.price { font-size: 22px; font-weight: 700; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.plan-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; background: var(--surface); }
.plan-card.current { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.legal-text { line-height: 1.6; }
.menu { position: relative; } .menu summary { cursor: pointer; list-style: none; } .menu summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; top: 40px; right: 0; z-index: 20; min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(22,10,60,.12); padding: 6px; display: flex; flex-direction: column; }
.menu-list a { padding: 8px 10px; border-radius: 6px; color: var(--text); } .menu-list a:hover { background: var(--bg); text-decoration: none; }

/* ---------- settings layout ---------- */
.settings-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 20px; }
.settings-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text); font-weight: 500; font-size: 13px; text-decoration: none; }
.settings-nav a .icon { color: var(--muted); } .settings-nav a:hover { background: #F2EEF9; text-decoration: none; }
.settings-nav a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; } .settings-nav a.active .icon { color: var(--primary); }

/* ---------- auth pages (split layout) ---------- */
.auth-split { display: grid; grid-template-columns: minmax(0, 1fr) 640px; min-height: 100vh; background: var(--surface); }
.auth-split .auth-left { display: flex; flex-direction: column; justify-content: space-between; padding: 32px 48px; gap: 32px; }
.auth-split .auth-form { width: 100%; max-width: 400px; margin: 0 auto; }
.auth-split .auth-form h1 { font-size: 28px; margin-bottom: 8px; } .auth-split .auth-form .lead { color: var(--muted); margin-bottom: 22px; }
.auth-word { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); text-decoration: none; }
.auth-right { position: relative; overflow: hidden; background: radial-gradient(circle at 78% 22%, rgba(155,48,255,.55), rgba(155,48,255,0) 46%),
  radial-gradient(circle at 10% 100%, rgba(236,72,153,.22), rgba(236,72,153,0) 40%), var(--sidebar); color: #fff; padding: 56px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 16px; }
.auth-right::before { content: ""; position: absolute; width: 440px; height: 440px; top: -90px; right: -120px; border-radius: 50%;
  border: 2px dashed rgba(201,162,255,.45); }
.auth-right::after { content: ""; position: absolute; width: 56px; height: 56px; top: 210px; right: 290px; border-radius: 50%;
  background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2724%27 height=%2724%27 viewBox=%270 0 24 24%27 fill=%27none%27 stroke=%27white%27 stroke-width=%272%27 stroke-linecap=%27round%27 stroke-linejoin=%27round%27%3E%3Cpath d=%27M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z%27/%3E%3Cpath d=%27m21.854 2.147-10.94 10.939%27/%3E%3C/svg%3E") center / 24px no-repeat;
  box-shadow: 0 10px 30px rgba(155,48,255,.45); }
.auth-right > * { position: relative; z-index: 1; }
.accent { color: var(--primary); } .auth-right .accent { color: #C9A2FF; }
.auth-right h2 { font-size: 24px; font-weight: 700; line-height: 1.3; color: #fff; margin: 0 0 8px; }
.auth-right li { list-style: none; display: flex; gap: 10px; align-items: center; color: var(--sidebar-text); margin-bottom: 10px; } .auth-right ul { padding: 0; margin: 0; }
.auth-right .icon { color: #C9A2FF; }
.auth-foot { color: var(--muted); font-size: 12px; } .auth-foot a { color: var(--muted); }

/* ---------- house style (brand kit) ---------- */
.swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.swatch-big label { display: block; } .swatch-big input[type=color] { width: 100%; height: 44px; border-radius: var(--radius-sm); }
.font-sample { background: var(--bg); border-radius: 10px; padding: 14px; }
.mail-preview { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #fff; }
.mail-preview .inner { padding: 20px 24px; } .mail-preview .foot { background: #F8F5FC; padding: 10px; font-size: 11px; color: var(--muted); text-align: center; }
.ai-note { background: var(--ai-soft); border-radius: var(--radius-sm); padding: 14px; font-size: 13px; } .ai-note strong { color: var(--ai-dark); display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }

/* ---------- AI assistant ---------- */
.ai-credits { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--ai-soft); border: 1px solid var(--ai-border); color: var(--ai-dark); font-size: 12px; font-weight: 600; }
.ai-credits .meter { width: 54px; height: 6px; margin: 0; background: var(--ai-border); } .ai-credits .icon { color: var(--ai); }
.ai-card { background: var(--surface); border: 1.5px solid var(--ai-border); border-radius: 16px; padding: 28px; margin-bottom: 24px; }
.ai-card-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; } .ai-card-head .t { flex: 1; min-width: 240px; }
.ai-card-head h2 { font-size: 19px; margin: 0 0 2px; }
.ai-prompt { background: var(--bg); border-radius: var(--radius); padding: 16px 18px; }
.ai-prompt textarea { border: 0; background: transparent; padding: 0; font-size: 15px; min-height: 64px; resize: vertical; } .ai-prompt textarea:focus { outline: none; }
.ai-prompt .opts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.ai-prompt .opts select { width: auto; min-height: 32px; padding: 4px 10px; font-size: 13px; border-radius: 8px; }
.ai-examples { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; font-size: 13px; color: var(--muted); }
.start-center { max-width: 1200px; margin: 0 auto; } .start-center > .row-head { justify-content: center; text-align: center; flex-direction: column; margin: 12px 0 28px; }
.ai-panel { position: fixed; top: 0; right: 0; bottom: 0; width: 400px; background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; z-index: 40; box-shadow: -12px 0 32px rgba(22,10,60,.08); }
.ai-panel[hidden] { display: none; }
.ai-head { display: flex; gap: 12px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); } .ai-head .t { flex: 1; } .ai-head strong { display: block; font-size: 15px; } .ai-head span { color: var(--muted); font-size: 12px; }
.ai-head .icon-btn { color: var(--muted); } .ai-head .icon-btn:hover { color: var(--text); }
.ai-conv { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.ai-msg-user { align-self: flex-end; max-width: 85%; background: var(--primary); color: #fff; border-radius: 14px 14px 4px 14px; padding: 10px 14px; white-space: pre-wrap; }
.ai-msg-ai { align-self: flex-start; max-width: 95%; background: #F5F2FA; border-radius: 14px 14px 14px 4px; padding: 12px 14px; }
.ai-msg-ai ul { margin: 8px 0 0; padding: 0; list-style: none; } .ai-msg-ai li { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 4px; } .ai-msg-ai li .icon { color: var(--success); margin-top: 3px; }
.ai-msg-ai .meta { background: #fff; border-radius: 8px; padding: 10px 12px; margin-top: 10px; font-size: 13px; } .ai-msg-ai .meta span { color: var(--muted); display: block; }
.ai-msg-error { align-self: stretch; background: var(--danger-soft); border-radius: 10px; padding: 10px 14px; font-size: 13px; }
.ai-thinking { align-self: flex-start; color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.ai-thinking::before { content: ""; width: 14px; height: 14px; border: 2px solid var(--ai-border); border-top-color: var(--ai); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ai-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-compose { border-top: 1px solid var(--border); padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; }
.ai-compose form { display: flex; gap: 8px; align-items: flex-end; border: 1.5px solid var(--ai-border); border-radius: var(--radius); padding: 8px 8px 8px 12px; margin: 0; }
.ai-compose textarea { border: 0; padding: 4px 0; min-height: 40px; max-height: 160px; resize: none; } .ai-compose textarea:focus { outline: none; }
.ai-compose .send { width: 38px; height: 38px; border-radius: 10px; border: 0; background: var(--ai); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.ai-compose .send:disabled { opacity: .5; cursor: not-allowed; }
.ai-compose .note { font-size: 12px; color: var(--muted); margin: 0; } .ai-compose .ai-credits { align-self: center; }

/* ---------- public pages ---------- */
.public-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 40px 16px; }
.public-card { width: 100%; max-width: 480px; background: #fff; border-radius: 14px; padding: 36px; border: 1px solid var(--border); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } .auth-split { grid-template-columns: 1fr; } .auth-right { display: none; } }
@media (max-width: 900px) {
  body.has-shell { padding-left: 0; padding-top: 56px; }
  .nav-burger { display: inline-flex; position: fixed; top: 10px; left: 12px; z-index: 35; width: 38px; height: 38px; border-radius: 8px; background: var(--sidebar); color: #fff; align-items: center; justify-content: center; cursor: pointer; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; } .nav-toggle:checked ~ .sidebar { transform: none; }
  .container { padding: 16px 16px 48px; } .settings-layout { grid-template-columns: 1fr; } .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .stat { border-right: 0; border-bottom: 1px solid var(--border); } .swatches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-panel { width: 100%; } .branches { grid-template-columns: 1fr; } .codes { columns: 1; }
  .auth-split .auth-left { padding: 24px 16px; }
}
.section-title { font-size: 18px; font-weight: 700; margin: 0 0 14px; } .settings-content .card.narrow { max-width: none; }
.tone-chips { display: flex; flex-wrap: wrap; gap: 8px; } .tone-chip { position: relative; cursor: pointer; }
.tone-chip input { position: absolute; opacity: 0; } .tone-chip span { display: inline-block; padding: 5px 12px; border-radius: 999px; background: #F2EEF9; color: var(--muted); font-size: 13px; font-weight: 600; }
.tone-chip input:checked + span { background: var(--primary-soft); color: var(--primary); } .tone-chip input:focus-visible + span { outline: 2px solid var(--primary); }
.editor-bar { margin-bottom: 12px; }
.ai-msg-ai li span:first-child { color: var(--success); font-weight: 700; }
/* tables that fill their card edge to edge */
.card:has(> .table:first-child) { padding: 0; }
.card > h2 + .table, .card > .row-head + .table, .card > .card-head + .table, .card > p + .table, .card > .filterbar + .table { width: calc(100% + 40px); margin: 0 -20px 12px; }
.card > :is(h2, .row-head, .card-head, p, .filterbar) + .table:last-child { margin-bottom: -20px; } .card > .table + p { margin-top: 4px; }
.card > .table th:first-child, .card > .table td:first-child { padding-left: 20px; }
.card > .table th:last-child, .card > .table td:last-child { padding-right: 20px; }
.card > .table { border-radius: 0 0 var(--radius) var(--radius); }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }
.flow-row { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; }
.flow-row:last-child { border-bottom: 0; } .flow-row:hover { text-decoration: none; } .flow-row .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.flow-row .t strong { font-size: 14px; } .flow-row .t span { font-size: 12px; color: var(--muted); }
.auth-split { position: relative; } .auth-split > .messages { position: absolute; top: 16px; left: 48px; right: 688px; z-index: 2; } @media (max-width: 1100px) { .auth-split > .messages { right: 16px; left: 16px; } }

/* ---------- campaign editor (design screens 04 + 06) ---------- */
body.editor-page { padding: 0; overflow: hidden; } .editor-page .sidebar, .editor-page .nav-burger { display: none; }
main.ed { height: 100vh; display: flex; flex-direction: column; background: var(--surface); position: relative; }
main.ed > .messages { position: absolute; top: 74px; left: 50%; transform: translateX(-50%); z-index: 50; min-width: 360px; }
.ed-top { display: grid; grid-template-columns: auto minmax(160px, 1fr) auto minmax(160px, 1fr); align-items: center; gap: 16px; padding: 12px 24px; border-bottom: 1px solid var(--border); }
.ed-top > .btn { justify-self: end; }
.ed-back { width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--text); }
.ed-back:hover { background: var(--bg); text-decoration: none; }
.ed-title { display: flex; flex-direction: column; min-width: 0; } .ed-title strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-title span { font-size: 12px; color: var(--muted); }
.ed-steps { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.ed-steps li + li::before { content: ""; display: inline-block; width: 18px; height: 2px; background: #E8E1F4; margin-right: 6px; vertical-align: middle; }
.ed-steps a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; color: var(--muted); font-weight: 500; text-decoration: none; white-space: nowrap; }
.ed-steps .n { width: 22px; height: 22px; border-radius: 50%; background: #E8E1F4; color: var(--muted); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.ed-steps .done a { color: var(--text); } .ed-steps .done .n { background: var(--success); color: #fff; }
.ed-steps .active a { background: var(--primary-soft); color: var(--primary); font-weight: 600; } .ed-steps .active .n { background: var(--primary); color: #fff; }
.ed-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 24px; border-bottom: 1px solid var(--border); }
.ed-group { display: flex; align-items: center; gap: 6px; }
.ed-tool { display: inline-flex; align-items: center; gap: 6px; height: 34px; min-width: 34px; justify-content: center; padding: 0 8px; border: 0; background: none; border-radius: 8px; color: var(--text); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; }
.ed-tool:hover { background: var(--bg); text-decoration: none; } .ed-sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }
.ed-zoom { width: auto; min-height: 34px; border: 0; background: none; font-weight: 500; padding: 4px 8px; }
.ed-seg { display: inline-flex; background: #F4F0FA; border-radius: 10px; padding: 3px; gap: 2px; }
.ed-seg button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px 12px; border-radius: 8px; font: inherit; font-weight: 500; color: var(--muted); cursor: pointer; }
.ed-seg button.on { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(22,10,60,.08); }
.ed-seg.small button { padding: 4px 10px; font-size: 13px; }
.btn-ai-soft { background: var(--ai-soft); border-color: var(--ai-border); color: var(--ai-dark); font-weight: 600; } .btn-ai-soft:hover { background: #EAE4FF; border-color: var(--ai-border); }
.btn-ai-soft.on { background: var(--ai); border-color: var(--ai); color: #fff; }
.ed-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px minmax(0, 1fr) 340px; }
.ed-body.html-mode { grid-template-columns: 1fr; }
.ed-left { border-right: 1px solid var(--border); overflow-y: auto; display: flex; flex-direction: column; }
.ed-tabs { display: flex; gap: 0; padding: 0 6px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: #fff; z-index: 2; }
.ed-tabs button { flex: 1 1 auto; border: 0; background: none; padding: 12px 3px 10px; font: inherit; font-size: 12.5px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; }
.ed-tabs button.on { color: var(--text); font-weight: 600; border-color: var(--primary); }
.ed-pane { padding: 14px 16px 24px; }
.ed-search { display: flex; align-items: center; gap: 8px; background: #F5F2FA; border-radius: 10px; padding: 0 12px; color: var(--muted); margin-bottom: 8px; }
.ed-search input { border: 0; background: none; min-height: 38px; padding: 0; } .ed-search input:focus { outline: none; }
.ed-list { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.ed-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; background: #F5F2FA; border-radius: 8px; font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.ed-item .icon { color: var(--primary); } .ed-item:hover { background: #EEE8F7; }
.ed-swatches { display: flex; gap: 8px; flex-wrap: wrap; } .ed-swatch { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border); padding: 0; cursor: pointer; }
.ed-swatch:hover { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--primary); }
.ed-canvas { background: #F2EEF9; min-width: 0; position: relative; }
.ed-canvas #gjs { height: 100% !important; border: 0; border-radius: 0; margin: 0; }
.ed-html { width: calc(100% - 48px); height: calc(100% - 48px); margin: 24px; }
.ed-right { border-left: 1px solid var(--border); overflow-y: auto; display: flex; flex-direction: column; min-width: 0; }
.ed-right > #ed-props { display: flex; flex-direction: column; min-height: 100%; } .ed-right > #ed-props[hidden] { display: none; }
.ed-props-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.ed-sel { display: inline-flex; align-items: center; gap: 8px; min-width: 0; } .ed-sel .icon { color: var(--primary); } .ed-sel strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-props-body { padding: 14px 16px; flex: 1; } .ed-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.ed-quick { margin-bottom: 16px; }
.ed-mailsettings { border-top: 1px solid var(--border); padding: 12px 16px; } .ed-mailsettings summary { cursor: pointer; display: flex; gap: 8px; align-items: center; font-weight: 500; font-size: 13px; }
.ed-mailsettings p { margin-top: 10px; }
.ed-right .ai-panel { position: static; width: auto; border: 0; box-shadow: none; flex: 1; min-height: 100%; z-index: auto; }
.ed-form { position: absolute; bottom: 12px; left: 312px; display: flex; gap: 8px; align-items: center; z-index: 5; }
.ed-form input[type=text] { width: 240px; min-height: 32px; font-size: 13px; }
.html-mode ~ .ed-form, .ed-body.html-mode + .ed-form { left: 24px; }
.ed-canvas.dark .gjs-frame { filter: invert(1) hue-rotate(180deg); }

/* GrapesJS UI in the light design */
.ed .gjs-one-bg { background-color: #fff; } .ed .gjs-two-color { color: var(--text); }
.ed .gjs-three-bg { background-color: var(--primary); color: #fff; } .ed .gjs-four-color, .ed .gjs-four-color-h:hover { color: var(--primary); }
.ed .gjs-cv-canvas { background: #F2EEF9; width: 100%; height: 100%; top: 0; }
.ed .gjs-frame-wrapper { padding-top: 24px; }
.ed .gjs-editor { font-family: inherit; }
.ed .gjs-blocks-c { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 4px 0 6px; }
.ed .gjs-block { width: auto; min-height: 76px; margin: 0; padding: 12px 4px 8px; border: 1px solid var(--border); border-radius: 10px; box-shadow: none; color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: #fff; transition: border-color .15s; }
.ed .gjs-block:hover { border-color: var(--primary); color: var(--primary); box-shadow: none; }
.ed .gjs-block-label { font-family: inherit; font-size: 12px; font-weight: 500; line-height: 1.2; }
.ed .gjs-block__media { margin: 0; } .ed .gjs-block svg { width: 22px; height: 22px; }
.ed .gjs-block-categories { display: flex; flex-direction: column; gap: 6px; } .ed .gjs-block-category { border: 0; }
.ed .gjs-block-category .gjs-title { background: none; border: 0; padding: 10px 0 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ed .gjs-block-category .gjs-caret-icon { display: none; }
.ed .gjs-sm-sector, .ed .gjs-trt-traits { border: 0; } .ed .gjs-sm-sector-title { background: none; border: 0; border-bottom: 1px solid var(--border); padding: 10px 0; font-size: 13px; font-weight: 600; letter-spacing: 0; }
.ed .gjs-sm-properties { padding: 10px 0; } .ed .gjs-sm-property, .ed .gjs-trt-trait { font-size: 13px; color: var(--text); }
.ed .gjs-sm-label, .ed .gjs-label { font-size: 12px; font-weight: 600; color: var(--text); }
.ed .gjs-field { background: #fff; border: 1px solid var(--border); border-radius: 8px; color: var(--text); }
.ed .gjs-field input, .ed .gjs-field select, .ed .gjs-field textarea { min-height: 0; border: 0; padding: 6px 8px; font-size: 13px; color: var(--text); }
.ed .gjs-trt-trait { padding: 6px 0; display: flex; flex-direction: column; gap: 4px; align-items: stretch; } .ed .gjs-trt-trait .gjs-label-wrp { width: auto; }
.ed .gjs-clm-tags { display: none; }
.ed .gjs-layer { background: none; font-size: 13px; } .ed .gjs-layer-title { border-bottom: 1px solid var(--border); padding: 8px 6px; background: none; } .ed .gjs-layer.gjs-selected .gjs-layer-item { background: var(--primary-soft); }
.ed .gjs-toolbar { background: var(--primary); border-radius: 6px; } .ed .gjs-badge { background: var(--primary); border-radius: 4px; font-family: inherit; }
.ed .gjs-selected { outline: 2px solid var(--primary) !important; } .ed .gjs-placeholder { border-color: var(--primary); }
.gjs-mdl-dialog { font-family: inherit; border-radius: 12px; } .gjs-mdl-header { border-bottom: 1px solid var(--border); }
@media (max-width: 1200px) { .ed-body { grid-template-columns: 260px minmax(0, 1fr) 300px; } .ed-steps a { font-size: 0; gap: 0; padding: 4px; } .ed-steps .n { font-size: 12px; } }
@media (max-width: 900px) { body.editor-page { padding: 0; } .ed-body { grid-template-columns: 1fr; } .ed-left, .ed-right { display: none; } .ed-top { grid-template-columns: auto 1fr auto; } .ed-steps { display: none; } }
.ed .gjs-pn-panel, .ed .gjs-pn-views-container, .ed .gjs-pn-views { display: none !important; }
.ed-save-tpl { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.ed-form { position: static; } .ed-body:not(.html-mode) ~ .ed-form { display: none; }
.ed-body.html-mode ~ .ed-form { display: flex; padding: 0 24px 16px; }

/* ---------- flow builder (design screen 02) ---------- */
.crumbs { margin: 0 0 4px; font-size: 12px; color: var(--muted); } .crumbs a { color: var(--muted); }
.fb { display: grid; grid-template-columns: 300px minmax(0, 1fr); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); min-height: calc(100vh - 160px); }
.fb-side { padding: 22px 24px; border-right: 1px solid var(--border); }
.fb-side h2 { font-size: 16px; margin-bottom: 16px; }
.fb-form .btn-primary { margin-top: 6px; }
.fb-option { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--border); }
.fb-option strong { font-size: 13px; } .fb-option .help { margin-top: 2px; } .fb-option .field-check { margin-top: 8px; }
.switch { position: relative; flex: none; width: 38px; height: 22px; margin-top: 1px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #DCD3EC; border-radius: 11px; transition: background .15s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--primary); } .switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.fb-note { display: flex; gap: 10px; background: var(--primary-soft); color: var(--text); border-radius: 10px; padding: 12px 14px; font-size: 13px; margin-top: 16px; } .fb-note .icon { color: var(--primary); margin-top: 2px; }
.fb-stats-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.fb-stats-tiles div { background: var(--bg); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; }
.fb-stats-tiles strong { font-size: 20px; } .fb-stats-tiles span { font-size: 12px; color: var(--muted); }
.fb-canvas { background: #F5F2FA; padding: 32px 24px 48px; overflow-x: auto; }
.fb-flow { display: flex; flex-direction: column; align-items: center; width: max-content; min-width: 100%; }
.fb-card { width: 360px; max-width: 100%; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 1px 2px rgba(22,10,60,.04); }
.fb-card:has(> .fb-det[open]) { box-shadow: 0 0 0 2px var(--primary-soft); border-color: #D3B8FF; }
.fb-sum { display: flex; gap: 12px; align-items: center; padding: 14px 16px; cursor: pointer; list-style: none; }
.fb-sum::-webkit-details-marker { display: none; } .fb-start .fb-sum { cursor: default; }
.fb-ico { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.tone-blue { background: var(--primary-soft); color: var(--primary); } .tone-amber { background: #FEF3E2; color: #B45309; }
.tone-purple { background: var(--ai-soft); color: var(--ai); } .tone-green { background: var(--success-soft); color: var(--success); }
.tone-grey { background: #F2EEF9; color: var(--muted); }
.fb-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fb-t small { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fb-t strong { font-size: 14px; line-height: 1.35; } .fb-t span { font-size: 12px; color: var(--muted); }
.fb-chev { color: var(--muted); transition: transform .15s; } .fb-det[open] .fb-chev { transform: rotate(180deg); }
.fb-stats { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); background: #FCFAFE; border-radius: 0 0 12px 12px; }
.fb-edit { padding: 4px 16px 14px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; padding-top: 14px; }
.fb-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; font-size: 13px; }
.fb-row input[type=number] { width: 76px; } .fb-row select { width: auto; flex: 1 1 140px; } .fb-row label { display: inline-flex; gap: 6px; align-items: center; }
.fb-col { display: flex; flex-direction: column; gap: 8px; margin: 0; } .fb-col .btn { align-self: flex-start; }
.fb-tools { display: flex; gap: 4px; border-top: 1px dashed var(--border); padding-top: 8px; } .fb-tools form { margin: 0; }
.fb-tools .ed-tool { height: 30px; font-size: 13px; color: var(--muted); } .fb-tools .ed-tool.danger:hover { color: var(--danger); background: var(--danger-soft); }
.fb-line { width: 2px; height: 22px; background: #DCD3EC; } .fb-line.short { height: 14px; }
.fb-branches { display: flex; gap: 24px; align-items: flex-start; justify-content: center; }
.fb-branch { position: relative; padding-top: 12px; }
.fb-branch::before { content: ""; position: absolute; top: 0; height: 2px; background: #DCD3EC; }
.fb-branch:first-child::before { left: 50%; right: -12px; } .fb-branch:last-child::before { left: -12px; right: 50%; }
.fb-branch::after { content: ""; position: absolute; top: 0; left: calc(50% - 1px); width: 2px; height: 12px; background: #DCD3EC; }
.fb-branch { display: flex; flex-direction: column; align-items: center; min-width: 260px; }
.fb-branch .fb-card { width: 280px; } .fb-branch .fb-branch .fb-card { width: 250px; }
.fb-pill { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; margin-top: -2px; }
.fb-pill.yes { background: var(--success-soft); color: var(--success); } .fb-pill.no { background: #F2EEF9; color: var(--muted); }
.fb-empty { margin: 10px 0 0; }
.fb-add { position: relative; } .fb-add > summary { list-style: none; display: inline-flex; gap: 6px; align-items: center; padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--border); color: var(--primary); font-weight: 600; font-size: 13px; cursor: pointer; }
.fb-add > summary::-webkit-details-marker { display: none; } .fb-add[open] > summary { border-color: var(--primary); }
.fb-menu { position: absolute; top: 40px; left: 50%; transform: translateX(-50%); z-index: 10; width: 240px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 12px 32px rgba(22,10,60,.14); padding: 6px; display: flex; flex-direction: column; margin: 0; }
.fb-menu button { display: flex; gap: 10px; align-items: center; border: 0; background: none; padding: 9px 10px; border-radius: 8px; font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.fb-menu button:hover { background: var(--bg); } .fb-menu .icon { color: var(--primary); }
@media (max-width: 1000px) { .fb { grid-template-columns: 1fr; } .fb-side { border-right: 0; border-bottom: 1px solid var(--border); } }
.fb-warn { color: var(--warning) !important; font-weight: 500; }
.fb-branches { width: max-content; } .fb-branch { flex: none; }
.fb-det > summary { list-style: none; } .fb-det > summary::-webkit-details-marker { display: none; }
.fb-mailbar { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 16px 14px; border-top: 1px solid var(--border); }
.fb-tools { flex-wrap: wrap; } .fb-tools .ed-tool { padding: 0 6px; }
.fb-col select, .fb-col input { width: 100%; }
.fb-card select { text-overflow: ellipsis; }
/* one consistent dropdown arrow everywhere (native arrows sit at different spots per browser) */
select:not([multiple]):not([size]) {
  -webkit-appearance: none; appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px 16px;
}
.ed-zoom { padding-right: 26px !important; background-position: right 6px center !important; }
.ai-prompt .opts select { padding-right: 30px; background-position: right 8px center; }
.tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.tpl-tile { display: flex; gap: 14px; align-items: center; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.tpl-tile .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tpl-tile .t strong { font-size: 15px; } .tpl-tile .t span { font-size: 13px; color: var(--muted); line-height: 1.45; }
.tpl-tile .t em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--primary); margin-top: 2px; } .tpl-tile .t em.tx { color: var(--success); }
.tpl-tile form { margin: 0; flex: none; }
@media (max-width: 900px) { .tile-grid { grid-template-columns: 1fr; } }
label.field-check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; margin-bottom: 8px; }
label.field-check input { margin-top: 2px; flex: none; }
.stats { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
main.container > h1, .settings-content > h1 { margin-bottom: 20px; } main.container > h1 + p, main.container > h1 + .muted { margin-top: -12px; margin-bottom: 20px; color: var(--muted); }
.nowrap { white-space: nowrap; }
.form-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 20px; align-items: start; }
.form-cols > .field-check, .form-cols > .form-actions, .form-cols > .msg { grid-column: 1 / -1; }
@media (max-width: 900px) { .form-cols { grid-template-columns: 1fr; } }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.filters a { padding: 5px 12px; border-radius: 999px; background: #F2EEF9; color: var(--muted); font-size: 13px; font-weight: 500; text-decoration: none; }
.filters a.active, .filters a:hover { background: var(--primary-soft); color: var(--primary); }

/* editor: versions and own blocks */
.ed-version { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; background: #F5F2FA; border-radius: 8px; margin: 0; }
.ed-version > span { display: flex; gap: 10px; align-items: center; min-width: 0; } .ed-version .icon { color: var(--primary); flex: none; }
.ed-version > span > span { display: flex; flex-direction: column; min-width: 0; } .ed-version small { color: var(--muted); font-size: 12px; }
.ed-mine-box { margin-top: 12px; font-size: 13px; } .ed-mine-box summary { cursor: pointer; color: var(--muted); }
.ed-mine-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.ed-mine-row .icon-btn { color: var(--muted); } .ed-mine-row .icon-btn:hover { color: var(--danger); }
.ed-save-block { width: 100%; margin-bottom: 12px; }
.ed-dialog { border: 0; border-radius: var(--radius); padding: 22px; width: min(560px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(22,10,60,.25); color: var(--text); }
.ed-dialog::backdrop { background: rgba(7,1,39,.45); } .ed-dialog h2 { font-size: 18px; } .ed-dialog .actions { justify-content: flex-end; margin-top: 16px; }
.ed-pick { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; margin-top: 10px; }
.ed-pick label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.ed-pick label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.ed-pick img, .ed-pick .ph { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; background: var(--bg); display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.ed-pick strong { display: block; font-size: 13px; } .ed-pick small { color: var(--muted); font-size: 12px; }
