:root {
  --assistant-accent: #0f6cbd;
  --assistant-accent-strong: #0b4f8f;
  --assistant-accent-soft: rgba(15, 108, 189, 0.12);
  --assistant-panel-bg: rgba(248, 252, 255, 0.84);
  --assistant-line: rgba(15, 23, 42, 0.07);
  --assistant-text: #0f172a;
  --assistant-muted: #5e7088;
  --assistant-shadow: 0 28px 80px rgba(15, 23, 42, 0.18);
  --assistant-panel-glow:
    radial-gradient(circle at 12% 14%, rgba(59, 130, 246, 0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(103, 232, 249, 0.2), transparent 26%);
}

@keyframes assistantBubbleIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes assistantFabFloat {
  0% {
    transform: translateY(0);
    box-shadow: 0 22px 40px rgba(15, 108, 189, 0.18);
  }

  50% {
    transform: translateY(-4px);
    box-shadow: 0 28px 52px rgba(15, 108, 189, 0.24);
  }

  100% {
    transform: translateY(0);
    box-shadow: 0 22px 40px rgba(15, 108, 189, 0.18);
  }
}

.assistant-layer {
  position: fixed;
  right: 22px;
  bottom: 20px;
  z-index: 90;
  display: grid;
  justify-items: end;
  gap: 14px;
}

.assistant-nudge {
  max-width: min(330px, calc(100vw - 40px));
  padding: 15px 17px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: linear-gradient(180deg, rgba(14, 23, 42, 0.94), rgba(28, 45, 80, 0.92));
  color: #fff;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(16px);
  animation: assistantBubbleIn 180ms ease-out;
}

.assistant-nudge strong,
.assistant-nudge p {
  margin: 0;
}

.assistant-nudge strong {
  font-size: 0.84rem;
  letter-spacing: 0.04em;
}

.assistant-nudge p {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.88rem;
  line-height: 1.48;
}

.assistant-fab {
  position: relative;
  width: 84px;
  height: 94px;
  padding: 0;
  border: 0;
  border-radius: 30px;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.82), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(225, 240, 255, 0.82));
  box-shadow:
    0 22px 40px rgba(15, 108, 189, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(16px);
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  animation: assistantFabFloat 2.6s ease-in-out infinite;
}

.assistant-fab::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.72);
}

.assistant-fab-character {
  position: relative;
  width: 48px;
  height: 52px;
  display: block;
}

.assistant-fab-head,
.assistant-fab-body,
.assistant-fab-glow {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.assistant-fab-head {
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.98), transparent 18%),
    linear-gradient(180deg, #76ddff, #3aaaff 58%, #0f6cbd);
  box-shadow: 0 10px 18px rgba(15, 108, 189, 0.24);
}

.assistant-fab-head::before,
.assistant-fab-head::after {
  content: "";
  position: absolute;
  top: 11px;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #08375d;
}

.assistant-fab-head::before {
  left: 8px;
}

.assistant-fab-head::after {
  right: 8px;
}

.assistant-fab-body {
  top: 22px;
  width: 34px;
  height: 24px;
  border-radius: 14px 14px 18px 18px;
  background: linear-gradient(180deg, #fefeff, #d9efff 56%, #b8ddff);
  box-shadow: inset 0 -2px 0 rgba(15, 108, 189, 0.1);
}

.assistant-fab-body::before,
.assistant-fab-body::after {
  content: "";
  position: absolute;
  top: 4px;
  width: 8px;
  height: 16px;
  border-radius: 999px;
  background: #d4ecff;
}

.assistant-fab-body::before {
  left: -5px;
  transform: rotate(26deg);
}

.assistant-fab-body::after {
  right: -5px;
  transform: rotate(-26deg);
}

.assistant-fab-glow {
  top: 9px;
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.28), transparent 68%);
  z-index: -1;
}

.assistant-fab-label {
  position: relative;
  color: var(--assistant-accent-strong);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.assistant-fab-count {
  position: absolute;
  right: -4px;
  top: -4px;
  min-width: 22px;
  min-height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #22c55e, #16a34a);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 18px rgba(22, 163, 74, 0.26);
}

.assistant-backdrop {
  position: fixed;
  inset: 0;
  z-index: 88;
  background: rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(8px);
}

.assistant-panel {
  position: fixed;
  right: 26px;
  bottom: 124px;
  z-index: 89;
  width: min(430px, calc(100vw - 24px));
  max-height: min(760px, calc(100vh - 148px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  background:
    var(--assistant-panel-glow),
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(245, 250, 255, 0.88));
  box-shadow: var(--assistant-shadow);
  backdrop-filter: blur(20px);
  animation: assistantBubbleIn 180ms ease-out;
  font-family: "Avenir Next", "PingFang SC", "Noto Sans SC", sans-serif;
}

.assistant-panel-header,
.assistant-panel-body,
.assistant-panel-footer {
  padding: 18px 18px 0;
}

.assistant-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-top: 22px;
}

.assistant-header-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.assistant-header-avatar {
  position: relative;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.76), transparent 24%),
    linear-gradient(180deg, #eff8ff, #d7eeff 58%, #c5e4ff);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 14px 24px rgba(15, 108, 189, 0.14);
}

.assistant-header-avatar-head,
.assistant-header-avatar-body {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.assistant-header-avatar-head {
  top: 8px;
  width: 19px;
  height: 19px;
  border-radius: 999px;
  background: linear-gradient(180deg, #70dcff, #339fff 58%, #0f6cbd);
}

.assistant-header-avatar-body {
  top: 24px;
  width: 24px;
  height: 16px;
  border-radius: 12px 12px 14px 14px;
  background: linear-gradient(180deg, #ffffff, #dbeeff);
}

.assistant-header-copy {
  min-width: 0;
}

.assistant-header-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15, 108, 189, 0.1);
  color: var(--assistant-accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.assistant-panel-header h2,
.assistant-panel-header p,
.assistant-section-title,
.assistant-message p,
.assistant-message h4 {
  margin: 0;
}

.assistant-panel-header h2 {
  margin-top: 8px;
  font-size: 1.32rem;
  color: var(--assistant-text);
}

.assistant-panel-header p {
  margin-top: 4px;
  color: var(--assistant-muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.assistant-close {
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.7);
  color: var(--assistant-muted);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

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

.assistant-notification-button {
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid rgba(15, 108, 189, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--assistant-accent-strong);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.assistant-notification-button.is-enabled {
  border-color: rgba(22, 163, 74, 0.18);
  background: rgba(220, 252, 231, 0.86);
  color: #15803d;
}

.assistant-notification-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.assistant-summary {
  margin: 14px 18px 0;
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(15, 108, 189, 0.08), rgba(56, 189, 248, 0.12));
  border: 1px solid rgba(15, 108, 189, 0.12);
}

.assistant-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.assistant-summary-card {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
}

.assistant-summary-card span,
.assistant-chip-label {
  display: block;
  color: var(--assistant-muted);
  font-size: 0.76rem;
}

.assistant-summary-card strong {
  display: block;
  margin-top: 6px;
  color: var(--assistant-text);
  font-size: 1.05rem;
}

.assistant-panel-body {
  overflow: auto;
  padding-top: 14px;
  padding-bottom: 10px;
}

.assistant-section + .assistant-section {
  margin-top: 14px;
}

.assistant-section-title {
  margin-bottom: 12px;
  color: var(--assistant-accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.assistant-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.assistant-chip,
.assistant-send {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 0;
}

.assistant-chip {
  background: rgba(255, 255, 255, 0.88);
  color: var(--assistant-accent);
  font-weight: 700;
  border: 1px solid rgba(15, 108, 189, 0.1);
  box-shadow: 0 10px 22px rgba(15, 108, 189, 0.08);
}

.assistant-reminders,
.assistant-messages {
  display: grid;
  gap: 12px;
}

.assistant-reminder,
.assistant-message {
  padding: 0;
  border: 0;
  background: transparent;
}

.assistant-reminder {
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(245, 158, 11, 0.18);
  background: linear-gradient(180deg, rgba(255, 251, 235, 0.92), rgba(255, 246, 214, 0.76));
}

.assistant-message-shell {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.assistant-message-bubble {
  flex: 1;
  padding: 14px 15px;
  border-radius: 22px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 16px 28px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(16px);
}

.assistant-message-avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.assistant-message-avatar-bot {
  background: linear-gradient(180deg, #e6f6ff, #cdeaff);
  color: var(--assistant-accent);
  box-shadow: 0 10px 20px rgba(15, 108, 189, 0.12);
}

.assistant-message-avatar-user {
  background: linear-gradient(180deg, #eff3f8, #dfe6ee);
  color: #445468;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.assistant-message-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.assistant-reminder p,
.assistant-message p {
  color: var(--assistant-text);
  line-height: 1.58;
}

.assistant-message p {
  margin: 0;
}

.assistant-message.assistant-message-user {
  margin-left: 34px;
}

.assistant-message.assistant-message-bot {
  margin-right: 18px;
}

.assistant-message.assistant-message-user .assistant-message-shell {
  flex-direction: row-reverse;
}

.assistant-message.assistant-message-bot .assistant-message-bubble {
  border-top-left-radius: 12px;
}

.assistant-message.assistant-message-user .assistant-message-bubble {
  border-top-right-radius: 12px;
  background: linear-gradient(180deg, rgba(232, 244, 255, 0.94), rgba(214, 236, 255, 0.84));
  border-color: rgba(15, 108, 189, 0.12);
}

.assistant-message.assistant-message-success .assistant-message-bubble {
  border-color: rgba(16, 185, 129, 0.24);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(236, 253, 245, 0.92));
}

.assistant-message.assistant-message-warning .assistant-message-bubble {
  border-color: rgba(245, 158, 11, 0.24);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(255, 251, 235, 0.94));
}

.assistant-message.assistant-message-error .assistant-message-bubble {
  border-color: rgba(239, 68, 68, 0.24);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(254, 242, 242, 0.94));
}

.assistant-message.assistant-message-pending .assistant-message-bubble {
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow:
    inset 0 0 0 1px rgba(37, 99, 235, 0.04),
    0 16px 28px rgba(15, 23, 42, 0.08);
}

.assistant-message h4 {
  color: var(--assistant-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.assistant-message-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.assistant-message-badge-pending {
  background: rgba(37, 99, 235, 0.12);
  color: #1d4ed8;
}

.assistant-message-badge-success {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
}

.assistant-message-badge-warning {
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
}

.assistant-message-badge-error {
  background: rgba(239, 68, 68, 0.14);
  color: #b91c1c;
}

.assistant-message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.assistant-message-action {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 0;
  font-weight: 700;
}

.assistant-message-action-primary {
  background: linear-gradient(135deg, #0f6cbd, #36b3ff);
  color: #fff;
  box-shadow: 0 12px 22px rgba(15, 108, 189, 0.18);
}

.assistant-message-action-secondary {
  background: rgba(15, 23, 42, 0.08);
  color: var(--assistant-text);
}

.assistant-panel-footer {
  padding-bottom: 18px;
}

.assistant-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.08);
}

.assistant-input {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.92);
  color: var(--assistant-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.assistant-send {
  min-width: 84px;
  background: linear-gradient(135deg, #0f6cbd, #36b3ff);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(15, 108, 189, 0.22);
}

.assistant-empty {
  padding: 18px;
  border-radius: 20px;
  border: 1px dashed rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.52);
  color: var(--assistant-muted);
  text-align: center;
}

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

  .assistant-panel {
    right: 10px;
    left: 10px;
    bottom: 96px;
    width: auto;
    max-height: min(80vh, calc(100vh - 108px));
    border-radius: 26px;
  }

  .assistant-summary-grid {
    grid-template-columns: 1fr;
  }

  .assistant-form {
    grid-template-columns: 1fr;
  }

  .assistant-send {
    width: 100%;
  }

  .assistant-nudge {
    max-width: min(300px, calc(100vw - 28px));
  }

  .assistant-fab {
    width: 74px;
    height: 84px;
    border-radius: 26px;
  }

  .assistant-fab-label {
    font-size: 0.66rem;
  }

  .assistant-header-avatar {
    width: 48px;
    height: 48px;
  }
}
