.sr-root {
  --sr-accent: #0f6e6b;
  --sr-accent-text: #f7f4ee;
  --sr-panel: #f7f4ee;
  --sr-ink: #1c1915;
  --sr-line: #e4dccf;
  --sr-surface: #ffffff;
  --sr-radius: 16px;
  --sr-font: "Segoe UI", "Helvetica Neue", sans-serif;
}

.sr-launcher,
.sr-panel,
.sr-panel * {
  box-sizing: border-box;
  font-family: var(--sr-font);
}

.sr-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99998;
  border: 0;
  border-radius: 999px;
  background: var(--sr-accent);
  color: var(--sr-accent-text);
  padding: 12px 16px;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(28, 25, 21, 0.18);
}

.sr-panel {
  position: fixed;
  right: 20px;
  bottom: 76px;
  z-index: 99999;
  display: none;
  width: min(380px, calc(100vw - 24px));
  height: min(540px, calc(100vh - 120px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--sr-line);
  border-radius: var(--sr-radius);
  background: var(--sr-panel);
  color: var(--sr-ink);
  box-shadow: 0 16px 40px rgba(28, 25, 21, 0.18);
}

.sr-panel.sr-open {
  display: flex;
}

.sr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--sr-surface);
  border-bottom: 1px solid var(--sr-line);
  color: var(--sr-ink);
}

.sr-head strong {
  font-family: Palatino, "Palatino Linotype", serif;
  font-size: 18px;
  font-weight: 600;
}

.sr-close {
  border: 0;
  background: transparent;
  font-size: 20px;
  cursor: pointer;
}

.sr-log {
  flex: 1;
  overflow: auto;
  padding: 16px;
}

.sr-msg {
  max-width: 90%;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: 14px;
}

.sr-user {
  margin-left: auto;
  background: var(--sr-accent);
  color: var(--sr-accent-text);
}

.sr-bot {
  background: var(--sr-surface);
  border: 1px solid var(--sr-line);
}

.sr-sources {
  margin: -4px 0 12px;
  padding: 0;
  list-style: none;
  font-size: 12px;
}

.sr-sources a {
  color: var(--sr-accent);
}

.sr-next {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  margin: -2px 0 12px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--sr-accent);
  color: var(--sr-accent-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.sr-next::after {
  content: " →";
}

.sr-next:hover {
  filter: brightness(0.95);
}

.sr-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: var(--sr-surface);
  border-top: 1px solid var(--sr-line);
}

.sr-form input {
  flex: 1;
  border: 1px solid var(--sr-line);
  color: var(--sr-ink);
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
}

.sr-form button {
  border: 0;
  border-radius: 8px;
  background: var(--sr-ink);
  color: var(--sr-panel);
  padding: 0 14px;
  cursor: pointer;
}

.sr-form button:disabled {
  opacity: 0.5;
  cursor: default;
}

.sr-root.sr-left .sr-launcher,
.sr-root.sr-left .sr-panel {
  right: auto;
  left: 20px;
}
