/* Components shared by the site and the admin panel. Colours only via tokens.css.
   Every component is shown on /admin/design. */

/* =========================================================== icons */
.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-sm { width: 1em; height: 1em; }
.icon-lg { width: 1.5em; height: 1.5em; }
.icon-xl { width: 2rem; height: 2rem; stroke-width: 1.75; }
.icon-gold { color: var(--gold); }

/* =========================================================== brand */
.brand { display: inline-flex; align-items: center; gap: var(--sp-3); }
.brand-mark { width: 40px; height: 40px; object-fit: contain; }
.brand-name {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: var(--fs-18);
  line-height: 1;
  letter-spacing: .08em;
  color: var(--silver);
  direction: ltr;
  white-space: nowrap;
}
.brand-name b { color: var(--gold); font-weight: 800; }
.brand-sub { display: block; margin-top: 4px; font-size: var(--fs-12); color: var(--text-faint); letter-spacing: 0; font-weight: 500; }

/* =========================================================== buttons */
.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  --btn-border: var(--border-strong);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--touch);
  padding: 0 var(--sp-5);
  border: 1px solid var(--btn-border);
  border-radius: var(--r-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: var(--fs-16);
  line-height: 1;
  white-space: nowrap;
  user-select: none;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease),
              color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease),
              transform var(--dur-1) var(--ease);
}
.btn:hover { --btn-bg: var(--surface-3); --btn-border: var(--border-hover); }
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

.btn-primary {
  --btn-bg: var(--gold);
  --btn-fg: var(--on-gold);
  --btn-border: transparent;
  font-weight: 700;
}
.btn-primary:hover { --btn-bg: var(--gold-hover); --btn-border: transparent; }
.btn-primary:active { --btn-bg: var(--gold-press); }

.btn-outline { --btn-bg: transparent; --btn-fg: var(--gold); --btn-border: var(--gold-line); }
.btn-outline:hover { --btn-bg: var(--gold-soft); --btn-border: var(--gold); }

.btn-ghost { --btn-bg: transparent; --btn-fg: var(--text-muted); --btn-border: transparent; }
.btn-ghost:hover { --btn-bg: var(--surface-2); --btn-fg: var(--text); --btn-border: transparent; }

.btn-danger { --btn-bg: var(--danger-soft); --btn-fg: var(--danger); --btn-border: var(--danger-line); }
.btn-danger:hover { --btn-bg: var(--danger-soft); --btn-border: var(--danger); }

.btn-success { --btn-bg: var(--success-soft); --btn-fg: var(--success); --btn-border: var(--success-line); }
/* Google's own button rules: neutral button + the official "G" (static/brand/google-g.svg) */
.btn-google > img { width: 20px; height: 20px; flex: none; }
.btn-success:hover { --btn-bg: var(--success-soft); --btn-border: var(--success); }

.btn-sm { min-height: 36px; padding: 0 var(--sp-3); font-size: var(--fs-14); }
.btn-lg { min-height: 52px; padding: 0 var(--sp-6); font-size: var(--fs-18); border-radius: var(--r-md); }
.btn-block { width: 100%; }
.btn-icon { width: var(--touch); padding: 0; }
.btn-icon.btn-sm { width: 36px; }
@media (pointer: coarse) {
  .btn-sm { min-height: var(--touch); }
  .btn-icon.btn-sm { width: var(--touch); }
}

.btn.is-loading { color: transparent; pointer-events: none; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--btn-fg);
  border-inline-end-color: transparent;
  animation: ds-spin .7s linear infinite;
}

/* =========================================================== forms */
/* minmax(0, 1fr): a wide input inside (its intrinsic size) never pushes the field past its card */
.field { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: var(--sp-2); min-width: 0; }
.label { font-size: var(--fs-14); font-weight: 600; color: var(--text); }
.label .req { color: var(--danger); margin-inline-start: 2px; }
.label .opt { color: var(--text-faint); font-weight: 400; }
.hint { font-size: var(--fs-13); color: var(--text-faint); }
.error-text {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-14);
  color: var(--danger);
}
.error-text .icon { width: 16px; height: 16px; }

.input, .select, .textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--fs-16); /* 16px stops iOS from zooming on focus */
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-hover); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--gold); box-shadow: var(--ring); outline: none; }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.input[aria-invalid="true"]:focus, .textarea[aria-invalid="true"]:focus { box-shadow: var(--ring-danger); }
.input:disabled, .select:disabled, .textarea:disabled { opacity: .55; cursor: not-allowed; }
.input[readonly] { background: var(--surface-1); color: var(--text-muted); }
.textarea { min-height: 120px; padding: var(--sp-3) var(--sp-4); resize: vertical; line-height: var(--lh-body); }

.select-wrap { position: relative; }
.select { appearance: none; padding-inline-end: 44px; cursor: pointer; }
.select-wrap > .icon {
  position: absolute;
  inset-inline-end: 14px;
  top: 50%;
  translate: 0 -50%;
  color: var(--text-faint);
  pointer-events: none;
}

/* input with a fixed prefix/suffix, e.g. "@" before a Telegram username */
.affix {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 48px;
  padding-inline: var(--sp-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.affix:hover { border-color: var(--border-hover); }
.affix:focus-within { border-color: var(--gold); box-shadow: var(--ring); }
.affix[aria-invalid="true"] { border-color: var(--danger); }
.affix > .affix-text { color: var(--text-faint); font-weight: 600; }
.affix > input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: var(--fs-16);
  outline: none;
}
.affix > input::placeholder { color: var(--text-faint); }

/* 6-digit code: one real input (paste and SMS/e-mail autofill keep working) */
.input-otp {
  min-height: 64px;
  padding-inline-start: .6em;
  font-family: var(--font-head);
  font-size: var(--fs-28);
  font-weight: 700;
  letter-spacing: .6em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  direction: ltr;
}
.input-otp::placeholder { letter-spacing: .6em; }

.check {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  min-height: var(--touch);
  padding-block: 10px;
  cursor: pointer;
}
.check > input {
  appearance: none;
  flex: none;
  display: grid;
  place-content: center;
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  border: 1.5px solid var(--border-hover);
  border-radius: 6px;
  background: var(--surface-2);
  cursor: pointer;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.check > input[type="radio"] { border-radius: 50%; }
.check > input:checked { background: var(--gold); border-color: var(--gold); }
.check > input[type="checkbox"]:checked::after {
  content: "";
  width: 11px;
  height: 6px;
  margin-top: -3px;
  border-left: 2.5px solid var(--on-gold);
  border-bottom: 2.5px solid var(--on-gold);
  transform: rotate(-45deg);
}
.check > input[type="radio"]:checked::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--on-gold);
}
.check > input:focus-visible { box-shadow: var(--ring); }
.check-text { color: var(--text); }
.check-text small { display: block; color: var(--text-faint); font-size: var(--fs-13); }

.switch { display: inline-flex; align-items: center; gap: var(--sp-3); min-height: var(--touch); cursor: pointer; }
.switch > input {
  appearance: none;
  position: relative;
  flex: none;
  width: 46px;
  height: 26px;
  margin: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-full);
  background: var(--surface-3);
  cursor: pointer;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.switch > input::after {
  content: "";
  position: absolute;
  top: 2px;
  inset-inline-start: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: inset-inline-start var(--dur-2) var(--ease), background var(--dur-1) var(--ease);
}
.switch > input:checked { background: var(--gold); border-color: var(--gold); }
.switch > input:checked::after { inset-inline-start: 22px; background: var(--on-gold); }
.switch > input:focus-visible { box-shadow: var(--ring); }

/* selectable chips (device, duration, type) - real radios/checkboxes inside */
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip { position: relative; display: inline-flex; }
.chip > input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip-body {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: var(--touch);
  padding: 0 var(--sp-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 500;
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.chip:hover .chip-body { border-color: var(--border-hover); }
.chip > input:checked + .chip-body { border-color: var(--gold); background: var(--gold-soft); color: var(--gold); }
.chip > input:focus-visible + .chip-body { box-shadow: var(--ring); }
.chip > input:disabled { cursor: not-allowed; }
.chip > input:disabled + .chip-body { opacity: .45; text-decoration: line-through; }

/* bigger selectable cards (payment method, delivery option) */
.options { display: grid; gap: var(--sp-3); }
.option { position: relative; display: block; }
.option > input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.option-body {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-1);
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.option:hover .option-body { border-color: var(--border-hover); }
.option > input:checked + .option-body { border-color: var(--gold); background: var(--gold-soft); }
.option > input:focus-visible + .option-body { box-shadow: var(--ring); }
.option-icon {
  display: grid;
  place-content: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  color: var(--silver);
}
.option > input:checked + .option-body .option-icon { background: var(--gold); color: var(--on-gold); }
.option-title { display: block; font-weight: 700; color: var(--text); }
.option-desc { display: block; font-size: var(--fs-14); color: var(--text-muted); }
.option-tick { margin-inline-start: auto; color: var(--gold); opacity: 0; transition: opacity var(--dur-1) var(--ease); }
.option > input:checked + .option-body .option-tick { opacity: 1; }

/* receipt upload */
.dropzone {
  position: relative;
  display: grid;
  justify-items: center;
  gap: var(--sp-2);
  padding: var(--sp-8) var(--sp-4);
  border: 1.5px dashed var(--border-hover);
  border-radius: var(--r-lg);
  background: var(--surface-1);
  color: var(--text-muted);
  text-align: center;
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.dropzone > input[type="file"] { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone:hover, .dropzone.is-drag { border-color: var(--gold); background: var(--gold-soft); }
.dropzone:focus-within { box-shadow: var(--ring); }
.dropzone-icon {
  display: grid;
  place-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--gold);
}
.dropzone-title { color: var(--text); font-weight: 700; }
.dropzone-preview { display: none; width: 100%; max-width: 280px; }
.dropzone.has-file .dropzone-preview { display: block; }
.dropzone-preview img { width: 100%; max-height: 220px; object-fit: contain; border-radius: var(--r-sm); background: var(--surface-2); }
.dropzone-file { font-size: var(--fs-14); color: var(--text); direction: ltr; word-break: break-all; }

/* =========================================================== badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--r-full);
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: var(--fs-13);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.badge .icon { width: 14px; height: 14px; }
.badge-info { background: var(--info-soft); color: var(--info); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-gold { background: var(--gold-soft); color: var(--gold); }
.badge-neutral { background: var(--surface-2); color: var(--text-muted); }
.badge-instant { background: var(--surface-1); border-color: var(--border-strong); color: var(--silver); }
.badge-instant .icon { color: var(--gold); fill: currentColor; }
/* an offer (H6): solid, so it reads on any picture */
.badge-sale { background: var(--danger); color: var(--on-strong); font-weight: 800; }
.badge-out { background: var(--surface-1); border-color: var(--border-strong); color: var(--text-muted); }
.badge-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.count {
  display: inline-grid;
  place-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  color: var(--text);
  font-size: var(--fs-12);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.count-alert { background: var(--danger); color: var(--on-strong); }
.count-gold { background: var(--gold); color: var(--on-gold); }

.kbd {
  display: inline-grid;
  place-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-muted);
  font: 600 var(--fs-12)/1 var(--font-body);
  direction: ltr;
}

.status-pill {
  --pill-c: var(--text-faint);
  --pill-soft: transparent;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  height: 34px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  background: var(--surface-1);
  color: var(--text-muted);
  font-size: var(--fs-13);
  font-weight: 600;
  white-space: nowrap;
}
.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pill-c);
  box-shadow: 0 0 0 3px var(--pill-soft);
}
.status-pill.is-online { --pill-c: var(--success); --pill-soft: var(--success-soft); }
.status-pill.is-wait { --pill-c: var(--warning); --pill-soft: var(--warning-soft); }
.status-pill.is-off { --pill-c: var(--danger); --pill-soft: var(--danger-soft); }

/* =========================================================== cards */
.card {
  padding: var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface-1);
  box-shadow: var(--inner-hi);
}
.card-flush { padding: 0; overflow: hidden; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.card-title { font-family: var(--font-head); font-size: var(--fs-18); font-weight: 700; color: var(--silver); }
.card-sub { font-size: var(--fs-14); color: var(--text-muted); }
a.card, .card-link { display: block; transition: border-color var(--dur-2) var(--ease), transform var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease); }
a.card:hover, .card-link:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow-2); }
a.card:focus-visible, .card-link:focus-visible { outline: none; box-shadow: var(--ring); }

.price {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: var(--fs-18);
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.price small { font-size: .72em; font-weight: 500; color: var(--text-muted); }
.price-lg { font-size: var(--fs-28); }
/* relative: its hidden «بدل» (.sr-only) stays inside a card in a swiped row, never widening the page */
.price-old { position: relative; color: var(--text-faint); text-decoration: line-through; font-size: var(--fs-14); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* product card: the picture, the name and the price (H7). 2 to 5 a row, from a small phone to a wide screen */
.products { display: grid; gap: var(--sp-3); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .products { gap: var(--sp-4); grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 960px) { .products { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1240px) { .products { gap: var(--sp-5); grid-template-columns: repeat(5, minmax(0, 1fr)); } }

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface-1);
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), transform var(--dur-2) var(--ease-out);
}
.product-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-2); transform: translateY(-3px); }
.product-card:active { transform: scale(.985); }
.product-card:focus-visible { outline: none; box-shadow: var(--ring); }
.product-card:hover .cover > img:not(.lqip) { transform: scale(1.05); }
.product-body { display: grid; flex: 1; align-content: space-between; gap: var(--sp-2); padding: var(--sp-3); }
@media (min-width: 768px) { .product-body { padding: var(--sp-3) var(--sp-4) var(--sp-4); } }
/* two lines kept for every name, so the prices of one row line up */
.product-name { min-height: 2.7em; font-family: var(--font-head); font-size: clamp(.9375rem, .88rem + .2vw, 1rem); font-weight: 700; line-height: 1.35; color: var(--silver); }
.product-body .price-wrap { flex-wrap: wrap; column-gap: var(--sp-2); }
.product-card.is-soldout .cover > *:not(.cover-flag) { opacity: .4; }
.product-card.is-soldout .price { color: var(--text-faint); }
/* one flag on a cover: the offer or «نفذت الكمية» */
.cover-flag { position: absolute; inset-block-start: var(--sp-2); inset-inline-start: var(--sp-2); z-index: 1; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 var(--sp-2); border-radius: var(--r-full); background: var(--bg); color: var(--text-muted); font-size: var(--fs-12); font-weight: 700; }
.cover-flag-sale { background: var(--danger); color: var(--on-strong); }

.cover {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--cover-art);
}
.cover-wide { aspect-ratio: 16 / 9; }
.cover-square { aspect-ratio: 1 / 1; }
.cover > img { width: 100%; height: 100%; object-fit: cover; }
.cover-art {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3);
  text-align: center;
}
.cover-mark {
  font-family: var(--font-head);
  font-size: var(--fs-22);
  overflow-wrap: anywhere;
  font-weight: 900;
  line-height: 1.1;
  color: var(--silver);
  direction: ltr;
}
.cover-art .icon { width: 28px; height: 28px; color: var(--text-faint); }
.product-card .cover-art .icon { width: clamp(30px, 8vw, 40px); height: clamp(30px, 8vw, 40px); stroke-width: 1.4; }
@media (min-width: 768px) { .cover-mark { font-size: var(--fs-28); } }

/* =========================================================== alerts */
.alert {
  --alert-c: var(--text-muted);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-1);
}
.alert > .icon { color: var(--alert-c); margin-top: 3px; }
.alert-title { font-weight: 700; color: var(--text); }
.alert-text { font-size: var(--fs-14); color: var(--text-muted); }
.alert-info { --alert-c: var(--info); border-color: var(--info-line); background: var(--info-soft); }
.alert-success { --alert-c: var(--success); border-color: var(--success-line); background: var(--success-soft); }
.alert-warning { --alert-c: var(--warning); border-color: var(--warning-line); background: var(--warning-soft); }
.alert-danger { --alert-c: var(--danger); border-color: var(--danger-line); background: var(--danger-soft); }

/* =========================================================== stepper */
.stepper { display: flex; gap: var(--sp-2); counter-reset: step; }
.step { position: relative; display: flex; flex: 1; flex-direction: column; align-items: center; gap: var(--sp-2); min-width: 0; text-align: center; }
.step::before {
  content: "";
  position: absolute;
  top: 16px;
  inset-inline-start: calc(50% + 22px);
  width: calc(100% - 44px + var(--sp-2));
  height: 2px;
  border-radius: 2px;
  background: var(--border-strong);
}
.step:last-child::before { display: none; }
.step.is-done::before { background: var(--text-muted); }
.step-dot {
  position: relative;
  display: grid;
  place-content: center;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface-1);
  color: var(--text-faint);
  font-weight: 700;
  font-size: var(--fs-14);
  font-variant-numeric: tabular-nums;
}
.step-dot .icon { width: 16px; height: 16px; stroke-width: 3; }
.step-dot .step-check { display: none; }
.step.is-done .step-check { display: block; }
.step.is-done .step-num { display: none; }
.step-label { font-size: var(--fs-13); color: var(--text-faint); font-weight: 500; }
.step.is-done .step-dot { border-color: var(--silver); background: var(--silver); color: var(--bg); }
.step.is-done .step-label { color: var(--text-muted); }
.step.is-current .step-dot { border-color: var(--gold); background: var(--gold); color: var(--on-gold); box-shadow: 0 0 0 4px var(--gold-soft); }
.step.is-current .step-label { color: var(--gold); font-weight: 700; }

/* =========================================================== timeline */
.timeline { position: relative; display: grid; gap: var(--sp-5); padding-inline-start: 28px; }
.timeline::before {
  content: "";
  position: absolute;
  inset-block: 8px;
  inset-inline-start: 7px;
  width: 2px;
  border-radius: 2px;
  background: var(--border-strong);
}
.tl-item { position: relative; }
.tl-dot {
  position: absolute;
  top: 6px;
  inset-inline-start: -28px;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-strong);
  border-radius: 50%;
  background: var(--bg);
}
.tl-item.is-done .tl-dot { border-color: var(--success); background: var(--success); }
.tl-item.is-current .tl-dot { border-color: var(--gold); background: var(--bg); box-shadow: 0 0 0 4px var(--gold-soft); }
.tl-item.is-failed .tl-dot { border-color: var(--danger); background: var(--danger); }
.tl-title { font-weight: 600; color: var(--text); }
.tl-item:not(.is-done):not(.is-current):not(.is-failed) .tl-title { color: var(--text-faint); }
.tl-time { font-size: var(--fs-13); color: var(--text-faint); font-variant-numeric: tabular-nums; }
.tl-note { margin-top: 4px; font-size: var(--fs-14); color: var(--text-muted); }

/* =========================================================== tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface-1); }
.table { width: 100%; font-size: var(--fs-14); }
.table th {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-muted);
  font-size: var(--fs-13);
  font-weight: 600;
  text-align: start;
  white-space: nowrap;
}
.table td { padding: 14px var(--sp-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--dur-1) var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: end; }
@media (max-width: 767px) {
  .table-cards thead { display: none; }
  .table-cards tbody tr, .table-cards tfoot tr { display: grid; gap: var(--sp-2); padding: var(--sp-4); border-bottom: 1px solid var(--border); }
  .table-cards tbody tr:last-child, .table-cards tfoot tr:last-child { border-bottom: 0; }
  .table-cards tfoot tr:first-child { border-top: 1px solid var(--border-strong); }  /* totals: cards like the rows */
  .table.table-cards tfoot td { padding: 0; border: 0; }
  .table-cards td { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px var(--sp-3); padding: 0; border: 0; }
  /* a second line under the value (its detail, its buttons) takes the whole width */
  .table-cards td > .cell-sub, .table-cards td > .row-actions { flex-basis: 100%; text-align: end; }
  .table-cards td > .row-actions { justify-content: flex-end; }
  .table-cards td::before { content: attr(data-label); color: var(--text-faint); font-size: var(--fs-13); }
  .table-cards .num { text-align: start; }
}
/* the same cards when the table's own box is narrow (a laptop with the menu open; decision 64) */
.table-wrap { container-type: inline-size; }
@container (max-width: 720px) {
  .table-cards thead { display: none; }
  .table-cards tbody tr, .table-cards tfoot tr { display: grid; gap: var(--sp-2); padding: var(--sp-4); border-bottom: 1px solid var(--border); }
  .table-cards tbody tr:last-child, .table-cards tfoot tr:last-child { border-bottom: 0; }
  .table-cards tfoot tr:first-child { border-top: 1px solid var(--border-strong); }  /* totals: cards like the rows */
  .table.table-cards tfoot td { padding: 0; border: 0; }
  .table-cards td { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px var(--sp-3); padding: 0; border: 0; }
  .table-cards td > .cell-sub, .table-cards td > .row-actions { flex-basis: 100%; text-align: end; }
  .table-cards td > .row-actions { justify-content: flex-end; }
  .table-cards td::before { content: attr(data-label); color: var(--text-faint); font-size: var(--fs-13); }
  .table-cards .num { text-align: start; }
}

/* =========================================================== tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;  /* every tab stays in sight on a phone (decision 64) */
  gap: var(--sp-1);
  border-bottom: 1px solid var(--border);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: var(--touch);
  padding: 0 var(--sp-4);
  border: 0;
  background: none;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  transition: color var(--dur-1) var(--ease);
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--gold); }
.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset-inline: var(--sp-3);
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
}
.tab:focus-visible { outline: none; box-shadow: inset var(--ring); border-radius: var(--r-sm); }
.tab-panel { padding-top: var(--sp-5); }

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.segmented > label { position: relative; }
.segmented input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.segmented span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 var(--sp-4);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: var(--fs-14);
  font-weight: 600;
  transition: background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.segmented input:checked + span { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-1); }
.segmented input:focus-visible + span { box-shadow: var(--ring); }

/* =========================================================== dialogs */
dialog { color: var(--text); }
dialog::backdrop { background: var(--overlay); backdrop-filter: blur(3px); }
.modal {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100dvh - 64px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  background: var(--surface-1);
  box-shadow: var(--shadow-3);
}
.modal[open] { display: flex; flex-direction: column; animation: ds-pop var(--dur-2) var(--ease); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }
.modal-title { font-family: var(--font-head); font-size: var(--fs-18); font-weight: 700; color: var(--silver); }
.modal-body { padding: var(--sp-5); overflow-y: auto; }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--border); }
@media (max-width: 639px) {
  .modal { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .modal[open] { animation: ds-sheet var(--dur-2) var(--ease); }
  .modal-foot .btn { flex: 1; }
}

.drawer {
  width: min(480px, 100%);
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  margin-inline-end: 0;
  margin-inline-start: auto;
  padding: 0;
  border: 0;
  border-inline-start: 1px solid var(--border-strong);
  background: var(--surface-1);
  box-shadow: var(--shadow-3);
}
.drawer[open] { display: flex; flex-direction: column; animation: ds-drawer var(--dur-2) var(--ease); }
.drawer .modal-body { flex: 1; }

/* =========================================================== toasts */
.toasts {
  position: fixed;
  inset-block-start: calc(var(--header-h) + var(--sp-2) + env(safe-area-inset-top));
  inset-inline: 0;
  z-index: var(--z-toast);
  display: grid;
  justify-items: center;
  gap: var(--sp-2);
  padding-inline: var(--sp-4);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  max-width: 480px;
  min-height: 48px;
  padding: 10px var(--sp-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-3);
  box-shadow: var(--shadow-3);
  color: var(--text);
  font-weight: 500;
  pointer-events: auto;
  animation: ds-toast-in var(--dur-2) var(--ease);
  transition: opacity var(--dur-2) var(--ease), transform var(--dur-2) var(--ease);
}
/* ds.js times it (4.5 s; a problem stays until closed) and gives it a close button (decision 64) */
.toast.is-leaving { opacity: 0; transform: translateY(-8px); }
.toast-close { display: grid; place-items: center; width: 32px; height: 32px; margin-inline-start: auto; margin-inline-end: -6px; padding: 0; border: 0; border-radius: var(--r-sm); background: none; color: var(--text-muted); cursor: pointer; }
.toast-close:hover { color: var(--text); background: var(--surface-2); }
.toast-close:focus-visible { outline: none; box-shadow: var(--ring); }
.toast-close .icon { width: 16px; height: 16px; }
.toast-link { margin-inline-start: auto; padding: 6px var(--sp-2); border-radius: var(--r-sm); color: var(--gold); font-weight: 700; white-space: nowrap; text-decoration: none; }
.toast-link:hover { background: var(--surface-2); }
.toast-link:focus-visible { outline: none; box-shadow: var(--ring); }
.toast-link + .toast-close { margin-inline-start: 0; }
/* the first tap of a [data-confirm] button only asks */
.is-confirming { border-color: var(--danger) !important; color: var(--danger) !important; }
.toast > .icon { color: var(--text-muted); }
.toast-success > .icon { color: var(--success); }
.toast-danger > .icon { color: var(--danger); }
.toast-info > .icon { color: var(--info); }
.toast-warning > .icon { color: var(--warning); }

/* =========================================================== feedback */
.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: ds-spin .8s linear infinite;
}
.skeleton { position: relative; overflow: hidden; border-radius: var(--r-sm); background: var(--surface-2); }
.skeleton::after { content: ""; position: absolute; inset: 0; background: var(--shimmer); animation: ds-shimmer 1.4s ease-in-out infinite; }
.skeleton-line { height: 12px; }
.skeleton-title { height: 18px; width: 60%; }
.skeleton-box { aspect-ratio: 3 / 4; border-radius: var(--r-lg); }

.progress {
  appearance: none;
  width: 100%;
  height: 6px;
  overflow: hidden;
  border: 0;
  border-radius: var(--r-full);
  background: var(--surface-3);
}
.progress::-webkit-progress-bar { background: var(--surface-3); }
.progress::-webkit-progress-value { background: var(--gold-gradient); border-radius: var(--r-full); }
.progress::-moz-progress-bar { background: var(--gold); border-radius: var(--r-full); }

.empty { display: grid; justify-items: center; gap: var(--sp-3); padding: var(--sp-10) var(--sp-4); text-align: center; }
.empty-icon { display: grid; place-content: center; width: 64px; height: 64px; border-radius: 50%; background: var(--surface-2); color: var(--text-faint); }
.empty-title { font-family: var(--font-head); font-size: var(--fs-18); font-weight: 700; color: var(--silver); }
.empty-text { max-width: 40ch; color: var(--text-muted); }

.avatar {
  display: grid;
  place-content: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--silver);
  font-weight: 700;
  font-size: var(--fs-14);
}

.avatar.avatar-lg { width: 52px; height: 52px; font-size: var(--fs-18); }

.divider-text { display: flex; align-items: center; gap: var(--sp-3); color: var(--text-faint); font-size: var(--fs-13); }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.list { display: grid; }
.list-row { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: 0; }
/* a signed-in device («حسابي») */
.device { gap: var(--sp-3); }
.device-icon { display: grid; place-content: center; flex: none; width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--surface-3); color: var(--silver); }
.device-name { color: var(--text); font-weight: 600; }
.device-meta { color: var(--text-faint); font-size: var(--fs-13); }

.copy-field {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 48px;
  padding-inline: var(--sp-4) var(--sp-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.copy-field > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }

/* =========================================================== auth card */
.gate { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; min-height: 100dvh; padding: var(--sp-6) var(--sp-4); background: var(--page-glow) no-repeat, var(--bg); }
.auth-card { width: min(440px, 100%); display: grid; align-content: start; gap: var(--sp-5); padding: var(--sp-6); border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--surface-1); box-shadow: var(--shadow-2); }
@media (min-width: 640px) { .auth-card { padding: var(--sp-8); } }
.auth-head { display: grid; justify-items: center; gap: var(--sp-3); text-align: center; }
.auth-head .brand-mark { width: 72px; height: 72px; }
.auth-title { font-family: var(--font-head); font-size: var(--fs-22); font-weight: 800; color: var(--silver); }
.auth-note { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); color: var(--text-faint); font-size: var(--fs-13); text-align: center; }

/* =========================================================== stats (admin) */
.stat { display: grid; gap: 6px; padding: var(--sp-5); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface-1); }
.stat-label { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-14); color: var(--text-muted); }
.stat-value { font-family: var(--font-head); font-size: var(--fs-28); font-weight: 700; color: var(--silver); font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat-delta { font-size: var(--fs-13); font-weight: 600; color: var(--text-faint); }
.stat-delta.is-up { color: var(--success); }
.stat-delta.is-down { color: var(--danger); }

.attn {
  --attn-c: var(--text-muted);
  --attn-soft: var(--surface-3);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface-1);
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
a.attn:hover { border-color: var(--border-hover); background: var(--surface-2); }
a.attn:focus-visible { outline: none; box-shadow: var(--ring); }
.attn-icon { display: grid; place-content: center; flex: none; width: 46px; height: 46px; border-radius: var(--r-md); background: var(--attn-soft); color: var(--attn-c); }
.attn-count { font-family: var(--font-head); font-size: var(--fs-22); font-weight: 800; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
.attn-label { font-size: var(--fs-14); color: var(--text-muted); }
.attn-go { margin-inline-start: auto; color: var(--text-faint); }
.attn-pay { --attn-c: var(--gold); --attn-soft: var(--gold-soft); }
.attn-fail { --attn-c: var(--danger); --attn-soft: var(--danger-soft); }
.attn-stock { --attn-c: var(--warning); --attn-soft: var(--warning-soft); }
.attn-manual { --attn-c: var(--info); --attn-soft: var(--info-soft); }
.attn-ok { --attn-c: var(--success); --attn-soft: var(--success-soft); }

/* =========================================================== motion */
@keyframes ds-spin { to { transform: rotate(360deg); } }
@keyframes ds-shimmer { from { transform: translateX(100%); } to { transform: translateX(-100%); } }
@keyframes ds-pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes ds-sheet { from { transform: translateY(100%); } }
@keyframes ds-drawer { from { opacity: 0; transform: translateX(-24px); } }
@keyframes ds-toast-in { from { opacity: 0; transform: translateY(-8px); } }
@keyframes ds-toast-out { to { opacity: 0; transform: translateY(-8px); visibility: hidden; } }
@keyframes ds-rise { from { opacity: 0; transform: translateY(4px); } }
.rise { animation: ds-rise var(--dur-2) var(--ease) both; }

/* =========================================================== storefront & catalog (phase C1) */
/* breadcrumbs: Home › Category › Product */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); margin-bottom: var(--sp-4); color: var(--text-faint); font-size: var(--fs-13); }
.crumbs a { color: var(--text-muted); transition: color var(--dur-1) var(--ease); }
.crumbs a:hover { color: var(--gold); }
.crumbs [aria-current] { color: var(--text); font-weight: 600; }

/* filter / sort links that look like chips (no JS: each is a real link) */
.chip-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  min-height: var(--touch);
  padding: 0 var(--sp-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 500;
  transition: border-color var(--dur-1) var(--ease), background var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.chip-link:hover { border-color: var(--border-hover); }
.chip-link:focus-visible { outline: none; box-shadow: var(--ring); }
.chip-link[aria-current="true"] { border-color: var(--gold); background: var(--gold-soft); color: var(--gold); }
.chip-link-sm { min-height: 36px; padding: 0 var(--sp-3); font-size: var(--fs-14); }
@media (pointer: coarse) { .chip-link-sm { min-height: var(--touch); } }

.price-wrap { display: inline-flex; align-items: baseline; gap: 4px; }
.price-from { color: var(--text-muted); font-size: var(--fs-13); font-weight: 500; }

/* «قبل لا تطلب»: conditions above the price */
.note-box { display: grid; gap: var(--sp-2); padding: var(--sp-4); border: 1px solid var(--warning-line); border-radius: var(--r-md); background: var(--warning-soft); }
.note-box .label { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--warning); }
.req-list { display: grid; gap: var(--sp-1); padding-inline-start: var(--sp-5); list-style: disc; color: var(--text); font-size: var(--fs-14); }

.pre-line { white-space: pre-line; }
.warn-text { color: var(--warning); }
.danger-text { color: var(--danger); }
/* an icon at the start of a line of text (svg is display:block): <p class="with-icon">{icon}<span>…</span></p> */
.with-icon { display: flex; align-items: center; gap: var(--sp-2); }
.with-icon > .icon { flex: none; }
.link { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.textarea-sm { min-height: 88px; }
.field-narrow { max-width: 220px; }
.dropzone-sm { padding: var(--sp-5) var(--sp-4); }
.dropzone-sm .dropzone-icon { width: 44px; height: 44px; }

/* =========================================================== old pages in the new design (phase C3) */
/* a selectable card that cannot be chosen (more than the budget) */
.option > input:disabled { cursor: not-allowed; }
.option > input:disabled + .option-body { opacity: .5; }
.option.is-off:hover .option-body { border-color: var(--border-strong); }
@media (min-width: 640px) { .options-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .options-3 .option-body { height: 100%; } }

/* <details> that opens without JS: FAQs, the rules of a category */
.disclosures { display: grid; gap: var(--sp-2); }
.disclosure { border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-1); }
.disclosure > summary {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: var(--touch);
  padding: var(--sp-3) var(--sp-4);
  color: var(--text);
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary > .icon:first-child { color: var(--gold); }
.disclosure > summary:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-md); }
.disclosure-chevron { margin-inline-start: auto; color: var(--text-faint); transition: transform var(--dur-1) var(--ease); }
.disclosure[open] > summary .disclosure-chevron { transform: rotate(180deg); }
.disclosure-body { display: grid; gap: var(--sp-3); padding: 0 var(--sp-4) var(--sp-4); }
.disclosure-sm > summary { min-height: 40px; padding-block: var(--sp-2); font-size: var(--fs-14); font-weight: 600; }
@media (pointer: coarse) { .disclosure-sm > summary { min-height: var(--touch); } }

/* star rating: radios 5..1 laid out in reverse, so in RTL they fill from the right */
.rating-field { display: grid; gap: var(--sp-2); min-width: 0; margin: 0; padding: 0; border: 0; }
.rating { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: var(--sp-1); }
.rating > label { display: grid; place-content: center; width: var(--touch); height: var(--touch); border-radius: var(--r-sm); color: var(--border-hover); cursor: pointer; transition: color var(--dur-1) var(--ease); }
.rating > label .icon { width: 28px; height: 28px; fill: currentColor; }
.rating > input:checked ~ label,
.rating > label:hover,
.rating > label:hover ~ label { color: var(--gold); }
.rating > input:focus-visible + label { box-shadow: var(--ring); }
.stars .is-off { color: var(--border-hover); }

/* ---------- wallet balances: «محفظتي» and the customer's file in the panel (W, F1) ---------- */
.wallet-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-5); }
.wallet-card { display: grid; gap: var(--sp-1); padding: var(--sp-5); border: 1px solid var(--gold-line); border-radius: var(--r-lg); background: var(--surface-1); }
.wallet-kind { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--text-muted); font-size: var(--fs-14); font-weight: 600; }
.wallet-kind .icon { color: var(--gold); }
.wallet-amount { color: var(--gold); font-family: var(--font-head); font-size: var(--fs-28); font-weight: 800; }
.success-text { color: var(--success); }

/* ---------- one-time codes: staff two-step sign-in (F6) ---------- */
.code-input { font-family: var(--font-head); font-size: var(--fs-22); font-weight: 700; letter-spacing: 4px; text-align: center; }
.steps-list { display: grid; gap: var(--sp-2); padding-inline-start: var(--sp-6); list-style: decimal; }

/* A small menu that opens under its button (details.menu; ds.js closes it on a click outside or Esc).
   On the site (sorting) and in the panel («تنزيل»: Excel or PDF, decision 54). */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] > summary { border-color: var(--border-hover); }
.menu-list {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  z-index: var(--z-sticky);
  display: grid;
  min-width: 168px;
  padding: var(--sp-1);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  box-shadow: var(--shadow-3);
  animation: ds-pop var(--dur-2) var(--ease-out);
}
.menu-list a { display: flex; align-items: center; gap: var(--sp-2); min-height: 40px; padding: 0 var(--sp-3); border-radius: var(--r-sm); color: var(--text-muted); font-size: var(--fs-14); font-weight: 600; }
.menu-list a:hover { background: var(--surface-3); color: var(--text); }
.menu-list a[aria-current="true"] { color: var(--gold); }
.menu-list a:focus-visible { outline: none; box-shadow: var(--ring); }
@media (pointer: coarse) { .menu-list a { min-height: var(--touch); } }
.menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  z-index: var(--z-sticky);
  display: grid;
  gap: var(--sp-3);
  width: min(300px, calc(100vw - 32px));
  padding: var(--sp-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface-2);
  box-shadow: var(--shadow-3);
  animation: ds-pop var(--dur-2) var(--ease-out);
}

/* the time left (decision 58, ds.js [data-until]): red once it is over */
[data-until].is-over { color: var(--danger); }
