:root {
  --teal: #0f766e; --deep: #0b3f3b; --gold: #f2b233; --deal: #c2410c; --red: #b91c1c;
  --bg: #f4f6f5; --card: #fff; --line: #e2e8e6; --ink: #1c2725; --muted: #64706d;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
/* Type scale (Tajawal): 400 text · 500 labels, tabs, pills · 700 headings, buttons, numbers · 800 page titles */
body { font-family: 'Tajawal', system-ui, sans-serif; font-weight: 400; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.6; }
[hidden] { display: none !important; }
a { color: var(--teal); }
h1 { font-size: 1.5rem; margin: 0 0 16px; font-weight: 800; }
h2, h3, b, strong { font-weight: 700; }
h1 small, h2 small { color: var(--muted); font-weight: 400; font-size: .8em; }
h2 { font-size: 1.1rem; margin: 24px 0 12px; }
.card h2:first-child, .form > h2:first-child { margin-top: 0; }
.muted { color: var(--muted); }
.warn-text { color: var(--deal); }
code { background: #e9efed; padding: 1px 6px; border-radius: 4px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px; border-radius: 10px;
  border: 1px solid transparent; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn.primary { background: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--deep); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger.ghost { background: transparent; color: var(--red); border-color: #f3c4c4; }
.btn.small { min-height: 34px; padding: 4px 12px; font-size: .9rem; }
.btn.big { min-height: 52px; padding: 12px 28px; font-size: 1.05rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: linear-gradient(160deg, var(--deep), var(--teal)); }
.login-box { width: 100%; max-width: 360px; background: #fff; border-radius: 16px; padding: 28px; display: grid; gap: 16px; box-shadow: 0 20px 50px #0004; }
.login-box label { display: grid; gap: 6px; font-weight: 500; }
.login-box .err { color: var(--red); margin: 0; min-height: 1.4em; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; }
.mark { width: 34px; height: 34px; border-radius: 10px; background: var(--gold); color: var(--deep); display: grid; place-items: center; font-weight: 800; }

/* shell */
.shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--deep); color: #fff; padding: 20px 14px; display: flex; flex-direction: column; gap: 20px; position: sticky; top: 0; height: 100vh; }
.side nav { display: grid; gap: 4px; }
.side nav a { color: #d7e7e4; text-decoration: none; padding: 10px 12px; border-radius: 10px; }
.side nav a:hover { background: #ffffff14; }
.side nav a.on { background: var(--teal); color: #fff; font-weight: 500; }
.side [data-logout] { margin-top: auto; color: #d7e7e4; border-color: #ffffff33; }
.view { padding: 28px; min-width: 0; max-width: 1200px; }

/* blocks */
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.head h1, .head h2 { margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; min-width: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-decoration: none; color: inherit; display: grid; gap: 2px; }
.stat b { font-size: 1.7rem; color: var(--teal); line-height: 1.2; }
.stat span { color: var(--muted); font-size: .9rem; }
.stat.warn { border-color: #f7c99d; background: #fff8f1; }
.stat.warn b { color: var(--deal); }
a.stat:hover { border-color: var(--teal); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; margin-top: 16px; }

/* tables */
.table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { background: #eef3f1; font-size: .85rem; color: var(--muted); font-weight: 500; }
.table tr:last-child td { border-bottom: 0; }
.stores-table tbody tr { cursor: pointer; }
.stores-table tbody tr:hover { background: #f6faf9; }
.logo { width: 40px; height: 40px; border-radius: 8px; object-fit: contain; background: #fff; border: 1px solid var(--line); display: block; }
.logo.ph { background: #eef3f1; }
.flags span { margin-inline-end: 2px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 500; background: #eef3f1; }
.pill.published { background: #dcf3ee; color: var(--teal); }
.pill.review { background: #fdf0d5; color: #8a5a00; }
.pill.hidden { background: #f1e3e3; color: var(--red); }

/* filters & forms */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.filters input[type=search] { flex: 1 1 220px; }
input, select, textarea { font: inherit; color: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-height: 40px; width: 100%; max-width: 100%; }
.filters select { width: auto; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #0f766e55; border-color: var(--teal); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; accent-color: var(--teal); flex: none; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.field { display: grid; gap: 6px; align-content: start; min-width: 0; }
.field > span { font-weight: 500; font-size: .9rem; }
.field small { font-size: .8rem; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 40px; }
.check.dim { opacity: .55; }
.row { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; }
.row > .field, .row > input { flex: 1 1 140px; }
.form .actions { margin-top: 18px; }
.logo-preview img { max-height: 60px; max-width: 160px; border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: #fff; }
.code { font-family: ui-monospace, Menlo, monospace; letter-spacing: .05em; text-transform: uppercase; }
.countries { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.coupon-form { border-inline-start: 4px solid var(--teal); }
.coupon-form.off { border-inline-start-color: #c7cfcc; background: #fafbfb; }
.coupon-form .countries, .coupon-form .field:has(.countries) { grid-column: 1 / -1; }
.release .row { align-items: end; }
.release .field { max-width: 200px; }
.pick { list-style: none; padding: 0; margin: 0 0 12px; max-height: 420px; overflow: auto; display: grid; gap: 4px; }
.log { background: #0e1a18; color: #cfe6e1; padding: 16px; border-radius: var(--radius); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; direction: ltr; text-align: left; font-size: .85rem; }

/* uploads */
.logo-field { grid-column: 1 / -1; }
.logo-up { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.logo-up .logo-preview { width: 96px; height: 96px; border: 1px dashed var(--line); border-radius: 10px; display: grid; place-items: center; background: #fff; flex: none; padding: 6px; }
.logo-up .logo-preview img { max-width: 100%; max-height: 100%; border: 0; padding: 0; }
.logo-up .logo-preview .muted { font-size: .8rem; }
.logo-up-actions { display: grid; gap: 8px; flex: 1 1 220px; min-width: 0; }
.logo-up-actions .upload-btn { justify-self: start; }
.upload-btn { position: relative; }
.upload-btn.busy { opacity: .6; pointer-events: none; }
.upload-btn.busy::after { content: '…'; }
.icons { display: flex; flex-wrap: wrap; gap: 20px; align-items: end; }
.icons figure { margin: 0; display: grid; gap: 6px; justify-items: center; }
.icons figcaption { font-size: .8rem; color: var(--muted); }
.icons img { background: repeating-conic-gradient(#eef1f0 0 25%, #fff 0 50%) 0 0 / 12px 12px; border-radius: 6px; }
.serp-mini > div { display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; direction: rtl; }
.serp-mini img { border-radius: 50% !important; background: #f1f3f4 !important; padding: 3px; }
.serp-mini span { display: grid; line-height: 1.3; }
.serp-mini small { color: var(--muted); direction: ltr; text-align: right; }
.tips { margin: 0 0 14px; padding-inline-start: 20px; }

/* toast */
.toast { position: fixed; bottom: 20px; inset-inline-start: 50%; transform: translate(50%, 30px); background: var(--deep); color: #fff; padding: 12px 20px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 10; max-width: calc(100vw - 32px); box-shadow: 0 8px 24px #0003; }
.toast.show { opacity: 1; transform: translate(50%, 0); }
.toast.bad { background: var(--red); }

/* mobile */
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 0; z-index: 5; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 16px; gap: 8px; }
  .side .brand { font-size: 1rem; }
  .side .mark { width: 28px; height: 28px; }
  .side [data-logout] { margin: 0 0 0 0; margin-inline-start: auto; }
  .side nav { order: 3; width: 100%; grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .side nav a { padding: 6px 12px; white-space: nowrap; font-size: .9rem; }
  .view { padding: 16px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .release .field { max-width: none; }
  /* stores table becomes cards */
  .stores-table thead { display: none; }
  .stores-table, .stores-table tbody { display: block; border: 0; background: none; }
  .stores-table tr { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 2px 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 8px; }
  .stores-table td { padding: 0; border: 0; }
  .stores-table td:nth-child(1) { grid-row: span 3; }
  .stores-table td:nth-child(2) { grid-column: 2 / 4; overflow-wrap: anywhere; }
  .stores-table td:nth-child(3), .stores-table td:nth-child(8) { display: none; }
  .stores-table td:nth-child(4)::after { content: ' كوبون'; color: var(--muted); }
  .stores-table td:nth-child(5) { text-align: end; font-weight: 500; color: var(--deal); }
  .stores-table td:nth-child(6) { grid-column: 2; }
  .stores-table td:nth-child(7) { text-align: end; }
  .stores-table td[colspan] { grid-column: 1 / -1; }
  .filters select, .filters input[type=search] { flex: 1 1 calc(50% - 4px); width: auto; min-width: 0; }
  .table { font-size: .9rem; }
  .table th, .table td { padding: 8px; }
  .head .actions .btn { flex: 1 1 auto; }
}

/* ---------- SEO panel ---------- */
.seo { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-top: 24px; background: #fbfdfc; display: grid; gap: 16px; min-width: 0; }
.seo h2 { margin: 0; }
.seo-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.seo-head p { margin: 2px 0 0; font-size: .9rem; }
.seo-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seo-pick select { width: auto; min-height: 36px; padding: 4px 8px; }
.score { --p: 0; --c: var(--muted); width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; align-content: center; line-height: 1;
  background: radial-gradient(closest-side, #fff 78%, transparent 80% 100%), conic-gradient(var(--c) calc(var(--p) * 1%), #e5ebe9 0); }
.score b { font-size: 1.3rem; color: var(--c); }
.score span { font-size: .65rem; color: var(--muted); }
.score.good { --c: #15803d; } .score.warn { --c: #c27c0e; } .score.bad { --c: var(--red); }
.seg { display: inline-flex; background: #eef3f1; border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; font: inherit; padding: 6px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); font-weight: 500; min-height: 34px; }
.seg button[aria-selected="true"] { background: #fff; color: var(--teal); box-shadow: 0 1px 3px #0001; }
.seg.small button { padding: 3px 10px; min-height: 28px; font-size: .85rem; }
.seg.tabs2 { justify-self: start; }
.seo-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.seo-col, .seo-fields { display: grid; gap: 12px; min-width: 0; }
.kw-row { display: flex; gap: 8px; align-items: end; }
.kw-row .field { flex: 1; }
.kw-row .btn { flex: none; margin-bottom: 2px; }
.vars { display: flex; flex-wrap: wrap; gap: 4px; margin-top: -4px; }
.var { border: 1px dashed #b7c7c2; background: #fff; border-radius: 6px; font: 12px ui-monospace, Menlo, monospace; padding: 2px 6px; cursor: pointer; color: var(--teal); direction: ltr; }
.var:hover { border-color: var(--teal); }
.meter-row { display: grid; gap: 2px; }
.meter { height: 6px; background: #e5ebe9; border-radius: 4px; position: relative; overflow: hidden; }
.meter i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 4px; background: #15803d; }
.meter-row.warn i { background: #d99a1e; } .meter-row.bad i { background: var(--red); }
.meter-row em { font-size: .72rem; color: var(--muted); font-style: normal; }
.serp-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.serp { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; font-family: Arial, sans-serif; overflow: hidden; }
.serp.mobile { max-width: 380px; }
.serp-site { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.serp-site img { width: 28px; height: 28px; border-radius: 50%; background: #f1f3f4; padding: 4px; flex: none; }
.serp-site span { display: grid; line-height: 1.3; min-width: 0; }
.serp-site b { font-size: 14px; color: #202124; font-weight: 400; }
.serp-site small { font-size: 12px; color: #4d5156; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: start; }
.serp-title { color: #1a0dab; font-size: 20px; line-height: 1.3; margin-bottom: 4px; overflow-wrap: anywhere; }
.serp.mobile .serp-title { font-size: 18px; }
.serp-desc { color: #4d5156; font-size: 14px; line-height: 1.58; overflow-wrap: anywhere; }
.serp-desc b { color: #202124; }
.small { font-size: .8rem; }
.chk-group { border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-bottom: 10px; }
.chk-group summary { padding: 10px 14px; font-weight: 700; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.checks { list-style: none; margin: 0; padding: 0 14px 10px; display: grid; gap: 8px; }
.checks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; }
.checks i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 800; color: #fff; background: var(--muted); }
.checks .good i { background: #15803d; } .checks .warn i { background: #d99a1e; } .checks .bad i { background: var(--red); } .checks .info i { background: #64748b; }
.checks b { font-weight: 500; display: block; }
.checks small { color: var(--muted); display: block; line-height: 1.6; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .75rem; font-weight: 500; background: #eef3f1; color: var(--muted); }
.chip.good { background: #dcfce7; color: #166534; } .chip.warn { background: #fef3c7; color: #92400e; } .chip.bad { background: #fee2e2; color: #991b1b; }
.g-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 14px; }
.card-lite { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px; min-width: 0; }
.card-lite h3 { font-size: .95rem; margin: 0 0 10px; }
.card-lite h3:not(:first-child) { margin-top: 16px; }
.outline { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.outline li { padding-inline-start: calc((var(--l) - 1) * 18px); font-size: .88rem; display: flex; gap: 6px; align-items: baseline; border-inline-start: 3px solid transparent; }
.outline li.kw { border-inline-start-color: #16a34a; }
.outline em { font-style: normal; font: 700 10px ui-monospace, Menlo, monospace; color: #fff; background: var(--teal); border-radius: 4px; padding: 1px 4px; flex: none; }
.outline .h2 em { background: #0e7490; } .outline .h3 em { background: #64748b; }
.tbl-wrap { overflow-x: auto; }
.kw-table { border-collapse: collapse; width: 100%; font-size: .82rem; }
.kw-table th, .kw-table td { border-bottom: 1px solid var(--line); padding: 6px; text-align: center; white-space: nowrap; }
.kw-table tbody th { text-align: start; white-space: normal; min-width: 110px; }
.kw-table td.yes { color: #15803d; font-weight: 800; } .kw-table td.no { color: #c0c8c6; }
.phr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.phr ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: .85rem; }
.phr li { display: flex; justify-content: space-between; gap: 8px; background: #f6f9f8; border-radius: 6px; padding: 3px 8px; }
.plain { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-top: 12px; }
.plain summary { cursor: pointer; font-weight: 500; }
.plain p { font-size: .85rem; color: var(--muted); max-height: 260px; overflow: auto; }
.c-list { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; }
.c-list li span:first-child { margin-inline-end: 6px; }
.seo-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; font-size: .85rem; }
.cseo { grid-column: 1 / -1; display: grid; gap: 4px; font-size: .8rem; background: #f6f9f8; border-radius: 8px; padding: 8px 10px; }
.cseo div { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cseo:empty { display: none; }
@media (max-width: 980px) {
  .seo-body, .g-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .seo { padding: 14px; margin-inline: -6px; }
  .seo-head { grid-template-columns: auto minmax(0, 1fr); }
  .seo-pick { grid-column: 1 / -1; }
  .phr { grid-template-columns: minmax(0, 1fr); }
  .kw-row { flex-wrap: wrap; }
}

.pages-table tbody tr { cursor: pointer; }
.pages-table tbody tr:hover { background: #f6faf9; }
@media (max-width: 820px) {
  .pages-table th:nth-child(3), .pages-table td:nth-child(3) { display: none; }
  .pages-table td:first-child { overflow-wrap: anywhere; }
}
.logo-up .card-preview { width: 120px; height: 120px; }
.logo-up-actions [data-card-del] { justify-self: start; }
.rating-field .row { gap: 12px; align-items: end; }
.rating-field .row .field { flex: 1; min-width: 0; }

/* ---------- store editor: sticky header + tabs ---------- */
.store-top { position: sticky; top: 0; z-index: 20; background: var(--bg); margin: -8px -4px 16px; padding: 10px 4px 0;
  display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 8px 12px; border-bottom: 1px solid var(--line); }
.store-top .back { text-decoration: none; font-size: 1.3rem; color: var(--muted); padding: 4px 8px; border-radius: 8px; }
.store-top .back:hover { background: #e9efed; color: var(--teal); }
.st-logo img { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; background: #fff; border: 1px solid var(--line); padding: 3px; display: block; }
.st-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.st-name h1 { margin: 0; font-size: 1.3rem; }
.st-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.stabs { grid-column: 1 / -1; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.stabs button, .stabs a { border: 0; text-decoration: none; background: none; font: inherit; font-weight: 500; color: var(--muted); padding: 10px 14px; cursor: pointer;
  border-bottom: 3px solid transparent; white-space: nowrap; }
.stabs button:hover { color: var(--ink); }
.stabs a:hover { color: var(--ink); }
.stabs button[aria-selected="true"], .stabs a[aria-selected="true"] { color: var(--teal); border-bottom-color: var(--teal); }
.stabs button b { background: var(--teal); color: #fff; border-radius: 999px; padding: 0 7px; font-size: .8rem; margin-inline-start: 4px; }
.stabs button small { color: var(--muted); font-weight: 400; }
.spanel > h2:first-child { margin-top: 0; }
.media-grid { grid-template-columns: 1fr 1fr; }
.danger-zone { margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line); display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* coupons as collapsible rows */
.c-list { display: grid; gap: 8px; }
.c-row { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.c-row[open] { border-color: var(--teal); box-shadow: 0 2px 10px #0f766e14; }
.c-row.off summary > :not(.tgl) { opacity: .6; }
.c-row summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(90px, auto) 52px 1fr auto auto auto; gap: 12px; align-items: center; padding: 12px 16px; }
/* Show/hide switch on each coupon card's row */
.tgl { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 500; white-space: nowrap; }
.tgl input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tgl-ui { width: 38px; height: 22px; border-radius: 999px; background: #cbd5d2; position: relative; flex: none; transition: background .15s; }
.tgl-ui::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px #0003; transition: inset-inline-start .15s; }
.tgl input:checked + .tgl-ui { background: var(--teal); }
.tgl input:checked + .tgl-ui::after { inset-inline-start: 19px; }
.tgl input:focus-visible + .tgl-ui { outline: 2px solid var(--teal); outline-offset: 2px; }
.tgl-txt { min-width: 34px; color: var(--muted); }
.c-row summary::-webkit-details-marker { display: none; }
.c-row summary:hover { background: #f6faf9; border-radius: var(--radius); }
.c-code { font-family: ui-monospace, Menlo, monospace; font-weight: 700; color: var(--teal); }
.c-code i { font-family: inherit; font-style: normal; color: var(--deal); font-weight: 500; }
.c-pct { font-weight: 700; }
.c-offer { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.c-flags { letter-spacing: 2px; }
.c-row > form.coupon-form { border: 0; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); box-shadow: none; margin: 0; }
@media (max-width: 820px) {
  .store-top { grid-template-columns: auto auto 1fr; }
  .st-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .media-grid { grid-template-columns: 1fr; }
  .c-row summary { grid-template-columns: 1fr auto; gap: 4px 10px; }
  .c-row summary .c-offer { grid-column: 1 / -1; grid-row: 2; }
  .c-row summary .c-flags { display: none; }
  .c-row summary .c-state { grid-column: 1 / -1; }
}

.logo-up .card-preview { width: 160px; height: 160px; padding: 0; overflow: hidden; position: relative; }
.logo-up .card-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; }
.card-preview .auto-tag { position: absolute; top: 6px; inset-inline-start: 6px; background: #000a; color: #fff; font-style: normal; font-size: .72rem; padding: 1px 8px; border-radius: 999px; }
.card-preview .muted { padding: 8px; text-align: center; }

/* ---------- analytics ---------- */
.an-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.an-head h1 { margin-bottom: 4px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 16px 0; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 2px; }
.kpi b { font-size: 1.7rem; line-height: 1.2; color: var(--deep); }
.kpi b small { font-size: .9rem; color: var(--muted); font-weight: 400; }
.kpi span { font-weight: 500; }
.kpi > small { color: var(--muted); font-size: .8rem; }
.traffic-off { background: linear-gradient(135deg, #eef7f5, #fff); border-style: dashed; margin-bottom: 16px; }
.traffic-off h2 { margin: 0 0 6px; }
.traffic-off p { margin: 0; color: var(--ink); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.chart-card h2 { margin: 0 0 4px; font-size: 1rem; }
.chart-card .small, .muted.small { font-size: .82rem; margin: 0 0 12px; }
.hb { display: grid; gap: 8px; margin-top: 10px; }
.hb-row { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto 70px; gap: 10px; align-items: center; font-size: .9rem; }
.hb-row.dim { opacity: .5; }
.hb-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-l .tag { font-style: normal; font-size: .7rem; background: #eef3f1; border-radius: 999px; padding: 0 6px; color: var(--muted); }
.hb-t { background: #eef3f1; border-radius: 6px; height: 12px; overflow: hidden; }
.hb-t i { display: block; height: 100%; background: var(--teal); border-radius: 6px; min-width: 2px; }
.hb.gold .hb-t i { background: var(--gold); }
.hb.deal .hb-t i { background: #ea8a4b; }
.hb-row b { font-variant-numeric: tabular-nums; }
.hb-row small { color: var(--muted); font-size: .78rem; }
.cols-chart { display: flex; align-items: flex-end; gap: 6px; height: 170px; margin-top: 12px; }
.cc { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; gap: 3px; }
.cc b { font-size: .72rem; color: var(--muted); }
.cc-bar { width: 100%; max-width: 34px; background: var(--teal); border-radius: 6px 6px 2px 2px; }
.cols-chart.gold .cc-bar { background: var(--gold); }
.cc small { font-size: .65rem; color: var(--muted); white-space: nowrap; }
.stack { display: flex; height: 22px; border-radius: 8px; overflow: hidden; background: #eef3f1; margin-top: 12px; }
.stack i, .legend i { display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: .85rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend small { color: var(--muted); }
.s1 { background: #0f766e; } .s2 { background: #5fb3a6; } .s3 { background: var(--gold); } .s4 { background: #ea8a4b; } .s5 { background: #b91c1c; } .s6 { background: #94a3b8; }
.opps-title { margin-top: 28px; }
.opps { display: grid; gap: 10px; }
.opp { padding: 0; border-inline-start: 4px solid var(--line); }
.opp.hi { border-inline-start-color: var(--red); } .opp.mid { border-inline-start-color: var(--gold); } .opp.lo { border-inline-start-color: #94a3b8; }
.opp summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 14px 16px; }
.opp summary::-webkit-details-marker { display: none; }
.opp summary b { flex: 1; }
.opp .imp { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #eef3f1; white-space: nowrap; }
.opp.hi .imp { background: #fde2e2; color: var(--red); } .opp.mid .imp { background: #fdf0d5; color: #8a5a00; }
.opp .count { background: var(--deep); color: #fff; border-radius: 999px; padding: 0 10px; font-weight: 700; font-size: .85rem; }
.opp > p, .opp > ul, .opp > a { margin-inline: 16px; }
.opp > p { margin-top: 0; }
.opp > a { margin-bottom: 14px; }
.opp-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 16px; margin-bottom: 14px; }
.opp-list li { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); padding: 4px 0; }
.opp-list small { color: var(--muted); white-space: nowrap; }
@media (max-width: 560px) {
  .charts { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .hb-row { grid-template-columns: 38% 1fr auto; }
  .hb-row small { display: none; }
  .cols-chart { gap: 3px; }
  .cc small { font-size: .55rem; writing-mode: vertical-rl; transform: rotate(180deg); }
}

/* ---------- home page editor ---------- */
.hm-panel { display: grid; gap: 14px; }
.hm-panel .card h2 { margin-top: 0; }
.hm-opts { gap: 8px; align-items: center; flex-wrap: wrap; }
.num-in { width: 72px; }
.bn-list { display: grid; gap: 12px; }
.bn-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.bn-head .row-tools { margin-inline-start: auto; }
.bn-body { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.bn-preview { aspect-ratio: 16 / 7; border: 1px dashed var(--line); border-radius: 12px; overflow: hidden; display: grid; place-items: center; background: #f6faf9; color: var(--muted); }
.bn-preview > img { width: 100%; height: 100%; object-fit: cover; }
.bn-store { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #fff; padding: 10px; text-align: center; }
.bn-store img { width: 54px; height: 54px; object-fit: contain; background: #fff; border-radius: 10px; padding: 3px; }
.bn-store em { font-style: normal; font-weight: 800; font-size: 1.4rem; color: #fcd34d; }
.t-teal { background: linear-gradient(135deg, #0f766e, #0b3f3b); } .t-ink { background: linear-gradient(135deg, #1e293b, #0f172a); }
.t-sunset { background: linear-gradient(135deg, #ea580c, #b45309); } .t-plum { background: linear-gradient(135deg, #7c3aed, #4c1d95); }
.bn-fields { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.row-tools { display: inline-flex; gap: 4px; }
.icon-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 32px; height: 32px; cursor: pointer; font: inherit; }
.icon-btn:hover { border-color: var(--teal); color: var(--teal); }
.icon-btn.del:hover { border-color: var(--red); color: var(--red); }
.pick-list { list-style: none; counter-reset: pk; padding: 0; margin: 12px 0; display: grid; gap: 6px; }
.pick-list li { counter-increment: pk; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.pick-list li::before { content: counter(pk); color: var(--muted); font-weight: 700; min-width: 18px; }
.pick-list li.empty::before { content: none; }
.pick-list li > span:first-of-type, .pick-list li > label { flex: 1; min-width: 0; }
.add-row { gap: 8px; }
@media (max-width: 820px) { .bn-body { grid-template-columns: 1fr; } }
.hm-opts .num-in { width: 76px; flex: none; }
.bn-fields .countries { display: flex; gap: 6px 14px; flex-wrap: wrap; border: 0; padding: 0; }
.bn-store { gap: 2px; padding: 8px; }
.bn-store img { width: 40px; height: 40px; }
.bn-store b { font-size: .9rem; line-height: 1.3; }
.bn-store em { font-size: 1.2rem; line-height: 1.1; }

.c-cond { grid-column: 1 / -1; background: #f6faf9; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.c-cond > span small { font-weight: 400; }
.cond-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.faq-field { grid-column: 1 / -1; }

/* categories */
.cats-table tbody tr { cursor: pointer; }
.cats-table tbody tr:hover { background: #f6faf9; }
.cat-ico { font-size: 22px; width: 36px; text-align: center; }
.cat-ico.big { font-size: 30px; }
.cc { display: inline-block; font-size: 13px; padding: 2px 6px; border-radius: 6px; margin: 1px; white-space: nowrap; }
.cc.live { background: #e7f6ef; color: #065f46; font-weight: 500; }
.cc.off { background: #f3f4f6; color: #9ca3af; }
.score-bar { width: 110px; height: 8px; background: #eef1f1; border-radius: 99px; overflow: hidden; display: inline-block; vertical-align: middle; margin-inline-end: 6px; }
.score-bar i { display: block; height: 100%; }
.score-bar i.good, .cat-check b.good { background: #10b981; color: #fff; }
.score-bar i.mid, .cat-check b.mid { background: #f59e0b; color: #fff; }
.score-bar i.low, .cat-check b.low { background: #ef4444; color: #fff; }
.cat-edit { display: grid; grid-template-columns: 1fr 270px; gap: 16px; align-items: start; }
.cat-check { position: sticky; top: 140px; }
.cat-check b { padding: 1px 8px; border-radius: 99px; font-size: 13px; }
.cat-check ul { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; font-size: 14px; }
.cat-check li.ok { color: #065f46; }
.cat-check li.no { color: #6b7280; }
.cat-stores { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.cat-stores li { display: flex; justify-content: space-between; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.cat-stores a { display: flex; align-items: center; gap: 8px; }
.cat-stores img { border-radius: 6px; object-fit: contain; }
.dlg { border: 0; border-radius: 14px; padding: 20px; width: min(460px, 92vw); }
.dlg::backdrop { background: rgb(0 0 0 / .35); }
@media (max-width: 900px) {
  .cat-edit { grid-template-columns: 1fr; }
  .cat-check { position: static; order: -1; }
  .cats-table th:nth-child(5), .cats-table td:nth-child(5) { display: none; }
}
.cats-table td.flags { min-width: 130px; }
.cats-table td.flags .cc { margin: 1px 0; }
/* Same breathing room around store logos in the dashboard */
.logo { box-sizing: border-box; padding: 3px; }
.cat-stores img { box-sizing: border-box; padding: 2px; background: #fff; border: 1px solid var(--line); }

/* ---------- side menu with sub-items ---------- */
.topbar, .scrim { display: none; }
.side { overflow-y: auto; }
.side nav { display: grid; gap: 2px; }
.nav-row { display: flex; align-items: center; }
.nav-row a { flex: 1; }
.nav-caret { background: none; border: 0; color: #9fc3bd; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 18px; line-height: 1; transition: transform .15s; }
.nav-caret:hover { background: #ffffff14; color: #fff; }
.nav-item.open .nav-caret { transform: rotate(90deg); }
.nav-subs { display: none; margin: 2px 0 6px; padding-inline-start: 14px; border-inline-start: 2px solid #ffffff1f; margin-inline-start: 18px; }
.nav-item.open .nav-subs { display: grid; gap: 1px; }
.side .nav-subs a { padding: 6px 10px; font-size: .9rem; color: #b9d3cf; border-radius: 8px; }
.side .nav-subs a:hover { background: #ffffff10; color: #fff; }
.side .nav-subs a.on { background: #ffffff1a; color: #fff; font-weight: 500; }
/* analytics tabs */
.an-tabs { margin: 12px 0 16px; }
.stabs a { display: inline-block; white-space: nowrap; }
.an-tabs .cnt { background: var(--deal); color: #fff; border-radius: 99px; padding: 0 7px; font-size: .75rem; }
.opp-teaser { display: block; text-decoration: none; color: var(--ink); border-inline-start: 4px solid var(--deal); }
.opp-teaser:hover { border-color: var(--teal); }
/* tracking page */
.track-group h2 { margin-top: 0; }
.track-row { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 1.2fr); gap: 8px 20px; padding: 14px 0; border-top: 1px solid var(--line); align-items: start; }
.track-row:first-of-type { border-top: 0; }
.track-row.sub { padding-inline-start: 28px; background: linear-gradient(90deg, transparent, #f8fbfa); }
.track-row > .check { grid-column: 2; }
.tr-name { display: flex; gap: 10px; align-items: flex-start; }
.tr-name > div { display: grid; flex: 1; }
.tr-name small { font-size: .85rem; line-height: 1.5; }
.tr-ico { font-size: 22px; width: 30px; text-align: center; }
.track-row .field input { font-family: ui-monospace, Menlo, monospace; }
.track-row .check { display: flex; gap: 8px; align-items: flex-start; font-size: .92rem; margin: 6px 0; min-height: 0; }
.track-row .check input { margin-top: 5px; }

@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .topbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30; background: var(--deep); color: #fff; padding: 10px 14px; }
  .topbar .brand { font-size: 1rem; }
  .topbar .mark { width: 28px; height: 28px; }
  .menu-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid #ffffff33; background: transparent; display: grid; place-content: center; gap: 4px; cursor: pointer; }
  .menu-btn span { display: block; width: 18px; height: 2px; background: #fff; border-radius: 2px; }
  .side { position: fixed; top: 0; inset-inline-start: 0; z-index: 50; width: min(290px, 84vw); height: 100vh; height: 100dvh;
    flex-direction: column; flex-wrap: nowrap; align-items: stretch; padding: 20px 14px; gap: 16px;
    transform: translateX(100%); transition: transform .2s ease; box-shadow: none; }
  [dir="rtl"] .side { transform: translateX(100%); }
  body.menu-open .side { transform: none; box-shadow: -10px 0 40px #0005; }
  .side nav { order: 0; width: auto; grid-auto-flow: row; overflow: visible; }
  .side nav a { white-space: normal; font-size: 1rem; padding: 10px 12px; }
  .side [data-logout] { margin: auto 0 0; }
  .scrim { display: block; position: fixed; inset: 0; background: #0006; z-index: 40; }
  .scrim[hidden] { display: none; }
  .track-row { grid-template-columns: minmax(0, 1fr); }
  .track-row > .check { grid-column: 1; }
}

/* ---------- analytics: period comparison ---------- */
.period h2 { font-size: 1.05rem; margin: 18px 0 10px; }
.range-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.range-bar .field { margin: 0; min-width: 150px; }
.range-bar .field[hidden] { display: none; }
.range-label { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.prev-chip { background: #eef2f1; border-radius: 99px; padding: 1px 10px; font-size: .9rem; }
.pkpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pkpi { text-align: start; font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; align-content: start; cursor: pointer; }
.pkpi.static { cursor: default; }
.pkpi:not(.static):hover { border-color: var(--teal); }
.pkpi.on { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); background: #f3faf8; }
.pkpi > span { font-size: .85rem; font-weight: 500; }
.pkpi b { font-size: 1.45rem; color: var(--deep); line-height: 1.2; }
.pkpi small { font-size: .78rem; }
.dl { font-size: .8rem; font-weight: 600; justify-self: start; border-radius: 6px; padding: 0 6px; }
.dl.up { color: #157a4a; background: #e3f5ec; }
.dl.down { color: #b4232f; background: #fde8ea; }
.dl.eq { color: var(--muted); background: #f0f2f2; }
.pchart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.pchart-head h3 { margin: 0; font-size: 1rem; }
.legend i.s-cur { background: var(--teal); }
.legend i.s-prev { background: #c9d6d3; }
.pchart { display: flex; align-items: stretch; gap: 4px; height: 160px; margin-top: 10px; }
.pc { flex: 1; min-width: 0; display: grid; grid-template-rows: 1fr auto; gap: 4px; }
.pc-bars { display: flex; align-items: flex-end; justify-content: center; gap: 2px; border-bottom: 1px solid var(--line); }
.pc-bars span { flex: 1; max-width: 16px; border-radius: 4px 4px 1px 1px; }
.pc-cur { background: var(--teal); }
.pc-prev { background: #c9d6d3; }
.pc small { font-size: .65rem; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; }
.pchart.dense .pc:nth-child(odd) small { visibility: hidden; }
.now-title { font-size: 1.1rem; margin: 22px 0 0; }
@media (max-width: 820px) {
  .pkpis { grid-template-columns: 1fr 1fr; }
  .range-bar .field { flex: 1 1 140px; }
  .pchart { gap: 2px; }
  .pc:nth-child(even) small { visibility: hidden; }
}

/* coupon details + proof screenshot */
.proof-box { display: grid; grid-template-columns: 160px 1fr; gap: 14px; margin-top: 8px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; }
.proof-prev { aspect-ratio: 3 / 4; background: #f4f7f6; border-radius: 8px; display: grid; place-items: center; overflow: hidden; font-size: .85rem; }
.proof-prev img { width: 100%; height: 100%; object-fit: contain; }
.proof-side { display: grid; gap: 6px; align-content: start; }
.proof-side .field { margin: 0; }
@media (max-width: 600px) { .proof-box { grid-template-columns: 1fr; } .proof-prev { max-height: 220px; } }

.table-wrap { overflow-x: auto; }
.ev-table tr.ev-stage td { border-top: 2px solid var(--line); }
.ev-table td:first-child { white-space: nowrap; }
.dims { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; margin: 8px 0 14px; }
.dims div { display: grid; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.dims small { color: var(--muted); font-size: .8rem; }

/* ---------- articles ---------- */
.art-table tr[data-href] { cursor: pointer; }
.empty-art { border: 2px dashed var(--line); }
.art-head h1 { margin: 4px 0 10px; }
.art-edit { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.art-main { display: grid; gap: 14px; min-width: 0; }
.art-side { display: grid; gap: 14px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
.art-side h2 { font-size: 1rem; margin: 0 0 8px; }
.art-title input { font-size: 1.35rem; font-weight: 700; }
.art-meta { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.slug-row { display: flex; align-items: center; gap: 4px; }
.slug-row small { color: var(--muted); white-space: nowrap; }
.art-tabs { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.art-tabs button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 12px; font: inherit; cursor: pointer; }
.art-tabs button[aria-selected="true"] { background: var(--deep); color: #fff; border-color: var(--deep); }
.art-tabs [data-wc] { margin-inline-start: auto; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px; background: #f4f7f6; border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; }
.toolbar button, .toolbar .tb-file, .toolbar select { border: 1px solid transparent; background: #fff; border-radius: 6px; padding: 4px 10px; font: inherit; font-size: .9rem; cursor: pointer; }
.toolbar button:hover, .toolbar .tb-file:hover { border-color: var(--teal); }
.toolbar select { max-width: 170px; border-color: var(--line); }
.body-in { width: 100%; border-radius: 0 0 10px 10px; font-size: 1rem; line-height: 1.9; min-height: 420px; }
.art-prev { border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; line-height: 1.9; min-height: 420px; }
.art-prev h1 { font-size: 1.6rem; }
.art-prev figure { margin: 12px 0; } .art-prev img { max-width: 100%; height: auto; border-radius: 8px; }
.art-prev figcaption { font-size: .85rem; color: var(--muted); }
.art-prev .tip { background: #fff8e1; border-inline-start: 4px solid var(--gold); padding: 8px 12px; border-radius: 8px; margin: 10px 0; }
.pv-tldr, .pv-toc { background: #f3faf8; border-radius: 10px; padding: 10px 14px; margin: 10px 0; }
.pv-store { background: #eef6ff; border: 1px dashed #93c5fd; border-radius: 10px; padding: 10px 14px; margin: 10px 0; }
.md-help { margin-top: 10px; font-size: .9rem; } .md-help summary { cursor: pointer; color: var(--muted); }
.md-help code { background: #f1f3f3; padding: 0 5px; border-radius: 4px; direction: ltr; unicode-bidi: embed; }
.art-cover { display: grid; grid-template-columns: 220px 1fr; gap: 14px; }
.cover-prev { aspect-ratio: 16 / 9; background: #f4f7f6; border-radius: 8px; display: grid; place-items: center; overflow: hidden; }
.cover-prev img { width: 100%; height: 100%; object-fit: cover; }
.seo-score-card { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; }
.ring { --p: 0; --c: #b4232f; width: 96px; height: 96px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(closest-side, #fff 78%, transparent 80%), conic-gradient(var(--c) calc(var(--p) * 1%), #e8eded 0); }
.ring.good { --c: #15803d; } .ring.warn { --c: #d97706; }
.ring b { font-size: 1.8rem; line-height: 1; } .ring small { color: var(--muted); }
.ss-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .85rem; color: var(--muted); }
.ss-stats b { color: var(--ink); }
.gprev { margin: 10px 0; }
.gp { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-top: 4px; font-family: Arial, sans-serif; }
.gp-url { font-size: 12px; color: #4d5156; }
.gp-title { color: #1a0dab; font-size: 18px; line-height: 1.3; }
.gp-desc { color: #4d5156; font-size: 13px; line-height: 1.5; }
.gp-desc em { font-style: normal; color: #70757a; }
.meter-row.good .meter i { background: #15803d; } .meter-row.warn .meter i { background: #d97706; } .meter-row.bad .meter i { background: #b4232f; }
.st-picked, .st-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 3px 10px; font: inherit; font-size: .85rem; cursor: pointer; }
.chip.on { background: #e6f4f1; border-color: var(--teal); }
.art-side input[type=search] { width: 100%; }
.checks-card details { border-top: 1px solid var(--line); padding: 8px 0; }
.checks-card details:first-child { border-top: 0; }
.checks-card summary { cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.checks-card .cnt { border-radius: 99px; padding: 0 8px; font-size: .8rem; color: #fff; }
.checks-card .cnt.bad { background: #d97706; } .checks-card .cnt.good { background: #15803d; }
.checks { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; font-size: .88rem; }
.checks li { display: grid; grid-template-columns: 20px 1fr; gap: 6px; line-height: 1.6; }
.checks i { font-style: normal; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; color: #fff; margin-top: 3px; }
.checks .good i { background: #15803d; } .checks .warn i { background: #d97706; } .checks .bad i { background: #b4232f; } .checks .info i { background: #94a3b8; }
@media (max-width: 1100px) { .art-edit { grid-template-columns: minmax(0, 1fr); } .art-side { position: static; max-height: none; } }
@media (max-width: 600px) { .art-cover { grid-template-columns: 1fr; } }

/* ---------- footer editor ---------- */
.ft-cols { display: grid; gap: 12px; margin-bottom: 14px; }
.ft-col { border: 1px solid var(--line, #e5e7eb); border-radius: 12px; padding: 14px; display: grid; gap: 10px; }
.ft-col.off { opacity: .55; }
.ft-col-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.ft-move { display: flex; gap: 6px; flex-wrap: wrap; }
.ft-mode { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; }
.ft-count { width: 90px; margin: 0; }
.ft-pick .st-picked .chip button { border: 0; background: none; cursor: pointer; padding: 0 2px; color: inherit; }
.ft-pick input[type=search] { margin-top: 8px; width: 100%; }
.ft-pages { display: flex; flex-wrap: wrap; gap: 6px; }
.ft-links { display: grid; gap: 8px; }
.ft-link { display: grid; grid-template-columns: 1fr 1fr 1.4fr auto auto auto; gap: 6px; align-items: center; }
.ft-link .check { white-space: nowrap; margin: 0; }
.ft-soc { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 700px) {
  .grid.two { grid-template-columns: 1fr; }
  .ft-link { grid-template-columns: 1fr 1fr; padding-bottom: 8px; border-bottom: 1px dashed var(--line, #e5e7eb); }
  .ft-link input[data-l="url"] { grid-column: 1 / -1; }
}

/* ---------- spacing pass: nothing touches (controls ≥ 8px apart, ≥ 12px between stacked fields) ---------- */
:where(.card, section, form, aside, div:not(.grid):not(.row):not(.ft-mode):not(.slug-row)) > .field + .field,
:where(.card, section, form, aside) > .field + .grid, :where(.card, section, form, aside) > .grid + .field,
:where(.card, section, form, aside) > .field + .check, :where(.card, section, form, aside) > .check + .field { margin-top: 12px; }
.pill { margin-block: 3px; margin-inline-end: 6px; vertical-align: middle; }
.icon-btn + .icon-btn { margin-inline-start: 8px; }
.row, .actions { row-gap: 10px; }
.check + .check { margin-inline-start: 12px; }
/* Button labels stay on one line and get a little smaller on small screens instead of wrapping. */
@media (max-width: 480px) {
  .btn { font-size: .92rem; padding-inline: 12px; gap: 5px; }
  .btn.small { font-size: .84rem; padding-inline: 10px; }
}
@media (max-width: 360px) { .btn { font-size: .86rem; padding-inline: 10px; } }

/* ---------- reports ---------- */
.nav-badge { background: var(--red); color: #fff; border-radius: 999px; padding: 0 7px; font-size: .75rem; font-weight: 700; margin-inline-start: 6px; }
.rp-list { display: grid; gap: 14px; }
.rp-card { display: grid; gap: 12px; }
.rp-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.rp-top img { width: 44px; height: 44px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: #fff; }
.rp-top .rp-name { flex: 1 1 220px; min-width: 0; }
.rp-top .rp-name b { display: block; }
.rp-count { background: #fde8e8; color: var(--red); border-radius: 12px; padding: 6px 12px; font-weight: 700; white-space: nowrap; }
.rp-reasons { display: flex; flex-wrap: wrap; gap: 8px; }
.rp-notes { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.rp-notes li { background: #f6f8f7; border-radius: 10px; padding: 10px 12px; }
.rp-notes small { display: block; margin-top: 4px; }
.rp-votes { display: flex; flex-wrap: wrap; gap: 14px; }
.rp-votes .up { color: #15803d; } .rp-votes .down { color: var(--red); }
.stabs .cnt { background: var(--red); color: #fff; border-radius: 99px; padding: 0 7px; font-size: .75rem; margin-inline-start: 4px; }

/* ---------- consistency pass: select arrows, count badges, checkbox rows ---------- */
/* Own chevron with room around it, instead of the browser arrow stuck to the edge. */
select { -webkit-appearance: none; appearance: none; padding-inline-end: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235b6b66' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: left 14px center; background-size: 12px 8px; cursor: pointer; }
[dir=ltr] select { background-position: right 14px center; }
select::-ms-expand { display: none; }
.toolbar select { padding-inline-end: 30px; background-position: left 10px center; }
/* Count bubbles: digits centred inside a fixed round box (Tajawal's tall line box pushed them out). */
.nav-badge, .stabs .cnt, .stabs button b, .an-tabs .cnt, .checks-card .cnt, .opp .count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 999px; font: 700 12px/1 system-ui, -apple-system, 'Segoe UI', sans-serif; font-variant-numeric: tabular-nums;
  vertical-align: middle; box-sizing: border-box; color: #fff; }
.opp .count { height: 24px; font-size: 13px; padding: 0 9px; }
/* Checkbox + its label (flags, names) on one centred line. */
.check { display: inline-flex; align-items: center; gap: 8px; }
.check input { margin: 0; }
.flag { font-size: 20px; line-height: 1; display: inline-block; font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif; }
.switch-row { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch-row input { margin: 0; }
.check.multi { display: flex; align-items: flex-start; }
.check.multi input { margin-top: 4px; }

/* Article editor: product cards */
.ap-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ap-head h2 { margin: 0; }
.prod-ed { border: 1px solid var(--line); border-radius: 12px; margin: 10px 0; background: #fff; }
.prod-ed > summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.prod-ed > summary::-webkit-details-marker { display: none; }
.prod-ed[open] > summary { border-bottom: 1px solid var(--line); }
.prod-ed > .grid, .prod-ed > .row { padding: 12px; }
.pe-img { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; flex: none; background: #fff; }
.pe-img img { width: 100%; height: 100%; object-fit: contain; }
.pe-big { width: 96px; height: 96px; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.pe-photo .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pe-actions { display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); }
.pv-prod { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 10px 0; }
.pv-prod img { width: 72px; height: 72px; object-fit: contain; }
.grid > .wide { grid-column: 1 / -1; }

/* Pop-ups page and banner/pop-up numbers */
.pop-body { display: grid; gap: 16px; }
.pop-imgs { display: grid; grid-template-columns: minmax(0, 160px) minmax(0, 300px); gap: 16px; align-items: start; }
.pop-img { display: grid; gap: 6px; justify-items: start; }
.pop-prev { width: 100%; border: 1px dashed var(--line); border-radius: 10px; background: #f6f8f7; display: grid; place-items: center; overflow: hidden; color: var(--muted); font-size: .85rem; }
.pop-img.mobile .pop-prev { aspect-ratio: 4 / 5; }
.pop-img.desktop .pop-prev { aspect-ratio: 16 / 9; }
.pop-prev img { width: 100%; height: 100%; object-fit: contain; }
.pop-mini { font-size: .8rem; white-space: nowrap; margin-inline-start: auto; }
.pop-mini + .row-tools { margin-inline-start: 8px; }
.pop-stats-head { justify-content: space-between; align-items: center; }
.pop-stats-head h2 { margin: 0; }
.pop-stats-head select { width: auto; }
.promo-tbl { width: 100%; border-collapse: collapse; }
.promo-tbl th, .promo-tbl td { text-align: center; white-space: nowrap; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.promo-tbl th { font-size: .82rem; color: var(--muted); font-weight: 600; }
.promo-tbl th:first-child, .promo-tbl td:first-child { text-align: start; }
.promo-tbl tr.sub td { font-size: .82rem; color: var(--muted); }
.promo-tbl tr.sub td:first-child { padding-inline-start: 24px; }

/* «✨ اكتبه بالإنجليزي» next to a field */
.ai-btn { justify-self: start; border: 1px solid #c7d2fe; background: #eef2ff; color: #3730a3; border-radius: 999px; padding: 2px 10px; font: inherit; font-size: .78rem; cursor: pointer; white-space: nowrap; }
.ai-btn:hover { background: #e0e7ff; }
.ai-btn:disabled { opacity: .6; cursor: wait; }

/* ---------- the app page (📱 التطبيق): settings on one side, a live phone preview on the other ---------- */
.app-cols { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.app-side { position: sticky; top: 16px; }
.app-prev-card { display: grid; gap: 10px; justify-items: center; }
.app-prev-seg { justify-content: center; }
.app-phone { width: 340px; max-width: 100%; height: 640px; border: 10px solid #15202b; border-radius: 36px; background: #f4f5f2; }
.app-checks { display: grid; gap: 2px; justify-items: start; }
.app-checks .check + .check { margin-inline-start: 0; }
.app-checks .check small { font-size: .8rem; }
.app-nums { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 8px; }
.field.wide { grid-column: 1 / -1; }
.app-tabs-tbl input[type="text"], .app-tabs-tbl input:not([type]) { width: 100%; min-width: 90px; }
.app-tabs-tbl td { vertical-align: middle; }
#app-who, #app-text, #app-tabs { scroll-margin-top: 16px; }
@media (max-width: 1100px) { .app-cols { grid-template-columns: minmax(0, 1fr); } .app-side { position: static; } .app-nums { grid-template-columns: minmax(0, 1fr); } }
#app-stats { scroll-margin-top: 16px; }
.app-stats-head { justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.app-stats-head h2 { margin: 0; }
#app-stats h3 { margin: 18px 0 0; font-size: 1rem; }
#app-stats .kpis { margin: 10px 0; }
.verdict { padding: 10px 14px; border-radius: 10px; margin: 6px 0 12px; }
.verdict.good { background: #dcf3ee; } .verdict.mid { background: #eef3f1; } .verdict.bad { background: #fdf0d5; }
.tab-bars { display: grid; gap: 6px; margin: 10px 0; max-width: 520px; }
.tab-bar { display: grid; grid-template-columns: 90px 1fr 60px; align-items: center; gap: 10px; }
.tab-bar i { display: block; height: 10px; border-radius: 999px; background: var(--teal, #0f766e); min-width: 4px; }
.tab-bar b { text-align: end; }
.app-stats-head { display: flex; }
.app-stats-head > div { display: flex; gap: 8px; flex-wrap: wrap; }
.app-stats-head select { width: auto; min-width: 130px; }
#app-stats .tbl th, #app-stats .tbl td { white-space: nowrap; }
#app-extras, #app-push { scroll-margin-top: 16px; }
.push-send { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.app-checks .check { flex-wrap: wrap; row-gap: 0; }
.app-checks .check small { flex-basis: 100%; padding-inline-start: 26px; margin-top: -6px; }

/* ---------- Telegram page ---------- */
.tg-switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; cursor: pointer; }
.tg-switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tg-switch i { position: absolute; inset: 0; background: #cfd8d5; border-radius: 99px; transition: background .2s; pointer-events: none; }
.tg-switch i::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 2px #0003; }
.tg-switch input:checked + i { background: var(--teal); }
.tg-switch input:checked + i::after { transform: translateX(-16px); }
[dir="ltr"] .tg-switch input:checked + i::after { transform: translateX(16px); }
.tg-switch input:focus-visible + i { outline: 2px solid var(--teal); outline-offset: 2px; }
.tg-switch.big { width: 52px; height: 30px; }
.tg-switch.big i::after { width: 24px; height: 24px; }
.tg-switch.big input:checked + i::after { transform: translateX(-22px); }
.tg-master { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 6px; border: 1px solid var(--line); border-radius: 99px; background: #fff; cursor: pointer; }
.tg-master.on { border-color: var(--teal); color: var(--teal); }
.tg-steps { margin: 0; padding-inline-start: 20px; display: grid; gap: 6px; }
.tg-chart { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding: 8px 0; border-bottom: 1px solid var(--line); margin-top: 12px; }
.tg-day { flex: 1; height: 100%; display: flex; align-items: flex-end; gap: 1px; min-width: 0; }
.tg-day i { flex: 1; border-radius: 3px 3px 0 0; min-height: 2px; }
.tg-day i.c, .tg-key.c { background: var(--teal); }
.tg-day i.p, .tg-key.p { background: var(--gold); }
.tg-key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; }
.tg-chans { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.tg-compose { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 18px; align-items: start; }
.tg-compose .field { margin-bottom: 10px; }
.tg-phone { background: #c9dcc4 linear-gradient(135deg, #d6e5cf, #b9d0b3); border-radius: 14px; padding: 14px; margin-top: 4px; min-height: 160px; }
.tg-bubble { background: #fff; border-radius: 12px 12px 12px 4px; padding: 10px 12px; box-shadow: 0 1px 2px #0002; font-size: .92rem; line-height: 1.55; overflow-wrap: anywhere; }
.tg-bubble code { background: #eef3f1; padding: 0 4px; border-radius: 4px; font-family: ui-monospace, monospace; }
.tg-btn { display: block; text-align: center; margin-top: 10px; padding: 7px; border-radius: 8px; background: #eef6ff; color: #2481cc; font-weight: 500; text-decoration: none; }
.tg-sched { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tg-sched.off .tg-sched-main { opacity: .55; }
.tg-sched-main { flex: 1; min-width: 200px; display: grid; }
.tg-form { margin-top: 14px; padding: 14px; border: 1px dashed var(--teal); border-radius: var(--radius); background: #f8fbfa; }
.tg-form .field { margin-bottom: 10px; }
.tg-days { display: flex; flex-wrap: wrap; gap: 6px; }
.tg-days .chip { display: inline-flex; gap: 4px; align-items: center; font-size: .85rem; padding: 4px 10px; cursor: pointer; }
.tg-msg { display: grid; grid-template-columns: 1fr 1fr 180px auto; gap: 6px; margin-bottom: 8px; align-items: start; }
.tg-ch-list { display: grid; gap: 8px; margin-bottom: 10px; }
.tg-ch { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) 150px 100px auto auto; gap: 8px; align-items: center; }
.tg-ch small { grid-column: 2 / -1; }
.tg-cut { max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) {
  .tg-compose { grid-template-columns: 1fr; }
  .tg-ch { grid-template-columns: auto 1fr 1fr; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .tg-ch input[data-c$=":name"] { grid-column: 2 / -1; }
  .tg-ch input[data-c$=":chat"] { grid-column: 1 / -1; }
  .tg-ch select[data-c$=":country"], .tg-ch [data-c-test] { grid-column: 1 / 3; }
  .tg-msg { grid-template-columns: 1fr; }
}

/* ---------- Security page ---------- */
.sec-checks { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 4px; }
.sec-checks li.no { color: var(--deal); }
.sec-qr { width: 200px; height: 200px; background: #fff; padding: 8px; border: 1px solid var(--line); border-radius: 10px; margin: 10px 0; }
.sec-qr svg { width: 100%; height: 100%; display: block; }
.sec-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; margin: 10px 0; }
.sec-codes code { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; text-align: center; font-size: 1rem; }
.login-box small { display: block; margin-top: 4px; font-weight: 400; }
