:root {
  color-scheme: light dark;
  --bg: #f4ede2;
  --bg-soft: #fffaf4;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --text: #14212b;
  --muted: #66717c;
  --border: rgba(21, 32, 43, 0.1);
  --shadow: 0 30px 80px rgba(35, 28, 16, 0.22);
  --accent: #f26f3a;
  --accent-strong: #e95514;
  --accent-soft: rgba(242, 111, 58, 0.12);
  --assistant: #ffffff;
  --user: #fff0e7;
  --good: #1f7a57;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11161d;
    --bg-soft: #171d25;
    --panel: rgba(19, 24, 32, 0.92);
    --panel-strong: rgba(31, 38, 49, 0.96);
    --text: #eef3f8;
    --muted: #aab4bf;
    --border: rgba(255, 255, 255, 0.09);
    --shadow: 0 28px 72px rgba(0, 0, 0, 0.45);
    --accent: #ff8a56;
    --accent-strong: #ff6a2c;
    --accent-soft: rgba(255, 138, 86, 0.16);
    --assistant: #1a212b;
    --user: #2b1f18;
    --good: #68d49e;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(242, 111, 58, 0.12), transparent 24%),
    radial-gradient(circle at right center, rgba(58, 123, 213, 0.1), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
}

body.chat-open {
  overflow: hidden;
}

body.chat-open .chat-launcher {
  opacity: 0;
  transform: translateY(8px) scale(0.92);
  pointer-events: none;
}

button,
textarea {
  font: inherit;
}

button {
  appearance: none;
  border: none;
}

.chat-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 0 18px 0 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 18px 32px rgba(242, 111, 58, 0.28);
  cursor: pointer;
  transition:
    opacity 0.22s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.chat-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 38px rgba(242, 111, 58, 0.32);
}

.chat-launcher-icon {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 0.88rem;
  transform-origin: center;
  animation: assistant-launcher-pulse 2.8s ease-in-out infinite;
}

.chat-overlay {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.chat-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.chat-overlay.is-opening {
  opacity: 0;
  pointer-events: none;
}

.chat-overlay.is-closing {
  opacity: 0;
}

.chat-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.008), transparent 26%),
    radial-gradient(circle at 72% 12%, rgba(254, 113, 69, 0.018), transparent 20%),
    rgba(7, 11, 16, 0.08);
  backdrop-filter: blur(6px) saturate(110%);
  -webkit-backdrop-filter: blur(6px) saturate(110%);
}

.chat-drawer {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100vw - 24px));
  height: min(84vh, 820px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  opacity: 0;
  transform: translateY(26px) scale(0.97);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease;
}

.chat-overlay.is-open .chat-drawer {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.chat-overlay.is-opening .chat-drawer {
  opacity: 0;
  transform: translateY(38px) scale(0.94);
}

.chat-overlay.is-closing .chat-drawer {
  opacity: 0;
  transform: translateY(30px) scale(0.95);
}

.drawer-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "heading actions";
  column-gap: 12px;
  row-gap: 0;
  align-items: center;
  padding: 10px 10px 8px;
  margin-bottom: 0;
  border: 1px solid rgba(21, 32, 43, 0.08);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 249, 243, 0.88)),
    radial-gradient(circle at top right, rgba(242, 111, 58, 0.12), transparent 32%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 12px 28px rgba(21, 32, 43, 0.04);
}

.drawer-header[data-dir="rtl"] {
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "heading actions";
}

.drawer-heading {
  grid-area: heading;
  min-width: 0;
  display: grid;
  gap: 0;
}

.drawer-heading .eyebrow {
  font-size: 0.84rem;
  line-height: 1.08;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--accent-strong);
  opacity: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eyebrow {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-strong);
  opacity: 0.92;
}

.header-toolbar {
  grid-area: toolbar;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-width: 0;
  overflow: visible;
}

.mode-dropdown {
  position: relative;
  display: inline-flex;
  flex-wrap: nowrap;
  flex: 0 1 auto;
  min-width: 0;
  overflow: visible;
}

.mode-dropdown-button,
.language-button,
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  white-space: nowrap;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}

.mode-dropdown-button {
  background: rgba(255, 255, 255, 0.78);
  border-color: var(--border);
  gap: 8px;
  min-width: 126px;
  padding: 0 8px;
  font-size: 0.72rem;
  transition:
    transform 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.mode-dropdown-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.94);
}

.mode-dropdown-caret {
  font-size: 0.72rem;
  opacity: 0.72;
}

.mode-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-start: 0;
  z-index: 30;
  min-width: 214px;
  max-width: min(320px, calc(100vw - 32px));
  display: grid;
  gap: 2px;
  padding: 8px 0;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 20px 42px rgba(21, 32, 43, 0.14);
  backdrop-filter: blur(18px);
  direction: inherit;
}

.drawer-header[data-dir="rtl"] .mode-dropdown-menu {
  inset-inline-start: auto;
  inset-inline-end: 0;
}

.mode-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-align: start;
  opacity: 0.88;
  cursor: default;
  pointer-events: none;
}

.mode-option::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: transparent;
  flex: 0 0 auto;
}

.mode-option[aria-current="true"] {
  color: var(--accent-strong);
  font-weight: 900;
  opacity: 1;
}

.mode-option[aria-current="true"]::before {
  background: currentColor;
}

.mode-option[aria-current="false"] {
  color: var(--text);
}

.mode-option + .mode-option {
  border-top: 1px solid rgba(21, 32, 43, 0.04);
}

.language-switcher {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  z-index: 2;
  margin-inline-start: 0;
  align-self: center;
}

.language-button {
  gap: 5px;
  min-width: 0;
  padding: 0 8px;
  font-size: 0.72rem;
  background: var(--panel-strong);
  transition:
    transform 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease;
}

.language-button:hover {
  transform: translateY(-1px);
  background: rgba(21, 32, 43, 0.04);
  border-color: rgba(21, 32, 43, 0.14);
}

.language-button.is-active,
.language-button[aria-expanded="true"] {
  background: rgba(242, 111, 58, 0.24);
  border-color: rgba(242, 111, 58, 0.34);
}

.language-button-caret {
  font-size: 0.72rem;
  opacity: 0.72;
}

.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  inset-inline-start: auto;
  z-index: 30;
  min-width: 214px;
  max-width: min(300px, calc(100vw - 32px));
  max-height: min(62vh, 420px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  box-shadow: 0 20px 42px rgba(21, 32, 43, 0.16);
  backdrop-filter: blur(18px);
  direction: ltr;
}

.language-option {
  appearance: none;
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  direction: ltr;
  unicode-bidi: isolate;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease;
}

.language-option:hover {
  transform: translateY(-1px);
  background: rgba(21, 32, 43, 0.05);
}

.language-option.is-selected {
  background: var(--accent-soft);
  border-color: rgba(242, 111, 58, 0.22);
}

.language-option::after {
  content: "";
  flex: 0 0 auto;
  min-width: 1ch;
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 900;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.language-option.is-selected::after {
  content: "✓";
  opacity: 1;
}

.status-pill {
  cursor: default;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: none;
  flex: 0 0 auto;
  font-size: 0.72rem;
  min-height: 26px;
  padding: 0 8px;
}

.reset-button {
  color: var(--accent-strong);
}

.chip-soft {
  background: var(--accent-soft);
  border-color: rgba(242, 111, 58, 0.18);
}

.drawer-actions {
  grid-area: actions;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  justify-content: flex-end;
  align-self: start;
  width: max-content;
}

.ghost-button,
.close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(21, 32, 43, 0.08);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  font-weight: 700;
  font-size: 0.72rem;
  cursor: pointer;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    background-color 0.18s ease;
}

.ghost-button:hover,
.close-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(21, 32, 43, 0.12);
}

.close-button {
  width: 26px;
  padding: 0;
  font-size: 1.05rem;
  line-height: 1;
}

.conversation-stage {
  min-height: 0;
  display: grid;
}

.welcome-screen {
  min-height: 0;
  display: grid;
  align-items: center;
  padding: 12px 2px;
  direction: ltr;
}

.welcome-screen[data-dir="rtl"] {
  direction: rtl;
}

.welcome-card {
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 20px;
  border-radius: 26px;
  border: 1px solid rgba(21, 32, 43, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 248, 241, 0.88)),
    radial-gradient(circle at top right, rgba(242, 111, 58, 0.14), transparent 26%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 18px 36px rgba(21, 32, 43, 0.06);
}

.welcome-copy {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

.welcome-screen[data-dir="rtl"] .welcome-copy {
  text-align: right;
}

.welcome-screen[data-dir="ltr"] .welcome-copy {
  text-align: left;
}

.welcome-art {
  order: -1;
}

.welcome-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.welcome-title {
  margin: 0;
  font-size: clamp(1.55rem, 2.8vw, 2.2rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
}

.welcome-body,
.welcome-note {
  margin: 0;
  max-width: 38ch;
  color: var(--text);
  line-height: 1.6;
}

.welcome-body {
  font-size: 0.98rem;
  font-weight: 650;
}

.welcome-note {
  font-size: 0.88rem;
  color: var(--muted);
}

.welcome-start-button {
  appearance: none;
  justify-self: start;
  min-height: 46px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 16px 26px rgba(242, 111, 58, 0.22);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.welcome-start-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 28px rgba(242, 111, 58, 0.26);
}

.welcome-screen[data-dir="rtl"] .welcome-start-button {
  justify-self: end;
}

.welcome-art {
  position: relative;
  min-height: 220px;
  display: grid;
  place-items: center;
  grid-template: 1fr / 1fr;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(21, 32, 43, 0.08);
  background:
    radial-gradient(circle at 50% 50%, rgba(242, 111, 58, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(255, 247, 241, 0.7));
}

.welcome-art svg,
.welcome-mark {
  grid-area: 1 / 1;
}

.welcome-art svg {
  width: min(80%, 340px);
  height: auto;
  overflow: visible;
  transform-origin: center;
  animation: assistant-welcome-float 9s ease-in-out infinite;
  z-index: 1;
}

.welcome-mark {
  position: relative;
  width: clamp(30px, 8vw, 38px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  z-index: 2;
  pointer-events: none;
  animation: assistant-logo-pulse 5.6s ease-in-out infinite;
}

.welcome-mark::before {
  content: "";
  position: absolute;
  inset: -12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 111, 58, 0.16), rgba(242, 111, 58, 0.06) 44%, transparent 74%);
  filter: blur(6px);
  opacity: 0.6;
}

.welcome-mark-image {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 6px 10px rgba(242, 111, 58, 0.1));
}

.particle-dot {
  fill: var(--accent);
  transform-box: fill-box;
  transform-origin: center;
  filter: none;
}

.transcript {
  min-height: 0;
  overflow: auto;
  padding: 8px 2px 8px 2px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(255, 255, 255, 0.82)),
    radial-gradient(circle at top right, rgba(242, 111, 58, 0.08), transparent 28%);
  border: 1px solid rgba(21, 32, 43, 0.08);
}

.message {
  display: grid;
  gap: 8px;
  margin: 10px 0;
  padding: 0 8px;
  animation: assistant-message-rise 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.message .bubble {
  width: fit-content;
  max-width: min(92%, 42rem);
  padding: 14px 16px;
  border-radius: 20px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
  box-shadow: 0 10px 26px rgba(21, 32, 43, 0.06);
}

.message[data-dir="rtl"] .bubble,
.message[data-dir="rtl"] .follow-up {
  direction: rtl;
  unicode-bidi: plaintext;
  text-align: right;
}

.message[data-dir="ltr"] .bubble,
.message[data-dir="ltr"] .follow-up {
  direction: ltr;
  unicode-bidi: plaintext;
  text-align: left;
}

.message[data-dir="auto"] .bubble,
.message[data-dir="auto"] .follow-up {
  direction: auto;
  unicode-bidi: plaintext;
  text-align: start;
}

.message.assistant .bubble {
  background: var(--assistant);
  border: 1px solid rgba(21, 32, 43, 0.08);
}

.message.user {
  justify-items: end;
}

.message.user .bubble {
  background: var(--user);
  border: 1px solid rgba(242, 111, 58, 0.14);
}

.follow-up {
  margin: 0 6px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  border-radius: 14px;
  background: rgba(242, 111, 58, 0.08);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 6px 4px;
  padding: 0;
}

.message .action-row {
  order: -1;
}

.message[data-dir="rtl"] .action-row {
  justify-content: flex-end;
}

.reference-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 6px 0;
}

.message[data-dir="rtl"] .reference-row {
  justify-content: flex-end;
}

.reference-link {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(242, 111, 58, 0.16);
  background: rgba(255, 243, 236, 0.92);
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.reference-link:hover {
  border-color: rgba(242, 111, 58, 0.28);
  background: rgba(255, 235, 224, 0.98);
}

.action-button {
  appearance: none;
  border: 1px solid rgba(242, 111, 58, 0.18);
  background: var(--accent-soft);
  color: var(--text);
  border-radius: 999px;
  min-height: 26px;
  padding: 0 10px;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease;
}

.action-button:hover {
  transform: translateY(-1px);
  background: rgba(242, 111, 58, 0.18);
  box-shadow: 0 10px 20px rgba(242, 111, 58, 0.12);
}

.action-button:disabled {
  cursor: default;
  transform: none;
  box-shadow: none;
  opacity: 0.68;
}

.action-button.is-selected {
  background: rgba(242, 111, 58, 0.24);
  border-color: rgba(242, 111, 58, 0.34);
  color: var(--text);
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}

.composer-field {
  position: relative;
  min-width: 0;
}

.composer-input {
  width: 100%;
  min-height: 86px;
  padding-block: 14px;
  padding-inline-start: 16px;
  padding-inline-end: 56px;
  border-radius: 18px;
  border: 1px solid rgba(21, 32, 43, 0.12);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  line-height: 1.5;
  resize: none;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.composer-input::placeholder {
  color: var(--composer-placeholder-color, rgba(102, 113, 124, 0.38));
  font-size: 0.78rem;
  line-height: 1.35;
  opacity: 0.76;
  transition:
    color 0.14s linear,
    opacity 0.14s linear;
}

.composer-input.is-suggestion-armed {
  font-weight: 800;
  color: var(--text);
  border-color: rgba(242, 111, 58, 0.45);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(255, 248, 243, 0.94)),
    rgba(255, 255, 255, 0.96);
  box-shadow:
    0 0 0 4px rgba(242, 111, 58, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.66);
  letter-spacing: 0.01em;
}

.composer-input[dir="rtl"] {
  text-align: right;
}

.composer-input[dir="ltr"] {
  text-align: left;
}

.composer-input[dir="auto"] {
  text-align: start;
}

.composer-input:focus {
  border-color: rgba(242, 111, 58, 0.6);
  box-shadow: 0 0 0 4px rgba(242, 111, 58, 0.12);
}

.composer-suggestion-button {
  position: absolute;
  inset-block-start: 11px;
  inset-inline-end: 11px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  border: 1px solid rgba(21, 32, 43, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.12em;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(21, 32, 43, 0.08);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease,
    opacity 0.18s ease;
}

.composer-suggestion-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(242, 111, 58, 0.22);
  box-shadow: 0 12px 22px rgba(21, 32, 43, 0.1);
}

.composer-suggestion-button.is-active {
  background: rgba(242, 111, 58, 0.14);
  border-color: rgba(242, 111, 58, 0.26);
  color: var(--accent-strong);
  box-shadow: 0 12px 22px rgba(242, 111, 58, 0.18);
  animation: assistant-suggestion-pulse 1.9s ease-in-out infinite;
}

.composer-suggestion-button:disabled {
  opacity: 0;
  pointer-events: none;
}

.send-button {
  min-width: 118px;
  min-height: 56px;
  padding: 0 18px;
  border-radius: 18px;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 18px 30px rgba(242, 111, 58, 0.24);
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.send-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 34px rgba(242, 111, 58, 0.28);
}

.send-button:disabled,
.ghost-button:disabled,
.close-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.drawer-header {
  position: relative;
  min-height: 46px;
  padding-block: 8px;
  padding-inline-end: 54px;
}

.drawer-close {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: 8px;
  transform: translateY(-50%);
  z-index: 2;
}

.drawer-close:hover,
.drawer-close:focus-visible {
  transform: translateY(-50%);
}

@keyframes assistant-launcher-pulse {
  0%,
  100% {
    transform: scale(0.98);
    opacity: 0.92;
  }
  50% {
    transform: scale(1.05);
    opacity: 1;
  }
}

@keyframes assistant-welcome-float {
  0%,
  100% {
    transform: translateY(-1px) rotate(-0.25deg);
  }
  50% {
    transform: translateY(4px) rotate(0.35deg);
  }
}

@keyframes assistant-logo-pulse {
  0%,
  100% {
    transform: scale(0.985);
  }
  50% {
    transform: scale(1.015);
  }
}

@keyframes assistant-message-rise {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes assistant-suggestion-pulse {
  0%,
  100% {
    transform: translateY(0) scale(0.98);
  }
  50% {
    transform: translateY(-1px) scale(1.02);
  }
}

@media (prefers-color-scheme: dark) {
  body {
    background:
      radial-gradient(circle at top left, rgba(255, 138, 86, 0.16), transparent 24%),
      radial-gradient(circle at right center, rgba(95, 152, 255, 0.14), transparent 24%),
      linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  }

  .chat-backdrop {
    background: rgba(3, 7, 12, 0.52);
    backdrop-filter: blur(12px);
  }

  .chat-launcher {
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.38);
  }

  .ghost-button,
  .close-button {
    background: rgba(20, 26, 34, 0.78);
    border-color: rgba(255, 255, 255, 0.08);
  }

  .ghost-button:hover,
  .close-button:hover {
    background: rgba(24, 31, 41, 0.94);
  }

  .mode-dropdown-button:hover,
  .language-button:hover {
    background: rgba(255, 255, 255, 0.05);
  }

  .drawer-header {
    border-color: rgba(255, 255, 255, 0.08);
    background:
      linear-gradient(180deg, rgba(18, 23, 31, 0.92), rgba(24, 31, 41, 0.9)),
      radial-gradient(circle at top right, rgba(255, 138, 86, 0.12), transparent 32%);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.05),
      0 12px 28px rgba(0, 0, 0, 0.18);
  }

  .eyebrow {
    color: var(--accent);
  }

  .language-button.is-active,
  .language-button[aria-expanded="true"],
  .language-option.is-selected {
    background: rgba(255, 138, 86, 0.24);
    border-color: rgba(255, 138, 86, 0.34);
  }

  .mode-option[aria-current="true"] {
    background: transparent;
    border-color: transparent;
    color: var(--accent);
  }

  .transcript {
    background:
      linear-gradient(180deg, rgba(26, 33, 43, 0.84), rgba(18, 23, 31, 0.92)),
      radial-gradient(circle at top right, rgba(255, 138, 86, 0.12), transparent 28%);
    border-color: rgba(255, 255, 255, 0.08);
  }

  .message.assistant .bubble {
    background: var(--assistant);
    border-color: rgba(255, 255, 255, 0.08);
  }

  .message.user .bubble {
    background: var(--user);
    border-color: rgba(255, 138, 86, 0.18);
  }

  .follow-up {
    background: rgba(255, 138, 86, 0.12);
  }

  .action-button {
    border-color: rgba(255, 138, 86, 0.22);
  }

  .action-button:hover {
    background: rgba(255, 138, 86, 0.2);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
  }

  .action-button.is-selected {
    background: rgba(255, 138, 86, 0.28);
    border-color: rgba(255, 138, 86, 0.4);
  }

  .welcome-card {
    border-color: rgba(255, 255, 255, 0.08);
    background:
      linear-gradient(180deg, rgba(18, 23, 31, 0.96), rgba(24, 31, 41, 0.92)),
      radial-gradient(circle at top right, rgba(255, 138, 86, 0.12), transparent 28%);
  }

  .welcome-art {
    border-color: rgba(255, 255, 255, 0.08);
    background:
      radial-gradient(circle at 50% 50%, rgba(255, 138, 86, 0.1), transparent 42%),
      linear-gradient(180deg, rgba(18, 23, 31, 0.88), rgba(12, 16, 22, 0.94));
  }

  .welcome-mark::before {
    background: radial-gradient(circle, rgba(255, 138, 86, 0.2), rgba(255, 138, 86, 0.08) 40%, transparent 72%);
  }

  .language-menu {
    box-shadow: 0 20px 42px rgba(0, 0, 0, 0.38);
  }

  .composer-input {
    background: rgba(15, 19, 25, 0.96);
    border-color: rgba(255, 255, 255, 0.09);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  }

  .mode-dropdown-menu {
    background: rgba(16, 20, 26, 0.94);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 42px rgba(0, 0, 0, 0.34);
  }

  .composer-input.is-suggestion-armed {
    background:
      linear-gradient(180deg, rgba(20, 26, 34, 0.96), rgba(24, 30, 40, 0.94)),
      rgba(15, 19, 25, 0.98);
    border-color: rgba(255, 138, 86, 0.46);
    box-shadow:
      0 0 0 4px rgba(255, 138, 86, 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  .composer-suggestion-button {
    background: rgba(16, 20, 26, 0.9);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.18);
  }

  .composer-suggestion-button:hover {
    background: rgba(22, 28, 36, 0.96);
    border-color: rgba(255, 138, 86, 0.24);
  }

  .composer-suggestion-button.is-active {
    background: rgba(255, 138, 86, 0.16);
    border-color: rgba(255, 138, 86, 0.28);
    color: var(--accent);
  }

  .composer-input:focus {
    border-color: rgba(255, 138, 86, 0.7);
    box-shadow: 0 0 0 4px rgba(255, 138, 86, 0.14);
  }
}

[hidden] {
  display: none !important;
}

@media (max-width: 1024px) {
  .chat-drawer {
    width: min(100vw - 24px, 600px);
    height: min(88vh, 840px);
  }

  .mode-dropdown-button,
  .language-button,
  .status-pill {
    min-height: 30px;
    padding: 0 10px;
    font-size: 0.76rem;
  }

  .language-menu {
    min-width: 184px;
  }
}

@media (max-width: 740px) {
  .chat-overlay {
    padding: 0;
    place-items: stretch;
  }

  .chat-drawer {
    width: 100vw;
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: none;
    padding: 12px 0 0;
    box-shadow: none;
  }

  .drawer-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "heading actions";
    align-items: center;
    row-gap: 0;
    margin: 0 12px 10px;
    padding: 10px 10px 8px;
    border-radius: 20px;
  }

  .drawer-header {
    min-height: 42px;
    padding-inline-end: 48px;
  }

  .drawer-actions {
    justify-content: flex-end;
    gap: 4px;
  }

  .conversation-stage {
    padding-inline: 0;
  }

  .welcome-screen {
    padding: 12px 0;
  }

  .drawer-close {
    inset-inline-end: 8px;
  }

  .mode-dropdown-button,
  .language-button,
  .status-pill {
    min-height: 24px;
    padding: 0 7px;
    font-size: 0.68rem;
  }

  .language-switcher {
    width: auto;
    margin-inline-start: 0;
  }

  .language-button {
    min-width: 0;
    justify-content: center;
  }

  .message {
    padding: 0 4px;
  }

  .message .bubble {
    max-width: min(94%, 42rem);
    padding: 13px 14px;
  }

  .welcome-card {
    gap: 14px;
    padding: 0 12px 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .welcome-art {
    min-height: 210px;
  }

  .welcome-mark {
    width: clamp(26px, 10vw, 32px);
  }

  .welcome-title {
    font-size: clamp(1.4rem, 7vw, 2rem);
  }

  .welcome-start-button {
    width: 100%;
  }

  .welcome-screen[data-dir="rtl"] .welcome-start-button {
    justify-self: stretch;
  }

  .action-row {
    gap: 6px;
    margin: 0 4px 4px;
  }

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

  .composer-input {
    padding-inline-end: 50px;
  }

  .composer-suggestion-button {
    inset-block-start: 9px;
    inset-inline-end: 9px;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    font-size: 1rem;
  }

  .send-button {
    width: 100%;
  }

  .chat-launcher {
    right: 14px;
    bottom: 14px;
  }
}

@media (hover: none) and (pointer: coarse) {
  .chat-launcher,
  .ghost-button,
  .close-button,
  .action-button,
  .send-button {
    -webkit-tap-highlight-color: transparent;
  }

  .chat-launcher:hover,
  .ghost-button:hover,
  .close-button:hover,
  .action-button:hover,
  .send-button:hover {
    transform: none;
    box-shadow: none;
  }
}

@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;
  }
}
