/* ==========================================================================
   Madar — shared demo app shell
   Used by: demos/qahwa.html (رَوق) · demos/mawaeed.html (مساحة) · demos/store.html (دار)
   Each demo sets its own palette via body.demo-* custom properties; the shell,
   spacing, controls and accessibility behaviour are shared.
   ========================================================================== */

@font-face { font-family: "Plex Arabic"; src: url("../fonts/IBMPlexSansArabic-400.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url("../fonts/IBMPlexSansArabic-500.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url("../fonts/IBMPlexSansArabic-600.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Kufi"; src: url("../fonts/NotoKufiArabic-700.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Grotesk"; src: url("../fonts/SpaceGrotesk-500.ttf") format("truetype"); font-weight: 500; font-display: swap; }

:root {
  --ink: #15171C; --bone: #F2EDE4; --coral: #E8632B; --coral-deep: #A33A14; --teal: #114B55; --sand: #D9CBB3;
  --font-body: "Plex Arabic", "IBM Plex Sans Arabic", system-ui, -apple-system, sans-serif;
  --font-head: "Kufi", "Noto Kufi Arabic", "Plex Arabic", system-ui, sans-serif;
  --font-num: "Grotesk", "Space Grotesk", "Plex Arabic", system-ui, sans-serif;
  --tap: 44px; --radius: 14px; --radius-lg: 20px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* Demo palettes */
.demo-qahwa   { --a-bg: #EFE3D2; --a-surface: #FBF5EC; --a-ink: #2A1B12; --a-muted: #75634F; --a-line: rgba(42, 27, 18, .15); --a-line-strong: rgba(42, 27, 18, .35); --a-accent: #E8632B; --a-accent-ink: #15171C; --a-tile: #EADCC8; --a-strong: #2A1B12; --a-strong-ink: #FBF5EC; --a-ok: #2E6B3F; }
.demo-mawaeed { --a-bg: #DFE7E6; --a-surface: #F3F5F4; --a-ink: #0F3238; --a-muted: #4F6367; --a-line: rgba(17, 75, 85, .18); --a-line-strong: rgba(17, 75, 85, .4); --a-accent: #114B55; --a-accent-ink: #F2EDE4; --a-tile: #DCE5E4; --a-strong: #114B55; --a-strong-ink: #F2EDE4; --a-ok: #114B55; }
.demo-dar     { --a-bg: #DDD1BC; --a-surface: #F4EEE3; --a-ink: #15171C; --a-muted: #665E52; --a-line: rgba(21, 23, 28, .14); --a-line-strong: rgba(21, 23, 28, .35); --a-accent: #A33A14; --a-accent-ink: #F2EDE4; --a-tile: #E6DCCB; --a-strong: #15171C; --a-strong-ink: #F2EDE4; --a-ok: #2E6B3F; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--a-bg); color: var(--a-ink);
  font-family: var(--font-body); font-size: 1rem; line-height: 1.6;
  overflow-x: clip; -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.3; margin: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; }
.num { font-family: var(--font-num); font-weight: 500; font-variant-numeric: tabular-nums; }
[dir="ltr"] { unicode-bidi: isolate; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.skip { position: absolute; inset-inline-start: 1rem; top: -4rem; background: var(--ink); color: var(--bone); padding: .6rem 1rem; border-radius: 8px; z-index: 100; text-decoration: none; }
.skip:focus { top: 1rem; }

/* ---------- Madar demo bar ---------- */
.dbar {
  background: var(--ink); color: var(--bone);
  font-size: .88rem;
}
.dbar__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 44px; padding: 0 1rem; max-width: 1180px; margin-inline: auto; }
.dbar__label { display: inline-flex; align-items: center; gap: .55rem; font-weight: 500; }
.dbar__label img { width: 22px; height: 22px; }
.dbar a { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; color: var(--bone); text-decoration: none; font-weight: 600; }
.dbar a:hover { color: var(--coral); }
.dbar a .ic { width: 1rem; height: 1rem; }
@media (max-width: 420px) { .dbar__label span { display: none; } .dbar__label::after { content: "نموذج من مدار"; } }

/* ---------- App frame ---------- */
.app {
  background: var(--a-surface);
  min-height: calc(100vh - 44px);
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 1rem);
}
@media (min-width: 900px) {
  .app {
    width: min(100% - 3rem, 1100px); margin: 2rem auto 3rem;
    min-height: 0; border-radius: var(--radius-lg); overflow: clip;
    padding-bottom: 2rem;
    box-shadow: 0 1px 0 rgba(21, 23, 28, .06), 0 24px 60px rgba(21, 23, 28, .10);
  }
}

.app-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 1.25rem .9rem; border-bottom: 1px solid var(--a-line);
}
.app-head__brand { display: grid; gap: .1rem; }
.app-head__brand h1 { font-size: 1.6rem; line-height: 1.1; }
.app-head__brand p { font-size: .85rem; color: var(--a-muted); }
.app-head__actions { display: flex; gap: .5rem; align-items: center; }

/* App nav: bottom bar on mobile, inline tabs on desktop */
.app-nav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
  background: var(--a-surface); border-top: 1px solid var(--a-line);
  padding-bottom: var(--safe-b);
}
.app-nav ul { display: flex; }
.app-nav li { flex: 1; }
.app-nav button {
  width: 100%; min-height: var(--nav-h); display: grid; justify-items: center; align-content: center; gap: .15rem;
  background: transparent; border: 0; font-size: .78rem; font-weight: 600; color: var(--a-muted); cursor: pointer; position: relative;
}
.app-nav button .ic { width: 1.4rem; height: 1.4rem; }
.app-nav button[aria-current="page"] { color: var(--a-ink); }
.app-nav button[aria-current="page"]::before { content: ""; position: absolute; top: 0; width: 2.5rem; height: 3px; border-radius: 0 0 3px 3px; background: var(--a-accent); }
.badge {
  position: absolute; top: 8px; inset-inline-start: calc(50% + 4px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--a-accent); color: var(--a-accent-ink); font-size: .7rem; font-weight: 600;
  display: grid; place-items: center; line-height: 1;
}
.badge[data-zero] { display: none; }
@media (min-width: 900px) {
  .app-nav { position: static; border-top: 0; border-bottom: 1px solid var(--a-line); padding: 0 1.25rem; }
  .app-nav ul { gap: .25rem; }
  .app-nav li { flex: none; }
  .app-nav button { min-height: 52px; grid-auto-flow: column; gap: .5rem; padding: 0 1rem; font-size: .95rem; }
  .app-nav button .ic { width: 1.2rem; height: 1.2rem; }
  .app-nav button[aria-current="page"]::before { top: auto; bottom: -1px; width: 100%; border-radius: 3px 3px 0 0; }
  .badge { position: static; margin-inline-start: .1rem; }
}

/* ---------- Views ---------- */
.view { padding: 1.25rem 1.25rem 0; }
.view-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.view-head h2 { font-size: 1.3rem; }
.view-head h2:focus { outline: none; }
.view-sub { color: var(--a-muted); font-size: .92rem; }
@media (min-width: 900px) { .view { padding: 1.5rem 2rem 0; } }

.notice { padding: .8rem 1rem; border-radius: var(--radius); background: var(--a-tile); font-size: .92rem; color: var(--a-ink); }
.notice--noscript { margin: 1rem 1.25rem 0; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: var(--tap); padding: .6rem 1.2rem; border-radius: 999px;
  background: var(--a-strong); color: var(--a-strong-ink); border: 1.5px solid var(--a-strong);
  font-weight: 600; font-size: .98rem; text-decoration: none; cursor: pointer;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), opacity .15s;
}
.btn:hover { opacity: .9; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--accent { background: var(--a-accent); border-color: var(--a-accent); color: var(--a-accent-ink); }
.btn--ghost { background: transparent; color: var(--a-ink); border-color: var(--a-line-strong); }
.btn--ghost:hover { background: rgba(0, 0, 0, .05); opacity: 1; }
.btn--block { width: 100%; }
.btn--small { min-height: 38px; padding: .4rem .95rem; font-size: .9rem; }
.btn--madar { background: var(--ink); border-color: var(--ink); color: var(--bone); }
.iconbtn {
  display: inline-grid; place-items: center; width: var(--tap); height: var(--tap);
  border-radius: 50%; border: 1.5px solid var(--a-line-strong); background: transparent; cursor: pointer; position: relative;
}
.iconbtn:hover { background: rgba(0, 0, 0, .05); }
.iconbtn .ic { width: 1.3rem; height: 1.3rem; }
.iconbtn .badge { top: -4px; inset-inline-start: auto; inset-inline-end: -4px; margin: 0; position: absolute; }
.iconbtn[aria-pressed="true"] { background: var(--a-accent); border-color: var(--a-accent); color: var(--a-accent-ink); }
.iconbtn[aria-pressed="true"] .ic { fill: currentColor; }

.field { display: grid; gap: .35rem; }
.field label, .field legend { font-weight: 600; font-size: .95rem; }
.input, .select {
  width: 100%; font: inherit; color: var(--a-ink); background: #fff;
  border: 1.5px solid var(--a-line-strong); border-radius: 10px; padding: .6rem .9rem; min-height: var(--tap);
}
.search { position: relative; }
.search .input { padding-inline-start: 2.6rem; }
.search .ic { position: absolute; inset-inline-start: .9rem; top: 50%; transform: translateY(-50%); color: var(--a-muted); pointer-events: none; }
.select {
  appearance: none; -webkit-appearance: none; padding-inline-start: 2.4rem;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315171C' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: left .8rem center; background-size: 1.1rem;
}
.toolbar { display: grid; gap: .75rem; margin-bottom: 1rem; }
@media (min-width: 700px) { .toolbar { grid-template-columns: 1fr auto; align-items: center; } .toolbar .search { max-width: 360px; } }

/* Chips (filters) — real radio inputs */
.chips { display: flex; gap: .45rem; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; -ms-overflow-style: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { position: relative; flex: none; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 .95rem; border-radius: 999px;
  border: 1.5px solid var(--a-line-strong); font-weight: 500; font-size: .92rem; cursor: pointer; white-space: nowrap;
  transition: background-color .15s var(--ease), color .15s var(--ease);
}
.chip input:checked + span { background: var(--a-strong); color: var(--a-strong-ink); border-color: var(--a-strong); }
.chip input:focus-visible + span { outline: 3px solid var(--coral); outline-offset: 2px; }

/* Option pills (product options) */
.opt-group { display: grid; gap: .5rem; }
.opt-group legend { margin-bottom: .35rem; }
.opts { display: flex; flex-wrap: wrap; gap: .45rem; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt span {
  display: inline-flex; align-items: center; gap: .4rem; min-height: 42px; padding: 0 .9rem; border-radius: 999px;
  border: 1.5px solid var(--a-line-strong); font-size: .92rem; cursor: pointer; background: var(--a-surface);
}
.opt span small { color: var(--a-muted); font-size: .8rem; }
.opt input:checked + span { background: var(--a-strong); color: var(--a-strong-ink); border-color: var(--a-strong); }
.opt input:checked + span small { color: inherit; opacity: .85; }
.opt input:focus-visible + span { outline: 3px solid var(--coral); outline-offset: 2px; }
.opt input:disabled + span { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .25); flex: none; }

/* Quantity stepper */
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--a-line-strong); border-radius: 999px; overflow: hidden; }
.qty button { width: var(--tap); height: var(--tap); border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; }
.qty button:hover { background: rgba(0, 0, 0, .05); }
.qty button:disabled { opacity: .35; cursor: not-allowed; }
.qty output { min-width: 2rem; text-align: center; font-weight: 600; }
.qty--small button { width: 38px; height: 38px; }

/* ---------- Product list / cards ---------- */
.plist { display: grid; gap: .75rem; }
.pcard {
  display: grid; grid-template-columns: 84px 1fr; gap: .9rem; align-items: center;
  padding: .75rem; border: 1px solid var(--a-line); border-radius: var(--radius-lg); background: var(--a-surface);
  text-align: start;
}
.pcard__media { aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--a-tile); display: grid; place-items: center; color: var(--a-muted); }
.pcard__media img { width: 100%; height: 100%; object-fit: cover; }
.pcard__media .ic { width: 2rem; height: 2rem; }
.pcard__body { display: grid; gap: .2rem; min-width: 0; }
.pcard__cat { font-size: .78rem; color: var(--a-muted); font-weight: 500; }
.pcard__name { font-size: 1.05rem; font-weight: 600; }
.pcard__desc { font-size: .88rem; color: var(--a-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard__row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .35rem; }
.pcard__price { font-size: 1.05rem; }
.pcard__open { width: 100%; height: 100%; text-align: start; background: none; border: 0; padding: 0; cursor: pointer; display: contents; }
.pcard__wish { position: absolute; top: .6rem; inset-inline-end: .6rem; background: var(--a-surface); }
@media (min-width: 640px) {
  .plist { grid-template-columns: repeat(2, 1fr); }
  .plist--grid { grid-template-columns: repeat(2, 1fr); }
  .pcard--grid { grid-template-columns: 1fr; position: relative; padding: .6rem .6rem .9rem; }
}
@media (min-width: 1000px) {
  .plist { grid-template-columns: repeat(3, 1fr); }
  .plist--grid { grid-template-columns: repeat(3, 1fr); }
}
.plist--grid .pcard { position: relative; grid-template-columns: 1fr; padding: .6rem .6rem .9rem; }
.plist--grid .pcard__body { padding-inline: .3rem; }
@media (max-width: 420px) { .plist--grid .pcard { grid-template-columns: 96px 1fr; } .plist--grid .pcard__wish { top: .6rem; bottom: auto; inset-inline-start: .6rem; inset-inline-end: auto; } }

.price-note { font-size: .82rem; color: var(--a-muted); }

/* ---------- Dialog (bottom sheet on mobile, modal on desktop) ---------- */
dialog.sheet {
  border: 0; padding: 0; margin: 0;
  width: 100%; max-width: 100%; max-height: 92dvh;
  inset: auto 0 0 0;
  background: var(--a-surface); color: var(--a-ink);
  border-radius: 22px 22px 0 0;
}
dialog.sheet::backdrop { background: rgba(21, 23, 28, .5); }
dialog.sheet[open] { display: grid; grid-template-rows: auto 1fr auto; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem .5rem; }
.sheet__head h2 { font-size: 1.25rem; }
.sheet__body { padding: .5rem 1.25rem 1rem; overflow-y: auto; display: grid; gap: 1.1rem; }
.sheet__foot { padding: .75rem 1.25rem calc(1rem + var(--safe-b)); border-top: 1px solid var(--a-line); display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.sheet__media { aspect-ratio: 16 / 10; border-radius: 16px; overflow: hidden; background: var(--a-tile); display: grid; place-items: center; color: var(--a-muted); }
.sheet__media img { width: 100%; height: 100%; object-fit: cover; }
.sheet__media .ic { width: 3rem; height: 3rem; }
.sheet__desc { color: var(--a-muted); font-size: .95rem; }
.sheet__total { font-size: 1.15rem; font-weight: 600; }
@media (min-width: 700px) {
  dialog.sheet { inset: 0; margin: auto; width: min(92vw, 640px); max-height: 88vh; border-radius: 22px; }
}
@media (prefers-reduced-motion: no-preference) {
  dialog.sheet[open] { animation: sheet-in .22s var(--ease); }
  @keyframes sheet-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
}

/* ---------- Cart ---------- */
.lines { display: grid; gap: .6rem; }
.line {
  display: grid; grid-template-columns: 64px 1fr; gap: .8rem; align-items: start;
  padding: .75rem; border: 1px solid var(--a-line); border-radius: var(--radius-lg);
}
.line__media { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--a-tile); display: grid; place-items: center; color: var(--a-muted); }
.line__media img { width: 100%; height: 100%; object-fit: cover; }
.line__body { display: grid; gap: .25rem; min-width: 0; }
.line__name { font-weight: 600; }
.line__opts { font-size: .85rem; color: var(--a-muted); }
.line__row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-top: .3rem; }
.line__ctrl { display: flex; align-items: center; gap: .5rem; }
.linkbtn { background: none; border: 0; padding: .4rem .5rem; min-height: var(--tap); color: var(--coral-deep); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.demo-mawaeed .linkbtn { color: var(--a-accent); }

.panel { border: 1px solid var(--a-line); border-radius: var(--radius-lg); padding: 1rem 1.1rem; display: grid; gap: .8rem; background: var(--a-surface); }
.panel h3 { font-size: 1.05rem; }
.totals { display: grid; gap: .4rem; }
.totals div { display: flex; justify-content: space-between; gap: 1rem; font-size: .95rem; }
.totals .is-total { font-size: 1.15rem; font-weight: 600; padding-top: .5rem; border-top: 1px solid var(--a-line); margin-top: .25rem; }
.cart-grid { display: grid; gap: 1.25rem; }
@media (min-width: 900px) { .cart-grid { grid-template-columns: 1.4fr 1fr; align-items: start; } .cart-grid .panel { position: sticky; top: 1rem; } }

/* Selectable cards (radio) */
.cardsel { display: grid; gap: .6rem; }
.cardsel label { position: relative; display: block; cursor: pointer; }
.cardsel input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cardsel__box {
  display: grid; grid-template-columns: auto 1fr auto; gap: .9rem; align-items: center;
  padding: .9rem 1rem; border: 1.5px solid var(--a-line-strong); border-radius: var(--radius-lg); background: var(--a-surface);
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.cardsel__ic { width: 44px; height: 44px; border-radius: 12px; background: var(--a-tile); display: grid; place-items: center; color: var(--a-ink); }
.cardsel__ic .ic { width: 1.4rem; height: 1.4rem; }
.cardsel__t { display: grid; gap: .1rem; min-width: 0; }
.cardsel__t b { font-weight: 600; }
.cardsel__t small { color: var(--a-muted); font-size: .85rem; }
.cardsel__end { text-align: end; font-weight: 600; white-space: nowrap; }
.cardsel input:checked + .cardsel__box { border-color: var(--a-accent); background: var(--a-tile); box-shadow: inset 0 0 0 1px var(--a-accent); }
.cardsel input:focus-visible + .cardsel__box { outline: 3px solid var(--coral); outline-offset: 2px; }
.cardsel input:disabled + .cardsel__box { opacity: .45; cursor: not-allowed; }
@media (min-width: 700px) { .cardsel--cols { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } }

/* ---------- Empty / success ---------- */
.empty { display: grid; justify-items: center; gap: .75rem; text-align: center; padding: 2.5rem 1rem; border: 1.5px dashed var(--a-line-strong); border-radius: var(--radius-lg); }
.empty .ic { width: 2.5rem; height: 2.5rem; color: var(--a-muted); }
.empty h3 { font-size: 1.1rem; }
.empty p { color: var(--a-muted); max-width: 26rem; }
.done { display: grid; gap: 1rem; max-width: 36rem; margin-inline: auto; padding: 1.5rem 0 1rem; }
.done__mark { width: 64px; height: 64px; border-radius: 50%; background: var(--a-accent); color: var(--a-accent-ink); display: grid; place-items: center; }
.done__mark .ic { width: 2rem; height: 2rem; }
.done h2 { font-size: 1.5rem; }
.done__ref { display: grid; gap: .2rem; padding: .9rem 1rem; border-radius: var(--radius); background: var(--a-tile); }
.done__ref small { color: var(--a-muted); }
.done__ref b { font-size: 1.4rem; letter-spacing: .06em; }
.done__note { padding: .9rem 1rem; border-radius: var(--radius); border: 1px solid var(--a-line-strong); font-size: .95rem; }
.done .actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.done__madar { margin-top: .5rem; padding-top: 1rem; border-top: 1px solid var(--a-line); display: grid; gap: .6rem; font-size: .95rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; inset-inline: 1rem; bottom: calc(var(--nav-h) + var(--safe-b) + .75rem); z-index: 60;
  display: flex; justify-content: center; pointer-events: none;
}
.toast span {
  background: var(--ink); color: var(--bone); padding: .7rem 1.1rem; border-radius: 999px; font-size: .92rem; font-weight: 500;
  opacity: 0; transform: translateY(6px); transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.is-on span { opacity: 1; transform: none; }
@media (min-width: 900px) { .toast { bottom: 1.5rem; } }
@media (prefers-reduced-motion: reduce) { .toast span { transition: none; } dialog.sheet[open] { animation: none; } }

/* ---------- Appointment flow specifics ---------- */
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; margin-bottom: 1.25rem; }
.stepper li { display: grid; gap: .3rem; font-size: .78rem; color: var(--a-muted); font-weight: 500; }
.stepper li::before { content: ""; height: 4px; border-radius: 2px; background: var(--a-line); }
.stepper li[aria-current="step"] { color: var(--a-ink); }
.stepper li[aria-current="step"]::before, .stepper li.is-done::before { background: var(--a-accent); }
.step { display: grid; gap: 1rem; }
.step[hidden] { display: none; }
.step__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.step__head h2 { font-size: 1.2rem; }
.step__nav { display: flex; justify-content: space-between; gap: .75rem; margin-top: .5rem; flex-wrap: wrap; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; }
.days label { position: relative; display: block; cursor: pointer; }
.days input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.days span {
  display: grid; justify-items: center; gap: .05rem; padding: .55rem 0; border-radius: 12px; min-height: 60px;
  border: 1.5px solid var(--a-line-strong); background: var(--a-surface);
}
.days small { font-size: .68rem; color: var(--a-muted); white-space: nowrap; overflow: hidden; max-width: 100%; text-overflow: ellipsis; }
.days b { font-size: 1.1rem; }
.days input:checked + span { background: var(--a-accent); color: var(--a-accent-ink); border-color: var(--a-accent); }
.days input:checked + span small { color: inherit; }
.days input:focus-visible + span { outline: 3px solid var(--coral); outline-offset: 2px; }
@media (max-width: 400px) { .days { grid-template-columns: repeat(4, 1fr); } }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; }
@media (min-width: 540px) { .slots { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) { .slots { grid-template-columns: repeat(6, 1fr); } }
.slots label { position: relative; display: block; }
.slots input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.slots span { display: grid; place-items: center; min-height: var(--tap); border-radius: 10px; border: 1.5px solid var(--a-line-strong); background: var(--a-surface); cursor: pointer; }
.slots input:checked + span { background: var(--a-accent); color: var(--a-accent-ink); border-color: var(--a-accent); }
.slots input:focus-visible + span { outline: 3px solid var(--coral); outline-offset: 2px; }
.slots input:disabled + span { color: var(--a-muted); text-decoration: line-through; background: var(--a-tile); border-color: transparent; cursor: not-allowed; }
.slots__legend { display: flex; gap: 1rem; font-size: .82rem; color: var(--a-muted); }
.slots__legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: .4rem; vertical-align: middle; border: 1.5px solid var(--a-line-strong); }
.slots__legend .is-off::before { background: var(--a-tile); border-color: transparent; }
.review { display: grid; gap: .6rem; }
.review div { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--a-line); }
.review div:last-child { border-bottom: 0; }
.review small { color: var(--a-muted); }
.review b { font-weight: 600; text-align: end; }
.bookings { display: grid; gap: .6rem; }
.booking { display: grid; grid-template-columns: 1fr auto; gap: .5rem 1rem; align-items: center; padding: .9rem 1rem; border: 1px solid var(--a-line); border-radius: var(--radius-lg); }
.booking__t { display: grid; gap: .15rem; font-size: .95rem; }
.booking__t small { color: var(--a-muted); }
.booking__ref { letter-spacing: .06em; font-weight: 600; }
.err { color: var(--coral-deep); font-weight: 500; font-size: .92rem; }
.demo-mawaeed .err { color: #8A2E0E; }

/* ---------- Wishlist / misc ---------- */
.thumbs { display: flex; gap: .5rem; }
.thumbs button { width: 56px; height: 56px; padding: 0; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: var(--a-tile); cursor: pointer; display: grid; place-items: center; color: var(--a-muted); }
.thumbs button[aria-pressed="true"] { border-color: var(--a-ink); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.sort { display: flex; align-items: center; gap: .5rem; }
.sort label { font-size: .9rem; font-weight: 600; white-space: nowrap; }
.sort .select { min-width: 170px; }
.tag { display: inline-flex; align-items: center; padding: .15rem .6rem; border-radius: 999px; background: var(--a-tile); font-size: .78rem; font-weight: 500; }

/* Brand treatment for native browser surfaces. */
.demo-dar .sheet__media { position: relative; }
.demo-dar .sheet__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.demo-dar .sheet__body { grid-auto-rows: max-content; align-content: start; }
::selection { background: #E8632B; color: #15171C; }
html { scrollbar-color: #888278 #F2EDE4; }
input, textarea { caret-color: var(--a-ink); }
input::placeholder, textarea::placeholder { color: var(--a-muted); opacity: 1; }
a { text-underline-offset: .2em; }
