/* زر المساعد أسفل اليسار دائماً (حتى مع RTL) */
.guide-fab { position: fixed; z-index: 60; left: 18px; bottom: 18px; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--gold); background: var(--blue); color: #fff; box-shadow: 0 10px 26px rgb(4 22 38 / .35); cursor: pointer; }
.guide-fab svg { width: 28px; height: 28px; }
.guide-panel { position: fixed; z-index: 61; left: 18px; bottom: 88px; width: min(390px, calc(100vw - 36px)); height: min(640px, calc(100svh - 112px)); display: flex; flex-direction: column; overflow: hidden; border-radius: 18px; background: #fff; color: var(--ink); box-shadow: 0 24px 60px rgb(4 22 38 / .32); border: 1px solid var(--line); }
.guide-panel[hidden], .guide-panel [hidden] { display: none; }
.guide-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--blue-dark); color: #fff; }
.guide-panel button { font: inherit; cursor: pointer; }
.guide-close { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; color: #fff; }
.guide-langs { display: flex; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.guide-langs button { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.guide-langs button[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.guide-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: 12px; list-style: none; display: flex; flex-direction: column; gap: 10px; background: var(--soft); }
.guide-msg { max-width: 88%; padding: 10px 12px; border-radius: 14px; background: #fff; overflow-wrap: anywhere; }
.guide-msg.visitor { align-self: flex-end; background: var(--blue); color: #fff; }
.guide-msg.guide { align-self: flex-start; }
.guide-msg p { margin: 0; line-height: 1.7; }
.guide-msg small { display: block; margin-top: 4px; opacity: .8; }
.guide-msg > img { display: block; max-width: 180px; border-radius: 10px; margin-bottom: 6px; }
.guide-msg .guide-error { color: #ffe3a8; font-weight: 600; }
.guide-msg .guide-unsure { color: #8a5a00; opacity: 1; font-weight: 600; }
.guide-msg.thinking { opacity: .7; }
.guide-link { min-height: 36px; padding: 0; border: 0; background: none; color: var(--blue); text-decoration: underline; font-size: .85rem; }
.guide-msg.visitor .guide-link { color: #fff; }
.guide-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.guide-place { display: flex; gap: 10px; margin-top: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; }
.guide-place img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; }
.guide-place small { margin: 0; }
.guide-place span { display: flex; flex-wrap: wrap; gap: 12px; }
.guide-place a { min-height: 32px; display: inline-flex; align-items: center; font-weight: 600; font-size: .9rem; }
.guide-suggest { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.guide-suggest button { min-height: 40px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--blue); background: #fff; color: var(--blue); text-align: start; }
.guide-consent { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 14px; background: #fff; }
.guide-consent p { margin: 0; line-height: 1.8; }
.guide-note { margin: 0; padding: 8px 14px; background: #fff3d6; color: #6b4600; font-size: .9rem; }
.guide-form { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 8px 8px 6px; border-top: 1px solid var(--line); }
.guide-form > button { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: var(--blue); }
.guide-form .guide-send { background: var(--blue); color: #fff; }
.guide-form .guide-location[aria-pressed="true"] { background: var(--gold); color: var(--ink); }
.guide-form .guide-mic.live { background: #b3261e; color: #fff; }
.guide-form textarea { flex: 1; min-width: 0; min-height: 40px; max-height: 96px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 18px; resize: none; font: inherit; font-size: 16px; }
.guide-chip { flex-basis: 100%; display: flex; gap: 8px; align-items: center; }
.guide-chip img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.guide-chip button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: #fff; }
.guide-foot { padding: 0 12px 8px; display: grid; gap: 2px; font-size: .78rem; color: var(--muted); }
.guide-foot span { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; }
.guide-foot .guide-link { font-size: .78rem; }

/* لا يغطي الزر ما في الزاوية نفسها */
html[dir="rtl"] body.has-guide .to-top { bottom: 90px; }
html[dir="rtl"] body.has-guide .cinema .motion-toggle { bottom: 90px; }
html[dir="rtl"] body.has-guide .cinema > .src-mark { bottom: 101px; }
html[dir="ltr"] body.has-guide .cinema-body { padding-bottom: 92px; }

@media (max-width: 600px) {
  .guide-panel { inset: 0; width: 100%; height: 100dvh; border: 0; border-radius: 0; z-index: 120; }
  html.guide-open { overflow: hidden; }
  html.guide-open .guide-fab { display: none; }
}
@media print { .guide-root { display: none; } }
