:root {
  font-family: "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #302f2c;
  background: #fcfcfb;
  font-synthesis: none;
  --sidebar: #fafaf9;
  --muted: #82817b;
  --line: #e3e3e2;
  --accent: #353936;
  --icon: #656b67;
  --icon-hover: #262b28;
  --icon-disabled: #a6aba7;
  --icon-surface: #eceeeb;
  --action-hover: #484e49;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

button:disabled {
  cursor: default;
}

[hidden] {
  display: none !important;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.icon-library {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.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;
}

.app-shell {
  display: flex;
  height: 100dvh;
  overflow: hidden;
}

.sidebar {
  width: 272px;
  flex: 0 0 272px;
  display: flex;
  flex-direction: column;
  padding: 18px 12px 0;
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 5px 26px;
}

.brand {
  color: #292a2d;
  font-family: Georgia, "Noto Serif CJK SC", serif;
  font-size: 27px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -.7px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--icon);
}

.icon-button:hover:not(:disabled) {
  background: var(--icon-surface);
  color: var(--icon-hover);
}

.new-chat {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  height: 43px;
  padding: 0 12px;
  background: #ecebe7;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
  font-size: 14px;
}

.new-chat:hover {
  background: #dfded8;
}

.new-chat svg {
  color: var(--icon);
}

.new-chat:hover svg {
  color: var(--icon-hover);
}

.history-section {
  flex: 1;
  margin-top: 24px;
  overflow: auto;
  min-height: 0;
  padding-bottom: 20px;
}

.history-section h2 {
  margin: 0 12px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.conversation-item {
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 7px;
  margin-bottom: 3px;
}

.conversation-item:hover,
.conversation-item.active {
  background: #e7e6e1;
}

.conversation-link {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.delete-conversation {
  width: 29px;
  height: 29px;
  margin-right: 5px;
  opacity: 0;
}

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

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

.history-empty {
  margin: 16px 12px;
  font-size: 12px;
  color: #999890;
}

.workspace {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 66px;
  flex-shrink: 0;
  padding: 0 30px;
  color: #6e6d67;
  font-size: 13px;
}

#conversation-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#open-sidebar {
  display: none;
}

.conversation-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.welcome {
  display: none;
}

.welcome-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.welcome-icon {
  color: var(--accent);
  width: 40px;
  height: 40px;
}

h1 {
  margin: 0;
  font-family: "Noto Serif CJK SC", "Songti SC", "SimSun", Georgia, serif;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 500;
  letter-spacing: .4px;
  line-height: 1.5;
}

.messages {
  width: min(100%, 800px);
  margin: 0 auto;
  padding: 26px 28px 24px;
}

.message {
  margin: 0 0 24px;
  font-size: 15px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.message.user {
  margin-left: auto;
  width: fit-content;
  max-width: 88%;
  padding: 12px 19px;
  border-radius: 18px;
  background: #eeede9;
  white-space: pre-wrap;
}

.message.assistant {
  padding: 0 4px;
}

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

.thinking {
  margin: 0 0 6px;
  color: #747873;
  font-size: 13px;
}

.thinking summary {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 1px 0;
  cursor: pointer;
  list-style: none;
}

.thinking summary::-webkit-details-marker {
  display: none;
}

.thinking summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 3px;
}

.thinking summary:hover {
  color: var(--accent);
}

.thinking summary svg {
  width: 14px;
  height: 14px;
}

.thinking[open] summary svg {
  transform: rotate(180deg);
}

.thinking[data-state="thinking"] .thinking-title::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: breathe 1.3s ease-in-out infinite;
}

.thinking-content {
  max-height: 300px;
  margin-top: 9px;
  padding: 2px 14px;
  border-left: 2px solid var(--line);
  overflow-y: auto;
  overscroll-behavior: contain;
  line-height: 1.8;
}

.message-content {
  min-width: 0;
  display: flow-root;
}

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

.message-content > :first-child {
  margin-top: 0;
}

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

.message-content pre {
  margin: 14px 0;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f4f3f0;
  overflow: auto;
  font-family: "DejaVu Sans Mono", monospace;
  font-size: 13px;
  line-height: 1.65;
}

.message-content code {
  font-family: "DejaVu Sans Mono", monospace;
  font-size: .88em;
  border-radius: 4px;
  background: #eeede9;
  padding: 2px 4px;
}

.message-content pre code {
  padding: 0;
  border-radius: 0;
  background: transparent;
  font-size: inherit;
}

.message-content :is(h1, h2, h3, h4, h5, h6) {
  margin: 20px 0 9px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: normal;
  line-height: 1.6;
}

.message-content h1 { font-size: 24px; }
.message-content h2 { font-size: 21px; }
.message-content :is(h4, h5, h6) { font-size: 16px; }

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

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

.message-content li > p {
  margin: 6px 0;
}

.message-content blockquote {
  margin: 14px 0;
  padding: 3px 0 3px 16px;
  border-left: 3px solid #d4d6d2;
  color: #686d67;
}

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

.message-content hr {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.message-content a {
  color: #326ba8;
  text-underline-offset: 3px;
}

.message-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 12px 0;
  border-radius: 8px;
}

.table-scroll {
  margin: 16px 0;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.message-content :is(th, td) {
  padding: 9px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.message-content th {
  background: #f4f4f1;
  font-weight: 600;
}

.message-content tr:last-child td {
  border-bottom: 0;
}

.message-content .task-list-item {
  list-style: none;
}

.task-list-item-checkbox {
  margin: 0 7px 0 -20px;
  accent-color: var(--accent);
}

.message-content .katex {
  font-size: 1.08em;
}

.message-content .katex-display {
  max-width: 100%;
  margin: 16px 0;
  padding: 4px 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.message-content .katex-error {
  color: #8a6358;
  font-family: "DejaVu Sans Mono", monospace;
  font-size: .9em;
  overflow-wrap: anywhere;
}

.message-content .hljs-comment,
.message-content .hljs-quote { color: #778176; }
.message-content .hljs-keyword,
.message-content .hljs-selector-tag { color: #8254a0; }
.message-content .hljs-string,
.message-content .hljs-regexp { color: #356c48; }
.message-content .hljs-number,
.message-content .hljs-literal { color: #a45c30; }
.message-content .hljs-title,
.message-content .hljs-built_in { color: #306a9b; }
.message-content .hljs-attr,
.message-content .hljs-type { color: #7d5b2c; }

.message-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
}

.message-actions .icon-button {
  width: 28px;
  height: 28px;
  color: var(--icon);
}

.message-actions svg {
  width: 15px;
  height: 15px;
}

.regenerate-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--icon);
}

.regenerate-button:hover:not(:disabled),
.message-actions .icon-button:hover:not(:disabled) {
  background: var(--icon-surface);
  color: var(--icon-hover);
}

.regenerate-button:disabled {
  opacity: .45;
}

.reply-versions {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 4px;
  color: var(--icon);
}

.reply-version-count {
  min-width: 30px;
  text-align: center;
  font-size: 14px;
  line-height: 28px;
  font-variant-numeric: tabular-nums;
}

.reply-version-previous svg { transform: rotate(90deg); }
.reply-version-next svg { transform: rotate(-90deg); }
.message-actions .reply-versions button:disabled { color: var(--icon-disabled); opacity: .55; }

.pending {
  color: #898983;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.pending-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: breathe 1.3s ease-in-out infinite;
}

@keyframes breathe {
  50% {
    opacity: .35;
  }
}

.truncated-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 12px;
}

.composer-area {
  flex-shrink: 0;
  width: min(calc(100% - 64px), 800px);
  margin: 0 auto;
  padding: 8px 0 max(10px, env(safe-area-inset-bottom));
}

.composer-input {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 3px 16px #2e292906;
}

.composer-input:focus-within {
  border-color: #babec3;
}

textarea {
  display: block;
  flex: 1;
  min-width: 0;
  width: 100%;
  min-height: 32px;
  max-height: 220px;
  resize: none;
  padding: 3px 0;
  border: 0;
  color: #302f2c;
  background: transparent;
  font-size: 15px;
  line-height: 1.7;
}

textarea:focus-visible {
  outline: none;
}

textarea::placeholder {
  color: #9b9a94;
}

.composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
  padding: 0 4px;
}

.send-button {
  width: 33px;
  height: 33px;
  flex-shrink: 0;
  border: 0;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: white;
}

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

.send-button:disabled {
  background: var(--icon-surface);
  color: var(--icon-disabled);
}

.send-button svg {
  width: 19px;
  height: 19px;
}

.composer-status {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: baseline;
  justify-content: flex-start;
  gap: 8px;
  font-size: 11px;
}

#status {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

#status.error {
  color: #b34d40;
}

.text-button {
  flex-shrink: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  text-decoration: underline;
}

.workspace.empty .conversation-scroll {
  flex: 0 0 auto;
  overflow: visible;
  margin-top: max(44px, calc(38dvh - 110px));
}

.workspace.empty .welcome {
  display: block;
  margin: 0 24px 29px;
}

.workspace.empty .messages {
  display: none;
}

.workspace.empty .composer-area {
  width: min(calc(100% - 80px), 800px);
}

.workspace.empty #conversation-title {
  visibility: hidden;
}

.sidebar-collapsed .sidebar {
  display: none;
}

.sidebar-collapsed #open-sidebar {
  display: inline-flex;
}

.sidebar-overlay {
  display: none;
}

@media (max-width: 1000px) {
  .sidebar {
    width: 240px;
    flex-basis: 240px;
  }

  .composer-area {
    width: calc(100% - 40px);
  }

  .workspace.empty .composer-area {
    width: calc(100% - 48px);
  }

  .topbar {
    padding: 0 20px;
  }
}

@media (max-width: 720px) {
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 272px;
    z-index: 10;
    transform: translateX(-100%);
    transition: transform .18s ease;
  }

  .sidebar-collapsed .sidebar {
    display: flex;
  }

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

  .sidebar-open .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 9;
    border: 0;
    background: #29272338;
  }

  #open-sidebar {
    display: inline-flex;
  }

  .topbar {
    height: 58px;
    padding: 0 14px;
    gap: 8px;
  }

  .welcome-heading {
    flex-direction: column;
    gap: 15px;
  }

  h1 {
    font-size: 27px;
  }

  .welcome-icon {
    width: 36px;
    height: 36px;
  }

  .workspace.empty .conversation-scroll {
    margin-top: max(30px, calc(30dvh - 70px));
  }

  .workspace.empty .welcome {
    margin-bottom: 28px;
  }

  .workspace.empty .composer-area,
  .composer-area {
    width: calc(100% - 28px);
  }

  .messages {
    padding: 20px 20px 28px;
  }

  .message {
    font-size: 14px;
  }

  .composer-input {
    padding: 9px 10px 9px 14px;
    border-radius: 15px;
  }

  textarea {
    font-size: 16px;
  }

  .delete-conversation {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pending-dot {
    animation: none;
  }

  .sidebar {
    transition: none;
  }

  .conversation-scroll {
    scroll-behavior: auto;
  }
}

.model-picker {
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: 65%;
  gap: 6px;
  margin-left: auto;
}

.model-chevron {
  width: 14px;
  height: 14px;
  color: var(--icon);
}

#model-select {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  min-width: 0;
  padding: 6px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
}

#model-label {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#model-select:hover:not(:disabled),
#model-select[aria-expanded="true"] {
  background: var(--icon-surface);
  color: var(--icon-hover);
}

#model-select[aria-expanded="true"] .model-chevron {
  transform: rotate(180deg);
}

#model-select:disabled {
  opacity: .65;
}

.model-menu {
  position: fixed;
  inset: auto;
  width: max-content;
  min-width: 200px;
  max-width: min(320px, calc(100vw - 24px));
  max-height: 360px;
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #dededb;
  border-radius: 12px;
  background: #fff;
  color: #302f2c;
  box-shadow: 0 12px 36px #302f2c18, 0 2px 6px #302f2c0d;
}

.model-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}

.model-option:hover,
.model-option:focus-visible {
  background: #f4f4f2;
  outline: none;
}

.model-option-name {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
  line-height: 1.5;
}

.model-option svg {
  width: 16px;
  height: 16px;
  visibility: hidden;
  color: #3478d4;
}

.model-option[aria-selected="true"] svg {
  visibility: visible;
}

.streaming > .message-content> :last-child::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 14px;
  margin-left: 5px;
  background: var(--accent);
  vertical-align: middle;
  animation: breathe 1.3s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .streaming > .message-content> :last-child::after,
  .thinking[data-state="thinking"] .thinking-title::after {
    animation: none;
  }
}

.auth-screen { min-height: 100dvh; display: grid; place-items: center; padding: 40px 24px; background: radial-gradient(ellipse at 20% 10%, #edf0e9, transparent 60%), #fcfcfb; }
.auth-card { width: min(100%, 380px); }
.auth-brand { display: flex; align-items: center; gap: 18px; color: var(--accent); text-decoration: none; font-size: 28px; font-weight: 700; letter-spacing: -.06em; margin-bottom: 54px; }
.auth-brand span { color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: .12em; border-left: 1px solid var(--line); padding-left: 18px; }
.auth-card h1 { font-size: 29px; font-weight: 600; letter-spacing: -.04em; margin: 0 0 10px; }
.auth-intro { color: var(--muted); font-size: 14px; margin: 0 0 28px; }
.account-form { display: grid; gap: 16px; }
.account-form label { display: grid; gap: 8px; font-size: 13px; }
.account-form label > span:not(#email-address-label), .field-hint { font-size: 12px; color: var(--muted); line-height: 1.7; }
.account-form input { min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; background: #fff; color: inherit; }
.primary-button, .secondary-button { border: 1px solid var(--accent); border-radius: 9px; padding: 11px 18px; font-size: 13px; background: var(--accent); color: white; }
.primary-button:hover { background: var(--action-hover); }
.primary-button:disabled, .secondary-button:disabled { opacity: .5; }
.secondary-button { color: var(--accent); background: transparent; border-color: var(--line); }
.secondary-button:hover { background: var(--icon-surface); }
.auth-links { display: flex; justify-content: space-between; gap: 15px; margin-top: 22px; }
#auth-status, #account-status { font-size: 13px; line-height: 1.7; margin: 0; color: #8a3c2b; white-space: pre-line; }
#auth-status:empty, #account-status:empty { display: none; }
#auth-status.success, #account-status.success { color: #4d6b4b; }
.sidebar-account {
  margin-top: auto;
  padding: 6px 0 8px;
  border-top: 1px solid var(--line);
}

.account-entry {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  padding: 7px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}

.account-entry:hover,
.account-entry:focus-visible {
  background: #eff1ed;
}

.avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid #ffffff16;
  border-radius: 8px;
  background: #38443e;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}

.account-entry-copy {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 2px;
}

#account-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.account-entry-settings {
  width: 18px;
  height: 18px;
  margin: 0 2px 0 8px;
  color: #8b928c;
  stroke-width: 1.5;
}

.account-entry:hover .account-entry-settings {
  color: var(--accent);
}

.account-menu {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: #302f2c;
  box-shadow: 0 6px 24px #0000001a;
}

.account-menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  font-size: 14px;
  line-height: 1.5;
}

.account-menu button:hover,
.account-menu button:focus-visible { background: #f2f2f1; }
.account-menu hr { margin: 5px 8px; border: 0; border-top: 1px solid var(--line); }
.account-entry[aria-expanded="true"] { background: #eceeeb; }
.account-entry[aria-expanded="true"] .account-entry-settings { transform: rotate(180deg); }

.account-page {
  flex: 1;
  min-width: 0;
  padding: 56px 40px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fcfcfb;
}

.account-page-content { max-width: 760px; margin: 0 auto; }
.account-page .account-form { max-width: 420px; }
.account-page .account-form > .primary-button { justify-self: start; }
.account-page .account-heading { padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.account-page #account-status:not(:empty) { margin-bottom: 20px; }

.account-heading,
.account-heading-main {
  display: flex;
  align-items: center;
}

.account-heading {
  justify-content: space-between;
  gap: 16px;
}

.account-heading-main {
  flex: 1;
  min-width: 0;
  gap: 8px;
}

.account-heading h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: -.025em;
}

.account-back {
  margin-left: -8px;
}

.account-back svg {
  width: 18px;
  height: 18px;
  transform: rotate(-90deg);
}

.account-close {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
}

.account-close svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.6;
}

.account-home {
  margin-top: 12px;
}

.account-heading h2 {
  flex-shrink: 0;
}

.settings-list {
  display: grid;
  gap: 2px;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}

.settings-row:hover {
  background: #f5f7f3;
}

.settings-row:focus-visible {
  outline-offset: -2px;
  background: #f5f7f3;
}

.settings-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #626f65;
}

.settings-icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.6;
}

.settings-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
  gap: 8px;
}

.settings-copy strong {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
}

.settings-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #6f776f;
  font-size: 12px;
  line-height: 1.5;
}

.settings-chevron {
  width: 15px;
  height: 15px;
  margin-left: 4px;
  transform: rotate(-90deg);
  color: #9ca39c;
  stroke-width: 1.6;
}

.account-session-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #edf0eb;
}

.account-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 8px;
  border: 1px solid #e5e9e2;
  border-radius: 9px;
  background: #fff;
  color: #5b655d;
  font-size: 12px;
  line-height: 1.5;
}

.account-logout svg {
  width: 16px;
  height: 16px;
}

.account-logout:hover {
  background: #f5f7f3;
  border-color: #ccd4c9;
}

.account-logout-all {
  border-color: transparent;
  color: #9a4d40;
}

.account-logout-all:hover {
  border-color: transparent;
  background: #fcf1ed;
}

.logout-description { font-size: 14px; line-height: 1.8; margin: 0; }
.confirmation-actions { margin-top: 24px; display: flex; justify-content: flex-end; gap: 10px; }
.danger-button { background: #8a3c2b; border-color: #8a3c2b; }
.danger-button:hover { background: #723122; }
.account-page .account-panel { margin-top: 16px; }
.account-page h3 { font-size: 15px; margin: 0 0 8px; }
.account-page .field-hint { margin: 0 0 16px; }
.account-page #account-status { margin-top: 18px; }
.verification-row { display: flex; align-items: end; gap: 10px; }
.verification-row label { flex: 1; }
.account-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#more-history { margin: 10px; }
#rename-conversation { margin-left: auto; white-space: nowrap; font-size: 12px; }
@media (max-width: 480px) {
  .auth-brand { margin-bottom: 36px; }
  .account-page { padding: 24px 16px; }
  .account-heading-main { flex-wrap: wrap; }
  .account-heading h2 { font-size: 20px; }
  .account-page .account-form input { font-size: 16px; }
  .settings-row { padding-inline: 6px; }
  .confirmation-actions > button { flex: 1; }
}

.account-page[data-view="devices"] .account-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; }
.account-page[data-view="devices"] h2 { font-size: 20px; }
.account-page[data-view="devices"] #account-status:empty,
#devices-status:empty { display: none; }
.device-logout-all { padding: 8px 14px; border: 0; border-radius: 10px; background: #f2f2f1; font-size: 14px; line-height: 1.5; white-space: nowrap; }
.device-logout-all:hover { background: #e8e8e7; }
.device-table { width: 100%; border-collapse: separate; border-spacing: 0 4px; table-layout: fixed; text-align: left; font-size: 14px; }
.device-table th { padding: 18px 12px 8px; color: #727571; font-weight: 400; font-size: 13px; }
.device-table th:first-child { width: 37%; }
.device-table th:last-child { width: 48px; }
.device-row td { padding: 16px 12px; vertical-align: middle; }
.device-row.is-current,
.device-row:hover,
.device-row:focus-within { background: #f3f3f2; }
.device-row td:first-child { border-radius: 10px 0 0 10px; }
.device-row td:last-child { border-radius: 0 10px 10px 0; }
.device-name { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 500; }
.device-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.current-device { flex-shrink: 0; color: #235db5; background: #e0eafa; font-size: 11px; font-weight: 400; border-radius: 12px; padding: 3px 8px; white-space: nowrap; }
.device-time { color: #727571; font-size: 13px; line-height: 1.7; font-variant-numeric: tabular-nums; }
.device-row .device-actions { padding: 10px 8px 10px 0; }
.device-menu-trigger { width: 34px; height: 34px; border-radius: 10px; font-size: 25px; line-height: 1; }
.device-menu-trigger[aria-expanded="true"] { background: #dcdedd; }
.device-menu { position: fixed; inset: auto; margin: 0; min-width: 156px; padding: 6px; border: 1px solid #e3e3e2; border-radius: 14px; background: #fff; box-shadow: 0 6px 24px #0000001a; }
.device-menu button { display: block; width: 100%; padding: 10px 14px; border: 0; border-radius: 9px; background: transparent; color: #ac302b; text-align: left; font-size: 14px; }
.device-menu button:hover { background: #fcf1ed; }
.device-footer { margin-top: 12px; }
.device-footer:has(button[hidden]) { display: none; }
@media (max-width: 640px) {
  .account-page[data-view="devices"] .account-heading { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; }
  .account-page[data-view="devices"] h2 { font-size: 18px; }
  .account-page[data-view="devices"] .account-close { grid-column: 2; grid-row: 1; }
  .device-logout-all { grid-column: 1 / -1; justify-self: end; font-size: 13px; }
  .device-table, .device-table tbody { display: block; }
  .device-table thead { display: none; }
  .device-row { display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 8px 4px; margin-top: 8px; padding: 14px 10px; border-radius: 10px; }
  .device-row td { display: block; padding: 0; }
  .device-row .device-actions { grid-column: 2; grid-row: 1; padding: 0; }
  .device-row .device-time { grid-column: 1 / -1; font-size: 12px; }
  .device-time::before { content: attr(data-label); display: inline-block; width: 5.5em; color: #82817b; }
  .device-name { min-height: 34px; flex-wrap: wrap; gap: 6px; font-size: 13px; }
  .current-device { font-size: 10px; padding: 2px 6px; }
}
.danger-text { color: #8a3c2b; }
#email-summary { overflow-wrap: anywhere; }
.verification-row label { min-width: 0; }
