/* Journal, part 1 of 4 — page chrome, the record feed and record rows.
   The four journal-*.css files are loaded in order (see index.html); later
   files deliberately build on and override earlier ones. */
/* App chrome (moved from style.css, index page only): loading state,
   dialogs, the editor form, delete confirmation, toast, lightbox and the
   backup notices. */
dialog {
  padding: 30px;
  max-height: 90dvh;
  max-width: calc(100% - 28px);
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.dialog-heading h2 {
  font-family: "Songti SC", STSong, serif;
  font-size: 28px;
  font-weight: 500;
}
.icon-button {
  border: 0;
  background: transparent;
  color: var(--label-3);
  font-size: 27px;
  padding: 0 10px;
  line-height: 1.4;
}
.form-footer {
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--separator);
  padding-top: 20px;
  margin-top: 24px;
}
.form-footer > span {
  font-size: 11px;
  color: var(--label-3);
}
.form-footer > div {
  display: flex;
  gap: 8px;
}
.loading {
  color: var(--label-3);
  padding: 40px;
  text-align: center;
}
#delete-dialog {
  width: 430px;
}
#delete-dialog p {
  color: var(--label-3);
  font-size: 14px;
}
.delete-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 28px;
}
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 25px;
  color: var(--label-inverse);
  box-shadow: 0 4px 20px #0002;
  font-size: 13px;
}
/* The photo viewer fills the screen; the photo fits inside it whole. */
#lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: rgb(10 10 12 / 94%);
  color: #fff;
  box-shadow: none;
}
#lightbox::backdrop { background: rgb(0 0 0 / 60%); }
#lightbox .icon-button {
  position: absolute;
  z-index: 2;
  top: calc(10px + env(safe-area-inset-top));
  right: 12px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 12%);
  color: #fff;
  font-size: 26px;
  line-height: 1;
}
#lightbox .icon-button:hover { background: rgb(255 255 255 / 22%); }
#full-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
#retry {
  background: none;
  border: 1px solid var(--separator);
  border-radius: 6px;
  padding: 8px 18px;
  color: var(--label);
}
@media (max-width: 640px) {
  dialog {
    padding: 22px;
    max-height: 92dvh;
  }
  .dialog-heading {
    margin-bottom: 18px;
  }
  .form-footer {
    flex-direction: column;
  }
  .form-footer > div {
    width: 100%;
    justify-content: flex-end;
  }
}
#editor {
  width: 780px;
}
@media (max-width: 640px) {
  #editor {
    width: calc(100% - 20px);
  }
}
html:has(dialog[open]),
body:has(dialog[open]) {
  overflow: hidden;
  overscroll-behavior: none;
}
.backup-warning {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 9px 12px 9px 14px;
  font-size: 13px;
  line-height: 1.5;
}
.backup-warning > span {
  flex: 1;
  min-width: 0;
}
.backup-warning-action {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 2px 4px;
}
.backup-warning-dismiss {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  padding: 2px 6px;
  opacity: .7;
}
.backup-warning-dismiss:hover {
  opacity: 1;
}
.backup-status {
  border-top: 1px solid var(--separator);
  margin-top: 24px;
  padding-top: 4px;
}
.backup-status-text {
  font-size: 14px;
  margin: 6px 0;
}
.backup-status.is-warning .backup-status-text {
  color: #944438;
}
/* Journal chrome: header, record feed, reader and editor. */
body {
  font-size: 16px;
  line-height: 1.8;
}
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1080px;
  margin: auto;
}
.header-controls {
  display: flex;
  align-items: center;
  gap: 24px;
}
.site-header .primary {
  font-size: 14px;
  min-height: 44px;
  padding: 8px 16px;
}
.header-search {
  position: relative;
  z-index: 35;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}
.search-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--label);
}
.search-toggle:hover {
  background: #eee8de;
}
.header-search.is-open .search-toggle {
  opacity: 0;
  pointer-events: none;
}
.header-search.has-filters .search-toggle::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.search-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(410px, calc(100vw - 40px));
  overflow: hidden;
  border: 1px solid var(--separator);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 12px 32px #2926221c;
  opacity: 0;
  visibility: hidden;
  transform: scaleX(0.16);
  transform-origin: right top;
  pointer-events: none;
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease, visibility 0s linear 240ms;
}
.header-search.is-open .search-panel {
  opacity: 1;
  visibility: visible;
  transform: none;
  pointer-events: auto;
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease, visibility 0s;
}
.search-panel form {
  display: flex;
  align-items: center;
  height: 44px;
}
.search-submit,
.search-close {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--label-3);
}
.search-close {
  font-size: 24px;
  line-height: 1;
}
.search-submit:hover,
.search-close:hover {
  color: var(--accent);
}
#search-form input[type='search'] {
  min-width: 0;
  width: 100%;
  height: 44px;
  padding: 0 2px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--label);
  font-size: 14px;
}
#search-form input[type='search']::-webkit-search-cancel-button {
  display: none;
}
#search-form input[type='search']::placeholder {
  color: var(--label-3);
}
.search-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  border-top: 1px solid var(--separator);
  padding: 7px 10px;
}
.search-filters[hidden] { display: none; }
.search-filters button {
  font: inherit;
}
#filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  min-height: 27px;
  border-radius: 5px;
  background: var(--bg);
  color: var(--label-3);
  font-size: 12px;
}
.filter-chip-name {
  padding: 3px 6px;
  white-space: nowrap;
}
.filter-chip select,
.filter-chip input[type='month'] {
  min-height: 27px;
  max-width: 118px;
  border: 0;
  border-left: 1px solid var(--separator);
  outline: 0;
  background: transparent;
  color: var(--label);
  font: inherit;
  padding: 2px 4px;
}
.filter-chip input[type='month'] { max-width: 110px; }
.filter-chip-remove {
  width: 25px;
  align-self: stretch;
  border: 0;
  border-left: 1px solid var(--separator);
  border-radius: 0 5px 5px 0;
  background: transparent;
  color: var(--label-3);
  font-size: 17px !important;
  line-height: 1;
}
.filter-chip-remove:hover { color: var(--accent); }
.filter-chip:focus-within {
  outline: 1px solid #9aac9c;
}
#add-filter,
#clear-filters {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 27px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--label-3);
  font-size: 12px;
  padding: 3px 6px;
}
#add-filter:not(:disabled):hover,
#clear-filters:hover { background: var(--bg); color: var(--label); }
#add-filter:disabled { opacity: 0.4; cursor: default; }
#clear-filters { border-color: var(--separator); }
#clear-filters[hidden] { display: none; }
#filter-menu {
  flex: 0 0 100%;
  border: 1px solid var(--separator);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 7px 20px #29262212;
  overflow: hidden;
}
#filter-menu[hidden] { display: none; }
#filter-type-search {
  display: block;
  width: 100%;
  height: 36px;
  border: 0;
  border-bottom: 1px solid var(--separator);
  outline: 0;
  background: transparent;
  color: var(--label);
  font-size: 13px;
  padding: 0 10px;
}
#filter-type-list { padding: 4px; }
#filter-type-list button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--label);
  text-align: left;
  font-size: 13px;
  padding: 7px 9px;
}
#filter-type-list button:hover,
#filter-type-list button:focus-visible { background: var(--bg); }
#filter-type-list button[hidden],
#filter-menu-empty[hidden] { display: none; }
#filter-menu-empty { margin: 0; padding: 8px 12px; color: var(--label-3); font-size: 12px; }
.search-panel:focus-within {
  border-color: #9aac9c;
}
.search-results {
  max-height: min(56vh, 440px);
  overflow-y: auto;
  border-top: 1px solid var(--separator);
  padding: 6px;
}
#search-status {
  margin: 0;
  padding: 7px 10px;
  color: var(--label-3);
  font-size: 12px;
}
.search-result,
.search-more {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--label);
  text-align: left;
}
.search-result:hover,
.search-result:focus-visible,
.search-more:hover {
  background: var(--bg);
}
.search-result-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--label-3);
  font-size: 11px;
}
.search-result strong,
.search-result-excerpt {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.search-result strong {
  font-size: 14px;
  font-weight: 500;
}
.search-result-excerpt {
  color: var(--label-3);
  font-size: 12px;
  line-height: 1.5;
}
.search-more {
  color: var(--accent);
  font-size: 12px;
  text-align: center;
}
/* 设置 is a page like 回顾. There is no white sheet around it: the tabs sit
   on the page background and each group of settings is its own white card.
   Cards are lifted by a shadow (not outlined); lines are kept for structure
   only (the tab bar, rows inside a card, input fields). Space separates the
   groups: 20px between cards (16px on phones), 6-14px inside one. */
.settings-view {
  --settings-card-shadow: 0 0 0 1px rgb(0 0 0 / 5%), 0 1px 2px -1px rgb(0 0 0 / 6%), 0 2px 6px rgb(0 0 0 / 4%);
  --settings-card-pad: 20px;
  width: min(720px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 4vh, 44px) 0 clamp(56px, 10vh, 120px);
}
/* The column only keeps the page from dragging sideways; its 6px inset
   leaves room for the cards' shadows. */
.settings-card { min-width: 0; margin: 0 -6px; padding: 0 6px 6px; overflow-x: hidden; }
.settings-tabs { display: flex; gap: 26px; margin: 0 0 24px; padding: 0 2px; border-bottom: 1px solid var(--separator); overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
.settings-tabs::-webkit-scrollbar { display: none; }
.settings-tabs button {
  flex: none;
  margin-bottom: -1px;
  padding: 10px 0 11px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--label-3);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: color .15s ease-out, border-color .15s ease-out;
}
.settings-tabs button[aria-selected='true'] { border-bottom-color: var(--accent); color: var(--label); font-weight: 600; }
@media (hover: hover) { .settings-tabs button:hover { color: var(--label); } }
.settings-tabs button:focus-visible { outline-offset: -2px; border-radius: 4px; }
@media (max-width: 760px) { .settings-view { padding: 14px 0 92px; } }
@media (max-width: 480px) { .settings-view { --settings-card-pad: 16px; } .settings-tabs { gap: 20px; } .settings-tab-panel, .ai-settings { gap: 16px; } }
.settings-tab-panel { display: grid; align-content: start; gap: 20px; min-width: 0; min-height: 250px; }
.settings-tab-panel[hidden] { display: none; }
.settings-tab-panel:not([hidden]) { animation: soft-fade .15s ease-out; }
/* A panel's introduction sits on the page, above its cards. */
.settings-description { margin: 0; color: var(--label-3); font-size: 13px; line-height: 1.6; }
.settings-tab-panel > .settings-description { padding: 0 4px; }
.settings-group .settings-description { margin: 0 0 14px; }
.account-card .settings-description { margin: 8px 0 0; }
/* One white card per group of settings. */
.settings-view .settings-group,
.settings-view .account-card {
  min-width: 0;
  margin: 0;
  padding: var(--settings-card-pad);
  border: 1px solid transparent;
  border-radius: var(--radius-l);
  background: var(--surface);
  box-shadow: var(--settings-card-shadow);
}
.settings-view .settings-group h3, .settings-view .account-card h3 { margin: 0 0 6px; color: var(--label); font-size: 16px; font-weight: 600; line-height: 1.4; }
/* Buttons give a little when pressed. */
@media (prefers-reduced-motion: no-preference) {
  .settings-view .primary,
  .settings-view .secondary,
  .settings-view .ai-provider-add-model { transition: background-color .15s ease, color .15s ease, transform .15s ease-out; }
  .settings-view .primary:active:not(:disabled),
  .settings-view .secondary:active:not(:disabled),
  .settings-view .ai-provider-add-model:active { transform: scale(.96); }
}
/* 个性化: the page background, as round swatches plus a custom colour. */
.settings-view .settings-section-title { margin: 0 0 6px; font-size: 16px; }
.appearance-swatches { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.appearance-swatch { display: grid; justify-items: center; gap: 6px; width: 60px; padding: 0; border: 0; background: transparent; color: var(--label-3); font-size: 12px; cursor: pointer; }
.appearance-swatch-color { width: 44px; height: 44px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 12%); }
@media (hover: hover) { .appearance-swatch:hover .appearance-swatch-color { box-shadow: inset 0 0 0 1px rgb(0 0 0 / 22%); } }
.appearance-swatch[aria-checked='true'] { color: var(--label); font-weight: 600; }
.appearance-swatch[aria-checked='true'] .appearance-swatch-color { box-shadow: inset 0 0 0 1px rgb(0 0 0 / 12%), 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.appearance-swatch:focus-visible { outline: none; }
.appearance-swatch:focus-visible .appearance-swatch-color { outline: 2px solid var(--accent); outline-offset: 4px; }
.appearance-custom { display: flex; align-items: center; gap: 12px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--separator-soft); font-size: 13px; }
.appearance-custom-label { display: inline-flex; align-items: center; gap: 10px; color: var(--label-2); cursor: pointer; }
.appearance-custom input[type=color] { width: 44px; height: 30px; padding: 2px; border: 1px solid var(--separator); border-radius: 8px; background: var(--surface); cursor: pointer; }
.appearance-custom.is-chosen input[type=color] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.appearance-custom code { color: var(--label-3); font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.appearance-status { min-height: 20px; margin: 12px 0 0; color: var(--label-3); font-size: 12px; }
.appearance-status.is-error { color: var(--danger); }
.ai-settings { display: grid; gap: 20px; min-width: 0; }
/* 启用 AI 聊天 and the assistant's looks: the first card of the tab. */
.ai-general { display: grid; justify-items: start; gap: 12px; }
.ai-general .ai-toggle { font-size: 14px; }
.ai-general .ai-persona-entry { max-width: 100%; padding: 7px 16px; font-size: 13px; white-space: normal; text-align: left; }
.ai-settings label { display: grid; gap: 6px; min-width: 0; color: var(--label-3); font-size: 12px; }
.ai-settings input, .ai-settings select { width: 100%; padding: 9px 10px; border: 1px solid var(--separator); border-radius: var(--radius-s); background: var(--surface); color: var(--label); font-size: 14px; }
.ai-settings .ai-toggle { display: flex; align-items: center; gap: 8px; color: var(--label); cursor: pointer; }
.ai-settings .ai-toggle input { width: 15px; margin: 0; accent-color: var(--accent); }
.ai-key-status, .ai-status { min-height: 1.2em; margin: -3px 0 0; color: var(--label-3); font-size: 11px; }
.ai-settings-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.ai-settings-actions button { font-size: 12px; }
.ai-feature-note { margin: 0; color: var(--label-3); font-size: 12px; line-height: 1.6; }
.ai-provider-list { display: grid; gap: 12px; }
/* A model service is a card: its name on top, a line between its models. */
.ai-provider { display: grid; gap: 0; min-width: 0; border: 1px solid transparent; border-radius: var(--radius-l); background: var(--surface); box-shadow: var(--settings-card-shadow); overflow: hidden; }
.ai-provider-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 14px 16px 12px 18px; border-bottom: 1px solid var(--separator-soft); }
.ai-provider-name { margin: 0; color: var(--label); font-size: 15px; font-weight: 600; line-height: 1.4; }
.ai-provider-models { display: grid; }
.ai-provider-models .ai-model-item { border: 0; border-bottom: 1px solid var(--separator-soft); border-radius: 0; padding: 10px 16px 10px 18px; }
.ai-provider-models .ai-model-item.is-editing { background: var(--fill); }
.ai-provider-models .ai-model-empty { padding: 12px 18px; }
/* Inside a card the form is a grey well: 8px in, so its corners are the
   card's 18px minus 8px. */
.ai-provider .ai-model-form { margin: 8px; border-radius: 10px; background: var(--fill); box-shadow: none; }
.ai-provider-add-model { justify-self: start; margin: 6px 10px 8px; padding: 6px 8px; border: 0; border-radius: var(--radius-s); background: transparent; color: var(--accent); font-size: 13px; cursor: pointer; }
@media (hover: hover) { .ai-provider-add-model:hover { background: var(--accent-soft); } }
.ai-provider-add-model[hidden] { display: none; }
.ai-settings textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--separator); border-radius: var(--radius-s); background: var(--surface); color: var(--label); font: 13px/1.6 ui-monospace, Menlo, monospace; resize: vertical; }
.ai-settings label[hidden] { display: none; }
.ai-model-empty { margin: 0; color: var(--label-3); font-size: 12px; }
.ai-model-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--separator); border-radius: 8px; background: var(--surface); }
.ai-model-item-main { display: grid; gap: 3px; min-width: 0; }
.ai-model-item-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--label); font-size: 14px; }
.ai-model-item-main small { overflow: hidden; color: var(--label-3); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.ai-model-badge { padding: 0 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11px; line-height: 18px; }
.ai-model-badge.is-warn { background: var(--orange-soft); color: var(--orange-label); }
.ai-model-item-actions { display: flex; flex: none; gap: 6px; }
.ai-model-item-actions button { padding: 5px 9px; font-size: 12px; }
.ai-model-add { justify-self: start; font-size: 13px; }
.ai-model-add[hidden] { display: none; }
.ai-model-form { display: grid; gap: 12px; min-width: 0; padding: var(--settings-card-pad, 16px); border: 1px solid transparent; border-radius: var(--radius-l); background: var(--surface); box-shadow: var(--settings-card-shadow); }
.ai-model-form[hidden] { display: none; }
.ai-model-form-title { margin: 0; color: var(--label); font-size: 16px; font-weight: 600; }
.ai-provider .ai-model-form-title { font-size: 14px; }
.ai-settings-actions button[hidden] { display: none; }
@media (max-width: 560px) {
  .ai-model-item, .ai-provider-head { align-items: flex-start; flex-direction: column; }
}
/* 标签: one card with the search on top and a line between the tags. */
.settings-view #tag-manager { width: auto; padding: var(--settings-card-pad); }
.settings-view #tag-manager-status { margin: 12px 0 0; }
.settings-view #tag-manager-search { display: block; width: 100%; margin: 0; padding: 9px 12px; border: 1px solid var(--separator); border-radius: var(--radius-s); background: var(--surface); color: var(--label); font-size: 14px; }
/* One row per tag, also on phones: name, count, 改名, 删除. */
.settings-view .managed-tag { flex-wrap: nowrap; gap: 10px; margin: 0; padding: 10px 0; border-bottom: 1px solid var(--separator-soft); }
.settings-view .managed-tag input { flex: 1 1 auto; min-width: 0; margin: 0; padding: 7px 10px; border-radius: var(--radius-s); }
.settings-view #tag-manager-list { margin-top: 6px; }
.settings-view #tag-manager-list .managed-tag:last-child { border-bottom: 0; padding-bottom: 0; }
.settings-view .managed-tag .tag-usage { min-width: 3em; text-align: right; font-variant-numeric: tabular-nums; }
.settings-view .managed-tag .secondary { padding: 6px 14px; font-size: 13px; }
@media (max-width: 480px) { .settings-view .managed-tag { gap: 8px; } .settings-view .managed-tag .secondary { padding: 6px 12px; } }
.settings-view .managed-tag .text-action { padding: 6px 4px; border: 0; background: none; color: var(--label-3); font-size: 13px; }
@media (hover: hover) { .settings-view .managed-tag .text-action:hover:not(:disabled) { color: var(--danger); } }
/* Settings → 账号: one card per task (profile, password, backup, sign
   out), each with its own action at the bottom right; only 保存资料 is a
   filled button. */
.account-card .field { margin-top: 14px; }
.account-card .field input { width: 100%; box-sizing: border-box; }
.account-card .account-copy { margin: 0; }
.account-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.account-actions .primary,
.account-actions .secondary { padding: 8px 20px; font-size: 14px; }
/* Password fields look like the other fields (style.css styles text only). */
.account-card input[type=password] {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--separator);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--label);
  font-size: 14px;
}
.account-card input[type=text] { border-radius: var(--radius-s); }
.account-card .error { margin: 12px 0 0; }
.profile-row { display: flex; align-items: center; gap: 16px; margin-top: 12px; }
.profile-avatar {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--fill);
  color: var(--label-2);
  font-size: 26px;
  font-weight: 600;
}
.profile-avatar .profile-avatar-preview { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; object-fit: cover; }
.profile-avatar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; min-width: 0; }
.profile-avatar-pick { display: inline-flex; align-items: center; padding: 7px 16px; font-size: 13px; line-height: 1.4; cursor: pointer; }
.profile-avatar-actions input:focus-visible + .profile-text-button,
.profile-avatar-pick:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.profile-text-button { padding: 4px 0; border: 0; background: none; color: var(--label-3); font-size: 13px; }
@media (hover: hover) { .profile-text-button:hover { color: var(--danger, #d70015); } }
#profile-username { margin-top: 6px; font-size: 12px; }
.account-logout { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.account-logout[hidden] { display: none; }
.account-logout-button { flex: none; padding: 8px 18px; font-size: 14px; color: var(--danger, #d70015); }
.account-copy {
  font-size: 13px;
  color: var(--label-3);
  margin: 8px 0 0;
}
main {
  max-width: 1080px;
  padding: 0 40px 64px;
}
.journal {
  padding-top: 4px;
}
.empty {
  padding: 60px 0;
  text-align: center;
}
.empty h2 {
  margin-bottom: 17px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.5;
}
.empty .primary {
  font-size: 13px;
}

.ai-usage h3 { margin: 0; font-size: 15px; font-weight: 600; }
.ai-usage-stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; margin: 16px 0; }
.ai-usage-stats div { min-width: 0; }
.ai-usage-stats dt { color: var(--label-3); font-size: 12px; }
.ai-usage-stats dd { margin: 6px 0 0; color: var(--label); font-size: 20px; font-weight: 600; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.ai-usage-breakdown, .ai-usage-note { margin: 8px 0 0; color: var(--label-3); font-size: 12px; line-height: 1.6; }
.ai-usage-models { margin-top: 12px; }
.ai-usage-models summary { cursor: pointer; color: var(--label-2); font-size: 13px; }
.ai-usage-table-scroll { max-width: 100%; overflow-x: auto; margin-top: 10px; }
.ai-usage-models table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ai-usage-models th, .ai-usage-models td { padding: 10px 8px; border-bottom: 1px solid var(--separator); text-align: right; font-variant-numeric: tabular-nums; }
.ai-usage-models th:first-child { text-align: left; }
.ai-usage-models tbody th { font-weight: 400; max-width: 220px; overflow-wrap: anywhere; }
.ai-usage-models th small { display: block; margin-top: 3px; color: var(--label-3); font-weight: 400; }
.ai-model-item-main .ai-model-usage { white-space: normal; }
@media (max-width: 600px) {
  .ai-usage-stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ai-usage-stats dd { font-size: 18px; }
  .ai-usage-models table { min-width: 450px; }
}
