.s3-assistant[hidden],
.s3-assistant-panel[hidden] {
  display: none !important;
}

.s3-assistant {
  position: fixed;
  right: 22px;
  bottom: 20px;
  z-index: 1800;
  font-family: inherit;
}

.s3-assistant-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #000;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.32);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.s3-assistant-toggle:hover {
  background: #222;
}

.s3-assistant-toggle-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  font-size: 16px;
}

.s3-assistant-toggle-icon img {
  display: block;
  filter: invert(1);
}

.s3-assistant-panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  display: flex;
  width: min(420px, calc(100vw - 36px));
  height: min(660px, calc(100vh - 120px));
  min-height: 360px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #d8e0eb;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 58px rgba(19, 36, 59, 0.28);
  color: #172334;
}

.s3-assistant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 17px;
  border-bottom: 1px solid #e4eaf1;
  background: #f8fafd;
}

.s3-assistant-heading {
  min-width: 0;
}

.s3-assistant-heading strong,
.s3-assistant-heading span {
  display: block;
}

.s3-assistant-heading strong {
  font-size: 15px;
}

.s3-assistant-heading span,
.s3-assistant-status,
.s3-assistant-footnote {
  color: #637187;
  font-size: 11px;
}

.s3-assistant-status {
  margin-top: 3px;
}

.s3-assistant-header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.s3-assistant-icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid #d8e0eb;
  border-radius: 9px;
  background: #fff;
  color: #33445a;
  font: inherit;
  cursor: pointer;
}

.s3-assistant-icon-button:disabled {
  opacity: 0.45;
  cursor: default;
}

.s3-assistant-log {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  padding: 16px;
  background: #fff;
}

.s3-assistant-message {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.s3-assistant-message-assistant {
  align-self: flex-start;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 5px;
  background: #f5f8fc;
}

.s3-assistant-message-list {
  margin: 0.25em 0;
  padding-left: 1.35em;
}

.s3-assistant-message-list li + li {
  margin-top: 0.15em;
}
.s3-assistant-message-user {
  align-self: flex-end;
  border-bottom-right-radius: 5px;
  background: #e6f0ff;
  color: #193d68;
}

.s3-assistant-message-notice {
  align-self: flex-start;
  color: #637187;
  font-size: 12px;
}

.s3-assistant-action {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px;
  border: 1px solid #d8e0eb;
  border-radius: 13px;
  background: #fff;
  color: #26364b;
  font-size: 12px;
}

.s3-assistant-action p {
  margin: 0;
  line-height: 1.45;
}

.s3-assistant-action code {
  padding: 6px 8px;
  border-radius: 7px;
  background: #f2f5f9;
  color: #274a76;
  overflow-wrap: anywhere;
}

.s3-assistant-action pre {
  max-height: 118px;
  margin: 0;
  overflow: auto;
  padding: 8px;
  border-radius: 7px;
  background: #f5f7fa;
  font: 10px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.s3-assistant-action label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: #40516a;
  font-size: 11px;
}

.s3-assistant-action input {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #172334;
  font: inherit;
}

.s3-assistant-action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}

.s3-assistant-action-buttons button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #d8e0eb;
  border-radius: 8px;
  background: #fff;
  color: #33445a;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.s3-assistant-action-buttons .s3-assistant-confirm {
  border-color: #174c91;
  background: #174c91;
  color: #fff;
}

.s3-assistant-action-buttons button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.s3-assistant-form-error {
  color: #b42318;
  font-size: 12px;
}

.s3-assistant-form {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 12px 14px 8px;
  border-top: 1px solid #e4eaf1;
  background: #fff;
}

.s3-assistant-form textarea {
  width: 100%;
  min-height: 62px;
  max-height: 135px;
  resize: vertical;
  padding: 10px 11px;
  border: 1px solid #d1dae5;
  border-radius: 11px;
  outline: none;
  color: #172334;
  font: inherit;
  font-size: 13px;
}

.s3-assistant-form textarea:focus {
  border-color: #5b89c4;
  box-shadow: 0 0 0 3px rgba(50, 112, 184, 0.12);
}

.s3-assistant-form textarea:disabled {
  background: #f5f7fa;
}

.s3-assistant-send {
  align-self: flex-end;
  min-height: 35px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: #000;
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.s3-assistant-send:hover:not(:disabled) {
  background: #222;
}

.s3-assistant-send:disabled {
  opacity: 0.5;
  cursor: default;
}

.s3-assistant-footnote {
  margin: 0;
  padding: 0 14px 11px;
  background: #fff;
  line-height: 1.35;
}

@media (max-width: 600px) {
  .s3-assistant {
    right: 12px;
    bottom: 12px;
  }

  .s3-assistant-toggle {
    min-height: 50px;
    padding: 0 15px;
  }

  .s3-assistant-panel {
    right: 0;
    bottom: 62px;
    width: calc(100vw - 24px);
    height: min(72dvh, 700px);
    min-height: 340px;
  }

  .s3-assistant-log {
    padding: 12px;
  }
}
.s3-assistant-feedback {
  align-self: flex-start;
  width: min(92%, 440px);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -5px;
  color: #718096;
  font-size: 11px;
}

.s3-assistant-feedback-buttons,
.s3-assistant-feedback-reasons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.s3-assistant-feedback button {
  min-height: 26px;
  padding: 3px 7px;
  border: 1px solid #dbe3ed;
  border-radius: 8px;
  background: #fff;
  color: #42546c;
  font: inherit;
  cursor: pointer;
}

.s3-assistant-feedback button:hover:not(:disabled) {
  border-color: #8aa8ce;
  background: #f5f8fc;
}

.s3-assistant-feedback button:disabled {
  opacity: 0.55;
  cursor: default;
}

.s3-assistant-feedback-question {
  flex: 1 0 100%;
}

.s3-assistant-feedback-error {
  color: #a12626;
}

.s3-assistant-loading {
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 9px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f5f8fc;
  color: #4b5d73;
  font-size: 12px;
}

.s3-assistant-loading-spinner {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 2px solid #cbd8e8;
  border-top-color: #174c91;
  border-radius: 50%;
  animation: s3-assistant-spin 0.8s linear infinite;
}

@keyframes s3-assistant-spin {
  to { transform: rotate(360deg); }
}

.s3-assistant-cancel-request {
  min-height: 29px;
  margin-left: 3px;
  padding: 0 9px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #33445a;
  font: inherit;
  cursor: pointer;
}

.s3-assistant-cancel-request:hover:not(:disabled) {
  border-color: #8aa8ce;
  background: #edf4fc;
}

.s3-assistant-cancel-request:disabled {
  opacity: 0.65;
  cursor: wait;
}

.s3-assistant-feedback-buttons button {
  min-width: 32px;
  min-height: 32px;
  font-size: 17px;
  line-height: 1;
}

.s3-assistant-feedback-buttons button {
  display: grid;
  place-items: center;
  border-color: #ddd;
  color: #000;
}

.s3-assistant-feedback-buttons button:hover:not(:disabled) {
  border-color: #000;
  background: #f0f0f0;
}

.s3-assistant-feedback-buttons img {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .s3-assistant-loading-spinner {
    animation: none;
  }
}
