:root {
  --sidebar-bg: #edf5f7;
  --page-bg: #eef5f7;
  --content-bg: #f8fbfc;
  --border: #d8e4e8;
  --text-main: #1f2933;
  --text-muted: #6a6b74;
  --text-soft: #7f6b58;
  --link: #0f5f70;
  --link-hover: #0b4855;
  --accent: #bf6d47;
  --accent-soft: #edf5f7;
  --teal-soft: #dbeceb;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius-card: 18px;
  --radius-pill: 999px;
  --font-main: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(219, 236, 235, 0.72), transparent 30%),
    linear-gradient(180deg, #f7fbfc 0%, var(--page-bg) 100%);
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 270px;
  background: linear-gradient(180deg, rgba(248, 251, 252, 0.96), rgba(237, 245, 247, 0.96));
  border-right: 1px solid var(--border);
  display: flex;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.sidebar-inner {
  max-width: 220px;
}

.avatar {
  text-align: center;
  margin-bottom: 1.5rem;
}

.avatar-circle {
  width: 160px;
  height: 160px;
  margin: 0 auto;
  border-radius: 50%;
  background: #d4d4d8;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 4px solid rgba(255, 255, 255, 0.9);
}

.avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.name {
  margin: 1rem 0 0.3rem 0;
  font-family: var(--font-display);
  font-size: 1.7rem;
  line-height: 1.1;
  text-align: center;
}

.headline {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.6;
}

.degree {
  margin: 0.7rem 0 1.1rem 0;
  font-size: 0.86rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.6;
}

.meta {
  list-style: none;
  padding: 0;
  margin: 0 0 1.2rem 0;
  font-size: 0.9rem;
}

.meta li {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.55rem;
  color: var(--text-main);
}

.icon {
  width: 1.8rem;
  flex-shrink: 0;
}

.icon svg {
  stroke: var(--accent);
}

.nav-block {
  margin-top: 1rem;
}

.nav-title {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-soft);
  margin-bottom: 0.45rem;
  font-weight: 700;
}

.sidebar-links {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem 0;
  font-size: 0.92rem;
}

.sidebar-links li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.45rem;
}

.chip-icon {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-soft), var(--teal-soft));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #5b4637;
  flex-shrink: 0;
  font-weight: 700;
}

.sidebar a,
a {
  color: var(--link);
  text-decoration: none;
}

.sidebar a:hover,
a:hover {
  color: var(--link-hover);
}

.main-column {
  flex: 1;
  padding: 2rem 2.5rem;
  background: transparent;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.topbar-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar-name {
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-display);
}

.topbar-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hamburger {
  border: none;
  background: var(--content-bg);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0;
  cursor: pointer;
}

.hamburger span {
  width: 18px;
  height: 2px;
  background: #111827;
  border-radius: 999px;
  display: block;
  margin: 0;
}

.hamburger-menu {
  position: absolute;
  right: 2.5rem;
  top: 4.1rem;
  background: var(--content-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.4rem 0;
  box-shadow: var(--shadow);
  display: none;
  min-width: 150px;
  z-index: 10;
}

.hamburger-menu.open {
  display: block;
}

.hamburger-menu a {
  display: block;
  padding: 0.35rem 0.9rem;
  font-size: 0.9rem;
  color: var(--text-main);
  text-decoration: none;
}

.hamburger-menu a:hover {
  background: var(--sidebar-bg);
  color: var(--link);
}

.content {
  background: rgba(248, 251, 252, 0.94);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 1.8rem 2.1rem 1.4rem 2.1rem;
}

.section {
  margin-bottom: 1.8rem;
  scroll-margin-top: 1.25rem;
}

.section h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
  font-family: var(--font-display);
}

.section p {
  margin-top: 0;
  line-height: 1.72;
  color: var(--text-main);
}

.section ul {
  margin-top: 0.6rem;
  padding-left: 1.2rem;
}

#summary-body p:first-child {
  font-size: 1.02rem;
}

#research-list {
  list-style: disc;
  display: block;
  padding-left: 1.35rem;
}

#research-list li {
  margin-bottom: 0.7rem;
  line-height: 1.7;
  color: var(--text-main);
}

.project {
  position: relative;
  margin-bottom: 1.2rem;
  padding: 1rem 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--content-bg), var(--sidebar-bg));
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.project:last-of-type {
  margin-bottom: 0;
}

.project h3 {
  margin: 0 0 0.4rem 0;
  padding-right: 5.2rem;
  font-size: 1.02rem;
}

.project h3 a {
  text-decoration: none;
}

.home-project-stack {
  margin-top: 0.55rem;
}

.home-project-stack .stack,
.stack.compact-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
}

.stack-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 1.85rem;
  max-width: 100%;
  padding: 0.28rem 0.62rem 0.28rem 0.42rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text-soft);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}

.stack-badge img,
.stack-fallback {
  width: 1rem;
  height: 1rem;
  flex: 0 0 1rem;
}

.stack-badge img {
  display: block;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(31%) sepia(71%) saturate(631%) hue-rotate(145deg) brightness(86%) contrast(91%);
}

.stack-fallback {
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(15, 95, 112, 0.12);
  color: var(--link);
  font-size: 0.58rem;
  font-weight: 900;
}

.project-actions {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: inline-flex;
  gap: 0.4rem;
}

.project-action {
  display: inline-grid;
  place-items: center;
  width: 1.95rem;
  height: 1.95rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--link);
  font-size: 0.72rem;
  font-weight: 900;
  text-decoration: none;
}

#contact-body p:first-child {
  margin-bottom: 1rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--content-bg), var(--sidebar-bg));
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  color: var(--text-main);
}

.contact-card:hover {
  color: var(--link-hover);
}

.contact-redirect-card {
  margin-top: 1.2rem;
  min-height: 132px;
  padding: 1.35rem;
}

.contact-redirect-card .contact-icon {
  width: 3.2rem;
  height: 3.2rem;
  font-size: 1.15rem;
}

.contact-redirect-card .contact-card-text strong {
  font-size: 1.35rem;
}

.contact-redirect-card .contact-card-text span {
  font-size: 0.98rem;
}

.contact-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-soft), var(--teal-soft));
  color: #23404b;
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
}

.contact-card-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.contact-card-text strong {
  font-size: 0.95rem;
  color: var(--text-main);
}

.contact-card-text span {
  font-size: 0.84rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.footer {
  margin-top: 1.4rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
  font-size: 0.86rem;
  color: var(--text-muted);
}

@media (max-width: 880px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1.5rem 1.25rem;
  }

  .sidebar-inner {
    max-width: none;
  }

  .avatar-circle {
    width: 130px;
    height: 130px;
  }

  .main-column {
    padding: 1.5rem 1.25rem 2rem 1.25rem;
  }

  .hamburger-menu {
    right: 1.25rem;
  }

  body.pepper-mobile-open {
    overflow: hidden;
  }

  .chat-card {
    height: 360px;
  }

  .chat-card.is-mobile-fullscreen {
    position: fixed;
    top: var(--viewport-offset-top, 0);
    left: var(--viewport-offset-left, 0);
    right: auto;
    width: var(--viewport-width, 100vw);
    max-width: var(--viewport-width, 100vw);
    height: var(--viewport-height, 100vh);
    margin-top: 0;
    border-radius: 0;
    border: none;
    z-index: 1000;
    background: #f9fafb;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .chat-card.is-mobile-fullscreen .chat-header {
    padding-top: max(0.9rem, env(safe-area-inset-top));
    position: sticky;
    top: 0;
    z-index: 2;
  }

  .chat-card.is-mobile-fullscreen .chat-messages {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
  }

  .chat-card.is-mobile-fullscreen .chat-input-row {
    position: sticky;
    bottom: 0;
    z-index: 2;
    align-items: center;
    padding-bottom: max(0.7rem, env(safe-area-inset-bottom));
  }

  .chat-card.is-mobile-fullscreen .chat-input-row textarea {
    min-height: 44px;
    font-size: 16px;
  }

  .chat-card.is-mobile-fullscreen .chat-mobile-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .chat-voice-actions {
    gap: 0.35rem;
  }

  .chat-voice-button {
    padding: 0;
    font-size: 0;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.chat-card {
  margin-top: 1rem;
  width: 100%;
  max-width: 100%;
  height: 420px;
  border-radius: 16px;
  border: 1px solid #e2e4ea;
  background: #f9fafb;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid #e2e4ea;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #ffffff;
  cursor: pointer;
}

.chat-title-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.chat-voice-actions {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.24rem;
  min-width: 64px;
  justify-content: flex-end;
}

.chat-action-cluster {
  display: flex;
  align-items: flex-end;
  gap: 0.38rem;
}

.chat-action-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.24rem;
  justify-content: flex-start;
}

.chat-action-stack:first-child {
  margin-left: 0.18rem;
}

.chat-voice-button {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.14);
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.chat-voice-button:disabled {
  opacity: 0.42;
  cursor: default;
  box-shadow: none;
}

.chat-voice-button:not(:disabled):hover {
  transform: translateY(-1px);
}

.chat-voice-button::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.08) 34%, transparent 56%);
  opacity: 0.55;
  pointer-events: none;
}

.chat-voice-button::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.chat-voice-button-call {
  background: linear-gradient(180deg, #d9b08d 0%, #bf6d47 100%);
  color: #ffffff;
}

.chat-voice-button-call::after {
  background: radial-gradient(circle, rgba(191, 109, 71, 0.22), transparent 68%);
}

.chat-voice-button-call.is-listening {
  background: linear-gradient(180deg, #d8c5a8 0%, #8a6a52 100%);
  box-shadow: 0 0 0 3px rgba(191, 109, 71, 0.14), 0 4px 14px rgba(15, 23, 42, 0.16);
}

.chat-voice-button-call.is-listening::after {
  opacity: 1;
  transform: scale(1.18);
}

.chat-voice-button-end {
  background: linear-gradient(180deg, #f87171 0%, #b91c1c 100%);
  color: #ffffff;
}

.chat-voice-button-end::after {
  background: radial-gradient(circle, rgba(239, 68, 68, 0.2), transparent 68%);
}

.chat-contact-button {
  background: linear-gradient(180deg, #dbeceb 0%, #0f5f70 100%);
  color: #ffffff;
}

.chat-contact-button::after {
  background: radial-gradient(circle, rgba(15, 95, 112, 0.2), transparent 68%);
}

.chat-assistant-button {
  background: linear-gradient(180deg, #60a5fa 0%, #1d4ed8 100%);
  color: #ffffff;
}

.chat-assistant-button::after {
  background: radial-gradient(circle, rgba(59, 130, 246, 0.2), transparent 68%);
}

.chat-voice-button.is-disabled-mode {
  opacity: 0.65;
}

.chat-voice-core {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  text-shadow: none;
}

.chat-voice-svg {
  width: 12px;
  height: 12px;
  line-height: 1;
  filter: none;
}

.chat-voice-beta {
  font-size: 0.56rem;
  letter-spacing: 0.03em;
  color: #64748b;
  line-height: 1.05;
  white-space: normal;
  min-height: 1.45rem;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: center;
}

.chat-voice-label,
.chat-mode-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.08rem;
  justify-content: flex-start;
}

.chat-voice-label,
.chat-mode-label {
  width: 58px;
}

.chat-voice-label span,
.chat-mode-label span {
  display: block;
}

.chat-voice-label span:first-child,
.chat-mode-label span:first-child {
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0;
}

.chat-voice-label span:nth-child(2) {
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0;
}

.chat-voice-label span:last-child,
.chat-mode-label span:last-child {
  font-size: 0.5rem;
  letter-spacing: 0.02em;
}

.chat-orb {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #e0f2fe, #2563eb);
  box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.18);
  flex-shrink: 0;
  position: relative;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.chat-orb::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.24);
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 180ms ease, transform 180ms ease, border-color 180ms ease;
}

.chat-title-main {
  font-size: 0.9rem;
  font-weight: 600;
}

.chat-title-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-height: 1em;
  letter-spacing: 0.01em;
  transition: color 180ms ease;
}

.chat-title-sub[data-state="connecting"] { color: #475569; }
.chat-title-sub[data-state="available"],
.chat-title-sub[data-state="ready"] { color: #1f2937; }
.chat-title-sub[data-state="processing"] { color: #111827; }
.chat-title-sub[data-state="error"] { color: #991b1b; }
.chat-title-sub[data-state="handoff"] { color: #1f2937; }
.chat-title-sub[data-state="relay"] { color: #a16207; }
.chat-title-sub[data-state="checking"] { color: #166534; }

.chat-mobile-close {
  border: 1px solid var(--border);
  background: #ffffff;
  color: #374151;
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.76rem;
  cursor: pointer;
  display: none;
}

.chat-messages {
  flex: 1;
  padding: 0.8rem 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: #f9fafb;
}

.message-row {
  display: flex;
  width: 100%;
}

.message-row.assistant { justify-content: flex-start; }
.message-row.user { justify-content: flex-end; }
.message-row.event { justify-content: center; }

.message-bubble {
  max-width: 72%;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  line-height: 1.4;
  border-radius: 16px;
  position: relative;
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
}

.message-bubble.assistant {
  background: #e5e7eb;
  color: #111827;
  border-bottom-left-radius: 4px;
}

.message-bubble.user {
  background: #dbeafe;
  color: #0f172a;
  border-bottom-right-radius: 4px;
}

.message-event {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  color: #64748b;
  font-size: 0.72rem;
  line-height: 1.2;
  text-align: center;
  max-width: 82%;
}

.message-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  align-self: flex-end;
}

.message-ticks {
  display: inline-flex;
  align-items: center;
  gap: 0.08rem;
}

.message-tick {
  color: #9ca3af;
  opacity: 0.95;
  transition: color 180ms ease, opacity 180ms ease;
}

.message-tick.is-active { color: #86efac; }
.message-tick.is-error { color: #dc2626; }
.message-status-label { color: var(--text-muted); }
.message-meta[data-status="processing"] .message-status-label { color: #374151; }
.message-meta[data-status="responded"] .message-status-label { color: #166534; }
.message-meta[data-status="error"] .message-status-label { color: #b91c1c; }

.chat-input-row {
  border-top: 1px solid var(--border);
  background: #ffffff;
  padding: 0.55rem 0.7rem;
  display: flex;
  gap: 0.6rem;
  align-items: flex-end;
}

.chat-input-row textarea {
  flex: 1;
  resize: none;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.45rem 0.75rem;
  font-family: var(--font-main);
  font-size: 0.9rem;
  min-height: 40px;
  max-height: 80px;
  outline: none;
  background: #f9fafb;
}

@media (max-width: 880px) {
  .chat-input-row textarea {
    font-size: 16px;
  }
}

.chat-input-row textarea:focus {
  border-color: var(--link);
  background: #ffffff;
}

.chat-input-row button {
  border: none;
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.45);
}

.chat-input-row button:disabled {
  opacity: 0.6;
  cursor: default;
  box-shadow: none;
}

.chat-orb.state-connecting {
  background: radial-gradient(circle at 30% 30%, #f0f9ff, #3b82f6);
  animation: orb-connect 1.3s ease-in-out infinite;
}

.chat-orb.state-connecting::after {
  opacity: 1;
  border-color: rgba(59, 130, 246, 0.35);
}

.chat-orb.state-idle {
  opacity: 1;
  background: radial-gradient(circle at 30% 30%, #ffffff, #2563eb);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.chat-orb.state-idle::after {
  opacity: 1;
  transform: scale(1);
}

.chat-orb.state-typing {
  background: radial-gradient(circle at 30% 30%, #eff6ff, #1d4ed8);
  animation: orb-processing 0.9s linear infinite;
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.14);
}

.chat-orb.state-typing::after {
  opacity: 1;
  border-color: rgba(37, 99, 235, 0.38);
  animation: orb-ring 1.2s ease-out infinite;
}

.chat-orb.state-ready {
  background: radial-gradient(circle at 30% 30%, #ffffff, #2563eb);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
  animation: orb-ready 1.8s ease-in-out infinite;
}

.chat-orb.state-ready::after {
  opacity: 1;
  border-color: rgba(37, 99, 235, 0.28);
  transform: scale(1.08);
}

.chat-orb.state-error {
  background: radial-gradient(circle at 30% 30%, #fef2f2, #b91c1c);
  box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.1);
}

.chat-orb.state-error::after {
  opacity: 1;
  border-color: rgba(185, 28, 28, 0.28);
}

.chat-orb.state-handoff {
  background: radial-gradient(circle at 30% 30%, #f0fdf4, #22c55e);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.12);
  animation: orb-handoff 1.5s ease-in-out infinite;
}

.chat-orb.state-handoff::after {
  opacity: 1;
  border-color: rgba(34, 197, 94, 0.32);
  transform: scale(1.08);
}

.chat-orb.state-relay {
  background: radial-gradient(circle at 30% 30%, #fefce8, #eab308);
  box-shadow: 0 0 0 4px rgba(234, 179, 8, 0.08);
  animation: orb-relay 1.7s ease-in-out infinite;
}

.chat-orb.state-relay::after {
  opacity: 1;
  border-color: rgba(234, 179, 8, 0.24);
  transform: scale(1.03);
}

.chat-orb.state-checking {
  background: radial-gradient(circle at 30% 30%, #ecfdf5, #16a34a);
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.08);
  animation: orb-checking 1.6s ease-in-out infinite;
}

.chat-orb.state-checking::after {
  opacity: 1;
  border-color: rgba(34, 197, 94, 0.24);
  transform: scale(1.05);
}

@keyframes orb-connect {
  0%   { transform: scale(1); opacity: 0.8; }
  50%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}

@keyframes orb-processing {
  0%   { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(180deg) scale(1.12); }
  100% { transform: rotate(360deg) scale(1); }
}

@keyframes orb-ring {
  0%   { transform: scale(0.9); opacity: 0.75; }
  70%  { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}

@keyframes orb-ready {
  0%   { transform: scale(1); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08); }
  50%  { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.18); }
  100% { transform: scale(1); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08); }
}

@keyframes orb-handoff {
  0%   { transform: scale(1); box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.08); }
  50%  { transform: scale(1.08); box-shadow: 0 0 0 7px rgba(34, 197, 94, 0.18); }
  100% { transform: scale(1); box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.08); }
}

@keyframes orb-relay {
  0%   { transform: scale(1); box-shadow: 0 0 0 4px rgba(234, 179, 8, 0.06); }
  50%  { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(234, 179, 8, 0.14); }
  100% { transform: scale(1); box-shadow: 0 0 0 4px rgba(234, 179, 8, 0.06); }
}

@keyframes orb-checking {
  0%   { transform: scale(1); box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.06); }
  50%  { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.14); }
  100% { transform: scale(1); box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.06); }
}
