/* The `hidden` attribute must always win. Any `display` rule (.btn, .modal, .co-err,
   .img-spinner …) otherwise overrides it, because attribute and class selectors have the
   same specificity and the class usually comes later. This has caused the same visible bug
   three times — a global reset ends the class of bug rather than patching each selector. */
[hidden] { display: none !important; }

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --fg: #0f172a;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --border: #e8eaee;
  --border-strong: #d7dbe2;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-fg: #ffffff;
  --primary-weak: #eef2ff;
  --danger: #dc2626;
  --danger-weak: #fef2f2;
  --radius: 8px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.05);
  --shadow: 0 8px 24px rgba(16,24,40,.10);
  --sidebar-w: 216px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* aliases kept for older references */
  --line: #e7e9ee; /* admin.css loads without app.css, where --line lives */
  --background: var(--surface); --foreground: var(--fg); --card: var(--surface);
  --surface-2: var(--surface); --muted-foreground: var(--muted); --input: var(--border);
  --ring: var(--primary); --primary-foreground: var(--primary-fg);
  --destructive: var(--danger); --destructive-bg: var(--danger-weak);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); font-size: 13px; line-height: 1.45; color: var(--fg); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
i[class^="ri-"], i[class*=" ri-"] { font-style: normal; line-height: 1; }

/* ---- layout ---- */
.admin-shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-w); flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar-brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 15px; padding: 5px 8px 10px; letter-spacing: -.01em; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 27px; height: 27px; border-radius: 7px; background: var(--primary); color: #fff; font-size: 15px; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-section { display: flex; flex-direction: column; gap: 1px; }
.nav-section + .nav-section { margin-top: 14px; }
.nav-section-title { padding: 4px 10px 3px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--radius); color: var(--muted); font-weight: 500; transition: background .12s, color .12s; }
.nav-item i { font-size: 17px; width: 19px; text-align: center; color: var(--muted-2); transition: color .12s; }
.nav-item:hover { background: #f1f2f5; color: var(--fg); }
.nav-item:hover i { color: var(--fg); }
.nav-item.is-active { background: var(--primary-weak); color: var(--primary); }
.nav-item.is-active i { color: var(--primary); }
.nav-item.is-muted { cursor: default; opacity: .7; }
.nav-store { margin-top: auto; }
.soon { margin-left: auto; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; background: #f1f2f5; color: var(--muted); padding: 2px 6px; border-radius: 999px; }

.content-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 20px; background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar-spacer { flex: 1; }
.user-chip { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; }
.user-chip i { font-size: 16px; }
.icon-btn { display: none; background: none; border: 0; font-size: 21px; cursor: pointer; color: var(--fg); padding: 4px; }
.main { padding: 18px 22px; width: 100%; }

/* ---- headings ---- */
.page-head { margin-bottom: 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 3px; }
.page-sub { color: var(--muted); margin: 0; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--border-strong); font-size: 13px; font-weight: 500; font-family: inherit; cursor: pointer; background: var(--surface); color: var(--fg); transition: background .12s, border-color .12s, box-shadow .12s, transform .05s; white-space: nowrap; }
.btn i { font-size: 16px; }
.btn:hover { background: #f6f7f9; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); box-shadow: 0 1px 2px rgba(79,70,229,.25); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: #f1f2f5; }
.btn-block { width: 100%; }
.btn-sm { height: 27px; padding: 0 9px; font-size: 12px; border-radius: 7px; gap: 4px; }
.btn-sm i { font-size: 15px; }
.btn-danger { color: var(--danger); border-color: transparent; }
.btn-danger:hover { background: var(--danger-weak); }

/* ---- forms ---- */
.field { display: block; margin-bottom: 11px; }
.label { display: block; font-weight: 500; margin-bottom: 4px; font-size: 12px; color: #334155; }
.input, select.input, .textarea { width: 100%; height: 33px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); font-size: 13px; font-family: inherit; background: var(--surface); color: var(--fg); transition: border-color .12s, box-shadow .12s; }
.textarea { height: auto; min-height: 78px; padding: 8px 10px; line-height: 1.5; resize: vertical; }
.input:focus, .textarea:focus, select.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }

/* ---- cards ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-title i { color: var(--muted-2); margin-right: 2px; }
.card-title { font-size: 14px; font-weight: 600; margin: 0; letter-spacing: -.01em; }

/* ---- stats ---- */
.grid { display: grid; gap: 14px; margin-bottom: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid > .card { margin-bottom: 0; }
.stat { display: flex; align-items: center; gap: 12px; margin-bottom: 0; }
.stat-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: var(--primary-weak); color: var(--primary); font-size: 19px; flex-shrink: 0; }
.stat-body { display: flex; flex-direction: column; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }

/* ---- dashboard ---- */
.dash-cols { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 14px; align-items: start; }
@media (max-width: 900px) { .dash-cols { grid-template-columns: 1fr; } }
.dash-cols .card { margin-bottom: 0; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 6px; border-bottom: 1px solid var(--border); }
.chart-col { flex: 1; display: flex; align-items: flex-end; height: 100%; }
.chart-bar { width: 100%; background: #c7d2fe; border-radius: 4px 4px 0 0; transition: background .12s; }
.chart-col:hover .chart-bar { background: var(--primary); }
.chart-axis { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11px; color: var(--muted); }
.rank-list { display: flex; flex-direction: column; gap: 13px; }
.rank-row { display: flex; align-items: center; gap: 10px; }
.rank-n { flex-shrink: 0; width: 20px; height: 20px; border-radius: 6px; background: #f1f2f5; color: var(--muted); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.rank-main { flex: 1; min-width: 0; }
.rank-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 5px; }
.rank-bar { height: 5px; background: #f1f2f5; border-radius: 999px; overflow: hidden; }
.rank-bar span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.rank-val { flex-shrink: 0; font-size: 13px; font-weight: 600; }

/* ---- table ---- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 6px 9px; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; padding-top: 4px; padding-bottom: 8px; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: #fafbfc; }
.table tbody tr:last-child td { border-bottom: 0; }
.table a { color: var(--primary); font-weight: 500; }
.muted { color: var(--muted); }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }
.table-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.inline-form { display: inline; }

/* full-bleed tables: a card wrapping a table has no left/right gap — the table spans edge to edge,
   while headers, titles, tabs and pagination inside keep their inset. */
.card:has(> .table) { padding-left: 0; padding-right: 0; }
.card:has(> .table) > *:not(.table):not(.inset) { padding-left: 16px; padding-right: 16px; }
/* .inset opts a child out of that padding and offsets it instead — for children that
   draw their own box (a bordered panel, a button), where inner padding would leave
   the border itself flush against the card edge. */
.card:has(> .table) > .inset { margin-left: 16px; margin-right: 16px; }
.card:has(> .table) .table th:first-child, .card:has(> .table) .table td:first-child { padding-left: 16px; }
.card:has(> .table) .table th:last-child, .card:has(> .table) .table td:last-child { padding-right: 16px; }

/* ---- badges ---- */
.badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: #f1f2f5; color: var(--muted); }
.badge.status-paid { background: #dcfce7; color: #166534; }
.badge.status-pending { background: #fef9c3; color: #854d0e; }
/* COD orders: placed and fulfillable, payment collected on delivery. */
.badge.status-confirmed { background: #dbeafe; color: #1e40af; }
.badge.status-approved { background: #dcfce7; color: #166534; }
.badge.status-rejected { background: #fee2e2; color: #991b1b; }
.pay-badge { font-size: 11px; font-weight: 500; border-radius: 999px; padding: 1px 8px; background: #f1f5f9; color: #475569; margin-left: 6px; }
.badge.status-failed, .badge.status-cancelled { background: #fee2e2; color: #991b1b; }
.badge.status-refunded { background: #e0e7ff; color: #3730a3; }
.badge.status-active { background: #dcfce7; color: #166534; }
.badge.status-draft { background: #f1f2f5; color: #475569; }
.badge.status-archived { background: #fef9c3; color: #854d0e; }
.badge.status-published { background: #dcfce7; color: #166534; }
.badge.status-all { background: var(--primary-weak); color: #3730a3; }
.badge.status-created, .badge.status-awb_assigned, .badge.status-pickup_scheduled, .badge.status-in_transit { background: #dbeafe; color: #1e40af; }
.badge.status-delivered { background: #dcfce7; color: #166534; }
.badge.status-rto { background: #fef9c3; color: #854d0e; }

/* align-items:flex-start so a multi-line message does not centre its icon halfway down the
   block, and the icon holds its size instead of being squeezed by long prose. */
.alert { padding: 11px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 8px; line-height: 1.5; }
.alert > i { flex: 0 0 auto; line-height: 1.5; }
.alert a { text-decoration: underline; }
.alert-error { background: var(--danger-weak); color: var(--danger); border: 1px solid #fecaca; }
.alert-ok { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-warn { background: #fffbeb; color: #854d0e; border: 1px solid #fde68a; }

/* ---- images ---- */
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.img-cell { border: 1px solid var(--border); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.img-cell .thumb { width: 100%; height: 100px; }
.img-actions { display: flex; flex-direction: column; gap: 4px; width: 100%; align-items: center; }
code { background: #f1f2f5; padding: 1px 6px; border-radius: 5px; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---- page builder ---- */
.section-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: var(--surface); box-shadow: var(--shadow-sm); }
.section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.section-tools { margin-left: auto; display: flex; gap: 4px; }
.sum-row { display: flex; justify-content: space-between; padding: 6px 0; }
.sum-total { font-weight: 700; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 10px; }

/* ---- login ---- */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; background: radial-gradient(1200px 500px at 50% -10%, #eef2ff, var(--bg)); }
.login-card { width: 100%; max-width: 400px; margin: 0; box-shadow: var(--shadow); border-radius: 16px; padding: 30px; }
.login-brand { display: flex; align-items: center; justify-content: center; width: 52px; height: 52px; margin: 0 auto 16px; border-radius: 14px; background: var(--primary); color: #fff; font-size: 26px; }
.login-title { font-size: 22px; font-weight: 700; margin: 0 0 2px; text-align: center; letter-spacing: -.02em; }
.login-sub { color: var(--muted); text-align: center; margin: 0 0 22px; }

/* Demo credentials on the login page. Only rendered on a demo host — see Demo::credentials(). */
.demo-creds { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); padding: 14px 16px; margin: 0 0 18px; }
.demo-creds-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--primary); }
.demo-creds p { margin: 6px 0 10px; font-size: 13px; color: var(--muted); }
.demo-creds dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; align-items: baseline; }
.demo-creds dt { font-size: 12px; color: var(--muted); }
.demo-creds dd { margin: 0; }
.demo-creds code { font-size: 13px; font-weight: 600; letter-spacing: .02em; user-select: all; }
.demo-creds-note { margin: 10px 0 0 !important; font-size: 12px !important; }

/* ---- toasts ---- */
.toast-wrap { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--fg); color: #fff; padding: 11px 15px; border-radius: var(--radius); font-size: 13px; box-shadow: var(--shadow); }
.toast.is-error { background: var(--danger); }

/* ---- responsive ---- */
@media (max-width: 860px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.is-open { transform: translateX(0); }
  .icon-btn { display: inline-flex; }
  .grid-2, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .main { padding: 20px 16px; }
}

/* ---- styled file inputs ---- */
.file-field { display: inline-flex; align-items: center; gap: 8px; padding: 10px 15px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: #fafbfc; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--muted); transition: border-color .12s, background .12s, color .12s; }
.file-field:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-weak); }
.file-field i { font-size: 18px; }
.file-field input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
input[type="file"]:not(.file-field input) { font-size: 13px; color: var(--muted); max-width: 100%; }
input[type="file"]::file-selector-button { margin-right: 10px; border: 1px solid var(--border-strong); background: #fff; padding: 8px 13px; border-radius: 8px; font-family: inherit; font-weight: 500; color: var(--fg); cursor: pointer; transition: background .12s, border-color .12s; }
input[type="file"]::file-selector-button:hover { background: var(--primary-weak); border-color: var(--primary); }
.upload-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 4px; }

/* ---- attribute master ---- */
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: #f1f2f5; border-radius: 999px; padding: 5px 6px 5px 13px; font-size: 13px; font-weight: 500; }
.chip-x { background: none; border: 0; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1; padding: 0 3px; }
.chip-x:hover { color: var(--danger); }
.add-value-form { display: flex; gap: 8px; align-items: center; }

/* ---- variant builder ---- */
.variant-builder { background: #fafbfc; border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-bottom: 18px; }
.attr-row { display: flex; align-items: center; gap: 14px; padding: 8px 0; flex-wrap: wrap; }
.attr-name { font-weight: 600; min-width: 92px; }
.attr-values { display: flex; flex-wrap: wrap; gap: 7px; }
.attr-chip { padding: 6px 14px; border: 1.5px solid var(--border-strong); border-radius: 999px; background: #fff; cursor: pointer; font-size: 13px; font-weight: 500; font-family: inherit; transition: background .12s, border-color .12s, color .12s; }
.attr-chip:hover { border-color: var(--primary); }
.attr-chip.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.builder-actions { display: flex; gap: 8px; margin-top: 12px; }
.variant-table th, .variant-table td { padding: 8px 6px; }
.variant-table .input { height: 36px; padding: 0 9px; }
.table-empty { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); padding: 22px; font-size: 14px; }
.table-empty i { font-size: 18px; color: var(--muted-2); }
.variant-empty-row td { border-bottom: 0; }

/* ---- media grid ---- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-bottom: 16px; }
.media-item { border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: #fff; }
.media-thumb { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #f4f5f7; margin-bottom: 9px; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-thumb video { width: 100%; height: 100%; object-fit: cover; background: #000; display: block; }
.media-badge { position: absolute; top: 7px; left: 7px; background: var(--primary); color: #fff; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.media-alt { display: flex; gap: 6px; margin-bottom: 9px; }
.input-sm { height: 34px; font-size: 13px; }
.media-actions { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.media-handle { cursor: grab; color: var(--muted-2); font-size: 18px; display: inline-flex; align-items: center; padding: 2px; }
.media-handle:active { cursor: grabbing; }
.media-item.sortable-ghost { opacity: .4; }

/* ---- description sections (Quill) ---- */
.psec-list { display: flex; flex-direction: column; gap: 14px; }
.psec { border: 1px solid var(--border); border-radius: 10px; background: #fff; padding: 10px; }
.psec.sortable-ghost { opacity: .4; }
.psec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.psec-handle { cursor: grab; color: var(--muted-2); font-size: 18px; display: inline-flex; align-items: center; }
.psec-handle:active { cursor: grabbing; }
.psec-title { flex: 1; }
/* Quill's snow theme ships its own borders, fonts and control sizing, none of which match
   the admin. It loads from the CDN AFTER admin.css, so every override needs the .ql-snow
   class to win on specificity.
   DOM shape matters here: Quill turns the target element INTO .ql-container and inserts
   .ql-toolbar as its SIBLING. So the toolbar is `.psec > .ql-toolbar`, never a descendant
   of .psec-editor — descendant selectors silently match nothing. */

/* Toolbar + editor read as one control, with a shared focus ring. */
/* Scoped to the editor, not the whole .psec — otherwise focusing the section TITLE input
   also lit up the editor below it. :has() reaches the toolbar, which is a preceding sibling.
   (The admin already relies on :has() elsewhere.) */
.psec:has(> .psec-editor:focus-within) > .ql-toolbar.ql-snow,
.psec-editor.ql-container:focus-within { border-color: var(--primary); }

.psec > .ql-toolbar.ql-snow {
  border: 1px solid var(--border-strong); border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 6px 8px; background: #fafbfc; font-family: inherit;
}
.psec-editor.ql-container.ql-snow {
  border: 1px solid var(--border-strong);
  border-radius: 0 0 var(--radius) var(--radius);
  font-family: inherit; font-size: 14px; color: var(--fg); background: var(--surface);
}
.psec-editor .ql-editor { min-height: 130px; padding: 12px 14px; line-height: 1.65; }
.psec-editor .ql-editor.ql-blank::before {
  color: var(--muted-2); font-style: normal; font-size: 14px; left: 14px; right: 14px;
}

/* Toolbar controls as hover chips at the same rhythm as .btn, not bare glyphs. */
.psec > .ql-toolbar.ql-snow button,
.psec > .ql-toolbar.ql-snow .ql-picker-label {
  border-radius: 6px; color: var(--muted); transition: background .12s, color .12s;
}
.psec > .ql-toolbar.ql-snow button { width: 28px; height: 28px; padding: 4px; }
.psec > .ql-toolbar.ql-snow button:hover,
.psec > .ql-toolbar.ql-snow button:focus,
.psec > .ql-toolbar.ql-snow button.ql-active { background: var(--primary-weak); color: var(--primary); }
.psec > .ql-toolbar.ql-snow button .ql-stroke,
.psec > .ql-toolbar.ql-snow .ql-picker-label .ql-stroke { stroke: currentColor; }
.psec > .ql-toolbar.ql-snow button .ql-fill,
.psec > .ql-toolbar.ql-snow .ql-picker-label .ql-fill { fill: currentColor; }

/* Hairline group separators instead of Quill's wide default gaps. */
.psec > .ql-toolbar.ql-snow .ql-formats { margin-right: 8px; padding-right: 8px; border-right: 1px solid var(--border); }
.psec > .ql-toolbar.ql-snow .ql-formats:last-child { border-right: 0; margin-right: 0; padding-right: 0; }

/* The "Normal" heading picker. */
.psec > .ql-toolbar.ql-snow .ql-picker { font-family: inherit; font-size: 13px; color: var(--fg); height: 28px; }
.psec > .ql-toolbar.ql-snow .ql-picker-label { padding: 0 20px 0 8px; display: inline-flex; align-items: center; height: 28px; border: 1px solid transparent; }
.psec > .ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label { border-color: var(--border); background: var(--surface); color: var(--fg); }
.psec > .ql-toolbar.ql-snow .ql-picker-options {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow); padding: 5px; margin-top: 4px;
}
.psec > .ql-toolbar.ql-snow .ql-picker-item { border-radius: 5px; padding: 5px 9px; color: var(--fg); }
.psec > .ql-toolbar.ql-snow .ql-picker-item:hover,
.psec > .ql-toolbar.ql-snow .ql-picker-item.ql-selected { background: var(--primary-weak); color: var(--primary); }

/* Link tooltip — the most obviously off-brand piece of the snow theme. */
.psec .ql-snow .ql-tooltip, .psec-editor .ql-tooltip {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow); padding: 8px 10px; color: var(--fg);
  font-family: inherit; font-size: 13px;
}
.psec-editor .ql-tooltip input[type=text] {
  border: 1px solid var(--border); border-radius: 6px; padding: 6px 9px;
  font-family: inherit; font-size: 13px; height: auto;
}
.psec-editor .ql-tooltip input[type=text]:focus { outline: none; border-color: var(--primary); }
.psec-editor .ql-tooltip a.ql-action, .psec-editor .ql-tooltip a.ql-remove { color: var(--primary); font-weight: 500; }

/* Editor content should read like the rest of the admin, not Quill's defaults. */
.psec-editor .ql-editor h1, .psec-editor .ql-editor h2, .psec-editor .ql-editor h3 { font-weight: 600; letter-spacing: -.01em; margin: 14px 0 6px; }
.psec-editor .ql-editor h1 { font-size: 20px; }
.psec-editor .ql-editor h2 { font-size: 17px; }
.psec-editor .ql-editor h3 { font-size: 15px; }
.psec-editor .ql-editor p { margin: 0 0 8px; }
.psec-editor .ql-editor a { color: var(--primary); }

/* ---- one-click AI ---- */
.ai-fab { position: fixed; right: 24px; bottom: 24px; z-index: 40; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--primary); color: #fff; font-size: 14px; font-weight: 500; font-family: inherit; cursor: pointer; box-shadow: var(--shadow); transition: background .12s, opacity .12s; }
.ai-fab:hover { background: var(--primary-hover); }
.ai-fab:disabled { opacity: .7; cursor: default; }
.ai-fab i { font-size: 18px; }
.ai-fab.is-loading i { animation: ai-spin 1s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-dialog { width: min(760px, 92vw); border: 1px solid var(--border); border-radius: 14px; padding: 0; box-shadow: var(--shadow); }
.ai-dialog::backdrop { background: rgba(16,24,40,.45); }
.ai-dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.ai-dialog-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.ai-variants { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding: 16px; max-height: 70vh; overflow-y: auto; }
.ai-variant { border: 1px solid var(--border); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.ai-variant-name { font-weight: 600; font-size: 14px; }
.ai-variant-meta { color: var(--muted); font-size: 12px; line-height: 1.5; }
.ai-variant-secs { color: var(--muted-2); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.ai-variant .btn { margin-top: auto; }

/* ---- styled confirm dialog (replaces window.confirm) ---- */
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #b91c1c; border-color: #b91c1c; }
.confirm { width: min(420px, 92vw); border: 1px solid var(--border); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); color: var(--fg); }
.confirm::backdrop { background: rgba(16,24,40,.45); }
.confirm[open] { animation: confirm-in .14s ease-out; }
@keyframes confirm-in { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.confirm-row { display: flex; gap: 14px; align-items: flex-start; }
.confirm-icon { flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--primary-weak); color: var(--primary); font-size: 20px; }
.confirm.is-danger .confirm-icon { background: var(--danger-weak); color: var(--danger); }
.confirm-title { margin: 0 0 4px; font-size: 15px; font-weight: 600; }
.confirm-msg { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ---- nested category tree ---- */
.cat-tree { display: flex; flex-direction: column; }
.cat-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.cat-row:last-child { border-bottom: 0; }
.cat-name { display: inline-flex; align-items: center; gap: 9px; font-weight: 500; flex: 1; min-width: 0; }
.cat-name i { color: var(--muted-2); font-size: 17px; }
.cat-name i.cat-sub { color: var(--primary); }
.cat-url { font-size: 13px; }
.cat-actions { display: flex; gap: 5px; }

/* ---- filter bar ---- */
.filter-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
/* Unscoped: .search was only styled inside .filter-bar / .ip-head, so anywhere else the
   icon lost its positioning context and floated above the input. */
.search { position: relative; }
.search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 17px; pointer-events: none; }
.search .input { padding-left: 38px; }
.filter-bar .search { flex: 1; min-width: 200px; max-width: 360px; }
.filter-bar select.input { min-width: 130px; width: auto; }
.filter-clear { color: var(--muted); font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.filter-clear:hover { color: var(--danger); }

/* ---- pagination ---- */
.pagination { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); flex-wrap: wrap; gap: 10px; }
.pg { min-width: 30px; height: 30px; }
.pg-total { color: var(--muted); font-size: 13px; }
.pg-links { display: flex; gap: 4px; align-items: center; }
.pg { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 9px; border: 1px solid var(--border-strong); border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--fg); background: #fff; transition: background .12s, border-color .12s; }
.pg:hover { background: #f6f7f9; border-color: var(--primary); }
.pg.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pg.is-disabled { color: var(--muted-2); background: #fafbfc; border-color: var(--border); cursor: default; }
.pg-gap { color: var(--muted-2); padding: 0 2px; }

/* ---- empty states ---- */
.empty-state { text-align: center; padding: 34px 20px; }
.empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 50px; height: 50px; border-radius: 13px; background: var(--primary-weak); color: var(--primary); font-size: 25px; margin-bottom: 12px; }
.empty-title { font-size: 15px; font-weight: 600; margin: 0 0 3px; }
.empty-sub { color: var(--muted); margin: 0 auto 16px; max-width: 380px; }
.empty-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ---- navigation builder ---- */
.nav-row { display: flex; gap: 8px; align-items: center; }
.nav-row .input { flex: 1; }
.nav-add { display: flex; gap: 8px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.nav-add .input { flex: 1; min-width: 150px; }

/* ---- appearance ---- */
.color-field { display: inline-flex; align-items: center; gap: 10px; }
.color-field input[type=color] { width: 46px; height: 34px; flex-shrink: 0; padding: 3px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.color-field input[type=color]:hover { border-color: var(--primary); }
.color-field input[type=color]:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.color-field input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color-field input[type=color]::-webkit-color-swatch { border: none; border-radius: 6px; }
.color-field input[type=color]::-moz-color-swatch { border: none; border-radius: 6px; }
.color-field code { font-size: 12px; font-weight: 500; color: var(--fg); text-transform: uppercase; letter-spacing: .02em; background: #f1f2f5; padding: 3px 8px; border-radius: 6px; }
.theme-preview { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tp-announce { background: #111827; color: #fff; text-align: center; font-size: 12px; padding: 7px 10px; }
.tp-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.tp-brand { font-weight: 800; font-size: 17px; display: inline-flex; align-items: center; gap: 6px; letter-spacing: -.02em; }
.tp-brand i { color: #d97706; }
.tp-nav { color: var(--muted); font-size: 13px; }
.tp-body { padding: 24px 18px; }
.tp-price { font-size: 20px; font-weight: 700; }
.tp-badge { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; margin-left: 8px; background: #fef3c7; color: #d97706; }
.tp-cta { border: 0; border-radius: 10px; background: #111827; color: #fff; font-weight: 600; padding: 11px 22px; font-family: inherit; cursor: pointer; margin-top: 12px; }

/* ---- menu tabs + flash ---- */
.menu-tabs { display: inline-flex; gap: 4px; background: var(--surface-2, #f1f1f0); padding: 3px; border-radius: 10px; }
.menu-tab { padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.menu-tab.is-active { background: #fff; color: var(--ink, #111827); box-shadow: var(--shadow-sm); }

/* status filter tabs — white underline bar with semantic count badges */
.status-tabs { display: flex; gap: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 0 16px; margin-bottom: 14px; overflow-x: auto; }
.status-tab { display: flex; align-items: center; gap: 7px; padding: 12px 2px; font-size: 13px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.status-tab:hover { color: var(--fg); }
.status-tab.is-active { color: var(--fg); border-bottom-color: var(--primary); }
.status-tab .badge { font-size: 11px; padding: 1px 7px; }
.flash-ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; border-radius: 10px; padding: 10px 14px; margin-bottom: 16px; font-size: 14px; display: flex; align-items: center; gap: 8px; }

/* ---- menu builder ---- */
.menu-builder { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: start; }
.mb-panel { display: flex; flex-direction: column; gap: 10px; }
.mb-search-wrap { position: relative; }
.mb-search-wrap i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 16px; pointer-events: none; }
.mb-search { padding-left: 34px; }
.mb-pick-t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-pick-parent { color: var(--muted); }
.mb-src { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 2px 14px 14px; }
.mb-src > summary { list-style: none; cursor: pointer; padding: 12px 0 10px; font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.mb-src > summary::-webkit-details-marker { display: none; }
.mb-src > summary i { color: var(--primary); }
.mb-list { max-height: 230px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.mb-pick { display: flex; align-items: center; gap: 8px; font-size: 13.5px; padding: 5px 6px; border-radius: 7px; cursor: pointer; }
.mb-pick:hover { background: #f6f7f9; }
.mb-none { font-size: 13px; padding: 6px; }
.mb-custom { display: flex; flex-direction: column; gap: 8px; }
.mb-structure { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.mb-structure-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mb-status { font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.mb-status.saved { color: #059669; }
.mb-status.saving { color: var(--muted); }
.mb-status.err { color: #dc2626; }
.mb-status .ri-loader-4-line { animation: mbspin .7s linear infinite; }
@keyframes mbspin { to { transform: rotate(360deg); } }
.mb-empty { color: var(--muted); font-size: 14px; text-align: center; padding: 30px; border: 2px dashed var(--line); border-radius: 12px; }
.menu-tree, .mi-children { list-style: none; margin: 0; padding: 0; }
.mi-children { padding-left: 26px; min-height: 8px; }
.mi { margin: 6px 0; }
.mi-row { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.mi-handle { cursor: grab; color: var(--muted); font-size: 18px; }
.mi-label { flex: 1; border: 0; font-family: inherit; font-size: 14px; font-weight: 500; padding: 4px 6px; border-radius: 6px; min-width: 60px; background: none; }
.mi-label:focus { outline: none; background: #f6f7f9; }
.mi-url { color: var(--muted); font-size: 12px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mi-type { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2, #f1f1f0); padding: 2px 6px; border-radius: 5px; }
.mi-del { background: none; border: 0; color: var(--muted); font-size: 17px; cursor: pointer; line-height: 1; }
.mi-del:hover { color: #dc2626; }
.mi-ghost { opacity: .45; }

/* ---- appearance (expanded) ---- */
.preset-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.preset { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer; text-align: left; transition: border-color .12s, box-shadow .12s; }
.preset:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.preset .pv { width: 16px; height: 16px; border-radius: 5px; }
.preset-swatches { display: inline-flex; gap: 5px; margin-bottom: 3px; }
.preset-label { font-weight: 600; font-size: 13px; }
.preset-hint { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.upload-field { display: flex; gap: 6px; align-items: center; }
.upload-field .input { flex: 1; min-width: 0; }
.trust-row { display: grid; grid-template-columns: 200px 1fr; gap: 8px; margin-top: 8px; }
/* In the page builder the same rows sit in a full-width column, where an unbounded label
   field stretches across the whole screen. Cap it and give the block room to breathe. */
.trust-field { margin: 16px 0 0; max-width: 720px; }
.trust-field .label { display: block; margin-bottom: 2px; }
/* Overrides .field-hint's negative top, which exists to tuck a hint under an input — here it
   follows a block of rows and needs to sit clear of both them and the Section style below. */
.trust-field + .field-hint { margin: 10px 0 18px; }

/* ---- remixicon picker (input[data-icon-picker]) ---- */
.icon-field { display: flex; gap: 6px; align-items: center; }
.icon-field .input { flex: 1; min-width: 0; }
.icon-field-btn { flex-shrink: 0; width: 33px; height: 33px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--fg); font-size: 17px; cursor: pointer; transition: border-color .12s, background .12s; }
.icon-field-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-weak); }
.icon-picker { width: min(560px, 94vw); border: 1px solid var(--border); border-radius: 14px; padding: 0; box-shadow: var(--shadow); }
.icon-picker::backdrop { background: rgba(16,24,40,.45); }
.ip-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.ip-head .search { position: relative; flex: 1; }
.ip-head .search i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 15px; pointer-events: none; }
.ip-head .search .input { padding-left: 32px; }
.ip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; padding: 12px 14px; max-height: 46vh; overflow-y: auto; }
.ip-icon { display: inline-flex; align-items: center; justify-content: center; aspect-ratio: 1; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--fg); font-size: 19px; cursor: pointer; transition: background .1s, border-color .1s, color .1s; }
.ip-icon:hover { background: var(--primary-weak); color: var(--primary); }
.ip-icon.is-current { border-color: var(--primary); background: var(--primary-weak); color: var(--primary); }
.ip-foot { padding: 8px 14px 12px; font-size: 12px; }

/* ---- radio option cards (header layout / card style / button shape) ---- */
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 6px 0 4px; }
.opt-card { position: relative; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--border-strong); border-radius: 10px; padding: 10px; cursor: pointer; background: var(--surface); transition: border-color .12s, box-shadow .12s; }
.opt-card:hover { border-color: var(--primary); }
.opt-card input { position: absolute; opacity: 0; pointer-events: none; }
.opt-card:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.14); }
.opt-card:has(input:checked)::after { content: "\eb7b"; font-family: "remixicon"; position: absolute; top: 6px; right: 8px; color: var(--primary); font-size: 16px; }
.opt-card:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(79,70,229,.3); }
.opt-name { font-size: 12.5px; font-weight: 600; }
.opt-hint { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.opt-preview { display: flex; flex-direction: column; gap: 4px; background: #f8f9fb; border: 1px solid var(--border); border-radius: 7px; padding: 8px; min-height: 74px; }
.opt-preview.op-center { align-items: center; justify-content: center; }
.opt-preview i { display: inline-block; font-style: normal; }
/* header mockup */
.hp-bar { display: flex; align-items: center; gap: 5px; background: #fff; border: 1px solid var(--border); border-radius: 5px; padding: 5px 7px; }
.hp-bar.hp-center { justify-content: center; }
.hp-dot { width: 12px; height: 12px; border-radius: 4px; background: #111827; flex-shrink: 0; }
.hp-line { width: 16px; height: 3px; border-radius: 2px; background: #c3c8d1; }
.hp-line.short { width: 10px; }
.hp-circle { width: 9px; height: 9px; border-radius: 999px; border: 1.5px solid #9aa1ab; margin-left: auto; }
.hp-circle.push { margin-left: auto; }
.hp-burger { width: 11px; height: 8px; border-top: 2px solid #6b7280; border-bottom: 2px solid #6b7280; }
.hp-nav { display: flex; justify-content: center; gap: 6px; padding: 2px 0; }
.hp-body { flex: 1; min-height: 22px; border-radius: 5px; background: repeating-linear-gradient(45deg, #eef0f4, #eef0f4 4px, #f6f7fa 4px, #f6f7fa 8px); }
/* product card mockup */
.cp-card { width: 58px; margin: 0 auto; display: flex; flex-direction: column; gap: 3px; background: #fff; border: 1px solid #d7dbe2; border-radius: 6px; padding: 4px; }
.cp-img { position: relative; height: 34px; border-radius: 4px; background: linear-gradient(135deg, #e2e5ea, #f0f2f5); }
.cp-name { width: 70%; height: 3px; border-radius: 2px; background: #c3c8d1; }
.cp-price { display: flex; align-items: center; gap: 3px; }
.cp-price::before { content: ""; width: 20px; height: 4px; border-radius: 2px; background: #111827; }
.cp-minimal { border: 0; background: transparent; padding: 0; }
.cp-minimal .cp-img { height: 38px; border-radius: 6px; }
.cp-badge { position: absolute; top: 3px; left: 3px; background: #dc2626; color: #fff; font-size: 6.5px; font-weight: 700; line-height: 1; padding: 2px 3px; border-radius: 999px; }
.cp-was { width: 12px; height: 3px; background: #c3c8d1; border-radius: 2px; position: relative; }
.cp-was::after { content: ""; position: absolute; left: 0; right: 0; top: 1px; height: 1px; background: #9aa1ab; }
/* layout-pack mockups */
.opt-grid-2 { grid-template-columns: repeat(2, 1fr); }
.opt-grid-3 { grid-template-columns: repeat(3, 1fr); }
.hp-pill { flex: 1; height: 9px; border-radius: 999px; background: #e6e9ee; border: 1px solid #d0d5dd; }
.cp-scrim { position: absolute; inset: auto 0 0 0; height: 55%; border-radius: 0 0 4px 4px; background: linear-gradient(180deg, transparent, rgba(10,12,18,.7)); display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; padding: 3px; }
.cp-scrim b { width: 60%; height: 3px; border-radius: 2px; background: rgba(255,255,255,.9); }
.cp-scrim u { width: 35%; height: 3px; border-radius: 2px; background: rgba(255,255,255,.6); text-decoration: none; }
.cp-overlay { border: 0; padding: 0; background: transparent; }
.cp-overlay .cp-img { height: 46px; }
.rp-img { width: 34px; background: linear-gradient(135deg, #e2e5ea, #f0f2f5); border: 1px solid #d7dbe2; border-radius: 5px; }
.rp-square { height: 34px; }
.rp-portrait { height: 46px; }
.gp-grid { display: grid; gap: 3px; width: 82px; }
.gp-grid i { aspect-ratio: 1; border-radius: 3px; background: linear-gradient(135deg, #e2e5ea, #f0f2f5); border: 1px solid #dde1e7; }
.pp-row { display: flex; gap: 5px; align-items: flex-start; width: 84px; }
.pp-row.pp-flip { flex-direction: row-reverse; }
.pp-img { width: 38px; height: 40px; border-radius: 4px; background: linear-gradient(135deg, #e2e5ea, #f0f2f5); border: 1px solid #d7dbe2; }
.pp-text { flex: 1; display: flex; flex-direction: column; gap: 3px; padding-top: 3px; }
.pp-text b { height: 4px; border-radius: 2px; background: #9aa1ab; }
.pp-text b + b { width: 70%; }
.pp-text u { height: 8px; width: 80%; border-radius: 3px; background: #111827; text-decoration: none; margin-top: 3px; }
.fp-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; width: 84px; }
.fp-cols i { height: 26px; border-radius: 3px; background: repeating-linear-gradient(180deg, #d6dae0, #d6dae0 2px, transparent 2px, transparent 6px); }
.fp-center { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 84px; }
.fp-center b { width: 16px; height: 8px; border-radius: 3px; background: #111827; }
.fp-center u { width: 60%; height: 3px; border-radius: 2px; background: #c3c8d1; text-decoration: none; }
.fp-center u.short { width: 40%; }
/* button shape mockup */
.bp-btn { display: inline-flex; align-items: center; justify-content: center; background: #111827; color: #fff; font-size: 10px; font-weight: 600; padding: 7px 14px; white-space: nowrap; }
.bp-rounded { border-radius: 8px; }
.bp-sharp { border-radius: 2px; }
.bp-pill { border-radius: 999px; }
.sec-handle { cursor: grab; color: var(--muted-2); font-size: 18px; display: inline-flex; align-items: center; margin-right: 2px; }
.sec-handle:active { cursor: grabbing; }
.section-card.sortable-ghost { opacity: .45; }
.sec-style-opts { margin-top: 10px; }
.sec-style-opts summary { cursor: pointer; font-size: 13px; font-weight: 500; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.sec-style-opts[open] summary { color: var(--fg); }
.ap-grid { display: grid; grid-template-columns: 1fr 380px; gap: 18px; align-items: start; }
.ap-controls { display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.ap-controls > .card { width: 100%; }
.ap-preview { position: sticky; top: 66px; }
.check-field { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-soft, #374151); margin-top: 12px; cursor: pointer; }
.tp-h { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
.tp-card { border: 1px solid var(--line); overflow: hidden; margin-bottom: 14px; }
.tp-card-img { aspect-ratio: 16/9; background: linear-gradient(135deg, #e5e7eb, #f3f4f6); }
.tp-card-b { padding: 10px 12px; }
.tp-name { font-weight: 500; font-size: 14px; }
.tp-footer { padding: 14px 18px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
@media (max-width: 900px) { .menu-builder, .ap-grid { grid-template-columns: 1fr; } .ap-preview { position: static; } }

/* ---- integrations ---- */
.int-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.int-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; transition: box-shadow .16s, transform .16s, border-color .16s; }
.int-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: transparent; }
.int-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.int-icon { width: 46px; height: 46px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; font-size: 24px; }
.int-status { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; }
.int-status.on { background: #ecfdf5; color: #059669; }
.int-status.off { background: var(--surface-2, #f1f1f0); color: var(--muted); }
.int-name { margin: 0 0 5px; font-size: 16px; font-weight: 600; }
.int-desc { margin: 0 0 18px; font-size: 13px; color: var(--muted); line-height: 1.55; flex: 1; }
.int-cta { width: 100%; }
.int-webhook { margin-top: 2px; }
.int-copy { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.int-copy code { flex: 1; overflow-x: auto; white-space: nowrap; background: var(--surface-2, #f6f7f9); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; font-size: 12.5px; }

/* ---- modal (reusable) ---- */
body.modal-lock { overflow: hidden; }
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-scrim { position: absolute; inset: 0; background: rgba(17,24,39,.5); opacity: 0; transition: opacity .18s; }
.modal.open .modal-scrim { opacity: 1; }
.modal-panel { position: relative; width: 100%; max-width: 540px; max-height: 90vh; display: flex; flex-direction: column; background: #fff; border-radius: 16px; box-shadow: 0 24px 60px rgba(17,24,39,.28); opacity: 0; transform: translateY(12px) scale(.98); transition: opacity .18s, transform .18s; }
.modal.open .modal-panel { opacity: 1; transform: none; }
.modal-head { flex-shrink: 0; display: flex; align-items: flex-start; gap: 13px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-titles { flex: 1; min-width: 0; }
.modal-titles h3 { margin: 0 0 3px; font-size: 16px; font-weight: 600; }
.modal-titles p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.modal-x { flex-shrink: 0; background: none; border: 0; font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; padding: 2px; border-radius: 8px; }
.modal-x:hover { background: var(--surface-2, #f1f1f0); color: var(--ink, #111827); }
/* the form wraps body+foot in most modals; it must carry the panel's flex column so the body can scroll */
.modal-panel { overflow: hidden; }
.modal-panel > form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.modal-body { flex: 1 1 auto; min-height: 0; padding: 20px 22px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); background: var(--surface, #fafafa); border-radius: 0 0 16px 16px; }
.modal-foot-sp { flex: 1; }
@media (max-width: 560px) { .int-grid { grid-template-columns: 1fr; } .modal { padding: 0; align-items: flex-end; } .modal-panel { max-width: 100%; max-height: 94vh; border-radius: 16px 16px 0 0; } }

/* Conversations — WhatsApp concierge inbox */
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; text-decoration: none; margin-bottom: 4px; }
.back-link:hover { color: var(--primary); }
.chat-card { padding: 0; }
.chat-thread { display: flex; flex-direction: column; gap: 12px; padding: 22px; max-height: 68vh; overflow-y: auto; }
.chat-msg { display: flex; flex-direction: column; max-width: 72%; }
.chat-msg.in { align-self: flex-start; align-items: flex-start; }
.chat-msg.out { align-self: flex-end; align-items: flex-end; }
.chat-bubble { padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.chat-msg.in .chat-bubble { background: var(--surface-2, #f1f5f9); border: 1px solid var(--border); border-bottom-left-radius: 4px; color: var(--fg); }
.chat-msg.out .chat-bubble { background: #dcf8c6; border-bottom-right-radius: 4px; color: #0f172a; }
.chat-meta { font-size: 11px; color: var(--muted-2); margin-top: 3px; padding: 0 4px; }
.chan-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; }
.chan-badge i { font-size: 15px; }
.chat-tag { display: inline-block; padding: 0 6px; margin: 0 2px; border-radius: 6px; background: var(--surface-2, #f1f5f9); color: var(--muted); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

/* Conversation thread + customer card layout */
.chat-grid { display: grid; grid-template-columns: 1fr 300px; gap: 16px; align-items: start; }
@media (max-width: 860px) { .chat-grid { grid-template-columns: 1fr; } }
.cust-card { padding: 16px; }
.cust-title { display: flex; align-items: center; gap: 6px; font-size: 14px; margin: 0 0 12px; }
/* sessions: status pills, live pulse, session facts */
.pill { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; vertical-align: middle; }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #16a34a; margin-left: 4px; vertical-align: middle; box-shadow: 0 0 0 0 rgba(22,163,74,.5); animation: livePulse 1.8s infinite; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.5); } 70% { box-shadow: 0 0 0 7px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }
.sess-facts { display: flex; flex-direction: column; gap: 10px; }
/* horizontal fact grid — keeps detail cards short & wide instead of tall & narrow */
.sess-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 13px 20px; }
.sess-grid .sess-fact-wide { grid-column: 1 / -1; }
.sess-fact { display: flex; flex-direction: column; gap: 1px; font-size: 13px; min-width: 0; }
.sess-fact > span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
.sess-fact > strong { font-weight: 600; word-break: break-word; }
.sess-fact a { color: var(--primary); }
.sess-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 760px) { .sess-duo { grid-template-columns: 1fr; } }
.cust-empty { color: var(--muted); font-size: 13px; margin: 4px 0; }
.cust-ids { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cust-ids li { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--fg); word-break: break-all; }
.cust-ids i { color: var(--muted); font-size: 15px; flex: none; }
.cust-kind { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; min-width: 62px; flex: none; }
.cust-sub { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 8px; }
.cust-orders { border-top: 1px solid var(--border); padding-top: 12px; }
.cust-order { display: flex; align-items: center; gap: 8px; padding: 6px 0; text-decoration: none; color: var(--fg); font-size: 13px; }
.cust-order:hover { color: var(--primary); }
.cust-order-no { font-weight: 600; }
.cust-order-amt { margin-left: auto; color: var(--muted); }

/* Customers — identity chips + stat pills */
.id-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.id-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; background: var(--surface-2, #f1f5f9); border: 1px solid var(--border); font-size: 12px; color: var(--fg); }
.id-chip i { font-size: 13px; color: var(--muted); }
.stat-pills { display: flex; gap: 10px; }
.stat-pill { display: flex; flex-direction: column; align-items: flex-end; padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.stat-num { font-size: 18px; font-weight: 700; line-height: 1.1; }
.stat-lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }

/* ========== Conversations — WhatsApp-Web style two-pane ========== */
.wa { display: flex; height: calc(100vh - 48px); margin: -18px -22px; background: var(--surface); overflow: hidden; }

/* left: thread list */
.wa-list { width: 340px; flex: none; display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--surface); }
.wa-list-head { padding: 12px 14px 10px; border-bottom: 1px solid var(--border); }
.wa-list-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.wa-title { font-size: 17px; font-weight: 700; margin: 0; }
.wa-tabs { display: inline-flex; gap: 2px; background: var(--surface-2, #f1f5f9); border-radius: 8px; padding: 2px; }
.wa-tab { border: 0; background: none; cursor: pointer; height: 26px; min-width: 30px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; color: var(--muted); font-family: inherit; display: inline-flex; align-items: center; }
.wa-tab i { font-size: 15px; }
.wa-tab.is-active { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }
.wa-search { position: relative; display: flex; align-items: center; }
.wa-search i { position: absolute; left: 10px; color: var(--muted-2); font-size: 15px; pointer-events: none; }
.wa-search input { width: 100%; height: 34px; border: 1px solid var(--border-strong); border-radius: 999px; padding: 0 12px 0 32px; font-size: 13px; font-family: inherit; background: var(--surface); color: var(--fg); }
.wa-search input:focus { outline: none; border-color: var(--primary); }

.wa-threads { flex: 1; overflow-y: auto; }
.wa-thread { display: flex; gap: 11px; align-items: center; padding: 10px 14px; text-decoration: none; color: var(--fg); border-bottom: 1px solid var(--border); cursor: pointer; }
.wa-thread:hover { background: var(--surface-2, #f6f7f9); }
.wa-thread.is-active { background: var(--primary-weak); }
.wa-avatar { position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; }
.wa-av-ch { position: absolute; right: -2px; bottom: -2px; width: 17px; height: 17px; border-radius: 50%; background: var(--surface); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; box-shadow: 0 0 0 1.5px var(--surface); }
.wa-thread-main { flex: 1; min-width: 0; }
.wa-thread-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wa-thread-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-thread-time { flex: none; font-size: 11px; color: var(--muted-2); }
.wa-thread-prev { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.wa-unread { flex: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #25d366; color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }
.wa-noresults { padding: 24px 16px; text-align: center; color: var(--muted); font-size: 13px; }

/* right: chat */
.wa-chat-wrap { flex: 1; min-width: 0; display: flex; }
.wa-chat { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #e9e6df; }
.wa-chat-head { display: flex; align-items: center; gap: 11px; padding: 9px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.wa-chat-head .wa-avatar { width: 40px; height: 40px; font-size: 16px; }
.wa-back { display: none; color: var(--fg); font-size: 20px; text-decoration: none; }
.wa-chat-who { flex: 1; min-width: 0; }
.wa-chat-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-chat-sub { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; margin-top: 1px; }
.wa-profile { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--fg); text-decoration: none; background: var(--surface); white-space: nowrap; }
.wa-profile:hover { border-color: var(--primary); color: var(--primary); }

.wa-msgs { flex: 1; overflow-y: auto; padding: 16px 8vw; display: flex; flex-direction: column; gap: 3px; }
.wa-msgs-empty { margin: auto; color: #5b6b63; font-size: 13px; background: #fff8; padding: 6px 14px; border-radius: 8px; }
.wa-daysep { align-self: center; margin: 10px 0; }
.wa-daysep span { background: #ffffffcc; color: #54656f; font-size: 11px; font-weight: 600; padding: 4px 12px; border-radius: 8px; box-shadow: var(--shadow-sm); }
.wa-msg { display: flex; max-width: min(72%, 560px); }
.wa-msg.in { align-self: flex-start; }
.wa-msg.out { align-self: flex-end; }
.wa-bubble { position: relative; padding: 6px 9px 5px; border-radius: 9px; font-size: 13.5px; line-height: 1.42; box-shadow: 0 1px .5px rgba(11,20,26,.13); word-break: break-word; }
.wa-msg.in .wa-bubble { background: #fff; border-top-left-radius: 3px; }
.wa-msg.out .wa-bubble { background: #d9fdd3; border-top-right-radius: 3px; }
.wa-text { white-space: pre-wrap; }
.wa-time { float: right; margin: 6px 0 -2px 10px; font-size: 10.5px; color: #667781; user-select: none; white-space: nowrap; }
.wa-tick { font-size: 13px; color: #53bdeb; vertical-align: -1px; }
.wa-tick.undel { color: #f0a; opacity: .8; }
.wa-badge { display: inline-block; margin-bottom: 3px; padding: 0 6px; border-radius: 5px; background: #0000000d; color: #54656f; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

.wa-composer { display: flex; align-items: center; gap: 9px; padding: 10px 16px; background: var(--surface); border-top: 1px solid var(--border); }
.wa-input { flex: 1; height: 40px; border: 1px solid var(--border-strong); border-radius: 999px; padding: 0 16px; font-size: 14px; font-family: inherit; background: var(--surface); color: var(--fg); }
.wa-input:focus { outline: none; border-color: var(--primary); }
.wa-send { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--primary); color: #fff; cursor: pointer; font-size: 18px; display: inline-flex; align-items: center; justify-content: center; }
.wa-send:hover { background: var(--primary-hover); }

.wa-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); background: #e9e6df; }
.wa-empty-icon { width: 66px; height: 66px; border-radius: 50%; background: #ffffff9c; display: inline-flex; align-items: center; justify-content: center; font-size: 32px; color: #8696a0; margin-bottom: 14px; }
.wa-empty-title { margin: 0 0 4px; font-size: 17px; color: #41525d; }
.wa-empty-sub { margin: 0; font-size: 13px; max-width: 300px; }

@media (max-width: 760px) {
    .wa { margin: -20px -16px; }
    .wa-list { width: 100%; }
    .wa-chat-wrap { display: none; }
    .wa.has-active .wa-list { display: none; }
    .wa.has-active .wa-chat-wrap { display: flex; }
    .wa-back { display: inline-flex; align-items: center; }
    .wa-msgs { padding: 14px 12px; }
    .wa-msg { max-width: 82%; }
}

/* WhatsApp Business page */
.wa-flash { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; border: 1px solid transparent; }
.wa-flash.is-ok { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.wa-flash.is-err { background: var(--danger-weak); color: var(--danger); border-color: #fecaca; }
.wa-prof .field-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.wa-prof-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.wa-prof-grid .field-wide { grid-column: 1 / -1; }
.wa-prof-pic { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.wa-prof-pic img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.wa-prof-foot { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.card-head.wa-tpl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tpl-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.tpl-cat { font-size: 12.5px; font-weight: 600; }
.tpl-body { max-width: 340px; }
@media (max-width: 640px) { .wa-prof-grid { grid-template-columns: 1fr; } }

/* Conversations — refinement pass (grouping, texture, loading, composer) */
.wa-msgs { background-color: #e9e6df; background-image: radial-gradient(rgba(11,20,26,.025) 1px, transparent 1px); background-size: 22px 22px; }
.wa-msg { margin-top: 9px; }
.wa-msg.grouped { margin-top: 2px; }
.wa-msg.grouped.in .wa-bubble { border-top-left-radius: 9px; }
.wa-msg.grouped.out .wa-bubble { border-top-right-radius: 9px; }
.wa-thread.is-active { box-shadow: inset 3px 0 0 var(--primary); }
.wa-chat-wrap.is-loading { opacity: .55; transition: opacity .1s; pointer-events: none; }
.wa-send { transition: background .12s, opacity .12s; }
.wa-send:disabled { background: var(--border-strong); cursor: default; opacity: .7; }

/* Conversations — infinite scroll sentinel + loader */
.wa-sentinel { height: 1px; }
.wa-threads.is-loading-more .wa-sentinel { height: 34px; position: relative; }
.wa-threads.is-loading-more .wa-sentinel::after { content: ''; position: absolute; left: 50%; top: 9px; width: 16px; height: 16px; margin-left: -8px; border: 2px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; animation: wa-spin .6s linear infinite; }
@keyframes wa-spin { to { transform: rotate(360deg); } }

/* WhatsApp send-template modal */
.tpl-preview-box { margin-top: 5px; padding: 10px 12px; border-radius: var(--radius); background: #d9fdd3; color: #0f172a; font-size: 13.5px; line-height: 1.45; white-space: pre-wrap; min-height: 20px; border: 1px solid #c5eebf; }

/* Cart recovery dashboard */
.rec-rate { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.rec-rate-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--surface-2, #eef1f5); overflow: hidden; }
.rec-rate-bar span { display: block; height: 100%; border-radius: 999px; }
.rec-rate-num { font-size: 12px; color: var(--muted); min-width: 40px; text-align: right; }
.rec-winner { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; color: #92400e; background: #fef3c7; padding: 1px 7px; border-radius: 999px; margin-left: 4px; }
.rec-winner i { font-size: 12px; }
#recWa, #recEmail { display: flex; flex-direction: column; gap: 0; }

/* Cart recovery — guide + insights */
.rec-guide { display: flex; align-items: stretch; gap: 4px; margin-bottom: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); flex-wrap: wrap; }
.rec-step { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 190px; }
.rec-step > i { font-size: 20px; color: var(--primary); flex: none; }
.rec-step-n { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--primary-weak); color: var(--primary); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.rec-step-txt { display: flex; flex-direction: column; line-height: 1.3; }
.rec-step-txt strong { font-size: 13px; }
.rec-step-txt span { font-size: 11.5px; color: var(--muted); }
.rec-step-arr { align-self: center; color: var(--muted-2); font-size: 18px; flex: none; }
.rec-insights { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 14px; padding: 0 2px; }
.rec-insight { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.rec-insight strong { color: var(--fg); }
.rec-insight i { font-size: 15px; }
.rec-dot { color: var(--muted-2); margin: 0 2px; }
.rec-learning { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 600; color: var(--muted); background: var(--surface-2, #f1f5f9); padding: 1px 7px; border-radius: 999px; margin-left: 4px; text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 820px) { .rec-step-arr { display: none; } }

/* Journey builder */
.jn-layout { display: grid; grid-template-columns: 1fr 280px; gap: 16px; align-items: start; }
@media (max-width: 900px) { .jn-layout { grid-template-columns: 1fr; } }
.jn-settings { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 14px; }
.jn-settings .field { margin-bottom: 0; }
@media (max-width: 620px) { .jn-settings { grid-template-columns: 1fr; } }
.jn-side { display: flex; flex-direction: column; gap: 14px; }
.jn-flow { display: flex; flex-direction: column; align-items: center; }
.jn-node { display: flex; align-items: center; gap: 11px; width: 100%; max-width: 460px; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.jn-node-trigger { background: #fffbeb; border-color: #fde68a; }
.jn-node-end { background: var(--surface-2, #f8fafc); }
.jn-node-ic { flex: none; width: 34px; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; background: #fef3c7; color: #d97706; }
.jn-node-end .jn-node-ic { background: var(--surface-2, #eef1f5); color: var(--muted); }
.jn-node strong { display: block; font-size: 13px; }
.jn-node span { font-size: 12px; color: var(--muted); }
.jn-node-txt { flex: 1; min-width: 0; }
.jn-node-txt span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.jn-node-actions { display: flex; gap: 1px; flex: none; }
.jn-ib { border: 0; background: none; cursor: pointer; color: var(--muted-2); width: 26px; height: 26px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.jn-ib:hover { background: var(--surface-2, #f1f5f9); color: var(--fg); }
.jn-ib-del:hover { background: var(--danger-weak); color: var(--danger); }
.jn-line { width: 2px; height: 16px; background: var(--border-strong); }
.jn-add { border: 1px dashed var(--border-strong); background: var(--surface); color: var(--primary); cursor: pointer; border-radius: 999px; padding: 6px 16px; font-size: 13px; font-weight: 500; font-family: inherit; display: inline-flex; align-items: center; gap: 5px; }
.jn-add:hover { background: var(--primary-weak); border-color: var(--primary); }
.jn-wait-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

/* Journey builder — canvas refinement */
.jn-flow { background: #f6f7f9; background-image: radial-gradient(rgba(15,23,42,.055) 1px, transparent 1px); background-size: 16px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px 20px; }
.jn-node { max-width: 480px; transition: box-shadow .12s, transform .06s; }
.jn-node-step { cursor: default; }
.jn-node-step:hover { box-shadow: 0 6px 18px rgba(16,24,40,.12); transform: translateY(-1px); }
.jn-node-actions { opacity: 0; transition: opacity .12s; }
.jn-node-step:hover .jn-node-actions, .jn-node-step:focus-within .jn-node-actions { opacity: 1; }
.jn-conn { position: relative; height: 30px; display: flex; align-items: center; justify-content: center; }
.jn-conn::before { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: var(--border-strong); }
.jn-insert { position: relative; z-index: 1; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; opacity: 0; transition: opacity .12s, background .12s, color .12s, transform .1s; }
.jn-flow:hover .jn-insert { opacity: .5; }
.jn-insert:hover { opacity: 1 !important; background: var(--primary); color: #fff; border-color: var(--primary); transform: scale(1.14); }
.jn-hint { text-align: center; color: var(--muted); font-size: 12.5px; margin: 6px 0 0; }

/* Branch / A-B split fork */
.jn-node-fork { max-width: 480px; background: #faf5ff; border-color: #e9d5ff; }
.jn-node-fork .jn-node-actions { opacity: 0; transition: opacity .12s; }
.jn-node-fork:hover .jn-node-actions { opacity: 1; }
.jn-arms { display: flex; gap: 14px; width: 100%; max-width: 760px; align-items: flex-start; position: relative; padding-top: 18px; }
.jn-arms::before { content: ''; position: absolute; top: 0; left: 50%; width: 2px; height: 18px; margin-left: -1px; background: var(--border-strong); }
.jn-arm { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; position: relative; }
.jn-arm::before { content: ''; position: absolute; top: -18px; height: 18px; width: 2px; background: var(--border-strong); }
.jn-arm-head { width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--tone); background: color-mix(in srgb, var(--tone) 10%, transparent); border: 1px solid color-mix(in srgb, var(--tone) 26%, transparent); }
.jn-arm-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jn-arm-w { flex: none; background: var(--tone); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 11px; }
.jn-arm-body { width: 100%; display: flex; flex-direction: column; align-items: center; }
.jn-arm .jn-node { max-width: 100%; }
.jn-arm .jn-node-txt strong { font-size: 12px; }
.jn-arm .jn-node-txt span { font-size: 11px; }
.jn-arm-end { background: var(--surface-2, #f8fafc); }
.jn-splitadd { display: flex; justify-content: center; padding: 2px 0; }
.jn-add-ghost { border-style: dashed; color: var(--muted); }
.jn-add-ghost:hover { color: #7c3aed; border-color: #c4b5fd; background: #faf5ff; }
.jn-add-sm { padding: 5px 12px; font-size: 12.5px; }
/* split modal: variant rows */
.jn-ab-arms { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 10px; }
.jn-ab-row { display: grid; grid-template-columns: 1fr 84px 26px; gap: 8px; align-items: center; }
.jn-ab-row .input { margin: 0; }
.jn-ab-pad { width: 26px; }
@media (max-width: 640px) { .jn-arms { flex-direction: column; max-width: 480px; } .jn-arm::before { display: none; } }

/* Customer activity timeline */
.tl { list-style: none; margin: 0; padding: 4px 0 0; position: relative; }
.tl-item { position: relative; display: flex; gap: 12px; padding: 0 0 16px 0; }
.tl-item::before { content: ''; position: absolute; left: 15px; top: 30px; bottom: -2px; width: 2px; background: var(--border); }
.tl-item:last-child { padding-bottom: 2px; }
.tl-item:last-child::before { display: none; }
.tl-dot { position: relative; z-index: 1; flex: none; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
.tl-body { padding-top: 5px; min-width: 0; }
.tl-title { font-size: 13.5px; font-weight: 500; }
.tl-title a { color: var(--primary); }
.tl-meta { font-size: 12px; color: var(--muted); margin-top: 1px; }

/* Automation overview */
.auto-kpi { text-decoration: none; transition: box-shadow .12s, transform .06s, border-color .12s; }
.auto-kpi:hover { box-shadow: var(--shadow); transform: translateY(-1px); border-color: var(--border-strong); }
.auto-kpi .stat-value { color: var(--fg); }

/* ---- campaign audience builder ---- */
.rule-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; background: #fafbfc; }
.rule-label { font-size: 13px; font-weight: 500; min-width: 180px; }
.rule-fields { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; }
.rule-fields .input { height: 34px; }
.rule-row .rule-del { margin-left: auto; }
/* Campaign + recipient status badges. */
.badge.status-draft { background: #f1f5f9; color: #475569; }
.badge.status-scheduled { background: #e0e7ff; color: #3730a3; }
.badge.status-sending { background: #fef9c3; color: #854d0e; }
.badge.status-paused { background: #ffedd5; color: #9a3412; }
.badge.status-done { background: #dcfce7; color: #166534; }
.badge.status-cancelled { background: #f1f5f9; color: #64748b; }
.badge.status-sent { background: #e0f2fe; color: #075985; }
.badge.status-delivered { background: #dcfce7; color: #166534; }
.badge.status-read { background: #dcfce7; color: #14532d; }
.badge.status-dead { background: #fee2e2; color: #991b1b; }
.badge.status-skipped { background: #f1f5f9; color: #64748b; }
/* A working-but-not-connected integration (e.g. storage on local disk). */
.int-status.neutral { background: #eff6ff; color: #1d4ed8; }

/* ---- reports ---- */
/* Period-over-period delta under a stat value. */
.rep-delta { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 500; margin-top: 2px; color: var(--muted); }
.rep-delta.up { color: #16a34a; }
.rep-delta.down { color: #dc2626; }
/* Two side-by-side cards are unreadable on a phone; 640px matches the other admin grids. */
@media (max-width: 640px) { .grid-2, .grid-4 { grid-template-columns: 1fr; } }

/* Storage migration notice inside the integration modal. Amber rather than red: nothing is
   broken, there is just work outstanding that the customer has to trigger. */
.int-note{margin:0 0 14px;padding:12px 14px;border-radius:10px;font-size:.86rem;line-height:1.55;
  background:rgba(245,158,11,.10);border:1px solid rgba(245,158,11,.28);color:#7c4a03}
.int-note b{font-weight:700}

/* ---- SEO overview ---- */
.seo-ok { color: #16a34a; }
.seo-warn { color: #d97706; }
.seo-fail { color: #dc2626; }
.seo-fix { margin-top: 5px; font-size: 12.5px; color: var(--primary); display: flex; align-items: center; gap: 4px; }
.seo-chip { display: inline-block; font-size: 11.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--primary-weak); color: var(--primary); border-radius: 5px; padding: 2px 7px; margin: 0 4px 4px 0; }
.seo-guide { font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.seo-guide h3 { font-size: 13px; font-weight: 600; color: var(--fg, #111827); margin: 16px 0 6px; }
.seo-guide p { margin: 0 0 8px; }
.seo-guide ul { margin: 0 0 10px; padding-left: 18px; }
.seo-guide li { margin-bottom: 6px; }
.seo-guide code { font-size: 12px; background: var(--surface-2, #f1f1f0); border-radius: 4px; padding: 1px 5px; }
.seo-guide .seo-warn { display: flex; align-items: center; gap: 6px; }
.seo-cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 28px; }
.seo-cols h3:first-child { margin-top: 4px; }
@media (max-width: 760px) { .seo-cols { grid-template-columns: 1fr; } }

/* ---- integration detail page ---- */
.int-detail > div { display: flex; flex-direction: column; gap: 14px; }
.int-detail .card { margin-bottom: 0; }
.int-help { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.int-steps { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.int-steps li { margin-bottom: 9px; }
.int-steps li::marker { color: var(--primary); font-weight: 600; }
.int-gotchas { list-style: none; margin: 0; padding: 0; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.int-gotchas li { display: flex; gap: 8px; margin-bottom: 10px; }
.int-gotchas li i { color: #d97706; flex: none; margin-top: 2px; }
.page-sub .int-status { vertical-align: middle; }

/* ---- settings: image upload ---- */
.img-field { margin-bottom: 22px; max-width: 460px; }
.img-field > .label { display: block; margin-bottom: 3px; }
.img-hint { font-size: 12.5px; color: var(--muted); margin: 0 0 9px; }
.img-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 150px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2, #f7f7f6); cursor: pointer; transition: border-color .12s, background .12s; }
.img-drop:hover, .img-drop:focus-visible { border-color: var(--primary); background: var(--primary-weak); outline: none; }
.img-drop.is-empty { border-style: dashed; }
.img-drop.is-over { border-color: var(--primary); background: var(--primary-weak); border-style: solid; }
.img-drop.is-busy { pointer-events: none; opacity: .7; }
/* contain, not cover: a logo must never be cropped to fill the tile. */
.img-preview { display: block; max-width: 100%; }
.img-preview img { max-width: 100%; max-height: 110px; object-fit: contain; display: block; border-radius: 4px; }
.img-cta { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--muted); }
.img-drop:hover .img-cta { color: var(--primary); }
.img-cta i { font-size: 17px; }
.img-spinner { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.img-spinner i { animation: img-spin .8s linear infinite; }
@keyframes img-spin { to { transform: rotate(360deg); } }
.img-actions { display: flex; gap: 8px; margin-top: 8px; }
.img-err { color: var(--danger); font-size: 12.5px; margin: 8px 0 0; }

/* ---- dropzone (product media) ---- */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 30px 20px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg); background: #fafbfc; cursor: pointer; text-align: center; transition: border-color .12s, background .12s; position: relative; }
.dropzone:hover, .dropzone:focus-visible { border-color: var(--primary); background: var(--primary-weak); outline: none; }
.dropzone.is-over { border-color: var(--primary); background: var(--primary-weak); border-style: solid; }
.dropzone.is-busy { pointer-events: none; opacity: .75; }
.dropzone-icon { font-size: 27px; color: var(--muted-2); }
.dropzone:hover .dropzone-icon, .dropzone.is-over .dropzone-icon { color: var(--primary); }
.dropzone-title { font-size: 14px; font-weight: 500; color: var(--fg); }
.dropzone-sub { font-size: 12px; color: var(--muted); }
.dropzone-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--border); border-radius: 0 0 var(--radius-lg) var(--radius-lg); overflow: hidden; }
.dropzone-bar { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s; }


/* ---- small utilities (were used before they existed) ---- */
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.sm { font-size: 12px; }
.right { text-align: right; }

/* ---- MCP connector setup ---- */
.mcp-url { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 11px 14px; margin: 4px 0 16px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); }
.mcp-url .mono { word-break: break-all; }
.mcp-steps { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; color: var(--muted); }
.mcp-warn { display: flex; gap: 8px; margin: 16px 0 0; padding: 11px 14px; border-radius: var(--radius); background: #fffbeb; color: #854d0e; border: 1px solid #fde68a; font-size: 13px; }
.mcp-warn i { flex-shrink: 0; font-size: 16px; }

/* ---- OAuth consent (standalone page, reuses the login card) ---- */
.oauth-card { max-width: 440px; }
.oauth-brand-bad { background: var(--danger); }
.oauth-scopes { list-style: none; margin: 0 0 18px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; gap: 11px; font-size: 13.5px; }
.oauth-scopes li { display: flex; align-items: center; gap: 10px; }
.oauth-scopes i { color: var(--primary); font-size: 17px; flex-shrink: 0; }
.oauth-meta { font-size: 13px; color: var(--muted); margin: 0 0 20px; line-height: 1.6; }
.oauth-actions { display: flex; gap: 10px; }
.oauth-actions .btn { flex: 1; justify-content: center; }
.oauth-redirect { font-size: 12px; color: var(--muted); text-align: center; margin: 16px 0 0; }

/* Field hint: several page-builder sections draw content from elsewhere in the admin, and
   the editor gave no clue where. */
.field-hint { display: flex; gap: 6px; align-items: flex-start; margin: -4px 0 12px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.field-hint i { flex-shrink: 0; font-size: 13px; margin-top: 1px; }

/* ---- Tom Select: match the native .input it replaces ---- */
/* Tom Select copies the original element's classes onto its wrapper, so a <select class="input">
   ends up with the wrapper AND the inner control each drawing a border and a height. Strip the
   input chrome from the wrapper and let .ts-control be the field. */
.ts-wrapper { min-width: 0; }
.ts-wrapper.input { border: 0; padding: 0; height: auto; min-height: 0; background: none; box-shadow: none; }
.ts-wrapper.single .ts-control,
.ts-wrapper.multi .ts-control { border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--fg); font-family: inherit; font-size: 13px; padding: 4px 10px; min-height: 33px; box-shadow: none; }
.ts-wrapper.focus .ts-control { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-weak); }
.ts-wrapper.multi .ts-control > .item { background: var(--primary-weak); color: var(--primary); border: 0; border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 500; }
.ts-wrapper.multi .ts-control > .item .remove { border-left: 0; padding: 0 0 0 5px; opacity: .6; }
.ts-wrapper.multi .ts-control > .item .remove:hover { background: none; opacity: 1; }
.ts-dropdown { border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow); font-size: 13px; margin-top: 4px; }
.ts-dropdown .active { background: var(--primary-weak); color: var(--primary); }
.ts-control input { font-size: 13px; }
.cat-pick-field { grid-column: 1 / -1; }

/* A section field that does not apply to the current source. Hidden, not removed: its inputs
   still submit, so switching source back does not silently lose what was typed. */
.sec-cond.is-off { display: none; }

/* ---- card switch: a bordered row with a toggle, replacing bare checkboxes ---- */
.switch-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; margin-bottom: 12px; transition: border-color .12s; }
.switch-card:hover { border-color: var(--border-strong); }
.switch-card .sw-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.switch-card .sw-title { font-size: 13.5px; font-weight: 600; }
.switch-card .sw-sub { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.switch-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.sw-track { flex-shrink: 0; width: 40px; height: 23px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .15s; }
.sw-track::after { content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(17,24,39,.25); transition: transform .15s; }
.switch-card input:checked ~ .sw-track { background: var(--primary); }
.switch-card input:checked ~ .sw-track::after { transform: translateX(17px); }
.switch-card input:focus-visible ~ .sw-track { box-shadow: 0 0 0 3px var(--primary-weak); }

/* ---- per-page guide: right offcanvas ---- */
.guide-scrim { position: fixed; inset: 0; z-index: 90; background: rgba(17,24,39,.28); opacity: 0; transition: opacity .2s; }
.guide-scrim.show { opacity: 1; }
.guide-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 95; width: 420px; max-width: 94vw; background: #fff; box-shadow: -12px 0 40px rgba(17,24,39,.16); transform: translateX(100%); transition: transform .22s ease; display: flex; flex-direction: column; }
.guide-panel.open { transform: none; }
.guide-head { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.guide-head span { font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 8px; }
.guide-head span i { color: var(--primary); }
.guide-head button { background: none; border: 0; font-size: 22px; line-height: 1; cursor: pointer; color: var(--fg); padding: 2px; }
.guide-body { flex: 1; overflow-y: auto; padding: 18px 22px 30px; font-size: 13.5px; line-height: 1.65; color: var(--fg); }
.guide-body h2 { font-size: 15px; font-weight: 700; margin: 20px 0 6px; }
.guide-body h2:first-child { margin-top: 0; }
.guide-body h3 { font-size: 13.5px; font-weight: 600; margin: 16px 0 4px; }
.guide-body h4 { font-size: 12.5px; font-weight: 600; margin: 12px 0 3px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.guide-body p { margin: 0 0 10px; }
.guide-body ul, .guide-body ol { margin: 0 0 10px; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.guide-body blockquote { margin: 0 0 10px; padding: 9px 12px; border-left: 3px solid var(--primary); background: var(--primary-weak); border-radius: 0 8px 8px 0; }
.guide-body code { background: #f1f2f5; border-radius: 4px; padding: 1px 5px; font-size: .92em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.guide-body pre { background: #f6f7f9; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; overflow-x: auto; margin: 0 0 10px; }
.guide-body pre code { background: none; padding: 0; }
.guide-body hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.guide-body a { color: var(--primary); }

/* ---- preset library, grouped by colour scheme ---- */
.preset-group { display: flex; align-items: center; gap: 7px; margin: 16px 0 8px; }
.preset-group:first-of-type { margin-top: 10px; }
.preset-group i { color: var(--muted-2, var(--muted)); font-size: 15px; }
/* The first swatch is the page colour — outline it so white-on-white stays visible. */
.preset .pv:first-child { box-shadow: inset 0 0 0 1px rgba(128,128,128,.35); }
