:root {
  --bg: #f5f5f3;
  --panel: #ffffff;
  --panel-muted: #f7f7f5;
  --sidebar: #f3f3f0;
  --line: rgba(17, 24, 39, 0.08);
  --line-strong: rgba(17, 24, 39, 0.14);
  --text: #161616;
  --muted: #6b6f76;
  --muted-soft: #8a8f98;
  --accent: #111111;
  --user: #ececeb;
  --assistant: #ffffff;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.06);
  --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.04);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 28%),
    linear-gradient(180deg, #f8f8f6 0%, #f2f2ef 100%);
}

body.chat-page {
  font-size: 14px;
}

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

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

.auth-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.auth-language {
  position: fixed;
  top: 20px;
  right: 22px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
}

.auth-lang-btn {
  min-width: 56px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.auth-lang-btn.is-active {
  background: #111111;
  color: #ffffff;
}

.auth-layout {
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 460px);
  gap: 24px;
  align-items: stretch;
}

.auth-hero,
.auth-card {
  border: 1px solid var(--line);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.auth-hero {
  position: relative;
  overflow: hidden;
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  min-height: 520px;
}

.auth-hero::before,
.auth-hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.auth-hero::before {
  width: 340px;
  height: 340px;
  right: -90px;
  top: -110px;
  background: radial-gradient(circle, rgba(17, 17, 17, 0.08), transparent 70%);
}

.auth-hero::after {
  width: 300px;
  height: 300px;
  left: -90px;
  bottom: -120px;
  background: radial-gradient(circle, rgba(17, 17, 17, 0.05), transparent 72%);
}

.brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.brand::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #111111;
}

.auth-hero h1 {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.auth-chip,
.sidebar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.auth-card {
  padding: 34px 30px;
}

.auth-card-head h2 {
  margin: 14px 0 6px;
  font-size: 30px;
  line-height: 1.06;
  letter-spacing: -0.05em;
}

.auth-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.auth-form label {
  color: var(--muted);
  font-size: 13px;
}

.auth-form input,
.conversation-rename-input,
.composer textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  color: var(--text);
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.auth-form input:focus,
.conversation-rename-input:focus,
.composer textarea:focus {
  border-color: rgba(17, 24, 39, 0.18);
  box-shadow: 0 0 0 4px rgba(17, 24, 39, 0.06);
}

.auth-form button,
.sidebar-primary,
.sidebar-secondary,
.logout-btn,
.model-button,
.model-menu button,
.workspace-link,
.conversation-main,
.conversation-edit,
.conversation-delete,
.prompt-card {
  border: 0;
  cursor: pointer;
}

.auth-form button,
.sidebar-primary {
  height: 48px;
  border-radius: 18px;
  background: #111111;
  color: #ffffff;
  font-weight: 700;
}

.auth-form button:hover,
.sidebar-primary:hover,
.send-btn:hover {
  opacity: 0.94;
}

.auth-card a {
  display: inline-flex;
  margin-top: 16px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.flash {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid #fecaca;
  background: #fff4f4;
  color: #b42318;
  font-size: 14px;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  padding: 18px 14px;
  overflow: hidden;
  background: rgba(243, 243, 240, 0.94);
  border-right: 1px solid var(--line);
}

.sidebar-header {
  display: grid;
  gap: 14px;
  flex-shrink: 0;
}

.sidebar-workflows {
  display: grid;
  gap: 8px;
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-primary {
  width: 100%;
  font-size: 12px;
}

.sidebar-secondary {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--text);
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.sidebar-secondary:hover {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--line-strong);
}

.conversation-list {
  display: grid;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 6px;
  align-content: start;
}

.conversation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
}

.conversation-main {
  width: 100%;
  padding: 12px 14px;
  border-radius: 18px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  text-align: left;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.conversation-main:hover,
.conversation-edit:hover,
.conversation-delete:hover,
.workspace-link:hover,
.model-menu button:hover,
.prompt-card:hover {
  background: rgba(255, 255, 255, 0.72);
}

.conversation-main.active {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
}

.conversation-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}

.conversation-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted-soft);
  font-size: 10px;
}

.conversation-edit,
.conversation-delete {
  width: 32px;
  height: 32px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
  color: var(--muted);
}

.conversation-edit::before {
  content: "✎";
  font-size: 12px;
}

.conversation-delete::before {
  content: "×";
  font-size: 16px;
  line-height: 1;
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 12px;
  flex-shrink: 0;
}

.workspace-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

.sidebar-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.sidebar-account-copy {
  min-width: 0;
}

.sidebar-account-label,
.topbar-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--muted-soft);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sidebar-account strong {
  display: block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.logout-btn {
  min-width: 72px;
  height: 38px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

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

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px 10px;
  background: rgba(245, 245, 243, 0.82);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
}

.topbar-copy h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-soft);
}

.mode-switch-btn {
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.mode-switch-btn.is-active {
  background: #111111;
  color: #ffffff;
}

.model-picker {
  position: relative;
}

.model-button,
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.model-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 240px;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.model-menu-section + .model-menu-section {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.model-menu-section-label {
  padding: 6px 12px 8px;
  color: var(--muted-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.model-menu button {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.model-menu button.active {
  background: #111111;
  color: #ffffff;
}

.chat-pane {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 6px 28px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  gap: 12px;
  overflow: hidden;
}

.messages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 20px 0 10px;
}

.messages-empty {
  max-width: 760px;
  margin: 68px auto 0;
}

.messages-empty-copy {
  text-align: center;
}

.messages-empty h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.06;
  letter-spacing: -0.06em;
}

.messages-empty p {
  margin: 14px auto 0;
  max-width: 520px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.media-controls {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-soft);
  flex-shrink: 0;
}

.media-control-panel,
.media-control-row,
.option-pill-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.media-control-row {
  gap: 12px;
}

.media-control-label {
  color: var(--muted-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.option-pill-row {
  gap: 8px;
}

.option-pill {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.option-pill.is-active {
  border-color: #111111;
  background: #111111;
  color: #ffffff;
}

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

.prompt-card {
  min-height: 76px;
  padding: 16px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  text-align: left;
  font-size: 13px;
  line-height: 1.55;
  box-shadow: var(--shadow-soft);
}

.msg {
  max-width: 100%;
  margin-bottom: 22px;
  padding: 0 8px;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.msg.user {
  margin-left: auto;
  width: fit-content;
  max-width: min(76%, 760px);
  padding: 14px 18px;
  border-radius: 24px;
  background: var(--user);
}

.msg.user.has-rich-content {
  padding: 0;
  background: transparent;
}

.msg.assistant {
  max-width: min(820px, 100%);
}

.msg-bubble {
  width: min(760px, 100%);
  padding: 14px 18px;
  border-radius: 24px;
  background: var(--user);
}

.msg-bubble-copy {
  white-space: pre-wrap;
}

.msg-card {
  width: min(820px, 100%);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.msg.user .msg-card {
  width: min(760px, 100%);
  background: #f0f1f4;
}

.msg-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 0;
}

.msg-card-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #111111;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
}

.msg-card-meta,
.msg-card-status {
  color: var(--muted-soft);
  font-size: 11px;
}

.msg-card-status {
  padding: 6px 16px 0;
}

.msg-card-body {
  padding: 14px 16px 16px;
}

.msg-card-caption,
.msg-card-error {
  margin: 12px 0 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.msg-card-error {
  color: #b42318;
}

.msg-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.msg-card-actions a,
.msg-card-actions button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.msg-card-actions button:hover,
.msg-card-actions a:hover {
  border-color: var(--line-strong);
  background: #ffffff;
}

.message-attachments {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.message-attachment {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  text-decoration: none;
}

.message-attachment-preview,
.pending-attachment-preview {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #f1f3f5;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.message-attachment-preview.is-image,
.pending-attachment-preview.is-image {
  object-fit: cover;
  background: #e9edf1;
}

.message-attachment-meta,
.pending-attachment-meta {
  min-width: 0;
}

.message-attachment-meta strong,
.pending-attachment-meta strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.message-attachment-meta span,
.pending-attachment-meta span {
  display: block;
  margin-top: 4px;
  color: var(--muted-soft);
  font-size: 11px;
}

.media-preview {
  width: 100%;
  display: block;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #f6f7f9;
}

.media-preview-image {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.media-preview-video {
  max-height: 520px;
  background: #000000;
}

.progress-bar {
  width: 100%;
  height: 10px;
  margin-top: 8px;
  border-radius: 999px;
  background: #eceef2;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #111111;
}

.composer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 24px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  flex-shrink: 0;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.composer.is-dragging-upload {
  border-color: #111111;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08), var(--shadow);
}

.composer-drop-hint {
  position: absolute;
  inset: 6px;
  z-index: 3;
  display: grid;
  place-items: center;
  border: 1px dashed #111111;
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.88);
  color: #111111;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  pointer-events: none;
  backdrop-filter: blur(8px);
}

.composer-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.composer-input-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 8px;
}

.attach-btn,
.pending-attachment-remove {
  border: 1px solid var(--line);
  cursor: pointer;
}

.attach-btn {
  position: relative;
  z-index: 1;
  flex: 0 0 36px;
  min-width: 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.attach-btn:hover {
  border-color: var(--line-strong);
  background: #f8f8f8;
}

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

.pending-attachments {
  display: grid;
  gap: 10px;
}

.edit-source-chip {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8f9fa;
}

.edit-source-thumb {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  object-fit: cover;
  background: #f1f3f5;
}

.edit-source-copy {
  min-width: 0;
}

.edit-source-copy strong,
.edit-source-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edit-source-copy strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.edit-source-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.edit-source-cancel {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.pending-attachment {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fafafb;
}

.pending-attachment-remove {
  min-width: 54px;
  height: 34px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.composer textarea {
  resize: none;
  min-height: 36px;
  max-height: 220px;
  border: 0;
  padding: 7px 2px 7px 0;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  line-height: 1.7;
  overflow-y: auto;
}

.composer textarea:focus {
  box-shadow: none;
}

.send-btn {
  position: relative;
  z-index: 1;
  flex: 0 0 36px;
  min-width: 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  background: #111111;
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.send-btn:hover {
  opacity: 1;
  background: #1a1a1a;
}

.composer-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 0 4px;
  color: var(--muted-soft);
  font-size: 11px;
  flex-shrink: 0;
}

@media (min-width: 961px) {
  body.chat-page {
    overflow: hidden;
  }

  .app-shell {
    height: 100vh;
    overflow: hidden;
  }
}

.typing {
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.thinking-card {
  width: min(820px, 100%);
  padding: 18px 18px 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.thinking-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.thinking-card-head strong {
  display: block;
  font-size: 13px;
}

.thinking-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.thinking-dot {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  border-radius: 999px;
  background: #111111;
  animation: thinkingPulse 1.1s ease-in-out infinite;
}

.thinking-steps {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.thinking-step {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 16px;
  background: #f7f8fa;
  color: var(--muted);
  transition: background 0.18s ease, color 0.18s ease;
}

.thinking-step.is-active {
  background: #111111;
  color: #ffffff;
}

.thinking-step.is-done {
  background: #eceff3;
  color: var(--text);
}

.thinking-step-mark {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.thinking-step-copy {
  font-size: 12px;
  font-weight: 600;
}

@keyframes thinkingPulse {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.92);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.conversation-list,
.messages,
.composer textarea {
  scrollbar-width: thin;
  scrollbar-color: #cbced3 transparent;
}

.conversation-list::-webkit-scrollbar,
.messages::-webkit-scrollbar,
.composer textarea::-webkit-scrollbar {
  width: 10px;
}

.conversation-list::-webkit-scrollbar-track,
.messages::-webkit-scrollbar-track,
.composer textarea::-webkit-scrollbar-track {
  background: transparent;
}

.conversation-list::-webkit-scrollbar-thumb,
.messages::-webkit-scrollbar-thumb,
.composer textarea::-webkit-scrollbar-thumb {
  background: #c9ccd1;
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

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

  .auth-hero {
    min-height: 300px;
  }
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .conversation-list {
    max-height: 220px;
  }

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

  .topbar-actions {
    justify-content: flex-start;
  }

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

@media (max-width: 640px) {
  .auth-language {
    top: 14px;
    right: 14px;
  }

  .auth-shell,
  .topbar,
  .chat-pane {
    padding-left: 18px;
    padding-right: 18px;
  }

  .auth-hero,
  .auth-card {
    border-radius: 26px;
  }

  .auth-hero {
    padding: 28px 24px;
    min-height: 240px;
  }

  .auth-card {
    padding: 26px 22px;
  }

  .sidebar-account {
    flex-direction: column;
    align-items: stretch;
  }

  .mode-switch,
  .model-button,
  .user-chip {
    width: 100%;
    justify-content: center;
  }

  .sidebar-account strong {
    max-width: none;
  }

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

  .composer-input-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .send-btn {
    justify-self: end;
  }

  .media-control-row {
    align-items: flex-start;
  }

  .messages-empty {
    margin-top: 44px;
  }

  .messages-empty h2 {
    font-size: 28px;
  }

  .msg.user {
    max-width: 100%;
  }
}
