:root {
  color-scheme: light;
  --canvas: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #edf3f9;
  --ink: #172033;
  --muted: #68768a;
  --muted-strong: #46566c;
  --line: #dce5ef;
  --line-strong: #c5d2e1;
  --accent: #176fd1;
  --accent-dark: #0f55a8;
  --accent-soft: #e7f1fc;
  --gold: #d5a34f;
  --danger: #b53b3b;
  --danger-soft: #f8eaea;
  --sidebar-width: 282px;
  --header-height: 64px;
  --shadow: 0 16px 44px rgba(31, 55, 86, 0.12);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background: var(--canvas);
}

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

button,
input,
textarea {
  color: inherit;
}

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

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
  text-transform: uppercase;
}

.brand-lockup {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  font-size: 16px;
  font-weight: 750;
  white-space: nowrap;
}

.brand-lockup img {
  width: 46px;
  height: 34px;
  object-fit: contain;
}

.brand-lockup-light {
  color: var(--ink);
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted-strong);
  background: transparent;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.icon-button:hover {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface-soft);
}

.danger-hover:hover {
  border-color: #edcaca;
  color: var(--danger);
  background: var(--danger-soft);
}

.primary-button,
.secondary-button,
.danger-button,
.icon-text-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 17px;
  border-radius: 6px;
  font-weight: 700;
}

.primary-button {
  color: #fff;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-dark);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.secondary-button,
.icon-text-button {
  border: 1px solid var(--line-strong);
  color: var(--muted-strong);
  background: var(--surface);
}

.secondary-button:hover,
.icon-text-button:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.danger-button {
  color: #fff;
  background: var(--danger);
}

/* Authentication */
.auth-page {
  min-height: 100dvh;
  overflow-x: hidden;
  background: var(--surface);
}

.auth-shell {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: minmax(360px, 42%) minmax(460px, 58%);
}

.auth-brand {
  position: relative;
  display: flex;
  min-height: 100dvh;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  padding: 42px 48px 52px;
  color: var(--ink);
  background: #edf4fb;
}

.auth-brand > .brand-lockup {
  gap: 14px;
  font-size: 20px;
}

.auth-brand > .brand-lockup img {
  width: 84px;
  height: 63px;
}

.auth-brand::after {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 4px;
  height: 100%;
  background: var(--gold);
  content: "";
}

.auth-brand-content {
  position: relative;
  z-index: 1;
  max-width: 530px;
  margin: auto 0;
  padding: 70px 0;
}

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

.auth-brand-content h1 {
  max-width: 520px;
  margin: 18px 0 20px;
  font-size: 43px;
  font-weight: 720;
  line-height: 1.2;
}

.auth-brand-content > p:last-child {
  max-width: 450px;
  margin: 0;
  color: #53657a;
  font-size: 16px;
  line-height: 1.9;
}

.auth-panel {
  position: relative;
  display: grid;
  min-height: 100dvh;
  padding: 52px 52px 92px;
  place-items: center;
  background: var(--surface);
}

.auth-form-wrap {
  width: min(100%, 420px);
}

.auth-mobile-brand {
  display: none;
}

.auth-heading {
  margin-bottom: 32px;
}

.auth-heading h2 {
  margin: 10px 0 0;
  font-size: 31px;
  line-height: 1.3;
}

.form-field {
  margin-bottom: 20px;
}

.form-field label,
.app-dialog label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 650;
}

.form-field input,
.app-dialog input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
  background: var(--surface);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.form-field input:focus,
.app-dialog input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 111, 209, 0.13);
}

.form-field input[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(181, 59, 59, 0.12);
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 5px;
  right: 5px;
}

.agreement {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.agreement input {
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
  accent-color: var(--accent);
}

.agreement a,
.auth-switch a {
  color: var(--accent-dark);
  font-weight: 650;
}

.form-error {
  min-height: 22px;
  margin: 0 0 8px;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.6;
}

.auth-submit {
  width: 100%;
  min-height: 48px;
}

.auth-switch {
  margin: 24px 0 34px;
  color: var(--muted);
  text-align: center;
}

.auth-legal {
  display: flex;
  justify-content: center;
  gap: 22px;
  color: var(--muted);
  font-size: 13px;
}

.auth-legal a:hover {
  color: var(--ink);
}

.icp-link {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.icp-link:hover {
  color: var(--ink);
}

.auth-icp-footer {
  position: absolute;
  right: 24px;
  bottom: 22px;
  left: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  text-align: center;
}

.auth-page[data-mode="login"] .register-only {
  display: none;
}

/* Chat workspace */
.chat-page {
  height: 100dvh;
  overflow: hidden;
  background: var(--surface);
}

.sidebar {
  position: fixed;
  z-index: 20;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--canvas);
}

.sidebar-header {
  display: flex;
  min-height: var(--header-height);
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}

.new-chat-button {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  margin: 8px 14px 12px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 680;
  transition: border-color 140ms ease, background 140ms ease;
}

.new-chat-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.conversation-search {
  position: relative;
  margin: 0 14px 15px;
}

.conversation-search .icon {
  position: absolute;
  top: 10px;
  left: 11px;
  width: 17px;
  height: 17px;
  color: var(--muted);
}

.conversation-search input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  border: 1px solid transparent;
  border-radius: 6px;
  outline: none;
  background: #eaf0f7;
  font-size: 13px;
}

.conversation-search input:focus {
  border-color: var(--line-strong);
  background: var(--surface);
}

.history-label {
  padding: 0 19px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.conversation-list {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 0 9px 16px;
  scrollbar-width: thin;
}

.conversation-item {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  gap: 9px;
  margin-bottom: 3px;
  padding: 0 36px 0 10px;
  border-radius: 6px;
  color: var(--muted-strong);
  background: transparent;
  text-align: left;
}

.conversation-item > .icon {
  width: 16px;
  height: 16px;
}

.conversation-item-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.conversation-item:hover,
.conversation-item.active {
  color: var(--ink);
  background: #e7eef7;
}

.conversation-item.active::before {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 0;
  width: 3px;
  background: var(--accent);
  content: "";
}

.conversation-empty {
  padding: 18px 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
}

.sidebar-footer {
  border-top: 1px solid var(--line);
  padding: 9px;
}

.user-menu-wrap {
  position: relative;
}

.user-menu-button {
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 6px;
  background: transparent;
  text-align: left;
}

.user-menu-button:hover {
  background: #e7eef7;
}

.user-avatar,
.message-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  font-weight: 750;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  background: #3d5572;
}

.user-summary {
  display: block;
  min-width: 0;
  flex: 1;
}

.user-summary strong,
.user-summary small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-summary strong {
  font-size: 13px;
}

.user-summary small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.user-menu-button > .icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.user-menu {
  position: absolute;
  right: 0;
  bottom: 59px;
  left: 0;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.user-menu a,
.user-menu button {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border-radius: 5px;
  color: var(--muted-strong);
  background: transparent;
  text-align: left;
}

.user-menu a:hover {
  color: var(--ink);
  background: #e7eef7;
}

.user-menu button:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.user-menu .icon {
  width: 17px;
  height: 17px;
}

.user-menu-separator {
  height: 1px;
  margin: 5px 4px;
  background: var(--line);
}

.chat-main {
  display: grid;
  height: 100dvh;
  margin-left: var(--sidebar-width);
  grid-template-rows: var(--header-height) minmax(0, 1fr) auto;
  background: var(--surface);
}

.chat-header {
  position: relative;
  z-index: 5;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.chat-title-wrap {
  min-width: 0;
  flex: 1;
}

.chat-title-wrap h1 {
  max-width: 70vw;
  margin: 0;
  overflow: hidden;
  font-size: 15px;
  font-weight: 720;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.model-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.header-actions {
  display: flex;
  gap: 3px;
}

.chat-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

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

.empty-state > img {
  width: 96px;
  height: 72px;
  margin-bottom: 12px;
  object-fit: contain;
}

.empty-state h2 {
  margin: 9px 0 10px;
  font-size: 28px;
  line-height: 1.35;
}

.empty-state > p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.suggestion-grid {
  display: grid;
  width: min(100%, 720px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 34px;
}

.suggestion-grid button {
  display: block;
  min-height: 82px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.suggestion-grid button:hover {
  border-color: #a9c2df;
  background: var(--canvas);
  transform: translateY(-1px);
}

.suggestion-grid strong,
.suggestion-grid span {
  display: block;
}

.suggestion-grid strong {
  margin-bottom: 6px;
  color: var(--accent-dark);
  font-size: 13px;
}

.suggestion-grid span {
  overflow: hidden;
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-list {
  display: none;
  width: 100%;
  padding: 26px 0 54px;
}

.message-list.has-messages {
  display: block;
}

.message-row {
  width: 100%;
  padding: 17px 24px;
}

.message-inner {
  display: flex;
  width: min(100%, 820px);
  align-items: flex-start;
  gap: 13px;
  margin: 0 auto;
}

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

.message-avatar {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  color: #fff;
  background: var(--accent);
  font-size: 12px;
}

.message-row.user .message-avatar {
  order: 2;
  border-radius: 50%;
  background: #3d5572;
}

.message-body {
  min-width: 0;
  max-width: calc(100% - 43px);
}

.message-role {
  margin: 2px 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.message-row.user .message-role {
  display: none;
}

.message-content {
  color: #202b3d;
  font-size: 15px;
  line-height: 1.82;
  overflow-wrap: anywhere;
}

.message-row.user .message-content {
  max-width: 620px;
  padding: 10px 14px;
  border: 1px solid #d8e4f2;
  border-radius: 8px 2px 8px 8px;
  background: #eaf2fb;
  white-space: pre-wrap;
}

.message-content.streaming {
  white-space: pre-wrap;
}

.message-content p {
  margin: 0 0 13px;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-content h1,
.message-content h2,
.message-content h3 {
  margin: 20px 0 9px;
  font-size: 16px;
  line-height: 1.5;
}

.message-content ul,
.message-content ol {
  margin: 8px 0 14px;
  padding-left: 24px;
}

.message-content li {
  margin: 5px 0;
}

.message-content blockquote {
  margin: 12px 0;
  padding: 3px 0 3px 14px;
  border-left: 3px solid var(--accent);
  color: var(--muted-strong);
}

.message-content code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #edf2f7;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
}

.message-content pre {
  max-width: 100%;
  overflow-x: auto;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #334155;
  border-radius: 7px;
  color: #e7eef8;
  background: #182536;
}

.message-content pre code {
  padding: 0;
  color: inherit;
  background: transparent;
  line-height: 1.65;
}

.message-content a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.message-actions {
  display: flex;
  height: 32px;
  align-items: center;
  margin-top: 6px;
  opacity: 0;
  transition: opacity 140ms ease;
}

.message-row:hover .message-actions,
.message-actions:focus-within {
  opacity: 1;
}

.message-actions .icon-button {
  width: 30px;
  height: 30px;
}

.message-actions .icon {
  width: 16px;
  height: 16px;
}

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
}

.typing-indicator i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
  animation: typing 1.1s infinite ease-in-out;
}

.typing-indicator i:nth-child(2) { animation-delay: 130ms; }
.typing-indicator i:nth-child(3) { animation-delay: 260ms; }

@keyframes typing {
  0%, 60%, 100% { opacity: .35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

.composer-area {
  position: relative;
  z-index: 4;
  padding: 12px 22px 15px;
  background: var(--surface);
}

.composer {
  display: flex;
  width: min(100%, 820px);
  min-height: 58px;
  align-items: flex-end;
  gap: 10px;
  margin: 0 auto;
  padding: 8px 8px 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 26px rgba(31, 55, 86, 0.08);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.composer:focus-within {
  border-color: #8bb5e4;
  box-shadow: 0 8px 28px rgba(23, 111, 209, 0.11), 0 0 0 3px rgba(23, 111, 209, 0.08);
}

.composer textarea {
  width: 100%;
  max-height: 180px;
  min-height: 40px;
  resize: none;
  flex: 1;
  padding: 9px 0 7px;
  border: 0;
  outline: 0;
  background: transparent;
  line-height: 1.55;
}

.composer textarea::placeholder {
  color: #8794a6;
}

.send-button {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: var(--accent);
}

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

.send-button:disabled {
  cursor: not-allowed;
  color: #9aa7b8;
  background: #e5ebf2;
}

.send-button .stop-icon {
  display: none;
}

.composer.generating .send-button {
  background: #334a66;
}

.composer.generating .send-icon {
  display: none;
}

.composer.generating .stop-icon {
  display: block;
}

.composer-note {
  margin: 7px auto 0;
  color: #8390a2;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

.mobile-only {
  display: none;
}

.sidebar-overlay {
  position: fixed;
  z-index: 15;
  inset: 0;
  background: rgba(20, 34, 52, 0.42);
}

.app-dialog {
  width: min(430px, calc(100% - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.app-dialog::backdrop {
  background: rgba(24, 37, 54, 0.45);
}

.app-dialog form {
  padding: 22px;
}

.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.dialog-heading h2 {
  margin: 0;
  font-size: 18px;
}

.app-dialog > form > p {
  margin: -6px 0 24px;
  color: var(--muted);
  line-height: 1.7;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}

.toast-region {
  position: fixed;
  z-index: 100;
  top: 18px;
  right: 18px;
  display: grid;
  width: min(360px, calc(100% - 36px));
  gap: 9px;
}

.toast {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  color: var(--muted-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.6;
}

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

/* Legal documents */
.legal-page {
  min-height: 100dvh;
  background: var(--surface);
}

.legal-header {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  min-height: 68px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 max(24px, calc((100% - 960px) / 2));
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.legal-actions {
  display: flex;
  gap: 8px;
}

.legal-actions .icon-text-button {
  min-height: 38px;
  padding: 0 12px;
  font-size: 13px;
}

.legal-document {
  width: min(100% - 40px, 760px);
  margin: 0 auto;
  padding: 72px 0 90px;
}

.legal-document h1 {
  margin: 12px 0 10px;
  font-size: 34px;
  line-height: 1.3;
}

.legal-meta {
  margin: 0 0 42px;
  color: var(--muted);
  font-size: 13px;
}

.legal-document h2 {
  margin: 34px 0 11px;
  padding-top: 6px;
  font-size: 18px;
  line-height: 1.5;
}

.legal-document h3 {
  margin: 22px 0 8px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
}

.legal-document p,
.legal-document li {
  margin: 0 0 13px;
  color: #40516a;
  line-height: 1.9;
}

.legal-document ul {
  margin: 0 0 16px;
  padding-left: 24px;
}

.legal-document li {
  margin-bottom: 7px;
}

.legal-document a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 28px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: minmax(320px, 40%) minmax(420px, 60%);
  }

  .auth-brand {
    padding: 34px 32px 42px;
  }

  .auth-brand-content h1 {
    font-size: 35px;
  }

  .auth-panel {
    padding: 40px 40px 84px;
  }
}

@media (max-width: 760px) {
  .auth-shell {
    display: block;
  }

  .auth-brand {
    display: none;
  }

  .auth-panel {
    min-height: 100dvh;
    padding: 28px 22px 78px;
  }

  .auth-mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 54px;
    font-weight: 750;
  }

  .auth-mobile-brand img {
    width: 46px;
    height: 34px;
    object-fit: contain;
  }

  .auth-heading h2 {
    font-size: 27px;
  }

  .mobile-only {
    display: inline-grid;
  }

  .sidebar {
    width: min(88vw, var(--sidebar-width));
    min-width: 0;
    transform: translateX(-102%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow);
  }

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

  .chat-main {
    margin-left: 0;
  }

  .chat-header {
    padding: 0 12px;
  }

  .chat-title-wrap h1 {
    max-width: 55vw;
  }

  .empty-state {
    width: min(100% - 28px, 620px);
    padding-top: 40px;
  }

  .empty-state h2 {
    font-size: 23px;
  }

  .suggestion-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 28px;
  }

  .suggestion-grid button {
    min-height: 70px;
  }

  .message-row {
    padding: 15px 13px;
  }

  .message-inner {
    gap: 9px;
  }

  .message-body {
    max-width: calc(100% - 39px);
  }

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

  .composer-area {
    padding: 9px 10px 10px;
  }

  .composer-note {
    padding: 0 6px;
    font-size: 10px;
  }

  .legal-header {
    min-height: 62px;
    padding: 0 14px;
  }

  .legal-header .brand-lockup span {
    display: none;
  }

  .legal-actions .icon-text-button {
    width: 38px;
    min-height: 38px;
    padding: 0;
    font-size: 0;
  }

  .legal-document {
    width: min(100% - 32px, 760px);
    padding: 48px 0 70px;
  }

  .legal-document h1 {
    font-size: 27px;
  }

  .toast-region {
    top: 10px;
    right: 10px;
    width: calc(100% - 20px);
  }
}

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

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  html,
  body {
    width: 210mm;
    margin: 0;
    background: #fff;
  }

  .legal-header,
  .legal-footer {
    display: none;
  }

  .legal-document {
    width: 100%;
    margin: 0;
    padding: 14mm 16mm;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
  }

  .legal-document h1 {
    font-size: 26px;
  }
}
