/* Haatly order chat design — for stores that keep the original storefront (chat design flag on, home switch off).
   Built by chat_only_compose.py from chat-redesign.css; edit that, then rebuild. */

/* ===== order chat ===== */
/* ==========================================================================
   Order chat redesign (preview layer). Loaded after the original styles.
   Scope: #order-chat-modal only. Port to header.blade.php once approved.
   ========================================================================== */
#order-chat-modal {
  --oc-accent: #2fb3c2;
  --oc-accent-deep: #1f97a6;
  --oc-accent-soft: #e6f6f8;
  --oc-ink: #0f2a33;
  --oc-muted: #6b8089;
  --oc-surface: #ffffff;
  --oc-incoming: #f1f5f7;
  --oc-line: #e3eaed;
  --oc-ease: cubic-bezier(.22, .8, .24, 1);
}
html.dark-mode #order-chat-modal {
  --oc-ink: #e8f1f3;
  --oc-muted: #9fb2b8;
  --oc-surface: #1c1f26;
  --oc-incoming: #262a33;
  --oc-line: #323743;
  --oc-accent-soft: #17343a;
}

/* ---------- Bubbles: calmer shapes, consistent spacing ---------- */
#order-chat-modal .order-chat-bubble {
  border-radius: 18px 18px 18px 6px;
  padding: 8px 12px 6px;
  box-shadow: 0 1px 1px rgba(15, 42, 51, .04), 0 2px 8px rgba(15, 42, 51, .05);
  animation: oc-bubble-in .32s var(--oc-ease) both;
}
#order-chat-modal .order-chat-bubble-delegate .order-chat-bubble,
#order-chat-modal .order-chat-bubble-store .order-chat-bubble { background: var(--oc-incoming); color: var(--oc-ink); }
#order-chat-modal .order-chat-bubble-customer .order-chat-bubble {
  border-radius: 18px 18px 6px 18px;
  background: linear-gradient(160deg, var(--oc-accent) 0%, var(--oc-accent-deep) 100%);
}
#order-chat-modal .order-chat-row + .order-chat-row { margin-top: 6px; }
#order-chat-modal .order-chat-bubble-time,
#order-chat-modal .order-chat-voice-sent-at { font-variant-numeric: tabular-nums; letter-spacing: .2px; opacity: .75; }
@keyframes oc-bubble-in { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }

/* Delegate avatar: only once per run of consecutive delegate messages (on the last one). */
#order-chat-modal .order-chat-bubble-delegate:has(+ .order-chat-bubble-delegate) .order-chat-delegate-msg-avatar { visibility: hidden; }
#order-chat-modal .order-chat-delegate-msg-avatar { width: 28px; height: 28px; background: var(--oc-accent-soft); color: var(--oc-accent-deep); border: 0; }

/* ---------- Voice message ---------- */
#order-chat-modal .order-chat-bubble--voice-msg { padding: 8px 10px 7px; min-width: 248px; max-width: 290px; }
#order-chat-modal .order-chat-voice-avatar { display: none !important; }
#order-chat-modal .order-chat-voice-layout { display: block; }
#order-chat-modal .order-chat-voice-player { display: flex; flex-direction: column; gap: 4px; width: 100%; }
#order-chat-modal .order-chat-voice-player-track { display: flex; align-items: center; gap: 10px; direction: ltr; }

/* Play button: clean flat disc, crisp centred icon */
#order-chat-modal .order-chat-voice-play {
  --oc-p: 0;
  position: relative; flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
  border: 0; padding: 0; display: grid; place-items: center; cursor: pointer; isolation: isolate;
  background: var(--oc-accent-deep); color: #fff; box-shadow: none;
  transition: transform .18s var(--oc-ease), background .2s;
  -webkit-tap-highlight-color: transparent;
}
#order-chat-modal .order-chat-bubble-customer .order-chat-voice-play { background: #fff; color: var(--oc-accent-deep); }
#order-chat-modal .order-chat-voice-play:hover { transform: scale(1.05); }
#order-chat-modal .order-chat-voice-play:active { transform: scale(.92); }
#order-chat-modal .order-chat-voice-play:focus-visible { outline: 2px solid var(--oc-accent); outline-offset: 3px; }
#order-chat-modal .order-chat-voice-play-inner { position: relative; width: 16px; height: 16px; display: block; }
#order-chat-modal .order-chat-voice-play svg {
  position: absolute; inset: 0; width: 16px !important; height: 16px !important; display: block !important;
  transition: opacity .18s var(--oc-ease), transform .24s var(--oc-ease);
}
#order-chat-modal .order-chat-voice-play .oc-icon-play { transform: translateX(1px); }
#order-chat-modal .order-chat-voice-play .oc-icon-pause { opacity: 0; transform: scale(.6); }
#order-chat-modal .order-chat-voice-player.is-playing .oc-icon-play { opacity: 0; transform: translateX(1px) scale(.6); }
#order-chat-modal .order-chat-voice-player.is-playing .oc-icon-pause { opacity: 1; transform: none; }
/* progress ring that fills around the button while it plays */
#order-chat-modal .order-chat-voice-play::after {
  content: ''; position: absolute; inset: -5px; border-radius: 50%; z-index: -1; pointer-events: none;
  background: conic-gradient(var(--oc-ring, var(--oc-accent)) calc(var(--oc-p) * 1turn), var(--oc-ring-track, rgba(47, 179, 194, .16)) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1.5px));
  opacity: 0; transition: opacity .25s var(--oc-ease);
}
#order-chat-modal .order-chat-bubble-customer .order-chat-voice-play { --oc-ring: #fff; --oc-ring-track: rgba(255, 255, 255, .28); }
#order-chat-modal .order-chat-voice-player.is-playing .order-chat-voice-play::after,
#order-chat-modal .order-chat-voice-player.oc-started .order-chat-voice-play::after { opacity: 1; }
#order-chat-modal .order-chat-voice-play::after { display: none !important; }
/* simple look: the play / pause mark stands on its own, without a disc behind it */
#order-chat-modal .order-chat-voice-play,
#order-chat-modal .order-chat-bubble-customer .order-chat-voice-play { width: 30px; height: 38px; border-radius: 8px; background: none !important; color: var(--oc-accent-deep); }
#order-chat-modal .order-chat-bubble-customer .order-chat-voice-play { color: #fff; }
#order-chat-modal .order-chat-voice-play-inner { width: 22px; height: 22px; }
#order-chat-modal .order-chat-voice-play svg { width: 22px !important; height: 22px !important; }
#order-chat-modal .order-chat-voice-play .oc-icon-play { transform: none; }
#order-chat-modal .order-chat-voice-player.is-playing .oc-icon-play { transform: scale(.6); }
/* side column: duration, and the speed pill under it only while the note plays */
#order-chat-modal .oc-voice-side { flex: 0 0 auto; min-width: 34px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
#order-chat-modal .oc-voice-side .order-chat-voice-audio-dur { font-size: 11.5px; font-weight: 600; line-height: 1; }
#order-chat-modal .oc-voice-side { gap: 0; }
/* the pill eases in when the note starts and eases out when it ends (height, fade and a slight scale) */
#order-chat-modal .oc-voice-side .oc-voice-speed {
  display: block; height: 0; min-width: 32px; padding: 0 7px; margin-top: 0; font-size: 10.5px; font-weight: 700; overflow: hidden;
  opacity: 0; transform: scale(.8); pointer-events: none;
  transition: height .26s var(--oc-ease), margin-top .26s var(--oc-ease), opacity .22s ease, transform .26s var(--oc-ease), background .2s;
}
#order-chat-modal .order-chat-voice-player.oc-live .oc-voice-side .oc-voice-speed { height: 18px; margin-top: 4px; opacity: 1; transform: none; pointer-events: auto; }
#order-chat-modal .order-chat-voice-player.oc-live .oc-voice-side .oc-voice-speed:active { transform: scale(.9); }
#order-chat-modal .order-chat-voice-wave-block { margin-inline: 2px 4px; }
/* the bubble follows the length of the wave (set per note from its duration) */
#order-chat-modal .order-chat-bubble--voice-msg { min-width: 0; width: auto; }
#order-chat-modal .order-chat-voice-main { flex: 0 0 auto; }
#order-chat-modal .order-chat-voice-wave-block { flex: 0 0 auto; transition: width .2s var(--oc-ease); } /* no progress ring around the button: the waveform shows the progress */

/* Unplayed incoming voice: small dot on the play button */
#order-chat-modal .order-chat-voice-player.oc-unplayed .order-chat-voice-play::before {
  content: ''; position: absolute; top: 0; left: 0; width: 11px; height: 11px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 0 2px var(--oc-incoming);
}

/* Waveform: thin rounded bars, dots where it is quiet, and a knob riding on the play position */
#order-chat-modal .order-chat-voice-main { flex: 1 1 auto; min-width: 0; }
#order-chat-modal .order-chat-voice-wave-block { position: relative; cursor: pointer; padding: 4px 0; margin-inline: 6px; touch-action: none; }
#order-chat-modal .order-chat-voice-wave { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 2px; height: 28px; } /* runs left → right, starting beside the play button */
#order-chat-modal .order-chat-voice-wave-bar {
  flex: 0 0 3px; width: 3px; max-width: 3px; min-width: 3px; min-height: 3px; border-radius: 999px; align-self: center !important;
  background: var(--oc-accent-deep); opacity: .3 !important; /* only .oc-played brightens a bar */
  transform-origin: center; transition: opacity .12s linear;
}
#order-chat-modal .order-chat-bubble-customer .order-chat-voice-wave-bar { background: #fff; opacity: .42 !important; }
#order-chat-modal .order-chat-voice-wave-bar.oc-head { transform: none; animation: none !important; }
#order-chat-modal .order-chat-voice-wave-bar.oc-played,
#order-chat-modal .order-chat-bubble-customer .order-chat-voice-wave-bar.oc-played { opacity: 1 !important; }
#order-chat-modal .oc-voice-knob {
  position: absolute; top: 50%; right: calc(var(--oc-pos, 0) * 100%); width: 13px; height: 13px; margin: -6.5px -6.5px 0 0; border-radius: 50%;
  background: var(--oc-accent, #2fb3c2); box-shadow: 0 0 0 2.5px var(--oc-incoming, #f1f5f7); pointer-events: none; transition: transform .15s var(--oc-ease);
}
#order-chat-modal .order-chat-bubble-customer .oc-voice-knob { background: #fff; box-shadow: 0 0 0 2.5px var(--oc-accent-deep, #1f97a6); }
#order-chat-modal .order-chat-voice-wave-block:active .oc-voice-knob { transform: scale(1.25); }

/* Slot at the outer end of the row: mic mark while idle; once the note plays it turns into the speed pill */
#order-chat-modal .oc-voice-slot { position: relative; flex: 0 0 0; width: 0; margin-right: -10px; height: 30px; display: grid; place-items: center; overflow: hidden; transition: flex-basis .25s var(--oc-ease), width .25s var(--oc-ease), margin .25s var(--oc-ease); }
#order-chat-modal .order-chat-voice-player.oc-live .oc-voice-slot { flex-basis: 42px; width: 42px; margin-right: 0; }
#order-chat-modal .oc-voice-mic, #order-chat-modal .oc-voice-knob { display: none !important; } /* no mic mark and no scrub dot */
#order-chat-modal .oc-voice-slot { display: none !important; } /* no playback-speed button either: notes play at normal speed */
#order-chat-modal .oc-voice-slot > * { grid-area: 1 / 1; transition: opacity .2s var(--oc-ease), transform .25s var(--oc-ease); }
#order-chat-modal .oc-voice-mic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(15, 42, 51, .06); color: var(--oc-accent-deep, #1f97a6); }
#order-chat-modal .order-chat-bubble-customer .oc-voice-mic { background: rgba(255, 255, 255, .18); color: #fff; }
#order-chat-modal .oc-voice-mic svg { width: 15px; height: 15px; display: block; }
#order-chat-modal .oc-voice-slot .oc-voice-speed { opacity: 0; transform: scale(.7); pointer-events: none; }
#order-chat-modal .order-chat-voice-player.oc-live .oc-voice-slot .oc-voice-speed { opacity: 1; transform: none; pointer-events: auto; }
#order-chat-modal .order-chat-voice-player.oc-live .oc-voice-mic { opacity: 0; transform: scale(.7); }
/* Speed pill: in the main row, at the outer end beside the play button */
#order-chat-modal .oc-voice-speed {
  flex: 0 0 auto; direction: ltr; unicode-bidi: isolate; border: 0; cursor: pointer; font: inherit; font-weight: 800; font-size: 12px; line-height: 1;
  height: 26px; min-width: 40px; padding: 0 9px; border-radius: 999px; font-variant-numeric: tabular-nums;
  background: rgba(15, 42, 51, .08); color: inherit; transition: background .2s, transform .15s var(--oc-ease);
  -webkit-tap-highlight-color: transparent;
}
#order-chat-modal .order-chat-bubble-customer .oc-voice-speed { background: rgba(255, 255, 255, .22); }
#order-chat-modal .oc-voice-speed:active { transform: scale(.9); }
#order-chat-modal .oc-voice-speed:not([data-rate="1"]) { background: var(--oc-accent-deep, #1f97a6); color: #fff; }
#order-chat-modal .order-chat-bubble-customer .oc-voice-speed:not([data-rate="1"]) { background: #fff; color: var(--oc-accent-deep, #1f97a6); }

/* Meta row under the waveform: sent time at its start, duration at its end */
#order-chat-modal .order-chat-voice-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  direction: ltr; padding-left: 2px; padding-right: 6px; font-size: 11px; line-height: 1; /* sent time sits at the far left of the bubble */
}
#order-chat-modal .order-chat-voice-meta-end { display: inline-flex; align-items: center; gap: 6px; }
/* the sent time sits outside the voice bubble, just under it */
#order-chat-modal .order-chat-bubble--voice-msg { margin-bottom: 17px; overflow: visible; padding-bottom: 8px; }
#order-chat-modal .order-chat-bubble--voice-msg .order-chat-voice-player { position: static; } /* so the time is placed against the bubble, not the player */
#order-chat-modal .order-chat-bubble--voice-msg .order-chat-voice-meta { position: absolute; top: 100%; left: 6px; right: auto; margin-top: 4px; padding: 0; white-space: nowrap; }
/* it stays on the side the bubble's tail comes out of: left for incoming notes, right for your own */
#order-chat-modal .order-chat-bubble-customer .order-chat-bubble--voice-msg .order-chat-voice-meta { left: auto; right: 6px; }
#order-chat-modal .order-chat-bubble--voice-msg .order-chat-voice-sent-at { color: #7d8b91 !important; opacity: 1; }
#order-chat-modal .order-chat-bubble--voice-msg .oc-voice-read { color: var(--oc-accent, #2fb3c2); }
html.dark-mode #order-chat-modal .order-chat-bubble--voice-msg .order-chat-voice-sent-at, body.dark-mode #order-chat-modal .order-chat-bubble--voice-msg .order-chat-voice-sent-at { color: #9aa6ab !important; }
#order-chat-modal .order-chat-voice-audio-dur { font-weight: 700; font-variant-numeric: tabular-nums; }
#order-chat-modal .order-chat-voice-sent-at { direction: rtl !important; unicode-bidi: isolate !important; }

/* Read marks (✓✓) on your own voice notes: crisp icon next to the time */
#order-chat-modal .order-chat-voice-read { display: none !important; }
#order-chat-modal .oc-voice-read {
  display: inline-flex; align-items: center; margin-inline-start: 3px; color: #fff; opacity: .95;
  vertical-align: -2px;
}
#order-chat-modal .oc-voice-read svg { width: 16px; height: 11px; display: block; }
#order-chat-modal .order-chat-voice-sent-at { display: inline-flex; align-items: center; gap: 2px; }

/* The sent time of a voice note is not shown under it: it appears while the note is pressed (chat-redesign.js adds
   .oc-time-on for a few seconds), and the bubble makes room for it only then. */
#order-chat-modal .order-chat-bubble--voice-msg { margin-bottom: 0; transition: margin-bottom .2s var(--oc-ease, ease); -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
#order-chat-modal .order-chat-bubble--voice-msg.oc-time-on { margin-bottom: 17px; }
#order-chat-modal .order-chat-bubble--voice-msg .order-chat-voice-meta { opacity: 0; transform: translateY(-4px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
#order-chat-modal .order-chat-bubble--voice-msg.oc-time-on .order-chat-voice-meta { opacity: 1; transform: none; }

/* ---------- Delegate bill photo: show the whole receipt ---------- */
#order-chat-modal .order-chat-bubble-media--image-thumb {
  width: 230px !important; height: auto !important; max-height: 320px; overflow: hidden;
  background: #fff; border-radius: 12px; border: 1px solid var(--oc-line); margin-bottom: 6px;
}
#order-chat-modal .order-chat-bubble-media--image-thumb img { width: 100% !important; height: auto !important; max-height: 318px; object-fit: contain !important; display: block; }
#order-chat-modal .order-chat-bubble-total { border-top: 1px dashed var(--oc-line); margin-top: 8px; padding-top: 8px; }
#order-chat-modal .order-chat-bubble-total-amt { font-size: 16px; font-weight: 800; }

/* ---------- Order invoice card (top of chat): soft card ---------- */
#order-chat-modal .order-chat-invoice-card {
  border-radius: 18px; border: 1px solid var(--oc-line); background: var(--oc-surface);
  box-shadow: 0 6px 22px rgba(15, 42, 51, .07);
}
#order-chat-modal .order-chat-invoice-total { background: var(--oc-accent-soft); margin: 10px -4px 0; padding: 10px 12px; border-radius: 12px; border: 0; }
#order-chat-modal .order-chat-invoice-total-amt { font-size: 18px; font-weight: 800; color: var(--oc-accent-deep); }

/* ---------- Delegate's bill message: standalone paper receipt + text bubble below ---------- */
#order-chat-modal .order-chat-bubble.oc-bill-bubble {
  background: none !important; padding: 0 !important; box-shadow: none !important; border-radius: 0 !important;
  display: flex; flex-direction: column; align-items: center; gap: 0; width: 256px;
}
#order-chat-modal .oc-bill-bubble > .order-chat-bubble-row {
  position: relative; z-index: 2; align-self: stretch; margin-top: -14px;
  width: 100% !important; max-width: none !important; box-sizing: border-box;
  background: var(--oc-incoming); color: var(--oc-ink);
  border-radius: 14px 14px 18px 6px; padding: 14px 12px 6px;
  box-shadow: 0 1px 1px rgba(15, 42, 51, .04), 0 2px 8px rgba(15, 42, 51, .05);
}
#order-chat-modal .oc-bill-photo-hidden { position: absolute !important; width: 1px !important; height: 1px !important; min-width: 0 !important; min-height: 0 !important; overflow: hidden; opacity: 0; pointer-events: none; border: 0 !important; margin: 0 !important; }
#order-chat-modal .oc-bill {
  --zz: 6px; --paper: #fffdf8; --ink: #17202a; --soft: #7b8590; --rule: #c9cfd4;
  width: 224px; background: var(--paper); color: var(--ink); text-align: right;
  padding: calc(var(--zz) + 16px) 16px calc(var(--zz) + 14px);
  clip-path: polygon(
    0 var(--zz), 3.57% 0, 7.14% var(--zz), 10.71% 0, 14.28% var(--zz), 17.85% 0, 21.42% var(--zz), 25% 0, 28.57% var(--zz), 32.14% 0, 35.71% var(--zz), 39.28% 0, 42.85% var(--zz), 46.42% 0, 50% var(--zz), 53.57% 0, 57.14% var(--zz), 60.71% 0, 64.28% var(--zz), 67.85% 0, 71.42% var(--zz), 75% 0, 78.57% var(--zz), 82.14% 0, 85.71% var(--zz), 89.28% 0, 92.85% var(--zz), 96.42% 0, 100% var(--zz),
    100% calc(100% - var(--zz)), 96.42% 100%, 92.85% calc(100% - var(--zz)), 89.28% 100%, 85.71% calc(100% - var(--zz)), 82.14% 100%, 78.57% calc(100% - var(--zz)), 75% 100%, 71.42% calc(100% - var(--zz)), 67.85% 100%, 64.28% calc(100% - var(--zz)), 60.71% 100%, 57.14% calc(100% - var(--zz)), 53.57% 100%, 50% calc(100% - var(--zz)), 46.42% 100%, 42.85% calc(100% - var(--zz)), 39.28% 100%, 35.71% calc(100% - var(--zz)), 32.14% 100%, 28.57% calc(100% - var(--zz)), 25% 100%, 21.42% calc(100% - var(--zz)), 17.85% 100%, 14.28% calc(100% - var(--zz)), 10.71% 100%, 7.14% calc(100% - var(--zz)), 3.57% 100%, 0 calc(100% - var(--zz)));
}
#order-chat-modal .oc-bill-bubble { filter: drop-shadow(0 6px 10px rgba(15, 42, 51, .10)); }
/* the receipt "prints" out of a slot on top of the message bubble */
/* the paper slips out from behind the bubble's top edge: no slot graphic, just a clean lip + contact shadow */
#order-chat-modal .oc-bill-bubble > .order-chat-bubble-row {
  border-radius: 10px 10px 18px 6px !important;
  border-top: 1px solid rgba(255, 255, 255, .95);
  box-shadow: 0 -1px 0 rgba(15, 42, 51, .14), 0 -6px 10px -6px rgba(15, 42, 51, .22), 0 2px 8px rgba(15, 42, 51, .06) !important;
}
html.dark-mode #order-chat-modal .oc-bill-bubble > .order-chat-bubble-row { border-top-color: rgba(255, 255, 255, .14); }
/* shadow the bubble's edge casts on the paper */
#order-chat-modal .oc-bill-wrap::after {
  content: ''; position: absolute; left: 8px; right: 8px; bottom: 14px; height: 22px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(15, 42, 51, 0), rgba(15, 42, 51, .05) 55%, rgba(15, 42, 51, .2));
}
#order-chat-modal .oc-bill-wrap { overflow: hidden; padding: 0 8px; position: relative; z-index: 1; }
#order-chat-modal .oc-bill-wrap .oc-bill { padding-bottom: calc(var(--zz) + 22px); }
#order-chat-modal .oc-rx-head { text-align: center; }
#order-chat-modal .oc-rx-brand { font-size: 17px; font-weight: 900; line-height: 1.3; }
#order-chat-modal .oc-rx-sub { margin-top: 2px; font-size: 11px; color: var(--soft); white-space: nowrap; }
#order-chat-modal .oc-rx-sub b { display: inline !important; color: var(--ink); font-weight: 800; unicode-bidi: isolate; }
#order-chat-modal .oc-rx-rule { border: 0; border-top: 1.5px dashed var(--rule); margin: 12px 0; height: 0; }
#order-chat-modal .oc-rx-rows { display: grid; gap: 10px; }
#order-chat-modal .oc-rx-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; }
#order-chat-modal .oc-rx-row > span:first-child { font-weight: 700; }
#order-chat-modal .oc-rx-row > span:last-child { font-weight: 800; direction: ltr; white-space: nowrap; }
#order-chat-modal .oc-rx-row small { display: block; font-weight: 500; color: var(--soft); font-size: 10.5px; }
#order-chat-modal #order-chat-messages .oc-bill .sar-money, #order-chat-modal #order-chat-messages .oc-bill .sar-money * { color: var(--ink) !important; }
#order-chat-modal .oc-rx-rows--tight { gap: 5px; }
#order-chat-modal .oc-rx-meta { font-size: 11.5px; }
#order-chat-modal .oc-rx-meta > span:first-child { font-weight: 500; color: var(--soft); }
#order-chat-modal .oc-rx-meta > span:last-child { font-weight: 700; direction: rtl; }
#order-chat-modal .oc-rx-qty { font-style: normal; font-weight: 600; color: var(--soft); font-size: 11.5px; direction: ltr; unicode-bidi: isolate; }
#order-chat-modal .oc-rx-thanks { text-align: center; font-size: 11px; color: var(--soft); margin-top: 12px; }
#order-chat-modal .oc-rx-total { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#order-chat-modal .oc-rx-total > span:first-child { font-size: 17px; font-weight: 900; }
#order-chat-modal .oc-rx-total-amt { font-size: 19px; font-weight: 900; line-height: 1; direction: ltr; }
#order-chat-modal .oc-bill-photo-link {
  display: block; margin: 12px auto 0; border: 0; background: none; cursor: pointer; padding: 2px 4px;
  font: inherit; font-size: 11px; font-weight: 700; color: var(--oc-accent-deep); text-decoration: underline; text-underline-offset: 3px;
}
#order-chat-modal .oc-rx-barcode { margin: 12px auto 0; height: 28px; width: 86%; overflow: hidden; display: flex; align-items: stretch; justify-content: center; direction: ltr; }
#order-chat-modal .oc-rx-barcode i { display: block; background: var(--ink); }
#order-chat-modal .oc-rx-code { text-align: center; font-size: 9.5px; letter-spacing: 3px; color: var(--soft); margin-top: 2px; direction: ltr; }

/* ---------- Header ---------- */
#order-chat-modal .order-chat-modal-header-subtle-time { font-variant-numeric: tabular-nums; }
#order-chat-modal .order-chat-modal-header-avatar { background: var(--oc-accent-soft); color: var(--oc-accent-deep); }

@media (prefers-reduced-motion: reduce) {
  #order-chat-modal *, #order-chat-modal *::before, #order-chat-modal *::after { animation: none !important; transition: none !important; }
}

/* ---------- Hide the side scrollbar in the chat (scrolling still works) ---------- */
#order-chat-modal .order-chat-messages, #order-chat-modal .order-chat-scroll-wrap { scrollbar-width: none !important; -ms-overflow-style: none; }
#order-chat-modal .order-chat-messages::-webkit-scrollbar, #order-chat-modal .order-chat-scroll-wrap::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }

/* ---------- Orders pin at the top of the chat: name + status in words, track beside it ---------- */
#order-chat-modal .order-chat-progress-pin__item:has(.oc-pin-info) {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 46%); align-items: center; column-gap: 14px; padding: 9px 0;
}
#order-chat-modal .order-chat-progress-pin__item:has(.oc-pin-info) > .order-chat-progress-pin__order { display: none; }
#order-chat-modal .order-chat-progress-pin__item:has(.oc-pin-info) > .order-progress-bar { grid-column: 2; grid-row: 1; margin: 0; min-width: 0; }
#order-chat-modal .order-chat-progress-pin__item:has(.oc-pin-info) > .order-chat-prep-timer { grid-column: 1 / -1; }
/* captions move into the status line, so the icons no longer carry floating text */
#order-chat-modal .order-chat-progress-pin__item:has(.oc-pin-info) .order-progress-ready-label,
#order-chat-modal .order-chat-progress-pin__item:has(.oc-pin-info) .delegate-accept-time,
#order-chat-modal .order-chat-progress-pin__item:has(.oc-pin-info) .delivered-time { display: none !important; }
#order-chat-modal .oc-pin-info { grid-column: 1; grid-row: 1; min-width: 0; text-align: right; }
#order-chat-modal .oc-pin-name { margin: 0; display: flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 700; color: var(--oc-ink); line-height: 1.5; }
#order-chat-modal .oc-pin-type { flex: 0 0 auto; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; background: var(--oc-accent-soft); color: var(--oc-accent-deep); }
#order-chat-modal .oc-pin-status { margin: 1px 0 0; font-size: 11.5px; color: var(--oc-muted); line-height: 1.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#order-chat-modal .oc-pin-code { flex: 0 0 auto; font-size: 10.5px; font-weight: 500; color: var(--oc-muted); unicode-bidi: isolate; }
#order-chat-modal .oc-pin-name { min-width: 0; white-space: nowrap; }
#order-chat-modal .order-chat-progress-pin__item:not(.oc-pin-current):has(.oc-pin-info) .oc-pin-name { font-weight: 600; }
#order-chat-modal .order-chat-progress-pin__item.oc-pin-current .oc-pin-status { color: var(--oc-accent-deep); font-weight: 600; }

/* ---------- Pickup "I'm at the store" dock: one tidy row, compact directions ---------- */
/* Row: [ أنا عند المتجر ] [ إرشادات الوصول ⌄ ]; directions open above it as thumbnail + text. */
#order-chat-at-store-dock .oc-arrive-store {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "body body" "btn toggle";
  column-gap: 8px; align-items: stretch; padding: 8px; border-radius: 14px;
}
#order-chat-at-store-dock .oc-arrive-store .oc-at-store-btn {
  grid-area: btn; margin: 0 !important; min-height: 44px; padding: 8px 12px; border-radius: 10px; font-size: 14px; font-weight: 700;
}
#order-chat-at-store-dock .oc-arrive-store__toggle {
  grid-area: toggle; display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: auto;
  min-height: 44px; padding: 0 12px; margin: 0; border-radius: 10px; cursor: pointer;
  background: var(--oc-incoming, #f1f5f7); border: 1px solid var(--oc-line, #e3eaed); color: var(--oc-ink, #0f2a33);
}
#order-chat-at-store-dock .oc-arrive-store__name { font-size: 12.5px; font-weight: 700; white-space: nowrap; }
#order-chat-at-store-dock .oc-arrive-store__chevron { flex: 0 0 auto; margin-top: -3px; }
#order-chat-at-store-dock .oc-arrive-store.is-open .oc-arrive-store__toggle { background: var(--oc-accent-soft, #e6f6f8); border-color: transparent; color: var(--oc-accent-deep, #1f97a6); }

#order-chat-at-store-dock .oc-arrive-store__body { grid-area: body; padding: 2px 2px 10px; }
#order-chat-at-store-dock .oc-arrive-store.is-open .oc-arrive-store__body { display: flex; align-items: center; gap: 10px; }
#order-chat-at-store-dock .oc-pickup-arrival__photos { flex: 0 0 auto; gap: 6px; }
#order-chat-at-store-dock .oc-pickup-arrival__zoom { flex: 0 0 auto; width: 56px; height: 56px; padding: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--oc-line, #e3eaed); }
#order-chat-at-store-dock .oc-pickup-arrival__zoom img { width: 100%; height: 100%; object-fit: cover; display: block; }
#order-chat-at-store-dock .oc-pickup-arrival__text,
#order-chat-at-store-dock .oc-pickup-arrival__wait { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 13px; line-height: 1.6; color: var(--oc-ink, #0f2a33); }
#order-chat-at-store-dock .oc-pickup-arrival__maps { margin: 0; }
/* pickup: order number, large, at the end of the card + one line saying what it is for */
#order-chat-at-store-dock .oc-arrive-store.is-open .oc-arrive-store__body { flex-wrap: wrap; row-gap: 8px; }
#order-chat-at-store-dock .oc-pickup-arrival__text { flex: 1 1 0; }
#order-chat-at-store-dock .oc-arrive-num {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 86px; height: 56px; padding: 0 12px;
  border-radius: 10px; background: var(--oc-accent-soft, #e6f6f8); color: var(--oc-accent-deep, #1f97a6);
  position: relative; border: 0; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .12s;
}
#order-chat-at-store-dock .oc-arrive-num:active { transform: scale(.95); }
#order-chat-at-store-dock .oc-arrive-num svg { position: absolute; top: 5px; inset-inline-end: 6px; width: 11px; height: 11px; opacity: .7; }
#order-chat-at-store-dock .oc-arrive-num small { font-size: 10.5px; font-weight: 600; line-height: 1.3; opacity: .85; }
#order-chat-at-store-dock .oc-arrive-num b { font-size: 21px; font-weight: 800; line-height: 1.15; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
#order-chat-at-store-dock .oc-arrive-hint { flex: 0 0 100%; margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--oc-muted, #6b7f86); }
html.dark-mode #order-chat-at-store-dock .oc-arrive-num, body.dark-mode #order-chat-at-store-dock .oc-arrive-num { background: rgba(47, 179, 194, .16); color: #6fd3de; }
html.dark-mode #order-chat-at-store-dock .oc-arrive-hint, body.dark-mode #order-chat-at-store-dock .oc-arrive-hint { color: #a3b1b6; }

/* Orders pin toggle: always show its title (the single-order case left an empty row with only the arrow) */
#order-chat-modal .order-chat-progress-pin:not(.is-collapsed) .order-chat-progress-pin__toggle-label { display: block; }
#order-chat-modal .order-chat-progress-pin__toggle { padding: 4px 2px; margin: 0; min-height: 30px; }
#order-chat-modal .order-chat-progress-pin__toggle-label { font-size: 12px; font-weight: 700; color: var(--oc-muted); }
#order-chat-modal .order-chat-progress-pin.is-collapsed .order-chat-progress-pin__toggle-label { color: var(--oc-ink); }
#order-chat-modal .order-chat-progress-pin__item:has(.oc-pin-info):first-child { padding-top: 4px; }

/* Orders pin: show only the icon of the current stage instead of the whole track */
#order-chat-modal .order-chat-progress-pin__item:has(.oc-pin-info) { grid-template-columns: minmax(0, 1fr) auto; }
#order-chat-modal .order-chat-progress-pin__item:has(.oc-pin-info) .order-progress-track { justify-content: flex-end; width: auto; }
#order-chat-modal .order-chat-progress-pin__item:has(.oc-pin-info) .order-progress-segment,
#order-chat-modal .order-chat-progress-pin__item:has(.oc-pin-info) .order-progress-node:not(.oc-pin-now) { display: none !important; }
#order-chat-modal .order-chat-progress-pin__item:has(.oc-pin-info) .order-progress-node-wrap { display: contents; }
#order-chat-modal .order-chat-progress-pin__item:has(.oc-pin-info) .order-progress-node.oc-pin-now { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; }
#order-chat-modal .order-chat-progress-pin__item:has(.oc-pin-info) .order-progress-node.oc-pin-now svg { width: 21px; height: 21px; }
#order-chat-modal .order-chat-progress-pin__item:has(.oc-pin-info) .order-progress-cancel-reason { display: none; }

/* Orders pin: a chat lists only its own order */
#order-chat-modal .order-chat-progress-pin__item.oc-pin-other { display: none !important; }

/* ---------- Message with a total (store / delegate bill): text, then label + amount on one line, then time ---------- */
#order-chat-modal .order-chat-bubble-row:has(.order-chat-bubble-total) { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
#order-chat-modal .order-chat-bubble-row:has(.order-chat-bubble-total) .order-chat-bubble-text { display: block; width: 100%; }
#order-chat-modal .order-chat-bubble-row:has(.order-chat-bubble-total) .order-chat-bubble-text-main { display: block; font-size: 13.5px; line-height: 1.65; }
#order-chat-modal .order-chat-bubble-total {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--oc-line);
}
#order-chat-modal .order-chat-bubble-total-label { font-size: 12.5px; font-weight: 600; color: var(--oc-muted); line-height: 1.4; }
#order-chat-modal .order-chat-bubble-total-amt { flex: 0 0 auto; font-size: 16px; font-weight: 800; line-height: 1; direction: ltr; }
#order-chat-modal .order-chat-bubble-row:has(.order-chat-bubble-total) .order-chat-bubble-time { align-self: flex-end; margin: 6px 0 0; font-size: 10.5px; }
#order-chat-modal .oc-bill-bubble > .order-chat-bubble-row { padding: 16px 14px 8px; }
#order-chat-modal .order-chat-bubble-row:has(.order-chat-bubble-total) { width: 100%; max-width: none; box-sizing: border-box; }
#order-chat-modal .order-chat-bubble:has(> .order-chat-bubble-media--image-thumb):has(.order-chat-bubble-total) { width: 254px; box-sizing: border-box; }

/* ---------- Photo messages (image only, no caption): thin even frame, corners that follow the bubble, time on the photo ---------- */
#order-chat-modal .order-chat-bubble:has(> .order-chat-bubble-media--image-thumb):not(:has(.order-chat-bubble-text)) {
  position: relative; padding: 3px; width: auto;
}
#order-chat-modal .order-chat-bubble:has(> .order-chat-bubble-media--image-thumb):not(:has(.order-chat-bubble-text)) > .order-chat-bubble-media--image-thumb {
  margin: 0; border: 0; background: transparent; max-height: 320px;
  border-radius: 15px 15px 15px 3px; /* incoming: tail at bottom-left */
}
#order-chat-modal .order-chat-bubble-customer .order-chat-bubble:has(> .order-chat-bubble-media--image-thumb):not(:has(.order-chat-bubble-text)) > .order-chat-bubble-media--image-thumb {
  border-radius: 15px 15px 3px 15px; /* outgoing: tail at bottom-right */
}
#order-chat-modal .order-chat-bubble:has(> .order-chat-bubble-media--image-thumb):not(:has(.order-chat-bubble-text)) > .order-chat-bubble-media--image-thumb img {
  width: 100% !important; height: auto !important; max-height: 320px; object-fit: cover !important; border-radius: inherit;
}
#order-chat-modal .order-chat-bubble:has(> .order-chat-bubble-media--image-thumb):not(:has(.order-chat-bubble-text)) > .order-chat-bubble-row {
  position: absolute; bottom: 9px; left: 10px; margin: 0; padding: 2px 8px; width: auto; max-width: none;
  border-radius: 999px; background: rgba(8, 22, 27, .5); backdrop-filter: blur(4px); pointer-events: none;
}
#order-chat-modal .order-chat-bubble:has(> .order-chat-bubble-media--image-thumb):not(:has(.order-chat-bubble-text)) .order-chat-bubble-time {
  color: #fff !important; opacity: 1; font-size: 10.5px; margin: 0;
}

/* ---------- Tail at the corner each bubble comes out of (square corner + concave hook, as in the reference) ---------- */
#order-chat-modal .order-chat-bubble { position: relative; isolation: isolate; border-radius: 18px 18px 18px 0; }
#order-chat-modal .order-chat-bubble-customer .order-chat-bubble { border-radius: 18px 18px 0 18px; }
#order-chat-modal .order-chat-bubble::after {
  content: ''; position: absolute; z-index: -1; bottom: 0; left: -10px; width: 11px; height: 17px; pointer-events: none;
  background: #e3eaee;
  /* box: bubble edge at x=0. Straight down the edge, along the bottom to the tip, concave curve back up. */
  clip-path: path("M0 0 L0 17 L11 17 C5.5 15.5 1.5 10 0 0 Z");
  transform: scaleX(-1); /* incoming: tip points left */
}
#order-chat-modal .order-chat-bubble-customer .order-chat-bubble::after {
  left: auto; right: -10px; transform: none; background: var(--oc-accent-deep); /* outgoing: tip points right */
}
html.dark-mode #order-chat-modal .order-chat-bubble-delegate .order-chat-bubble::after,
html.dark-mode #order-chat-modal .order-chat-bubble-store .order-chat-bubble::after { background: var(--oc-incoming); }
#order-chat-modal .order-chat-bubble.oc-bill-bubble::after { display: none; }
#order-chat-modal .order-chat-bubble.oc-bill-bubble { border-radius: 0; }
#order-chat-modal .order-chat-messages { padding-inline: 18px; }
/* photo corners follow the square tail corner */
#order-chat-modal .order-chat-bubble:has(> .order-chat-bubble-media--image-thumb):not(:has(.order-chat-bubble-text)) > .order-chat-bubble-media--image-thumb { border-radius: 15px 15px 15px 0; }
#order-chat-modal .order-chat-bubble-customer .order-chat-bubble:has(> .order-chat-bubble-media--image-thumb):not(:has(.order-chat-bubble-text)) > .order-chat-bubble-media--image-thumb { border-radius: 15px 15px 0 15px; }

/* ---------- Photo album: consecutive photos from one sender share a bubble ---------- */
#order-chat-modal .order-chat-row.oc-album-moved { display: none !important; }
#order-chat-modal .order-chat-bubble.oc-album { padding: 3px; width: 250px; }
#order-chat-modal .oc-album-grid {
  display: grid; gap: 3px; grid-template-columns: 1fr 1fr; overflow: hidden;
  border-radius: 15px 15px 15px 0;
}
#order-chat-modal .order-chat-bubble-customer .oc-album-grid { border-radius: 15px 15px 0 15px; }
#order-chat-modal .oc-album-grid[data-count="3"] { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
#order-chat-modal .oc-album-grid[data-count="3"] > :first-child { grid-row: 1 / span 2; aspect-ratio: auto; }
#order-chat-modal .oc-album-grid[data-many="1"] { grid-template-columns: 1fr 1fr 1fr; }
#order-chat-modal .oc-album-grid > .order-chat-bubble-media--image-thumb {
  width: 100% !important; height: auto !important; min-width: 0 !important; min-height: 0 !important; max-height: none; aspect-ratio: 1 / 1;
  margin: 0; border: 0; border-radius: 0; background: rgba(148, 163, 184, .18);
}
#order-chat-modal .oc-album-grid[data-count="2"] > .order-chat-bubble-media--image-thumb { aspect-ratio: 3 / 4; }
#order-chat-modal .oc-album-grid > .order-chat-bubble-media--image-thumb img { width: 100% !important; height: 100% !important; max-height: none; object-fit: cover !important; display: block; }
#order-chat-modal .order-chat-bubble.oc-album > .order-chat-bubble-row {
  position: absolute; bottom: 9px; left: 10px; margin: 0; padding: 2px 8px; width: auto; max-width: none;
  border-radius: 999px; background: rgba(8, 22, 27, .5); backdrop-filter: blur(4px); pointer-events: none;
}
#order-chat-modal .order-chat-bubble.oc-album .order-chat-bubble-time { color: #fff !important; opacity: 1; font-size: 10.5px; margin: 0; }
/* album cells: no own rounding (the grid clips the outer corners); the 3-photo layout fills its rows */
#order-chat-modal .oc-album-grid > .order-chat-bubble-media--image-thumb,
#order-chat-modal .oc-album-grid > .order-chat-bubble-media--image-thumb img { border-radius: 0 !important; }
#order-chat-modal .oc-album-grid[data-count="3"] { height: 280px; }
#order-chat-modal .oc-album-grid[data-count="3"] > .order-chat-bubble-media--image-thumb { aspect-ratio: auto; height: 100% !important; }

/* ---------- Attachment tray: photos waiting to be sent ---------- */
#order-chat-modal .oc-attach-tray { display: flex; align-items: center; gap: 8px; padding: 10px 2px 6px; overflow-x: auto; scrollbar-width: none; }
#order-chat-modal .oc-attach-tray[hidden] { display: none; }
#order-chat-modal .oc-attach-tray::-webkit-scrollbar { display: none; }
#order-chat-modal .oc-attach-item { position: relative; flex: 0 0 auto; width: 58px; height: 58px; }
#order-chat-modal .oc-attach-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; display: block; box-shadow: 0 0 0 1px rgba(15, 42, 51, .08); }
#order-chat-modal .oc-attach-item button {
  position: absolute; top: -5px; left: -5px; width: 20px; height: 20px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center; background: rgba(15, 30, 38, .82); color: #fff; cursor: pointer;
  box-shadow: 0 0 0 2px var(--oc-surface, #fff); transition: background .15s, transform .15s var(--oc-ease);
}
#order-chat-modal .oc-attach-item button svg { width: 10px; height: 10px; }
#order-chat-modal .oc-attach-item button:hover { background: #c8372d; }
#order-chat-modal .oc-attach-item button:active { transform: scale(.88); }
/* add-more tile: same footprint as a photo, soft fill, icon + label */
#order-chat-modal .oc-attach-more {
  flex: 0 0 auto; width: 58px; height: 58px; border-radius: 12px; border: 0; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: var(--oc-accent-soft); color: var(--oc-accent-deep);
  transition: background .15s, transform .15s var(--oc-ease);
}
#order-chat-modal .oc-attach-more svg { width: 22px; height: 22px; }
#order-chat-modal .oc-attach-more span { font-size: 10px; font-weight: 700; line-height: 1; }
#order-chat-modal .oc-attach-more:hover { background: #d6eff3; }
#order-chat-modal .oc-attach-more:active { transform: scale(.94); }
#order-chat-modal .oc-attach-count {
  flex: 0 0 auto; margin-inline-start: auto; padding: 4px 9px; border-radius: 999px; background: var(--oc-incoming);
  font-size: 11px; font-weight: 700; color: var(--oc-muted); white-space: nowrap;
}
#order-chat-modal .oc-attach-tray.is-sending { opacity: .55; pointer-events: none; }
/* the engine's single-photo preview is replaced by the tray */
#order-chat-modal #order-chat-compose .order-chat-compose-attach-preview { display: none !important; }

/* ---------- Photo viewer: previous / next and counter ---------- */
#order-chat-image-lightbox .oc-gallery-nav[hidden] { display: none; }
#order-chat-image-lightbox .oc-gallery-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center; cursor: pointer; background: rgba(255, 255, 255, .16); color: #fff; backdrop-filter: blur(6px);
  transition: background .15s, opacity .15s;
}
#order-chat-image-lightbox .oc-gallery-btn svg { width: 22px; height: 22px; }
#order-chat-image-lightbox .oc-gallery-btn:hover { background: rgba(255, 255, 255, .3); }
#order-chat-image-lightbox .oc-gallery-btn:disabled { opacity: 0; pointer-events: none; }
#order-chat-image-lightbox .oc-gallery-prev { right: 12px; }
#order-chat-image-lightbox .oc-gallery-next { left: 12px; }
#order-chat-image-lightbox .oc-gallery-count {
  position: absolute; z-index: 5; bottom: max(18px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  padding: 5px 12px; border-radius: 999px; background: rgba(0, 0, 0, .5); color: #fff; font-size: 13px; font-weight: 700;
  direction: ltr; font-variant-numeric: tabular-nums;
}
#order-chat-image-lightbox-img.oc-gallery-in-next { animation: oc-gal-next .22s cubic-bezier(.22, .8, .24, 1); }
#order-chat-image-lightbox-img.oc-gallery-in-prev { animation: oc-gal-prev .22s cubic-bezier(.22, .8, .24, 1); }
@keyframes oc-gal-next { from { opacity: .2; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
@keyframes oc-gal-prev { from { opacity: .2; transform: translateX(40px); } to { opacity: 1; transform: none; } }

/* Photo viewer close button: same family as the arrows (round, translucent, crisp icon) */
#order-chat-image-lightbox .order-chat-image-lightbox-close {
  top: max(14px, env(safe-area-inset-top)); width: 40px; height: 40px; border-radius: 50%; border: 0; padding: 0;
  font-size: 0; line-height: 0; cursor: pointer; backdrop-filter: blur(6px);
  background: rgba(255, 255, 255, .16) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6.5 6.5l11 11M17.5 6.5l-11 11'/%3E%3C/svg%3E") center / 20px 20px no-repeat;
  transition: background-color .15s, transform .15s;
}
#order-chat-image-lightbox .order-chat-image-lightbox-close:hover { background-color: rgba(255, 255, 255, .3); }
#order-chat-image-lightbox .order-chat-image-lightbox-close:active { transform: scale(.9); }

/* The hidden file input was taking a 22px empty strip above the composer, so messages were cut off early. */
#order-chat-modal #order-chat-file-any {
  position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: 0 !important;
  border: 0 !important; opacity: 0 !important; overflow: hidden; pointer-events: none; clip-path: inset(50%);
}

/* Photo with a caption (e.g. the delegate's bill): same thin frame as plain photos; the text keeps its own padding.
   The bubble has a fixed, modest width (it used to grow as wide as its caption, which made a bill photo fill the
   screen) and the photo fills its frame: no white bars beside a tall photo. A tap still opens the whole photo. */
#order-chat-modal .order-chat-bubble:has(> .order-chat-bubble-media--image-thumb):has(.order-chat-bubble-text) { padding: 3px; width: 226px; box-sizing: border-box; }
#order-chat-modal .order-chat-bubble:has(> .order-chat-bubble-media--image-thumb):has(.order-chat-bubble-text) > .order-chat-bubble-media--image-thumb {
  width: 100% !important; margin: 0; border: 0; border-radius: 15px 15px 6px 6px; max-height: 300px; background: transparent;
}
#order-chat-modal .order-chat-bubble:has(> .order-chat-bubble-media--image-thumb):has(.order-chat-bubble-text) > .order-chat-bubble-media--image-thumb img { max-height: 300px; object-fit: cover !important; }
#order-chat-modal .order-chat-bubble:has(> .order-chat-bubble-media--image-thumb):has(.order-chat-bubble-text) > .order-chat-bubble-row { padding: 9px 10px 5px; }

/* ---------- Order options popover (cancel): tidy layout + a pointer up to the ⋮ button ---------- */
#order-chat-modal #order-chat-menu-popover {
  top: calc(100% + 10px); overflow: visible; width: 264px; border-radius: 16px; border: 1px solid var(--oc-line);
  background: var(--oc-surface); box-shadow: 0 16px 36px -12px rgba(15, 42, 51, .28), 0 2px 6px rgba(15, 42, 51, .06);
}
#order-chat-modal #order-chat-menu-popover[hidden] { display: none; }
#order-chat-modal #order-chat-menu-popover::before {
  content: ''; position: absolute; top: -7px; left: 11px; width: 13px; height: 13px; transform: rotate(45deg);
  background: var(--oc-surface); border-top: 1px solid var(--oc-line); border-left: 1px solid var(--oc-line); border-top-left-radius: 3px;
}
#order-chat-modal .order-chat-cancel-panel { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
#order-chat-modal .order-chat-cancel-panel > [hidden] { display: none !important; }
#order-chat-modal .order-chat-cancel-panel__title { margin: 0; font-size: 14.5px; font-weight: 800; color: var(--oc-ink); line-height: 1.4; }
#order-chat-modal .order-chat-cancel-panel__meta { margin: -4px 0 0; font-size: 12.5px; line-height: 1.65; color: var(--oc-muted); }
#order-chat-modal .order-chat-cancel-panel__meta:empty { display: none; }
#order-chat-modal .order-chat-cancel-panel__countdown {
  margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; padding: 0 12px;
  border-radius: 12px; background: #fff6ea; color: #8a4b12; font-size: 12.5px; font-weight: 700;
}
#order-chat-modal .order-chat-cancel-panel__countdown-val { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
#order-chat-modal #order-chat-cancel-order-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 44px; margin: 0; padding: 0 12px;
  border: 0; border-radius: 12px; cursor: pointer; background: #fdecea; color: #b3261e; font-size: 13.5px; font-weight: 700;
  transition: background .15s, transform .15s var(--oc-ease);
}
#order-chat-modal #order-chat-cancel-order-btn:hover { background: #fbdcd8; }
#order-chat-modal #order-chat-cancel-order-btn:active { transform: scale(.98); }
#order-chat-modal #order-chat-cancel-order-btn:disabled { opacity: .5; cursor: default; }
#order-chat-modal .order-chat-cancel-order-btn__icon { display: grid; place-items: center; }
#order-chat-modal .order-chat-cancel-order-btn__icon svg { width: 19px; height: 19px; display: block; }
#order-chat-modal .order-chat-cancel-ask-delegate {
  width: 100%; min-height: 42px; margin: 0; padding: 0 12px; border-radius: 12px; border: 1px solid var(--oc-line);
  background: var(--oc-surface); color: var(--oc-accent-deep); font-size: 13px; font-weight: 700; cursor: pointer;
}

/* ---------- Pickup receipt: smaller, tighter type ---------- */
#order-chat-modal .oc-bill { padding: calc(var(--zz) + 12px) 14px calc(var(--zz) + 12px); }
#order-chat-modal .oc-bill-wrap .oc-bill { padding-bottom: calc(var(--zz) + 20px); }
#order-chat-modal .oc-bill .oc-rx-brand { font-size: 14.5px; line-height: 1.35; }
#order-chat-modal .oc-bill .oc-rx-sub { font-size: 10.5px; margin-top: 1px; }
#order-chat-modal .oc-bill .oc-rx-rule {
  margin: 9px 0; height: 0; border: 0 !important; border-top: 1px dashed var(--rule) !important; background: none !important; opacity: 1 !important;
}
#order-chat-modal .oc-bill .oc-rx-rows { gap: 7px; }
#order-chat-modal .oc-bill .oc-rx-rows--tight { gap: 3px; }
#order-chat-modal .oc-bill .oc-rx-row { font-size: 11.5px; line-height: 1.5; align-items: flex-start; }
#order-chat-modal .oc-bill .oc-rx-row > span:first-child { font-weight: 600; }
#order-chat-modal .oc-bill .oc-rx-row > span:last-child { font-weight: 700; font-size: 11.5px; }
#order-chat-modal .oc-bill .oc-rx-row small { font-size: 10px; line-height: 1.5; margin-top: 0; }
#order-chat-modal .oc-bill .oc-rx-meta { font-size: 10.5px; }
#order-chat-modal .oc-bill .oc-rx-meta > span:first-child { font-weight: 400; }
#order-chat-modal .oc-bill .oc-rx-meta > span:last-child { font-weight: 600; font-size: 10.5px; }
#order-chat-modal .oc-bill .oc-rx-qty { font-size: 10px; font-weight: 500; }
#order-chat-modal .oc-bill .oc-rx-total > span:first-child { font-size: 13px; font-weight: 800; }
#order-chat-modal .oc-bill .oc-rx-total-amt { font-size: 14.5px; }
#order-chat-modal .oc-bill .oc-rx-thanks { font-size: 10px; margin-top: 9px; }
#order-chat-modal .oc-bill .oc-bill-photo-link { font-size: 10.5px; margin-top: 8px; }
#order-chat-modal .oc-bill .sar-symbol { font-size: .85em; }

/* Message with a total: smaller type, tighter box */
#order-chat-modal .order-chat-bubble-row:has(.order-chat-bubble-total) .order-chat-bubble-text-main { font-size: 12px; line-height: 1.6; }
#order-chat-modal .order-chat-bubble-total { margin-top: 7px; padding-top: 7px; }
#order-chat-modal .order-chat-bubble-total-label { font-size: 11.5px; }
#order-chat-modal .order-chat-bubble-total-amt { font-size: 14px; }
#order-chat-modal .order-chat-bubble-row:has(.order-chat-bubble-total) .order-chat-bubble-time { margin-top: 4px; font-size: 10px; }
#order-chat-modal .oc-bill-bubble > .order-chat-bubble-row { padding: 14px 12px 7px; }

/* ---------- Chat header buttons (⋮ and close): one matched pair ---------- */
#order-chat-modal .order-chat-modal-header-actions { display: flex; align-items: center; gap: 6px; }
#order-chat-modal .order-chat-modal-header-actions .order-chat-menu-wrap { display: flex; }
#order-chat-modal .order-chat-modal-close,
#order-chat-modal .order-chat-modal-header-actions .order-chat-menu-btn {
  width: 36px; height: 36px; margin: 0; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; background: var(--oc-incoming); color: var(--oc-ink);
  transition: background .15s, color .15s, transform .15s var(--oc-ease);
}
#order-chat-modal .order-chat-modal-header-actions [hidden] { display: none !important; }
#order-chat-modal .order-chat-modal-close svg,
#order-chat-modal .order-chat-modal-header-actions .order-chat-menu-btn svg { width: 18px; height: 18px; display: block; }
#order-chat-modal .order-chat-modal-close svg { stroke-width: 2.2; stroke-linecap: round; }
#order-chat-modal .order-chat-modal-close:hover,
#order-chat-modal .order-chat-modal-header-actions .order-chat-menu-btn:hover { background: var(--oc-accent-soft); color: var(--oc-accent-deep); }
#order-chat-modal .order-chat-modal-close:active,
#order-chat-modal .order-chat-modal-header-actions .order-chat-menu-btn:active { transform: scale(.9); }
#order-chat-modal .order-chat-modal-header-actions .order-chat-menu-btn[aria-expanded="true"] { background: var(--oc-accent-soft); color: var(--oc-accent-deep); }
/* header buttons: same rounded-square corners as the send button (not circles) */
#order-chat-modal .order-chat-modal-close,
#order-chat-modal .order-chat-modal-header-actions .order-chat-menu-btn { border-radius: 12px; }

/* Cancel popover in dark mode: tinted dark fills instead of the light-mode pastels */
html.dark-mode #order-chat-modal #order-chat-menu-popover { box-shadow: 0 16px 36px -12px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .3); }
html.dark-mode #order-chat-modal .order-chat-cancel-panel__countdown { background: rgba(245, 158, 11, .14); color: #f3c27a; }
html.dark-mode #order-chat-modal #order-chat-cancel-order-btn { background: rgba(239, 68, 68, .16); color: #ff9d95; }
html.dark-mode #order-chat-modal #order-chat-cancel-order-btn:hover { background: rgba(239, 68, 68, .26); }
html.dark-mode #order-chat-modal .order-chat-cancel-ask-delegate { background: var(--oc-incoming); color: #7fd6e0; border-color: var(--oc-line); }

/* delivery marks on your own messages: ✓ sent · ✓✓ delivered · ✓✓ blue = read */
#order-chat-modal .oc-voice-read, #order-chat-modal .oc-img-read { display: none !important; } /* replaced by .oc-tick */
#order-chat-modal .order-chat-bubble-time:has(.oc-tick), #order-chat-modal .order-chat-voice-sent-at:has(.oc-tick) { display: inline-flex; align-items: center; gap: 3px; }
#order-chat-modal .oc-tick { display: inline-flex; flex: 0 0 auto; color: currentColor; opacity: .8; transition: color .25s; }
#order-chat-modal .oc-tick svg { width: 13px; height: 9px; display: block; }
#order-chat-modal .oc-tick[data-state="read"] svg { stroke-width: 2.1; }
#order-chat-modal .oc-tick[data-state="read"] { color: #30b6c5; opacity: 1; } /* Haatly's own sky teal (same as the "order confirmed" text) */
/* inside the teal text bubble the same sky tone is used in its lightest shade (teal on teal would vanish); unread marks stay dimmer */
/* your own text messages: the time sits on the side the bubble's tail comes out of (right) */
#order-chat-modal .order-chat-bubble-customer .order-chat-bubble-row > .order-chat-bubble-time { align-self: flex-start; }

/* inside the teal text bubble the same sky tone is used in its lightest shade (teal on teal would vanish); unread marks stay dimmer */
#order-chat-modal .order-chat-bubble-customer .order-chat-bubble:not(.order-chat-bubble--voice-msg):not(:has(> .order-chat-bubble-media--image-thumb)) .oc-tick[data-state="read"] { color: #b4f6ff; }
#order-chat-modal .order-chat-bubble-customer .order-chat-bubble:not(.order-chat-bubble--voice-msg):not(:has(> .order-chat-bubble-media--image-thumb)) .oc-tick:not([data-state="read"]) { opacity: .55; }

/* ---------- Delegate details popover: tidy two-row card ---------- */
/* row 1: avatar · name / role ........ rating     row 2 (after a hairline): "vehicle plate" label ........ plate */
#order-chat-modal #order-chat-delegate-profile-popover {
  padding: 14px 14px 14px; border-radius: 16px; border: 1px solid var(--oc-line, #e3eaed); background: #fff;
  box-shadow: 0 10px 30px rgba(15, 42, 51, .12);
}
#order-chat-delegate-profile-popover .order-chat-dp-inner {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who rating" "plate plate"; align-items: center; column-gap: 10px; row-gap: 0;
}
#order-chat-delegate-profile-popover .order-chat-dp-head { display: contents; }
#order-chat-delegate-profile-popover .order-chat-dp-head-text {
  grid-area: who; display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 10px; row-gap: 1px; align-items: center; text-align: start; min-width: 0;
}
#order-chat-delegate-profile-popover .order-chat-dp-head-text::before {
  content: ''; grid-row: 1 / span 2; width: 40px; height: 40px; border-radius: 50%; background-color: var(--oc-accent-soft, #e6f6f8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f97a6' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 20px 20px;
}
#order-chat-delegate-profile-popover .order-chat-dp-title { grid-column: 2; align-self: end; margin: 0; font-size: 15px; font-weight: 700; line-height: 1.4; color: var(--oc-ink, #0f2a33); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#order-chat-delegate-profile-popover .order-chat-dp-role { grid-column: 2; align-self: start; margin: 0; font-size: 11.5px; line-height: 1.4; color: var(--oc-muted, #6b7f86); }
/* rating: one star, the score, and the count under it */
#order-chat-delegate-profile-popover .order-chat-dp-rating {
  grid-area: rating; margin: 0; display: grid; grid-template-columns: auto auto; justify-content: end; align-items: center; column-gap: 4px; row-gap: 1px; direction: ltr;
}
#order-chat-delegate-profile-popover .order-chat-dp-stars { display: inline-flex; }
#order-chat-delegate-profile-popover .order-chat-dp-star:nth-child(n+2) { display: none; }
#order-chat-delegate-profile-popover .order-chat-dp-star svg { width: 15px; height: 15px; display: block; }
#order-chat-delegate-profile-popover .order-chat-dp-rating-num { font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--oc-ink, #0f2a33); font-variant-numeric: tabular-nums; }
#order-chat-delegate-profile-popover .order-chat-dp-rating-count { grid-column: 1 / -1; justify-self: end; font-size: 10.5px; line-height: 1.3; color: var(--oc-muted, #6b7f86); direction: rtl; }
/* vehicle plate row */
#order-chat-delegate-profile-popover .order-chat-dp-plate {
  grid-area: plate; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--oc-line, #e9eef0);
}
#order-chat-delegate-profile-popover .order-chat-dp-plate::before { content: 'لوحة المركبة'; font-size: 12px; font-weight: 600; color: var(--oc-muted, #6b7f86); white-space: nowrap; }
html[lang^="en"] #order-chat-delegate-profile-popover .order-chat-dp-plate::before { content: 'Vehicle plate'; }
#order-chat-delegate-profile-popover .order-chat-dp-plate { direction: rtl; }
html[lang^="en"] #order-chat-delegate-profile-popover .order-chat-dp-plate { direction: ltr; }
#order-chat-delegate-profile-popover .order-chat-dp-plate-strip { flex: 0 0 auto; width: 150px; max-width: 60%; direction: ltr; }
/* dark mode */
html.dark-mode #order-chat-modal #order-chat-delegate-profile-popover, body.dark-mode #order-chat-modal #order-chat-delegate-profile-popover { background: #2b2c34; border-color: #3a3c46; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); }
html.dark-mode #order-chat-delegate-profile-popover .order-chat-dp-title, html.dark-mode #order-chat-delegate-profile-popover .order-chat-dp-rating-num { color: #f1f4f5; }
html.dark-mode #order-chat-delegate-profile-popover .order-chat-dp-role, html.dark-mode #order-chat-delegate-profile-popover .order-chat-dp-rating-count, html.dark-mode #order-chat-delegate-profile-popover .order-chat-dp-plate::before { color: #a3b1b6; }
html.dark-mode #order-chat-delegate-profile-popover .order-chat-dp-plate { border-top-color: #3a3c46; }
html.dark-mode #order-chat-delegate-profile-popover .order-chat-dp-head-text::before { background-color: rgba(47, 179, 194, .16); }

/* delegate popover · bank account + transfer QR (third block, full width) */
#order-chat-delegate-profile-popover .order-chat-dp-bank {
  grid-column: 1 / -1; margin: 12px 0 0; padding: 12px 0 0; border: 0; border-top: 1px solid var(--oc-line, #e9eef0); background: none; border-radius: 0;
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
}
#order-chat-delegate-profile-popover .order-chat-dp-bank-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; }
#order-chat-delegate-profile-popover .order-chat-dp-bank-label { margin: 0; font-size: 12px; font-weight: 600; color: var(--oc-muted, #6b7f86); }
#order-chat-delegate-profile-popover .order-chat-dp-bank-name { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--oc-ink, #0f2a33); }
#order-chat-delegate-profile-popover .order-chat-dp-bank-strip {
  display: flex; align-items: center; gap: 6px; margin: 0; padding: 0 4px 0 12px; height: 42px; border: 0; border-radius: 10px; background: #f3f6f7; direction: ltr;
}
#order-chat-delegate-profile-popover .order-chat-dp-bank-num {
  flex: 1 1 auto; min-width: 0; padding: 0; border: 0; background: none; font-size: 13px; font-weight: 600; letter-spacing: .3px; color: var(--oc-ink, #0f2a33);
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left;
}
#order-chat-delegate-profile-popover .order-chat-dp-copy-btn {
  flex: 0 0 auto; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--oc-accent-deep, #1f97a6); display: grid; place-items: center; cursor: pointer;
}
#order-chat-delegate-profile-popover .order-chat-dp-copy-btn:active { background: rgba(31, 151, 166, .12); }
/* QR: small picture (tap to enlarge) beside its label and the save button */
#order-chat-delegate-profile-popover .order-chat-dp-bank-qr {
  display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-areas: "img label" "img save"; column-gap: 12px; row-gap: 6px; align-items: center; margin: 2px 0 0; padding: 0; border: 0; background: none;
}
#order-chat-delegate-profile-popover .order-chat-dp-bank-qr-row { display: contents; }
#order-chat-delegate-profile-popover .order-chat-dp-bank-qr img {
  grid-area: img; width: 96px; height: 96px; padding: 0; border-radius: 12px; border: 1px solid var(--oc-line, #e3eaed); background: #1c1c1e; object-fit: cover; object-position: center top; /* the bank's IBAN card: the thumb shows its QR, a tap opens the whole card */ cursor: zoom-in; box-sizing: border-box; display: block; margin: 0;
}
#order-chat-delegate-profile-popover .order-chat-dp-bank-qr-label { grid-area: label; align-self: end; margin: 0; font-size: 12px; font-weight: 600; color: var(--oc-muted, #6b7f86); text-align: start; }
#order-chat-delegate-profile-popover .order-chat-dp-save-btn {
  grid-area: save; align-self: start; justify-self: start; display: inline-flex; flex-direction: row; align-items: center; gap: 6px; width: auto; height: 32px; padding: 0 12px; margin: 0;
  border: 0; border-radius: 9px; background: var(--oc-accent-soft, #e6f6f8); color: var(--oc-accent-deep, #1f97a6); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer;
}
#order-chat-delegate-profile-popover .order-chat-dp-save-btn svg { width: 15px; height: 15px; }
html.dark-mode #order-chat-delegate-profile-popover .order-chat-dp-bank { border-top-color: #3a3c46; }
html.dark-mode #order-chat-delegate-profile-popover .order-chat-dp-bank-strip { background: #34353e; }
html.dark-mode #order-chat-delegate-profile-popover .order-chat-dp-bank-num, html.dark-mode #order-chat-delegate-profile-popover .order-chat-dp-bank-name { color: #f1f4f5; }
html.dark-mode #order-chat-delegate-profile-popover .order-chat-dp-bank-label, html.dark-mode #order-chat-delegate-profile-popover .order-chat-dp-bank-qr-label { color: #a3b1b6; }
html.dark-mode #order-chat-delegate-profile-popover .order-chat-dp-save-btn { background: rgba(47, 179, 194, .16); color: #6fd3de; }
html.dark-mode #order-chat-delegate-profile-popover .order-chat-dp-bank-qr img { border-color: #3a3c46; }

/* delegate popover comes out the same way as the ⋮ options card: same surface, border, shadow and a pointer up to the avatar it opens from */
#order-chat-modal #order-chat-delegate-profile-popover {
  overflow: visible; margin-top: 10px; border: 1px solid var(--oc-line); background: var(--oc-surface);
  box-shadow: 0 16px 36px -12px rgba(15, 42, 51, .28), 0 2px 6px rgba(15, 42, 51, .06);
}
#order-chat-modal #order-chat-delegate-profile-popover::before {
  content: ''; position: absolute; top: -7px; right: 13px; width: 13px; height: 13px; transform: rotate(45deg);
  background: var(--oc-surface); border-top: 1px solid var(--oc-line); border-left: 1px solid var(--oc-line); border-top-left-radius: 3px;
}
html.dark-mode #order-chat-modal #order-chat-delegate-profile-popover, body.dark-mode #order-chat-modal #order-chat-delegate-profile-popover { background: var(--oc-surface); border-color: var(--oc-line); box-shadow: 0 16px 36px -12px rgba(0, 0, 0, .6), 0 2px 6px rgba(0, 0, 0, .3); }

/* voice bubble on a real connection: the wave may never push past its column, whatever its length */
#order-chat-modal .order-chat-voice-player-track { min-width: 0; }
#order-chat-modal .order-chat-voice-main { min-width: 0; max-width: 100%; overflow: hidden; }
#order-chat-modal .order-chat-voice-wave-block { max-width: 100%; }
#order-chat-modal .oc-voice-side { margin-inline-start: 2px; }
/* not-yet-played mark: a small dot at the corner of the play mark (it was sized for the old round button) */
#order-chat-modal .order-chat-voice-player.oc-unplayed .order-chat-voice-play::before {
  top: 5px; left: 0; width: 7px; height: 7px; box-shadow: none;
}

/* delegate popover · name and role as direct children (a delegate with no vehicle plate, or the store-payment
   variant of this popover): name and role at the start, rating at the end, anything else full width below */
#order-chat-delegate-profile-popover .order-chat-dp-inner:has(> .order-chat-dp-title) { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title rating" "role rating"; }
#order-chat-delegate-profile-popover .order-chat-dp-inner:has(> .order-chat-dp-title):has(> .order-chat-dp-rating) { grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "av title rating" "av role rating"; }
#order-chat-delegate-profile-popover .order-chat-dp-inner:has(> .order-chat-dp-title):has(> .order-chat-dp-rating)::before {
  content: ''; grid-area: av; width: 40px; height: 40px; border-radius: 50%; background-color: var(--oc-accent-soft, #e6f6f8);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231f97a6' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: 20px 20px;
}
#order-chat-delegate-profile-popover .order-chat-dp-inner > .order-chat-dp-title { grid-area: title; align-self: end; text-align: start; }
#order-chat-delegate-profile-popover .order-chat-dp-inner > .order-chat-dp-role { grid-area: role; align-self: start; text-align: start; }
html.dark-mode #order-chat-delegate-profile-popover .order-chat-dp-inner:has(> .order-chat-dp-title):has(> .order-chat-dp-rating)::before { background-color: rgba(47, 179, 194, .16); }

/* ---------- A currency word typed on its own in a message (chat-redesign.js) ----------
   It sits in the site's .sar-symbol element so the page-wide currency script leaves it alone; here it is plain
   message text again: the message's own font, size, weight and colour instead of the symbol's. */
/* (two ids and the bubble class: the site colours a delegate bubble's symbol with an !important rule of its own) */
#order-chat-modal #order-chat-messages .order-chat-bubble .sar-symbol.oc-cur-word {
  font-family: inherit !important; font-size: inherit !important; font-weight: inherit !important; line-height: inherit !important;
  color: inherit !important; display: inline !important; margin: 0 !important; vertical-align: baseline !important;
}

/* ---- Order card total + «زيادة سعر التوصيل»: the theme's own surfaces and accent ----
   The total row was a tinted teal block (dark: green-looking), the boost fold, amounts and note used the engine's
   slate-blue dark colours. All of them now sit on the chat's neutral surface with a hairline, and only the numbers
   carry the accent. The swipe-to-confirm bar keeps the store's theme colour. */
#order-chat-modal .order-chat-invoice-total { background: var(--oc-incoming) !important; border: 1px solid var(--oc-line) !important; color: var(--oc-ink) !important; box-shadow: none !important; }
#order-chat-modal .order-chat-invoice-total-label { color: var(--oc-ink) !important; }
#order-chat-modal .order-chat-invoice-total-amt,
#order-chat-modal .order-chat-invoice-total-amt .sar-money,
#order-chat-modal .order-chat-invoice-total-amt .sar-symbol { color: var(--oc-accent-deep) !important; }
html.dark-mode #order-chat-modal .order-chat-invoice-total-amt,
html.dark-mode #order-chat-modal .order-chat-invoice-total-amt .sar-money,
html.dark-mode #order-chat-modal .order-chat-invoice-total-amt .sar-symbol { color: var(--oc-accent) !important; }
#order-chat-modal .order-chat-delivery-boost__title { color: var(--oc-ink) !important; }
#order-chat-modal .order-chat-delivery-boost__subtitle { color: var(--oc-muted) !important; }
#order-chat-modal .order-chat-delivery-boost__fold { background: var(--oc-incoming) !important; border: 1px solid var(--oc-line) !important; color: var(--oc-ink) !important; box-shadow: none !important; }
#order-chat-modal .order-chat-delivery-boost__fold [data-order-chat-boost-fold-amt] { color: var(--oc-accent-deep) !important; }
html.dark-mode #order-chat-modal .order-chat-delivery-boost__fold [data-order-chat-boost-fold-amt] { color: var(--oc-accent) !important; }
#order-chat-modal .order-chat-delivery-boost__fold-chevron { color: var(--oc-muted) !important; }
#order-chat-modal .order-chat-delivery-boost__note { background: transparent !important; border: 1px dashed var(--oc-line) !important; color: var(--oc-muted) !important; }
#order-chat-modal .order-chat-delivery-boost__amount { background: var(--oc-incoming) !important; border: 1.5px solid var(--oc-line) !important; color: var(--oc-ink) !important; box-shadow: none !important; }
#order-chat-modal .order-chat-delivery-boost__amount.is-selected { border-color: var(--oc-accent) !important; background: color-mix(in srgb, var(--oc-accent) 14%, var(--oc-incoming)) !important; }
#order-chat-modal .order-chat-delivery-boost__amount-label { color: var(--oc-accent-deep) !important; }
html.dark-mode #order-chat-modal .order-chat-delivery-boost__amount-label { color: var(--oc-accent) !important; }
#order-chat-modal .order-chat-delivery-boost__swipe-caption { color: var(--oc-muted) !important; }

/* ---- Chat header while searching for a delegate: «البحث عن مندوب» and three bouncing dots ----
   The engine writes «محادثة مع المندوب • جاري البحث عن مندوب». The script marks that state with .oc-searching and
   changes the leading words to «البحث عن مندوب»; the sentence's place shows two more dots like the engine's own
   separator dot (same 5px size, same theme colour), the three rising and falling one after another.
   --oc-sd is the animation phase the script sets, so the dots do not restart each time the engine redraws the header. */
#order-chat-modal .order-chat-modal-subtitle-inner.oc-searching .order-chat-header-delegate-dot { margin: 0 !important; top: 0 !important; animation: oc-search-dot 3.6s ease-in-out infinite; animation-delay: var(--oc-sd, 0s); }
#order-chat-modal .order-chat-modal-subtitle-inner.oc-searching .order-chat-header-delegate-name { display: inline-flex !important; align-items: center; gap: 0; margin-inline-start: -4px; font-size: 0 !important; line-height: 0 !important; max-width: none !important; overflow: visible !important; }
#order-chat-modal .order-chat-modal-subtitle-inner.oc-searching .order-chat-header-delegate-name::before,
#order-chat-modal .order-chat-modal-subtitle-inner.oc-searching .order-chat-header-delegate-name::after { content: ''; display: block; width: 5px; height: 5px; border-radius: 50%; background: var(--theme-color, #15803d); animation: oc-search-dot 3.6s ease-in-out infinite; }
#order-chat-modal .order-chat-modal-subtitle-inner.oc-searching .order-chat-header-delegate-name::before { animation-delay: calc(var(--oc-sd, 0s) + .16s); margin-inline-end: 4px; }
#order-chat-modal .order-chat-modal-subtitle-inner.oc-searching .order-chat-header-delegate-name::after { animation-delay: calc(var(--oc-sd, 0s) + .32s); }
/* three motions of 1.2s each, repeating: hop, swell, dim */
@keyframes oc-search-dot {
  0%, 20%, 33.33% { transform: translateY(0) scale(1); opacity: .55; }
  10% { transform: translateY(-4px) scale(1); opacity: 1; }
  43.33% { transform: translateY(0) scale(1.7); opacity: 1; }
  53.33%, 66.66% { transform: translateY(0) scale(1); opacity: .55; }
  76.66% { transform: translateY(0) scale(.55); opacity: .15; }
  86.66%, 100% { transform: translateY(0) scale(1); opacity: .55; }
}
@media (prefers-reduced-motion: reduce) {
  #order-chat-modal .order-chat-modal-subtitle-inner.oc-searching .order-chat-header-delegate-dot,
  #order-chat-modal .order-chat-modal-subtitle-inner.oc-searching .order-chat-header-delegate-name::before,
  #order-chat-modal .order-chat-modal-subtitle-inner.oc-searching .order-chat-header-delegate-name::after { animation: none; opacity: 1; }
}

/* ---- «زيادة سعر التوصيل»: the heading's words live on the fold button; the standalone heading goes ----
   The script renames the button and marks the block (.oc-boost-merged); only then is the heading hidden, so a
   block the script has not touched keeps its heading. */
#order-chat-modal .order-chat-delivery-boost.oc-boost-merged .order-chat-delivery-boost__title { display: none !important; }
