:root {
  /* Mirrors the public site's brand tokens so the portal and the marketplace read as one
     product. --success stays green on purpose: in this portal green means "published",
     "done", "available now" — a state, not the brand. */
  --primary: #1d4ed8;
  --primary-glow: #3b82f6;
  --primary-deep: #163fae;
  --primary-ink: #14224a;
  --success: #0c8153;        /* 4.91:1 — replaces #0e8c5b, which failed AA at 4.27:1 */
  --success-strong: #15a06a; /* backgrounds only, never text on white */
  --success-deep: #0d7a4f;
  --gold: #f5b544;
  --gold-fg: #3a2c00;
  --bg: #f7f9fc;
  --card: #ffffff;
  --fg: #16202e;
  --muted: #5c6a7d;
  --border: #e3e9f2;
  --radius: 12px;
  /* v3 — one 4px spacing scale, replacing the 6/8/10/14/18/20/26 drift the views improvised. */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  /* v3 — three control heights. Everything used to be one 12px/18px button. */
  --h-sm: 28px; --h-md: 34px; --h-lg: 40px;
  /* v3 — shadows are for things that float ABOVE the page (dialogs, menus, toasts).
     A panel sitting on the page gets a 1px border and nothing else, so that the few
     things which really do float read as floating. */
  --shadow: 0 1px 2px rgba(20, 34, 74, .04);
  --shadow-pop: 0 12px 32px -12px rgba(20, 34, 74, .28), 0 2px 6px -2px rgba(20, 34, 74, .12);
  /* Neutral tints, named so a dark scheme is a token flip rather than a hunt through
     the stylesheet for literal light values. */
  --surface-2: #fbfcfe;      /* hover on a white surface */
  --surface-3: #eef2f9;      /* quiet fill: ghost hover, zebra, chip ground */
  --tint-selected: #f4f8ff;  /* a selected row or an open sheet target */
  --border-strong: #c9d5e8;  /* a border that has been hovered */
  --shadow-lg: var(--shadow-pop);
}

* { box-sizing: border-box; }
/* overflow-x: clip stops any too-wide child (charts, tables, long unbroken strings)
   from widening the page — which in RTL shifts the whole shell and drags the fixed
   off-canvas drawer + sticky topbar into view. `clip` (not `hidden`) keeps position:
   sticky working and never clips the fixed drawer, which lives outside body flow. */
html { direction: rtl; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Heebo', 'Rubik', system-ui, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: 'Rubik', 'Heebo', sans-serif; letter-spacing: -.01em; }

.container { max-width: 1120px; margin-inline: auto; padding-inline: 16px; }
.brand-gradient { background: linear-gradient(135deg, var(--primary), var(--primary-glow)); }
.hero-gradient {
  background:
    radial-gradient(60% 80% at 80% 0%, color-mix(in oklab, var(--primary-glow) 35%, transparent), transparent 60%),
    radial-gradient(50% 70% at 0% 20%, rgba(245, 181, 68, .25), transparent 60%),
    linear-gradient(180deg, var(--primary), var(--primary-deep));
}

/* header */
.app-header { position: sticky; top: 0; z-index: 40; color: #fff; }
.app-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; }
.logo { font-weight: 800; font-size: 20px; }
.logo .dot { color: var(--gold); }
.logo small { display: block; opacity: .85; font-weight: 500; font-size: 11px; margin-top: -3px; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.nav a:hover { background: rgba(255, 255, 255, .14); }
.chip { background: rgba(255, 255, 255, .16); border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 600; }

/* hero */
.hero { color: #fff; padding: 22px 0 56px; position: relative; overflow: hidden; }
.hero .chip { background: rgba(245, 181, 68, .9); color: var(--gold-fg); }
.hero h1 { font-size: 38px; font-weight: 800; margin: 10px 0 4px; line-height: 1.1; }
.hero p { opacity: .92; margin: 0; }
.search {
  background: var(--card); color: var(--fg); border-radius: 24px; padding: 14px;
  margin-top: 22px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; flex-wrap: wrap;
}
.search input, .search select {
  flex: 1; min-width: 150px; border: 0; background: #eef4f1;
  border-radius: 14px; padding: 12px 14px; font: inherit; outline: none;
}

/* v3 — three heights instead of one. Before this, "סנן" in a filter toolbar was the same
   34px-tall, weight-800 slab as "שלחו לאישור", so nothing on a screen read as primary.
   inline-flex + a fixed height keeps <a> and <button> buttons on the same baseline, which
   the old padding-only rule did not. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--h-md); padding: 0 14px; border-radius: var(--r-sm, 8px);
  border: 1px solid var(--border); background: var(--card); color: var(--fg);
  font: inherit; font-size: 13.5px; font-weight: 600; line-height: 1;
  cursor: pointer; white-space: nowrap; text-decoration: none; vertical-align: middle;
}
.btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn .ico, .btn svg { width: 15px; height: 15px; flex: 0 0 auto; }
.btn-sm { height: var(--h-sm); padding: 0 10px; font-size: 12.5px; border-radius: var(--r-xs, 6px); }
.btn-sm .ico, .btn-sm svg { width: 14px; height: 14px; }
.btn-lg { height: var(--h-lg); padding: 0 18px; font-size: 14.5px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-deep); border-color: var(--primary-deep); }

/* sections */
section.block { padding: 28px 0; }
.block h2 { font-size: 22px; font-weight: 800; margin: 0 0 14px; }
.grid { display: grid; gap: 14px; }
.cats { grid-template-columns: repeat(2, 1fr); }
.cards { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) {
  .cats { grid-template-columns: repeat(5, 1fr); }
  .cards { grid-template-columns: repeat(4, 1fr); }
}

.cat {
  position: relative; border-radius: var(--radius); overflow: hidden; padding: 16px; min-height: 104px;
  color: #fff; display: flex; flex-direction: column; justify-content: flex-end;
  background: linear-gradient(135deg, var(--primary), var(--primary-glow));
  box-shadow: var(--shadow); transition: transform .2s;
}
.cat:hover { transform: translateY(-3px); }
.cat .name { font-weight: 800; font-size: 16px; }
.cat .sub { opacity: .85; font-size: 12px; }

.lc {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.lc:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.lc .img {
  aspect-ratio: 5 / 4; position: relative; display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: var(--muted);
  background: linear-gradient(135deg, color-mix(in oklab, var(--primary) 12%, transparent), color-mix(in oklab, var(--primary-glow) 14%, transparent));
}
.lc .img img { width: 100%; height: 100%; object-fit: cover; }
.lc .body { padding: 12px; }
.lc .title { font-weight: 700; font-size: 14px; }
.lc .meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; margin-top: 8px; }
.price { font-weight: 800; color: var(--primary); font-size: 15px; }
.badge { position: absolute; top: 8px; inset-inline-start: 8px; background: var(--gold); color: var(--gold-fg); border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 700; }

.notice { background: #fff7e6; border: 1px solid #f5d98a; color: #7a5b00; border-radius: var(--radius); padding: 16px; }
/* shared status banners — use these instead of hand-rolled inline colors */
.notice-warn { background: #fff7e6; border: 1px solid #f5d98a; color: #7a5b00; }
.notice-ok { background: #e9f8f0; border: 1px solid #a9e0c5; color: var(--success-deep); }
.notice-err { background: #fdeaea; border: 1px solid #f0a9a9; color: #b03a3a; }
/* button scale (beyond .btn-primary): promote the ad-hoc inline styles */
.btn-secondary { background: var(--muted); border-color: var(--muted); color: #fff; }
.btn-secondary:hover { background: #4b5769; border-color: #4b5769; }
/* Ghost is the quiet one: no border until you touch it. Views that want a visible
   outline should use the default .btn, which now has one. */
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--fg); }
.btn-danger { background: transparent; border-color: var(--danger-bd); color: var(--danger-fg); }
.btn-danger:hover { background: var(--danger-bg); border-color: var(--danger-fg); }
/* Destructive AND primary — only for a confirmed, irreversible action. */
.btn-danger-solid { background: var(--danger-fg); border-color: var(--danger-fg); color: #fff; }
.btn-danger-solid:hover { background: #96302f; border-color: #96302f; }

.foot { margin-top: 30px; border-top: 1px solid var(--border); color: var(--muted); padding: 18px 0; font-size: 14px; }

/* dashboard shell (admin / business) */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
/* desktop sidebar stays pinned so the nav never scrolls out of reach on long pages */
.side { background: var(--primary-ink); color: #cfd9ec; padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { font-weight: 800; color: #fff; font-size: 19px; margin-bottom: 6px; }
.side .brand .dot { color: var(--gold); }
.side .role { font-size: 12px; opacity: .7; margin-bottom: 18px; }
.side-search { margin: 0 0 12px; }
.side-search input {
  width: 100%; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .1);
  color: #fff; border-radius: 12px; padding: 9px 12px; font: inherit; font-size: 13.5px;
}
.side-search input::placeholder { color: rgba(255, 255, 255, .55); }
.side-search input:focus { outline: 2px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .16); }
.side a { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px; font-weight: 600; color: #cfd9ec; margin-bottom: 4px; }
.side a:hover, .side a.active { background: rgba(255, 255, 255, .12); color: #fff; }
.main { padding: var(--s5); min-width: 0; }
/* 24/600, not 26/800. In Hebrew a weight-800 heading reads as shouting and loses the
   letterform; hierarchy comes from size and colour instead. */
.main h1 { margin: 0 0 var(--s4); font-size: 24px; font-weight: 600; letter-spacing: -.005em; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 860px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); overflow: hidden; transition: transform .12s ease, box-shadow .12s ease; }
/* The coloured rail is a signal, not decoration: it appears only on a KPI that carries a
   tone (k-ok / k-warn / k-danger / k-info / k-gold, which set their own gradient below).
   Painting it on every tile made the whole row shout and none of it mean anything. */
.kpi::before { content: ""; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 3px;
  background: transparent; }
a.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
/* The number is the point of a KPI, so it stays large — but 600, and inheriting --fg
   unless a k-* tone says otherwise. Painting every KPI brand-blue made none of them stand out. */
.kpi .value { font-size: 27px; font-weight: 600; margin-top: var(--s1); color: var(--fg); line-height: 1.1; letter-spacing: -.015em; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s4); box-shadow: var(--shadow); margin-top: var(--s4); }
.panel h2 { font-size: 15px; font-weight: 600; margin: 0 0 var(--s3); display: flex; align-items: center; gap: var(--s2); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: start; padding: 10px; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-weight: 600; }

/* small numeric count chip for admin list tables (listings/cards per row) */
.count-pill { display: inline-block; min-width: 26px; text-align: center; padding: 2px 9px;
  border-radius: 999px; font-weight: 700; font-size: 13px; background: #eaf2ff; color: #1f4e9c; }
.count-pill-alt { background: #e9f8f0; color: var(--success-deep); }

/* bulk-actions bar above admin tables */
.bulk-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px;
  padding: 8px 12px; border: 1px dashed var(--border); border-radius: 12px; font-size: 13.5px; color: var(--muted); }
.bulk-bar select { border: 1px solid var(--border); border-radius: 10px; padding: 7px 10px; font: inherit; }
.bulk-bar b[data-bulk-count] { color: var(--primary); }

/* media field actions + media library dialog */
.media-actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.media-lib { border: 1px dashed var(--primary); background: transparent; color: var(--primary); border-radius: 10px; padding: 6px 12px; cursor: pointer; font: inherit; font-weight: 700; font-size: 13px; }
.media-lib:hover { background: color-mix(in oklab, var(--primary) 8%, transparent); }
dialog.medlib-dlg { border: 0; border-radius: 18px; padding: 16px; width: min(640px, 94vw); box-shadow: var(--shadow-lg); color: var(--fg); }
dialog.medlib-dlg::backdrop { background: rgba(0, 0, 0, .45); }
.medlib-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.medlib-x { border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--muted); }
.medlib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: min(52vh, 460px); overflow-y: auto; }
.medlib-item { border: 2px solid var(--border); background: none; border-radius: 12px; padding: 0; cursor: pointer; overflow: hidden; aspect-ratio: 1; }
.medlib-item:hover { border-color: var(--primary); }
.medlib-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.medlib-empty { color: var(--muted); text-align: center; padding: 20px 0; }

/* icon picker (builder fields + admin category form) */
.icon-pick { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.icon-pick-btn {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border);
  background: var(--card); border-radius: 12px; padding: 8px 12px; font: inherit; font-weight: 600;
  cursor: pointer; color: var(--fg); min-height: 42px;
}
.icon-pick-btn:hover { border-color: var(--primary); color: var(--primary); }
.icon-pick-btn .icon-prev { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; }
.icon-pick-btn .icon-prev svg { width: 20px; height: 20px; }
.icon-pick-btn .icon-none { color: var(--muted); }
.icon-pick-clear { border: 0; background: #fdeaea; color: #b03a3a; border-radius: 10px; width: 30px; height: 30px; cursor: pointer; font: inherit; font-weight: 700; }
dialog.icon-dlg {
  border: 0; border-radius: 18px; padding: 16px; width: min(560px, 94vw);
  box-shadow: var(--shadow-lg); color: var(--fg);
}
dialog.icon-dlg::backdrop { background: rgba(0, 0, 0, .45); }
.icon-dlg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.icon-dlg-x { border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--muted); }
.icon-dlg-search { width: 100%; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; font: inherit; margin-bottom: 12px; }
.icon-dlg-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px;
  max-height: min(48vh, 420px); overflow-y: auto; padding: 2px;
}
.icon-dlg-item {
  display: inline-flex; align-items: center; justify-content: center; aspect-ratio: 1;
  border: 1px solid var(--border); background: var(--card); border-radius: 12px; cursor: pointer;
  color: var(--fg); transition: border-color .12s, background .12s, color .12s;
}
.icon-dlg-item:hover { border-color: var(--primary); background: color-mix(in oklab, var(--primary) 8%, transparent); color: var(--primary); }
.icon-dlg-item svg { width: 21px; height: 21px; }
.icon-dlg-empty { color: var(--muted); text-align: center; padding: 18px 0; }

/* admin filter/toolbar row shared by the listings + risk consoles */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0 14px; }
.toolbar input[type=search], .toolbar select, .toolbar input[type=text] {
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font: inherit; }
.toolbar input[type=search] { min-width: min(220px, 100%); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; gap: 10px; flex-wrap: wrap; }
.pager .pg-info { color: var(--muted); font-size: 13px; }
.pager .pg-links { display: flex; gap: 8px; }
.chip-filter { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--card); color: var(--fg); font-size: 13px; font-weight: 600;
  text-decoration: none; cursor: pointer; }
.chip-filter.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-filter .n { opacity: .75; font-weight: 700; }
/* mobile top bar + off-canvas drawer (business + admin portals share this file) */
.topbar { display: none; }
.nav-scrim { display: none; }
/* shared responsive form grid (stacks on narrow screens) */
.form-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 640px) { .form-2 { grid-template-columns: 1fr; } }

/* Below this width the fixed sidebar is cramped (a 240px column eats a third of a
   tablet) and, worse, it is not sticky so the nav scrolls out of reach on long pages
   like the dashboard. So we switch to the hamburger drawer for tablets + phones. */
@media (max-width: 992px) {
  .shell { grid-template-columns: 1fr; }
  .main { padding: 18px 14px; }

  /* top bar with hamburger — the only nav entry point on mobile/tablet */
  .topbar {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 55;
    background: var(--primary-ink); color: #fff; padding: 10px 14px;
  }
  .topbar .hamburger {
    border: 0; background: rgba(255, 255, 255, .14); color: #fff; width: 42px; height: 42px;
    border-radius: 12px; font-size: 21px; line-height: 1; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .topbar .hamburger:hover { background: rgba(255, 255, 255, .26); }
  .topbar .tb-brand { font-weight: 800; font-size: 18px; }
  .topbar .tb-brand .dot { color: var(--gold); }
  .topbar .tb-spacer { flex: 1; }

  /* sidebar becomes an off-canvas drawer (RTL: pinned to the right, slides in from the right) */
  .side {
    position: fixed; inset-block: 0; inset-inline-start: 0; width: min(280px, 82vw);
    transform: translateX(100%); transition: transform .25s ease; z-index: 60;
    overflow-y: auto; box-shadow: var(--shadow-lg);
  }
  body.nav-open .side { transform: none; }
  .nav-scrim {
    display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 59;
    opacity: 0; pointer-events: none; transition: opacity .25s;
  }
  body.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }

  /* wide data tables → stacked cards (labels injected by site.js auto-label) */
  .main table.table.is-cardified,
  .main table.table.is-cardified tbody,
  .main table.table.is-cardified tr,
  .main table.table.is-cardified td { display: block; width: auto; }
  .main table.table.is-cardified thead { display: none; }
  .main table.table.is-cardified tr {
    background: var(--card); border: 1px solid var(--border); border-radius: 14px;
    padding: 12px 14px; margin-bottom: 12px; box-shadow: var(--shadow);
  }
  .main table.table.is-cardified td { border: 0; padding: 6px 0; text-align: start; }
  .main table.table.is-cardified td + td { border-top: 1px solid var(--border); padding-top: 8px; margin-top: 2px; }
  .main table.table.is-cardified td[data-label]::before {
    content: attr(data-label) ": "; display: block; font-weight: 700;
    color: var(--muted); font-size: 12px; margin-bottom: 2px;
  }
  /* action cells use inline white-space:nowrap for the desktop table; once cardified
     to full-width rows, let their buttons/links + inline flex forms wrap instead of
     overflowing the card. */
  .main table.table.is-cardified td { white-space: normal !important; }
  .main table.table.is-cardified td form { flex-wrap: wrap; }
  .main table.table.is-cardified td[style*="text-align:end"] { text-align: start !important; }
}

/* ---- promo slider ---- */
.promo { position: relative; height: 210px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-top: -28px; }
@media (min-width: 720px) { .promo { height: 280px; } }
.promo .slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s; }
.promo .slide.on { opacity: 1; }
.promo .slide img { width: 100%; height: 100%; object-fit: cover; }
.promo .slide .ov { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 26px; color: #fff;
  background: linear-gradient(to left, color-mix(in oklab, var(--primary-deep) 90%, transparent), color-mix(in oklab, var(--primary) 40%, transparent) 60%, transparent); }
.promo .slide h3 { font-size: 24px; margin: 0 0 6px; }
.promo .slide p { margin: 0 0 12px; opacity: .95; }
.promo .pill { align-self: flex-start; background: #fff; color: var(--primary); border-radius: 999px; padding: 8px 16px; font-weight: 700; font-size: 13px; }
.promo .dots { position: absolute; bottom: 10px; inset-inline: 0; display: flex; gap: 6px; justify-content: center; }
.promo .dots span { width: 7px; height: 7px; border-radius: 999px; background: rgba(255, 255, 255, .5); }
.promo .dots span.on { width: 22px; background: #fff; }

/* ---- category icon ---- */
.cat .ico { align-self: flex-end; background: rgba(255, 255, 255, .18); border-radius: 14px; padding: 9px; display: inline-flex; }
.cat .ico svg { width: 22px; height: 22px; }
.cat .count { opacity: .9; font-size: 12px; }

/* ---- listing detail ---- */
.detail-hero { position: relative; height: 320px; }
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }
.detail-hero .ov { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.7), transparent 55%); display: flex; align-items: flex-end; }
.detail-hero .ov .c { color: #fff; padding: 24px; }
.detail-hero h1 { font-size: 30px; margin: 6px 0; }
.detail-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; max-width: 360px; }
.detail-actions .btn { display: flex; gap: 8px; align-items: center; justify-content: center; }
.btn-soft { background: var(--card); border-color: var(--border); color: var(--fg); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: var(--success-deep); border-color: var(--success-deep); }

/* ---- business profile (card page) ---- */
.card-theme-emerald { --c-bg:#f7faf8; --c-surface:#fff; --c-text:#15241d; --c-muted:#5b6b63; --c-primary:#0e8c5b; --c-primary-fg:#fff; --c-accent:#f5b544; --c-accent-fg:#3a2c00; --c-border:#e4ece8; }
.card-theme-noir { --c-bg:#121212; --c-surface:#1c1c1c; --c-text:#f3ead0; --c-muted:#b6a98a; --c-primary:#c9a84c; --c-primary-fg:#121212; --c-accent:#e7c873; --c-accent-fg:#121212; --c-border:rgba(255,255,255,.12); }
.ct-bg { background: var(--c-bg); color: var(--c-text); }
.ct-surface { background: var(--c-surface); color: var(--c-text); border: 1px solid var(--c-border); }
.ct-primary { background: var(--c-primary); color: var(--c-primary-fg); }
.ct-accent { background: var(--c-accent); color: var(--c-accent-fg); }
.profile-cover { height: 270px; position: relative; }
.profile-cover img { width: 100%; height: 100%; object-fit: cover; }
.profile-cover .veil { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.3), transparent 45%, var(--c-bg)); }
.profile-head { max-width: 760px; margin: -92px auto 0; padding: 0 16px; text-align: center; position: relative; }
.profile-logo { width: 140px; height: 140px; border-radius: 50%; overflow: hidden; border: 6px solid var(--c-bg); margin: 0 auto; box-shadow: var(--shadow-lg); }
.profile-logo img { width: 100%; height: 100%; object-fit: cover; }
.profile-head h1 { font-size: 34px; margin: 14px 0 2px; color: var(--c-text); }
.profile-head .prof { color: var(--c-muted); }
.profile-meta { display: flex; gap: 16px; justify-content: center; color: var(--c-muted); font-size: 14px; margin-top: 8px; flex-wrap: wrap; }
.status-open { color: var(--success); font-weight: 800; }
.status-closed { color: #c0392b; font-weight: 800; }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 520px; margin: 22px auto 0; }
@media (min-width: 640px) { .quick { grid-template-columns: repeat(6, 1fr); } }
.quick a { display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--c-muted); font-size: 12px; }
.quick .ico { width: 54px; height: 54px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: var(--c-surface); border: 1px solid var(--c-border); }
.quick .ico.accent { background: var(--c-accent); color: var(--c-accent-fg); border: 0; }
.psection { max-width: 760px; margin: 34px auto 0; padding: 0 16px; }
.psection h2 { display: flex; align-items: center; gap: 10px; color: var(--c-text); font-size: 22px; }
.psection h2:before { content: ""; width: 30px; height: 4px; border-radius: 999px; background: var(--c-accent); }
.svc { display: grid; gap: 10px; }
@media (min-width: 640px) { .svc { grid-template-columns: 1fr 1fr; } }
.svc .item { display: flex; justify-content: space-between; gap: 10px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 16px; padding: 14px; }
.svc .price { color: var(--c-primary); font-weight: 800; }
.prod { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .prod { grid-template-columns: repeat(4, 1fr); } }
.prod .item { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 16px; overflow: hidden; }
.prod .item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.prod .item .b { padding: 10px; display: flex; justify-content: space-between; align-items: center; }
.pgallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 640px) { .pgallery { grid-template-columns: repeat(3, 1fr); } }
.pgallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; }
.faq { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 16px; padding: 14px; margin-bottom: 8px; }
.faq summary { font-weight: 700; cursor: pointer; color: var(--c-text); }
.faq p { color: var(--c-muted); margin: 8px 0 0; }
.cform input, .cform textarea { width: 100%; border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-text); border-radius: 12px; padding: 12px; margin-bottom: 10px; font: inherit; }

/* ===== builder two-pane + modal ===== */
.builder-grid { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1000px) { .builder-grid { grid-template-columns: minmax(380px, 1fr) 1fr; } .builder-preview { position: sticky; top: 16px; } }
/* below the two-pane width: tab between the editor and the live preview so the
   78vh iframe doesn't bury the form on a phone */
.builder-tabs { display: none; }
@media (max-width: 999px) {
  .builder-tabs {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px;
    position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 8px 0;
  }
  .bt-tab {
    border: 1.5px solid var(--border); background: var(--card); color: var(--fg);
    border-radius: 12px; padding: 12px; font: inherit; font-weight: 700; cursor: pointer;
  }
  .bt-tab.is-active { border-color: var(--primary); background: color-mix(in oklab, var(--primary) 12%, transparent); color: var(--primary); }
  .builder-grid.show-preview .builder-edit { display: none; }
  .builder-grid:not(.show-preview) .builder-preview { display: none; }
}
/* offset the sticky tabs below the portal's mobile/tablet top bar */
@media (max-width: 992px) { .builder-tabs { top: 64px; } }

/* edit-language focus: a toggle picks one language; the other language's fields hide.
   Both He/Ar values are still submitted — this is display focus only. */
.edit-lang { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.edit-lang-label { font-weight: 700; font-size: 14px; color: var(--muted); }
.el-opt { border: 1.5px solid var(--border); background: var(--card); color: var(--fg); border-radius: 999px; padding: 7px 16px; font: inherit; font-weight: 700; cursor: pointer; }
.el-opt:hover { border-color: var(--primary); }
.el-opt.is-active { border-color: var(--primary); background: color-mix(in oklab, var(--primary) 12%, transparent); color: var(--primary); }
body[data-edit-lang="he"] [data-lang="ar"] { display: none; }
body[data-edit-lang="ar"] [data-lang="he"] { display: none; }

/* ===== admin structure tree (User → Business → Cards/Listings) ===== */
.tree-node { border: 1px solid var(--border); border-radius: 14px; background: var(--card); margin-bottom: 10px; }
.tree-node > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; font-weight: 700; }
.tree-node > summary::-webkit-details-marker { display: none; }
.tree-node > summary::before { content: "\25B8"; color: var(--muted); font-size: 13px; transition: transform .15s; }
.tree-node[open] > summary::before { transform: rotate(90deg); }
.tree-owner > summary { background: color-mix(in oklab, var(--primary) 6%, transparent); border-radius: 14px; }
.tree-children { padding: 6px 14px 12px; padding-inline-start: 32px; }
.tree-biz { margin: 8px 0; }
.tree-biz > summary { font-size: 14px; }
.tw-title { font-weight: 800; }
.tw-sub { color: var(--muted); font-weight: 500; font-size: 13px; }
.tw-counts { color: var(--muted); font-weight: 500; font-size: 12px; margin-inline-start: auto; }
.tw-badge { background: color-mix(in oklab, var(--primary) 14%, transparent); color: var(--primary); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; }
.tw-badge.tw-muted { background: var(--border); color: var(--muted); }
.tw-badge.tw-bad { background: #fdeaea; color: #b03a3a; }
.tw-manage { color: var(--primary); font-weight: 700; font-size: 12px; }
.tree-leaf { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tree-leaf:last-child { border-bottom: 0; }
.tl-ico { flex: 0 0 auto; }
.tl-main { flex: 1; min-width: 160px; font-weight: 700; }
.tl-meta { color: var(--muted); font-weight: 500; font-size: 12px; }
.tl-actions { display: flex; gap: 12px; }
.tl-actions a { color: var(--primary); font-weight: 700; font-size: 13px; }

/* ===== card theme gallery (visual picker) + per-card colour overrides ===== */
.theme-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 4px; }
.theme-swatch { border: 2px solid var(--border); border-radius: 14px; padding: 8px; background: var(--card); cursor: pointer; font: inherit; display: flex; flex-direction: column; gap: 6px; transition: transform .12s, border-color .12s, box-shadow .12s; }
.theme-swatch:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.theme-swatch.is-active { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 22%, transparent); }
.theme-swatch .ts-bars { display: flex; height: 34px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.theme-swatch .ts-bars span { flex: 1; }
.theme-swatch .ts-name { font-weight: 700; font-size: 12.5px; color: var(--fg); text-align: center; }

.theme-overrides { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: color-mix(in oklab, var(--bg) 55%, transparent); }
.theme-overrides > summary { cursor: pointer; font-weight: 700; }
.ov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-top: 12px; }
@media (max-width: 540px) { .ov-grid { grid-template-columns: 1fr; } }
.ov-row { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; margin: 0; }
.ov-row .ov-name { flex: 1; }
.ov-row input[type=color] { width: 42px; height: 28px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: none; cursor: pointer; }
.ov-row input[type=color]:disabled { opacity: .4; cursor: not-allowed; }

/* builder: touch-friendliness + no horizontal overflow on small screens */
@media (max-width: 560px) {
  .gal-rows, .tpl-grid, .addsec-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .map-canvas { height: 200px; }
  .wh-times input[type=time] { padding: 9px 8px; min-height: 42px; }
  .wh-add-shift { padding: 8px 12px; }
  .wh-chip { padding: 8px 14px; }
  .rte-tools button { min-width: 40px; height: 38px; }
  .seg-opt { padding: 10px 14px; }
}
.preview-frame { width: 100%; height: 78vh; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }
.preview-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.sec-row { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: var(--card); }
.sec-row.hidden-sec { opacity: .5; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); background: var(--card); border-radius: 10px; width: 34px; height: 34px; cursor: pointer; font-size: 15px; text-decoration: none; color: inherit; }
.iconbtn:hover { background: var(--muted); color: #fff; }
dialog.sec-modal { border: 0; border-radius: 18px; padding: 0; width: min(640px, 94vw); box-shadow: var(--shadow-lg); color: var(--fg); }
dialog.sec-modal::backdrop { background: rgba(0, 0, 0, .45); }
.sec-modal header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 800; }
.sec-modal .body { padding: 18px; max-height: 70vh; overflow: auto; }
.sec-modal .x { border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--muted); }
.fld { display: block; font-weight: 700; margin-bottom: 10px; }
.fld input, .fld textarea, .fld select { width: 100%; border: 1px solid var(--border); border-radius: 12px; padding: 10px; font: inherit; margin-top: 4px; }
.chk { display: flex; gap: 8px; align-items: center; margin: 6px 0; font-weight: 600; }
.repeater { margin-bottom: 8px; }
.rep-row { border: 1px solid var(--border); border-radius: 10px; padding: 10px; margin-bottom: 8px; background: color-mix(in oklab, var(--bg) 55%, transparent); }
.btn-add { border: 1px dashed var(--primary); background: transparent; color: var(--primary); border-radius: 10px; padding: 8px 12px; cursor: pointer; font: inherit; font-weight: 700; }
.btn-remove { border: 0; background: #fdeaea; color: #b03a3a; border-radius: 8px; padding: 5px 10px; cursor: pointer; font: inherit; font-weight: 700; margin-top: 6px; }
.drag { cursor: grab; color: var(--muted); padding: 2px 6px; font-size: 18px; user-select: none; line-height: 1; }
.drag:active { cursor: grabbing; }
.sortable-ghost { opacity: .4; }
.sortable-chosen { box-shadow: var(--shadow); }
.dropzone { border: 2px dashed var(--border); border-radius: 12px; padding: 14px; text-align: center; cursor: pointer; margin-top: 4px; transition: border-color .15s, background .15s; }
.dropzone.drag-over { border-color: var(--primary); background: color-mix(in oklab, var(--primary) 8%, transparent); }
.media-field { margin-top: 4px; }
.media-prev { max-width: 100%; max-height: 140px; border-radius: 10px; margin: 0 auto 8px; display: block; }
.media-hint { color: var(--muted); font-size: 13px; }
/* preview edit mode (click items to edit) */
.pv-edit [data-ei] { cursor: pointer; }
.pv-edit [data-ei]:hover { outline: 2px solid var(--c-primary); outline-offset: 2px; border-radius: 6px; }
.pv-add { display: inline-block; margin-top: 10px; border: 1px dashed var(--c-primary); background: transparent; color: var(--c-primary); border-radius: 10px; padding: 6px 12px; cursor: pointer; font: inherit; font-weight: 700; }

/* ===== builder pro: smart field editors ===== */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 12px; align-items: start; }
.field-grid > .span-2, .field-grid > .repeater { grid-column: 1 / -1; }
.field-grid > .fld { margin-bottom: 0; }
@media (max-width: 540px) { .field-grid { grid-template-columns: 1fr; } }
.fld-label { display: block; font-weight: 700; margin-bottom: 4px; font-size: 14px; }
.fld-help { display: block; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 4px; }
.fld.mono textarea { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }

/* segmented choice / icon picker */
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg-opt { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--border); background: var(--card); color: var(--fg); border-radius: 12px; padding: 8px 12px; cursor: pointer; font: inherit; font-weight: 600; font-size: 13px; transition: all .12s; }
.seg-opt:hover { border-color: var(--primary); }
.seg-opt svg { width: 16px; height: 16px; }
.seg-opt.is-active { border-color: var(--primary); background: color-mix(in oklab, var(--primary) 12%, transparent); color: var(--primary); }

/* rich text editor */
.rte { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.rte-tools { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px; border-bottom: 1px solid var(--border); background: color-mix(in oklab, var(--bg) 60%, transparent); }
.rte-tools button { min-width: 32px; height: 30px; border: 1px solid transparent; background: transparent; border-radius: 8px; cursor: pointer; font: inherit; color: var(--fg); }
.rte-tools button:hover { background: var(--card); border-color: var(--border); }
.rte-area { min-height: 120px; padding: 12px; outline: none; line-height: 1.7; }
.rte-area:focus { background: color-mix(in oklab, var(--primary) 3%, transparent); }
.rte-area h3 { margin: .4em 0; }

/* single image */
.media-clear { margin-top: 6px; border: 0; background: #fdeaea; color: #b03a3a; border-radius: 8px; padding: 5px 10px; cursor: pointer; font: inherit; font-weight: 700; }

/* repeater header */
.rep-head { font-weight: 800; margin: 4px 0 8px; }

/* gallery (multi image) */
.gallery-drop { border: 2px dashed var(--primary); border-radius: 12px; padding: 16px; text-align: center; cursor: pointer; color: var(--primary); font-weight: 600; margin-bottom: 10px; transition: background .15s; }
.gallery-drop.drag-over { background: color-mix(in oklab, var(--primary) 10%, transparent); }
.gal-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gal-cell { position: relative; }
.gal-cell .field-grid { grid-template-columns: 1fr; gap: 6px; }
.gal-cell .media-prev { max-height: 96px; }
.gal-cell .dropzone { padding: 8px; }
.gal-cell .drag { position: absolute; top: 6px; inset-inline-start: 6px; z-index: 2; background: rgba(255,255,255,.85); border-radius: 6px; }

/* work hours */
.wh-presets { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.wh-chip { border: 1px solid var(--border); background: var(--card); border-radius: 999px; padding: 6px 12px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; }
.wh-chip:hover { border-color: var(--primary); color: var(--primary); }
.wh-day { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--border); }
.wh-name { width: 52px; font-weight: 700; }
.wh-closed { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; margin: 0; }
.wh-times { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wh-times input[type=time] { border: 1px solid var(--border); border-radius: 8px; padding: 6px; font: inherit; }
.wh-sep { color: var(--muted); }
.wh-second.is-hidden { display: none; }
.wh-add-shift { border: 1px dashed var(--border); background: transparent; color: var(--muted); border-radius: 8px; padding: 5px 9px; cursor: pointer; font: inherit; font-size: 12px; }
.wh-day.is-closed .wh-times { opacity: .4; pointer-events: none; }

/* map picker */
.map-canvas { height: 280px; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 4px; z-index: 0; }

/* slug helper */
.slug-row { display: flex; gap: 8px; align-items: center; }
.slug-row input { flex: 1; }
.slug-ok { color: var(--success); font-weight: 700; }
.slug-bad { color: #b03a3a; font-weight: 700; }

/* progress checklist */
.progress-panel { padding: 14px 16px; }
.progress-bar { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.progress-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--gold)); border-radius: 999px; transition: width .3s; }
.progress-items { display: flex; flex-wrap: wrap; gap: 8px; }
.progress-item { font-size: 13px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; }
.progress-item.done { color: var(--success); border-color: #9be0c2; background: #e6f7ef; font-weight: 600; }

/* starter templates */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tpl-grid form { margin: 0; }
.tpl-card { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; border: 1.5px solid var(--border); background: var(--card); border-radius: 14px; padding: 16px 10px; cursor: pointer; font: inherit; transition: all .12s; }
.tpl-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.tpl-card svg { width: 28px; height: 28px; color: var(--primary); }
.tpl-name { font-weight: 800; }
.tpl-meta { font-size: 12px; color: var(--muted); }

/* add-section picker grid */
.addsec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.addsec-grid form { margin: 0; }
.addsec-card { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 5px; border: 1.5px solid var(--border); background: var(--card); border-radius: 14px; padding: 14px 10px; cursor: pointer; font: inherit; color: var(--fg); text-decoration: none; transition: all .12s; }
.addsec-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.addsec-card svg { width: 24px; height: 24px; color: var(--primary); }
.addsec-name { font-weight: 700; }
.addsec-desc { font-size: 12px; color: var(--muted); line-height: 1.4; }
.addsec-card.is-locked { opacity: .65; }
.addsec-card.is-locked svg { color: var(--muted); }
.addsec-lock { position: absolute; top: 8px; inset-inline-start: 8px; font-size: 14px; }

/* section row icon */
.sec-ico { width: 18px; height: 18px; color: var(--muted); }

/* preview device toggle */
.device-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.device-toggle button { border: 0; background: var(--card); padding: 4px 10px; cursor: pointer; font-size: 15px; }
.device-toggle button.is-active { background: var(--primary); }
.pv-wrap.is-mobile .preview-frame { max-width: 390px; margin: 0 auto; display: block; height: 80vh; }

/* preview embedded video */
.pv-video { position: relative; padding-top: 56.25%; border-radius: 14px; overflow: hidden; }
.pv-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* optional per-service icon (builder preview parity with the public card) */
.svc-ico {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: color-mix(in oklab, var(--c-primary) 12%, transparent); color: var(--c-primary);
}
.svc-ico svg { width: 20px; height: 20px; }

/* ===== system themes (data-theme on <html>) ===== */
[data-theme="indigo"] {
  --bg: oklch(0.985 0.005 270); --fg: oklch(0.18 0.05 270); --card: oklch(1 0 0);
  --primary: oklch(0.32 0.13 270); --primary-glow: oklch(0.55 0.18 268); --gold: oklch(0.83 0.15 78);
  --muted: oklch(0.5 0.03 270); --border: oklch(0.91 0.01 270);
}
[data-theme="sunset"] {
  --bg: oklch(0.985 0.012 60); --fg: oklch(0.2 0.04 40); --card: oklch(1 0 0);
  --primary: oklch(0.55 0.18 38); --primary-glow: oklch(0.72 0.18 55); --gold: oklch(0.78 0.15 80);
  --muted: oklch(0.5 0.04 40); --border: oklch(0.92 0.02 55);
}
[data-theme="plum"] {
  --bg: oklch(0.985 0.008 320); --fg: oklch(0.2 0.06 320); --card: oklch(1 0 0);
  --primary: oklch(0.4 0.16 320); --primary-glow: oklch(0.7 0.2 340); --gold: oklch(0.78 0.16 340);
  --muted: oklch(0.5 0.04 320); --border: oklch(0.92 0.02 320);
}
[data-theme="teal"] {
  --bg: oklch(0.98 0.005 220); --fg: oklch(0.18 0.03 230); --card: oklch(1 0 0);
  --primary: oklch(0.28 0.04 230); --primary-glow: oklch(0.7 0.13 195); --gold: oklch(0.74 0.14 195);
  --muted: oklch(0.5 0.02 230); --border: oklch(0.91 0.01 220);
}

/* ===== card themes (extra) ===== */
.card-theme-cream { --c-bg: oklch(0.97 0.015 75); --c-surface: oklch(0.99 0.008 75); --c-text: oklch(0.22 0.04 50); --c-muted: oklch(0.5 0.03 50); --c-primary: oklch(0.48 0.08 50); --c-primary-fg: oklch(0.99 0.01 70); --c-accent: oklch(0.7 0.1 55); --c-accent-fg: oklch(0.18 0.04 50); --c-border: oklch(0.88 0.02 70); }
.card-theme-aurora { --c-bg: oklch(0.16 0.04 270); --c-surface: oklch(0.22 0.05 265); --c-text: oklch(0.97 0.01 270); --c-muted: oklch(0.72 0.03 270); --c-primary: oklch(0.78 0.18 155); --c-primary-fg: oklch(0.14 0.04 270); --c-accent: oklch(0.72 0.17 305); --c-accent-fg: oklch(0.14 0.04 270); --c-border: oklch(1 0 0 / 14%); }
.card-theme-brutal { --c-bg: oklch(1 0 0); --c-surface: oklch(1 0 0); --c-text: oklch(0.12 0 0); --c-muted: oklch(0.35 0 0); --c-primary: oklch(0.12 0 0); --c-primary-fg: oklch(1 0 0); --c-accent: oklch(0.68 0.22 35); --c-accent-fg: oklch(1 0 0); --c-border: oklch(0.12 0 0); }

/* Kept byte-identical to the public site's definitions — including the layout tokens — so the
   builder preview and the live card render the same. Every --c-primary clears AA on white. */
.card-theme-azure { --c-bg:#f5f7fa; --c-surface:#fff; --c-text:#111827; --c-muted:#6b7280; --c-primary:#2563eb; --c-primary-fg:#fff; --c-accent:#f59e0b; --c-accent-fg:#3a2c00; --c-border:#e2e8f0;
  --c-radius:12px; --c-border-w:1px; --c-shadow:0 6px 18px -10px rgba(37,99,235,.35); --c-space:12px; }
.card-theme-violet { --c-bg:#faf9fe; --c-surface:#fff; --c-text:#1f2937; --c-muted:#6b7280; --c-primary:#7c3aed; --c-primary-fg:#fff; --c-accent:#a855f7; --c-accent-fg:#fff; --c-border:#e9e5f5;
  --c-radius:20px; --c-border-w:0px; --c-shadow:0 16px 40px -18px rgba(124,58,237,.45); --c-space:15px; }
.card-theme-sunset { --c-bg:#fff7ed; --c-surface:#fff; --c-text:#7c2d12; --c-muted:#9a6b4f; --c-primary:#c2410c; --c-primary-fg:#fff; --c-accent:#f97316; --c-accent-fg:#43180a; --c-border:#fbe3ce;
  --c-radius:18px; --c-border-w:1px; --c-shadow:0 10px 28px -14px rgba(194,65,12,.4); --c-space:14px; }
.card-theme-slate { --c-bg:#f3f4f6; --c-surface:#fff; --c-text:#111827; --c-muted:#6b7280; --c-primary:#111827; --c-primary-fg:#fff; --c-accent:#374151; --c-accent-fg:#fff; --c-border:#e5e7eb;
  --c-radius:8px; --c-border-w:1px; --c-shadow:none; --c-space:12px; --c-heading-spacing:.01em; }

/* ===== theme picker (settings) ===== */
.swatches { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 720px) { .swatches { grid-template-columns: repeat(3, 1fr); } }
.swatch { border: 2px solid var(--border); border-radius: 16px; padding: 12px; cursor: pointer; background: var(--card); text-align: start; transition: border-color .15s, box-shadow .15s; }
.swatch.active { border-color: var(--primary); box-shadow: var(--shadow); }
.swatch .bar { display: flex; height: 44px; border-radius: 12px; overflow: hidden; }
.swatch .bar span { flex: 1; }
.swatch .row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-weight: 700; }
.swatch .check { width: 22px; height: 22px; border-radius: 999px; background: var(--primary); color: #fff; display: none; align-items: center; justify-content: center; font-size: 13px; }
.swatch.active .check { display: inline-flex; }

/* The owner portal / admin have no bottom nav — the previous `.bottomnav`
   rules + `body{padding-bottom:84px}` reserved 84px of empty space at the
   foot of every mobile page for a component that was never rendered. Removed. */

/* ===== toasts (shared feedback — see window.souqToast) ===== */
.toasts { position: fixed; inset-block-end: 22px; inset-inline: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: #15241d; color: #fff; border-radius: 999px; padding: 10px 18px; font-size: 14px; font-weight: 700; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(10px); transition: .25s; max-width: 90%; }
.toast.in { opacity: 1; transform: none; }
.toast-ok { background: var(--success-deep); }
.toast-err { background: #b03a3a; }

/* styled confirm dialog reuses .sec-modal; keep it compact */
dialog.confirm-modal { border: 0; border-radius: 16px; padding: 0; width: min(420px, 92vw); box-shadow: var(--shadow-lg); color: var(--fg); }
dialog.confirm-modal::backdrop { background: rgba(0,0,0,.45); }

/* ============================================================
   Design-system foundation (v2) — shared component layer
   One vocabulary for status, headers, KPIs, tables, empty states,
   nav and charts so the ad-hoc inline styles across views can retire.
   ============================================================ */
:root {
  /* 3-step radius scale (collapses the 8/10/12/14/16/18/22 drift) */
  --r-xs: 6px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
  /* semantic status triplets: one canonical ok / warn / danger / info */
  --ok-bg: #e9f8f0;     --ok-bd: #a9e0c5;  --ok-fg: var(--success-deep);
  --warn-bg: #fff7e6;   --warn-bd: #f5d98a; --warn-fg: #8a6400;
  --danger-bg: #fdeaea; --danger-bd: #f0a9a9; --danger-fg: #b03a3a;
  --info-bg: #eaf2ff;   --info-bd: #bcd4f5; --info-fg: #1f4e9c;
}

/* --- status pill: replaces every hand-inlined colored badge/text-status --- */
.status-pill {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px;
  padding: 3px 11px; font-size: 12px; font-weight: 700; line-height: 1.55;
  border: 1px solid transparent; white-space: nowrap;
}
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: currentColor; opacity: .85; flex: 0 0 auto; }
.status-pill.no-dot::before { display: none; }
.status-pill.ok { background: var(--ok-bg); border-color: var(--ok-bd); color: var(--ok-fg); }
.status-pill.warn { background: var(--warn-bg); border-color: var(--warn-bd); color: var(--warn-fg); }
.status-pill.danger { background: var(--danger-bg); border-color: var(--danger-bd); color: var(--danger-fg); }
.status-pill.info { background: var(--info-bg); border-color: var(--info-bd); color: var(--info-fg); }
.status-pill.muted { background: var(--border); color: var(--muted); }
.notice-info { background: var(--info-bg); border: 1px solid var(--info-bd); color: var(--info-fg); }

/* --- panel header: title (+subtitle) with a right-aligned action slot --- */
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.panel-head .ph-title { font-size: 18px; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 8px; }
.panel-head .ph-title svg { width: 20px; height: 20px; color: var(--primary); }
.panel-head .ph-sub { color: var(--muted); font-size: 13px; margin: 3px 0 0; font-weight: 500; }
.panel-head .ph-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.panel-head .ph-actions .seeall, .panel-head .ph-actions a.link { color: var(--primary); font-weight: 800; font-size: 14px; white-space: nowrap; }

/* --- KPI polish: optional icon + semantic accent + trend delta chip --- */
.kpi .value { font-variant-numeric: tabular-nums; }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi .kpi-ico { width: 38px; height: 38px; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in oklab, var(--primary) 12%, var(--card)); color: var(--primary); flex: 0 0 auto; }
.kpi .kpi-ico svg { width: 20px; height: 20px; }
.kpi .delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 800; border-radius: 999px; padding: 2px 8px; font-variant-numeric: tabular-nums; }
.kpi .delta.up { background: var(--ok-bg); color: var(--ok-fg); }
.kpi .delta.down { background: var(--danger-bg); color: var(--danger-fg); }
.kpi .delta.flat { background: var(--border); color: var(--muted); }
/* semantic metric accent: recolours the left bar, value and icon by meaning */
.kpi.k-ok::before { background: linear-gradient(180deg, var(--success-strong), var(--success-deep)); }
.kpi.k-ok .value { color: var(--ok-fg); } .kpi.k-ok .kpi-ico { background: var(--ok-bg); color: var(--ok-fg); }
.kpi.k-warn::before { background: linear-gradient(180deg, #f5b544, #b45309); }
.kpi.k-warn .value { color: var(--warn-fg); } .kpi.k-warn .kpi-ico { background: var(--warn-bg); color: var(--warn-fg); }
.kpi.k-danger::before { background: linear-gradient(180deg, #f0846b, #b03a3a); }
.kpi.k-danger .value { color: var(--danger-fg); } .kpi.k-danger .kpi-ico { background: var(--danger-bg); color: var(--danger-fg); }
.kpi.k-info::before { background: linear-gradient(180deg, #7bb8ff, #1f4e9c); }
.kpi.k-info .value { color: var(--info-fg); } .kpi.k-info .kpi-ico { background: var(--info-bg); color: var(--info-fg); }
.kpi.k-gold::before { background: linear-gradient(180deg, #f5b544, #d69412); }
.kpi.k-gold .value { color: #b45309; } .kpi.k-gold .kpi-ico { background: #fdeede; color: #b45309; }

/* --- table polish: hover, tabular numerals, optional zebra + sticky head --- */
.table td { font-variant-numeric: tabular-nums; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: color-mix(in oklab, var(--primary) 5%, transparent); }
.table.zebra tbody tr:nth-child(even) { background: color-mix(in oklab, var(--bg) 55%, transparent); }
.table.zebra tbody tr:hover { background: color-mix(in oklab, var(--primary) 7%, transparent); }
.table.sticky-head thead th { position: sticky; top: 0; background: var(--card); z-index: 1; }
/* mini inline bar for in-table distribution (category counts, etc.) */
.tbar { display: inline-block; height: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--primary-glow), var(--primary)); vertical-align: middle; min-width: 2px; }

/* --- empty state: centered icon + headline + hint (+ optional CTA) --- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-state .es-ico { width: 58px; height: 58px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in oklab, var(--primary) 10%, var(--card)); color: var(--primary); margin-bottom: 12px; }
.empty-state .es-ico svg { width: 28px; height: 28px; }
.empty-state h3 { font-size: 17px; margin: 0 0 4px; color: var(--fg); }
.empty-state p { margin: 0 auto 14px; max-width: 44ch; font-size: 14px; line-height: 1.6; }

/* --- sidebar grouping + stronger active state + count badges --- */
.side-group { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: rgba(255, 255, 255, .42); margin: 16px 8px 6px; }
.side-group:first-of-type { margin-top: 8px; }
.side a { position: relative; }
.side a svg.side-ico { width: 18px; height: 18px; flex: 0 0 auto; opacity: .9; }
.side a.active svg.side-ico, .side a:hover svg.side-ico { opacity: 1; }
.side a.active::before { content: ""; position: absolute; inset-inline-start: 2px; top: 8px; bottom: 8px; width: 3px; border-radius: 999px; background: var(--gold); }
.nav-badge { margin-inline-start: auto; min-width: 18px; height: 18px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center;
  background: #e23b3b; color: #fff; border-radius: 999px; font-size: 11px; font-weight: 800; line-height: 1; }

/* --- bar chart: axis + gridlines + hover, brand palette (replaces the tiny inline sparkline) --- */
.barchart { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding: 6px 6px 0;
  position: relative; border-inline-start: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.barchart .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.barchart .bar .col { width: 100%; max-width: 38px; border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--primary-glow), var(--primary)); min-height: 3px; transition: filter .12s, height .3s; }
.barchart .bar:hover .col { filter: brightness(1.08); }
.barchart .bar .val { font-size: 12px; font-weight: 800; color: var(--fg); font-variant-numeric: tabular-nums; }
.barchart .bar .lbl { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* --- moderation / queue card list (approvals, reviews, plan requests) --- */
.queue-list { display: flex; flex-direction: column; gap: 12px; }
.queue-card { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px 16px; box-shadow: var(--shadow); }
.queue-card .qc-av { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
  background: color-mix(in oklab, var(--primary) 12%, var(--card)); display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--primary); }
.queue-card .qc-main { flex: 1; min-width: 0; }
.queue-card .qc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.queue-card .qc-title { font-weight: 800; }
.queue-card .qc-meta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.queue-card .qc-body { margin: 8px 0 0; line-height: 1.6; color: var(--fg); }
.queue-card .qc-actions { display: flex; gap: 8px; flex: 0 0 auto; flex-wrap: wrap; }
/* crisp star rating (replaces ★☆ text glyphs) */
.stars { display: inline-flex; gap: 1px; color: #f5b544; }
.stars svg { width: 15px; height: 15px; }
.stars.sm svg { width: 13px; height: 13px; }
.stars .off { color: color-mix(in oklab, var(--muted) 40%, transparent); }

/* --- custom domains: one card per hostname, with its DNS instructions inline --- */
.dom-list { display: flex; flex-direction: column; gap: 12px; }
.dom-row { border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; background: var(--card); }
.dom-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.dom-host { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; word-break: break-all; }
.dom-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dom-actions form { margin: 0; }
.dom-help { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.dom-step { font-size: 13.5px; line-height: 1.7; margin-bottom: 6px; }
.dom-step strong { color: var(--primary); }
.table.dom-dns { margin: 8px 0 12px; font-size: 13px; }
.table.dom-dns td { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.dom-add { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

/* Live-availability panel (dashboard) — a doctor's daily "available now" / "done for today" */
.avail-panel { border: 1px solid #bfe6d3; }
.avail-rows { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.avail-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; }
.avail-row.is-live { border-color: #9be0c2; background: color-mix(in oklab, var(--success) 6%, transparent); }
.avail-info { display: flex; align-items: center; gap: 12px; }
.avail-dot { width: 12px; height: 12px; border-radius: 999px; flex: none; }
.avail-dot.on { background: var(--success); box-shadow: 0 0 0 4px color-mix(in oklab, var(--success) 18%, transparent); }
.avail-dot.off { background: #c0392b; }
.avail-state { font-size: 13px; color: var(--muted); margin-top: 2px; }
.avail-row.is-live .avail-state { color: var(--success); font-weight: 700; }
.avail-form { margin: 0; }

/* ============================================================
   Design-system foundation (v3) — the components the views were
   improvising with inline styles. Every rule here exists because
   the same block was hand-written in three or more .cshtml files.
   ============================================================ */

/* --- page header: title (+subtitle) with a trailing action slot ---
   Replaces the display:flex;align-items:center;justify-content:space-between
   block that was copy-pasted at the top of ten views. */
.page-head { display: flex; align-items: center; gap: var(--s4); margin-bottom: var(--s4); flex-wrap: wrap; }
.page-head h1 { margin: 0; }
/* The title block takes the free space, so anything after it lands at the end —
   whether the actions are wrapped in .ph-actions or are just a trailing button. */
.page-head > :first-child { margin-inline-end: auto; }
.page-head .ph-sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.page-head .ph-actions { margin-inline-start: auto; display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }

/* --- form field ---------------------------------------------------------- */
.fld input, .fld textarea, .fld select,
.field-grid input, .field-grid textarea, .field-grid select {
  border-radius: var(--r-sm); padding: 8px 11px; font-size: 14px;
}
.fld input:focus-visible, .fld textarea:focus-visible, .fld select:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary);
}
.grp-label {
  display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--muted); margin-bottom: var(--s2);
}

/* --- tabs: one row of queues or filters, underline marks the open one ----- */
.tabs { display: flex; align-items: center; gap: var(--s1); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; height: var(--h-lg); padding: 0 13px;
  border: 0; background: transparent; border-bottom: 2px solid transparent; border-radius: 0;
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; text-decoration: none;
}
.tab:hover { color: var(--fg); }
.tab.is-active { color: var(--primary); border-bottom-color: var(--primary); }
.tab .n { border-radius: 999px; font-size: 11px; padding: 1px 7px; font-weight: 700; background: var(--surface-3); color: var(--muted); }
.tab.is-active .n { background: var(--primary); color: #fff; }

/* --- segmented control --------------------------------------------------- */
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; background: var(--card); }
.segmented > * {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px;
  border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 600;
  color: var(--muted); cursor: pointer; white-space: nowrap; text-decoration: none;
}
.segmented > .is-active { background: var(--primary); color: #fff; }

/* --- keyboard hint ------------------------------------------------------- */
.kbd {
  display: inline-block; font-family: 'Rubik', sans-serif; font-size: 11px; font-weight: 600;
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px;
  padding: 1px 6px; color: var(--muted); background: var(--card); line-height: 1.5;
}

/* --- attention strip: one row where three stacked banners used to sit ----- */
.attn { display: flex; align-items: stretch; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: var(--s4); flex-wrap: wrap; }
.attn-lead { display: flex; align-items: center; gap: 9px; padding: 12px var(--s4);
  background: var(--warn-bg); color: var(--warn-fg); font-weight: 600; font-size: 13px;
  border-inline-end: 1px solid var(--warn-bd); }
.attn.is-danger .attn-lead { background: var(--danger-bg); color: var(--danger-fg); border-inline-end-color: var(--danger-bd); }
.attn-item { display: flex; align-items: center; gap: 9px; padding: 12px var(--s4);
  border-inline-end: 1px solid var(--border); font-size: 13px; color: var(--fg); text-decoration: none; }
.attn-item:last-child { border-inline-end: 0; }
.attn-item b { font-size: 16px; font-weight: 700; }
.attn-item .go { color: var(--primary); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.attn-sp { flex: 1; }

/* --- secondary numbers as a rail, not more equal-weight KPI tiles --------- */
.stat-rail { display: flex; align-items: stretch; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; flex-wrap: wrap; margin-top: var(--s3); }
.stat-rail .stat { flex: 1 1 140px; padding: 11px var(--s4); display: flex; flex-direction: column; gap: 1px;
  border-inline-start: 1px solid var(--border); }
.stat-rail .stat:first-child { border-inline-start: 0; }
.stat-rail .stat .k { font-size: 11.5px; color: var(--muted); }
.stat-rail .stat .v { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* --- identity cell: avatar + name + secondary line ------------------------ */
.identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.identity .av { width: 30px; height: 30px; border-radius: var(--r-sm); display: grid; place-items: center;
  font-size: 12px; font-weight: 700; flex: 0 0 auto; background: var(--surface-3); color: var(--muted); }
.identity .nm { display: block; font-weight: 600; }
.identity .sb { display: block; font-size: 12px; color: var(--muted); }

/* --- row actions: two visible, the rest behind one control --------------- */
.row-acts { display: flex; align-items: center; justify-content: flex-end; gap: var(--s1); flex-wrap: wrap; }
.row-acts form { margin: 0; }

/* --- master-detail list -------------------------------------------------- */
.md-list { display: flex; flex-direction: column; }
.md-row { display: flex; gap: 11px; padding: 12px var(--s3); border-bottom: 1px solid var(--surface-3);
  text-decoration: none; color: inherit; }
.md-row:hover { background: var(--surface-2); }
.md-row.is-active { background: var(--tint-selected); border-inline-start: 3px solid var(--primary); padding-inline-start: 9px; }
.md-row .md-main { min-width: 0; flex: 1; }
.md-row .md-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.md-row .md-name { font-size: 13.5px; font-weight: 600; }
.md-row .md-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.md-row .md-time { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.md-unread { width: 7px; height: 7px; border-radius: 999px; background: var(--primary); flex: 0 0 auto; }

/* --- sticky action bar for long forms ------------------------------------ */
.actionbar {
  position: sticky; bottom: 0; z-index: 4; display: flex; align-items: center; gap: var(--s2);
  padding: 12px var(--s5); margin: var(--s4) calc(var(--s5) * -1) calc(var(--s5) * -1);
  background: var(--card); border-top: 1px solid var(--border); flex-wrap: wrap;
}
.actionbar .ab-sp { flex: 1; }

/* --- plan card ----------------------------------------------------------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s3); }
.plan { position: relative; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: var(--s3); }
.plan.is-current { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in oklab, var(--primary) 12%, transparent); }
.plan .p-name { font-size: 16px; font-weight: 600; }
.plan .p-price { font-size: 32px; font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.plan .p-per { font-size: 12.5px; color: var(--muted); }
.plan ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.plan li { display: flex; align-items: flex-start; gap: var(--s2); font-size: 13.5px; }
.plan li.off { color: var(--muted); }
.plan .p-flag { position: absolute; top: 0; inset-inline-end: 16px; transform: translateY(-50%);
  background: var(--gold); color: var(--gold-fg); border-radius: 999px; font-size: 11px; font-weight: 700; padding: 2px 10px; }

/* --- numbers line up, everywhere ----------------------------------------- */
.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* A shekel amount is a bidi terminator: in an RTL line the sign resolves to the wrong
   side of the digits. Isolating it keeps the sign where it was typed. */
.money { direction: ltr; unicode-bidi: isolate; display: inline-block; font-variant-numeric: tabular-nums; }

/* --- inline icon, sized by context --------------------------------------- */
.ico { width: 16px; height: 16px; flex: 0 0 auto; vertical-align: -3px; }
.ico-sm { width: 14px; height: 14px; }
.ico-lg { width: 20px; height: 20px; }

/* --- the handful of utilities the views were writing inline, hundreds of times --- */
.muted { color: var(--muted); }
.muted-sub { color: var(--muted); font-weight: 400; font-size: 13px; }
/* A bold block label above a group of fields — 29 views wrote this by hand. */
.fieldset-title { display: block; font-weight: 700; margin-bottom: var(--s3); }
/* Validation text under a field, and the summary above a form. */
.field-error { display: block; color: var(--danger-fg); font-size: 13px; font-weight: 400; margin-top: var(--s1); }
/* A link that carries weight — "נהל מודעות ←", "עברו לאישורים ←". */
.link-strong { color: var(--primary); font-weight: 600; }
.link-strong:hover { color: var(--primary-deep); }
/* A bare input outside a .fld wrapper. */
.input {
  border: 1px solid var(--border); border-radius: var(--r-sm); padding: 8px 11px;
  font: inherit; font-size: 14px; background: var(--card); color: var(--fg);
}
.input:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }

/* --- checkout: a narrow, centred column. Money screens should have nothing else on them. --- */
.checkout { display: flex; justify-content: center; }
.checkout-main { width: 100%; max-width: 560px; }
.checkout .panel { margin-top: var(--s4); }

.steps { display: flex; align-items: center; gap: var(--s2); list-style: none; margin: 0; padding: 0; }
.steps li {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.steps li + li::before { content: ""; width: 22px; height: 1px; background: var(--border); margin-inline-end: var(--s2); }
.steps li.is-done { color: var(--ok-fg); }
.steps li.is-current { color: var(--primary); }

.order-lines { border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.order-line { display: flex; gap: var(--s3); align-items: flex-start; padding: 14px var(--s4); }
.order-line .ol-ico {
  width: 38px; height: 38px; border-radius: var(--r-sm); flex: 0 0 auto;
  display: grid; place-items: center; background: var(--info-bg); color: var(--info-fg);
}
.order-line .ol-main { min-width: 0; flex: 1; }
.order-line .ol-title { display: block; font-size: 14.5px; font-weight: 600; }
.order-line .ol-sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.6; }
.order-line .ol-amount { font-weight: 600; font-size: 14.5px; white-space: nowrap; }
.order-total {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 13px var(--s4); border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--primary) 4%, var(--card)); font-weight: 600; font-size: 14px;
}
.order-total strong { font-size: 24px; font-weight: 600; color: var(--primary); letter-spacing: -.02em; }

.assurances { list-style: none; margin: var(--s4) 0 0; padding: var(--s3) 0 0; border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 7px; }
.assurances li { display: flex; align-items: flex-start; gap: var(--s2); font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.assurances li .ico-sm { color: var(--ok-fg); margin-top: 2px; }

.checkout-back { display: flex; align-items: center; justify-content: center; gap: 4px;
  margin-top: var(--s3); font-size: 12.5px; color: var(--muted); }
.checkout-back:hover { color: var(--fg); }

.paid-head { display: flex; align-items: flex-start; gap: var(--s3); margin-bottom: var(--s4); }
.paid-mark { width: 40px; height: 40px; border-radius: 999px; flex: 0 0 auto;
  display: grid; place-items: center; background: var(--ok-bg); color: var(--ok-fg); }
.paid-title { display: block; font-family: 'Rubik', sans-serif; font-size: 19px; font-weight: 600; }
.paid-sub { display: block; font-size: 13.5px; color: var(--muted); margin-top: 2px; }

.receipt { border: 1px solid var(--border); border-radius: var(--r-sm); padding: var(--s4);
  display: flex; flex-direction: column; gap: 9px; }
.receipt .rc-row { display: flex; justify-content: space-between; gap: var(--s3); font-size: 13px; }
.receipt .rc-row span:last-child { font-weight: 600; text-align: end; }
.receipt .rc-total { border-top: 1px solid var(--border); padding-top: 9px; align-items: baseline; }
.receipt .rc-total strong { font-size: 19px; font-weight: 600; color: var(--ok-fg); }

.unlocked { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.unlocked li { display: flex; align-items: flex-start; gap: var(--s2); font-size: 13.5px; }
.unlocked li .ico-sm { color: var(--ok-fg); margin-top: 3px; }

.paid-actions { display: flex; gap: var(--s2); margin-top: var(--s5); flex-wrap: wrap; }
.paid-actions .btn { flex: 1; min-width: 160px; }

/* --- moderation inbox: the tab bar sits directly under the page header --- */
.tabs { margin-bottom: var(--s4); }
.inbox-lead { margin: calc(var(--s3) * -1) 0 var(--s4); font-size: 13.5px; }

/* Queue cards get the same control sizing as the rest of the portal now that their
   buttons are .btn-sm rather than hand-padded. */
.queue-card { padding: 13px var(--s4); border-radius: var(--radius); box-shadow: none; }
.queue-card .qc-actions { align-items: flex-start; }
.queue-card .qc-actions .btn { white-space: nowrap; }
.queue-list { gap: var(--s2); }

/* --- filter toolbar + selection bar ------------------------------------- */
.toolbar { align-items: center; margin: 0 0 var(--s3); }
.toolbar input[type=search], .toolbar select, .toolbar input[type=text] {
  height: var(--h-md); border-radius: var(--r-sm); padding: 0 11px; font-size: 13.5px;
}
.toolbar-count { margin-inline-start: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; }

/* The selection bar is revealed by site.js only when rows are selected, so it reads as a
   response to what you did rather than as permanent chrome. */
.bulk-bar {
  background: color-mix(in oklab, var(--primary) 6%, var(--card));
  border: 1px solid var(--info-bd); border-radius: var(--r-sm);
  padding: 8px var(--s3); margin-bottom: var(--s3);
}
.bulk-bar[hidden] { display: none; }
.bulk-bar .bulk-count { font-size: 13px; font-weight: 600; color: var(--info-fg); white-space: nowrap; }
.bulk-bar .bulk-count b { font-variant-numeric: tabular-nums; }
.bulk-bar .bulk-sep { width: 1px; align-self: stretch; background: var(--info-bd); }
.bulk-bar select { height: var(--h-sm); border-radius: var(--r-xs); padding: 0 9px; font-size: 12.5px; }

/* Tabs used as a filter row sit tight above the panel they filter. */
.panel > .toolbar:first-child { margin-top: 0; }

/* ============================================================
   Builder: the section editor as a docked side sheet.

   It used to be a centred modal <dialog>, opened with showModal() — which drew a
   backdrop over the live preview that the whole builder exists to show. You edited
   a price blind, closed the modal, then looked. The sheet opens NON-modally against
   the start edge (the right, in RTL) so it sits over the form column and leaves the
   preview column visible and interactive the entire time.
   ============================================================ */
dialog.sec-sheet {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  inset-inline-end: auto;
  margin: 0;
  width: min(460px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 0;
  border-inline-end: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
  display: none;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  z-index: 70;
}
dialog.sec-sheet[open] { display: flex; animation: sheet-in .18s ease-out; }
/* A non-modal dialog has no ::backdrop, which is the point — nothing covers the preview. */
dialog.sec-sheet::backdrop { background: transparent; }

@keyframes sheet-in {
  from { transform: translateX(var(--sheet-from, -12px)); opacity: .4; }
  to { transform: none; opacity: 1; }
}
:root { --sheet-from: 12px; } /* RTL: the sheet enters from the right */
@media (prefers-reduced-motion: reduce) {
  dialog.sec-sheet[open] { animation: none; }
}

/* Clear the sidebar on desktop so navigation stays reachable while editing. */
@media (min-width: 993px) {
  dialog.sec-sheet { inset-inline-start: 240px; }
}

dialog.sec-sheet header {
  flex: 0 0 auto;
  padding: 13px var(--s4);
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
dialog.sec-sheet .body {
  flex: 1 1 auto;
  max-height: none;
  overflow-y: auto;
  padding: var(--s4);
}
/* The sheet's own save/cancel row sticks to its bottom rather than scrolling away
   at the end of a long section form. */
dialog.sec-sheet .body > form > div:last-child {
  position: sticky;
  bottom: calc(var(--s4) * -1);
  margin: var(--s4) calc(var(--s4) * -1) calc(var(--s4) * -1);
  padding: var(--s3) var(--s4);
  background: var(--card);
  border-top: 1px solid var(--border);
}

/* The row being edited is marked in the rail, so the rail, the sheet and the preview
   all point at the same section. */
.sec-row.is-editing {
  border-color: var(--primary);
  background: color-mix(in oklab, var(--primary) 7%, var(--card));
  box-shadow: inset 2px 0 0 var(--primary);
}

/* While a sheet is open the preview is what matters, so give it the room: the editor
   column collapses and the preview takes the full width beside the sheet. */
@media (min-width: 1000px) {
  /* The editor column narrows to exactly the sheet's width, so the sheet lands on top of
     it and the preview takes everything else. The column is left visible on purpose:
     the moment the sheet closes the section list is already there, in place. */
  body.sheet-open .builder-grid { grid-template-columns: 460px minmax(0, 1fr); }
  body.sheet-open .builder-preview { position: sticky; top: 16px; }
}
@media (max-width: 999px) {
  dialog.sec-sheet { inset-inline-start: 0; width: 100vw; }
}

/* --- form pattern: fields inside a labelled group fill their row ---------- */
.fieldset-title .input,
.fieldset-title input, .fieldset-title select, .fieldset-title textarea { width: 100%; margin-top: 5px; }
.fieldset-title input[type=checkbox], .fieldset-title input[type=radio] { width: auto; margin-top: 0; }
/* The label text itself is the group heading; the field under it is normal weight. */
.fieldset-title { font-weight: 700; }
.fieldset-title .input, .fieldset-title input, .fieldset-title select, .fieldset-title textarea { font-weight: 400; }

/* --- plan card details ---------------------------------------------------- */
.plan li .ico { color: var(--ok-fg); margin-top: 2px; }
.plan .plan-savings { color: var(--ok-fg); font-size: 13px; font-weight: 600; }
.plan .linklike { border: 0; background: none; color: var(--muted); font: inherit; font-size: 12.5px; text-decoration: underline; cursor: pointer; }
.plan .linklike:hover { color: var(--fg); }

/* ============================================================
   Card preview: keep it identical to the public card.

   Builder/Preview.cshtml renders the customer-facing card inside the portal, so it
   must look like Souq.Web.Public renders it — not like the portal's own chrome. The
   portal's .btn was rebuilt (34px, bordered, 8px radius); the public site's .btn is
   still the original slab. A preview that quietly disagrees with the live card is
   worse than no preview, so the card's own controls opt out of the portal's button.
   ============================================================ */
.cform .btn {
  display: block;
  height: auto;
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 700;
  font-size: inherit;
  line-height: normal;
}
.cform .btn:hover { background: var(--c-primary); }
