:root {
  color-scheme: light;
  --font-sans: "Noto Sans SC", "Noto Sans CJK SC", "PingFang SC", "Source Han Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --radius-small: 8px;
  --radius-control: 12px;
  --radius-card: 16px;
  --control-hit-min: 44px;
  --control-height: 48px;
  --bg: #fcfbf8;
  --surface: #ffffff;
  --surface-strong: #f7f4ef;
  --ink: #25221f;
  --muted: #746f69;
  --line: #e8e2da;
  --accent: #a94e6a;
  --accent-light: #f3e7eb;
  --accent-dark: #8f3f59;
  --accent-contrast: #ffffff;
  --mint: #718a78;
  --mint-soft: #e9efea;
  --apricot: #c98252;
  --gold: #c98252;
  --shadow: 0 1px 4px rgba(49, 39, 31, 0.06);
  --photo-matte: #ffffff;
  --input-surface: #f7f4ef;
  --input-panel: #ffffff;
  --input-text: #25221f;
  --input-placeholder: #827b74;
  --input-border: rgba(79, 67, 58, 0.1);
  --input-border-focus: rgba(169, 78, 106, 0.42);
  --input-focus-ring: 0 0 0 3px rgba(169, 78, 106, 0.18);
  --focus-ring-color: rgba(169, 78, 106, 0.32);
  --input-tool: #746f69;
  --input-action: #a94e6a;
  --horizontal-slide-duration: 280ms;
  --horizontal-slide-easing: cubic-bezier(0.22, 1, 0.36, 1);
}

::selection {
  color: var(--ink);
  background: var(--accent-light);
}

:where(a, button, [role="button"]):focus-visible {
  outline: 3px solid var(--focus-ring-color);
  outline-offset: 2px;
}

.foodie-waterfall {
  column-count: 2;
  column-gap: 8px;
  display: block;
  place-items: normal;
  align-items: normal;
  justify-items: normal;
}

.foodie-masonry-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 8px;
  break-inside: avoid;
  overflow: hidden;
}

.foodie-masonry-card .square-photo {
  width: 100%;
  aspect-ratio: 1;
}

.foodie-masonry-card .square-photo img {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: 1;
  object-fit: cover;
}

.foodie-masonry-card .foodie-card-body {
  padding: 7px;
  gap: 5px;
}

.compact-author {
  gap: 5px;
}

.compact-author .avatar {
  width: 24px;
  height: 24px;
}

.compact-author strong {
  font-size: 13px;
}

.clamp-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
}

.compact-stars {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  align-items: center;
  gap: 2px;
}

.compact-stars button {
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #d5b24a;
  font-size: 14px;
}

.compact-stars button.active {
  color: #c94a68;
  background: transparent;
}

.compact-stars span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.comment-entry {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: #f6f6f6;
  color: #586b8a;
  padding: 6px 7px;
  text-align: left;
  font-size: 13px;
  line-height: 1.35;
}

.comment-entry strong {
  color: var(--ink);
}

.comment-entry.muted {
  color: var(--muted);
}

.post-detail-viewer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px 10px max(18px, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.36);
}

.post-detail-viewer.hidden {
  display: none;
}

.post-detail-sheet {
  position: relative;
  width: min(100%, 560px);
  max-height: 86vh;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px 16px 10px 10px;
  background: var(--surface);
  box-shadow: 0 -14px 45px rgba(22, 18, 21, 0.22);
}

.post-detail-close {
  position: sticky;
  top: 0;
  justify-self: end;
  z-index: 2;
}

.detail-images,
.detail-comments,
.detail-comment-form {
  margin: 0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  touch-action: manipulation;
  overscroll-behavior-x: none;
}

html {
  overscroll-behavior-x: none;
}

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

input,
textarea,
select {
  font-size: 16px !important;
}

button {
  cursor: pointer;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.65), rgba(247, 243, 244, 0.95)),
    url("data:image/svg+xml,%3Csvg width='360' height='640' viewBox='0 0 360 640' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='360' height='640' fill='%23f4e9ec'/%3E%3Cpath d='M0 468c66-24 92-102 166-99 72 3 99 76 194 52v219H0z' fill='%23d9efe8'/%3E%3Cpath d='M0 152c56 31 99 12 144-29 65-58 132-50 216-8V0H0z' fill='%23f2d7c9'/%3E%3Ccircle cx='286' cy='245' r='52' fill='%23f9c6d1'/%3E%3Cpath d='M75 285c37-44 82-46 118-6 35 39 31 92-11 119-43 28-103 14-129-26-17-27-7-62 22-87z' fill='%23fff7ee'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}

.auth-panel {
  width: min(100%, 390px);
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px 22px 22px;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: white;
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 18px;
}

.auth-panel h1,
.topbar h1,
.profile-panel h2,
.section-title h2 {
  margin: 0;
  letter-spacing: 0;
}

.auth-panel h1 {
  font-size: 34px;
}

.auth-panel p,
.tiny-note,
.eyebrow,
#profile-bio {
  color: var(--muted);
}

.form-stack,
.composer {
  display: grid;
  gap: 14px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: #efe6e9;
  border-radius: 8px;
}

.segment {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  padding: 10px;
}

.segment.active {
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: 0 3px 12px rgba(64, 38, 50, 0.08);
}

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: var(--muted);
  font-size: 14px;
}

.field input,
.field textarea,
.field select,
.chat-box input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
  border-radius: 6px;
  padding: 11px 12px;
  outline: 0;
}

.field textarea {
  resize: vertical;
  min-height: 150px;
  line-height: 1.55;
}

.field input:focus,
.field textarea:focus,
.field select:focus,
.chat-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(219, 39, 119, 0.35);
}

.primary-button,
.secondary-button,
.danger-button,
.chat-box button {
  border: 0;
  border-radius: 8px;
  padding: 13px 16px;
  color: white;
  background: var(--accent);
  font-weight: 700;
}

.primary-button {
  color: var(--accent-contrast);
}

.secondary-button {
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.primary-button:active,
.chat-box button:active {
  background: var(--accent-dark);
}

/* === Tap feedback: immediate visual response on press === */

.tab:active {
  opacity: 0.6;
  transition: opacity 60ms ease;
}

[data-like]:active,
[data-favorite]:active,
[data-react-post]:active {
  transform: scale(0.85);
  transition: transform 60ms ease;
}

.chip:active,
.feed-switch-button:active {
  background: rgba(0, 0, 0, 0.08);
  transform: scale(0.95);
  transition: transform 80ms ease, background 80ms ease;
}

.danger-button {
  width: 100%;
  margin-top: 18px;
  color: #9b2639;
  background: #ffe8ed;
}

.tiny-note {
  margin: 0;
  font-size: 12px;
  text-align: center;
}

.hidden {
  display: none !important;
}

.profile-post-pane {
  min-width: 0;
}

.phone-shell {
  position: relative;
  min-height: 100vh;
  padding: max(10px, env(safe-area-inset-top)) 8px calc(74px + env(safe-area-inset-bottom));
  max-width: 520px;
  margin: 0 auto;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 2px 8px;
}

.topbar .icon-button {
  flex: 0 0 auto;
}

.topbar > div:first-child {
  flex: 1;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 12px;
}

.topbar h1 {
  font-size: 24px;
  font-weight: 800;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface-strong);
  font-size: 20px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

/* iOS-style push: pure CSS animations for GPU-only compositing */
@keyframes pageSlideInRight {
  from { transform: translate3d(100%, 0, 0); }
  to   { transform: translate3d(0, 0, 0); }
}
/* The pushed profile stays in a stable layer; animation classes are transient. */
.page.profile-page-active {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: none;
  touch-action: pan-y;
  background: var(--bg, #fff) !important;
  z-index: 99999 !important;
  backface-visibility: hidden;
  contain: layout paint;
  transform: translate3d(0, 0, 0);
}

.page.page-slide-in-active {
  animation: pageSlideInRight var(--horizontal-slide-duration) var(--horizontal-slide-easing) both;
  will-change: transform;
}

/* The page that stays behind during transition */
body.page-transitioning .page.page-behind {
  overflow-y: hidden !important;
  pointer-events: none;
  z-index: 1 !important;
}

@media (prefers-reduced-motion: reduce) {
  .page.page-slide-in-active {
    animation-duration: 1ms;
  }
}

.topic-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 0 0 9px;
  scrollbar-width: none;
}

.feed-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin: 0 0 9px;
  border-radius: 8px;
  background: rgba(232, 232, 232, 0.78);
}

.feed-switch-button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 700;
}

.feed-switch-button.active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.topic-row::-webkit-scrollbar {
  display: none;
}

.chip,
.text-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--muted);
  padding: 6px 11px;
  white-space: nowrap;
  font-size: 12px;
}

.chip.active {
  color: white;
  background: var(--mint);
  border-color: var(--mint);
}

.feed,
.messages,
.report-list {
  display: grid;
  gap: 8px;
}

.foodie-hero,
.foodie-guide,
.foodie-card,
.foodie-opt-in {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.foodie-hero {
  display: none;
  padding: 10px 12px;
  margin-bottom: 6px;
  background:
    linear-gradient(135deg, rgba(255, 246, 223, 0.94), rgba(233, 246, 241, 0.94)),
    #ffffff;
}

.foodie-hero h2 {
  margin: 0 0 5px;
  font-size: 24px;
  letter-spacing: 0;
}

.foodie-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.foodie-guide {
  display: none;
  margin-bottom: 6px;
  padding: 8px 10px;
  color: #7a5a21;
  background: #fff6df;
  font-size: 13px;
  line-height: 1.45;
}

.foodie-waterfall {
  display: grid;
  gap: 8px;
}

.foodie-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  width: 100%;
  overflow: hidden;
  margin: 0 0 8px;
}

.foodie-photo {
  width: 100%;
  border: 0;
  padding: 0;
  background: #f1f1f1;
  display: block;
  line-height: 0;
  aspect-ratio: 3 / 4;
}

.foodie-photo img {
  width: 100%;
  display: block;
  height: 100%;
  min-height: 128px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.foodie-card-body {
  display: grid;
  gap: 6px;
  padding: 8px;
  min-width: 0;
}

.foodie-author {
  display: flex;
  gap: 7px;
  align-items: center;
  min-width: 0;
}

.foodie-author .avatar {
  width: 28px;
  height: 28px;
  font-size: 12px;
}

.foodie-author strong,
.foodie-author .meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.foodie-text {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  word-break: break-word;
  white-space: normal;
}

.foodie-score {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 6px;
}

.foodie-score strong {
  color: var(--accent);
  font-size: 19px;
  line-height: 1;
}

.foodie-score span,
.foodie-friendly,
.foodie-comments.muted {
  color: var(--muted);
  font-size: 12px;
}

.foodie-stars {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 3px;
  width: 100%;
}

.foodie-stars button {
  min-width: 0;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.foodie-stars button.active {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
}

.foodie-rating-tools {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.foodie-rating-tools label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.foodie-rating-tools button {
  border: 0;
  background: transparent;
  color: #9b2639;
  padding: 2px;
  font-size: 12px;
}

.foodie-comments {
  display: grid;
  gap: 5px;
}

.foodie-comment-preview {
  display: grid;
  gap: 2px;
  padding: 6px;
  border-radius: 6px;
  background: #f6f6f6;
  font-size: 12px;
  line-height: 1.35;
}

.foodie-card .comments {
  margin: 0;
}

.foodie-card .comment-form {
  margin: 0;
}

.foodie-comment-preview span {
  color: var(--muted);
  word-break: break-word;
}

.foodie-comment-form {
  margin: 0;
}

.foodie-comment-form input {
  font-size: 13px;
}

.foodie-comment-form button {
  padding: 0 9px;
  font-size: 13px;
}

.foodie-opt-in {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.foodie-opt-in input {
  margin-top: 2px;
}

.foodie-tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid #ffd0da;
  border-radius: 999px;
  color: #9b2639;
  background: #fff3f5;
  padding: 4px 8px;
  font-size: 13px;
}

.post-card,
.profile-panel,
.admin-panel,
.empty-state,
.message,
.report-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.post-card {
  padding: 10px 10px 9px;
}

.post-head,
.comment-row,
.message-head,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.author {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.avatar,
.avatar-large {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--mint));
  font-weight: 800;
  border: 0;
  padding: 0;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.avatar-button {
  cursor: pointer;
}

.avatar-button:active,
.mention-profile-link:active,
[data-profile-user]:active {
  transform: none !important;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 13px;
}

.avatar-large {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  font-size: 28px;
}

.avatar img,
.avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

.author strong,
.message-head strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author strong {
  font-size: 15px;
}

.meta {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.topic-badge,
.role-badge {
  border-radius: 999px;
  background: #fff6df;
  color: var(--gold);
  padding: 3px 7px;
  font-size: 13px;
}

.post-text {
  margin: 8px 0 7px 42px;
  line-height: 1.5;
  font-size: 16px;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-images {
  display: grid;
  gap: 4px;
  margin: 0 0 8px 42px;
}

.post-images.one {
  grid-template-columns: minmax(0, 1fr);
  width: 112px;
}

.post-images.one .post-image-button {
  aspect-ratio: 1;
}

.post-images.multi {
  grid-template-columns: repeat(3, 72px);
  width: 224px;
}

.post-image-button {
  position: relative;
  border: 0;
  padding: 0;
  background: #f1f1f1;
  border-radius: 4px;
  overflow: hidden;
  line-height: 0;
}

.post-image-button span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(47, 41, 48, 0.58);
  color: white;
  font-size: 18px;
  font-weight: 800;
}

.post-images img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.post-images.one img {
  aspect-ratio: auto;
  max-height: 150px;
  object-fit: contain;
}

.post-images.multi img {
  aspect-ratio: 1;
  object-fit: cover;
}

.post-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-left: 42px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.action-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 5px 4px;
  font-size: 14px;
}

.action-button.liked {
  color: var(--accent);
  font-weight: 800;
}

.comments {
  display: grid;
  gap: 5px;
  margin: 7px 0 0 42px;
}

.comment-row {
  display: grid;
  gap: 4px;
  background: #f6f6f6;
  border-radius: 4px;
  padding: 5px 7px;
  line-height: 1.45;
  font-size: 14px;
}

.comment-main {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 7px;
  min-width: 0;
}

.comment-row strong {
  flex: 0 0 auto;
}

.comment-tools {
  display: flex;
  gap: 8px;
  align-items: center;
}

.comment-reply,
.reply-toggle,
.replying-hint button {
  border: 0;
  background: transparent;
  color: #586b8a;
  padding: 0;
  font-size: 12px;
}

.reply-list {
  display: grid;
  gap: 4px;
  padding-left: 10px;
  border-left: 2px solid #e7e7e7;
}

.reply-row {
  background: #ffffff;
  border: 1px solid #ececec;
}

.replying-hint {
  flex: 1 0 100%;
  color: #586b8a;
  font-size: 12px;
}

.comment-toggle {
  width: fit-content;
  border: 0;
  background: transparent;
  color: #586b8a;
  padding: 2px 0;
  font-size: 14px;
}

.comment-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 7px;
  margin: 7px 0 0 42px;
}

.comment-form input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 8px;
  font-size: 16px;
}

.comment-form button {
  border: 0;
  border-radius: 999px;
  background: #2f2930;
  color: white;
  padding: 0 12px;
  font-size: 14px;
  height: 34px;
}

.comment-form .voice-comment-button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #fff;
  color: #586b8a;
  padding: 0 9px;
}

.comment-form .replying-hint {
  grid-column: 1 / -1;
}

.empty-state {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
}

.upload-box {
  min-height: 118px;
  border: 1px dashed #d8c4cb;
  border-radius: 8px;
  display: grid;
  place-items: center;
  gap: 4px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
}

.upload-box.compact {
  min-height: 52px;
}

.upload-box input {
  display: none;
}

.upload-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-strong);
  color: var(--accent);
  font-size: 24px;
}

.image-preview {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.image-preview img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
}

.messages {
  height: calc(100dvh - 158px);
  overflow-y: auto;
  display: grid;
  grid-auto-rows: max-content;
  align-content: safe end;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  gap: 8px;
  padding-bottom: 78px;
}

.message {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  max-width: 86%;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transition: opacity 180ms ease, transform 180ms ease;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.message.own {
  justify-self: end;
  justify-content: flex-end;
}

.message-bubble {
  max-width: 100%;
  width: fit-content;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow: 0 5px 16px rgba(64, 38, 50, 0.06);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: pan-y;
}

.message-bubble *,
.message-action-menu {
  -webkit-touch-callout: none;
}

.message.own .message-bubble {
  background: #dff3e8;
  border-color: #c7e7d6;
}

.message p {
  margin: 4px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.45;
}

.message-head {
  justify-content: flex-start;
  gap: 6px;
}

.message-head strong {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.message-time {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.message-reply-quote {
  width: 100%;
  display: grid;
  gap: 2px;
  margin: 5px 0 6px;
  padding: 6px 8px;
  border: 0;
  border-left: 3px solid var(--accent);
  border-radius: 5px;
  background: rgba(219, 39, 119, 0.08);
  color: var(--ink);
  text-align: left;
}

.message-reply-quote strong,
.message-reply-quote span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.message-reply-quote strong {
  color: var(--accent);
}

.message.action-active .message-bubble {
  transform: scale(0.985);
  box-shadow: 0 0 0 4px rgba(45, 47, 54, 0.08), 0 8px 22px rgba(64, 38, 50, 0.12);
}

.recalled-message {
  width: 100%;
  max-width: 100%;
  justify-content: center;
}

.message-recalled-pill {
  justify-self: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(115, 115, 115, 0.12);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.message-action-menu {
  position: fixed;
  z-index: 220;
  min-width: 142px;
  padding: 8px;
  border: 1px solid rgba(214, 214, 214, 0.72);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(24, 24, 27, 0.18);
}

.message-action-menu button {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 10px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: transparent !important;
  color: #111827 !important;
  text-align: left;
}

.message-action-menu button:active {
  background: rgba(0, 0, 0, 0.06) !important;
}

.message-action-menu button.danger {
  color: #b4233f !important;
}

.message-action-menu span {
  font-size: 22px;
  line-height: 1;
}

.message-action-menu strong {
  font-size: 15px;
  font-weight: 700;
}

.message-reply-preview {
  grid-column: 1 / -1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 9px;
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  margin: -2px 0 0;
}

.message-reply-preview > div {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.message-reply-preview strong,
.message-reply-preview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.message-reply-preview button {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  padding: 0 !important;
  border-radius: 50% !important;
  background: #eee !important;
  color: var(--ink) !important;
}

.message-focus-flash .message-bubble {
  animation: message-focus-flash 850ms ease;
}

.detail-comment.comment-focus-flash {
  animation: comment-focus-flash 1000ms ease;
}

@keyframes message-focus-flash {
  0%, 100% { box-shadow: 0 5px 16px rgba(64, 38, 50, 0.06); }
  45% { box-shadow: 0 0 0 5px rgba(219, 39, 119, 0.28); }
}

@keyframes comment-focus-flash {
  0%, 100% { box-shadow: 0 0 0 rgba(219, 39, 119, 0); }
  45% { box-shadow: 0 0 0 5px rgba(219, 39, 119, 0.22); }
}

.chat-box {
  position: fixed;
  left: 50%;
  bottom: calc(64px + env(safe-area-inset-bottom));
  transform: translate3d(-50%, 0, 0);
  width: min(calc(100% - 28px), 492px);
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto auto;
  gap: 8px;
  background: rgba(245, 245, 245, 0.98);
  padding: 8px 0;
  contain: paint;
  touch-action: manipulation;
  will-change: transform;
}

.chat-box,
.detail-bottom-form {
  transition: box-shadow 220ms ease;
}

.chat-box.sticker-open {
  align-items: end;
}

.chat-box input,
.chat-box button {
  font-size: 14px;
}

.chat-box .voice-message-button {
  color: #586b8a;
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 0 10px;
  white-space: nowrap;
}

.profile-panel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 188px;
  padding: 20px 16px;
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 241, 244, 0.92), rgba(233, 246, 241, 0.92)),
    radial-gradient(circle at 18% 18%, rgba(219, 39, 119, 0.18), transparent 32%),
    radial-gradient(circle at 82% 8%, rgba(47, 125, 115, 0.18), transparent 34%),
    #ffffff;
}

.profile-layout {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 16px;
}

.profile-identity {
  min-width: 0;
}

.profile-identity h2,
.profile-identity p {
  overflow-wrap: anywhere;
}

.settings-gear-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-cover-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.48;
  transform: scale(1.02);
}

.profile-panel.has-cover {
  color: white;
  border-color: rgba(255, 255, 255, 0.18);
  background: #2f2930;
}

.profile-panel.has-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(20, 18, 20, 0.24), rgba(20, 18, 20, 0.72)),
    linear-gradient(90deg, rgba(20, 18, 20, 0.42), rgba(20, 18, 20, 0.16));
  z-index: 1;
}

.profile-panel.has-cover .profile-cover-layer {
  opacity: 1;
}

.profile-panel.portrait-cover {
  min-height: 420px;
  align-items: flex-end;
}

.profile-panel.portrait-cover .profile-cover-layer {
  background-size: cover;
}

.profile-panel > :not(.profile-cover-layer) {
  position: relative;
  z-index: 2;
}

.profile-panel.has-cover #profile-bio,
.profile-panel.has-cover .role-badge {
  color: rgba(255, 255, 255, 0.86);
}

.profile-panel.has-cover .role-badge {
  background: rgba(255, 255, 255, 0.16);
}

.profile-form,
.admin-panel,
.profile-settings-panel,
.my-works-panel,
.friend-panel {
  margin-top: 14px;
}

.admin-panel,
.profile-settings-panel,
.my-works-panel,
.friend-panel {
  padding: 14px;
  background: #fff;
  border: 1px solid rgba(232, 232, 232, 0.86);
  border-radius: 8px;
}

.report-item {
  box-shadow: none;
  padding: 10px;
  word-break: break-word;
}

.back-button {
  border: 0;
  background: transparent;
  color: var(--accent);
  box-sizing: border-box;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 8px;
  font-size: 15px;
  line-height: 1;
}

.page-back-button {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 44px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 8px;
  font-size: 15px;
  line-height: 1;
  color: var(--ink);
  background: var(--bg, #fff);
  pointer-events: auto;
  cursor: pointer;
}

.page-back-button.hidden {
  display: none !important;
}

.page.profile-page-active > .page-back-button {
  position: sticky;
  top: 0;
  left: auto;
  z-index: 101;
  width: auto;
  min-height: calc(44px + env(safe-area-inset-top));
  margin: 0;
  padding: env(safe-area-inset-top) 8px 0;
  justify-content: flex-start;
  box-sizing: border-box;
  background: var(--bg, #fff);
}

body.detail-open .page.profile-page-active {
  position: fixed !important;
  inset: 0 !important;
  width: min(100%, 520px) !important;
  margin: 0 auto;
}

.apple-profile {
  min-height: 230px;
  border-radius: 8px;
}

.profile-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 9px 0 11px;
}

.profile-actions button,
.profile-actions .primary-button,
.profile-actions .secondary-button {
  flex: 0 1 auto;
  min-width: 74px;
  min-height: 32px;
  width: auto;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.2;
}

.private-header,
.friend-item {
  display: flex;
  align-items: center;
  gap: 9px;
}

.conversation-list {
  display: grid;
  gap: 12px;
}

.conversation-group h2 {
  margin: 2px 2px 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.conversation-row-shell {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: stretch;
  border: 1px solid rgba(232, 232, 232, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  overflow: hidden;
  touch-action: pan-y;
  -webkit-touch-callout: none;
}

.conversation-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 10px 10px;
  border: 0;
  background: transparent;
  text-align: left;
}

.conversation-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: white;
  background: linear-gradient(135deg, #2f7d73, #8f6bd6);
  font-weight: 800;
}

.conversation-avatar-wrap {
  position: relative;
  flex: 0 0 auto;
  display: inline-grid;
}

.unread-dot {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: #e92f4f;
  color: white;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  padding: 0 3px;
}

.conversation-main {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 4px;
}

.conversation-main strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--ink);
  font-size: 15px;
}

.conversation-ttl-note {
  flex: 0 1 auto;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-main span {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-side {
  flex: 0 0 auto;
  align-self: stretch;
  display: flex;
  gap: 5px;
  align-items: flex-start;
  justify-content: flex-end;
  padding-top: 2px;
}

.conversation-side small {
  color: var(--muted);
  font-size: 11px;
}

.conversation-muted-indicator {
  width: 16px;
  height: 16px;
  display: inline-grid;
  flex: 0 0 16px;
  place-items: center;
  color: var(--muted);
}

.conversation-muted-indicator .conversation-line-icon {
  width: 15px;
  height: 15px;
}

.conversation-menu-button {
  width: 44px;
  min-width: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
}

.conversation-menu-button .conversation-line-icon {
  width: 21px;
  height: 21px;
}

.conversation-menu-button:active {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.05);
}

.chat-thread {
  min-height: calc(100dvh - 150px);
}

.conversation-messages {
  height: calc(100dvh - 206px);
}

.secondary-button.active-follow {
  color: white;
  background: #222222;
  border-color: #222222;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 10px;
}

.profile-stats div {
  padding: 10px 8px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(232, 232, 232, 0.86);
  text-align: center;
}

.profile-stats strong {
  display: block;
  font-size: 17px;
}

.profile-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.private-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(232, 232, 232, 0.78);
  border-radius: 8px;
}

.friend-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.friend-item {
  min-height: 48px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(246, 246, 246, 0.84);
}

.friend-item > div {
  min-width: 0;
  flex: 1;
}

.friend-item strong {
  display: block;
  font-size: 13px;
}

.friend-empty {
  color: var(--muted);
  font-size: 12px;
  padding: 8px 2px;
}

.mini-button {
  border: 0;
  border-radius: 999px;
  color: white;
  background: var(--accent);
  padding: 6px 11px;
  font-size: 12px;
}

.danger-mini {
  background: #b4233f;
}

.danger-inline {
  color: #a32139;
  background: #ffe8ed;
  border-color: #ffd0da;
}

.review-item {
  display: grid;
  gap: 8px;
}

.review-item.resolved {
  opacity: 0.68;
}

.review-item p {
  margin: 0;
  line-height: 1.5;
  word-break: break-word;
}

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

.policy-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 12px 0 0;
  font-size: 13px;
}

.policy-links a {
  color: #586b8a;
  text-decoration: none;
}

html.legal-document-root {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: auto;
}

body.legal-document {
  position: static !important;
  width: 100%;
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: visible;
  touch-action: pan-y pinch-zoom;
  overscroll-behavior-y: auto;
  -webkit-overflow-scrolling: touch;
}

.legal-page {
  width: min(100% - 32px, 720px);
  margin: 0 auto;
  padding: 36px 0 64px;
  line-height: 1.75;
  color: var(--ink);
}

.legal-page h1 {
  margin: 0 0 18px;
  font-size: 28px;
}

.legal-page h2 {
  margin: 30px 2px 8px;
  font-size: 17px;
  line-height: 1.4;
}

.legal-page p {
  margin: 0 0 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.legal-page > .meta {
  display: inline-block;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}

.compact-feed {
  margin-top: 10px;
}

.private-messages {
  height: calc(100dvh - 192px);
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate3d(-50%, 0, 0);
  width: min(100%, 520px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 5px 10px 0;
  background: #fff;
  border-top: 1px solid var(--line);
  contain: paint;
  touch-action: manipulation;
  will-change: transform;
}

.tab {
  position: relative;
  min-height: calc(46px + max(5px, env(safe-area-inset-bottom)));
  padding-top: 6px;
  padding-bottom: max(5px, env(safe-area-inset-bottom));
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  gap: 2px;
  font-size: 12px;
}

.tab-unread {
  position: absolute;
  top: 4px;
  right: 18%;
  min-width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e92f4f;
  color: white;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  padding: 0 4px;
}

.tab span {
  font-size: 19px;
  line-height: 1;
}

.tab.active {
  color: var(--accent);
  background: #fff1f4;
  font-weight: 800;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 40px), 360px);
  background: #2f2930;
  color: white;
  border-radius: 8px;
  padding: 12px 14px;
  text-align: center;
  box-shadow: var(--shadow);
  z-index: 20;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: var(--photo-matte);
  padding: 44px 12px;
}

.image-viewer img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
  transform-origin: center center;
  will-change: transform;
  transition: transform 120ms ease-out;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

.image-viewer img.zoomed {
  cursor: grab;
}

.image-viewer img.zoomed:active {
  cursor: grabbing;
}

.viewer-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: rgba(20, 20, 20, 0.12);
  color: #111111;
  font-size: 28px;
  pointer-events: auto;
}

.viewer-count {
  position: absolute;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  color: #111111;
  background: rgba(20, 20, 20, 0.08);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
}

.viewer-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 44px;
  height: 58px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 999px;
  background: rgba(30, 30, 30, 0.58);
  color: #ffffff;
  font-size: 38px;
  line-height: 1;
}

.viewer-prev { left: max(12px, calc((100vw - 520px) / 2 + 12px)); }
.viewer-next { right: max(12px, calc((100vw - 520px) / 2 + 12px)); }

.mention-profile-link {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: #db2777;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
}

.message-sticker[data-add-sticker-source] {
  touch-action: manipulation;
  -webkit-touch-callout: none;
  user-select: none;
}

.back-to-top {
  position: fixed;
  right: max(12px, calc((100vw - 520px) / 2 + 12px));
  bottom: calc(82px + env(safe-area-inset-bottom));
  z-index: 70;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #9a9a9a;
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
  font-size: 20px;
  opacity: 0.88;
}

.message-jump-latest {
  bottom: calc(42px + env(safe-area-inset-bottom));
}

body.typing .back-to-top,
body.detail-open .back-to-top {
  bottom: calc(78px + env(safe-area-inset-bottom));
}

body.typing .message-jump-latest,
body.detail-open .message-jump-latest {
  bottom: calc(38px + env(safe-area-inset-bottom));
}

.profile-viewer {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: end center;
  background: rgba(20, 18, 20, 0.54);
  padding: 14px;
}

.profile-card-view {
  position: relative;
  width: min(100%, 420px);
  min-height: 430px;
  overflow: hidden;
  border-radius: 8px;
  background: #2f2930;
  color: white;
  box-shadow: 0 24px 70px rgba(20, 18, 20, 0.34);
}

.profile-card-cover {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, var(--accent), #3b7c70);
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}

.profile-card-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(20, 18, 20, 0.2), rgba(20, 18, 20, 0.78)),
    linear-gradient(90deg, rgba(20, 18, 20, 0.36), rgba(20, 18, 20, 0.08));
  backdrop-filter: blur(1px);
}

.profile-card-cover.empty::after {
  background: linear-gradient(180deg, rgba(20, 18, 20, 0.1), rgba(20, 18, 20, 0.64));
}

.profile-card-content {
  position: relative;
  z-index: 1;
  min-height: 430px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  text-align: center;
  padding: 80px 24px 28px;
}

.profile-avatar-button {
  width: 92px;
  height: 92px;
  border: 3px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 0;
  background: linear-gradient(135deg, var(--accent), var(--mint));
  color: white;
  font-size: 34px;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(20, 18, 20, 0.24);
  cursor: default;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.profile-avatar-button[aria-disabled="true"] {
  pointer-events: none;
}

.profile-avatar-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

.profile-card-content h2 {
  margin: 14px 0 6px;
  font-size: 24px;
}

.profile-card-content p {
  margin: 0 0 12px;
  max-width: 280px;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.5;
}

.profile-close {
  z-index: 2;
}

input,
textarea,
select {
  font-size: 16px;
}

.chat-box {
  align-items: center;
  padding: 8px;
  border-radius: 16px;
}

.chat-box input,
.chat-box button {
  min-width: 0;
  font-size: 16px;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171614;
  --surface: #211f1c;
  --surface-strong: #292622;
  --ink: #f3efe8;
  --muted: #b9b1a7;
  --line: #3a3631;
  --accent: #c86d87;
  --accent-light: #493039;
  --accent-dark: #e2a0b2;
  --mint: #91a797;
  --mint-soft: #29342d;
  --photo-matte: #292622;
  --input-surface: #292622;
  --input-panel: #211f1c;
  --input-text: #f3efe8;
  --input-placeholder: #aaa197;
  --shadow: none;
  background: #171614;
}

body[data-theme="dark"] .phone-shell {
  background: var(--bg);
  color: var(--ink);
  padding-left: 0;
  padding-right: 0;
}

body[data-theme="dark"] .topbar {
  min-height: 62px;
  justify-content: center;
  padding: 8px 16px 12px;
  background: rgba(34, 40, 53, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body[data-theme="dark"] .topbar > div {
  text-align: center;
}

body[data-theme="dark"] .eyebrow {
  display: none;
}

body[data-theme="dark"] .topbar h1 {
  color: #ffffff;
  font-size: 21px;
}

body[data-theme="dark"] #refresh-button {
  position: absolute;
  color: #f4f4f5;
  background: transparent;
  border-color: transparent;
}

body[data-theme="dark"] #refresh-button {
  right: 14px;
}

body[data-theme="dark"] .conversation-list {
  gap: 0;
  padding: 0 0 12px;
}

body[data-theme="dark"] .conversation-group h2 {
  margin: 22px 26px 8px;
  color: #ff6965;
  font-size: 15px;
}

body[data-theme="dark"] .conversation-group:not(:first-child) h2 {
  color: #d7dbe4;
}

body[data-theme="dark"] .conversation-row-shell {
  min-height: 76px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-theme="dark"] .conversation-row-shell + .conversation-row-shell {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

body[data-theme="dark"] .conversation-row {
  gap: 14px;
  padding: 10px 0 10px 24px;
}

body[data-theme="dark"] .conversation-row .avatar,
body[data-theme="dark"] .conversation-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.84);
}

body[data-theme="dark"] .conversation-main strong {
  color: #ffffff;
  font-size: 20px;
  line-height: 1.1;
}

body[data-theme="dark"] .conversation-main span {
  color: #bfc5d0;
  font-size: 16px;
}

body[data-theme="dark"] .conversation-side {
  min-width: 44px;
}

body[data-theme="dark"] .conversation-side small {
  color: #d8dce4;
  font-size: 14px;
}

body[data-theme="dark"] .conversation-menu-button {
  color: #aeb8c8;
}

body[data-theme="dark"] .conversation-menu-button:active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

body[data-theme="dark"] .chat-thread {
  padding: 0 10px;
}

body[data-theme="dark"] .private-header {
  background: rgba(23, 27, 37, 0.82);
  border-color: rgba(255, 255, 255, 0.08);
  color: white;
}

body[data-theme="dark"] .back-button {
  color: #f4c400;
  padding-left: 8px;
}

body[data-theme="dark"] .conversation-messages {
  height: calc(100vh - 220px);
}

body[data-theme="dark"] .message-bubble {
  color: #f7f7f8;
  background: #3b414e;
  border-color: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .message.own .message-bubble {
  color: #111318;
  background: #cfeedd;
}

body[data-theme="dark"] .message-action-menu {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(36, 40, 50, 0.94);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
}

body[data-theme="dark"] .message-action-menu button {
  color: #f7f7f8 !important;
}

body[data-theme="dark"] .message-action-menu button:active {
  background: rgba(255, 255, 255, 0.08) !important;
}

body[data-theme="dark"] .message-action-menu button.danger {
  color: #ff9aaa !important;
}

body[data-theme="dark"] .image-viewer {
  background: var(--photo-matte);
}

body[data-theme="dark"] .viewer-close {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

body[data-theme="dark"] .viewer-count {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}

@media (prefers-color-scheme: dark) {
  body:not([data-theme="light"]) .image-viewer {
    background: var(--photo-matte);
  }

  body:not([data-theme="light"]) .viewer-close {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
  }

  body:not([data-theme="light"]) .viewer-count {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.14);
  }
}

body[data-theme="dark"] .chat-box {
  background: rgba(23, 27, 37, 0.92);
}

body[data-theme="dark"] .chat-box input {
  color: #f7f7f8;
  background: #2b303b;
  border-color: rgba(255, 255, 255, 0.1);
}

body[data-theme="dark"] .tabbar {
  background: rgba(18, 22, 31, 0.96);
  border-top-color: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .tab {
  color: #8f96a3;
}

body[data-theme="dark"] .tab.active {
  color: #f2f4f8;
  background: transparent;
}

.tab[data-target="home"] {
  order: 1;
}

.tab[data-target="chat"] {
  order: 4;
}

.tab[data-target="foodie"] {
  order: 2;
}

.writer-layout {
  display: grid;
  gap: 12px;
}

.writer-editor,
.note-list-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: var(--shadow);
}

.note-title-input,
.note-content-input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.note-title-input {
  display: none;
}

.reaction-bar {
  display: grid;
  gap: 6px;
  margin: 8px 0 0 42px;
  min-height: 72px;
  contain: layout;
}

.reaction-list,
.reaction-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reaction-pill,
.reaction-picker button,
.reaction-scroll button,
.reaction-actions button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--ink);
  padding: 4px 8px;
  font-size: 13px;
}

.reaction-pill.active {
  color: #9b2639;
  background: #ffe8ed;
  border-color: #ffd0da;
  font-weight: 800;
}

.reaction-list .reaction-pill {
  background: #fff6df;
  border-color: #ead7a6;
  color: #7b5a1c;
  box-shadow: 0 1px 4px rgba(92, 70, 20, 0.08);
}

.reaction-list .reaction-pill.active {
  background: #ffe0ea;
  border-color: var(--accent);
  color: #9b2639;
  box-shadow: 0 2px 8px rgba(219, 39, 119, 0.18);
}

.more-reactions {
  display: none;
  gap: 8px;
  max-width: 100%;
  contain: layout;
}

.post-card.show-reactions .more-reactions {
  display: grid;
}

.post-detail-sheet.show-reactions .more-reactions {
  display: grid;
}

.post-card.show-reactions .quick-reactions button:not(.reaction-more) {
  display: none;
}

.post-detail-sheet.show-reactions .quick-reactions button:not(.reaction-more) {
  display: none;
}

.reaction-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, 32px);
  grid-auto-columns: minmax(38px, max-content);
  gap: 6px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1px 1px 5px;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.reaction-scroll::-webkit-scrollbar {
  display: none;
}

.reaction-scroll button {
  min-width: 38px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  font-size: 16px;
}

.reaction-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.reaction-more {
  color: #586b8a;
}

.reaction-tool {
  min-width: 54px;
  white-space: nowrap;
}

.reaction-tool.danger {
  color: #9b2639;
  border-color: #ffd0da;
  background: #fff3f5;
}

.topic-badge.hidden-topic {
  color: #7a5a21;
  background: #fff4d8;
}

.edited-note {
  margin: -2px 0 5px 42px;
  color: var(--muted);
  font-size: 12px;
}

.comment-delete {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #9b2639;
  font-size: 12px;
  padding: 0 8px;
  min-width: 44px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.comment-audio {
  display: block;
  width: min(210px, 100%);
  height: 34px;
  margin-top: 4px;
}

.voice-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  border: 0;
  border-radius: 999px;
  background: #eceff3;
  color: #354052;
  padding: 4px 9px;
  font-size: 13px;
  line-height: 1.2;
}

.voice-inline span {
  font-size: 11px;
}

.voice-inline.playing {
  color: #9b2639;
  background: #ffe8ed;
}

.message-bubble .voice-inline {
  margin-top: 4px;
}

.notification-message {
  max-width: 100%;
}

.notification-bubble {
  width: min(100%, 360px);
}

.notification-post-preview {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  padding: 7px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.04);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.notification-post-preview img {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 6px;
  object-fit: cover;
}

.notification-post-preview span {
  min-width: 0;
  word-break: break-word;
}

.admin-users-title {
  margin-top: 14px;
}

.admin-user-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.admin-user-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 10px;
  overflow: hidden;
  box-sizing: border-box;
  border-radius: 8px;
  background: rgba(246, 246, 246, 0.84);
}

.admin-user-item > .avatar {
  width: 40px;
  height: 40px;
  aspect-ratio: 1;
  border-radius: 50%;
}

.admin-user-copy {
  min-width: 0;
  overflow: hidden;
}

.admin-user-item strong,
.admin-user-item .meta {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-item > .mini-button,
.admin-user-item > .role-badge {
  max-width: 96px;
  flex: 0 0 auto;
  white-space: nowrap;
}

.note-content-input {
  min-height: 180px;
  resize: vertical;
  line-height: 1.62;
}

.note-preview {
  margin: 10px 0;
  padding: 12px;
  border-radius: 8px;
  background: #f6f1e6;
  color: #2b2926;
  line-height: 1.55;
}

.note-preview h1,
.note-preview h2,
.note-preview h3,
.note-preview p {
  margin: 0 0 8px;
}

.note-preview code {
  padding: 2px 5px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.08);
}

.note-images {
  margin: 10px 0;
}

.note-images.empty {
  min-height: 76px;
}

.note-image-placeholder {
  min-height: 76px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(15, 20, 25, 0.03);
}

.draw-panel {
  margin-top: 12px;
}

.draw-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

#drawing-canvas {
  width: 100%;
  aspect-ratio: 11 / 7;
  display: block;
  border: 1px solid #eadfca;
  border-radius: 8px;
  background: #fffdf8;
  touch-action: none;
}

.writer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.publish-note-button {
  grid-column: 1 / -1;
}

.note-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.note-row {
  width: 100%;
  display: grid;
  gap: 3px;
  border: 0;
  border-radius: 8px;
  padding: 10px;
  background: #f6f1e6;
  text-align: left;
}

.note-row.active {
  background: #efe3cb;
}

.note-row strong {
  color: #1d1d1f;
  font-size: 15px;
}

.note-row span,
.note-row small {
  color: #77716b;
  font-size: 12px;
}

@media (min-width: 760px) {
  body {
    background:
      linear-gradient(90deg, rgba(247, 243, 244, 0.96), rgba(247, 243, 244, 0.82)),
      radial-gradient(circle at 20% 10%, #e7f5ef 0 22%, transparent 23%),
      radial-gradient(circle at 92% 6%, #fde3d8 0 18%, transparent 19%),
      var(--bg);
  }

  .phone-shell {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    background: rgba(247, 243, 244, 0.78);
  }

  body[data-page="me"] .profile-layout,
  body[data-page="user"] .profile-layout {
    grid-template-columns: 104px minmax(0, 1fr);
    column-gap: 22px;
    padding-left: 22px;
    padding-right: 22px;
  }
}

body[data-page="me"],
body[data-page="user"] {
  background: #ffffff;
}

body[data-page="me"] .phone-shell,
body[data-page="user"] .phone-shell {
  background: #ffffff;
}

body[data-page="me"] .topbar,
body[data-page="user"] .topbar {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: none;
}

body[data-page="me"] .my-works-panel {
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #ffffff;
  box-shadow: none;
  backdrop-filter: none;
}

body[data-page="me"] .profile-tabs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 10px;
}

body[data-page="me"] .profile-content-tabs {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  border: 0;
  background: transparent;
}

.profile-tab-search-button {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
}

.profile-search-icon {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body[data-page="me"] .profile-panel,
body[data-page="user"] .profile-panel {
  min-height: 132px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #ffffff;
  color: #111111;
  padding: 18px 4px 12px;
  overflow: visible;
}

body[data-page="me"] .profile-cover-layer,
body[data-page="user"] .profile-cover-layer,
body[data-page="me"] .profile-panel.has-cover::before,
body[data-page="user"] .profile-panel.has-cover::before {
  display: none;
}

body[data-page="me"] .profile-panel.has-cover,
body[data-page="user"] .profile-panel.has-cover {
  background: #ffffff;
  color: #111111;
}

body[data-page="me"] .profile-panel.portrait-cover,
body[data-page="user"] .profile-panel.portrait-cover {
  min-height: 132px;
  align-items: center;
}

body[data-page="me"] .avatar-large,
body[data-page="user"] .avatar-large {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 1px solid #e8e8e8;
  box-shadow: none;
}

body[data-page="me"] .profile-panel h2,
body[data-page="user"] .profile-panel h2 {
  color: #111111;
  font-size: 24px;
  line-height: 1.15;
}

body[data-page="me"] #profile-bio,
body[data-page="user"] #user-bio,
body[data-page="me"] .profile-panel.has-cover #profile-bio,
body[data-page="user"] .profile-panel.has-cover #user-bio {
  color: #111111;
  font-size: 16px;
}

body[data-page="me"] .role-badge,
body[data-page="user"] .role-badge,
body[data-page="me"] .profile-panel.has-cover .role-badge,
body[data-page="user"] .profile-panel.has-cover .role-badge {
  color: #555555;
  background: #f3f3f3;
}

body[data-page="me"] .profile-stats,
body[data-page="user"] .profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 2px 0 12px;
  padding: 10px 0;
  border-top: 1px solid #eeeeee;
  border-bottom: 1px solid #eeeeee;
  text-align: center;
  color: #111111;
}

body[data-page="me"] .profile-stats div,
body[data-page="user"] .profile-stats div {
  display: grid;
  gap: 1px;
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body[data-page="me"] .profile-stats div + div,
body[data-page="user"] .profile-stats div + div {
  border-left: 1px solid #eeeeee;
}

body[data-page="me"] .profile-stats strong,
body[data-page="user"] .profile-stats strong {
  font-size: 18px;
  line-height: 1.15;
}

body[data-page="me"] .profile-stats span,
body[data-page="user"] .profile-stats span {
  color: #555555;
  font-size: 12px;
}

body[data-page="me"] .profile-stats .profile-stat-button {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body[data-page="me"] .profile-stats .profile-stat-button strong {
  display: inline;
  font-size: 18px;
  line-height: 1.15;
}

body[data-page="me"] .profile-stats .profile-stat-button span {
  display: inline;
  margin-top: 0;
  font-size: 12px;
  line-height: 1.15;
}

body[data-page="me"] .my-post-search {
  width: min(42vw, 150px);
  margin: 0;
}

body[data-page="user"] .profile-actions {
  display: flex;
}

body[data-page="user"] .visitor-profile-topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 52px;
  align-items: center;
  min-height: 54px;
  margin: -6px -4px 6px;
  padding: max(8px, env(safe-area-inset-top)) 4px 6px;
  background: #fff;
}

body[data-page="user"] #user-avatar.avatar-large {
  width: 72px;
  height: 72px;
}

body[data-page="user"] .visitor-profile-topbar .page-back-button {
  position: static;
  width: auto;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0 8px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #111;
  font-size: 15px;
  line-height: 1;
}

body[data-page="user"] .visitor-profile-topbar .page-back-button::before {
  content: "‹";
  font-size: 42px;
  line-height: 1;
}

body[data-page="user"] .visitor-profile-topbar .back-button::before {
  content: none !important;
}

body[data-page="user"] #user-page-title {
  overflow: hidden;
  color: #111;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visitor-profile-more {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #111;
  font-size: 25px;
  font-weight: 800;
  line-height: 1;
}

body[data-page="user"] #user-profile-panel {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  min-height: 104px;
  padding: 12px 16px 10px;
  border-bottom: 0;
  background: #fff;
}

body[data-page="user"] #user-profile-panel .profile-identity {
  min-width: 0;
}

body[data-page="user"] #user-name {
  font-size: 22px;
  font-weight: 800;
}

body[data-page="user"] #user-bio {
  margin: 6px 0 0;
  color: #111;
  line-height: 1.45;
}

body[data-page="user"] #user-cover-layer,
body[data-page="user"] #user-role {
  display: none !important;
}

body[data-page="user"] .visitor-profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 2px 0 12px;
  padding: 10px 0;
  border-top: 1px solid #eeeeee;
  border-bottom: 1px solid #eeeeee;
  text-align: center;
}

body[data-page="user"] .visitor-profile-stats .profile-stat-button {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: #111;
  text-align: center;
}

body[data-page="user"] .visitor-profile-stats .profile-stat-button strong {
  display: inline;
  font-size: 18px;
  line-height: 1.15;
}

body[data-page="user"] .visitor-profile-stats .profile-stat-button span {
  display: inline;
  margin-top: 0;
  font-size: 12px;
  line-height: 1.15;
  color: #555555;
}

body[data-page="user"] .profile-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 10px;
  margin: 0 16px 16px;
}

body[data-page="user"] .profile-actions button {
  width: 100%;
  min-height: 42px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f7f7f8;
  color: #111;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 800;
}

body[data-page="user"] .profile-actions .hidden {
  display: none !important;
}

body[data-page="user"] #follow-action-button,
body[data-page="user"] #private-chat-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

body[data-page="user"] #follow-action-button.active-follow {
  background: #f7f7f8;
  color: #111;
}

.visitor-action-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 16px max(14px, env(safe-area-inset-bottom));
  background: rgba(21, 27, 31, 0.72);
}

body.visitor-action-open {
  overflow: hidden !important;
}

.visitor-action-sheet {
  width: min(100%, 520px);
  position: relative;
  z-index: 1;
}

.visitor-action-group,
.visitor-action-cancel {
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.2);
}

.visitor-action-group button,
.visitor-action-cancel {
  display: block;
  width: 100%;
  min-height: 56px;
  border: 0;
  border-bottom: 1px solid #ececec;
  background: #fff;
  color: #111;
  font-size: 19px;
  font-weight: 500;
  text-align: center;
}

.visitor-action-group button:last-child {
  border-bottom: 0;
}

.visitor-action-group button.danger {
  color: #e3222d;
  font-weight: 700;
}

.visitor-action-cancel {
  margin-top: 12px;
  border-bottom: 0;
}

body[data-page="foodie"] .topbar {
  padding-bottom: 4px;
}

body[data-page="foodie"] .page[data-page="foodie"].active {
  display: block;
  min-height: auto;
}

body[data-page="foodie"] .foodie-hero,
body[data-page="foodie"] .foodie-guide {
  display: none !important;
}

.foodie-waterfall {
  column-count: 2;
  column-gap: 8px;
  display: block;
}

.foodie-masonry-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 8px;
  break-inside: avoid;
  overflow: hidden;
}

.foodie-masonry-card .square-photo {
  width: 100%;
  aspect-ratio: 1;
}

.foodie-masonry-card .square-photo img {
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: 1;
  object-fit: cover;
}

.foodie-masonry-card .foodie-card-body {
  padding: 7px;
  gap: 5px;
}

.compact-author {
  gap: 5px;
}

.compact-author .avatar {
  width: 24px;
  height: 24px;
}

.compact-author strong {
  font-size: 13px;
}

.clamp-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 13px;
}

.compact-stars {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  align-items: center;
  gap: 2px;
}

.compact-stars button {
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #d5b24a;
  font-size: 14px;
}

.compact-stars button.active {
  color: #c94a68;
  background: transparent;
}

.compact-stars span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.comment-entry {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: #f6f6f6;
  color: #586b8a;
  padding: 6px 7px;
  text-align: left;
  font-size: 13px;
  line-height: 1.35;
}

.comment-entry strong {
  color: var(--ink);
}

.comment-entry.muted {
  color: var(--muted);
}

.post-detail-viewer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px 10px max(18px, env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.36);
}

.post-detail-viewer.hidden {
  display: none;
}

.post-detail-sheet {
  position: relative;
  width: min(100%, 560px);
  max-height: 86vh;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 16px 16px 10px 10px;
  background: var(--surface);
  box-shadow: 0 -14px 45px rgba(22, 18, 21, 0.22);
}

.post-detail-close {
  position: sticky;
  top: 0;
  justify-self: end;
  z-index: 2;
}

.detail-images,
.detail-comments,
.detail-comment-form {
  margin: 0;
}

.post-detail-viewer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: block;
  padding: 0;
  background: var(--surface);
  transform: translateX(0);
  transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.post-detail-viewer.hidden {
  display: block !important;
  pointer-events: none;
  transform: translateX(100%);
}

.image-viewer {
  z-index: 160;
}

body.detail-open #image-viewer {
  z-index: 100200;
}

.full-detail {
  width: 100%;
  max-width: 560px;
  height: 100dvh;
  max-height: none;
  margin: 0 auto;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  padding: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}

.detail-topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 44px;
  align-items: center;
  gap: 8px;
  padding: max(12px, env(safe-area-inset-top)) 12px 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.detail-back,
.detail-share,
.detail-follow {
  border: 0;
  background: transparent;
  color: var(--ink);
}

.detail-back {
  font-size: 15px;
  text-align: left;
}

.detail-author {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.detail-author .avatar {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
}

.detail-author strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.detail-follow {
  height: 32px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  padding: 0 14px;
  font-weight: 800;
}

.detail-share {
  font-size: 22px;
}

.detail-scroll {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px;
}

.detail-photo-strip {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  background: var(--photo-matte);
}

.detail-photo-strip.one {
  display: block;
}

.detail-photo-button {
  flex: 0 0 100%;
  border: 0;
  padding: 0;
  background: var(--photo-matte);
  line-height: 0;
  scroll-snap-align: start;
}

.detail-photo-button img {
  width: 100%;
  max-height: 48vh;
  object-fit: contain;
}

.detail-post-copy {
  display: grid;
  gap: 10px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
  justify-items: start;
  text-align: left;
}

.detail-post-copy .post-text {
  font-size: 18px;
  line-height: 1.55;
}

.detail-post-meta {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  width: 100%;
}

.detail-comment-panel {
  padding: 14px;
  text-align: left;
}

.detail-comment-panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.detail-comments {
  display: grid;
  gap: 0;
}

.detail-comment {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  column-gap: 8px;
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.detail-comment-avatar .avatar {
  width: 42px;
  height: 42px;
}

.detail-comment-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.detail-comment-name {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.detail-comment-name strong {
  color: var(--muted);
  font-weight: 700;
}

.detail-comment-name span {
  border-radius: 999px;
  background: #ffe8ed;
  color: #b53856;
  padding: 1px 6px;
  font-size: 11px;
}

.detail-comment-text {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.45;
  word-break: break-word;
}

.detail-comment-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  min-height: 30px;
}

.detail-comment-meta button,
.detail-reply-toggle {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-size: 13px;
}

.comment-action-stack {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  min-width: 0;
  margin-left: auto;
}

.comment-action-stack .comment-delete {
  margin-left: 0;
  color: var(--muted);
  min-width: 38px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  line-height: 1;
}

.detail-comment-meta .comment-like-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 38px;
  height: 30px;
  padding: 0 6px;
  color: var(--muted);
  line-height: 1;
}

.comment-like-button span {
  font-size: 17px;
  line-height: 1;
}

.comment-like-button em {
  font-style: normal;
  font-size: 12px;
}

.comment-like-button.liked {
  color: var(--accent);
}

.detail-reply-list {
  display: grid;
  gap: 9px;
  margin-top: 5px;
}

.detail-comment.detail-reply {
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: 7px;
  padding-bottom: 0;
}

.detail-comment.detail-reply .avatar {
  width: 24px;
  height: 24px;
  font-size: 10px;
}

.detail-reply-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  min-height: 28px;
}

.detail-reply-toggle::before {
  width: 18px;
  height: 1px;
  background: var(--line);
  content: "";
}

.detail-bottom-form {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 0;
  transform: translate3d(-50%, 0, 0);
  width: min(100%, 560px);
  z-index: 140;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
  justify-items: start;
  text-align: left;
  padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #fff;
  contain: paint;
  will-change: transform;
}

.detail-bottom-form .replying-hint {
  grid-column: 1 / -1;
}

.detail-bottom-form input[name="text"] {
  min-width: 0;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: #f2f2f4;
  padding: 0 14px;
  color: var(--ink);
  font-size: 16px;
}

.detail-bottom-form button {
  height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 12px;
  background: #2f2930;
  color: white;
}

.detail-bottom-form .voice-comment-button {
  border: 1px solid var(--line);
  background: #fff;
  color: #586b8a;
}

.detail-bottom-form .form-tool-button,
.chat-box .form-tool-button,
.comment-form .form-tool-button,
.comment-form .voice-comment-button,
.detail-bottom-form .voice-comment-button,
.chat-box .voice-message-button,
.chat-box .image-message-button {
  width: 38px;
  min-width: 38px;
  height: 38px;
  padding: 0 !important;
  display: inline-grid !important;
  place-items: center;
  line-height: 1 !important;
  font-size: 20px !important;
  font-weight: 600;
}

.voice-comment-button,
.voice-message-button {
  padding: 0 !important;
  overflow: visible;
}

.voice-speaker-icon {
  width: 27px;
  height: 27px;
  display: block;
  overflow: visible;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.voice-speaker-icon path:first-child {
  stroke: none;
}

.voice-comment-button.ready,
.voice-message-button.ready {
  color: #9b2639;
  border-color: #ffd0da !important;
  background: #ffe8ed !important;
  font-size: 20px !important;
  font-weight: 800;
}

body[data-theme="dark"] .detail-topbar,
body[data-theme="dark"] .detail-bottom-form {
  background: rgba(40, 47, 62, 0.9);
}

body[data-theme="dark"] .detail-bottom-form input[name="text"] {
  background: rgba(58, 66, 84, 0.92);
}

body[data-page="foodie"] {
  overflow: hidden;
}

body[data-page="foodie"] .phone-shell {
  height: 100dvh;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  padding-bottom: 0;
}

body[data-page="foodie"] .topbar {
  grid-row: 1;
}

body[data-page="foodie"] .page[data-page="foodie"].active {
  grid-row: 2;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 calc(76px + env(safe-area-inset-bottom));
}

body[data-page="foodie"] #foodie-list {
  margin-top: 0;
}

.tabbar {
  z-index: 90;
}

.post-card > .comment-entry {
  width: 100%;
  margin: 8px 0 0;
}

.post-card .comment-form {
  min-height: 38px;
}

.foodie-masonry-card .comment-entry {
  width: 100%;
  margin: 2px 0 0;
}

.quick-reactions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
}

.quick-reactions button:not(.reaction-more) {
  min-width: 44px;
}

.reaction-more {
  min-width: 44px;
}

body[data-page="foodie"] {
  overflow: auto;
}

body[data-page="foodie"] .phone-shell {
  height: auto;
  min-height: 100vh;
  display: block;
  overflow: visible;
  padding-bottom: calc(74px + env(safe-area-inset-bottom));
}

body[data-page="foodie"] .page[data-page="foodie"].active {
  display: block !important;
  overflow: visible;
  padding-bottom: 0;
}

body[data-page="foodie"] #foodie-list {
  display: block !important;
  margin-top: 0 !important;
}

body.detail-open {
  overflow: hidden !important;
  width: 100%;
}

body.detail-open .post-detail-viewer {
  z-index: 100100;
}

.post-detail-viewer {
  overscroll-behavior: contain;
  touch-action: pan-y;
  pointer-events: auto;
}

.post-detail-viewer * {
  pointer-events: auto;
}

.detail-scroll {
  overscroll-behavior: contain;
}

.detail-bottom-form {
  position: fixed;
  z-index: 140;
  pointer-events: auto;
  touch-action: manipulation;
}

.detail-bottom-form input,
.detail-bottom-form button,
.detail-comments button,
.post-detail-sheet button {
  pointer-events: auto;
}

.detail-photo-strip {
  background: var(--photo-matte);
  max-height: 36vh;
}

.detail-photo-button {
  background: var(--photo-matte);
  display: grid;
  place-items: center;
  height: min(36vh, 360px);
}

.detail-photo-button img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 36vh;
  object-fit: contain;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
}

.post-image-button img,
.foodie-photo img,
.image-viewer img {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
}

.detail-share {
  visibility: hidden;
  pointer-events: none;
}

body[data-page="foodie"] [data-page="home"] .feed-switch,
body[data-page="foodie"] [data-page="home"] .topic-row {
  display: none;
}

body[data-page="foodie"] #post-list.foodie-waterfall {
  display: block !important;
  column-count: 2;
  column-gap: 8px;
  margin-top: 0 !important;
}

body[data-page="foodie"] {
  overflow: auto !important;
}

body[data-page="foodie"] .phone-shell {
  min-height: 100vh !important;
  height: auto !important;
  display: block !important;
  overflow: visible !important;
  padding: max(10px, env(safe-area-inset-top)) 8px calc(74px + env(safe-area-inset-bottom)) !important;
}

body[data-page="foodie"] .page[data-page="foodie"] {
  display: none !important;
}

body[data-page="foodie"] .page[data-page="home"].active {
  display: block !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

body[data-page="foodie"] #post-list.foodie-waterfall {
  min-height: 0 !important;
  padding: 0 !important;
  transform: none !important;
}

body[data-page="foodie"] #post-list.foodie-waterfall .foodie-masonry-card {
  display: inline-block !important;
  width: 100% !important;
  margin: 0 0 8px !important;
}

body[data-page="foodie"] #post-list {
  display: none !important;
}

body[data-page="foodie"] #foodie-inline-list {
  display: block !important;
  column-count: 2;
  column-gap: 8px;
  min-height: 0 !important;
  padding: 0 !important;
  margin-top: 0 !important;
}

body[data-page="foodie"] .tabbar {
  position: fixed !important;
  left: 50% !important;
  right: auto !important;
  bottom: 0 !important;
  transform: translate3d(-50%, 0, 0) !important;
}

.reaction-list .reaction-pill {
  border-width: 1.5px;
  background: #fff0c9;
  border-color: #e5c063;
  color: #76540e;
  font-weight: 800;
}

.reaction-list .reaction-pill.active {
  background: #ffd7e4;
  border-color: var(--accent);
  color: #98233d;
}

.quick-reactions .reaction-more {
  display: inline-grid !important;
  place-items: center;
}

.chat-box {
  grid-template-columns: auto minmax(0, 1fr) auto auto auto !important;
}

.chat-box .image-message-button {
  color: #8a5a6a;
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 0 10px;
  white-space: nowrap;
}

.chat-box .image-message-button.ready {
  color: #9b2639;
  border-color: #ffd0da;
  background: #ffe8ed;
  font-weight: 800;
}

.message-image {
  display: block;
  width: min(190px, 62vw);
  max-height: 220px;
  margin-top: 6px;
  border-radius: 10px;
  object-fit: cover;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
}

.message-image-view {
  display: block;
  width: fit-content;
  border: 0;
  background: transparent;
  padding: 0;
  margin-top: 6px;
}

.message-sticker {
  display: block;
  width: min(96px, 28vw);
  max-height: 96px;
  object-fit: contain;
  margin-top: 4px;
  border-radius: 6px;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  user-select: none;
}

.message .message-sticker {
  pointer-events: none;
}

.message.sticker-only .message-bubble {
  padding: 0 !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.message.sticker-only.own .message-bubble {
  background: transparent !important;
  border-color: transparent !important;
}

body.typing .tabbar {
  display: none !important;
}

body.subpage .tabbar {
  display: none !important;
}

body.subpage .chat-box {
  bottom: 0 !important;
}

body.keyboard-open .chat-box {
  bottom: var(--keyboard-offset, 0px) !important;
  width: min(100%, 520px);
  padding: 8px 10px;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 24px rgba(33, 25, 30, 0.1);
}

body.keyboard-open .detail-bottom-form {
  bottom: var(--keyboard-offset, 0px) !important;
  padding-bottom: 10px;
  box-shadow: 0 -8px 24px rgba(33, 25, 30, 0.1);
}

@media (prefers-reduced-motion: reduce) {
  .chat-box,
  .detail-bottom-form {
    transition-duration: 1ms;
  }
}

.detail-scroll {
  padding-bottom: 92px;
}

body.subpage .conversation-messages,
body.subpage .private-messages {
  padding-bottom: 92px;
}

body.sticker-panel-open .conversation-messages,
body.sticker-panel-open .private-messages {
  padding-bottom: 286px;
}

.compact-stars {
  gap: 4px;
}

.compact-stars.pending-rating,
.compact-stars.personal-rating {
  grid-template-columns: repeat(5, 28px) minmax(0, 1fr);
}

.compact-stars button,
.foodie-stars button {
  min-width: 24px;
  height: 28px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #e6e1dc;
  color: #cfc8c0;
  font-size: 18px;
  line-height: 1;
  box-shadow: inset 0 -1px 0 rgba(151, 111, 30, 0.08);
}

.compact-stars button.filled,
.foodie-stars button.filled {
  color: #ffc400;
  background: #fff8c9;
  border-color: #ffd84d;
  box-shadow: 0 2px 9px rgba(255, 196, 0, 0.22);
}

.compact-stars button.active,
.foodie-stars button.active,
.compact-stars button:focus-visible,
.foodie-stars button:focus-visible {
  color: #ffc400;
  background: #fff4a8;
  border-color: #ffd321;
  box-shadow: 0 0 0 2px rgba(255, 211, 33, 0.2), 0 2px 9px rgba(255, 196, 0, 0.22);
}

.compact-stars span {
  font-size: 13px;
  padding-left: 2px;
  color: #817a72;
}

.compact-stars button.filled.active,
.foodie-stars button.filled.active {
  color: #ffc400;
  background: #fff3a3;
  border-color: #ffd321;
  box-shadow: 0 0 0 2px rgba(255, 211, 33, 0.26), 0 2px 9px rgba(255, 196, 0, 0.22);
}

.compact-stars button.empty.active,
.foodie-stars button.empty.active {
  color: #ffc400;
  background: #fff9df;
  border-color: #ffd321;
  box-shadow: 0 0 0 2px rgba(255, 211, 33, 0.2), 0 2px 9px rgba(255, 196, 0, 0.18);
}

body.settings-open {
  overflow: hidden !important;
}

.profile-settings-panel {
  position: fixed;
  inset: 0;
  z-index: 150;
  width: min(100%, 520px);
  height: 100dvh;
  margin: 0 auto;
  left: 50%;
  transform: translateX(-50%);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: max(12px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: -16px 0 40px rgba(42, 36, 40, 0.14);
}

.settings-sheet-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  align-items: center;
  margin: calc(-1 * max(12px, env(safe-area-inset-top))) -14px 12px;
  padding: max(12px, env(safe-area-inset-top)) 14px 10px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.settings-sheet-header strong {
  text-align: center;
  font-size: 18px;
}

.settings-sheet-header .back-button {
  margin: 0;
  padding: 0 8px;
}

.profile-settings-panel .profile-edit-list {
  display: block;
  margin: 0 -14px;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: #fff;
}

.profile-edit-media {
  display: flex;
  justify-content: center;
  justify-items: center;
  gap: 28px;
  padding: 28px 18px 24px;
  border-bottom: 1px solid var(--line);
}

.profile-edit-avatar {
  display: grid;
  justify-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.profile-edit-cover {
  display: grid;
  justify-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.profile-edit-avatar input,
.profile-edit-cover input {
  display: none;
}

.profile-edit-avatar-preview,
#profile-edit-avatar-preview {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
}

.profile-edit-avatar-preview img,
#profile-edit-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-edit-cover-preview,
#profile-edit-cover-preview {
  width: 124px;
  height: 88px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: #e05287;
  background: var(--surface-strong);
  font-size: 28px;
  font-weight: 400;
}

.profile-edit-cover-preview img,
#profile-edit-cover-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-edit-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: center;
  min-height: 60px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

.profile-edit-row > span {
  font-size: 17px;
  color: var(--text);
}

.profile-edit-row input,
.profile-edit-row select {
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 14px 0;
  background: transparent;
  color: var(--text);
  font-size: 17px;
  outline: none;
}

.profile-edit-row input::placeholder {
  color: var(--muted);
}

.profile-edit-save {
  width: calc(100% - 28px);
  min-height: 46px;
  margin: 18px 14px 10px;
  border: 0;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.reaction-bar {
  min-height: 0;
  align-content: start;
}

.post-card.show-reactions .reaction-bar,
.post-detail-sheet.show-reactions .reaction-bar {
  min-height: 96px;
}

.quick-reactions {
  align-items: center;
  min-height: 36px;
}

.quick-reactions button,
.reaction-pill,
.reaction-picker button,
.reaction-scroll button,
.reaction-actions button {
  flex: 0 0 auto;
  min-height: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.quick-reactions button:not(.reaction-more) {
  min-width: 46px;
}

.reaction-more {
  min-width: 64px;
}

.detail-photo-strip,
.detail-photo-strip.one {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}

.detail-photo-strip.one .detail-photo-button,
.detail-photo-button {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.detail-photo-button img {
  object-position: center center;
}

.compact-stars button,
.foodie-stars button {
  position: relative;
  overflow: hidden;
  transition: color 80ms ease, background-color 80ms ease, border-color 80ms ease, box-shadow 80ms ease;
}

.compact-stars [data-foodie-rate]:active,
.foodie-stars [data-foodie-rate]:active {
  color: #ffc400;
  background: #fff4a8;
  border-color: #ffd321;
  box-shadow: 0 0 0 2px rgba(255, 211, 33, 0.18);
}

.compact-stars button.empty,
.foodie-stars button.empty {
  color: #d0c8bc;
  background: #fffdf7;
  border-color: #eee2c0;
}

.compact-stars button.pending,
.foodie-stars button.pending {
  color: #aaa39b;
  background: #ffffff;
  border-color: #ddd7d0;
  box-shadow: none;
}

.compact-stars button.half,
.foodie-stars button.half {
  color: transparent;
  background: #fffdf7;
  border-color: #f0dda0;
}

.compact-stars button.half::before,
.foodie-stars button.half::before {
  content: "★";
  position: absolute;
  inset: 0;
  display: grid;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, #ffc400 50%, #d0c8bc 50%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  pointer-events: none;
}

.notification-message {
  cursor: pointer;
}

.notification-avatar-stack {
  position: relative;
  display: flex;
  align-items: center;
  width: 54px;
  min-width: 54px;
  min-height: 38px;
}

.notification-avatar-stack .stacked-avatar,
.notification-avatar-stack .stacked-more {
  width: 34px;
  height: 34px;
  margin-left: -14px;
  border: 2px solid var(--surface);
  box-shadow: 0 2px 8px rgba(35, 28, 30, 0.12);
}

.notification-avatar-stack .stacked-avatar:first-child {
  margin-left: 0;
}

.notification-avatar-stack .stacked-more {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff4a8;
  color: #9b2639;
  font-size: 11px;
  font-weight: 800;
}

.notification-message.compact-notification {
  align-items: flex-start;
}

.compact-notification .notification-bubble {
  width: min(100%, 318px);
  padding: 10px 11px;
}

.compact-notification .notification-post-preview {
  gap: 6px;
  padding: 6px;
  font-size: 12px;
}

.compact-notification .notification-post-preview img {
  width: 32px;
  height: 32px;
}

.notification-expand {
  margin: 2px 0 4px;
  border: 0;
  background: transparent;
  color: #586b8a;
  padding: 0;
  font-size: 12px;
}

.notification-comment-list {
  display: grid;
  gap: 4px;
  margin: 4px 0;
  padding: 6px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.035);
  color: #555;
  font-size: 12px;
}

.detail-comment-panel {
  padding-bottom: 8px;
}

.detail-comment-panel .empty-state {
  width: min(68vw, 260px);
  max-width: none;
  min-height: 48px;
  margin: 0;
  padding: 12px 14px;
}

.send-rise {
  animation: sendRise 220ms ease-out both;
}

@keyframes sendRise {
  from {
    opacity: 0.35;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.comment-form.sending,
.detail-bottom-form.sending,
.chat-box.sending {
  opacity: 1;
}

.post-card.removing,
.foodie-masonry-card.removing {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.comment-form.comment-focus,
.detail-bottom-form.comment-focus {
  box-shadow: 0 0 0 3px rgba(255, 211, 33, 0.24);
}

.form-tool-button {
  flex: 0 0 auto;
  width: 38px;
  min-width: 38px;
  height: 38px;
  border: 1px solid var(--line) !important;
  border-radius: 999px !important;
  background: #fff !important;
  color: #586b8a !important;
  padding: 0 !important;
  font-size: 20px !important;
  line-height: 1 !important;
}

.form-tool-button.ready {
  color: #9b2639 !important;
  border-color: #ffd0da !important;
  background: #ffe8ed !important;
  font-weight: 800;
}

.comment-form .sticker-panel,
.detail-bottom-form .sticker-panel,
.chat-box .sticker-panel {
  grid-column: 1 / -1;
}

.comment-form.sticker-open,
.detail-bottom-form.sticker-open {
  align-items: end;
}

.sticker-panel {
  grid-column: 1 / -1;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
  padding: 10px;
  margin-top: 4px;
  text-align: left;
}

.sticker-panel.hidden {
  display: none;
}

.sticker-panel-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.sticker-tab {
  width: 54px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #2f2930;
  padding: 0;
  font-size: 23px;
  line-height: 1;
}

.sticker-tab.active {
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(219, 39, 119, 0.18);
}

.sticker-tab:not(.active) {
  background: #fff !important;
  color: #2f2930 !important;
  box-shadow: none !important;
}

.sticker-panel-head .sticker-add {
  display: none !important;
}

.sticker-add,
.sticker-upload-tile {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #333;
  margin-left: auto;
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  max-height: 238px;
  overflow-y: auto;
  align-items: start;
}

.sticker-grid > * {
  min-width: 0;
  aspect-ratio: 1 / 1;
}

.sticker-grid button {
  width: 100%;
  aspect-ratio: 1;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 0;
  overflow: hidden;
}

.chat-box .sticker-grid button,
.comment-form .sticker-grid button,
.detail-bottom-form .sticker-grid button {
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 6px !important;
  padding: 0 !important;
  background: transparent !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}

.sticker-grid .system-sticker {
  display: grid;
  place-items: center;
  font-size: 28px;
  line-height: 1;
}

.sticker-grid .sticker-upload-tile {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  margin-left: 0;
  border: 1.5px dashed #2f2f2f;
  border-radius: 6px;
  font-size: 32px;
  color: #222;
  background: transparent;
  cursor: pointer;
  line-height: 1;
}

.sticker-grid img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
}

.compact-empty {
  grid-column: 1 / -1;
  padding: 14px;
}

.mention-panel {
  position: fixed;
  z-index: 100060;
  display: grid;
  gap: 4px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 -8px 28px rgba(32, 28, 31, 0.12);
}

body[data-theme="dark"] .mention-panel {
  color: var(--ink);
  background: #1f2530;
  border-color: rgba(255, 255, 255, 0.12);
}

.mention-empty {
  padding: 12px 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.mention-panel.hidden {
  display: none;
}

.mention-panel button {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 6px;
  text-align: left;
}

.tiny-avatar {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

.mini-icon-button {
  width: 34px;
  height: 34px;
  font-size: 20px;
}

.my-post-search {
  width: min(34vw, 128px);
  margin: 0 4px 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: #fff;
  font-size: 16px;
}

body[data-page="writer"] .note-list-panel,
body[data-page="writer"] .note-preview,
body[data-page="writer"] .draw-panel {
  display: none !important;
}

body[data-page="writer"] .writer-layout {
  display: block;
}

body[data-page="writer"] .writer-editor {
  border: 0;
  box-shadow: none;
}

body[data-page="writer"] .upload-box.compact {
  min-height: 42px;
  display: inline-flex;
  width: fit-content;
  gap: 6px;
  padding: 7px 10px;
  font-size: 12px;
}

body[data-page="writer"] .writer-actions {
  grid-template-columns: 1fr 1fr;
}

body.subpage .tabbar,
body.subpage[data-page="foodie"] .tabbar {
  display: none !important;
}

body:not(.subpage):not(.typing) .tabbar {
  display: grid;
}

.deleted-detail-body {
  display: grid;
  min-height: 42vh;
  place-items: center;
}

.profile-stats .profile-stat-button {
  display: block;
  width: 100%;
  padding: 10px 8px;
  border: 1px solid rgba(232, 232, 232, 0.86);
  background: #fff;
  color: var(--ink);
  text-align: center;
}

.profile-stats button.profile-stat-button {
  cursor: pointer;
}

.profile-stats .profile-stat-button.static {
  cursor: default;
}

.profile-stats .profile-stat-button strong {
  display: block;
  font-size: 17px;
}

.profile-stats .profile-stat-button span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.profile-content-tabs,
.follow-list-tabs,
.detail-bottom-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-content-tabs {
  margin: 0 0 10px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
}

.profile-content-tabs button,
.follow-list-tabs button,
.detail-action-button {
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.profile-content-tabs button.active,
.follow-list-tabs button.active,
.detail-action-button.active {
  background: #ffe8ed;
  color: #9b2639;
}

.profile-activity-card {
  width: 100%;
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  text-align: left;
}

.follow-list-viewer {
  position: fixed;
  inset: 0;
  z-index: 190;
  background: var(--bg);
}

.follow-list-sheet {
  width: min(100%, 560px);
  min-height: 100%;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px 24px;
  background: var(--bg);
}

.follow-list-sheet header {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  margin-bottom: 12px;
}

.follow-list-sheet header button {
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 15px;
  line-height: 1;
}

.follow-list-tabs {
  padding: 4px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.follow-list-tabs button {
  flex: 1;
}

.follow-list-body {
  display: grid;
  gap: 12px;
  min-height: 120px;
  animation: follow-pane-in 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
  will-change: transform, opacity;
}

.follow-list-body[data-follow-list-direction="back"] {
  animation-name: follow-pane-in-back;
}

.follow-list-sheet.is-loading .follow-list-body {
  opacity: 0.68;
  transition: opacity 180ms ease;
}

.follow-list-loading {
  min-height: 120px;
  display: grid;
  place-items: center;
}

@keyframes follow-pane-in {
  from {
    opacity: 0;
    transform: translate3d(18px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes follow-pane-in-back {
  from {
    opacity: 0;
    transform: translate3d(-18px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .follow-list-body {
    animation: none;
  }
}

.follow-list-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
}

.follow-list-item .avatar img {
  opacity: 1;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.follow-list-item span {
  display: block;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.follow-list-item button {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  padding: 0 14px;
}

.follow-list-item .follow-list-avatar {
  width: 44px;
  height: 44px;
  display: block;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.follow-list-avatar .avatar {
  width: 44px;
  height: 44px;
}

.follow-list-item .follow-list-relationship-action {
  min-width: max-content;
  color: var(--ink);
  font-weight: 700;
}

.detail-bottom-actions {
  position: sticky;
  bottom: 0;
  z-index: 4;
  justify-content: space-around;
  padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #fff;
}

.detail-action-button {
  flex: 1;
  background: #f2f2f4;
  color: var(--ink);
}

.detail-bottom-actions .favorite-icon-button {
  flex: 0 0 52px;
  height: 36px;
}

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

.favorite-icon-button {
  display: inline-grid !important;
  place-items: center;
  min-width: 46px;
  width: 46px;
  height: 34px;
  padding: 0 !important;
  border-color: rgba(219, 39, 119, 0.38) !important;
  background: rgba(255, 255, 255, 0.2) !important;
}

.favorite-star-icon {
  width: 21px;
  height: 21px;
  display: block;
  fill: transparent;
  stroke: var(--accent);
  stroke-width: 2.1;
  stroke-linejoin: round;
  transition: fill 180ms ease, stroke 180ms ease, transform 180ms ease;
}

.favorite-icon-button.active {
  border-color: var(--accent) !important;
  background: rgba(219, 39, 119, 0.12) !important;
}

.favorite-icon-button.active .favorite-star-icon {
  fill: var(--accent);
  stroke: var(--accent);
  transform: scale(1.04);
}

.message-sticker,
.sticker-grid,
.sticker-grid *,
[data-add-sticker-source],
[data-sticker-url] {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

body[data-theme="dark"] .profile-stats .profile-stat-button,
body[data-theme="dark"] .profile-content-tabs,
body[data-theme="dark"] .follow-list-tabs,
body[data-theme="dark"] .follow-list-item button,
body[data-theme="dark"] .detail-bottom-actions {
  background: rgba(42, 49, 64, 0.9);
}

.detail-post-copy .reaction-bar {
  width: 100%;
  margin: 4px 0 0;
  gap: 8px;
}

.detail-post-copy .reaction-list,
.detail-post-copy .quick-reactions {
  justify-content: flex-start;
}

.detail-post-copy .quick-reactions [data-react-post],
.detail-post-copy .quick-reactions .reaction-favorite {
  display: none !important;
}

.detail-post-copy .quick-reactions .reaction-more {
  margin-left: 0;
}

/* Final dark-mode and detail layout polish. */
.detail-post-copy {
  padding: 18px 20px 12px;
}

.detail-post-copy .post-text {
  width: 100%;
  margin: 0;
  text-align: left;
  font-size: 18px;
  line-height: 1.58;
}

.detail-post-copy .foodie-stars,
.detail-post-copy .detail-post-meta,
.detail-post-copy .reaction-bar {
  margin-left: 0;
}

.detail-photo-strip {
  max-height: 42vh;
}

.detail-photo-button {
  height: min(42vh, 430px);
}

.detail-photo-button img {
  max-height: 42vh;
}

.detail-photo-strip.pet-detail-media {
  max-height: 34vh;
}

.detail-photo-strip.pet-detail-media .detail-photo-button {
  height: min(34vh, 340px);
}

.detail-photo-strip.pet-detail-media .detail-photo-button img {
  max-height: 34vh;
}

body[data-theme="dark"] {
  --bg: #171a22;
  --surface: #202633;
  --surface-strong: #252c3a;
  --ink: #e8ecf4;
  --muted: #9aa3b3;
  --line: rgba(223, 230, 242, 0.13);
  --photo-matte: #141821;
  --shadow: 0 10px 26px rgba(8, 11, 18, 0.28);
  background: #171a22;
}

body[data-theme="dark"] .phone-shell {
  background: #202633;
  color: var(--ink);
}

body[data-theme="dark"] .topbar,
body[data-theme="dark"] .detail-topbar,
body[data-theme="dark"] .private-header,
body[data-theme="dark"] .settings-sheet-header {
  background: rgba(25, 30, 41, 0.94);
  border-color: rgba(223, 230, 242, 0.1);
  color: var(--ink);
}

body[data-theme="dark"] .topbar h1,
body[data-theme="dark"] .detail-author strong,
body[data-theme="dark"] .author strong,
body[data-theme="dark"] .foodie-author strong,
body[data-theme="dark"] .comment-entry strong,
body[data-theme="dark"] .detail-comment-name strong,
body[data-theme="dark"] .section-title h2 {
  color: var(--ink);
}

body[data-theme="dark"] .feed-switch,
body[data-theme="dark"] .segmented,
body[data-theme="dark"] .profile-content-tabs {
  background: rgba(16, 19, 27, 0.42);
  border: 1px solid rgba(223, 230, 242, 0.08);
}

body[data-theme="dark"] .feed-switch-button,
body[data-theme="dark"] .segment,
body[data-theme="dark"] .chip {
  color: #aeb6c5;
}

body[data-theme="dark"] .feed-switch-button.active,
body[data-theme="dark"] .segment.active {
  color: #f2f5fb;
  background: rgba(62, 70, 88, 0.78);
  box-shadow: none;
}

body[data-theme="dark"] .chip {
  background: rgba(39, 46, 61, 0.7);
  border-color: rgba(223, 230, 242, 0.12);
}

body[data-theme="dark"] .chip.active {
  color: #f3fbfb;
  background: #287b75;
  border-color: #287b75;
}

body[data-theme="dark"] .post-card,
body[data-theme="dark"] .foodie-card,
body[data-theme="dark"] .profile-panel,
body[data-theme="dark"] .admin-panel,
body[data-theme="dark"] .report-item,
body[data-theme="dark"] .writer-editor,
body[data-theme="dark"] .note-list-panel,
body[data-theme="dark"] .foodie-opt-in,
body[data-theme="dark"] .post-detail-sheet,
body[data-theme="dark"] .full-detail {
  background: var(--surface);
  border-color: rgba(223, 230, 242, 0.12);
  box-shadow: none;
}

body[data-theme="dark"] .page[data-page="writer"].active {
  background: var(--surface);
  border: 1px solid rgba(223, 230, 242, 0.08);
  border-radius: 10px;
  padding: 14px;
}

body[data-theme="dark"] .field input,
body[data-theme="dark"] .field textarea,
body[data-theme="dark"] .field select,
body[data-theme="dark"] .chat-box input,
body[data-theme="dark"] .detail-bottom-form input[name="text"],
body[data-theme="dark"] .note-title-input,
body[data-theme="dark"] .note-content-input {
  color: var(--ink);
  background: rgba(43, 51, 67, 0.92);
  border-color: rgba(223, 230, 242, 0.14);
}

body[data-theme="dark"] .field input::placeholder,
body[data-theme="dark"] .field textarea::placeholder,
body[data-theme="dark"] .chat-box input::placeholder,
body[data-theme="dark"] .detail-bottom-form input::placeholder {
  color: #8791a3;
}

body[data-theme="dark"] .upload-box,
body[data-theme="dark"] .secondary-button,
body[data-theme="dark"] .comment-entry,
body[data-theme="dark"] .foodie-comment-preview {
  color: #b7bfcd;
  background: rgba(237, 241, 248, 0.08);
  border-color: rgba(223, 230, 242, 0.12);
}

body[data-theme="dark"] .foodie-comment-preview strong {
  color: var(--ink);
}

body[data-theme="dark"] .foodie-comment-preview span,
body[data-theme="dark"] .comment-entry,
body[data-theme="dark"] .comment-entry.muted,
body[data-theme="dark"] .meta,
body[data-theme="dark"] .field span,
body[data-theme="dark"] .foodie-rating-tools {
  color: var(--muted);
}

body[data-theme="dark"] .tabbar {
  background: rgba(15, 18, 26, 0.96);
  border-top-color: rgba(223, 230, 242, 0.1);
}

body[data-theme="dark"] .tab {
  color: #929cac;
}

body[data-theme="dark"] .tab.active {
  color: #f3f6fb;
}

body[data-theme="dark"] .detail-bottom-actions,
body[data-theme="dark"] .detail-bottom-form {
  background: rgba(25, 30, 41, 0.94);
  border-color: rgba(223, 230, 242, 0.1);
}

body[data-theme="dark"] .detail-action-button {
  background: rgba(237, 241, 248, 0.08);
  color: #edf1f8;
}

body[data-theme="dark"] .detail-action-button.primary {
  background: var(--accent);
  color: #ffffff;
}

/* Targeted polish for favorite interactions and comfortable dark surfaces. */
.quick-reactions .favorite-icon-button,
.detail-post-copy .favorite-icon-button {
  background: rgba(255, 255, 255, 0.2) !important;
}

.quick-reactions .favorite-icon-button.active,
.detail-post-copy .favorite-icon-button.active {
  background: rgba(255, 255, 255, 0.2) !important;
}

body[data-theme="dark"][data-page="me"],
body[data-theme="dark"][data-page="user"] {
  background: #202633;
}

body[data-theme="dark"][data-page="me"] .phone-shell,
body[data-theme="dark"][data-page="user"] .phone-shell {
  background: linear-gradient(180deg, rgba(37, 44, 58, 0.94), rgba(31, 38, 51, 0.94));
}

body[data-theme="dark"][data-page="me"] .profile-panel,
body[data-theme="dark"][data-page="user"] .profile-panel,
body[data-theme="dark"][data-page="me"] .profile-panel.has-cover,
body[data-theme="dark"][data-page="user"] .profile-panel.has-cover {
  background: rgba(36, 43, 57, 0.78);
  color: #edf1f8;
  border-bottom: 1px solid rgba(223, 230, 242, 0.12);
}

body[data-theme="dark"][data-page="me"] .profile-panel h2,
body[data-theme="dark"][data-page="user"] .profile-panel h2,
body[data-theme="dark"][data-page="me"] #profile-bio,
body[data-theme="dark"][data-page="user"] #user-bio,
body[data-theme="dark"][data-page="me"] .profile-panel.has-cover #profile-bio,
body[data-theme="dark"][data-page="user"] .profile-panel.has-cover #user-bio {
  color: #edf1f8;
}

body[data-theme="dark"][data-page="me"] .role-badge,
body[data-theme="dark"][data-page="user"] .role-badge,
body[data-theme="dark"][data-page="me"] .profile-panel.has-cover .role-badge,
body[data-theme="dark"][data-page="user"] .profile-panel.has-cover .role-badge {
  color: #c6cfdd;
  background: rgba(237, 241, 248, 0.08);
}

body[data-theme="dark"][data-page="me"] .profile-stats,
body[data-theme="dark"][data-page="user"] .profile-stats {
  border-top-color: rgba(223, 230, 242, 0.12);
  border-bottom-color: rgba(223, 230, 242, 0.12);
  color: #edf1f8;
  background: rgba(28, 34, 46, 0.42);
}

body[data-theme="dark"][data-page="me"] .profile-stats div,
body[data-theme="dark"][data-page="user"] .profile-stats div,
body[data-theme="dark"] .profile-stats .profile-stat-button {
  background: transparent;
  color: #edf1f8;
  border-color: rgba(223, 230, 242, 0.12);
  box-shadow: none;
}

body[data-theme="dark"][data-page="me"] .profile-stats div + div,
body[data-theme="dark"][data-page="user"] .profile-stats div + div {
  border-left-color: rgba(223, 230, 242, 0.12);
}

body[data-theme="dark"][data-page="me"] .profile-stats span,
body[data-theme="dark"][data-page="user"] .profile-stats span,
body[data-theme="dark"] .profile-stats .profile-stat-button span {
  color: #aeb8c8;
}

body[data-theme="dark"][data-page="me"] .my-works-panel {
  background: transparent;
}

body[data-theme="dark"][data-page="me"] .profile-tabs-row {
  color: #edf1f8;
}

body[data-theme="dark"] .profile-content-tabs {
  background: rgba(16, 19, 27, 0.38);
  border-color: rgba(223, 230, 242, 0.12);
}

body[data-theme="dark"] .profile-content-tabs button {
  color: #aeb8c8;
}

body[data-theme="dark"] .profile-content-tabs button.active {
  color: #ff9cb1;
  background: rgba(255, 232, 237, 0.1);
}

body[data-theme="dark"][data-page="me"] .profile-content-tabs {
  border: 0;
  background: transparent;
}

body[data-theme="dark"][data-page="me"] .profile-tab-search-button {
  color: #edf1f8;
}

body[data-theme="dark"] .chat-box {
  background: rgba(18, 22, 31, 0.9);
  border-color: rgba(223, 230, 242, 0.1);
  box-shadow: 0 -10px 28px rgba(8, 11, 18, 0.24);
}

body[data-theme="dark"] .chat-box input {
  color: #edf1f8;
  background: rgba(42, 49, 64, 0.94);
  border-color: rgba(223, 230, 242, 0.15);
}

body[data-theme="dark"] .chat-box button:not([type="submit"]),
body[data-theme="dark"] .detail-bottom-form .form-tool-button,
body[data-theme="dark"] .detail-bottom-form .voice-comment-button,
body[data-theme="dark"] .comment-form .form-tool-button,
body[data-theme="dark"] .comment-form .voice-comment-button {
  color: #dbe2ee !important;
  background: rgba(237, 241, 248, 0.08) !important;
  border-color: rgba(223, 230, 242, 0.12) !important;
}

body[data-theme="dark"] .quick-reactions .favorite-icon-button,
body[data-theme="dark"] .quick-reactions .favorite-icon-button.active,
body[data-theme="dark"] .detail-post-copy .favorite-icon-button,
body[data-theme="dark"] .detail-post-copy .favorite-icon-button.active {
  background: rgba(237, 241, 248, 0.08) !important;
  border-color: rgba(223, 230, 242, 0.14) !important;
}

body[data-theme="dark"] .sticker-panel {
  background: rgba(31, 38, 51, 0.96);
  border-color: rgba(223, 230, 242, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

body[data-theme="dark"] .sticker-tab,
body[data-theme="dark"] .sticker-tab:not(.active) {
  color: #dbe2ee !important;
  background: rgba(237, 241, 248, 0.08) !important;
  box-shadow: none !important;
}

body[data-theme="dark"] .sticker-tab.active {
  color: #ffffff !important;
  background: var(--accent) !important;
  box-shadow: 0 8px 18px rgba(244, 114, 182, 0.2) !important;
}

body[data-theme="dark"] .sticker-grid,
body[data-theme="dark"] .sticker-grid button,
body[data-theme="dark"] .chat-box .sticker-grid button,
body[data-theme="dark"] .comment-form .sticker-grid button,
body[data-theme="dark"] .detail-bottom-form .sticker-grid button {
  color: #edf1f8 !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

body[data-theme="dark"] .sticker-grid .system-sticker {
  background: rgba(237, 241, 248, 0.04) !important;
}

body[data-theme="dark"] .sticker-grid .sticker-upload-tile {
  color: #dbe2ee !important;
  background: rgba(237, 241, 248, 0.04) !important;
  border-color: rgba(223, 230, 242, 0.28) !important;
}

body[data-theme="dark"] .compact-empty {
  color: #aeb8c8;
}

body.keyboard-open .chat-box,
body.keyboard-open .detail-bottom-form {
  border-bottom: 0;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
  box-shadow: 0 -2px 8px rgba(33, 25, 30, 0.05);
}

body[data-theme="dark"].keyboard-open .chat-box,
body[data-theme="dark"].keyboard-open .detail-bottom-form {
  box-shadow: 0 -2px 8px rgba(8, 11, 18, 0.12);
}

/* Conversation chrome: one stable header and one integrated composer. */
body[data-page="chat"].subpage .phone-shell {
  padding: env(safe-area-inset-top) 0 0;
}

body[data-page="chat"].subpage .phone-shell > .topbar {
  display: none;
}

.conversation-topbar {
  position: sticky;
  top: 0;
  z-index: 145;
  min-height: 56px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.conversation-back-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--accent);
  background: transparent;
}

.conversation-topbar-end {
  width: 44px;
  height: 44px;
}

.conversation-header {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
}

.conversation-header .avatar,
.conversation-header .conversation-icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
}

.conversation-header .conversation-icon {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--accent);
}

.conversation-title {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.conversation-title strong,
.conversation-title .meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-title strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.2;
  font-weight: 700;
}

.conversation-title .meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.conversation-line-icon {
  width: 21px;
  height: 21px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.conversation-header .conversation-line-icon {
  width: 19px;
  height: 19px;
}

body[data-page="chat"].subpage .chat-thread {
  min-height: calc(100dvh - env(safe-area-inset-top));
  padding: 0;
}

body[data-page="chat"].subpage .conversation-messages,
body[data-theme="dark"][data-page="chat"].subpage .conversation-messages {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 58px);
  right: max(0px, calc((100% - 520px) / 2));
  bottom: calc(var(--keyboard-offset, 0px) + var(--conversation-composer-height, 56px));
  left: max(0px, calc((100% - 520px) / 2));
  width: auto;
  height: auto;
  padding: 12px;
  overscroll-behavior-y: contain;
}

#conversation-message-form.conversation-composer {
  z-index: 150;
  bottom: 0 !important;
  width: min(100%, 520px);
  grid-template-columns: 36px minmax(0, 1fr) 36px 36px 42px !important;
  gap: 3px;
  align-items: center;
  padding: 7px 8px max(7px, env(safe-area-inset-bottom));
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: none;
}

#conversation-message-form.conversation-composer input[name="text"] {
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 21px;
  color: var(--ink);
  background: #f1f3f5;
  box-shadow: none;
}

#conversation-message-form.conversation-composer input[name="text"]:focus {
  border-color: rgba(219, 39, 119, 0.35);
  box-shadow: none;
}

#conversation-message-form.conversation-composer > button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  color: #707986 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#conversation-message-form.conversation-composer .voice-speaker-icon {
  width: 24px;
  height: 24px;
}

#conversation-message-form.conversation-composer .conversation-send-button {
  position: relative;
  width: 42px;
  min-width: 42px;
  height: 42px;
  color: #ffffff !important;
  background: var(--accent) !important;
  touch-action: manipulation;
}

#conversation-message-form.conversation-composer .conversation-send-button::before {
  position: absolute;
  inset: -4px 0;
  content: "";
}

#conversation-message-form.conversation-composer .conversation-send-button .conversation-line-icon {
  width: 20px;
  height: 20px;
}

#conversation-message-form.conversation-composer .form-tool-button.ready,
#conversation-message-form.conversation-composer .image-message-button.ready,
#conversation-message-form.conversation-composer .voice-message-button.ready {
  color: var(--accent) !important;
  background: rgba(219, 39, 119, 0.1) !important;
}

#conversation-message-form.conversation-composer > button:active,
.conversation-back-button:active {
  opacity: 0.62;
  transform: scale(0.92);
}

#conversation-message-form.conversation-composer .conversation-send-button:active {
  transform: none;
}

#conversation-message-form.conversation-composer .message-reply-preview {
  margin: 0 2px 3px;
  padding: 6px 8px;
  border-left-color: var(--accent);
  border-radius: 0;
  background: transparent;
}

#conversation-message-form.conversation-composer .message-reply-preview button {
  color: var(--muted) !important;
  background: transparent !important;
}

body.keyboard-open #conversation-message-form.conversation-composer {
  bottom: var(--keyboard-offset, 0px) !important;
  width: min(100%, 520px);
  padding: 7px 8px;
  border-bottom: 0;
  border-radius: 0;
  box-shadow: none;
}

body[data-theme="dark"] .conversation-topbar,
body[data-theme="dark"] #conversation-message-form.conversation-composer {
  color: var(--ink);
  background: rgba(25, 30, 41, 0.97);
  border-color: rgba(223, 230, 242, 0.1);
  box-shadow: none;
}

body[data-theme="dark"] #conversation-message-form.conversation-composer input[name="text"] {
  color: #edf1f8;
  background: #2a3140;
  border-color: transparent;
}

body[data-theme="dark"] #conversation-message-form.conversation-composer input[name="text"]:focus {
  border-color: rgba(244, 114, 182, 0.45);
}

body[data-theme="dark"] #conversation-message-form.conversation-composer > button {
  color: #aeb8c8 !important;
  background: transparent !important;
}

body[data-theme="dark"] #conversation-message-form.conversation-composer .conversation-send-button {
  color: #2a0a19 !important;
  background: #f472b6 !important;
}

/* Keep conversation bubbles light without changing notification cards. */
.conversation-messages:not(.notification-list),
.private-messages {
  --chat-bubble-incoming: #ffffff;
  --chat-bubble-outgoing: #fce7f3;
  --chat-bubble-text: #202b33;
  --chat-bubble-meta: #71808d;
  gap: 6px;
  background: #f3f5f7;
}

.conversation-messages:not(.notification-list) .message,
.private-messages .message {
  max-width: min(82%, 420px);
  gap: 6px;
}

.private-history-loader {
  display: block;
  width: fit-content;
  min-height: 30px;
  margin: 2px auto 8px;
  padding: 4px 12px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(125, 125, 125, 0.1);
  font-size: 12px;
}

.private-history-loader:disabled {
  cursor: default;
  opacity: 0.68;
}

.conversation-messages:not(.notification-list) .message-bubble,
.private-messages .message-bubble {
  color: var(--chat-bubble-text);
  padding: 7px 10px;
  border: 1px solid rgba(31, 45, 56, 0.06);
  border-radius: 15px 15px 15px 5px;
  background: var(--chat-bubble-incoming);
  box-shadow: 0 1px 2px rgba(31, 45, 56, 0.05);
}

.conversation-messages:not(.notification-list) .message.own .message-bubble,
.private-messages .message.own .message-bubble {
  color: var(--chat-bubble-text);
  border-color: rgba(219, 39, 119, 0.08);
  border-radius: 15px 15px 5px 15px;
  background: var(--chat-bubble-outgoing);
}

.conversation-messages:not(.notification-list) .message-head,
.private-messages .message-head {
  gap: 5px;
}

.conversation-messages:not(.notification-list) .message.own .message-head,
.private-messages .message.own .message-head {
  justify-content: flex-end;
}

.conversation-messages:not(.notification-list) .message.own .message-head strong,
.private-messages .message.own .message-head strong {
  display: none;
}

.conversation-messages:not(.notification-list) .message-head strong,
.conversation-messages:not(.notification-list) .message-time,
.private-messages .message-head strong,
.private-messages .message-time {
  color: var(--chat-bubble-meta);
}

.conversation-messages:not(.notification-list) .message-time,
.private-messages .message-time {
  font-size: 9px;
  opacity: 0.78;
}

.conversation-messages:not(.notification-list) .message-reply-quote,
.private-messages .message-reply-quote {
  border-left-color: var(--accent);
  background: rgba(219, 39, 119, 0.08);
}

.conversation-messages:not(.notification-list) .message-reply-quote strong,
.private-messages .message-reply-quote strong {
  color: var(--accent);
}

.conversation-messages:not(.notification-list) .message-image-view,
.private-messages .message-image-view {
  margin-top: 4px;
}

.conversation-messages:not(.notification-list) .message-image,
.private-messages .message-image {
  width: min(240px, 68vw);
  max-height: 300px;
  margin-top: 0;
  border-radius: 12px;
}

.conversation-messages:not(.notification-list) .voice-inline.playing,
.private-messages .voice-inline.playing {
  color: #be185d;
  background: rgba(219, 39, 119, 0.12);
}

.conversation-messages:not(.notification-list) .message.action-active .message-bubble,
.private-messages .message.action-active .message-bubble {
  transform: none;
  box-shadow: 0 0 0 2px rgba(219, 39, 119, 0.14);
}

body[data-theme="dark"] .conversation-messages:not(.notification-list),
body[data-theme="dark"] .private-messages {
  --chat-bubble-incoming: #2b3442;
  --chat-bubble-outgoing: #4a1831;
  --chat-bubble-text: #eef3f8;
  --chat-bubble-meta: #a8b5c3;
  background: #191e29;
}

body[data-theme="dark"] .conversation-messages:not(.notification-list) .message-bubble,
body[data-theme="dark"] .private-messages .message-bubble {
  color: var(--chat-bubble-text);
  border-color: rgba(223, 230, 242, 0.07);
  background: var(--chat-bubble-incoming);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

body[data-theme="dark"] .conversation-messages:not(.notification-list) .message.own .message-bubble,
body[data-theme="dark"] .private-messages .message.own .message-bubble {
  color: var(--chat-bubble-text);
  border-color: rgba(244, 114, 182, 0.1);
  background: var(--chat-bubble-outgoing);
}

body[data-theme="dark"] .conversation-messages:not(.notification-list) .message-reply-quote,
body[data-theme="dark"] .private-messages .message-reply-quote {
  background: rgba(244, 114, 182, 0.1);
}

body[data-theme="dark"] .conversation-messages:not(.notification-list) .message-reply-quote strong,
body[data-theme="dark"] .private-messages .message-reply-quote strong {
  color: #f472b6;
}

body[data-theme="dark"] .conversation-messages:not(.notification-list) .voice-inline,
body[data-theme="dark"] .private-messages .voice-inline {
  color: #d9e3ed;
  background: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .conversation-messages:not(.notification-list) .voice-inline.playing,
body[data-theme="dark"] .private-messages .voice-inline.playing {
  color: #fce7f3;
  background: rgba(244, 114, 182, 0.18);
}

/* Keep chat jump controls on one right-side rail above the live composer. */
body[data-page="chat"].subpage #message-jump-latest {
  bottom: calc(var(--keyboard-offset, 0px) + var(--conversation-composer-height, 56px) + 12px);
  z-index: 155;
}

body[data-page="chat"].subpage #back-to-top {
  bottom: calc(var(--keyboard-offset, 0px) + var(--conversation-composer-height, 56px) + 54px);
  z-index: 155;
}

body[data-page="chat"].subpage.sticker-panel-open #back-to-top,
body[data-page="chat"].subpage.sticker-panel-open #message-jump-latest,
body[data-page="chat"].subpage.keyboard-open #back-to-top {
  display: none !important;
}

.conversation-action-sheet {
  position: fixed;
  inset: 0;
  z-index: 230;
  display: grid;
  align-items: end;
  justify-items: center;
}

.conversation-action-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(12, 15, 20, 0.42);
}

.conversation-action-panel {
  position: relative;
  width: min(calc(100% - 24px), 366px);
  max-height: min(78dvh, 620px);
  overflow-y: auto;
  padding: 8px 12px max(12px, env(safe-area-inset-bottom));
  border: 0;
  border-radius: 24px 24px 0 0;
  background: #ffffff;
  box-shadow: 0 -12px 32px rgba(26, 31, 38, 0.16);
  animation: conversationSheetIn 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes conversationSheetIn {
  from { transform: translate3d(0, 18px, 0); opacity: 0; }
  to { transform: translate3d(0, 0, 0); opacity: 1; }
}

.conversation-action-head,
.conversation-action-confirm-head {
  display: grid;
  gap: 3px;
  padding: 10px 8px 12px;
}

.conversation-action-head strong,
.conversation-action-confirm-head strong {
  color: var(--ink);
  font-size: 16px;
}

.conversation-action-head span,
.conversation-action-confirm-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.conversation-action-list {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.conversation-action-list button {
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-size: 15px;
}

.conversation-action-list button:last-child {
  border-bottom: 0;
}

.conversation-action-list button:active,
.conversation-action-cancel:active,
.conversation-action-confirm-buttons button:active {
  background: rgba(0, 0, 0, 0.05);
}

.conversation-action-list .conversation-line-icon {
  width: 21px;
  height: 21px;
}

.conversation-action-list button.danger,
.conversation-action-confirm-buttons button.danger {
  color: #d93036;
}

.conversation-action-cancel {
  width: 100%;
  min-height: 50px;
  margin-top: 8px;
  padding: 0 12px;
  border: 0;
  color: var(--accent);
  background: transparent;
  font-size: 15px;
  font-weight: 700;
}

.conversation-action-confirm-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 4px 0;
}

.conversation-action-confirm-buttons button {
  min-height: 48px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  font-size: 15px;
  font-weight: 700;
}

.conversation-action-confirm-buttons button.danger {
  border-color: rgba(217, 48, 54, 0.24);
  background: rgba(217, 48, 54, 0.07);
}

body[data-theme="dark"] .conversation-action-panel {
  background: #191e29;
  box-shadow: 0 -12px 34px rgba(0, 0, 0, 0.34);
}

body[data-theme="dark"] .conversation-action-list,
body[data-theme="dark"] .conversation-action-list button,
body[data-theme="dark"] .conversation-action-confirm-buttons button {
  border-color: rgba(223, 230, 242, 0.11);
}

body[data-theme="dark"] .conversation-action-list button:active,
body[data-theme="dark"] .conversation-action-cancel:active,
body[data-theme="dark"] .conversation-action-confirm-buttons button:active {
  background: rgba(255, 255, 255, 0.06);
}

body[data-theme="dark"] .conversation-action-confirm-buttons button.danger {
  border-color: rgba(255, 105, 101, 0.24);
  background: rgba(255, 105, 101, 0.09);
}

@media (prefers-reduced-motion: reduce) {
  .conversation-action-panel {
    animation-duration: 1ms;
  }
}

/* Shared input surfaces; positioning and keyboard behavior stay with each form. */
body[data-theme="dark"] {
  --accent: #f472b6;
  --accent-light: #4a1831;
  --accent-dark: #f9a8d4;
  --accent-contrast: #2a0a19;
  --input-surface: #2a3140;
  --input-panel: #191e29;
  --input-text: #edf1f8;
  --input-placeholder: #8e99aa;
  --input-border: rgba(223, 230, 242, 0.1);
  --input-border-focus: rgba(244, 114, 182, 0.45);
  --input-focus-ring: 0 0 0 3px rgba(244, 114, 182, 0.45);
  --focus-ring-color: rgba(244, 114, 182, 0.45);
  --input-tool: #aeb8c8;
  --input-action: #f472b6;
}

.field input:not([type="file"]):not([type="checkbox"]):not([type="radio"]),
.field textarea,
.field select,
.my-post-search {
  color: var(--input-text);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  background: var(--input-surface);
  box-shadow: none;
  outline: 0;
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.field input:not([type="file"]):not([type="checkbox"]):not([type="radio"]):focus,
.field textarea:focus,
.field select:focus,
.my-post-search:focus {
  border-color: var(--input-border-focus);
  box-shadow: var(--input-focus-ring);
}

.field input::placeholder,
.field textarea::placeholder,
.my-post-search::placeholder,
.note-title-input::placeholder,
.note-content-input::placeholder {
  color: var(--input-placeholder);
  opacity: 1;
}

.chat-box,
.detail-bottom-form {
  color: var(--input-text);
  border-color: var(--input-border);
  background: var(--input-panel);
  box-shadow: none;
}

.chat-box input[name="text"],
.comment-form input[name="text"],
.detail-bottom-form input[name="text"],
#conversation-message-form.conversation-composer input[name="text"] {
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  color: var(--input-text);
  border: 1px solid transparent;
  border-radius: 21px;
  background: var(--input-surface);
  box-shadow: none;
  outline: 0;
  font-size: 16px;
  transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.chat-box input[name="text"]:focus,
.comment-form input[name="text"]:focus,
.detail-bottom-form input[name="text"]:focus,
#conversation-message-form.conversation-composer input[name="text"]:focus {
  border-color: var(--input-border-focus);
  box-shadow: var(--input-focus-ring);
}

.chat-box input[name="text"]::placeholder,
.comment-form input[name="text"]::placeholder,
.detail-bottom-form input[name="text"]::placeholder,
#conversation-message-form.conversation-composer input[name="text"]::placeholder {
  color: var(--input-placeholder);
  opacity: 1;
}

.comment-form .form-tool-button,
.comment-form .voice-comment-button,
.detail-bottom-form .form-tool-button,
.detail-bottom-form .voice-comment-button,
.chat-box .form-tool-button,
.chat-box .voice-message-button,
.chat-box .image-message-button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  padding: 0 !important;
  color: var(--input-tool) !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* 评论工具始终保持单行；安全区只增加底部留白，不参与控件居中。 */
.comment-form,
.detail-bottom-form {
  grid-template-columns: 36px minmax(72px, 1fr) 36px 36px 36px 48px !important;
  column-gap: 3px !important;
  align-items: center;
}

.comment-form .form-tool-button,
.comment-form .voice-comment-button,
.detail-bottom-form .form-tool-button,
.detail-bottom-form .voice-comment-button {
  width: 36px;
  min-width: 36px;
  height: 40px;
}

.comment-form > button[type="submit"],
.detail-bottom-form > button[type="submit"] {
  width: 48px !important;
  min-width: 48px !important;
  padding: 0 6px !important;
}

.comment-form > button[type="submit"],
.detail-bottom-form > button[type="submit"],
.chat-box > button[type="submit"] {
  min-width: 52px;
  height: 40px;
  padding: 0 14px;
  color: var(--accent-contrast);
  border: 0;
  border-radius: 20px;
  background: var(--input-action);
  box-shadow: none;
  font-size: 14px;
  font-weight: 700;
}

#conversation-message-form.conversation-composer .conversation-send-button {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  color: var(--accent-contrast) !important;
  border-radius: 50%;
  background: var(--input-action) !important;
}

#conversation-message-form.conversation-composer .conversation-send-button .conversation-line-icon {
  width: 20px;
  height: 20px;
}

.comment-form .form-tool-button.ready,
.comment-form .voice-comment-button.ready,
.detail-bottom-form .form-tool-button.ready,
.detail-bottom-form .voice-comment-button.ready,
.chat-box .form-tool-button.ready,
.chat-box .voice-message-button.ready,
.chat-box .image-message-button.ready {
  color: var(--input-action) !important;
  background: rgba(219, 39, 119, 0.1) !important;
}

.foodie-rating-tools input[type="checkbox"],
.foodie-opt-in input[type="checkbox"] {
  accent-color: var(--input-action);
}

body[data-theme="dark"] .field input:not([type="file"]):not([type="checkbox"]):not([type="radio"]),
body[data-theme="dark"] .field textarea,
body[data-theme="dark"] .field select,
body[data-theme="dark"] .my-post-search,
body[data-theme="dark"] .chat-box input[name="text"],
body[data-theme="dark"] .comment-form input[name="text"],
body[data-theme="dark"] .detail-bottom-form input[name="text"],
body[data-theme="dark"] #conversation-message-form.conversation-composer input[name="text"] {
  color: var(--input-text);
  border-color: var(--input-border);
  background: var(--input-surface);
}

body[data-theme="dark"] .chat-box,
body[data-theme="dark"] .detail-bottom-form,
body[data-theme="dark"] #conversation-message-form.conversation-composer {
  color: var(--input-text);
  border-color: var(--input-border);
  background: var(--input-panel);
  box-shadow: none;
}

body[data-theme="dark"] .comment-form .form-tool-button.ready,
body[data-theme="dark"] .comment-form .voice-comment-button.ready,
body[data-theme="dark"] .detail-bottom-form .form-tool-button.ready,
body[data-theme="dark"] .detail-bottom-form .voice-comment-button.ready,
body[data-theme="dark"] .chat-box .form-tool-button.ready,
body[data-theme="dark"] .chat-box .voice-message-button.ready,
body[data-theme="dark"] .chat-box .image-message-button.ready {
  background: rgba(244, 114, 182, 0.14) !important;
}

/* Home timeline: one continuous, media-forward feed. */
.timeline-feed {
  gap: 0;
  margin-right: -8px;
  margin-left: -8px;
  border-top: 1px solid var(--line);
}

.timeline-feed > .feed-post {
  width: 100%;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  box-shadow: none;
}

.feed-post .post-head {
  align-items: flex-start;
  gap: 8px;
}

.feed-post .author {
  min-width: 0;
  flex: 1 1 auto;
  align-items: flex-start;
  gap: 10px;
}

.feed-post .avatar {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

.feed-post .author > div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding-top: 1px;
  overflow: hidden;
}

.feed-post .author > .feed-author-copy {
  display: grid;
  align-items: start;
  gap: 1px;
  padding-top: 0;
  overflow: visible;
}

.feed-post .feed-author-line {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.feed-post .author strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-post .author .meta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.feed-post .author .meta::before {
  content: "·";
  margin-right: 4px;
}

.feed-post .topic-badge,
.feed-post .topic-badge.hidden-topic {
  width: max-content;
  max-width: 100%;
  overflow: visible;
  padding: 1px 0 0;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  text-overflow: clip;
  white-space: nowrap;
}

#image-viewer {
  touch-action: none;
}

.feed-post .post-text {
  margin: 5px 0 0 50px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.65;
}

.feed-post .edited-note {
  margin: 3px 0 0 50px;
}

.feed-post .post-images {
  width: calc(100% - 78px);
  margin: 9px 0 0 50px;
  gap: 2px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #eef1f4;
}

.feed-post .post-images.one,
.feed-post .post-images.multi {
  width: calc(100% - 78px);
}

.feed-post .post-images.one {
  display: block;
  width: calc(100% - 94px);
}

.feed-post .post-images.one .post-image-button {
  width: 100%;
  max-height: 300px;
  aspect-ratio: auto;
  border-radius: 0;
}

.feed-post .post-images.one img {
  width: 100%;
  height: auto;
  max-height: 300px;
  aspect-ratio: auto;
  object-fit: cover;
}

.feed-post .post-images.multi {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: clamp(104px, 26vw, 144px);
}

.feed-post .post-images.multi.two {
  width: calc(100% - 62px);
  grid-auto-rows: clamp(132px, 35vw, 174px);
}

.feed-post .post-images.multi .post-image-button {
  width: 100%;
  height: 100%;
  border-radius: 0;
}

.feed-post .post-images.multi .post-image-button:first-child:nth-last-child(3) {
  grid-row: span 2;
}

.feed-post .post-images.multi img {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
}

.feed-post .feed-reaction-bar {
  min-height: 0;
  gap: 5px;
  margin: 6px 0 0 50px;
  width: calc(100% - 78px);
  contain: layout;
}

.feed-post .feed-action-row {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  justify-items: start;
  gap: 0;
}

.feed-post .feed-action-row .feed-action-button {
  min-width: 0;
  width: auto;
  height: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  justify-self: start;
  gap: 5px;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #657786;
  background: transparent;
  box-shadow: none;
}

.feed-action-icon {
  width: 19px;
  height: 19px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feed-action-count {
  min-width: 8px;
  color: currentColor;
  font-size: 12px;
  line-height: 1;
}

.feed-post .feed-like.liked {
  color: #e54868;
}

.feed-post .feed-favorite.active,
.feed-post .feed-reaction-toggle.active,
.feed-post .feed-reaction-toggle.reacted {
  color: var(--accent);
}

.feed-post .feed-like.liked .feed-action-icon,
.feed-post .feed-favorite.active .feed-action-icon {
  fill: currentColor;
}

.post-card.feed-post.show-reactions .quick-reactions.feed-action-row button {
  display: inline-flex !important;
}

.post-card.feed-post.show-reactions .feed-reaction-bar {
  min-height: 0;
}

.feed-post .reaction-list {
  gap: 5px;
}

.feed-post .reaction-list .reaction-pill {
  min-height: 28px;
  height: 28px;
  padding: 3px 8px;
  border-color: rgba(219, 39, 119, 0.16);
  color: #526577;
  background: rgba(219, 39, 119, 0.07);
  box-shadow: none;
  font-size: 12px;
}

.feed-post .reaction-list .reaction-pill.active {
  border-color: rgba(229, 72, 104, 0.3);
  color: #c93f5d;
  background: rgba(229, 72, 104, 0.1);
  box-shadow: none;
}

.feed-post .more-reactions {
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

body[data-theme="dark"] .timeline-feed {
  border-top-color: rgba(223, 230, 242, 0.1);
}

body[data-theme="dark"] .timeline-feed > .feed-post {
  border-bottom-color: rgba(223, 230, 242, 0.1);
  background: #202633;
}

body[data-theme="dark"] .feed-post .post-images {
  border-color: rgba(223, 230, 242, 0.12);
  background: #191e29;
}

body[data-theme="dark"] .feed-post .feed-action-row .feed-action-button {
  color: #98a4b4;
  background: transparent;
}

body[data-theme="dark"] .feed-post .feed-like.liked {
  color: #ff6b88;
}

body[data-theme="dark"] .feed-post .feed-favorite.active,
body[data-theme="dark"] .feed-post .feed-reaction-toggle.active,
body[data-theme="dark"] .feed-post .feed-reaction-toggle.reacted {
  color: var(--accent);
}

body[data-theme="dark"] .feed-post .reaction-list .reaction-pill {
  border-color: rgba(244, 114, 182, 0.18);
  color: #c5d2df;
  background: rgba(244, 114, 182, 0.08);
}

body[data-theme="dark"] .feed-post .reaction-list .reaction-pill.active {
  border-color: rgba(255, 107, 136, 0.28);
  color: #ff8fa5;
  background: rgba(255, 107, 136, 0.1);
}

/* X-inspired home navigation: neutral surfaces, strong type, one thin accent. */
body[data-page="home"] [data-page="home"] .feed-switch {
  min-height: 52px;
  gap: 0;
  margin: 0 -8px;
  padding: 0;
  border-bottom: 1px solid #eff3f4;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: none;
}

body[data-page="home"] [data-page="home"] .feed-switch-button {
  position: relative;
  min-width: 44px;
  min-height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: 0;
  color: #536471;
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
}

body[data-page="home"] [data-page="home"] .feed-switch-button.active {
  color: #0f1419;
  background: transparent;
  box-shadow: none;
  font-weight: 700;
}

body[data-page="home"] [data-page="home"] .feed-switch-button.active::after,
body[data-page="home"] [data-page="home"] .topic-row .chip.active::after {
  position: absolute;
  right: 14px;
  bottom: 0;
  left: 14px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  content: "";
}

body[data-page="home"] [data-page="home"] .topic-row {
  gap: 0;
  margin: 0 -8px;
  padding: 0 4px;
  border-bottom: 1px solid #eff3f4;
  background: #fff;
}

body[data-page="home"] [data-page="home"] .topic-row .chip {
  position: relative;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  color: #536471;
  background: transparent;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}

body[data-page="home"] [data-page="home"] .topic-row .chip.active {
  color: #0f1419;
  background: transparent;
  font-weight: 700;
}

body[data-page="home"] [data-page="home"] .feed-switch-button:active,
body[data-page="home"] [data-page="home"] .topic-row .chip:active {
  background: rgba(15, 20, 25, 0.08);
  transform: none;
}

body[data-page="home"] .feed-post[data-card-open-post-detail] {
  cursor: pointer;
}

body[data-page="home"] .feed-post[data-card-open-post-detail].card-pressed {
  background: rgba(15, 20, 25, 0.045);
}

body[data-theme="dark"][data-page="home"] .feed-post[data-card-open-post-detail].card-pressed {
  background: rgba(255, 255, 255, 0.055);
}

body[data-theme="dark"][data-page="home"] [data-page="home"] .feed-switch,
body[data-theme="dark"][data-page="home"] [data-page="home"] .topic-row {
  border-color: #2f3336;
  background: rgba(0, 0, 0, 0.96);
}

body[data-theme="dark"][data-page="home"] [data-page="home"] .feed-switch-button,
body[data-theme="dark"][data-page="home"] [data-page="home"] .topic-row .chip {
  color: #71767b;
  background: transparent;
}

body[data-theme="dark"][data-page="home"] [data-page="home"] .feed-switch-button.active,
body[data-theme="dark"][data-page="home"] [data-page="home"] .topic-row .chip.active {
  color: #e7e9ea;
  background: transparent;
}

body[data-theme="dark"][data-page="home"] [data-page="home"] .feed-switch-button:active,
body[data-theme="dark"][data-page="home"] [data-page="home"] .topic-row .chip:active {
  background: rgba(231, 233, 234, 0.1);
}

/* Primary shell: three destinations, account drawer, and one global publisher. */
.tabbar {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.shell-avatar-button,
.account-drawer-avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.shell-avatar-button img,
.account-drawer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

.publish-fab {
  position: fixed;
  right: max(18px, calc((100vw - 520px) / 2 + 18px));
  bottom: calc(72px + env(safe-area-inset-bottom));
  z-index: 55;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 7px 20px rgba(190, 24, 93, 0.3);
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
}

body:not([data-page="home"]) .publish-fab,
body.subpage .publish-fab,
body.keyboard-open .publish-fab,
body.account-drawer-open .publish-fab,
body.composer-overlay-open .publish-fab {
  display: none;
}

.account-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100050;
  background: rgba(15, 20, 25, 0);
  pointer-events: none;
  transition: background var(--horizontal-slide-duration) var(--horizontal-slide-easing);
}

.account-drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(82vw, 360px);
  display: flex;
  flex-direction: column;
  padding: max(22px, env(safe-area-inset-top)) 22px max(20px, env(safe-area-inset-bottom));
  color: #0f1419;
  background: #fff;
  box-shadow: 8px 0 30px rgba(15, 20, 25, 0.16);
  transform: translate3d(-102%, 0, 0);
  transition: transform var(--horizontal-slide-duration) var(--horizontal-slide-easing);
  will-change: transform;
}

body.account-drawer-open {
  overflow: hidden;
}

body.account-drawer-open .account-drawer-backdrop {
  background: rgba(15, 20, 25, 0.4);
  pointer-events: auto;
}

body.account-drawer-open .account-drawer {
  transform: translate3d(0, 0, 0);
}

body.account-drawer-closing .account-drawer-backdrop,
body.account-drawer-closing .account-drawer {
  pointer-events: none;
}

.account-drawer-close {
  align-self: flex-end;
  width: 44px;
  height: 44px;
  margin: -8px -8px 4px 0;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: transparent;
  font-size: 25px;
}

.account-drawer-identity {
  display: grid;
  justify-items: start;
  gap: 5px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.account-drawer-identity strong {
  margin-top: 10px;
  font-size: 21px;
  line-height: 1.2;
}

.account-drawer-identity > span:last-child {
  color: #536471;
  font-size: 14px;
}

.account-drawer-user-id {
  max-width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #536471;
  background: transparent;
  font-size: 12px;
  text-align: left;
}

.account-drawer-user-id code {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-drawer-user-id svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account-drawer-stats {
  display: flex;
  gap: 20px;
  margin: 18px 0 18px;
}

.account-drawer-stats button {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
}

.account-drawer-stats span {
  color: #536471;
  font-size: 14px;
}

.account-drawer-menu {
  display: grid;
  border-top: 1px solid #eff3f4;
}

.account-drawer-menu button,
.account-drawer-footer button {
  min-height: 56px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  font-size: 17px;
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
}

.account-drawer-identity:active,
.account-drawer-menu button:active,
.account-drawer-footer button:active {
  transform: none !important;
}

.account-drawer-menu svg,
.account-drawer-footer svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account-drawer-footer {
  display: grid;
  margin-top: auto;
  border-top: 1px solid #eff3f4;
}

[data-page="writer"].composer-overlay-active {
  position: fixed;
  inset: 0;
  z-index: 100040;
  display: block !important;
  overflow-y: auto;
  padding: max(0px, env(safe-area-inset-top)) 0 env(safe-area-inset-bottom);
  background: #fff;
}

.composer-overlay-active .writer-layout {
  width: min(100%, 600px);
  min-height: 100%;
  margin: 0 auto;
  display: block;
}

.composer-overlay-active .writer-editor {
  min-height: 100%;
  padding: 0 16px 148px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.composer-input-tools {
  position: fixed;
  z-index: 100043;
  right: 0;
  bottom: var(--keyboard-offset, 0px);
  left: 0;
  width: min(100%, 600px);
  margin: 0 auto;
  padding: 7px 12px max(7px, env(safe-area-inset-bottom));
  border-top: 1px solid #eff3f4;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
}

.composer-meta-tools,
.composer-attachment-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.composer-meta-tools {
  display: flex;
  flex-wrap: nowrap;
  overflow: visible;
  padding-top: 5px;
}

.composer-meta-tools::-webkit-scrollbar {
  display: none;
}

.composer-tool-chip,
.composer-attachment-button {
  min-height: 36px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  width: max-content;
  padding: 0 8px;
  border: 1px solid #cfd9de;
  border-radius: 999px;
  color: var(--accent);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  min-width: 0;
}

.composer-tool-chip > span:last-child {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.composer-topic-chip select {
  width: auto;
  min-width: 0;
  padding: 0 18px 0 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
}

.composer-meta-tools .composer-tool-chip {
  flex: 0 0 auto;
}

.composer-meta-tools .foodie-opt-in span {
  white-space: nowrap;
}

.note-images figure {
  position: relative;
  margin: 0;
}

.note-images figure > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.note-images figure > button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(15, 20, 25, .72);
  font-size: 20px;
}

.account-drawer-menu #account-drawer-drafts {
  grid-template-columns: 30px 1fr auto;
}

.account-drawer-menu #account-drawer-drafts small {
  min-width: 22px;
  color: var(--muted);
  text-align: right;
}

.draft-viewer {
  position: fixed;
  z-index: 100045;
  inset: 0;
  overflow-y: auto;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  background: #fff;
}

.draft-viewer-header {
  position: sticky;
  z-index: 2;
  top: 0;
  min-height: 54px;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  text-align: center;
}

.draft-viewer-header button {
  min-height: 44px;
  border: 0;
  color: var(--accent);
  background: transparent;
  font-size: 16px;
}

.draft-viewer-header #draft-viewer-close {
  color: inherit;
  font-size: 15px;
}

.draft-viewer-list {
  width: min(100%, 600px);
  margin: 0 auto;
}

.draft-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.draft-card-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 11px;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.draft-card-main img,
.draft-card-placeholder {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  object-fit: cover;
  color: var(--muted);
  background: var(--soft);
  font-size: 12px;
}

.draft-card-main > span:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.draft-card-main em,
.draft-card-main small {
  overflow: hidden;
  color: var(--muted);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-card-delete {
  min-height: 40px;
  border: 0;
  color: #f4212e;
  background: transparent;
}

body[data-theme="dark"] .draft-viewer,
body[data-theme="dark"] .draft-viewer-header {
  color: #e7e9ea;
  background: #000;
}

.composer-input-tools .foodie-opt-in {
  margin: 0;
}

.composer-input-tools .foodie-opt-in input {
  width: 16px;
  height: 16px;
}

.composer-attachment-button {
  cursor: pointer;
  border: 0;
  padding: 0 8px;
}

.composer-attachment-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.composer-attachment-button svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.comment-policy-backdrop {
  position: fixed;
  z-index: 100050;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.42);
}

.comment-policy-sheet {
  width: min(100%, 600px);
  padding: 8px 18px max(20px, env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: #fff;
}

.comment-policy-handle {
  width: 38px;
  height: 5px;
  margin: 0 auto 14px;
  border-radius: 99px;
  background: #cfd9de;
}

.comment-policy-sheet h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.comment-policy-sheet button {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 32px 1fr 22px;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  color: #0f1419;
  background: transparent;
  text-align: left;
  font-size: 16px;
}

.comment-policy-sheet button > span {
  font-size: 22px;
  text-align: center;
}

.comment-policy-sheet button i {
  width: 20px;
  height: 20px;
  border: 2px solid #b8c3c9;
  border-radius: 50%;
}

.comment-policy-sheet button.selected i {
  border: 6px solid var(--accent);
}

.comment-restricted-notice {
  min-height: 48px;
  display: grid;
  place-items: center;
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface, #fff);
  font-size: 14px;
}

.publish-overlay-header {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 54px;
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  align-items: center;
  margin: 0 -16px 14px;
  padding: 0 12px;
  border-bottom: 1px solid #eff3f4;
  background: rgba(255, 255, 255, 0.96);
  text-align: center;
}

.publish-overlay-header button {
  min-height: 44px;
  padding: 0 8px;
  border: 0;
  color: #0f1419;
  background: transparent;
  font-size: 15px;
}

.publish-overlay-header .publish-overlay-submit {
  min-height: 36px;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-weight: 700;
}

.composer-overlay-active .writer-actions .publish-note-button,
.composer-overlay-active .note-list-panel {
  display: none;
}

body.composer-overlay-open {
  overflow: hidden;
}

body[data-theme="dark"] .account-drawer,
body[data-theme="dark"] [data-page="writer"].composer-overlay-active,
body[data-theme="dark"] .publish-overlay-header {
  color: #e7e9ea;
  background: #000;
}

body[data-theme="dark"] .account-drawer-menu,
body[data-theme="dark"] .account-drawer-footer,
body[data-theme="dark"] .publish-overlay-header {
  border-color: #2f3336;
}

body[data-theme="dark"] .account-drawer-identity > span:last-child,
body[data-theme="dark"] .account-drawer-user-id,
body[data-theme="dark"] .account-drawer-stats span {
  color: #71767b;
}

body[data-theme="dark"] .publish-overlay-header button {
  color: #e7e9ea;
}

body[data-theme="dark"] .publish-overlay-header .publish-overlay-submit {
  color: #fff;
}

body[data-theme="dark"] .composer-input-tools,
body[data-theme="dark"] .comment-policy-sheet {
  color: #e7e9ea;
  border-color: #2f3336;
  background: rgba(0, 0, 0, 0.97);
}

body[data-theme="dark"] .comment-policy-sheet button {
  color: #e7e9ea;
}

body[data-theme="dark"] .composer-tool-chip {
  border-color: #536471;
}

@media (prefers-reduced-motion: reduce) {
  .account-drawer-backdrop,
  .account-drawer {
    transition-duration: 1ms;
  }
}

/* Theme-independent icon geometry; themes only change paint. */
.topbar,
body[data-theme="dark"] .topbar {
  min-height: 44px;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px 6px;
}

.topbar > div,
body[data-theme="dark"] .topbar > div {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
}

.topbar h1,
body[data-theme="dark"] .topbar h1 {
  overflow: hidden;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.subpage:not(.account-drawer-open):not(.composer-overlay-open) .phone-shell > .topbar {
  display: none;
}

.icon-button,
body[data-theme="dark"] .icon-button,
.shell-avatar-button,
body[data-theme="dark"] .shell-avatar-button {
  position: static;
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  flex: 0 0 38px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

.tab,
body[data-theme="dark"] .tab {
  min-height: calc(46px + max(5px, env(safe-area-inset-bottom)));
  padding: 6px 0 max(5px, env(safe-area-inset-bottom));
  border-radius: 6px;
  font-size: 12px;
  line-height: 1;
}

.tab span,
body[data-theme="dark"] .tab span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: 19px;
  font-weight: 700;
  line-height: 24px;
}

.tab.active {
  color: var(--accent);
  background: rgba(219, 39, 119, 0.1);
}

body[data-theme="dark"] .tab.active {
  color: var(--accent);
  background: rgba(244, 114, 182, 0.12);
}

.tab[data-target="home"] { order: 1; }
.tab[data-target="foodie"] { order: 2; }
.tab[data-target="chat"] { order: 3; }

/* Context-specific density: compact chrome without shrinking content identity. */
.shell-avatar-button,
body[data-theme="dark"] .shell-avatar-button {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  flex-basis: 40px;
  display: grid;
  place-items: center;
  overflow: visible;
  border: 0;
  background: transparent;
}

.shell-avatar-visual {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.shell-avatar-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.timeline-feed > .feed-post {
  padding: 10px 12px 9px;
}

.feed-post .author {
  gap: 10px;
}

.feed-post .avatar {
  width: 44px;
  height: 44px;
  font-size: 14px;
}

.feed-post .author strong {
  font-size: 16px;
}

.feed-post .post-text {
  margin: 4px 0 0 54px;
  font-size: 16px;
  line-height: 1.5;
}

.feed-post .edited-note {
  margin: 2px 0 0 54px;
}

.feed-post .post-images {
  margin: 7px 0 0 54px;
}

.feed-post .feed-reaction-bar {
  margin: 4px 0 0 54px;
  width: calc(100% - 94px);
}

.conversation-row .avatar,
.conversation-row .conversation-icon,
body[data-theme="dark"] .conversation-row .avatar,
body[data-theme="dark"] .conversation-row .conversation-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
}

.conversation-main strong,
body[data-theme="dark"] .conversation-main strong {
  font-size: 16px;
  line-height: 1.25;
}

.conversation-main span,
body[data-theme="dark"] .conversation-main span {
  font-size: 14px;
  line-height: 1.35;
}

.conversation-header .avatar,
.conversation-header .conversation-icon {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
}

.detail-comment-avatar .avatar {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

.detail-comment-name strong {
  font-size: 14px;
}

.detail-comment-body p {
  font-size: 15px;
  line-height: 1.45;
}

.message p {
  font-size: 15px;
  line-height: 1.45;
}

.tabbar {
  padding: 0 8px env(safe-area-inset-bottom);
}

.tab,
body[data-theme="dark"] .tab {
  height: 48px;
  min-height: 48px;
  display: grid;
  grid-template-rows: 28px 14px;
  align-content: center;
  justify-items: center;
  gap: 2px;
  padding: 2px 0;
  box-sizing: border-box;
  font-size: 11px;
  line-height: 14px;
}

.tab .tab-icon,
body[data-theme="dark"] .tab .tab-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: currentColor;
}

.tab .tab-icon svg,
body[data-theme="dark"] .tab .tab-icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab .tab-label,
body[data-theme="dark"] .tab .tab-label {
  width: auto;
  height: 14px;
  display: block;
  font-size: 11px;
  font-weight: inherit;
  line-height: 14px;
  white-space: nowrap;
}

.publish-fab {
  bottom: calc(58px + env(safe-area-inset-bottom));
}

/* Post management stays separate from the lightweight reaction picker. */
.post-head-tools {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 2px;
}

.post-management {
  position: relative;
  flex: 0 0 auto;
}

.post-management-toggle {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  margin: -8px -8px -8px 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
}

.post-management-toggle svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.post-management-toggle:active,
.post-management.open .post-management-toggle {
  color: var(--accent);
  background: var(--accent-light);
}

.post-management-menu {
  position: absolute;
  top: 34px;
  right: 0;
  z-index: 210;
  width: max-content;
  min-width: 148px;
  overflow: hidden;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(15, 20, 25, 0.18);
}

.post-management-menu button,
.post-management-menu .foodie-tag {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-size: 15px;
  white-space: nowrap;
}

.post-management-menu button:active {
  background: var(--accent-light);
}

.post-management-menu button.danger {
  color: #d92d4b;
}

.post-management-detail .post-management-toggle {
  margin: 0;
}

.post-management-detail .post-management-menu {
  top: 46px;
  right: 6px;
}

.detail-reaction-toggle {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  padding: 0;
}

.detail-reaction-toggle .feed-action-icon {
  width: 20px;
  height: 20px;
}

.post-card.show-reactions .reaction-bar,
.post-detail-sheet.show-reactions .reaction-bar {
  min-height: 0;
}

.more-reactions {
  padding-top: 5px;
}

body[data-theme="dark"] .post-management-menu {
  border-color: rgba(223, 230, 242, 0.14);
  background: #202633;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.34);
}

body[data-theme="dark"] .post-management-toggle:active,
body[data-theme="dark"] .post-management.open .post-management-toggle,
body[data-theme="dark"] .post-management-menu button:active {
  background: rgba(244, 114, 182, 0.12);
}

body[data-theme="dark"] .profile-settings-panel,
body[data-theme="dark"] .profile-settings-panel .profile-edit-list,
body[data-theme="dark"] .profile-edit-avatar-preview,
body[data-theme="dark"] .visitor-action-group,
body[data-theme="dark"] .visitor-action-group button,
body[data-theme="dark"] .visitor-action-cancel {
  background: #202633;
  color: #edf1f8;
}

body[data-theme="dark"] .profile-edit-save {
  background: #edf1f8;
  color: #111318;
}

body[data-theme="dark"][data-page="user"] .visitor-profile-topbar {
  background: #202633;
}

body[data-theme="dark"][data-page="user"] #user-page-title,
body[data-theme="dark"][data-page="user"] .visitor-profile-more,
body[data-theme="dark"][data-page="user"] .visitor-profile-topbar .page-back-button,
body[data-theme="dark"][data-page="user"] .visitor-profile-stats .profile-stat-button,
body[data-theme="dark"][data-page="user"] .visitor-profile-stats .profile-stat-button span {
  color: #edf1f8;
}

body[data-theme="dark"][data-page="user"] .profile-actions button {
  background: rgba(237, 241, 248, 0.08);
  color: #edf1f8;
}

body[data-page="user"],
body[data-page="user"] .phone-shell,
body[data-page="user"] .visitor-profile-topbar,
body[data-page="user"] #user-profile-panel,
body[data-theme="dark"][data-page="user"],
body[data-theme="dark"][data-page="user"] .phone-shell,
body[data-theme="dark"][data-page="user"] .visitor-profile-topbar,
body[data-theme="dark"][data-page="user"] #user-profile-panel {
  background: #fff;
  color: #111;
}

body[data-theme="dark"][data-page="user"] #user-page-title,
body[data-theme="dark"][data-page="user"] .visitor-profile-more,
body[data-theme="dark"][data-page="user"] .visitor-profile-topbar .page-back-button,
body[data-theme="dark"][data-page="user"] #user-name,
body[data-theme="dark"][data-page="user"] #user-bio {
  color: #111;
}

body[data-theme="dark"][data-page="user"] .profile-actions button {
  background: #f0f0f2;
  color: #111;
}

body[data-theme="dark"][data-page="user"] #follow-action-button.active-follow {
  background: #f0f0f2;
  color: #111;
}

/* Final bottom navigation sizing: icon-only, same dimensions in light/dark. */
:root {
  --primary-tabbar-height: 56px;
  --primary-tab-hit: 56px;
  --primary-tab-icon: 24px;
  --primary-tab-icon-box: 28px;
  --primary-bottom-clearance: 64px;
}

.phone-shell,
body[data-theme="dark"] .phone-shell {
  padding-bottom: calc(var(--primary-bottom-clearance) + env(safe-area-inset-bottom));
}

body[data-page="foodie"] .phone-shell,
body[data-theme="dark"][data-page="foodie"] .phone-shell {
  padding-bottom: calc(var(--primary-bottom-clearance) + env(safe-area-inset-bottom)) !important;
}

body[data-page="foodie"] #post-list.foodie-waterfall,
body[data-theme="dark"][data-page="foodie"] #post-list.foodie-waterfall {
  padding-bottom: calc(var(--primary-bottom-clearance) + env(safe-area-inset-bottom)) !important;
}

.messages {
  padding-bottom: var(--primary-bottom-clearance);
}

.tabbar,
body[data-theme="dark"] .tabbar {
  height: calc(var(--primary-tabbar-height) + env(safe-area-inset-bottom));
  min-height: calc(var(--primary-tabbar-height) + env(safe-area-inset-bottom));
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 0;
  padding: 0 8px env(safe-area-inset-bottom);
}

.tab,
body[data-theme="dark"] .tab {
  height: var(--primary-tab-hit);
  min-height: var(--primary-tab-hit);
  display: grid;
  grid-template-rows: 28px 16px;
  place-items: center;
  align-content: center;
  justify-items: center;
  gap: 0;
  padding: 4px 0 8px;
  border-radius: 0;
  background: transparent;
  font-size: 12px;
  line-height: 16px;
}

.tab .tab-label,
body[data-theme="dark"] .tab .tab-label {
  display: block;
  height: 16px;
  font-size: 12px;
  line-height: 16px;
}

.tab .tab-icon,
body[data-theme="dark"] .tab .tab-icon {
  width: var(--primary-tab-icon-box);
  height: var(--primary-tab-icon-box);
  display: grid;
  place-items: center;
  color: currentColor;
}

.tab .tab-icon svg,
body[data-theme="dark"] .tab .tab-icon svg {
  width: var(--primary-tab-icon);
  height: var(--primary-tab-icon);
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.tab.active,
body[data-theme="dark"] .tab.active {
  color: var(--accent);
  background: transparent;
  font-weight: 800;
}

.tab.active .tab-icon,
body[data-theme="dark"] .tab.active .tab-icon {
  border-radius: var(--radius-small);
  background: rgba(219, 39, 119, 0.1);
}

body[data-theme="dark"] .tab.active .tab-icon {
  background: rgba(244, 114, 182, 0.12);
}

.publish-fab {
  bottom: calc(var(--primary-bottom-clearance) + env(safe-area-inset-bottom));
}

/* Soft pink conversation icons for public room and notifications. */
.conversation-row-shell[data-conversation-type="public"] .conversation-icon,
.conversation-row-shell[data-conversation-type="notifications"] .conversation-icon,
body[data-theme="dark"] .conversation-row-shell[data-conversation-type="public"] .conversation-icon,
body[data-theme="dark"] .conversation-row-shell[data-conversation-type="notifications"] .conversation-icon {
  border: 1px solid rgba(219, 39, 119, 0.16);
  border-radius: 12px;
  color: var(--accent);
  background: linear-gradient(135deg, #fff1f6, #ffe6ef);
  box-shadow: 0 6px 16px rgba(219, 39, 119, 0.08);
}

.conversation-row-shell[data-conversation-type="public"] .conversation-icon {
  color: #be185d;
}

.conversation-row-shell[data-conversation-type="notifications"] .conversation-icon {
  color: #db2777;
}

.conversation-header .conversation-icon,
body[data-theme="dark"] .conversation-header .conversation-icon {
  border: 1px solid rgba(219, 39, 119, 0.16);
  color: var(--accent);
  background: linear-gradient(135deg, #fff1f6, #ffe6ef);
}

body[data-theme="dark"] .conversation-row-shell[data-conversation-type="public"] .conversation-icon,
body[data-theme="dark"] .conversation-row-shell[data-conversation-type="notifications"] .conversation-icon,
body[data-theme="dark"] .conversation-header .conversation-icon {
  border-color: rgba(244, 114, 182, 0.2);
  color: #f472b6;
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.18), rgba(219, 39, 119, 0.12));
  box-shadow: none;
}

/* Pet accounts: phase-one application, publishing and discovery surfaces. */
.foodie-inline-header {
  display: grid;
  gap: 0;
  margin-bottom: 10px;
}

.foodie-section-switch {
  position: sticky;
  top: 0;
  z-index: 12;
  width: auto;
  min-height: 52px;
  gap: 0;
  margin: 0 -8px;
  padding: 0;
  border-bottom: 1px solid #eff3f4;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: none;
}

.foodie-section-switch .feed-switch-button {
  position: relative;
  min-width: 44px;
  min-height: 52px;
  padding: 0 16px;
  border: 0;
  border-radius: 0;
  color: #536471;
  background: transparent;
  box-shadow: none;
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
}

.foodie-section-switch .feed-switch-button.active {
  color: #0f1419;
  background: transparent;
  box-shadow: none;
  font-weight: 700;
}

.foodie-section-switch .feed-switch-button::after {
  position: absolute;
  right: 14px;
  bottom: 0;
  left: 14px;
  height: 3px;
  border-radius: 999px;
  background: var(--accent);
  content: "";
  opacity: 0;
  transform: scaleX(0.35);
  transition: opacity 160ms ease, transform 160ms ease;
}

.foodie-section-switch .feed-switch-button.active::after {
  opacity: 1;
  transform: scaleX(1);
}

.foodie-inline-header .foodie-guide {
  margin-top: 10px;
}

body[data-page="foodie"] #foodie-inline-list.hidden,
body[data-page="foodie"] #pet-inline-list.hidden {
  display: none !important;
}

body[data-page="foodie"] #pet-inline-list:not(.hidden) {
  display: block !important;
  column-count: 2;
  column-gap: 8px;
  min-height: 0;
  padding: 0;
}

body[data-page="foodie"] [data-page="home"] .foodie-section-switch {
  display: grid !important;
}

.pet-masonry-card {
  display: inline-block;
  width: 100%;
  break-inside: avoid;
  margin-bottom: 8px;
}

.pet-card-author,
.pet-owner-row,
.pet-detail-author {
  border: 0;
  background: transparent;
  color: inherit;
}

.pet-card-author {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  text-align: left;
}

.pet-card-author > span:last-child {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.pet-avatar {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--accent-light);
  font-size: 18px;
}

.pet-avatar img,
.pet-profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pet-type-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--accent-dark);
  background: var(--accent-light);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.pet-overlay {
  position: fixed;
  inset: 0;
  z-index: 92;
  overflow: auto;
  background: var(--bg);
}

#pet-profile-view {
  z-index: 100110;
}

body.detail-open .page.profile-page-active {
  z-index: 100110 !important;
}

.pet-overlay-header {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 54px;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  padding: env(safe-area-inset-top) 12px 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(16px);
  text-align: center;
}

.pet-overlay-body {
  width: min(100%, 680px);
  margin: 0 auto;
  display: grid;
  gap: 20px;
  padding: 16px 12px calc(30px + env(safe-area-inset-bottom));
}

.pet-management-list,
.pet-application-list {
  display: grid;
  gap: 10px;
}

.pet-management-card,
.pet-application-card,
.pet-review-card,
.pet-form-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  padding: 12px;
}

.pet-management-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.pet-management-card > div:nth-child(2),
.pet-management-actions {
  display: grid;
  gap: 4px;
}

.pet-management-card p,
.pet-application-card p,
.pet-review-card p {
  margin: 3px 0;
  color: var(--muted);
}

.pet-management-card.deactivated {
  opacity: 0.72;
}

.pet-cooldown-notice,
.pet-archive-notice {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(236, 72, 153, 0.22);
  border-radius: 10px;
  color: #9d174d;
  background: rgba(253, 242, 248, 0.94);
  font-size: 13px;
  line-height: 1.5;
}

.pet-status-badge {
  display: inline-flex;
  margin-left: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.pet-management-actions button,
.pet-application-card button,
.review-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
}

.pet-form-card h2,
.pet-edit-sheet h2 {
  margin-top: 0;
}

.pet-form-preview {
  max-width: 180px;
  max-height: 180px;
  border-radius: 12px;
  object-fit: cover;
}

.pet-review-card {
  display: grid;
  gap: 7px;
}

.pet-review-media {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
}

.pet-review-media img,
.pet-review-media > span {
  width: 100%;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-light);
  object-fit: cover;
  font-size: 32px;
}

.pet-profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 4px;
}

.pet-feed-filter {
  display: inline-flex;
  gap: 4px;
  margin-top: 9px;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-strong);
}

.pet-feed-filter button {
  min-height: 30px;
  padding: 4px 12px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
}

.pet-feed-filter button.active {
  color: #fff;
  background: var(--accent);
}

.pet-people-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pet-person-card {
  min-width: 0;
  min-height: 126px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface);
  text-align: center;
}

.pet-person-card.empty {
  color: var(--muted);
  border-style: dashed;
}

.pet-person-card strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pet-person-card small {
  color: var(--muted);
}

.pet-person-avatar,
.pet-person-avatar-placeholder {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--accent-light);
  font-size: 24px;
}

.pet-person-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pet-profile-relationship-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pet-follow-button,
.pet-updater-invite-form button,
.pet-updater-pending button {
  min-height: 36px;
  padding: 7px 13px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-weight: 700;
}

.pet-follow-button.active {
  color: var(--ink);
  background: var(--surface-strong);
  box-shadow: inset 0 0 0 1px var(--line);
}

.pet-follower-count {
  color: var(--muted);
  font-size: 13px;
}

.pet-updater-invite-form,
.pet-updater-pending {
  flex: 1 0 100%;
  display: flex;
  align-items: end;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: var(--surface-strong);
}

.pet-updater-invite-form label {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 5px;
}

.pet-updater-invite-form label span,
.pet-updater-pending span {
  color: var(--muted);
  font-size: 12px;
}

.pet-updater-invite-form input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 10px;
}

.pet-updater-danger {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  color: #a3213b;
  background: #ffe8ed;
}

.pet-invite-notification-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.pet-invite-notification-actions button {
  min-height: 34px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface);
}

.pet-invite-notification-actions button:first-child {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.pet-profile-header h2,
.pet-profile-header p {
  margin: 3px 0;
}

.pet-profile-avatar {
  flex: 0 0 auto;
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--accent-light);
  font-size: 45px;
}

.pet-owner-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
}

.pet-owner-row > span {
  display: grid;
}

.pet-edit-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100120;
  display: grid;
  place-items: end center;
  background: rgba(0, 0, 0, 0.36);
}

.pet-edit-sheet {
  width: min(100%, 560px);
  display: grid;
  gap: 12px;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0;
  background: var(--surface);
}

.pet-edit-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pet-edit-actions button {
  min-height: 44px;
}

.pet-deactivate-button {
  min-height: 42px;
  border: 1px solid rgba(190, 24, 93, 0.24);
  border-radius: 10px;
  color: #be185d;
  background: #fff1f5;
}

.pet-deactivate-warning {
  margin: 0;
  color: #9f1239;
  line-height: 1.55;
}

.pet-deactivate-ack {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.pet-deactivate-sheet .danger-button {
  margin: 0;
}

.pet-content-confirm {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 2px;
  color: var(--muted);
  font-size: 13px;
}

.pet-detail-author {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  text-align: left;
}

.pet-detail-avatar-stack {
  position: relative;
  flex: 0 0 42px;
  width: 42px;
  height: 38px;
  isolation: isolate;
}

.pet-detail-pet-link,
.pet-detail-name,
.pet-detail-owner-link {
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
}

.pet-detail-pet-link {
  display: grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  overflow: hidden;
  border-radius: 50%;
}

.pet-detail-avatar-stack .pet-avatar {
  width: 34px;
  height: 34px;
}

.pet-detail-owner-avatar-button {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 20px;
  min-width: 20px;
  max-width: 20px;
  height: 20px;
  min-height: 20px;
  max-height: 20px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--surface);
  color: inherit;
  font-size: 10px;
  line-height: 1;
}

.pet-detail-owner-avatar-button .pet-owner-avatar {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 50%;
}

.pet-detail-owner-avatar-button .pet-owner-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.pet-detail-identity-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.pet-detail-name {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 5px;
  text-align: left;
}

.pet-detail-name strong {
  max-width: 120px;
}

.pet-detail-owner-link {
  width: fit-content;
  max-width: 150px;
  overflow: hidden;
  color: var(--muted);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.pet-detail-author small,
.pet-publisher-note {
  color: var(--muted);
  font-size: 11px;
}

.pet-menu-icon {
  width: 24px;
  text-align: center;
}

body[data-theme="dark"] .pet-type-badge {
  color: #f9a8d4;
}

body[data-theme="dark"] .foodie-section-switch {
  border-color: rgba(223, 230, 242, 0.1);
  background: rgba(25, 30, 41, 0.98);
}

body[data-theme="dark"] .foodie-section-switch .feed-switch-button {
  color: #aeb6c5;
  background: transparent;
}

body[data-theme="dark"] .foodie-section-switch .feed-switch-button.active {
  color: #f2f5fb;
  background: transparent;
}

body[data-theme="dark"] .pet-detail-owner-avatar-button {
  border-color: #191e29;
  background: #191e29;
}

body[data-theme="dark"] .pet-cooldown-notice,
body[data-theme="dark"] .pet-archive-notice {
  color: #f9a8d4;
  background: rgba(131, 24, 67, 0.22);
}

/* Final pet-only layout authority: keep mobile at two columns and expand only pet surfaces on desktop. */
body[data-page="foodie"] #pet-inline-list:not(.hidden) {
  display: block !important;
  column-count: 2 !important;
  column-gap: 8px !important;
  min-width: 0;
}

body[data-page="foodie"] #pet-inline-list:not(.hidden) > .pet-masonry-card {
  display: inline-block !important;
  width: 100% !important;
  margin: 0 0 8px !important;
  break-inside: avoid;
}

body[data-page="foodie"] #pet-inline-list:not(.hidden) > .empty-state {
  column-span: all;
}

.pet-updater-leave {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 3px 7px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 500;
}

.pet-updater-leave:hover,
.pet-updater-leave:focus-visible {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface-strong);
}

@media (min-width: 760px) {
  body[data-page="foodie"].pet-feed-mode .phone-shell {
    max-width: 920px;
  }

  body[data-page="foodie"] #pet-inline-list:not(.hidden) {
    column-count: 3 !important;
    column-gap: 12px !important;
  }

}

@media (min-width: 1200px) {
  body[data-page="foodie"].pet-feed-mode .phone-shell {
    max-width: 1120px;
  }

  body[data-page="foodie"] #pet-inline-list:not(.hidden) {
    column-count: 4 !important;
  }

}

#pet-profile-view .pet-overlay-body {
  width: min(100%, 680px);
}

#pet-profile-view .pet-profile-posts {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  column-count: auto !important;
  gap: 8px;
}
/* Capacity pagination controls: authoritative final rule. */
.post-page-more {
  display: block;
  width: min(100%, 320px);
  min-height: 40px;
  margin: 18px auto;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  column-span: all;
  break-inside: avoid;
}

.post-page-more:disabled {
  cursor: wait;
  opacity: 0.65;
}

/* Final viewport stability authority: geometry must not change with theme or scroll compositing. */
.tabbar,
body[data-theme="dark"] .tabbar {
  left: 0;
  right: 0;
  margin: 0 auto;
  transform: none;
  contain: none;
  will-change: auto;
}

body:not(.subpage) .back-to-top {
  width: 44px;
  height: 44px;
  bottom: calc(var(--primary-bottom-clearance) + 68px + env(safe-area-inset-bottom));
}

body[data-page="chat"].subpage,
body[data-page="chat"].subpage .phone-shell,
body[data-page="chat"].subpage .page[data-page="chat"].active {
  overflow: hidden;
  background: #f3f5f7;
}

body[data-theme="dark"][data-page="chat"].subpage,
body[data-theme="dark"][data-page="chat"].subpage .phone-shell,
body[data-theme="dark"][data-page="chat"].subpage .page[data-page="chat"].active {
  background: #191e29;
}

body[data-page="chat"].subpage .chat-thread,
body[data-theme="dark"][data-page="chat"].subpage .chat-thread {
  position: fixed;
  top: env(safe-area-inset-top);
  right: 0;
  bottom: 0;
  left: 0;
  width: min(100%, 520px);
  min-height: 0;
  margin: 0 auto;
  overflow: hidden;
  padding: 0;
  background: #f3f5f7;
}

body[data-theme="dark"][data-page="chat"].subpage .chat-thread {
  background: #191e29;
}

body[data-page="chat"].subpage .conversation-messages,
body[data-theme="dark"][data-page="chat"].subpage .conversation-messages {
  top: calc(env(safe-area-inset-top) + 56px);
}

#conversation-message-form.conversation-composer,
body[data-theme="dark"] #conversation-message-form.conversation-composer {
  left: 0;
  right: 0;
  margin: 0 auto;
  transform: none;
  contain: none;
  will-change: auto;
}

.conversation-row .avatar,
.conversation-row .conversation-icon,
body[data-theme="dark"] .conversation-row .avatar,
body[data-theme="dark"] .conversation-row .conversation-icon {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  height: 44px;
  min-height: 44px;
  max-height: 44px;
  flex: 0 0 44px;
  aspect-ratio: 1;
  overflow: hidden;
}

.conversation-row-shell[data-conversation-type="public"] .conversation-icon,
.conversation-row-shell[data-conversation-type="notifications"] .conversation-icon,
body[data-theme="dark"] .conversation-row-shell[data-conversation-type="public"] .conversation-icon,
body[data-theme="dark"] .conversation-row-shell[data-conversation-type="notifications"] .conversation-icon {
  border-radius: 12px;
  line-height: 1;
}

body[data-theme="dark"] .conversation-row-shell {
  min-height: 68px;
}

body[data-theme="dark"] .conversation-row {
  gap: 10px;
  padding: 10px 0 10px 10px;
}

body[data-theme="dark"] .conversation-side small {
  font-size: 12px;
  line-height: 1.3;
}

/* Final design-system authority: an even-number type scale and semantic dark surfaces. */
:root {
  --type-title-1: 20px;
  --type-title-2: 18px;
  --type-body: 16px;
  --type-supporting: 14px;
  --type-caption: 12px;
  --leading-title: 1.25;
  --leading-body: 1.5;
  --color-success: #16805f;
  --color-warning: #9a6700;
  --color-danger: #c93655;
}

body {
  font-size: var(--type-body);
  line-height: var(--leading-body);
}

.topbar h1,
.profile-card-content h2,
.profile-panel h2 {
  font-size: var(--type-title-1);
  line-height: var(--leading-title);
}

.section-title h2,
.settings-sheet-header strong,
.draft-viewer-header strong {
  font-size: var(--type-title-2);
  line-height: var(--leading-title);
}

.meta,
.field span,
.tiny-note,
.conversation-main span,
.account-drawer-identity > span:last-child,
.account-drawer-stats span {
  font-size: var(--type-supporting);
  line-height: var(--leading-body);
}

small,
.eyebrow {
  font-size: var(--type-caption);
}

body[data-theme="dark"] {
  --bg: #11141a;
  --surface: #191e27;
  --surface-strong: #222936;
  --ink: #edf1f7;
  --muted: #aeb7c5;
  --line: rgba(226, 232, 240, 0.14);
  --photo-matte: #0d1015;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  --input-surface: #222936;
  --input-panel: #191e27;
  --input-text: #edf1f7;
  --input-placeholder: #98a3b3;
  --input-border: rgba(226, 232, 240, 0.14);
  --input-border-focus: rgba(240, 132, 181, 0.55);
  --input-focus-ring: 0 0 0 3px rgba(240, 132, 181, 0.2);
  --focus-ring-color: rgba(240, 132, 181, 0.45);
  --input-tool: #aeb7c5;
  --input-action: #d85b92;
  --accent: #e36a9f;
  --accent-light: #3a202e;
  --accent-dark: #c94f84;
  --color-success: #55c89a;
  --color-warning: #e5b75a;
  --color-danger: #ef8096;
  background: var(--bg);
}

body[data-theme="dark"] .phone-shell {
  color: var(--ink);
  background: var(--bg);
}

/* The title stays optically centered even when the side controls change. */
.topbar,
body[data-theme="dark"] .topbar {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  justify-content: initial;
  align-items: center;
}

.topbar > div,
body[data-theme="dark"] .topbar > div {
  width: 100%;
  text-align: center;
}

body[data-page="home"] [data-page="home"] .feed-switch-button,
body[data-page="home"] [data-page="home"] .topic-row .chip,
.foodie-section-switch .feed-switch-button {
  display: grid;
  place-items: center;
  text-align: center;
}

/* Override the legacy foodie !important centering rule that caused iOS drift. */
.tabbar,
body[data-page="foodie"] .tabbar,
body[data-theme="dark"] .tabbar,
body[data-theme="dark"][data-page="foodie"] .tabbar {
  position: fixed !important;
  top: auto !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: min(100%, 520px) !important;
  margin: 0 auto !important;
  transform: none !important;
  contain: none !important;
  will-change: auto !important;
}

.publish-fab {
  bottom: calc(var(--primary-bottom-clearance) + env(safe-area-inset-bottom));
}

body:not(.subpage) .back-to-top {
  bottom: calc(var(--primary-bottom-clearance) + 68px + env(safe-area-inset-bottom));
}

/* Header icons use the compact geometry; list icons retain their 44px hit geometry. */
.conversation-header .conversation-icon,
body[data-theme="dark"] .conversation-header .conversation-icon {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  flex: 0 0 34px;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 50%;
  line-height: 1;
}

body[data-theme="dark"] .conversation-row-shell[data-conversation-type="public"] .conversation-icon,
body[data-theme="dark"] .conversation-row-shell[data-conversation-type="notifications"] .conversation-icon,
body[data-theme="dark"] .conversation-header .conversation-icon {
  border-color: #5b3346;
  color: #f0a3c6;
  background: #34212b;
  box-shadow: none;
}

/* Settings and profile surfaces must never fall back to light paint in dark mode. */
body[data-theme="dark"] .profile-settings-panel,
body[data-theme="dark"] .settings-sheet-header,
body[data-theme="dark"] .profile-settings-panel .profile-edit-list,
body[data-theme="dark"] .profile-edit-avatar-preview,
body[data-theme="dark"] #profile-edit-avatar-preview {
  color: var(--ink) !important;
  border-color: var(--line) !important;
  background: var(--surface) !important;
}

body[data-theme="dark"] .profile-edit-row,
body[data-theme="dark"] .profile-edit-media {
  border-color: var(--line);
}

body[data-theme="dark"] .profile-edit-row > span,
body[data-theme="dark"] .profile-edit-row input,
body[data-theme="dark"] .profile-edit-row select {
  color: var(--ink);
  background: transparent;
}

body[data-theme="dark"] .profile-edit-save {
  color: #ffffff;
  background: var(--input-action);
}

body[data-theme="dark"] .profile-settings-panel .friend-panel,
body[data-theme="dark"] .profile-settings-panel .admin-panel,
body[data-theme="dark"] .profile-settings-panel .report-item {
  color: var(--ink);
  border-color: var(--line);
  background: var(--surface);
  box-shadow: none;
}

body[data-theme="dark"] .profile-settings-panel .friend-item,
body[data-theme="dark"] .profile-settings-panel .admin-user-item {
  color: var(--ink);
  background: var(--surface-strong);
}

body[data-theme="dark"] .profile-settings-panel .policy-links a,
body[data-theme="dark"] .profile-settings-panel .friend-empty {
  color: var(--muted);
}

body[data-theme="dark"][data-page="user"],
body[data-theme="dark"][data-page="user"] .phone-shell,
body[data-theme="dark"][data-page="user"] .visitor-profile-topbar,
body[data-theme="dark"][data-page="user"] #user-profile-panel {
  color: var(--ink) !important;
  background: var(--bg) !important;
}

body[data-theme="dark"][data-page="user"] #user-page-title,
body[data-theme="dark"][data-page="user"] .visitor-profile-more,
body[data-theme="dark"][data-page="user"] .visitor-profile-topbar .page-back-button,
body[data-theme="dark"][data-page="user"] #user-name,
body[data-theme="dark"][data-page="user"] #user-bio {
  color: var(--ink) !important;
}

body[data-theme="dark"][data-page="user"] .profile-actions button {
  color: var(--ink);
  background: var(--surface-strong);
}

/* Safari-compatible bottom anchoring: auto margin collapses when history overflows. */
.conversation-messages:not(.notification-list) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  align-content: initial;
}

.conversation-messages:not(.notification-list) > .message:first-of-type,
.conversation-messages:not(.notification-list) > .private-history-loader:first-child,
.conversation-messages:not(.notification-list) > .empty-state:first-child {
  margin-top: auto;
}

.conversation-messages:not(.notification-list) > .message {
  flex: 0 0 auto;
  align-self: flex-start;
}

.conversation-messages:not(.notification-list) > .message.own {
  align-self: flex-end;
}

/* Explicit pet columns avoid Android multi-column balancing differences. */
body[data-page="foodie"] #pet-inline-list:not(.hidden) {
  column-count: auto !important;
}

.pet-masonry-grid {
  display: grid;
  grid-template-columns: repeat(var(--pet-masonry-columns, 2), minmax(0, 1fr));
  align-items: start;
  gap: 8px;
}

.pet-masonry-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

body[data-page="foodie"] #pet-inline-list:not(.hidden) .pet-masonry-card {
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
}

@media (min-width: 760px) {
  .pet-masonry-grid {
    gap: 12px;
  }

  .pet-masonry-column {
    gap: 12px;
  }
}

/* Post details must own interaction above transformed profile-page stacking contexts. */
body.detail-open #post-detail-viewer {
  z-index: 2147483000 !important;
  pointer-events: auto !important;
}

body.detail-open .page.profile-page-active {
  pointer-events: none !important;
}

/* Profiles intentionally opened from a detail temporarily cover that detail. */
body.detail-open.profile-over-detail #post-detail-viewer {
  z-index: 100100 !important;
  pointer-events: none !important;
}

body.detail-open.profile-over-detail .page.profile-page-active,
body.detail-open.profile-over-detail #pet-profile-view:not(.hidden) {
  pointer-events: auto !important;
}

/* A photo opened from a post detail is the topmost transient layer. */
body.detail-open #image-viewer:not(.hidden) {
  z-index: 2147483100 !important;
  pointer-events: auto !important;
}

/*
 * iOS primary shell: only the middle page scrolls. Keeping navigation in the
 * normal grid avoids WebKit's dynamic-toolbar position:fixed compositor drift.
 */
html,
body,
#app {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden !important;
}

#app > .auth-screen {
  height: 100%;
  min-height: 0;
  overflow-y: auto;
}

.phone-shell,
body[data-page="foodie"] .phone-shell,
body[data-theme="dark"] .phone-shell,
body[data-theme="dark"][data-page="foodie"] .phone-shell {
  width: min(100%, 520px) !important;
  height: 100vh !important;
  height: 100dvh !important;
  min-height: 0 !important;
  max-height: 100dvh !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  margin: 0 auto !important;
  padding: max(10px, env(safe-area-inset-top)) 0 0 !important;
  overflow: hidden !important;
}

.phone-shell > .topbar {
  grid-row: 1;
  grid-column: 1;
  min-width: 0;
  margin: 0 8px;
}

.phone-shell > .page.active,
body[data-page="foodie"] .phone-shell > .page[data-page="home"].active {
  position: relative;
  grid-row: 2;
  grid-column: 1;
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 8px 8px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.phone-shell > .tabbar,
body[data-page="foodie"] .phone-shell > .tabbar,
body[data-theme="dark"] .phone-shell > .tabbar,
body[data-theme="dark"][data-page="foodie"] .phone-shell > .tabbar {
  position: relative !important;
  grid-row: 3;
  grid-column: 1;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  align-self: end;
  width: 100% !important;
  margin: 0 !important;
  transform: none !important;
  contain: none !important;
  will-change: auto !important;
}

.phone-shell > .publish-fab {
  position: absolute !important;
  right: 18px !important;
  bottom: calc(var(--primary-bottom-clearance) + env(safe-area-inset-bottom)) !important;
}
/* Horizontal section switching owns only the horizontal gesture; vertical page scrolling stays native. */
.section-swipe-surface {
  touch-action: pan-y;
}

/* Authoritative foodie waterfall cards: display-only rating and one concise review. */
body[data-page="foodie"] .foodie-waterfall .foodie-masonry-card {
  position: relative;
  background: #ffffff;
  border: 1px solid rgba(36, 43, 55, 0.08);
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(24, 30, 42, 0.06);
  overflow: hidden;
}

body[data-page="foodie"] .foodie-waterfall .foodie-masonry-card.foodie-hot-card {
  background: linear-gradient(160deg, #ffffff 38%, #fff8fb 100%);
  border-color: rgba(217, 52, 109, 0.18);
  box-shadow: 0 3px 12px rgba(217, 52, 109, 0.08);
}

body[data-page="foodie"] .foodie-waterfall .foodie-photo {
  position: relative;
  display: block;
  overflow: hidden;
}

body[data-page="foodie"] .foodie-waterfall .foodie-hot-badge {
  position: absolute;
  z-index: 1;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid rgba(217, 52, 109, 0.16);
  border-radius: 999px;
  color: #c92f65;
  background: rgba(255, 247, 250, 0.94);
  box-shadow: 0 2px 8px rgba(74, 33, 49, 0.08);
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  white-space: nowrap;
  pointer-events: none;
}

body[data-page="foodie"] .foodie-waterfall .foodie-card-body {
  display: grid;
  gap: 8px;
  padding: 10px;
}

body[data-page="foodie"] .foodie-waterfall .compact-author {
  min-width: 0;
  gap: 8px;
}

body[data-page="foodie"] .foodie-waterfall .compact-author .avatar {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
}

body[data-page="foodie"] .foodie-waterfall .compact-author strong {
  overflow: hidden;
  font-size: 14px;
  line-height: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="foodie"] .foodie-waterfall .compact-stars[data-rating-mode="aggregate"] {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
}

body[data-page="foodie"] .foodie-waterfall .foodie-star-glyphs {
  display: inline-flex;
  flex: 0 1 auto;
  gap: 1px;
  min-width: 0;
  padding: 0;
}

body[data-page="foodie"] .foodie-waterfall .foodie-star-glyph {
  position: relative;
  padding: 0;
  color: #d7d4cf;
  font-size: 16px;
  line-height: 20px;
}

body[data-page="foodie"] .foodie-waterfall .foodie-star-glyph.filled {
  color: #f5b800;
}

body[data-page="foodie"] .foodie-waterfall .foodie-star-glyph.half {
  color: transparent;
  background: linear-gradient(90deg, #f5b800 50%, #d7d4cf 50%);
  background-clip: text;
  -webkit-background-clip: text;
}

body[data-page="foodie"] .foodie-waterfall .foodie-score-summary {
  display: inline-flex;
  align-items: baseline;
  flex: 0 0 auto;
  gap: 3px;
  padding: 0;
  color: #747983;
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
}

body[data-page="foodie"] .foodie-waterfall .foodie-score-summary strong {
  color: #272b33;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  line-height: 20px;
}

body[data-page="foodie"] .foodie-waterfall .foodie-score-empty {
  color: #8a8f98;
  font-size: 12px;
}

body[data-page="foodie"] .foodie-waterfall .foodie-short-review {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  padding: 7px 8px;
  border-radius: 8px;
  color: #505661;
  background: #f7f7f8;
  font-size: 13px;
  line-height: 20px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body[data-page="foodie"] .foodie-waterfall .foodie-short-review strong {
  margin-right: 5px;
  color: #2d3139;
}

body[data-page="foodie"] .foodie-waterfall .foodie-post-summary > :first-child {
  margin-top: 0;
}

body[data-page="foodie"] .foodie-waterfall .foodie-post-summary > :last-child {
  margin-bottom: 0;
}

body[data-theme="dark"][data-page="foodie"] .foodie-waterfall .foodie-masonry-card {
  background: var(--surface);
  border-color: rgba(223, 230, 242, 0.1);
  box-shadow: none;
}

body[data-theme="dark"][data-page="foodie"] .foodie-waterfall .foodie-masonry-card.foodie-hot-card {
  background: linear-gradient(160deg, var(--surface) 42%, rgba(92, 37, 59, 0.22) 100%);
  border-color: rgba(235, 106, 155, 0.24);
}

body[data-theme="dark"][data-page="foodie"] .foodie-waterfall .foodie-hot-badge {
  color: #f2a1c0;
  background: rgba(60, 31, 44, 0.94);
  border-color: rgba(235, 106, 155, 0.26);
}

body[data-theme="dark"][data-page="foodie"] .foodie-waterfall .foodie-star-glyph.empty,
body[data-theme="dark"][data-page="foodie"] .foodie-waterfall .foodie-star-glyph.pending {
  color: #626875;
}

body[data-theme="dark"][data-page="foodie"] .foodie-waterfall .foodie-star-glyph.half {
  background: linear-gradient(90deg, #f2ba32 50%, #626875 50%);
  background-clip: text;
  -webkit-background-clip: text;
}

body[data-theme="dark"][data-page="foodie"] .foodie-waterfall .foodie-score-summary strong,
body[data-theme="dark"][data-page="foodie"] .foodie-waterfall .foodie-short-review strong {
  color: var(--ink);
}

body[data-theme="dark"][data-page="foodie"] .foodie-waterfall .foodie-score-summary,
body[data-theme="dark"][data-page="foodie"] .foodie-waterfall .foodie-score-empty,
body[data-theme="dark"][data-page="foodie"] .foodie-waterfall .foodie-short-review {
  color: var(--muted);
}

body[data-theme="dark"][data-page="foodie"] .foodie-waterfall .foodie-short-review {
  background: rgba(255, 255, 255, 0.045);
}

/* Girl and Her 2026 visual system: five mobile-first primary surfaces. */
:root {
  --primary-tabbar-height: 82px;
  --primary-bottom-clearance: 94px;
}

html,
body {
  background: var(--bg);
}

body {
  font-family: var(--font-sans);
}

.phone-shell,
body[data-page="foodie"] .phone-shell,
body[data-theme="dark"] .phone-shell,
body[data-theme="dark"][data-page="foodie"] .phone-shell {
  width: min(100%, 390px) !important;
  max-width: 390px !important;
  color: var(--ink);
  background: var(--surface) !important;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.phone-shell > .topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: max(20px, env(safe-area-inset-top)) 18px 12px;
  color: var(--ink);
  background: var(--surface);
  border: 0;
  box-shadow: none;
}

.phone-shell > .topbar > div {
  order: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.phone-shell > .topbar h1 {
  margin: 0;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.topbar-wordmark {
  color: var(--muted);
  font-family: Inter, sans-serif;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.topbar-wordmark:empty {
  display: none;
}

.phone-shell > .topbar #refresh-button {
  display: none;
}

.phone-shell > .topbar .shell-avatar-button {
  order: 3;
  margin-left: auto;
}

.phone-shell > .topbar .icon-button,
.phone-shell > .topbar .shell-avatar-button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  background: var(--surface-strong);
  box-shadow: none;
}

.phone-shell > .page.active,
body[data-page="foodie"] .phone-shell > .page[data-page="home"].active {
  padding: 0 !important;
  background: var(--surface);
}

body[data-page="home"] .page[data-page="home"].active {
  display: flex;
  flex-direction: column;
}

body[data-page="home"] .feed-switch {
  order: 1;
  width: 100%;
  height: 48px;
  min-height: 48px;
  grid-template-columns: repeat(2, 54px);
  gap: 8px;
  padding: 0 18px;
  background: var(--surface);
  border: 0;
  justify-content: flex-start !important;
}

body[data-page="home"] .feed-switch-button {
  flex: 0 0 54px !important;
  min-width: 54px;
  height: 36px;
  padding: 0 8px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 14px;
  font-weight: 500;
}

body[data-page="home"] .feed-switch-button.active {
  color: var(--ink);
  background: transparent;
}

body[data-page="home"] .feed-switch-button.active::after {
  right: auto;
  bottom: 0;
  left: 50%;
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
  transform: translateX(-50%);
}

/* Match Figma 25:11 exactly after the earlier X-style compatibility rules. */
body[data-page="home"] [data-page="home"] .feed-switch {
  grid-template-columns: repeat(2, 54px);
  gap: 8px;
}

body[data-page="home"] [data-page="home"] .feed-switch-button.active::after {
  right: auto;
  left: 50%;
  width: 20px;
  transform: translateX(-50%);
}

body[data-page="home"] [data-page="home"] .feed-switch-button {
  padding-right: 0;
  padding-left: 0;
  white-space: nowrap;
}

/* Food and pet content shares the home DOM for fast switching, but must never
   enter the Discover reading flow while the Home tab is active. */
body[data-page="home"] #foodie-inline-header,
body[data-page="home"] #foodie-inline-list,
body[data-page="home"] #pet-inline-list {
  display: none !important;
}

body[data-page="home"] #topic-filter {
  display: none !important;
}

.home-share-composer {
  order: 2;
  width: calc(100% - 28px);
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 14px 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  background: var(--surface-strong);
  text-align: left;
}

.home-share-composer > span:nth-child(2) {
  min-width: 0;
  flex: 1;
  font-size: 12px;
}

.home-share-avatar {
  width: 40px;
  min-width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-light);
  font-size: 14px;
  font-weight: 500;
}

.home-share-composer strong {
  padding: 8px 13px;
  border-radius: 14px;
  color: var(--accent-contrast);
  background: var(--accent);
  font-size: 12px;
  font-weight: 500;
}

body[data-page="home"] #post-list,
body[data-page="home"] #following-post-list {
  order: 3;
  padding: 0 14px 14px;
}

body[data-page="home"] .feed {
  gap: 12px;
}

body[data-page="home"] .post-card,
body[data-page="me"] .post-card {
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: none;
}

body[data-page="home"] .post-card .post-head,
body[data-page="me"] .post-card .post-head {
  min-height: 68px;
  padding: 14px;
}

body[data-page="home"] .post-card .post-text,
body[data-page="me"] .post-card .post-text {
  margin: 0;
  padding: 0 14px 12px;
  color: var(--ink);
  font-size: 14px;
  line-height: 22px;
}

body[data-page="home"] .post-images,
body[data-page="me"] .post-images {
  width: 100%;
  height: 278px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  padding: 0;
  border-radius: 0;
  overflow: hidden;
}

body[data-page="home"] .post-images.one,
body[data-page="me"] .post-images.one {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

body[data-page="home"] .post-images.two,
body[data-page="me"] .post-images.two {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
}

body[data-page="home"] .post-images.multi:not(.two) > :first-child,
body[data-page="me"] .post-images.multi:not(.two) > :first-child {
  grid-row: 1 / 3;
}

body[data-page="home"] .post-image-button,
body[data-page="me"] .post-image-button {
  min-width: 0;
  min-height: 0;
  height: 100%;
  border-radius: 0;
}

body[data-page="home"] .post-image-button img,
body[data-page="me"] .post-image-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body[data-page="home"] .reaction-bar.feed-reaction-bar,
body[data-page="me"] .reaction-bar.feed-reaction-bar {
  min-height: 48px;
  padding: 4px 12px;
  border-top: 0;
}

body[data-page="home"] .publish-fab,
body[data-page="ai"] .publish-fab,
body[data-page="chat"] .publish-fab,
body[data-page="me"] .publish-fab {
  display: none !important;
}

body[data-page="foodie"] .shell-avatar-button {
  display: none;
}

body[data-page="foodie"] .home-share-composer {
  display: none !important;
}

body[data-page="foodie"] .publish-fab {
  top: max(22px, env(safe-area-inset-top)) !important;
  right: 18px !important;
  bottom: auto !important;
  width: 38px;
  height: 38px;
  display: grid !important;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  background: var(--surface-strong);
  box-shadow: none;
  font-size: 20px;
}

body[data-page="foodie"] #refresh-button {
  display: none;
}

.foodie-inline-header {
  background: var(--surface);
}

.foodie-section-switch {
  min-height: 48px;
  gap: 26px;
  padding: 0 18px;
  border: 0;
  background: var(--surface);
}

.foodie-section-switch .feed-switch-button {
  min-width: auto;
  height: 48px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 14px;
}

.foodie-section-switch .feed-switch-button.active {
  color: var(--ink);
  background: transparent;
}

body[data-page="foodie"] .foodie-inline-header .foodie-guide:not(.hidden) {
  display: block !important;
  min-height: 48px;
  margin: 0;
  padding: 14px;
  border: 0;
  border-radius: 0;
  color: var(--mint);
  background: var(--mint-soft);
  font-size: 12px;
}

body[data-page="foodie"] .foodie-waterfall > .empty-state {
  width: 100%;
  display: block;
  column-span: all;
  margin: 0;
  padding: 28px 18px;
  border: 0;
  border-radius: 16px;
  color: var(--muted);
  background: var(--surface-strong);
  text-align: center;
  line-height: 22px;
}

body[data-page="foodie"] #foodie-inline-list,
body[data-page="foodie"] #pet-inline-list:not(.hidden) {
  gap: 10px !important;
  padding: 12px 14px 16px !important;
}

body[data-page="foodie"] .foodie-waterfall .foodie-masonry-card {
  border-color: var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: none;
}

body[data-page="foodie"] .foodie-waterfall .foodie-card-body {
  gap: 7px;
  padding: 10px;
}

body[data-page="ai"] .phone-shell > .page.ai-projects-page.active {
  padding: 0 18px 24px !important;
}

.ai-projects-intro {
  padding: 26px 0 18px;
}

.ai-projects-intro h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.35;
}

.ai-projects-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 20px;
}

.ai-project-card {
  min-height: 230px;
  padding: 20px;
  border: 0;
  border-radius: 24px;
  color: var(--ink);
  background: #f7f2ed;
}

.ai-project-status {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 14px;
  color: var(--accent);
  background: var(--accent-light);
  font-size: 11px;
  font-weight: 700;
}

.ai-project-card h3 {
  margin: 12px 0;
  font-size: 24px;
  line-height: 1.35;
}

.ai-project-card p {
  margin: 0;
  color: #69645e;
  font-size: 13px;
  line-height: 21px;
}

.ai-project-card footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #e9e0d9;
  color: #827b74;
  font-size: 11px;
}

body[data-theme="dark"] .ai-project-card {
  background: #292621;
}

body[data-theme="dark"] .ai-project-card p,
body[data-theme="dark"] .ai-project-card footer {
  color: var(--muted);
}

body[data-theme="dark"] .ai-project-card footer {
  border-color: var(--line);
}

.conversation-search {
  height: 54px;
  display: block;
  padding: 7px 14px;
  background: var(--surface);
}

.conversation-search input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 18px;
  color: var(--ink);
  background: var(--surface-strong);
  font: inherit;
  font-size: 13px;
  outline: 0;
}

.conversation-search input:focus {
  box-shadow: var(--input-focus-ring);
}

.conversation-row-shell {
  min-height: 76px;
  border-color: var(--line);
  background: var(--surface);
}

.conversation-row-shell.search-hidden,
.conversation-group.search-hidden {
  display: none !important;
}

body[data-page="me"] .phone-shell > .topbar {
  display: flex !important;
}

body[data-page="me"] .phone-shell > .topbar .shell-avatar-button {
  display: none;
}

.me-settings-open {
  position: fixed;
  z-index: 20;
  top: max(30px, env(safe-area-inset-top));
  right: max(18px, calc((100vw - 390px) / 2 + 18px));
  min-width: 44px;
  min-height: 32px;
  padding: 6px 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
}

body[data-page="me"] .profile-panel,
body[data-page="me"] .my-works-panel {
  border-color: transparent;
  border-radius: 0;
  box-shadow: none;
}

body[data-page="me"] .profile-panel {
  min-height: 96px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-areas: "avatar identity";
  align-items: center;
  gap: 12px;
  padding: 10px 18px 14px;
}

body[data-page="me"] .profile-cover-layer {
  display: none;
}

body[data-page="me"] #profile-avatar.avatar-large {
  grid-area: avatar;
  width: 48px;
  min-width: 48px;
  height: 48px;
  margin: 0;
  border: 0;
  font-size: 17px;
}

body[data-page="me"] .profile-identity {
  grid-area: identity;
  min-width: 0;
  align-items: flex-start;
  text-align: left;
}

body[data-page="me"] .profile-panel h2 {
  font-size: 17px;
  line-height: 24px;
}

body[data-page="me"] #profile-bio {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="me"] .role-badge {
  margin-top: 2px;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 10px;
}

.profile-shortcuts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 6px 18px 8px;
}

.profile-shortcuts button {
  min-width: 0;
  min-height: 48px;
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  padding: 6px 10px;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  text-align: center;
}

.profile-shortcuts button + button {
  border-left: 1px solid var(--line);
}

.profile-shortcuts button:focus-visible {
  border-radius: 10px;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.profile-shortcuts strong {
  color: var(--accent);
  font-family: Inter, sans-serif;
  font-size: 16px;
  font-weight: 500;
}

.profile-shortcuts span {
  font-size: 12px;
  font-weight: 500;
}

.tabbar,
body[data-page="foodie"] .tabbar,
body[data-theme="dark"] .tabbar,
body[data-theme="dark"][data-page="foodie"] .tabbar {
  min-height: calc(82px + env(safe-area-inset-bottom)) !important;
  height: calc(82px + env(safe-area-inset-bottom)) !important;
  display: flex !important;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0;
  padding: 8px 12px max(14px, env(safe-area-inset-bottom)) !important;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 97%, transparent) !important;
  box-shadow: none !important;
}

.tabbar .tab,
.tabbar .tab[data-target] {
  width: 64px !important;
  min-width: 56px !important;
  height: 56px !important;
  display: flex;
  flex: 0 1 64px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 16px !important;
  color: var(--muted) !important;
  background: transparent !important;
  box-shadow: none !important;
}

.tabbar .tab.active {
  color: var(--accent) !important;
  background: var(--accent-light) !important;
}

.tabbar .tab-icon {
  width: 24px;
  height: 24px;
}

.tabbar .tab-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tabbar .tab-label {
  font-size: 12px;
  line-height: 16px;
}

.tabbar .tab[data-target="home"] { order: 1; }
.tabbar .tab[data-target="foodie"] { order: 2; }
.tabbar .tab[data-target="ai"] { order: 3; }
.tabbar .tab[data-target="chat"] { order: 4; }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (min-width: 560px) {
  .phone-shell {
    margin: 12px auto !important;
    height: calc(100dvh - 24px) !important;
    border: 1px solid var(--line);
    border-radius: 24px;
    overflow: hidden;
  }
}

/* Figma P2 · 02: reading order is copy, media, actions, discussion. */
.full-detail .detail-post-copy {
  padding: 20px 18px 14px;
}

.full-detail .detail-photo-strip {
  margin: 0 14px;
  border-radius: 18px;
  overflow: hidden;
}

.full-detail .detail-action-row {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.full-detail .detail-action-row .reactions {
  margin: 0;
}

/* Figma P2 · 05: settings start from a calm hub; editing is a second level. */
.settings-view.hidden,
.settings-detail-view [data-settings-section].hidden {
  display: none !important;
}

.settings-home-view {
  display: grid;
  gap: 18px;
  padding: 4px 0 12px;
}

.settings-account-card {
  width: 100%;
  min-height: 88px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
  box-shadow: var(--shadow);
}

.settings-account-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: var(--accent-contrast);
  background: var(--accent);
  font-size: 18px;
  font-weight: 650;
}

.settings-account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.settings-account-card > span:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.settings-account-card strong {
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-account-card small,
.settings-group small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.settings-account-card b,
.settings-group b {
  color: var(--muted);
  font-size: 25px;
  font-weight: 300;
}

.settings-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.settings-group button,
.settings-group a {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 14px;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  text-align: left;
  text-decoration: none;
}

.settings-group > :last-child {
  border-bottom: 0;
}

.settings-group button > span,
.settings-group a > span {
  display: flex;
  align-items: center;
  gap: 11px;
}

.settings-group i {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--accent);
  background: var(--accent-light);
  font-style: normal;
}

.settings-home-view > .danger-button {
  width: 100%;
  min-height: 50px;
  border: 1px solid color-mix(in srgb, #b8404f 24%, transparent);
  border-radius: 16px;
  color: #b8404f;
  background: var(--surface);
}

.settings-detail-view {
  padding-top: 4px;
}

/* Figma P2 · 10: one compact input row; tools expand below without covering messages. */
.chat-box.message-tools-ready {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
}

.chat-box.message-tools-ready > [data-voice-message],
.chat-box.message-tools-ready > [data-image-message],
.chat-box.message-tools-ready > [data-sticker-open] {
  display: none !important;
}

.message-tools-toggle {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: var(--surface-strong);
  font-size: 25px;
  font-weight: 300;
  transition: transform 160ms ease, background 160ms ease;
}

.message-tools-open .message-tools-toggle {
  background: var(--accent-light);
  transform: rotate(45deg);
}

.message-tools-panel {
  grid-column: 1 / -1;
  max-height: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  overflow: hidden;
  opacity: 0;
  transition: max-height 180ms ease, padding 180ms ease, opacity 140ms ease;
}

.message-tools-open .message-tools-panel {
  max-height: 112px;
  padding: 14px 4px 6px;
  opacity: 1;
}

.message-tools-panel button {
  min-height: 78px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 10px 4px;
  border: 0;
  border-radius: 16px;
  color: var(--ink);
  background: var(--surface-strong);
}

.message-tools-panel span {
  color: var(--accent);
  font-size: 24px;
}

.message-tools-panel strong {
  font-size: 12px;
  font-weight: 500;
}

body[data-theme="dark"] .settings-account-card,
body[data-theme="dark"] .settings-group,
body[data-theme="dark"] .settings-home-view > .danger-button,
body[data-theme="dark"] .message-tools-panel button {
  color: var(--ink);
  background: var(--surface-strong);
  border-color: var(--line);
}

/* Keep dark mode warm and neutral after the legacy theme declarations above. */
body[data-theme="dark"] {
  --bg: #171614;
  --surface: #211f1c;
  --surface-strong: #292622;
  --ink: #f3efe8;
  --muted: #b9b1a7;
  --line: #3a3631;
  --accent: #c86d87;
  --accent-light: #493039;
  --accent-dark: #e2a0b2;
  --accent-contrast: #ffffff;
  --mint: #91a797;
  --mint-soft: #29342d;
  --photo-matte: #292622;
  --input-surface: #292622;
  --input-panel: #211f1c;
  --input-text: #f3efe8;
  --input-placeholder: #aaa197;
  --input-border: rgba(243, 239, 232, 0.12);
  --input-border-focus: rgba(200, 109, 135, 0.48);
  --input-focus-ring: 0 0 0 3px rgba(200, 109, 135, 0.18);
  --focus-ring-color: rgba(200, 109, 135, 0.36);
  --input-tool: #b9b1a7;
  --input-action: #c86d87;
  --shadow: none;
  background: var(--bg);
}

body[data-theme="dark"] .phone-shell,
body[data-theme="dark"][data-page="foodie"] .phone-shell {
  color: var(--ink);
  background: var(--surface) !important;
}

body[data-theme="dark"] .phone-shell > .topbar {
  color: var(--ink);
  background: var(--surface) !important;
  border-color: var(--line);
}

body[data-theme="dark"][data-page="home"] .post-card,
body[data-theme="dark"][data-page="me"] .post-card {
  color: var(--ink);
  background: var(--surface-strong) !important;
  border-color: var(--line) !important;
}

body[data-theme="dark"] .feed-switch,
body[data-theme="dark"] .segmented,
body[data-theme="dark"] .profile-content-tabs {
  background: var(--bg);
  border-color: var(--line);
}

/* Phase 2: calm, mobile-first secondary flows. */
[data-page="writer"].composer-overlay-active {
  right: auto;
  left: 50%;
  width: min(100%, 390px);
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  transform: translateX(-50%);
}

.composer-overlay-active .writer-layout,
.composer-overlay-active .writer-editor {
  width: 100%;
  min-height: 100%;
  background: var(--surface);
}

.composer-overlay-active .writer-editor {
  padding: 0 18px 156px;
}

.publish-overlay-header {
  min-height: 62px;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  margin: 0 -18px 18px;
  padding: max(6px, env(safe-area-inset-top)) 10px 6px;
  border-color: var(--line);
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(18px);
}

.publish-overlay-header strong {
  font-size: 16px;
  font-weight: 650;
}

.publish-overlay-header button {
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
}

.publish-overlay-header .publish-overlay-submit {
  min-height: 38px;
  padding: 0 15px;
  color: var(--accent-contrast);
  background: var(--accent);
  font-weight: 650;
}

.composer-overlay-active .note-title-input,
.composer-overlay-active .note-content-input {
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
}

.composer-overlay-active .note-title-input {
  min-height: 44px;
  margin-bottom: 6px;
  font-size: 20px;
  line-height: 28px;
  font-weight: 650;
}

.composer-overlay-active .note-content-input {
  min-height: 230px;
  resize: none;
  font-size: 17px;
  line-height: 29px;
}

.composer-overlay-active .note-title-input::placeholder,
.composer-overlay-active .note-content-input::placeholder {
  color: var(--input-placeholder);
  opacity: 0.82;
}

.composer-overlay-active .note-images {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 16px;
}

.composer-overlay-active .note-images.empty {
  display: none;
}

.composer-overlay-active .note-images figure {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 12px;
  background: var(--surface-strong);
}

.composer-input-tools {
  right: auto;
  left: 50%;
  width: min(100%, 390px);
  padding: 8px 14px max(10px, env(safe-area-inset-bottom));
  border-color: var(--line);
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.composer-attachment-tools,
.composer-meta-tools {
  gap: 7px;
}

.composer-tool-chip,
.composer-attachment-button {
  min-height: 38px;
  padding: 0 11px;
  border-color: var(--line);
  color: var(--accent);
  background: var(--surface-strong);
  font-size: 13px;
  font-weight: 600;
}

.comment-policy-backdrop {
  background: rgba(24, 20, 18, 0.28);
}

.comment-policy-sheet {
  width: min(calc(100% - 24px), 366px);
  margin-right: auto;
  margin-left: auto;
  padding: 10px 16px max(18px, env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  border-radius: 22px 22px 0 0;
  color: var(--ink);
  background: var(--surface);
}

/* Post details read like one continuous, quiet story rather than a modal card. */
.post-detail-viewer {
  right: auto;
  left: 50%;
  width: min(100%, 390px);
  background: var(--surface);
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  transform: translateX(-50%);
  transition: opacity 180ms ease, transform 220ms cubic-bezier(.22, 1, .36, 1);
  opacity: 1;
}

.post-detail-viewer.hidden {
  opacity: 0;
  transform: translateX(calc(-50% + 24px));
}

.full-detail {
  width: 100%;
  max-width: 390px;
  height: 100dvh;
  max-height: none;
  overflow: hidden;
  border-radius: 0;
  color: var(--ink);
  background: var(--surface);
}

.detail-topbar {
  min-height: 64px;
  grid-template-columns: 52px minmax(0, 1fr) auto 40px;
  gap: 6px;
  padding: max(8px, env(safe-area-inset-top)) 12px 8px;
  border-color: var(--line);
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(18px);
}

.detail-back {
  min-width: 48px;
  height: 44px;
  color: var(--accent);
  font-weight: 600;
}

.detail-author .avatar {
  width: 36px;
  height: 36px;
}

.detail-author strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
}

.detail-follow {
  height: 34px;
  padding: 0 13px;
  border-color: var(--line);
  color: var(--accent);
  background: var(--accent-light);
  font-weight: 650;
}

.detail-scroll {
  padding-bottom: 18px;
  background: var(--surface);
  scrollbar-width: none;
}

.detail-scroll::-webkit-scrollbar {
  display: none;
}

.detail-photo-strip,
.detail-photo-button {
  background: var(--photo-matte);
}

.detail-post-copy {
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--line);
}

.detail-post-copy .post-text {
  color: var(--ink);
  font-size: 16px;
  line-height: 27px;
}

.detail-post-meta {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.detail-comment-panel {
  padding: 18px 16px 110px;
}

.detail-comment-panel > h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 650;
}

.detail-comment {
  padding: 0 0 12px;
}

.detail-comment-avatar .avatar {
  width: 30px;
  height: 30px;
}

.detail-comment-text {
  color: var(--ink);
  font-size: 14px;
  line-height: 22px;
}

.detail-bottom-form {
  right: auto;
  bottom: 0;
  left: 50%;
  width: min(100%, 390px);
  min-height: calc(62px + env(safe-area-inset-bottom));
  padding: 8px 12px max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.detail-bottom-form input[name="text"] {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 21px;
  color: var(--input-text);
  background: var(--input-surface);
}

.detail-bottom-form button[type="submit"] {
  min-width: 54px;
  height: 42px;
  border: 0;
  border-radius: 21px;
  color: var(--accent-contrast);
  background: var(--accent);
  font-weight: 650;
}

/* Conversation chrome shares the same 390 px shell and never covers messages. */
body[data-page="chat"].subpage .chat-thread {
  width: 100%;
  max-width: 390px;
  margin: 0 auto;
  color: var(--ink);
  background: var(--surface);
}

.conversation-topbar {
  min-height: 64px;
  grid-template-columns: 52px minmax(0, 1fr) 40px;
  padding: max(8px, env(safe-area-inset-top)) 10px 8px;
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(18px);
}

.conversation-back-button {
  width: 48px;
  color: var(--accent);
  font-weight: 600;
}

body[data-page="chat"].subpage .conversation-messages {
  top: calc(env(safe-area-inset-top) + 64px);
  right: max(0px, calc((100% - 390px) / 2));
  bottom: calc(var(--keyboard-offset, 0px) + var(--conversation-composer-height, 62px));
  left: max(0px, calc((100% - 390px) / 2));
  padding: 16px 12px 20px;
  background: var(--bg);
}

body[data-page="chat"].subpage .conversation-messages:has(.empty-state) {
  display: flex;
  align-items: center;
  justify-content: center;
}

body[data-page="chat"].subpage .conversation-messages > .empty-state {
  width: min(100%, 280px);
  margin: 0 auto;
}

#conversation-message-form.conversation-composer {
  width: min(100%, 390px);
  min-height: 62px;
  padding: 8px 9px max(8px, env(safe-area-inset-bottom));
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  backdrop-filter: blur(18px);
}

#conversation-message-form.conversation-composer input[name="text"] {
  color: var(--input-text);
  background: var(--input-surface);
}

.conversation-messages:not(.notification-list),
.private-messages {
  --chat-bubble-incoming: var(--surface);
  --chat-bubble-outgoing: var(--accent-light);
  --chat-bubble-text: var(--ink);
  --chat-bubble-meta: var(--muted);
  background: var(--bg);
}

.conversation-messages:not(.notification-list) .message-bubble,
.private-messages .message-bubble {
  padding: 9px 12px;
  border-color: var(--line);
  border-radius: 17px 17px 17px 6px;
  box-shadow: var(--shadow);
}

.conversation-messages:not(.notification-list) .message.own .message-bubble,
.private-messages .message.own .message-bubble {
  border-color: color-mix(in srgb, var(--accent) 16%, transparent);
  border-radius: 17px 17px 6px 17px;
}

/* Settings are grouped like a personal space, not an administration dashboard. */
.profile-settings-panel {
  width: min(100%, 390px);
  padding: 0 14px max(24px, env(safe-area-inset-bottom));
  color: var(--ink);
  background: var(--bg);
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  box-shadow: none;
}

.settings-sheet-header {
  min-height: 64px;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  margin: 0 -14px 16px;
  padding: max(8px, env(safe-area-inset-top)) 10px 8px;
  border-color: var(--line);
  color: var(--ink);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(18px);
}

.settings-sheet-header strong {
  font-size: 17px;
  font-weight: 650;
}

.profile-settings-panel .profile-edit-list,
.profile-settings-panel .friend-panel,
.profile-settings-panel .admin-panel {
  overflow: hidden;
  margin: 0 0 16px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.profile-edit-media {
  padding: 24px 18px 20px;
  border-color: var(--line);
}

.profile-edit-avatar-preview,
#profile-edit-avatar-preview {
  width: 76px;
  height: 76px;
  box-shadow: 0 0 0 4px var(--accent-light);
}

.profile-edit-row {
  min-height: 58px;
  padding: 8px 14px;
  border-color: var(--line);
}

.profile-edit-row > span {
  color: var(--muted);
  font-size: 14px;
}

.profile-edit-row input {
  color: var(--ink);
  background: transparent;
  text-align: right;
}

.profile-edit-save {
  min-height: 48px;
  margin: 14px;
  border: 0;
  border-radius: 14px;
  color: var(--accent-contrast);
  background: var(--accent);
  font-weight: 650;
}

.profile-settings-panel .section-title {
  min-height: 52px;
  margin: 0;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.profile-settings-panel .friend-list,
.profile-settings-panel .report-list {
  padding: 0 14px;
}

.profile-settings-panel > .danger-button {
  width: 100%;
  min-height: 50px;
  border: 1px solid color-mix(in srgb, #b8404f 24%, transparent);
  border-radius: 16px;
  color: #b8404f;
  background: var(--surface);
  box-shadow: none;
}

/* Warm secondary surfaces in dark mode; never revert to the legacy blue-gray. */
body[data-theme="dark"] [data-page="writer"].composer-overlay-active,
body[data-theme="dark"] .composer-overlay-active .writer-layout,
body[data-theme="dark"] .composer-overlay-active .writer-editor,
body[data-theme="dark"] .publish-overlay-header,
body[data-theme="dark"] .composer-input-tools,
body[data-theme="dark"] .comment-policy-sheet,
body[data-theme="dark"] .post-detail-viewer,
body[data-theme="dark"] .full-detail,
body[data-theme="dark"] .detail-topbar,
body[data-theme="dark"] .detail-scroll,
body[data-theme="dark"] .detail-bottom-form,
body[data-theme="dark"] .conversation-topbar,
body[data-theme="dark"] #conversation-message-form.conversation-composer,
body[data-theme="dark"] .settings-sheet-header,
body[data-theme="dark"] .profile-settings-panel .profile-edit-list,
body[data-theme="dark"] .profile-settings-panel .friend-panel,
body[data-theme="dark"] .profile-settings-panel .admin-panel {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

body[data-theme="dark"] .conversation-messages:not(.notification-list),
body[data-theme="dark"] .private-messages {
  --chat-bubble-incoming: var(--surface-strong);
  --chat-bubble-outgoing: var(--accent-light);
  --chat-bubble-text: var(--ink);
  --chat-bubble-meta: var(--muted);
  background: var(--bg);
}

body[data-theme="dark"] #conversation-message-form.conversation-composer input[name="text"] {
  color: var(--input-text);
  background: var(--input-surface);
  border-color: transparent;
}

body[data-theme="dark"] .composer-overlay-active .note-title-input,
body[data-theme="dark"] .composer-overlay-active .note-content-input {
  color: var(--ink);
  background: transparent;
  border-color: transparent;
}

body.subpage .phone-shell > .tabbar,
body[data-theme="dark"].subpage .phone-shell > .tabbar {
  display: none !important;
}

body[data-theme="dark"] .conversation-back-button,
body[data-theme="dark"] .settings-sheet-header .back-button,
body[data-theme="dark"] .detail-back {
  color: var(--accent) !important;
}

/* Figma P2 · 01: choose intent before opening the editor. */
.publish-type-picker {
  position: fixed;
  inset: 0 auto 0 50%;
  z-index: 100045;
  width: min(100%, 390px);
  height: 100dvh;
  overflow-y: auto;
  color: var(--ink);
  background: var(--bg);
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  transform: translateX(-50%);
}

.publish-type-picker.hidden {
  display: none;
}

body.publish-type-picker-open {
  overflow: hidden;
}

.publish-type-header {
  min-height: 64px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 52px;
  align-items: center;
  padding: max(8px, env(safe-area-inset-top)) 14px 8px;
  background: var(--bg);
}

.publish-type-header button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 34px;
  line-height: 1;
  font-weight: 300;
}

.publish-type-header strong {
  text-align: center;
  font-size: 18px;
  font-weight: 650;
}

.publish-type-content {
  padding: 34px 20px max(36px, env(safe-area-inset-bottom));
}

.publish-type-content > h2 {
  margin: 0;
  color: var(--ink);
  font-size: 25px;
  line-height: 34px;
  font-weight: 680;
  letter-spacing: -0.4px;
}

.publish-type-content > p {
  margin: 8px 0 26px;
  color: var(--muted);
  font-size: 14px;
}

.publish-type-options {
  display: grid;
  gap: 14px;
}

.publish-type-options > button {
  min-height: 84px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 0;
  border-radius: 18px;
  color: var(--ink);
  background: var(--accent-light);
  text-align: left;
}

.publish-type-options > button:nth-child(2) {
  background: #f6e6d9;
}

.publish-type-options > button:nth-child(3) {
  background: var(--mint-soft);
}

.publish-type-options > button:nth-child(4) {
  background: var(--surface-strong);
}

.publish-type-options i {
  width: 48px;
  height: 48px;
  display: block;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 17%, transparent);
}

.publish-type-options > button:nth-child(2) i {
  background: color-mix(in srgb, var(--apricot) 20%, transparent);
}

.publish-type-options > button:nth-child(3) i {
  background: color-mix(in srgb, var(--mint) 18%, transparent);
}

.publish-type-options > button:nth-child(4) i {
  background: color-mix(in srgb, var(--muted) 16%, transparent);
}

.publish-type-options span {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.publish-type-options strong {
  font-size: 16px;
  font-weight: 650;
}

.publish-type-options small {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.publish-type-options b {
  color: var(--muted);
  font-size: 24px;
  font-weight: 300;
}

.publish-recent-draft {
  margin-top: 44px;
}

.publish-recent-draft h3 {
  margin: 0 0 14px 2px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
}

.publish-recent-draft button {
  width: 100%;
  min-height: 82px;
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
}

.publish-recent-draft button strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.publish-recent-draft button span {
  color: var(--muted);
  font-size: 12px;
}

body[data-theme="dark"] .publish-type-options > button {
  background: var(--surface-strong);
}

@media (min-width: 560px) {
  .publish-type-picker {
    top: 12px;
    bottom: 12px;
    height: calc(100dvh - 24px);
    border: 1px solid var(--line);
    border-radius: 24px;
  }
}

@media (min-width: 560px) {
  [data-page="writer"].composer-overlay-active,
  .post-detail-viewer,
  .profile-settings-panel {
    top: 12px;
    bottom: 12px;
    height: calc(100dvh - 24px);
    border: 1px solid var(--line);
    border-radius: 24px;
    overflow: hidden;
  }
}

/* Final chat-tool authority: later legacy composer rules must not collapse this panel. */
#conversation-message-form.message-tools-ready,
#private-message-form.message-tools-ready {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  column-gap: 4px;
}

#conversation-message-form.message-tools-ready > input[name="text"],
#private-message-form.message-tools-ready > input[name="text"] {
  width: 100%;
  min-width: 0;
}

#conversation-message-form.message-tools-ready > .conversation-send-button,
#private-message-form.message-tools-ready > button[type="submit"] {
  grid-column: 3;
}

#conversation-message-form.message-tools-ready > .message-tools-panel,
#private-message-form.message-tools-ready > .message-tools-panel {
  grid-column: 1 / -1;
  width: 100%;
  max-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 4px;
  overflow: hidden;
  opacity: 0;
}

#conversation-message-form.message-tools-open > .message-tools-panel,
#private-message-form.message-tools-open > .message-tools-panel {
  max-height: 112px;
  padding-top: 14px;
  padding-bottom: 6px;
  opacity: 1;
}

/* One composer system across comments, the public room, and private chat. */
#conversation-message-form.conversation-composer,
#private-message-form.chat-box {
  display: grid;
  grid-template-columns: 36px minmax(72px, 1fr) 36px 36px 48px !important;
  align-items: center;
  column-gap: 3px !important;
  min-height: calc(62px + env(safe-area-inset-bottom));
  padding: 8px 12px max(8px, env(safe-area-inset-bottom));
  color: var(--input-text);
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  backdrop-filter: blur(18px);
}

#conversation-message-form.conversation-composer .voice-message-button,
#conversation-message-form.conversation-composer .form-tool-button,
#conversation-message-form.conversation-composer .image-message-button,
#private-message-form.chat-box .voice-message-button,
#private-message-form.chat-box .form-tool-button,
#private-message-form.chat-box .image-message-button {
  width: 36px !important;
  min-width: 36px !important;
  height: 40px !important;
  padding: 0 !important;
  color: var(--input-tool) !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent !important;
  box-shadow: none !important;
}

#conversation-message-form.conversation-composer input[name="text"],
#private-message-form.chat-box input[name="text"] {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 21px;
  color: var(--input-text);
  background: var(--input-surface);
  font-size: 16px;
}

#conversation-message-form.conversation-composer > button[type="submit"],
#private-message-form.chat-box > button[type="submit"] {
  width: 48px !important;
  min-width: 48px !important;
  height: 40px !important;
  padding: 0 6px !important;
  border: 0 !important;
  border-radius: 20px !important;
  color: var(--accent-contrast) !important;
  background: var(--input-action) !important;
  font-size: 14px;
  font-weight: 700;
}

/* Refined shared composer: tools live inside one quiet input capsule. */
.comment-form,
.detail-bottom-form,
#conversation-message-form.conversation-composer,
#private-message-form.chat-box {
  column-gap: 8px !important;
  padding-right: 12px;
  padding-left: 12px;
}

.comment-form,
.detail-bottom-form {
  grid-template-columns: 34px minmax(80px, 1fr) 34px 34px 34px 44px !important;
}

#conversation-message-form.conversation-composer,
#private-message-form.chat-box {
  grid-template-columns: 34px minmax(80px, 1fr) 34px 34px 44px !important;
}

.comment-form input[name="text"],
.detail-bottom-form input[name="text"] {
  grid-column: 1 / 6;
  grid-row: 1;
  width: 100%;
  height: 46px;
  padding-right: 112px;
  padding-left: 46px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 23px;
  background: var(--input-surface);
}

#conversation-message-form.conversation-composer input[name="text"],
#private-message-form.chat-box input[name="text"] {
  grid-column: 1 / 5;
  grid-row: 1;
  width: 100%;
  height: 46px;
  padding-right: 78px;
  padding-left: 46px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 23px;
  background: var(--input-surface);
}

.comment-form .voice-comment-button,
.detail-bottom-form .voice-comment-button,
#conversation-message-form .voice-message-button,
#private-message-form .voice-message-button {
  grid-column: 1;
  grid-row: 1;
  z-index: 1;
  justify-self: center;
}

.comment-form .mention-trigger-button,
.detail-bottom-form .mention-trigger-button {
  grid-column: 3;
  grid-row: 1;
  z-index: 1;
}

.comment-form [data-sticker-open],
.detail-bottom-form [data-sticker-open] {
  grid-column: 4;
  grid-row: 1;
  z-index: 1;
}

.comment-form [data-comment-image],
.detail-bottom-form [data-comment-image] {
  grid-column: 5;
  grid-row: 1;
  z-index: 1;
}

#conversation-message-form [data-sticker-open],
#private-message-form [data-sticker-open] {
  grid-column: 3;
  grid-row: 1;
  z-index: 1;
}

#conversation-message-form [data-image-message],
#private-message-form [data-image-message] {
  grid-column: 4;
  grid-row: 1;
  z-index: 1;
}

.comment-form > button[type="submit"],
.detail-bottom-form > button[type="submit"],
#conversation-message-form.conversation-composer > button[type="submit"],
#private-message-form.chat-box > button[type="submit"] {
  grid-row: 1;
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  font-size: 0 !important;
  box-shadow: none;
}

.comment-form > button[type="submit"] {
  grid-column: 6;
}

.detail-bottom-form > button[type="submit"] {
  grid-column: 6;
}

#conversation-message-form.conversation-composer > button[type="submit"],
#private-message-form.chat-box > button[type="submit"] {
  grid-column: 5;
}

.comment-form > button[type="submit"]::before,
.detail-bottom-form > button[type="submit"]::before,
#conversation-message-form.conversation-composer > button[type="submit"]::before,
#private-message-form.chat-box > button[type="submit"]::before {
  content: "↑";
  display: block;
  color: currentColor;
  font-size: 23px;
  line-height: 1;
  font-weight: 400;
}

.comment-form .form-tool-button,
.comment-form .voice-comment-button,
.detail-bottom-form .form-tool-button,
.detail-bottom-form .voice-comment-button,
#conversation-message-form .form-tool-button,
#conversation-message-form .voice-message-button,
#conversation-message-form .image-message-button,
#private-message-form .form-tool-button,
#private-message-form .voice-message-button,
#private-message-form .image-message-button {
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  color: color-mix(in srgb, var(--input-tool) 88%, transparent) !important;
}

body[data-theme="dark"] .comment-form input[name="text"],
body[data-theme="dark"] .detail-bottom-form input[name="text"],
body[data-theme="dark"] #conversation-message-form.conversation-composer input[name="text"],
body[data-theme="dark"] #private-message-form.chat-box input[name="text"] {
  border-color: var(--line);
  background: var(--input-surface);
}

/* Figma primary-screen authority: 25:4, 29:158, 31:282, 35:322, 38:353. */
.phone-shell > .topbar {
  min-height: 82px !important;
  height: 82px !important;
  padding: 0 18px !important;
  border-bottom: 0 !important;
  background: var(--surface) !important;
  box-shadow: none !important;
}

.phone-shell > .topbar h1 {
  color: var(--ink);
  font-size: 22px !important;
  line-height: 26px !important;
  font-weight: 700;
}

.phone-shell > .topbar .topbar-wordmark {
  margin-left: 8px;
  color: var(--muted);
  font-size: 9px !important;
  letter-spacing: 1.2px;
}

body[data-page="home"] .feed-switch,
body[data-page="foodie"] .foodie-inline-header > .feed-switch,
body[data-page="me"] .profile-tabs-row {
  min-height: 48px;
  padding-right: 18px;
  padding-left: 18px;
}

body[data-page="home"] .home-share-composer {
  width: calc(100% - 28px);
  min-height: 62px;
  margin: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
  box-shadow: none;
}

body[data-page="home"] #post-list,
body[data-page="home"] #following-post-list,
body[data-page="me"] #my-post-list {
  width: 100%;
  padding-right: 14px !important;
  padding-left: 14px !important;
}

body[data-page="home"] #post-list > .post-card,
body[data-page="home"] #following-post-list > .post-card,
body[data-page="me"] #my-post-list > .post-card {
  width: 100%;
  margin-right: 0 !important;
  margin-left: 0 !important;
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  background: var(--surface) !important;
  box-shadow: none !important;
}

body[data-page="foodie"] #foodie-inline-list,
body[data-page="foodie"] #pet-inline-list:not(.hidden) {
  grid-template-columns: repeat(2, minmax(0, 172px)) !important;
  justify-content: space-between;
  gap: 10px !important;
  padding: 12px 14px 20px !important;
}

body[data-page="foodie"] .foodie-waterfall .foodie-masonry-card {
  width: 172px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: none;
}

body[data-page="ai"] .phone-shell > .page.ai-projects-page.active {
  padding: 0 18px 24px !important;
}

body[data-page="ai"] .ai-projects-intro {
  padding: 26px 0 18px;
}

body[data-page="ai"] .ai-project-card {
  width: 100%;
  min-height: 230px;
  padding: 20px;
  border: 0;
  border-radius: 24px;
  background: var(--surface-strong);
  box-shadow: none;
}

body[data-page="chat"] .conversation-search {
  height: 54px;
  padding: 7px 14px;
  background: var(--surface);
}

body[data-page="chat"] .conversation-search input {
  height: 36px;
  border-radius: 18px;
  background: var(--surface-strong);
}

body[data-page="chat"] .conversation-row-shell {
  min-height: 76px;
  margin: 0 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: var(--surface) !important;
  box-shadow: none !important;
}

body[data-page="me"] .profile-shortcuts {
  min-height: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 6px 18px 8px;
}

body[data-page="me"] .profile-shortcuts button {
  width: 100%;
  min-height: 48px;
  border-radius: 0;
  background: transparent;
}

body[data-page="me"] .profile-tabs-row {
  min-height: 48px;
  border-top: 0;
  border-bottom: 0;
}

body[data-page="me"] .my-works-panel {
  border: 0 !important;
  background: var(--surface);
  box-shadow: none !important;
}

/* Figma 57:19 — notification center, adapted to the existing notification data. */
body[data-page="chat"].subpage .conversation-messages.notification-list {
  display: block !important;
  align-content: start !important;
  top: calc(env(safe-area-inset-top) + 64px) !important;
  bottom: 0 !important;
  padding: 0 16px 32px !important;
  background: var(--bg) !important;
}

.notification-center-title {
  display: grid;
  place-items: center;
}

.notification-center-title strong {
  font-size: 18px;
  font-weight: 700;
}

.conversation-header:has(.notification-center-title) {
  position: static;
  justify-content: center;
}

.notification-mark-all {
  position: absolute;
  right: 18px;
  top: 22px;
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  font-size: 13px;
  font-weight: 400;
}

.notification-filter-tabs {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.notification-filter-tabs button {
  width: 62px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 17px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}

.notification-filter-tabs button.active {
  color: var(--accent);
  background: var(--accent-light);
  font-weight: 500;
}

.notification-day-label {
  margin: 4px 4px 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.notification-center-card {
  position: relative;
  width: 100%;
  min-height: 108px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  margin: 0 0 16px;
  padding: 18px 14px;
  border: 0;
  border-radius: 16px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: none;
  cursor: pointer;
}

.notification-kind-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 500;
}

.notification-kind-icon.berry {
  color: var(--accent-dark);
  background: #faf3f5;
}

.notification-kind-icon.sage {
  color: #526a59;
  background: var(--mint-soft);
}

.notification-kind-icon.apricot {
  color: var(--apricot);
  background: #f6e8dc;
}

.notification-kind-icon.neutral {
  color: var(--muted);
  background: var(--surface-strong);
}

.notification-card-copy {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
}

.notification-card-copy > strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-card-copy > p,
.notification-post-excerpt {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-card-copy > .meta {
  color: var(--muted);
  font-size: 11px;
}

body[data-theme="dark"] .notification-center-card {
  background: var(--surface);
}

body[data-theme="dark"] .notification-kind-icon.berry {
  background: color-mix(in srgb, var(--accent) 20%, var(--surface));
}

/* Figma 57:27 — pet profile with the app's real pet/update model. */
#pet-profile-view {
  right: auto;
  left: 50%;
  width: min(100%, 390px);
  transform: translateX(-50%);
  color: var(--ink);
  background: var(--bg);
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

#pet-profile-view .pet-overlay-header {
  min-height: 64px;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  padding: max(4px, env(safe-area-inset-top)) 16px 0;
  border-bottom: 0;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  box-shadow: none;
}

#pet-profile-view .pet-overlay-header strong {
  font-size: 18px;
  font-weight: 700;
}

#pet-profile-view .pet-overlay-header .back-button,
#pet-profile-view .pet-overlay-header .text-button {
  min-height: 44px;
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  font-size: 14px;
  font-weight: 500;
}

#pet-profile-view .pet-overlay-header .back-button {
  color: var(--ink);
  text-align: left;
}

#pet-profile-view .pet-overlay-header .text-button {
  text-align: right;
}

#pet-profile-view .pet-overlay-body {
  width: 100%;
  display: block;
  padding: 10px 16px calc(32px + env(safe-area-inset-bottom));
}

.pet-profile-showcase {
  position: relative;
}

.pet-profile-hero-media {
  width: 100%;
  height: 234px;
  display: block;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: var(--mint-soft);
}

.pet-profile-hero-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.pet-profile-hero-media.empty {
  display: grid;
  place-items: center;
}

.pet-profile-hero-placeholder {
  width: 116px;
  height: 116px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  font-size: 58px;
}

.pet-profile-identity-row {
  min-height: 70px;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: -30px;
  padding: 0 6px;
}

.pet-profile-identity-row .pet-profile-avatar {
  width: 76px;
  height: 76px;
  border: 5px solid var(--bg);
  background: #f6e8dc;
  font-size: 38px;
}

.pet-profile-identity-row h2 {
  align-self: end;
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.2;
}

.pet-profile-identity-row .pet-follow-button {
  align-self: end;
  min-width: 76px;
  min-height: 38px;
  margin-bottom: 4px;
  padding: 0 18px;
  border-radius: 19px;
  font-size: 13px;
}

.pet-profile-type {
  margin: 20px 6px 0;
  color: var(--muted);
  font-size: 13px;
}

.pet-profile-bio {
  min-height: 28px;
  margin: 14px 6px 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

.pet-profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 20px 6px 0;
}

.pet-profile-stats span {
  display: grid;
  gap: 4px;
}

.pet-profile-stats strong {
  font-size: 18px;
}

.pet-profile-stats small {
  color: var(--muted);
  font-size: 11px;
}

.pet-recent-section {
  margin-top: 30px;
}

.pet-recent-section h3,
.pet-profile-management h3 {
  margin: 0 6px 16px;
  font-size: 17px;
}

.pet-recent-grid {
  display: grid;
  grid-template-columns: repeat(3, 112px);
  justify-content: space-between;
  gap: 8px;
}

.pet-recent-media {
  width: 112px;
  height: 112px;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--surface-strong);
}

.pet-recent-media img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.pet-recent-empty {
  grid-column: 1 / -1;
  min-height: 82px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 13px;
}

.pet-care-note {
  min-height: 78px;
  display: grid;
  align-content: center;
  gap: 7px;
  margin-top: 28px;
  padding: 14px 16px;
  border-radius: 16px;
  color: var(--mint);
  background: var(--mint-soft);
}

.pet-care-note strong {
  font-size: 13px;
  font-weight: 500;
}

.pet-care-note span {
  color: var(--muted);
  font-size: 12px;
}

.pet-profile-management,
.pet-all-posts {
  margin-top: 28px;
}

.pet-profile-management {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.pet-profile-management .pet-person-card {
  min-height: 96px;
  border: 0;
  background: var(--surface-strong);
}

.pet-profile-management .pet-person-avatar,
.pet-profile-management .pet-person-avatar-placeholder {
  width: 44px;
  height: 44px;
  font-size: 18px;
}

.pet-public-follow-count {
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.pet-all-posts > .section-title {
  padding: 0 6px;
}

body[data-theme="dark"] #pet-profile-view,
body[data-theme="dark"] #pet-profile-view .pet-overlay-header {
  background: var(--bg);
}

body[data-theme="dark"] .pet-profile-identity-row .pet-profile-avatar {
  border-color: var(--bg);
}

/* Figma 72:2 · 收藏与草稿 */
.favorites-viewer,
.draft-viewer {
  position: fixed;
  z-index: 100045;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(100%, 390px);
  overflow-y: auto;
  transform: translateX(-50%);
  color: var(--ink);
  background: var(--bg);
}

.favorites-viewer-header,
.draft-viewer-header {
  position: sticky;
  z-index: 5;
  top: 0;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  min-height: 68px;
  padding-top: env(safe-area-inset-top);
  border: 0;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(18px);
  text-align: center;
}

.favorites-viewer-header strong,
.draft-viewer-header strong {
  font-size: 18px;
  font-weight: 700;
}

.favorites-viewer-header button,
.draft-viewer-header button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  color: var(--accent);
  background: transparent;
  font-size: 14px;
}

.favorites-viewer-header .back-button,
.draft-viewer-header .back-button {
  overflow: hidden;
  color: transparent;
  font-size: 0;
}

.favorites-viewer-header .back-button::before,
.draft-viewer-header .back-button::before {
  content: "‹";
  color: var(--ink);
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
}

.favorites-viewer-header #favorites-search-toggle {
  color: var(--muted);
  font-size: 21px;
}

.favorites-filter {
  display: flex;
  gap: 8px;
  padding: 8px 20px 14px;
}

.favorites-filter button {
  min-width: 58px;
  min-height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}

.favorites-filter button.active {
  color: var(--accent);
  background: var(--accent-light);
  font-weight: 600;
}

.favorites-search {
  padding: 0 20px 8px;
}

.favorites-search input {
  width: 100%;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 21px;
  color: var(--ink);
  background: var(--surface-strong);
  font: inherit;
  font-size: 13px;
}

.favorites-viewer-list {
  display: grid;
  gap: 16px;
  padding: 4px 14px 32px;
}

.favorites-viewer-list > .post-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: none;
}

.draft-viewer-summary {
  margin: 6px 20px 18px;
  color: var(--muted);
  font-size: 13px;
}

.draft-viewer-list {
  display: grid;
  gap: 16px;
  width: auto;
  margin: 0;
  padding: 0 16px;
}

.draft-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  align-items: center;
  min-height: 128px;
  gap: 4px;
  padding: 12px;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
}

.draft-card-main {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.draft-card-main img,
.draft-card-placeholder {
  width: 84px;
  height: 84px;
  border-radius: 12px;
  color: #c98252;
  background: #f6e8dc;
  font-size: 20px;
  font-weight: 600;
}

.draft-card-main > span:last-child {
  align-content: start;
  gap: 8px;
  padding-top: 2px;
}

.draft-card-main strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-card-main em {
  font-size: 12px;
}

.draft-card-main small {
  margin-top: 5px;
  font-size: 11px;
}

.draft-card-delete {
  align-self: end;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  color: var(--muted);
  font-size: 14px;
}

.draft-autosave-note {
  display: grid;
  gap: 7px;
  margin: 44px 16px 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface-strong);
}

.draft-autosave-note strong { font-size: 13px; }
.draft-autosave-note span { color: var(--muted); font-size: 12px; }
.draft-viewer-footnote { margin: 42px 0 28px; color: var(--muted); font-size: 11px; text-align: center; }

body[data-theme="dark"] .favorites-viewer,
body[data-theme="dark"] .draft-viewer,
body[data-theme="dark"] .favorites-viewer-header,
body[data-theme="dark"] .draft-viewer-header {
  background: #171614;
}

body[data-theme="dark"] .draft-card { background: #211f1c; }
body[data-theme="dark"] .draft-autosave-note { background: #292622; }

/* Figma 72:10 · 他人主页与关系 */
body[data-page="user"] .page[data-page="user"] {
  padding: 0 0 92px;
  background: var(--bg);
}

body[data-page="user"] .visitor-profile-topbar {
  min-height: 68px;
  margin: 0;
  padding: env(safe-area-inset-top) 8px 0;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(18px);
}

body[data-page="user"] .visitor-profile-topbar .page-back-button {
  overflow: hidden;
  color: transparent;
  font-size: 0;
}

body[data-page="user"] .visitor-profile-topbar .page-back-button::before {
  content: "‹";
  color: var(--ink);
  font-size: 30px;
}

body[data-page="user"] #user-page-title {
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

body[data-page="user"] .visitor-profile-more {
  color: var(--muted);
  font-size: 16px;
}

body[data-page="user"] #user-profile-panel {
  position: relative;
  display: block;
  min-height: 202px;
  padding: 74px 22px 14px;
  box-sizing: border-box;
  background: var(--bg);
}

body[data-page="user"] #user-cover-layer {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  display: block !important;
  height: 112px;
  background-color: #e9efea;
  background-position: center;
  background-size: cover;
}

body[data-page="user"] #user-avatar.avatar-large {
  position: relative;
  z-index: 1;
  width: 78px;
  height: 78px;
  margin-top: 0;
  border: 4px solid var(--bg);
  background: #e9efea;
  color: #526a59;
}

body[data-page="user"] #user-profile-panel .profile-identity {
  position: static;
}

body[data-page="user"] #user-name {
  position: absolute;
  top: 78px;
  left: 122px;
  right: 20px;
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.visitor-profile-handle {
  position: absolute;
  top: 110px;
  left: 122px;
  right: 20px;
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-page="user"] #user-bio {
  position: absolute;
  top: 154px;
  left: 22px;
  width: calc(100% - 44px);
  max-width: 346px;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

body[data-page="user"] .visitor-profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 2px 0 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

body[data-page="user"] .visitor-profile-stats .profile-stat-button {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 0 8px;
  color: var(--ink);
  text-align: center;
}

body[data-page="user"] .visitor-profile-stats .profile-stat-button strong {
  display: inline;
  font-size: 18px;
  line-height: 1.15;
}

body[data-page="user"] .visitor-profile-stats .profile-stat-button span {
  display: inline;
  margin-top: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.15;
}

body[data-page="user"] .profile-actions {
  display: flex;
  gap: 10px;
  margin: 0 20px 22px;
}

body[data-page="user"] .profile-actions button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

body[data-page="user"] #follow-action-button { color: var(--accent); background: var(--accent-light); }
body[data-page="user"] #friend-action-button { color: #fff; background: var(--accent); }
body[data-page="user"] #friend-reject-button { color: var(--accent); background: var(--accent-light); }

.visitor-posts-title {
  margin: 0 20px 12px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

body[data-page="user"] #user-post-list {
  display: grid;
  gap: 16px;
  padding: 0 16px 24px;
}

body[data-page="user"] #user-post-list > .post-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: none;
}

body[data-theme="dark"][data-page="user"] .visitor-profile-topbar,
body[data-theme="dark"][data-page="user"] #user-profile-panel {
  background: var(--bg);
}

.follow-list-viewer {
  z-index: 100140;
  left: 50%;
  right: auto;
  width: min(100%, 390px);
  transform: translateX(-50%);
}

.follow-list-sheet {
  width: 100%;
  min-height: 100%;
  padding: max(12px, env(safe-area-inset-top)) 16px 24px;
}

.follow-list-sheet header {
  min-height: 52px;
  margin-bottom: 8px;
}

.follow-list-sheet header strong {
  font-size: 18px;
  text-align: center;
}

.follow-list-sheet header .back-button {
  overflow: hidden;
  color: transparent;
  font-size: 0;
}

.follow-list-sheet header .back-button::before {
  content: "‹";
  color: var(--ink);
  font-size: 30px;
}

.follow-list-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
  background: transparent;
}

.follow-list-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  margin-bottom: 14px;
  padding: 0 16px;
  border-radius: 21px;
  color: var(--muted);
  background: var(--surface-strong);
}

.follow-list-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-size: 12px;
}

.follow-list-tabs button {
  min-height: 38px;
  border: 0;
  border-radius: 19px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
}

.follow-list-tabs button.active {
  color: #fff;
  background: var(--accent);
}

.follow-list-body { gap: 14px; }

.follow-list-item {
  min-height: 78px;
  padding: 12px;
  border: 0;
  border-radius: 14px;
  background: var(--surface);
}

body[data-theme="dark"] .follow-list-viewer,
body[data-theme="dark"] .follow-list-sheet { background: #171614; }
body[data-theme="dark"] .follow-list-item { background: #211f1c; }

/* Figma 72:18 · 美食详情与沉浸看图 */
.foodie-full-detail .detail-topbar {
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  min-height: 68px;
  padding: env(safe-area-inset-top) 8px 0;
  background: var(--surface);
  backdrop-filter: none;
}

.foodie-full-detail,
.foodie-full-detail .detail-scroll {
  background: var(--surface);
}

.foodie-full-detail .detail-page-title {
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}

.foodie-full-detail .detail-topbar .post-management-menu {
  grid-column: 3;
  justify-self: center;
}

.foodie-full-detail .detail-scroll {
  padding: 0 20px calc(96px + env(safe-area-inset-bottom));
}

.foodie-detail-author {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 0 12px;
}

.foodie-detail-author .avatar {
  width: 42px;
  height: 42px;
  background: #f6e8dc;
  color: #c98252;
}

.foodie-detail-author > div:nth-child(2) { display: grid; gap: 2px; }
.foodie-detail-author strong { font-size: 15px; font-weight: 600; }
.foodie-detail-author span { color: var(--muted); font-size: 12px; }
.foodie-detail-author .foodie-stars { min-width: 116px; justify-self: end; }

.foodie-full-detail .detail-post-copy {
  padding: 0 0 18px;
  border: 0;
}

.foodie-full-detail .detail-post-copy .post-text {
  font-size: 14px;
  line-height: 1.55;
}

.foodie-full-detail .detail-post-meta { display: none; }

.foodie-full-detail .detail-photo-strip.foodie-detail-media {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  grid-template-rows: repeat(2, 136px);
  gap: 8px;
  width: 100%;
  height: 280px;
  margin: 18px 0 0;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  background: var(--surface-strong);
}

.foodie-full-detail .foodie-detail-media .detail-photo-button {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f0ede8;
}

.foodie-full-detail .foodie-detail-media .detail-photo-button:first-child {
  grid-row: 1 / 3;
}

.foodie-full-detail .foodie-detail-media.one {
  display: block;
}

.foodie-full-detail .foodie-detail-media.two {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: 280px;
}

.foodie-full-detail .foodie-detail-media.two .detail-photo-button:first-child { grid-row: auto; }
.foodie-full-detail .foodie-detail-media img { width: 100%; height: 100%; object-fit: cover; background: #f0ede8; }

body[data-theme="dark"] .foodie-full-detail .foodie-detail-media .detail-photo-button,
body[data-theme="dark"] .foodie-full-detail .foodie-detail-media img { background: #292622; }

.detail-more-images {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-width: 34px;
  padding: 5px 8px;
  border-radius: 17px;
  color: #fff;
  background: rgba(23, 22, 20, .72);
  font-size: 12px;
}

.foodie-detail-tags {
  margin-top: 16px;
  color: #c98252;
  font-size: 12px;
}

.foodie-full-detail .detail-action-row {
  margin: 10px 0 0;
  padding: 8px 0;
  border: 0;
}

.foodie-full-detail .detail-action-row .reaction-bar {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  min-height: 38px;
}

.foodie-full-detail .detail-action-row .reaction-list,
.foodie-full-detail .detail-action-row .quick-reactions {
  flex-wrap: nowrap;
  align-items: center;
}

.foodie-full-detail .detail-action-row .more-reactions {
  flex: 0 0 100%;
}

.foodie-detail-note {
  margin: 16px 0 26px;
  padding: 18px 16px;
  border-radius: 16px;
  color: var(--muted);
  background: #f6e8dc;
  font-size: 12px;
}

.foodie-full-detail .detail-comment-panel { padding: 0; border: 0; }
.foodie-full-detail .detail-comment-panel h2 { font-size: 16px; }

#image-viewer.image-viewer {
  position: fixed;
  inset: 0 auto 0 50%;
  z-index: 2147483200;
  width: min(100%, 390px);
  height: 100dvh;
  overflow: hidden;
  transform: translateX(-50%);
  color: #f3efe8;
  background: #171614;
}

#image-viewer #viewer-image {
  position: absolute;
  top: calc(max(14px, env(safe-area-inset-top)) + 48px);
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 0;
  width: 100%;
  height: auto;
  max-width: none;
  max-height: none;
  object-fit: contain;
  background: #211f1c;
  transition: transform 160ms ease;
}

#image-viewer .viewer-close,
#image-viewer .viewer-more {
  position: absolute;
  z-index: 4;
  top: max(14px, env(safe-area-inset-top));
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  color: #f3efe8;
  background: transparent;
}

#image-viewer .viewer-close { left: 6px; font-size: 30px; }
#image-viewer .viewer-more { right: 6px; font-size: 16px; }

#image-viewer .viewer-count {
  top: max(28px, calc(env(safe-area-inset-top) + 14px));
  left: 50%;
  padding: 0;
  color: #f3efe8;
  background: transparent;
  transform: translateX(-50%);
  font-size: 13px;
}

#image-viewer .viewer-arrow {
  z-index: 3;
  top: 44%;
  width: 44px;
  height: 52px;
  border: 0;
  color: #f3efe8;
  background: rgba(23, 22, 20, .28);
  font-size: 34px;
}

#image-viewer .viewer-prev { left: 0; }
#image-viewer .viewer-next { right: 0; }

/* Figma 72:26 · 宠物申请与高风险注销 */
#pet-center {
  left: 50%;
  right: auto;
  width: min(100%, 390px);
  transform: translateX(-50%);
}

#pet-center .pet-overlay-header {
  min-height: 68px;
  padding: env(safe-area-inset-top) 8px 0;
  border: 0;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
}

#pet-center .pet-overlay-body { gap: 18px; padding: 10px 16px 32px; }

.pet-application-form-card {
  padding: 0;
  border: 0;
  background: transparent;
}

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

.pet-application-heading h2 { margin: 0; font-size: 18px; }
.pet-application-heading span { color: var(--muted); font-size: 12px; }

.pet-application-intro {
  display: grid;
  gap: 7px;
  margin-bottom: 24px;
  padding: 14px 16px;
  border-radius: 16px;
  color: #718a78;
  background: #e9efea;
}

.pet-application-intro strong { font-size: 14px; font-weight: 600; }
.pet-application-intro span { color: var(--muted); font-size: 12px; }

#pet-application-form { gap: 12px; }
#pet-application-form .field { gap: 7px; }
#pet-application-form .field > span { color: var(--muted); font-size: 12px; }

#pet-application-form input:not([type="file"]),
#pet-application-form select,
#pet-application-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  font-size: 13px;
}

#pet-application-form textarea { min-height: 62px; resize: vertical; }

.pet-photo-upload {
  position: relative;
  min-height: 126px;
  align-content: center;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
}

.pet-photo-upload > span { position: absolute; top: -25px; left: 4px; }
.pet-photo-upload input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pet-photo-upload b { color: var(--muted); font-size: 30px; font-weight: 300; }
.pet-photo-upload em { color: var(--muted); font-size: 12px; font-style: normal; }
.pet-photo-upload .pet-form-preview { position: absolute; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; object-fit: cover; }

.pet-application-agreement {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface);
  font-size: 12px;
}

.pet-application-agreement input,
.pet-deactivate-ack input { width: 20px; height: 20px; accent-color: var(--accent); }

.pet-application-submit {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 24px;
  color: #fff;
  background: var(--accent);
}

#pet-deactivate-backdrop {
  z-index: 2147483200;
  place-items: stretch center;
  background: rgba(0, 0, 0, .52);
}

#pet-deactivate-backdrop .pet-deactivate-sheet {
  width: min(100%, 390px);
  min-height: 100dvh;
  align-content: start;
  gap: 24px;
  padding: max(10px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  border-radius: 0;
  color: #f3efe8;
  background: #171614;
}

.pet-deactivate-sheet header {
  display: grid;
  grid-template-columns: 52px 1fr 52px;
  align-items: center;
  min-height: 48px;
}

.pet-deactivate-sheet header h2 { margin: 0; color: #f3efe8; font-size: 18px; text-align: center; }
.pet-deactivate-sheet header button { width: 44px; height: 44px; border: 0; color: #f3efe8; background: transparent; font-size: 28px; }

#pet-deactivate-backdrop .pet-deactivate-warning {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 17px;
  border: 1px solid #c44d5e;
  border-radius: 18px;
  color: #f3efe8;
  background: #211f1c;
}

.pet-deactivate-warning strong { color: #d35165; font-size: 17px; }
.pet-deactivate-warning span { font-size: 13px; line-height: 1.55; }

#pet-deactivate-backdrop .field { display: grid; gap: 9px; }
#pet-deactivate-backdrop .field span { color: #b9b1a7; font-size: 12px; }
#pet-deactivate-backdrop .field input { min-height: 48px; padding: 0 13px; border: 1px solid #3a3631; border-radius: 12px; color: #f3efe8; background: #292622; font: inherit; }

#pet-deactivate-backdrop .pet-deactivate-ack {
  min-height: 62px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #211f1c;
}

.pet-deactivate-impact { display: grid; gap: 12px; padding: 16px; border-radius: 16px; background: #211f1c; }
.pet-deactivate-impact strong { font-size: 14px; }
.pet-deactivate-impact span { color: #b9b1a7; font-size: 13px; line-height: 1.55; }

.pet-deactivate-actions { display: grid; gap: 12px; margin-top: auto; }
.pet-deactivate-actions button { min-height: 48px; border: 0; border-radius: 24px; color: #f3efe8; background: #292622; }
.pet-deactivate-actions .danger-button { color: #fff; background: #c44d5e; }

/* Figma 72:34 · 安全与关系；聊天输入仍使用已确认的紧凑单行组件。 */
.visitor-action-backdrop { align-items: flex-end; padding: 0; background: rgba(23, 22, 20, .54); }

.visitor-action-sheet {
  width: min(100%, 390px);
  margin: 0 auto;
  padding: 8px 12px max(14px, env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  color: var(--ink);
  background: var(--surface);
}

.visitor-action-grabber { width: 20px; height: 2px; margin: 2px auto 12px; border-radius: 2px; background: var(--muted); }
.visitor-action-sheet h2 { margin: 0 8px 14px; font-size: 17px; }

.visitor-action-group { display: grid; gap: 10px; padding: 0; border-radius: 0; background: transparent; }

.visitor-action-group button {
  position: relative;
  display: grid;
  gap: 2px;
  min-height: 56px;
  padding: 9px 38px 9px 14px;
  border: 0;
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface-strong);
  text-align: left;
}

.visitor-action-group button strong { font-size: 13px; font-weight: 600; }
.visitor-action-group button span { color: var(--muted); font-size: 11px; }
.visitor-action-group button i { position: absolute; top: 16px; right: 14px; color: var(--muted); font-size: 18px; font-style: normal; }
.visitor-action-group button.danger strong { color: #c44d5e; }

.visitor-action-cancel {
  width: 100%;
  min-height: 46px;
  margin-top: 12px;
  border: 0;
  border-radius: 23px;
  color: var(--ink);
  background: var(--surface-strong);
}

.conversation-action-letter {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--accent);
  background: var(--accent-light);
  font-size: 11px;
  font-weight: 700;
}

body[data-theme="dark"] .visitor-action-sheet { color: #f3efe8; background: #211f1c; }
body[data-theme="dark"] .visitor-action-group button,
body[data-theme="dark"] .visitor-action-cancel { color: #f3efe8; background: #292622; }

.visitor-profile-friend-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  margin: 12px 0 0 !important;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 16%, var(--line));
  border-radius: 12px;
  color: var(--ink) !important;
  background: color-mix(in srgb, var(--accent-light) 42%, var(--surface));
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.visitor-profile-friend-note::before {
  content: "补充备注 · 仅自己可见";
  flex: 0 0 auto;
  margin-top: 1px;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-light);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

.friend-remark-sheet {
  position: fixed;
  z-index: 100500;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.friend-remark-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(23, 22, 20, .54);
}

.friend-remark-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  max-height: min(86vh, 680px);
  overflow: auto;
  padding: 0 18px max(22px, env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  color: var(--ink);
  background: var(--surface);
}

.friend-remark-panel header {
  min-height: 58px;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

.friend-remark-panel header strong { text-align: center; }
.friend-remark-panel button { border: 0; color: inherit; background: transparent; font: inherit; }
.friend-remark-panel header button:first-child { text-align: left; }
.friend-remark-panel header .friend-remark-save { color: var(--accent); font-weight: 700; text-align: right; }
.friend-remark-panel button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.friend-remark-identity {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 17px 2px 5px;
}

.friend-remark-identity > span { display: grid; gap: 2px; }
.friend-remark-identity small { color: var(--muted); font-size: 11px; }

.friend-remark-panel label {
  display: grid;
  gap: 8px;
  margin-top: 17px;
}

.friend-remark-panel label > span {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 650;
}

.friend-remark-panel label small { color: var(--muted); font-weight: 400; }

.friend-remark-panel input,
.friend-remark-panel textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface-strong);
  font: inherit;
  outline: none;
}

.friend-remark-panel input { min-height: 48px; padding: 0 13px; }
.friend-remark-panel textarea { min-height: 112px; padding: 12px 13px; resize: vertical; line-height: 1.55; }
.friend-remark-panel input:focus,
.friend-remark-panel textarea:focus { border-color: var(--accent); }
.friend-remark-panel > p { margin: 13px 2px; color: var(--muted); font-size: 12px; line-height: 1.55; }

.friend-remark-clear {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  border-radius: 12px !important;
  color: #c44d5e !important;
  background: var(--surface-strong) !important;
}

body.friend-remark-open { overflow: hidden; }

body[data-theme="dark"] .friend-remark-panel {
  color: #f3efe8;
  background: #211f1c;
}

body[data-theme="dark"] .friend-remark-panel input,
body[data-theme="dark"] .friend-remark-panel textarea,
body[data-theme="dark"] .friend-remark-clear {
  color: #f3efe8;
  background: #292622 !important;
}

@media (min-width: 700px) {
  .friend-remark-sheet { align-items: center; }
  .friend-remark-panel { border-radius: 22px; }
}

/* Figma 110:393 · Her 印度占星体验 */
.ai-projects-intro > span,
.vedic-kicker,
.vedic-stage-heading > span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .14em;
}

.ai-project-card ul { display: grid; gap: 8px; margin: 18px 0; padding: 0; list-style: none; color: var(--muted); font-size: 12px; }
.ai-project-card li { position: relative; padding-left: 18px; }
.ai-project-card li::before { content: ""; position: absolute; top: 6px; left: 2px; width: 6px; height: 6px; border-radius: 50%; background: #7a9e8e; }
.ai-project-card > button,
.vedic-primary {
  width: 100%; min-height: 48px; border: 0; border-radius: 16px; color: #fff; background: var(--accent); font: inherit; font-size: 14px; font-weight: 700;
}
.ai-project-card footer a { color: inherit; text-underline-offset: 2px; }

.vedic-experience {
  position: absolute; inset: 0; z-index: 180; overflow-y: auto; overscroll-behavior: contain;
  padding: 0 16px calc(30px + env(safe-area-inset-bottom)); color: var(--ink); background: var(--surface);
}
.vedic-topbar {
  position: sticky; top: 0; z-index: 3; height: 58px; display: grid; grid-template-columns: 64px 1fr 64px; align-items: center;
  margin: 0 -16px; padding: env(safe-area-inset-top) 16px 0; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px);
}
.vedic-topbar strong { text-align: center; font-size: 16px; }
.vedic-topbar button { min-height: 44px; padding: 0; border: 0; color: var(--accent); background: transparent; font: inherit; font-size: 13px; }
.vedic-topbar button:last-child { text-align: right; }

.vedic-stage { display: grid; gap: 18px; padding: 28px 2px 20px; }
.vedic-stage > h2,
.vedic-stage-heading h2 { margin: 0; font-size: 25px; line-height: 1.25; }
.vedic-stage > p,
.vedic-stage-heading p { margin: -8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.vedic-stage > small,
.vedic-result > small { color: var(--muted); font-size: 10px; line-height: 1.55; text-align: center; }
.vedic-stage > small a { margin-left: 4px; color: inherit; text-underline-offset: 2px; }
.vedic-stage-heading { display: grid; gap: 8px; }
.vedic-trust-card { display: grid; gap: 8px; padding: 16px; border-radius: 18px; background: var(--surface-strong); }
.vedic-trust-card strong { font-size: 14px; }
.vedic-trust-card span { color: var(--muted); font-size: 12px; line-height: 1.6; }

#vedic-birth-form > label:not(.vedic-consent) { display: grid; gap: 8px; }
#vedic-birth-form label > span { color: var(--muted); font-size: 12px; }
#vedic-birth-form input,
#vedic-birth-form select {
  width: 100%; min-height: 48px; padding: 0 13px; border: 1px solid var(--line); border-radius: 14px;
  color: var(--ink); background: var(--surface-strong); font: inherit; font-size: 14px; outline: none;
}
#vedic-birth-form input:focus,
#vedic-birth-form select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); }

.vedic-time-control {
  position: relative;
  width: 100%;
  height: 48px;
  display: grid !important;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink) !important;
  background: var(--surface-strong);
  font-size: 14px !important;
}

#vedic-birth-form .vedic-time-control input[name="birthTime"] {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.vedic-time-control:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.vedic-time-display {
  pointer-events: none;
  color: var(--ink) !important;
  font-size: 14px !important;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: center;
}

.vedic-time-control svg {
  position: absolute;
  right: 13px;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}
.vedic-place-field { grid-template-columns: 1fr 72px; }
.vedic-place-field > span { grid-column: 1 / -1; }
.vedic-place-field button { border: 0; border-radius: 14px; color: var(--accent); background: var(--accent-light); font: inherit; font-weight: 700; }
.vedic-location-results { display: grid; gap: 8px; margin-top: -8px; }
.vedic-location-results button { min-height: 50px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: var(--surface); font: inherit; font-size: 12px; text-align: left; }
.vedic-location-results button.active { border-color: var(--accent); background: var(--accent-light); }
.vedic-location-results button span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.vedic-consent { display: grid; grid-template-columns: 20px 1fr; align-items: start; gap: 10px; padding: 13px; border-radius: 14px; background: var(--surface-strong); }
.vedic-consent input { width: 18px !important; min-height: 18px !important; margin: 1px 0 0; accent-color: var(--accent); }
.vedic-consent span { line-height: 1.55; }

.vedic-result { gap: 14px; padding-top: 18px; padding-bottom: 92px; }
.vedic-chart-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.vedic-chart-summary article { display: grid; gap: 4px; min-width: 0; padding: 12px 10px; border-radius: 14px; background: var(--surface-strong); }
.vedic-chart-summary span { color: var(--muted); font-size: 10px; }
.vedic-chart-summary strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.vedic-topic-tabs { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; }
.vedic-topic-tabs::-webkit-scrollbar { display: none; }
.vedic-topic-tabs button { flex: 0 0 auto; min-height: 36px; padding: 0 14px; border: 0; border-radius: 18px; color: var(--ink); background: var(--surface-strong); font: inherit; font-size: 12px; }
.vedic-messages { display: grid; gap: 12px; }
.vedic-messages > :last-child { scroll-margin-bottom: 72px; }
.vedic-message { max-width: 91%; padding: 13px 14px; border-radius: 18px; color: var(--ink); background: var(--surface-strong); font-size: 13px; line-height: 1.65; }
.vedic-message.user { justify-self: end; border-bottom-right-radius: 6px; background: var(--accent-light); }
.vedic-message.assistant { border-bottom-left-radius: 6px; }
.vedic-message.pending { color: var(--muted); }
.vedic-message.pending.assistant { animation: vedic-pending 1.2s ease-in-out infinite alternate; }
.vedic-message p { margin: 0 0 9px; }
.vedic-message p:last-child { margin-bottom: 0; }
.vedic-chat-form { position: sticky; bottom: 0; z-index: 2; display: grid; grid-template-columns: 1fr 46px; gap: 8px; padding: 8px 0 max(8px, env(safe-area-inset-bottom)); background: var(--surface); }
.vedic-chat-form textarea { min-height: 46px; max-height: 110px; resize: none; padding: 12px 14px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--surface-strong); font: inherit; font-size: 13px; line-height: 20px; outline: 0; }
.vedic-chat-form button { width: 46px; height: 46px; border: 0; border-radius: 50%; color: #fff; background: var(--accent); font-size: 24px; line-height: 1; }
.vedic-delete { min-height: 42px; border: 0; color: #b44a5c; background: transparent; font: inherit; font-size: 12px; }
.vedic-secondary { min-height: 44px; border: 1px solid var(--line); border-radius: 14px; color: var(--accent); background: var(--surface); font: inherit; font-size: 13px; font-weight: 650; }
.vedic-history-list { display: grid; gap: 10px; }
.vedic-history-item { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; min-height: 64px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--surface); text-align: left; }
.vedic-history-item strong { font-size: 13px; }
.vedic-history-item span { grid-row: 2; color: var(--muted); font-size: 11px; }
.vedic-history-item button { grid-column: 2; grid-row: 1 / 3; align-self: center; border: 0; color: var(--accent); background: transparent; font: inherit; font-size: 12px; }
.vedic-busy { position: fixed; inset: 0; z-index: 6; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 30px; color: var(--ink); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); text-align: center; }
.vedic-busy span { width: 30px; height: 30px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: vedic-spin .8s linear infinite; }
.vedic-busy strong { font-size: 15px; }
.vedic-busy small { max-width: 240px; color: var(--muted); font-size: 11px; line-height: 1.5; }
@keyframes vedic-spin { to { transform: rotate(360deg); } }
@keyframes vedic-pending { from { opacity: .55; } to { opacity: 1; } }

body[data-theme="dark"] .ai-project-card { background: #292622; }
body[data-theme="dark"] .vedic-experience,
body[data-theme="dark"] .vedic-chat-form { background: #1c1a18; }
body[data-theme="dark"] .vedic-topbar { background: rgba(28, 26, 24, .94); }
@media (prefers-reduced-motion: reduce) { .vedic-busy span { animation-duration: 1.8s; } }

/* The final 64px conversation header owns this boundary; messages must never sit underneath it. */
body[data-page="chat"].subpage .conversation-messages,
body[data-theme="dark"][data-page="chat"].subpage .conversation-messages {
  top: calc(env(safe-area-inset-top) + 64px);
}

/* Figma 101:2 / 102:399 / 105:40 / 106:2 — final mobile review. */
:root {
  --primary-tabbar-height: 48px;
  --primary-tab-hit: 48px;
  --primary-bottom-clearance: 52px;
}

.phone-shell,
body[data-page="foodie"] .phone-shell,
body[data-theme="dark"] .phone-shell,
body[data-theme="dark"][data-page="foodie"] .phone-shell,
.post-detail-viewer,
#pet-profile-view,
.profile-settings-panel {
  border-right: 0 !important;
  border-left: 0 !important;
}

#pet-center {
  z-index: 100220;
}

#pet-profile-view {
  z-index: 100230;
}

.pet-edit-backdrop {
  z-index: 100240;
}

.phone-shell > .topbar {
  min-height: 64px !important;
  height: 64px !important;
  gap: 10px;
  padding: 0 18px !important;
}

.phone-shell > .topbar .shell-avatar-button {
  order: 0 !important;
  width: 36px;
  min-width: 36px;
  height: 36px;
  margin: 0 !important;
  border: 0;
}

.phone-shell > .topbar > div {
  order: 1 !important;
  width: auto !important;
  flex: 0 1 auto !important;
  align-self: center;
  text-align: left !important;
}

body[data-page="home"] .feed-switch,
body[data-page="foodie"] .foodie-inline-header > .feed-switch,
body[data-page="me"] .profile-tabs-row {
  min-height: 42px;
  height: 42px;
  padding-right: 18px;
  padding-left: 18px;
}

body[data-page="home"] .feed-switch {
  grid-template-columns: repeat(2, 44px) !important;
  gap: 18px !important;
}

body[data-page="home"] .feed-switch-button {
  min-width: 44px;
  height: 42px;
  padding: 0 !important;
  text-align: left;
}

body[data-page="home"] .feed-switch-button.active::after {
  right: auto;
  left: 0 !important;
  width: 24px;
  transform: none !important;
}

body[data-page="home"] .home-share-composer {
  width: calc(100% - 36px);
  min-height: 56px;
  margin: 0 auto 8px;
  padding: 8px 10px;
  border-radius: 18px;
}

body[data-page="foodie"] #foodie-inline-list,
body[data-page="foodie"] #pet-inline-list:not(.hidden) {
  width: 100%;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 12px !important;
  padding: 12px 18px 18px !important;
}

body[data-page="foodie"] .foodie-waterfall .foodie-masonry-card {
  width: 100% !important;
  max-width: none !important;
}

body[data-page="foodie"] .foodie-waterfall .foodie-photo,
body[data-page="foodie"] .foodie-waterfall .square-photo {
  width: 100%;
  height: min(300px, 38dvh);
  aspect-ratio: auto;
}

.home-share-avatar {
  width: 36px;
  min-width: 36px;
  height: 36px;
}

.home-share-composer strong {
  min-width: 54px;
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 0 12px;
  border-radius: 17px;
}

.tabbar,
body[data-page="foodie"] .tabbar,
body[data-theme="dark"] .tabbar,
body[data-theme="dark"][data-page="foodie"] .tabbar {
  min-height: calc(48px + env(safe-area-inset-bottom)) !important;
  height: calc(48px + env(safe-area-inset-bottom)) !important;
  align-items: flex-start;
  padding: 0 12px env(safe-area-inset-bottom) !important;
}

.tabbar .tab,
.tabbar .tab[data-target] {
  width: auto !important;
  min-width: 62px !important;
  height: 48px !important;
  min-height: 48px !important;
  flex: 1 1 0;
  flex-direction: row;
  gap: 5px;
  padding: 0 !important;
  border-radius: 0 !important;
}

.tabbar .tab.active {
  background: transparent !important;
}

.tabbar .tab-icon,
.tabbar .tab-icon svg {
  width: 21px;
  height: 21px;
}

.tabbar .tab-label {
  font-size: 11px;
  line-height: 16px;
}

.account-drawer {
  right: auto !important;
  left: max(0px, calc((100vw - 390px) / 2)) !important;
  width: min(82vw, 312px);
  padding: max(18px, env(safe-area-inset-top)) 18px max(16px, env(safe-area-inset-bottom));
  color: var(--ink);
  background: var(--surface);
  box-shadow: 12px 0 28px rgba(37, 34, 31, .16);
  transform: translate3d(-102%, 0, 0);
}

.account-drawer-close {
  align-self: flex-end;
}

body[data-theme="dark"] .account-drawer {
  color: var(--ink);
  background: var(--surface);
}

.full-detail:not(.foodie-full-detail) .detail-scroll {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 12px 18px calc(76px + env(safe-area-inset-bottom));
}

.full-detail:not(.foodie-full-detail) .detail-photo-strip {
  order: 1;
  width: 100%;
  height: min(350px, 44dvh);
  margin: 0;
  border-radius: 18px;
}

.full-detail:not(.foodie-full-detail) .detail-post-copy {
  order: 2;
  padding: 10px 0 8px;
  border: 0;
}

.full-detail:not(.foodie-full-detail) .detail-post-copy .post-text {
  font-size: 16px;
  line-height: 23px;
}

.full-detail:not(.foodie-full-detail) .detail-post-meta {
  margin-top: 7px;
  font-size: 11px;
}

.full-detail:not(.foodie-full-detail) .detail-action-row {
  order: 3;
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--line);
}

.full-detail:not(.foodie-full-detail) .detail-action-row .reaction-bar,
.foodie-full-detail .detail-action-row .reaction-bar {
  justify-content: flex-start !important;
  margin-left: 0 !important;
}

.full-detail:not(.foodie-full-detail) .detail-comment-panel {
  order: 4;
  padding: 8px 0 24px;
}

.full-detail:not(.foodie-full-detail) .detail-comment-panel > h2 {
  margin-bottom: 10px;
}

.foodie-full-detail .detail-scroll {
  padding-right: 18px;
  padding-left: 18px;
}

.foodie-full-detail .detail-post-copy {
  padding-bottom: 8px;
}

.foodie-full-detail .detail-photo-strip.foodie-detail-media {
  height: min(388px, 49dvh);
  margin-top: 8px;
}

.foodie-full-detail .detail-action-row {
  margin-top: 4px;
  padding: 4px 0;
}

.foodie-detail-note {
  margin: 8px 0 14px;
  padding: 14px 16px;
}

#pet-profile-view .pet-overlay-header {
  min-height: 58px;
}

#pet-profile-view .pet-overlay-body {
  padding-top: 6px;
}

.pet-profile-hero-media {
  height: 222px;
}

.pet-profile-identity-row {
  min-height: 58px;
}

.pet-profile-type {
  margin-top: 10px;
}

.pet-profile-bio {
  min-height: 20px;
  margin-top: 7px;
}

.pet-profile-stats {
  margin-top: 12px;
}

.pet-recent-section {
  margin-top: 16px;
}

.pet-recent-section h3,
.pet-profile-management h3 {
  margin-bottom: 9px;
}

.pet-recent-media {
  height: 96px;
}

.pet-care-note {
  min-height: 58px;
  margin-top: 14px;
  padding: 10px 14px;
}

#conversation-message-form.conversation-composer,
.detail-bottom-form,
#private-message-form.chat-box {
  min-height: calc(64px + env(safe-area-inset-bottom));
  padding: 6px 8px max(6px, env(safe-area-inset-bottom));
}

#conversation-message-form.conversation-composer input[name="text"],
.detail-bottom-form input[name="text"],
#private-message-form.chat-box input[name="text"] {
  min-height: 52px;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 26px;
}

#conversation-message-form.conversation-composer .conversation-send-button,
.detail-bottom-form button[type="submit"],
#private-message-form.chat-box button[type="submit"] {
  width: 52px;
  min-width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  line-height: 1;
}

#conversation-message-form.conversation-composer .conversation-send-button::before,
.detail-bottom-form button[type="submit"]::before,
#private-message-form.chat-box button[type="submit"]::before {
  margin: 0 !important;
  transform: none !important;
}

.conversation-messages:not(.notification-list) .message-bubble,
.private-messages .message-bubble {
  min-height: 0 !important;
  padding: 8px 12px;
}

.composer-overlay-active .writer-editor {
  padding-bottom: 214px;
}

.composer-input-tools {
  display: grid;
  gap: 6px;
  padding: 7px 12px max(8px, env(safe-area-inset-bottom));
}

#image-viewer.image-viewer {
  color: var(--ink);
  background: var(--surface);
}

#image-viewer #viewer-image {
  background: var(--surface-strong);
}

#image-viewer .viewer-close,
#image-viewer .viewer-more,
#image-viewer .viewer-count,
#image-viewer .viewer-arrow {
  color: var(--ink);
}

#image-viewer .viewer-arrow {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

body[data-theme="dark"] #image-viewer.image-viewer {
  color: #f3efe8;
  background: #211f1c;
}

body[data-theme="dark"] #image-viewer #viewer-image {
  background: #292622;
}

body[data-theme="dark"] #image-viewer .viewer-close,
body[data-theme="dark"] #image-viewer .viewer-more,
body[data-theme="dark"] #image-viewer .viewer-count,
body[data-theme="dark"] #image-viewer .viewer-arrow {
  color: #f3efe8;
}

@media (min-width: 560px) {
  .phone-shell {
    border: 0 !important;
  }
}

/* Vedic is an in-shell screen: keep iOS rubber-banding and browser chrome from
   moving the underlying community or introducing horizontal drift. */
body.vedic-open {
  overflow: hidden !important;
  overscroll-behavior: none;
  touch-action: pan-y;
}

body.vedic-open .phone-shell {
  overflow: hidden !important;
  overscroll-behavior: none;
  touch-action: pan-y;
}

body.vedic-open .phone-shell > .page.ai-projects-page.active {
  grid-row: 1 / 3 !important;
  padding: 0 !important;
  overflow: hidden !important;
  overscroll-behavior: none;
  touch-action: pan-y;
}

body.vedic-open .phone-shell > .topbar {
  display: none !important;
}

.vedic-experience {
  right: 0 !important;
  left: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  overscroll-behavior: none;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  contain: layout paint;
}

.vedic-topbar,
body[data-theme="dark"] .vedic-topbar {
  background: var(--surface) !important;
  backdrop-filter: none;
}

.vedic-experience > * {
  max-width: 100%;
}

@supports (height: 100svh) {
  body.vedic-open .phone-shell {
    height: 100svh !important;
    min-height: 100svh !important;
    max-height: 100svh !important;
  }
}

/* On real phones the app uses the whole CSS viewport. The 390px presentation
   frame remains only for wider desktop windows. */
@media (max-width: 559px) {
  .phone-shell,
  body[data-page="foodie"] .phone-shell,
  body[data-theme="dark"] .phone-shell,
  body[data-theme="dark"][data-page="foodie"] .phone-shell {
    width: 100vw !important;
    max-width: none !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    border-radius: 0 !important;
  }
}

/* Detail galleries are content, not flexible spacer material. Safari otherwise
   shrinks a multi-image gallery to zero when a post has a long comment thread. */
.full-detail:not(.foodie-full-detail) .detail-photo-strip {
  flex: 0 0 auto;
  min-height: 1px;
}

.full-detail:not(.foodie-full-detail) .detail-photo-strip.multi .detail-photo-button {
  display: block;
  min-width: 0;
  overflow: hidden;
}

/* The Figma food gallery changed the outer height without changing its fixed
   136px rows. Let both rows stretch so the last pixels meet the container. */
.foodie-full-detail .detail-photo-strip.foodie-detail-media:not(.one) {
  grid-template-rows: repeat(2, minmax(0, 1fr));
  align-content: stretch;
}

.foodie-full-detail .detail-photo-strip.foodie-detail-media.two {
  grid-template-rows: minmax(0, 1fr);
}

/* Home publishing is a calm top-right action; the refresh affordance yields its slot. */
.publish-label-home,
.publish-label-life {
  display: none;
  line-height: 1;
}

body[data-page="home"] .publish-label-home,
body[data-page="foodie"] .publish-label-life {
  display: block;
}

body[data-page="home"] #refresh-button {
  visibility: hidden !important;
  pointer-events: none !important;
}

body[data-page="home"] .publish-fab {
  position: absolute !important;
  top: max(8px, env(safe-area-inset-top)) !important;
  right: 12px !important;
  bottom: auto !important;
  width: auto !important;
  min-width: 58px;
  height: 40px;
  display: grid !important;
  place-items: center;
  padding: 0 16px;
  border: 0;
  border-radius: 20px;
  color: var(--accent-contrast);
  background: var(--accent);
  box-shadow: none;
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
}

body[data-page="home"] .publish-fab:focus-visible {
  outline: 3px solid var(--focus-ring-color);
  outline-offset: 2px;
}

/* Feedback must remain visible above full-screen experiences and safety sheets. */
.toast {
  z-index: 200000 !important;
}

/* One horizontal content rail, shared with the Vedic experience (18px). */
body[data-page="home"] [data-page="home"] .feed-switch {
  width: auto !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
  padding-right: 18px !important;
  padding-left: 18px !important;
}

body[data-page="home"] #post-list,
body[data-page="home"] #following-post-list {
  width: auto !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
  padding-right: 18px !important;
  padding-left: 18px !important;
}

body[data-page="chat"] .conversation-search {
  padding-right: 18px !important;
  padding-left: 18px !important;
}

body[data-page="chat"] .conversation-group h2 {
  margin-right: 18px !important;
  margin-left: 18px !important;
}

body[data-page="chat"] .conversation-row,
body[data-theme="dark"][data-page="chat"] .conversation-row {
  padding-left: 18px !important;
}

/* Restore the pre-Figma post-media geometry; keep only the new interaction layer. */
body[data-page="home"] #post-list > .post-card.feed-post,
body[data-page="home"] #following-post-list > .post-card.feed-post,
body[data-page="me"] #my-post-list > .post-card.feed-post {
  overflow: visible;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: var(--surface) !important;
}

body[data-page="home"] .feed-post .post-images,
body[data-page="me"] .feed-post .post-images {
  width: calc(100% - 78px) !important;
  height: auto !important;
  margin: 9px 0 0 50px !important;
  padding: 0 !important;
  gap: 2px !important;
  overflow: hidden;
  border: 0 !important;
  border-radius: 12px !important;
  background: var(--surface-strong) !important;
}

body[data-page="home"] .feed-post .post-images.one,
body[data-page="me"] .feed-post .post-images.one {
  display: block !important;
  width: calc(100% - 94px) !important;
}

body[data-page="home"] .feed-post .post-images.one .post-image-button,
body[data-page="me"] .feed-post .post-images.one .post-image-button {
  display: block;
  width: 100%;
  height: auto !important;
  max-height: 300px !important;
  aspect-ratio: auto !important;
  border-radius: 0;
}

body[data-page="home"] .feed-post .post-images.one img,
body[data-page="me"] .feed-post .post-images.one img {
  display: block;
  width: 100%;
  height: auto !important;
  max-height: 300px !important;
  aspect-ratio: auto !important;
  object-fit: cover;
}

body[data-page="home"] .feed-post .post-images.multi,
body[data-page="me"] .feed-post .post-images.multi {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(2, clamp(104px, 26vw, 144px)) !important;
  height: auto !important;
}

body[data-page="home"] .feed-post .post-images.multi.two,
body[data-page="me"] .feed-post .post-images.multi.two {
  width: calc(100% - 62px) !important;
  grid-template-rows: clamp(132px, 35vw, 174px) !important;
}

body[data-page="home"] .feed-post .post-images.multi:not(.two) > :first-child,
body[data-page="me"] .feed-post .post-images.multi:not(.two) > :first-child {
  grid-row: 1 / 3;
}

body[data-page="home"] .feed-post .post-images.multi .post-image-button,
body[data-page="me"] .feed-post .post-images.multi .post-image-button,
body[data-page="home"] .feed-post .post-images.multi img,
body[data-page="me"] .feed-post .post-images.multi img {
  width: 100%;
  height: 100% !important;
  min-height: 0;
  aspect-ratio: auto !important;
  object-fit: cover;
}

.full-detail:not(.foodie-full-detail) {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.full-detail:not(.foodie-full-detail) .detail-post-copy {
  order: 1;
  padding: 10px 0 12px;
}

.full-detail:not(.foodie-full-detail) .detail-photo-strip {
  order: 2;
  width: 100%;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: transparent;
}

.full-detail:not(.foodie-full-detail) .detail-photo-strip.one {
  display: block;
  height: min(64vw, 280px);
  max-height: 38dvh;
  background: var(--surface-strong);
}

.full-detail:not(.foodie-full-detail) .detail-photo-strip.one .detail-photo-button {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 100%;
  background: transparent;
}

.full-detail:not(.foodie-full-detail) .detail-photo-strip.one img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}

.full-detail:not(.foodie-full-detail) .detail-photo-strip.multi {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 3px;
  height: min(72vw, 320px);
  max-height: none;
}

.full-detail:not(.foodie-full-detail) .detail-photo-strip.multi.two {
  grid-template-rows: minmax(0, 1fr);
  height: min(56vw, 250px);
}

.full-detail:not(.foodie-full-detail) .detail-photo-strip.multi:not(.two) > :first-child {
  grid-row: 1 / 3;
}

.full-detail:not(.foodie-full-detail) .detail-photo-strip.multi .detail-photo-button,
.full-detail:not(.foodie-full-detail) .detail-photo-strip.multi img {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  object-fit: cover;
}

/* Publishing lives only in the Life-page plus button. The timeline uses one content rail. */
body[data-page="home"] .home-share-composer {
  display: none !important;
}

body[data-page="home"] .feed-post .post-images,
body[data-page="me"] .feed-post .post-images,
body[data-page="home"] .feed-post .post-images.one,
body[data-page="me"] .feed-post .post-images.one,
body[data-page="home"] .feed-post .post-images.multi.two,
body[data-page="me"] .feed-post .post-images.multi.two {
  width: calc(100% - 28px) !important;
  margin-right: 14px !important;
  margin-left: 14px !important;
}

body[data-page="home"] .feed-post .feed-reaction-bar,
body[data-page="me"] .feed-post .feed-reaction-bar {
  width: calc(100% - 28px) !important;
  margin-right: 14px !important;
  margin-left: 14px !important;
  padding-right: 0 !important;
  padding-left: 0 !important;
}

/* One visible back control per layer; settings must fully cover the page below. */
.profile-settings-panel {
  z-index: 100400 !important;
  isolation: isolate;
  pointer-events: auto;
  color: var(--ink);
  background: var(--bg) !important;
}

body.settings-open .back-button:not(#profile-settings-close),
body.settings-open .conversation-back-button,
body.settings-open .detail-back,
body.settings-open .me-settings-open {
  visibility: hidden !important;
  pointer-events: none !important;
}

.back-button,
.conversation-back-button,
.detail-back {
  color: var(--accent) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.back-button::before,
.conversation-back-button::before,
.detail-back::before {
  content: none !important;
}

/* The arrow glyph is absolutely centered in every round send control. */
.comment-form > button[type="submit"],
.detail-bottom-form > button[type="submit"],
#conversation-message-form.conversation-composer > button[type="submit"],
#private-message-form.chat-box > button[type="submit"] {
  position: relative !important;
  display: grid !important;
  place-items: center !important;
  line-height: 1 !important;
}

.comment-form > button[type="submit"]::before,
.detail-bottom-form > button[type="submit"]::before,
#conversation-message-form.conversation-composer > button[type="submit"]::before,
#private-message-form.chat-box > button[type="submit"]::before {
  position: absolute !important;
  top: 50% !important;
  right: auto !important;
  bottom: auto !important;
  left: 50% !important;
  width: 1em;
  height: 1em;
  display: grid !important;
  place-items: center !important;
  margin: 0 !important;
  line-height: 1 !important;
  transform: translate(-50%, -53%) !important;
}

/* Mobile conversations use the full viewport and one warm off-white surface. */
body[data-page="chat"],
body[data-page="chat"] .phone-shell,
body[data-page="chat"] [data-page="chat"],
body[data-page="chat"].subpage .chat-thread,
body[data-page="chat"].subpage .conversation-topbar,
body[data-page="chat"].subpage .conversation-messages,
body[data-page="chat"] #conversation-message-form.conversation-composer {
  background: var(--bg) !important;
}

@media (max-width: 559px) {
  .profile-settings-panel,
  body[data-page="chat"].subpage .chat-thread,
  body[data-page="chat"] #conversation-message-form.conversation-composer {
    right: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    margin: 0 !important;
    border-right: 0 !important;
    border-left: 0 !important;
    border-radius: 0 !important;
  }

  .profile-settings-panel {
    transform: none !important;
  }

  body[data-page="chat"].subpage .conversation-messages {
    right: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    max-width: none !important;
  }
}

/* Real phones are wider than the 390px Figma canvas. Full-page layers must
   cover the live viewport; only modal sheets are allowed to reveal a backdrop. */
@media (max-width: 559px) {
  [data-page="writer"].composer-overlay-active,
  .publish-type-picker:not(.hidden),
  .post-detail-viewer:not(.hidden),
  .profile-settings-panel:not(.hidden),
  #pet-profile-view:not(.hidden),
  .favorites-viewer:not(.hidden),
  .draft-viewer:not(.hidden),
  .follow-list-viewer:not(.hidden),
  #image-viewer.image-viewer:not(.hidden),
  #pet-center:not(.hidden) {
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    height: 100dvh !important;
    min-height: 100dvh;
    margin: 0 !important;
    border-right: 0 !important;
    border-left: 0 !important;
    border-radius: 0 !important;
    transform: none !important;
    transition: none !important;
  }

  [data-page="writer"].composer-overlay-active,
  .publish-type-picker:not(.hidden),
  .post-detail-viewer:not(.hidden),
  .profile-settings-panel:not(.hidden),
  #pet-profile-view:not(.hidden),
  .favorites-viewer:not(.hidden),
  .draft-viewer:not(.hidden),
  .follow-list-viewer:not(.hidden),
  #pet-center:not(.hidden) {
    color: var(--ink) !important;
    background: var(--bg) !important;
  }

  .post-detail-viewer:not(.hidden) .full-detail,
  body[data-page="chat"].subpage .chat-thread {
    width: 100vw !important;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background: var(--bg) !important;
  }

  body.composer-overlay-open .composer-input-tools,
  body.detail-open .detail-bottom-form {
    right: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    margin: 0 !important;
    transform: none !important;
  }
}

/* Discovery and Life use the same quiet add action. */
body[data-page="home"] .publish-fab,
body[data-page="foodie"] .publish-fab {
  position: absolute !important;
  top: max(13px, env(safe-area-inset-top)) !important;
  right: 18px !important;
  bottom: auto !important;
  width: 38px !important;
  min-width: 38px !important;
  height: 38px !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center;
  border: 1px solid var(--line) !important;
  border-radius: 50% !important;
  color: var(--accent) !important;
  background: var(--surface-strong) !important;
  box-shadow: none !important;
  font-size: 22px !important;
  font-weight: 400 !important;
}

/* Every primary page mirrors the 48px bottom navigation rail. */
body:not(.subpage) .phone-shell > .topbar {
  min-height: var(--primary-tabbar-height) !important;
  height: var(--primary-tabbar-height) !important;
}

/* Discovery and Life share one publish color and one safe-area center line. */
body[data-page="home"] .publish-fab,
body[data-page="foodie"] .publish-fab {
  top: calc(max(10px, env(safe-area-inset-top)) + 5px) !important;
  color: #e05287 !important;
}

body[data-page="foodie"] .phone-shell > .topbar .shell-avatar-button {
  display: grid !important;
  flex: 0 0 auto;
}

/* All primary pages share exact avatar, Chinese title, and wordmark coordinates. */
body:not(.subpage) .phone-shell > .topbar {
  display: grid !important;
  grid-template-columns: 44px minmax(0, 1fr) 44px !important;
  align-items: center !important;
  justify-content: initial !important;
  gap: 10px !important;
  padding: 0 18px !important;
}

body:not(.subpage) .phone-shell > .topbar > div {
  grid-column: 2;
  width: auto !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: baseline;
  gap: 8px;
  justify-self: start;
  overflow: visible !important;
  text-align: left !important;
}

body:not(.subpage) .phone-shell > .topbar .topbar-wordmark {
  margin-left: 0;
}

body[data-page="foodie"] #page-title {
  min-width: 0;
  overflow: visible !important;
  white-space: nowrap !important;
}

.profile-settings-panel[data-drawer-entry="admin"] .settings-detail-view {
  height: calc(100% - 58px);
  overflow-y: auto;
  padding: 8px 0 calc(28px + env(safe-area-inset-bottom));
}

.profile-settings-panel[data-drawer-entry="admin"] .admin-panel {
  display: grid;
  gap: 18px;
  overflow: visible;
  margin: 0;
  padding: 0 14px 24px;
  border: 0;
  background: var(--bg);
}

.profile-settings-panel[data-drawer-entry="admin"] .admin-panel > .section-title,
.profile-settings-panel[data-drawer-entry="admin"] #admin-pet-review > .section-title {
  min-height: 46px;
  padding: 0;
}

.profile-settings-panel[data-drawer-entry="admin"] .report-list,
.profile-settings-panel[data-drawer-entry="admin"] .admin-user-list {
  padding: 0;
}

.profile-settings-panel[data-drawer-entry="admin"] #admin-pet-review {
  display: grid;
  gap: 10px;
}

body[data-theme="dark"] .profile-settings-panel[data-drawer-entry="admin"] .admin-panel {
  color: var(--ink);
  background: var(--bg);
}

.admin-permission-card {
  display: grid;
  gap: 14px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 16px;
  overflow: hidden;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.admin-permission-card > * {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.admin-permission-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-permission-heading h2 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 17px;
}

.admin-eyebrow {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .08em;
}

.admin-level-badge {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-light);
  font-size: 11px;
  font-weight: 700;
}

.admin-permission-table {
  display: grid;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.admin-permission-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 62px 72px;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 42px;
  box-sizing: border-box;
  border-top: 1px solid var(--line);
}

.admin-permission-row:first-child { border-top: 0; }
.admin-permission-row > * { min-width: 0; padding: 8px; }
.admin-permission-row > span { color: var(--muted); font-size: 12px; text-align: center; }
.admin-permission-row > span[aria-label="允许"] { color: #526a59; font-weight: 800; }
.admin-permission-row strong { color: var(--ink); font-size: 12px; font-weight: 600; line-height: 1.35; }
.admin-permission-header { min-height: 36px; background: var(--bg); }
.admin-permission-header > span { font-size: 10px; font-weight: 700; }
.admin-permission-card > p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.admin-user-management { display: grid; }

.profile-settings-panel[data-drawer-entry="admin"] .admin-panel > * {
  min-width: 0;
  max-width: 100%;
}

body[data-theme="dark"] .admin-permission-card,
body[data-theme="dark"] .admin-permission-table {
  border-color: var(--line);
  background: var(--surface);
}

@media (max-width: 370px) {
  .admin-permission-card { padding: 13px; }
  .admin-permission-row { grid-template-columns: minmax(0, 1fr) 54px 62px; }
  .admin-permission-row > * { padding: 7px 5px; }
  .admin-level-badge { max-width: 112px; white-space: normal; text-align: center; }
}

/* iOS date controls carry an intrinsic minimum width. Every birth-form row
   must yield to the same content rail instead of widening the form grid. */
#vedic-birth-form {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  grid-template-columns: minmax(0, 1fr);
}

#vedic-birth-form > *,
#vedic-birth-form > label:not(.vedic-consent),
#vedic-birth-form .vedic-date-field {
  min-width: 0;
  max-width: 100%;
}

#vedic-birth-form .vedic-date-field input[name="birthDate"] {
  display: block;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box;
  text-align: center;
}

#vedic-birth-form .vedic-date-field input[name="birthDate"]::-webkit-date-and-time-value {
  width: 100%;
  margin: 0;
  text-align: center;
}

#vedic-birth-form .vedic-date-field input[name="birthDate"]::-webkit-datetime-edit {
  width: 100%;
  padding: 0;
  text-align: center;
}

/* The account sheet belongs to the viewport edge, including wider mobile
   browsers whose app canvas is centered inside the page. */
.account-drawer {
  left: 0 !important;
}

/* Life navigation and its guidance are two separate surfaces. Keep the
   selection stroke inside the tab rail and give the notice its own inset card. */
body[data-page="foodie"] .foodie-inline-header {
  gap: 10px;
  padding-bottom: 12px;
  background: var(--surface);
}

body[data-page="foodie"] .foodie-inline-header > .foodie-section-switch {
  min-height: 50px;
  height: 50px;
  margin: 0;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

body[data-page="foodie"] .foodie-section-switch .feed-switch-button {
  height: 50px;
}

body[data-page="foodie"] .foodie-section-switch .feed-switch-button::after {
  right: auto;
  bottom: 5px;
  left: 50%;
  width: 44px;
  height: 3px;
  transform: translateX(-50%) scaleX(.35);
}

body[data-page="foodie"] .foodie-section-switch .feed-switch-button.active::after {
  transform: translateX(-50%) scaleX(1);
}

body[data-page="foodie"] .foodie-inline-header .foodie-guide:not(.hidden) {
  width: calc(100% - 36px);
  min-height: 44px;
  margin: 0 18px !important;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--mint) 18%, transparent);
  border-radius: 12px;
  color: var(--mint);
  background: var(--mint-soft);
  line-height: 20px;
}

body[data-theme="dark"][data-page="foodie"] .foodie-inline-header > .foodie-section-switch {
  border-bottom-color: var(--line);
  background: var(--surface);
}

/* Food-detail copy matches the drawer's readable 17px scale without taking
   on the drawer label's bold weight. */
.foodie-full-detail .detail-post-copy .post-text {
  font-size: 17px;
  font-weight: 400;
  line-height: 29px;
}

/* Secondary navigation: every pushed page owns one stable title bar. */
.profile-self-topbar,
.private-topbar {
  position: sticky;
  top: 0;
  z-index: 120;
  min-height: calc(64px + env(safe-area-inset-top));
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  align-items: center;
  padding: env(safe-area-inset-top) 8px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.profile-self-topbar > .app-back-button,
.private-topbar > .app-back-button {
  grid-column: 1;
  grid-row: 1;
}

.profile-self-topbar > strong,
.private-topbar > .private-header {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.profile-self-topbar > strong {
  overflow: hidden;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-self-topbar > .me-settings-open,
.private-topbar > span {
  grid-column: 3;
  grid-row: 1;
}

.profile-self-topbar > .me-settings-open {
  position: static;
  width: 56px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: right;
}

.private-topbar .private-header {
  position: static;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.private-topbar .private-header .avatar {
  width: 34px;
  min-width: 34px;
  height: 34px;
}

.private-topbar .private-header > div {
  min-width: 0;
  overflow: hidden;
}

.private-topbar .private-header strong,
.private-topbar .private-header .meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* One compact, language-independent back affordance with a full 44px hit area. */
.app-back-button,
.back-button.app-back-button,
.conversation-back-button.app-back-button,
.detail-back.app-back-button {
  position: relative;
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  overflow: hidden;
  justify-self: start;
  padding: 0 !important;
  border: 0 !important;
  color: var(--accent) !important;
  background: transparent !important;
  font-size: 0 !important;
  line-height: 0 !important;
  text-indent: -9999px;
}

.app-back-button::before,
.back-button.app-back-button::before,
.conversation-back-button.app-back-button::before,
.detail-back.app-back-button::before {
  content: "" !important;
  position: absolute;
  top: 50%;
  left: 14px;
  width: 11px;
  height: 11px;
  display: block !important;
  color: inherit !important;
  border: 0;
  border-bottom: 2px solid currentColor;
  border-left: 2px solid currentColor;
  transform: translateY(-50%) rotate(45deg);
  transform-origin: center;
}

body[data-page="user"] .visitor-profile-topbar .back-button.app-back-button::before {
  content: "" !important;
  color: inherit !important;
}

.app-back-button:focus-visible {
  outline: 2px solid var(--focus-ring-color);
  outline-offset: -4px;
  border-radius: 12px;
}

/* A normal conversation ends exactly where its fixed composer begins. */
body[data-page="chat"].subpage .conversation-messages:not(.notification-list),
body[data-theme="dark"][data-page="chat"].subpage .conversation-messages:not(.notification-list) {
  top: calc(env(safe-area-inset-top) + 64px) !important;
  bottom: calc(var(--keyboard-offset, 0px) + var(--conversation-composer-height, 62px)) !important;
  height: auto !important;
  max-height: none !important;
}

body[data-theme="dark"] .profile-self-topbar,
body[data-theme="dark"] .private-topbar {
  background: color-mix(in srgb, var(--bg) 94%, transparent);
}

/* Pet discovery keeps the two-column rhythm without letting portraits dominate a card. */
body[data-page="foodie"] #pet-inline-list:not(.hidden) .pet-masonry-card .foodie-photo,
body[data-page="foodie"] #pet-inline-list:not(.hidden) .pet-masonry-card .square-photo {
  width: 100%;
  height: min(200px, 25dvh) !important;
  min-height: 0 !important;
  aspect-ratio: auto !important;
  overflow: hidden;
}

body[data-page="foodie"] #pet-inline-list:not(.hidden) .pet-masonry-card .foodie-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The three publishing selectors share the available row instead of widening it. */
.composer-input-tools .composer-meta-tools {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(68px, .65fr) minmax(84px, .8fr);
  gap: 7px;
  overflow: hidden;
}

.composer-input-tools .composer-meta-tools > *,
.composer-input-tools .pet-identity-chip,
.composer-input-tools .composer-topic-chip,
.composer-input-tools #comment-policy-trigger {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.composer-input-tools .composer-meta-tools select,
.composer-input-tools .composer-meta-tools span:last-child {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-follow-slot {
  width: 0;
  min-width: 0;
}

.detail-follow.active-follow {
  color: var(--muted);
  background: var(--surface-strong);
}

/* Every drawer label starts on one immutable text rail. Icon artwork may have
   different internal whitespace, so it is centered inside a shared slot. */
.account-drawer-menu button,
.account-drawer-footer button,
.account-drawer-menu #account-drawer-drafts {
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 16px;
}

.account-drawer-menu #account-drawer-drafts {
  grid-template-columns: 28px minmax(0, 1fr) auto;
}

.account-drawer-menu button > svg,
.account-drawer-footer button > svg,
.account-drawer-menu button > .pet-menu-icon {
  justify-self: center;
}

.account-drawer-menu button > span:not(.pet-menu-icon),
.account-drawer-footer button > span {
  grid-column: 2;
  justify-self: start;
  margin: 0;
}

.account-drawer-menu button > .pet-menu-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  line-height: 1;
}

/* Closed registration and recommendation workflow */
.auth-panel .segmented:has([data-auth-mode="apply"]) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.auth-panel .segmented:has([data-auth-mode="apply"]) .segment { padding-inline: 8px; font-size: 13px; }
.registration-application-fields { margin-top: 18px; }
.registration-application-fields textarea { resize: vertical; min-height: 112px; }
.auth-flow-heading { display: grid; gap: 6px; padding: 14px 15px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.auth-flow-heading strong { color: var(--ink); font-size: 16px; }
.auth-flow-heading span { color: var(--muted); font-size: 12px; line-height: 1.55; }
.auth-success-card { padding: 20px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: 18px; background: var(--surface); }
.auth-success-card strong { color: var(--ink); font-size: 18px; }
.auth-success-card p { margin: 10px 0 0; color: var(--muted); line-height: 1.65; }
.recommendation-menu-icon { display: inline-grid; place-items: center; width: 24px; font-size: 18px; }
.recommendation-body { display: grid; align-content: start; gap: 16px; }
.recommendation-intro { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.recommendation-intro p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.recommendation-list, .admin-registration-application-list, .admin-registration-code-list { display: grid; gap: 12px; }
.recommendation-card, .admin-registration-card { padding: 17px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-soft); }
.recommendation-card header, .admin-registration-card header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.recommendation-card header > div, .admin-registration-card header > div { display: grid; gap: 3px; min-width: 0; }
.recommendation-card header span, .recommendation-card time, .admin-registration-card header span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.recommendation-card dl, .admin-registration-card dl { display: grid; gap: 10px; margin: 16px 0; }
.recommendation-card dl > div, .admin-registration-card dl > div { display: grid; gap: 4px; }
.recommendation-card dt, .admin-registration-card dt { color: var(--muted); font-size: 11px; }
.recommendation-card dd, .admin-registration-card dd { margin: 0; color: var(--ink); font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.recommendation-card label, .admin-registration-card label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; }
.recommendation-card textarea, .admin-registration-card textarea { width: 100%; box-sizing: border-box; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--bg); color: var(--ink); resize: vertical; }
.submitted-recommendation { padding: 13px; border-radius: 14px; background: var(--bg); }
.submitted-recommendation p { margin: 7px 0 0; color: var(--muted); line-height: 1.6; white-space: pre-wrap; }
.admin-registration-management { display: grid; gap: 14px; margin-bottom: 20px; }
.admin-registration-card header b { flex: none; padding: 5px 9px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); font-size: 11px; }
.registration-code-generator { padding: 14px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); }
.registration-code-generator summary { cursor: pointer; color: var(--ink); font-weight: 700; }
.registration-code-generator form { margin-top: 14px; }
.registration-code-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.registration-code-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.registration-code-row > div { display: grid; gap: 3px; min-width: 0; }
.registration-code-row strong { letter-spacing: 1px; }
.registration-code-row span, .registration-code-row small { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }

@media (max-width: 380px) {
  .auth-panel .segmented:has([data-auth-mode="apply"]) .segment { font-size: 12px; padding-inline: 4px; }
  .registration-code-fields { grid-template-columns: 1fr; }
}

/* HER HAVEN application landing and member entry */
#app > .auth-screen {
  --auth-paper: #fcf8f3;
  --auth-paper-deep: #e9e3d9;
  --auth-ink: #292522;
  --auth-muted: #756b64;
  --auth-wine: #a94e6a;
  --auth-wine-dark: #84394f;
  --auth-sage: #718a78;
  --auth-night: #263446;
  --auth-line: rgba(66, 51, 44, 0.15);
  --auth-serif: "Songti SC", "STSong", "Noto Serif SC", serif;
  position: relative;
  display: block;
  padding: 0;
  background: var(--auth-paper);
  color: var(--auth-ink);
  line-height: 1.7;
  scroll-behavior: smooth;
}

/* The selected hero scene also sets the color atmosphere for the whole
   application page, including the closing invitation and footer. */
#app > .auth-screen[data-auth-theme="classic"] {
  --auth-night: #263446;
  --auth-wine: #a94e6a;
  --auth-wine-dark: #84394f;
}

#app > .auth-screen[data-auth-theme="almond"] {
  --auth-night: #285351;
  --auth-wine: #b65f73;
  --auth-wine-dark: #914658;
}

.auth-landing-nav {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 50%;
  width: min(1180px, calc(100% - 48px));
  height: 92px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
}

.auth-wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  letter-spacing: 0.18em;
}

.auth-wordmark > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  font-family: var(--auth-serif);
  font-size: 18px;
}

.auth-wordmark strong { font-size: 13px; line-height: 1.2; }
.auth-wordmark small { display: block; margin-top: 4px; color: rgba(255, 255, 255, 0.62); font-size: 9px; font-weight: 400; letter-spacing: 0.12em; }
.auth-member-login { border: 0; padding: 11px 0; background: transparent; color: #fff; font-size: 14px; }
.auth-member-login span { margin-left: 8px; }

.auth-hero {
  position: relative;
  width: 100%;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 130px max(24px, calc((100% - 1180px) / 2)) 150px;
  color: #fff;
  background: var(--auth-night);
}

.auth-hero::before { content: ""; position: absolute; z-index: 1; inset: 0; background: linear-gradient(90deg, rgba(22, 31, 45, 0.92), rgba(27, 38, 54, 0.76) 38%, rgba(27, 38, 54, 0.12) 68%, rgba(27, 38, 54, 0.18)); transition: background 700ms ease; pointer-events: none; }
.auth-hero::after { content: ""; position: absolute; z-index: 1; inset: auto 0 0; height: 24%; background: linear-gradient(transparent, var(--auth-paper)); pointer-events: none; }
.auth-hero[data-background-theme="almond"]::before { background: linear-gradient(90deg, rgba(23, 57, 59, 0.9), rgba(34, 79, 77, 0.72) 39%, rgba(28, 89, 84, 0.16) 70%, rgba(21, 58, 57, 0.12)); }
.auth-hero-art { position: absolute; z-index: 0; inset: 0; overflow: hidden; background: var(--auth-night); }
.auth-hero-bg { position: absolute; inset: -4%; opacity: 0; background-position: center; background-size: cover; transform: scale(1.04); transition: opacity 900ms ease; will-change: opacity, transform; }
.auth-hero-bg.is-active { opacity: 1; }
.auth-hero-bg-classic { background-image: url("/assets/her-haven-application-hero-v1.webp"); }
.auth-hero-bg-almond { background-image: none; }
.auth-hero-bg-classic.is-active { animation: authClassicDrift 17s ease-in-out infinite alternate; }
.auth-hero-bg-almond.is-active { animation: authAlmondDrift 16s ease-in-out infinite alternate; }
@keyframes authClassicDrift { from { transform: scale(1.04) translate3d(0, 0, 0); } to { transform: scale(1.09) translate3d(-1.3%, -0.7%, 0); } }
@keyframes authAlmondDrift { from { transform: scale(1.045) translate3d(0.8%, -0.4%, 0); } to { transform: scale(1.1) translate3d(-1.8%, 0.8%, 0); } }
.auth-hero-particles { position: absolute; z-index: 2; inset: 0; opacity: 0; transition: opacity 600ms ease; pointer-events: none; }
.auth-hero-particles i { position: absolute; left: var(--x); top: var(--y); display: block; opacity: 0; }
.auth-hero[data-background-theme="classic"] .auth-hero-particles { opacity: 0.58; }
.auth-hero[data-background-theme="classic"] .auth-hero-particles i { width: 3px; height: 3px; border-radius: 50%; background: rgba(255, 244, 224, 0.72); box-shadow: 0 0 8px rgba(255, 231, 190, 0.3); animation: authDustFloat calc(var(--duration) * 0.72) ease-in-out var(--delay) infinite alternate; }
.auth-hero[data-background-theme="almond"] .auth-hero-particles { opacity: 0.72; }
.auth-hero[data-background-theme="almond"] .auth-hero-particles i { width: 8px; height: 13px; border-radius: 80% 15% 75% 20%; background: rgba(255, 247, 232, 0.72); filter: blur(0.2px); animation: authPetalFall var(--duration) linear var(--delay) infinite; }
@keyframes authPetalFall { 0% { opacity: 0; transform: translate3d(0, -8vh, 0) rotate(0deg); } 12% { opacity: 0.78; } 75% { opacity: 0.46; } 100% { opacity: 0; transform: translate3d(8vw, 88vh, 0) rotate(420deg); } }
@keyframes authDustFloat { from { opacity: 0.12; transform: translate3d(-5px, 9px, 0) scale(0.65); } to { opacity: 0.78; transform: translate3d(10px, -14px, 0) scale(1.2); } }
.auth-hero-copy { position: relative; z-index: 2; width: min(590px, 58vw); }
.auth-eyebrow { display: flex; align-items: center; gap: 12px; margin: 0 0 23px; color: #ead7c7; font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; }
.auth-eyebrow::before { content: ""; width: 36px; height: 1px; background: currentColor; }
.auth-hero h1 { margin: 0; font-family: var(--auth-serif); font-size: clamp(48px, 6.1vw, 88px); font-weight: 500; line-height: 1.08; letter-spacing: -0.035em; }
.auth-lead { max-width: 530px; margin: 28px 0 0; color: rgba(255, 255, 255, 0.82); font-size: clamp(16px, 1.45vw, 20px); line-height: 1.95; }
.auth-hero-actions { display: flex; align-items: center; gap: 22px; margin-top: 38px; }
.auth-landing-primary { border: 0; border-radius: 2px; padding: 15px 24px; background: var(--auth-wine); color: #fff; box-shadow: 0 12px 30px rgba(68, 18, 34, 0.18); font-weight: 700; transition: transform 180ms ease, background 180ms ease; }
.auth-landing-primary:hover { transform: translateY(-2px); background: var(--auth-wine-dark); }
.auth-landing-primary:disabled, .auth-landing-primary.is-disabled { cursor: default; transform: none; background: rgba(169, 78, 106, 0.72); color: rgba(255, 255, 255, 0.84); box-shadow: none; }
.auth-hero-actions a { padding: 11px 0; border-bottom: 1px solid currentColor; color: #fff; text-decoration: none; font-size: 14px; }
.auth-trustline { display: flex; flex-wrap: wrap; gap: 9px 20px; margin-top: 36px; color: rgba(255, 255, 255, 0.62); font-size: 12px; }
.auth-trustline span::before { content: "·"; margin-right: 9px; color: #e0ad89; }
.auth-background-picker { position: absolute; z-index: 3; right: max(24px, calc((100% - 1180px) / 2)); bottom: 58px; display: flex; align-items: center; gap: 14px; padding: 10px 12px 9px 14px; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 3px; background: rgba(14, 24, 36, 0.45); box-shadow: 0 14px 34px rgba(7, 14, 23, 0.18); backdrop-filter: blur(14px); }
.auth-background-label { color: rgba(255, 255, 255, 0.62); font-size: 10px; font-weight: 700; letter-spacing: 0.15em; white-space: nowrap; }
.auth-background-options { display: flex; align-items: flex-start; gap: 7px; }
.auth-background-option { min-width: 48px; padding: 0; border: 0; background: transparent; color: rgba(255, 255, 255, 0.58); font: inherit; cursor: pointer; }
.auth-background-preview { position: relative; display: block; width: 46px; height: 32px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.26); border-radius: 2px; background-position: center; background-size: cover; transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease; }
.auth-background-preview-classic { background-image: url("/assets/her-haven-application-hero-v1.webp"); }
.auth-background-preview-almond { background-image: url("/assets/her-haven-bg-almond-thumb-v1.webp"); }
.auth-background-name { display: block; margin-top: 5px; font-size: 9px; letter-spacing: 0.04em; white-space: nowrap; }
.auth-background-option:hover .auth-background-preview { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.68); }
.auth-background-option.is-active { color: #fff; }
.auth-background-option.is-active .auth-background-preview { border-color: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28), 0 6px 16px rgba(0, 0, 0, 0.22); }
.auth-background-option[aria-busy="true"] .auth-background-preview { opacity: 0.58; }
.auth-background-option:focus-visible { outline: 2px solid #fff; outline-offset: 4px; border-radius: 2px; }
.auth-section-kicker { color: var(--auth-wine); font-size: 11px; font-weight: 700; letter-spacing: 0.22em; }

.auth-vision,
.auth-values,
.auth-before,
.auth-closing,
.auth-footer {
  content-visibility: auto;
}

.auth-vision,
.auth-values,
.auth-before { contain-intrinsic-size: auto 760px; }
.auth-closing { contain-intrinsic-size: auto 420px; }
.auth-footer { contain-intrinsic-size: auto 90px; }

.auth-vision { width: min(1060px, calc(100% - 48px)); margin: auto; padding: 100px 0 115px; display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 10vw; }
.auth-vision h2, .auth-before h2, .auth-values h2, .auth-closing h2 { margin: 17px 0; font-family: var(--auth-serif); font-size: clamp(34px, 4.3vw, 58px); font-weight: 500; line-height: 1.25; }
.auth-letter { padding-top: 22px; font-family: var(--auth-serif); font-size: clamp(20px, 2vw, 28px); line-height: 1.9; }
.auth-letter p { margin: 0 0 24px; }
.auth-letter small { display: block; color: var(--auth-muted); font-family: var(--font-sans); font-size: 14px; line-height: 1.75; }

.auth-values { padding: 100px 24px; background: var(--auth-paper-deep); text-align: center; }
.auth-values-inner { width: min(1120px, 100%); margin: auto; }
.auth-values h2 { margin-bottom: 54px; }
.auth-value-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(41, 37, 34, 0.22); border-bottom: 1px solid rgba(41, 37, 34, 0.22); text-align: left; }
.auth-value-grid article { min-height: 250px; padding: 38px 42px 44px; }
.auth-value-grid article + article { border-left: 1px solid rgba(41, 37, 34, 0.22); }
.auth-value-grid i { color: var(--auth-wine); font: italic 18px var(--auth-serif); }
.auth-value-grid h3 { margin: 34px 0 13px; font: 500 30px var(--auth-serif); }
.auth-value-grid p { margin: 0; color: var(--auth-muted); font-size: 14px; }

.auth-before { width: min(1100px, calc(100% - 48px)); margin: auto; padding: 120px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10vw; align-items: start; }
.auth-before > div { position: sticky; top: 40px; }
.auth-before > div > p { color: var(--auth-muted); }
.auth-before aside { margin-top: 34px; padding: 20px 0; border-top: 1px solid var(--auth-line); border-bottom: 1px solid var(--auth-line); color: var(--auth-muted); font-size: 13px; }
.auth-before aside strong { display: block; margin-bottom: 5px; color: var(--auth-ink); }
.auth-before ol { margin: 0; padding: 0; list-style: none; counter-reset: auth-step; }
.auth-before li { counter-increment: auth-step; display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto; column-gap: 18px; row-gap: 12px; padding: 24px 0; border-bottom: 1px solid var(--auth-line); }
.auth-before li::before { content: "0" counter(auth-step); grid-column: 1; grid-row: 1; align-self: baseline; color: var(--auth-wine); font: italic 16px var(--auth-serif); }
.auth-before li strong { grid-column: 2; grid-row: 1; align-self: baseline; margin: 0; font-size: 16px; line-height: 1.5; }
.auth-before li span { grid-column: 2; grid-row: 2; color: var(--auth-muted); font-size: 14px; line-height: 1.7; }

.auth-closing { position: relative; width: 100%; overflow: hidden; padding: 106px 24px 112px; background: var(--auth-night); color: #fff; text-align: center; transition: background-color 700ms ease; }
.auth-closing::before { content: "她"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -51%); color: rgba(255, 255, 255, 0.025); font: 400 300px var(--auth-serif); }
.auth-closing > * { position: relative; }
.auth-closing h2 { margin: 14px 0 18px; }
.auth-closing p { max-width: 600px; margin: 0 auto 30px; color: rgba(255, 255, 255, 0.68); }
.auth-footer { width: 100%; display: flex; justify-content: space-between; gap: 20px; padding: 26px max(24px, calc((100% - 1180px) / 2)); background: color-mix(in srgb, var(--auth-night) 86%, #000); color: rgba(255, 255, 255, 0.55); font-size: 11px; letter-spacing: 0.05em; transition: background-color 700ms ease; }
.auth-footer a { color: inherit; }

.auth-overlay { position: fixed; z-index: 200000; inset: 0; display: grid; place-items: center; padding: 16px; }
.auth-overlay-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgba(22, 28, 37, 0.74); backdrop-filter: blur(6px); }
.auth-panel { position: relative; z-index: 1; width: min(100%, 620px); max-height: calc(100dvh - 32px); overflow: auto; padding: 0; border: 0; border-radius: 2px; background: #fffdf9; box-shadow: 0 30px 100px rgba(18, 22, 28, 0.38); }
.auth-panel-header { position: sticky; z-index: 2; top: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: 24px 28px 18px; border-bottom: 1px solid var(--auth-line); background: rgba(255, 253, 249, 0.96); backdrop-filter: blur(10px); }
.auth-panel-header span { color: var(--auth-wine); font-size: 11px; font-weight: 700; letter-spacing: 0.18em; }
.auth-panel-header h2 { margin: 3px 0 0; font: 500 30px var(--auth-serif); }
.auth-panel-header button { width: 42px; height: 42px; border: 0; background: transparent; color: var(--auth-muted); font-size: 26px; }
.auth-panel #auth-form { padding: 26px 28px 30px; }
.auth-panel .segmented { border-radius: 3px; background: #efe8e2; }
.auth-panel .segment { border-radius: 2px; }
.auth-panel .segment.active { background: #fffdf9; box-shadow: 0 2px 10px rgba(52, 39, 32, 0.08); }
.auth-panel .field input, .auth-panel .field textarea, .auth-panel .field select { border-color: var(--auth-line); border-radius: 3px; background: #f7f2ec; }
.auth-panel .field input:focus, .auth-panel .field textarea:focus, .auth-panel .field select:focus { border-color: var(--auth-wine); box-shadow: 0 0 0 3px rgba(169, 78, 106, 0.12); }
.auth-panel .password-input-wrap { position: relative; display: block; }
.auth-panel .password-input-wrap input { width: 100%; padding-right: 62px; }
.auth-panel .password-visibility-toggle {
  position: absolute;
  right: 11px;
  bottom: 50%;
  min-width: 40px;
  min-height: 32px;
  padding: 0 5px;
  border: 0;
  color: var(--auth-wine);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.04em;
  transform: translateY(50%);
  cursor: pointer;
}
.auth-panel .password-visibility-toggle:hover { color: #713149; }
.auth-panel .password-visibility-toggle:focus-visible { outline: 2px solid var(--auth-wine); outline-offset: 2px; border-radius: 2px; }
.auth-panel .primary-button { border-radius: 2px; background: var(--auth-wine); }
.auth-panel .primary-button:hover { background: var(--auth-wine-dark); }
.auth-panel .tiny-note { color: var(--auth-muted); font-size: 12px; }
.auth-panel .registration-application-fields { margin-top: 16px; }
.auth-panel .auth-flow-heading { border-radius: 3px; background: #f4ebe7; }
.auth-panel .auth-success-card { border-radius: 3px; }
.auth-confirmation { display: flex; align-items: flex-start; gap: 10px; color: var(--auth-muted); font-size: 13px; line-height: 1.65; }
.auth-confirmation input { flex: 0 0 auto; margin-top: 5px; accent-color: var(--auth-wine); }
.auth-application-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.auth-application-grid .field:last-child { grid-column: 1 / -1; }
body.auth-modal-open { overscroll-behavior: none; }

@media (max-width: 760px) {
  .auth-landing-nav { width: calc(100% - 32px); height: 72px; }
  .auth-wordmark small { display: none; }
  .auth-member-login { font-size: 12px; }
  .auth-hero { min-height: 760px; align-items: flex-end; padding: 156px 18px 100px; }
  .auth-hero-bg { background-position: 63% center; }
  .auth-hero-bg-almond { background-position: 68% center; }
  .auth-hero::before { background: linear-gradient(180deg, rgba(28, 39, 54, 0.18), rgba(26, 36, 50, 0.55) 38%, rgba(24, 34, 48, 0.96) 78%, var(--auth-paper)); }
  .auth-hero[data-background-theme="almond"]::before { background: linear-gradient(180deg, rgba(20, 62, 63, 0.12), rgba(21, 65, 63, 0.5) 42%, rgba(17, 47, 49, 0.94) 78%, var(--auth-paper)); }
  .auth-background-picker { top: 82px; right: 14px; bottom: auto; gap: 8px; padding: 6px 8px; }
  .auth-background-label { display: none; }
  .auth-background-options { gap: 8px; }
  .auth-background-option { display: grid; min-width: 46px; min-height: 48px; place-items: center; touch-action: manipulation; }
  .auth-background-preview { width: 40px; height: 28px; }
  .auth-background-name { display: block; margin-top: 3px; font-size: 10px; line-height: 1; }
  .auth-hero-copy { width: 100%; }
  .auth-eyebrow { margin-bottom: 17px; }
  .auth-hero h1 { font-size: 48px; }
  .auth-lead { font-size: 15px; line-height: 1.8; }
  .auth-hero-actions { align-items: stretch; flex-direction: column; gap: 5px; }
  .auth-landing-primary { width: 100%; min-height: 50px; }
  .auth-hero-actions a { align-self: center; }
  .auth-trustline { justify-content: center; margin-top: 22px; }
  .auth-vision, .auth-before { width: calc(100% - 38px); grid-template-columns: 1fr; gap: 24px; padding: 74px 0; }
  .auth-vision { padding-top: 48px; }
  .auth-letter { padding-top: 0; }
  .auth-values { padding: 74px 19px; }
  .auth-values h2 { margin-bottom: 34px; }
  .auth-value-grid { grid-template-columns: 1fr; }
  .auth-value-grid article { min-height: 0; padding: 28px 8px; }
  .auth-value-grid article + article { border-top: 1px solid rgba(41, 37, 34, 0.22); border-left: 0; }
  .auth-value-grid h3 { margin: 16px 0 8px; }
  .auth-before > div { position: static; }
  .auth-closing { padding: 78px 20px; }
  .auth-footer { flex-direction: column; text-align: center; }
  .auth-overlay { align-items: end; padding: 0; }
  .auth-panel { width: 100%; max-height: 92dvh; border-radius: 14px 14px 0 0; }
  .auth-panel-header, .auth-panel #auth-form { padding-left: 20px; padding-right: 20px; }
  .auth-panel-header h2 { font-size: 27px; }
  .auth-application-grid { grid-template-columns: 1fr; }
  .auth-application-grid .field:last-child { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-hero-bg.is-active, .auth-hero-particles i { animation: none !important; }
  .auth-hero-bg, .auth-hero-particles { transition-duration: 0.01ms; }
}

@media (prefers-reduced-motion: reduce) {
  #app > .auth-screen { scroll-behavior: auto; }
  .auth-landing-primary { transition: none; }
}

/* Keep iOS Safari from inflating text differently between feed and full-page layers. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Figma final: discovery feed body copy. */
.feed-post .post-text {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 22px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Figma final: compact two-column life cards for food and pet posts. */
.foodie-text,
body[data-page="foodie"] .foodie-waterfall .foodie-short-review,
body[data-page="foodie"] .pet-masonry-card .foodie-text {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Figma final: generic and food post detail body copy. */
.detail-post-copy .post-text,
.foodie-full-detail .detail-post-copy .post-text {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 23px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Keep the trust marker attached to its label when the row wraps on narrow screens. */
.auth-trustline span {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  white-space: nowrap;
}

.auth-trustline span::before {
  flex: 0 0 auto;
}

/* The recommendation destination follows the drawer's icon / label / badge rail. */
.account-drawer-menu #account-drawer-recommendations {
  grid-template-columns: 28px minmax(0, 1fr) auto;
  grid-template-rows: 1fr;
}

#account-drawer-recommendations > svg,
#account-drawer-recommendations > span,
#account-drawer-recommendations > small {
  grid-row: 1;
  align-self: center;
}

#account-drawer-recommendations > small {
  grid-column: 3;
  min-width: 0;
  color: var(--accent);
  font-size: 12px;
  text-align: right;
}

/* Profile media editing follows the familiar crop-first flow used by mature social apps. */
.profile-edit-media {
  position: relative;
  min-height: 224px;
  display: block;
  padding: 14px 14px 22px;
}

.profile-edit-cover {
  width: 100%;
  display: block;
  color: var(--ink);
}

.profile-edit-cover-preview,
#profile-edit-cover-preview {
  width: 100%;
  height: 132px;
  border-radius: 14px;
  border-color: var(--line);
  background: linear-gradient(135deg, var(--accent-light), var(--surface-strong));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--surface) 28%, transparent);
}

.profile-edit-cover-copy {
  min-height: 52px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  margin-left: 108px;
  padding-top: 8px;
  text-align: left;
}

.profile-edit-cover-copy strong,
.profile-edit-avatar-copy strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

.profile-edit-cover-copy small,
.profile-edit-avatar-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.profile-edit-avatar {
  position: absolute;
  z-index: 2;
  left: 28px;
  top: 104px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-edit-avatar-preview,
#profile-edit-avatar-preview {
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  border: 3px solid var(--surface);
  box-shadow: 0 2px 10px rgba(30, 24, 27, 0.16);
}

.profile-edit-avatar-copy {
  display: none;
}

.profile-edit-avatar::after {
  content: "编辑";
  position: absolute;
  right: -4px;
  bottom: 0;
  min-width: 34px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border: 2px solid var(--surface);
  border-radius: 11px;
  color: #fff;
  background: var(--accent);
  font-size: 10px;
  font-weight: 650;
}

.profile-cropper {
  position: fixed;
  z-index: 2147483500;
  inset: 0;
  width: min(100%, 430px);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  color: #fff;
  background: #0e0d0e;
  overscroll-behavior: contain;
}

.profile-cropper.hidden {
  display: none;
}

body.profile-cropper-open {
  overflow: hidden;
  touch-action: none;
}

.profile-cropper-header {
  min-height: calc(58px + env(safe-area-inset-top));
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  align-items: end;
  padding: env(safe-area-inset-top) 8px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: #151315;
}

.profile-cropper-header strong {
  align-self: center;
  text-align: center;
  font-size: 16px;
  font-weight: 650;
}

.profile-cropper-header button {
  min-height: 42px;
  border: 0;
  color: rgba(255, 255, 255, 0.82);
  background: transparent;
  font-size: 14px;
}

#profile-cropper-confirm {
  color: #ff82ae;
  font-weight: 700;
}

.profile-cropper-stage {
  position: relative;
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
  background: #090809;
}

.profile-cropper-stage > img {
  display: block;
  max-width: 100%;
}

.profile-cropper .cropper-container {
  width: 100% !important;
  height: 100% !important;
}

.profile-cropper .cropper-view-box {
  outline: 2px solid rgba(255, 255, 255, 0.95);
  outline-color: rgba(255, 255, 255, 0.95);
  box-shadow: none;
}

.profile-cropper.avatar-crop .cropper-view-box,
.profile-cropper.avatar-crop .cropper-face {
  border-radius: 50%;
}

.profile-cropper .cropper-modal {
  background: #050505;
  opacity: 0.72;
}

.profile-cropper-hint {
  margin: 0;
  padding: 14px 18px 8px;
  color: rgba(255, 255, 255, 0.64);
  background: #151315;
  font-size: 12px;
  text-align: center;
}

.profile-cropper-zoom {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 10px;
  padding: 4px 24px 12px;
  color: rgba(255, 255, 255, 0.68);
  background: #151315;
  font-size: 18px;
}

.profile-cropper-zoom input {
  width: 100%;
  accent-color: #e35c8d;
}

.profile-cropper-tools {
  min-height: calc(66px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 0 18px env(safe-area-inset-bottom);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #151315;
}

.profile-cropper-tools button {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  color: rgba(255, 255, 255, 0.76);
  background: transparent;
  font-size: 12px;
}

.profile-cropper-tools button span {
  font-size: 20px;
}

/* A saved cover is part of the profile header for both the owner and visitors. */
body[data-page="me"] #profile-panel.has-cover {
  min-height: 202px;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  padding: 108px 18px 14px;
  background: var(--surface);
}

body[data-page="me"] #profile-panel.has-cover .profile-cover-layer,
body[data-page="user"] #user-profile-panel.has-cover #user-cover-layer {
  display: block !important;
  inset: 0 0 auto;
  width: 100%;
  height: 132px;
  border-radius: 0 0 16px 16px;
  opacity: 1;
  transform: none;
  background-size: cover;
  background-position: center;
  cursor: pointer;
}

body[data-page="me"] #profile-panel.has-cover #profile-avatar.avatar-large {
  width: 64px;
  min-width: 64px;
  height: 64px;
  border: 3px solid var(--surface);
  box-shadow: 0 2px 10px rgba(23, 19, 21, 0.18);
}

body[data-page="me"] #profile-panel.has-cover .profile-identity {
  align-self: end;
  padding-top: 24px;
}

body[data-page="user"] #user-profile-panel.has-cover {
  min-height: 214px;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: end;
  padding: 108px 16px 12px;
  background: var(--surface);
}

body[data-page="user"] #user-profile-panel.has-cover #user-avatar {
  width: 74px;
  height: 74px;
  border: 3px solid var(--surface);
  box-shadow: 0 2px 10px rgba(23, 19, 21, 0.18);
}

body[data-page="user"] #user-profile-panel.has-cover .profile-identity {
  align-self: end;
  padding-top: 26px;
}

body[data-theme="dark"] .profile-edit-cover-preview,
body[data-theme="dark"] #profile-edit-cover-preview {
  background: linear-gradient(135deg, #402531, #29272b);
}

/* The pushed self profile owns its safe area and title bar; never show the
   primary-page “我的” header above it. */
body[data-page="me"] .phone-shell {
  padding-top: 0 !important;
}

body[data-page="me"] .phone-shell > .topbar {
  display: none !important;
}

body[data-page="me"] .phone-shell > .page[data-page="me"].profile-page-active {
  top: 0 !important;
  height: 100dvh !important;
}

body[data-page="me"] .profile-self-topbar {
  position: sticky;
  top: 0;
}

/* Profile title bars use the same 48px content rail as the global bottom nav. */
body[data-page="me"] .profile-self-topbar,
body[data-page="user"] .visitor-profile-topbar {
  min-height: calc(var(--primary-tabbar-height) + env(safe-area-inset-top)) !important;
  height: calc(var(--primary-tabbar-height) + env(safe-area-inset-top)) !important;
  padding-top: env(safe-area-inset-top) !important;
  padding-bottom: 0 !important;
}

/* Covers are full-width media, so every edge follows the same square geometry. */
body[data-page="me"] #profile-panel.has-cover .profile-cover-layer,
body[data-page="user"] #user-profile-panel.has-cover #user-cover-layer {
  border-radius: 0 !important;
}

/* Reserve a complete row for the signature. It must never flow behind the
   overlapping avatar, even with long copy or a narrow phone viewport. */
body[data-page="me"] #profile-panel.has-cover,
body[data-page="user"] #user-profile-panel.has-cover {
  display: grid !important;
  grid-template-areas: none;
  grid-template-columns: 74px minmax(0, 1fr);
  grid-template-rows: 74px auto auto;
  align-items: start;
  gap: 0 14px;
  min-height: 238px;
  padding: 108px 18px 14px;
}

body[data-page="me"] #profile-panel.has-cover #profile-avatar,
body[data-page="user"] #user-profile-panel.has-cover #user-avatar {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  width: 74px;
  min-width: 74px;
  height: 74px;
  margin: 0;
}

body[data-page="me"] #profile-panel.has-cover .profile-identity,
body[data-page="user"] #user-profile-panel.has-cover .profile-identity {
  display: contents;
}

body[data-page="me"] #profile-panel.has-cover #profile-name,
body[data-page="user"] #user-profile-panel.has-cover #user-name {
  position: static;
  inset: auto;
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  min-width: 0;
  margin: 0;
}

body[data-page="user"] #user-profile-panel.has-cover #user-name {
  transform: translateY(-10px);
}

body[data-page="user"] #user-profile-panel.has-cover #user-handle {
  position: static;
  inset: auto;
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  min-width: 0;
  transform: translateY(17px);
}

body[data-page="me"] #profile-panel.has-cover #profile-bio,
body[data-page="user"] #user-profile-panel.has-cover #user-bio {
  position: static;
  inset: auto;
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  max-width: none;
  margin: 10px 0 0;
  overflow: visible;
  line-height: 1.55;
  text-overflow: clip;
  white-space: normal;
}

body[data-page="me"] #profile-panel.has-cover #profile-role,
body[data-page="user"] #user-profile-panel.has-cover #user-role {
  grid-column: 1 / -1;
  grid-row: 3;
  justify-self: start;
  margin-top: 8px;
}

/* Simplified composer: identity, visibility and one optional destination. */
.composer-input-tools .composer-meta-tools {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.25fr);
  overflow: visible;
}

.composer-input-tools .foodie-opt-in {
  cursor: pointer;
  justify-content: center;
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
}

.composer-input-tools .foodie-opt-in:has(input:checked) {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 62%, var(--line));
  background: var(--accent-light);
}

.plain-post-text {
  white-space: normal;
  overflow-wrap: anywhere;
}

.notification-settings-sheet {
  position: fixed;
  z-index: 1900;
  inset: 0;
  display: grid;
  align-items: end;
}

.notification-settings-sheet.hidden {
  display: none;
}

.notification-settings-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(12, 15, 20, 0.46);
}

.notification-settings-panel {
  position: relative;
  width: min(100%, 430px);
  max-height: min(88dvh, 760px);
  margin: 0 auto;
  overflow-y: auto;
  color: var(--ink);
  border-radius: 22px 22px 0 0;
  background: var(--surface);
  box-shadow: 0 -16px 48px rgba(22, 24, 30, 0.2);
  animation: conversation-sheet-in 160ms ease-out;
}

.notification-settings-panel > header {
  position: sticky;
  z-index: 1;
  top: 0;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  min-height: 56px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(16px);
}

.notification-settings-panel > header strong {
  text-align: center;
  font-size: 17px;
}

.notification-settings-panel > header button {
  min-height: 44px;
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  font: inherit;
  text-align: left;
}

.notification-settings-master,
.notification-settings-group {
  margin: 14px 14px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-strong);
}

.notification-settings-group:last-child {
  margin-bottom: max(22px, env(safe-area-inset-bottom));
}

.notification-settings-group h2 {
  margin: 0;
  padding: 11px 14px 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.notification-setting-row {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
}

.notification-settings-master .notification-setting-row,
.notification-settings-group h2 + .notification-setting-row {
  border-top: 0;
}

.notification-setting-row > span {
  display: grid;
  gap: 3px;
  min-width: 0;
  font-size: 15px;
}

.notification-setting-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.notification-setting-row input {
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  accent-color: var(--accent);
  cursor: pointer;
}

.notification-setting-row.master-disabled,
.notification-setting-row.locked {
  color: var(--muted);
}

body.notification-settings-open {
  overflow: hidden;
}

body[data-theme="dark"] .notification-settings-panel {
  background: #191e29;
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.42);
}

@media (min-width: 700px) {
  .notification-settings-sheet {
    align-items: center;
  }

  .notification-settings-panel {
    border-radius: 22px;
  }
}

/* 好友备注主页：身份信息保持一条清晰的纵向阅读路径。 */
body[data-page="user"] #user-profile-panel {
  display: grid !important;
  grid-template-columns: 74px minmax(0, 1fr);
  grid-template-rows: 74px auto auto auto;
  align-items: start;
  gap: 0 14px;
  min-height: 238px;
  padding: 108px 18px 14px;
  background: var(--surface);
}

body[data-page="user"] #user-profile-panel #user-cover-layer {
  height: 132px;
}

body[data-page="user"] #user-profile-panel #user-avatar {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  width: 74px;
  min-width: 74px;
  height: 74px;
  margin: 0;
  border-color: var(--surface);
}

body[data-page="user"] #user-profile-panel .profile-identity {
  display: contents;
}

body[data-page="user"] #user-profile-panel #user-name {
  position: static;
  inset: auto;
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  min-width: 0;
  margin: 0;
  transform: translateY(-10px);
}

body[data-page="user"] #user-profile-panel #user-handle {
  position: static;
  inset: auto;
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  min-width: 0;
  margin: 0;
  transform: translateY(17px);
}

body[data-page="user"] #user-profile-panel #user-handle.has-friend-remark {
  color: color-mix(in srgb, var(--accent) 82%, var(--ink));
  font-weight: 650;
}

.profile-name-rule {
  margin: -1px 14px 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

body[data-page="user"] #user-profile-panel #user-bio {
  position: static;
  inset: auto;
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  max-width: none;
  margin: 10px 0 0;
  overflow: visible;
  line-height: 1.55;
  text-overflow: clip;
  white-space: normal;
}

body[data-page="user"] #user-profile-panel #user-friend-note {
  grid-column: 1 / -1;
  grid-row: 3;
}

body[data-page="user"] #user-profile-panel #user-role {
  grid-column: 1 / -1;
  grid-row: 4;
  justify-self: start;
  margin-top: 8px;
}

body[data-theme="dark"] .visitor-profile-friend-note {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
  background: color-mix(in srgb, var(--accent-light) 18%, var(--surface));
}

/* Contribution and feedback surfaces keep the drawer focused on account-level work. */
.account-drawer-contribution {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 78px;
  margin: 18px 0 16px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 18px;
  color: var(--ink);
  background: color-mix(in srgb, var(--accent-light) 38%, var(--surface));
  text-align: left;
}

.account-drawer-contribution > span {
  display: grid;
  gap: 2px;
  min-width: 42px;
}

.account-drawer-contribution strong {
  font-size: 21px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.account-drawer-contribution small,
.account-drawer-contribution em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.account-drawer-contribution em {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-drawer-contribution b {
  color: var(--accent);
  font-size: 22px;
  font-weight: 400;
}

.account-drawer-menu {
  margin-top: 0;
}

.account-drawer-footer {
  margin-top: auto;
}

body.community-center-open {
  overflow: hidden;
}

.community-center {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(100%, 520px);
  margin: 0 auto;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 0 48px rgba(45, 31, 29, .12);
}

.community-center.hidden {
  display: none;
}

.community-center-header {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 72px;
  align-items: center;
  min-height: calc(56px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 12px 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
}

.community-center-header > strong {
  justify-self: center;
  font-size: 16px;
}

.community-center-header > button:last-child {
  justify-self: end;
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  color: var(--accent);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.community-center-body {
  display: grid;
  align-content: start;
  gap: 28px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 20px 16px calc(36px + env(safe-area-inset-bottom));
}

.points-hero {
  display: grid;
  justify-items: start;
  padding: 24px;
  border-radius: 24px;
  color: #3d2d2d;
  background: #f4e7df;
}

.points-hero > span {
  color: #876d69;
  font-size: 12px;
  letter-spacing: .08em;
}

.points-hero > strong {
  margin-top: 5px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 54px;
  font-weight: 500;
  line-height: 1;
}

.points-hero > p {
  margin: 10px 0 18px;
  color: #735e5a;
  font-size: 13px;
  line-height: 1.6;
}

.points-hero > button {
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 22px;
  color: #fff;
  background: #8d5e62;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.points-hero > button:disabled {
  color: #8b7773;
  background: rgba(255, 255, 255, .58);
}

.points-hero > .points-secondary-action {
  min-height: 36px;
  margin-top: 8px;
  padding: 0;
  color: #755257;
  background: transparent;
  font-size: 12px;
}

.community-section-heading span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .12em;
}

.community-section-heading h2 {
  margin: 5px 0 14px;
  font-size: 18px;
  font-weight: 720;
}

#points-rule-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

#points-rule-list article {
  display: grid;
  align-content: start;
  min-width: 0;
  min-height: 118px;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
}

#points-rule-list span {
  color: var(--muted);
  font-size: 11px;
}

#points-rule-list strong {
  margin: 8px 0;
  color: var(--accent);
  font-size: 21px;
}

#points-rule-list small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.points-daily-limit {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  color: #85425d;
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-strong));
  font-size: 12px;
  line-height: 1.6;
}

.points-policy-list {
  margin: 12px 0 0;
  padding: 2px 16px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
}

.points-policy-list li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.points-policy-list li:last-child {
  border-bottom: 0;
}

.points-policy-list li > span {
  padding-top: 2px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}

.points-policy-list li > div {
  min-width: 0;
}

.points-policy-list strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.points-policy-list p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.invitation-card-list,
.points-event-list,
.feedback-item-list,
.official-update-list {
  display: grid;
  gap: 10px;
}

.invitation-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
}

.invitation-card > div {
  display: grid;
  gap: 4px;
}

.invitation-card > div > span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 750;
}

.invitation-card > div > small,
.invitation-card > time {
  color: var(--muted);
  font-size: 11px;
}

.invitation-card form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.invitation-card input {
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  font-size: 12px;
}

.invitation-card form button {
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.points-event-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 54px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}

.points-event-list article > div {
  display: grid;
  gap: 4px;
}

.points-event-list time {
  color: var(--muted);
  font-size: 10px;
}

.points-event-list b {
  font-size: 16px;
}

.points-event-list .positive {
  color: #71845f;
}

.points-event-list .negative {
  color: #9a6670;
}

.community-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 28px 16px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

.community-empty strong {
  color: var(--ink);
  font-size: 13px;
}

.community-empty span {
  font-size: 11px;
  line-height: 1.5;
}

.feedback-welcome {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 18px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--accent-light) 42%, var(--surface-strong));
}

.feedback-team-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  color: #fff;
  background: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}

.feedback-welcome div {
  display: grid;
  gap: 6px;
}

.feedback-welcome p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.official-update-card,
.feedback-item-card {
  display: grid;
  gap: 9px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
}

.official-update-card > div,
.feedback-item-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 10px;
}

.official-update-card > div > span,
.feedback-item-card > header > span {
  color: var(--accent);
  font-weight: 750;
}

.official-update-card p,
.feedback-item-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.feedback-item-card aside {
  display: grid;
  gap: 5px;
  margin-top: 4px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface);
  font-size: 11px;
  line-height: 1.55;
}

.feedback-item-card aside b,
.feedback-item-card footer {
  color: var(--accent);
}

.feedback-item-card footer {
  font-size: 11px;
  font-weight: 700;
}

.feedback-compose-sheet {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  align-items: end;
  background: rgba(30, 22, 21, .28);
  backdrop-filter: blur(8px);
}

.feedback-compose-sheet.hidden {
  display: none;
}

.feedback-compose-sheet form {
  display: grid;
  gap: 16px;
  max-height: 92%;
  padding: 0 18px calc(24px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  color: var(--ink);
  background: var(--surface);
}

.feedback-compose-sheet header {
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  min-height: 58px;
}

.feedback-compose-sheet header strong {
  justify-self: center;
}

.feedback-compose-sheet header button {
  min-height: 44px;
  border: 0;
  color: var(--accent);
  background: transparent;
  font: inherit;
  font-size: 13px;
}

.feedback-compose-sheet header button:last-child {
  justify-self: end;
  font-weight: 750;
}

.feedback-compose-sheet label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.feedback-compose-sheet input,
.feedback-compose-sheet select,
.feedback-compose-sheet textarea {
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: var(--surface-strong);
  font: inherit;
  font-size: 13px;
  outline: none;
}

.feedback-compose-sheet textarea {
  min-height: 150px;
  resize: vertical;
}

.feedback-compose-sheet input:focus,
.feedback-compose-sheet select:focus,
.feedback-compose-sheet textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.feedback-compose-sheet form > p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.invitation-card-confirm-sheet {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  align-items: end;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  background: rgba(30, 22, 21, .32);
  backdrop-filter: blur(7px);
}

.invitation-card-confirm-sheet.hidden {
  display: none;
}

.invitation-card-confirm-sheet > section {
  display: grid;
  justify-items: center;
  padding: 24px 20px 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 18px 54px rgba(47, 31, 30, .2);
}

.invitation-card-confirm-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-size: 18px;
  font-weight: 800;
}

.invitation-card-confirm-sheet h2 {
  margin: 14px 0 7px;
  font-size: 19px;
}

.invitation-card-confirm-sheet p {
  max-width: 300px;
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
  line-height: 1.65;
}

.invitation-card-confirm-sheet > section > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-top: 20px;
}

.invitation-card-confirm-sheet button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 15px;
  color: var(--ink);
  background: var(--surface-strong);
  font: inherit;
  font-size: 14px;
  font-weight: 750;
}

#invitation-card-confirm {
  border-color: transparent;
  color: #fff;
  background: var(--accent);
}

#invitation-card-confirm:disabled {
  opacity: .62;
}

body[data-theme="dark"] .points-hero {
  color: #f0dfdc;
  background: #392d2d;
}

body[data-theme="dark"] .points-hero > span,
body[data-theme="dark"] .points-hero > p {
  color: #c8aaa6;
}

body[data-theme="dark"] .points-hero > button:disabled {
  color: #b59b97;
  background: rgba(255, 255, 255, .08);
}

body[data-theme="dark"] .points-hero > .points-secondary-action {
  color: #d3aaa9;
}

@media (max-width: 360px) {
  .account-drawer-contribution {
    gap: 9px;
    padding-inline: 12px;
  }

  #points-rule-list {
    grid-template-columns: 1fr;
  }

  #points-rule-list article {
    min-height: 86px;
  }
}

.admin-feedback-management,
.admin-feedback-list {
  display: grid;
  gap: 14px;
}

.admin-feedback-management.hidden {
  display: none;
}

.official-update-composer,
.admin-feedback-card {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
}

.official-update-composer summary {
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.official-update-composer[open] summary {
  margin-bottom: 14px;
}

.admin-feedback-card {
  display: grid;
  gap: 12px;
}

.admin-feedback-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.admin-feedback-card > header > div {
  display: grid;
  gap: 4px;
}

.admin-feedback-card > header span,
.admin-feedback-card > header b {
  color: var(--muted);
  font-size: 10px;
}

.admin-feedback-card > p {
  margin: 0;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.admin-feedback-card > label,
.admin-feedback-actions label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.admin-feedback-card select,
.admin-feedback-card textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  font-size: 12px;
}

.admin-feedback-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.admin-feedback-actions button {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  color: #fff;
  background: var(--accent);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
}

/* Administrator workspace: compact queues first, editing controls on demand. */
.profile-settings-panel[data-drawer-entry="admin"] .admin-panel {
  gap: 12px;
  padding-inline: 16px;
}

.admin-workspace-intro {
  display: grid;
  gap: 5px;
  padding: 8px 4px 10px;
}

.admin-workspace-intro > span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
}

.admin-workspace-intro > strong {
  font-size: 21px;
  letter-spacing: -.02em;
}

.admin-workspace-intro > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.admin-workspace-module {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface);
}

.admin-workspace-module.hidden {
  display: none;
}

.admin-workspace-module > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: center;
  min-height: 68px;
  padding: 0 14px 0 16px;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}

.admin-workspace-module > summary::-webkit-details-marker,
.admin-feedback-card > summary::-webkit-details-marker {
  display: none;
}

.admin-workspace-module > summary > span {
  display: grid;
  gap: 3px;
}

.admin-workspace-module > summary strong {
  color: var(--ink);
  font-size: 15px;
}

.admin-workspace-module > summary small {
  color: var(--muted);
  font-size: 10px;
}

.admin-workspace-module > summary > i,
.admin-feedback-card > summary > i {
  justify-self: end;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translate(-2px, 2px);
  transition: transform .18s ease;
}

.admin-workspace-module[open] > summary {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
}

.admin-workspace-module[open] > summary > i,
.admin-feedback-card[open] > summary > i {
  transform: rotate(225deg) translate(-2px, 2px);
}

.admin-module-content {
  padding: 14px;
}

.admin-module-content > .section-title {
  min-height: 36px !important;
  margin: 0 0 10px;
  justify-content: flex-end;
}

.admin-module-content > .section-title > h2,
.admin-module-content > .section-title > div {
  display: none;
}

.admin-feedback-overview {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 13px;
  background: var(--bg);
  color: var(--muted);
  font-size: 10px;
}

.admin-feedback-overview span {
  white-space: nowrap;
}

.admin-feedback-overview b {
  color: var(--ink);
  font-size: 15px;
}

.admin-feedback-overview small {
  justify-self: end;
  text-align: right;
  line-height: 1.35;
}

.admin-feedback-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  padding: 4px;
  border-radius: 13px;
  background: var(--bg);
}

.admin-feedback-filters button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  min-height: 36px;
  padding: 0 5px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 10px;
}

.admin-feedback-filters button.active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 5px rgba(44, 31, 29, .08);
  font-weight: 750;
}

.admin-feedback-filters button b {
  color: inherit;
  font-size: 10px;
}

.admin-feedback-list {
  gap: 8px;
}

.admin-feedback-card {
  --feedback-status: #8a817e;
  display: block;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  background: var(--surface);
}

.admin-feedback-card.status-received { --feedback-status: #b86655; }
.admin-feedback-card.status-reviewing { --feedback-status: #557ca4; }
.admin-feedback-card.status-planned { --feedback-status: #aa792f; }
.admin-feedback-card.status-adopted { --feedback-status: #4f8063; }
.admin-feedback-card.status-closed { --feedback-status: #7b7775; }

.admin-feedback-card > summary {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 10px;
  min-height: 70px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  -webkit-tap-highlight-color: transparent;
}

.admin-feedback-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--feedback-status);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--feedback-status) 13%, transparent);
}

.admin-feedback-card > summary > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.admin-feedback-card > summary strong,
.admin-feedback-card > summary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-feedback-card > summary strong {
  color: var(--ink);
  font-size: 13px;
}

.admin-feedback-card > summary span {
  color: var(--muted);
  font-size: 10px;
}

.admin-feedback-card > summary > b {
  padding: 5px 7px;
  border-radius: 999px;
  color: var(--feedback-status);
  background: color-mix(in srgb, var(--feedback-status) 11%, var(--surface));
  font-size: 9px;
  white-space: nowrap;
}

.admin-feedback-editor {
  display: grid;
  gap: 12px;
  padding: 2px 12px 14px 30px;
  border-top: 1px solid var(--line);
}

.admin-feedback-editor > p {
  margin: 12px 0 0;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.admin-feedback-editor > label,
.admin-feedback-editor .admin-feedback-actions label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

@media (max-width: 370px) {
  .admin-feedback-overview { grid-template-columns: auto auto; }
  .admin-feedback-overview small { display: none; }
  .admin-feedback-filters button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .admin-feedback-card > summary { grid-template-columns: 8px minmax(0, 1fr) 18px; }
  .admin-feedback-card > summary > b { display: none; }
  .admin-feedback-editor { padding-left: 12px; }
}

/* Moment feed: one, two, and three-image galleries share one stable frame. */
body[data-page="home"] .feed-post .post-images,
body[data-page="home"] .feed-post .post-images.one,
body[data-page="home"] .feed-post .post-images.multi.two {
  height: clamp(210px, calc(52vw + 2px), 290px) !important;
}

body[data-page="home"] .feed-post .post-images.one .post-image-button,
body[data-page="home"] .feed-post .post-images.one img {
  height: 100% !important;
  max-height: none !important;
}

body[data-page="home"] .feed-post .post-images.multi.two {
  grid-template-rows: 1fr !important;
}

[data-voice-message].recording,
[data-voice-comment].recording {
  color: #ffffff !important;
  background: #b84a62 !important;
  transform: scale(1.08);
  animation: voice-recording-pulse 1s ease-in-out infinite;
  touch-action: none;
}

@keyframes voice-recording-pulse {
  50% { box-shadow: 0 0 0 7px rgba(184, 74, 98, 0.16); }
}
