:root {
  font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
  color: #20233a;
  background: #f7f8fc;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-optical-sizing: auto;
  font-weight: 400;
  --navy: #0b1b5a;
  --green: #159a4b;
  --bg-light: #f8fafc;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --white: #ffffff;
  --ink: var(--text-dark);
  --muted: var(--text-muted);
  --purple: var(--navy);
  --purple-dark: #07143f;
  --accent-green: var(--green);
  --line: #e2e8f0;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
}

button,
input,
textarea {
  font: inherit;
}

body,
input,
textarea {
  font-family: "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #c9ccd6 transparent;
}

*::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: #c9ccd6;
  border-radius: 10px;
}

*::-webkit-scrollbar-thumb:hover {
  background: #aeb2c0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.app-shell {
  display: flex;
  width: min(1440px, 100%);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 12px 60px rgb(31 36 72 / 5%);
}

.sidebar {
  position: relative;
  display: flex;
  flex: 0 0 268px;
  flex-direction: column;
  padding: 29px 21px 22px;
  background: #fbfbfd;
  border-left: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: #262944;
  font-size: 22px;
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e9edf4;
  border-radius: 10px;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar-rule {
  height: 1px;
  margin: 27px 0 21px;
  background: var(--line);
}

.new-chat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 45px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  background: var(--purple);
  border: 0;
  border-radius: 11px;
  box-shadow: 0 5px 12px rgb(101 88 211 / 15%);
  transition: background 150ms ease, transform 150ms ease;
}

.new-chat:hover,
.send-button:hover {
  background: var(--purple-dark);
}

.new-chat:active,
.send-button:active {
  transform: translateY(1px);
}

.new-chat span {
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}

.sidebar-note {
  display: flex;
  gap: 10px;
  margin-top: 27px;
  padding: 13px;
  color: #777b91;
  background: #edf8f1;
  border: 1px solid #d9efdf;
  border-radius: 11px;
}

.note-icon {
  color: var(--accent-green);
}

.sidebar-note p {
  margin: 0;
  font-size: 12px;
  line-height: 1.8;
}

.sidebar-bottom {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 16px 4px 0;
  color: #898da1;
  font-size: 12px;
}

.online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  background: #42bd87;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgb(66 189 135 / 12%);
}

.chat-panel {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.topbar {
  display: flex;
  min-height: 81px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 42px;
  border-bottom: 1px solid var(--line);
}

.assistant-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  color: var(--accent-green);
  background: #edf8f1;
  border: 1px solid #d9efdf;
  border-radius: 14px;
}

.avatar svg {
  width: 25px;
  height: 25px;
}

.assistant-identity h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.assistant-identity p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 3px 0 0;
  color: #8b8fa1;
  font-size: 11px;
}

.assistant-identity p .online-dot {
  width: 6px;
  height: 6px;
}

.model-label {
  padding: 6px 11px;
  color: #777b91;
  font-size: 11px;
  background: #f6f6f9;
  border: 1px solid #ededf2;
  border-radius: 20px;
}

.official-site-link {
  padding: 7px 11px;
  color: var(--purple);
  font-size: 12px;
  text-decoration: none;
  border: 1px solid #dfe3f0;
  border-radius: 9px;
  transition: background 150ms ease, border-color 150ms ease;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.data-saver-toggle {
  padding: 7px 11px;
  color: var(--purple);
  font-size: 12px;
  background: #fff;
  border: 1px solid #dfe3f0;
  border-radius: 9px;
  transition: background 150ms ease, border-color 150ms ease;
}

.data-saver-toggle:hover {
  background: #f5f7fc;
  border-color: #bfc8e0;
}

.topbar-actions button.official-site-link {
  padding: 7px 11px;
  background: transparent;
  cursor: pointer;
}

.official-site-link:hover {
  background: #f5f7fc;
  border-color: #bfc8e0;
}

.official-site-link:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

.mobile-brand {
  display: none;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e9edf4;
  border-radius: 9px;
}

.mobile-brand img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.conversation {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  overflow-y: auto;
  padding: 42px 25px 32px;
}

.welcome {
  width: min(560px, 100%);
  margin: auto;
  padding: 15px 0 40px;
  text-align: center;
}

.welcome-logo {
  display: block;
  width: 88px;
  height: 88px;
  margin: 0 auto 18px;
  background: #edf8f1;
  border: 1px solid #d9efdf;
  border-radius: 22px;
  object-fit: contain;
  box-shadow: 0 8px 24px rgb(11 27 90 / 8%);
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--purple);
  font-size: 13px;
  font-weight: 600;
}

.welcome h2 {
  margin: 0;
  color: #252840;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 600;
  letter-spacing: -0.5px;
}

.welcome-copy {
  margin: 10px 0 26px;
  color: #8d91a5;
  font-size: 14px;
}

.suggestions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  text-align: right;
}

.suggestion {
  display: flex;
  min-height: 53px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 13px;
  color: #5d6178;
  font-size: 12px;
  background: #fff;
  border: 1px solid #e9eaf1;
  border-radius: 11px;
  transition: border-color 150ms ease, background 150ms ease;
}

.suggestion:hover {
  background: #f5fbf7;
  border-color: #b9dfc4;
}

.suggestion span:last-child {
  color: #7fba92;
  font-size: 15px;
}

.messages {
  display: flex;
  width: min(760px, 100%);
  flex-direction: column;
  gap: 18px;
  margin: 0 auto;
}

.message-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: appear 180ms ease-out;
}

.message-content {
  display: flex;
  max-width: calc(100% - 41px);
  flex-direction: column;
  align-items: flex-start;
}

.message-row.user {
  flex-direction: row-reverse;
}

.message-row.user .message-content {
  align-items: flex-end;
}

.message-avatar {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  place-items: center;
  color: var(--accent-green);
  font-size: 13px;
  background: #edf8f1;
  border-radius: 10px;
}

.message-row.user .message-avatar {
  color: #fff;
  background: #0b1b5a;
}

.message-bubble {
  max-width: min(78%, 620px);
  padding: 11px 15px;
  color: #454960;
  font-size: 14px;
  line-height: 1.9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f7f7fa;
  border: 1px solid #f0f0f4;
  border-radius: 4px 15px 15px;
}

.message-bubble strong {
  color: #252840;
  font-weight: 700;
}

.message-bubble a {
  color: #1769aa;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.message-bubble a:hover {
  color: #0b1b5a;
}

.message-list {
  margin: 4px 0;
  padding-inline-start: 24px;
}

.message-list li + li {
  margin-top: 3px;
}

.message-list.ordered {
  padding-inline-start: 28px;
}

.message-footer {
  display: flex;
  min-height: 25px;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 0;
  color: #8d91a5;
  font-size: 10px;
}

.message-row.user .message-footer {
  justify-content: flex-end;
}

.message-copy-button {
  padding: 1px 4px;
  color: #70758a;
  font-size: 12px;
  line-height: 1.2;
  background: transparent;
  border: 0;
  border-radius: 5px;
}

.message-copy-button:hover {
  color: var(--purple);
  background: #f0f2f8;
}

.message-copy-button:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 1px;
}

.copy-feedback {
  color: var(--accent-green);
  font-size: 10px;
}

.message-row.user .message-bubble {
  color: #fff;
  background: var(--purple);
  border-color: var(--purple);
  border-radius: 15px 4px 15px 15px;
}

.message-bubble.info-card {
  padding: 12px;
  margin-block: 8px;
  background: #f8fafc;
  border: 1px solid #e1e8e4;
  border-left: 4px solid #159a4b;
  border-radius: 8px;
}

.message-bubble.pending:after {
  display: inline-block;
  width: 5px;
  height: 15px;
  margin-right: 4px;
  vertical-align: -3px;
  background: var(--purple);
  content: "";
  animation: blink 850ms steps(2, start) infinite;
}

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 19px;
  vertical-align: middle;
}

.typing-indicator span {
  width: 6px;
  height: 6px;
  background: #85899b;
  border-radius: 50%;
  animation: typing-pulse 1s ease-in-out infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 150ms;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 300ms;
}

.composer-area {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 0 25px 17px;
}

.summarize-button {
  display: block;
  margin: 10px auto;
  padding: 5px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 15px;
}

.summarize-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.summarize-button.loading {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: wait;
}

.summarize-button.loading::after {
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-left-color: transparent;
  border-radius: 50%;
  content: "";
  animation: spin 700ms linear infinite;
}

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 10px 0;
}

.quick-reply {
  padding: 7px 12px;
  color: #5d6178;
  font-size: 12px;
  background: #fff;
  border: 1px solid #e1e5ed;
  border-radius: 20px;
}

.quick-reply:hover {
  background: #f5fbf7;
  border-color: #b9dfc4;
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 11px 10px 12px;
  background: #fff;
  border: 1px solid #e6e7ef;
  border-radius: 15px;
  box-shadow: 0 5px 22px rgb(42 45 84 / 5%);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.composer:focus-within {
  border-color: #bcb7ed;
  box-shadow: 0 5px 23px rgb(101 88 211 / 9%);
}

.composer textarea {
  width: 100%;
  max-height: 120px;
  min-height: 35px;
  resize: none;
  padding: 7px 5px;
  color: #33364b;
  font-size: 14px;
  line-height: 1.55;
  background: transparent;
  border: 0;
  outline: 0;
}

.composer textarea::placeholder {
  color: #a0a3b3;
}

.send-button {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  color: #fff;
  background: var(--purple);
  border: 0;
  border-radius: 11px;
  transition: background 150ms ease, transform 150ms ease;
}

.send-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.send-button svg {
  width: 18px;
  height: 18px;
  transform: rotate(180deg);
}

.disclaimer {
  margin: 9px 0 0;
  color: #a0a3b3;
  font-size: 10px;
  text-align: center;
}

.error-message {
  margin: 0 0 9px;
  color: #b42332;
  font-size: 12px;
}

.error-message:not([hidden]) {
  display: block;
}

@keyframes appear {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
  to { visibility: hidden; }
}

@keyframes typing-pulse {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 700px) {
  .sidebar {
    display: none;
  }

  .topbar {
    min-height: 70px;
    padding: 12px 19px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .conversation {
    padding: 25px 16px;
  }

  .composer-area {
    padding: 0 14px 12px;
  }

  .suggestions {
    grid-template-columns: 1fr;
  }

  .welcome {
    padding-bottom: 20px;
  }

  .model-label {
    display: none;
  }

  .official-site-link,
  .data-saver-toggle {
    padding: 7px 9px;
    font-size: 11px;
  }

  .topbar-actions {
    flex-wrap: wrap;
    gap: 5px;
  }

  .mobile-brand {
    display: block;
  }

  .message-bubble {
    max-width: 86%;
    font-size: 13px;
  }

  .message-content {
    max-width: calc(100% - 41px);
  }

}

body.data-saver *,
body.data-saver *::before,
body.data-saver *::after {
  animation: none !important;
  transition: none !important;
  box-shadow: none !important;
}

@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;
  }
}

@media print {
  body {
    min-width: 0;
    min-height: 0;
    color: #000;
    background: #fff;
  }

  .sidebar,
  .topbar,
  .composer-area,
  .welcome,
  #quick-replies,
  button,
  .official-site-link {
    display: none !important;
  }

  .app-shell,
  .chat-panel,
  .conversation {
    display: block;
    width: 100%;
    min-height: 0;
    overflow: visible;
    padding: 0;
    margin: 0;
    background: #fff;
    box-shadow: none;
  }

  .messages {
    display: flex;
    width: 100%;
    gap: 10px;
  }

  .message-row {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .message-copy-button {
    display: none;
  }

  .message-bubble {
    max-width: 100%;
    color: #000 !important;
    background: #fff !important;
    border: 1px solid #ccc !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }
}

body {
  color: var(--text-dark);
  background: var(--bg-light);
}

.app-shell {
  width: min(1520px, 100%);
  background: var(--white);
  box-shadow: 0 18px 60px rgb(15 23 42 / 7%);
}

.sidebar {
  background: #f9fbfd;
  border-left-color: #e5eaf0;
}

.brand {
  color: var(--navy);
}

.new-chat {
  background: var(--navy);
  box-shadow: 0 5px 14px rgb(11 27 90 / 12%);
}

.new-chat:hover {
  background: #07143f;
}

.topbar {
  position: relative;
  min-height: 84px;
  background: var(--white);
  border-bottom: 2px solid var(--green);
  box-shadow: 0 1px 3px rgb(0 0 0 / 5%);
}

.assistant-identity h1 {
  color: var(--navy);
  font-weight: 700;
}

.avatar {
  color: var(--green);
  background: #eff8f2;
  border-color: #dcefe2;
}

.official-site-link,
.data-saver-toggle {
  color: var(--navy);
  background: var(--white);
  border-color: #dce4ed;
}

.official-site-link:hover,
.data-saver-toggle:hover {
  background: #f1f8f3;
  border-color: #9ac9a8;
}

.official-site-link:focus-visible,
.data-saver-toggle:focus-visible {
  outline-color: var(--green);
}

.conversation {
  background:
    radial-gradient(ellipse at 50% 0%, rgb(21 154 75 / 4%), transparent 58%),
    linear-gradient(180deg, #fbfdff 0%, #f8fafc 100%);
}

.welcome {
  width: min(650px, 100%);
  padding: 30px 24px 40px;
}

.welcome-logo {
  width: 120px;
  height: 120px;
  margin-bottom: 22px;
  background: var(--white);
  border-color: #e3eee6;
  border-radius: 28px;
  box-shadow: 0 12px 32px rgb(11 27 90 / 9%);
}

.eyebrow {
  color: var(--green);
}

.welcome h2 {
  color: var(--navy);
  font-size: clamp(24px, 3.4vw, 34px);
  font-weight: 700;
  letter-spacing: 0;
}

.welcome-copy {
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.9;
}

.suggestions {
  gap: 12px;
}

.suggestion {
  min-height: 66px;
  padding: 14px 16px;
  color: var(--text-dark);
  font-size: 13px;
  background: var(--white);
  border-color: #e2e8f0;
  border-radius: 15px;
  box-shadow: 0 5px 16px rgb(15 23 42 / 4%);
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.suggestion:hover {
  background: #fff;
  border-color: var(--green);
  box-shadow: 0 10px 22px rgb(21 154 75 / 9%);
  transform: translateY(-2px);
}

.suggestion span:last-child {
  color: var(--green);
}

.messages {
  width: min(820px, 100%);
  gap: 22px;
}

.message-row {
  gap: 10px;
}

.message-avatar {
  display: none;
}

.message-content,
.message-row.user .message-content {
  width: 100%;
  max-width: 100%;
}

.message-bubble {
  width: fit-content;
  max-width: min(100%, 740px);
  padding: 15px 18px;
  color: var(--text-dark);
  font-size: 14px;
  line-height: 2;
  background: var(--white);
  border: 1px solid #e7edf2;
  border-inline-start: 4px solid var(--green);
  border-radius: 14px;
  box-shadow: 0 5px 18px rgb(15 23 42 / 5%);
}

.message-bubble strong {
  color: var(--navy);
}

.message-row.user {
  justify-content: flex-start;
}

.message-row.user .message-bubble {
  max-width: min(78%, 620px);
  padding: 12px 17px;
  color: var(--white);
  background: var(--navy);
  border: 1px solid var(--navy);
  border-radius: 16px 16px 0 16px;
  box-shadow: 0 4px 12px rgb(11 27 90 / 12%);
}

.message-row.user .message-bubble strong,
.message-row.user .message-bubble a {
  color: #fff;
}

.message-bubble.info-card {
  background: var(--white);
  border-inline-start: 4px solid var(--green);
  border-radius: 14px;
  box-shadow: 0 5px 18px rgb(15 23 42 / 5%);
}

.message-bubble.pending:after {
  background: var(--green);
}

.message-footer {
  color: #8491a2;
}

.message-copy-button {
  color: #64748b;
}

.message-copy-button:hover {
  color: var(--navy);
  background: #edf5f0;
}

.composer-area {
  position: sticky;
  z-index: 2;
  bottom: 0;
  padding: 12px 25px 18px;
  background: rgb(248 250 252 / 90%);
  border-top: 1px solid rgb(226 232 240 / 70%);
  backdrop-filter: blur(14px);
}

.summarize-button,
.quick-reply {
  color: var(--navy);
  background: var(--white);
  border-color: #dce4ed;
  box-shadow: 0 3px 10px rgb(15 23 42 / 4%);
}

.summarize-button:hover,
.quick-reply:hover {
  background: #f1f8f3;
  border-color: #9ac9a8;
}

.composer {
  padding: 10px 11px 10px 12px;
  background: rgb(255 255 255 / 94%);
  border: 1px solid #dfe7ed;
  border-radius: 24px;
  box-shadow: 0 12px 30px rgb(15 23 42 / 12%);
  backdrop-filter: blur(12px);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.composer:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgb(21 154 75 / 10%), 0 12px 30px rgb(15 23 42 / 12%);
}

.composer textarea {
  color: var(--text-dark);
}

.composer textarea::placeholder {
  color: #8793a2;
}

.send-button {
  border-radius: 50%;
  background: var(--green);
}

.send-button:hover {
  background: #117d3e;
}

.send-button:disabled {
  background: #94a3b8;
}

.disclaimer {
  color: var(--text-muted);
}

* {
  scrollbar-color: rgb(100 116 139 / 35%) transparent;
}

*::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

*::-webkit-scrollbar-thumb {
  background: rgb(100 116 139 / 28%);
}

*::-webkit-scrollbar-thumb:hover {
  background: rgb(100 116 139 / 45%);
}

@media (max-width: 700px) {
  .topbar {
    min-height: 76px;
    padding: 11px 15px;
  }

  .conversation {
    padding: 22px 14px;
  }

  .welcome {
    padding: 18px 8px 25px;
  }

  .welcome-logo {
    width: 100px;
    height: 100px;
    border-radius: 24px;
  }

  .suggestion {
    min-height: 58px;
  }

  .message-bubble,
  .message-bubble.info-card {
    max-width: 100%;
    padding: 12px 14px;
    font-size: 13px;
  }

  .message-row.user .message-bubble {
    max-width: 88%;
  }

  .composer-area {
    padding: 9px 12px 12px;
  }

  .composer {
    border-radius: 22px;
  }
}

@media print {
  .app-shell {
    width: 100%;
    box-shadow: none;
  }

  .conversation {
    background: #fff;
  }

  .message-bubble,
  .message-row.user .message-bubble {
    color: #000 !important;
    background: #fff !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
  }
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-icon-button,
.header-new-chat {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  color: var(--navy);
  font-size: 12px;
  background: var(--white);
  border: 1px solid #dce4ed;
  border-radius: 10px;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.header-icon-button {
  width: 38px;
  padding: 0;
  font-size: 16px;
}

.header-new-chat span {
  color: var(--green);
  font-size: 17px;
}

.header-icon-button:hover,
.header-new-chat:hover {
  background: #f1f8f3;
  border-color: #9ac9a8;
}

.message-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 1px 4px 5px;
}

.regenerate-btn,
.feedback-btn {
  display: inline-grid;
  width: 28px;
  height: 26px;
  place-items: center;
  padding: 0;
  color: #64748b;
  font-size: 13px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}

.regenerate-btn:hover,
.feedback-btn:hover {
  color: var(--navy);
  background: #edf5f0;
  border-color: #d9eadf;
}

.feedback-btn.selected {
  color: var(--navy);
  background: #e8f5ec;
  border-color: #9ac9a8;
}

.toast-container {
  position: fixed;
  z-index: 20;
  right: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  display: flex;
  width: min(440px, calc(100% - 32px));
  flex-direction: column;
  align-items: center;
  gap: 9px;
  pointer-events: none;
  transform: translateX(50%);
}

.toast {
  max-width: 100%;
  padding: 11px 17px;
  color: var(--white);
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
  background: #1e293b;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 13px;
  box-shadow: 0 10px 30px rgb(15 23 42 / 20%);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

body.dark-mode {
  --bg-light: #0f172a;
  --white: #1e293b;
  --text-dark: #f8fafc;
  --text-muted: #94a3b8;
  --line: #334155;
  color: var(--text-dark);
  background: var(--bg-light);
}

body.dark-mode .app-shell {
  background: var(--bg-light);
  box-shadow: 0 18px 60px rgb(0 0 0 / 25%);
}

body.dark-mode .sidebar,
body.dark-mode .topbar,
body.dark-mode .composer {
  background: var(--white);
  border-color: #334155;
}

body.dark-mode .brand,
body.dark-mode .assistant-identity h1,
body.dark-mode .welcome h2,
body.dark-mode .model-label,
body.dark-mode .suggestion,
body.dark-mode .official-site-link,
body.dark-mode .data-saver-toggle,
body.dark-mode .header-icon-button,
body.dark-mode .header-new-chat,
body.dark-mode .summarize-button,
body.dark-mode .quick-reply {
  color: var(--text-dark);
}

body.dark-mode .sidebar-note,
body.dark-mode .avatar,
body.dark-mode .suggestion,
body.dark-mode .model-label,
body.dark-mode .official-site-link,
body.dark-mode .data-saver-toggle,
body.dark-mode .header-icon-button,
body.dark-mode .header-new-chat,
body.dark-mode .summarize-button,
body.dark-mode .quick-reply {
  background: #172337;
  border-color: #334155;
}

body.dark-mode .sidebar-note {
  color: #cbd5e1;
}

body.dark-mode .conversation {
  background:
    radial-gradient(ellipse at 50% 0%, rgb(21 154 75 / 8%), transparent 58%),
    linear-gradient(180deg, #111c30 0%, #0f172a 100%);
}

body.dark-mode .welcome-copy,
body.dark-mode .assistant-identity p,
body.dark-mode .sidebar-bottom,
body.dark-mode .disclaimer {
  color: var(--text-muted);
}

body.dark-mode .welcome-logo {
  background: var(--white);
  border-color: #334155;
}

body.dark-mode .suggestion:hover,
body.dark-mode .official-site-link:hover,
body.dark-mode .data-saver-toggle:hover,
body.dark-mode .header-icon-button:hover,
body.dark-mode .header-new-chat:hover,
body.dark-mode .summarize-button:hover,
body.dark-mode .quick-reply:hover {
  background: #22334b;
  border-color: var(--green);
}

body.dark-mode .message-bubble,
body.dark-mode .message-bubble.info-card {
  color: var(--text-dark);
  background: #1e293b;
  border-color: #334155;
  border-inline-start-color: var(--green);
  box-shadow: 0 5px 18px rgb(0 0 0 / 15%);
}

body.dark-mode .message-bubble strong,
body.dark-mode .message-bubble a {
  color: #a7f3c0;
}

body.dark-mode .message-row.user .message-bubble {
  color: #fff;
  background: #132b68;
  border-color: #24428b;
}

body.dark-mode .message-row.user .message-bubble strong,
body.dark-mode .message-row.user .message-bubble a {
  color: #fff;
}

body.dark-mode .message-footer,
body.dark-mode .message-copy-button,
body.dark-mode .regenerate-btn,
body.dark-mode .feedback-btn {
  color: #a8b4c5;
}

body.dark-mode .message-copy-button:hover,
body.dark-mode .regenerate-btn:hover,
body.dark-mode .feedback-btn:hover,
body.dark-mode .feedback-btn.selected {
  color: #f8fafc;
  background: #26364b;
  border-color: #46614f;
}

body.dark-mode .composer-area {
  background: rgb(15 23 42 / 92%);
  border-top-color: rgb(51 65 85 / 75%);
}

body.dark-mode .composer {
  background: rgb(30 41 59 / 96%);
  border-color: #475569;
  box-shadow: 0 12px 30px rgb(0 0 0 / 28%);
}

body.dark-mode .composer:focus-within {
  border-color: #4ade80;
  box-shadow: 0 0 0 3px rgb(74 222 128 / 12%), 0 12px 30px rgb(0 0 0 / 28%);
}

body.dark-mode .composer textarea {
  color: #f8fafc;
}

body.dark-mode .composer textarea::placeholder {
  color: #94a3b8;
}

body.dark-mode .toast {
  color: #f8fafc;
  background: #26364b;
  border-color: #475569;
}

@media (max-width: 900px) {
  .topbar {
    padding-inline: 20px;
  }

  .topbar-actions {
    gap: 5px;
  }
}

@media (max-width: 700px) {
  .header-new-chat {
    width: 38px;
    padding-inline: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 0;
  }

  .header-new-chat span {
    font-size: 20px;
  }

  .topbar-actions {
    margin-inline-start: auto;
  }
}
