:root {
  --cream: #fafaf7;
  --white: #fff;
  --green: #63713e;
  --dark: #46552e;
  --yellow: #ffe8a3;
  --text: #252922;
  --muted: #65705b;
  --line: #e6e9df;
  --soft: #f0f3e9;
  --shadow: none;
  --radius: 22px;
  --social-stroke: #879467;
  --social-ease: cubic-bezier(.22, .68, 0, 1);
  --social-gutter: 20px;
}

html {
  background: #f1f2ed;
  scrollbar-color: #a3ae90 #f1f2ed;
  scrollbar-width: thin;
  scroll-padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
}

body {
  background: #f1f2ed;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

/* Apply to document, sheets, chat logs and horizontal activity lists. */
* {
  scrollbar-width: thin;
  scrollbar-color: #a3ae90 #f1f2ed;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f2ed; }
::-webkit-scrollbar-thumb { background: #a3ae90; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #7c895f; }

.app {
  max-width: 430px;
  padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px));
  background: var(--cream);
  box-shadow: none;
}

.app-header { padding: 0; }

/* Non-plaza tabs carry no visible header copy; only safe-area breathing room remains. */
html.bare-head .app-header { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
.placeholder-page { padding: 4px var(--social-gutter) 24px; }
.placeholder-hero { margin: 0; }

button, a, input, textarea, select {
  transition: background-color 180ms var(--social-ease),
    border-color 180ms var(--social-ease), color 180ms var(--social-ease);
}

button { min-height: 44px; }
button:disabled { opacity: .55; }

button:focus-visible, a:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}

button, a[href], input, textarea, select, [tabindex] { scroll-margin-block: 16px; }
#main-content:focus-visible { outline-offset: -3px; }
.skip-link {
  position: fixed;
  z-index: 1000;
  top: calc(16px + env(safe-area-inset-top, 0px));
  left: max(16px, calc((100vw - 430px) / 2 + 16px));
  max-width: calc(100vw - 32px);
  min-height: 44px;
  padding: 12px 16px;
  border: 2px solid var(--green);
  border-radius: 12px;
  background: var(--yellow);
  color: var(--dark);
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.skip-link:not(:focus-visible) {
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

button:not(:disabled):active { filter: brightness(.94); }
input, textarea, select { font-size: 16px; border-color: var(--social-stroke); }
input::placeholder, textarea::placeholder { color: #747b6c; opacity: 1; }
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] {
  border: 2px solid #963f35;
}

.primary, .secondary {
  min-height: 44px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: none;
}

.primary, .join { background: var(--green); }
.primary.danger, .danger { background: #faefeb; color: #963f35; }

/* Search first, then the four categories and the single message entry. */
#plaza-tools {
  padding: calc(20px + env(safe-area-inset-top, 0px)) var(--social-gutter) 0;
}

.search-row { gap: 8px; }
.search-box {
  width: 100%;
  min-height: 48px;
  gap: 4px;
  padding: 0 12px 0 16px;
  border: 1.5px solid var(--social-stroke);
  border-radius: 15px;
  background: #fff;
  box-shadow: none;
  transition: border-color 180ms var(--social-ease);
}

.search-box:focus-within { border-color: var(--green); outline: 2px solid var(--green); outline-offset: -2px; }
/* The container supplies the input's focus ring; the clear button keeps its own. */
.search-box input:focus-visible { outline: none; }
.search-box .clear-search:focus-visible { outline-offset: -3px; }
.search-box input {
  order: 0;
  flex: 1 1 0;
  min-width: 0;
  min-height: 46px;
  padding: 10px 0;
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.5;
}

/* hydrateIcons removes data-icon, so order the surviving wrapper, not that attribute. */
.search-box > span:not(.sr-only), .search-box > svg {
  order: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  color: #6b7659;
  pointer-events: none;
}

.search-box svg { width: 22px; height: 22px; color: inherit; }
.search-box .clear-search { order: 1; flex: 0 0 44px; border-radius: 10px; }
.search-box input::-webkit-search-cancel-button { -webkit-appearance: none; }

.community-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  min-width: 0;
}

.community-toolbar .tabs {
  flex: 1 1 0;
  min-width: 0;
  gap: 4px;
  margin: 0;
  padding: 0;
  border: 0;
}

.community-toolbar .tab {
  position: relative;
  isolation: isolate;
  flex: 1 1 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

/* A 32px painted pill inside a 44px touch target. */
.community-toolbar .tab::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 6px 0;
  border-radius: inherit;
  background: transparent;
  transition: background-color 180ms var(--social-ease);
}

.community-toolbar .tab.active { color: #fff; font-size: 14px; font-weight: 700; }
.community-toolbar .tab.active::before { background: #252723; }
.community-toolbar .tab.active::after { display: none; }

.message-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 12px;
  background: transparent;
  color: #30362a;
  box-shadow: none;
}

.message-button svg { width: 25px; height: 25px; }
.message-dot {
  width: 8px;
  height: 8px;
  top: 5px;
  right: 4px;
  border: 2px solid var(--cream);
  border-radius: 50%;
  background: var(--green);
}

#storage-state {
  min-height: 0;
  margin: 0;
  padding: 4px var(--social-gutter) 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

#plaza-tools #storage-state { padding-inline: 0; }
#storage-state.warning {
  margin: 4px var(--social-gutter) 10px;
  padding: 8px 12px;
  background: #fbf1df;
  color: #86591e;
  border-radius: 10px;
}

#plaza-tools #storage-state.warning { margin-inline: 0; padding-inline: 12px; }

/* One playful entry: copy on the left, a single decorative SVG on the right. */
.buddy-discovery { margin: 4px var(--social-gutter) 12px; }
.buddy-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(76px, 25vw, 112px);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 152px;
  padding: 16px;
  border: 1px solid #dce2c8;
  border-radius: 22px;
  background: #eef1df;
  color: var(--dark);
  text-align: left;
  white-space: normal;
  transition: background-color 200ms var(--social-ease),
    border-color 200ms var(--social-ease), transform 200ms var(--social-ease);
}

.buddy-entry-copy { order: 0; min-width: 0; overflow-wrap: anywhere; }
.buddy-eyebrow { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.buddy-entry-title { display: block; color: var(--dark); font-size: clamp(24px, 6.5vw, 28px); font-weight: 800; line-height: 1.2; letter-spacing: 0; }
.buddy-entry-subtitle { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.buddy-entry-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  min-height: 28px;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--dark);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.buddy-entry-cta svg { flex: 0 0 16px; width: 16px; height: 16px; transition: transform 200ms var(--social-ease); }
.buddy-entry-art { order: 1; display: block; width: 100%; min-width: 0; color: var(--dark); pointer-events: none; }
.buddy-entry-illustration { display: block; width: 100%; height: auto; aspect-ratio: 160 / 144; }
.buddy-entry:not(:disabled):active { background: #e2e9cf; border-color: var(--social-stroke); filter: none; transform: translateY(1px); }

/* Existing activities remain available when real records exist. */
@supports selector(:has(*)) {
  #activities-section:not(:has(.activity-card)) { display: none; }
}

.activities-section { padding-top: 0; }
.section-heading { padding-inline: var(--social-gutter); }
.section-heading .muted, .section-heading button { font-size: 12px; }
.activity-track {
  padding-inline: var(--social-gutter);
  scrollbar-width: thin;
  scrollbar-color: #a3ae90 #f1f2ed;
}
.activity-track::-webkit-scrollbar { display: block; height: 5px; }
.activity-card, .activity-card:nth-child(even) { background: var(--soft); border-color: #dce2cf; }
.activity-card { display: flex; flex-direction: column; flex-basis: min(272px, 82vw); padding: 0; }
.activity-link { display: block; flex: 1; padding: 12px 14px 8px; color: var(--text); }
.activity-link h3 { max-width: none; margin: 8px 0; font-size: 14px; }
.activity-card p { white-space: normal; overflow: visible; font-size: 12px; color: var(--muted); }
.activity-card .activity-account { margin-top: 4px; }
.activity-card .pill, .pill { font-size: 12px; }
.activity-source { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; padding: 8px 14px; border-top: 1px solid #dce2cf; color: var(--dark); font-size: 12px; text-align: left; }
.activity-source svg { width: 16px; height: 16px; }
.activity-link:hover, .activity-source:hover { background: #e7eddb; }
.activity-link:focus-visible, .activity-source:focus-visible { outline: 2px solid var(--dark); outline-offset: -3px; }
.activity-link:active, .activity-source:active { background: #dce5cc; }
.activity-track { scroll-padding-inline: var(--social-gutter); }

.feed-heading {
  flex-wrap: wrap;
  gap: 4px 12px;
  padding: 4px var(--social-gutter) 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.feed-heading .row { gap: 4px; }
.filter-description { padding: 4px var(--social-gutter) 8px; font-size: 12px; overflow-wrap: anywhere; }
.feed { gap: 16px; padding: 0 var(--social-gutter); }
.post {
  min-width: 0;
  padding: 18px 18px 6px;
  border: 1.5px solid var(--social-stroke);
  border-radius: 22px;
  background: #fff;
  box-shadow: none;
  transition: border-color 180ms var(--social-ease);
}

.post.flash { outline: 3px solid var(--green); outline-offset: 3px; }
.post-top { gap: 10px; align-items: center; }
.avatar { width: 44px; height: 44px; border: 1px solid #e4e8db; border-radius: 12px; background: #eeeadd; color: #716144; }
.avatar.sage { background: #e9eddf; color: #57693b; }
.avatar.rose { background: #f2e8e2; color: #865a48; }
.post-name { flex-wrap: wrap; gap: 2px 6px; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.post-meta { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.self-tag { font-size: 12px; color: var(--dark); }

.follow {
  position: relative;
  isolation: isolate;
  flex: 0 0 auto;
  min-width: 64px;
  min-height: 44px;
  gap: 3px;
  padding: 8px;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.follow::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 7px 0;
  border-radius: inherit;
  background: var(--green);
  transition: background-color 180ms var(--social-ease);
}

.follow.is-following { color: var(--dark); font-weight: 500; }
.follow.is-following::before { background: var(--soft); }
.follow svg { width: 13px; height: 13px; }
.post-tools { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.post-tools .follow { min-width: 56px; padding-inline: 6px; }
.post-dm { display: inline-flex; align-items: center; justify-content: center; gap: 3px; min-width: 54px; min-height: 44px; padding: 6px; border: 1px solid #dce2cf; border-radius: 999px; font-size: 12px; color: var(--dark); white-space: nowrap; }
.post-dm svg { width: 14px; height: 14px; }
.post-content { margin: 16px 0 12px; font-size: 16px; line-height: 1.75; color: var(--text); }
.post-tags { flex-wrap: wrap; gap: 4px 10px; margin-bottom: 12px; }
.post-tag, .post-tag.warm { padding: 0; background: none; border-radius: 0; color: #60713e; font-size: 12px; line-height: 1.5; }
.post-image { min-height: 44px; border-radius: 12px; background: var(--soft); }
.post-image::after { font-size: 12px; letter-spacing: 0; }
.image-fallback { font-size: 12px; line-height: 1.5; color: var(--muted); background: var(--soft); }
.achievement { border-color: #d5ddc9; background: #f6f7f2; border-radius: 12px; }
.achievement-label { font-size: 12px; }

.buddy-box { margin: 12px 0; padding: 12px; background: #f5f6f0; border-radius: 12px; }
.buddy-title { align-items: flex-start; font-size: 14px; line-height: 1.5; color: var(--dark); }
.buddy-title svg { margin-top: 3px; }
.buddy-detail, .buddy-members { color: var(--muted); font-size: 12px; line-height: 1.5; }
.buddy-detail svg { width: 15px; height: 15px; }
.buddy-bottom { margin-top: 8px; flex-wrap: wrap; }
.buddy-members strong { font-size: 12px; color: var(--dark); }

.post-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  min-height: 52px;
  margin-top: 12px;
  padding: 4px 0;
  border-top: 1px solid var(--line);
}

.post-action {
  min-height: 44px;
  min-width: 44px;
  gap: 5px;
  padding: 6px 0;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.post-action svg { width: 20px; height: 20px; }
.post-action.liked { color: var(--dark); }
.post-action.liked svg { fill: #e5ebd8; }
.post-action.chat, .post-footer > :not(button):last-child {
  min-width: 0;
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: right;
  overflow-wrap: anywhere;
}

.join {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
}

.post-footer > .join { margin-left: auto; }
.join svg { width: 18px; height: 18px; }
.join.joined { background: var(--soft); color: var(--dark); }
.feed-end { padding: 24px 16px; font-size: 12px; color: var(--muted); letter-spacing: 0; }

.empty { padding: 28px 20px; background: #fff; border-color: var(--social-stroke); color: var(--muted); }
.empty h3 { color: var(--text); line-height: 1.4; }
.empty p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.empty .empty-icon { width: 52px; height: 52px; border-radius: 16px; }
.empty-icon svg { color: var(--green); }

/* Quiet persistent navigation; no yellow message or publishing blocks. */
.bottom-nav {
  background: #fff;
  border-color: var(--line);
  border-radius: 0;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  backdrop-filter: none;
  box-shadow: none;
}

.nav-item { min-height: 52px; font-size: 12px; color: var(--muted); }
.nav-item .nav-icon { padding: 2px 14px; border-radius: 9px; }
.nav-item.active .nav-icon { color: var(--dark); background: var(--soft); }
.fab {
  right: max(20px, calc((100vw - 430px) / 2 + 20px));
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  width: 52px;
  height: 52px;
  border: 2px solid #fff;
  border-radius: 18px;
  background: var(--yellow);
  color: var(--dark);
  box-shadow: 0 4px 12px #38432524;
}

/* Shared sheets retain the existing script's native dialog and focus management. */
dialog {
  width: 100%;
  max-width: 430px;
  background: var(--cream);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -8px 32px #2529221f;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-padding-block: 80px calc(24px + env(safe-area-inset-bottom, 0px));
}

dialog::backdrop { background: #25292266; backdrop-filter: none; }
.sheet-handle { width: 32px; height: 4px; margin: 8px auto 2px; background: #cbd2bf; }
.sheet-head { gap: 12px; padding: 4px 16px 8px; border-color: var(--line); background: var(--cream); }
.sheet-head h2 { min-width: 0; font-size: 18px; line-height: 1.3; letter-spacing: 0; overflow-wrap: anywhere; }
.sheet-head > button { flex: 0 0 44px; }
.sheet-body { padding: 16px 20px calc(24px + env(safe-area-inset-bottom, 0px)); }
.sheet-feedback {
  flex-shrink: 0;
  min-width: 0;
  margin: 8px var(--social-gutter);
  padding: 10px 12px;
  border: 1px solid #dce2cf;
  border-radius: 10px;
  background: var(--soft);
  color: var(--dark);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  pointer-events: none;
}
.sheet-note, .field .hint, .counter, .comment-time, .end-note, .draft-image span { font-size: 12px; line-height: 1.5; }
.field { font-size: 14px; }
.field-title { gap: 8px; flex-wrap: wrap; }
.field input, .field textarea,
.input-send textarea { min-width: 0; font-size: 16px; }
.input-send textarea { line-height: 1.7; }
.image-tools button, .message-tabs button { min-height: 44px; font-size: 12px; }
.comment-item p, .chat-bubble { font-size: 15px; line-height: 1.7; }
.chat-bubble small { font-size: 12px; }
.comment-item strong, .message-item strong { font-size: 14px; line-height: 1.5; }
.message-item { gap: 12px; min-height: 64px; border-color: var(--line); border-radius: 8px; }
.message-item p { font-size: 12px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.message-item > svg { width: 18px; height: 18px; color: var(--muted); }
.liked-post-excerpt { display: block; margin: 6px 0; color: var(--muted); font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-item[data-action="discovery-detail"] { align-items: flex-start; }
.message-item[data-action="discovery-detail"] > .avatar, .message-item[data-action="discovery-detail"] > svg { flex-shrink: 0; }
.people-heading { margin: 20px 0 4px; font-size: 15px; font-weight: 700; line-height: 1.4; }
.sheet-body .people-hint { margin: 0 0 8px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.empty-chat { font-size: 14px; color: var(--muted); }
.toast { background: #39472af5; font-size: 14px; line-height: 1.5; transition: opacity 150ms var(--social-ease); }

/* Discovery: JS owns active-card transforms; CSS lifts real previews with --deck-progress. */
dialog[data-kind="buddy-discovery"] {
  inset: 0;
  width: 100%;
  max-width: 430px;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  margin: auto;
  padding: env(safe-area-inset-top, 0px) 0 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  overflow: hidden;
  overflow: clip;
  overscroll-behavior: contain;
}

dialog[data-kind="buddy-discovery"][open] { display: flex; flex-direction: column; }
dialog[data-kind="buddy-discovery"] .sheet-handle { display: none; }
dialog[data-kind="buddy-discovery"] .sheet-head {
  position: static;
  z-index: 4;
  flex: 0 0 auto;
  justify-content: flex-start;
  gap: 8px;
  padding: 4px 12px;
  border: 0;
  background: #fff;
}
dialog[data-kind="buddy-discovery"] .sheet-head > button { order: -1; width: 44px; height: 44px; }
dialog[data-kind="buddy-discovery"] .sheet-head > button svg { transform: rotate(180deg); }
dialog[data-kind="buddy-discovery"] .sheet-head h2 { margin: 0; font-size: 17px; line-height: 1.3; }
dialog[data-kind="buddy-discovery"] .sheet-feedback { margin: 4px 12px; padding: 8px 12px; font-size: 12px; }
dialog[data-kind="buddy-discovery"] .sheet-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  overflow: clip;
}
.discovery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0 16px;
}
.discovery-count { min-width: 0; color: var(--muted); font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.discovery-toolbar button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; gap: 6px; min-width: 44px; min-height: 44px; padding: 8px; border-radius: 10px; font-size: 12px; color: var(--dark); }
.discovery-toolbar button svg { width: 17px; height: 17px; }

/* The deck never scrolls or grows with its article; only .discovery-content scrolls. */
.swipe-stage {
  position: relative;
  isolation: isolate;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  margin: 4px 12px 18px;
  padding: 0;
  overflow: visible;
}
.swipe-underlay {
  position: absolute;
  z-index: 1;
  inset: 0;
  border: 1px solid #cbd3bd;
  border-radius: 16px;
  background: #e9eddf;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  transform-origin: 50% 100%;
  transform: translateY(calc(10px * (1 - var(--deck-progress, 0)))) scale(calc(.96 + .04 * var(--deck-progress, 0)));
  transition: transform 200ms var(--social-ease);
}
.swipe-underlay.is-next { z-index: 2; }
.swipe-underlay.is-far {
  transform: translateY(calc(18px - 8px * var(--deck-progress, 0))) scale(calc(.92 + .04 * var(--deck-progress, 0)));
}
.swipe-underlay > img { width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }
.swipe-underlay-label {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  padding: 24px 16px 16px;
  background: #e9eddf;
  color: var(--dark);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.swipe-underlay > img ~ .swipe-underlay-label { padding-top: 48px; background: linear-gradient(transparent, #172013d9 55%, #172013ed); color: #fff; }
.swipe-stage.is-advancing .swipe-underlay { --deck-progress: 1; }
.swipe-stage.is-advancing { pointer-events: none; }
.swipe-stage.is-dragging .swipe-underlay { transition: none; }
.swipe-card {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  border: 1px solid #cbd3bd;
  border-radius: 16px;
  background: var(--cream);
  overflow: hidden;
  overflow: clip;
  touch-action: pan-y pinch-zoom;
  cursor: grab;
  transform-origin: 50% 80%;
  transition: transform 200ms var(--social-ease), opacity 200ms var(--social-ease),
    border-color 200ms var(--social-ease);
}
.swipe-card:focus:not(:focus-visible) { outline: none; }
.swipe-card:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.swipe-card.is-leaving { transition: transform 200ms var(--social-ease), opacity 200ms var(--social-ease); pointer-events: none; }
.swipe-card.is-dragging, .swipe-stage.is-dragging .swipe-card { transition: none; cursor: grabbing; user-select: none; }
.swipe-post-card { padding: 0; overflow-wrap: anywhere; }

/* A separate, non-interactive rail cannot cover scrolled text or keyboard focus. */
.swipe-card-rail { flex: 0 0 3px; height: 3px; margin: 8px 12px 5px; border-radius: 999px; background: #dce2cf; overflow: hidden; pointer-events: none; user-select: none; }
.swipe-card-rail > span { display: block; max-width: 100%; height: 100%; border-radius: inherit; background: var(--green); pointer-events: none; }
.discovery-content {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  height: 100%;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-padding-block: 16px;
  overscroll-behavior: contain;
  touch-action: pan-y pinch-zoom;
  scrollbar-width: thin;
  scrollbar-color: #a3ae90 var(--cream);
}
.discovery-content::-webkit-scrollbar { width: 5px; }
.discovery-content::-webkit-scrollbar-track { background: var(--cream); }
.discovery-content::-webkit-scrollbar-thumb { background: #a3ae90; border-radius: 8px; }
.discovery-content::-webkit-scrollbar-thumb:hover { background: #7c895f; }
.swipe-post-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  min-height: 100%;
  background: #e9eddf;
}
.swipe-post-media { position: absolute; inset: 0; margin: 0; border-radius: 0; background: #e9eddf; }
.swipe-post-media > img { display: block; width: 100%; height: 100%; max-height: none; aspect-ratio: auto; border-radius: 0; object-fit: cover; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.swipe-post-header { position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; margin-top: auto; padding: 20px; }
.swipe-post-header .avatar { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; background: var(--cream); color: var(--dark); }
.swipe-post-header .grow { min-width: 0; }
.swipe-post-header h3 { margin: 0; color: var(--text); font-size: 18px; font-weight: 750; line-height: 1.4; overflow-wrap: anywhere; }
.swipe-post-header .post-meta { margin-top: 4px; font-size: 12px; line-height: 1.5; }
.swipe-post-hero.has-image .swipe-post-header { padding-top: 64px; background: linear-gradient(transparent, #172013d9 48px, #172013ed); }
.swipe-post-hero.has-image .swipe-post-header h3,
.swipe-post-hero.has-image .swipe-post-header .post-meta { color: #fff; }
.swipe-post-hero.is-text { min-height: 0; padding-top: 8px; background: #e9eddf; color: var(--dark); }
.swipe-text-art { display: flex; flex: 0 0 auto; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-width: 0; padding: 16px 24px; text-align: center; }
.swipe-text-art svg { width: 40px; height: 40px; color: var(--green); stroke-width: 1.4; }
.swipe-text-art small { font-size: 12px; line-height: 1.5; color: var(--dark); }
.swipe-text-art strong { max-width: 100%; font-size: clamp(28px, 8vw, 36px); font-weight: 750; line-height: 1.3; letter-spacing: .03em; overflow-wrap: anywhere; }
.swipe-post-hero.is-text .swipe-post-header { border-top: 1px solid #d4dcc6; }
.swipe-post-hero.is-text .swipe-post-header h3 { color: var(--dark); }
.swipe-post-copy { min-width: 0; padding: 20px 20px 24px; background: var(--cream); }
.swipe-post-card .post-content { display: block; height: auto; max-height: none; margin: 0 0 16px; overflow: visible; -webkit-line-clamp: unset; font-size: 16px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.swipe-post-card .post-tags { flex-wrap: wrap; gap: 4px 10px; }
.swipe-post-card .post-tag { min-width: 0; overflow-wrap: anywhere; }
.swipe-post-card .achievement { margin: 16px 0; }
.swipe-post-card .achievement img { display: block; width: 100%; height: auto; max-height: none; aspect-ratio: auto; border-radius: 12px; object-fit: contain; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.swipe-post-card .achievement-label { color: var(--muted); }
.swipe-post-card .buddy-box { margin: 16px 0; border: 1px solid var(--line); }
.swipe-post-card .buddy-title, .swipe-post-card .buddy-detail { min-width: 0; overflow-wrap: anywhere; }
.swipe-post-card .buddy-members { flex-wrap: wrap; gap: 4px; }
.swipe-post-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.swipe-post-stats > span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.swipe-post-stats svg { width: 16px; height: 16px; }
.swipe-post-stats .secondary { min-width: 44px; min-height: 44px; max-width: 100%; margin-left: auto; padding: 8px 12px; border: 1px solid var(--line); font-size: 12px; overflow-wrap: anywhere; }
.sheet-body .discovery-note { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.5; }

.swipe-feedback {
  position: absolute;
  z-index: 4;
  top: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: calc(50% - 20px);
  padding: 8px 10px;
  border: 2px solid currentColor;
  border-radius: 10px;
  background: var(--cream);
  font-size: 18px;
  font-weight: 750;
  line-height: 1.3;
  opacity: 0;
  pointer-events: none;
}
.swipe-feedback svg { width: 22px; height: 22px; }
.swipe-feedback.like { right: 12px; left: auto; color: var(--dark); opacity: var(--swipe-like, 0); }
.swipe-feedback.skip { left: 12px; right: auto; color: #705e50; background: #fff8e6; opacity: var(--swipe-skip, 0); }

/* Controls occupy their own row: no button overlaps scrollable copy or its focus ring. */
.discovery-controls {
  flex: 0 0 auto;
  min-width: 0;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px));
  border: 0;
  background: #fff;
}
.swipe-actions { display: grid; grid-template-columns: 72px 52px 72px; align-items: center; justify-content: center; gap: 24px; margin: 0; }
.swipe-actions button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 72px;
  height: 72px;
  min-width: 44px;
  min-height: 44px;
  padding: 6px;
  border: 1px solid var(--social-stroke);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
  box-shadow: 0 3px 10px #38432512;
  transition: background-color 180ms var(--social-ease), border-color 180ms var(--social-ease),
    color 180ms var(--social-ease), transform 180ms var(--social-ease);
}
.swipe-actions button:not(:disabled):active { transform: scale(.96); }
.swipe-actions button:disabled { box-shadow: none; }
.swipe-actions button > span { display: flex; align-items: center; justify-content: center; font-size: 12px; line-height: 1.5; }
.swipe-actions .swipe-pass { background: var(--cream); color: #606b54; }
.swipe-actions .swipe-undo { width: 52px; height: 52px; padding: 4px 2px; color: var(--dark); background: var(--yellow); border-color: #a18c51; box-shadow: none; }
.swipe-actions .swipe-like { background: var(--green); color: #fff; border-color: var(--green); }
.swipe-actions svg { width: 26px; height: 26px; }
.swipe-actions .swipe-undo svg { width: 18px; height: 18px; }
.sheet-body .swipe-hint { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; overflow-wrap: anywhere; }

/* Hover is only painted for devices with an actual hover-capable pointer. */
@media (hover: hover) and (pointer: fine) {
  .search-box:hover, input:not([aria-invalid="true"]):hover,
  textarea:not([aria-invalid="true"]):hover, select:not([aria-invalid="true"]):hover { border-color: var(--green); }
  .community-toolbar .tab:not(.active):hover::before { background: #e9edde; }
  .message-button:hover, .post-action:hover, .discovery-toolbar button:hover, .message-item:hover { background: var(--soft); }
  .buddy-entry:hover:not(:disabled):not(:active) { background: #e7edd5; border-color: var(--social-stroke); }
  .buddy-entry:hover:not(:disabled) .buddy-entry-cta svg { transform: translateX(2px); }
  .swipe-post-card:hover:not(.is-dragging):not(.is-leaving) { border-color: var(--green); }
  .post:hover { border-color: #738157; }
  .follow:not(.is-following):hover::before { background: #526033; }
  .follow.is-following:hover::before { background: #e2e8d6; }
  .primary:not(.danger):hover, .join:not(.joined):hover:not(:disabled), .swipe-actions .swipe-like:hover:not(:disabled) { background: #526033; }
  .fab:hover:not(:disabled) { background: #f5dda0; color: var(--dark); }
  .secondary:hover, .join.joined:hover, .swipe-actions .swipe-pass:hover, .swipe-actions .swipe-undo:hover:not(:disabled) { background: #e7ecde; }
  .post-image:hover { outline: 2px solid var(--social-stroke); outline-offset: 2px; }
}

@media (max-width: 359px) {
  :root { --social-gutter: 16px; }
  .app-header { padding: 0; }
  .community-toolbar { gap: 4px; }
  .community-toolbar .tabs { gap: 2px; }
  .community-toolbar .tab, .community-toolbar .tab.active { padding-inline: 6px; font-size: 13px; }
  .buddy-entry { grid-template-columns: minmax(0, 1fr) 76px; min-height: 148px; padding: 12px; }
  .buddy-entry-title { font-size: 24px; }
  .buddy-entry-cta { padding-inline: 8px; }
  .post { padding: 16px 14px 6px; }
  .post-top { gap: 8px; }
  .post-name { font-size: 14px; }
  .post-meta { font-size: 12px; }
  .follow { min-width: 60px; padding-inline: 6px; }
  .post-footer { column-gap: 8px; }
  .join { padding-inline: 10px; }
  .sheet-body { padding-inline: 16px; }
  .discovery-toolbar { padding-inline: 12px; }
  .swipe-stage { margin-inline: 8px; }
  .swipe-post-header { gap: 8px; padding-inline: 16px; }
  .swipe-post-copy { padding-inline: 16px; }
  .swipe-feedback { gap: 4px; padding: 8px; font-size: 16px; }
  .swipe-feedback svg { width: 18px; height: 18px; }
  .swipe-actions { gap: 20px; grid-template-columns: 64px 48px 64px; }
  .swipe-actions button { width: 64px; height: 64px; }
  .swipe-actions .swipe-undo { width: 48px; height: 48px; }
}

@media (min-width: 760px) {
  body { background: #f1f2ed; }
  .app { box-shadow: 0 0 0 1px #e0e5d6; }
  .app-header { padding: 0; }
  dialog { bottom: 16px; max-height: calc(100dvh - 32px); border-radius: 22px; }
  dialog[data-kind="buddy-discovery"] {
    inset: 16px 0;
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    border-radius: 20px;
    box-shadow: 0 8px 32px #2529221f;
  }
  .desktop-note { color: var(--muted); }
  .desktop-note p, .desktop-note ol, .desktop-note footer,
  .desktop-note .brand-en, .desktop-note .demo-pill { color: var(--muted); font-size: 12px; }
  .desktop-note h2 { color: var(--dark); line-height: 1.4; }
}

/* Short landscape viewports keep every action visible without scrolling the sheet. */
@media (max-height: 500px) {
  dialog[data-kind="buddy-discovery"] {
    inset: 0;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
  dialog[data-kind="buddy-discovery"] .sheet-head { padding-block: 0; }
  dialog[data-kind="buddy-discovery"] .sheet-head h2 { font-size: 16px; }
  dialog[data-kind="buddy-discovery"] .sheet-feedback { margin-block: 2px; padding: 4px 8px; }
  .discovery-toolbar { padding-inline: 12px; }
  .swipe-stage { margin-top: 2px; }
  .swipe-post-hero.is-text { padding-top: 0; }
  .swipe-text-art { flex-direction: row; justify-content: flex-start; gap: 8px; padding: 12px 16px; }
  .swipe-text-art svg { width: 32px; height: 32px; margin: 0; }
  .swipe-text-art small { display: none; }
  .swipe-text-art strong { font-size: 24px; }
  .swipe-post-header { padding: 12px 16px; }
  .swipe-post-hero.has-image .swipe-post-header { padding-top: 48px; }
  .discovery-controls { padding: 4px 12px calc(4px + env(safe-area-inset-bottom, 0px)); }
  .swipe-actions { grid-template-columns: 64px 48px 64px; gap: 20px; }
  .swipe-actions button { width: 64px; height: 64px; }
  .swipe-actions .swipe-undo { width: 48px; height: 48px; }
  .sheet-body .swipe-hint { margin-top: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .activity-track { scroll-snap-type: none; }
  button, a, input, textarea, select, .search-box, .post, .buddy-entry,
  .community-toolbar .tab::before, .follow::before,
  .swipe-card, .swipe-card.is-leaving, .swipe-card.is-dragging,
  .swipe-underlay, .swipe-actions button,
  .swipe-feedback, .buddy-entry-cta svg, .toast { transition: none; animation: none; }
  .swipe-underlay { transform: translateY(10px) scale(.96); }
  .swipe-underlay.is-far { transform: translateY(18px) scale(.92); }
  .swipe-actions button:not(:disabled):active { transform: none; }
  .discovery-content { scroll-behavior: auto; }
  .buddy-entry:not(:disabled):active,
  .buddy-entry:hover:not(:disabled) .buddy-entry-cta svg { transform: none; }
}

/* ---- 功能需求说明文档弹层 ---- */
.docs-open {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 16px; padding: 11px 15px; min-height: 44px;
  border: 1.5px solid #b9c7a4; border-radius: 15px; background: #fffdf4;
  color: var(--dark); font-weight: 700; font-size: 13px; letter-spacing: .5px;
  transition: background 150ms var(--social-ease), border-color 150ms var(--social-ease), transform 150ms var(--social-ease);
}
.docs-open:hover { background: var(--soft); border-color: var(--green); transform: translateY(-1px); }
.docs-open svg { width: 16px; height: 16px; }
.docs-open-sub { flex-basis: 100%; font-size: 10px; font-weight: 500; color: #7f8b76; letter-spacing: .4px; }
.docs-link {
  display: flex; width: max-content; align-items: center; gap: 6px;
  margin: 12px auto 0; padding: 8px 16px; min-height: 44px;
  border: 1px dashed #c4cdb2; border-radius: 16px; background: transparent;
  color: #77836b; font-size: 12px; letter-spacing: .5px;
  transition: background 150ms var(--social-ease), color 150ms var(--social-ease), border-color 150ms var(--social-ease);
}
.docs-link:hover { background: #fff; color: var(--dark); border-color: var(--green); }
.docs-link svg { width: 14px; height: 14px; }

#docs-dialog {
  max-width: 430px; height: 92dvh; max-height: 92dvh;
  overflow: hidden; border-radius: 24px 24px 0 0;
}
#docs-dialog[open] { display: flex; flex-direction: column; }
.docs-head {
  flex: none; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 18px 18px 13px; border-bottom: 1px solid var(--line);
  background: linear-gradient(140deg, #fffdf4 0%, #f3f6e8 100%);
}
.docs-eyebrow { font-size: 9px; letter-spacing: 2px; color: #8a9678; font-weight: 700; }
.docs-head h2 { font-size: 21px; color: var(--dark); letter-spacing: 1px; margin: 3px 0 2px; line-height: 1.3; }
.docs-head p { font-size: 11px; color: var(--muted); line-height: 1.5; }
.docs-close { flex: 0 0 44px; }
.docs-layout { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.docs-nav {
  flex: none; display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: #f7f5ea;
  scrollbar-width: thin; scrollbar-color: #a3ae90 #f1f2ed;
}
.docs-nav-title { display: none; }
.docs-nav a {
  flex: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 8px 12px; min-height: 36px; border-radius: 16px;
  border: 1px solid #e3e6d6; background: #fff; color: #6b7663;
  font-size: 12px; text-decoration: none;
  transition: background 150ms var(--social-ease), color 150ms var(--social-ease), border-color 150ms var(--social-ease);
}
.docs-nav a span { font-size: 10px; font-weight: 700; color: #a3ae90; }
.docs-nav a:hover { border-color: var(--green); color: var(--dark); }
.docs-nav a.active { background: var(--dark); border-color: var(--dark); color: #fff; }
.docs-nav a.active span { color: #cbd8b8; }
.docs-content {
  flex: 1; min-height: 0; overflow-y: auto; position: relative;
  padding: 16px 18px calc(28px + env(safe-area-inset-bottom, 0px));
  overscroll-behavior: contain; outline: none;
}
.docs-content:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; }
.docs-intro {
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; margin-bottom: 16px; font-size: 12.5px; line-height: 1.8; color: var(--muted);
}
.docs-intro strong { color: var(--dark); }
.docs-intro-tip { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 11.5px; }
.doc-section {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 16px 16px 14px; margin-bottom: 14px;
  box-shadow: 0 3px 0 rgba(66, 86, 52, .03); scroll-margin-top: 14px;
}
.doc-section > header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.doc-num {
  flex: none; font-size: 11px; font-weight: 800; letter-spacing: .5px;
  color: #8a7a3f; background: var(--yellow); border-radius: 9px; padding: 4px 7px;
}
.doc-section h3 { flex: 1; min-width: 0; font-size: 16px; color: var(--dark); letter-spacing: .3px; line-height: 1.4; }
.doc-tag {
  flex: none; font-size: 9px; font-weight: 800; letter-spacing: 1px;
  color: #4c7a45; background: #e7f0dc; border: 1px solid #cfe0bc; padding: 3px 7px; border-radius: 10px;
}
.doc-summary { font-size: 12.5px; color: var(--muted); line-height: 1.7; margin-bottom: 10px; }
.doc-entry {
  font-size: 12px; line-height: 1.7; background: #f7f8ee; border-radius: 10px;
  padding: 8px 10px; color: #55614e; margin-bottom: 12px;
}
.doc-entry strong, .doc-edge > strong {
  display: inline-block; margin-right: 8px; padding: 1px 6px; border-radius: 6px;
  font-size: 10px; letter-spacing: 1px; color: #77836b; background: #eaeedd;
}
.doc-section h4 { font-size: 12px; letter-spacing: 1.5px; color: #77836b; font-weight: 800; margin: 0 0 8px; }
.doc-section h4::before { content: ""; display: inline-block; width: 4px; height: 12px; border-radius: 3px; background: var(--green); margin-right: 7px; vertical-align: -1px; }
.doc-steps { margin: 0 0 12px; padding-left: 0; list-style: none; counter-reset: doc-step; }
.doc-steps li {
  counter-increment: doc-step; position: relative; padding: 0 0 8px 27px;
  font-size: 13px; line-height: 1.75; color: var(--text);
}
.doc-steps li::before {
  content: counter(doc-step); position: absolute; left: 0; top: 4px;
  width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  background: #eff4e8; border: 1px solid #dce5cc; color: #5f7a52; font-size: 10px; font-weight: 800;
}
.doc-steps li strong { color: var(--dark); }
.doc-edge { border-top: 1px dashed var(--line); padding-top: 10px; margin-bottom: 12px; font-size: 12px; }
.doc-edge > strong { color: #8a6d3b; background: #fbf0d8; }
.doc-edge ul { margin: 6px 0 0; padding-left: 16px; color: var(--muted); line-height: 1.7; }
.doc-edge li { margin-bottom: 2px; }
.doc-demo {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  padding: 10px 16px; border-radius: 14px; background: var(--dark); color: #fff9e8;
  font-size: 12.5px; font-weight: 700; letter-spacing: .5px;
  transition: background 150ms var(--social-ease), transform 150ms var(--social-ease);
}
.doc-demo:hover { background: #2c4a33; transform: translateY(-1px); }
.doc-demo:active { transform: translateY(0); }
.doc-demo svg { width: 14px; height: 14px; }
.doc-section code, .docs-intro code {
  font-family: ui-monospace, Consolas, monospace; font-size: .92em;
  background: #f1f3e6; border: 1px solid #e2e6d2; padding: 1px 5px; border-radius: 6px;
  color: #4f6b3f; overflow-wrap: anywhere;
}
.docs-foot { margin-top: 6px; padding: 14px 4px 0; border-top: 1px solid var(--line); font-size: 11px; color: #939d85; line-height: 1.8; }
.docs-foot p + p { margin-top: 6px; font-size: 10px; letter-spacing: 1px; }

@media (min-width: 760px) {
  #docs-dialog {
    max-width: 960px; width: min(960px, calc(100vw - 48px));
    top: 0; bottom: 0; margin: auto;
    height: min(88dvh, 840px); max-height: min(88dvh, 840px); border-radius: 26px;
  }
  .docs-head { padding: 22px 26px 16px; }
  .docs-head h2 { font-size: 24px; }
  .docs-layout { display: grid; grid-template-columns: 216px minmax(0, 1fr); }
  .docs-nav {
    flex-direction: column; gap: 3px; overflow-x: hidden; overflow-y: auto;
    padding: 16px 12px; border-right: 1px solid var(--line); border-bottom: 0;
  }
  .docs-nav-title { display: block; font-size: 10px; letter-spacing: 2px; color: #96a184; font-weight: 800; margin: 0 0 8px 8px; }
  .docs-nav a { border-radius: 11px; padding: 8px 10px; min-height: 36px; font-size: 12.5px; border-color: transparent; background: transparent; }
  .docs-nav a:hover { background: #eef1e0; border-color: transparent; }
  .docs-nav a.active { background: var(--dark); }
  .docs-content { padding: 22px 26px 30px; }
  .doc-section { padding: 20px 22px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .docs-open, .docs-link, .docs-nav a, .doc-demo { transition: none; }
  .docs-open:hover, .doc-demo:hover { transform: none; }
}

/* ---- Motion pass: every state change lands with a short, cancellable transition ---- */
html { scrollbar-width: thin; scrollbar-color: #a3ae90 var(--cream); }
html::-webkit-scrollbar, .sheet-body::-webkit-scrollbar, .chat-log::-webkit-scrollbar, .docs-content::-webkit-scrollbar, .docs-nav::-webkit-scrollbar { width: 8px; height: 8px; }
html::-webkit-scrollbar-track, .sheet-body::-webkit-scrollbar-track, .chat-log::-webkit-scrollbar-track, .docs-content::-webkit-scrollbar-track, .docs-nav::-webkit-scrollbar-track { background: var(--cream); }
html::-webkit-scrollbar-thumb, .sheet-body::-webkit-scrollbar-thumb, .chat-log::-webkit-scrollbar-thumb, .docs-content::-webkit-scrollbar-thumb, .docs-nav::-webkit-scrollbar-thumb { background: #a3ae90; border-radius: 8px; }
html::-webkit-scrollbar-thumb:hover, .sheet-body::-webkit-scrollbar-thumb:hover, .chat-log::-webkit-scrollbar-thumb:hover, .docs-content::-webkit-scrollbar-thumb:hover, .docs-nav::-webkit-scrollbar-thumb:hover { background: #7c895f; }
.sheet-body, .chat-log, .docs-content, .docs-nav { scrollbar-width: thin; scrollbar-color: #a3ae90 var(--cream); }

/* Sheets fade/slide in and out via allow-discrete; state never waits on animationend. */
dialog {
  opacity: 1;
  transition: opacity 180ms var(--social-ease), display 180ms allow-discrete, overlay 180ms allow-discrete;
}
dialog:not([open]) { opacity: 0; }
dialog::backdrop { opacity: 1; transition: opacity 180ms var(--social-ease), display 180ms allow-discrete, overlay 180ms allow-discrete; }
dialog:not([open])::backdrop { opacity: 0; }
@starting-style { dialog[open] { opacity: 0; } dialog[open]::backdrop { opacity: 0; } }
dialog[open] > * { animation: dialog-rise 220ms var(--social-ease) both; }
@keyframes dialog-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
dialog[open] .sheet-body.swap-in { animation: swap-in 180ms var(--social-ease) both; }
@keyframes swap-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#sheet-feedback:not([hidden]) { animation: feedback-in 160ms var(--social-ease) both; }
@keyframes feedback-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Feed entrance only fires on deliberate tab/filter switches, never on each keystroke or mutation. */
.feed.feed-enter > * { animation: feed-in 260ms var(--social-ease) both; animation-delay: calc(var(--i, 0) * 32ms); }
@keyframes feed-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Confirmation pops for replaced nodes (like / follow / join) and appended messages. */
.post-action.pop svg { animation: like-pop 320ms var(--social-ease); }
@keyframes like-pop { 0% { transform: scale(1); } 35% { transform: scale(1.28); } 70% { transform: scale(.94); } 100% { transform: scale(1); } }
.follow.pop-in, .join.pop-in { animation: pop-in 220ms var(--social-ease); }
@keyframes pop-in { 0% { transform: scale(.9); } 60% { transform: scale(1.05); } 100% { transform: scale(1); } }
.comment-item.is-new, .chat-bubble.is-new { animation: feed-in 220ms var(--social-ease) both; }
.preview-image, .draft-image img, .activity-cover { animation: img-in 220ms var(--social-ease) both; }
@keyframes img-in { from { opacity: 0; } to { opacity: 1; } }
.storage-state.warning { animation: feedback-in 200ms var(--social-ease) both; }

/* Continuous state transitions for controls whose node persists. */
.tab { transition: color 180ms var(--social-ease), font-size 180ms var(--social-ease); }
.tab.active::after { animation: tab-line 200ms var(--social-ease); }
@keyframes tab-line { from { transform: translateX(-50%) scaleX(.3); opacity: 0; } to { transform: translateX(-50%) scaleX(1); opacity: 1; } }
.nav-item { transition: color 180ms var(--social-ease); }
.nav-item .nav-icon { transition: background-color 180ms var(--social-ease), color 180ms var(--social-ease); }
.post-action { transition: color 180ms var(--social-ease); }
.post-action svg { transition: fill 180ms var(--social-ease); }
.follow, .join { transition: background-color 180ms var(--social-ease), color 180ms var(--social-ease); }
.segmented button, .message-tabs button { transition: background-color 180ms var(--social-ease), color 180ms var(--social-ease), box-shadow 180ms var(--social-ease); }
.post { outline: 3px solid transparent; transition: border-color 180ms var(--social-ease), outline-color 300ms var(--social-ease); }
.post.flash { outline-color: #b9ce9f; }
.activity-card { transition: transform 180ms var(--social-ease), box-shadow 180ms var(--social-ease), border-color 180ms var(--social-ease); }
.toast { transform: translateX(-50%) translateY(8px); transition: opacity 180ms var(--social-ease), transform 180ms var(--social-ease); }
.toast.visible { transform: translateX(-50%) translateY(0); }

/* Tactile press feedback on persistent and replaced controls alike. */
.primary:not(:disabled):active, .secondary:not(:disabled):active, .join:not(:disabled):active,
.fab:not(:disabled):active, .icon-button:not(:disabled):active, .post-action:not(:disabled):active,
.follow:not(:disabled):active, .menu-row:active, .message-item:active,
.segmented button:not(:disabled):active, .message-tabs button:active,
.image-tools button:not(:disabled):active, .activity-link:active { transform: scale(.97); }
.primary, .secondary, .join, .fab, .icon-button, .post-action, .follow,
.menu-row, .message-item, .segmented button, .message-tabs button, .image-tools button, .activity-link { transition: background-color 180ms var(--social-ease), color 180ms var(--social-ease), border-color 180ms var(--social-ease), transform 120ms var(--social-ease), box-shadow 180ms var(--social-ease); }
@media (hover: hover) and (pointer: fine) {
  .activity-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px #38432514; border-color: var(--social-stroke); }
  .menu-row:hover, .image-tools button:hover { background: var(--soft); }
  .nav-item:hover { color: var(--dark); }
}

/* ---- 好好精灵：底栏凸起入口、三姿态舞台与计划卡 ---- */
.pet-fab { margin-top: -18px; gap: 1px; }
.pet-fab-avatar { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 35% 30%, #fdfcf4, #eaf0dd); border: 3px solid #fbfcf4; box-shadow: 0 6px 16px #3f5a3526, 0 0 0 1px #dfe6d1; transition: transform 180ms var(--social-ease), box-shadow 180ms var(--social-ease); }
.pet-fab-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pet-fab-label { line-height: 1.4; }
.pet-fab.active .pet-fab-avatar { box-shadow: 0 0 0 2px var(--green), 0 6px 16px #3f5a3530; }
.pet-fab:hover .pet-fab-avatar { transform: translateY(-3px); }
.pet-fab:active .pet-fab-avatar { transform: translateY(0) scale(.96); }
.pet-fab[aria-current="page"] .pet-fab-label { font-weight: 750; color: var(--dark); }

.pet-tabs { display: flex; gap: 6px; padding: 2px 16px 10px; flex: none; }
.pet-tabs button { flex: 1; min-height: 44px; border-radius: 14px; background: #f2f5ea; color: #7d8b70; font-size: 13px; font-weight: 600; border: 1px solid #e8eddd; }
.pet-tabs button.selected { background: #fffef9; color: var(--dark); font-weight: 750; box-shadow: 0 3px 10px #3f5a350f; border-color: #dfe7d2; }
.pet-chatbar { display: flex; gap: 8px; align-items: center; padding: 0 16px 8px; flex: none; }
.pet-chat-switch { flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; gap: 6px; padding: 6px 12px; background: #fffef9; border: 1px solid #e8eddd; border-radius: 14px; text-align: left; }
.pet-chat-name { font-size: 13px; font-weight: 650; color: #46523d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pet-chat-sub { font-size: 10px; color: #8a9580; white-space: nowrap; }
.pet-chat-switch svg { width: 15px; height: 15px; color: #8a9580; flex: none; }
.pet-newchat { min-height: 44px; padding: 0 12px; border-radius: 14px; background: #eef4e2; color: #5f7a50; font-size: 12px; display: flex; align-items: center; gap: 4px; white-space: nowrap; border: 1px solid #e3ebd7; }
.pet-newchat svg { width: 15px; height: 15px; }
.pet-attach-button { width: 44px; height: 44px; min-width: 44px; border: 1.5px solid var(--social-stroke); border-radius: 14px; background: #fff; color: #6f8a5e; display: grid; place-items: center; flex: none; }
.pet-attach-button svg { width: 19px; height: 19px; }
.pet-attach-preview { display: flex; gap: 8px; overflow-x: auto; min-width: 0; flex: none; padding: 0 16px 6px; scrollbar-width: none; }
.pet-attach-menu { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }
.pet-attach-menu button { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px; text-align: left; }
.pet-attach-menu button svg { width: 24px; height: 24px; color: #6f8a5e; flex: none; }
.pet-attach-menu strong { display: block; font-size: 14px; color: #46523d; }
.pet-attach-menu small { display: block; font-size: 10px; color: #8a9580; margin-top: 2px; }
.pet-page.chatting .pet-chips { display: none; }
.pet-attach-preview::-webkit-scrollbar { display: none; }
.pet-attach-preview[hidden] { display: none; }
.pet-pending-item { position: relative; display: flex; align-items: center; gap: 6px; background: #f6f8ee; border: 1px solid #e6ebdb; border-radius: 12px; padding: 3px 4px 3px 6px; flex: none; max-width: 180px; }
.pet-pending-item img { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.pet-pending-item small { font-size: 10px; color: #6d7c61; max-width: 74px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pet-pending-item .icon-button { width: 36px; height: 44px; min-width: 36px; min-height: 44px; }
.pet-pending-item.is-file { color: #6f8a5e; }
.pet-pending-item.is-file > svg { width: 18px; height: 18px; flex: none; }
.pet-msg-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.pet-attach-thumb img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; display: block; border: 1px solid #ffffff55; }
.pet-attach-file { display: inline-flex; align-items: center; gap: 6px; background: #eef4e2; border-radius: 10px; padding: 6px 8px; max-width: 220px; }
.pet-attach-file svg { width: 16px; height: 16px; color: #6f8a5e; flex: none; }
.pet-attach-file b { font-size: 11px; color: #4d5a47; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pet-attach-file small { font-size: 9px; color: #8a9580; white-space: nowrap; }
.pet-chat-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.pet-chat-row { display: flex; align-items: center; gap: 6px; border: 1px solid #e8eddd; border-radius: 14px; background: #fffef9; padding: 4px; }
.pet-chat-row.active { border-color: var(--green); box-shadow: inset 0 0 0 1px #b9cd9f; }
.pet-chat-open { flex: 1; min-width: 0; text-align: left; padding: 8px; display: flex; flex-direction: column; gap: 2px; min-height: 44px; }
.pet-chat-open strong { font-size: 13px; color: #46523d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pet-chat-open small { font-size: 10px; color: #8a9580; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pet-chat-open span { font-size: 9px; color: #a1aa98; }
.pet-chat-row .icon-button { width: 44px; height: 44px; flex: none; }
.pet-model-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.pet-model-option { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 12px; border: 1.5px solid #e8eddd; border-radius: 14px; background: #fbfcf5; text-align: left; }
.pet-model-option.selected { border-color: var(--green); background: #f2f7e8; box-shadow: inset 0 0 0 1px #b9cd9f; }
.pet-model-radio { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #c8d2bd; flex: none; position: relative; }
.pet-model-option.selected .pet-model-radio { border-color: var(--green); }
.pet-model-option.selected .pet-model-radio:after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--green); }
.pet-model-copy strong { display: block; font-size: 13px; color: #46523d; }
.pet-model-copy small { display: block; font-size: 10px; color: #8a9580; margin-top: 2px; }
.pet-pane { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.pet-pane[hidden] { display: none; }
.pet-pane-today { overflow-y: auto; padding: 0 16px 8px; }
.pet-pane-chat { min-height: 0; }
.pet-today-card { background: #fffef9; border: 1px solid #edf0e3; border-radius: 24px; padding: 14px; box-shadow: 0 10px 26px #3f5a3510; }
.pet-today-card.all-done { box-shadow: inset 0 0 0 2px #cfe0b5, 0 10px 26px #3f5a3514; }
.pet-today-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.pet-today-date { font-size: 11px; color: #8a9580; letter-spacing: .4px; }
.pet-today-copy strong { display: block; font-size: 19px; color: #39442f; margin: 3px 0 2px; }
.pet-today-copy small { font-size: 11px; color: #7f8c74; }
.pet-today-mini { position: relative; width: 88px; height: 92px; flex: none; display: flex; align-items: flex-end; justify-content: center; }
.pet-today-mini img { height: 88px; width: auto; filter: drop-shadow(0 6px 8px #3f5a351c); animation: pet-breathe 3.4s ease-in-out infinite; transform-origin: 50% 92%; }
.pet-today-mini.is-happy img { animation: pet-pop 520ms var(--social-ease); }
.pet-today-shadow { position: absolute; bottom: 0; left: 50%; width: 58px; height: 10px; margin-left: -29px; border-radius: 50%; background: #41552c1a; filter: blur(2px); }
.pet-today-mini.is-summoned { animation: pet-summon 360ms var(--social-ease) both; }
.pet-today-stats { display: flex; gap: 12px; align-items: center; margin: 12px 0 14px; padding: 10px; background: #f6f8ee; border-radius: 18px; }
.pet-energy { position: relative; width: 104px; flex: none; }
.pet-energy .rec-ring { width: 104px; height: 104px; display: block; }
.pet-energy .rec-ring-center strong { font-size: 24px; }
.pet-energy .rec-ring-center small { font-size: 9px; letter-spacing: .2px; }
.pet-streak { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; min-width: 0; }
.pet-streak-label { width: 100%; font-size: 10px; color: #8a9580; }
.pet-streak strong { font-size: 22px; color: #4c5f3f; line-height: 1.1; }
.pet-streak-unit { font-size: 10px; color: #8a9580; }
.pet-week { display: flex; gap: 5px; margin-top: 6px; flex-wrap: wrap; }
.pet-dot { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pet-dot i { width: 12px; height: 12px; border-radius: 50%; background: #e6ebdb; display: block; }
.pet-dot.part i { background: #b9cf9a; }
.pet-dot.full i { background: var(--green); }
.pet-dot.today i { box-shadow: 0 0 0 2px #f6f8ee, 0 0 0 3px #9db986; }
.pet-dot small { font-size: 9px; color: #9aa590; }
.pet-tasks { display: flex; flex-direction: column; gap: 8px; }
.pet-task-wrap { position: relative; border-radius: 16px; overflow: hidden; background: #f2f6e9; }
.pet-task-bg { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: center; padding: 0 18px; pointer-events: none; }
.pet-task-bg span { font-size: 11px; color: #5f7a50; }
.pet-task-bg span:last-child { color: #a4753f; }
.pet-task { position: relative; width: 100%; min-height: 58px; display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #fffef9; border: 1px solid #edf0e4; border-radius: 16px; text-align: left; touch-action: pan-y; user-select: none; transform: translateX(var(--swipe, 0px)); transition: transform 180ms var(--social-ease), border-color 180ms var(--social-ease), background-color 180ms var(--social-ease); }
.pet-task.dragging { transition: none; }
.pet-task.is-done { background: #f7faf1; border-color: #dfe9d2; }
.pet-task-icon { width: 36px; height: 36px; border-radius: 12px; background: #eef4e2; color: #6f8a5e; display: grid; place-items: center; flex: none; }
.pet-task-icon svg { width: 18px; height: 18px; }
.pet-task-copy { flex: 1; min-width: 0; }
.pet-task-copy strong { display: block; font-size: 13px; color: #46523d; }
.pet-task-copy small { display: block; font-size: 10px; color: #8d9883; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pet-task-check { width: 24px; height: 24px; border-radius: 50%; border: 1.5px dashed #cfd9c3; display: grid; place-items: center; color: #fff; flex: none; }
.pet-task.is-done .pet-task-check { background: var(--green); border-style: solid; }
.pet-task-check svg { width: 14px; height: 14px; }
.pet-today-actions { display: grid; grid-template-columns: 1.2fr 1fr; gap: 8px; margin-top: 14px; }
.pet-today-actions button { min-height: 44px; font-size: 12px; }
.pet-today-note { font-size: 10px; color: #95a08b; text-align: center; padding: 10px 6px 4px; }

.pet-page { position: fixed; z-index: 14; inset: 0 0 calc(88px + env(safe-area-inset-bottom, 0px)); left: 0; right: 0; margin-inline: auto; max-width: 430px; display: flex; flex-direction: column; background: radial-gradient(circle at 50% 0, #f4f8ea 0, #fbfaf3 46%, #f7f5ec 100%); overflow: hidden; }
.pet-page[hidden] { display: none; }
.pet-page.leaving { animation: pet-page-out 180ms var(--social-ease) both; }
@keyframes pet-page-out { to { opacity: 0; transform: translateY(10px); } }
.pet-topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: calc(14px + env(safe-area-inset-top, 0px)) 12px 4px 16px; }
.pet-id { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.pet-id > div { min-width: 0; }
.pet-id strong, .pet-id small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pet-id-avatar { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: #eef3e4; border: 2px solid #fff; box-shadow: 0 3px 10px #3f5a3517; flex: none; }
.pet-id-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pet-id strong { display: block; font-size: 15px; color: var(--dark); }
.pet-id small { display: block; font-size: 11px; color: #77866a; margin-top: 1px; }
.pet-tools { display: flex; gap: 0; flex: none; }
.pet-tools .icon-button { width: 44px; height: 44px; }
.pet-stage { position: relative; flex: none; height: min(232px, 27vh); display: flex; align-items: flex-end; justify-content: center; margin: 0 16px; border-radius: 24px; background: radial-gradient(circle at 50% 80%, #eef4dd 0, #f8f8ee 62%, transparent 100%); overflow: hidden; }
.pet-bubble { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: #fffef9; border: 1px solid #e6ead9; box-shadow: 0 6px 16px #3f5a3512; border-radius: 14px; padding: 7px 12px; font-size: 12px; color: #5e6f52; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; animation: bubble-in 220ms var(--social-ease) both; }
@keyframes bubble-in { from { opacity: 0; transform: translate(-50%, 6px); } }
.pet-sprite-wrap { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; transform-origin: 50% 80%; }
.pet-sprite { height: min(196px, 24vh); width: auto; display: block; filter: drop-shadow(0 10px 14px #3f5a351f); transition: opacity 120ms linear; animation: pet-breathe 3.4s ease-in-out infinite; transform-origin: 50% 92%; }
.pet-sprite.pose-out { opacity: .2; }
.pet-shadow { position: absolute; bottom: 6px; left: 50%; width: 96px; height: 16px; margin-left: -48px; border-radius: 50%; background: #41552c1c; filter: blur(2px); animation: shadow-breathe 3.4s ease-in-out infinite; }
.pet-stage[data-pet-state="thinking"] .pet-sprite { animation: pet-hop 820ms ease-in-out infinite; }
.pet-stage[data-pet-state="thinking"] .pet-shadow { animation: shadow-hop 820ms ease-in-out infinite; }
.pet-stage[data-pet-state="celebrate"] .pet-sprite { animation: pet-pop 500ms var(--social-ease); }
.pet-spark { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #d9e5a6; opacity: 0; animation: sparkle 4.6s ease-in-out infinite; }
.pet-spark.s1 { left: 22%; bottom: 44%; animation-delay: .8s; }
.pet-spark.s2 { right: 20%; bottom: 56%; width: 8px; height: 8px; background: #f3dc9a; animation-delay: 2.1s; }
.pet-spark.s3 { left: 36%; bottom: 28%; width: 4px; height: 4px; background: #c9dba0; animation-delay: 3.2s; }
@keyframes pet-breathe { 0%, 100% { transform: translateY(0) rotate(-.6deg); } 50% { transform: translateY(-4px) rotate(.8deg); } }
@keyframes shadow-breathe { 0%, 100% { transform: scale(1); opacity: .5; } 50% { transform: scale(.9); opacity: .36; } }
@keyframes pet-hop { 0%, 100% { transform: translateY(0) scale(1, 1); } 30% { transform: translateY(-10px) scale(.98, 1.03); } 60% { transform: translateY(0) scale(1.03, .96); } }
@keyframes shadow-hop { 0%, 100% { transform: scale(1); opacity: .45; } 30% { transform: scale(.78); opacity: .28; } 60% { transform: scale(1.04); opacity: .5; } }
@keyframes pet-pop { 0% { transform: scale(.92); } 45% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes sparkle { 0%, 70%, 100% { opacity: 0; transform: translateY(0); } 80% { opacity: .9; transform: translateY(-8px); } 90% { opacity: 0; transform: translateY(-14px); } }
.pet-sprite-wrap.is-summoned { animation: pet-summon 360ms var(--social-ease) both; }
@keyframes pet-summon { 0% { transform: translate(var(--summon-x, 0), var(--summon-y, 0)) scale(.18); opacity: .4; } 60% { transform: translate(0, -6px) scale(1.04); opacity: 1; } 100% { transform: translate(0, 0) scale(1); } }

.pet-chat { flex: 1; overflow-y: auto; padding: 12px 16px 8px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; }
.pet-welcome { margin: auto; text-align: center; padding: 6px 18px 16px; color: #76866a; }
.pet-welcome strong { display: block; font-size: 15px; color: #4c5c43; }
.pet-welcome p { font-size: 13px; line-height: 1.7; margin: 6px 0; color: #63735a; }
.pet-welcome span { font-size: 11px; color: #8a9580; }
.pet-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 100%; }
.pet-msg.user { flex-direction: column; align-items: flex-end; }
.pet-msg-avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; background: #eef3e4; border: 1.5px solid #fff; }
.pet-msg-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; align-items: flex-start; }
.pet-msg-bubble { background: #fffef9; border: 1px solid #e9ecdf; border-radius: 16px 16px 16px 5px; padding: 10px 13px; font-size: 13px; line-height: 1.7; color: #4d5a47; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 4px 12px #3f5a350c; max-width: 100%; }
.pet-msg.user .pet-msg-bubble { background: var(--green); border-color: var(--green); color: #fff; border-radius: 16px 16px 5px 16px; }
.pet-msg small { font-size: 10px; color: #8a9580; padding: 0 4px; }
.pet-plan { width: min(100%, 330px); background: #fffef9; border: 1px solid #e6ead9; border-radius: 16px; padding: 12px; box-shadow: 0 6px 18px #3f5a3510; }
.pet-plan-head { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; }
.pet-plan-head .pill { align-self: flex-start; background: #eef4e2; color: #5f7a50; font-size: 10px; padding: 2px 7px; border-radius: 7px; }
.pet-plan-head strong { font-size: 13px; color: #465239; }
.pet-plan-head small { font-size: 10px; color: #8a9580; }
.pet-plan ul { display: flex; flex-direction: column; gap: 2px; margin: 0 0 6px; padding: 0; list-style: none; }
.pet-plan li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px; align-items: baseline; font-size: 12px; padding: 5px 0; border-bottom: 1px dashed #f0f2e8; }
.pet-plan li b { font-size: 11px; color: #6f805f; font-weight: 650; }
.pet-plan li span { color: #4d5a47; overflow-wrap: anywhere; }
.pet-plan li em { font-style: normal; font-size: 10px; color: #8a9580; white-space: nowrap; }
.pet-plan-note { font-size: 10px; line-height: 1.6; color: #8a9580; margin: 4px 0 8px; }
.pet-plan-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pet-plan-actions button { min-height: 44px; font-size: 11px; padding: 6px 8px; }
.pet-plan-actions button:first-child { grid-column: 1 / -1; }
.pet-chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 16px 6px; scrollbar-width: none; }
.pet-chips::-webkit-scrollbar { display: none; }
.pet-chips button { flex: none; min-height: 44px; border-radius: 999px; border: 1px solid #dfe6d3; background: #fbfcf5; color: #5d7050; font-size: 11px; padding: 0 13px; }
.pet-chips button:hover { background: #f2f7e8; }
.pet-composer { display: flex; gap: 8px; align-items: flex-end; padding: 2px 16px 0; }
.pet-composer textarea { flex: 1; min-height: 46px; max-height: 96px; resize: none; border: 1.5px solid var(--social-stroke); border-radius: 16px; background: #fff; padding: 12px 13px; font-size: 16px; line-height: 1.5; color: #46523f; }
.pet-composer textarea:focus { outline: 2px solid #a9bf8c; border-color: #a9bf8c; }
.pet-composer .primary { min-width: 64px; min-height: 46px; border-radius: 16px; }
.pet-note { font-size: 10px; color: #95a08b; text-align: center; padding: 6px 16px 8px; }
.pet-char-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pet-char-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px; border-radius: 18px; border: 1.5px solid #e7ecdc; background: #fbfcf5; text-align: center; }
.pet-char-card img { width: 100%; max-width: 120px; height: 96px; object-fit: contain; }
.pet-char-card strong { font-size: 13px; color: #46523b; }
.pet-char-card span { font-size: 10px; color: #8a9580; }
.pet-char-card.selected { border-color: var(--green); background: #f2f7e8; box-shadow: inset 0 0 0 2px #b9cd9f; }
.pet-page.chatting .pet-stage { height: 108px; }
.pet-page.chatting .pet-sprite { height: 86px; }
.pet-page.chatting .pet-shadow { width: 54px; margin-left: -27px; bottom: 2px; }
.pet-page.chatting .pet-bubble { top: 6px; font-size: 11px; padding: 5px 10px; }
html.on-pet .toast { bottom: calc(210px + env(safe-area-inset-bottom, 0px)); }
@media (max-height: 640px) {
  .pet-page.chatting .pet-stage { height: 96px; }
  .pet-page.chatting .pet-sprite { height: 84px; }
  .pet-page.chatting .pet-shadow { width: 54px; margin-left: -27px; }
  .pet-page.chatting .pet-chips { display: none; }
  .pet-note { display: none; }
  html.on-pet .toast { top: calc(8px + env(safe-area-inset-top, 0px)); bottom: auto; }
}
@media (max-width: 359px) {
  .pet-today-card { padding: 12px; }
  .pet-today-stats { padding: 8px; gap: 8px; }
  .pet-energy { width: 92px; }
  .pet-energy .rec-ring { width: 92px; height: 92px; }
  .pet-today-mini { width: 72px; height: 80px; }
  .pet-today-mini img { height: 76px; }
  .pet-today-actions { grid-template-columns: 1fr; }
  .pet-stage { height: 196px; }
  .pet-sprite { height: 168px; }
  .pet-page.chatting .pet-stage { height: 100px; }
  .pet-page.chatting .pet-sprite { height: 78px; }
  .pet-plan-actions { grid-template-columns: 1fr; }
  .pet-plan-actions button:first-child { grid-column: auto; }
  .pet-welcome img { width: 78px; height: 78px; }
}

@media (prefers-reduced-motion: reduce) {
  dialog, dialog::backdrop { transition: none; }
  .pet-sprite, .pet-shadow, .pet-spark, .pet-bubble, .pet-sprite-wrap, .pet-page,
  .pet-stage[data-pet-state="thinking"] .pet-sprite, .pet-stage[data-pet-state="thinking"] .pet-shadow,
  .pet-stage[data-pet-state="celebrate"] .pet-sprite { animation: none !important; transition: none !important; }
  .pet-fab-avatar, .pet-plan, .pet-msg-bubble, .pet-chips button { transition: none !important; }
  .pet-today-mini img, .pet-today-mini.is-happy img, .pet-today-mini.is-summoned,
  .pet-tabs button, .pet-task { animation: none !important; transition: none !important; }
  dialog[open] > *, dialog[open] .sheet-body.swap-in, #sheet-feedback:not([hidden]), .feed.feed-enter > *,
  .post-action.pop svg, .follow.pop-in, .join.pop-in, .comment-item.is-new, .chat-bubble.is-new,
  .preview-image, .draft-image img, .activity-cover, .storage-state.warning, .tab.active::after { animation: none; }
  .tab, .nav-item, .nav-item .nav-icon, .post-action, .post-action svg, .follow, .join,
  .segmented button, .message-tabs button, .post, .activity-card, .toast,
  .primary, .secondary, .join, .fab, .icon-button, .post-action, .follow,
  .menu-row, .message-item, .image-tools button, .activity-link { transition: none; }
  .toast, .toast.visible { transform: translateX(-50%); }
  .primary:not(:disabled):active, .secondary:not(:disabled):active, .join:not(:disabled):active,
  .fab:not(:disabled):active, .icon-button:not(:disabled):active, .post-action:not(:disabled):active,
  .follow:not(:disabled):active, .menu-row:active, .message-item:active,
  .segmented button:not(:disabled):active, .message-tabs button:active,
  .image-tools button:not(:disabled):active, .activity-link:active, .activity-card:hover { transform: none; }
}

/* ---- 记录模块：饮食识别 + 健身关联 ---- */
.rec-page { display: grid; gap: 14px; padding: 4px 0 24px; }
.rec-page.rec-enter > * { animation: feed-in 260ms var(--social-ease) both; animation-delay: calc(var(--i, 0) * 32ms); }
.rec-subtabs { position: sticky; top: 8px; z-index: 5; box-shadow: 0 4px 14px #38432512; }
html.on-records { scroll-padding-top: 76px; }
.rec-subtabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; }
.rec-subtabs svg { width: 18px; height: 18px; }
.rec-summary { display: flex; align-items: center; gap: 16px; background: var(--card, #fff); border: 1px solid var(--social-stroke); border-radius: 22px; padding: 16px; }
.rec-ring-wrap { position: relative; flex: 0 0 116px; width: 116px; height: 116px; }
.rec-ring { width: 116px; height: 116px; display: block; }
.rec-ring circle { transition: stroke-dasharray 300ms var(--social-ease); }
.rec-ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 2px; }
.rec-ring-center strong { font-size: 26px; line-height: 1.1; color: var(--dark); font-variant-numeric: tabular-nums; }
.rec-ring-center small { font-size: 12px; color: var(--muted, #6b7261); }
.rec-summary-side { flex: 1; min-width: 0; display: grid; gap: 8px; }
.rec-summary-title { font-size: 13px; font-weight: 700; color: var(--muted, #6b7261); letter-spacing: .04em; }
.rec-macros { display: grid; gap: 6px; }
.rec-macro { display: grid; grid-template-columns: 62px 1fr 40px; align-items: center; gap: 8px; font-size: 12px; }
.rec-macro-label { display: inline-flex; align-items: center; gap: 6px; color: var(--dark); }
.rec-macro-label i { width: 8px; height: 8px; border-radius: 3px; flex: 0 0 8px; }
.rec-macro-bar { height: 8px; border-radius: 99px; background: #edf0e4; overflow: hidden; }
.rec-macro-bar b { display: block; height: 100%; border-radius: 99px; transition: width 300ms var(--social-ease); }
.rec-macro-val { text-align: right; color: var(--muted, #6b7261); font-variant-numeric: tabular-nums; }
.rec-goal-link { display: inline-flex; align-items: center; gap: 5px; justify-self: start; min-height: 44px; padding: 0 6px; border: 0; background: none; color: #4c6837; font-size: 12px; font-weight: 700; cursor: pointer; border-radius: 8px; }
.rec-goal-link svg { width: 14px; height: 14px; }
.rec-goal-link:hover { color: #35511f; text-decoration: underline; }
.rec-fit-stats { display: flex; gap: 14px; font-size: 14px; font-weight: 700; color: var(--dark); }
.rec-fit-stats span { display: inline-flex; align-items: center; gap: 6px; }
.rec-fit-stats svg { width: 16px; height: 16px; color: #b07f2a; }
.rec-viewfinder { position: relative; aspect-ratio: 4 / 3; border-radius: 20px; overflow: hidden; background: radial-gradient(120% 90% at 50% 10%, #3a4a2c 0%, #232d1a 62%, #1a2213 100%); border: 1px solid #46543a; }
.rec-viewfinder video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rec-viewfinder-empty { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: #cfe3ae; font-size: 14px; }
.rec-viewfinder-empty svg { width: 40px; height: 40px; opacity: .9; }
.rec-corner { position: absolute; width: 34px; height: 34px; border: 3px solid #a5d46f; }
.rec-corner.tl { top: 14px; left: 14px; border-right: 0; border-bottom: 0; border-top-left-radius: 12px; }
.rec-corner.tr { top: 14px; right: 14px; border-left: 0; border-bottom: 0; border-top-right-radius: 12px; }
.rec-corner.bl { bottom: 14px; left: 14px; border-right: 0; border-top: 0; border-bottom-left-radius: 12px; }
.rec-corner.br { bottom: 14px; right: 14px; border-left: 0; border-top: 0; border-bottom-right-radius: 12px; }
.rec-shutter { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); width: 62px; height: 62px; border-radius: 50%; border: 4px solid #f6f3e7; background: #a5d46f; color: #22301c; display: grid; place-items: center; cursor: pointer; box-shadow: 0 6px 18px #0006; }
.rec-shutter svg { width: 26px; height: 26px; }
.rec-shutter:active { transform: translateX(-50%) scale(.94); }
.rec-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rec-actions .primary { grid-column: 1 / -1; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.rec-actions .secondary { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; padding: 0 6px; }
.rec-actions svg { width: 17px; height: 17px; }
.rec-result { background: var(--card, #fff); border: 1px solid var(--social-stroke); border-radius: 22px; padding: 14px; display: grid; gap: 12px; }
.rec-result-media { position: relative; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; background: #edf0e4; }
.rec-result-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rec-result-noimg { position: absolute; inset: 0; display: grid; place-items: center; color: #9aa587; }
.rec-result-noimg svg { width: 40px; height: 40px; }
.rec-scanning { position: absolute; inset: 0; background: #22301c33; }
.rec-scanning span { position: absolute; left: 6%; right: 6%; height: 3px; border-radius: 99px; background: #a5d46f; box-shadow: 0 0 14px 4px #a5d46f88; animation: rec-scan 1.15s ease-in-out infinite alternate; }
@keyframes rec-scan { from { top: 10%; } to { top: 88%; } }
.rec-result-status { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: #5c7a45; min-height: 44px; }
.rec-result-status svg { width: 18px; height: 18px; animation: rec-pulse 1s ease-in-out infinite alternate; }
@keyframes rec-pulse { from { opacity: .45; transform: scale(.92); } to { opacity: 1; transform: scale(1.06); } }
.rec-result-form { display: grid; gap: 10px; }
.rec-result-src { font-size: 12px; color: var(--muted, #6b7261); background: #f4f6ea; border-radius: 10px; padding: 8px 10px; }
.field-row.four { grid-template-columns: repeat(4, 1fr); }
.rec-list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.rec-list-head strong { font-size: 15px; color: var(--dark); }
.rec-list-head .secondary { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.rec-list-head svg { width: 15px; height: 15px; }
.rec-group { display: grid; gap: 8px; }
.rec-group-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--muted, #6b7261); padding: 0 4px; }
.rec-group-head strong { color: var(--dark); font-size: 14px; }
.rec-row { display: flex; align-items: center; gap: 10px; background: var(--card, #fff); border: 1px solid var(--social-stroke); border-radius: 16px; padding: 10px 10px 10px 14px; outline: 3px solid transparent; transition: outline-color 300ms var(--social-ease); }
.rec-row.flash { outline-color: #b9ce9f; }
.rec-row-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.rec-row-main strong { font-size: 15px; color: var(--dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-row-meta { font-size: 12px; color: var(--muted, #6b7261); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-row-thumb { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; flex: 0 0 42px; }
.rec-row-tools { display: flex; gap: 2px; flex: 0 0 auto; }
.rec-row-tools .icon-button { width: 44px; height: 44px; }
.rec-demo-share { display: flex; align-items: center; gap: 12px; background: #fbf7e6; border: 1px solid #e8dcb8; border-radius: 18px; padding: 12px; }
.rec-demo-share img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; flex: 0 0 56px; }
.rec-demo-share strong { font-size: 14px; color: var(--dark); display: block; }
.rec-demo-share .primary { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; flex: 0 0 auto; }
.rec-demo-share svg { width: 15px; height: 15px; }
.rec-band { background: var(--card, #fff); border: 1px solid var(--social-stroke); border-radius: 22px; padding: 14px; display: grid; gap: 12px; }
.rec-band.is-empty { background: #f4f6ea; }
.rec-band-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rec-band-head strong { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--dark); }
.rec-band-head svg { width: 18px; height: 18px; color: #5c7a45; }
.rec-band-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.rec-band-grid > div { display: grid; justify-items: center; gap: 2px; background: #f4f6ea; border-radius: 14px; padding: 10px 4px; }
.rec-band-grid i { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 9px; color: #fff; }
.rec-band-grid i svg { width: 15px; height: 15px; }
.rec-band-grid .b-steps { background: #6fa06b; }
.rec-band-grid .b-heart { background: #c75b5b; }
.rec-band-grid .b-sleep { background: #5e5ce6; }
.rec-band-grid .b-kcal { background: #e0a63c; }
.rec-band-grid strong { font-size: 17px; color: var(--dark); font-variant-numeric: tabular-nums; }
.rec-band-grid span { font-size: 11px; color: var(--muted, #6b7261); }
.rec-band-note { font-size: 12px; color: var(--muted, #6b7261); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rec-apps { display: grid; gap: 8px; }
.rec-app { display: flex; align-items: center; gap: 12px; background: var(--card, #fff); border: 1px solid var(--social-stroke); border-radius: 16px; padding: 10px 12px; }
.rec-app-dot { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; }
.rec-app-dot svg { width: 18px; height: 18px; }
.rec-app strong { font-size: 14px; color: var(--dark); display: block; }
.rec-app .primary, .rec-app .secondary { min-height: 44px; font-size: 13px; flex: 0 0 auto; }
.rec-chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; background: var(--card, #fff); border: 1px solid var(--social-stroke); border-radius: 18px; padding: 14px 10px 10px; height: 150px; }
.rec-chart-col { display: grid; grid-template-rows: 1fr auto auto; justify-items: center; gap: 4px; height: 100%; min-width: 0; }
.rec-chart-col b { width: 70%; max-width: 26px; align-self: end; border-radius: 7px 7px 3px 3px; transition: height 300ms var(--social-ease); transform-origin: bottom; }
.rec-page.rec-enter .rec-chart-col b { animation: bar-grow 420ms var(--social-ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
@keyframes bar-grow { from { transform: scaleY(0); } }
.rec-band-grid > div.pop-in { animation: pop-in 220ms var(--social-ease) both; }
.rec-chart-col span { font-size: 11px; color: var(--dark); font-variant-numeric: tabular-nums; min-height: 14px; }
.rec-chart-col small { font-size: 11px; color: var(--muted, #6b7261); white-space: nowrap; }
.rec-history { display: grid; gap: 8px; }
.rec-history-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--card, #fff); border: 1px solid var(--social-stroke); border-radius: 16px; padding: 10px; cursor: pointer; min-height: 64px; }
.rec-history-item img { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; flex: 0 0 48px; }
.rec-history-item strong { font-size: 14px; color: var(--dark); display: block; }
.rec-history-item > svg { width: 16px; height: 16px; color: var(--muted, #6b7261); flex: 0 0 16px; }
.rec-history-item:hover { border-color: #a3ae90; }
.rec-scopes { display: grid; gap: 8px; margin: 10px 0 16px; padding: 0; list-style: none; }
.rec-scopes li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--dark); background: #f4f6ea; border-radius: 12px; padding: 10px 12px; }
.rec-scopes svg { width: 17px; height: 17px; color: #5c7a45; }
@media (max-width: 360px) {
  .rec-summary { flex-direction: column; align-items: stretch; }
  .rec-ring-wrap { margin: auto; }
  .rec-band-grid { grid-template-columns: repeat(2, 1fr); }
  .field-row.four { grid-template-columns: repeat(2, 1fr); }
  .rec-row-thumb { display: none; }
}
/* 自绘选择器：居中奶油卡片，叠在 sheet 之上的第二层 dialog */
dialog.pk {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(340px, calc(100vw - 40px));
  max-width: 340px;
  height: fit-content;
  max-height: min(560px, calc(100dvh - 48px));
  border-radius: 22px;
  box-shadow: 0 18px 60px #1f352140;
  overflow: hidden;
}
dialog.pk[open] { display: flex; flex-direction: column; }
dialog.pk::backdrop { background: #25292259; }
dialog.pk[open] .pk-card { animation: pk-pop 200ms var(--social-ease) both; }
@keyframes pk-pop { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
.pk-card { display: flex; flex-direction: column; min-height: 0; }
.pk-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0; padding: 10px 10px 8px 20px; border-bottom: 1px solid var(--line); background: var(--cream); }
.pk-head strong { font-size: 16px; color: var(--dark); }
.pk-head .icon-button { flex: 0 0 44px; }
.pk-body { padding: 12px 16px 16px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #a3ae90 var(--cream); }
.pk-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.pk-nav strong { font-size: 15px; color: var(--dark); }
.pk-nav .icon-button { width: 44px; height: 44px; }
.pk-week, .pk-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.pk-week span { padding: 6px 0; text-align: center; font-size: 12px; color: var(--muted); }
.pk-day { min-height: 44px; border: 0; border-radius: 12px; background: transparent; font-size: 15px; color: var(--text); transition: background-color 160ms var(--social-ease), color 160ms var(--social-ease), transform 160ms var(--social-ease); }
.pk-day:hover { background: var(--soft); }
.pk-day:active { transform: scale(.94); }
.pk-day.is-today { box-shadow: inset 0 0 0 2px var(--green); font-weight: 700; }
.pk-day.is-selected { background: var(--green); color: #fff; font-weight: 700; }
.pk-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
.pk-foot button { min-height: 44px; }
.pk-list { display: flex; flex-direction: column; gap: 4px; }
.pk-option { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 10px 14px; border: 1.5px solid transparent; border-radius: 14px; background: transparent; font-size: 16px; color: var(--text); text-align: left; transition: background-color 160ms var(--social-ease), border-color 160ms var(--social-ease); }
.pk-option:hover { background: var(--soft); }
.pk-option[aria-selected="true"] { background: var(--soft); border-color: var(--green); font-weight: 700; }
.pk-check { display: grid; place-items: center; width: 20px; height: 20px; color: var(--green); opacity: 0; transform: scale(.6); transition: opacity 160ms var(--social-ease), transform 160ms var(--social-ease); }
.pk-check svg { width: 18px; height: 18px; }
.pk-option[aria-selected="true"] .pk-check { opacity: 1; transform: none; }
.field-trigger { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 48px; padding: 12px; border: 1.5px solid var(--social-stroke); border-radius: 14px; background: #fff; font-size: 16px; color: var(--text); text-align: left; transition: border-color 160ms var(--social-ease), box-shadow 160ms var(--social-ease); }
.field-trigger > svg { width: 18px; height: 18px; color: var(--muted); flex: 0 0 18px; }
.field-trigger:hover:not(:disabled) { border-color: var(--green); }
.field-trigger:disabled { opacity: .6; }
.field-trigger[aria-invalid="true"] { border-color: #c0563f; }
.field-trigger.pk-set { animation: pk-set 320ms var(--social-ease); }
@keyframes pk-set { from { box-shadow: 0 0 0 0 #6fa06b66; } to { box-shadow: 0 0 0 10px #6fa06b00; } }
.pk-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pk-duo-item { display: block; min-width: 0; }
@media (prefers-reduced-motion: reduce) {
  .rec-page.rec-enter > *, .rec-scanning span, .rec-result-status svg, .rec-page.rec-enter .rec-chart-col b, .rec-band-grid > div.pop-in { animation: none; }
  .rec-ring circle, .rec-macro-bar b, .rec-chart-col b, .rec-shutter, .rec-row { transition: none; }
  .rec-shutter:active { transform: translateX(-50%); }
  dialog.pk[open] .pk-card, .field-trigger.pk-set { animation: none; }
  .pk-day, .pk-option, .pk-check, .field-trigger { transition: none; }
}
