:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --text: #2c2c2a;
  --muted: #5f5e5a;
  --hint: #888780;
  --line: rgba(0, 0, 0, 0.1);
  --accent: #185fa5;
  --accent-soft: #e6f1fb;
  --self: #1d9e75;
  --self-soft: #e1f5ee;
  --warn-soft: #faeeda;
  --warn: #854f0b;
  --danger: #a32d2d;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Helvetica Neue", "Noto Sans CJK SC", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  overscroll-behavior-y: none;
  touch-action: pan-x pan-y;
  overflow: hidden;
}

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

/* Touch selection is reserved for editable fields and content users may copy. */
@media (pointer: coarse) {
  body {
    -webkit-user-select: none;
    user-select: none;
  }

  :where(input, textarea, [contenteditable=""], [contenteditable="true"],
         [contenteditable="plaintext-only"], [data-selectable-text],
         #peer-name, #history-peer, #profile-name, .profile-login-name,
         #peer-profile-name, #peer-profile-display-name, #peer-profile-login-name,
         .me-identity-text, .partner-heading > b, .advisor-peer-name,
         #friend-search-results .meta, .blacklist-identity, #export-peer-list .meta > b,
         :is(#incoming-list, #outgoing-list) .meta, .unread-peer-name,
         .ff-name-row :is(h2, h3, strong), .cd-name-line h3,
         .notification-head > b, .media-forward-name, .message-forward-recipient-name,
         .forward-record-author-name, .forward-record-text, .forward-record-original,
         .advisor-answer-text, #quote-text, .feedback-preview, #translation-feedback-disclosure,
         #file-viewer-text, #ios-help :is(p, ol), #rtc-peer) {
    -webkit-user-select: text;
    user-select: text;
  }

  #view-chat:is(.has-message-menu, .is-message-selecting) #msgs > .row > .bubble {
    -webkit-touch-callout: none;
  }

  #view-chat:is(.has-message-menu, .is-message-selecting) #msgs > .row > .bubble [data-selectable-text] {
    -webkit-user-select: none;
    user-select: none;
  }
}

/* ---------- 登录页语言栏（国旗） ---------- */

.langbar {
  position: absolute;
  top: var(--app-top, 0px); left: 0; right: 0;
  z-index: 30;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: calc(env(safe-area-inset-top) + 5px) 8px 5px;
  background: var(--surface);
  border-bottom: 0.5px solid var(--line);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.langbar::-webkit-scrollbar { display: none; }
.langbar .flag {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: 0;
  padding: 3px 5px;
  border-radius: 8px;
  font-size: 10px;
  line-height: 1.2;
  color: var(--muted);
  cursor: pointer;
}
.langbar .flag img {
  width: 30px; height: 20px;
  display: block;
  border-radius: 3px;
}
.langbar .flag.active { background: var(--accent-soft); color: var(--accent); }
.langbar .flag.active img { outline: 1.5px solid var(--accent); outline-offset: 1px; }
body.langbar-off .langbar { display: none; }

/* 语言栏占掉顶部一行，视图整体下移 */
body:not(.langbar-off) .view {
  top: calc(var(--app-top, 0px) + env(safe-area-inset-top) + 56px);
  height: calc(var(--app-height, 100dvh) - env(safe-area-inset-top) - 56px);
}

.view {
  position: absolute;
  top: var(--app-top, 0px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  height: var(--app-height, 100dvh);
  background: var(--bg);
  min-height: 0;
}
#view-login { overflow-y: auto; }
#view-list { overflow-y: auto; -webkit-overflow-scrolling: touch; }
#view-chat, #view-history, #view-peer-profile, #view-advisor, #view-admin, #view-account, #view-preferences { overflow: hidden; }
.hidden { display: none !important; }

.update-loading {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
  color: var(--muted);
  font-size: 14px;
}
.ghb-updating .update-loading { display: flex; }
.update-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: translation-spin 0.8s linear infinite;
}
.update-progress { display: flex; flex-direction: column; align-items: center; gap: 6px; width: min(260px, calc(100vw - 48px)); font-variant-numeric: tabular-nums; }
.update-progress progress { width: 100%; height: 8px; accent-color: var(--accent); }

.theme-download-progress {
  position: fixed;
  left: 50%;
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 10px));
  z-index: 115;
  width: min(360px, calc(100vw - 28px));
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 10px 32px rgb(0 0 0 / 18%);
  color: var(--text);
  transform: translateX(-50%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.theme-download-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
#theme-download-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
#theme-download-count { flex: none; color: var(--muted); }
.theme-download-progress progress { display: block; width: 100%; height: 8px; accent-color: var(--accent); }
.theme-download-progress.is-error { border-color: color-mix(in srgb, var(--danger) 60%, var(--line)); }
.theme-download-progress.is-error #theme-download-label { color: var(--danger); }

.message-sync {
  position: fixed;
  top: calc(var(--app-top, 0px) + 68px);
  right: max(12px, env(safe-area-inset-right));
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 7px;
  max-width: calc(100vw - 24px);
  padding: 8px 11px;
  border: 0.5px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 4px 18px rgb(0 0 0 / 10%);
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
}
.message-sync-spinner {
  width: 14px;
  height: 14px;
  flex: none;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: translation-spin 0.8s linear infinite;
}

.chat-sync-gap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  margin: 7px 0;
  padding: 6px 12px;
  flex: none;
  color: var(--muted);
  font-size: 12px;
}
.chat-sync-gap[role="button"] { cursor: pointer; }
.chat-sync-gap[role="button"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 登录 ---------- */

.login-box {
  margin: auto;
  width: min(420px, calc(100% - 40px));
  padding: 28px 22px;
  background: var(--surface);
  border: 0.5px solid var(--line);
  border-radius: 16px;
}
.login-box h1 { font-size: 22px; font-weight: 500; margin: 0 0 6px; }
.registration-title { margin: 0 0 12px; font-size: 19px; font-weight: 650; }
.login-box .sub { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.field { display: block; margin-top: 14px; }
.err { color: var(--danger); font-size: 13px; margin: 10px 0 0; min-height: 18px; }
.switch { text-align: center; font-size: 13px; color: var(--muted); margin: 16px 0 0; }
/* 用 button 而不是 a[href="#"]：可点区域更大，也不会有锚点跳转的副作用 */
.switch a,
.switch button.link,
.login-box button.login-link {
  color: var(--accent);
  text-decoration: none;
  background: none;
  border: 0;
  font: inherit;
  padding: 6px 2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.login-submit { width: 100%; margin-top: 2px; }
.login-link { display: block; width: 100%; text-align: center; margin-top: 8px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

input, select, textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  border: 0.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }

button {
  font: inherit;
  border-radius: 10px;
  border: 0.5px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 10px 14px;
  cursor: pointer;
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 500;
}
button.primary:disabled { opacity: 0.5; }
button.ghost { background: transparent; border-color: transparent; color: var(--accent); }
#login-btn { width: 100%; margin-top: 20px; }
#login-cancel { display: block; width: 100%; margin-top: 8px; min-height: 44px; }

/* ---------- 顶栏 ---------- */

.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 12px 10px;
  background: var(--surface);
  border-bottom: 0.5px solid var(--line);
  flex: none;
}
.bar h2 { font-size: 16px; font-weight: 500; margin: 0; }
.bar .sub { font-size: 12px; color: var(--muted); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .grow { flex: 1; min-width: 0; }
.bar .center { text-align: center; }
#view-chat > .bar .grow { text-align: start; }
#view-chat > .bar #peer-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#peer-state.is-typing { color: var(--accent); font-weight: 600; }
.spacer { width: 48px; flex: none; }
.bar-actions { display: flex; align-items: center; gap: 2px; flex: none; margin-inline-start: auto; }
.bar-actions button { min-height: 44px; min-width: 44px; padding-inline: 9px; white-space: nowrap; }
#bell-btn { position: relative; }
.notification-count {
  position: absolute;
  inset-block-start: 1px;
  inset-inline-end: 0;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 2px solid var(--surface);
  border-radius: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
.bar .back-button { display: grid; place-items: center; width: 44px; height: 44px; min-width: 44px; flex: none; padding: 0; }
.bar .back-button::before { content: ""; display: block; width: 11px; height: 11px; margin-left: 5px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.header-language {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: none;
  min-width: 82px;
  min-height: 44px;
  padding: 7px 8px;
  font-size: 13px;
  white-space: nowrap;
}
.header-language-flag,
.language-menu-flag {
  width: 22px;
  height: 16px;
  flex: none;
  object-fit: cover;
  border: 0.5px solid rgba(0, 0, 0, 0.16);
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.header-language-code { font-weight: 700; letter-spacing: 0.04em; }
.header-language-chevron { font-size: 15px; line-height: 1; transform: translateY(-1px); }
.language-menu {
  position: fixed;
  z-index: 35;
  width: min(250px, calc(100vw - 16px));
  max-height: min(60vh, 420px);
  overflow-y: auto;
  padding: 6px;
  background: var(--surface);
  border: 0.5px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.15);
}
.language-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 7px 10px;
  text-align: start;
  border: 0;
  background: transparent;
}
.language-menu button.active { background: var(--accent-soft); color: var(--accent); }
body:not(.langbar-off) .bar { padding-top: 10px; }

/* ---------- 联系人 ---------- */

.account-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: var(--surface);
  border-bottom: 0.5px solid var(--line);
}
.account-bar label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.account-bar select { flex: 1; width: auto; min-width: 0; padding: 7px 8px; }
.account-bar button { flex: none; min-height: 42px; padding: 7px 10px; white-space: nowrap; }

.list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; min-height: 0; }
#view-list > #partner-list { flex: none; overflow: visible; }
.friend-form { flex: none; padding: 10px 12px 0; background: var(--bg); }
.friend-form label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.friend-row { display: flex; gap: 8px; }
.friend-row input { flex: 1; min-width: 0; font-size: 16px; }
.friend-row button { flex: none; min-height: 44px; }
.friend-msg { min-height: 18px; margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.relation-section { flex: none; padding: 0 8px; }
.relation-section h3 { font-size: 13px; font-weight: 500; color: var(--muted); margin: 6px 8px 2px; }
.relation-list { padding: 4px 0; max-height: 125px; }
.relation-list li { margin-bottom: 4px; padding: 5px 8px; }
.relation-list button { min-height: 40px; padding: 7px 9px; }
.status-pill { flex: none; font-size: 12px; color: var(--muted); }
.danger { color: var(--danger) !important; }

.install-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 10px 0;
  padding: 12px 14px;
  background: var(--accent-soft);
  border: 0.5px solid rgba(24, 95, 165, 0.35);
  border-radius: 12px;
}
.install-card b { font-weight: 500; display: block; font-size: 14px; color: #0c447c; }
.install-card span { font-size: 12px; color: #185fa5; }
.install-card button { flex: none; padding: 8px 14px; }
.list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border: 0.5px solid var(--line);
  border-radius: 12px;
  margin-bottom: 8px;
}
.list li.partner-item { position: relative; display: block; padding: 0; overflow: hidden; isolation: isolate; }
#view-list #partner-list > .partner-item { margin-block: 0; border-radius: 0; clip-path: none; }
#view-list #partner-list > .partner-item:not(:last-child) { border-block-end: 0; }
#view-list #partner-list > .partner-item + .partner-item { border-block-start: 1px solid var(--line); }
#view-list #partner-list > .partner-item:first-child { border-start-start-radius: 12px; border-start-end-radius: 12px; }
#view-list #partner-list > .partner-item:last-child { border-end-start-radius: 12px; border-end-end-radius: 12px; }
.partner-main { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 12px; background: var(--surface); cursor: pointer; touch-action: pan-y; transition: transform 180ms ease; }
.partner-main:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.partner-item.action-open .partner-main { transform: translateX(-168px); }
.partner-remark-action,
.partner-delete { position: absolute; inset-block: 0; right: 0; display: grid; place-items: center; width: 84px; height: 100%; padding: 0; border: 0; border-radius: 0; background: var(--danger); color: #fff; font-size: 14px; cursor: pointer; }
.partner-remark-action { right: 84px;
  height: 100%; background: var(--accent); }
.partner-remark-action:focus-visible,
.partner-delete:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.dot {
  position: relative;
  width: 40px; height: 40px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-size: 15px; font-weight: 500;
}
.dot > img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.partner-item .partner-avatar { min-height: 40px; padding: 0; border: 0; cursor: pointer; }
.partner-avatar.has-unread, .chat-unread-avatar {
  box-shadow: 0 0 0 2px #dc3545;
  animation: unread-avatar-pulse 1.4s ease-in-out 2;
}
@keyframes unread-avatar-pulse {
  0%, 45%, 100% { transform: scale(1); opacity: 1; }
  22% { transform: scale(1.11); opacity: .68; }
}
@keyframes unread-avatar-flash-reduced {
  0%, 45%, 100% { opacity: 1; }
  22% { opacity: .48; }
}
.partner-language-flag {
  position: absolute; z-index: 2; left: -5px; top: -5px;
  width: 20px; height: 20px; overflow: hidden; border-radius: 50%;
  border: 2px solid var(--surface); background: var(--surface);
  box-shadow: 0 0 0 0.5px var(--line);
}
.partner-language-flag img { display: block; width: 100%; height: 100%; object-fit: cover; }
.partner-online-dot {
  position: absolute; z-index: 2; right: -3px; bottom: -3px;
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--surface); background: #a8ce57;
}
.partner-unread-dot {
  position: absolute; z-index: 2; right: -3px; top: -3px;
  width: 13px; height: 13px; border-radius: 50%;
  background: #b00020;
}
.chat-peer-avatar { position: relative; width: 38px; height: 38px; flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; color: #fff; font-size: 15px; cursor: pointer; overflow: visible; }
.chat-peer-avatar > img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.chat-peer-avatar .partner-language-flag { width: 19px; height: 19px; }
.chat-peer-avatar .partner-online-dot { width: 14px; height: 14px; }
.chat-unread-peers { display: flex; align-items: center; gap: 3px; flex: none; }
.chat-unread-peers:empty { display: none; }
.chat-unread-avatar, .chat-unread-more {
  position: relative; display: grid; place-items: center; width: 32px; height: 32px;
  flex: none; padding: 0; border-radius: 50%; cursor: pointer;
}
.chat-unread-avatar { border: 2px solid var(--surface); color: #fff; font-size: 13px; overflow: hidden; }
.chat-unread-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.chat-unread-more { border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 22px; line-height: 1; }
.chat-unread-avatar:focus-visible, .chat-unread-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .partner-avatar.has-unread { animation: none; }
  .chat-unread-avatar { animation-name: unread-avatar-flash-reduced; }
}
.list .meta { flex: 1; min-width: 0; }
.list .meta b { font-weight: 500; display: block; }
.list .meta span { font-size: 12px; color: var(--muted); }
.partner-meta { display: grid; align-content: center; gap: 4px; min-width: 0; }
.partner-meta b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.partner-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.partner-heading b { min-width: 0; }
.partner-time { flex: none; color: var(--muted); font-size: 11px; text-align: end; white-space: nowrap; }

/* Shared compact timestamps, including the default theme and downloaded themes. */
html body .message-time,
html body .partner-time,
html body .advisor-message-time,
html body .notification-head time,
html body .history-item-meta,
html body #peer-state,
html body #voice-time {
  font-family: "Arial Narrow", "Roboto Condensed", ui-monospace, monospace !important;
  font-size: 9px !important;
  line-height: 11px !important;
  letter-spacing: .08em;
  font-variant-numeric: tabular-nums;
}
.list .partner-meta .partner-preview {
  display: block; min-height: 1.3em; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 13px; color: var(--hint);
}
.list .partner-meta .partner-preview.is-unread { color: var(--text); font-weight: 600; }

/* ---------- 聊天记录 ---------- */
.history-controls { flex: none; display: grid; gap: 6px; padding: 6px 12px; background: var(--surface); border-bottom: 0.5px solid var(--line); }
.history-search { display: flex; align-items: center; gap: 5px; min-width: 0; }
html body #history-search-input { flex: 1; min-width: 0; width: 0; height: 36px; min-height: 36px; padding: 5px 9px; font-size: 16px; font-weight: 400; line-height: 24px; }
html body .history-search button { flex: none; display: grid; place-items: center; width: 36px; height: 36px; min-height: 36px; padding: 7px; }
.history-search button svg { display: block; width: 20px; height: 20px; }
.history-time-open[aria-expanded="true"] { background: var(--accent-soft); }
.history-tabs { display: flex; gap: 5px; }
html body .history-tabs button { flex: 1; min-width: 0; min-height: 30px; height: 30px; padding: 3px 5px; font-size: 12px; line-height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-tabs button[aria-selected="true"] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.history-status { flex: none; min-height: 0; margin: 0; padding: 0 12px; color: var(--muted); font-size: 12px; }
.history-status:not(:empty) { padding-block: 7px; }
.history-list { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; -webkit-overflow-scrolling: touch; }
.history-list.history-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); align-content: start; }
.history-photo-grid .history-item { max-width: none; min-width: 0; align-self: stretch; }
.history-photo-grid .history-item-photo { width: 100%; height: 135px; max-width: none; max-height: none; object-fit: cover; }
.history-item { max-width: min(86%, 42rem); padding: 10px 12px; border: 0.5px solid var(--line); border-radius: 12px; background: var(--surface); overflow-wrap: anywhere; }
.history-item.self { align-self: flex-end; background: var(--self-soft); }
.history-item.peer { align-self: flex-start; }
.history-item-meta { color: var(--muted); font-size: 11px; margin-bottom: 6px; }
.history-item-text { white-space: pre-wrap; font-size: 14px; }
.history-item-original { margin-top: 6px; color: var(--muted); font-size: 12px; white-space: pre-wrap; }
.history-item-photo { display: block; max-width: min(68vw, 280px); max-height: 240px; border-radius: 8px; object-fit: contain; }
.history-item-photo-link { display: block; min-width: 110px; min-height: 60px; }
.history-photo-grid .video-frame { width: 100%; min-width: 0; }
.history-photo-grid .chat-video { width: 100%; max-height: 180px; }
.history-item-audio { display: block; width: min(66vw, 290px); max-width: 100%; height: 42px; }
.history-item-jump { margin-top: 8px; padding: 4px 8px; font-size: 12px; }
#history-delete-menu { max-width: min(360px, calc(100vw - 28px)); border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: var(--surface); color: var(--text); }
#history-delete-menu h2 { margin: 0 0 12px; font-size: 17px; }
#history-delete-menu form, .history-delete-selection { display: flex; flex-wrap: wrap; gap: 8px; }
.history-delete-selection { padding: 0 12px 8px; align-items: center; }
.history-delete-selection p { width: 100%; margin: 0; color: var(--muted); font-size: 13px; }
.history-delete-point { margin: 8px 0 0 6px; padding: 4px 8px; font-size: 12px; }
.history-delete-point[aria-pressed="true"] { outline: 2px solid currentColor; outline-offset: -2px; }

.history-more { flex: none; align-self: center; margin: 6px 0 calc(env(safe-area-inset-bottom) + 8px); }
.history-time-box { width: min(380px, 100%); min-width: 0; max-height: calc(var(--app-height, 100dvh) - 40px); overflow: auto; }
.history-time-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.history-time-heading h3 { margin: 0; }
.history-time-heading button { flex: none; }
.history-time-box label { display: flex; gap: 8px; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
html body #history-at { display: block; width: 100%; min-width: 0; max-width: 100%; min-height: 42px; font-size: 16px; }
.history-time-box .history-status { padding-inline: 0; }
.hint { text-align: center; color: var(--hint); font-size: 12px; padding: 12px; margin: 0; }

/* ---------- 好友公开资料 ---------- */
.peer-profile-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 12px calc(env(safe-area-inset-bottom) + 28px); }
.peer-profile-card { display: grid; justify-items: center; gap: 8px; width: min(100%, 460px); margin: 0 auto; padding: 24px 18px; border: 0.5px solid var(--line); border-radius: 14px; background: var(--surface); }
.peer-profile-card .profile-avatar-preview { width: 108px; height: 108px; font-size: 36px; }
.peer-profile-card h3 { margin: 5px 0 0; overflow-wrap: anywhere; text-align: center; }
.peer-profile-card .profile-login-name { margin: 0; }
.peer-profile-facts { width: 100%; margin: 14px 0 0; }
.peer-profile-facts > div { display: flex; justify-content: space-between; gap: 20px; padding: 13px 2px; border-top: 0.5px solid var(--line); }
.peer-profile-facts dt { color: var(--muted); }
.peer-profile-facts dd { margin: 0; text-align: end; overflow-wrap: anywhere; }
.peer-profile-language-value { display: inline-flex; align-items: center; justify-content: flex-end; gap: 7px; }
.peer-profile-language-flag { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.peer-profile-card > button:not(.profile-avatar-preview) { width: 100%; min-height: 44px; margin-top: 8px; }
.peer-profile-card.is-friend-preview .peer-profile-friend-only { display: none !important; }
.peer-profile-remark-form { display: grid; gap: 7px; width: 100%; margin-top: 10px; padding: 12px; border-radius: 12px; background: var(--bg); }
.peer-profile-remark-form > label { color: var(--muted); font-size: 13px; }
.peer-profile-remark-actions { display: flex; justify-content: flex-end; gap: 8px; }
.peer-profile-remark-actions button { min-height: 42px; }
.peer-profile-remark-actions .primary { width: auto; margin-top: 0; }

/* ---------- 账户资料 ---------- */
#view-blacklist { overflow: hidden; }
.blacklist-search { display: flex; gap: 8px; margin-block: 12px; }
.blacklist-search input { min-width: 0; flex: 1; font-size: 16px; }
.blacklist-search button, .blacklist-pagination button, .blacklist-row button { min-height: 44px; flex: none; }
.blacklist-row { display: flex; align-items: center; gap: 12px; }
.blacklist-identity { display: grid; flex: 1; min-width: 0; gap: 4px; overflow-wrap: anywhere; }
.blacklist-identity small { color: var(--muted); }
.blacklist-pagination { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#view-list > .bar h2 { overflow-wrap: anywhere; line-height: 1.2; }
.account-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 12px calc(env(safe-area-inset-bottom) + 28px); }
.profile-card { display: grid; gap: 8px; width: min(100%, 460px); margin: 0 auto; padding: 18px; border-radius: 14px; border: 0.5px solid var(--line); background: var(--surface); }
.profile-card > label { margin-top: 7px; font-size: 13px; color: var(--muted); }
.profile-card > button.primary { min-height: 46px; margin-top: 10px; }
.account-email-summary { margin-block-end: 12px; }
#account-email-current { overflow-wrap: anywhere; }
#view-account-email [hidden], #me-account-email[hidden] { display: none; }
#view-account-email .friend-msg:empty { display: none; }
#view-account-email button { min-height: 44px; }
.profile-time-zone-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.profile-time-zone-row select { flex: 1; min-width: 0; width: 100%; }
.profile-time-zone-row button { flex: none; min-height: 42px; padding-inline: 10px; white-space: nowrap; }
.profile-avatar-row { display: flex; align-items: center; gap: 16px; margin-bottom: 6px; }
.profile-avatar-preview { position: relative; display: grid; place-items: center; width: 88px; height: 88px; flex: none; overflow: hidden; border-radius: 50%; color: #fff; font-size: 30px; background: var(--accent); }
.profile-avatar-preview[type="button"] { min-height: 0; margin: 0; padding: 0; border: 0; cursor: zoom-in; }
.profile-avatar-preview[type="button"]:disabled { opacity: 1; cursor: default; }
.profile-avatar-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-actions { display: grid; gap: 4px; min-width: 0; }
.profile-avatar-actions strong { overflow-wrap: anywhere; }
.profile-login-name { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.profile-avatar-actions label { display: grid; place-items: center; min-height: 42px; padding: 7px 10px; border-radius: 10px; color: var(--accent); cursor: pointer; }
.profile-avatar-actions button { min-height: 42px; }
.profile-crop { display: grid; justify-items: center; gap: 8px; padding: 10px; border-radius: 12px; background: var(--bg); }
.profile-crop canvas { width: min(220px, 100%); height: auto; aspect-ratio: 1; border-radius: 50%; touch-action: none; cursor: grab; }
.profile-crop canvas:active { cursor: grabbing; }
.profile-crop p { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }
.profile-crop label { justify-self: stretch; font-size: 13px; color: var(--muted); }
.profile-crop input { padding: 5px 0; }
.profile-crop-actions { display: flex; justify-content: flex-end; gap: 5px; width: 100%; }
.profile-crop-actions button { min-height: 42px; }

/* ---------- 管理员模型设置 ---------- */

.admin-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 12px calc(env(safe-area-inset-bottom) + 24px); }
.admin-tabs { display: flex; flex-shrink: 0; gap: 6px; overflow-x: auto; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.admin-tabs button { flex: 0 0 auto; min-height: 40px; white-space: nowrap; }
.admin-tabs button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.admin-scroll > [hidden] { display: none !important; }
.admin-scroll > [role="tabpanel"] { margin-top: 0; }
.admin-scroll > h3, .admin-form h3 { font-size: 17px; font-weight: 600; margin: 4px 0 6px; }
.admin-scroll > .hint { text-align: left; padding: 0 0 12px; }
.model-list { display: grid; gap: 9px; }
.model-card { background: var(--surface); border: 0.5px solid var(--line); border-radius: 12px; padding: 12px; min-width: 0; }
.model-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.model-head b { overflow-wrap: anywhere; }
.model-detail { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; margin-top: 4px; }
.model-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.model-actions button { min-height: 40px; }
.admin-form { display: grid; gap: 7px; margin-top: 18px; padding: 14px; background: var(--surface); border: 0.5px solid var(--line); border-radius: 12px; }
.admin-form label { font-size: 13px; color: var(--muted); margin-top: 4px; }
.admin-form input { min-width: 0; }
.admin-form .mobile-admin-create-checkbox { display:flex; align-items:center; gap:8px; }
.mobile-admin-create-checkbox input { width:auto; flex:none; }
#mobile-admin-create-language { width:100%; min-height:44px; }
#mobile-admin-create-status.success { color:var(--accent); }
.admin-form button { min-height: 44px; margin-top: 10px; }
.ip-allowlist-section { margin-top: 22px; }
.ip-allowlist-section h3 { font-size: 17px; margin: 0 0 6px; }
.ip-allowlist-section > .hint { text-align: left; padding: 0 0 10px; }
.admin-search-row { display: flex; gap: 7px; margin-bottom: 10px; }
.admin-search-row input { flex: 1; min-width: 0; }
.admin-table-wrap { width: 100%; overflow-x: auto; border: 0.5px solid var(--line); border-radius: 10px; background: var(--surface); }
.admin-data-table { width: 100%; min-width: 620px; border-collapse: collapse; }
.admin-data-table th, .admin-data-table td { padding: 9px 10px; border-bottom: 0.5px solid var(--line); text-align: left; vertical-align: top; font-size: 12px; overflow-wrap: anywhere; }
.admin-data-table th { color: var(--muted); font-weight: 600; background: var(--soft); white-space: nowrap; }
.admin-data-table tr:last-child td { border-bottom: 0; }
.admin-data-table button { min-height: 36px; white-space: nowrap; }
.admin-pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; }
.admin-pager span { color: var(--muted); font-size: 12px; text-align: center; }
.admin-pager button { min-height: 40px; }
.audit-section { margin-top: 22px; }
.audit-section h3 { font-size: 17px; margin: 0 0 6px; }
.audit-section .hint { text-align: left; padding: 0 0 10px; }
.audit-section label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.audit-section select { margin-bottom: 10px; }
.audit-list { display: grid; gap: 8px; }
.audit-card { display: grid; gap: 4px; min-width: 0; padding: 11px; background: var(--surface); border: 0.5px solid var(--line); border-radius: 10px; }
.audit-card b { font-size: 14px; font-weight: 600; }
.audit-card .audit-last-message { color: var(--accent); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.audit-card span { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }

/* ---------- 消息 ---------- */

.msgs {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  -webkit-overflow-scrolling: touch;
}
.message-pane { position: relative; display: flex; flex: 1; min-height: 0; }
.message-pane .msgs { width: 100%; }

.row { display: flex; flex-direction: column; max-width: min(82%, 36rem); min-width: 0; }
.row.self { align-self: flex-end; align-items: flex-end; }
.row.peer { align-self: flex-start; align-items: flex-start; }

.bubble {
  position: relative;
  box-sizing: border-box;
  max-width: 100%;
  padding: 6px 12px 8px;
  border-radius: 14px;
  background: var(--surface);
  border: 0.5px solid var(--line);
  word-break: break-word;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  touch-action: pan-y;
}
.bubble.has-dated-time { min-width: 138px; }
.bubble.has-peer-avatar.has-dated-time { min-width: 152px; }
.message-time {
  position: absolute;
  z-index: 2;
  top: -1px;
  right: 9px;
  transform: translateY(-100%);
  padding: 0 3px;
  border-radius: 3px;
  background: transparent;
  color: var(--hint);
  font-family: "Arial Narrow", "Roboto Condensed", sans-serif;
  font-size: 9px;
  line-height: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.row.self .message-time { background: transparent; }
.link-preview-block { width: 260px; max-width: 100%; margin: 5px 0; }
.link-preview { display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); text-decoration: none; }
.link-preview-cover { display: block; width: 100%; height: 132px; object-fit: cover; }
.link-preview-block [hidden] { display: none !important; }
.link-preview-body { display: grid; gap: 6px; padding: 10px 12px; }
.link-preview-title { font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.link-preview-description { font-size: 12px; line-height: 1.5; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.link-preview-site { color: var(--hint); font-size: 11px; overflow-wrap: anywhere; }
.link-preview-load { max-width: 100%; margin-top: 4px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-size: 12px; overflow-wrap: anywhere; }
.link-preview-status { display: block; font-size: 12px; color: var(--muted); }
.link-preview:focus-visible, .link-preview-load:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* 来源标记与时间文字等高，颜色跟随当前主题；伪元素保留定时刷新。 */
html body .explanation-model.model-local,
html body .explanation-model.model-hy7b_local,
html body .explanation-model.model-desktop,
html body .explanation-model.model-codex,
html body .message-time.model-local,
html body .message-time.model-gx10,
html body .message-time.model-mac,
html body .message-time.model-hy7b_local,
html body .message-time.model-qwen27b_local,
html body .message-time.model-desktop,
html body .message-time.model-codex,
html body .advisor-message-time.model-local,
html body .advisor-message-time.model-hy7b_local,
html body .advisor-message-time.model-qwen27b_local,
html body .advisor-message-time.model-external,
html body .advisor-message-time.model-calendar,
html body .advisor-message-time.model-unknown,
html body .advisor-message-time.model-desktop,
html body .advisor-message-time.model-codex { display: inline-flex; align-items: center; gap: 4px; }
html body .message-time.model-hy7b_local::before,
html body .message-time.model-qwen27b_local::before,
html body .advisor-message-time.model-hy7b_local::before,
html body .advisor-message-time.model-qwen27b_local::before {
  content: "";
  display: inline-block;
  flex: 0 0 1.2em;
  width: 1.2em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http%3A//www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M12 8.5 15.5 1 M20.5 12.2c-1 2.8-5.8 3.3-10.5 1.6S1.9 8.8 2.9 6s5.8-3.3 10.5-1.6 8.1 5 7.1 7.8Z M17.1 11c-.5 1.4-3.2 1.6-5.9.6S6.7 8.7 7.2 7.3s3.2-1.6 5.9-.6 4.5 2.9 4 4.3Z M3.7 10.9l4.5 7.4c4.3.1 8.3-1.4 11.2-4.3 M1 3.8C3.3 1.2 7 .6 10.5 1.4 M22.6 10.8c.8 2.5-.1 4.8-2.4 6.3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http%3A//www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M12 8.5 15.5 1 M20.5 12.2c-1 2.8-5.8 3.3-10.5 1.6S1.9 8.8 2.9 6s5.8-3.3 10.5-1.6 8.1 5 7.1 7.8Z M17.1 11c-.5 1.4-3.2 1.6-5.9.6S6.7 8.7 7.2 7.3s3.2-1.6 5.9-.6 4.5 2.9 4 4.3Z M3.7 10.9l4.5 7.4c4.3.1 8.3-1.4 11.2-4.3 M1 3.8C3.3 1.2 7 .6 10.5 1.4 M22.6 10.8c.8 2.5-.1 4.8-2.4 6.3'/%3E%3C/svg%3E") center / contain no-repeat;
}
html body .message-time.model-local::before,
html body .message-time.model-gx10::before,
html body .advisor-message-time.model-local::before {
  content: "";
  display: inline-block;
  flex: 0 0 1.2em;
  width: 1.2em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11 6 3h12l3 8'/%3E%3Crect x='2' y='10' width='20' height='8' rx='2'/%3E%3Cpath d='M16 14h.01M19 14h.01'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11 6 3h12l3 8'/%3E%3Crect x='2' y='10' width='20' height='8' rx='2'/%3E%3Cpath d='M16 14h.01M19 14h.01'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}
html body .message-time.model-desktop::before,
html body .message-time.model-mac::before,
html body .advisor-message-time.model-desktop::before {
  content: "";
  display: inline-block;
  flex: 0 0 1.2em;
  width: 1.2em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M4 2h16a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2M12 14v4M7 18h10'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M4 2h16a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2M12 14v4M7 18h10'/%3E%3C/svg%3E") center / contain no-repeat;
}
html body .message-time.model-codex::before,
html body .advisor-message-time.model-codex::before {
  content: "";
  display: inline-block;
  flex: 0 0 1.2em;
  width: 1.2em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M7 6l4 4-4 4M13 14h4M4 2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M7 6l4 4-4 4M13 14h4M4 2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2'/%3E%3C/svg%3E") center / contain no-repeat;
}
html body .advisor-message-time.model-external::before {
  content: "";
  display: inline-block;
  flex: 0 0 1.2em;
  width: 1.2em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.6'%3E%3Ccircle cx='12' cy='10' r='8'/%3E%3Cellipse cx='12' cy='10' rx='3.5' ry='8'/%3E%3Cpath d='M4 10h16M5.5 5.5h13M5.5 14.5h13'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.6'%3E%3Ccircle cx='12' cy='10' r='8'/%3E%3Cellipse cx='12' cy='10' rx='3.5' ry='8'/%3E%3Cpath d='M4 10h16M5.5 5.5h13M5.5 14.5h13'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}
html body .advisor-message-time.model-calendar::before {
  content: "";
  display: inline-block;
  flex: 0 0 1.2em;
  width: 1.2em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Crect x='4' y='3' width='16' height='15' rx='2'/%3E%3Cpath d='M8 1v4M16 1v4M4 7h16M8 11h2M14 11h2M8 14h2M14 14h2'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Crect x='4' y='3' width='16' height='15' rx='2'/%3E%3Cpath d='M8 1v4M16 1v4M4 7h16M8 11h2M14 11h2M8 14h2M14 14h2'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}
html body .advisor-message-time.model-unknown::before {
  content: "";
  display: inline-block;
  flex: 0 0 1.2em;
  width: 1.2em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='12' cy='10' r='8'/%3E%3Cpath d='M9.5 7a2.5 2.5 0 1 1 4 2c-1 .6-1.5 1-1.5 2.5M12 14h.01'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='12' cy='10' r='8'/%3E%3Cpath d='M9.5 7a2.5 2.5 0 1 1 4 2c-1 .6-1.5 1-1.5 2.5M12 14h.01'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}
html body .bubble.has-local-model,
html body .bubble.has-hy7b_local-model,
html body .bubble.has-desktop-model,
html body .bubble.has-codex-model { min-width: 90px; }
html body .explanation-model.model-local,
html body .explanation-model.model-hy7b_local,
html body .explanation-model.model-desktop,
html body .explanation-model.model-codex { display: flex; font-size: 11px; line-height: 1.4; margin-bottom: 5px; color: var(--muted); }
html body .bubble.has-local-model.has-dated-time,
html body .bubble.has-hy7b_local-model.has-dated-time,
html body .bubble.has-desktop-model.has-dated-time,
html body .bubble.has-codex-model.has-dated-time,
html body .advisor-answer-bubble.has-local-model,
html body .advisor-answer-bubble.has-hy7b_local-model,
html body .advisor-answer-bubble.has-qwen27b_local-model,
html body .advisor-answer-bubble.has-external-model,
html body .advisor-answer-bubble.has-calendar-model,
html body .advisor-answer-bubble.has-unknown-model,
html body .advisor-answer-bubble.has-desktop-model,
html body .advisor-answer-bubble.has-codex-model { min-width: 176px; }
html body .bubble.has-local-model.has-peer-avatar.has-dated-time,
html body .bubble.has-hy7b_local-model.has-peer-avatar.has-dated-time,
html body .bubble.has-desktop-model.has-peer-avatar.has-dated-time,
html body .bubble.has-codex-model.has-peer-avatar.has-dated-time { min-width: 190px; }
.row.peer .bubble.has-peer-avatar { position: relative; padding-left: 34px; }
.message-peer-avatar-button {
  position: absolute;
  left: -12px;
  top: -10px;
  z-index: 1;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
  overflow: hidden;
  cursor: pointer;
}
.message-peer-avatar { display: block; width: 100%; height: 100%; object-fit: cover; }
.row.self .bubble { position: relative; background: var(--self-soft); border-color: rgba(29, 158, 117, 0.3); }
.outbox-text { font-size: 15px; }
.outbox-status { margin-top: 1px; padding: 2px 4px; color: var(--hint); font-size: 11px; line-height: 1.35; }
.upload-keepalive { display: grid; gap: 3px; min-width: 0; max-width: min(65vw, 280px); margin-top: 4px; }
.upload-keepalive button.upload-keepalive-toggle, .upload-keepalive button.upload-screen-wake { justify-self: start; max-width: 100%; min-height: 32px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--accent); font: inherit; font-size: 12px; line-height: 1.4; white-space: normal; overflow-wrap: anywhere; cursor: pointer; touch-action: manipulation; }
.upload-keepalive button[aria-pressed="true"] { background: var(--self-soft); }
.upload-keepalive small { color: var(--muted); font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.upload-keepalive small[hidden] { display: none; }
button.outbox-status { min-height: 32px; padding: 5px 6px; border: 0; background: transparent; font-family: inherit; cursor: pointer; }
button.outbox-failed { color: var(--danger); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
button.outbox-failed:focus-visible { outline: 2px solid var(--danger); border-radius: 3px; }
.row .bubble.recalled-bubble { background: var(--surface); border-style: dashed; color: var(--hint); }
.recalled-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.recalled-text { color: var(--hint); font-size: 13px; }
.recalled-edit { min-height: 28px; padding: 2px 6px; border: 0; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font: inherit; font-size: 12px; cursor: pointer; }
.recalled-edit:disabled { opacity: 0.5; cursor: default; }

.bubble .translated { font-size: 15px; }
.quote-reference {
  display: flex;
  box-sizing: border-box;
  flex-direction: column;
  gap: 2px;
  max-width: 20rem;
  width: 100%;
  margin-bottom: 7px;
  padding: 5px 8px;
  border: 0;
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  background: var(--accent-soft);
  color: inherit;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}
.quote-reference:hover { background: var(--self-soft); }
.quote-reference:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.quote-reference b, .quote-reference span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-reference b { color: var(--accent); }
.quote-reference span { color: var(--muted); }
.quote-target-flash .bubble { outline: 2px solid var(--accent); outline-offset: 3px; }
.jump-latest {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin: 0;
  padding: 0;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
  font-size: 22px;
  line-height: 1;
}
.bubble .pending { color: var(--hint); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.bubble .translation-failed { margin-top: 6px; color: var(--danger); font-size: 12px; font-weight: 600; }
.bubble .translation-retry {
  display: block;
  min-height: 28px;
  margin: 6px 0 0;
  padding: 3px 10px;
  border: 1px solid currentColor;
  border-radius: 7px;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}
.bubble .translation-retry:disabled { cursor: default; opacity: 0.55; }
.translation-spinner {
  display: inline-block;
  flex: none;
  width: 13px;
  height: 13px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: translation-spin 0.8s linear infinite;
}
@keyframes translation-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .translation-spinner, .update-spinner, .message-sync-spinner { animation-duration: 2s; }
}
.bubble .origin {
  display: block;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 0.5px dashed var(--line);
  font-size: 13px;
  color: var(--muted);
}
.bubble.failed-translation .origin { margin-top: 0; padding-top: 0; border-top: 0; font-size: 14px; color: inherit; }
.bubble.collapsed-origin .origin { display: none; }
.image-frame { min-width: 110px; max-width: min(72vw, 320px); }
.cli-image-toggle { display: none; }
.image-upload-badge { display: inline-flex; align-items: center; gap: 5px; margin-top: 5px; color: var(--hint); font-size: 11px; }
.image-upload-badge::before { content: ""; width: 11px; height: 11px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: translation-spin 0.8s linear infinite; }
.image-status { display: block; color: var(--hint); font-size: 13px; padding: 20px 8px; }
.image-original { display: block; color: var(--accent); font-size: 13px; }
.chat-image { display: block; max-width: 100%; max-height: min(52vh, 420px); width: auto; height: auto; border-radius: 9px; object-fit: contain; }
.image-translation-controls { display: grid; justify-items: start; margin-top: 4px; }
.image-translation-action { min-height: 44px; padding: 4px 8px; font-size: 12px; }
.image-translation-notice { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.video-frame { width: min(72vw, 320px); max-width: 100%; min-width: 150px; }
.video-subtitle-box { width: min(420px, 100%); }
.video-subtitle-switch { display: flex; align-items: center; gap: 10px; margin: 14px 0; font-weight: 650; }
.video-subtitle-switch input { width: 20px; height: 20px; accent-color: var(--accent); }
.video-subtitle-box .field { display: grid; gap: 6px; margin-top: 12px; }
.video-subtitle-status { display: grid; gap: 5px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.video-subtitle-status progress { width: 100%; height: 7px; accent-color: var(--accent); }
.video-subtitle-retry { justify-self: start; min-height: 30px; padding: 4px 10px; }
.video-play { display: grid; place-items: center; width: 100%; min-height: 110px; padding: 12px; border: 0; border-radius: 9px; background-color: #1b2630; background-position: center; background-size: cover; color: #fff; font: inherit; font-weight: 650; text-shadow: 0 1px 4px #000; cursor: pointer; }
.video-play::before { content: "▶"; display: block; font-size: 28px; }
.chat-video { display: block; width: 100%; max-height: min(52vh, 420px); border-radius: 9px; background: #111; touch-action: auto; }
.video-download { display: inline-block; margin-top: 6px; color: var(--accent); font-size: 12px; }
.video-original-status { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; }
.outbox-progress, .video-original-status { display: grid; gap: 5px; min-width: 0; overflow-wrap: anywhere; }
.outbox-progress { width: min(56vw, 240px); max-width: 100%; margin-top: 6px; font-size: 12px; color: var(--muted); }
.outbox-progress progress, .video-original-status progress { width: 100%; height: 7px; accent-color: var(--accent); }
.video-original-status.is-failed { color: var(--danger); }
.video-error { display: block; margin-top: 5px; color: var(--warn); font-size: 12px; }
.sticker-frame { width: 72px; height: 72px; min-width: 72px; max-width: 72px; overflow: hidden; -webkit-touch-callout: none; user-select: none; }
.sticker-frame .image-content { width: 100%; height: 100%; }
.sticker-frame .image-status { box-sizing: border-box; display: grid; place-items: center; width: 100%; height: 100%; padding: 4px; text-align: center; }
.sticker-original { display: grid; place-items: center; width: 100%; height: 100%; }
.sticker-image { width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; }
.sticker-message-menu { position: fixed; z-index: 38; display: grid; gap: 2px; min-width: 152px; padding: 5px; border: 0.5px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 8px 26px rgba(0, 0, 0, 0.16); }
.sticker-message-menu button { min-height: 42px; padding: 8px 12px; border: 0; background: transparent; color: var(--text); text-align: start; }
.sticker-message-menu button:hover, .sticker-message-menu button:focus-visible { background: var(--accent-soft); color: var(--accent); }
.audio-message { display: block; width: min(66vw, 290px); max-width: 100%; height: 42px; }
.voice-transcription { width: min(66vw, 290px); max-width: 100%; }
.voice-transcribe-status { font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.voice-transcribe-status:not(:empty) { padding: 5px 0; }
.history-item .voice-transcribe-status .origin { margin-top: 6px; color: var(--muted); font-size: 12px; }
.file-card { box-sizing: border-box; display: flex; align-items: center; gap: 10px; width: min(72vw, 330px); max-width: 100%; min-width: 190px; padding: 9px; border: 1px solid color-mix(in srgb, currentColor 16%, transparent); border-radius: 10px; color: inherit; text-decoration: none; }
.file-card:hover, .file-card:focus-visible { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.file-card-icon { display: grid; place-items: center; flex: none; width: 45px; height: 52px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.file-card-info { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 3px; }
.file-card-name { overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.file-card-size { min-height: 1em; color: var(--muted); font-size: 11px; }
.file-card-action { color: var(--accent); font-size: 12px; }

.note {
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 13px;
}
.note b { font-weight: 500; }

.expl {
  margin-top: 8px;
  padding: 10px 11px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: #0c447c;
  font-size: 13px;
  white-space: pre-wrap;
}
.expl-error { margin-top: 8px; color: var(--danger); font-size: 12px; }
.explanation-advisor-action { display: block; max-width: 100%; min-height: 36px; margin-top: 8px; padding: 5px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--accent); font: inherit; font-size: 12px; line-height: 1.5; text-align: start; white-space: normal; overflow-wrap: anywhere; }
.explanation-advisor-action:hover, .explanation-advisor-action:focus-visible { text-decoration: underline; }
.explanation-switch-action { display: block; max-width: 100%; min-height: 36px; margin-top: 8px; padding: 5px 8px; color: var(--accent); font: inherit; font-size: 12px; line-height: 1.5; text-align: start; white-space: normal; overflow-wrap: anywhere; }

.actions { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 0; }
.actions button, .actions .audio-download {
  background: transparent;
  border: none;
  color: var(--hint);
  font-size: 12px;
  padding: 2px 7px;
  min-height: 28px;
}
.actions .audio-download { display: inline-flex; align-items: center; box-sizing: border-box; text-decoration: none; }
.actions button:disabled { opacity: 0.45; }
#view-chat #msgs > .row > .actions { gap: 0; }
#view-chat #msgs > .row > .actions > [data-chat-action] {
  position: relative;
  inset: auto;
  z-index: auto;
  display: inline-block;
  box-sizing: border-box;
  flex: none;
  width: 26px;
  height: 28px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0;
  line-height: 0;
  touch-action: manipulation;
}
#view-chat #msgs > .row > .actions > [data-chat-action][hidden] { display: none; }
#view-chat #msgs > .row > .actions > [data-chat-action]:is(:hover, :focus-visible):not(:disabled) {
  color: var(--accent);
  background: var(--accent-soft);
}
#view-chat #msgs > .row > .actions > [data-chat-action]::before {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 16px;
  height: 16px;
  content: "";
  background-color: currentColor;
  -webkit-mask: var(--chat-action-icon) center / contain no-repeat;
  mask: var(--chat-action-icon) center / contain no-repeat;
  pointer-events: none;
}
#view-chat #msgs > .row > .actions > [data-chat-action]::after { content: none; }
html[dir="rtl"] #view-chat #msgs > .row > .actions > :is([data-chat-action="forward"], [data-chat-action="recall"])::before { transform: scaleX(-1); }
@media (any-pointer: coarse) {
  #view-chat #msgs > .row > .actions > [data-chat-action] { width: 30px; height: 36px; }
}
#view-chat #msgs > .row > .actions > [data-chat-action="quote"] {
  --chat-action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 11c0-3 1.5-4.8 4-6m-4 6h5v6H4zm10 0c0-3 1.5-4.8 4-6m-4 6h5v6h-5z' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
#view-chat #msgs > .row > .actions > [data-chat-action="copy"] {
  --chat-action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='8' y='8' width='12' height='12' rx='2' fill='none' stroke='black' stroke-width='1.8'/%3E%3Cpath d='M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
#view-chat #msgs > .row > .actions > [data-chat-action="select"] {
  --chat-action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m3 6 2 2 4-4m3 3h9M3 12h5v5H3zM12 14h9M12 19h9' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
#view-chat #msgs > .row > .actions > [data-chat-action="forward"] {
  --chat-action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 8h7V4l7 7-7 7v-5h-3a6 6 0 0 0-6 6c-2-6-1-9 2-11Z' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
#view-chat #msgs > .row > .actions > [data-chat-action="recall"] {
  --chat-action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 10h13a4.5 4.5 0 0 1 0 9h-5M7 6l-4 4 4 4' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
#view-chat #msgs > .row > .actions > [data-chat-action="download"] {
  --chat-action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v12m-4-4 4 4 4-4M4 16v4h16v-4' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
#view-chat #msgs > .row > .actions > [data-chat-action="transcribe"] {
  --chat-action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 10v4m4-7v10m5-14v18m5-14v10m4-7v4' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
#view-chat #msgs > .row > .actions > [data-chat-action="explain"] {
  --chat-action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.5 8a4.5 4.5 0 1 1 7 3.7C13 12.8 12 13.5 12 16' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'/%3E%3Ccircle cx='12' cy='20' r='1.35'/%3E%3C/svg%3E");
}
#view-chat #msgs > .row > .actions > [data-chat-action="sticker"] {
  --chat-action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13 21H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v7l-8 8Zm0 0v-5a3 3 0 0 1 3-3h5M9 7v5m-2.5-2.5h5' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
#view-chat #msgs > .row > .actions > [data-chat-action="original"] {
  --chat-action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6-10-6-10-6Z M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
#view-chat #msgs > .row > .actions > [data-chat-action="original"][aria-expanded="true"] {
  --chat-action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m3 3 18 18M10.6 6.1 12 6c6.5 0 10 6 10 6a17 17 0 0 1-3 3.4M6.2 7.8C3.5 9.6 2 12 2 12s3.5 6 10 6c1.4 0 2.6-.3 3.7-.7' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
#view-chat #msgs > .row > .actions > [data-chat-action="feedback"] {
  --chat-action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 4H5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h2v3l4-3h8a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2Zm-7 4v3m0 3h.01' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
/* Default, memo and strawberry: attach metadata to its bubble and separate messages. */
html:is(:not([data-theme]), [data-theme="memo"], [data-theme="strawberry"]) #msgs > .row:not(:last-child) { margin-bottom: 5px; }
html:is(:not([data-theme]), [data-theme="memo"], [data-theme="strawberry"]) #msgs > .row > .actions { margin-top: -3px; }
#view-chat #msgs > .row > .actions > [data-chat-action="explain"][aria-expanded] {
  --chat-action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 4v11' stroke='black' stroke-width='2.2' stroke-linecap='round'/%3E%3Ccircle cx='12' cy='20' r='1.35'/%3E%3C/svg%3E");
}
#view-chat #msgs > .row > .actions > [data-chat-action="feedback"][data-chat-action-complete="true"] {
  --chat-action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 4H5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h2v3l4-3h8a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2Zm-10 7 2 2 4-4' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
#view-chat #msgs > .row > .actions > [data-chat-action][aria-busy="true"] {
  --chat-action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3a9 9 0 1 1-9 9' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
#view-chat #msgs > .row > .actions > [data-chat-action][aria-busy="true"] {
  color: var(--accent);
  opacity: 1;
}
#view-chat #msgs > .row > .actions > [data-chat-action="explain"][aria-busy="true"] {
  --chat-action-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='5' cy='12' r='1.8'/%3E%3Ccircle cx='12' cy='12' r='1.8'/%3E%3Ccircle cx='19' cy='12' r='1.8'/%3E%3C/svg%3E");
}
@media (prefers-reduced-motion: no-preference) {
  #view-chat #msgs > .row > .actions > [data-chat-action][aria-busy="true"]::before { animation: translation-spin .8s linear infinite; }
  #view-chat #msgs > .row > .actions > [data-chat-action="explain"][aria-busy="true"]::before { animation: chat-explanation-dots 1.2s steps(1, end) infinite; }
}
@keyframes chat-explanation-dots {
  0% { clip-path: inset(0 66.666% 0 0); }
  33.333% { clip-path: inset(0 33.333% 0 0); }
  66.666%, 100% { clip-path: inset(0); }
}
html:is(:not([data-theme]), [data-theme="memo"], [data-theme="strawberry"]) #msgs .message-time { top: 1px; }
html[data-theme="memo"] #msgs .message-time { top: 0; }
.read-receipt {
  position: absolute;
  left: -43px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 36px;
  height: 31px;
  border: 0;
  color: var(--hint);
  background: transparent;
}
.receipt-envelope {
  display: block;
  width: 28px;
  height: 28px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform-origin: center;
}
.read-receipt.is-unread .receipt-envelope { transform: rotate(-12deg); }
.read-receipt.is-read {
  display: flex;
  height: 35px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: var(--self);
}
.read-receipt.is-read .receipt-envelope {
  flex: none;
  width: 30px;
  height: 24px;
  stroke-width: 1.25;
  transform: none;
}
.receipt-envelope-letter,
.receipt-envelope-pocket { fill: var(--bg); }
.read-receipt-label {
  position: static;
  flex: none;
  transform: none;
  padding: 0;
  background: transparent;
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

/* ---------- 输入区 ---------- */

.composer {
  flex: none;
  background: var(--surface);
  border-top: 0.5px solid var(--line);
  padding: 5px 10px clamp(3px, env(safe-area-inset-bottom), 12px);
}
.composer-menu {
  margin-bottom: 8px;
  padding: 9px;
  border: 0.5px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}
.quote-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 6px 8px;
  border-left: 3px solid var(--accent);
  border-radius: 5px;
  background: var(--accent-soft);
}
.quote-preview-content { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 2px; font-size: 12px; }
.quote-preview-content b { color: var(--accent); }
.quote-preview-content span { color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.quote-cancel { flex: none; border: 0; background: transparent; color: var(--muted); font-size: 21px; width: 32px; height: 32px; }
.langrow {
  display: flex;
  align-items: center;
  gap: 6px;
}
.langrow .mini { width: auto; min-width: 0; flex: 1; padding: 7px 8px; font-size: 16px; border-radius: 8px; }
.mini-btn { padding: 7px 9px; min-height: 40px; font-size: 16px; }
.paste-image-button { width: 100%; min-height: 40px; margin-top: 8px; }
.state { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--hint); text-align: right; }

.inputrow { display: flex; gap: 7px; align-items: flex-end; }
.inputrow.file-drag-over #input { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
#input { flex: 1; min-width: 0; resize: none; max-height: 120px; border-radius: 12px; font-size: 16px; }
.voice-draft { box-sizing: border-box; display: flex; align-items: center; flex: 1; gap: 7px; min-width: 0; height: 44px; padding: 3px 6px 3px 10px; border: 1px solid var(--accent); border-radius: 12px; background: var(--surface); }
.voice-live-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #e04e4e; animation: voice-pulse 1.1s ease-in-out infinite; }
@keyframes voice-pulse { 50% { opacity: .3; } }
#voice-wave { display: block; flex: 1; width: 100%; min-width: 0; height: 36px; }
#voice-time { flex: none; min-width: 2.5em; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
#voice-cancel { flex: none; width: 32px; height: 32px; padding: 0; border: 0; color: var(--muted); font-size: 25px; line-height: 1; }
.voice-toggle[aria-pressed="true"] { color: #d33; background: color-mix(in srgb, #d33 12%, transparent); }
.composer-toggle, .send { flex: none; display: grid; place-items: center; width: 42px; height: 44px; padding: 0; border-radius: 12px; }
.composer-toggle { color: var(--accent); font-size: 27px; font-weight: 300; line-height: 1; }
.send svg { width: 21px; height: 21px; }
#send-btn { touch-action: manipulation; }
#send-btn svg { pointer-events: none; }
@media (pointer: coarse), (max-width: 700px) {
  #send-btn { box-sizing: border-box; width: 52px; height: 48px; min-width: 52px; min-height: 48px; align-self: flex-end; }
}
.toolrow { display: flex; align-items: center; gap: 4px; min-height: 40px; margin-top: 1px; }
.toolrow > button { display: grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; border-radius: 10px; color: var(--muted); }
.toolrow > button svg { width: 21px; height: 21px; }
@media (max-width: 360px) { #view-chat .toolrow { gap: 2px; } }
.toolrow > button:hover, .toolrow > button[aria-expanded="true"] { color: var(--accent); background: var(--accent-soft); }
.toolrow > button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.toolrow > button:disabled { opacity: 0.45; }
.advisor-header { display: flex; align-items: center; gap: 10px; min-width: 0; }
.advisor-header-copy { min-width: 0; }
.advisor-header-copy h2, .advisor-header-copy p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.advisor-thread { background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 78%, #eef8fc), var(--bg)); }
.advisor-thread .row.peer { max-width: min(94%, 42rem); }
.advisor-thread .row.self { max-width: min(82%, 36rem); margin-block: 2px 8px; }
.advisor-thread .row.self .advisor-bubble { background: color-mix(in srgb, var(--accent-soft) 78%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 22%, var(--line)); }
.advisor-pending-group { display: contents; }
.advisor-agent-row { flex-direction: row; align-items: flex-end; gap: 7px; margin-block-end: 10px; }
.advisor-agent-row .advisor-bubble { min-width: 0; }
.advisor-bubble { font-size: 15px; line-height: 1.55; }
.advisor-answer-bubble, .advisor-pending-bubble { flex: 1; max-width: min(calc(100% - 41px), 38rem); white-space: normal; box-shadow: 0 4px 14px rgb(28 69 91 / 7%); }
.advisor-question-bubble { white-space: pre-wrap; }
.advisor-answer-label { display: block; margin-block-end: 4px; color: var(--accent); font-size: 11px; font-weight: 650; }
.advisor-answer-label::before { content: "✦"; margin-inline-end: 5px; color: #e9935c; }
.advisor-answer-text { display: block; white-space: pre-wrap; }
.advisor-markdown { white-space: normal; overflow-wrap: anywhere; min-width: 0; }
.advisor-markdown > :first-child { margin-top: 0; }
.advisor-markdown > :last-child { margin-bottom: 0; }
.advisor-markdown p, .advisor-markdown blockquote { white-space: pre-wrap; }
.advisor-markdown p, .advisor-markdown ul, .advisor-markdown ol, .advisor-markdown pre { margin: .6em 0; }
.advisor-markdown h3, .advisor-markdown h4, .advisor-markdown h5, .advisor-markdown h6 { font-size: 1em; line-height: 1.5; margin: .85em 0 .35em; font-weight: 700; }
.advisor-markdown h3 { font-size: 1.12em; }
.advisor-markdown ul, .advisor-markdown ol { padding-inline-start: 1.6em; }
.advisor-markdown li { margin: .25em 0; white-space: pre-wrap; }
.advisor-markdown blockquote { margin: .6em 0; padding-inline-start: .8em; border-inline-start: 3px solid currentColor; opacity: .8; }
.advisor-markdown code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; background: rgba(127,127,127,.12); border-radius: 4px; padding: .1em .3em; }
.advisor-markdown pre { max-width: 100%; overflow-x: auto; white-space: pre; padding: .75em; border-radius: 8px; background: rgba(127,127,127,.1); }
.advisor-markdown pre code { padding: 0; background: none; }
.advisor-markdown a { color: inherit; text-decoration: underline; text-underline-offset: .15em; }
.advisor-markdown hr { border: 0; border-top: 1px solid rgba(127,127,127,.3); margin: .9em 0; }
.advisor-message-time { position: absolute; inset-block-start: -7px; inset-inline-end: 9px; padding-inline: 3px; border-radius: 3px; background: inherit; color: var(--hint); font-size: 10px; line-height: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.advisor-bot { position: relative; display: grid; place-items: center; width: 34px; height: 32px; flex: none; border: 2px solid #5f8ca6; border-radius: 13px 13px 15px 15px; background: linear-gradient(145deg,#fff,#ccecf8); box-shadow: 0 5px 12px rgb(71 118 143 / 16%); transform-origin: 50% 100%; }
.advisor-bot::before { content: ""; position: absolute; inset-block-start: -8px; inset-inline-start: calc(50% - 1px); width: 2px; height: 7px; background: #5f8ca6; }
.advisor-bot::after { content: ""; position: absolute; inset-block-start: -12px; inset-inline-start: calc(50% - 4px); width: 8px; height: 8px; border-radius: 50%; background: #ffc573; box-shadow: 0 0 0 3px #fff3dd; }
.advisor-bot-eyes { display: flex; gap: 7px; margin-block-start: -4px; }
.advisor-bot-eyes i { width: 4px; height: 6px; border-radius: 4px; background: #315c74; transform-origin: center; }
.advisor-bot-mouth { position: absolute; inset-inline-start: calc(50% - 4px); inset-block-start: 21px; width: 8px; height: 4px; border-block-end: 2px solid #d47f89; border-radius: 50%; }
.advisor-bot-cheek { position: absolute; inset-block-start: 18px; width: 4px; height: 2px; border-radius: 999px; background: #f6b0b4; opacity: .75; }
.advisor-bot-cheek.left { inset-inline-start: 5px; }.advisor-bot-cheek.right { inset-inline-end: 5px; }
.advisor-bot.is-thinking { animation: advisor-think 1.1s ease-in-out infinite; }
.advisor-bot.is-sad .advisor-bot-mouth { inset-block-start: 24px; border-block-start: 2px solid #d47f89; border-block-end: 0; }
.advisor-bot-header { width: 38px; height: 36px; border-radius: 14px 14px 16px 16px; }
.advisor-bot-header, .advisor-bot-large { animation: advisor-breathe 3.6s ease-in-out infinite; }
.advisor-bot-header .advisor-bot-eyes i, .advisor-bot-large .advisor-bot-eyes i { animation: advisor-blink 4.4s infinite; }
.advisor-bot-header .advisor-bot-mouth { inset-block-start: 24px; }
.advisor-bot-header .advisor-bot-cheek { inset-block-start: 21px; }

.advisor-empty { display: grid; justify-items: center; align-content: center; gap: 14px; width: min(100%, 34rem); min-height: 100%; margin: auto; padding: 24px 12px; }
.advisor-empty .advisor-hint { max-width: 30rem; margin: 4px 0; color: var(--muted); font-size: 14px; line-height: 1.65; text-align: center; }
.advisor-bot-large { width: 82px; height: 74px; border-width: 3px; border-radius: 28px 28px 32px 32px; box-shadow: 0 15px 28px rgb(71 118 143 / 18%); }
.advisor-bot-large::before { inset-block-start: -15px; width: 3px; height: 13px; }.advisor-bot-large::after { inset-block-start: -22px; inset-inline-start: calc(50% - 7px); width: 14px; height: 14px; box-shadow: 0 0 0 5px #fff3dd; }
.advisor-bot-large .advisor-bot-eyes { gap: 17px; margin-block-start: -9px; }.advisor-bot-large .advisor-bot-eyes i { width: 8px; height: 12px; }
.advisor-bot-large .advisor-bot-mouth { inset-inline-start: calc(50% - 9px); inset-block-start: 51px; width: 18px; height: 7px; border-block-end-width: 3px; }
.advisor-bot-large .advisor-bot-cheek { inset-block-start: 44px; width: 9px; height: 4px; }.advisor-bot-large .advisor-bot-cheek.left { inset-inline-start: 13px; }.advisor-bot-large .advisor-bot-cheek.right { inset-inline-end: 13px; }
.advisor-quick-prompts { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; width: 100%; }
.advisor-quick-prompt { min-height: 40px; max-width: 100%; padding: 7px 11px; border-color: var(--line) !important; border-radius: 999px; background: color-mix(in srgb, var(--surface) 92%, transparent) !important; font-size: 12px; overflow-wrap: anywhere; }

.advisor-evidence { margin-block-start: 9px; padding-block-start: 7px; border-block-start: 0.5px dashed var(--line); }
.advisor-evidence summary { min-height: 30px; padding-block: 5px; color: var(--accent); font-size: 12px; cursor: pointer; list-style: none; }
.advisor-evidence summary::-webkit-details-marker { display: none; }
.advisor-evidence summary::after { content: "▾"; margin-inline-start: 5px; font-size: 10px; }
.advisor-evidence[open] summary::after { content: "▴"; }
.advisor-evidence-body { display: grid; gap: 7px; padding: 8px; border-radius: 10px; background: var(--bg); }
.advisor-evidence-title { color: var(--muted); font-size: 11px; font-weight: 600; }
.advisor-evidence-item { display: grid; gap: 2px; padding-inline-start: 8px; border-inline-start: 2px solid color-mix(in srgb, var(--accent) 45%, var(--line)); }
.advisor-evidence-meta { color: var(--hint); font-size: 10px; font-variant-numeric: tabular-nums; }
.advisor-evidence-text { color: var(--muted); font-size: 12px; white-space: pre-wrap; }

.advisor-pending-bubble { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; }
.advisor-thinking-dots { display: inline-flex; gap: 4px; flex: none; }
.advisor-thinking-dot { width: 5px; height: 5px; border-radius: 50%; background: #6f98ad; animation: advisor-dot 1s ease-in-out infinite; }
.advisor-thinking-dot:nth-child(2) { animation-delay: .15s; }.advisor-thinking-dot:nth-child(3) { animation-delay: .3s; }
.advisor-failed .advisor-pending-bubble { flex-wrap: wrap; border-color: color-mix(in srgb, var(--danger) 30%, var(--line)); }
.advisor-failed-text { flex: 1; min-width: 12rem; color: var(--danger); }
.advisor-retry { min-width: 68px; min-height: 40px; margin-inline-start: auto; color: var(--danger) !important; }

.advisor-rules { flex: none; border-bottom: 0.5px solid #eadfce; background: color-mix(in srgb, var(--surface) 88%, #fff2df); padding: 0 12px; }
.advisor-health-data {
  display: flex; flex: none; flex-wrap: wrap; align-items: center; gap: 4px 12px;
  padding: 8px 12px; color: var(--text); background: var(--surface); border-bottom: 1px solid var(--line);
}
.advisor-health-data[hidden] { display: none; }
.advisor-health-data-copy { flex: 1 1 225px; min-width: 0; font-size: 13px; overflow-wrap: anywhere; }
.advisor-health-data-copy p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
#advisor-health-data-status:empty { display: none; }
#advisor-health-data-toggle { flex: none; min-height: 36px; max-width: 100%; overflow-wrap: anywhere; }
.advisor-rules summary { display: flex; align-items: center; min-height: 40px; color: #8a5c3c; font-size: 13px; cursor: pointer; }
.advisor-rule-list { display: grid; gap: 7px; max-height: min(28dvh, 240px); overflow-y: auto; padding: 0 0 9px; }
.advisor-rule-empty { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; }
.advisor-rule-item { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 7px 9px; border-radius: 9px; background: var(--bg); }
.advisor-rule-body { display: grid; gap: 3px; flex: 1; min-width: 0; }
.advisor-rule-meta { color: var(--muted); font-size: 11px; }
.advisor-rule-text { font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.advisor-rule-delete { flex: none; min-height: 36px; font-size: 12px; }
.advisor-composer { padding-top: 8px; }
.advisor-composer #advisor-input { flex: 1; min-width: 0; resize: none; max-height: 120px; border-radius: 12px; font-size: 16px; }
.advisor-composer #advisor-more { width: 100%; min-height: 36px; margin-bottom: 6px; }
.advisor-status { min-height: 0; margin: 0 2px 5px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.advisor-status:empty { display: none; }
.advisor-feedback-offer { display: grid; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; overflow-wrap: anywhere; }
.advisor-feedback-offer p { margin: 0; }
.advisor-feedback-offer-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.advisor-feedback-offer-actions button { min-height: 44px; }
.advisor-reference { display: flex; align-items: flex-start; gap: 4px; min-width: 0; margin-bottom: 8px; padding: 6px 8px; border-inline-start: 3px solid var(--accent); border-radius: 8px; background: var(--accent-soft); font-size: 12px; }
.advisor-reference-details { flex: 1; min-width: 0; }
.advisor-reference-details summary { cursor: pointer; color: var(--text); overflow-wrap: anywhere; }
.advisor-reference-details summary b { color: var(--accent); }
.advisor-reference-excerpt { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted); }
.advisor-reference-body { max-height: min(25dvh, 180px); margin-top: 7px; overflow-y: auto; overscroll-behavior: contain; }
.advisor-reference-section { display: grid; gap: 3px; margin-bottom: 7px; white-space: pre-wrap; overflow-wrap: anywhere; }
.advisor-reference-section b { color: var(--muted); font-weight: 500; }
.advisor-reference-cancel { flex: none; min-width: 36px; min-height: 36px; padding: 3px; font-size: 20px; }
@keyframes advisor-breathe { 50% { transform: translateY(-1px) scale(1.025); } }
@keyframes advisor-blink { 0%,46%,50%,100% { transform: scaleY(1); } 48% { transform: scaleY(.08); } }
@keyframes advisor-think { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-5px) rotate(4deg); } }
@keyframes advisor-dot { 0%,100% { transform: translateY(0); opacity: .3; } 50% { transform: translateY(-4px); opacity: 1; } }
@media (max-width: 420px) {
  .advisor-thread { padding-inline: 9px; }
  .advisor-thread .row.peer { max-width: 98%; }
  .advisor-thread .row.self { max-width: 86%; }
  .advisor-agent-row { gap: 6px; }
  .advisor-answer-bubble, .advisor-pending-bubble { max-width: calc(100% - 40px); }
  .advisor-header { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .advisor-bot, .advisor-bot-eyes i, .advisor-thinking-dot { animation: none !important; }
}
.image-storage { margin: 8px 2px 0; color: var(--hint); font-size: 11px; line-height: 1.3; }
.image-storage:empty, .image-warning:empty { display: none; }
.image-warning { margin: 4px 2px 0; color: var(--warn); font-size: 12px; line-height: 1.35; }
.emoji-picker {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: min(80dvh, 340px);
  overflow: hidden;
  margin-bottom: 7px;
  border: 0.5px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.emoji-tabs { display: flex; align-items: center; gap: 3px; flex: none; padding: 3px 5px; border-bottom: 0.5px solid var(--line); }
.emoji-tabs button { border: 0; background: transparent; color: var(--muted); min-height: 32px; padding: 3px 10px; font-size: 13px; }
.emoji-tabs [role="tab"][aria-selected="true"] { color: var(--accent); font-weight: 600; box-shadow: inset 0 -2px var(--accent); }
.emoji-tabs #sticker-manage { margin-left: auto; color: var(--accent); }
.emoji-default-view { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.emoji-categories { display: flex; flex: none; gap: 2px; padding: 3px 5px; overflow-x: auto; scrollbar-width: none; border-bottom: 0.5px solid var(--line); }
.emoji-categories::-webkit-scrollbar { display: none; }
.emoji-categories button { display: grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: transparent; font-size: 20px; }
.emoji-categories button[aria-pressed="true"] { background: var(--accent-soft); }
.emoji-categories button:focus-visible, .emoji-pages button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.emoji-swipe-viewport { position: relative; flex: none; height: 190px; overflow: hidden; touch-action: pan-y; --emoji-drag-x: 0px; }
.emoji-pages { display: flex; align-items: center; justify-content: center; flex: none; gap: 12px; min-height: 34px; border-top: 0.5px solid var(--line); }
.emoji-pages button { width: 40px; height: 32px; padding: 0; border: 0; color: var(--accent); font-size: 27px; line-height: 1; }
.emoji-pages button:disabled { color: var(--hint); opacity: .45; }
.emoji-pages span { min-width: 4em; text-align: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.emoji-grid, .sticker-grid { display: grid; gap: 2px; min-height: 0; overflow-y: auto; padding: 4px; }
.emoji-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (min-width: 600px) { .emoji-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
.emoji-grid { position: absolute; inset: 0; width: 100%; height: 190px; box-sizing: border-box; grid-auto-rows: 44px; overflow: hidden; touch-action: pan-y; will-change: transform; }
#emoji-prev-panel { transform: translate3d(calc(var(--emoji-drag-x) - 100%), 0, 0); }
#emoji-default-panel { transform: translate3d(var(--emoji-drag-x), 0, 0); }
#emoji-next-panel { transform: translate3d(calc(var(--emoji-drag-x) + 100%), 0, 0); }
.emoji-swipe-viewport.is-settling .emoji-grid { transition: transform 220ms ease-out; }
.emoji-ghost { pointer-events: none; }
.sticker-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.emoji-grid button, .sticker-grid button {
  min-width: 0;
  min-height: 44px;
  padding: 3px;
  border: 0;
  background: transparent;
}
.emoji-grid button {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 24px;
  line-height: 1;
}
.sticker-panel { display: flex; flex-direction: column; min-height: 0; }
.sticker-grid button { position: relative; height: 54px; border-radius: 8px; }
.sticker-grid button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sticker-grid img { width: 100%; height: 100%; object-fit: contain; }
.sticker-grid .sticker-add { border: 1px dashed var(--line); color: var(--accent); font-size: 27px; line-height: 1; }
.sticker-grid .sticker-remove::after { content: "×"; position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: var(--danger); color: white; font: 16px/1 sans-serif; }
.sticker-status { margin: 0; padding: 3px 8px 5px; color: var(--warn); font-size: 12px; }
.sticker-status:empty { display: none; }

/* ---------- 说明弹层 ---------- */

.sheet {
  position: absolute;
  top: var(--app-top, 0px);
  left: 0;
  right: 0;
  height: var(--app-height, 100dvh);
  background: rgba(0, 0, 0, 0.35);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 40;
}
.sheet-box {
  background: var(--surface);
  border-radius: 16px;
  padding: 20px;
  max-width: 380px;
}
.sheet-box h3 { margin: 0 0 10px; font-size: 16px; font-weight: 500; }
.sheet-box p, .sheet-box li { font-size: 14px; color: var(--text); }
.sheet-box ol { padding-inline-start: 20px; }
.sheet-box .primary { width: 100%; margin-top: 14px; }
#web-install-help {
  box-sizing: border-box;
  width: min(380px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  border: 1px solid var(--line);
  color: var(--text);
  overflow: auto;
}
#web-install-help::backdrop { background: rgba(0, 0, 0, 0.35); }
#web-install-help button { width: 100%; min-height: 44px; margin-top: 8px; }
#view-login:not([data-auth-mode="login"]) #login-install-btn { display: none; }
.web-install-notice {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin: 8px 12px 0;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--text);
}
.web-install-notice strong { flex: 1 1 12rem; font-size: 14px; }
.web-install-notice button { min-height: 40px; white-space: normal; }
.translation-feedback-box { width: min(520px, calc(100vw - 28px)); max-height: calc(100dvh - 32px); overflow: auto; }
.translation-feedback-box label { display: block; margin: 12px 0 5px; color: var(--muted); font-size: 13px; }
.feedback-preview { padding: 10px 12px; border-radius: 10px; background: var(--surface, #f5f4f1); white-space: pre-wrap; overflow-wrap: anywhere; }
.translation-feedback-box textarea { box-sizing: border-box; width: 100%; min-height: 92px; resize: vertical; }
.feedback-buttons { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.feedback-buttons .primary { width: auto; margin-top: 0; }
.feedback-choice-buttons { display: grid; gap: 8px; margin-top: 14px; }
.feedback-choice-buttons .primary { margin-top: 0; }
.translation-feedback-action { color: var(--accent); }
.remark-editor-box { display: grid; gap: 8px; width: min(380px, 100%); }
.remark-editor-box > label { color: var(--muted); font-size: 13px; }
.remark-editor-box input { width: 100%; }
.remark-editor-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.remark-editor-actions button { min-height: 42px; }
.remark-editor-actions .primary { width: auto; margin-top: 0; }
#media-forward { z-index: 48; }
.login-captcha-picture { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.login-captcha-picture img { width: 210px; max-width: 100%; height: 72px; object-fit: contain; border-radius: 8px; background: white; }
.login-captcha-picture button { min-height: 42px; }
.login-captcha input { text-transform: uppercase; letter-spacing: .14em; }
.media-forward-box { display: flex; flex-direction: column; width: min(420px, 100%); max-height: min(78dvh, 620px); min-height: 0; }
.media-forward-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.media-forward-title-row h3 { margin: 0; }
.media-forward-title-row button { flex: none; min-height: 38px; }
.media-forward-hint { margin: 7px 0 12px; color: var(--muted) !important; font-size: 12px !important; }
.media-forward-list { min-height: 0; margin: 0; padding: 0; overflow-y: auto; list-style: none; border-block: 0.5px solid var(--line); }
.media-forward-list li { margin: 0; padding: 0; }
.media-forward-recipient { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 8px 4px; border: 0; border-bottom: 0.5px solid var(--line); border-radius: 0; background: transparent; color: var(--text); text-align: start; }
.media-forward-list li:last-child .media-forward-recipient { border-bottom: 0; }
.media-forward-recipient:hover, .media-forward-recipient:focus-visible { background: var(--accent-soft); color: var(--accent); }
.media-forward-recipient:disabled { opacity: .5; }
.media-forward-avatar { position: relative; display: grid; place-items: center; flex: none; width: 40px; height: 40px; overflow: hidden; border-radius: 50%; color: white; font-weight: 650; }
.media-forward-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-forward-name { min-width: 0; overflow: hidden; font-size: 14px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.media-forward-empty { padding: 24px 8px !important; color: var(--muted); text-align: center; }
.media-forward-box #media-forward-status { min-height: 1.25em; margin: 9px 0 0; }

/* 选择状态保留输入草稿，使用独立底栏和只读记录容器。 */
#view-chat.is-message-selecting > .composer { display: none; }
.message-selection-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); flex: none; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); border-block-start: 1px solid var(--line); background: var(--surface); color: var(--text); }
.message-selection-heading { display: flex; grid-column: 1 / -1; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.message-selection-heading strong { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.message-selection-bar button { min-width: 0; min-height: 40px; margin: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.3; }
.message-selection-status { grid-column: 1 / -1; margin: 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.message-selection-status:empty { display: none; }
.row .message-selector { display: none; }
#view-chat.is-message-selecting #msgs > .row { position: relative; align-self: stretch; width: auto; max-width: none; padding-left: 32px; box-sizing: border-box; }
#view-chat.is-message-selecting #msgs > .row > :not(.message-selector) { max-width: min(92%, 38rem); }
#view-chat.is-message-selecting .row .message-selector { position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 25px; height: 25px; min-height: 25px; padding: 0; border: 1.5px solid var(--muted); border-radius: 50%; background: var(--surface); color: var(--text); z-index: 4; }
#view-chat.is-message-selecting .row .message-selector[hidden] { display: none; }
.message-selector-tick { visibility: hidden; font-size: 15px; line-height: 1; }
.message-selector { touch-action: none; }
.message-selector[aria-checked="true"] .message-selector-tick { visibility: visible; }
#view-chat.is-message-selecting .row.is-message-selected .message-selector { border-color: var(--accent); background: var(--accent); color: white; }
#view-chat.is-message-selecting .row.is-message-selected > .bubble { outline: 2px solid var(--accent); outline-offset: 2px; }
#view-chat.is-message-selecting .row > .actions { visibility: hidden; pointer-events: none; }
#message-range-to { position: absolute; z-index: 7; right: 12px; margin: 0; min-height: 36px; max-width: calc(100% - 48px); background: var(--surface); color: var(--accent); border: 1px solid var(--accent); box-shadow: 0 2px 5px #0003; overflow-wrap: anywhere; }
#message-range-to[hidden], #message-forward-limit[hidden] { display: none; }
#view-chat.is-message-selecting .row.is-range-endpoint > .bubble { outline: 1px dashed var(--accent); outline-offset: 2px; }
.message-forward-menu { max-width: calc(100vw - 16px); min-width: min(220px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); overflow: auto; }
#message-menu-actions { display: contents; }
.message-forward-menu button { white-space: normal; overflow-wrap: anywhere; }
.message-forward-menu button[hidden] { display: none; }
.message-forward-box { display: flex; flex-direction: column; width: min(420px, 100%); max-width: 420px; max-height: min(84dvh, 650px); min-height: 0; box-sizing: border-box; }
.message-forward-heading, .forward-record-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: none; }
.message-forward-heading h3, .forward-record-heading h3 { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.message-forward-heading button, .forward-record-heading button { flex: none; min-height: 38px; padding: 6px 8px; }
.message-forward-mode, .forward-record-count { margin: 6px 0 10px; font-size: 12px !important; color: var(--muted) !important; overflow-wrap: anywhere; }
.message-forward-box input { width: 100%; flex: none; min-width: 0; margin-block-end: 10px; box-sizing: border-box; }
.message-forward-recipients { flex: 1; min-height: 0; margin: 0; padding: 0; overflow-y: auto; overscroll-behavior: contain; list-style: none; border-block: 1px solid var(--line); }
.message-forward-recipient { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 8px 4px; border: 0; border-radius: 0; border-block-end: 1px solid var(--line); background: transparent; color: var(--text); text-align: start; }
.message-forward-recipient:hover, .message-forward-recipient:focus-visible, .message-forward-recipient.is-recipient-selected { background: var(--accent-soft); color: var(--text); }
.message-forward-avatar, .forward-record-avatar { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; color: white; font-size: 15px; font-weight: 600; }
.message-forward-recipient-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.message-forward-recipient-check { flex: none; width: 20px; color: var(--accent); }
.message-forward-empty { padding: 22px 8px; text-align: center; color: var(--muted) !important; }
.message-forward-box #message-forward-status { min-height: 1.3em; margin: 8px 0 0; overflow-wrap: anywhere; }
.message-forward-box > .primary { flex: none; margin-top: 8px; }
.forward-history-card { display: block; width: 280px; max-width: 100%; min-width: 0; padding: 11px 12px 0; overflow: hidden; box-sizing: border-box; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); text-align: start; white-space: normal; }
.forward-history-title { display: block; margin-block-end: 7px; font-size: 15px; font-weight: 600; }
.forward-history-preview { display: grid; gap: 4px; }
.forward-history-excerpt { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; }
.forward-history-footer { display: block; margin-top: 9px; padding: 7px 0; border-block-start: 1px solid var(--line); color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.forward-history-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.forward-record-sheet { z-index: 45; }
.forward-record-box { display: flex; flex-direction: column; width: min(660px, 100%); max-width: 660px; height: min(88dvh, 860px); min-height: 0; padding: 14px; box-sizing: border-box; }
.forward-record-heading h3 { flex: 1; }
.forward-record-list { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 16px; padding: 12px 4px; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.forward-record-row { width: fit-content; max-width: 90%; min-width: 0; }
.forward-record-row.author-b { align-self: flex-end; }
.forward-record-author { display: flex; flex-wrap: nowrap; align-items: center; gap: 5px; margin-block-end: 5px; color: var(--muted); }
.forward-record-avatar { flex-shrink: 0; width: 23px; height: 23px; font-size: 11px; }
.forward-record-author-name { min-width: 0; max-width: calc(100% - 30px); font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.forward-record-time { flex: none; white-space: nowrap; font-size: 10px; color: var(--muted); }
.forward-record-content { padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); overflow-wrap: anywhere; }
.forward-record-row.author-b .forward-record-content { background: var(--accent-soft); }
.forward-record-text, .forward-record-original { white-space: pre-wrap; font-size: 14px; line-height: 1.55; }
.forward-record-original { margin-block-start: 7px; padding-block-start: 7px; border-block-start: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.forward-record-paragraph + .forward-record-paragraph { margin-block-start: 12px; padding-block-start: 12px; border-block-start: 1px solid var(--line); }
.forward-record-status { margin-block-start: 5px; color: var(--muted); font-size: 12px; }
.forward-record-retry { margin-block-start: 8px; }
.forward-record-image, .forward-record-video { display: block; width: auto; max-width: min(100%, 320px); max-height: 400px; object-fit: contain; border-radius: 5px; }
.forward-record-image[hidden] { display: none; }
.forward-record-audio { display: block; max-width: 100%; width: 280px; }
.forward-record-file { display: block; color: var(--accent); overflow-wrap: anywhere; }
.forward-record-unavailable, .forward-record-empty { color: var(--muted); font-size: 13px; }
.forward-record-content > .forward-history-card { margin: -2px; }
html[data-theme="cli"] #view-chat.is-message-selecting #msgs > .row > :not(.message-selector) { max-width: min(100%, 58rem); }
html[data-theme="cli"] .message-selection-bar, html[data-theme="cli"] .message-forward-box, html[data-theme="cli"] .forward-record-box, html[data-theme="cli"] .forward-history-card, html[data-theme="cli"] .forward-record-content { border-radius: 0; font-family: var(--mono, monospace); }
html[data-theme="cli"] .message-forward-avatar, html[data-theme="cli"] .forward-record-avatar { border-radius: 2px; }
html[data-theme="eva"] .forward-history-card, html[data-theme="eva"] .forward-record-content, html[data-theme="eva"] .message-forward-box, html[data-theme="eva"] .forward-record-box { border-radius: 2px; }
html[data-theme="sanctuary"] .forward-history-card, html[data-theme="sanctuary"] .forward-record-content { border-color: var(--sanctuary-gold, var(--line)); }
html[data-theme="memo"] .forward-history-card { border-radius: 10px 10px 4px 10px; }
html[data-theme="strawberry"] .forward-history-card { border-radius: 14px; }
@media (max-width: 420px) {
  #message-forward-sheet, #forward-record-sheet { padding: 10px; }
  .message-forward-box { padding: 14px; }
  .forward-record-box { height: calc(var(--app-height, 100dvh) - 20px); padding: 12px; }
  .forward-record-row { max-width: 96%; }
  .forward-record-content { padding: 8px; }
  .forward-history-card { width: 245px; padding-inline: 9px; }
  .forward-record-heading { gap: 4px; }
  .forward-record-heading button { max-width: 85px; white-space: normal; overflow-wrap: anywhere; }
}

.paste-image-box { width: min(560px, 100%); max-width: none; max-height: min(86dvh, 720px); display: flex; flex-direction: column; min-height: 0; }
.paste-image-frame { min-height: 0; display: grid; place-items: center; overflow: hidden; background: var(--accent-soft); border-radius: 10px; }
.paste-image-frame img { display: block; max-width: 100%; max-height: min(58dvh, 560px); object-fit: contain; }
.paste-file-preview { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 18px; border-radius: 10px; background: var(--accent-soft); }
.paste-file-icon { display: grid; place-items: center; flex: none; width: 58px; height: 68px; padding: 4px; border-radius: 8px; background: var(--surface); color: var(--accent); font-size: 11px; font-weight: 700; overflow: hidden; }
.paste-file-copy { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.paste-file-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paste-file-copy span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.paste-image-box #paste-image-error { margin: 8px 0 0; color: var(--warn); }
.paste-image-box #paste-image-error:empty { display: none; }
.paste-image-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.paste-image-actions button { min-width: 100px; min-height: 44px; }
.paste-image-actions .primary { width: auto; margin-top: 0; }

#image-viewer {
  background: #000;
  padding-top: max(28px, calc(env(safe-area-inset-top, 0px) - var(--app-top, 0px) + 8px));
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  z-index: 45;
}
.image-viewer-box { position: relative; width: min(100%, 1100px); height: 100%; display: grid; place-items: center; min-height: 0; overflow: hidden; }
.image-viewer-close { position: absolute; top: 0; right: 0; z-index: 4; touch-action: manipulation; width: 44px; height: 44px; border: 0; border-radius: 50%; color: white; font-size: 30px; line-height: 1; cursor: pointer; }
/* 媒体预览图标保留白色，细黑边让白色、深色和复杂画面上都能辨认。 */
#image-viewer .image-viewer-close,
#image-viewer .image-viewer-nav,
#image-viewer-zoom-out,
#image-viewer-zoom-in {
  color: #fff;
  text-shadow: -0.75px -0.75px 0 #000, 0 -0.75px 0 #000, 0.75px -0.75px 0 #000,
    -0.75px 0 0 #000, 0.75px 0 0 #000,
    -0.75px 0.75px 0 #000, 0 0.75px 0 #000, 0.75px 0.75px 0 #000;
}
/* 透明底和居中布局不受普通按钮及主题背景影响，保留原有点击区域。 */
.image-viewer-close,
.image-viewer-nav {
  display: flex;
  align-items: center;
  justify-content: center;
}
#image-viewer .image-viewer-close,
#image-viewer .image-viewer-nav {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.image-viewer-stage { width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; touch-action: none; overscroll-behavior: contain; user-select: none; -webkit-user-select: none; }
.image-viewer-stage.is-image-zoomed { cursor: grab; }
.image-viewer-stage.is-image-dragging { cursor: grabbing; }
.image-viewer-photo, .image-viewer-video { grid-area: 1 / 1; display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; transform: translate3d(0, 0, 0) scale(1); transform-origin: center; will-change: transform; }
.image-viewer-video { background: black; }
.image-viewer-nav { position: absolute; top: 50%; z-index: 3; width: 44px; height: 56px; transform: translateY(-50%); border: 0; border-radius: 999px; color: white; font-size: 38px; line-height: 1; cursor: pointer; }
.image-viewer-nav:disabled { opacity: 0.2; cursor: default; }
.image-viewer-prev { left: 8px; }
.image-viewer-next { right: 8px; }
.image-viewer-count { position: absolute; left: 50%; top: 12px; z-index: 2; transform: translateX(-50%); padding: 4px 9px; border-radius: 999px; background: rgba(0, 0, 0, 0.56); color: white; font-size: 12px; }
.image-viewer-toolbar { position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 3; transform: translateX(-50%); display: flex; align-items: center; justify-content: center; flex-wrap: wrap; width: max-content; max-width: calc(100% - 24px); gap: 8px; }
.image-viewer-toolbar button { min-width: 44px; height: 42px; padding: 0 12px; border: 0; background: rgba(20, 20, 20, 0.78); color: white; cursor: pointer; }
.image-viewer-toolbar button:disabled { opacity: 0.38; cursor: default; }
.image-viewer-original { border-radius: 999px !important; white-space: nowrap; }
.image-viewer-translation-notice { flex-basis: 100%; text-align: center; color: white; font-size: 12px; overflow-wrap: anywhere; }
.image-viewer.is-translated .image-viewer-box { grid-template-rows: minmax(0, 1fr) auto; }
.image-viewer.is-translated .image-viewer-stage { grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
.image-viewer.is-translated .image-viewer-toolbar { position: static; transform: none; margin-bottom: max(14px, env(safe-area-inset-bottom)); }
.image-viewer.is-profile-avatar .image-viewer-nav,
.image-viewer.is-profile-avatar .image-viewer-count,
.image-viewer.is-profile-avatar .image-viewer-original { display: none; }
.image-viewer-zoom { display: flex; overflow: hidden; border-radius: 999px; background: rgba(20, 20, 20, 0.78); }
.image-viewer-zoom button { border-radius: 0; background: transparent; font-size: 20px; }
.image-viewer-zoom #image-viewer-zoom-reset { min-width: 58px; padding: 0 8px; border-right: 1px solid rgba(255, 255, 255, 0.16); border-left: 1px solid rgba(255, 255, 255, 0.16); font-size: 12px; }
.image-viewer-progress { position: absolute; left: 50%; bottom: max(70px, calc(env(safe-area-inset-bottom) + 58px)); z-index: 4; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; max-width: calc(100% - 20px); padding: 8px 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.72); color: white; font-size: 12px; white-space: nowrap; }
.image-viewer-ring { --download-progress: 0%; position: relative; display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: conic-gradient(var(--accent) var(--download-progress), rgba(255, 255, 255, 0.3) 0); font-size: 10px; }
.image-viewer-ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #1b1b1b; }
.image-viewer-ring.is-indeterminate { background: none; border: 3px solid rgba(255, 255, 255, 0.3); border-right-color: var(--accent); animation: translation-spin 0.8s linear infinite; }
.image-viewer-ring.is-indeterminate::before { display: none; }
.image-viewer-ring span { position: relative; z-index: 1; }
#image-viewer-retry { color: white; background: transparent; border: 1px solid currentColor; border-radius: 6px; padding: 5px 8px; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .image-upload-badge::before, .image-viewer-ring.is-indeterminate { animation-duration: 2s; } }
.file-viewer { z-index: 46; padding: 0; background: var(--surface); }
.file-viewer-box { display: flex; flex-direction: column; width: 100%; max-width: 100%; height: 100%; min-width: 0; min-height: 0; background: var(--surface); }
.file-viewer-bar { display: flex; align-items: center; gap: 8px; flex: none; min-height: 52px; padding: env(safe-area-inset-top) 10px 0; border-bottom: 0.5px solid var(--line); background: var(--surface); }
.file-viewer-bar strong { flex: 1; min-width: 0; overflow: hidden; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.file-viewer-close { flex: none; width: 42px; height: 42px; padding: 0; color: var(--accent); font-size: 24px; }
.file-viewer-save { flex: none; min-width: 42px; padding: 9px 8px; color: var(--accent); font-size: 12px; text-align: center; text-decoration: none; }
.file-viewer-frame { flex: 1; width: 100%; min-height: 0; border: 0; background: #fff; }
.file-viewer-text { flex: 1; width: 100%; min-width: 0; min-height: 0; box-sizing: border-box; margin: 0; padding: 16px; overflow: auto; overscroll-behavior: contain; white-space: pre-wrap; overflow-wrap: anywhere; background: #fff; color: #111; font: 14px/1.6 ui-monospace, Consolas, monospace; -webkit-text-size-adjust: 100%; }
.file-viewer-status { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 20px 12px; }
.file-viewer-status[hidden], .file-viewer-text[hidden], .file-viewer-frame[hidden] { display: none; }
.pdf-viewer-scroller { position: relative; flex: 1; width: 100%; max-width: 100%; min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; touch-action: pan-x pan-y; background: #777; }
.pdf-viewer-pages { display: flex; flex-direction: column; align-items: center; gap: 12px; box-sizing: content-box; min-width: 100%; min-height: 100%; padding: 8px 0 40px; }
.pdf-page { flex: none; overflow: hidden; background: #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, 0.32); }
.pdf-page-canvas { display: block; }
.pdf-page-error { background: repeating-linear-gradient(135deg, #fff, #fff 10px, #f2f2f2 10px, #f2f2f2 20px); }
.pdf-viewer-status { position: sticky; z-index: 2; top: 12px; display: flex; align-items: center; gap: 8px; width: max-content; max-width: calc(100% - 24px); margin: 12px auto -48px; padding: 8px 12px; border-radius: 999px; background: rgba(20, 20, 20, 0.82); color: #fff; font-size: 13px; }
.pdf-viewer-status[hidden] { display: none; }
.pdf-viewer-status button { min-height: 32px; padding: 5px 9px; border-color: currentColor; color: inherit; }

.notification-box {
  width: min(440px, 100%);
  max-width: none;
  max-height: min(78dvh, 650px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
#notification-center { grid-template-columns: minmax(0, 1fr); }
.notification-title-row,
.notification-setting,
.notification-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.notification-title-row { margin-bottom: 14px; }
.notification-title-row h3 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.notification-title-row button { flex: none; min-height: 40px; }
.notification-setting {
  padding: 12px;
  border-radius: 12px;
  background: var(--accent-soft);
}
.notification-setting + .notification-setting { margin-top: 8px; }
.notification-setting > div { min-width: 0; overflow-wrap: anywhere; }
.notification-setting b { font-size: 14px; }
.notification-setting p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.notification-setting button { flex: none; max-width: 45%; min-height: 42px; white-space: normal; overflow-wrap: anywhere; }
.notification-setting button:disabled { opacity: 0.5; }
.notification-box h4 { margin: 18px 0 4px; font-size: 14px; font-weight: 500; }
.notification-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; min-height: 0; min-width: 0; }
.notification-list li { border-top: 0.5px solid var(--line); }
.notification-list .notification-empty { padding: 18px 4px; color: var(--muted); font-size: 14px; }
.notification-item { display: block; width: 100%; padding: 12px 4px; border: 0; text-align: start; }
.notification-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.notification-head b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 500; }
.notification-head time { flex: none; color: var(--hint); font-size: 11px; white-space: nowrap; }
.notification-preview { display: block; margin-top: 3px; color: var(--muted); font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 390px) {
  .notification-setting { flex-direction: column; align-items: stretch; gap: 8px; }
  .notification-setting button { align-self: flex-end; max-width: 100%; }
  .profile-time-zone-row { display: grid; grid-template-columns: minmax(0, 1fr); }
  .profile-time-zone-row button { justify-self: end; }
  .bar { gap: 4px; padding-inline: 8px; }
  .bar-actions button { padding-inline: 5px; font-size: 13px; }
  #view-list > .bar h2 { font-size: 13px; }
  .account-bar { gap: 5px; padding-inline: 8px; }
  .account-bar label { display: none; }
  .account-bar button { padding-inline: 6px; font-size: 13px; }
  .install-card { margin-inline: 8px; padding: 10px; gap: 8px; }
  .partner-main { gap: 8px; padding-inline: 10px; }
  .relation-list li { flex-wrap: wrap; gap: 6px; }
  .relation-list .meta { flex-basis: 100%; overflow-wrap: anywhere; }
  .state { min-width: 0; }
  .composer { padding-inline: 8px; }
  .row { max-width: 90%; }
}

/* Mandarin learning: each ruby is one unbreakable character + marked syllable. */
.pinyin-text { line-height: 2.1; overflow-wrap: anywhere; }
.pinyin-text ruby.pinyin-unit { display: inline-flex; flex-direction: column-reverse; align-items: center; vertical-align: bottom; white-space: nowrap; padding: 0 .10em; line-height: 1.3; text-indent: 0; direction: ltr; unicode-bidi: isolate; }
.pinyin-text .pinyin-unit > span { display: block; line-height: 1.3; }
.pinyin-text .pinyin-unit > rt { display: block; font-family: Arial, sans-serif; font-size: max(12px, .65em); font-weight: 400; font-style: normal; line-height: 1.45; letter-spacing: 0; text-transform: none; color: inherit; opacity: 1; text-shadow: none; text-align: center; user-select: none; -webkit-user-select: none; }
.profile-card .pinyin-setting { display: flex; align-items: center; gap: 10px; color: var(--text); }
.profile-card .pinyin-setting input { width: 20px; height: 20px; flex: 0 0 20px; margin: 0; }
.profile-card .pinyin-hint { margin: 0; font-size: 12px; line-height: 1.6; color: var(--muted); }

.pinyin-text .pinyin-group { display: inline-block; white-space: nowrap; vertical-align: bottom; }

/* A Japanese ruby can cover an entire compound word. */
.pinyin-text[lang="ja"] .pinyin-group { display: inline-flex; align-items: flex-end; max-width: 100%; }
.pinyin-text[lang="ja"] .pinyin-unit { min-width: 0; }
.pinyin-text[lang="ja"] .pinyin-unit > * { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: center; }

.local-model-routing { margin-top: 12px; }
.feature-model-routing { margin-bottom: 12px; }
.feature-model-routing > h3 { margin-top: 0; }
.model-preferred { display: grid; gap: 8px; font-weight: 600; }
.model-preferred select { width: 100%; min-width: 0; min-height: 44px; }
.model-route-overrides { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.model-route-overrides > summary { cursor: pointer; font-weight: 600; }
#model-resources, #external-models { margin-bottom: 12px; }
#model-resources > h3, #external-models > h3 { margin-top: 0; }
.model-resource { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 12px; }
.model-resource > h3 { margin: 0; font-size: 15px; }
.model-idle-controls { display: grid; grid-template-columns: minmax(0, 1fr) 78px auto; align-items: center; gap: 8px; margin-top: 12px; }
.model-idle-controls input { min-width: 0; width: 100%; }
@media (max-width: 380px) { .model-idle-controls { grid-template-columns: minmax(0, 1fr) auto; }.model-idle-controls label { grid-column: 1 / -1; } }
.codex-route-status { display: flex; align-items: center; gap: 8px; margin: 12px 0; font-weight: 600; }
.codex-route-icon { display: block; flex: 0 0 24px; width: 24px; height: 20px; }
.codex-route-status > p { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.local-model-routing label { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 8px; margin: 10px 0; }
.local-model-routing label > span { min-width: 0; overflow-wrap: anywhere; }
.local-model-routing select { min-width: 0; width: 100%; max-width: 100%; min-height: 40px; margin: 0; }
#gx10-codex-status { overflow-wrap: anywhere; font-size: 13px; color: var(--muted); }
@media (max-width: 380px) { .local-model-routing label { grid-template-columns: minmax(0, 1fr); gap: 5px; } }

html body .explanation-model.model-local,
html body .explanation-model.model-hy7b_local,
html body .explanation-model.model-desktop,
html body .explanation-model.model-codex { font-size: 12px; gap: 5px; }
html body .explanation-model.model-local > svg,
html body .explanation-model.model-hy7b_local > svg,
html body .explanation-model.model-desktop > svg,
html body .explanation-model.model-codex > svg { display: block; flex: 0 0 16px; width: 16px; height: 14px; color: inherit; }

/* Shared navigation hierarchy: themes decorate these controls without moving them. */
:root { --main-nav-height: calc(64px + env(safe-area-inset-bottom)); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
html body #view-list, html body .primary-view { padding-bottom: var(--main-nav-height); }
html body #view-advisors, html body #view-me { padding-top: env(safe-area-inset-top); }
#view-me, .me-subview, #view-advisors, #view-accounts, #view-client-downloads, #view-add-friend, #view-friends, #view-export { overflow: hidden; }
.home-list-top { position: sticky; top: 0; z-index: 8; flex: none; background: var(--surface); }
html body #view-list .home-bar { display: flex; gap: 8px; padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; min-width: 0; }
html body #view-list .home-bar::before, html body #view-list .home-bar::after { content: none; }
#contact-notices {
  display: flex; min-height: 44px; background: var(--accent-soft); color: var(--text);
  border-block-end: 1px solid var(--line);
}
#contact-notices[hidden], #contact-notice-pause[hidden] { display: none; }
#contact-notice-viewport { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
#contact-notice-viewport::-webkit-scrollbar { display: none; }
#contact-notice-track { display: flex; min-inline-size: 100%; inline-size: max-content; }
.contact-notice-item { min-height: 44px; display: flex; align-items: center; padding: 8px 12px; white-space: nowrap; font-size: 14px; }
.contact-notice-many .contact-notice-item { min-inline-size: var(--notice-page-width, 100%); }
html body button.contact-notice-item {
  background: transparent; color: inherit; border: 0; border-radius: 0; box-shadow: none;
  min-inline-size: 100%; justify-content: flex-start; text-align: start; cursor: pointer;
}
html body .contact-notice-many button.contact-notice-item { min-inline-size: var(--notice-page-width); }
html body #contact-notice-pause {
  min-inline-size: 44px; flex: none; border: 0; border-inline-start: 1px solid var(--line);
  border-radius: 0; background: transparent; color: inherit;
}
#contact-notice-pause:not([aria-pressed="true"]) .notice-resume-icon,
#contact-notice-pause[aria-pressed="true"] .notice-pause-icon { display: none; }
#contact-notices { --notice-direction: -1; }
[dir="rtl"] #contact-notices { --notice-direction: 1; }
@keyframes contact-notice-scroll {
  0%, 12% { transform: translateX(0); }
  88%, 100% { transform: translateX(calc(var(--notice-distance) * var(--notice-direction))); }
}
@media (prefers-reduced-motion: no-preference) {
  .contact-notices-moving #contact-notice-track { animation: contact-notice-scroll var(--notice-duration) linear infinite alternate; }
  .contact-notices-paused #contact-notice-track,
  #contact-notice-viewport:focus-within #contact-notice-track { animation-play-state: paused; }
}
@media (hover: hover) {
  #contact-notice-viewport:hover #contact-notice-track { animation-play-state: paused; }
}
.contact-search-box { position: relative; display: flex; align-items: center; flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.search-icon { width: 18px; height: 18px; flex: none; margin-inline-start: 12px; color: var(--muted); }
.contact-search-box input { min-width: 0; height: 42px; padding: 8px 9px; border: 0; border-radius: inherit; background: transparent; font-size: 16px; }
.contact-search-box:focus-within { border-color: var(--accent); }
.contact-search-box input::-webkit-search-cancel-button { -webkit-appearance: none; }
html body #contact-search-clear { flex: none; width: 36px; height: 40px; padding: 0; min-width: 0; border: 0; border-image: none; border-radius: 10px; background: transparent; font-size: 24px; line-height: 1; }
html body #home-add-btn { width: 44px; height: 44px; flex: 0 0 44px; padding: 0; border: 0; border-image: none; border-radius: 12px; background: transparent; color: var(--accent); font-size: 28px; line-height: 1; }
.home-requests { display: flex; align-items: center; gap: 9px; flex: none; min-height: 44px; margin: 8px 12px 0; padding: 7px 12px; text-align: start; background: var(--surface); border-color: var(--line); color: var(--text); }
.home-requests .directory-chevron { margin-inline-start: auto; }
.directory-scroll { flex: 1; min-height: 0; min-width: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px; }
.directory-intro { margin: 10px 16px 0; font-size: 13px; color: var(--muted); }
.directory-card, .directory-group { width: 100%; margin: 0 0 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.directory-group { overflow: hidden; }
html body .directory-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 52px; padding: 12px 16px; border: 0; border-image: none; border-radius: 0; clip-path: none; background: var(--surface); color: var(--text); text-align: start; font-size: 15px; box-shadow: none; }
.directory-group > .directory-row + .directory-row { border-top: .5px solid var(--line); }
html body .directory-row.directory-card { border: 1px solid var(--line); border-radius: 14px; }
.directory-row > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.directory-chevron { flex: none; color: var(--hint); font-size: 24px; line-height: 1; }
html[dir="rtl"] :is(#view-me, .me-subview) .directory-chevron { transform: scaleX(-1); }
.directory-row .unread-count { margin-inline-start: auto; }
html body .me-identity { display: flex; align-items: center; gap: 14px; padding: 18px 16px; text-align: start; color: var(--text); border-image: none; clip-path: none; }
.me-avatar { width: 56px; height: 56px; background: var(--accent); font-size: 22px; }
.me-identity-text { display: grid; flex: 1; gap: 2px; min-width: 0; }
.me-identity-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 18px; font-weight: 650; }
.me-identity-text > span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.me-subview .bar h2 { overflow-wrap: anywhere; }
#view-call-settings .rtc-settings-title { display: none; }
.language-setting { padding-block: 3px !important; }
html body .language-setting .header-language { border: 0; border-image: none; border-radius: 8px; min-width: 82px; min-height: 44px; padding: 7px 8px; background: transparent; color: var(--accent); }
#view-accounts .account-bar { flex-wrap: wrap; padding: 14px; border-radius: 14px; }
#view-accounts .account-bar label { display: block; flex-basis: 100%; }
#view-accounts .account-bar select { flex-basis: 100%; padding: 10px; }
.client-download-intro { margin: 0 4px 14px; }
.client-download-card { padding: 18px 16px; color: var(--text); }
.client-download-platform { margin: 0 0 8px; font-size: 19px; }
.client-download-version { margin: 0 0 8px; font-size: 15px; overflow-wrap: anywhere; }
.client-download-details { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 16px; font-size: 13px; color: var(--muted); }
.client-download-details > span { min-width: 0; overflow-wrap: anywhere; }
html body .client-download-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; max-width: 100%; padding: 10px 16px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-soft); color: var(--accent); text-decoration: none; font-size: 15px; text-align: center; overflow-wrap: anywhere; }
.client-download-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.client-download-status { margin: 12px 4px; }
.client-download-status:empty { display: none; }
#view-add-friend .friend-form { padding: 4px 0 12px; background: transparent; }
.friend-search-results.list { padding: 0; }
.friend-search-results .dot { min-height: 40px; padding: 0; border: 0; }
.friend-search-results .meta { overflow-wrap: anywhere; }
.friend-search-results li > button:last-child { flex: none; min-height: 44px; max-width: 45%; overflow-wrap: anywhere; }
.friends-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; flex: none; padding: 10px 12px 0; }
.friends-tabs button { min-height: 44px; padding: 8px; font-size: 13px; overflow-wrap: anywhere; }
.friends-tabs [aria-selected="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
#view-friends .relation-section { padding: 0; }
#view-friends .relation-list { max-height: none; overflow: visible; padding: 0; }
#view-friends .relation-list li { padding: 12px; }
/* A shared, open avatar cloud: each theme keeps its own colours, without cards. */
html body #view-advisors .advisor-cloud {
  --advisor-avatar-size: clamp(60px, 16vw, 72px);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  align-content: start;
  gap: 20px 12px;
  flex: 1;
  align-self: center;
  width: 100%;
  max-width: 720px;
  min-height: 0;
  margin: 0;
  padding: 24px 16px 32px;
  overflow-x: hidden;
  overflow-y: auto;
  list-style: none;
  -webkit-overflow-scrolling: touch;
}
html body #view-advisors .advisor-peer-item {
  min-width: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  animation: advisor-peer-arrive 420ms cubic-bezier(.2,.8,.2,1) both;
  animation-delay: var(--peer-delay, 0s);
}
html body #view-advisors .advisor-peer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 112px;
  margin: 0;
  padding: 5px 2px;
  border: 0;
  border-image: none;
  border-radius: 18px;
  clip-path: none;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  text-align: center;
  font-size: 14px;
  line-height: 1.3;
  transition: transform 180ms ease;
}
html body #view-advisors .advisor-peer::before,
html body #view-advisors .advisor-peer::after { content: none; }
html body #view-advisors .advisor-peer:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
html body #view-advisors .advisor-peer:active { transform: scale(.94); }
html body #view-advisors .advisor-peer .advisor-peer-avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: var(--advisor-avatar-size);
  height: var(--advisor-avatar-size);
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-image: none;
  border-radius: 50%;
  clip-path: none;
  font-size: 24px;
  line-height: 1;
  box-shadow: 0 7px 18px color-mix(in srgb, var(--text) 12%, transparent);
  animation: advisor-peer-float 5.6s ease-in-out infinite;
  animation-delay: var(--peer-float-delay, 0s);
}
html body #view-advisors .advisor-peer-avatar > img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
html body #view-advisors .advisor-peer-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  width: 100%;
  min-width: 0;
  min-height: 2.6em;
  max-height: 2.6em;
  overflow: hidden;
  overflow-wrap: anywhere;
  white-space: normal;
  font-weight: 550;
}
html body #view-advisors .advisor-peer-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 24px 0;
  color: var(--muted);
  text-align: center;
}
html body #view-advisors.hidden .advisor-peer-item,
html body #view-advisors.hidden .advisor-peer-avatar { animation-play-state: paused; }
@keyframes advisor-peer-arrive {
  from { opacity: 0; transform: translateY(12px) scale(.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes advisor-peer-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@media (min-width: 480px) {
  html body #view-advisors .advisor-cloud { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 24px 16px; padding-inline: 24px; }
}
@media (hover: hover) and (pointer: fine) {
  html body #view-advisors .advisor-peer:hover { transform: translateY(-2px) scale(1.035); }
  html body #view-advisors .advisor-peer:hover:active { transform: scale(.94); }
}
@media (prefers-reduced-motion: reduce) {
  html body #view-advisors .advisor-peer-item,
  html body #view-advisors .advisor-peer .advisor-peer-avatar { animation: none; }
  html body #view-advisors .advisor-peer { transition: none; }
}
.export-controls { flex: none; padding: 12px 12px 0; }
.export-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: none; padding: 12px 12px max(12px, env(safe-area-inset-bottom)); background: var(--surface); border-top: .5px solid var(--line); }
.export-footer > span { font-size: 13px; color: var(--muted); }
.export-footer button { min-height: 44px; max-width: 62%; overflow-wrap: anywhere; }
.export-peer-list input[type="checkbox"] { width: 20px; height: 20px; margin: 0; flex: 0 0 20px; accent-color: var(--accent); }
.export-peer-list label { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; cursor: pointer; }
.export-peer-list .meta { overflow-wrap: anywhere; }
.history-export { flex: none; max-width: 110px; min-height: 44px; padding: 6px 8px; font-size: 12px; white-space: normal; overflow-wrap: anywhere; }
.main-nav { position: absolute; inset-inline: 0; top: calc(var(--app-top, 0px) + var(--app-height, 100dvh)); transform: translateY(-100%); z-index: 20; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); min-height: var(--main-nav-height); padding: 5px max(8px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); border-top: .5px solid var(--line); background: var(--surface); }
html body .main-nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; min-height: 52px; padding: 4px 3px; border: 0; border-image: none; border-radius: 12px; clip-path: none; background: transparent; color: var(--muted); font-size: 11px; line-height: 1.3; text-align: center; box-shadow: none; }
html body .main-nav-item.active { color: var(--accent); background: var(--accent-soft); }
.main-nav-item > span:last-child { max-width: 100%; overflow-wrap: anywhere; }
.main-nav-icon { position: relative; display: block; width: 25px; height: 25px; flex: none; }
.main-nav-icon > svg { display: block; width: 25px; height: 25px; }
.main-nav-icon .unread-count { position: absolute; top: -4px; right: -9px; }
.unread-count { display: inline-grid; place-items: center; flex: none; min-width: 18px; height: 18px; padding: 0 5px; border: 0; border-radius: 999px; background: #b00020; color: #fff; font: 700 10px/1 -apple-system, BlinkMacSystemFont, sans-serif; font-variant-numeric: tabular-nums; }
.session-state { position: absolute; top: calc(var(--app-top, 0px) + env(safe-area-inset-top) + 62px); inset-inline-end: 12px; z-index: 24; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: max-content; max-width: calc(100vw - 24px); margin: 0; padding: 8px 10px; border: .5px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: 0 4px 18px rgb(0 0 0 / 8%); }
.session-state:empty { display: none; }
.session-state button { min-height: 36px; padding: 4px 8px; font-size: 12px; }
/* Keep editable controls readable without mobile browser focus zoom, in every theme. */
@media (max-width: 900px), (pointer: coarse) {
  html body input,
  html body select,
  html body textarea,
  html body [contenteditable]:not([contenteditable="false"]) { font-size: max(16px, 1rem) !important; }
}
/* Badges stay red in every theme; online dots retain their surface border. */
html body .partner-avatar .partner-unread-dot { width: 10px; height: 10px; padding: 0; border: 0; background: #b00020; box-shadow: none; }
html body .partner-avatar .partner-unread-dot.has-count { display: grid; place-items: center; min-width: 17px; width: auto; height: 17px; right: -5px; top: -5px; padding: 0 4px; color: #fff; font: 700 10px/1 -apple-system, BlinkMacSystemFont, sans-serif; font-variant-numeric: tabular-nums; }
#view-chat > .bar { display: flex; }
#view-chat > .bar .grow { flex: 1 1 112px; min-width: 56px; }
#view-advisor > .bar .grow { flex: 1 1 148px; min-width: 108px; }
#view-advisor .advisor-header-copy { flex: 1; }
#view-advisor .advisor-bot-header { flex: none; }
.chat-unread-peers { justify-content: flex-end; gap: 4px; min-width: 0; max-width: 100%; flex: 0 0 auto; }
html body .chat-unread-avatar { width: 32px; height: 32px; min-height: 32px; overflow: visible; }
.chat-unread-avatar img { border-radius: 50%; }
.chat-unread-count { position: absolute; z-index: 2; top: -4px; right: -4px; display: grid; place-items: center; min-width: 14px; height: 14px; padding: 0 3px; border: 0; border-radius: 999px; background: #b00020; color: #fff; font: 700 9px/1 -apple-system, BlinkMacSystemFont, sans-serif; pointer-events: none; }
html body #view-chat #chat-unread-peers .chat-unread-more,
html body #view-advisor #advisor-unread-peers .chat-unread-more { width: 32px; height: 32px; min-height: 32px; border: 0; border-image: none; border-radius: 50%; clip-path: none; background: #b00020; color: #fff; font: 700 11px/1 -apple-system, BlinkMacSystemFont, sans-serif; box-shadow: none; }
.unread-chooser-box { display: flex; flex-direction: column; max-height: min(80dvh, 600px); }
.unread-chooser-box .list { overflow-y: auto; margin-block: 8px; }
.unread-chooser-box .list button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; }
@media (max-width: 390px) {
  html body #view-list .home-bar { padding-inline: 8px; gap: 4px; }
  .directory-scroll { padding: 10px; }
  html body .directory-row { padding-inline: 12px; }
  html body .me-identity { padding: 14px 12px; }
  .me-avatar { width: 48px; height: 48px; }
  #view-chat > .bar .grow { flex-basis: 88px; min-width: 52px; }
  .friend-row { flex-wrap: wrap; }
  .friend-row input { flex-basis: 150px; }
}

/* Tips are independent of the keyboard, composer and bottom function controls. */
.ghb-notice-layer {
  position: fixed;
  top: calc(var(--app-top, 0px) + env(safe-area-inset-top) + 12px);
  inset-inline: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(440px, calc(100% - env(safe-area-inset-left) - env(safe-area-inset-right) - 24px));
  max-height: min(50dvh, calc(var(--app-height, 100dvh) - 80px));
  margin-inline: auto;
  overflow-x: hidden;
  overflow-y: auto;
  pointer-events: none;
  overscroll-behavior: contain;
}
.ghb-notice {
  position: relative;
  flex: none;
  min-width: 0;
  width: 100%;
  padding: 12px 48px 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 6px 24px color-mix(in srgb, var(--text) 16%, transparent);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  pointer-events: auto;
  overflow-wrap: anywhere;
}
.ghb-notice.is-error { border-color: var(--danger); }
.ghb-notice.is-error .ghb-notice-message { color: var(--danger); }
.ghb-notice-message { min-width: 0; white-space: pre-wrap; }
.ghb-notice-actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; margin-top: 8px; }
.ghb-notice-actions:empty { display: none; }
html body .ghb-notice .ghb-notice-action,
html body .ghb-notice .ghb-notice-close {
  min-width: 0;
  min-height: 36px;
  margin: 0;
  border: 1px solid var(--line);
  border-image: none;
  border-radius: 8px;
  clip-path: none;
  background: var(--accent-soft);
  box-shadow: none;
  color: var(--accent);
  font: inherit;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}
html body .ghb-notice .ghb-notice-action { max-width: 100%; padding: 6px 10px; }
html body .ghb-notice .ghb-notice-close {
  position: absolute;
  top: 5px;
  inset-inline-end: 5px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 23px;
  line-height: 1;
}
html body .ghb-notice button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Swipe-back moves each view without changing viewport or keyboard geometry. */
html body.swipe-back-active {
  contain: paint;
  overflow: clip;
}
html body .view.swipe-back-current,
html body .view.swipe-back-underlay {
  background-color: var(--bg) !important;
  will-change: transform;
  transition: none;
}
html body .view.swipe-back-current {
  z-index: 25;
  transform: translate3d(var(--swipe-back-x, 0px), 0, 0);
  box-shadow: -8px 0 24px rgb(0 0 0 / 12%);
}
html body .view.swipe-back-underlay {
  display: flex !important;
  z-index: 0;
  transform: translate3d(var(--swipe-back-underlay-x, 0px), 0, 0);
  pointer-events: none;
}
html body .view.swipe-back-current.swipe-back-settling,
html body .view.swipe-back-underlay.swipe-back-settling {
  transition: transform 220ms cubic-bezier(.22, .61, .36, 1);
}
html body .view.swipe-back-current.swipe-back-settling {
  pointer-events: none;
}
html body #main-nav.swipe-back-nav-preview {
  display: flex !important;
  z-index: 20;
  pointer-events: none;
}
html body #main-nav.swipe-back-nav-preview > .main-nav-item {
  flex: 1 1 0;
}
@media (prefers-reduced-motion: reduce) {
  html body .view.swipe-back-current.swipe-back-settling,
  html body .view.swipe-back-underlay.swipe-back-settling {
    transition-duration: 120ms;
  }
}

/* GHBFindFriendsStyles:start */
/* 合拍样式仅作用于 cd 命名空间；人物照片覆盖完整发现舞台。 */
.cd-shell { --cd-bg:var(--bg,#faf7f5); --cd-surface:var(--surface,#fff); --cd-text:var(--text,#292631); --cd-muted:var(--muted,#817680); --cd-line:color-mix(in srgb,var(--cd-text) 13%,transparent); --cd-rose:var(--accent,#b74e73); --cd-soft:color-mix(in srgb,var(--cd-rose) 11%,var(--cd-surface)); display:flex; flex:1; flex-direction:column; position:relative; min-height:0; min-width:0; width:100%; color:var(--cd-text); background:var(--cd-bg); font:inherit; isolation:isolate; }
.cd-shell *, .cd-shell *::before, .cd-shell *::after { box-sizing:border-box; }
html body .cd-shell :is(button,input,textarea,select) { font:inherit; line-height:1.45; border-image:none; clip-path:none; min-width:0; }
html body .cd-shell button { appearance:none; display:inline-flex; align-items:center; justify-content:center; min-width:44px; min-height:44px; padding:9px 13px; margin:0; border:1px solid transparent; border-radius:12px; background:transparent; color:inherit; box-shadow:none; cursor:pointer; touch-action:manipulation; }
html body .cd-shell button:disabled { opacity:.42; cursor:default; }
html body .cd-shell :is(button,input,textarea,select,[tabindex]):focus-visible { outline:3px solid var(--cd-rose); outline-offset:3px; }
.cd-shell :is(h2,h3,p,ol) { margin:0; overflow-wrap:anywhere; }
.cd-shell [hidden] { display:none!important; }
.cd-nav { display:flex; flex:none; align-items:center; justify-content:center; gap:17px; padding:0 14px; border-bottom:1px solid var(--cd-line); }
html body .cd-shell .cd-nav button { position:relative; padding:9px 3px; color:var(--cd-muted); border-radius:0; font-size:13px; }
html body .cd-shell .cd-nav button[aria-current=page] { color:var(--cd-rose); }
.cd-nav button[aria-current=page]::after { content:""; position:absolute; height:2px; inset:auto 0 0; background:var(--cd-rose); border-radius:2px; }
.cd-content { display:flex; flex:1; flex-direction:column; min-height:0; overflow:auto; overscroll-behavior:contain; scrollbar-width:thin; }
.cd-discover { display:flex; flex:1 1 0; flex-direction:column; min-width:0; min-height:0; width:100%; max-width:520px; margin:0 auto; padding:10px 10px 12px; }
.cd-stage { position:relative; display:flex; flex:1 1 0; min-height:300px; overflow:hidden; border-radius:22px; background:#342635; color:#fff; isolation:isolate; touch-action:pan-y; container:cd-stage / size; }
.cd-photo-frame,.cd-photo-shade { position:absolute; inset:0; pointer-events:none; }
.cd-photo { display:block; width:100%; height:100%; object-fit:cover; object-position:center 30%; user-select:none; -webkit-user-drag:none; }
.cd-photo-unavailable { display:grid; width:100%; height:100%; place-items:center; background:linear-gradient(145deg,#694854,#28212d); color:#edd7dd; font-size:50px; }
.cd-photo-shade { z-index:1; background:linear-gradient(180deg,#160c205e 0%,#160c2030 29%,#160c2000 43%,#160c2060 58%,#160c20e8 84%,#160c20f2 100%); }
.cd-heading { position:absolute; inset:0 0 auto; z-index:5; display:flex; align-items:flex-start; justify-content:space-between; gap:10px; padding:18px 19px 0; text-shadow:0 1px 15px #160c2075; }
.cd-heading h2 { font-size:22px; line-height:1.4; font-weight:500; letter-spacing:.4px; }
.cd-heading p { font-size:11px; margin-top:3px; opacity:.85; }
html body .cd-shell .cd-pace { font-size:11px; background:#271c285c; border-color:#ffffff28; backdrop-filter:blur(10px); flex:none; min-height:44px; padding:7px 10px; border-radius:22px; color:#fff; }
.cd-scene { position:absolute; inset:69px 0 auto; height:270px; z-index:2; pointer-events:none; }
.cd-scene canvas { display:block; width:100%; height:100%; }
.cd-scene-fallback { position:absolute; top:55px; inset-inline:0; text-align:center; font-size:75px; color:#f7d3de; text-shadow:0 2px 30px #4c2545; opacity:.65; }
.cd-stage[data-started=true] .cd-scene { height:150px; }
.cd-source-host { display:none; }
.cd-source { position:relative; display:flex; flex:none; gap:9px; align-items:center; padding:7px 10px; margin-bottom:12px; border-radius:12px; background:#21162888; border:1px solid #ffffff35; backdrop-filter:blur(12px); color:#fff; }
.cd-source>span { flex:none; font-size:25px; }
.cd-source strong { display:block; font-weight:500; font-size:12px; }
.cd-source-account { display:inline-block; margin-inline-start:5px; font-size:11px; font-weight:400; opacity:.9; overflow-wrap:anywhere; }
.cd-source p { font-size:11px; margin-top:2px; opacity:.85; }
.cd-person-host { position:absolute; inset:0; z-index:3; pointer-events:none; }
.cd-person-info { position:absolute; inset:auto 21px 190px; color:#fff; text-shadow:0 1px 10px #160c2040; }
.cd-name-line { display:flex; align-items:baseline; gap:9px; }
.cd-name-line h3 { font-size:30px; font-weight:500; line-height:1.2; letter-spacing:-.6px; }
.cd-age { font-size:21px; }
html body .cd-shell .cd-person-menu { margin-inline-start:auto; padding:0; font-size:26px; pointer-events:auto; background:#261b244d; }
.cd-place { margin-top:3px!important; font-size:12px; opacity:.9; }
.cd-bio { margin:10px 0 11px!important; font-size:14px; line-height:1.65; max-width:480px; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; white-space:pre-line; }
.cd-tags { display:flex; flex-wrap:wrap; gap:6px; max-height:60px; overflow:hidden; }
.cd-tags span { padding:3px 9px; border:1px solid #ffffff42; border-radius:20px; background:#ffffff12; font-size:11px; backdrop-filter:blur(8px); }
.cd-stage-controls { position:absolute; inset:0; z-index:4; pointer-events:none; }
.cd-stage-controls button,.cd-stage-controls a { pointer-events:auto; }
.cd-bottom { position:absolute; inset:auto 15px 16px; }
.cd-album-toolbar { display:flex; align-items:center; justify-content:space-between; gap:8px; }
html body .cd-shell .cd-album-arrow { position:absolute; top:28%; z-index:8; width:44px; height:44px; flex:none; padding:0; border-radius:50%; background:#21172250; border-color:#ffffff40; color:#fff; font-size:28px; line-height:1; backdrop-filter:blur(10px); }
.cd-album-prev { inset-inline-start:9px; }
.cd-album-next { inset-inline-end:9px; }
.cd-stage.is-reading .cd-album-arrow { top:160px; }
.cd-album-middle { display:flex; align-items:center; justify-content:center; gap:8px; flex-wrap:wrap; }
.cd-counter { font-size:11px; opacity:.85; }
html body .cd-shell .cd-about-link { font-size:12px; padding:6px 3px; color:#ffe1ea; }
.cd-status-row { display:flex; align-items:center; gap:9px; min-height:40px; }
.cd-status { flex:1; font-size:11px; text-align:center; color:#ffe4eb; line-height:1.5; }
html body .cd-shell .cd-pause { padding:5px 4px; font-size:11px; color:#ffedf2; min-width:44px; flex:none; }
.cd-actions { display:flex; gap:10px; }
html body .cd-shell .cd-actions button { display:flex; flex:1; flex-direction:column; min-height:62px; padding:10px 5px; border-radius:16px; background:#fffc; border-color:#ffffff52; color:#35222e; backdrop-filter:blur(14px); }
html body .cd-shell .cd-actions .cd-hit { background:#b3476be8; border-color:#f2adc244; color:#fff; }
.cd-actions button>span { font-size:16px; line-height:1.5; font-weight:500; }
.cd-actions small { display:block; font-size:10px; opacity:.83; margin-top:2px; }
.cd-intro { position:absolute; inset:42% 20px auto; padding:22px 15px; border-radius:20px; background:#211324a6; backdrop-filter:blur(16px); text-align:center; }
.cd-intro h3 { font-size:23px; font-weight:500; line-height:1.5; }
.cd-intro p { font-size:12px; margin:8px 0 17px; color:#f4e6ed; }
.cd-stage[data-started=false] .cd-person-host,.cd-stage[data-started=false] .cd-bottom { opacity:.35; }
html body .cd-shell .cd-primary { background:var(--cd-rose); color:var(--accent-text,#fff); border-radius:100px; padding:11px 20px; font-weight:500; }
html body .cd-shell .cd-intro .cd-primary { background:#bb5275; color:#fff; }
.cd-about { position:absolute; inset:225px 17px 195px; display:flex; flex-direction:column; border:1px solid #ffffff32; border-radius:17px; padding:16px; color:#fff; background:#241826db; backdrop-filter:blur(18px); pointer-events:auto; }
.cd-about-person { font-size:11px; opacity:.75; }
.cd-about h3 { font-size:19px; font-weight:500; margin:5px 0 11px; }
.cd-about-text { min-height:0; overflow:auto; white-space:pre-wrap; font-size:14px; line-height:1.9; user-select:text; -webkit-user-select:text; overscroll-behavior:contain; scrollbar-width:thin; }
.cd-stage.is-reading .cd-photo { filter:brightness(.7); }
.cd-stage.is-reading .cd-scene { opacity:.7; }
.cd-readonly-actions { min-height:62px; display:flex; justify-content:center; align-items:center; text-align:center; font-size:12px; color:#f2dfe8; }
.cd-empty { position:absolute; inset:95px 22px 35px; display:flex; flex-direction:column; justify-content:center; text-align:center; pointer-events:auto; }
.cd-empty-symbol { color:#ecc0d1; font-size:64px; margin-bottom:21px; }
.cd-empty h3 { font-size:22px; font-weight:500; }
.cd-empty p { font-size:13px; line-height:1.8; color:#e6d6df; margin-top:12px; }
.cd-empty-actions { display:flex; flex-wrap:wrap; justify-content:center; gap:10px; margin-top:24px; }
.cd-stage.is-empty .cd-scene { opacity:.2; }
html body .cd-shell .cd-empty .cd-primary { background:#bb5275; color:#fff; }
html body .cd-shell .cd-empty .cd-secondary { border-color:#ffffff45; color:#fff; }
.cd-connection { display:flex; gap:12px; align-items:center; padding:10px 13px; margin-top:11px; border-radius:14px; color:var(--cd-rose); background:var(--cd-soft); font-size:12px; }
.cd-connection p { flex:1; }
html body .cd-shell .cd-connection button { background:var(--cd-surface); }
html body .cd-shell .cd-back { align-self:flex-start; color:var(--cd-rose); padding:5px 6px; margin-bottom:6px; }
.cd-inbox,.cd-editor { width:100%; max-width:700px; margin:0 auto; padding:24px 22px 32px; }
.cd-inbox h2,.cd-editor h2 { font-size:23px; font-weight:500; line-height:1.4; }
.cd-sub { font-size:12px; line-height:1.8; color:var(--cd-muted); margin-top:8px!important; }
.cd-inbox-tabs { display:flex; gap:4px; background:var(--cd-soft); border-radius:15px; padding:4px; margin-top:19px; }
html body .cd-shell .cd-inbox-tabs button { flex:1; padding:8px 3px; font-size:12px; color:var(--cd-muted); }
html body .cd-shell .cd-inbox-tabs button[aria-pressed=true] { background:var(--cd-surface); color:var(--cd-rose); }
.cd-inbox-person { display:flex; gap:14px; align-items:flex-start; padding:20px 0; border-bottom:1px solid var(--cd-line); }
html body .cd-shell .cd-person-link { width:80px; height:100px; padding:0; border-radius:14px; overflow:hidden; flex:none; }
.cd-inbox-photo { width:100%; height:100%; object-fit:cover; object-position:center 30%; }
.cd-inbox-info { min-width:0; flex:1; padding-top:2px; }
.cd-inbox-info h3 { font-size:17px; font-weight:500; }
.cd-account { font-size:12px; margin-top:3px!important; color:var(--cd-muted); }
.cd-inbox-source { font-size:12px; margin-top:6px!important; color:var(--cd-rose); }
.cd-inbox-actions { display:flex; flex-wrap:wrap; gap:5px; margin-top:8px; }
html body .cd-shell .cd-inbox-actions button { padding:8px 10px; font-size:12px; background:var(--cd-soft); color:var(--cd-rose); }
html body .cd-shell .cd-inbox-actions .cd-primary { background:var(--cd-rose); color:var(--accent-text,#fff); border-radius:12px; }
html body .cd-shell .cd-quiet { background:transparent; color:var(--cd-muted); }
.cd-list-empty { text-align:center; color:var(--cd-muted); padding:50px 12px; font-size:13px; }
.cd-list-empty h3 { font-size:19px; font-weight:500; color:var(--cd-text); margin-bottom:10px; }
.cd-list-empty p { line-height:1.8; }
.cd-receipt { display:flex; align-items:center; gap:9px; padding:10px 12px; border-radius:13px; background:var(--cd-soft); color:var(--cd-rose); margin:20px 0; font-size:11px; }
.cd-receipt p { flex:1; }
html body .cd-shell .cd-receipt button { font-size:12px; padding:5px; }
.cd-error,.cd-success { border-radius:12px; padding:10px 12px; font-size:12px; line-height:1.7; margin:10px 0!important; background:var(--cd-soft); color:var(--cd-rose); }
.cd-error { background:color-mix(in srgb,#ce3554 12%,var(--cd-surface)); color:var(--danger,#bb3152); }
.cd-bottom .cd-error { color:#fff; background:#822741eb; pointer-events:auto; }
.cd-bottom .cd-success { background:#35203bdb; color:#ffe4ed; }
.cd-publication { display:inline-block; font-size:11px; padding:5px 10px; border-radius:20px; color:var(--cd-rose); background:var(--cd-soft); margin:9px 0 0; }
.cd-birthday { display:flex; gap:13px; align-items:center; padding:14px; border-radius:15px; background:var(--cd-soft); margin-top:18px; }
.cd-birthday>div { flex:1; min-width:0; }
.cd-birthday strong { font-size:12px; font-weight:500; }
.cd-birthday p { font-size:11px; color:var(--cd-muted); margin-top:4px!important; line-height:1.7; }
html body .cd-shell .cd-birthday button { font-size:11px; padding:8px; }
.cd-field { display:flex; flex-direction:column; gap:7px; margin-top:21px; font-size:13px; }
.cd-field small { color:var(--cd-muted); font-size:11px; }
html body .cd-shell :is(textarea,input:not([type=checkbox]):not([type=file]),select) { width:100%; min-height:44px; padding:11px 12px; border:1px solid var(--cd-line); border-radius:11px; background:var(--cd-surface); color:var(--cd-text); }
html body .cd-shell textarea { resize:vertical; line-height:1.8; }
.cd-privacy { border:1px solid var(--cd-line); border-radius:14px; margin:22px 0 0; padding:7px 13px 13px; }
.cd-privacy legend { font-size:12px; padding:0 5px; }
.cd-privacy label { display:flex; align-items:center; gap:9px; min-height:44px; font-size:13px; }
.cd-shell input[type=checkbox] { width:20px; height:20px; accent-color:var(--cd-rose); flex:none; }
.cd-photos-editor { margin-top:23px; }
.cd-photos-editor h3 { font-size:16px; font-weight:500; }
.cd-photo-list { list-style:none; padding:0; margin:13px 0!important; display:flex; flex-direction:column; gap:10px; }
.cd-edit-photo { display:flex; align-items:center; gap:13px; padding:10px; background:var(--cd-surface); border:1px solid var(--cd-line); border-radius:14px; }
.cd-edit-thumbnail { width:72px; height:88px; border-radius:10px; object-fit:cover; flex:none; }
.cd-photo-edit-controls { flex:1; min-width:0; font-size:12px; }
.cd-photo-edit-controls>label { display:flex; align-items:center; gap:7px; min-height:44px; }
.cd-photo-edit-controls>div { display:flex; gap:5px; flex-wrap:wrap; }
html body .cd-shell .cd-photo-edit-controls button { border:1px solid var(--cd-line); padding:7px 10px; font-size:12px; }
html body .cd-shell .cd-danger { color:var(--danger,#c44864); }
.cd-upload { position:relative; display:flex; align-items:center; justify-content:center; min-height:48px; border:1px dashed var(--cd-rose); border-radius:13px; color:var(--cd-rose); font-size:13px; overflow:hidden; }
.cd-upload input { position:absolute; inset:0; opacity:0; cursor:pointer; width:100%; height:100%; }
.cd-upload:focus-within { outline:3px solid var(--cd-rose); outline-offset:3px; }
.cd-upload.is-disabled { opacity:.5; }
.cd-editor-actions { display:flex; flex-wrap:wrap; gap:9px; margin-top:25px; }
html body .cd-shell .cd-secondary { border:1px solid var(--cd-line); background:var(--cd-surface); }
.cd-sheet-host:empty { display:none; }
.cd-overlay { position:absolute; inset:0; z-index:30; background:#17101a75; display:flex; align-items:flex-end; justify-content:center; padding:12px; backdrop-filter:blur(5px); }
.cd-sheet { width:100%; max-width:620px; max-height:90%; overflow:auto; padding:20px; background:var(--cd-surface); border:1px solid var(--cd-line); border-radius:22px; box-shadow:0 15px 50px #0003; }
.cd-sheet>header { display:flex; gap:12px; align-items:center; justify-content:space-between; }
.cd-sheet h2 { font-size:20px; font-weight:500; }
html body .cd-shell .cd-close { flex:none; padding:0; font-size:26px; color:var(--cd-muted); }
.cd-pace-options { display:flex; flex-direction:column; gap:9px; margin:18px 0; }
html body .cd-shell .cd-pace-options button { display:flex; flex-direction:column; align-items:flex-start; min-height:70px; gap:4px; padding:13px 15px; border:1px solid var(--cd-line); border-radius:14px; }
.cd-pace-options strong { font-size:14px; font-weight:500; }
.cd-pace-options span { font-size:12px; color:var(--cd-muted); }
html body .cd-shell .cd-pace-options button[aria-pressed=true] { background:var(--cd-soft); border-color:var(--cd-rose); color:var(--cd-rose); }
html body .cd-shell .cd-sheet-action { display:flex; width:100%; justify-content:flex-start; margin-top:12px; border:1px solid var(--cd-line); }
.cd-sheet .cd-primary { margin-top:18px; }
[dir=rtl] .cd-shell .cd-album-arrow { transform:scaleX(-1); }
@media (min-width:720px) { .cd-discover { max-width:520px; padding:14px 18px; } .cd-heading { padding:22px 24px 0; } .cd-heading h2 { font-size:26px; } .cd-person-info { inset-inline:27px; bottom:196px; } .cd-name-line h3 { font-size:35px; } .cd-bottom { inset-inline:22px; bottom:20px; } .cd-about { inset-block-start:235px; } }
@media (max-width:359px) { .cd-nav { gap:14px; } .cd-discover { padding:7px; } .cd-heading { padding-inline:13px; } .cd-heading h2 { font-size:19px; } .cd-heading p { font-size:10px; } html body .cd-shell .cd-pace { padding:7px; font-size:10px; } .cd-person-info { inset-inline:16px; } .cd-name-line h3 { font-size:27px; } .cd-bottom { inset-inline:11px; } .cd-album-middle { gap:0; flex-direction:column; } html body .cd-shell .cd-about-link { min-height:24px; padding:2px; } .cd-inbox,.cd-editor { padding-inline:15px; } .cd-inbox-person { gap:10px; } html body .cd-shell .cd-person-link { width:66px; height:86px; } .cd-birthday { flex-wrap:wrap; } .cd-birthday>div { flex-basis:100%; } .cd-sheet { padding:15px; } .cd-actions button>span { font-size:14px; } }
/* 使用真实舞台高度分配空间；竖屏核心按钮不依赖外层滚动。 */
@media (max-height:700px) {
  .cd-discover { padding:4px 6px; }
  html body .cd-shell .cd-back { margin-bottom:0; }
  .cd-connection-host { display:none; }
}
@container cd-stage (max-height:650px) {
  html body .cd-shell .cd-stage.is-reading .cd-album-arrow { top:76px; }
  .cd-heading { padding:10px 13px 0; }
  .cd-heading h2 { font-size:20px; line-height:1.25; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
  .cd-heading p { display:none; }
  .cd-scene { top:56px; height:170px; }
  .cd-stage[data-started=true] .cd-scene { height:94px; }
  .cd-person-info { inset-inline:16px; bottom:151px; }
  .cd-bio,.cd-tags { display:none; }
  .cd-source { padding:6px 8px; margin-bottom:8px; gap:7px; }
  .cd-source>span { font-size:22px; }
  .cd-source strong { font-size:11px; line-height:1.5; }
  .cd-source-account { font-size:10px; }
  .cd-source p { display:none; }
  .cd-name-line { align-items:center; }
  .cd-name-line h3 { font-size:26px; }
  .cd-age { font-size:18px; }
  .cd-place { font-size:11px; line-height:1.35; }
  html body .cd-shell .cd-album-arrow { top:76px; }
  .cd-bottom { inset-inline:12px; bottom:8px; display:grid; grid-template-columns:minmax(0,1fr) 44px; column-gap:5px; }
  .cd-album-toolbar { grid-column:1; grid-row:1; min-height:44px; }
  html body .cd-shell .cd-about-link { min-height:44px; padding:5px 2px; font-size:11px; }
  .cd-status-row { display:contents; }
  .cd-status { grid-column:1 / -1; grid-row:2; min-height:14px; max-height:28px; overflow:auto; font-size:10px; line-height:1.4; margin-bottom:4px; }
  html body .cd-shell .cd-pause { grid-column:2; grid-row:1; padding:4px 0; font-size:10px; }
  .cd-actions,.cd-readonly-actions { grid-column:1 / -1; grid-row:3; }
  html body .cd-shell .cd-actions button { min-height:52px; padding:6px 4px; border-radius:14px; }
  .cd-actions button>span { font-size:14px; }
  .cd-actions small { margin-top:0; font-size:10px; }
  .cd-bottom>.cd-error,.cd-bottom>.cd-success { grid-column:1 / -1; }
  .cd-about { inset:130px 15px 151px; padding:12px; }
  .cd-about-person,.cd-about h3 { display:none; }
  .cd-about-text { font-size:13px; line-height:1.75; }
  .cd-stage[data-started=false] .cd-person-host,.cd-stage[data-started=false] .cd-bottom { visibility:hidden; }
  .cd-intro { inset:auto 14px 22px; padding:16px 12px; }
  .cd-intro h3 { font-size:20px; line-height:1.4; }
  .cd-intro p { font-size:11px; margin:7px 0 12px; }
  .cd-empty { inset:70px 16px 12px; overflow:auto; justify-content:flex-start; padding-top:10px; }
  .cd-empty-symbol { font-size:40px; margin-bottom:8px; }
  .cd-empty h3 { font-size:19px; }
  .cd-empty p { font-size:12px; line-height:1.6; margin-top:8px; }
  .cd-empty-actions { margin-top:14px; gap:8px; }
}
@container cd-stage (max-height:450px) {
  html body .cd-shell .cd-stage.is-reading .cd-album-arrow { top:52px; }
  .cd-heading { padding-top:6px; }
  .cd-heading h2 { font-size:17px; }
  .cd-person-info { bottom:132px; }
  .cd-place { display:none; }
  .cd-name-line h3 { font-size:24px; }
  html body .cd-shell .cd-album-arrow { top:52px; }
  .cd-about { inset:102px 15px 132px; padding:8px; }
  .cd-about .cd-source { margin-bottom:6px; }
  .cd-empty-symbol { display:none; }
}
@media (prefers-reduced-motion:reduce) { .cd-shell * { scroll-behavior:auto!important; transition:none!important; animation:none!important; } }

/* CUPID_AIM_CONTROLS */
/* 半透明瞄准区保持照片可见；仅从此区开始的拖动表示明确表态。 */
.cd-photo-shade { background:linear-gradient(180deg,#160c205e 0%,#160c2012 29%,#160c2000 43%,#160c201a 58%,#160c2055 84%,#160c2070 100%); }
.cd-bottom { text-shadow:0 1px 4px #160c20e6; }
.cd-person-info { bottom:245px; }
.cd-aim-zone { position:relative; width:100%; height:120px; grid-column:1 / -1; grid-row:3; pointer-events:auto; touch-action:none; user-select:none; -webkit-user-select:none; }
html body .cd-shell .cd-aim-outside { position:absolute; inset:0; width:100%; height:100%; padding:0; border:0; border-radius:0; background:transparent; touch-action:none; }
html body .cd-shell .cd-aim-target { position:absolute; top:0; left:50%; transform:translateX(-50%); z-index:2; display:grid; place-items:center; width:94px; height:94px; min-width:94px; min-height:94px; padding:0; border:1.5px solid #fff0e999; border-radius:50%; background:#b54c7026; color:#fff; touch-action:none; transition:background .15s,border-color .15s; }
.cd-target-rings { position:absolute; inset:8px; border:1px solid #ffe4ce8c; border-radius:50%; pointer-events:none; }
.cd-target-rings::before,.cd-target-rings::after { content:""; position:absolute; inset:11px; border:1px solid #ffe4ce8c; border-radius:50%; }
.cd-target-rings::after { inset:23px; background:#efb6ba33; }
.cd-target-label { position:relative; z-index:1; max-width:calc(100% - 14px); font-size:13px; line-height:1.2; text-align:center; font-weight:500; text-shadow:0 1px 4px #3e1834; pointer-events:none; }
.cd-aim-status { position:absolute; inset:auto 0 0; margin:0; font-size:11px; line-height:1.5; text-align:center; color:#fff; pointer-events:none; }
.cd-stage[data-aim=hit] .cd-aim-target { background:#bd527957; border-color:#fff4d9; }
.cd-stage[data-aim=miss] .cd-aim-target { background:#b54c7014; }
.cd-stage[data-phase=hit] .cd-aim-target { background:#d27b9a70; }
.cd-aim-arrow { position:absolute; z-index:15; width:74px; height:3px; border-radius:3px; background:linear-gradient(90deg,#dc8aab,#ffe6ad); box-shadow:0 1px 4px #2b15377a; transform:translate(-100%,-50%) rotate(-35deg); transform-origin:100% 50%; pointer-events:none; }
.cd-aim-arrow::after { content:""; position:absolute; right:-1px; top:-4px; border-top:5.5px solid transparent; border-bottom:5.5px solid transparent; border-left:11px solid #ffe6ad; }
.cd-aim-arrow::before { content:""; position:absolute; left:2px; top:-4px; width:11px; height:11px; border-top:3px solid #edbad2; border-bottom:3px solid #edbad2; transform:skewX(30deg); }
html body .cd-shell .cd-magnifier { position:absolute; inset-inline-end:17px; bottom:66px; z-index:9; width:44px; height:44px; min-width:44px; min-height:44px; padding:0; border-radius:50%; border:1px solid #ffffff66; background:#271c2847; color:#fff; backdrop-filter:blur(5px); }
.cd-search-icon { position:relative; display:block; width:15px; height:15px; border:1.8px solid currentColor; border-radius:50%; margin:-3px 3px 0 0; pointer-events:none; }
.cd-search-icon::after { content:""; position:absolute; width:8px; height:1.8px; right:-6px; bottom:-3px; border-radius:2px; background:currentColor; transform:rotate(45deg); }
.cd-friend-card { min-width:0; overflow-wrap:anywhere; }
.cd-sheet:has(.cd-friend-card)>header { position:sticky; top:0; z-index:2; padding-block:6px; background:var(--cd-surface); }
.cd-card-photo { display:block; width:100%; height:clamp(150px,32dvh,320px); object-fit:cover; object-position:center 30%; border-radius:14px; }
.cd-card-gallery { display:flex; flex-wrap:wrap; gap:7px; margin:10px 0 14px; }
html body .cd-shell .cd-card-gallery button { width:44px; height:52px; padding:2px; border-radius:8px; border:2px solid transparent; background:var(--cd-soft); }
.cd-card-gallery img { display:block; width:100%; height:100%; object-fit:cover; border-radius:4px; }
html body .cd-shell .cd-card-gallery button[aria-pressed=true] { border-color:var(--cd-rose); }
.cd-friend-card h3 { font-size:23px; font-weight:500; }
.cd-friend-card p { font-size:13px; line-height:1.7; margin-top:5px; }
.cd-friend-card .cd-card-source { color:var(--cd-rose); }
.cd-card-tags { display:flex; flex-wrap:wrap; gap:7px; margin:12px 0; }
.cd-card-tags span { background:var(--cd-soft); border-radius:14px; padding:4px 10px; font-size:12px; }
.cd-friend-card .cd-card-bio { white-space:pre-wrap; margin:12px 0 0; }
.cd-stage.is-reading .cd-about { bottom:250px; }
@container cd-stage (max-height:650px) {
  .cd-person-info { bottom:210px; }
  .cd-stage.is-reading .cd-about { inset:132px 16px 213px; padding:10px; }
}
@container cd-stage (max-height:450px) {
  .cd-aim-zone { height:106px; }
  html body .cd-shell .cd-aim-target { width:80px; height:80px; min-width:80px; min-height:80px; }
  .cd-target-rings { inset:6px; }
  .cd-target-rings::before { inset:9px; }
  .cd-target-rings::after { inset:19px; }
  .cd-person-info { bottom:190px; }
  .cd-stage.is-reading .cd-about { inset:92px 15px 164px; padding:8px; }
  .cd-stage.is-reading .cd-status { display:none; }
  html body .cd-shell .cd-magnifier { bottom:57px; }
}
/* Timeline is a separate scrolling feed; Cupid's full-photo stage stays intact. */
.cd-nav { gap: 4px; overflow-x: auto; flex-shrink: 0; }
.cd-nav button { white-space: nowrap; }
.cd-social-settings { display: grid; gap: 12px; border: 0; padding: 0; margin: 0 0 18px; }
.cd-social-settings small { color: var(--muted, #8d94a5); }
.st-timeline { width: min(100%, 760px); margin-inline: auto; padding: 18px; box-sizing: border-box; overflow-wrap: anywhere; }
.st-heading, .st-post > header, .st-post > footer, .st-composer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.st-heading h2 { margin: 0; font-size: 24px; }
.st-heading p, .st-composer small { color: var(--muted, #8d94a5); font-size: 13px; }
.st-timeline button { min-height: 38px; border-radius: 20px; padding: 7px 14px; background: var(--cd-surface, #fff); border: 1px solid #8884; color: inherit; cursor: pointer; }
.st-timeline button:hover { border-color: #d68b9f; }
.st-timeline button:disabled { opacity: .5; cursor: default; }
.st-composer, .st-post, .st-report { border: 1px solid #8883; border-radius: 20px; margin-block: 18px; background: var(--cd-surface, #fff); overflow: hidden; }
.st-composer, .st-report { padding: 16px; }
.st-composer textarea, .st-report textarea { resize: vertical; min-height: 54px; width: 100%; box-sizing: border-box; }
.st-composer .cd-field { gap: 5px; margin-bottom: 6px; }
.st-composer-bottom { flex-wrap: wrap; margin-block: 10px; }
.st-composer select { max-width: 100%; }
.st-post > header, .st-post > footer { padding: 14px 16px; flex-wrap: wrap; }
.st-post header small { display: block; margin-top: 4px; color: var(--muted, #8d94a5); font-size: 12px; }
.st-post-actions { display: flex; gap: 4px; }
.st-post-actions button { font-size: 12px; min-height: 32px; padding: 5px 10px; background: transparent; }
.st-post-text { white-space: pre-wrap; line-height: 1.65; margin: 6px 16px 16px; }
.st-post-photos { display: flex; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; width: 100%; }
.st-post-photos img { width: 100%; flex: 0 0 100%; max-height: 720px; object-fit: contain; background: #080c15; scroll-snap-align: start; }
.st-post time { font-size: 12px; color: var(--muted, #8d94a5); }
.st-photo-picker { margin-block: 10px; }
.st-photo-picker > div { display: flex; gap: 10px; overflow-x: auto; margin-block: 10px; }
.st-photo-picker label { flex: 0 0 70px; position: relative; }
.st-photo-picker img { height: 88px; width: 70px; object-fit: cover; border-radius: 10px; }
.st-photo-picker input { position: absolute; bottom: 5px; inset-inline-end: 4px; }
.st-feed-controls, .st-review-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 12px; }
.st-review-list { display: grid; gap: 12px; margin-top: 18px; }
.st-review-list button { text-align: start; white-space: pre-wrap; overflow-wrap: anywhere; }
.st-review-details { font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 280px; overflow: auto; background: #8881; padding: 12px; }
@media (max-width: 480px) { .st-timeline { padding: 12px 8px; } .st-post { border-radius: 16px; } .st-heading { align-items: flex-start; } .cd-nav button { padding-inline: 10px; font-size: 12px; } }

/* 找朋友：仅供管理员查看的产品预览，样式限定在 ff 命名空间。 */
html body #main-nav.has-discover,
html body #main-nav:has(> #nav-discover:not(.hidden)) {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: 1fr;
  grid-auto-flow: column;
}

#view-discover {
  min-height: 0;
  overflow: hidden;
}

#find-friends-root {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.ff-shell {
  --ff-radius: 20px;
  --ff-soft: color-mix(in srgb, var(--surface) 78%, var(--accent-soft));
  --ff-shadow: 0 10px 30px color-mix(in srgb, var(--text) 7%, transparent);
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
  max-width: 1080px;
  min-width: 0;
  min-height: 0;
  margin: 0 auto;
  color: var(--text);
  font-family: inherit;
}

.ff-shell *, .ff-shell *::before, .ff-shell *::after {
  box-sizing: border-box;
}

html body .ff-shell :is(button:where([data-ff-action]), input:where([data-ff-field], [data-ff-search]), select, textarea) {
  min-width: 0;
  font: inherit;
  line-height: 1.45;
  border-image: none;
  clip-path: none;
}

html body .ff-shell button:where([data-ff-action]) {
  appearance: none;
  min-height: 42px;
  margin: 0;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

html body .ff-shell :is(button, input, select, textarea):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

html body .ff-shell button:where([data-ff-action]):disabled {
  opacity: .5;
  cursor: default;
}

.ff-shell :is(h1, h2, h3, h4, p) {
  margin: 0;
  overflow-wrap: anywhere;
}

.ff-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 9px;
}

.ff-heading { min-width: 0; }
.ff-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 7px; }
.ff-heading h1, .ff-heading h2 { font-size: clamp(21px, 4.7vw, 25px); line-height: 1.25; letter-spacing: -.5px; }
.ff-eyebrow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 7px; color: var(--self); font-size: 10px; font-weight: 650; letter-spacing: 1.8px; text-transform: uppercase; }
.ff-admin-chip { display: inline-flex; align-items: center; min-height: 18px; padding: 1px 5px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-size: 9px; font-weight: 500; letter-spacing: .1px; }
.ff-lead { margin-top: 3px !important; color: var(--muted); font-size: 11px; line-height: 1.5; }

html body .ff-shell .ff-profile-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: none;
  min-height: 36px;
  padding: 7px 9px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.ff-profile-button svg { width: 16px; height: 16px; flex: none; }

.ff-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  flex: none;
  gap: 4px;
  margin: 0 12px 9px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 50%, var(--bg));
}

html body .ff-shell .ff-tab { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 6px 5px; border-radius: 10px; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
html body .ff-shell .ff-tab.is-active, html body .ff-shell .ff-tab[aria-selected="true"] { background: var(--surface); color: var(--accent); box-shadow: 0 2px 7px color-mix(in srgb, var(--text) 6%, transparent); }
.ff-tab svg { width: 17px; height: 17px; flex: none; }

.ff-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 0 12px 12px;
  overflow: hidden;
}

.ff-map-layout, .ff-swipe-layout, .ff-daily-layout { display: grid; gap: 16px; min-width: 0; }
.ff-map-panel { position: relative; display: flex; flex-direction: column; min-height: 335px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--ff-radius); background: color-mix(in srgb, var(--surface) 88%, #b9d4c5); isolation: isolate; }
.ff-map-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px; padding: 15px 14px 10px; color: var(--muted); font-size: 10px; }
.ff-map-top .ff-eyebrow { margin: 0; font-size: 9px; letter-spacing: 1.4px; }
.ff-map-board { position: relative; flex: 1; min-height: 0; margin: 0 8px; border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); border-radius: 13px; background: color-mix(in srgb, var(--surface) 78%, #bad4e5); }
.ff-map-grid { position: absolute; inset: 0; border-radius: inherit; background-image: linear-gradient(color-mix(in srgb, var(--text) 5%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--text) 5%, transparent) 1px, transparent 1px); background-size: 32px 32px; }
.ff-map-canvas { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; opacity: .85; }
.ff-map-canvas path { fill: color-mix(in srgb, var(--surface) 55%, #bbceac); stroke: color-mix(in srgb, var(--text) 13%, transparent); stroke-width: 1.2; }
.ff-map-canvas text { fill: color-mix(in srgb, var(--muted) 54%, transparent); font-family: inherit; font-size: 10px; letter-spacing: 2px; }
.ff-map-caption { position: relative; z-index: 2; margin: 0 12px !important; padding: 11px 2px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.ff-map-caption strong { color: var(--text); font-weight: 600; }
.ff-city-shortcuts { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; padding: 0 12px 12px; }
html body .ff-shell .ff-city-shortcuts .ff-button { min-height: 31px; padding: 6px 9px; border-radius: 8px; font-size: 10px; font-weight: 500; }

html body .ff-shell .ff-city-pin {
  position: absolute;
  top: var(--ff-y, 50%);
  left: var(--ff-x, 50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 0;
  padding: 5px;
  border: 0;
  border-radius: 15px;
  transform: translate(-50%, -50%);
}

.ff-pin-avatar { position: relative; display: grid; place-items: center; width: 43px; height: 43px; border: 3px solid var(--surface); border-radius: 50%; background: hsl(var(--ff-hue, 150) 33% 79%); color: hsl(var(--ff-hue, 150) 28% 25%); font-size: 17px; font-weight: 650; box-shadow: 0 3px 9px rgb(0 0 0 / 12%); }
.ff-pin-avatar .ff-avatar { width: 100%; height: 100%; border-radius: 50%; font-size: 15px; }
.ff-pin-count { position: absolute; top: -6px; right: -7px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 1px 4px; border: 2px solid var(--surface); border-radius: 10px; background: var(--accent); color: var(--surface); font-size: 10px; font-weight: 650; line-height: 1; }
.ff-city-label { max-width: 90px; padding: 2px 7px; border: 1px solid color-mix(in srgb, var(--line) 65%, transparent); border-radius: 20px; background: color-mix(in srgb, var(--surface) 94%, transparent); color: var(--muted); font-size: 11px; white-space: nowrap; }
.ff-city-pin.is-active .ff-pin-avatar { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 13%, transparent), 0 3px 12px rgb(0 0 0 / 13%); }
.ff-city-pin.is-active .ff-city-label { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.ff-self-pin { position: absolute; top: var(--ff-y, 50%); left: var(--ff-x, 50%); z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 3px; margin-top: -12px; margin-left: 42px; transform: translate(-50%, -50%); pointer-events: none; }
.ff-self-avatar { display: grid; place-items: center; width: 33px; height: 33px; border: 2px solid var(--accent); border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 650; box-shadow: 0 2px 8px rgb(0 0 0 / 8%); }
.ff-self-pin > span:not(.ff-self-avatar) { padding: 2px 6px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: 10px; background: var(--surface); color: var(--accent); font-size: 9px; white-space: nowrap; }
.ff-privacy-status { margin: 10px 12px 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--ff-soft); color: var(--muted); font-size: 10px; line-height: 1.65; }
.ff-privacy-status strong { color: var(--text); }
.ff-self-row { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 12px 10px; border: 1px solid color-mix(in srgb, var(--self) 30%, var(--line)); border-radius: 13px; background: color-mix(in srgb, var(--self) 6%, var(--surface)); }
.ff-self-row > .ff-avatar { width: 40px; height: 40px; border-radius: 13px; font-size: 17px; }
.ff-self-row .ff-chip { flex: none; font-size: 9px; }

.ff-city-summary { display: flex; flex-direction: column; gap: 13px; min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: var(--ff-radius); background: var(--surface); }
.ff-city-summary h3 { font-size: 18px; line-height: 1.4; }
.ff-city-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.ff-city-heading .ff-eyebrow { margin-bottom: 5px; font-size: 9px; letter-spacing: 1px; }
.ff-city-heading h2 { font-size: 21px; line-height: 1.3; }
.ff-city-heading h2 > span { padding-left: 4px; color: var(--hint); font-size: 13px; font-weight: 400; }
.ff-city-summary > p { color: var(--muted); font-size: 12px; }
.ff-filter-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.ff-filter-label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
html body .ff-shell .ff-select { width: auto; max-width: 100%; min-height: 34px; padding: 5px 26px 5px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font-size: 12px; }
.ff-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 6px; background: var(--ff-soft); color: var(--accent); font-size: 11px; line-height: 1.45; }
.ff-active-filters .ff-tags { margin-top: 0; }
.ff-profile-grid { display: grid; gap: 9px; min-width: 0; }
html body .ff-shell .ff-mini-card { display: flex; align-items: flex-start; gap: 11px; width: 100%; min-width: 0; padding: 13px 11px; border: 1px solid var(--line); border-radius: 13px; background: color-mix(in srgb, var(--surface) 95%, var(--bg)); text-align: start; }
.ff-avatar { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border-radius: 16px; background: hsl(var(--ff-hue, 150) 30% 87%); color: hsl(var(--ff-hue, 150) 31% 31%); font-size: 21px; font-weight: 600; overflow: hidden; }
.ff-avatar img, .ff-map-place-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.ff-avatar-large { width: 88px; height: 88px; border-radius: 24px; font-size: 36px; }
.ff-location-badge { display: inline-flex; align-items: center; align-self: flex-start; max-width: 100%; padding: 3px 7px; border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 11px; white-space: normal; overflow-wrap: anywhere; }
.ff-location-badge.is-device { color: #126d50; background: #e7f4ed; }
.ff-data-credit { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 9px; line-height: 1.2; }
.ff-data-credit a { color: var(--muted); }
.ff-tone-0 { --ff-hue: 154; }
.ff-tone-1 { --ff-hue: 206; }
.ff-tone-2 { --ff-hue: 24; }
.ff-tone-3 { --ff-hue: 278; }
.ff-tone-4 { --ff-hue: 343; }
.ff-tone-5 { --ff-hue: 78; }
.ff-mini-info { flex: 1; min-width: 0; }
.ff-mini-info strong { font-size: 14px; }
.ff-mini-info .ff-name-row { gap: 3px 6px; }
.ff-mini-info .ff-name-row strong { color: var(--text); font-size: 14px; }
.ff-mini-info .ff-name-row > span { font-size: 10px; }
.ff-mini-sub { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.ff-mini-arrow { flex: none; margin-top: 2px; color: var(--hint); font-size: 16px; }
.ff-mini-info p { margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.ff-mini-info > span { color: var(--muted); font-size: 11px; }
.ff-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.ff-tag { display: inline-flex; align-items: center; padding: 3px 7px; border: 1px solid var(--line); border-radius: 6px; background: color-mix(in srgb, var(--surface) 65%, var(--bg)); color: var(--muted); font-size: 10px; line-height: 1.4; }

/* 全球探索：地图和城市列表占据同一内容槽，地图页不产生正文长滚屏。 */
.ff-shell [hidden] { display: none !important; }
.ff-entry-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ff-world-page, .ff-place-page { display: flex; flex: 1; flex-direction: column; gap: 9px; min-width: 0; min-height: 0; overflow: hidden; }
.ff-world-toolbar { position: relative; z-index: 8; display: flex; align-items: center; flex: none; gap: 7px; min-width: 0; }
.ff-world-toolbar > :is(label, .ff-search-box, .ff-world-search) { display: flex; flex: 1; align-items: center; min-width: 0; }
.ff-world-search { position: relative; }
.ff-search-icon { position: absolute; top: 50%; inset-inline-start: 10px; color: var(--muted); font-size: 17px; transform: translateY(-50%); pointer-events: none; }
html body .ff-shell .ff-world-toolbar input { flex: 1; width: 100%; min-width: 0; min-height: 41px; margin: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--text); font: inherit; font-size: 16px; line-height: 1.4; appearance: none; box-shadow: none; }
.ff-world-toolbar input::placeholder { color: var(--hint); font-size: 12px; }
html body .ff-shell .ff-world-search input { padding-inline-start: 29px; }
html body .ff-shell .ff-world-toolbar .ff-button { flex: none; min-height: 41px; padding: 8px 10px; font-size: 11px; white-space: nowrap; }
.ff-search-results { position: absolute; top: calc(100% + 6px); right: 0; left: 0; z-index: 12; display: grid; gap: 3px; max-height: min(46dvh, 340px); padding: 5px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--ff-shadow); scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.ff-search-results:empty { display: none; }
html body .ff-shell .ff-search-results :is(button[data-ff-action], [role="option"]) { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-width: 0; min-height: 45px; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); text-align: start; font-size: 12px; }
.ff-search-results .ff-search-result > :first-child { flex: 1; min-width: 0; }
.ff-search-results .ff-search-result > :last-child { flex: none; max-width: 40%; }
.ff-search-results strong { display: block; overflow-wrap: anywhere; unicode-bidi: plaintext; font-size: 12px; font-weight: 600; }
.ff-search-results small { display: block; margin-top: 2px; overflow-wrap: anywhere; unicode-bidi: plaintext; color: var(--muted); font-size: 10px; }
.ff-search-results > p, .ff-search-empty { padding: 10px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.ff-world-stage { position: relative; flex: 1; min-width: 0; min-height: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: color-mix(in srgb, var(--surface) 74%, var(--accent-soft)); }
.ff-world-canvas { position: absolute; inset: 0; width: 100%; height: 100%; min-width: 0; min-height: 0; touch-action: none; }
.ff-world-canvas :is(.maplibregl-canvas-container, .maplibregl-canvas) { touch-action: none; }
.ff-world-footer { display: flex; flex-direction: column; align-items: stretch; flex: none; gap: 5px; min-width: 0; color: var(--hint); font-size: 10px; line-height: 1.5; }
.ff-world-footer-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-width: 0; }
.ff-world-stat { min-width: 0; overflow: hidden; color: var(--hint); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.ff-world-footer-line .ff-chip { flex: none; padding: 2px 5px; font-size: 9px; }
.ff-world-footer > p { min-width: 0; }
.ff-world-footer .ff-note, .ff-world-footer .ff-privacy-status { margin: 0; padding: 0; border: 0; background: transparent; font-size: 10px; line-height: 1.5; }
.ff-world-footer .ff-privacy-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-width: 0; min-height: 32px; color: var(--muted); }
.ff-world-footer .ff-privacy-status > span { flex: 1; min-width: 0; overflow: hidden; unicode-bidi: plaintext; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
html body .ff-shell .ff-world-footer .ff-privacy-status .ff-button { flex: none; max-width: 42%; min-height: 31px; padding: 6px 9px; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.ff-destination { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 7px; width: 100%; min-width: 0; min-height: 43px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 11px; background: var(--ff-soft); }
.ff-destination > span { min-width: 0; }
.ff-destination strong { display: block; overflow: hidden; unicode-bidi: plaintext; color: var(--text); font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.ff-destination small { display: block; margin-top: 1px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
html body .ff-shell .ff-destination .ff-button { min-height: 31px; padding: 6px 9px; font-size: 10px; white-space: nowrap; }
html body .ff-shell .ff-destination [data-ff-action="clear-destination"] { width: 27px; min-height: 27px; padding: 3px; border-color: transparent; background: transparent; color: var(--muted); font-size: 16px; }
.ff-world-status, .ff-map-status { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; background: var(--surface); color: var(--muted); font-size: 12px; line-height: 1.7; text-align: center; }
.ff-world-status h3, .ff-map-status h3 { color: var(--text); font-size: 16px; }
.ff-map-fallback { display: grid; justify-items: center; gap: 11px; width: 100%; max-width: 310px; }
.ff-map-fallback p { font-size: 12px; line-height: 1.7; }
.ff-loading-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: ff-loading-pulse 1.2s ease-in-out infinite; }
@keyframes ff-loading-pulse { 50% { opacity: .35; } }

/* 经纬度位置完全由地图引擎控制；这里只处理点位的外观，不移动地理锚点。 */
html body .ff-shell .ff-map-place { display: flex; flex-direction: column; align-items: center; gap: 3px; width: max-content; min-width: 0; min-height: 0; margin: 0; padding: 3px; border: 0; border-image: none; border-radius: 11px; clip-path: none; background: transparent; color: var(--text); font: inherit; line-height: 1.35; box-shadow: none; cursor: pointer; touch-action: manipulation; }
.ff-map-place-dot { display: block; width: 9px; height: 9px; border: 2px solid var(--surface); border-radius: 50%; background: var(--accent); box-shadow: 0 1px 4px rgb(0 0 0 / 15%); }
.ff-map-place-avatar { display: grid; place-items: center; width: 33px; height: 33px; border: 2px solid var(--surface); border-radius: 50%; background: hsl(var(--ff-hue, 150) 30% 85%); color: hsl(var(--ff-hue, 150) 31% 29%); font-size: 14px; font-weight: 650; box-shadow: 0 2px 7px rgb(0 0 0 / 14%); }
.ff-map-place:not(.has-people) .ff-map-place-avatar, .ff-map-place.has-people .ff-map-place-dot { display: none; }
.ff-map-place-name { display: block; max-width: 106px; padding: 2px 5px; overflow: hidden; unicode-bidi: plaintext; border: 1px solid color-mix(in srgb, var(--line) 76%, transparent); border-radius: 6px; background: color-mix(in srgb, var(--surface) 94%, transparent); color: var(--muted); font-size: 10px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.ff-map-place.has-people .ff-map-place-name { color: var(--text); font-weight: 600; }
.ff-map-place.is-cluster .ff-map-place-avatar { box-shadow: 4px -3px 0 -1px var(--surface), 7px -5px 0 -1px var(--line), 0 2px 7px rgb(0 0 0 / 14%); }
.ff-map-place-count { position: absolute; top: -3px; left: calc(50% + 5px); display: grid; place-items: center; min-width: 19px; height: 19px; padding: 1px 4px; border: 2px solid var(--surface); border-radius: 10px; background: var(--accent); color: var(--surface); direction: ltr; unicode-bidi: isolate; font-size: 9px; font-weight: 650; line-height: 1; }
html body .ff-shell .ff-map-country-label { width: max-content; max-width: 150px; min-width: 0; min-height: 0; margin: 0; padding: 4px 6px; overflow: hidden; unicode-bidi: plaintext; border: 0; border-image: none; border-radius: 7px; clip-path: none; background: color-mix(in srgb, var(--surface) 50%, transparent); color: var(--muted); font: inherit; font-size: 11px; font-weight: 600; line-height: 1.5; text-align: center; text-overflow: ellipsis; white-space: nowrap; box-shadow: none; cursor: pointer; touch-action: manipulation; }
html body .ff-shell :is(.ff-map-place, .ff-map-country-label):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* MapLibre 样式会延迟加载，限定控件规则的层级高于图库和主题全局规则。 */
.ff-world-canvas .maplibregl-ctrl-group { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: 0 3px 14px color-mix(in srgb, var(--text) 10%, transparent); }
html body .ff-shell .ff-world-canvas .maplibregl-ctrl-group button { width: 34px; height: 34px; min-width: 34px; min-height: 34px; margin: 0; padding: 0; border: 0; border-image: none; border-radius: 0; clip-path: none; background: var(--surface); color: var(--text); box-shadow: none; font: inherit; line-height: 1; cursor: pointer; touch-action: manipulation; }
html body .ff-shell .ff-world-canvas .maplibregl-ctrl-group button + button { border-top: 1px solid var(--line); }
html body .ff-shell .ff-world-canvas .maplibregl-ctrl-group button:disabled { opacity: .45; }
.ff-world-canvas .maplibregl-ctrl-group .maplibregl-ctrl-icon { background-size: 20px; }
html[data-theme="sanctuary"] .ff-world-canvas .maplibregl-ctrl-group .maplibregl-ctrl-icon { filter: invert(1); }
.ff-world-canvas .maplibregl-ctrl-attrib { max-width: calc(100% - 62px); padding: 0 6px; border-radius: 7px 0 0 0; background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--muted); font-size: 9px; line-height: 17px; }
.ff-world-canvas .maplibregl-ctrl-attrib a { color: var(--muted); }
html body .ff-shell .ff-world-canvas .maplibregl-ctrl-attrib-button { width: 24px; height: 24px; min-width: 24px; min-height: 24px; margin: 0; padding: 0; border: 0; border-image: none; border-radius: 50%; clip-path: none; background-color: var(--surface); box-shadow: none; }

/* 城市/国家详情：信息与筛选固定，仅列表区域竖向滚动。 */
.ff-place-header { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; flex: none; gap: 8px 10px; min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.ff-place-header > :is(h2, h3) { align-self: center; font-size: 20px; line-height: 1.4; }
.ff-place-header h2 { overflow-wrap: anywhere; unicode-bidi: plaintext; font-size: 20px; line-height: 1.4; }
.ff-place-header > div { min-width: 0; }
.ff-place-header .ff-eyebrow { margin-bottom: 3px; font-size: 9px; letter-spacing: 1px; }
.ff-place-header > div > p { max-height: 52px; margin-top: 3px; overflow-y: auto; color: var(--muted); font-size: 11px; line-height: 1.55; }
.ff-place-header > .ff-place-meta { grid-column: 1 / -1; }
html body .ff-shell .ff-back-button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 34px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--muted); font-size: 11px; white-space: nowrap; }
.ff-place-meta { display: flex; flex-wrap: wrap; gap: 4px 9px; max-height: 98px; min-width: 0; overflow-y: auto; color: var(--muted); font-size: 11px; line-height: 1.65; scrollbar-width: thin; }
.ff-place-meta > p { margin: 0; }
.ff-place-meta > span { min-width: 0; overflow-wrap: anywhere; }
.ff-shell bdi { unicode-bidi: isolate; }
.ff-place-meta strong, .ff-place-meta time { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.ff-place-meta small { color: var(--hint); font-size: 10px; }
.ff-place-details { flex: none; width: 100%; min-width: 0; padding: 6px 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--muted); font-size: 11px; }
.ff-place-details > summary { padding: 4px 0; cursor: pointer; }
.ff-place-details[open] > :not(summary) { max-height: min(24dvh, 140px); overflow-y: auto; }
.ff-place-details .ff-place-meta { margin-top: 4px; }
.ff-local-time { color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.ff-place-summary { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; flex: none; gap: 4px 9px; min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--ff-soft); color: var(--muted); font-size: 11px; line-height: 1.6; }
.ff-place-summary strong { color: var(--text); font-weight: 600; }
.ff-place-summary h3 { color: var(--text); font-size: 13px; }
.ff-place-summary p { font-size: 10px; }
.ff-place-filters { display: flex; align-items: center; flex-wrap: wrap; flex: none; gap: 7px 10px; min-width: 0; padding: 0 2px; }
.ff-place-filters .ff-filter-label { font-size: 11px; }
html body .ff-shell .ff-place-filters .ff-select { min-height: 33px; padding-top: 5px; padding-bottom: 5px; font-size: 11px; }
.ff-place-list { display: flex; flex: 1; flex-direction: column; gap: 9px; min-width: 0; min-height: 0; padding: 0 2px 2px; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-gutter: stable; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.ff-place-list > * { flex: none; }
.ff-country-people { display: grid; gap: 9px; }
.ff-country-people h3, .ff-place-list > h3 { color: var(--text); font-size: 13px; font-weight: 600; }
.ff-city-people-count { white-space: nowrap; }
html body .ff-shell .ff-load-more { width: 100%; min-height: 36px; }
html body .ff-shell .ff-profile-row, html body .ff-shell .ff-country-city-row { display: flex; align-items: flex-start; gap: 11px; width: 100%; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--text); font-size: 12px; text-align: start; }
.ff-profile-row > .ff-avatar { width: 43px; height: 43px; border-radius: 14px; font-size: 18px; }
.ff-profile-row strong, .ff-country-city-row strong { font-size: 14px; font-weight: 600; }
.ff-profile-row small, .ff-country-city-row small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.ff-country-city-row { align-items: center !important; justify-content: space-between; }
.ff-country-city-row > :first-child { flex: 1; min-width: 0; }
.ff-country-city-row > :first-child :is(strong, small), .ff-profile-row .ff-mini-sub { display: block; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.ff-country-city-row > :last-child { flex: none; color: var(--muted); font-size: 11px; }
.ff-place-list .ff-empty { margin: 0; padding: 26px 16px; background: var(--surface); font-size: 12px; }
.ff-place-list .ff-empty h3 { color: var(--text); font-size: 15px; }
.ff-match-placeholder { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 12px; width: 100%; max-width: 640px; min-width: 0; min-height: 0; margin: 0 auto; padding: 26px 20px; overflow-y: auto; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(150deg, var(--surface), var(--ff-soft)); color: var(--muted); font-size: 13px; line-height: 1.75; text-align: center; }
.ff-match-placeholder h2 { color: var(--text); font-size: 22px; font-weight: 600; }
.ff-match-placeholder > span:first-child { color: var(--self); font-size: 32px; }
.ff-match-placeholder p { max-width: 32em; }
.ff-match-placeholder .ff-note { max-width: 34em; font-size: 11px; }
.ff-match-symbol { color: var(--self); font-size: 32px; }
.ff-title-text { white-space: nowrap; }
.ff-modal-host { flex: none; min-width: 0; }
.ff-own-city-results { display: grid; gap: 2px; max-height: 210px; padding: 4px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); scrollbar-width: thin; }
.ff-own-city-results:empty { display: none; }
html body .ff-shell .ff-own-city-results .ff-search-result { display: block; width: 100%; min-height: 41px; padding: 8px; border: 0; background: transparent; color: var(--text); text-align: start; }
.ff-own-city-results .ff-search-result strong { display: block; font-size: 12px; }
.ff-own-city-results .ff-search-result small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.ff-own-city-selection { display: flex; align-items: center; justify-content: space-between; gap: 9px; min-width: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--ff-soft); color: var(--muted); font-size: 11px; }
.ff-own-city-selection strong { min-width: 0; color: var(--text); font-size: 12px; overflow-wrap: anywhere; }
html body .ff-shell .ff-own-city-selection .ff-button { flex: none; min-height: 30px; padding: 5px 8px; font-size: 10px; }

/* 滑卡以风景和几何人物呈现示例资料，避免制造真实照片的错觉。 */
.ff-swipe-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; min-width: 0; }
.ff-swipe-card { width: 100%; max-width: 465px; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 25px; background: var(--surface); box-shadow: var(--ff-shadow); touch-action: pan-y; transition: transform 200ms ease, opacity 200ms ease; }
.ff-portrait { position: relative; display: grid; place-items: center; height: 250px; overflow: hidden; background: linear-gradient(155deg, hsl(var(--ff-hue, 145) 26% 88%) 0%, hsl(calc(var(--ff-hue, 145) + 28) 31% 76%) 65%, hsl(var(--ff-hue, 145) 27% 62%) 100%); isolation: isolate; }
.ff-portrait::before { position: absolute; top: 24px; right: 30px; width: 66px; height: 66px; border: 1px solid rgb(255 255 255 / 45%); border-radius: 50%; background: rgb(255 255 255 / 35%); content: ""; }
.ff-portrait::after { position: absolute; right: -14%; bottom: -68%; left: -24%; z-index: -1; height: 115%; border-radius: 48% 60% 0 0; background: hsl(var(--ff-hue, 145) 25% 61% / .6); transform: rotate(-12deg); content: ""; }
.ff-portrait > svg { position: relative; z-index: 1; display: block; width: 100%; height: 100%; }
.ff-portrait-label { position: absolute; bottom: 10px; left: 11px; z-index: 2; padding: 4px 8px; border: 1px solid rgb(255 255 255 / 35%); border-radius: 6px; background: rgb(255 255 255 / 70%); color: #485953; font-size: 10px; }
.ff-portrait > .ff-avatar { width: 110px; height: 110px; border: 5px solid rgb(255 255 255 / 65%); border-radius: 40px; background: rgb(255 255 255 / 38%); font-size: 45px; box-shadow: 0 8px 28px rgb(0 0 0 / 7%); }
.ff-portrait-shape { position: absolute; bottom: -35px; left: 50%; width: 180px; height: 160px; border-radius: 80px 80px 24px 24px; background: hsl(var(--ff-hue, 145) 27% 39%); transform: translateX(-50%); }
.ff-portrait-face { position: absolute; bottom: 89px; left: 50%; width: 74px; height: 92px; border-radius: 42% 42% 48% 48%; background: #efd5bb; transform: translateX(-50%); }
.ff-portrait-hair { position: absolute; bottom: 149px; left: 50%; width: 79px; height: 42px; border-radius: 55% 55% 28% 20%; background: #49423d; transform: translateX(-50%) rotate(-7deg); }
.ff-card-body { padding: 19px 21px 20px; }
.ff-name-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px; }
.ff-name-row h2, .ff-name-row h3, .ff-name-row strong { font-size: 23px; font-weight: 650; line-height: 1.3; }
.ff-name-row h2 > span { color: var(--muted); font-size: 16px; font-weight: 400; }
.ff-name-row > span { color: var(--muted); font-size: 12px; }
.ff-card-bio { margin-top: 10px !important; color: var(--muted); font-size: 13px; line-height: 1.75; }
.ff-card-facts { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; color: var(--muted); font-size: 11px; }
.ff-card-facts > span { display: inline-flex; align-items: center; gap: 4px; }
.ff-card-body .ff-tags { margin-top: 12px; }
.ff-card-body .ff-tag { padding: 4px 8px; font-size: 11px; }
.ff-card-body .ff-note { margin-top: 14px; }
.ff-card-actions { display: flex; align-items: center; justify-content: center; gap: 18px; width: 100%; }
html body .ff-shell .ff-action-button { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 112px; min-height: 48px; padding: 11px 19px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 13px; box-shadow: 0 3px 11px color-mix(in srgb, var(--text) 4%, transparent); }
html body .ff-shell .ff-action-button.is-like { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.ff-action-button svg { width: 19px; height: 19px; flex: none; }
.ff-gesture-hint { color: var(--hint); font-size: 11px; text-align: center; }
.ff-like-panel { display: flex; flex-direction: column; gap: 14px; align-self: start; min-width: 0; padding: 20px 18px; border: 1px solid var(--line); border-radius: var(--ff-radius); background: var(--surface); }
.ff-like-panel h2, .ff-like-panel h3 { font-size: 17px; }
.ff-like-panel > p { color: var(--muted); font-size: 12px; line-height: 1.65; }
.ff-likes-stack { display: flex; align-items: center; gap: 10px; padding: 7px 0 2px; }
.ff-likes-stack > div, .ff-likes-stack > article { display: flex; align-items: center; gap: 11px; min-width: 0; min-height: 63px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.ff-likes-stack strong { display: block; color: var(--text); font-size: 12px; }
.ff-likes-stack p, .ff-likes-stack small { color: var(--muted); font-size: 11px; }
.ff-blurred-avatar { display: grid; place-items: center; flex: none; width: 40px; height: 40px; overflow: hidden; border-radius: 50%; background: hsl(var(--ff-hue, 210) 25% 82%); color: hsl(var(--ff-hue, 210) 27% 43%); font-size: 25px; filter: blur(5px); opacity: .8; }
.ff-likes-stack > .ff-blurred-avatar { width: 48px; height: 48px; }
.ff-blurred-avatar .ff-avatar { width: 100%; height: 100%; border-radius: inherit; }
.ff-likes-count { color: var(--muted); font-size: 12px; }
.ff-likes-count strong { margin-right: 3px; color: var(--text); font-size: 24px; font-weight: 600; }
.ff-revealed { display: grid; gap: 9px; padding-top: 13px; border-top: 1px solid var(--line); }
.ff-revealed h3 { font-size: 13px; }
.ff-mutual { display: grid; gap: 9px; padding: 13px; border: 1px solid color-mix(in srgb, var(--self) 28%, var(--line)); border-radius: 13px; background: color-mix(in srgb, var(--self) 7%, var(--surface)); color: var(--self); font-size: 12px; }
.ff-mutual strong { font-size: 14px; }
.ff-mutual p { color: var(--muted); }
.ff-mutual h3 { font-size: 13px; }
.ff-mutual-row { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.ff-mutual-row > .ff-avatar { width: 35px; height: 35px; border-radius: 11px; font-size: 15px; }
.ff-mutual-row > span { flex: 1; color: var(--text); font-size: 12px; }
.ff-mutual-row small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
html body .ff-shell .ff-mutual-row .ff-button { min-height: 33px; padding: 6px 9px; font-size: 10px; }
.ff-section-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; max-width: 465px; color: var(--muted); font-size: 11px; }
.ff-section-top .ff-eyebrow { margin: 0; font-size: 9px; letter-spacing: 1.2px; }

.ff-daily-card { min-width: 0; padding: 22px; border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line)); border-radius: var(--ff-radius); background: linear-gradient(145deg, var(--surface), var(--ff-soft)); }
.ff-daily-card > h2 { font-size: 23px; font-weight: 650; line-height: 1.45; }
.ff-daily-intro { margin-top: 7px !important; color: var(--muted); font-size: 12px; line-height: 1.7; }
.ff-daily-top { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.ff-daily-kicker { display: block; margin-bottom: 7px; color: var(--accent); font-size: 11px; font-weight: 650; letter-spacing: 1.4px; }
.ff-daily-top h3 { font-size: 21px; font-weight: 650; }
.ff-daily-top p { margin-top: 6px; color: var(--muted); font-size: 12px; }
.ff-daily-card > .ff-mini-card { padding: 0; border: 0; background: transparent; }
.ff-daily-card .ff-avatar { width: 64px; height: 64px; border-radius: 21px; font-size: 26px; }
.ff-daily-card .ff-mini-info strong { font-size: 20px; }
.ff-daily-card .ff-card-bio { margin-top: 18px !important; font-size: 14px; }
.ff-daily-person { display: grid; grid-template-columns: 95px minmax(0, 1fr); gap: 13px; align-items: start; margin-top: 24px; }
.ff-daily-person > .ff-portrait { height: 145px; border-radius: 14px; }
.ff-daily-person .ff-portrait-label { display: none; }
.ff-daily-person-copy { min-width: 0; }
.ff-daily-person-copy .ff-eyebrow { font-size: 9px; letter-spacing: 1px; }
.ff-daily-person-copy h3 { font-size: 19px; }
.ff-daily-person-copy h3 span { color: var(--muted); font-size: 13px; font-weight: 400; }
.ff-daily-person-copy > p:not(.ff-card-bio) { margin-top: 6px; color: var(--muted); font-size: 10px; }
.ff-daily-person-copy .ff-card-bio { margin-top: 10px !important; font-size: 12px; }
.ff-daily-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 13px; }
.ff-daily-checklist { display: grid; gap: 9px; margin: 20px 0; padding: 16px 0; list-style: none; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ff-check { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.ff-check > svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--self); }
.ff-check > span:first-child { color: var(--self); }
.ff-daily-checklist h3 { margin-bottom: 4px; font-size: 13px; }
.ff-daily-aside { display: flex; flex-direction: column; gap: 14px; align-self: start; min-width: 0; padding: 19px; border: 1px solid var(--line); border-radius: var(--ff-radius); background: var(--surface); }
.ff-daily-aside h3 { font-size: 16px; }
.ff-daily-aside p { color: var(--muted); font-size: 12px; line-height: 1.75; }
.ff-daily-aside ol, .ff-daily-aside ul { display: grid; gap: 10px; margin: 0; padding-left: 18px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.ff-preference-list { display: grid; gap: 11px; margin: 0; }
.ff-preference-list > div { padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.ff-preference-list dt { color: var(--hint); font-size: 10px; }
.ff-preference-list dd { margin: 4px 0 0; color: var(--text); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }

html body .ff-shell .ff-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--text); font-size: 12px; font-weight: 600; }
html body .ff-shell .ff-button.is-primary { background: var(--accent); border-color: var(--accent); color: var(--surface); }
html body .ff-shell .ff-button.is-quiet { background: var(--ff-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 15%, var(--line)); }
.ff-button svg { width: 16px; height: 16px; flex: none; }
.ff-empty { display: grid; justify-items: center; gap: 10px; padding: 34px 16px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); font-size: 13px; text-align: center; }
.ff-note { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: color-mix(in srgb, var(--surface) 80%, var(--bg)); color: var(--hint); font-size: 11px; line-height: 1.7; }
.ff-toast { position: fixed; right: 20px; bottom: calc(var(--main-nav-height, 64px) + 15px); left: 20px; z-index: 72; width: max-content; max-width: min(460px, calc(100vw - 40px)); margin: auto; padding: 11px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font-size: 12px; text-align: center; box-shadow: var(--ff-shadow); pointer-events: none; }
.ff-toast:empty { display: none; }

/* 弹窗在浏览器可视区域内滚动，保留窄屏键盘和安全区的空间。 */
.ff-modal-layer { position: fixed; inset: 0; z-index: 65; display: flex; align-items: center; justify-content: center; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background: color-mix(in srgb, var(--text) 34%, transparent); backdrop-filter: blur(4px); }
.ff-modal { width: 100%; max-width: 550px; max-height: calc(var(--app-height, 100dvh) - max(16px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom))); min-width: 0; min-height: 0; padding: 0 20px 20px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); color: var(--text); box-shadow: 0 18px 70px rgb(0 0 0 / 20%); -webkit-overflow-scrolling: touch; }
.ff-modal-header { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 -20px 16px; padding: 17px 16px 13px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.ff-modal-header h2, .ff-modal-header h3 { font-size: 18px; }
html body .ff-shell .ff-close { display: grid; place-items: center; flex: none; width: 36px; min-height: 36px; padding: 5px; border: 1px solid var(--line); border-radius: 50%; background: var(--bg); color: var(--muted); font-size: 20px; line-height: 1; }
.ff-modal > p { margin-bottom: 14px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.ff-modal-body { min-width: 0; }
.ff-profile-facts { display: grid; gap: 10px; margin: 16px 0; }
.ff-profile-facts > div { display: grid; grid-template-columns: minmax(70px, 1fr) minmax(0, 2fr); gap: 12px; font-size: 13px; }
.ff-profile-facts dt { color: var(--muted); }
.ff-profile-facts dd { margin: 0; overflow-wrap: anywhere; unicode-bidi: plaintext; }
.ff-profile-status { min-height: 1.4em; color: var(--accent); font-size: 12px; overflow-wrap: anywhere; }
html body .ff-shell .ff-profile-row .ff-mini-arrow { max-width: 5em; font-size: 11px; line-height: 1.5; white-space: normal; }
.ff-modal-footer { position: sticky; bottom: -20px; z-index: 2; margin-bottom: -20px; padding-bottom: 20px; background: var(--surface); }
.ff-modal-body > p { margin: 12px 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.ff-modal-body > .ff-portrait { height: 245px; margin-bottom: 17px; border-radius: 15px; }
.ff-modal-body > .ff-tags { margin-bottom: 12px; }
.ff-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
.ff-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--muted); font-size: 12px; }
.ff-field-wide { grid-column: 1 / -1; }
html body .ff-shell .ff-field :is(input, select, textarea) { width: 100%; min-height: 41px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--text); font-size: 16px; }
html body .ff-shell .ff-field textarea { min-height: 86px; resize: vertical; }
html body .ff-shell .ff-field input[type="checkbox"] { width: 16px; min-height: 16px; margin: 0; padding: 0; accent-color: var(--accent); }
.ff-field small { color: var(--hint); font-size: 10px; line-height: 1.6; }
.ff-option-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.ff-shell .ff-option { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 11px; cursor: pointer; }
.ff-shell .ff-option.is-selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
html body .ff-shell .ff-option { min-height: 34px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); font-size: 11px; }
html body .ff-shell .ff-option.is-selected, html body .ff-shell .ff-option[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.ff-checkbox { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: 12px; line-height: 1.6; }
html body .ff-shell .ff-checkbox input[type="checkbox"] { flex: none; margin-top: 2px; }
.ff-form-error { margin-top: 13px !important; color: var(--danger, #a32d2d) !important; font-size: 12px; }
.ff-form-error:empty { display: none; }
.ff-modal-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.ff-unlock-orbit { display: grid; place-items: center; width: 108px; height: 108px; margin: 22px auto 18px; border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); border-radius: 50%; background: radial-gradient(circle, var(--surface) 44%, var(--accent-soft) 45%, var(--accent-soft) 61%, var(--surface) 62%); color: var(--accent); font-size: 35px; }
.ff-unlock-orbit svg { width: 31px; height: 31px; }
.ff-unlock-title { margin: 0 0 13px !important; font-size: 18px; text-align: center; }
.ff-countdown { display: grid; justify-items: center; gap: 7px; margin: 14px 0; color: var(--accent); font-size: 28px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.ff-countdown strong { color: var(--accent); font-size: 28px; font-weight: 600; }
.ff-progress { display: block; width: 100%; height: 6px; margin: 16px 0; overflow: hidden; border: 0; border-radius: 999px; background: var(--line); accent-color: var(--accent); }
.ff-progress > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 250ms linear; }
.ff-progress::-webkit-progress-bar { border-radius: inherit; background: var(--line); }
.ff-progress::-webkit-progress-value { border-radius: inherit; background: var(--accent); }
.ff-progress::-moz-progress-bar { border-radius: inherit; background: var(--accent); }

@media (hover: hover) {
  html body .ff-shell .ff-tab:not(.is-active):hover { color: var(--accent); background: var(--ff-soft); }
  html body .ff-shell :is(.ff-button, .ff-profile-button, .ff-option, .ff-close):not(:disabled):hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
  html body .ff-shell .ff-city-pin:hover { transform: translate(-50%, -50%) scale(1.06); }
  html body .ff-shell .ff-action-button:not(:disabled):hover { transform: translateY(-2px); }
  html body .ff-shell .ff-search-results button[data-ff-action]:hover { background: var(--ff-soft); }
  html body .ff-shell :is(.ff-profile-row, .ff-country-city-row):hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
  .ff-map-place:hover .ff-map-place-name { border-color: var(--accent); color: var(--accent); }
  .ff-map-place:hover .ff-map-place-avatar { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
  html body .ff-shell .ff-map-country-label:hover { background: var(--surface); color: var(--accent); }
  html body .ff-shell .ff-world-canvas .maplibregl-ctrl-group button:not(:disabled):hover { background-color: var(--accent-soft); }
}

@media (min-width: 600px) {
  .ff-header { padding: calc(12px + env(safe-area-inset-top, 0px)) 18px 10px; }
  .ff-tabs { margin-right: 18px; margin-left: 18px; }
  .ff-panel { padding-right: 18px; padding-left: 18px; padding-bottom: 16px; }
  .ff-lead { font-size: 11px; }
  html body .ff-shell .ff-profile-button { padding: 8px 11px; font-size: 11px; }
  .ff-map-panel { min-height: 410px; }
  .ff-portrait { height: 290px; }
  .ff-daily-card { padding: 27px; }
  .ff-daily-person { grid-template-columns: 150px minmax(0, 1fr); gap: 19px; }
  .ff-daily-person > .ff-portrait { height: 200px; }
}

@media (min-width: 820px) {
  .ff-map-layout { grid-template-columns: minmax(0, 1.5fr) minmax(285px, 1fr); align-items: start; }
  .ff-map-panel { min-height: 460px; }
  .ff-swipe-layout { grid-template-columns: minmax(0, 1.5fr) minmax(285px, 1fr); align-items: start; }
  .ff-daily-layout { grid-template-columns: minmax(0, 1.5fr) minmax(285px, 1fr); align-items: start; }
  .ff-city-summary { max-height: 540px; overflow-y: auto; scrollbar-width: thin; }
  .ff-swipe-stage { padding: 0 12px 12px; }
  .ff-like-panel { margin-top: 8px; }
  .ff-portrait { height: 270px; }
}

@media (max-width: 359px) {
  .ff-header { align-items: flex-start; gap: 8px; padding-right: 12px; padding-left: 12px; }
  .ff-heading h1, .ff-heading h2 { font-size: 20px; }
  html body .ff-shell .ff-profile-button { padding: 7px 8px; font-size: 10px; }
  .ff-tabs { margin-right: 12px; margin-left: 12px; }
  html body .ff-shell .ff-tab { gap: 4px; font-size: 11px; }
  .ff-panel { padding-right: 12px; padding-left: 12px; }
  .ff-map-panel { min-height: 310px; }
  .ff-pin-avatar { width: 38px; height: 38px; font-size: 15px; }
  .ff-city-label { font-size: 10px; }
  .ff-card-body { padding: 17px; }
  .ff-daily-card { padding: 17px; }
  .ff-form-grid { grid-template-columns: minmax(0, 1fr); }
  .ff-place-header { padding: 10px; gap: 6px 8px; }
  .ff-place-header h2 { font-size: 18px; }
  .ff-place-meta { max-height: 76px; font-size: 10px; }
  .ff-place-summary { padding: 7px 9px; font-size: 10px; }
  html body .ff-shell .ff-world-toolbar .ff-button { padding-right: 8px; padding-left: 8px; font-size: 10px; }
  .ff-world-footer, .ff-world-footer .ff-note, .ff-world-footer .ff-privacy-status { font-size: 9px; }
  .ff-place-list { gap: 7px; }
  html body .ff-shell .ff-profile-row, html body .ff-shell .ff-country-city-row { padding: 10px; gap: 9px; }
  .ff-match-placeholder { padding: 22px 14px; font-size: 12px; }
}

@media (max-height: 600px) {
  .ff-lead { display: none; }
  .ff-tabs { margin-bottom: 7px; }
  html body .ff-shell .ff-tab { min-height: 32px; font-size: 11px; }
  .ff-world-footer .ff-note { display: -webkit-box; max-height: 30px; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .ff-place-header { padding-top: 9px; padding-bottom: 9px; }
  .ff-place-meta { max-height: 68px; }
}

/* 短手机首屏优先地图；目的地与本人城市各占一行，操作保持可见。 */
@media (max-width: 480px) {
  html body .ff-shell .ff-world-toolbar .ff-directory-button { min-width: 36px; padding: 7px 9px; font-size: 0; line-height: 1; }
  .ff-world-toolbar .ff-directory-button::before { content: "☷"; font-size: 17px; line-height: 1; }
  .ff-world-toolbar .ff-nearby-button { min-width: 49px; }
}

@media (max-width: 480px) and (max-height: 700px) {
  .ff-header { align-items: center; gap: 7px; padding: calc(7px + env(safe-area-inset-top, 0px)) 12px 7px; }
  .ff-heading h1, .ff-heading h2 { font-size: 19px; }
  .ff-title-row { gap: 5px; }
  .ff-admin-chip { min-height: 16px; padding: 1px 4px; font-size: 8px; }
  .ff-lead { display: none; }
  html body .ff-shell .ff-profile-button { min-height: 30px; padding: 5px 7px; font-size: 10px; }
  .ff-tabs { margin-bottom: 7px; padding: 3px; border-radius: 12px; }
  html body .ff-shell .ff-tab { min-height: 30px; padding-top: 5px; padding-bottom: 5px; font-size: 11px; }
  .ff-panel { padding-bottom: 8px; }
  .ff-world-page { gap: 7px; }
  .ff-world-toolbar { gap: 6px; }
  html body .ff-shell .ff-world-toolbar input { height: 37px; min-height: 37px; padding-top: 6px; padding-bottom: 6px; }
  .ff-world-toolbar input::placeholder { font-size: 11px; }
  html body .ff-shell .ff-world-toolbar .ff-button { height: 37px; min-height: 37px; padding-top: 6px; padding-bottom: 6px; font-size: 10px; }
  html body .ff-shell .ff-world-toolbar .ff-directory-button { font-size: 0; }
  .ff-world-stage { border-radius: 14px; }
  .ff-world-footer { gap: 4px; }
  .ff-world-footer-line { display: none; }
  .ff-world-footer .ff-privacy-status { min-height: 30px; gap: 6px; }
  .ff-world-footer .ff-privacy-status > span { font-size: 9px; }
  html body .ff-shell .ff-world-footer .ff-privacy-status .ff-button { min-height: 30px; padding: 5px 8px; font-size: 9px; }
  .ff-destination { min-height: 38px; padding: 3px 6px; gap: 5px; }
  .ff-destination strong { font-size: 11px; }
  .ff-destination small { display: none; }
  html body .ff-shell .ff-destination .ff-button { min-height: 29px; padding: 5px 7px; font-size: 9px; }
  html body .ff-shell .ff-destination [data-ff-action="clear-destination"] { min-height: 26px; width: 25px; font-size: 15px; }
}

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

/* 合拍照片舞台占满独立面板；地图布局沿用原样。 */
.ff-shell:is([data-ff-mode="daily"],[data-ff-mode="timeline"])>.ff-header{display:none}.ff-cupid-host{display:flex;flex:1;min-height:0;width:100%;overflow:hidden}
/* GHBFindFriendsStyles:end */

.advisor-stop { flex: none; margin-inline-start: 8px; font-size: 12px; }
.advisor-pending-bubble:has(.advisor-answer-text) { display: block; }
.advisor-pending-bubble .advisor-answer-text + .advisor-stop { margin: 8px 0 0; }

/* Account-scoped privacy and terms test. */
.compliance-test-dialog {
  width: min(740px, calc(100% - 24px));
  height: min(780px, calc(100vh - 24px));
  height: min(780px, calc(100dvh - 24px));
  padding: 8px;
  overflow: hidden;
  border: 1px solid #d7d7e8;
  border-radius: 14px;
  background: #f2f3fa;
  color: #24263a;
}
.compliance-test-dialog[open] { display: flex; flex-direction: column; }
.compliance-test-dialog::backdrop { background: rgba(31, 34, 55, .65); }
.compliance-test-toolbar { display: flex; flex: none; justify-content: flex-start; padding-bottom: 8px; }
.compliance-test-toolbar > button {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #a7b5cc;
  background: #fff;
  color: #23416b;
}
.compliance-test-frame { flex: 1; width: 100%; min-height: 0; border: 0; }
#user-report-dialog { width:min(500px, calc(100% - 28px)); max-height:85vh; padding:20px; border:1px solid var(--line, #bbb); border-radius:12px; background:var(--panel, #fff); color:var(--text, #222); }
#user-report-dialog::backdrop { background:rgba(0, 0, 0, .48); }
#user-report-dialog.report-compose[open] { display:flex; flex-direction:column; }
#user-report-dialog.report-compose h2 { flex:none; margin:0 0 6px; font-size:20px; }
#user-report-dialog form { display:flex; flex-direction:column; min-height:0; }
#user-report-dialog form > label { display:grid; flex:none; gap:4px; margin:6px 0; }
#user-report-dialog form > p { flex:none; margin:6px 0 10px; color:var(--muted); font-size:13px; }
#user-report-dialog select { min-height:40px; }
#user-report-dialog .report-evidence-choices { min-inline-size:0; min-block-size:80px; max-height:36vh; overflow:auto; }
#user-report-dialog .report-evidence-choices label {
  display:grid; grid-template-columns:20px minmax(0, 1fr); align-items:start; gap:10px;
  padding:8px 0; overflow-wrap:anywhere; cursor:pointer;
}
#user-report-dialog .report-evidence-choices label + label { border-top:1px solid var(--line); }
#user-report-dialog .report-evidence-choices input[type="checkbox"] {
  appearance:auto; width:20px; height:20px; margin:2px 0 0; padding:0; accent-color:var(--accent);
}
#user-report-dialog .report-evidence-choices input[type="checkbox"]:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.report-evidence-details { display:grid; gap:4px; font-size:14px; }
.report-evidence-details bdi { white-space:pre-wrap; }
.report-evidence-caption { color:var(--muted); font-size:12px; }
#user-report-dialog .report-dialog-actions { flex:none; position:sticky; bottom:-20px; padding:8px 0; background:var(--panel, #fff); }
#user-report-dialog .report-dialog-actions p:empty { display:none; }
#user-report-dialog button { min-height:36px; margin-inline-end:8px; }
#me-moderation, a.directory-row { color:inherit; text-decoration:none; }
.has-report-notice::after { content:""; display:inline-block; width:8px; height:8px; border-radius:50%; background:#d93542; }
.directory-row.has-report-notice::after { order: 1; flex: none; margin-inline-start: auto; }
.directory-row.has-report-notice .directory-chevron { order: 2; }

/* Spellift sign-in, registration and password recovery. */
body:not(.langbar-off) #view-login,
#view-login {
  top: var(--app-top, 0px);
  height: var(--app-height, 100dvh);
  overflow: hidden;
  isolation: isolate;
  color: #231853;
  --text: #201847;
  --muted: #514583;
  --hint: #60558b;
  --accent: #3025c3;
  --surface: #fdfcff;
  --auth-safe-top: max(env(safe-area-inset-top, 0px), var(--spellift-auth-top, 0px));
  --auth-safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--spellift-auth-bottom, 0px));
  --auth-available-height: calc(var(--app-height, 100dvh) - var(--auth-safe-top) - var(--auth-safe-bottom));
  background:
    radial-gradient(ellipse 76% 18% at 103% 2%, #a1edff88, transparent 82%),
    radial-gradient(ellipse 88% 33% at 3% -8%, #c195f1b3, transparent 90%),
    radial-gradient(ellipse 79% 28% at 112% 104%, #bdc4ffb5, transparent 88%),
    radial-gradient(ellipse 60% 23% at 3% 105%, #ffd5eeaa, transparent 85%),
    linear-gradient(135deg, #fff 23%, #f6f2ff 61%, #fff 100%);
}
#view-login .auth-scroll {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
  scroll-padding-bottom: calc(var(--auth-safe-bottom) + 12px);
}
#view-login .auth-scroll::-webkit-scrollbar { display: none; }
.auth-decoration {
  position: absolute;
  z-index: -1;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.auth-decoration::before,
.auth-decoration::after {
  content: "";
  position: absolute;
  pointer-events: none;
  inset-inline: -13%;
  border-radius: 47% 53% 48% 52%;
}
#view-login .auth-decoration::before {
  top: -115px;
  height: 193px;
  background: linear-gradient(102deg, #f1caf5b8, #ab9bf08f 56%, #8ce9fcac);
  border-bottom: 1px solid #ffffffab;
  box-shadow: 0 14px 0 #fdf3ff58, 0 30px 0 #fce4f553;
  transform: rotate(-10deg);
}
#view-login .auth-decoration::after {
  bottom: -99px;
  height: 148px;
  background: linear-gradient(96deg, #ad9af2ae, #dce5ffad 54%, #b2a3ffcb);
  border-top: 1px solid #ffffffb0;
  box-shadow: 0 -16px 0 #d7eaff77, 0 -28px 0 #ede5ff75;
  transform: rotate(6deg);
}
#view-login .auth-language-strip {
  display: flex;
  flex: none;
  width: min(490px, calc(100% - 28px));
  margin-inline: auto;
  padding-top: calc(var(--auth-safe-top) + 4px);
  direction: ltr;
}
#view-login #langbar {
  position: static;
  min-width: 0;
  display: flex;
  flex: 1;
  overflow: auto hidden;
  overscroll-behavior-x: contain;
  padding: 4px;
  gap: 4px;
  border: 0;
  background: transparent;
}
#view-login #langbar .flag {
  gap: 4px;
  min-width: clamp(52px, 16vw, 72px);
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 13px;
  padding: 4px 6px;
  color: #21164d;
  font-size: clamp(9px, 2.6vw, 12px);
  font-weight: 570;
  letter-spacing: normal;
}
#view-login #langbar .flag span { white-space: nowrap; }
#view-login #langbar .flag img { width: 34px; height: 22px; object-fit: cover; border-radius: 6px; outline: 0; }
#view-login #langbar .flag.active { background: #dcf3ffb8; border-color: #1683ed; color: #1149b4; }
@media (hover: hover) and (pointer: fine) {
  #view-login #langbar {
    scrollbar-width: thin;
    scrollbar-color: #bfb4e6 transparent;
  }
}
#view-login .login-box {
  width: min(454px, calc(100% - 36px));
  flex: none;
  margin: 0 auto;
  padding: 0 0 calc(var(--auth-safe-bottom) + 8px);
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
#view-login[data-auth-mode="login"] .login-box { margin-block: auto; }
#view-login .login-box::before,
#view-login .login-box::after,
#view-login .auth-wordmark::before,
#view-login .auth-wordmark::after { content: none; }
.auth-brand { margin: 8px auto 14px; text-align: center; }
.auth-lockup { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.auth-mark {
  display: block;
  width: clamp(72px, calc((var(--auth-available-height) - 575px) * 0.53), 132px);
  height: auto;
}
.auth-brand-name { position: relative; display: inline-block; direction: ltr; padding: 0 6px 13px; }
#view-login .auth-wordmark {
  margin: 0;
  color: #29136e;
  font-family: "Geist", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(40px, 11.5vw, 55px);
  font-style: italic;
  font-weight: 790;
  letter-spacing: -0.035em;
  line-height: 1.04;
}
.auth-orbit {
  position: absolute;
  right: -10px;
  bottom: 6px;
  width: 63%;
  height: 25px;
  border-bottom: 3px solid #7e40df;
  border-radius: 50%;
  transform: rotate(-9deg);
}
.auth-orbit::after,
.auth-divider span {
  display: block;
  width: 15px;
  height: 15px;
  background: currentColor;
  clip-path: polygon(50% 0, 63% 36%, 100% 50%, 63% 64%, 50% 100%, 37% 64%, 0 50%, 37% 36%);
}
.auth-orbit::after { content: ""; position: absolute; right: -3px; bottom: 1px; color: #9a55ed; }
.auth-tagline {
  margin: 6px auto 0;
  color: #2924a9;
  font-size: clamp(15px, 4.4vw, 21px);
  font-weight: 710;
  line-height: 1.38;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.auth-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: min(74%, 300px);
  margin: 8px auto 0;
  color: #4442f8;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, currentColor);
}
.auth-divider::after { transform: rotate(180deg); }
.auth-divider span { width: 14px; height: 14px; }
#view-login[data-auth-mode]:not([data-auth-mode="login"]) .auth-brand { margin-top: 11px; margin-bottom: 13px; }
#view-login[data-auth-mode]:not([data-auth-mode="login"]) .auth-lockup { flex-direction: row; }
#view-login[data-auth-mode]:not([data-auth-mode="login"]) .auth-mark { width: 56px; }
#view-login[data-auth-mode]:not([data-auth-mode="login"]) .auth-wordmark { font-size: 34px; }
#view-login[data-auth-mode]:not([data-auth-mode="login"]) .auth-tagline { font-size: clamp(14px, 4vw, 18px); }
#view-login .registration-title { margin: 0 0 12px; font-size: 20px; color: #302079; text-align: center; }
#view-login .field { margin-block-start: 10px; }
#view-login .field > span:not(.auth-select),
#view-login .field > label {
  display: block;
  margin: 0 0 5px;
  color: #514583;
  font-size: 14px;
  font-weight: 570;
}
#view-login[data-auth-mode="login"] #login-pw-label {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
}
#view-login .auth-input,
#view-login .auth-select { position: relative; display: block; margin: 0; }
#login-market-field:not(.hidden) + #login-name-field { margin-block-start: 13px; }
#view-login .auth-input > svg,
#view-login .auth-select > svg {
  position: absolute;
  inset-inline-start: 13px;
  top: 50%;
  width: 22px;
  height: 22px;
  color: #6758a3;
  transform: translateY(-50%);
  pointer-events: none;
}
#view-login input,
#view-login textarea#login-name,
#view-login select {
  width: 100%;
  min-height: 46px;
  padding: 9px 13px;
  border: 1px solid #cfc4f2;
  border-radius: 13px;
  color: #211649;
  background: #f9f6ffb8;
}
#view-login :is(input, textarea)::placeholder { color: #746b94; opacity: 1; }
#view-login .auth-input input,
#view-login textarea#login-name,
#view-login .auth-select select { padding-inline-start: 43px; }
#view-login textarea#login-name {
  display: block;
  height: 46px;
  padding-block: 12px;
  line-height: 20px;
  resize: none;
  overflow: hidden;
  white-space: pre;
}
#view-login #login-pw { padding-inline-end: 48px; }
#view-login[data-auth-mode="login"] #login-name-field:has(#login-history-toggle:not(.hidden)) #login-name {
  padding-inline-end: 48px;
}
#view-login #login-history {
  position: absolute;
  z-index: 2;
  inset-inline: 0;
  top: calc(100% + 4px);
  max-height: min(188px, 32dvh);
  overflow: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 4px;
  list-style: none;
  border: 1px solid #cfc4f2;
  border-radius: 13px;
  background: #fdfbff;
  box-shadow: 0 6px 16px #30216a24;
}
#login-history li { display: flex; direction: ltr; }
#login-history li + li { border-top: 1px solid #eae2f7; }
#login-history button {
  min-height: 44px;
  padding: 4px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: #29136e;
}
#login-history button:hover { background: #f0eaff; }
#login-history .auth-history-name {
  flex: 1;
  min-width: 0;
  text-align: start;
  overflow-wrap: anywhere;
}
#login-history .auth-history-remove { width: 44px; flex: none; font-size: 20px; }
#view-login #login-remember-field {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 44px;
  padding-inline: 4px;
  color: #514583;
  font-size: 14px;
  cursor: pointer;
}
#view-login:not([data-auth-mode="login"]) :is(#login-history-toggle, #login-history, #login-remember-field) {
  display: none;
}
#view-login #login-remember-password {
  width: 17px;
  height: 17px;
  min-height: 0;
  margin: 0;
  padding: 0;
  accent-color: #4735d3;
}
#view-login .auth-select select { appearance: none; padding-inline-end: 38px; }
.auth-select::after {
  content: "";
  position: absolute;
  inset-inline-end: 15px;
  top: calc(50% - 7px);
  width: 9px;
  height: 9px;
  border: solid #332656;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  pointer-events: none;
}
#auth-password-toggle,
#login-history-toggle {
  position: absolute;
  inset-inline-end: 3px;
  top: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  transform: translateY(-50%);
  color: #6758a3;
  background: transparent;
  border: 0;
}
#auth-password-toggle svg,
#login-history-toggle svg { width: 23px; height: 23px; }
#auth-password-toggle[aria-pressed="true"] .auth-eye-slash { display: none; }
#view-login :is(input,textarea,select,button,a):focus-visible {
  outline: 2px solid #5544df;
  outline-offset: 2px;
}
#view-login #login-msg:empty { display: none; }
#view-login #register-email-status:empty { display: none; }
#view-login #login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 50px;
  margin-top: 14px;
  padding: 9px 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(110deg, #287bf3 -4%, #454cf0 37%, #4b22d4 100%);
  box-shadow: 0 8px 17px #4422d72c;
  font-size: 17px;
  font-weight: 720;
}
#view-login #login-btn::after {
  content: "";
  width: 20px;
  height: 20px;
  flex: none;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 12h17M12 4l8 8-8 8' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}
[dir="rtl"] #view-login #login-btn::after { transform: scaleX(-1); }
#view-login .login-link { min-height: 44px; margin-top: 3px; font-size: 15px; font-weight: 580; }
#view-login .auth-secondary,
#view-login .auth-legal-links {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  align-items: center;
  margin: 0;
  text-align: center;
}
#view-login .auth-secondary { margin-top: 4px; }
#view-login .auth-secondary:not(:has(> :not(.hidden))) { display: none; }
#view-login .auth-secondary .login-link { margin: 0; }
#view-login .auth-secondary .switch { margin: 0; }
#view-login #switch-text { display: none; }
#view-login .auth-secondary #switch-mode { width: 100%; min-height: 44px; color: #4621c9; font-size: 15px; font-weight: 580; }
#view-login .auth-legal-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 4px 6px;
  color: #3025c3;
  font-size: 14px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
#view-login .login-attribution {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 5px 0 0;
  color: #60558b;
  font-size: 12px;
  text-align: center;
}
.login-attribution svg { width: 16px; height: 16px; flex: none; }
#view-login .login-attribution a { color: inherit; }

@media (max-height: 720px) {
  #view-login[data-auth-mode="login"] .auth-brand { margin-block: 6px 9px; }
  #view-login[data-auth-mode="login"] .auth-lockup { flex-direction: row; }
  #view-login[data-auth-mode="login"] .auth-mark { width: clamp(48px, 16vw, 68px); }
  #view-login[data-auth-mode="login"] .auth-wordmark { font-size: clamp(36px, 10.5vw, 45px); }
}

@media (max-height: 650px) {
  #view-login[data-auth-mode="login"] .login-box { padding-bottom: calc(var(--auth-safe-bottom) + 3px); }
  #view-login[data-auth-mode="login"] .auth-brand { margin-block: 3px 6px; }
  #view-login[data-auth-mode="login"] .auth-mark { width: 49px; }
  #view-login[data-auth-mode="login"] .auth-brand-name { padding-bottom: 8px; }
  #view-login[data-auth-mode="login"] .auth-orbit { bottom: 2px; }
  #view-login[data-auth-mode="login"] .auth-tagline { margin-top: 3px; }
  #view-login[data-auth-mode="login"] .auth-divider { display: none; }
  #view-login[data-auth-mode="login"] .field { margin-block-start: 7px; }
  #view-login[data-auth-mode="login"] #login-btn { margin-top: 8px; }
}

/* Contacts directory and application-owned confirmations. */
html body #view-contacts .home-bar { display:flex; gap:8px; padding:8px 12px; min-width:0; }
html body #view-contacts .home-bar::before, html body #view-contacts .home-bar::after { content:none; }
.contacts-title { margin:0; padding:calc(env(safe-area-inset-top) + 16px) 16px 4px; font-size:30px; }
.contacts-directory { flex:1; min-height:0; position:relative; overflow:hidden; display:flex; }
#contacts-list { flex:1; margin:0; padding-inline-end:28px; overflow-y:auto; min-width:0; }
#contacts-list .contacts-group { position:sticky; top:0; z-index:1; display:block; margin:0; padding:4px 16px; min-height:24px; border:0; background:var(--soft); color:var(--muted); font-weight:600; }
#contacts-list .contacts-row { display:block; padding:0; margin:0; border-radius:0; }
html body .contact-entry { width:100%; display:flex; align-items:center; gap:12px; min-height:62px; padding:10px 16px; background:var(--surface); color:var(--text); border:0; border-bottom:.5px solid var(--line); border-radius:0; text-align:start; }
.contact-entry b { min-width:0; overflow-wrap:anywhere; }
#contacts-index { flex:none; display:flex; flex-direction:column; justify-content:center; gap:0; width:28px; overflow-y:auto; padding-block:6px; }
html body .contacts-index-letter { min-height:24px; padding:1px; border:0; background:transparent; color:var(--accent); font-size:12px; }
html body #main-nav { grid-template-columns:repeat(4,minmax(0,1fr)); }
html body #main-nav.has-discover, html body #main-nav:has(> #nav-discover:not(.hidden)) { grid-template-columns:repeat(5,minmax(0,1fr)); }
.app-dialog { width:min(360px,calc(100vw - 40px)); max-height:calc(100dvh - 48px); overflow:auto; box-sizing:border-box; padding:22px; border:1px solid var(--line); border-radius:20px; background:var(--surface); color:var(--text); box-shadow:0 12px 48px #0004; }
.app-dialog::backdrop { background:#0006; }
.app-dialog h2 { font-size:19px; margin:0 0 12px; }
.app-dialog p { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.55; margin:0 0 20px; }
.app-dialog-actions { display:flex; justify-content:flex-end; gap:10px; flex-wrap:wrap; }
.app-dialog-actions button { min-height:44px; min-width:76px; }

/* About keeps the APK version separate from the cumulative project build. */
.about-card { display:grid; gap:16px; padding:20px; }
.about-app-name { font-size:24px; }
.about-release { margin:0; display:grid; gap:12px; }
.about-release > div { display:flex; justify-content:space-between; gap:20px; }
.about-release dt { color:var(--muted); }
.about-release dd { margin:0; font-variant-numeric:tabular-nums; }
.about-card .hint { margin:0; }
.about-card .client-download-link, .about-card button { min-height:44px; justify-self:start; }

/* 当前账号在此设备上的可管理缓存。 */
.storage-content { width: min(100%, 640px); margin-inline: auto; display: grid; gap: 14px; padding-block: 6px 24px; }
.storage-summary { padding: 24px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.storage-eyebrow { margin: 0 0 16px; color: var(--muted); font-size: 12px; letter-spacing: .02em; overflow-wrap: anywhere; }
.storage-summary h3 { margin: 0; font-size: 14px; font-weight: 500; color: var(--muted); }
.storage-total { display: block; margin-block: 5px 22px; font-size: clamp(30px, 8vw, 42px); line-height: 1.2; font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.storage-meter { display: flex; height: 10px; overflow: hidden; border-radius: 8px; background: var(--line); }
.storage-meter > span { flex: none; min-width: 0; }
#storage-meter-cache, .storage-dot-cache { background: var(--accent); }
#storage-meter-chats, .storage-dot-chats { background: #599a91; }
#storage-meter-resources, .storage-dot-resources { background: #d5a365; }
.storage-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-block-start: 12px; color: var(--muted); font-size: 11px; }
.storage-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.storage-legend i { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.storage-card { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.storage-card-head { display: flex; align-items: center; gap: 12px; min-width: 0; flex-wrap: wrap; }
.storage-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); }
.storage-icon svg { width: 23px; height: 23px; }
.storage-icon-chats { color: #387b70; background: #e7f3ef; }
.storage-icon-resources { color: #986b31; background: #faf0e1; }
.storage-card-value { min-width: 0; flex: 1 1 90px; }
.storage-card-value h3 { margin: 0 0 4px; color: var(--muted); font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.storage-card-value bdi { font-size: 23px; font-weight: 650; line-height: 1.2; font-variant-numeric: tabular-nums; }
html body .storage-action { min-width: 72px; min-height: 44px; padding: 8px 16px; border-radius: 22px; border-image: none; clip-path: none; font-size: 14px; font-weight: 600; max-width: 100%; overflow-wrap: anywhere; }
html body .storage-action.ghost { color: var(--accent); background: var(--accent-soft); border: 0; }
html body .storage-action:disabled { opacity: .45; cursor: default; }
.storage-card-hint, .storage-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.storage-note { margin: 0 4px; }
.storage-feedback { display: flex; align-items: center; gap: 10px; min-height: 28px; margin-inline: 4px; }
#storage-status { margin: 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
#storage-status.is-error { color: var(--danger, #b34848); }
.storage-conversations { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); padding: 16px; }
.storage-conversations[hidden], .storage-feedback [hidden] { display: none; }
.storage-conversations h3 { margin: 0 0 10px; font-size: 14px; }
.storage-conversation { display: flex; align-items: center; gap: 10px; padding-block: 12px; }
.storage-conversation + .storage-conversation { border-block-start: 1px solid var(--line); }
.storage-conversation > div { display: grid; flex: 1; min-width: 0; gap: 4px; }
.storage-conversation strong { font-size: 14px; overflow-wrap: anywhere; }
.storage-conversation bdi { color: var(--muted); font-size: 12px; }
@media (max-width: 360px) { .storage-summary { padding: 20px; } .storage-card { padding: 15px; } .storage-icon { width: 34px; height: 34px; flex-basis: 34px; } .storage-card-head { gap: 9px; } html body .storage-action { padding-inline: 12px; } }
