﻿:root {
  --bg: #f4f5fa;
  --surface: #ffffff;
  --border: #e6e8f0;
  --border-strong: #d6d9e6;
  --text: #16192b;
  --muted: #667085;
  --accent: #0e9f6e;
  --accent-soft: #e6f7f0;
  --accent-strong: #0b7d57;
  --green: #158a52;
  --green-soft: #e5f6ee;
  --amber: #b45309;
  --amber-soft: #fdf1df;
  --red: #c2323e;
  --red-soft: #fdeaec;
  --blue: #175cd3;
  --blue-soft: #eaf1fd;
  --sidebar-bg: #12141f;
  --sidebar-text: #9aa0b4;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .08);
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'DM Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; }
code { font-family: var(--mono); font-size: 12.5px; background: var(--accent-soft); color: var(--accent-strong); border-radius: 6px; padding: 2px 7px; }

.app-shell { display: flex; min-height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 236px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, #34d399, #0e9f6e);
  color: #fff; display: grid; place-items: center; font-size: 15px;
}
.brand span { font-weight: 800; font-size: 17px; letter-spacing: .2px; color: #fff; }
.brand span b { color: #6ee7b7; }
.store-switcher {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09);
  padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 18px;
}
.store-dot { width: 9px; height: 9px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.18); flex-shrink: 0; }
.store-switcher strong { display: block; color: #fff; font-size: 13px; line-height: 1.25; }
.store-switcher small { font-size: 11px; opacity: .65; word-break: break-all; }

.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; margin: 16px 10px 6px; opacity: .55; font-weight: 700; }
nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--sidebar-text); font-weight: 600; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.nav-item i {
  font-style: normal; width: 26px; height: 26px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 8px;
  background: rgba(255,255,255,.06); font-size: 13px;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(16, 185, 129, .28), rgba(16, 185, 129, .12)); }
.nav-item.active i { background: var(--accent); color: #fff; }
.sidebar-foot { margin-top: auto; padding: 14px 10px 2px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11.5px; opacity: .6; }

/* ---------- Main ---------- */
.main-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 30px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 40;
}
.breadcrumbs { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 13px; }
.breadcrumbs strong { color: var(--text); font-size: 15px; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.view { padding: 26px 30px 60px; max-width: 1160px; width: 100%; margin: 0 auto; }

/* ---------- Hero ---------- */
.hero { margin-bottom: 22px; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 800; color: var(--accent); margin: 0 0 4px; }
.hero h1 { margin: 0 0 4px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.hero p { margin: 0; color: var(--muted); }

/* ---------- Panels & grids ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 18px;
}
.panel h2 { margin: 0 0 6px; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.panel h3 { margin: 0 0 4px; font-size: 14px; font-weight: 800; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 3fr 2fr; gap: 18px; align-items: start; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px;
}
.stat-card .label { display: block; font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.stat-card strong { font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.stat-foot { margin-top: 4px; font-size: 12px; color: var(--muted); }
.stat-accent strong { color: var(--accent); }

/* ---------- Badges & chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; padding: 3px 9px;
  border-radius: 999px; white-space: nowrap;
  background: #eef0f5; color: var(--muted);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.info { background: var(--blue-soft); color: var(--blue); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.danger { background: var(--red-soft); color: var(--red); }
.badge.accent { background: var(--accent-soft); color: var(--accent-strong); }
.chip {
  display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px;
  background: #f1f2f7; border: 1px solid var(--border); border-radius: 7px; color: var(--muted);
}

/* ---------- Tables / rows ---------- */
.trow {
  display: grid; gap: 14px; align-items: center;
  padding: 13px 6px; border-top: 1px solid var(--border);
  font-size: 13.5px;
}
.trow:first-of-type { border-top: 0; }
.trow > div { min-width: 0; }
.trow strong { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow small { display: block; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow .num { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; }
.thead { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 800; padding: 0 6px 8px; }

/* ---------- Buttons ---------- */
button, .btn, a.primary {
  font-family: var(--font); font-size: 13px; font-weight: 700;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  padding: 8px 15px; cursor: pointer; transition: filter .15s, background .15s;
  display: inline-flex; align-items: center; gap: 7px;
}
.primary:hover { background: var(--accent-strong); }
.primary, a.primary, button.primary {
  background: var(--accent); color: #fff; text-decoration: none;
  box-shadow: 0 1px 2px rgba(14, 159, 110, .35);
}
.secondary, button.secondary {
  background: var(--surface); color: var(--text);
  border-color: var(--border-strong);
}
.secondary:hover { background: #f6f7fb; }
.danger-btn { background: var(--red-soft); color: var(--red); }
.ghost { background: transparent; color: var(--muted); }
.ghost:hover { color: var(--text); background: #f1f2f7; }
button:disabled { opacity: .55; cursor: not-allowed; }
.is-busy { opacity: .6; pointer-events: none; }

/* ---------- Tabs (settings / preview) ---------- */
.tab-row { display: flex; gap: 4px; background: #f1f2f7; padding: 4px; border-radius: 11px; margin-bottom: 18px; width: max-content; }
.tab-btn { border: 0; background: transparent; padding: 8px 18px; border-radius: 8px; font-weight: 700; font-size: 13px; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: #fff; color: var(--text); box-shadow: var(--shadow); }

/* ---------- Forms ---------- */
label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 13px; }
input, select, textarea {
  width: 100%; margin-top: 5px; font-family: var(--font); font-size: 13.5px;
  color: var(--text); background: #fbfbfe;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 9px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(84,87,214,.14); background: #fff; }
textarea { resize: vertical; min-height: 74px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
/* Multi-trigger toggle grid (opt-in prompt editor). Scoped so the global
   label/input rules (display:block, width:100%) don't crush it. */
.pe-trigger-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 8px 12px; margin: 2px 0 2px; }
.pe-trigger-option {
  display: flex; align-items: center; gap: 10px; margin: 0;
  font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.35;
  background: #fbfbfe; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 9px 12px; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s;
}
.pe-trigger-option:hover { border-color: var(--accent); }
.pe-trigger-option:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.pe-trigger-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.pe-trigger-option .switch.sm { margin: 0; }
.pe-trigger-option .pe-trigger-label { flex: 1; font-size: 12.5px; font-weight: 600; color: var(--text); line-height: 1.35; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.form-actions span { font-size: 12.5px; color: var(--muted); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; margin-top: 0; min-width: 170px; }

/* ---------- Charts ---------- */
.bar-track { height: 8px; background: #edeff5; border-radius: 999px; overflow: hidden; display: flex; }
.bar-track .bar-sent { background: linear-gradient(90deg, #34c98e, #158a52); height: 100%; }
.bar-track .bar-failed { background: var(--red); height: 100%; }
.donut {
  --value: 0;
  width: 118px; height: 118px; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--value) * 1%), #e9eaf2 0);
  display: grid; place-items: center; margin: 0 auto;
}
.donut::after {
  content: attr(data-label);
  width: 86px; height: 86px; border-radius: 50%;
  background: var(--surface); display: grid; place-items: center;
  font-size: 19px; font-weight: 800;
}
.legend { display: flex; gap: 16px; justify-content: center; margin-top: 12px; font-size: 12px; color: var(--muted); font-weight: 600; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }

/* ---------- Activity feed ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; align-items: baseline; padding: 9px 2px; border-top: 1px solid var(--border); font-size: 13px; }
.feed li:first-child { border-top: 0; }
.feed time { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.queue-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.queue-chips .chip b { color: var(--text); }

/* ---------- Empty / banners ---------- */
.empty-state { text-align: center; color: var(--muted); padding: 38px 20px; }
.empty-state::before { content: '◎'; display: block; font-size: 26px; margin-bottom: 10px; opacity: .5; }
.banner { border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px; font-size: 13.5px; border: 1px solid; }
.banner.warn { background: var(--amber-soft); border-color: #f3ddb8; color: var(--amber); }
.banner.error { background: var(--red-soft); border-color: #f6c6cb; color: var(--red); }
.banner.ok { background: var(--green-soft); border-color: #bfe8d4; color: var(--green); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 17, 32, .48);
  backdrop-filter: blur(2px); z-index: 90;
  display: grid; place-items: center; padding: 20px;
}
.modal {
  background: var(--surface); border-radius: var(--radius);
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
  box-shadow: 0 20px 50px rgba(15, 17, 32, .3);
  animation: pop .16s ease-out;
}
@keyframes pop { from { transform: translateY(8px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; }
.modal-head h2 { margin: 0; font-size: 17px; font-weight: 800; }
.modal-close { background: #f1f2f7; border: 0; border-radius: 8px; width: 30px; height: 30px; font-size: 14px; color: var(--muted); cursor: pointer; display: grid; place-items: center; line-height: 1; padding: 0; flex-shrink: 0; }
.modal-close:hover { color: var(--text); background: #e6e8f0; }
.modal-body { padding: 16px 22px 22px; }

/* ---------- Notification preview ---------- */
.push-preview {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fbfbfe; padding: 12px 14px; margin-bottom: 14px;
  display: flex; gap: 11px; align-items: flex-start;
}
.push-preview .pp-icon { width: 30px; height: 30px; flex-shrink: 0; border-radius: 8px; background: linear-gradient(135deg, #34d399, #0e9f6e); display: grid; place-items: center; color: #fff; font-size: 13px; }
.push-preview strong { display: block; font-size: 13px; }
.push-preview p { margin: 1px 0 0; font-size: 12.5px; color: var(--muted); }
.push-preview small { font-size: 11px; color: #98a2b3; }

/* ---------- Flow (automations) ---------- */
.flow { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin: 8px 0 2px; }
.flow span { font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 7px; background: #f1f2f7; color: var(--muted); }
.flow em { color: #c3c8d6; font-style: normal; font-weight: 800; }

/* ---------- Switch (funnel collection) ---------- */
.switch { position: relative; width: 38px; height: 22px; flex-shrink: 0; display: inline-block; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 2; }
.switch span { position: absolute; inset: 0; background: #d8dbe6; border-radius: 999px; transition: background .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.3); transition: left .15s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { left: 19px; }

.switch.sm { width: 32px; height: 19px; }
.switch.sm span::after { width: 13px; height: 13px; top: 3px; left: 3px; }
.switch.sm input:checked + span::after { left: 16px; }

/* ---------- Device previews ---------- */
.device-previews { display: flex; gap: 18px; flex-wrap: wrap; align-items: stretch; }
.device-col { display: flex; flex-direction: column; gap: 6px; }
.device-label { font-size: 11px; font-weight: 800; letter-spacing: .09em; color: var(--muted); }
.device-frame { background: #fff; border: 1px solid var(--border-strong); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.device-chrome { display: flex; align-items: center; gap: 5px; padding: 8px 11px; background: #f1f2f7; border-bottom: 1px solid var(--border); }
.device-dot { width: 8px; height: 8px; border-radius: 50%; background: #cfd3e0; }
.device-url { flex: 1; margin-left: 8px; background: #fff; border-radius: 999px; font-size: 10.5px; color: var(--muted); padding: 3px 12px; text-align: center; }
.viewport { position: relative; height: 270px; width: 420px; max-width: 100%; background: linear-gradient(180deg, #fbfbfe, #edeff6); }
.phone-shell { width: 391px; max-width: 100%; border-radius: 34px; border: 1px solid var(--border-strong); padding: 7px; background: #fff; box-shadow: var(--shadow); }
.phone-notch { width: 80px; height: 5px; border-radius: 999px; background: #dfe2ec; margin: 3px auto 6px; }
.phone-screen { position: relative; width: 375px; height: 520px; border-radius: 26px; background: linear-gradient(180deg, #fbfbfe, #edeff6); overflow: hidden; }
.pp-stage { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; }
.pp-stage .pp-prompt { position: absolute; transition: none; }
.mock-bell { width: 26px; height: 26px; flex-shrink: 0; border-radius: 8px; display: grid; place-items: center; }

/* ---------- Notification mockups (mobile + desktop) ---------- */
.notif-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 14px; align-items: start; }
.notif-pair > div { min-width: 0; }
.notif-mobile { background: #fff; border: 1px solid var(--border-strong); border-radius: 14px; padding: 11px 13px; box-shadow: var(--shadow); }
.notif-desktop { background: #fff; border: 1px solid var(--border-strong); border-top: 3px solid var(--accent, #0e9f6e); border-radius: 11px; padding: 12px 14px; box-shadow: var(--shadow); }
.notif-row { display: flex; gap: 9px; align-items: flex-start; }
.notif-text { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.notif-title { font-weight: 800; font-size: 12.5px; line-height: 1.3; }
.notif-body { color: #5b6172; font-size: 11.5px; margin-top: 2px; line-height: 1.45; overflow-wrap: break-word; }
.notif-meta { display: flex; align-items: baseline; gap: 4px; min-width: 0; max-width: 100%; margin-top: 4px; color: #98a2b3; font-size: 10px; white-space: nowrap; }
.notif-url { display: block; flex: 1 1 auto; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-when { flex: 0 0 auto; white-space: nowrap; }

/* ---------- Composer: live preview, icon picker, A/B, test send ---------- */
/* One wide modal, two columns: the form on the left, the real notification on
   the right. Below 900px it collapses to a single column, so the composer still
   works at 390px with no horizontal scroll. */
.modal-composer { max-width: 960px; }
.composer-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 26px; align-items: start; }
.composer-fields { min-width: 0; }
.composer-preview { position: sticky; top: 0; min-width: 0; }
.preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.preview-head h3 { margin: 0; font-size: 14px; font-weight: 800; }
.preview-stack { display: flex; flex-direction: column; gap: 10px; }

/* The browser notification itself: square icon, one-line title, two-line body. */
.np-card { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); padding: 12px 14px; box-shadow: var(--shadow); }
/* A browser notification is LTR chrome — icon on the left, text beside it —
   whatever language the dashboard is in. The copy inside keeps its own script
   direction via unicode-bidi: plaintext, so Arabic text reads correctly without
   mirroring the card. */
.np-card { direction: ltr; text-align: left; }
.np-title, .np-body { unicode-bidi: plaintext; }
.np-tag { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.np-row { display: flex; gap: 11px; align-items: flex-start; }
.np-icon { flex: 0 0 auto; }
.np-text { min-width: 0; flex: 1 1 auto; }
.np-title { font-weight: 800; font-size: 13px; line-height: 1.32; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-body { font-size: 12.5px; line-height: 1.45; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.np-origin { display: flex; gap: 5px; align-items: baseline; font-size: 10.5px; color: var(--muted); margin-top: 6px; min-width: 0; }
.np-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-placeholder { color: #98a2b3; }

.pp-icon-tile { position: relative; display: grid; place-items: center; border-radius: 10px; overflow: hidden; background: var(--accent-soft); flex: 0 0 auto; }
.pp-icon-tile > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.pp-icon-tile > img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; display: block; }

.icon-field { margin: 2px 0 15px; }
.field-label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 7px; }
.icon-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.icon-choice {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 6px; background: #fbfbfe; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); color: var(--muted);
  font-size: 11.5px; font-weight: 700; line-height: 1.2; text-align: center; cursor: pointer;
}
.icon-choice:hover { border-color: var(--accent); color: var(--text); }
.icon-choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); box-shadow: 0 0 0 1px var(--accent) inset; }
.icon-choice:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-choice .icon-art { display: block; width: 40px; height: 40px; border-radius: 10px; overflow: hidden; }
.icon-choice .icon-art svg { display: block; width: 100%; height: 100%; }
.icon-custom { margin-bottom: 4px; }
.icon-custom-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.icon-custom-row .ghost { padding: 2px 0; font-size: 12px; }
.field-error { color: var(--red); font-size: 12px; margin: 4px 0 0; }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; line-height: 1.45; }
.help { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); margin-top: 4px; }
.note { margin: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.note.ok { color: var(--green); }
.note.warn { color: var(--amber); }

.ab-block { border-top: 1px solid var(--border); padding-top: 13px; margin-bottom: 14px; }
.ab-toggle { display: flex; gap: 11px; align-items: flex-start; margin: 0; color: var(--text); cursor: pointer; font-weight: 600; }
.ab-toggle .switch { margin-top: 2px; }
.ab-toggle strong { display: block; font-size: 13px; font-weight: 800; color: var(--text); }
.ab-toggle small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; margin-top: 2px; line-height: 1.4; }
.ab-fields[hidden] { display: none; }
.ab-fields { padding-top: 12px; }
.split-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.split-head .field-label { margin-bottom: 0; }
.ab-fields output { display: inline-block; font-size: 11.5px; font-weight: 700; color: var(--accent-strong); background: var(--accent-soft); border-radius: 999px; padding: 1px 9px; }
.ab-fields input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; padding: 0; margin-top: 8px; background: transparent; border: 0; box-shadow: none; accent-color: var(--accent); }
.ab-fields input[type="range"]:focus { box-shadow: none; border: 0; }
.ab-fields input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: var(--border-strong); }
.ab-fields input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(16,24,40,.3); }
.ab-fields input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--border-strong); }
.ab-fields input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; }

.test-zone { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 13px; display: flex; flex-direction: column; gap: 7px; }
.test-zone button { justify-content: center; text-align: center; width: 100%; }
.test-zone .hint { margin: 0; }
.quiet-hint { margin: 2px 0 0; }

/* ---------- History: icon, A/B chip, delivery words ---------- */
.camp-cell { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.camp-text { min-width: 0; flex: 1 1 auto; }
.camp-text .chip { display: inline-block; font-size: 10.5px; padding: 1px 7px; }
.camp-icon { margin-top: 1px; }
/* Name keeps the full cell width and the tags take the line below it, so two
   chips wrap under the name instead of squeezing it (~100px of name width at
   390px, where a shared line would leave a one-word name). */
.camp-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 4px; min-width: 0; }
.ab-chip { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-strong); font-weight: 800; }
.ab-win-chip { background: var(--green-soft); border-color: var(--green-soft); color: var(--green); font-weight: 800; }
.camp-ab-toggle { padding: 0; background: none; border: 0; box-shadow: none; font: 700 10.5px/1.7 var(--font); color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }
.camp-ab-toggle:hover { background: none; color: var(--accent); }

/* A/B result, expanded under its campaign row: two symmetric version cards,
   then one plain sentence. */
.camp-detail { border-top: 1px dashed var(--border); background: var(--bg); padding: 10px 8px 12px; font-size: 12.5px; }
.camp-detail[hidden] { display: none; }
.camp-detail-note { margin: 8px 0 0; font-size: 12px; }
.ab-result { display: flex; flex-direction: column; gap: 10px; }
.ab-result-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ab-result-head h3 { margin: 0; font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.ab-versions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: stretch; }
.ab-version { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.ab-version.is-winner { background: var(--accent-soft); border-color: var(--accent); }
.ab-version-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.ab-version-count { font-size: 20px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.ab-version-unit { font-size: 12px; font-weight: 700; letter-spacing: 0; color: var(--muted); }
.ab-version-share { font-size: 11.5px; color: var(--muted); }
.ab-verdict { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--text); }
.del-words { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 5px; font-size: 11.5px; font-weight: 600; }
.del-word.ok { color: var(--green); }
.del-word.warn { color: var(--amber); }
.del-word.danger { color: var(--red); }
.del-word.muted { color: var(--muted); }

/* ---------- Sending rules (Settings) ---------- */
.rule-toggle { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 16px; color: var(--text); cursor: pointer; font-weight: 600; }
.rule-toggle .switch { margin-top: 2px; }
.rule-toggle strong { display: block; font-size: 13.5px; font-weight: 800; }
.rule-toggle small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; margin-top: 2px; }
#qh-times.is-off { opacity: .6; }

@media (max-width: 900px) {
  .composer-grid { grid-template-columns: 1fr; gap: 18px; }
  .composer-preview { position: static; }
}
@media (max-width: 480px) {
  .icon-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-head { padding: 14px 16px 0; }
  .modal-body { padding: 12px 16px 18px; }
  .test-zone button { font-size: 12.5px; padding: 9px 10px; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translate(-50%, 14px);
  background: #16192b; color: #fff; font-size: 13.5px; font-weight: 600;
  padding: 11px 20px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 120;
  box-shadow: 0 10px 30px rgba(15,17,32,.35);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.muted { color: var(--muted); }
.mt0 { margin-top: 0; }

/* ---------- Onboarding: setup wizard + getting-started checklist ---------- */
.wizard-wrap { max-width: 680px; margin: 7vh auto 0; display: flex; flex-direction: column; align-items: center; }
.wiz-card { width: 100%; padding: 30px 34px 32px; }
.wiz-rail { display: flex; align-items: center; gap: 6px; margin-bottom: 24px; }
.wiz-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 800; background: #f1f2f7; color: var(--muted); border: 1.5px solid var(--border); flex-shrink: 0; }
.wiz-dot.wiz-current { background: var(--accent-soft); color: var(--accent-strong); border-color: var(--accent); }
.wiz-dot.wiz-done { background: var(--accent); color: #fff; border-color: var(--accent); }
.wiz-line { flex: 1; height: 1.5px; background: var(--border); min-width: 14px; }
.wiz-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 6px; }
.wiz-sub { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.wiz-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 24px; }
.wiz-actions .muted { font-size: 12.5px; }
.wiz-skip { margin-top: 16px; font-size: 12.5px; }
.wiz-brand { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg, #34d399, #0e9f6e); color: #fff; display: grid; place-items: center; font-size: 24px; font-weight: 800; margin-bottom: 16px; }
.wiz-points { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }

/* RTL (العربية / الدارجة): logical alignment + Arabic-friendly font. */
body.pp-rtl { font-family: 'Tajawal', 'Manrope', system-ui, sans-serif; }
body.pp-rtl code { direction: ltr; unicode-bidi: embed; }
body.pp-rtl input, body.pp-rtl select, body.pp-rtl textarea { text-align: start; }
body.pp-rtl select { min-width: 118px; }
body.pp-rtl .thead span, body.pp-rtl .trow > div { text-align: start; }
body.pp-rtl .notif-meta, body.pp-rtl .device-url { direction: ltr; unicode-bidi: embed; }
/* A notification's origin is a hostname, not prose: keep it LTR in Arabic UI. */
body.pp-rtl .np-origin { direction: ltr; unicode-bidi: embed; justify-content: flex-end; }
/* Keep the share slider's low end on the left even in RTL: the label reads
   "version A share", and a mirrored track would send the thumb the wrong way
   for the number printed next to it. */
body.pp-rtl .ab-fields input[type="range"] { direction: ltr; }

/* Merchant-paced catalog import: bottom row of the Funnels panel. */
.pace-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 0 2px; }
.pace-row .muted { font-size: 12.5px; }
.wiz-points li { display: flex; gap: 11px; align-items: flex-start; }
.wiz-points .pt { width: 24px; height: 24px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; font-size: 12px; font-weight: 800; flex-shrink: 0; margin-top: 1px; }
.wiz-points strong { display: block; font-size: 13.5px; }
.wiz-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wiz-choice { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; background: #fbfbfe; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.wiz-choice strong { font-size: 14px; }
.wiz-choice p { margin: 0; font-size: 12.5px; color: var(--muted); }
.wiz-stat-line { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.wiz-stat-line .chip { font-size: 12.5px; padding: 5px 11px; }

.onboarding-card { border-color: #bfe8d4; }
.check-list .check-row { display: flex; align-items: center; gap: 12px; padding: 11px 2px; border-top: 1px solid var(--border); }
.check-list .check-row:first-child { border-top: 0; }
.check-mark { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; flex-shrink: 0; background: #f1f2f7; color: var(--muted); border: 1.5px solid var(--border); }
.check-done .check-mark { background: var(--accent); border-color: var(--accent); color: #fff; }
.check-text { min-width: 0; flex: 1; }
.check-text strong { display: block; font-size: 13.5px; }
.check-text small { color: var(--muted); font-size: 12px; }
.check-done .check-text strong { color: var(--muted); font-weight: 700; }
.check-row .primary, .check-row .secondary { flex-shrink: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .wizard-wrap { margin-top: 10px; }
  .wiz-card { padding: 22px 20px; }
  .wiz-choices { grid-template-columns: 1fr; }
}
@media (max-width: 1020px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; padding: 14px; }
  nav { flex-direction: row; overflow-x: auto; gap: 4px; }
  .nav-label, .store-switcher { display: none; }
  .view { padding: 18px 16px 50px; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  /* Data tables: give rows their natural width back and let the panel swipe.
     The inline grid-template-columns stay intact — they just get room to breathe. */
  .panel { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .thead, .trow { min-width: 660px; }
  .form-row { grid-template-columns: 1fr; }
}

/* Billing: plan screen / switch view */
.plan-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 16px; align-items: stretch; }
.plan-card { display: flex; flex-direction: column; gap: 10px; height: 100%; }
.plan-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.plan-price { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.plan-price .muted { font-size: 13px; font-weight: 600; }
.plan-features { margin: 0 0 6px; padding-left: 18px; color: var(--muted); font-size: 13.5px; display: grid; gap: 5px; }
.plan-card .primary { margin-top: auto; }
.plan-card .badge { margin-top: auto; align-self: flex-start; }

/* Product tour (driver.js) — themed to the app */
.tour-btn { display:block; width:100%; margin:0 0 10px; padding:8px 10px; border:1px solid rgba(255,255,255,.14); border-radius:8px; background:rgba(255,255,255,.04); color:#cfd8d4; font:600 11.5px/1 inherit; cursor:pointer; text-align:left; }
.tour-btn:hover { background:rgba(255,255,255,.09); color:#fff; }
.driver-popover.pp-tour { background:#fff; color:#101828; border-radius:12px; box-shadow:0 24px 60px rgba(16,24,40,.28); max-width:340px; }
.driver-popover.pp-tour .driver-popover-title { font:800 16px/1.25 inherit; color:#101828; }
.driver-popover.pp-tour .driver-popover-description { font:400 13.5px/1.5 inherit; color:#475467; }
.driver-popover.pp-tour .driver-popover-progress-text { color:#667085; font-size:11.5px; }
.driver-popover.pp-tour button { border-radius:8px; font:700 12.5px/1 inherit; padding:8px 12px; text-shadow:none; }
.driver-popover.pp-tour .driver-popover-next-btn, .driver-popover.pp-tour .driver-popover-done-btn { background:#0f766e; color:#fff; border:0; }
.driver-popover.pp-tour .driver-popover-prev-btn { background:#f2f4f7; color:#344054; border:1px solid #e4e7ec; }
.driver-popover.pp-tour .driver-popover-close-btn { color:#98a2b3; }
