/* Kauthar AI — public customer chat (mobile-first; RTL for Arabic, LTR for English / French — logical properties only) */
:root {
  /* tenant brand — overridden per tenant by an inline :root{} from src/lib/brand.js (cssVars) */
  --brand: #0f766e;
  --brand-600: #0d6660;
  --brand-50: #e7f6f3;
  --on-brand: #fff;          /* text/icons ON the brand color (#fff or navy, WCAG) */
  --brand-ink: #0f766e;      /* brand-colored text on white (darkened when the brand is too light) */
  --brand-soft: var(--brand-50);
  --brand-dark: var(--brand-600);
  --bg: #eef1f6;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --ok: #10b981;
  --radius: 18px;
  --flip: 1;                 /* «send / forward» icons point to the reading direction: mirrored in RTL */
}
[dir=rtl] { --flip: -1; }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, textarea, input { font-family: inherit; }

.gc-app {
  height: 100vh; height: 100dvh; display: flex; flex-direction: column;
  max-width: 760px; margin: 0 auto; background: var(--bg); position: relative; overflow: hidden;
}
@media (min-width: 800px) {
  body:not(.is-embed) { background: linear-gradient(160deg, var(--brand-soft), #e9edf5 60%); }
  body:not(.is-embed) .gc-app { height: calc(100dvh - 40px); margin: 20px auto; border-radius: 24px; box-shadow: 0 20px 60px rgba(15, 23, 42, .15); }
}

/* ---------- header ---------- */
.gc-head {
  flex: none; display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: linear-gradient(135deg, var(--brand), var(--brand-600)); color: var(--on-brand);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .12); z-index: 2;
}
.gc-avatar {
  position: relative; flex: none; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 20px;
  background: color-mix(in srgb, var(--on-brand) 18%, transparent); border: 2px solid color-mix(in srgb, var(--on-brand) 40%, transparent); color: var(--on-brand);
}
.gc-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.gc-avatar.is-logo { background: #fff; border-color: #fff; }
.gc-avatar.is-logo img { object-fit: contain; padding: 4px; }
.gc-avatar.is-persona { background: #e6fbf6; border-color: #fff; }   /* default assistant avatar = the Kauthar persona */
.gc-online { position: absolute; bottom: -2px; inset-inline-end: -2px; width: 12px; height: 12px; border-radius: 50%; background: #22c55e; border: 2px solid #fff; }
.gc-title { flex: 1; min-width: 0; }
.gc-name { font-weight: 700; font-size: 16.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc-sub { font-size: 12.5px; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.gc-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .3); display: inline-block; flex: none; }
.gc-actions { display: flex; gap: 6px; flex: none; }
.gc-iconbtn {
  width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: color-mix(in srgb, var(--on-brand) 15%, transparent); color: var(--on-brand); font-size: 18px; cursor: pointer; text-decoration: none;
  transition: background .15s, transform .1s;
}
.gc-iconbtn:hover { background: color-mix(in srgb, var(--on-brand) 26%, transparent); }
.gc-iconbtn:active { transform: scale(.94); }
.gc-wa { background: #25d366; color: #fff; }
.gc-wa:hover { background: #1fbd5a; }

.is-embed .gc-head { padding: 9px 12px; gap: 10px; }
.is-embed .gc-avatar { width: 36px; height: 36px; font-size: 16px; }
.is-embed .gc-name { font-size: 15px; }
.is-embed .gc-iconbtn { width: 34px; height: 34px; font-size: 16px; }
.is-embed .gc-app { max-width: none; }
/* «عرض بملء الشاشة»: the full page drops its card margins; inside the website widget the parent enlarges the panel (widget.js) */
body.gc-full:not(.is-embed) .gc-app { max-width: none; height: 100dvh; margin: 0; border-radius: 0; box-shadow: none; }
/* phones: the chat already fills the screen (page and widget alike) */
@media (max-width: 520px) { body:not(.is-embed) #gcMax { display: none; } }
.is-embed:not(.is-wide) #gcMax { display: none; }

/* ---------- messages ---------- */
.gc-body {
  flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 14px 12px 8px;
  background-color: var(--bg);
  background-image: radial-gradient(color-mix(in srgb, var(--brand) 7%, transparent) 1px, transparent 1px);
  background-size: 18px 18px;
  scroll-behavior: smooth;
}
.gc-list { display: flex; flex-direction: column; gap: 10px; }
.gc-day { align-self: center; font-size: 11.5px; color: var(--muted); background: rgba(255, 255, 255, .85); padding: 2px 12px; border-radius: 20px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }

.gc-row { display: flex; align-items: flex-end; gap: 8px; animation: gcIn .22s ease-out; }
@keyframes gcIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.gc-row.user { justify-content: flex-end; }
.gc-mini { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--on-brand); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.gc-row.agent .gc-mini { background: #0b2530; color: #fff; }
.gc-col { display: flex; flex-direction: column; max-width: 82%; min-width: 0; }
.gc-row.user .gc-col { align-items: flex-end; }

.gc-bubble {
  padding: 9px 13px; border-radius: var(--radius); line-height: 1.75; font-size: 15px;
  word-wrap: break-word; overflow-wrap: anywhere; white-space: normal;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}
.gc-row.assistant .gc-bubble, .gc-row.agent .gc-bubble { background: var(--card); border-start-start-radius: 6px; }
.gc-row.user .gc-bubble { background: var(--brand); color: var(--on-brand); border-start-end-radius: 6px; }
.gc-row.agent .gc-bubble { border: 1px solid color-mix(in srgb, #0b1e3f 15%, transparent); }
.gc-bubble p { margin: 0 0 6px; }
.gc-bubble p:last-child { margin-bottom: 0; }
.gc-bubble ul, .gc-bubble ol { margin: 4px 0 6px; padding-inline-start: 20px; }
.gc-bubble li { margin: 2px 0; }
.gc-bubble a { color: var(--brand-ink); font-weight: 600; word-break: break-all; }
.gc-row.user .gc-bubble a { color: var(--on-brand); }
.gc-bubble strong { font-weight: 700; }
.gc-agent-tag { font-size: 11.5px; color: #0b1e3f; font-weight: 700; margin-bottom: 3px; display: flex; align-items: center; gap: 4px; }
.gc-caret::after { content: ''; display: inline-block; width: 7px; height: 15px; background: var(--brand); margin-inline-start: 3px; vertical-align: -2px; border-radius: 2px; animation: gcBlink 1s steps(2) infinite; }
@keyframes gcBlink { 50% { opacity: 0; } }

.gc-info { display: flex; align-items: center; gap: 8px; margin-top: 3px; padding: 0 4px; font-size: 11px; color: var(--muted); }
.gc-fb { border: 0; background: none; padding: 2px 4px; color: #94a3b8; cursor: pointer; font-size: 13px; border-radius: 6px; line-height: 1; }
.gc-fb:hover { color: var(--ink); background: rgba(0,0,0,.05); }
.gc-fb.on.up { color: var(--ok); }
.gc-fb.on.down { color: #ef4444; }

.gc-sys { align-self: center; max-width: 90%; text-align: center; font-size: 13px; color: #334155; background: #fff8db; border: 1px solid #fde68a; padding: 6px 14px; border-radius: 14px; animation: gcIn .22s ease-out; white-space: pre-line; }

.gc-error .gc-bubble { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.gc-retry { border: 0; background: none; color: #b91c1c; font-weight: 700; cursor: pointer; padding: 0; margin-inline-start: 6px; text-decoration: underline; }

/* typing indicator */
.gc-typing { display: inline-flex; gap: 4px; padding: 14px 16px !important; }
.gc-typing span { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; animation: gcBounce 1.2s infinite ease-in-out; }
.gc-typing span:nth-child(2) { animation-delay: .15s; }
.gc-typing span:nth-child(3) { animation-delay: .3s; }
.gc-typing-row .gc-col { align-items: flex-start; }
.gc-busy { font-size: 12px; color: #64748b; margin-top: 4px; padding: 0 4px; line-height: 1.5; animation: gcIn .22s ease-out; }
.gc-busy i { margin-inline-end: 4px; }
@keyframes gcBounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

/* suggestion chips */
.gc-chips { display: flex; flex-wrap: wrap; gap: 7px; padding-block: 2px 4px; padding-inline: 36px 0; animation: gcIn .3s ease-out; }
.gc-chip {
  border: 1.5px solid color-mix(in srgb, var(--brand) 35%, transparent); background: #fff; color: var(--brand-ink);
  font-size: 13.5px; font-weight: 600; padding: 6px 13px; border-radius: 20px; cursor: pointer;
  transition: background .15s, transform .1s; text-align: start;
}
.gc-chip:hover { background: var(--brand-soft); }
.gc-chip:active { transform: scale(.97); }

/* inline cards (lead form / rating) */
.gc-card {
  align-self: stretch; background: #fff; border-radius: 16px; padding: 14px; margin: 2px 0;
  box-shadow: 0 4px 18px rgba(15, 23, 42, .08); border: 1px solid var(--line); animation: gcIn .25s ease-out;
}
.gc-card h4 { margin: 0 0 4px; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.gc-card h4 i { color: var(--brand-ink); }
.gc-card p { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.gc-field { margin-bottom: 8px; }
.gc-field input, .gc-field textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 9px 12px; font-size: 15px; outline: none; background: #f8fafc;
  transition: border-color .15s, background .15s;
}
.gc-field input:focus, .gc-field textarea:focus { border-color: var(--brand-ink); background: #fff; }
.gc-field input.bad { border-color: #ef4444; }
.gc-field .ltr { direction: ltr; text-align: left; }
[dir=rtl] .gc-field .ltr { text-align: right; }
.gc-err { color: #dc2626; font-size: 12.5px; min-height: 0; margin: -2px 0 6px; }
.gc-btn {
  width: 100%; border: 0; border-radius: 12px; padding: 10px; font-size: 15px; font-weight: 700; cursor: pointer;
  background: var(--brand); color: var(--on-brand); display: flex; align-items: center; justify-content: center; gap: 6px;
}
.gc-btn:disabled { opacity: .6; cursor: default; }
.gc-btn.ghost { background: transparent; color: var(--muted); font-weight: 600; padding: 6px; margin-top: 4px; }
.gc-stars { display: flex; justify-content: center; gap: 6px; direction: ltr; margin: 4px 0 6px; }
.gc-star { border: 0; background: none; font-size: 30px; color: #cbd5e1; cursor: pointer; padding: 0 2px; transition: transform .1s, color .1s; }
.gc-star.on { color: #f59e0b; }
.gc-star:active { transform: scale(.9); }
.gc-done { text-align: center; color: var(--ok); font-weight: 700; font-size: 14px; }

/* ---------- composer ---------- */
.gc-foot { flex: none; background: #fff; border-top: 1px solid var(--line); padding: 8px 10px; padding-bottom: max(6px, env(safe-area-inset-bottom)); }
.gc-composer { display: flex; align-items: flex-end; gap: 8px; }
.gc-composer textarea {
  flex: 1; resize: none; border: 1.5px solid var(--line); background: #f1f5f9; border-radius: 22px;
  padding: 10px 16px; font-size: 16px; line-height: 1.5; max-height: 140px; min-height: 46px; outline: none;
  transition: border-color .15s, background .15s; color: var(--ink);
}
.gc-composer textarea:focus { border-color: var(--brand-ink); background: #fff; }
.gc-composer textarea:disabled { opacity: .7; }
.gc-send {
  flex: none; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--brand); color: var(--on-brand);
  font-size: 18px; display: grid; place-items: center; cursor: pointer; transition: transform .1s, opacity .15s, background .15s;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 40%, transparent);
}
.gc-send i { transform: scaleX(var(--flip)); margin-inline-end: 2px; }
.gc-send:disabled { background: #cbd5e1; color: #fff; box-shadow: none; cursor: default; }
.gc-send:not(:disabled):active { transform: scale(.92); }
.gc-send.busy i { animation: gcSpin 1s linear infinite; }
@keyframes gcSpin { to { transform: scaleX(var(--flip)) rotate(360deg); } }
.gc-meta { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 4px 6px; margin-top: 6px; font-size: 11.5px; color: #94a3b8; }
.gc-link { border: 0; background: none; color: var(--muted); font-size: 11.5px; cursor: pointer; padding: 0; text-decoration: none; display: inline-flex; align-items: center; gap: 3px; }
.gc-link:hover { color: var(--brand-ink); }
.gc-powered b { font-weight: 700; color: #475569; }
.gc-sep { color: #cbd5e1; }
.is-embed .gc-foot { padding: 7px 9px 5px; }
.is-embed .gc-meta { margin-top: 4px; }

/* ---------- not-found page ---------- */
.gc-nf { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, #e0e9ff, #eef1f6); }
.gc-nf-card { background: #fff; border-radius: 22px; padding: 32px 24px; max-width: 420px; text-align: center; box-shadow: 0 20px 50px rgba(15, 23, 42, .12); }
.gc-nf-icon { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; background: #effcf9; color: #0f766e; font-size: 34px; }
.gc-nf h1 { font-size: 21px; margin: 0 0 8px; }
.gc-nf p { color: var(--muted); line-height: 1.8; margin: 0 0 18px; font-size: 14.5px; }
.gc-nf-btn { display: inline-block; background: #0f766e; color: #fff; padding: 10px 22px; border-radius: 12px; text-decoration: none; font-weight: 700; }
.is-embed #gcRateBtn, .is-embed #gcHuman { display: none; }

/* «مسارات الرد» — path buttons */
.gc-flow { padding-block: 4px 6px; padding-inline: 36px 0; animation: gcIn .3s ease-out; }
.gc-flow-ctx { font-size: 12.5px; color: #64748b; margin: 0 2px 6px; }
.gc-flow-ctx i { color: var(--brand-ink); }
.gc-flow-btns { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gc-flow-btn {
  display: flex; align-items: center; gap: 8px; text-align: start; min-height: 46px;
  padding: 10px 12px; border-radius: 14px; border: 1.5px solid color-mix(in srgb, var(--brand-ink) 55%, transparent); background: #fff; color: var(--brand-ink);
  font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; transition: background .15s, transform .1s;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}
.gc-flow-btn:hover { background: var(--brand-soft); }
.gc-flow-btn:active { transform: scale(.98); }
.gc-flow-ic { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 1.05rem; line-height: 1;
  background: color-mix(in srgb, var(--brand) 12%, #fff); color: var(--brand-ink); }
.gc-flow-nav { display: flex; gap: 14px; margin-top: 8px; font-size: 13px; }
@media (max-width: 420px) { .gc-flow { padding-inline-start: 0; } .gc-flow-btns { grid-template-columns: 1fr 1fr; } }

/* helpdesk ticket from the chat */
.gc-btn.alt { background: #fff; color: var(--brand-ink); border: 1.5px solid var(--brand-ink); margin-top: 6px; }
.gc-btn.alt:hover { background: var(--brand-soft); }
.gc-tk-link {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; padding: 5px 12px; border-radius: 20px;
  background: var(--brand); color: var(--on-brand); font-weight: 700; font-size: 13px; text-decoration: none;
}
.gc-tk-link:hover { background: var(--brand-600); }
.gc-sys .gc-tk-link { display: flex; width: fit-content; margin: 6px auto 0; }

/* «حجز موعد» — inline booking stepper */
.gc-bk { padding: 12px; }
.gc-bk-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gc-bk-h h4 { margin: 0; }
.gc-bk-x { border: 0; background: #f1f5f9; color: var(--muted); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; font-size: 13px; }
.gc-bk-x:hover { color: var(--ink); }
.gc-bk-sum { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 2px; }
.gc-bk-sum:empty { display: none; }
.gc-bk-sum span { font-size: 12px; font-weight: 700; color: var(--brand-ink); background: var(--brand-soft); padding: 2px 9px; border-radius: 12px; }
.gc-bk-t { font-size: 13.5px; font-weight: 800; color: var(--ink); margin: 10px 0 8px; }
.gc-bk-g { font-size: 12px; font-weight: 700; color: var(--muted); margin: 8px 0 5px; }
.gc-bk-g i { color: var(--brand-ink); }
.gc-bk-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.gc-bk-chips.col { flex-direction: column; }
.gc-bk-chips.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.gc-bk-chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.gc-bk-chip {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: start; font: inherit; cursor: pointer;
  border: 1.5px solid color-mix(in srgb, var(--brand) 35%, transparent); background: #fff; color: var(--ink);
  padding: 8px 12px; border-radius: 12px; transition: background .15s, transform .1s;
}
.gc-bk-chip b { font-size: 14px; font-weight: 700; }
.gc-bk-chip small { font-size: 11.5px; color: var(--muted); }
.gc-bk-chip:hover { background: var(--brand-soft); }
.gc-bk-chip:active { transform: scale(.97); }
.gc-bk-chip.any { border-style: dashed; background: var(--brand-soft); }
.gc-bk-chip.day { flex: none; align-items: center; min-width: 78px; }
.gc-bk-chip.slot { align-items: center; padding: 8px 4px; color: var(--brand-ink); }
.gc-bk-back { margin-top: 10px; font-size: 12.5px; }
.gc-bk-load { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; padding: 10px 0; }
.gc-bk-empty { font-size: 13.5px; color: #334155; line-height: 1.8; }
.gc-bk-spin { width: 16px; height: 16px; border: 2px solid color-mix(in srgb, var(--brand) 25%, transparent); border-top-color: var(--brand); border-radius: 50%; display: inline-block; animation: gcSpin2 .8s linear infinite; }
.gc-bk-spin.light { border-color: color-mix(in srgb, var(--on-brand) 45%, transparent); border-top-color: var(--on-brand); }
@keyframes gcSpin2 { to { transform: rotate(360deg); } }
.gc-bk .gc-err { margin: 6px 0; }
.gc-sys-bk { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; font-weight: 700; }
.gc-book-link { color: var(--brand-ink); font-weight: 700; }

/* registration gate — name + phone (+ profession/business) before the first message; «new session» divider */
.gc-gate { padding: 14px 14px 12px; border-top: 3px solid var(--brand); }
.gc-gate h4 { font-size: 15.5px; }
.gc-gate p { margin-bottom: 12px; }
.gc-lab { display: block; font-size: 12.5px; font-weight: 700; color: #334155; margin: 0 2px 4px; }
.gc-lab b { color: #dc2626; font-weight: 700; }
.gc-gate .gc-field { margin-bottom: 9px; }
.gc-gate .gc-field input { padding: 10px 12px; }
.gc-gate .gc-err { margin: 0 0 8px; line-height: 1.5; }
.gc-gate .gc-err:empty { display: none; }
.gc-gate .gc-btn { margin-top: 2px; }
.gc-gate-note { display: flex; align-items: center; justify-content: center; gap: 5px; margin-top: 9px; font-size: 11.5px; color: var(--muted); text-align: center; line-height: 1.5; }
.gc-gate-note i { color: var(--ok); font-size: 13px; }
.gc-shake { animation: gcShake .35s ease; }
@keyframes gcShake { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.gc-newsess { display: inline-flex; align-items: center; gap: 5px; color: var(--brand-ink); background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent); font-weight: 700; padding: 3px 12px; }
.gc-sys-ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; font-weight: 700; }
.gc-composer textarea:disabled { background: #f1f5f9; color: var(--muted); cursor: not-allowed; }
.is-embed .gc-gate { padding: 12px 12px 10px; }
.is-embed .gc-gate p { margin-bottom: 9px; font-size: 12.5px; }
.is-embed .gc-gate .gc-field { margin-bottom: 7px; }
.is-embed .gc-gate .gc-field input { padding: 8px 11px; font-size: 14.5px; }
.is-embed .gc-gate .gc-btn { padding: 9px; font-size: 14.5px; }

/* rich answers: formatted Markdown + product cards under an assistant bubble (cards themselves: rich.css) */
.gc-col.has-cards { max-width: 100%; width: 100%; }
.gc-col.has-cards .gc-bubble { max-width: 82%; align-self: flex-start; }
.gc-cards { margin-top: 2px; }
.gc-bubble u { text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.gc-bubble code { font-size: .92em; background: rgba(100, 116, 139, .12); padding: 0 .3em; border-radius: 4px; }
.gc-bubble li::marker { color: var(--brand-ink); }

/* «اطلب الآن»: order card for a synced store product (chat.js openOrder) */
.gc-ord .gc-field select, .gc-ord .gc-field textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 9px 12px; font-size: 15px; outline: none; background: #f8fafc;
  font-family: inherit; color: inherit;
}
.gc-ord .gc-field textarea { resize: vertical; min-height: 64px; }
.gc-ord .gc-field select:focus, .gc-ord .gc-field textarea:focus { border-color: var(--brand-ink); background: #fff; }
.gc-ord .gc-field select.bad, .gc-ord .gc-field textarea.bad { border-color: #ef4444; }
.gc-ord .gc-err:empty { display: none; }
.gc-ord-prod { display: flex; align-items: center; gap: 10px; margin: 10px 0; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafc; }
.gc-ord-prod img, .gc-ord-noimg { width: 56px; height: 56px; flex: none; border-radius: 10px; object-fit: cover; background: #fff; }
.gc-ord-noimg { display: grid; place-items: center; color: var(--muted); font-size: 22px; border: 1px solid var(--line); }
.gc-ord-prod div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gc-ord-prod b { font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.gc-ord-prod small { font-size: 13px; font-weight: 700; color: var(--brand-ink); }
.gc-qty { display: flex; align-items: stretch; gap: 6px; max-width: 170px; }
.gc-qty button { flex: none; width: 40px; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; font-size: 20px; font-weight: 700; cursor: pointer; color: var(--brand-ink); }
.gc-qty input { text-align: center; direction: ltr; }
.gc-ord-sum { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-bottom: 8px; }
.gc-ord-sum th { text-align: start; font-weight: 600; color: var(--muted); padding: 5px 0; width: 32%; vertical-align: top; }
.gc-ord-sum td { padding: 5px 0; overflow-wrap: anywhere; }
.gc-ord-sum tr + tr { border-top: 1px dashed var(--line); }
.gc-ord-total { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-radius: 12px; background: var(--brand-soft); margin-bottom: 6px; }
.gc-ord-total b { font-size: 17px; color: var(--brand-ink); }
.gc-ord-note { font-size: 12px; color: var(--muted); margin-bottom: 8px; line-height: 1.6; }
.gc-ord-hint { margin-top: 6px; width: auto; align-self: flex-start; padding: 8px 14px; font-size: 14px; }

/* language switch (full page only, header): one icon button → small popover with «ع · EN · FR» (views/partials/lang_switch.ejs) */
.gc-lang { position: relative; }
.gc-lang-pop { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 20; background: #fff; border-radius: 999px; padding: 4px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .22); }
.gc-lang-pop[hidden] { display: none; }
.gc-lang-pop .k-lang { background: transparent; }
.gc-nf-lang { margin-top: 18px; }

/* shared phone field (public/js/kphone.js) inside chat cards: same height / radius / colors as the other chat inputs */
.gc-field .kphone { border-radius: 12px; }
.gc-field .kphone .kphone-cc { min-height: 42px; border: 1.5px solid var(--line); border-inline-end: 0; border-radius: 12px 0 0 12px; background: #f1f5f9;
  font-size: 14px; padding: 0 .55rem; color: var(--ink); }
.gc-field .kphone .kphone-cc:hover, .gc-field .kphone .kphone-cc:focus-visible { background: var(--brand-soft); box-shadow: none; border-color: var(--brand-ink); }
.gc-field .kphone input.kphone-num { width: auto; flex: 1 1 auto; min-width: 0; border-radius: 0 12px 12px 0; direction: ltr; text-align: left; }
.gc-field .kphone input.kphone-num.bad { border-color: #ef4444; }
.gc-field .kphone.bad .kphone-cc { border-color: #ef4444; }
.gc-gate .gc-field .kphone input.kphone-num { padding: 10px 12px; }
.is-embed .gc-gate .gc-field .kphone input.kphone-num { padding: 8px 11px; }
.kphone-sheet { font-family: 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif; }
.kphone-sheet .kphone-search input:focus { border-color: var(--brand-ink); box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--brand) 18%, transparent); }
.kphone-sheet .kphone-list li[aria-selected=true] { background: var(--brand-soft); }
