:root {
  --srom-primary: #fccf00;
  --srom-primary-dark: #d6ae00;
  --srom-accent: #a9a8a6;
  --srom-bg: #f5f8fa;
  --srom-text: #24211c;
  --srom-muted: #60727b;
  --srom-border: #d8e2e7;
}

.srom-ai-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9998;
  display: grid;
  place-items: center;
  align-items: center;
  width: 60px;
  height: 60px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--srom-text);
  background: var(--srom-primary);
  box-shadow: 0 10px 28px rgba(36, 33, 28, .24);
  font: 700 15px/1.2 Arial, sans-serif;
  cursor: pointer;
}

.srom-ai-launcher:hover,
.srom-ai-launcher:focus-visible {
  background: var(--srom-primary-dark);
}

.srom-ai-launcher__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  color: transparent;
  font-size: 0;
}

.srom-ai-launcher__icon svg {
  display: none;
}

/* Funguje i tehdy, když prohlížeč ještě drží starou verzi JavaScriptu. */
.srom-ai-launcher__icon::before {
  content: "";
  display: block;
  width: 34px;
  height: 34px;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='%2324211c' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 5.5h22v15H14l-6 5v-5H5z'/%3E%3Cpath d='M12 17.5l1-4 8.4-8.4 3.5 3.5-8.4 8.4-4.5.5z'/%3E%3Cpath d='M20 6.5l3.5 3.5M13 13.5l3.5 3.5'/%3E%3C/svg%3E");
}

.srom-ai-launcher__label {
  display: none !important;
}

.srom-ai-panel {
  position: fixed;
  right: 20px;
  bottom: 86px;
  z-index: 9999;
  display: none;
  flex-direction: column;
  width: min(390px, calc(100vw - 24px));
  height: min(620px, calc(100vh - 110px));
  overflow: hidden;
  border: 1px solid var(--srom-border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 52px rgba(36, 33, 28, .28);
  color: var(--srom-text);
  font: 15px/1.45 Arial, sans-serif;
}

.srom-ai-panel[data-open="true"] {
  display: flex;
}

.srom-ai-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  color: var(--srom-text);
  background: var(--srom-primary);
}

.srom-ai-header__mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 50%;
  color: var(--srom-text);
  background: #fff;
  font-size: 21px;
}

.srom-ai-header__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.srom-ai-header__status {
  margin: 1px 0 0;
  font-size: 12px;
  opacity: .88;
}

.srom-ai-close {
  width: 36px;
  height: 36px;
  margin-left: auto;
  border: 0;
  border-radius: 50%;
  color: var(--srom-text);
  background: rgba(36, 33, 28, .10);
  font-size: 24px;
  cursor: pointer;
}

.srom-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--srom-bg);
}

.srom-ai-message {
  max-width: 88%;
  margin: 0 0 12px;
  padding: 11px 13px;
  border-radius: 15px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.srom-ai-message--assistant {
  border: 1px solid var(--srom-border);
  border-bottom-left-radius: 4px;
  background: #fff;
}

.srom-ai-message--user {
  margin-left: auto;
  border-bottom-right-radius: 4px;
  color: var(--srom-text);
  background: var(--srom-primary);
}

.srom-ai-sources {
  margin: 8px 0 0;
  padding: 9px 11px;
  border-left: 3px solid var(--srom-accent);
  background: #fff;
  font-size: 13px;
}

.srom-ai-sources a {
  color: #665300;
  font-weight: 700;
}

.srom-ai-feedback {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  margin: 8px 0 16px;
  color: var(--srom-muted);
  font-size: 12px;
}

.srom-ai-feedback__actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.srom-ai-feedback button {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--srom-border);
  border-radius: 14px;
  color: #665300;
  background: #fff;
  font: inherit;
  font-size: 17px;
  cursor: pointer;
}

.srom-ai-feedback button:hover,
.srom-ai-feedback button:focus-visible {
  border-color: var(--srom-primary-dark);
  background: #fff8d8;
}

.srom-ai-typing {
  color: var(--srom-muted);
  font-style: italic;
}

.srom-ai-form {
  padding: 12px;
  border-top: 1px solid var(--srom-border);
  background: #fff;
}

.srom-ai-form__row {
  display: flex;
  gap: 8px;
}

.srom-ai-input {
  min-width: 0;
  flex: 1;
  resize: none;
  border: 1px solid #b9c9d1;
  border-radius: 12px;
  padding: 10px 11px;
  color: var(--srom-text);
  background: #fff;
  font: inherit;
}

.srom-ai-input:focus {
  outline: 3px solid rgba(252, 207, 0, .30);
  border-color: var(--srom-primary);
}

.srom-ai-send {
  align-self: stretch;
  min-width: 48px;
  border: 0;
  border-radius: 12px;
  color: var(--srom-text);
  background: var(--srom-primary);
  font-size: 21px;
  cursor: pointer;
}

.srom-ai-send:disabled,
.srom-ai-input:disabled {
  opacity: .55;
  cursor: wait;
}

.srom-ai-note {
  margin: 8px 2px 0;
  color: var(--srom-muted);
  font-size: 11px;
  line-height: 1.35;
}

.srom-ai-honeypot {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  white-space: nowrap !important;
}

@media (max-width: 540px) {
  .srom-ai-launcher {
    right: 12px;
    bottom: 12px;
  }

  .srom-ai-launcher__label {
    display: none;
  }

  .srom-ai-panel {
    right: 12px;
    bottom: 78px;
    width: calc(100vw - 24px);
    height: calc(100vh - 96px);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .srom-ai-panel[data-open="true"] {
    animation: srom-ai-enter .18s ease-out;
  }
  @keyframes srom-ai-enter {
    from { opacity: 0; transform: translateY(10px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
}
