.page-assistant {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  font-family: inherit;
}

.page-assistant-bubble {
  width: 58px;
  height: 58px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.28);
  cursor: pointer;
  font-weight: 800;
}

.page-assistant-bubble:hover {
  background: var(--accent-strong);
}

.page-assistant-panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(420px, calc(100vw - 28px));
  height: min(620px, calc(100vh - 116px));
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(16, 24, 32, 0.18);
}

.page-assistant-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.page-assistant-header strong {
  display: block;
  font-size: 14px;
}

.page-assistant-header span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.page-assistant-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.page-assistant-reset {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.page-assistant-reset:hover {
  background: var(--surface-muted);
}

.page-assistant-close {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.page-assistant-close:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.page-assistant-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 14px;
  overflow-y: auto;
  background: #f8fafb;
}

.page-assistant-message {
  width: auto;
  max-width: 92%;
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.page-assistant-message.assistant {
  align-self: flex-start;
  border: 1px solid var(--border);
  background: var(--surface);
}

.page-assistant-message.user {
  align-self: flex-end;
  max-width: 86%;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
}

.page-assistant-status {
  align-self: center;
  max-width: 90%;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.page-assistant-input {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.page-assistant-input textarea {
  flex: 1;
  min-height: 42px;
  max-height: 120px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  resize: vertical;
}

.page-assistant-input .primary-button {
  min-height: 42px;
}

.page-assistant-input .page-assistant-stop {
  min-height: 42px;
  color: #b42318;
}

@media (max-width: 680px) {
  .page-assistant {
    right: 14px;
    bottom: 14px;
  }

  .page-assistant-panel {
    right: -6px;
    width: calc(100vw - 28px);
  }
}
