:root {
  --page: #f7f7f3;
  --panel: #efefe9;
  --surface: #ffffff;
  --ink: #111916;
  --muted: #727b76;
  --line: #dcded8;
  --soft-line: #e8e9e4;
  --accent: #109b7e;
  --accent-soft: #e2f5ef;
  --danger: #bd4b42;
  --shadow: 0 22px 60px rgba(20, 31, 27, 0.08);
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--page);
  color: var(--ink);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  height: var(--app-viewport-height, 100dvh);
}

button,
select,
textarea {
  font: inherit;
}

button,
a,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(16, 155, 126, 0.2);
  outline-offset: 2px;
}

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

.sidebar {
  position: relative;
  z-index: 20;
  display: flex;
  height: 100%;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--panel);
  padding: 24px 18px 18px;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 760;
  letter-spacing: 0.12em;
  text-decoration: none;
}

.brand-mark,
.empty-mark {
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--ink);
  color: white;
  font-family: Georgia, serif;
  font-weight: 700;
}

.brand-mark {
  width: 40px;
  height: 40px;
  font-size: 15px;
}

.icon-button {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.icon-button:hover {
  background: rgba(17, 25, 22, 0.06);
}

.sidebar-close,
.menu-button {
  display: none;
}

.new-chat-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  margin-top: 26px;
  border: 1px solid var(--ink);
  border-radius: 15px;
  background: var(--ink);
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease;
}

.new-chat-button:hover {
  background: #25302c;
  transform: translateY(-1px);
}

.history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 8px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.text-button:hover {
  color: var(--danger);
}

.conversation-list {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.conversation-item {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  border-radius: 12px;
}

.conversation-item.active {
  background: var(--surface);
  box-shadow: 0 6px 20px rgba(20, 31, 27, 0.04);
}

.conversation-open {
  min-width: 0;
  flex: 1;
  padding: 11px 38px 11px 12px;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-delete {
  position: absolute;
  right: 5px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
}

.conversation-item:hover .conversation-delete,
.conversation-delete:focus-visible {
  opacity: 1;
}

.conversation-delete:hover {
  background: #fae8e6;
  color: var(--danger);
}

.history-empty {
  margin: 14px 8px auto;
  color: #939a96;
  font-size: 13px;
}

.cloud-history-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.56);
}

.cloud-history-card > div {
  min-width: 0;
}

.cloud-history-card strong,
.cloud-history-card span {
  display: block;
}

.cloud-history-card strong {
  margin-bottom: 3px;
  font-size: 12px;
}

.cloud-history-card span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-history-card.enabled {
  border-color: #b9ded4;
  background: var(--accent-soft);
}

.cloud-history-card.warning {
  border-color: #efc7c3;
  background: #fff4f2;
}

.cloud-settings-button {
  min-width: 46px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.cloud-settings-button:hover:not(:disabled) {
  border-color: #96bdb2;
  color: var(--accent);
}

.cloud-settings-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.privacy-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.privacy-note strong,
.privacy-note span {
  display: block;
}

.privacy-note strong {
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 12px;
}

.privacy-note span {
  font-size: 11px;
  line-height: 1.5;
}

.chat-main {
  display: grid;
  height: 100%;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 0%, rgba(16, 155, 126, 0.07), transparent 34%),
    var(--page);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 78px;
  padding: 14px 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 247, 243, 0.88);
  backdrop-filter: blur(14px);
}

.header-left,
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.model-control,
.style-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.model-control label,
.style-control label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
}

.model-control select,
.style-control select {
  min-width: 210px;
  max-width: min(42vw, 360px);
  height: 44px;
  padding: 0 38px 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 680;
}

.style-control select {
  min-width: 104px;
  max-width: 120px;
}

.model-control select:disabled,
.style-control select:disabled {
  color: var(--muted);
  cursor: wait;
}

.account-state {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #0a765f;
  font-size: 12px;
  font-weight: 700;
}

.account-state.error {
  background: #fae8e6;
  color: var(--danger);
}

.console-link {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.console-link:hover {
  color: var(--accent);
}

.chat-stage {
  position: relative;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

.empty-state {
  display: flex;
  width: min(680px, calc(100% - 40px));
  min-height: 100%;
  margin: 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 0 90px;
  text-align: center;
}

.empty-mark {
  width: 58px;
  height: 58px;
  border-radius: 17px;
  font-size: 23px;
  box-shadow: var(--shadow);
}

.empty-state h1 {
  margin: 24px 0 10px;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.04em;
}

.empty-state p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.starter-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 32px;
}

.starter-grid button {
  min-height: 64px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.72);
  color: #424b47;
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  transition: border-color 160ms ease, transform 160ms ease;
}

.starter-grid button:hover {
  border-color: #aeb5b0;
  transform: translateY(-1px);
}

.message-list {
  display: flex;
  width: min(840px, calc(100% - 40px));
  margin: 0 auto;
  flex-direction: column;
  gap: 28px;
  padding: 42px 0 54px;
}

.message-list:empty {
  display: none;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

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

.message-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 10px;
  background: var(--ink);
  color: white;
  font-family: Georgia, serif;
  font-size: 12px;
  font-weight: 700;
}

.message-content {
  min-width: 0;
  max-width: min(720px, 82%);
}

.message.user .message-content {
  padding: 12px 16px;
  border-radius: 18px 18px 5px 18px;
  background: #e9eae5;
}

.message-image-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 180px));
  gap: 8px;
  margin-bottom: 10px;
}

.message-image-gallery img {
  display: block;
  width: 100%;
  max-height: 220px;
  border-radius: 12px;
  object-fit: cover;
}

.message-image-unavailable {
  margin-bottom: 8px;
  padding: 9px 11px;
  border: 1px dashed #bdc3bd;
  border-radius: 11px;
  color: #737b77;
  font-size: 12px;
}

.message.assistant .message-content {
  padding: 2px 0 0;
}

.message-text {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.8;
}

.markdown-body {
  white-space: normal;
}

.markdown-body > :first-child {
  margin-top: 0;
}

.markdown-body > :last-child {
  margin-bottom: 0;
}

.markdown-body p {
  margin: 0 0 14px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  margin: 24px 0 10px;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.markdown-body h1 { font-size: 1.48em; }
.markdown-body h2 { font-size: 1.3em; }
.markdown-body h3 { font-size: 1.16em; }
.markdown-body h4 { font-size: 1.04em; }

.markdown-body ul,
.markdown-body ol {
  margin: 8px 0 16px;
  padding-left: 1.55em;
}

.markdown-body li {
  margin: 4px 0;
  padding-left: 0.18em;
}

.markdown-body blockquote {
  margin: 12px 0 16px;
  padding: 8px 0 8px 15px;
  border-left: 3px solid #9bcabd;
  color: #59635f;
}

.markdown-body hr {
  height: 1px;
  margin: 24px 0;
  border: 0;
  background: var(--line);
}

.markdown-body a {
  color: #087e66;
  text-decoration: underline;
  text-decoration-color: rgba(8, 126, 102, 0.35);
  text-underline-offset: 3px;
}

.markdown-body :not(pre) > code {
  padding: 0.15em 0.38em;
  border: 1px solid #daddd7;
  border-radius: 5px;
  background: #eff1ed;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
}

.markdown-math-inline {
  display: inline-block;
  max-width: 100%;
  margin: 0 0.08em;
  vertical-align: -0.08em;
}

.markdown-math-block {
  max-width: 100%;
  margin: 14px 0 18px;
  padding: 10px 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  text-align: center;
}

.markdown-math-block .katex-display {
  margin: 0;
}

.markdown-code-block {
  margin: 14px 0 18px;
  overflow: hidden;
  border: 1px solid #29322f;
  border-radius: 13px;
  background: #131916;
  color: #e7eee9;
}

.markdown-code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  padding: 0 12px;
  border-bottom: 1px solid #2b3531;
  color: #9ead9f;
  font-size: 11px;
}

.markdown-code-toolbar button {
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: #c4d0c8;
  cursor: pointer;
  font: inherit;
}

.markdown-code-toolbar button:hover {
  color: white;
}

.markdown-code-block pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  white-space: pre;
  tab-size: 2;
}

.markdown-code-block code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.65;
}

.markdown-table-wrap {
  max-width: 100%;
  margin: 14px 0 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.markdown-body table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.45);
  font-size: 13px;
}

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

.markdown-body th {
  background: #eef1ec;
  font-weight: 750;
}

.markdown-body tr:last-child td { border-bottom: 0; }
.markdown-body th:last-child,
.markdown-body td:last-child { border-right: 0; }

.message-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 8px;
  color: #909793;
  font-size: 11px;
}

.copy-message {
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.copy-message:hover {
  color: var(--accent);
}

.typing-cursor::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 16px;
  margin-left: 3px;
  vertical-align: -2px;
  background: var(--accent);
  animation: blink 900ms steps(2, jump-none) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.stage-status {
  width: min(760px, calc(100% - 40px));
  margin: 28px auto;
  padding: 18px;
  border: 1px solid #efc7c3;
  border-radius: 16px;
  background: #fff4f2;
  color: #7c312b;
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}

.stage-status a {
  color: inherit;
  font-weight: 750;
}

.composer-wrap {
  position: relative;
  z-index: 5;
  min-height: 0;
  padding: 12px 24px 18px;
  background: linear-gradient(to top, var(--page) 72%, rgba(247, 247, 243, 0));
}

.composer {
  width: min(840px, 100%);
  margin: 0 auto;
  padding: 13px 14px 10px;
  border: 1px solid #cfd3cd;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 16px 46px rgba(20, 31, 27, 0.08);
}

.composer:focus-within {
  border-color: #96bdb2;
  box-shadow: 0 16px 46px rgba(20, 31, 27, 0.09), 0 0 0 3px rgba(16, 155, 126, 0.08);
}

.composer.is-dragging {
  border-color: var(--accent);
  background: #f2fbf8;
  box-shadow: 0 0 0 4px rgba(16, 155, 126, 0.1);
}

.image-preview-list {
  display: flex;
  gap: 9px;
  margin-bottom: 10px;
}

.image-preview-list[hidden] {
  display: none;
}

.image-preview-item {
  position: relative;
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
}

.image-preview-item img {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid #d6dad5;
  border-radius: 12px;
  object-fit: cover;
}

.image-preview-remove {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  width: 22px;
  height: 22px;
  padding: 0;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--ink);
  color: white;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.composer textarea {
  display: block;
  width: 100%;
  max-height: 190px;
  resize: none;
  overflow-y: auto;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.65;
}

.composer textarea::placeholder {
  color: #9ba19d;
}

.composer textarea:disabled {
  cursor: not-allowed;
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 7px;
}

.composer-tools {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.attach-image-button {
  display: inline-flex;
  min-height: 32px;
  padding: 0 10px;
  align-items: center;
  gap: 3px;
  border: 1px solid #d4d8d3;
  border-radius: 10px;
  background: #f8f9f6;
  color: #58615d;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.attach-image-button:hover:not(:disabled) {
  border-color: #9bbdb4;
  color: #087e66;
}

.attach-image-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.composer-hint {
  color: #9ba19d;
  font-size: 11px;
}

.send-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 11px;
  background: var(--ink);
  color: white;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.send-button:hover:not(:disabled) {
  background: var(--accent);
}

.send-button:disabled {
  background: #d2d5d1;
  cursor: not-allowed;
}

.usage-note {
  margin: 9px auto 0;
  color: #969d99;
  font-size: 11px;
  text-align: center;
}

.confirm-dialog {
  width: min(420px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.confirm-dialog::backdrop {
  background: rgba(17, 25, 22, 0.36);
  backdrop-filter: blur(4px);
}

.confirm-dialog form {
  padding: 26px;
}

.confirm-dialog h2 {
  margin: 0;
  font-size: 20px;
}

.confirm-dialog p {
  margin: 12px 0 24px;
  color: var(--muted);
  line-height: 1.7;
}

.cloud-dialog {
  width: min(540px, calc(100% - 32px));
}

.cloud-disclosure {
  margin: -8px 0 20px;
  padding-left: 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.85;
}

.cloud-acknowledgement {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 22px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--page);
  color: #4e5853;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.55;
}

.cloud-acknowledgement input {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin: 2px 0 0;
  accent-color: var(--accent);
}

.cloud-dialog-status {
  margin: -8px 0 18px !important;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff4f2;
  color: var(--danger) !important;
  font-size: 12px;
}

.dialog-primary {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: white;
}

.dialog-primary:disabled,
.cloud-dialog-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.cloud-clear-button:hover {
  color: var(--danger);
}

.cloud-disable-button {
  white-space: nowrap;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dialog-actions button {
  min-height: 42px;
  padding: 0 17px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
}

.dialog-cancel {
  border: 1px solid var(--line);
  background: white;
  color: var(--ink);
}

.dialog-confirm {
  border: 1px solid var(--danger);
  background: var(--danger);
  color: white;
}

.toast {
  position: fixed;
  z-index: 80;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100% - 44px));
  padding: 13px 16px;
  border-radius: 13px;
  background: var(--ink);
  color: white;
  box-shadow: var(--shadow);
  font-size: 13px;
}

.sidebar-backdrop {
  display: none;
  pointer-events: none;
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
    height: 100%;
    min-height: 0;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(310px, calc(100vw - 52px));
    transform: translateX(-102%);
    transition: transform 200ms ease;
    box-shadow: 24px 0 70px rgba(17, 25, 22, 0.2);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 15;
    inset: 0;
    display: none;
    background: rgba(17, 25, 22, 0.3);
    pointer-events: none;
  }

  .sidebar-backdrop:not([hidden]) {
    display: block;
    pointer-events: auto;
  }

  .sidebar-close,
  .menu-button {
    display: inline-grid;
  }

  .chat-main {
    height: 100%;
    min-height: 0;
  }

  .chat-header {
    min-height: 70px;
    padding: 10px 14px;
  }

  .header-left {
    min-width: 0;
    flex: 1;
    gap: 8px;
  }

  .header-actions {
    display: none;
  }

  .model-control {
    min-width: 0;
    flex: 1;
  }

  .model-control label,
  .style-control label {
    display: none;
  }

  .model-control select {
    width: 100%;
    min-width: 0;
    max-width: none;
    height: 42px;
    font-size: 14px;
  }

  .style-control select {
    width: 86px;
    min-width: 86px;
    max-width: 86px;
    height: 42px;
    font-size: 14px;
  }

  .composer textarea {
    font-size: 16px;
  }

  .empty-state {
    padding: 48px 0 68px;
  }

  .starter-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
  }

  .starter-grid button {
    min-height: 52px;
    text-align: center;
  }

  .message-list {
    width: calc(100% - 28px);
    gap: 24px;
    padding-top: 28px;
  }

  .message-content {
    max-width: 86%;
  }

  .composer-wrap {
    padding: 10px 10px max(12px, env(safe-area-inset-bottom));
  }

  .composer-hint {
    display: none;
  }

  .usage-note {
    display: none;
  }

  .cloud-dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .cloud-dialog-actions button {
    width: 100%;
  }
}

.sidebar-backdrop[hidden] {
  display: none !important;
  pointer-events: none !important;
}

@media (max-width: 480px) {
  .brand {
    font-size: 14px;
  }

  .empty-state {
    width: calc(100% - 28px);
  }

  .empty-state h1 {
    font-size: 28px;
  }

  .empty-state p {
    font-size: 14px;
  }

  .message-avatar {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
    border-radius: 9px;
  }

  .message-text {
    font-size: 14px;
  }
}

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