/* Layout/components copied from the approved mockup; real dashboard additions. */
[hidden] { display: none !important; }
body { overflow-wrap: anywhere; }
/* Tables keep whole words. The body-wide `anywhere` above lets an auto-layout table shrink every column to one
   letter (Arabic headers and values broke letter by letter, on desktop too). break-word still wraps a long
   address inside its cell without counting toward the column's minimum width. */
table, th, td { overflow-wrap: break-word; word-break: normal; }
th { white-space: nowrap; }
/* The first column names the row (campaign, newsletter, subscriber): it gets room before the numbers do. */
@media (min-width: 641px) { .table-wrap td:first-child { min-width: 13rem; } }
/* No horizontal scroll (owner rule): on phones, and on any screen where a table is wider than its box
   (dashboard.js sets .is-stacked), each row becomes a block of «label: value» lines; the labels come from the
   table's own header (dashboard.js copies each th into its column's td data-label). */
.table-wrap.is-stacked { overflow-x: visible; border: 0; border-radius: 0; }
.table-wrap.is-stacked table, .table-wrap.is-stacked tbody, .table-wrap.is-stacked tr { display: block; width: 100%; }
.table-wrap.is-stacked thead { display: none; }
.table-wrap.is-stacked tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); column-gap: 24px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 16px; margin-bottom: 10px; background: #fff; }
.table-wrap.is-stacked td { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--border); text-align: end; min-width: 0; }
.table-wrap.is-stacked td:first-child, .table-wrap.is-stacked td[colspan] { grid-column: 1 / -1; display: block; text-align: start; min-width: 0; }
.table-wrap.is-stacked td[data-label]:not([data-label=""]):not(:first-child)::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 700; text-align: start; flex: 0 1 50%; }
.table-wrap.is-stacked tr:hover td { background: none; }
@media (max-width: 640px) {
  .table-wrap { overflow-x: visible; border: 0; border-radius: 0; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px 14px; margin-bottom: 10px; background: #fff; }
  .table-wrap td { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--border); text-align: end; }
  .table-wrap td:last-child { border-bottom: 0; }
  .table-wrap td[data-label]:not([data-label=""])::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 700; text-align: start; flex: 0 1 45%; }
  .table-wrap td[colspan] { display: block; text-align: start; }
  .table-wrap tr:hover td { background: none; }
}
input, select, textarea { max-width: 100%; min-width: 0; }
.topbar { flex-wrap: wrap; }
.sending-address { display: block; overflow-wrap: anywhere; }
.card, .auth-card, .store-chip > div { min-width: 0; }
.auth-card { width: 100%; max-width: 430px; }
.tabs { flex-wrap: wrap; }
button:disabled { cursor: not-allowed; opacity: .6; }
@media (max-width: 600px) { .content { padding: 16px 12px; } .topbar { padding: 12px; } .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { html, body { overflow-x: clip; } .sidebar { visibility: hidden; } .sidebar.open { visibility: visible; } }

/* Sales channels (one engine, a connector per platform). */
.channel p { margin: 0 0 12px; color: var(--text-2); }
.channel .row { gap: 10px; }
.channel h3 { margin: 0; }
.ch-logo { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: .85rem; border: 1px solid var(--border); background: var(--surface-2); flex-shrink: 0; }
.ch-salla { background: #e7f8f5; color: #004d5a; }
.ch-zid { background: #f1ecff; color: #5b2bd6; }
.ch-woocommerce { background: #f3ecfb; color: #7f54b3; }
.ch-shopify { background: #eef7e6; color: #5e8e3e; }
.ch-store { margin: 0; font-size: .9rem; }
.sidebar-foot .logout { width: 100%; justify-content: flex-start; }
.empty h3 { margin: 8px 0 4px; }
@media (max-width: 760px) { .channels { grid-template-columns: minmax(0, 1fr); } }#stats > .card, .channels > .card { margin-top: 0; }
.sw-row { display: flex; align-items: center; gap: 12px; margin: 14px 0; }
.savebar { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.hint { margin: -6px 0 14px; font-size: .82rem; color: var(--muted); }
.pop-grid{display:grid;grid-template-columns:minmax(0,420px) minmax(0,1fr);gap:18px;align-items:start}.popup-stage{background:#e5e7eb;border-radius:12px;padding:20px;display:flex;justify-content:center}.subscriber-table{overflow:auto}.subscriber-table table{width:100%;border-collapse:collapse}.subscriber-table td,.subscriber-table th{padding:12px;text-align:start;border-bottom:1px solid var(--border)}#stats{grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}@media(max-width:980px){.pop-grid{grid-template-columns:minmax(0,1fr)}}
.domain-table { overflow-x: auto; margin: 18px 0; }
.domain-table td { vertical-align: top; min-width: 100px; }
.domain-table td span, .domain-table small { overflow-wrap: anywhere; }
.domain-table small { display: block; color: var(--muted); margin-top: 6px; }
.domain-table .btn { margin: 4px; }

/* popup page (mockup/popup.html parity, 2026-11-09) */
.pp-grid { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 18px; align-items: start; }
.pp-preview-col { position: sticky; top: 76px; }
.pp-panel[hidden] { display: none; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: none; padding: 7px 14px; font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; color: var(--text-2); }
.seg button.on { background: var(--brand); color: #fff; }
.pp-stage { background: #e5e7eb; border-radius: var(--radius); padding: 16px; display: flex; justify-content: center; overflow: hidden; }
.pp-site { position: relative; width: 100%; max-width: 640px; height: 460px; background: #fff; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); transition: max-width .25s; }
.pp-site.mobile { max-width: 280px; height: 500px; }
.pp-site-head { height: 40px; background: #111827; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; color: #fff; font-weight: 800; font-size: .85rem; }
.pp-site-hero { height: 90px; background: linear-gradient(120deg, #fde68a, #fcd34d); display: grid; place-items: center; font-weight: 800; color: #78350f; }
.pp-site-prods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px; }
.pp-site.mobile .pp-site-prods { grid-template-columns: repeat(2, 1fr); }
.pp-site .sp { height: 78px; border-radius: 8px; display: grid; place-items: center; font-size: 26px; }
.pp-overlay { position: absolute; inset: 0; background: rgba(17,24,39,.55); display: grid; place-items: center; padding: 14px; }
.pp-overlay.hidden { display: none; }
.pp-pop { position: relative; width: 100%; max-width: 380px; border-radius: 16px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.35); display: flex; }
.pp-site.mobile .pp-pop { flex-direction: column; max-width: 240px; }
.pp-pop .pimg { width: 38%; background: linear-gradient(135deg, rgba(255,255,255,.25), rgba(255,255,255,.05)) center/cover no-repeat; display: grid; place-items: center; font-size: 40px; }
.pp-site.mobile .pp-pop .pimg { width: 100%; height: 70px; font-size: 30px; }
.pp-pop .pimg.none { display: none; }
.pp-pop .pbody { flex: 1; padding: 20px 16px; text-align: center; }
.pp-pop h4 { font-size: 1.1rem; margin: 0 0 4px; }
.pp-pop .sub { font-size: .8rem; margin-bottom: 10px; opacity: .9; }
.pp-pop .offer { display: inline-block; font-weight: 800; font-size: 1.5rem; margin-bottom: 8px; }
.pp-pop .pin { background: #fff; color: #111827; border-radius: 8px; padding: 8px 10px; font-size: .8rem; text-align: start; margin-bottom: 8px; border: 1px solid rgba(0,0,0,.1); }
.pp-pop .pbtn { display: block; padding: 9px; border-radius: 8px; font-weight: 800; font-size: .85rem; border: 0; width: 100%; font-family: inherit; cursor: pointer; }
.pp-pop .cons { font-size: .62rem; margin-top: 8px; opacity: .85; line-height: 1.4; }
.pp-pop .cons a { color: inherit; text-decoration: underline; }
.pp-pop .x { position: absolute; top: 8px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.25); color: #fff; display: grid; place-items: center; font-size: .8rem; cursor: pointer; border: 0; z-index: 1; }
.pp-pop .x.left { left: 8px; } .pp-pop .x.right { right: 8px; }
.pp-teaser { position: absolute; bottom: 14px; inset-inline-start: 0; padding: 8px 12px; border-radius: 0 12px 12px 0; color: #fff; font-weight: 800; font-size: .78rem; cursor: pointer; border: 0; font-family: inherit; display: none; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.pp-teaser.show { display: block; }
.clr { display: flex; align-items: center; gap: 8px; }
.clr input[type=color] { width: 40px; height: 36px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.sw-row .l { font-weight: 700; font-size: .9rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input[type=range] { flex: 1; }
.range-row b { min-width: 52px; text-align: center; }
.pp-drop { display: block; border: 2px dashed var(--border); border-radius: 10px; padding: 16px; text-align: center; color: var(--muted); cursor: pointer; }
.pp-drop.drag { border-color: var(--brand); color: var(--brand); }
.pp-toast { position: fixed; bottom: 56px; inset-inline-start: 50%; transform: translateX(50%); background: #111827; color: #fff; padding: 8px 18px; border-radius: 999px; font-size: .88rem; font-weight: 700; z-index: 60; opacity: 0; pointer-events: none; transition: .25s; }
.pp-toast.show { opacity: 1; }
@media (max-width: 980px) { .pp-grid { grid-template-columns: minmax(0, 1fr); } .pp-preview-col { position: static; order: -1; } }
/* newsletters (styles copied from mockup/newsletters.html and mockup/newsletter-edit.html, scoped to .nl) */
.nl .nl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.nl .nl-layout-sm { grid-template-columns: minmax(0, 1fr) 290px; }
.nl .nl-side .card + .card { margin-top: 16px; }
.nl .sum-row { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: .9rem; }
.nl .sum-row:last-child { border-bottom: 0; }
.nl .sum-row b { font-weight: 800; }
.nl .t-title { font-weight: 700; }
.nl .t-sub { font-size: .78rem; color: var(--muted); }
.nl .num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.nl .acts { display: flex; gap: 4px; white-space: nowrap; }
.nl .report-row > td { padding: 0; background: var(--surface-2); }
.nl .report-row:hover td { background: var(--surface-2); }
.nl .report { padding: 18px 20px; }
.nl .funnel { display: flex; flex-direction: column; gap: 8px; }
.nl .f-line { display: grid; grid-template-columns: 90px 1fr 120px; gap: 10px; align-items: center; font-size: .86rem; }
.nl .f-bar { height: 22px; background: #e3e9f2; border-radius: 6px; overflow: hidden; }
.nl .f-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #4b6a99); border-radius: 6px; }
.nl .link-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: .86rem; }
.nl .link-row span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nl .sales-box { background: var(--ok-bg); border: 1px solid var(--ok-line); border-radius: var(--radius-sm); padding: 14px; margin-top: 12px; }
.nl .sales-box .big { font-size: 1.6rem; font-weight: 800; color: var(--ok); }
.nl .nl-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.nl .nl-filters button { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 6px 14px; font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; color: var(--text-2); }
.nl .nl-filters button.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-head .nl-savebar { margin: 0; }
.nl .steps .step { cursor: pointer; }
.nl .pane { display: none; margin-top: 16px; } .nl .pane.active { display: block; }
.nl .nav-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.nl .seg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.nl .seg { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 2px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; background: #fff; }
.nl .seg.selected { border-color: var(--brand); background: var(--brand-2); }
.nl .seg.off { cursor: not-allowed; opacity: .6; }
.nl .seg input { margin-top: 5px; }
.nl .seg .n { font-weight: 800; font-size: .9rem; }
.nl .seg .d { font-size: .76rem; color: var(--muted); }
.nl .seg .cnt { margin-inline-start: auto; font-weight: 800; color: var(--brand); font-size: .85rem; white-space: nowrap; }
.nl .group-title { font-size: .78rem; font-weight: 800; color: var(--muted); margin: 14px 0 8px; }
.nl .count-box { text-align: center; }
.nl .count-box .big { font-size: 2.3rem; font-weight: 800; color: var(--brand); line-height: 1.2; }
.nl .nl-sticky { position: sticky; top: 80px; }
.nl .opt { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.nl .opt:last-child { border-bottom: 0; }
.nl .opt .t { flex: 1; font-size: .88rem; }
.nl .opt .t small { display: block; }
.nl .chips { display: flex; gap: 6px; flex-wrap: wrap; }
.nl .chip { border: 1px dashed var(--brand); background: var(--brand-2); color: var(--brand); border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 700; cursor: pointer; font-family: inherit; }
.nl .editor { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 14px; align-items: start; }
.nl .palette { display: flex; flex-direction: column; gap: 6px; }
.nl .pal-btn { display: flex; gap: 8px; align-items: center; padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px; background: #fff; font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; text-align: start; }
.nl .pal-btn:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-2); }
.nl .pal-btn.hl { border-color: var(--accent); background: var(--warn-bg); }
.nl .canvas { background: #e5e7eb; border-radius: var(--radius-sm); padding: 16px; }
.nl .mail { background: #fff; max-width: 600px; margin: 0 auto; border-radius: 8px; overflow: hidden; transition: max-width .2s; }
.nl .mail.mobile { max-width: 340px; }
.nl .mail-head { background: #111827; color: #facc15; padding: 16px; text-align: center; font-weight: 800; }
.nl .blk { position: relative; padding: 14px 18px; border: 2px solid transparent; }
.nl .blk:hover, .nl .blk:focus-within { border-color: var(--brand-line); }
.nl .blk .tools { display: none; position: absolute; top: 4px; inset-inline-start: 4px; gap: 4px; z-index: 2; }
.nl .blk:hover .tools, .nl .blk:focus-within .tools { display: flex; }
.nl .blk .tools button { border: 1px solid var(--border); background: #fff; border-radius: 6px; padding: 0 7px; cursor: pointer; font-size: .8rem; }
.nl .blk input, .nl .blk textarea { width: 100%; font: inherit; border: 1px dashed transparent; background: transparent; padding: 4px 6px; border-radius: 6px; }
.nl .blk input:hover, .nl .blk textarea:hover, .nl .blk input:focus, .nl .blk textarea:focus { border-color: var(--border); background: #fff; outline: none; }
.nl .blk .h-in { font-size: 1.3rem; font-weight: 800; text-align: center; }
.nl .blk textarea { min-height: 90px; resize: vertical; color: #374151; line-height: 1.8; }
.nl .blk .btn-mail { display: block; width: fit-content; margin: 0 auto; background: var(--brand); color: #fff; padding: 10px 26px; border-radius: 8px; font-weight: 800; }
.nl .blk .btn-mail input { color: #fff; text-align: center; font-weight: 800; width: 14em; }
.nl .blk .btn-mail input:focus { color: var(--text); }
.nl .blk .btn-mail input::placeholder { color: #e3e9f2; }
.nl .blk .sub-in { font-size: .8rem; margin-top: 6px; }
/* Coupon block in the editor: same dashed card the email shows. */
.nl .blk .coupon-box { border: 2px dashed var(--brand); border-radius: 10px; padding: 12px; text-align: center; background: var(--brand-2); display: grid; gap: 6px; }
.nl .blk .coupon-box .sub-in { text-align: center; font-weight: 700; font-size: .9rem; margin: 0; }
.nl .blk .coupon-code { font-family: Consolas, Menlo, monospace; font-size: 1.3rem; font-weight: 800; letter-spacing: 3px; text-align: center; color: var(--brand); max-width: 16em; margin: 0 auto; }
.nl .blk .err { color: #b91c1c; font-size: .78rem; }
.nl .blk hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.nl .blk .img-prev { display: block; max-width: 100%; max-height: 220px; margin: 0 auto 6px; border-radius: 8px; }
.nl .img-ph { height: 150px; border-radius: 8px; background: linear-gradient(135deg, var(--brand-line), #fde68a); display: grid; place-items: center; font-size: 3rem; margin-bottom: 6px; }
.nl .pgrid { display: grid; gap: 10px; }
.nl .pgrid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .nl .pgrid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nl .mail.mobile .pgrid.c3, .nl .mail.mobile .pgrid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nl .pcard { border: 1px solid var(--border); border-radius: 8px; padding: 8px; text-align: center; font-size: .8rem; }
.nl .thumb { height: 70px; border-radius: 6px; display: grid; place-items: center; font-size: 1.9rem; margin-bottom: 6px; background: var(--surface-2); overflow: hidden; }
.nl .thumb img { width: 100%; height: 100%; object-fit: cover; }
.nl .pcard .pn, .nl .prod .pn { font-weight: 700; line-height: 1.3; }
.nl .pcard .pp { color: var(--brand); font-weight: 800; margin-top: 2px; }
.nl .social .sl { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 6px; align-items: center; font-size: .8rem; margin-bottom: 4px; }
.nl .mail-foot { padding: 14px; text-align: center; font-size: .72rem; color: #6b7280; background: #f9fafb; }
.nl .empty-canvas { text-align: center; color: var(--muted); padding: 30px 10px; font-size: .9rem; }
.nl .modal-bg { position: fixed; inset: 0; background: rgba(17,24,39,.55); display: none; align-items: center; justify-content: center; z-index: 60; padding: 14px; }
.nl .modal-bg.open { display: flex; }
.nl .modal { background: #fff; border-radius: var(--radius); width: 100%; max-width: 760px; max-height: 92vh; display: flex; flex-direction: column; }
.nl .modal.nl-confirm { max-width: 460px; }
.nl .modal-h, .nl .modal-f { padding: 14px 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.nl .modal-h { border-bottom: 1px solid var(--border); } .nl .modal-f { border-top: 1px solid var(--border); }
.nl .modal-b { padding: 16px 18px; overflow-y: auto; }
.nl .prod-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.nl .prod { border: 2px solid var(--border); border-radius: 12px; padding: 10px; cursor: pointer; position: relative; background: #fff; text-align: start; font: inherit; }
.nl .prod.sel { border-color: var(--brand); background: var(--brand-2); }
.nl .prod .tick { position: absolute; top: 6px; inset-inline-start: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; display: none; place-items: center; font-size: .8rem; z-index: 1; }
.nl .prod.sel .tick { display: grid; }
.nl .prod .thumb { height: 84px; font-size: 2.3rem; }
.nl .prod .pn { font-size: .85rem; }
.nl .prod .pp { font-weight: 800; color: var(--brand); }
.nl .prod.out { opacity: .55; }
.nl .check { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); align-items: flex-start; font-size: .9rem; }
.nl .check:last-child { border-bottom: 0; }
.nl .check .ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; font-weight: 800; flex-shrink: 0; background: var(--surface-2); }
.nl .check .ic.ok { background: var(--ok-bg); color: var(--ok); } .nl .check .ic.warn { background: var(--warn-bg); color: var(--warn); }
.nl .seg-btns { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.nl .seg-btns button { border: 0; background: #fff; padding: 7px 14px; font: inherit; font-weight: 700; cursor: pointer; }
.nl .seg-btns button.active { background: var(--brand); color: #fff; }
.nl .nl-frame { display: block; width: 100%; max-width: 600px; height: 640px; margin: 0 auto; border: 0; background: #fff; border-radius: 8px; transition: max-width .2s; }
.nl .nl-frame.mobile { max-width: 340px; }
.nl .nl-toast { position: fixed; bottom: 52px; inset-inline-start: 50%; transform: translateX(50%); background: var(--ok-ink); color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 80; display: none; font-weight: 700; }
.nl .nl-toast.bad { background: #991b1b; }
@media (max-width: 980px) { .nl .nl-layout, .nl .nl-layout-sm { grid-template-columns: minmax(0, 1fr); } .nl .nl-sticky { position: static; } }
@media (max-width: 760px) { .nl .editor { grid-template-columns: minmax(0, 1fr); } .nl .palette { flex-direction: row; flex-wrap: wrap; } .nl .seg-grid { grid-template-columns: minmax(0, 1fr); } .nl .prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .nl .steps .step { min-width: 120px; } }
@media (max-width: 560px) { .nl .f-line { grid-template-columns: 70px 1fr 90px; } }

/* mockup parity: home, subscribers, domain, settings (2026-11-09) — copied from mockup/<page>.html, scoped */
.pg-later { color: var(--muted); }
.pg-home .kpi .hint, .pg-subs .kpi .hint { margin: 4px 0 0; }
.pg-home .welcome h1 { margin-bottom: 2px; }
.pg-home .check-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.pg-home .check-item:last-child { border-bottom: 0; }
.pg-home .check-item .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; background: var(--surface-2); border: 1px solid var(--border); flex-shrink: 0; }
.pg-home .check-item.done .n { background: var(--ok); color: #fff; border-color: var(--ok); }
.pg-home .check-item.current .n { background: var(--brand); color: #fff; border-color: var(--brand); }
.pg-home .check-item .t { flex: 1; min-width: 0; }
.pg-home .check-item .t b { display: block; }
.pg-home .check-item .t span { font-size: .82rem; color: var(--muted); }
.pg-home .check-item.done .t b { color: var(--text-2); text-decoration: line-through; text-decoration-color: var(--muted); }
.pg-home .delta:empty { display: none; }
.pg-kpi5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pg-kpi5 > .card { margin-top: 0; }
.pg-health { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.pg-health .h { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; background: var(--surface-2); min-width: 0; }
.pg-health .h .l { font-size: .8rem; color: var(--text-2); font-weight: 600; }
.pg-health .h .v { font-size: 1.3rem; font-weight: 800; margin: 2px 0 6px; }
.pg-home .feed { list-style: none; margin: 0; padding: 0; }
.pg-home .feed li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.pg-home .feed li:last-child { border-bottom: 0; }
.pg-home .feed .ic { width: 32px; height: 32px; border-radius: 10px; background: var(--brand-2); display: grid; place-items: center; flex-shrink: 0; }
.pg-home .feed .time { font-size: .78rem; color: var(--muted); }
.pg-home .limit-row { display: flex; justify-content: space-between; gap: 8px; font-size: .85rem; margin-bottom: 6px; }
.pg-two { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.pg-two > div > .card + .card { margin-top: 16px; }
@media (max-width: 1100px) { .pg-kpi5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 980px) { .pg-health { grid-template-columns: repeat(3, minmax(0, 1fr)); } .pg-two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .pg-kpi5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pg-kpi5 .kpi .value { font-size: 1.3rem; } }
@media (max-width: 480px) { .pg-health { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.pg-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.pg-kpis > .card { margin-top: 0; }
.pg-subs .kpi.hl { border-color: var(--ok-line); background: var(--ok-bg); }
.pg-subs .kpi.hl .value { color: var(--ok); }
.pg-ways { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.pg-ways .way { background: rgba(255,255,255,.7); border: 1px solid var(--info-line); border-radius: 10px; padding: 10px; font-size: .85rem; }
.pg-ways .way b { display: block; }
.pg-subs .tabs { margin-bottom: 14px; }
.pg-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.pg-toolbar input[type=text] { flex: 1; min-width: 180px; width: auto; }
/* Existing-tag chips under the manual-add tags box (same look as the newsletter chips). */
.pg-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: -4px; }
.pg-chip { border: 1px dashed var(--brand); background: var(--brand-2); color: var(--brand); border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 700; cursor: pointer; font-family: inherit; }
.pg-chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.pg-toolbar select { width: auto; min-width: 120px; }
.pg-person { display: flex; align-items: center; gap: 10px; }
.pg-subs .av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: .85rem; flex-shrink: 0; }
.pg-click { cursor: pointer; }
.pg-seg-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pg-seg-item { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; gap: 12px; align-items: center; background: #fff; min-width: 0; }
.pg-seg-item .n { font-weight: 800; }
.pg-seg-item .c { margin-inline-start: auto; text-align: end; font-weight: 800; color: var(--brand); white-space: nowrap; }
.pg-subs .group-title { font-size: .78rem; font-weight: 800; color: var(--muted); margin: 14px 0 8px; }
.pg-rule { display: grid; grid-template-columns: 1.3fr 1.1fr 1.3fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.pg-join { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; }
.pg-subs .seg-btns { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.pg-subs .seg-btns button { border: 0; background: #fff; padding: 5px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.pg-subs .seg-btns button.active { background: var(--brand); color: #fff; }
.pg-live { background: var(--brand-2); border: 1px solid var(--brand-line); border-radius: var(--radius-sm); padding: 14px; text-align: center; }
.pg-live .big { font-size: 2.2rem; font-weight: 800; color: var(--brand); }
.pg-drop { display: block; border: 2px dashed var(--brand-line); border-radius: var(--radius); background: var(--brand-2); text-align: center; padding: 30px 16px; cursor: pointer; }
.pg-drop:hover, .pg-drop.drag { background: #e3e9f2; }
.pg-drawer-bg { position: fixed; inset: 0; background: rgba(17,24,39,.45); z-index: 60; display: none; }
.pg-drawer-bg.open { display: block; }
.pg-drawer { position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: 100%; max-width: 420px; background: #fff; box-shadow: -8px 0 30px rgba(0,0,0,.15); z-index: 61; overflow-y: auto; display: none; }
.pg-drawer.open { display: block; }
.pg-drawer-h { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; align-items: center; }
.pg-drawer-b { padding: 18px 20px; }
.pg-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.pg-mini div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px; text-align: center; }
.pg-mini b { display: block; font-size: 1.05rem; } .pg-mini span { font-size: .72rem; color: var(--muted); }
.pg-tl { position: relative; padding-inline-start: 26px; }
.pg-tl::before { content: ""; position: absolute; inset-inline-start: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.pg-tl .tl-i { position: relative; margin-bottom: 16px; }
.pg-tl .dot { position: absolute; inset-inline-start: -26px; top: 0; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--brand); display: grid; place-items: center; font-size: .6rem; }
.pg-tl .t { font-weight: 700; font-size: .9rem; } .pg-tl .w { font-size: .76rem; color: var(--muted); }
@media (max-width: 980px) { .pg-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pg-seg-list { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .pg-ways { grid-template-columns: minmax(0, 1fr); } .pg-rule { grid-template-columns: 1fr 1fr; } .pg-toolbar select { flex: 1; } }
@media (max-width: 420px) { .pg-kpis { grid-template-columns: minmax(0, 1fr); } }

.pg-dom .step { cursor: pointer; }
.pg-dom .step.locked { cursor: not-allowed; opacity: .6; }
.pg-dom-input { display: flex; direction: ltr; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.pg-dom-input input { border: 0; border-radius: 0; direction: ltr; text-align: left; font-family: Consolas, monospace; flex: 1; }
.pg-dom-input input:focus { outline: none; }
.pg-dom-input .pfx { background: var(--surface-2); padding: 10px 12px; color: var(--muted); font-family: Consolas, monospace; border-inline-end: 1px solid var(--border); }
.pg-rec { display: flex; align-items: center; gap: 8px; direction: ltr; justify-content: flex-start; min-width: 0; }
.pg-rec code { word-break: break-all; background: var(--surface-2); border: 1px solid var(--border); padding: 3px 8px; border-radius: 6px; }
.pg-full { direction: ltr; text-align: left; overflow-wrap: anywhere; margin-top: 4px; }
.pg-dom .copy { padding: 4px 10px; font-size: .75rem; white-space: nowrap; }
.pg-dom .copy.copied { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.pg-dom .type-pill { font-family: Consolas, monospace; font-weight: 800; font-size: .78rem; background: var(--brand-2); color: var(--brand); padding: 2px 8px; border-radius: 6px; }
.pg-dom details { border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; margin-bottom: 10px; }
.pg-dom details summary { padding: 14px 16px; cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 10px; }
.pg-dom details summary::-webkit-details-marker { display: none; }
.pg-dom details summary::after { content: "▾"; margin-inline-start: auto; color: var(--muted); }
.pg-dom details[open] summary::after { content: "▴"; }
.pg-dom details .dbody { padding: 0 18px 16px; }
.pg-dom details ol { margin: 0; padding-inline-start: 22px; color: var(--text-2); }
.pg-dom details ol li { margin-bottom: 8px; }
.pg-scan { display: flex; gap: 14px; align-items: center; }
.pg-dom .pulse { width: 14px; height: 14px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 0 rgba(217,119,6,.5); animation: pg-pulse 1.6s infinite; flex-shrink: 0; }
.pg-dom .pulse.done { background: var(--ok); animation: none; }
@keyframes pg-pulse { 70% { box-shadow: 0 0 0 10px rgba(217,119,6,0); } 100% { box-shadow: 0 0 0 0 rgba(217,119,6,0); } }
.pg-dom .big-ok { font-size: 3rem; text-align: center; }
.pg-grow { flex: 1; min-width: 140px; }
.pg-wiz > .card + .card, .pg-wiz > .card + .alert { margin-top: 16px; }
@media (max-width: 760px) { .pg-dom .step { min-width: 120px; } .pg-rec { flex-wrap: wrap; } }

.pg-tabs { overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap; scrollbar-width: none; margin-bottom: 14px; }
.pg-tabs::-webkit-scrollbar { display: none; }
.pg-tabs button { white-space: nowrap; }
.pg-sw { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.pg-sw:last-child { border-bottom: 0; }
.pg-sw .t { flex: 1; min-width: 0; }
.pg-sw .t b { display: block; }
.pg-sw .t > span { font-size: .85rem; color: var(--text-2); }
.pg-set .choice { flex-direction: row; }
.pg-set .choice .body { flex: 1; min-width: 0; }
.pg-set .choice .body h3 { margin-bottom: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pg-set .pros { margin: 8px 0 0; padding: 0; list-style: none; font-size: .86rem; color: var(--text-2); }
.pg-set .pros li::before { content: "✔ "; color: var(--ok); font-weight: 800; }
.pg-set .pros.neutral li::before { content: "• "; color: var(--muted); }
.pg-sub { display: none; margin-top: 14px; padding: 16px; border: 1px dashed var(--brand-line); border-radius: var(--radius-sm); background: var(--surface-2); }
.pg-sub.active { display: block; }
.pg-addr { display: flex; direction: ltr; align-items: stretch; }
.pg-addr input { border-radius: 10px 0 0 10px; flex: 1; }
.pg-addr .suffix { padding: 10px 12px; background: #eef0f4; border: 1px solid var(--border); border-inline-start: 0; border-radius: 0 10px 10px 0; font-family: Consolas, monospace; font-size: .88rem; white-space: nowrap; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.pg-domain-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pg-domain-line code { background: #fff; border: 1px solid var(--border); padding: 4px 10px; border-radius: 8px; }
.pg-ex { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.pg-ex .ex { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; background: #fff; font-size: .82rem; }
.pg-num { display: inline-block; width: 74px !important; }
.pg-two-f { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pg-two-f .field { margin-bottom: 0; }
.pg-time { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pg-time input { width: 120px; }
.pg-savebar { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.pg-savebar .small { margin-inline-end: auto; }
.pg-set [data-st-panel] > .card + .card { margin-top: 16px; }
@media (max-width: 760px) { .pg-two-f, .pg-ex { grid-template-columns: minmax(0, 1fr); } .pg-addr .suffix { font-size: .78rem; padding: 10px 8px; } }

/* channels: aligned with the parity pages */
.channels .channel { display: flex; flex-direction: column; }
.channels .channel .btn { align-self: flex-start; margin-top: auto; }

.pg-home .check-item.paused .n { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.pg-home .check-item.paused .t span { color: var(--warn-ink); }

/* Email designer (2026-11-13, helpers/emailDesign.js): the canvas reads the theme through --m-* variables set by
   newsletters.js; drop lines show only while dragging; block options sit under each block. */
.nl .mail { background: var(--m-card, #fff); }
.nl .mail-head { background: var(--m-head-bg, #111827); color: var(--m-head-fg, #facc15); }
.nl .mail-head.none { background: transparent; color: var(--muted); font-weight: 600; font-size: .78rem; padding: 6px; border-bottom: 1px dashed var(--border); }
.nl .mail-head .logo { display: inline-block; height: 44px; width: auto; max-width: 220px; }
.nl .blk .h-in { color: var(--m-heading, #111827); }
.nl .blk .h-in.sz-md { font-size: 1.1rem; } .nl .blk .h-in.sz-sm { font-size: .98rem; }
.nl .blk textarea, .nl .blk .list-blk input { color: var(--m-text, #374151); }
.nl .blk .btn-mail { background: var(--m-accent, var(--brand)); border-radius: var(--m-radius, 8px); }
.nl .blk .btn-wrap .btn-mail { display: inline-block; margin: 0; }
.nl .blk .btn-mail.full { display: block; width: auto; }
.nl .blk .btn-mail.full input { width: 100%; }
.nl .blk .coupon-box { border-color: var(--m-accent, var(--brand)); }
.nl .blk .coupon-code { color: var(--m-accent, var(--brand)); }
.nl .blk .img-prev { border-radius: var(--m-radius, 8px); }
.nl .blk .tools .grip { cursor: grab; letter-spacing: -1px; }
.nl .blk-opts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; opacity: 0; transition: opacity .15s; }
.nl .blk:hover > div > .blk-opts, .nl .blk:focus-within > div > .blk-opts, .nl .blk:hover > .blk-opts, .nl .blk:focus-within .blk-opts { opacity: 1; }
.nl .mini-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.nl .mini-seg button { border: 0; background: none; font: inherit; font-size: .75rem; font-weight: 700; padding: 3px 9px; cursor: pointer; color: var(--muted); }
.nl .mini-seg button.active { background: var(--brand-2); color: var(--brand); }
.nl .mini-seg button + button { border-inline-start: 1px solid var(--border); }
.nl .drop { height: 4px; margin: 0 18px; border-radius: 4px; transition: height .12s, background .12s; }
body.nl-dragging .nl .drop { height: 14px; background: var(--brand-2); outline: 1px dashed var(--brand-line); }
body.nl-dragging .nl .drop.over { height: 30px; background: var(--brand-line); }
.nl .spacer-prev { background: repeating-linear-gradient(45deg, transparent 0 6px, var(--brand-2) 6px 12px); border-radius: 6px; }
.nl .list-blk { display: grid; gap: 4px; }
.nl .list-blk .li { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 4px; align-items: center; }
.nl .list-blk .mark { color: var(--m-accent, var(--brand)); font-weight: 800; text-align: center; }
.nl .list-blk .x { border: 0; background: none; color: var(--muted); cursor: pointer; }
.nl .video-blk { position: relative; }
.nl .video-blk .play { position: absolute; top: 60px; inset-inline-start: 50%; transform: translateX(50%); width: 52px; height: 52px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; font-size: 1.3rem; pointer-events: none; }
.nl .cols-blk { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.nl .mail.mobile .cols-blk { grid-template-columns: minmax(0, 1fr); }
.nl .cols-blk .col { border: 1px dashed var(--border); border-radius: 8px; padding: 6px; min-width: 0; }
.nl .blk.inner { padding: 6px 8px; }
.nl .col-add { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.nl .col-add .btn { font-size: .72rem; padding: 2px 8px; }
.nl .nl-theme .t-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.nl .nl-theme .preset { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 4px 10px 4px 6px; font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.nl .nl-theme .preset.active { border-color: var(--brand); background: var(--brand-2); }
.nl .nl-theme .preset .sw { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.1); }
.nl .nl-theme .t-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.nl .nl-theme .t-colors { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 12px; }
.nl .nl-theme .t-color { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; margin: 0; cursor: pointer; }
.nl .nl-theme .t-color input { width: 30px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: none; cursor: pointer; }
@media (max-width: 760px) { .nl .nl-theme .t-grid { grid-template-columns: minmax(0, 1fr); } .nl .blk-opts { opacity: 1; } }
.nl .live-blk { border: 2px dashed var(--m-accent, var(--brand)); border-radius: var(--m-radius, 8px); padding: 14px; text-align: center; background: var(--brand-2); }
.nl .live-blk b { color: var(--m-accent, var(--brand)); }
.nl .pal-btn.live { border-style: dashed; }
/* Automation message designer: full-screen over the automation editor (helpers/automationsViews.js). */
.au-designer { position: fixed; inset: 0; z-index: 60; background: var(--bg, #f5f6fa); overflow-y: auto; }
.au-designer-bar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--border); }
.au-designer-bar .spacer { flex: 1; }
.au-designer .ad-body { max-width: 1180px; margin: 16px auto; padding: 0 16px; }
@media (max-width: 600px) { .au-designer-bar { padding: 10px 12px; } .au-designer .ad-body { padding: 0 10px; } }
/* Template library (designer «📚 القوالب»): live thumbnails of the real email, scaled down. */
.tpl-modal .tpl-dialog { max-width: 1040px; width: calc(100% - 24px); }
.tpl-modal .tpl-tabs { flex-wrap: wrap; margin-bottom: 10px; }
.tpl-modal .tpl-save { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.tpl-modal .tpl-save input { flex: 1; min-width: 200px; }
.tpl-modal .tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; max-height: 62vh; overflow-y: auto; padding: 2px; }
.tpl-modal .tpl-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.tpl-modal .tpl-frame { height: 320px; overflow: hidden; position: relative; background: #f3f4f6; }
.tpl-modal .tpl-thumb { width: 640px; height: 900px; border: 0; position: absolute; top: 0; left: 50%; transform: translateX(-50%) scale(.4); transform-origin: top center; pointer-events: none; }
.tpl-modal .tpl-meta { display: flex; gap: 6px; align-items: center; padding: 8px 10px; border-top: 1px solid var(--border); }
.tpl-modal .tpl-meta b { flex: 1; font-size: .85rem; }
/* Designer v2 blocks on the canvas (hero, band, cards, gallery) and the header options. */
.nl .mail-strip { background: var(--m-accent, var(--brand)); color: #fff; font-size: .72rem; font-weight: 700; text-align: center; padding: 5px; }
.nl .mail-head.clean { background: var(--m-card, #fff); color: var(--m-heading, #111827); border-bottom: 1px solid var(--border); }
.nl .blk .eyebrow-in { font-size: .72rem; font-weight: 800; letter-spacing: 1px; color: var(--m-accent, var(--brand)); }
.nl .blk .h-in.sz-xl { font-size: 1.7rem; }
.nl .blk .btn-mail.outline { background: transparent; border: 2px solid var(--m-accent, var(--brand)); }
.nl .blk .btn-mail.outline input { color: var(--m-accent, var(--brand)); }
.nl .hero-blk .img-prev, .nl .hero-blk .img-ph { border-radius: 0; max-height: none; width: 100%; }
.nl .hero-area { padding: 14px; border-radius: 0 0 8px 8px; display: grid; gap: 4px; }
.nl .hero-area input, .nl .hero-area textarea, .nl .band-blk input, .nl .band-blk textarea { color: inherit; }
.nl .hero-area .h-in { font-size: 1.4rem; }
.nl .hero-area .btn-mail { margin: 6px auto 0; }
.nl .band-blk { padding: 12px; border-radius: 8px; }
.nl .band-blk .blk.inner { border-color: rgba(255,255,255,.25); }
.nl .cards-blk { display: grid; gap: 8px; }
.nl .cards-blk.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .nl .cards-blk.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nl .mail.mobile .cards-blk { grid-template-columns: minmax(0, 1fr); }
.nl .card-in { border: 1px solid var(--border); border-radius: var(--m-radius, 8px); padding: 8px; position: relative; min-width: 0; }
.nl .card-in .num { color: var(--m-accent, var(--brand)); font-size: 1.3rem; }
.nl .card-in .x, .nl .g-in .x { position: absolute; top: 4px; inset-inline-start: 4px; border: 0; background: #fff; border-radius: 6px; cursor: pointer; color: var(--muted); }
.nl .card-in textarea { min-height: 54px; }
.nl .gallery-blk { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.nl .gallery-blk.feature .g-in:first-child { grid-column: 1 / -1; }
.nl .g-in { position: relative; min-width: 0; }
.nl .g-in .img-prev { max-height: 160px; width: 100%; object-fit: cover; }
.nl .blk .hero-area .h-in, .nl .blk .hero-area textarea, .nl .blk .hero-area .eyebrow-in, .nl .blk .band-blk .h-in, .nl .blk .band-blk textarea, .nl .blk .band-blk .eyebrow-in, .nl .blk .band-blk .list-blk input { color: inherit; }
.nl .blk .hero-area input::placeholder, .nl .blk .hero-area textarea::placeholder, .nl .blk .band-blk input::placeholder, .nl .blk .band-blk textarea::placeholder { color: inherit; opacity: .6; }
/* Popup templates (helpers/popupTemplates.js): layouts in the live preview and the template gallery cards. */
.pp-tpl-cta { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.pp-pop.L-top { flex-direction: column; max-width: 300px; } .pp-pop.L-top .pimg { width: 100%; height: 120px; }
.pp-pop.L-none .pimg, .pp-pop.L-cover .pimg { display: none; }
.pp-pop.L-cover { background-size: cover !important; background-position: center !important; }
.pp-pop.L-cover > :not(.pimg):not(.x) { background: rgba(0,0,0,.55); }
.pp-tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; max-height: 64vh; overflow-y: auto; }
.pp-tpl-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #f3f4f6; display: flex; flex-direction: column; }
.pp-mini { display: flex; min-height: 150px; margin: 12px; border-radius: 12px; overflow: hidden; background-size: cover; background-position: center; box-shadow: 0 8px 20px rgba(0,0,0,.15); }
.pp-mini.L-top { flex-direction: column; } .pp-mini.L-top .pp-mini-img { width: 100%; height: 80px; }
.pp-mini-img { width: 38%; background-size: cover; background-position: center; flex: none; }
.pp-mini-body { flex: 1; padding: 14px 10px; display: grid; gap: 5px; text-align: center; align-content: center; }
.pp-mini.L-cover .pp-mini-body { background: rgba(0,0,0,.55); color: #fff; }
.pp-mini-body b { font-size: .9rem; line-height: 1.4; } .pp-mini-body span { font-size: .72rem; opacity: .9; line-height: 1.5; }
.pp-mini-body i { font-style: normal; font-weight: 800; font-size: .75rem; border-radius: 6px; padding: 5px; margin-top: 4px; }
.pp-tpl-card .tpl-meta { display: flex; gap: 6px; align-items: center; padding: 8px 10px; background: #fff; border-top: 1px solid var(--border); }
.pp-tpl-card .tpl-meta b { flex: 1; font-size: .85rem; }
/* The template galleries also open outside the newsletter page (popup page): the same modal, unscoped. */
.tpl-modal.modal-bg { position: fixed; inset: 0; background: rgba(17,24,39,.55); display: none; align-items: center; justify-content: center; z-index: 60; padding: 14px; }
.tpl-modal.modal-bg.open { display: flex; }
.tpl-modal .modal { background: #fff; border-radius: 16px; width: 100%; max-height: calc(100dvh - 28px); display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.tpl-modal .modal-h { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.tpl-modal .modal-b { padding: 14px 18px; overflow: auto; }
.tpl-modal .spacer { flex: 1; }

/* ---------- designer quality round (2026-11-13): web font, header links, footer icons, minimal products, split ---------- */
@font-face { font-family: 'Readex Pro'; font-style: normal; font-weight: 200 700; font-display: swap; src: url(/fonts/readex-pro.woff2) format('woff2'); }
.nl .mail-head.has-nav { padding-bottom: 8px; }
.nl .mail-head.clean.has-nav { border-bottom: 0; }
.nl .mail-nav { background: var(--m-head-bg, #111827); color: var(--m-head-fg, #facc15); text-align: center; padding: 0 12px 12px; font-size: .78rem; font-weight: 700; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; }
.nl .mail-nav.clean { background: var(--m-card, #fff); color: var(--m-heading, #111827); border-bottom: 1px solid var(--border); }
.nl .social-icons { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 2px 0 10px; }
.nl .social-icons img { width: 24px; height: 24px; display: block; }
.nl .pcard.minimal { border: 0; padding: 4px; }
.nl .pcard.minimal .thumb { border-radius: var(--m-radius, 8px); background: #f3f4f6; }
.nl .pcard.minimal .pn { font-weight: 400; color: var(--m-heading, #111827); margin-top: 6px; }
.nl .pcard.minimal .pp { color: var(--m-heading, #111827); }
.nl .pcard.minimal::after { content: 'تسوّق الآن'; display: block; margin-top: 4px; color: var(--m-accent, #4f46e5); font-weight: 700; text-decoration: underline; font-size: .72rem; }
.nl .split-blk { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: center; }
.nl .split-blk.left .split-pic { order: 2; }
.nl .split-pic .img-prev, .nl .split-pic .img-ph { width: 100%; border-radius: var(--m-radius, 8px); }
.nl .split-words { display: grid; gap: 6px; }
.nl .split-words input, .nl .split-words textarea { text-align: right; }
.nl .mail.mobile .split-blk { grid-template-columns: minmax(0, 1fr); }
.nl .mail.mobile .split-blk.left .split-pic { order: 0; }
.nl .nl-theme .t-more { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.nl .nl-theme .t-more summary { cursor: pointer; font-weight: 700; font-size: .85rem; }
.nl .nl-theme .t-sub { margin-top: 10px; }
.nl .nl-theme .t-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.nl .nl-theme .t-nav-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 4px; }
.nl .nl-theme .t-nav-row .err { grid-column: 1 / -1; }
.nl .nl-theme .t-social { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; margin-top: 6px; }
.nl .nl-theme .t-social .sl { display: grid; grid-template-columns: 20px 70px minmax(0, 1fr); gap: 6px; align-items: center; font-size: .8rem; }
.nl .nl-theme .t-social .sl .err { grid-column: 1 / -1; }
@media (max-width: 760px) { .nl .nl-theme .t-nav, .nl .nl-theme .t-social { grid-template-columns: minmax(0, 1fr); } .nl .split-blk { grid-template-columns: minmax(0, 1fr); } .nl .split-blk.left .split-pic { order: 0; } }
/* Canvas: a coupon inside a colour section reads in the section's own ink (the email does the same); the footer
   carries a button that opens the footer accounts in the theme panel. */
.nl .band-blk .coupon-box { background: transparent; border-color: currentColor; color: inherit; }
.nl .band-blk .coupon-box .small, .nl .band-blk .coupon-box input, .nl .band-blk .coupon-box .coupon-code { color: inherit; background: transparent; }
.nl .band-blk .coupon-box input::placeholder { color: inherit; opacity: .6; }
.nl .mail-foot .foot-edit { margin: 2px 0 6px; font: inherit; font-size: .72rem; font-weight: 700; color: inherit; background: transparent; border: 1px dashed currentColor; border-radius: 999px; padding: 3px 12px; cursor: pointer; }
.nl .mail-foot .foot-edit:hover { background: rgba(127,127,127,.12); }
.nl .nl-theme .t-sub .row { flex-wrap: wrap; align-items: center; }
.nl .nl-theme .t-sub .row select { width: auto; min-width: 0; flex: 0 0 auto; padding-block: 4px; }
/* Domain page: «فصل الدومين» on the final screen, folded so it is findable but never the first thing clicked. */
.dm-off { margin-top: 18px; text-align: start; border-top: 1px solid var(--border); padding-top: 12px; }
.dm-off summary { cursor: pointer; font-weight: 700; font-size: .85rem; color: var(--muted); }
.dm-off .btn.danger { color: #b91c1c; border-color: #fecaca; }
.dm-off .btn.danger:hover { background: #fef2f2; }

/* ---------- First-run setup wizard (/setup, assets/setup-page.js, plan 17 § Phase 0) ----------
   Full screen without the sidebar: a numbered stepper across the top, the step in a card, a tip beside it. */
body[data-page="setup"] { background: var(--bg); }
.setup { max-width: 1180px; margin: 0 auto; padding: 20px max(16px, env(safe-area-inset-left, 0px)) 48px; display: grid; gap: 22px; }
.setup-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.setup-title { font-weight: 700; font-size: 17px; margin-inline-end: auto; }
.setup-skip-all { color: var(--text-2); }
.setup-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; counter-reset: s; }
.setup-steps li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--muted); min-width: 0; }
.setup-steps .n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--surface-2); color: var(--text-2); }
.setup-steps .t { display: grid; min-width: 0; line-height: 1.35; }
.setup-steps .t b { font-size: 14px; color: var(--text); }
.setup-steps .t small { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setup-steps li.on { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy) inset; }
.setup-steps li.on .n { background: var(--navy); color: #fff; }
.setup-steps li.done .n { background: var(--ok); color: #fff; }
.setup-body { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.setup-main { padding: clamp(20px, 3vw, 34px); display: grid; gap: 16px; }
.setup-main h1 { margin: 0; font-size: clamp(22px, 2.6vw, 30px); }
.su-count { margin: 0; font-size: 13px; font-weight: 600; color: var(--olive); }
.su-sub { margin: -6px 0 0; color: var(--text-2); max-width: 60ch; }
.su-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-top: 8px; border-top: 1px solid var(--border); }
.su-actions .su-back { margin-inline-start: auto; }
.su-skip { background: transparent; border-color: transparent; color: var(--text-2); }
.su-tip { padding: 20px; display: grid; gap: 8px; background: var(--surface-2); }
.su-tip h3 { margin: 0; font-size: 16px; }
.su-tip p { margin: 0; color: var(--text-2); }
.su-field { display: grid; gap: 6px; }
.su-field > span:first-child { font-weight: 600; }
.su-field input:not([type=color]) { width: 100%; }
.su-brand { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.su-brand-info { display: grid; gap: 14px; flex: 1; min-width: 220px; }
.su-logo { width: 120px; height: 120px; object-fit: contain; border-radius: var(--radius); border: 1px solid var(--border); background: #fff; padding: 10px; }
.su-logo.empty { display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; }
.su-logo-box { display: grid; justify-items: center; gap: 2px; width: 150px; text-align: center; }
.su-logo-box small { font-size: 12px; line-height: 1.5; }
input#su-color { width: 52px; height: 40px; padding: 2px; border-radius: 10px; cursor: pointer; flex: none; }
.su-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.su-chips li { padding: 3px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; }
.su-history { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; margin: 0; }
.su-history legend { font-weight: 700; padding: 0 6px; }
.su-choice { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.su-choice small { grid-column: 2; color: var(--text-2); }
.su-choice.on { border-color: var(--navy); background: var(--surface-2); }
.su-records summary { cursor: pointer; font-weight: 600; }
.su-recs { display: grid; gap: 10px; margin-top: 10px; }
.su-rec { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; display: grid; gap: 10px; background: #fff; }
.su-rec-h { display: flex; align-items: center; gap: 8px; }
.su-pill { font-family: var(--mono); font-weight: 800; font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 6px; }
.su-rec-p { font-size: 13px; font-weight: 600; min-width: 0; }
.su-rec-req { margin-inline-start: auto; flex: none; font-size: 12px; color: var(--text-2); }
.su-rec-req.on { color: var(--navy); font-weight: 700; }
.su-rec-f { display: grid; gap: 4px; min-width: 0; }
.su-rec-l { font-size: 12px; color: var(--text-2); }
.su-rec-v { display: flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 6px 6px 6px 10px; min-width: 0; direction: ltr; }
.su-rec-v code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; text-align: left; }
.su-rec-f > small { overflow-wrap: anywhere; text-align: left; }
.su-copy { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 7px; background: #fff; color: var(--text-2); cursor: pointer; }
.su-copy:hover { color: var(--navy); border-color: var(--navy); }
.su-copy.done { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }
.su-guide { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; display: grid; gap: 10px; }
.su-guide h3 { margin: 0; font-size: 15px; }
.su-guide-note { margin: 0; font-size: 13px; color: var(--text-2); }
.su-guide-note.found { color: var(--ok-ink); background: var(--ok-bg); border: 1px solid var(--ok-line); border-radius: 8px; padding: 8px 12px; }
.su-guide-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.su-guide-tab { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; background: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text); }
.su-guide-tab:hover { border-color: var(--navy); }
.su-guide-tab.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.su-guide-tab:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.su-guide-panel { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); padding: 14px 16px; }
.su-guide-panel h4 { margin: 0 0 10px; font-size: 14px; }
.su-steps-list { margin: 0; padding: 0; list-style: none; counter-reset: su-step; display: grid; gap: 10px; }
.su-steps-list li { counter-increment: su-step; display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.su-steps-list li::before { content: counter(su-step); width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; margin-top: 2px; }
.su-steps-list .mono { font-family: var(--mono); background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
.su-flow { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.su-flow small { display: block; color: var(--text-2); }
.su-preview iframe { width: 100%; height: 520px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.su-tpls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.su-tpl { display: grid; gap: 6px; padding: 8px; border: 2px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; font: inherit; text-align: start; }
.su-tpl[aria-pressed="true"] { border-color: var(--navy); box-shadow: 0 0 0 3px var(--surface-2); }
.su-tpl-name { font-weight: 600; font-size: 13.5px; }
.su-mini { border-radius: 10px; padding: 12px; display: grid; gap: 4px; min-height: 150px; align-content: end; font-size: 12px; overflow: hidden; }
.su-mini-img { height: 60px; border-radius: 6px; background-size: cover; background-position: center; margin-bottom: 4px; }
.su-mini b { font-size: 13.5px; }
.su-mini i { font-style: normal; justify-self: start; padding: 3px 10px; border-radius: 6px; font-weight: 600; }
.setup-modal { position: fixed; inset: 0; background: rgba(15, 35, 64, .45); display: grid; place-items: center; padding: 16px; z-index: 50; }
.setup-modal .card { max-width: 440px; padding: 24px; display: grid; gap: 12px; }
.setup-modal h3 { margin: 0; }
@media (max-width: 960px) { .setup-steps .t small { display: none; } .setup-body { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .setup-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); } .setup-steps li { justify-content: center; padding: 8px; } .setup-steps .t { display: none; } .su-tpls { grid-template-columns: repeat(2, minmax(0, 1fr)); } .su-flow { grid-template-columns: auto 1fr; } .su-flow .btn { grid-column: 1 / -1; } }
.setup .su-field input:not([type=color]), .setup #su-root { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font: inherit; background: var(--surface); color: var(--text); min-width: 0; }
.setup .su-field input:not([type=color]):focus, .setup #su-root:focus { outline: 2px solid var(--navy); outline-offset: 1px; }
.setup #su-root { flex: 1; }
.setup-main > .btn { justify-self: start; }
/* Email quality grade in the newsletter review (helpers/emailQuality.js) */
.nl-quality { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 12px; background: var(--surface-2); }
.nl-q-grade { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; font-weight: 700; color: #fff; background: var(--muted); }
.nl-quality.g-A .nl-q-grade { background: var(--ok); } .nl-quality.g-B .nl-q-grade { background: #65a30d; }
.nl-quality.g-C .nl-q-grade { background: var(--warn); } .nl-quality.g-D .nl-q-grade { background: var(--bad); }
.nl-q-parts { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 13px; color: var(--text-2); margin: 2px 0; }
/* AI writer in the newsletter editor (helpers/aiWriter.js) */
.nl-ai { border-color: var(--brand-line, var(--border)); }
.nl-ai-row { align-items: stretch; gap: 10px; }
.nl-ai-row textarea { flex: 1; min-width: 0; resize: vertical; }
.nl-ai-result { margin-top: 12px; padding: 14px; border-radius: var(--radius); background: var(--surface-2); display: grid; gap: 6px; }
.nl-ai-result h3, .nl-ai-result p { margin: 0; }
.nl-ai-subjects { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.nl-ai-subjects .chip { font: inherit; font-size: 13.5px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.nl-ai-subjects .chip:hover { border-color: var(--navy); }
.linklike { font: inherit; background: none; border: 0; padding: 0; color: var(--olive); cursor: pointer; text-decoration: underline; }
.blk { position: relative; }
.nl-ai-pop { position: absolute; z-index: 20; inset-inline-end: 8px; top: 40px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 8px; display: grid; gap: 4px; min-width: 150px; }
.nl-ai-pop button { font: inherit; text-align: start; background: none; border: 0; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.nl-ai-pop button:hover { background: var(--surface-2); }
@media (max-width: 640px) { .nl-ai-row { flex-direction: column; } }
/* Custom flows «مساراتك الخاصة» (assets/custom-flows.js) */
.cf-card { display: grid; gap: 6px; align-content: start; }
.cf-card p { margin: 0; }
.cf-empty { border-style: dashed; }
#cf-modal { position: fixed; inset: 0; background: rgba(17,24,39,.55); display: none; align-items: center; justify-content: center; z-index: 60; padding: 14px; }
#cf-modal.open { display: flex; }
.cf-modal { background: var(--surface); border-radius: var(--radius); width: min(1180px, 100%); height: calc(100vh - 28px); display: flex; flex-direction: column; box-shadow: var(--shadow); }
.cf-modal .modal-h, .cf-modal .modal-f { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.cf-modal .modal-f { border-bottom: 0; border-top: 1px solid var(--border); }
.cf-modal .modal-b { padding: 16px 18px; overflow: auto; display: grid; gap: 12px; }
.cf-modal .spacer { flex: 1; }
.cf-modal input, .cf-modal textarea, .cf-modal select { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); min-width: 0; }
.cf-modal .row select, .cf-modal .row input[type=number], .cf-modal .row input[type=date] { width: auto; }
.cf-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 4px 0; }
.cf-kpi { background: var(--bg, #f8fafc); border-radius: 8px; padding: 6px 8px; display: grid; }
.cf-kpi b { font-size: 1rem; } .cf-kpi span { font-size: .72rem; color: var(--muted); }
.cf-kpi.strong { background: #ecfccb; } .cf-kpi.strong b { color: #3f6212; }
/* v2 canvas (plan 18 B): a vertical tree on a dotted board, branches side by side. */
#cf-modal .modal-b { display: flex; flex-direction: column; }
#cf-modal .modal-b > * { flex: none; }
.cf-canvas { background: radial-gradient(circle, #d6dbe4 1px, transparent 1.2px) 0 0 / 18px 18px, var(--bg, #f8fafc); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 12px 28px; display: flex; flex-direction: column; align-items: center; }
.cf-condition .cf-ico { font-weight: 800; color: #86198f; }
.cf-col { display: flex; flex-direction: column; align-items: center; width: 100%; min-width: 0; }
.cf-node { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 1px 2px rgba(15,35,64,.06); }
.cf-node-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; }
.cf-node-h .cf-sum { flex: 1; font-weight: 700; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--bg, #f1f5f9); flex: none; }
.cf-email .cf-ico { background: #e0e7ff; } .cf-wait .cf-ico { background: #fef3c7; } .cf-tag .cf-ico { background: #dcfce7; } .cf-condition .cf-ico { background: #fae8ff; }
.cf-trigger { border-color: var(--navy, #0f2340); } .cf-trigger .cf-ico { background: var(--navy, #0f2340); color: #fff; } .cf-trigger .cf-node-h { cursor: default; }
.cf-node-b { padding: 0 12px 12px; display: grid; gap: 8px; }
.cf-x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .9rem; padding: 2px 6px; border-radius: 6px; }
.cf-x:hover { background: #fee2e2; color: #b91c1c; }
.cf-counts { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 12px 10px; }
.cf-count { font-size: .72rem; background: var(--bg, #f1f5f9); border-radius: 999px; padding: 2px 8px; color: var(--text-2, #475569); }
.cf-count.live { background: #dbeafe; color: #1d4ed8; font-weight: 700; } .cf-count.money { background: #ecfccb; color: #3f6212; font-weight: 700; }
.cf-link { position: relative; display: flex; flex-direction: column; align-items: center; padding: 4px 0; }
.cf-link::before { content: ''; width: 2px; height: 14px; background: #cbd5e1; }
.cf-add { width: 26px; height: 26px; border-radius: 50%; border: 1px dashed #94a3b8; background: var(--surface); cursor: pointer; font-weight: 700; color: #475569; line-height: 1; }
.cf-add:hover, .cf-add:focus-visible { border-style: solid; border-color: var(--navy, #0f2340); color: var(--navy, #0f2340); }
.cf-menu { position: absolute; top: 44px; z-index: 5; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 28px rgba(15,35,64,.18); display: grid; padding: 4px; min-width: 170px; }
.cf-menu button { border: 0; background: none; text-align: start; padding: 8px 10px; border-radius: 8px; font: inherit; cursor: pointer; }
.cf-menu button:hover { background: var(--bg, #f1f5f9); }
.cf-branches { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; margin-top: 8px; }
.cf-branch { border-top: 2px solid; padding-top: 6px; min-width: 0; }
.cf-branch.yes { border-color: #22c55e; } .cf-branch.no { border-color: #f43f5e; }
.cf-branch-h { text-align: center; font-weight: 800; font-size: .8rem; margin-bottom: 2px; }
.cf-branch.yes .cf-branch-h { color: #15803d; } .cf-branch.no .cf-branch-h { color: #be123c; }
.cf-end { font-size: .72rem; color: var(--muted); padding: 2px 10px; border-radius: 999px; background: var(--surface); border: 1px dashed var(--border); }
.cf-ai { display: grid; gap: 6px; padding: 12px; border-radius: 12px; background: linear-gradient(135deg, #f5f3ff, #eef2ff); border: 1px solid #ddd6fe; }
.cf-ai .row { gap: 8px; align-items: stretch; } .cf-ai textarea { flex: 1; resize: vertical; }
.cf-code { margin: 0; padding: 10px; background: #0f172a; color: #e2e8f0; border-radius: 8px; font-size: .75rem; white-space: pre-wrap; word-break: break-all; }
@media (max-width: 720px) { .cf-branches { grid-template-columns: 1fr; } .cf-ai .row { flex-direction: column; } .cf-kpis { grid-template-columns: repeat(2, 1fr); } }
/* Team tab (helpers/team.js) */
.tm-invite { gap: 8px; flex-wrap: wrap; }
.tm-invite input { flex: 1; min-width: 200px; }
.tm-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--border); }
.tm-row small { display: block; color: var(--text-2); }
@media (max-width: 560px) { .tm-row { grid-template-columns: 1fr; } }

/* «مساعد يوصل» (dashboard/assets/agent.js): a side panel over the designer, newsletter and automation messages alike. */
.agent { position: fixed; inset-block: 12px; inset-inline-end: 12px; width: min(380px, calc(100vw - 24px)); z-index: 1200; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border, #e5e7eb); border-radius: 16px; box-shadow: 0 18px 48px rgba(15, 35, 64, .22); overflow: hidden; }
.agent[hidden] { display: none; }
.agent-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border, #e5e7eb); background: var(--brand-2, #eef2f7); }
.agent-h .spacer { flex: 1; }
.agent-log { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.agent-msg { max-width: 92%; padding: 9px 12px; border-radius: 14px; font-size: .9rem; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.agent-msg.me { align-self: flex-start; background: var(--brand, #0f2340); color: #fff; border-end-start-radius: 4px; }
.agent-msg.bot { align-self: flex-end; background: #f3f4f6; color: #111827; border-end-end-radius: 4px; }
.agent-msg.thinking { color: var(--muted, #64748b); animation: agent-pulse 1.2s ease-in-out infinite; }
.agent-msg.err { background: #fef2f2; color: #991b1b; }
.agent-extra { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.agent-extra .warn { color: #92400e; }
.agent-extra .muted { color: var(--muted, #64748b); }
.agent-extra .btn { align-self: flex-start; margin-top: 4px; }
.agent-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; }
.agent-chips .chip { border: 1px dashed var(--brand, #0f2340); background: var(--brand-2, #eef2f7); color: var(--brand, #0f2340); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
.agent-chips .chip:disabled { opacity: .5; cursor: default; }
.agent-form { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border, #e5e7eb); }
.agent-form textarea { flex: 1; resize: none; min-height: 44px; font: inherit; font-size: .9rem; padding: 8px 10px; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; }
.agent-note { margin: 0; padding: 0 14px 12px; color: var(--muted, #64748b); }
.blk.agent-sel { outline: 2px dashed var(--brand, #0f2340); outline-offset: 2px; }
@keyframes agent-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .agent-msg.thinking { animation: none; } }
@media (max-width: 640px) { .agent { inset: auto 0 0 0; width: 100%; height: 78vh; border-radius: 16px 16px 0 0; } }
/* «مساعد يوصل» bubble on every page (dashboard/assets/assistant.js). */
.ya-bubble { position: fixed; inset-block-end: 20px; inset-inline-end: 20px; z-index: 1100; display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border: 0; border-radius: 999px; background: var(--navy, #0f2340); color: #fff; font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 10px 30px rgba(15,35,64,.3); }
.ya-bubble:hover { transform: translateY(-1px); }
.ya-bubble[hidden], body.agent-open .ya-bubble { display: none; }
.ya-dot { width: 10px; height: 10px; border-radius: 50%; background: #c5f04a; box-shadow: 0 0 0 4px rgba(197,240,74,.25); }
.ya-panel { position: fixed; inset-block-end: 20px; inset-inline-end: 20px; z-index: 1150; width: min(420px, calc(100vw - 24px)); height: min(640px, calc(100vh - 40px)); display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border, #e5e7eb); border-radius: 18px; box-shadow: 0 24px 60px rgba(15,35,64,.28); overflow: hidden; }
.ya-panel[hidden] { display: none; }
.ya-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; background: var(--navy, #0f2340); color: #fff; }
.ya-h .spacer { flex: 1; } .ya-h .btn { background: rgba(255,255,255,.12); color: #fff; border-color: transparent; }
.ya-h .badge { background: rgba(197,240,74,.18); color: #c5f04a; }
.ya-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #f8fafc; }
.ya-msg { max-width: 90%; padding: 10px 13px; border-radius: 14px; font-size: .92rem; line-height: 1.75; white-space: pre-wrap; word-break: break-word; }
.ya-msg.me { align-self: flex-start; background: var(--navy, #0f2340); color: #fff; border-end-start-radius: 4px; }
.ya-msg.bot { align-self: flex-end; background: #fff; border: 1px solid var(--border, #e5e7eb); border-end-end-radius: 4px; }
.ya-msg.bot a { color: #4a7d00; font-weight: 700; direction: ltr; unicode-bidi: isolate; }
.ya-msg.err { background: #fef2f2; color: #991b1b; }
.ya-msg.thinking { color: var(--muted, #64748b); animation: agent-pulse 1.2s ease-in-out infinite; }
.ya-acts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; } .ya-act { font-size: .72rem; background: #ecfccb; color: #3f6212; border-radius: 999px; padding: 2px 8px; } .ya-act.bad { background: #fee2e2; color: #991b1b; }
.ya-pending { align-self: flex-end; max-width: 90%; background: #fffbeb; border: 1px solid #fcd34d; border-radius: 14px; padding: 10px 13px; font-size: .9rem; }
.ya-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 0; background: #fff; }
.ya-chips .chip { border: 1px dashed var(--navy, #0f2340); background: #eef2f7; color: var(--navy, #0f2340); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
.ya-form { display: flex; gap: 8px; padding: 10px 14px; background: #fff; }
.ya-form textarea { flex: 1; resize: none; font: inherit; font-size: .9rem; padding: 8px 10px; border: 1px solid var(--border, #e5e7eb); border-radius: 10px; }
.ya-note { margin: 0; padding: 0 14px 10px; background: #fff; color: var(--muted, #64748b); }
@media (prefers-reduced-motion: reduce) { .ya-bubble:hover { transform: none; } .ya-msg.thinking { animation: none; } }
@media (max-width: 640px) { .ya-panel { inset: auto 0 0 0; width: 100%; height: 85vh; border-radius: 18px 18px 0 0; } .ya-bubble { inset-block-end: 14px; inset-inline-end: 14px; } }

/* The editor assistant docks beside the editor on wide screens: the page makes room instead of being covered. */
@media (min-width: 1280px) {
  body.agent-open .main { margin-inline-end: 396px; }
  body.agent-open #ad-overlay { inset-inline-end: 396px; }
  body.agent-open .agent { inset-block: 0; inset-inline-end: 0; border-radius: 0; height: 100vh; }
}
/* Room under the last row of every page so the «اسأل يوصل» bubble never sits on a button. */
.content { padding-bottom: 88px; }
.agent-h b, .agent-h .badge, .agent-h .btn { white-space: nowrap; }
.agent-h .badge { font-size: .72rem; }

/* Verification labels wrap without expanding the subscribers page. */
.pg-subs .badge{white-space:normal}
@media(max-width:600px){.pg-subs,.pg-subs .card{min-width:0;max-width:100%;box-sizing:border-box}.pg-subs .pg-toolbar{flex-wrap:wrap}.pg-subs .pg-toolbar>*{min-width:0;max-width:100%}.pg-subs .table-wrap{max-width:100%;overflow:auto}}
