#sr-ai-launch,
#sr-ai-panel {
  font-family: "DM Sans","DM Sans Fallback", Arial, sans-serif;
  letter-spacing: 0;
}

#sr-ai-launch[hidden],
#sr-ai-panel[hidden],
#sr-ai-panel [hidden] {
  display: none !important;
}

#sr-ai-launch {
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 10020;
  min-width: 112px;
  height: 50px;
  padding: 0 20px;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 25px;
  background: #13231d;
  color: #fff;
  box-shadow: 0 14px 36px rgba(19,35,29,.28);
  font: 700 15px/1 "DM Sans","DM Sans Fallback", Arial, sans-serif;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

#sr-ai-launch:hover,
#sr-ai-launch:focus-visible {
  background: #1d342b;
  box-shadow: 0 17px 42px rgba(19,35,29,.34);
  transform: translateY(-2px);
}

#sr-ai-launch:focus-visible,
#sr-ai-panel button:focus-visible,
#sr-ai-panel a:focus-visible,
#sr-ai-panel input:focus-visible,
#sr-ai-panel select:focus-visible,
#sr-ai-panel summary:focus-visible {
  outline: 3px solid #d7be83;
  outline-offset: 2px;
}

#sr-ai-panel {
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(84px, calc(env(safe-area-inset-bottom) + 72px));
  z-index: 10021;
  display: flex;
  flex-direction: column;
  width: min(410px, calc(100vw - 32px));
  max-height: min(700px, calc(100dvh - 110px));
  overflow: hidden;
  border: 1px solid rgba(19,35,29,.16);
  border-radius: 8px;
  background: #fff;
  color: #17221d;
  box-shadow: 0 24px 70px rgba(10,26,20,.3);
}

#sr-ai-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 66px;
  padding: 12px 14px 12px 18px;
  background: #13231d;
  color: #fff;
}

#sr-ai-panel > header strong,
#sr-ai-panel > header small { display: block; }
#sr-ai-panel > header strong { font: 700 17px/1.25 Manrope,"Manrope Fallback", sans-serif; }
#sr-ai-panel > header small { margin-top: 3px; color: #d8dfdc; font-size: 12px; }
.sr-ai-header-actions { display: flex; gap: 6px; }

#sr-ai-panel button,
#sr-ai-panel input,
#sr-ai-panel select { font: inherit; }

.sr-ai-header-actions button {
  min-width: 40px;
  height: 36px;
  padding: 0 9px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 5px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.sr-ai-header-actions [data-close] { font-size: 24px; line-height: 1; }
.sr-ai-modes {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 16px;
  border-bottom: 1px solid #e5e9e7;
  background: #f7f8f7;
  font-size: 12px;
}
.sr-ai-modes label { display: flex; align-items: center; gap: 6px; }
.sr-ai-modes a { color: #765f31; font-weight: 700; }

#sr-ai-panel [data-log] {
  flex: 1 1 260px;
  min-height: 180px;
  padding: 15px;
  overflow-y: auto;
  background: #f3f5f4;
  overscroll-behavior: contain;
}

.sr-ai-message {
  width: fit-content;
  max-width: 88%;
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid #dfe5e2;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(19,35,29,.06);
}
.sr-ai-message.client { margin-left: auto; border-color: #13231d; background: #13231d; color: #fff; }
.sr-ai-message p { margin: 0; font-size: 14px; line-height: 1.48; }
.sr-ai-message small { display: block; margin-top: 7px; color: #68726d; font-size: 11px; }
.sr-ai-message.client small { color: #d8dfdc; }
.sr-ai-message a { display: inline-block; margin-top: 7px; color: #765f31; font-size: 12px; font-weight: 700; }
.sr-ai-message img { display: block; width: 100%; margin-top: 8px; border-radius: 4px; }
.sr-ai-message button { margin-top: 9px; }

#sr-ai-panel [data-topics] {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  padding: 10px 14px 0;
}
#sr-ai-panel [data-topics]:empty { display: none; }
#sr-ai-panel [data-topics] button,
.sr-ai-message button,
.sr-ai-privacy button,
.sr-ai-admin-body button,
.sr-ai-voice-actions button {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #c7d0cc;
  border-radius: 5px;
  background: #fff;
  color: #13231d;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
#sr-ai-panel [data-topics] button {
  width: 100%;
  max-width: none;
  min-height: 36px;
  white-space: normal;
  text-align: left;
}
#sr-ai-panel [data-status] { min-height: 18px; margin: 6px 16px; color: #606b66; font-size: 11px; }

#sr-ai-panel > form { padding: 0 14px 14px; }
#sr-ai-panel > form > label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; }
.sr-ai-input { display: grid; grid-template-columns: minmax(0,1fr) 34px auto 40px; gap: 5px; }
.sr-ai-input input { width: 100%; min-width: 0; height: 42px; padding: 0 11px; border: 1px solid #aebbb5; border-radius: 5px; color: #17221d; }
.sr-ai-input button { min-width: 34px; height: 42px; padding: 0 8px; border: 1px solid #b8c2bd; border-radius: 5px; background: #fff; color: #13231d; font-weight: 700; cursor: pointer; }
.sr-ai-input button[type="submit"] { border-color: #13231d; background: #13231d; color: #fff; font-size: 18px; }

.sr-ai-voice-settings,
#sr-ai-admin { border-bottom: 1px solid #e5e9e7; background: #fff; font-size: 12px; }
.sr-ai-voice-settings summary,
#sr-ai-admin summary { padding: 8px 16px; cursor: pointer; font-weight: 700; }
.sr-ai-voice-inner,
.sr-ai-admin-body { padding: 0 16px 12px; }
.sr-ai-voice-inner label { display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 8px; margin: 7px 0; }
.sr-ai-voice-inner select { min-width: 0; }
.sr-ai-voice-inner input[type="range"] { width: 100%; }
.sr-ai-online { display: flex !important; }
.sr-ai-voice-actions { display: flex; gap: 6px; margin-top: 9px; }

.sr-ai-privacy {
  position: absolute;
  inset: 66px 0 0;
  z-index: 2;
  padding: 18px;
  overflow-y: auto;
  background: #fff;
}
.sr-ai-privacy h2 { margin: 0 0 12px; font: 700 20px/1.25 Manrope,"Manrope Fallback", sans-serif; }
.sr-ai-privacy h3 { margin: 16px 0 5px; font-size: 14px; }
.sr-ai-privacy p { margin: 0 0 9px; font-size: 12px; line-height: 1.5; }
.sr-ai-privacy a { color: #765f31; font-weight: 700; }
.sr-ai-admin-body ul { max-height: 180px; padding-left: 20px; overflow-y: auto; }
.sr-ai-admin-body button { margin: 4px 6px 0 0; }

@media (max-width: 600px) {
  #sr-ai-launch { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); }
  #sr-ai-panel {
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    bottom: max(76px, calc(env(safe-area-inset-bottom) + 68px));
    width: auto;
    max-height: calc(100dvh - 92px - env(safe-area-inset-top));
  }
  .sr-ai-modes { align-items: flex-start; }

}

/* „Kontaktovať makléra“ — výrazné tlačidlo (hore aj pri otázke) */
.sr-ai-modes a.sr-ai-contact,
.sr-ai-question-head a.sr-ai-contact { display: inline-flex; align-items: center; padding: 7px 12px; border-radius: 6px; background: #b8914b; color: #fff; font-size: 13.5px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.sr-ai-modes a.sr-ai-contact:hover,
.sr-ai-question-head a.sr-ai-contact:hover { background: #9c7a3c; color: #fff; }
.sr-ai-question-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.sr-ai-question-head label { margin: 0; }

/* Nízke obrazovky (13" notebook, zväčšené zobrazenie Windows): hlavička a nastavenia hlasu ostávajú vždy
   viditeľné, zmenšuje sa len história správ; keby ani to nestačilo, okno sa dá posúvať. */
#sr-ai-panel { max-height: min(700px, calc(100dvh - 100px)); overflow-y: auto; }
#sr-ai-panel > header { position: sticky; top: 0; z-index: 2; flex: 0 0 auto; }
#sr-ai-panel > header ~ * { flex-shrink: 0; }
#sr-ai-panel [data-log] { flex: 1 1 110px !important; min-height: 90px; }
@media (max-height: 760px) {
  #sr-ai-panel { bottom: max(70px, calc(env(safe-area-inset-bottom) + 62px)); max-height: calc(100dvh - 78px); }
  #sr-ai-panel > header { min-height: 50px; padding-top: 6px; padding-bottom: 6px; }
  #sr-ai-panel [data-topics] { max-height: 84px; overflow-y: auto; }
}
