/* Online-Rezeption – Info-Assistent. Theme-Variablen mit Fallbacks (siehe ARCHITEKTUR.md). */

.or-assist {
  --or-navy: var(--navy, #12314E);
  --or-blue: var(--blue, #0095D5);
  --or-blue-deep: var(--blue-deep, #00689F);
  --or-sky: var(--sky, #EAF5FC);
  --or-line: var(--line, #D9E8F2);
  --or-muted: var(--muted, #5B6B7B);
  --or-font: var(--font, "Source Sans 3", "Source Sans Pro", "Segoe UI", system-ui, sans-serif);
  --or-ok: #1E7B4F;
  --or-closed: #A4452C;
  font-family: var(--or-font);
  color: var(--or-navy);
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
}
.or-assist *, .or-assist *::before, .or-assist *::after { box-sizing: border-box; }

.or-assist__sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---------- Schwebende Variante ---------- */
.or-assist--floating {
  --or-assist-bottom: 16px;
  position: fixed;
  right: 16px;
  bottom: var(--or-assist-bottom);
  z-index: 9990; /* unter dem Cookie-Banner (Cookie Law Info: 9999) */
  transition: bottom .2s ease;
}
.or-assist__launcher {
  display: grid; place-items: center;
  width: 56px; height: 56px; padding: 0;
  border: 0; border-radius: 50%;
  background: var(--or-blue); color: #fff;
  box-shadow: 0 6px 20px rgba(18, 49, 78, .25);
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.or-assist__launcher:hover { background: var(--or-blue-deep); transform: translateY(-1px); }
.or-assist__launcher:focus-visible { outline: 2px solid var(--or-blue-deep); outline-offset: 3px; }
.or-assist__launcher svg { display: block; }
.or-assist__icon-close { display: none; }
.or-assist.is-open .or-assist__icon-open { display: none; }
.or-assist.is-open .or-assist__icon-close { display: block; }

.or-assist--floating .or-assist__panel {
  position: fixed;
  right: 16px;
  bottom: calc(var(--or-assist-bottom) + 68px);
  width: 380px;
  max-width: calc(100vw - 32px);
  height: min(640px, 80vh, calc(100vh - var(--or-assist-bottom) - 84px));
  box-shadow: 0 16px 48px rgba(18, 49, 78, .22);
}
.or-assist__panel[hidden] { display: none !important; }

/* ---------- Inline-Variante (Shortcode, Vorschau) ---------- */
.or-assist--inline { margin: 1.5em 0; }
.or-assist--inline .or-assist__panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  height: min(640px, 80vh);
}

/* ---------- Panel ---------- */
.or-assist__panel {
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid var(--or-line);
  border-radius: 2px;
  overflow: hidden;
  overflow: clip; /* auch per focus() nicht verschiebbar (Formular im Panel) */
}
.or-assist__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 14px 16px 12px;
  background: var(--or-navy); color: #fff;
}
.or-assist__title {
  margin: 0; font-family: inherit; font-size: 17px; font-weight: 600; line-height: 1.3;
  letter-spacing: .02em; color: #fff;
}
.or-assist__sub { margin: 2px 0 0; font-size: 13px; line-height: 1.4; color: rgba(255, 255, 255, .85); }
.or-assist__sub[hidden] { display: none; }
.or-assist__switch {
  padding: 0; border: 0; background: none; color: #fff; font: inherit; font-size: 13px;
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.or-assist__close {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 36px; height: 36px; margin: -4px -6px 0 0; padding: 0;
  border: 0; border-radius: 2px; background: transparent; color: #fff; cursor: pointer;
}
.or-assist__close:hover { background: rgba(255, 255, 255, .12); }
.or-assist__switch:focus-visible, .or-assist__close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ---------- Verlauf ---------- */
.or-assist__log {
  flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth;
}
.or-assist__log:focus { outline: none; }
.or-assist__msg {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: 2px;
  font-size: 15.5px; line-height: 1.5;
  overflow-wrap: anywhere;
}
.or-assist__msg p { margin: 0 0 .5em; }
.or-assist__msg p:last-child { margin-bottom: 0; }
.or-assist__msg ul { margin: .3em 0 .6em; padding-left: 1.2em; }
.or-assist__msg ul:last-child { margin-bottom: 0; }
.or-assist__msg li { margin: .15em 0; }
.or-assist__msg--bot { align-self: flex-start; background: var(--or-sky); color: var(--or-navy); }
.or-assist__msg--bot a { color: var(--or-blue-deep); text-decoration: underline; text-underline-offset: 2px; }
.or-assist__msg--user { align-self: flex-end; background: var(--or-blue); color: #fff; }
.or-assist__msg--bot:empty { display: none; }

.or-assist__hours { width: 100%; border-collapse: collapse; margin: 0 0 .6em; font-size: 15px; }
.or-assist__hours caption { text-align: left; font-weight: 600; padding-bottom: 4px; }
.or-assist__hours th, .or-assist__hours td { text-align: left; padding: 3px 0; border-bottom: 1px solid var(--or-line); vertical-align: top; }
.or-assist__hours th { font-weight: 400; padding-right: 12px; white-space: nowrap; }
.or-assist__vac { font-size: 14.5px; }

.or-assist__status-line { display: flex; gap: 8px; align-items: baseline; font-weight: 600; }
.or-assist__dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--or-closed); transform: translateY(-1px); }
.or-assist__status.is-open .or-assist__dot { background: var(--or-ok); }
.or-assist__status-hint { font-size: 14.5px; color: var(--or-navy); }

/* ---------- Buttons ---------- */
.or-assist__actions {
  flex: 0 0 auto;
  display: flex; flex-wrap: wrap; gap: 6px;
  max-height: 46%;
  overflow-y: auto;
  padding: 12px 16px;
  border-top: 1px solid var(--or-line);
  background: #fff;
}
.or-assist__actions:empty { display: none; }
.or-assist__chip {
  display: inline-flex; align-items: center;
  min-height: 36px; padding: 6px 11px;
  border: 1.5px solid var(--or-navy); border-radius: 2px;
  background: #fff; color: var(--or-navy);
  font: inherit; font-size: 14px; font-weight: 400; line-height: 1.25; text-align: left;
  text-decoration: none; cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.or-assist__chip:hover { border-color: var(--or-blue); color: var(--or-blue-deep); background: var(--or-sky); }
.or-assist__chip:focus-visible { outline: 2px solid var(--or-blue-deep); outline-offset: 2px; }
.or-assist__chip--back { border-color: var(--or-line); color: var(--or-muted); }
.or-assist__chip--primary {
  background: var(--or-blue); border-color: var(--or-blue); color: #fff;
  font-weight: 600; font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
}
.or-assist__chip--primary:hover { background: var(--or-blue-deep); border-color: var(--or-blue-deep); color: #fff; }

/* ---------- Freitext ---------- */
.or-assist__free {
  flex: 0 0 auto;
  display: flex; gap: 8px;
  padding: 10px 16px 4px;
  border-top: 1px solid var(--or-line);
  margin: 0;
}
.or-assist__input {
  flex: 1 1 auto; min-width: 0;
  height: 42px; padding: 0 12px;
  border: 1px solid var(--or-line); border-radius: 2px;
  background: #fff; color: var(--or-navy);
  font: inherit; font-size: 16px; /* 16 px: kein Auto-Zoom auf iOS */
}
.or-assist__input:focus { outline: 2px solid var(--or-blue-deep); outline-offset: 0; border-color: var(--or-blue-deep); }
.or-assist__input::placeholder { color: var(--or-muted); opacity: 1; }
.or-assist__send {
  flex: 0 0 auto; height: 42px; padding: 0 16px;
  border: 0; border-radius: 2px;
  background: var(--or-blue); color: #fff;
  font: inherit; font-size: 13px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  cursor: pointer;
}
.or-assist__send:hover { background: var(--or-blue-deep); }
.or-assist__send:focus-visible { outline: 2px solid var(--or-blue-deep); outline-offset: 2px; }
.or-assist__note { margin: 0; padding: 2px 16px 10px; font-size: 12.5px; color: var(--or-muted); }

/* ---------- Mobil: Panel als Vollbild ---------- */
@media (max-width: 640px) {
  .or-assist--floating .or-assist__panel {
    position: fixed;
    inset: 0;
    width: auto; max-width: none;
    height: auto;
    border: 0;
    box-shadow: none;
  }
  .or-assist__msg { max-width: 92%; }
  .or-assist__head { padding-top: max(14px, env(safe-area-inset-top)); }
  .or-assist__note { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}
html.or-assist-lock, html.or-assist-lock body { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .or-assist--floating, .or-assist__launcher, .or-assist__chip { transition: none; }
  .or-assist__launcher:hover { transform: none; }
  .or-assist__log { scroll-behavior: auto; }
}

@media print {
  .or-assist--floating { display: none !important; }
}
.or-assist__after { margin-top: .6em; }

/* ---------- Online-Rezeption im Panel ---------- */
.or-assist__free[hidden], .or-assist__note[hidden] { display: none; }
.or-assist__formblock {
  align-self: stretch; width: 100%; flex: 0 0 auto;
  padding-top: 12px; border-top: 3px solid var(--or-blue);
  scroll-margin-top: 8px;
}
.or-assist__loading { margin: 0; color: var(--or-muted); font-size: 15px; }
.or-assist__confirm { flex: 1 0 100%; margin: 0 0 2px; font-weight: 600; font-size: 15px; }
@media (min-width: 641px) {
  .or-assist--floating.has-form .or-assist__panel {
    width: 440px;
    height: min(760px, 88vh, calc(100vh - var(--or-assist-bottom) - 84px));
  }
}

/* ---------- Karte bei „Anfahrt und Parken“ ---------- */
.or-assist__msg--wide { max-width: 100%; align-self: stretch; }
.or-assist__map { margin-top: .6em; }
.or-assist__map iframe { display: block; width: 100%; height: 200px; border: 1px solid var(--or-line); background: #fff; }
.or-assist__msg--wide .or-assist__map { margin: .6em -13px -10px; } /* Karte über die volle Breite des Verlaufs */
