:root {
  color-scheme: light;
  --ink: #182326;
  --ink-soft: #617074;
  --paper: #f4f1ea;
  --paper-deep: #ebe6dd;
  --surface: #fffdf8;
  --surface-soft: #f8f5ee;
  --line: #e4ded3;
  --sidebar: #173238;
  --sidebar-soft: #234148;
  --sidebar-muted: #a8bcbd;
  --accent: #f1a65a;
  --accent-deep: #d97c37;
  --mint: #93cbbd;
  --danger: #d45c4f;
  --shadow: 0 22px 60px rgba(23, 50, 56, 0.12);
  --font-heading: "Manrope", sans-serif;
  --font-body: "DM Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  height: 100%;
  background: var(--paper);
  overflow: hidden;
}

body {
  height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 94% 2%, rgba(241, 166, 90, 0.18), transparent 28rem),
    var(--paper);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(241, 166, 90, 0.48);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

.app-shell.auth-locked {
  visibility: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 26px 20px 20px;
  color: #edf3ef;
  background:
    radial-gradient(circle at 24% 12%, rgba(147, 203, 189, 0.14), transparent 17rem),
    var(--sidebar);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px 13px 13px 4px;
  color: var(--sidebar);
  background: var(--accent);
  font: 800 22px/1 var(--font-heading);
}

.brand strong {
  display: block;
  font: 800 21px/1.1 var(--font-heading);
  letter-spacing: -0.04em;
}

.brand span {
  display: block;
  margin-top: 4px;
  color: var(--sidebar-muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.primary-nav {
  display: grid;
  gap: 7px;
  margin: 38px 0 30px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 13px;
  color: #cbd8d7;
  background: transparent;
  text-align: left;
  transition: background 150ms ease, color 150ms ease, transform 150ms ease;
}

.nav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
  transform: translateX(2px);
}

.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
}

.nav-item svg,
.icon-button svg,
.button svg,
.stage-link svg,
.suggestion-chip svg,
.chat-heading svg,
.composer-note svg,
.form-footer svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.nav-dot {
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--accent);
}

.sidebar-section {
  min-height: 180px;
}

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 10px;
  color: #8da4a5;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
}

.icon-button:hover {
  background: var(--surface-soft);
}

.icon-button.subtle {
  border-color: transparent;
  color: inherit;
  background: transparent;
}

.sidebar .icon-button.subtle {
  color: var(--sidebar-muted);
}

.sidebar .icon-button.subtle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.recent-list {
  display: grid;
  gap: 4px;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 52px;
  padding: 7px 9px;
  border: 0;
  border-radius: 13px;
  color: #d9e3e1;
  background: transparent;
  text-align: left;
}

.recent-item:hover,
.recent-item.active {
  background: rgba(255, 255, 255, 0.07);
}

.mini-avatar {
  display: block;
  width: 38px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 13px;
  background: #eef4f1;
  overflow: hidden;
}

.portrait-art {
  display: block;
  width: 100%;
  height: 100%;
}

.portrait-art svg {
  display: block;
  width: 100%;
  height: 100%;
}

.portrait-art svg * {
  pointer-events: none;
}

.recent-copy {
  min-width: 0;
}

.recent-copy strong {
  display: block;
  font-size: 13px;
  line-height: 1.2;
}

.recent-copy span {
  display: block;
  margin-top: 4px;
  color: #8da4a5;
  font-size: 11px;
}

.side-card {
  margin-top: auto;
  padding: 17px;
  border-radius: 20px;
  color: var(--sidebar);
  background: #f6d5a8;
}

.side-card-icon {
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 13px;
  place-items: center;
  border-radius: 11px;
  color: #f6d5a8;
  background: var(--sidebar);
}

.side-card-icon svg {
  width: 17px;
  height: 17px;
}

.side-card strong {
  font: 800 17px/1.25 var(--font-heading);
}

.side-card p {
  margin: 7px 0 14px;
  color: #5b574e;
  font-size: 12px;
  line-height: 1.5;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.button:hover {
  filter: brightness(0.97);
  transform: translateY(-1px);
}

.button-dark {
  border-color: var(--sidebar);
  color: #fff;
  background: var(--sidebar);
}

.button-light {
  width: 100%;
  border-color: rgba(23, 50, 56, 0.15);
  color: var(--sidebar);
  background: rgba(255, 255, 255, 0.54);
}

.button-large {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 14px;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 14px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.profile-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: var(--sidebar);
  background: var(--mint);
  font-size: 11px;
  font-weight: 800;
}

.profile-row strong,
.profile-row span {
  display: block;
}

.profile-row strong {
  font-size: 12px;
}

.profile-row span {
  margin-top: 2px;
  color: var(--sidebar-muted);
  font-size: 10px;
}

.profile-row .icon-button {
  margin-left: auto;
}

.profile-row .logout-button {
  display: inline-flex;
  width: auto;
  min-width: 0;
  padding: 0 10px;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
}

.logout-button svg {
  width: 15px;
  height: 15px;
}

.main-content {
  display: flex;
  height: 100dvh;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  min-height: 82px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(22px, 4vw, 56px);
  border-bottom: 1px solid rgba(228, 222, 211, 0.72);
  background: rgba(244, 241, 234, 0.86);
  backdrop-filter: blur(18px);
}

.topbar-title span,
.topbar-title strong {
  display: block;
}

.eyebrow {
  color: #7c898a;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.topbar-title strong {
  margin-top: 4px;
  font: 800 17px/1.2 var(--font-heading);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.language-control {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.72);
}

.language-control svg {
  width: 17px;
  height: 17px;
}

.language-control select {
  max-width: 112px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}

.sound-toggle {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.sound-toggle svg {
  width: 17px;
  height: 17px;
}

.sound-toggle.is-on {
  color: #2b6959;
  border-color: rgba(147, 203, 189, 0.72);
  background: rgba(147, 203, 189, 0.18);
}

.mobile-menu {
  display: none;
}

.conversation-page {
  display: flex;
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.persona-stage {
  position: sticky;
  top: 108px;
  min-height: 630px;
  padding: clamp(26px, 3.4vw, 42px);
  border-radius: 30px;
  color: #f5f7f3;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.08), transparent 45%),
    radial-gradient(circle at 92% 78%, rgba(147, 203, 189, 0.14), transparent 14rem),
    var(--sidebar);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.persona-stage::before {
  position: absolute;
  right: -80px;
  bottom: -110px;
  width: 310px;
  height: 310px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  content: "";
}

.stage-copy {
  position: relative;
  z-index: 2;
  max-width: 340px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: #c9d8d7;
  background: rgba(255, 255, 255, 0.05);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #91d6b7;
  box-shadow: 0 0 0 4px rgba(145, 214, 183, 0.12);
}

.stage-kicker {
  margin: 30px 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stage-copy h1 {
  margin: 0;
  font: 800 clamp(46px, 6vw, 76px)/0.96 var(--font-heading);
  letter-spacing: -0.065em;
}

.stage-description {
  max-width: 310px;
  margin: 18px 0 20px;
  color: #b8c7c5;
  font-size: 14px;
  line-height: 1.65;
}

.persona-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.persona-tag {
  padding: 7px 10px;
  border-radius: 999px;
  color: #d9e4e1;
  background: rgba(255, 255, 255, 0.075);
  font-size: 10px;
  font-weight: 600;
}

.stage-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 24px;
  padding: 0;
  border: 0;
  color: #f0f3ef;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.stage-link:hover {
  color: var(--accent);
}

.stage-portrait {
  position: absolute;
  right: 7%;
  bottom: 14%;
  width: 210px;
  height: 240px;
}

.portrait-avatar {
  position: absolute;
  z-index: 2;
  bottom: 10px;
  left: 50%;
  display: block;
  width: 205px;
  height: 258px;
  transform: translateX(-50%);
}

.portrait-orbit {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
}

.orbit-one {
  right: -12px;
  bottom: -26px;
  width: 245px;
  height: 245px;
}

.orbit-two {
  right: 20px;
  bottom: 4px;
  width: 178px;
  height: 178px;
  border-style: dashed;
}

.portrait-speech {
  position: absolute;
  z-index: 4;
  top: 18px;
  right: 2px;
  padding: 10px 14px;
  border-radius: 14px 14px 14px 3px;
  color: var(--sidebar);
  background: #fffaf0;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  font: 700 12px/1 var(--font-heading);
}

.portrait-badge {
  position: absolute;
  z-index: 3;
  right: 15px;
  bottom: 80px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 4px solid var(--sidebar);
  border-radius: 50%;
  color: var(--sidebar);
  background: var(--accent);
}

.portrait-badge svg {
  width: 17px;
  height: 17px;
}

.chat-card {
  display: flex;
  min-width: 0;
  min-height: 0;
  width: 100%;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
  overflow: hidden;
}

.conversation-persona {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  flex: 0 0 auto;
  gap: 16px;
  align-items: center;
  padding: 11px clamp(20px, 4vw, 52px) 10px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), transparent),
    var(--surface);
  overflow: hidden;
}

.conversation-persona::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 30%;
  background: radial-gradient(circle at 0 45%, var(--persona-color, var(--accent)) 0, transparent 68%);
  content: "";
  opacity: 0.1;
  pointer-events: none;
}

.conversation-persona::after {
  position: absolute;
  right: clamp(20px, 4vw, 52px);
  bottom: -1px;
  left: clamp(20px, 4vw, 52px);
  height: 2px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--persona-color, var(--accent)), transparent 48%);
  content: "";
  opacity: 0.8;
}

.persona-header-main {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.conversation-persona-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.persona-title-group {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.persona-accent {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--persona-color, var(--accent));
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--persona-color, var(--accent)) 13%, transparent);
}

.conversation-persona h1 {
  margin: 0;
  overflow: hidden;
  font: 800 22px/1 var(--font-heading);
  letter-spacing: -0.045em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-persona .status-pill {
  min-height: 27px;
  padding: 4px 8px;
  border-color: rgba(74, 144, 116, 0.18);
  color: #356f5e;
  background: rgba(147, 203, 189, 0.14);
  font-size: 8px;
}

.persona-header-role {
  margin: 0;
  overflow: hidden;
  color: var(--accent-deep);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.persona-header-description {
  max-width: 760px;
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.persona-meta-separator {
  color: #b3bab7;
  font-size: 11px;
}

.persona-level {
  overflow: hidden;
  color: #7d8886;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.persona-header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  justify-content: flex-end;
}

.clear-chat-button {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid rgba(95, 115, 109, 0.16);
  border-radius: 999px;
  color: #687a75;
  background: rgba(255, 255, 255, 0.48);
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.clear-chat-button:hover {
  border-color: rgba(173, 88, 76, 0.28);
  color: #9a4f44;
  background: rgba(255, 240, 237, 0.72);
}

.clear-chat-button svg {
  width: 13px;
  height: 13px;
}

.memory-chip {
  position: relative;
  z-index: 1;
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  gap: 6px;
  align-self: center;
  padding: 0 10px;
  border-radius: 999px;
  color: #356f5e;
  background: rgba(147, 203, 189, 0.12);
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.memory-chip[hidden] {
  display: none;
}

.memory-chip svg {
  width: 13px;
  height: 13px;
}

.chat-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 18px clamp(20px, 4vw, 52px) 10px;
  flex: 0 0 auto;
}

.chat-heading h2 {
  margin: 5px 0 0;
  font: 800 26px/1.1 var(--font-heading);
  letter-spacing: -0.04em;
}

.chat-heading-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.level-chip {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 700;
}

.messages {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 14px;
  padding: 18px clamp(20px, 4vw, 52px) 20px;
  overflow-y: auto;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}

.messages::-webkit-scrollbar {
  width: 5px;
}

.messages::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: rgba(23, 50, 56, 0.15);
}

.day-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #9aa3a2;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.day-divider::before,
.day-divider::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: "";
}

.message-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  max-width: 86%;
  animation: message-in 220ms ease both;
}

.message-row.user {
  margin-left: auto;
  flex-direction: row-reverse;
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.message-avatar {
  display: block;
  width: 34px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: #f1eee7;
  overflow: hidden;
}

.message-bubble {
  min-width: 0;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  color: #929b99;
  font-size: 10px;
}

.message-row.user .message-meta {
  justify-content: flex-end;
}

.message-text {
  padding: 12px 14px;
  border-radius: 17px 17px 17px 5px;
  color: #293638;
  background: #f1eee7;
  font-size: 14px;
  line-height: 1.55;
  text-align: start;
  unicode-bidi: plaintext;
}

.message-row.user .message-text {
  border-radius: 17px 17px 5px;
  color: #fff;
  background: var(--sidebar);
}

.message-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.message-tool {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  border: 0;
  border-radius: 8px;
  color: #7d8888;
  background: transparent;
  font-size: 10px;
}

.message-tool:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.message-tool svg {
  width: 14px;
  height: 14px;
}

.typing-bubble {
  display: flex;
  gap: 4px;
  padding: 15px 17px;
  border-radius: 17px 17px 17px 5px;
  background: #f1eee7;
}

.typing-bubble span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #93a09f;
  animation: typing 800ms infinite alternate;
}

.typing-bubble span:nth-child(2) {
  animation-delay: 160ms;
}

.typing-bubble span:nth-child(3) {
  animation-delay: 320ms;
}

@keyframes typing {
  to {
    opacity: 0.3;
    transform: translateY(-3px);
  }
}

.suggestions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
  padding: 14px clamp(20px, 4vw, 52px);
  border-top: 1px solid var(--line);
  overflow-x: auto;
}

.suggestion-chip {
  display: inline-flex;
  min-height: 40px;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface);
  font-size: 11px;
  font-weight: 600;
}

.suggestion-chip:hover {
  border-color: #c7beb0;
  color: var(--ink);
  background: var(--surface-soft);
}

.composer-wrap {
  flex: 0 0 auto;
  padding: 2px clamp(20px, 4vw, 52px) 14px;
}

.voice-mode-status {
  display: flex;
  width: fit-content;
  min-height: 27px;
  align-items: center;
  gap: 7px;
  margin: 0 0 6px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #2c6b58;
  background: rgba(147, 203, 189, 0.18);
  font-size: 9px;
  font-weight: 700;
}

.voice-mode-status[hidden] {
  display: none;
}

.voice-mode-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #4ca787;
  box-shadow: 0 0 0 4px rgba(76, 167, 135, 0.13);
}

.voice-mode-status[data-mode="listening"] .voice-mode-dot {
  animation: voice-mode-pulse 900ms ease-in-out infinite alternate;
}

.voice-mode-status[data-mode="waitingForReply"] {
  color: #806328;
  background: rgba(241, 166, 90, 0.16);
}

.voice-mode-status[data-mode="waitingForReply"] .voice-mode-dot {
  background: #d89449;
  box-shadow: 0 0 0 4px rgba(216, 148, 73, 0.12);
}

.voice-mode-status[data-mode="transcribing"] {
  color: #355c74;
  background: rgba(104, 157, 190, 0.16);
}

.voice-mode-status[data-mode="transcribing"] .voice-mode-dot {
  background: #5c93b3;
  box-shadow: 0 0 0 4px rgba(92, 147, 179, 0.12);
  animation: voice-mode-pulse 900ms ease-in-out infinite alternate;
}

.voice-mode-status[data-mode="pausedWhileSpeaking"] {
  color: #667473;
  background: rgba(230, 226, 217, 0.72);
}

.voice-mode-status[data-mode="pausedWhileSpeaking"] .voice-mode-dot {
  background: #98a3a1;
  box-shadow: none;
}

@keyframes voice-mode-pulse {
  to {
    box-shadow: 0 0 0 7px rgba(76, 167, 135, 0.04);
  }
}

.speech-status {
  display: flex;
  width: fit-content;
  min-height: 26px;
  align-items: center;
  gap: 8px;
  margin: 0 0 7px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #356f5e;
  background: rgba(147, 203, 189, 0.13);
  font-size: 10px;
  font-weight: 700;
}

.speech-status[hidden] {
  display: none;
}

.speech-bars {
  display: flex;
  height: 14px;
  align-items: center;
  gap: 2px;
}

.speech-bars span {
  width: 2px;
  height: 5px;
  border-radius: 99px;
  background: #4c9a83;
}

.speech-status[data-mode="preparing"] .speech-bars span {
  animation: speech-bars 620ms ease-in-out infinite alternate;
}

.speech-status[data-mode="speaking"] .speech-bars span {
  animation: speech-bars 380ms ease-in-out infinite alternate;
}

.speech-bars span:nth-child(2) {
  animation-delay: 90ms;
}

.speech-bars span:nth-child(3) {
  animation-delay: 180ms;
}

.speech-bars span:nth-child(4) {
  animation-delay: 270ms;
}

@keyframes speech-bars {
  to {
    height: 13px;
  }
}

.recording-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(212, 92, 79, 0.25);
  border-radius: 17px;
  background: #fff4f1;
}

.recording-strip[hidden] {
  display: none;
}

.waveform {
  display: flex;
  height: 28px;
  align-items: center;
  gap: 3px;
}

.waveform span {
  width: 3px;
  height: 9px;
  border-radius: 99px;
  background: var(--danger);
  animation: wave 700ms ease-in-out infinite alternate;
}

.waveform span:nth-child(2),
.waveform span:nth-child(8) {
  animation-delay: 80ms;
}

.waveform span:nth-child(3),
.waveform span:nth-child(7) {
  animation-delay: 160ms;
}

.waveform span:nth-child(4),
.waveform span:nth-child(6) {
  animation-delay: 240ms;
}

.waveform span:nth-child(5) {
  animation-delay: 320ms;
}

@keyframes wave {
  to {
    height: 25px;
  }
}

.recording-strip div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.recording-strip strong,
.recording-strip span {
  display: block;
}

.recording-strip strong {
  color: #853e34;
  font-size: 12px;
}

.recording-strip span {
  margin-top: 2px;
  color: #98675f;
  font-size: 10px;
}

.recording-stop {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(212, 92, 79, 0.3);
  border-radius: 10px;
  color: #853e34;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(23, 50, 56, 0.07);
}

.composer:focus-within {
  border-color: #a9b7b4;
  box-shadow: 0 0 0 4px rgba(147, 203, 189, 0.14);
}

.composer.has-voice-transcript {
  border-color: rgba(79, 151, 126, 0.42);
  box-shadow:
    0 0 0 4px rgba(106, 178, 149, 0.13),
    0 14px 34px rgba(23, 74, 61, 0.1);
}

.composer.has-voice-transcript textarea {
  color: #214f43;
  font-weight: 600;
}

.composer textarea {
  min-height: 42px;
  max-height: 140px;
  flex: 1;
  padding: 11px 4px 7px;
  border: 0;
  outline: 0;
  resize: none;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
  line-height: 1.45;
}

.composer textarea::placeholder {
  color: #a0a8a6;
}

.mic-button,
.send-button {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 0;
  border-radius: 12px;
}

.mic-button {
  position: relative;
  width: 68px;
  height: 36px;
  align-self: center;
  border: 1px solid rgba(42, 73, 65, 0.1);
  border-radius: 999px;
  color: #7d8b86;
  background: #edf2ef;
  box-shadow: inset 0 1px 3px rgba(29, 62, 53, 0.07);
  overflow: hidden;
  transition:
    color 220ms ease,
    background 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.mic-button:hover {
  color: #426a5e;
  background: #e3ebe6;
}

.mic-switch-word {
  position: absolute;
  top: 50%;
  z-index: 1;
  font-size: 7px;
  font-weight: 850;
  letter-spacing: 0.09em;
  transform: translateY(-50%);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.mic-switch-on {
  left: 10px;
  color: #fff;
  opacity: 0;
}

.mic-switch-off {
  right: 7px;
  color: #7f8d88;
  opacity: 1;
}

.mic-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: #667773;
  background: #fff;
  box-shadow:
    0 3px 9px rgba(25, 54, 47, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition:
    transform 240ms cubic-bezier(0.34, 1.3, 0.64, 1),
    color 180ms ease,
    background 180ms ease;
}

.mic-switch-thumb svg {
  width: 14px;
  height: 14px;
}

.mic-button.is-voice-mode {
  border-color: rgba(42, 112, 88, 0.42);
  color: #fff;
  background: linear-gradient(110deg, #2f6d5a, #4b9276);
  box-shadow:
    0 0 0 3px rgba(88, 161, 134, 0.14),
    0 7px 18px rgba(38, 102, 80, 0.2);
}

.mic-button.is-voice-mode .mic-switch-thumb {
  color: #276450;
  transform: translateX(32px);
}

.mic-button.is-voice-mode .mic-switch-on {
  opacity: 1;
}

.mic-button.is-voice-mode .mic-switch-off {
  opacity: 0;
}

.mic-button.is-voice-mode.is-recording {
  animation: mic-listening 1.15s ease-in-out infinite alternate;
}

.mic-button.is-voice-mode.is-recording .mic-switch-thumb {
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.2),
    0 4px 12px rgba(13, 53, 41, 0.24);
}

@keyframes mic-listening {
  to {
    box-shadow:
      0 0 0 6px rgba(88, 161, 134, 0.16),
      0 9px 24px rgba(38, 102, 80, 0.24);
  }
}

.send-button {
  color: #fff;
  background: var(--accent-deep);
}

.send-button:hover {
  background: #c36c2e;
}

.mic-button svg,
.send-button svg {
  width: 18px;
  height: 18px;
}

.composer-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 8px 0 0;
  color: #959d9a;
  font-size: 10px;
}

.composer-note svg {
  width: 13px;
  height: 13px;
}

.scrim {
  position: fixed;
  z-index: 40;
  inset: 0;
  background: rgba(16, 30, 33, 0.22);
  backdrop-filter: blur(3px);
}

.scrim[hidden] {
  display: none;
}

.persona-dialog {
  width: min(760px, calc(100% - 32px));
  max-height: calc(100vh - 42px);
  padding: 0;
  border: 1px solid rgba(228, 222, 211, 0.9);
  border-radius: 28px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(16, 30, 33, 0.28);
  overflow-y: auto;
}

.persona-dialog::backdrop {
  background: rgba(16, 30, 33, 0.42);
  backdrop-filter: blur(5px);
}

.auth-dialog {
  width: min(440px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  padding: 26px;
  border: 1px solid rgba(228, 222, 211, 0.92);
  border-radius: 26px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 30px 90px rgba(16, 30, 33, 0.3);
  overflow-y: auto;
}

.auth-dialog::backdrop {
  background: rgba(16, 30, 33, 0.55);
  backdrop-filter: blur(7px);
}

.permission-dialog {
  width: min(510px, calc(100% - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 28px;
  color: var(--ink);
  background: transparent;
  box-shadow: 0 34px 100px rgba(10, 35, 31, 0.34);
  overflow: auto;
}

.permission-dialog::backdrop {
  background: rgba(12, 34, 31, 0.58);
  backdrop-filter: blur(8px);
}

.permission-card {
  position: relative;
  padding: 27px;
  background:
    radial-gradient(circle at 92% 4%, rgba(244, 184, 96, 0.22), transparent 30%),
    radial-gradient(circle at 4% 94%, rgba(121, 181, 165, 0.2), transparent 36%),
    #fffdf8;
  overflow: hidden;
}

.permission-icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 15px 15px 15px 5px;
  color: #fffdf7;
  background: linear-gradient(145deg, #204d42, #367560);
  box-shadow: 0 12px 28px rgba(28, 74, 62, 0.22);
}

.permission-icon svg {
  width: 21px;
  height: 21px;
}

.permission-card h2 {
  max-width: 370px;
  margin: 7px 0 8px;
  font: 800 clamp(24px, 5vw, 31px) / 1.05 var(--font-heading);
  letter-spacing: -0.045em;
}

.permission-intro {
  max-width: 420px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.permission-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 21px 0 14px;
}

.permission-option {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  padding: 13px;
  border: 1px solid rgba(41, 73, 66, 0.12);
  border-radius: 17px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 6px 20px rgba(20, 50, 44, 0.055);
  text-align: left;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.permission-option:hover:not(:disabled) {
  border-color: rgba(46, 105, 88, 0.3);
  box-shadow: 0 10px 26px rgba(20, 50, 44, 0.1);
  transform: translateY(-1px);
}

.permission-option:disabled {
  cursor: default;
}

.permission-option.is-granted {
  border-color: rgba(67, 143, 112, 0.28);
  background: rgba(231, 247, 240, 0.9);
}

.permission-option.is-blocked {
  border-color: rgba(188, 92, 73, 0.22);
  background: rgba(255, 244, 239, 0.86);
}

.permission-option-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  color: #315f52;
  background: #eaf2ed;
}

.permission-option-icon svg {
  width: 17px;
  height: 17px;
}

.permission-option-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.permission-option-copy strong {
  font-size: 12px;
}

.permission-option-copy small {
  overflow: hidden;
  color: #74817d;
  font-size: 9px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permission-option.is-granted .permission-option-copy small {
  color: #39765f;
}

.permission-option.is-blocked .permission-option-copy small {
  color: #a95745;
}

.permission-privacy {
  margin: 0;
  padding: 11px 12px;
  border-radius: 13px;
  color: #667572;
  background: rgba(231, 239, 234, 0.7);
  font-size: 9.5px;
  line-height: 1.5;
}

.permission-dismiss {
  display: block;
  margin: 14px auto 0;
  padding: 7px 12px;
  border: 0;
  color: #74817e;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}

@media (max-width: 560px) {
  .permission-card {
    padding: 21px;
  }

  .permission-options {
    grid-template-columns: 1fr;
    margin-top: 17px;
  }
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.auth-brand .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px 12px 12px 4px;
  background: var(--accent);
  color: var(--sidebar);
}

.auth-brand strong,
.auth-brand span {
  display: block;
}

.auth-brand strong {
  font: 800 18px/1 var(--font-heading);
}

.auth-brand span {
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 10px;
}

.auth-copy {
  margin: 24px 0 18px;
}

.auth-copy h1 {
  margin: 6px 0 8px;
  font: 800 28px/1.1 var(--font-heading);
  letter-spacing: -0.045em;
}

.auth-copy p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.auth-tabs {
  display: flex;
  gap: 5px;
  padding: 4px;
  border-radius: 13px;
  background: var(--surface-soft);
}

.auth-tab {
  min-height: 38px;
  flex: 1;
  border: 0;
  border-radius: 10px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}

.auth-tab.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 3px 12px rgba(23, 50, 56, 0.08);
}

.auth-form {
  display: grid;
  gap: 13px;
  padding-top: 17px;
}

.auth-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.auth-consent input {
  margin-top: 2px;
  accent-color: var(--accent-deep);
}

.auth-consent a {
  color: #315f53;
  font-weight: 700;
  text-underline-offset: 2px;
}

.auth-hint {
  margin: -3px 0 0;
  color: #788581;
  font-size: 10px;
  line-height: 1.45;
}

.auth-forgot {
  justify-self: center;
  padding: 4px;
  border: 0;
  color: #466b60;
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.recovery-question {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(74, 144, 116, 0.16);
  border-radius: 13px;
  background: rgba(147, 203, 189, 0.12);
}

.recovery-question span {
  color: #71827d;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.recovery-question strong {
  color: #294a42;
  font-size: 14px;
  line-height: 1.45;
}

.auth-submit {
  width: 100%;
  min-height: 45px;
}

.auth-error {
  margin: 0;
  padding: 9px 11px;
  border-radius: 9px;
  color: #983e36;
  background: #fff0ed;
  font-size: 10px;
  line-height: 1.4;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 28px 20px;
}

.dialog-header h2 {
  margin: 7px 0 0;
  font: 800 29px/1.1 var(--font-heading);
  letter-spacing: -0.045em;
}

.dialog-close {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
}

.dialog-close:hover {
  background: var(--surface-soft);
}

.dialog-close svg {
  width: 17px;
  height: 17px;
}

.dialog-tabs {
  display: flex;
  gap: 5px;
  margin: 0 28px;
  padding: 5px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.dialog-tab {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.dialog-tab.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 3px 12px rgba(23, 50, 56, 0.08);
}

.dialog-panel {
  padding: 22px 28px 28px;
}

.dialog-panel[hidden] {
  display: none;
}

.ready-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ready-persona {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  text-align: left;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.ready-persona:hover {
  border-color: #c6bbab;
  background: #fffaf2;
  transform: translateY(-2px);
}

.ready-persona.is-current {
  border-color: #91b9ac;
  background: #f2f8f5;
}

.ready-avatar {
  position: relative;
  display: block;
  width: 58px;
  height: 68px;
  border-radius: 18px;
  background: #f3f1ea;
  overflow: hidden;
}

.ready-online {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 10px;
  height: 10px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #57b58e;
}

.ready-copy {
  min-width: 0;
}

.ready-copy strong,
.ready-copy span,
.ready-copy small {
  display: block;
}

.ready-copy strong {
  font: 800 14px/1.25 var(--font-heading);
}

.ready-copy span {
  margin-top: 3px;
  color: #687777;
  font-size: 11px;
  font-weight: 600;
}

.ready-copy small {
  display: -webkit-box;
  margin-top: 6px;
  overflow: hidden;
  color: #919a98;
  font-size: 10px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ready-action {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--surface);
}

.ready-action svg {
  width: 14px;
  height: 14px;
}

.persona-form {
  display: grid;
  gap: 17px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.field {
  display: grid;
  gap: 7px;
  color: #5d6969;
  font-size: 11px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
}

.field input,
.field select {
  height: 46px;
  padding: 0 13px;
}

.field textarea {
  padding: 12px 13px;
  line-height: 1.55;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #a4aba9;
}

.color-options {
  display: flex;
  gap: 10px;
}

.color-swatch {
  width: 34px;
  height: 34px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px var(--line);
}

.color-swatch.selected {
  box-shadow: 0 0 0 2px var(--sidebar);
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 5px;
}

.form-footer p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: #8b9492;
  font-size: 10px;
}

.form-footer p svg {
  width: 15px;
  height: 15px;
}

.toast {
  position: fixed;
  z-index: 80;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100% - 32px));
  padding: 13px 16px;
  border-radius: 13px;
  color: #fff;
  background: var(--sidebar);
  box-shadow: 0 18px 45px rgba(23, 50, 56, 0.24);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1030px) {
  .persona-stage {
    min-height: 600px;
  }

  .stage-portrait {
    right: 2%;
    width: 180px;
    height: 205px;
  }

  .portrait-avatar {
    width: 175px;
    height: 220px;
  }

  .portrait-orbit.orbit-one {
    width: 205px;
    height: 205px;
  }

  .portrait-orbit.orbit-two {
    width: 150px;
    height: 150px;
  }
}

@media (max-width: 840px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 50;
    left: 0;
    top: 0;
    width: min(310px, 86vw);
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    overscroll-behavior: contain;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    transform: translateX(-102%);
    transition: transform 200ms ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar .brand,
  .sidebar .primary-nav,
  .sidebar .profile-row {
    flex: 0 0 auto;
  }

  .sidebar-section {
    min-height: 0;
    flex: 1 1 auto;
    margin-bottom: 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar .side-card {
    display: none;
  }

  .sidebar .profile-row {
    margin-top: 0;
    padding-top: 12px;
    padding-bottom: 2px;
    background: var(--sidebar);
  }

  .mobile-menu {
    display: inline-grid;
  }

  .topbar {
    min-height: 74px;
    padding: 12px 17px;
  }

  .topbar-title {
    margin-right: auto;
  }

  .sound-toggle span {
    display: none;
  }

  .sound-toggle {
    width: 40px;
    padding: 0;
    justify-content: center;
  }

  .topbar-actions .button {
    width: 40px;
    padding: 0;
  }

  .topbar-actions .button span,
  .topbar-actions .button {
    font-size: 0;
  }

  .conversation-page {
    display: flex;
    width: 100%;
    flex-direction: column;
    padding: 0;
  }

  .chat-card {
    width: 100%;
    padding: 0;
    border-radius: 0;
  }

  .conversation-persona,
  .chat-heading,
  .messages,
  .suggestions,
  .composer-wrap {
    padding-left: 16px;
    padding-right: 16px;
  }

  .messages {
    min-height: 0;
  }

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

@media (max-width: 560px) {
  .topbar-title .eyebrow {
    display: none;
  }

  .topbar-title strong {
    font-size: 15px;
  }

  .language-control {
    width: 40px;
    padding: 0;
    justify-content: center;
  }

  .language-control select {
    position: absolute;
    width: 40px;
    height: 40px;
    opacity: 0;
  }

  .conversation-persona {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .conversation-persona h1 {
    font-size: 20px;
  }

  .conversation-persona-top {
    align-items: center;
    flex-wrap: wrap;
    gap: 5px 7px;
  }

  .persona-header-description {
    display: none;
  }

  .persona-header-actions {
    gap: 4px;
  }

  .conversation-persona .status-pill {
    width: 27px;
    padding: 0;
    justify-content: center;
  }

  .conversation-persona .status-pill span:last-child,
  .clear-chat-button span,
  .memory-chip span {
    display: none;
  }

  .clear-chat-button,
  .memory-chip {
    width: 27px;
    min-width: 27px;
    padding: 0;
    justify-content: center;
  }

  .chat-heading h2 {
    font-size: 23px;
  }

  .level-chip {
    display: none;
  }

  .message-row {
    max-width: 95%;
  }

  .suggestions {
    padding-bottom: 10px;
  }

  .recording-strip {
    align-items: flex-start;
  }

  .recording-strip div:nth-child(2) span {
    display: none;
  }

  .dialog-header,
  .dialog-panel {
    padding-left: 18px;
    padding-right: 18px;
  }

  .dialog-tabs {
    margin-left: 18px;
    margin-right: 18px;
  }

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

  .form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .form-footer p {
    order: 2;
    justify-content: center;
    text-align: center;
  }

  .form-footer .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 2026 conversation-first redesign */
:root {
  --ink: #1b2827;
  --ink-soft: #65716e;
  --paper: #f0ede5;
  --paper-deep: #e7e2d8;
  --surface: #fffdf8;
  --surface-soft: #f7f3eb;
  --line: rgba(40, 62, 57, 0.12);
  --sidebar: #142d2c;
  --sidebar-soft: #1d3a37;
  --sidebar-muted: #a8b9b4;
  --accent: #eaa065;
  --accent-deep: #d97942;
  --mint: #9fc5b6;
  --shadow: 0 24px 70px rgba(20, 45, 44, 0.13);
}

body {
  background:
    radial-gradient(circle at 86% 8%, rgba(234, 160, 101, 0.16), transparent 26rem),
    radial-gradient(circle at 64% 90%, rgba(159, 197, 182, 0.12), transparent 30rem),
    var(--paper);
}

.app-shell {
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  height: 100dvh;
  padding: 22px 14px 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: hidden;
  background:
    radial-gradient(circle at 25% 0%, rgba(159, 197, 182, 0.18), transparent 17rem),
    radial-gradient(circle at 100% 90%, rgba(234, 160, 101, 0.08), transparent 19rem),
    var(--sidebar);
}

.sidebar::after {
  position: absolute;
  right: -70px;
  bottom: 120px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(255, 255, 255, 0.035);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.brand {
  gap: 11px;
  padding: 0 7px 19px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 13px 13px 13px 5px;
  color: #17302d;
  background: linear-gradient(145deg, #f4c281, #ed9a5b);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.58),
    0 9px 22px rgba(0, 0, 0, 0.16);
  font-size: 20px;
}

.brand strong {
  font-size: 21px;
  letter-spacing: -0.04em;
}

.brand span {
  color: #90aaa3;
  font-size: 9px;
  letter-spacing: 0.02em;
}

.sidebar-section {
  min-height: 0;
  flex: 1 1 auto;
  margin: 8px 0 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sidebar-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 7px 9px;
}

.section-label {
  padding: 0;
  color: #88a39c;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sidebar-add {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  color: #dce9e4;
  background: rgba(255, 255, 255, 0.045);
}

.sidebar-add:hover {
  border-color: rgba(234, 160, 101, 0.36);
  color: #ffd5b3;
  background: rgba(234, 160, 101, 0.09);
}

.sidebar-add svg {
  width: 14px;
  height: 14px;
}

.recent-list {
  display: grid;
  gap: 4px;
  padding: 0;
}

.recent-item {
  min-height: 58px;
  gap: 10px;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  transition:
    background 150ms ease,
    border-color 150ms ease,
    transform 150ms ease;
}

.recent-item:hover {
  border-color: rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.045);
  transform: translateX(2px);
}

.recent-item.active {
  border-color: rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.045));
  box-shadow: inset 3px 0 var(--persona-color, var(--accent));
}

.recent-item .mini-avatar {
  width: 34px;
  height: 39px;
  border-radius: 10px;
}

.recent-copy strong {
  color: #eef5f1;
  font-size: 12px;
}

.recent-copy span {
  margin-top: 3px;
  color: #89a29c;
  font-size: 9.5px;
}

.sidebar-admin {
  display: inline-flex;
  min-height: 38px;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  margin: 8px 4px 0;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  color: #a9c0ba;
  background: rgba(255, 255, 255, 0.035);
  font-size: 10px;
  font-weight: 700;
}

.sidebar-admin svg {
  width: 15px;
  height: 15px;
}

.profile-row {
  gap: 9px;
  margin-top: 10px;
  padding: 13px 5px 2px;
}

.profile-avatar {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: #1b3732;
  background: linear-gradient(145deg, #cce4d8, #9fc5b6);
}

.profile-row strong {
  font-size: 11px;
}

.profile-row span {
  color: #86a098;
  font-size: 9px;
}

.profile-row .logout-button {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 10px;
}

.profile-row .logout-button span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.main-content {
  position: relative;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.32), transparent 18%),
    transparent;
}

.topbar {
  min-height: 62px;
  justify-content: flex-end;
  padding: 10px clamp(22px, 4vw, 46px);
  border-bottom-color: rgba(40, 62, 57, 0.08);
  background: rgba(240, 237, 229, 0.76);
  backdrop-filter: blur(22px) saturate(1.2);
}

.topbar-actions {
  gap: 7px;
}

.language-control,
.sound-toggle {
  min-height: 38px;
  border-color: rgba(40, 62, 57, 0.1);
  background: rgba(255, 253, 248, 0.64);
  box-shadow: 0 4px 14px rgba(20, 45, 44, 0.035);
}

.language-control {
  padding: 0 9px;
  border-radius: 11px;
}

.sound-toggle {
  padding: 0 11px;
  font-size: 10px;
}

.sound-toggle.is-on {
  border-color: rgba(84, 142, 119, 0.2);
  color: #2c6756;
  background: rgba(159, 197, 182, 0.15);
}

.topbar-actions .button {
  min-height: 38px;
  padding: 0 13px;
  border-radius: 11px;
  background: #183533;
  box-shadow: 0 7px 18px rgba(20, 45, 44, 0.13);
  font-size: 10px;
}

.conversation-page {
  background: transparent;
}

.chat-card {
  background: transparent;
}

.conversation-persona {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 72px;
  padding: 9px clamp(20px, 4vw, 46px);
  border-bottom-color: rgba(40, 62, 57, 0.09);
  background: rgba(255, 253, 248, 0.72);
  backdrop-filter: blur(20px);
}

.conversation-persona::before {
  width: 38%;
  opacity: 0.045;
}

.conversation-persona::after {
  display: none;
}

.persona-header-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
}

.persona-header-avatar {
  width: 43px;
  height: 50px;
  flex: 0 0 auto;
  border: 1px solid rgba(40, 62, 57, 0.08);
  border-radius: 14px;
  background:
    linear-gradient(145deg, color-mix(in srgb, var(--persona-color, var(--accent)) 28%, #fff), #fffaf1);
  box-shadow: 0 7px 18px rgba(20, 45, 44, 0.08);
  overflow: hidden;
}

.persona-header-main {
  min-width: 0;
}

.conversation-persona-top {
  gap: 6px;
}

.conversation-persona h1 {
  max-width: none;
  font-size: 19px;
  letter-spacing: -0.035em;
}

.persona-header-role {
  color: color-mix(in srgb, var(--persona-color, var(--accent)) 62%, #41504c);
  font-size: 8px;
  letter-spacing: 0.09em;
}

.persona-meta-separator {
  color: #bdc3bd;
  font-size: 9px;
}

.persona-level {
  color: #7b8581;
  font-size: 8.5px;
}

.persona-header-actions {
  gap: 6px;
}

.memory-chip {
  min-height: 28px;
  padding: 0 9px;
  color: #45665c;
  background: rgba(159, 197, 182, 0.13);
  font-size: 8px;
}

.clear-chat-button {
  width: 29px;
  height: 29px;
  min-height: 29px;
  justify-content: center;
  padding: 0;
  border-color: rgba(40, 62, 57, 0.09);
  color: #82908b;
  background: rgba(255, 255, 255, 0.52);
}

.clear-chat-button span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.messages {
  width: 100%;
  max-width: 930px;
  margin: 0 auto;
  gap: 17px;
  padding: 27px clamp(20px, 4vw, 42px) 18px;
  border-radius: 26px 26px 0 0;
  background: linear-gradient(
    180deg,
    rgba(255, 253, 248, 0.52),
    rgba(255, 253, 248, 0) 86px
  );
}

.day-divider {
  gap: 10px;
  margin: 1px 0 7px;
  color: #9ba39e;
  font-size: 8px;
  letter-spacing: 0.11em;
}

.day-divider::before,
.day-divider::after {
  background: rgba(40, 62, 57, 0.075);
}

.message-row {
  max-width: min(690px, 82%);
  gap: 0;
}

.message-row.user {
  max-width: min(560px, 72%);
}

.message-meta {
  margin: 0 5px 5px;
  color: #8f9994;
  font-size: 9px;
}

.message-text {
  padding: 12px 15px;
  border: 1px solid rgba(40, 62, 57, 0.065);
  border-radius: 5px 19px 19px 19px;
  color: #263331;
  background: rgba(255, 253, 248, 0.9);
  box-shadow:
    0 8px 25px rgba(20, 45, 44, 0.045),
    inset 0 1px rgba(255, 255, 255, 0.8);
  font-size: 14.5px;
  line-height: 1.62;
}

.message-row.user .message-text {
  border-color: transparent;
  border-radius: 19px 5px 19px 19px;
  color: #f6f8f4;
  background:
    linear-gradient(145deg, #1c3b38, #142d2c);
  box-shadow: 0 9px 24px rgba(20, 45, 44, 0.14);
}

.message-tools {
  margin: 3px 0 0 4px;
}

.message-tool {
  width: 28px;
  height: 27px;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #8b9691;
}

.message-tool:hover {
  border-color: rgba(40, 62, 57, 0.08);
  background: rgba(255, 253, 248, 0.72);
}

.typing-bubble {
  padding: 14px 16px;
  border: 1px solid rgba(40, 62, 57, 0.06);
  border-radius: 5px 19px 19px 19px;
  background: rgba(255, 253, 248, 0.9);
}

.suggestions {
  width: 100%;
  max-width: 930px;
  margin: 0 auto;
  gap: 6px;
  padding: 8px clamp(20px, 4vw, 42px) 2px;
  border-top: 0;
  scrollbar-width: none;
}

.suggestions::-webkit-scrollbar {
  display: none;
}

.suggestion-chip {
  min-height: 34px;
  gap: 6px;
  padding: 0 10px;
  border-color: rgba(40, 62, 57, 0.09);
  color: #687471;
  background: rgba(255, 253, 248, 0.44);
  font-size: 10px;
}

.suggestion-chip:hover {
  border-color: rgba(217, 121, 66, 0.2);
  color: #3f4d49;
  background: rgba(255, 253, 248, 0.9);
}

.suggestion-chip svg {
  width: 14px;
  height: 14px;
  color: var(--accent-deep);
}

.composer-wrap {
  width: 100%;
  max-width: 930px;
  margin: 0 auto;
  padding: 4px clamp(16px, 4vw, 38px) 16px;
}

.composer {
  gap: 7px;
  padding: 7px;
  border-color: rgba(40, 62, 57, 0.1);
  border-radius: 23px;
  background: rgba(255, 253, 248, 0.93);
  box-shadow:
    0 18px 42px rgba(20, 45, 44, 0.08),
    inset 0 1px rgba(255, 255, 255, 0.92);
}

.composer:focus-within {
  border-color: rgba(217, 121, 66, 0.28);
  box-shadow:
    0 18px 42px rgba(20, 45, 44, 0.08),
    0 0 0 4px rgba(234, 160, 101, 0.09);
}

.composer textarea {
  min-height: 39px;
  padding: 9px 4px 6px;
  font-size: 14px;
}

.send-button {
  width: 39px;
  height: 39px;
  border-radius: 15px;
}

.mic-button {
  width: 68px;
  height: 36px;
  border-radius: 999px;
  background: #edf2ef;
}

.send-button {
  background: linear-gradient(145deg, #e99a5d, #d97942);
  box-shadow: 0 7px 18px rgba(217, 121, 66, 0.22);
}

.send-button:hover {
  background: linear-gradient(145deg, #eda66d, #d97b44);
}

.voice-mode-status,
.speech-status {
  margin-left: 3px;
}

@media (max-width: 840px) {
  .sidebar {
    width: min(286px, 86vw);
    padding: 18px 12px calc(12px + env(safe-area-inset-bottom));
  }

  .brand {
    padding-bottom: 14px;
  }

  .sidebar-section {
    margin-top: 4px;
  }

  .topbar {
    min-height: 58px;
    padding: 8px 13px;
    justify-content: space-between;
  }

  .topbar-actions {
    margin-left: auto;
  }

  .language-control select {
    max-width: 80px;
  }

  .sound-toggle {
    width: 38px;
    padding: 0;
  }

  .topbar-actions .button {
    width: 38px;
    padding: 0;
  }

  .conversation-persona {
    min-height: 66px;
    padding: 7px 13px;
  }

  .persona-header-avatar {
    width: 37px;
    height: 44px;
    border-radius: 12px;
  }

  .conversation-persona h1 {
    font-size: 17px;
  }

  .persona-header-role {
    max-width: 90px;
  }

  .memory-chip {
    width: 28px;
    min-width: 28px;
    height: 28px;
    justify-content: center;
    padding: 0;
  }

  .clear-chat-button {
    width: 28px;
    height: 28px;
    min-width: 28px;
  }

  .eye-tracking-button {
    width: 28px;
    min-width: 28px;
    height: 28px;
    padding: 0;
  }

  .eye-tracking-button span {
    display: none;
  }

  .messages {
    padding: 18px 13px 12px;
  }

  .suggestions {
    padding: 7px 13px 1px;
  }

  .composer-wrap {
    padding: 3px 9px calc(9px + env(safe-area-inset-bottom));
  }

  .message-row {
    max-width: 91%;
  }

  .message-row.user {
    max-width: 84%;
  }
}

@media (max-width: 480px) {
  .persona-level,
  .persona-meta-separator {
    display: none;
  }

  .persona-header-role {
    max-width: 112px;
  }

  .language-control {
    min-width: 82px;
    justify-content: center;
    gap: 4px;
    padding: 0 7px;
  }

  .language-control svg {
    display: block;
  }

  .language-control select {
    max-width: 58px;
  }

  .suggestion-chip {
    min-height: 32px;
    padding: 0 9px;
  }
}

/* Animated persona stage */
.conversation-persona {
  position: relative;
  display: block;
  height: 50dvh;
  min-height: 310px;
  max-height: 620px;
  padding: 0;
  perspective: 900px;
  border-bottom: 0;
  background:
    radial-gradient(
      ellipse 58% 92% at 50% 38%,
      color-mix(in srgb, var(--persona-color, var(--accent)) 34%, transparent),
      transparent 72%
    ),
    linear-gradient(
      90deg,
      color-mix(in srgb, var(--persona-color, var(--accent)) 20%, #f1eee6) 0%,
      #f8f5ef 32%,
      #f8f5ef 68%,
      color-mix(in srgb, var(--persona-color, var(--accent)) 20%, #f1eee6) 100%
    );
  box-shadow: 0 16px 34px rgba(24, 52, 48, 0.045);
  isolation: isolate;
}

.conversation-persona::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: auto;
  background:
    linear-gradient(90deg, transparent 49.9%, rgba(40, 62, 57, 0.035) 50%, transparent 50.1%),
    linear-gradient(0deg, transparent 49.9%, rgba(40, 62, 57, 0.025) 50%, transparent 50.1%);
  background-size: 74px 74px;
  content: "";
  opacity: 0.5;
  mask-image: radial-gradient(circle at center, #000 0, transparent 68%);
  pointer-events: none;
}

.conversation-persona::after {
  position: absolute;
  right: 18%;
  bottom: 44px;
  left: 18%;
  display: block;
  height: 28px;
  border-radius: 50%;
  background: rgba(28, 58, 54, 0.12);
  filter: blur(18px);
  content: "";
  pointer-events: none;
}

.persona-animation-scene {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  pointer-events: none;
}

.persona-animation-scene::after {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 0;
  left: 0;
  height: 62px;
  background: linear-gradient(180deg, transparent, rgba(240, 237, 229, 0.96));
  content: "";
  pointer-events: none;
}

.face-tracking-panel {
  position: absolute;
  z-index: 7;
  top: 54px;
  left: 14px;
  width: auto;
  max-width: 180px;
  padding: 7px 10px;
  border: 1px solid rgba(40, 62, 57, 0.1);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.74);
  box-shadow: 0 10px 28px rgba(20, 45, 44, 0.1);
  backdrop-filter: blur(14px);
  pointer-events: none;
}

.face-tracking-panel video {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  clip-path: inset(50%);
  pointer-events: none;
}

.face-tracking-status {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  padding: 0;
  color: #687671;
  font-size: 7px;
  font-weight: 750;
  line-height: 1.25;
}

.face-tracking-status span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.face-tracking-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #d89b54;
  box-shadow: 0 0 0 3px rgba(216, 155, 84, 0.1);
}

.face-tracking-panel[data-state="found"] .face-tracking-dot {
  background: #62b090;
  box-shadow: 0 0 0 3px rgba(98, 176, 144, 0.12);
}

.face-tracking-panel[data-state="loading"] .face-tracking-dot {
  animation: stage-speaking-pulse 700ms ease-in-out infinite alternate;
}

.persona-aura {
  position: absolute;
  top: 49%;
  left: 50%;
  border: 1px solid color-mix(in srgb, var(--persona-color, var(--accent)) 24%, transparent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: persona-aura-breathe 6s ease-in-out infinite alternate;
}

.persona-aura.one {
  width: min(45vh, 390px);
  height: min(45vh, 390px);
}

.persona-aura.two {
  width: min(33vh, 285px);
  height: min(33vh, 285px);
  animation-delay: -2.5s;
}

.persona-header-avatar {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(72%, 520px);
  height: 100%;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  filter: drop-shadow(0 24px 30px rgba(24, 52, 48, 0.16));
  -webkit-mask-image: linear-gradient(
    180deg,
    #000 0%,
    #000 86%,
    rgba(0, 0, 0, 0.88) 95%,
    transparent 100%
  );
  mask-image: linear-gradient(
    180deg,
    #000 0%,
    #000 86%,
    rgba(0, 0, 0, 0.88) 95%,
    transparent 100%
  );
  transition: filter 450ms ease;
  transform: translate(-50%, -50%);
  transform-origin: 50% 78%;
  transform-style: preserve-3d;
  animation: persona-body-idle 5.8s ease-in-out infinite;
}

.persona-header-avatar::before {
  position: absolute;
  z-index: -1;
  inset: 8% 1% 1% 5%;
  border-radius: 44% 44% 22% 22%;
  background: linear-gradient(90deg, rgba(25, 52, 48, 0.16), transparent 70%);
  content: "";
  filter: blur(12px);
  transform: translate3d(18px, 9px, -24px);
}

.persona-header-avatar .portrait-art,
.persona-header-avatar svg {
  overflow: visible;
}

.persona-header-avatar .portrait-head-tracking {
  transform-box: fill-box;
  transform-origin: 50% 58%;
  transform:
    rotateX(var(--head-pitch, 0deg))
    rotateY(var(--head-yaw, 0deg));
  transform-style: preserve-3d;
  transition: transform 70ms linear;
  will-change: transform;
}

.persona-header-avatar .portrait-head {
  transform-box: fill-box;
  transform-origin: 50% 62%;
  transform-style: preserve-3d;
  animation: persona-head-idle 6.4s ease-in-out infinite;
}

.persona-header-avatar .portrait-eyes {
  transform-box: fill-box;
  transform-origin: center;
  animation: persona-blink 5.1s infinite;
}

.persona-header-avatar .portrait-mouth {
  transform-box: fill-box;
  transform-origin: center;
}

.persona-header-avatar .portrait-pupils {
  transform-box: fill-box;
  transform-origin: center;
  transform: translate(var(--gaze-x, 0px), var(--gaze-y, 0px));
  transition: transform 100ms linear;
  will-change: transform;
}

.conversation-persona.is-speaking .portrait-mouth {
  transform:
    translateY(var(--mouth-lift, 0))
    scale(var(--mouth-width, 1), var(--mouth-open, 0.72));
  will-change: transform;
}

.conversation-persona.is-speaking .persona-header-avatar {
  filter:
    drop-shadow(0 26px 34px rgba(24, 52, 48, 0.18))
    brightness(1.015);
}

.conversation-persona.mouth-fallback.is-speaking .portrait-mouth {
  animation: persona-mouth-talk 280ms ease-in-out infinite alternate;
}

.persona-stage-speaking {
  position: absolute;
  z-index: 5;
  bottom: 91px;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border: 1px solid rgba(52, 107, 88, 0.12);
  border-radius: 999px;
  color: #42685d;
  background: rgba(255, 253, 248, 0.82);
  box-shadow: 0 8px 24px rgba(24, 52, 48, 0.07);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.07em;
  opacity: 0;
  transform: translate(-50%, 6px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.conversation-persona.is-speaking .persona-stage-speaking {
  opacity: 1;
  transform: translate(-50%, 0);
}

.composer-wrap .speech-status {
  display: none !important;
}

.stage-speaking-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6ab295;
  box-shadow: 0 0 0 4px rgba(106, 178, 149, 0.11);
  animation: stage-speaking-pulse 600ms ease-in-out infinite alternate;
}

.persona-header-identity {
  position: absolute;
  z-index: 4;
  top: auto;
  bottom: 0;
  left: 50%;
  display: block;
  width: min(430px, calc(100% - 32px));
  max-width: none;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 24px;
  background:
    radial-gradient(
      circle at 8% 0%,
      color-mix(in srgb, var(--persona-color, var(--accent)) 30%, transparent),
      transparent 52%
    ),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 250, 242, 0.94));
  box-shadow:
    0 -12px 34px rgba(28, 61, 53, 0.09),
    0 12px 30px rgba(28, 61, 53, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  overflow: hidden;
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.persona-header-identity::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--persona-color, var(--accent)) 34%,
    #f0d3a6 68%,
    transparent
  );
  content: "";
}

.persona-header-identity::after {
  position: absolute;
  top: -76px;
  right: -54px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: color-mix(
    in srgb,
    var(--persona-color, var(--accent)) 19%,
    transparent
  );
  content: "";
  filter: blur(8px);
  pointer-events: none;
}

.persona-header-main {
  position: relative;
  padding: 14px 16px 13px 21px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.2), transparent 45%);
}

.persona-header-main::before {
  position: absolute;
  top: 50%;
  left: 11px;
  width: 3px;
  height: 38px;
  border-radius: 99px;
  background: var(--persona-color, var(--accent));
  box-shadow: 0 0 14px color-mix(in srgb, var(--persona-color, var(--accent)) 52%, transparent);
  content: "";
  transform: translateY(-50%);
}

.conversation-persona-top {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  grid-template-areas:
    "title title title level"
    "role separator language level";
  column-gap: 6px;
  row-gap: 5px;
  align-items: center;
  justify-content: flex-start;
}

.persona-title-group {
  position: relative;
  grid-area: title;
  padding-left: 12px;
}

.persona-title-group::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--persona-color, var(--accent));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--persona-color, var(--accent)) 14%, transparent);
  content: "";
  transform: translateY(-50%);
}

.conversation-persona h1 {
  color: #183b33;
  font-size: 22px;
  letter-spacing: -0.035em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.persona-header-role {
  grid-area: role;
  padding: 0;
  border: 0;
  color: #58766c;
  background: transparent;
  font-size: 7px;
  letter-spacing: 0.13em;
}

.persona-meta-separator {
  grid-area: separator;
  color: rgba(42, 80, 69, 0.28);
  font-size: 8px;
}

.persona-header-language {
  grid-area: language;
  overflow: hidden;
  color: #667d75;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.persona-level {
  grid-area: level;
  display: grid;
  min-width: 49px;
  min-height: 40px;
  padding: 5px 9px;
  place-items: center;
  align-self: center;
  border: 1px solid color-mix(in srgb, var(--persona-color, var(--accent)) 34%, #fff);
  border-radius: 14px;
  color: color-mix(in srgb, var(--persona-color, var(--accent)) 54%, #29483f);
  background:
    linear-gradient(
      145deg,
      color-mix(in srgb, var(--persona-color, var(--accent)) 22%, #fff),
      rgba(255, 255, 255, 0.9)
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 5px 15px color-mix(in srgb, var(--persona-color, var(--accent)) 12%, transparent);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.06em;
}

.persona-header-actions {
  position: absolute;
  z-index: 6;
  top: 54px;
  right: clamp(14px, 3vw, 34px);
}

.eye-tracking-button {
  display: inline-flex;
  width: auto;
  min-width: 29px;
  height: 29px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid rgba(40, 62, 57, 0.09);
  border-radius: 999px;
  color: #82908b;
  background: rgba(255, 253, 248, 0.7);
  backdrop-filter: blur(12px);
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
  font-size: 8px;
  font-weight: 750;
  white-space: nowrap;
}

.eye-tracking-button:hover {
  color: #4b6760;
  background: rgba(255, 253, 248, 0.95);
}

.eye-tracking-button.is-on {
  border-color: rgba(217, 121, 66, 0.24);
  color: #b65f31;
  background: rgba(255, 239, 226, 0.92);
  box-shadow:
    0 0 0 4px rgba(234, 160, 101, 0.09),
    inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.eye-tracking-button svg {
  width: 14px;
  height: 14px;
}

.persona-header-role {
  color: color-mix(in srgb, var(--persona-color, var(--accent)) 62%, #4d5c56);
}

.memory-chip {
  background: rgba(255, 253, 248, 0.7);
  backdrop-filter: blur(12px);
}

.clear-chat-button {
  background: rgba(255, 253, 248, 0.7);
  backdrop-filter: blur(12px);
}

@keyframes persona-body-idle {
  0%,
  100% {
    transform:
      translate(-50%, -50%)
      translate3d(-2px, 1px, 0)
      rotateY(-1.1deg)
      scale(1);
  }
  32% {
    transform:
      translate(-50%, -50%)
      translate3d(1.5px, -3px, 0)
      rotateY(0.35deg)
      scale(1.004);
  }
  66% {
    transform:
      translate(-50%, -50%)
      translate3d(2.5px, 0, 0)
      rotateY(1.1deg)
      scale(1);
  }
}

@keyframes persona-body-speaking {
  0%,
  100% {
    transform: translate(-50%, -50%) rotateY(-0.8deg);
  }
  45% {
    transform: translate(-50%, -50%) rotateY(0.8deg);
  }
  70% {
    transform: translate(-50%, -50%) rotateY(-0.2deg);
  }
}

@keyframes persona-head-idle {
  0%,
  100% {
    transform: rotateX(-0.8deg) rotateY(-3deg);
  }
  32% {
    transform: rotateX(1.4deg) rotateY(2.2deg);
  }
  64% {
    transform: rotateX(0.45deg) rotateY(3.2deg);
  }
  82% {
    transform: rotateX(-1.2deg) rotateY(0.4deg);
  }
}

@keyframes persona-head-talking {
  0%,
  100% {
    transform: rotateY(-2.4deg);
  }
  28% {
    transform: rotateY(2.8deg);
  }
  56% {
    transform: rotateY(-1deg);
  }
  78% {
    transform: rotateY(1.5deg);
  }
}

@keyframes persona-head-thinking {
  0%,
  100% {
    transform: rotateY(-2deg);
  }
  50% {
    transform: rotateY(2.2deg);
  }
}

@keyframes persona-head-listening {
  0%,
  100% {
    transform: rotateY(-1.8deg);
  }
  50% {
    transform: rotateY(1.2deg);
  }
}

@keyframes persona-blink {
  0%,
  43%,
  46%,
  74%,
  77%,
  100% {
    transform: scaleY(1);
  }
  44.2%,
  75.2% {
    transform: scaleY(0.08);
  }
}

@keyframes persona-mouth-talk {
  from {
    transform: scaleY(0.72) translateY(1px);
  }
  to {
    transform: scaleY(1.38) translateY(-1px);
  }
}

@keyframes persona-aura-breathe {
  from {
    opacity: 0.42;
    transform: translate(-50%, -50%) scale(0.96);
  }
  to {
    opacity: 0.78;
    transform: translate(-50%, -50%) scale(1.04);
  }
}

@keyframes stage-speaking-pulse {
  to {
    opacity: 0.5;
    box-shadow: 0 0 0 7px rgba(106, 178, 149, 0.03);
  }
}

@media (prefers-reduced-motion: reduce) {
  .persona-header-avatar {
    animation-duration: 5.8s !important;
    animation-iteration-count: infinite !important;
  }

  .persona-header-avatar .portrait-head {
    animation-duration: 6.4s !important;
    animation-iteration-count: infinite !important;
  }

  .persona-header-avatar .portrait-eyes {
    animation-duration: 5.1s !important;
    animation-iteration-count: infinite !important;
  }
}

@media (max-width: 840px) {
  .conversation-persona {
    height: 50dvh;
    min-height: 280px;
  }

  .persona-header-avatar {
    top: 50%;
    width: 100%;
    height: 100%;
  }

  .persona-header-identity {
    top: auto;
    bottom: 8px;
    width: calc(100% - 24px);
    max-width: none;
    padding: 0;
    border-radius: 18px;
  }

  .persona-header-main {
    padding: 10px 13px 9px 17px;
  }

  .persona-header-actions {
    top: 9px;
    right: 9px;
  }

  .face-tracking-panel {
    top: 84px;
    left: 9px;
    width: auto;
    max-width: 160px;
  }

  .face-tracking-status {
    padding-top: 4px;
    font-size: 6px;
  }

  .persona-stage-speaking {
    bottom: 75px;
  }
}

@media (max-width: 480px) {
  .conversation-persona {
    height: 48dvh;
    min-height: 250px;
  }

  .persona-header-avatar {
    height: 100%;
  }

  .persona-header-identity {
    width: calc(100% - 18px);
    max-width: none;
    border-radius: 16px;
  }

  .conversation-persona h1 {
    font-size: 17px;
  }

  .persona-header-role {
    padding: 0;
    font-size: 6.5px;
  }

  .persona-level {
    min-width: 44px;
    min-height: 36px;
    padding: 4px 6px;
    font-size: 9px;
  }

  .persona-header-language {
    font-size: 8px;
  }

  .persona-stage-speaking {
    bottom: 66px;
    padding: 5px 8px;
  }

  .persona-aura.one {
    width: min(39dvh, 310px);
    height: min(39dvh, 310px);
  }

  .persona-aura.two {
    width: min(29dvh, 230px);
    height: min(29dvh, 230px);
  }
}
