/* The venue board stays on paper. Phone pages inherit the device palette. */
:root.venue {
  color-scheme: light;
  --bg: #f4efe6; --card: #fffdf9; --surface-2: #e9e2d5; --line: #d5cbb9;
  --ink: #1c1915; --muted: #6a6256; --warn: #8a5000; --prep-fill: #fbe9c8;
  --ok: #0b6b57; --come-fill: #d8f1e8; --err: #a23b2a; --dot-off: #d8ccb6;
}
body { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
bdi[dir="ltr"].lat { white-space: nowrap; }
:focus-visible { outline: 3px solid var(--warn); outline-offset: 3px; }
.account-brand { display: block; width: 132px; height: 44px; border-radius: 6px; }
.phone main { max-width: 32rem; min-height: 100dvh; padding: 24px 18px 32px; }
.phone .mast { padding-block: 4px 18px; border-bottom: 1px solid var(--line); }
.phone .content { margin-top: 24px; }
.phone h1, .venue h2 { font-size: 32px; line-height: 1.7; margin: 0 0 8px; }
.phone label { display: block; font-weight: 600; margin-block: 12px 4px; }
.phone input, .venue input, .venue select {
  min-width: 0; min-height: 48px; font: inherit; text-align: start; letter-spacing: normal;
  border: 1.5px solid var(--muted); border-radius: 10px; background: var(--card);
}
.phone input[dir="ltr"], .venue input[dir="ltr"], .place-code, .result bdi, .pairurl { font-family: var(--font-mono); }
.phone button { margin-top: 14px; }
.phone button:not(.secondary,.link) { background: var(--amber); color: #14120f; border: 1.5px solid var(--warn); }
.phone .link { background: none; color: var(--ink); width: auto; padding: 4px 0; min-height: 44px; }
.phone a, .link, .place a { color: var(--ink); text-decoration: underline; text-underline-offset: .2em; }
.phone fieldset { margin: 16px 0; padding: 10px 14px 16px; min-width: 0; border: 1px solid var(--line); border-radius: 14px; }
.phone legend, .venue h3, .place h2 { font-size: 19px; font-weight: 600; }
#ts { margin-top: 16px; min-height: 65px; max-width: 100%; }
.step { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.step .mk { font-family: var(--font-mono); color: var(--warn); }
.muted { font-size: 14px; }
p:empty { display: none; }
.venue header .identity { background: var(--card); padding: 14px; border-radius: 12px; }
.venue nav button.on { background: var(--surface-2); color: var(--ink); }
.venue nav button.on .mk, .result nav .mk, .place .mk { color: var(--warn); }
.venue nav button { border-radius: 12px; }
.venue nav .mk { display: inline-block; }
.venue .value { font: 32px/1 var(--font-grid), var(--font-ar); }
.venue .lead { padding: 16px; background: var(--card); border-inline-start: 4px solid var(--warn); border-radius: 10px; }
.venue .lead .value { font-size: 48px; }
.venue .heading { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.venue .result, .place { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-block: 12px; }
.place ul { list-style: none; padding: 0; }
.place li { border-top: 1px solid var(--line); }
.place a { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.place-code { margin-inline-start: auto; }
.account-state { border-block-start: 1px solid var(--line); padding-top: 12px; }
.account-state .mk, .support-bar .mk { color: var(--warn); margin-inline-end: 6px; }
.account-state.confirmed .mk { color: var(--ok); }
.account-pin { container-type: inline-size; max-width: 300px; direction: ltr; }
.pin-row { position: relative; display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 4px; overflow: clip; border-radius: 8px; }
.pin-row:has(:focus-visible) { outline: 3px solid var(--warn); outline-offset: 3px; }
.pin-row span { height: 52px; border: 1.5px solid var(--muted); border-radius: 8px; background: var(--card); }
.account-pin .pin-row input {
  position: absolute; inset: 0 auto 0 0; height: 100%; margin: 0; border: 0; border-radius: 8px;
  background: transparent; text-align: left; font: 32px/1 var(--font-grid); direction: ltr;
  --cell: calc((100cqw - 20px) / 6);
  /* Leave room for the last digit's trailing letter-spacing so the input never scrolls sideways. */
  width: calc(100% + (var(--cell) - 1ch) / 2 + 6px);
  padding: 0 0 0 calc((var(--cell) - 1ch) / 2);
  letter-spacing: calc(var(--cell) + 4px - 1ch);
}
input[aria-invalid="true"], .pin-row:has([aria-invalid="true"]) span { border-color: var(--err); }
.waiting { color: var(--muted); }
.waiting::before, form button:disabled::before, #eSend:disabled::before { content: "[ . . . .]"; display: inline-block; margin-inline-end: 8px; direction: ltr; unicode-bidi: isolate; white-space: pre; font: 14px var(--font-mono); color: var(--warn); animation: load-dots 332ms step-end 300ms infinite, load-delay 300ms step-end backwards; }
@keyframes load-dots {
  0% { content: "[@@ . . .]"; } 25% { content: "[ .@@ . .]"; }
  50% { content: "[ . .@@ .]"; } 75% { content: "[ . . .@@]"; }
}
@keyframes load-delay { from { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
  .waiting::before { content: "[ . . . .]"; animation: load-delay 300ms step-end backwards; }
  .waiting:not(.brief)::after { content: " لحظة"; }
}
@media (max-width: 680px) {
  .venue nav button { flex: 1 1 6rem; }
  .venue .shell > * { min-width: 0; }
}
.venue .support-shell {
  width: min(100%, 1180px); max-width: none; padding: clamp(16px, 4vw, 52px);
  display: grid; grid-template-columns: 192px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px);
}
.support-shell header { display: block; border: 0; border-inline-end: 1px solid var(--line); padding-inline-end: 16px; }
.support-shell header nav { padding: 12px; }
.support-shell h1 { font-size: 24px; margin-top: 12px; }
.support-shell form { align-items: center; margin: 0; background: var(--card); padding: 16px; border: 1px solid var(--line); border-radius: 14px; }
.support-shell label { flex-basis: 100%; font-weight: 600; }
.support-shell .result a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.venue .seg button.on { color: var(--bg); background: var(--ink); }
@media (max-width: 920px) {
  .venue .support-shell { grid-template-columns: minmax(0, 1fr); }
  .support-shell header { display: flex; align-items: center; border: 0; border-bottom: 1px solid var(--line); padding: 0 0 12px; }
}

form button:disabled::before, #eSend:disabled::before { color: inherit; }

/* «أظهر» inside a password field: on the field's left (its text runs left to right) */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-left: 64px !important; }
.pw-wrap .pw-eye { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); width: auto; min-height: 36px; margin: 0 !important;
  padding: 0 8px; border: 0; border-radius: 8px; background: transparent !important; color: var(--ink) !important; font: inherit; font-size: .88rem; font-weight: 600;
  text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.dash .pw-wrap { margin-top: 6px; }
.dash .pw-wrap input { margin-top: 0 !important; }

/* the B-jar app's back button (auth.js), at the start of the page's own top bar */
.app-back { flex: none; display: inline-grid !important; place-items: center; width: 40px !important; height: 40px; min-height: 40px !important; margin: 0 !important; padding: 0 !important;
  border-radius: 50% !important; border: 1px solid var(--line) !important; background: var(--card) !important; color: var(--ink) !important; font: 600 20px/1 var(--font-ar) !important; cursor: pointer; }
.phone .mast:has(.app-back) { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.side .brand-row:has(.app-back) { justify-content: flex-start; gap: 10px; }
.side .brand-row:has(.app-back) .menu-toggle { margin-inline-start: auto; }
