:root {
  color-scheme: dark;
  --app-height: 100vh;
  --safe-area-bottom: env(safe-area-inset-bottom);
  --surface-bg: #000000;
  --surface-panel: #000000;
  --surface-card: #121212;
  --surface-muted: #0a0a0a;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --muted: #a6a6a6;
  --brand: #ffffff;
  --brand-strong: #f4f4f4;
  --danger: #c8372d;
  --danger-soft: rgba(200, 55, 45, 0.1);
  --success: #177f47;
  --success-soft: rgba(23, 127, 71, 0.1);
  --user-bubble: #303030;
  --assistant-text: #ffffff;
  --sidebar-width: 88vw;
  --composer-height: 74px;
  --composer-scrim: rgba(0, 0, 0, 0.94);
  --shadow-soft: 0 20px 40px rgba(0, 0, 0, 0.22);
  --sidebar-translate: -100%;
  --sidebar-scrim-opacity: 0;
}

@supports (height: 100dvh) {
  :root {
    --app-height: 100dvh;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  min-height: 100%;
  background: var(--surface-bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  overscroll-behavior: none;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html {
  height: -webkit-fill-available;
}

body {
  height: var(--app-height);
  min-height: var(--app-height);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
}

.is-hidden {
  display: none !important;
}

.app-root {
  height: var(--app-height);
  min-height: var(--app-height);
}

@supports (-webkit-touch-callout: none) {
  body,
  .app-root,
  .chat-screen {
    min-height: -webkit-fill-available;
  }
}

.screen {
  min-height: var(--app-height);
  padding: max(20px, env(safe-area-inset-top)) 20px calc(20px + var(--safe-area-bottom));
  display: grid;
  place-items: center;
}

.screen-auth,
.screen-gate,
.screen-splash {
  background:
    radial-gradient(circle at top, rgba(237, 160, 34, 0.22), transparent 32%),
    linear-gradient(180deg, #0f0f10 0%, #090909 100%);
  color: #ffffff;
}

.screen-splash {
  padding: max(24px, env(safe-area-inset-top)) 24px calc(24px + var(--safe-area-bottom));
}

.splash-shell {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.splash-title {
  margin: 0;
  font-size: clamp(2.2rem, 9vw, 3rem);
  line-height: 0.94;
  letter-spacing: -0.04em;
  color: #ffffff;
  animation: splash-breathe 1.8s ease-in-out infinite;
}

.splash-status {
  margin: 0;
  min-height: 1.1rem;
  color: rgba(255, 255, 255, 0.48);
  font-size: 0.76rem;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.support-inline {
  margin: 6px 0 0;
  max-width: 24rem;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.83rem;
  line-height: 1.5;
}

.support-inline a {
  color: #ffffff;
  font-weight: 600;
  text-decoration: none;
}

.screen-splash.is-error .splash-title {
  animation: none;
}

.splash-retry {
  width: auto;
  min-width: 9rem;
  margin-top: 6px;
}

@keyframes splash-breathe {
  0%, 100% {
    opacity: 0.82;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-1px);
  }
}

.auth-card,
.gate-card {
  width: min(100%, 27rem);
  padding: 28px 22px 22px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.32);
}

.auth-logo {
  width: 66px;
  height: 66px;
  border-radius: 18px;
  margin-bottom: 18px;
}

.auth-kicker {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.72);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 700;
}

.screen-gate .auth-kicker {
  color: var(--brand);
}

.auth-title,
.gate-card h2 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 2.65rem);
  line-height: 0.96;
}

.auth-copy,
.gate-copy {
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.5;
  font-size: 0.97rem;
}

.auth-form {
  margin-top: 22px;
}

.webview-warning {
  margin-top: 18px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(237, 160, 34, 0.28);
  background: rgba(237, 160, 34, 0.12);
  display: grid;
  gap: 10px;
}

.webview-warning-title {
  margin: 0;
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 700;
}

.webview-warning-copy {
  margin: 0;
  color: rgba(255, 246, 223, 0.84);
  font-size: 0.88rem;
  line-height: 1.45;
}

.webview-warning-btn {
  min-height: 46px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field span {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.78);
}

.field input {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 16px;
  outline: none;
}

.field input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.field input:focus {
  border-color: rgba(237, 160, 34, 0.72);
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border-radius: 18px;
  font-weight: 700;
  font-size: inherit;
  text-decoration: none;
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease;
}

.btn:active {
  transform: scale(0.985);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand);
  color: #111111;
}

.btn-primary:hover {
  background: var(--brand-strong);
}

.auth-card.is-webview .btn-primary {
  background: linear-gradient(180deg, #ffffff 0%, #f0f0f0 100%);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

.auth-card.is-webview .btn-secondary.google-disabled {
  opacity: 0.44;
  border-color: rgba(255, 255, 255, 0.08);
}

.gate-card .btn-primary {
  background: #ffffff;
  color: #0d0d0d;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.gate-card .btn-primary:hover {
  background: #ececec;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-form .btn + .btn,
.gate-card .btn + .btn {
  margin-top: 10px;
}

.support-card {
  margin-top: 18px;
  padding: 14px 15px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.support-card-title {
  margin: 0;
  font-size: 0.93rem;
  font-weight: 700;
  color: #ffffff;
}

.support-card-copy {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.5;
  font-size: 0.9rem;
}

.support-card-copy a {
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  word-break: break-word;
}

.auth-switch {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.72);
}

.auth-switch button {
  background: none;
  color: #ffffff;
  text-decoration: underline;
  padding: 0;
}

.auth-contact {
  margin: 14px 0 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.86rem;
  line-height: 1.5;
}

.auth-contact a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
}

.status {
  min-height: 1.2rem;
  margin: 12px 0 0;
  font-size: 0.88rem;
  line-height: 1.4;
}

.status-error {
  color: #ff8f84;
}

.status-info {
  color: #87f0a0;
}

.chat-screen {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  height: var(--app-height);
  min-height: 0;
  overflow: hidden;
  background: var(--surface-bg);
}

.sidebar-scrim {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.35);
  opacity: var(--sidebar-scrim-opacity);
  pointer-events: none;
  transition: opacity 250ms ease-out;
  z-index: 20;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  max-width: 90vw;
  padding: max(12px, env(safe-area-inset-top)) 10px calc(10px + var(--safe-area-bottom));
  background: #000000;
  backdrop-filter: blur(18px);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  transform: translateX(var(--sidebar-translate));
  transition: transform 250ms ease-out;
  z-index: 21;
  display: flex;
  flex-direction: column;
  gap: 10px;
  will-change: transform;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 4px 8px 2px;
}

.sidebar-brand-title {
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #f5f5f5;
}

.sidebar-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px 4px;
}

.sidebar-compose-btn {
  flex: 0 0 auto;
  width: 46px;
  min-width: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0f0f0f;
  color: #f4f4f4;
  border: 1px solid rgba(255, 255, 255, 0.04);
  touch-action: manipulation;
}

.sidebar-compose-btn:hover {
  background: #0f0f0f;
}

.sidebar-compose-icon,
.sidebar-search-icon,
.sidebar-premium-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-compose-icon svg,
.sidebar-search-icon svg,
.sidebar-premium-icon svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: currentColor;
}

.sidebar-search {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #0f0f0f;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar-search-icon {
  color: #9c9c9c;
}

.sidebar-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: #f2f2f2;
  font-size: 16px;
  padding: 0;
  white-space: nowrap;
}

.sidebar-search input::placeholder {
  color: #9c9c9c;
  white-space: nowrap;
  opacity: 1;
}

body.sidebar-visible .sidebar-scrim {
  pointer-events: auto;
}

body.sidebar-dragging .sidebar,
body.sidebar-dragging .sidebar-scrim {
  transition: none;
}

.sidebar-section {
  min-height: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
}

.sidebar-section-title {
  margin: 0 0 8px;
  padding: 0 14px;
  color: #8c8c8c;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.conversation-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 4px 4px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overscroll-behavior-y: contain;
  user-select: none;
}

.conversation-group {
  display: grid;
  gap: 4px;
}

.conversation-group-title {
  padding: 0 10px 6px;
  color: #8f8f8f;
  font-size: 0.79rem;
  font-weight: 600;
  text-transform: none;
}

.conversation-row {
  width: 100%;
  min-height: 44px;
  min-width: 0;
  padding: 10px 10px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  transition: background 140ms ease, border-color 140ms ease;
  overflow: hidden;
}

.conversation-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.conversation-row.is-active {
  background: #0f0f0f;
  border-color: rgba(255, 255, 255, 0.05);
}

.conversation-title {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  display: block;
  font-weight: 500;
  line-height: 1.35;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conversation-meta {
  flex: 0 0 auto;
  display: block;
  margin-left: auto;
  padding-left: 8px;
  color: var(--muted);
  font-size: 0.76rem;
}

.empty-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: pre-line;
  text-align: center;
  color: #8a8a8a;
  line-height: 1.5;
  font-size: 1.25rem;
  padding: 24px 24px calc(var(--composer-height) + 24px);
}

.conversation-load-state {
  padding: 14px 12px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  text-align: center;
}

.chat-data-state {
  width: min(100%, 28rem);
  margin: auto;
  border: 0;
  background: transparent;
  color: var(--muted);
}

button.chat-data-state.is-error {
  flex: 0 0 auto;
  min-height: 48px;
  padding: 14px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface-muted);
  color: var(--text);
  cursor: pointer;
}

.sidebar-footer {
  position: relative;
  padding: 8px 4px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: grid;
  gap: 6px;
}

.sidebar-profile-wrap {
  position: relative;
}

.sidebar-profile-button {
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.sidebar-profile-button:hover {
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: #0f0f0f;
  color: #f5f5f5;
  font-size: 0.95rem;
  font-weight: 700;
}

.sidebar-profile-copy {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 4px;
}

.sidebar-profile-mainline {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  column-gap: 6px;
}

.sidebar-profile-name,
.sidebar-profile-email {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-profile-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: #f2f2f2;
}

.sidebar-profile-email {
  font-size: 0.78rem;
  color: #a2a2a2;
}

.sidebar-profile-badge {
  justify-self: start;
  width: fit-content;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(246, 196, 81, 0.16);
  border: 1px solid rgba(246, 196, 81, 0.35);
  color: #f6c451;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-profile-chevron {
  flex: 0 0 auto;
  color: #8a8a8a;
  font-size: 0.92rem;
}

.header-version {
  font-size: 0.72rem;
  font-weight: 400;
  color: #6e6e6e;
  margin-left: 6px;
}

.profile-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  padding: 8px;
  border-radius: 16px;
  background: rgba(34, 34, 34, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
  display: grid;
  gap: 4px;
  z-index: 24;
}

.profile-menu-item {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  background: transparent;
  color: #f2f2f2;
  text-decoration: none;
  font-size: 0.9rem;
}

.profile-menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.profile-menu-item.is-danger {
  color: #ff9b92;
}

.chat-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--surface-bg);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: calc(env(safe-area-inset-top) + 12px) 18px 10px;
  background: transparent;
}

.chat-header-leading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.chat-header-copy {
  display: flex;
  align-items: center;
  min-width: 0;
}

.chat-header-title {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f5f5f5;
}

.icon-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #303030;
  color: #f0f0f0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: none;
  user-select: none;
}

.hamburger-icon,
.hamburger-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

.notice-banner {
  position: absolute;
  left: 14px;
  right: 14px;
  z-index: 4;
  min-height: 44px;
  padding: 12px 14px;
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  font-size: 0.9rem;
  line-height: 1.4;
}

.notice-offline {
  top: calc(env(safe-area-inset-top) + 74px);
  background: #0a0a0a;
  color: #ffffff;
}

.notice-update {
  top: calc(env(safe-area-inset-top) + 74px);
  z-index: 6;
  background: #ffffff;
  border: none;
  color: #0d0d0d;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: background 140ms ease;
}

.notice-update:hover {
  background: #ececec;
}

.notice-stream {
  display: none;
}

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: 10px 16px calc(var(--composer-offset, var(--composer-height)) + 18px);
  display: flex;
  flex-direction: column;
  gap: 26px;
  scroll-padding-bottom: calc(var(--composer-offset, var(--composer-height)) + 28px);
  user-select: none;
}

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

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

.message-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(100%, 48rem);
  max-width: min(100%, 48rem);
}

.message-stack.user {
  align-items: flex-end;
}

.message-stack.assistant {
  align-items: flex-start;
}

.message-text {
  margin: 0;
  color: var(--assistant-text);
  line-height: 1.7;
  font-size: 0.98rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.message-text strong {
  font-weight: 700;
}

.message-text em {
  font-style: italic;
}

.message-bubble {
  max-width: 100%;
}

.message-bubble.user {
  padding: 10px 14px;
  border-radius: 18px;
  background: #3a3a3a;
}

.message-bubble.assistant {
  padding: 0;
}

.message-bubble.assistant.is-typing {
  padding: 10px 14px;
  border-radius: 18px;
  background: #0f0f0f;
}

.typing-indicator {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  min-height: 18px;
  padding: 0;
}

.typing-label {
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.58);
}

.typing-dots {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  margin-left: 1px;
}

.typing-dot {
  display: inline-block;
  min-width: 0.18em;
  font-size: 0.82rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.34);
  opacity: 0.28;
  text-shadow: 0 0 0 rgba(255, 255, 255, 0);
  animation: typing-dot-glow 1.1s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.12s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.24s;
}

@keyframes typing-dot-glow {
  0%, 100% {
    color: rgba(255, 255, 255, 0.32);
    opacity: 0.25;
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
  40% {
    color: rgba(255, 255, 255, 0.92);
    opacity: 1;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.36);
  }
}

.message-time {
  font-size: 0.72rem;
  color: var(--muted);
  padding: 9px 4px;
}

.message-media {
  display: grid;
  grid-template-columns: minmax(0, max-content);
  gap: 6px;
  margin-bottom: 8px;
}

.message-media-item {
  display: block;
  width: 100%;
  max-width: 236px;
}

.message-media-button {
  width: 100%;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 14px;
  overflow: hidden;
  display: block;
}

.message-media-thumb {
  display: block;
  width: 100%;
  max-width: 236px;
  max-height: 190px;
  object-fit: cover;
  border-radius: 14px;
  cursor: pointer;
}

.message-media-item:only-child .message-media-thumb {
  max-width: 236px;
  max-height: 190px;
}

.message-media:has(.message-media-item:nth-child(2)) {
  grid-template-columns: repeat(2, minmax(0, 156px));
  gap: 6px;
}

.message-media:has(.message-media-item:nth-child(2)) .message-media-item {
  max-width: 156px;
}

.message-media:has(.message-media-item:nth-child(2)) .message-media-thumb {
  max-width: 156px;
  max-height: 132px;
}

.message-media-fallback {
  width: 100%;
  min-height: 132px;
  max-width: 100%;
  padding: 14px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  text-align: left;
}

.message-media-fallback-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #f1f1f1;
}

.message-media-fallback-detail {
  font-size: 0.76rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.64);
}

.message-media-retry {
  margin-top: 2px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #f1f1f1;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.message-media-retry:hover,
.message-media-retry:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
}

.message-media-item.is-loading .message-media-retry {
  opacity: 0.7;
  pointer-events: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.94);
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom));
}

.lightbox-backdrop {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  touch-action: none;
}

.lightbox-image {
  display: block;
  width: auto;
  max-width: min(96vw, 1200px);
  max-height: min(88vh, 1200px);
  border-radius: 18px;
  object-fit: contain;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 1.25rem;
  z-index: 1;
}

.message-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
}

.message-action-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #8f8f8f;
  border: 0;
  box-shadow: none;
  transition: color 140ms ease, background 140ms ease, transform 140ms ease;
}

.message-action-btn:hover,
.message-action-btn:active,
.message-action-btn.is-active {
  color: #d0d0d0;
  background: rgba(255, 255, 255, 0.06);
}

.message-action-btn:disabled {
  opacity: 0.38;
  cursor: default;
}

.message-action-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

.message-bubble.user.is-pending {
  opacity: 0.72;
}

.day-separator {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.72rem;
  width: min(100%, 48rem);
  align-self: center;
  justify-content: center;
}

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

.composer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 56px;
  padding: 6px 14px calc(4px + var(--safe-area-bottom));
  border-radius: 0;
  background: var(--surface-bg);
  border-top: 1px solid var(--line);
  backdrop-filter: none;
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.18);
}

/* Zone opaque : aucun message ne doit rester visible derrière le composer,
   notamment pendant le scroll ou lorsque le clavier iOS est ouvert. */
.composer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--surface-bg);
}

.composer-shell {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1 1 auto;
  min-width: 0;
  padding: 4px 6px;
  border-radius: 22px;
  background: #2f2f2f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

.composer-image-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.composer-image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 88px));
  gap: 10px;
  align-items: start;
  justify-content: flex-start;
  padding: 4px 0 10px;
}

.composer-image-card {
  position: relative;
  width: 88px;
  height: 88px;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.composer-image-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.composer-image-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 17, 17, 0.74);
  color: #f5f5f5;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

.composer-status {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.35;
  text-align: center;
}

.composer-status[data-tone="error"] {
  color: #ff9b92;
}

.composer-status[data-tone="info"] {
  color: #9d9d9d;
}

/* Mention légale : dernier élément de la liste (comme sur iOS), aligné à
   droite, visible une seule fois, et qui défile avec les messages. */
.chat-disclaimer {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  align-self: flex-end;
  gap: 2px;
  margin: 0;
  padding: 16px 4px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.25;
  text-align: right;
  user-select: text;
}

.composer-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: 100%;
}

.composer-main {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 38px;
}

.composer-actions-trailing {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.composer-plus-btn {
  position: relative;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  margin: 0 0 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #b6b6b6;
  border: 0;
  font-size: 1.9rem;
  font-weight: 300;
  line-height: 1;
  padding: 0;
  opacity: 1;
}

.composer-plus-btn:disabled {
  cursor: default;
  opacity: 1;
}

.composer-image-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ffffff;
  color: #0d0d0d;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}

.voice-capture-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--composer-height) + 8px);
  z-index: 9;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #262626;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
}

.voice-capture-bar.is-recording {
  background: #301818;
  border-color: rgba(255, 120, 120, 0.18);
}

.voice-capture-bar.is-error {
  background: #311e1e;
  border-color: rgba(255, 143, 132, 0.2);
}

.voice-capture-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.voice-capture-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #7e7e7e;
  flex: 0 0 auto;
}

.voice-capture-bar.is-recording .voice-capture-dot {
  background: #ff6f61;
  box-shadow: 0 0 0 6px rgba(255, 111, 97, 0.12);
}

.voice-capture-bar.is-ready .voice-capture-dot {
  background: #87f0a0;
}

.voice-capture-bar.is-error .voice-capture-dot {
  background: #ff8f84;
}

.voice-capture-copy span:last-child {
  min-width: 0;
  color: #f0f0f0;
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-capture-clear {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e2e2;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  font-weight: 600;
}

.record-btn {
  flex: 0 0 auto;
  align-self: center;
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #3a3a3a;
  color: #9b9b9b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: none;
  transition: transform 140ms ease, background 140ms ease, color 140ms ease, border-color 140ms ease;
}

.record-btn-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.record-btn-icon svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: currentColor;
}

.record-btn-status-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #ff6f61;
  opacity: 0;
  transform: scale(0.65);
  transition: opacity 140ms ease, transform 140ms ease;
  pointer-events: none;
}

.record-btn.is-recording {
  background: #4a2020;
  color: rgba(255, 212, 206, 0);
  border-color: rgba(255, 120, 120, 0.25);
}

.record-btn.is-recording .record-btn-status-dot {
  opacity: 1;
  transform: scale(1);
  animation: record-pulse 1.15s ease-in-out infinite;
}

.record-btn.is-ready {
  color: #f0f0f0;
  background: #424242;
}

.record-btn.is-error {
  color: #ff8f84;
}

.composer textarea {
  flex: 1;
  width: 100%;
  min-height: 38px;
  max-height: 140px;
  display: block;
  resize: none;
  border: 0;
  outline: none;
  background: transparent;
  color: #f1f1f1;
  font-size: 16px;
  margin: 0;
  padding: 8px 6px;
  line-height: 1.4;
  overflow-y: auto;
  box-sizing: border-box;
  -webkit-appearance: none;
  scrollbar-width: none;
}

.composer textarea::-webkit-scrollbar {
  display: none;
}

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

.send-btn {
  flex: 0 0 auto;
  align-self: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f4f4f4;
  color: #111111;
  font-weight: 800;
  font-size: 1rem;
}

@media (min-width: 768px) {
  .composer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .composer-row {
    max-width: min(100%, 54rem);
    margin: 0 auto;
  }

  .composer-shell {
    max-width: none;
    margin: 0;
  }

}

.settings-panel {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 12px calc(12px + var(--safe-area-bottom));
  background: rgba(17, 17, 17, 0.28);
  backdrop-filter: blur(10px);
}

.settings-scrim {
  position: absolute;
  inset: 0;
}

.settings-card {
  position: relative;
  width: min(100%, 32rem);
  padding: 18px;
  border-radius: 24px;
  background: #121212;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
}

.settings-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.settings-kicker {
  margin: 0 0 6px;
  color: #9e9e9e;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-head h2 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1;
}

.settings-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #2d2d2d;
  color: #f4f4f4;
}

.settings-body {
  margin-top: 14px;
  display: grid;
  gap: 16px;
}

.settings-section {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: #0f0f0f;
  overflow: hidden;
}

.settings-section-legal {
  background: transparent;
  gap: 1px;
}

.settings-section-legal .settings-row {
  background: #0f0f0f;
  border-radius: 0;
}

.settings-section-legal .settings-row:first-child {
  border-radius: 14px 14px 0 0;
}

.settings-section-legal .settings-row:last-child {
  border-radius: 0 0 14px 14px;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  min-height: 48px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

.settings-row + .settings-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.settings-row:active {
  background: rgba(255, 255, 255, 0.06);
}

.settings-row-info {
  cursor: default;
}

.settings-row-info:active {
  background: transparent;
}

.settings-row-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #a6a6a6;
}

.settings-row-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-email-value {
  color: #a6a6a6;
  font-size: 0.88rem;
}

.settings-row-chevron {
  flex-shrink: 0;
  color: #666;
  font-size: 1.2rem;
  line-height: 1;
}

.settings-row-badge {
  flex-shrink: 0;
  font-size: 0.78rem;
  color: #a6a6a6;
  background: rgba(255, 255, 255, 0.06);
  padding: 3px 8px;
  border-radius: 8px;
}

.settings-row-danger {
  color: var(--danger);
}

.settings-row-danger .settings-row-icon {
  color: var(--danger);
}

@keyframes record-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 111, 97, 0.24);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(255, 111, 97, 0);
  }
}

.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.4);
  backdrop-filter: blur(14px);
  padding: max(14px, env(safe-area-inset-top)) 14px calc(14px + var(--safe-area-bottom));
  display: flex;
  align-items: flex-end;
  z-index: 30;
}

@media (display-mode: standalone) {
  html {
    background: var(--surface-bg);
  }
  .sidebar {
    padding-bottom: 4px;
  }
  .composer {
    padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px));
  }
}

.onboarding-card {
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
  padding: 18px;
  border-radius: 28px;
  background: #0f0f0f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.45);
}

.onboarding-progress {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #424242;
  overflow: hidden;
}

.onboarding-progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: #ffffff;
  transition: width 180ms ease;
}

.onboarding-head {
  margin-top: 16px;
}

.onboarding-head .auth-kicker {
  color: #b4b4b4;
}

.onboarding-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 7vw, 2.25rem);
  line-height: 1.02;
  color: #ffffff;
}

.onboarding-subtitle {
  margin: 10px 0 0;
  color: #b4b4b4;
  line-height: 1.45;
}

.onboarding-body {
  margin-top: 18px;
  display: grid;
  gap: 10px;
  max-height: min(50dvh, 26rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.onboarding-option,
.onboarding-input {
  width: 100%;
  border-radius: 18px;
  border: 1px solid #424242;
  background: #0f0f0f;
  color: #ffffff;
  text-align: left;
}

.onboarding-option {
  padding: 16px;
}

.onboarding-option.is-selected {
  border-color: #ffffff;
  background: #ffffff;
  color: #0d0d0d;
}

.onboarding-option-title {
  display: block;
  font-weight: 700;
}

.onboarding-option-copy {
  display: block;
  margin-top: 6px;
  color: #b4b4b4;
  line-height: 1.4;
  font-size: 0.9rem;
}

.onboarding-option.is-selected .onboarding-option-copy {
  color: rgba(13, 13, 13, 0.65);
}

.onboarding-input {
  min-height: 54px;
  padding: 0 16px;
  font-size: 16px;
  outline: none;
}

.onboarding-input:focus {
  border-color: rgba(255, 255, 255, 0.5);
}

.onboarding-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

@media (min-width: 980px) {
  :root {
    --sidebar-width: 312px;
  }

  .chat-screen {
    grid-template-columns: var(--sidebar-width) 1fr;
  }

  .sidebar {
    position: relative;
    transform: none;
    transition: none;
    inset: auto;
    width: 100%;
    max-width: none;
    max-height: var(--app-height);
    z-index: 1;
  }

  .sidebar-scrim {
    display: none;
  }

  .chat-stage {
    border-left: 1px solid rgba(255, 255, 255, 0.05);
  }

  #openSidebarBtn {
    display: none;
  }

  .messages {
    padding-left: 40px;
    padding-right: 40px;
  }

  .composer {
    left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
  }

  .voice-capture-bar {
    left: calc(var(--sidebar-width) + 20px);
    right: 20px;
  }
}

/* ── Announcement overlay ── */

.announcement-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.5);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.announcement-card {
  width: 100%;
  max-width: 22rem;
  padding: 24px 22px 18px;
  border-radius: 20px;
  background: #121212;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.announcement-title {
  margin: 0 0 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #f5f5f5;
}

.announcement-message {
  margin: 0 0 20px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.78);
  white-space: pre-line;
}

.announcement-dismiss-btn {
  width: 100%;
  background: #ffffff;
  color: #0d0d0d;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.announcement-dismiss-btn:hover {
  background: #ececec;
}

/* ── PWA Install Modal ──────────────────────────────────────────────── */

#pwaInstallModal .pwa-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999;
}

#pwaInstallModal .pwa-card {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #0f0f0f;
  border-radius: 20px 20px 0 0;
  padding: 28px 24px calc(36px + var(--safe-area-bottom, 0px));
  z-index: 1000;
  text-align: center;
  max-width: 480px;
  margin: 0 auto;
}

#pwaInstallModal .pwa-icon {
  margin-bottom: 16px;
}

#pwaInstallModal .pwa-icon img {
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

#pwaInstallModal .pwa-title {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  margin: 0 0 8px;
  line-height: 1.3;
}

#pwaInstallModal .pwa-desc {
  font-size: 14px;
  color: #999;
  margin: 0 0 24px;
  line-height: 1.5;
}

#pwaInstallModal .pwa-steps {
  text-align: left;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#pwaInstallModal .pwa-step {
  display: flex;
  align-items: center;
  gap: 12px;
}

#pwaInstallModal .pwa-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0f0f0f;
  border: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  flex-shrink: 0;
}

#pwaInstallModal .pwa-step-text {
  font-size: 14px;
  color: #ccc;
  line-height: 1.4;
}

#pwaInstallModal .pwa-step-text strong {
  color: #fff;
}

#pwaInstallModal .pwa-arrow-hint {
  font-size: 12px;
  color: #666;
  margin-bottom: 20px;
  padding: 8px 16px;
  background: #222;
  border-radius: 8px;
}

#pwaInstallModal .pwa-btn-primary {
  width: 100%;
  background: #ffffff;
  color: #000;
  border: none;
  border-radius: 12px;
  padding: 15px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 10px;
  -webkit-appearance: none;
}

#pwaInstallModal .pwa-btn-primary:active {
  opacity: 0.85;
}

#pwaInstallModal .pwa-btn-secondary {
  width: 100%;
  background: transparent;
  color: #666;
  border: none;
  padding: 12px;
  font-size: 14px;
  cursor: pointer;
  -webkit-appearance: none;
}

#pwaInstallModal .pwa-btn-mute {
  width: 100%;
  background: transparent;
  color: #444;
  border: none;
  padding: 8px;
  font-size: 12px;
  cursor: pointer;
  -webkit-appearance: none;
  opacity: 0.6;
}

/* ── Thème clair : suivi du réglage du téléphone (prefers-color-scheme) ── */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --surface-bg: #ffffff;
    --surface-panel: #f7f7f7;
    --surface-card: #ffffff;
    --surface-muted: #f2f2f2;
    --line: rgba(0, 0, 0, 0.08);
    --line-strong: rgba(0, 0, 0, 0.14);
    --text: #0d0d0d;
    --muted: #6b6b6b;
    --brand: #0d0d0d;
    --brand-strong: #000000;
    --user-bubble: #f0f0f0;
    --assistant-text: #0d0d0d;
    --composer-scrim: rgba(255, 255, 255, 0.94);
  }

  html, body { background: var(--surface-bg); color: var(--text); }

  .sidebar {
    background: #f7f7f7;
    border-right-color: rgba(0, 0, 0, 0.06);
  }

  .sidebar-compose-btn,
  .sidebar-search,
  .sidebar-profile-btn {
    background: #ececec;
    color: #0d0d0d;
  }

  .sidebar-compose-btn:hover { background: #e2e2e2; }
  .conversation-row:hover { background: rgba(0, 0, 0, 0.05); }
  .conversation-row.is-active { background: #e8e8e8; }
  .chat-stage { border-left-color: rgba(0, 0, 0, 0.06); }

  .message-bubble.user { background: #f0f0f0; color: #0d0d0d; }
  .message-bubble.assistant.is-typing { background: #f2f2f2; }

  .composer-shell {
    background: #f2f2f2;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: none;
  }
  .composer textarea { color: #0d0d0d; }
  .composer-plus-btn { color: #6b6b6b; }
  .record-btn {
    background: #e6e6e6;
    color: #555555;
    border-color: rgba(0, 0, 0, 0.06);
  }
  .send-btn { background: #0d0d0d; color: #ffffff; }
  .empty-state { color: #8a8a8a; }
  .notice-offline, .notice-update { color: #0d0d0d; }
  .settings-card, .onboarding-card, .announcement-card, .pwa-card { background: #ffffff; color: #0d0d0d; }
}

/* ── Thème clair : lisibilité des composants (logo, profil, réglages) ── */
@media (prefers-color-scheme: light) {
  .sidebar-brand-title { color: #0d0d0d; }
  .chat-header-title { color: #0d0d0d; }
  .icon-btn {
    background: #ececec;
    color: #0d0d0d;
    border-color: rgba(0, 0, 0, 0.06);
  }
  .announcement-title { color: #0d0d0d; }
  .announcement-message { color: #3c3c3c; }
  .sidebar-profile-name { color: #0d0d0d; }
  .sidebar-profile-email { color: #6b6b6b; }
  .header-version { color: #9a9a9a; }
  .sidebar-section-title { color: #6b6b6b; }

  .sidebar-search {
    background: #ececec;
    border-color: rgba(0, 0, 0, 0.06);
    color: #0d0d0d;
  }
  .sidebar-search input { color: #0d0d0d; }
  .sidebar-search input::placeholder { color: #8a8a8a; }
  .sidebar-search-icon { color: #6b6b6b; }
  .sidebar-compose-btn { background: #ececec; color: #0d0d0d; }
  .sidebar-compose-btn:hover { background: #e2e2e2; }

  .settings-section { background: #f2f2f2; }
  .settings-section-legal .settings-row { background: #f2f2f2; }
  .settings-row { color: #0d0d0d; }
  .settings-row:active { background: rgba(0, 0, 0, 0.06); }
  .settings-row-badge {
    background: rgba(0, 0, 0, 0.06);
    color: #6b6b6b;
  }
  .settings-email-value { color: #6b6b6b; }
  .settings-row-chevron { color: #8a8a8a; }
  .settings-close-btn { background: #e6e6e6; color: #0d0d0d; }
  .settings-kicker { color: #6b6b6b; }
  .settings-scrim { background: rgba(0, 0, 0, 0.25); }

  .message-actions button { color: #6b6b6b; }
  .typing-indicator span { background: #b0b0b0; }
}
