:root {
  color-scheme: light;
  --bg: #ffffff;
  --sidebar: #f9f9f9;
  --hover: #ececec;
  --soft: #f4f4f4;
  --card: #ffffff;
  --ink: #171717;
  --muted: #676767;
  --line: #dedede;
  --line-soft: #ececec;
  --accent: #10a37f;
  --danger: #d12f2f;
  --shadow: 0 18px 58px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 16px 12px;
  overflow: hidden;
  background: var(--sidebar);
  border-right: 1px solid #ededed;
  transition: padding 180ms ease;
}

.sidebar-head,
.composer-footer,
.research-head,
.research-status,
.research-bottom,
.account {
  display: flex;
  align-items: center;
}

.sidebar-head {
  justify-content: space-between;
  min-height: 40px;
  padding: 0 10px;
}

.sidebar-head strong {
  font-size: 18px;
}

.sidebar-icon {
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.sidebar-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.sidebar-icon:hover {
  background: var(--hover);
}

.nav-main {
  display: grid;
  gap: 2px;
  margin: 24px 0 14px;
}

.nav-main button,
.history button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.nav-main button:hover,
.history button:hover,
.history button.active {
  background: var(--hover);
}

.search-panel {
  padding: 0 8px 14px;
}

.search-panel input {
  width: 100%;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
  padding: 0 10px;
}

.section-label {
  margin: 2px 0 8px;
  padding: 0 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.history {
  flex: 1;
  display: grid;
  align-content: start;
  gap: 2px;
  overflow: auto;
  min-height: 0;
  padding-bottom: 16px;
}

.history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  border-radius: 8px;
}

.history-row:hover,
.history-row.active {
  background: var(--hover);
}

.history-row .history-open {
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #252525;
}

.history-row .history-open span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-row .history-delete {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  opacity: 0;
}

.history-row:hover .history-delete {
  opacity: 1;
}

.history-row .history-delete:hover {
  background: #dedede;
  color: #111;
}

.history-row .history-delete svg {
  width: 15px;
  height: 15px;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #bbb;
}

.status-dot.running {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(16, 163, 127, 0.12);
}

.status-dot.done {
  background: #888;
}

.status-dot.error {
  background: var(--danger);
}

.status-dot.stopped {
  background: #d2a036;
}

.empty-history {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
}

.account {
  gap: 10px;
  flex: 0 0 auto;
  width: 100%;
  min-height: 56px;
  margin-top: auto;
  padding: 12px 8px 6px;
  border: 0;
  border-top: 1px solid var(--line-soft);
  background: var(--sidebar);
  color: var(--ink);
  text-align: left;
}

.account > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: #555;
  background: #e8e8e8;
  font-size: 12px;
}

.account > span svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.account strong,
.account small {
  display: block;
}

.account > div {
  min-width: 0;
}

.account strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(12px);
}

.auth-modal[hidden] {
  display: none;
}

.auth-panel {
  display: grid;
  width: min(460px, 100%);
  gap: 14px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}

.auth-brand {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
}

.auth-brand > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.auth-panel h2 {
  margin: 0;
  font-size: 21px;
}

.auth-panel p,
.auth-note {
  color: var(--muted);
  line-height: 1.55;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #f2f2f2;
}

.auth-tabs button {
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.auth-tabs button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
}

.auth-panel label {
  display: grid;
  gap: 7px;
  color: #2b2b2b;
  font-size: 13px;
  font-weight: 700;
}

.auth-panel input {
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 13px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.auth-panel input:focus {
  border-color: #b8b8b8;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.045);
}

.captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.captcha-row img {
  flex: 1;
  width: 160px;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f7f7f7;
  cursor: pointer;
  object-fit: contain;
}

.captcha-row button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #333;
  font-weight: 600;
}

.auth-actions {
  display: flex;
  gap: 10px;
}

.auth-actions button {
  flex: 1;
  min-height: 42px;
  border: 1px solid #111;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-weight: 700;
}

.auth-actions button + button {
  border-color: var(--line);
  background: #fff;
  color: #111;
}

.auth-note {
  font-size: 12px;
}

#authMessage {
  min-height: 18px;
  color: var(--danger);
}

.chat {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 58%, rgba(0, 0, 0, 0.024), transparent 28%),
    #fff;
}

.topbar {
  min-height: 58px;
  padding: 24px 28px 8px;
}

h1,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: 0;
}

.messages {
  overflow: auto;
  padding: 18px 24px 164px;
}

.empty-state {
  display: grid;
  min-height: calc(100vh - 300px);
  place-items: center;
  padding: 20px;
  text-align: center;
}

.empty-state > div {
  width: min(680px, 100%);
}

.empty-state h2 {
  margin: 0;
  font-size: 28px;
  letter-spacing: 0;
}

.empty-state p {
  margin: 10px auto 22px;
  max-width: 520px;
  color: var(--muted);
  line-height: 1.6;
}

.starter-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.starter-list button {
  min-height: 84px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: #fff;
  color: #242424;
  text-align: left;
  line-height: 1.45;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.035);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.starter-list button:hover {
  border-color: #d2d2d2;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.message {
  display: grid;
  grid-template-columns: 32px minmax(0, 760px);
  justify-content: center;
  gap: 14px;
  margin: 0 auto 24px;
  animation: message-in 280ms ease-out both;
}

.message.user {
  display: flex;
  justify-content: center;
}

.message.user .bubble {
  width: min(575px, 100%);
  margin-left: 300px;
  padding: 14px 18px;
  border-radius: 24px;
  background: #f0f0f0;
  animation: bubble-in 220ms ease-out both;
}

.avatar {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 800;
  animation: avatar-pop 240ms ease-out both;
}

.bubble {
  min-width: 0;
}

.bubble h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.bubble h3 {
  margin: 18px 0 8px;
  font-size: 15px;
}

.bubble p,
.bubble li {
  line-height: 1.7;
}

.bubble ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.research-card {
  width: min(700px, 100%);
  padding: 20px 20px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(16, 163, 127, 0.035), transparent 42%),
    #fff;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.02),
    0 22px 56px rgba(0, 0, 0, 0.055);
  animation: card-in 300ms ease-out both;
}

.research-head {
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.research-head h2 {
  margin: 0;
  font-size: 18px;
}

.research-head p {
  max-width: 500px;
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.research-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.research-head button,
.edit-plan-button,
.cancel-plan-button,
.start-plan-button {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-weight: 600;
  transition: background 160ms ease, transform 160ms ease;
}

.research-head button:hover,
.edit-plan-button:hover,
.cancel-plan-button:hover,
.start-plan-button:hover {
  background: #f7f7f7;
  transform: translateY(-1px);
}

.plan-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 16px;
}

.plan-meta span {
  padding: 4px 9px;
  border-radius: 999px;
  background: #f4f4f4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.activity-panel {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #fafafa;
}

.activity-panel h3 {
  margin: 0 0 8px;
  color: #303030;
  font-size: 13px;
}

.activity-list {
  max-height: 180px;
  margin: 0;
  overflow: auto;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
}

.activity-list li {
  margin: 5px 0;
  line-height: 1.5;
}

.check-list {
  display: grid;
  gap: 14px;
}

.check-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 14px;
  align-items: start;
  padding: 10px 10px 10px 8px;
  border-radius: 12px;
  transition: color 180ms ease, opacity 180ms ease;
}

.check-item > span {
  display: grid;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  place-items: center;
  border: 1.5px dashed #c8c8c8;
  border-radius: 50%;
  background: #fff;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.check-item.active > span {
  border-style: solid;
  border-color: #1f1f1f;
  background: #fff;
  animation: soft-pulse 1.4s ease-in-out infinite;
}

.check-item.active {
  background: rgba(0, 0, 0, 0.025);
}

.check-item.done > span {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(16, 163, 127, 0.1);
  transform: scale(0.92);
}

.check-item.done > span::after {
  width: 7px;
  height: 4px;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  content: "";
  transform: rotate(-45deg) translate(1px, -1px);
}

.check-item p {
  margin: 0;
  color: #202020;
  font-size: 15px;
  line-height: 1.55;
}

.research-status {
  justify-content: space-between;
  gap: 20px;
  margin-top: 22px;
  color: var(--muted);
  font-size: 14px;
}

.current-step {
  max-width: 76%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.research-status span {
  flex: 0 0 auto;
}

.research-bottom {
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
}

.bar {
  position: relative;
  flex: 1;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9e9e9;
}

.bar::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  transform: translateX(-100%);
  animation: bar-shine 1.8s ease-in-out infinite;
}

.bar span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: #1f1f1f;
  transition: width 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.search-bar {
  background: #737373;
}

.write-bar {
  background: var(--accent);
}

.stop-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #111;
  background: #f1f1f1;
  font-size: 12px;
  transition: background 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.start-plan-button {
  flex: 0 0 auto;
  border-color: #111;
  background: #111;
  color: #fff;
}

.start-plan-button:hover {
  background: #222;
}

.plan-buttons {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
}

.plan-buttons .cancel-plan-button {
  margin-left: auto;
}

.clarify-card {
  max-width: 640px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.clarify-card h2 {
  margin: 0 0 8px;
  font-size: 17px;
}

.clarify-card p {
  margin: 0 0 12px;
  color: var(--muted);
}

.clarify-card ol {
  margin: 0;
  padding-left: 22px;
}

.stop-button:hover {
  background: #e9e9e9;
  transform: scale(1.04);
}

.stop-button:disabled {
  cursor: default;
  opacity: 0.45;
  transform: none;
}

.research-card.stopped .bar::after,
.research-card.stopped .check-item.active > span {
  animation: none;
}

.research-card.stopped .bar span {
  background: #9a9a9a;
}

.final-output {
  max-width: 760px;
  color: #1f1f1f;
  font-size: 15px;
  line-height: 1.72;
}

.answer-actions {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
}

.answer-actions button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #222;
  font-size: 13px;
  font-weight: 600;
}

.answer-actions button:hover {
  background: #f6f6f6;
}

.final-output h2,
.final-output h3,
.final-output h4 {
  color: #111;
  line-height: 1.25;
}

.final-output h2 {
  margin: 22px 0 12px;
  font-size: 22px;
}

.final-output h2:first-child {
  margin-top: 0;
}

.final-output h3 {
  margin: 20px 0 10px;
  font-size: 18px;
}

.final-output h4 {
  margin: 16px 0 8px;
  font-size: 16px;
}

.final-output p {
  margin: 10px 0;
}

.final-output ul,
.final-output ol {
  margin: 10px 0 14px;
  padding-left: 22px;
}

.final-output li {
  margin: 5px 0;
}

.final-output a {
  color: #0b63ce;
  text-decoration: none;
}

.final-output a:hover {
  text-decoration: underline;
}

.final-output .citation {
  display: inline-flex;
  align-items: center;
  color: #0b63ce;
  font-weight: 650;
  text-decoration: none;
}

.final-output .source-item {
  scroll-margin-top: 24px;
}

.final-output .source-item:target {
  border-radius: 8px;
  background: #eef6ff;
  box-shadow: 0 0 0 4px #eef6ff;
}

.final-output hr {
  height: 1px;
  margin: 22px 0;
  border: 0;
  background: var(--line);
}

.final-output code {
  padding: 2px 5px;
  border-radius: 6px;
  background: #f2f2f2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.final-output pre {
  overflow: auto;
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #f7f7f7;
}

.final-output pre code {
  display: block;
  padding: 0;
  background: transparent;
  white-space: pre;
}

.final-output blockquote {
  margin: 14px 0;
  padding: 2px 0 2px 14px;
  border-left: 3px solid #d0d0d0;
  color: var(--muted);
}

.markdown-table-wrap {
  overflow-x: auto;
  margin: 14px 0;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
}

.final-output table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.final-output th,
.final-output td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.final-output th {
  background: #f7f7f7;
  font-weight: 700;
}

.final-output tr:last-child td {
  border-bottom: 0;
}

.error {
  color: var(--danger);
}

.error-card {
  max-width: 680px;
  padding: 14px 16px;
  border: 1px solid #f1c6c6;
  border-radius: 14px;
  background: #fff7f7;
  color: #8f1d1d;
}

.error-card strong {
  display: block;
  margin-bottom: 4px;
}

.error-card p {
  color: #9f2f2f;
  line-height: 1.6;
}

.composer {
  position: sticky;
  bottom: 0;
  display: grid;
  justify-content: center;
  padding: 16px 24px 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 34%);
}

.composer-box {
  width: min(850px, calc(100vw - 360px));
  border: 1px solid var(--line);
  border-radius: 30px;
  background: #fff;
  box-shadow: var(--shadow);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.composer-box:focus-within {
  border-color: #cfcfcf;
  box-shadow: 0 22px 64px rgba(0, 0, 0, 0.13);
  transform: translateY(-1px);
}

.composer textarea {
  display: block;
  width: 100%;
  max-height: 190px;
  min-height: 54px;
  padding: 20px 22px 8px;
  resize: none;
  border: 0;
  border-radius: 30px 30px 0 0;
  background: transparent;
  color: var(--ink);
  outline: none;
  line-height: 1.5;
}

.composer-footer {
  gap: 8px;
  min-height: 50px;
  padding: 4px 11px 11px 14px;
}

.mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: #f7f7f7;
}

.mode-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.mode-option:hover {
  transform: translateY(-1px);
}

.mode-option.active {
  color: #0066cc;
  background: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
}

.mode-option svg {
  width: 16px;
  height: 16px;
}

.mode-option.active svg {
  color: #0066cc;
}

.composer-spacer {
  flex: 1;
}

.composer button[type="submit"] {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: background 160ms ease, transform 160ms ease, opacity 160ms ease;
}

.composer button[type="submit"] {
  display: grid;
  place-items: center;
  border: 0;
  color: #fff;
  background: #000;
}

.composer button[type="submit"]:not(:disabled):hover {
  transform: translateY(-1px);
}

.composer button[type="submit"]:not(:disabled):active {
  transform: scale(0.96);
}

.composer button:disabled {
  opacity: 0.42;
}

.disclaimer {
  margin-top: 9px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.typing-answer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 4px 0;
}

.typing-answer span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9a9a9a;
  animation: typing-dot 1s ease-in-out infinite;
}

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

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

.sidebar-collapsed .layout {
  grid-template-columns: 72px minmax(0, 1fr);
}

.sidebar-collapsed .sidebar {
  padding: 16px 10px;
}

.sidebar-collapsed .sidebar-head {
  justify-content: center;
  padding: 0;
}

.sidebar-collapsed .sidebar-head strong,
.sidebar-collapsed .section-label,
.sidebar-collapsed .history,
.sidebar-collapsed .search-panel,
.sidebar-collapsed .account {
  display: none;
}

.sidebar-collapsed .nav-main {
  margin-top: 24px;
}

.sidebar-collapsed .nav-main button {
  justify-content: center;
  gap: 0;
  padding: 0;
  font-size: 0;
}

.sidebar-collapsed .nav-main svg {
  width: 19px;
  height: 19px;
}

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

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes avatar-pop {
  from {
    opacity: 0;
    transform: scale(0.82);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes soft-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.1);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(0, 0, 0, 0.05);
  }
}

@keyframes bar-shine {
  0% {
    transform: translateX(-100%);
  }
  60%,
  100% {
    transform: translateX(100%);
  }
}

@keyframes typing-dot {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

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

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .topbar {
    padding: 12px 14px;
  }

  .messages {
    padding: 12px 12px 145px;
  }

  .message {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .starter-list {
    grid-template-columns: 1fr;
  }

  .mode-switch {
    max-width: calc(100vw - 104px);
    overflow-x: auto;
  }

  .mode-option {
    flex: 0 0 auto;
  }

  .message.user .bubble {
    width: auto;
    max-width: 100%;
    margin-left: 0;
  }

  .composer {
    padding: 12px 12px 8px;
  }

  .composer-box {
    width: min(100%, 820px);
  }
}
