/* =====================================================================
   بيجر تِك — owner-controlled features («الميزات»), shared by the three themes.
   Theme tokens only (--surface, --text, --muted, --line, --brand, --ready, --warn…), so each theme keeps
   its own look. Loaded after the theme's screen CSS on /staff, /o/:token and /d/:slug.
   ===================================================================== */

/* ---------------- staff settings: groups, categories, option forms ---------------- */
h4.set-title { margin: 0; }
.set-intro { gap: 6px; }
.set-group-title { font-size: 19px; font-weight: var(--fw-bold); line-height: 1.35; }
.set-cat {
  margin: 10px 0 -4px; padding-top: 14px; border-top: 1.5px solid var(--line);
  font-size: 12.5px; font-weight: var(--fw-bold); letter-spacing: .02em; color: var(--muted);
}
.set-cat + .set { border-top: 0; padding-top: 6px; }
.set-form { display: flex; flex-direction: column; gap: 12px; }
.set-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.set-field .field { min-height: 52px; font-size: 15px; }
.set-field .field[dir="ltr"] { text-align: left; }
.set-label { font-size: 13.5px; font-weight: var(--fw-medium); color: var(--muted); }
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 520px) { .set-grid { grid-template-columns: 1fr; } }

/* multi-select chips (order types the cashier sees) */
.picks { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { position: relative; }
.pick input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.pick span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px;
  border-radius: var(--radius-pill); background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 14.5px; font-weight: var(--fw-medium); color: var(--muted); white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.pick span::before { content: ""; width: 9px; height: 9px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px currentColor; }
.pick input:checked + span { background: var(--brand); color: var(--on-brand); box-shadow: none; font-weight: var(--fw-bold); }
.pick input:checked + span::before { background: currentColor; }
.pick input:focus-visible + span { outline: 3px solid var(--text); outline-offset: 2px; }
.pick input:disabled + span { opacity: .6; }

/* ---------------- staff entry: no automatic numbers (the owner turned it off) ---------------- */
.s-entry.no-auto { grid-template-columns: minmax(110px, 170px) minmax(0, 1fr) auto; }
@container main (max-width: 760px) {
  .s-entry.no-auto { grid-template-columns: minmax(96px, 130px) minmax(0, 1fr) auto; }
}
@container main (max-width: 560px) {
  .s-entry.no-auto { grid-template-columns: minmax(0, 1fr) auto; }
}

/* ---------------- staff entry: order type chips («نوع الطلب») ---------------- */
.type-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 4px 0 2px; }
.type-row-k { font-size: 13px; font-weight: var(--fw-medium); color: var(--muted); margin-inline-end: 4px; }
.type-chip {
  min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--radius-pill); cursor: pointer;
  background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line);
  font: inherit; font-size: 14.5px; font-weight: var(--fw-medium); white-space: nowrap;
  transition: background-color .15s, color .15s, transform .15s;
}
.type-chip:active { transform: scale(.96); }
.type-chip:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.type-chip[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); box-shadow: none; font-weight: var(--fw-bold); }
.type-chip.is-app[aria-pressed="true"] { background: var(--ready); color: var(--on-ready); }

/* ---------------- staff cards: type tag + customer reply ---------------- */
.card-tag {
  display: inline-flex; align-items: center; align-self: flex-start; max-width: 100%;
  margin-bottom: 2px; padding: 1px 10px; border-radius: var(--radius-pill);
  background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 12.5px; font-weight: var(--fw-bold); line-height: 1.7; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-tag.is-app { background: var(--ready-soft); box-shadow: none; color: var(--text); }
/* «نيون» lays the card's text out on the card grid itself: the tag shares the label row, at its end */
html[data-theme="neon"] .card-tag { grid-area: label; justify-self: end; align-self: center; margin: 0; }
html[data-theme="neon"] .card:has(.card-tag) .card-label { padding-inline-end: 110px; }
.card-reply {
  grid-column: 1 / -1;
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin: 6px 4px 2px; padding: 6px 12px;
  border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--text);
  font-size: 14px; font-weight: var(--fw-bold); line-height: 1.45;
}
.card-reply .ico { width: 1.15em; height: 1.15em; }
.card-reply small { margin-inline-start: auto; font-weight: var(--fw-medium); color: var(--muted); white-space: nowrap; }
.card.has-reply { border-radius: var(--radius-lg); }
.card-reply.is-car { background: var(--alert-soft); }
.card.has-car { box-shadow: inset 0 0 0 2.5px var(--alert), var(--shadow-1); }

/* ---------------- staff report: order types + private ratings ---------------- */
.rp-sec { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; border-top: 1.5px solid var(--line); }
.rp-types { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.rp-types li {
  display: inline-flex; align-items: baseline; gap: 8px; padding: 6px 14px; border-radius: var(--radius-pill);
  background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--line); font-size: 14px; font-weight: var(--fw-medium);
}
.rp-types b { font-size: 16px; }
.fb-sum { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.fb-avg { font-size: 34px; font-weight: var(--fw-bold); line-height: 1.1; }
.fb-stars { font-size: 18px; letter-spacing: .08em; color: var(--warn); }
.fb-count { font-size: 13.5px; color: var(--muted); }
.fb-off { color: var(--line); }
.fb-bars { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; max-width: 420px; }
.fb-bars li { display: grid; grid-template-columns: 34px minmax(0, 1fr) 34px; align-items: center; gap: 10px; font-size: 13.5px; }
.fb-bars .fb-track { height: 10px; border-radius: 10px; background: var(--surface-2); overflow: hidden; }
.fb-bars .fb-fill { display: block; height: 100%; border-radius: 10px; background: var(--warn); transform: scaleX(var(--w, 0)); transform-origin: right center; }
.fb-sub { margin: 6px 0 0; font-size: 14px; font-weight: var(--fw-bold); }
.fb-recent { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.fb-recent li { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--line); }
.fb-recent .fb-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: var(--muted); }
.fb-recent .fb-meta b { color: var(--warn); letter-spacing: .06em; }
.fb-recent p { margin: 4px 0 0; font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere; }

/* ---------------- customer page ---------------- */
.c-box {
  display: flex; flex-direction: column; gap: 10px; padding: 16px 18px;
  border-radius: var(--radius-lg); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-1), inset 0 0 0 1.5px var(--line);
  animation: state-in .5s cubic-bezier(.2, .8, .2, 1) both;
}
.c-box-k { font-size: 13px; font-weight: var(--fw-medium); color: var(--muted); }

/* «أمامك N طلبات · جاهز خلال نحو X–Y دقائق» */
.c-queue { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; text-align: start; }
.c-queue-ahead { font-size: 17px; font-weight: var(--fw-bold); line-height: 1.4; }
.c-queue-eta { font-size: 14.5px; font-weight: var(--fw-medium); color: var(--muted); }
.c-queue-eta:empty { display: none; }

/* customer replies + car */
.c-replies { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.c-replies .btn { min-height: 54px; white-space: normal; text-align: center; }
.c-reply-ok { font-size: 14.5px; font-weight: var(--fw-bold); text-align: center; line-height: 1.5; }
.c-car-form { display: flex; flex-direction: column; gap: 10px; }
.c-car-form .field { min-height: 54px; font-size: 16px; }
.c-car-row { display: flex; gap: 8px; }
.c-car-row .btn { flex: 1 1 0; min-height: 52px; }
.c-car-done { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.c-car-done p { font-size: 15px; font-weight: var(--fw-bold); line-height: 1.55; }
.c-car-done small { font-size: 13px; color: var(--muted); }
.btn-car .ico, .c-reply-ok .ico { width: 1.35em; height: 1.35em; }
.btn-link { background: transparent; box-shadow: none; min-height: 44px; padding: 0 10px; font-weight: var(--fw-medium); color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

/* today's offer */
.c-promo { flex-direction: row; align-items: center; gap: 14px; background: var(--ready-soft); box-shadow: none; }
.c-promo-ico { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--ready); }
.c-promo-ico .ico { width: 22px; height: 22px; }
.c-promo-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.c-promo-text b { font-size: 15.5px; line-height: 1.5; overflow-wrap: anywhere; }
.c-promo a { font-size: 13.5px; font-weight: var(--fw-bold); color: var(--text); text-underline-offset: 3px; }

/* menu + social links */
.c-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.c-links .btn { min-height: 46px; padding: 0 16px; font-size: 14.5px; }
.c-links .btn .ico { width: 1.15em; height: 1.15em; }

/* private rating after pickup */
.c-fb { align-items: center; text-align: center; }
.c-fb-q { font-size: 17px; font-weight: var(--fw-bold); }
.c-stars { display: flex; justify-content: center; gap: 4px; direction: ltr; }
.c-star {
  width: 52px; height: 52px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%;
  background: transparent; color: var(--line); cursor: pointer; transition: transform .15s, color .15s;
}
.c-star .ico { width: 36px; height: 36px; }
.c-star.is-on { color: var(--warn); }
.c-star:active { transform: scale(.9); }
.c-star:focus-visible { outline: 3px solid var(--text); outline-offset: 1px; }
.c-fb-label { font-size: 13.5px; font-weight: var(--fw-medium); color: var(--muted); min-height: 1.5em; }
.c-fb form { align-self: stretch; }
.c-fb textarea.field { width: 100%; min-height: 84px; padding: 12px 16px; border-radius: var(--radius); resize: vertical; font: inherit; font-size: 15px; line-height: 1.6; text-align: start; }
.c-fb .btn { width: 100%; }
.c-fb-done { font-size: 15px; font-weight: var(--fw-bold); }
.c-box .form-error { font-size: 13.5px; font-weight: var(--fw-bold); color: var(--danger); text-align: center; }
.c-reply-ok.is-error { color: var(--danger); }

/* «جاهز» repaints the page in the ready colour (and redefines --text for it): cards become outlines */
.st-ready .c-box {
  background: color-mix(in srgb, var(--text) 10%, transparent);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--text) 40%, transparent);
  color: var(--text);
}
.st-ready .c-box-k { color: var(--muted); }
.st-ready .c-replies .btn, .st-ready .c-car .btn-ghost, .st-ready .c-car .btn-link {
  background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--text);
}
.st-ready .c-car .btn-link { box-shadow: none; }
.st-ready .c-car .btn-primary { background: var(--text); color: var(--ready); box-shadow: none; }
.st-ready .c-car .field { background: color-mix(in srgb, var(--text) 92%, var(--ready)); color: var(--ready); box-shadow: none; border-color: transparent; }
.st-ready .c-car .field::placeholder { color: color-mix(in srgb, var(--ready) 70%, var(--text)); }
.st-ready .c-box .form-error { color: var(--text); text-decoration: underline; }

/* ---------------- TV display ---------------- */
/* delivery app under the number, so drivers find their order */
.d-tag {
  display: block; max-width: 92%; margin-top: .25em; padding: .08em .6em; border-radius: 99px;
  background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line);
  font-size: max(11px, calc(min(var(--cw, 17vw), var(--ch, 17vw)) * .075)); font-weight: var(--fw-bold);
  line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.d-n.has-tag, .d-p.has-tag { grid-template-rows: auto auto; align-content: center; justify-items: center; }
.d-p .d-tag { font-size: max(10px, calc(var(--p, 6vw) * .14)); margin-top: .1em; }
/* today's offer along the bottom of the board */
.d-promo {
  display: flex; align-items: center; gap: 1.2vw; margin: 0 2.6vw 1.6vw; padding: .9vw 1.6vw;
  border-radius: 1.4vw; background: var(--surface); color: var(--text); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
  font-size: max(15px, 1.5vw); font-weight: var(--fw-bold); line-height: 1.4;
}
.d-promo-k { flex: none; padding: .15em .8em; border-radius: 99px; background: var(--ready); color: var(--on-ready); font-size: .8em; }
.d-promo-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-voice-note { font-size: max(12px, .8vw); color: var(--muted); white-space: nowrap; }
