:root {
  --green: #22735b;
  --green-2: #2fa77f;
  --ink: #1f2a33;
  --soft-blue: #eaf2f7;
  --mint: #edf7f1;
  --bg: #f4f2ee;
  --text: #22272f;
  --muted: #858b96;
  --line: #e7e9ed;
  --danger: #e04f5f;
  --amber: #f0a51a;
  --body-bg: #e6e4df;
  --phone-bg: var(--bg);
  --topbar-bg: #fbfaf7;
  --card-bg: rgba(255,255,255,.92);
  --card-border: rgba(31,42,51,.08);
  --surface: #fffdf8;
  --surface-2: #f7fbfa;
  --night: #1f2a33;
  --aqua: #2fa77f;
  --sea: #246b7a;
  --page-bg: #f4f2ee;
  --section-bg: #ffffff;
  --row-bg: #ffffff;
  --raised-bg: #f7fbfa;
  --divider: rgba(31,42,51,.08);
  --accent: #2fa77f;
  --nav-muted: rgba(36,67,90,.56);
}

/* App Review safety and account-management flows */
.auth-login-agreement {
  margin: 2px 0 0;
  color: #7b8782;
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}
.auth-login-agreement button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent, #169978);
  font: inherit;
}
.account-safety-card,
.account-danger-zone { margin-top: 14px; }
.account-settings-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 0;
  padding: 12px 0;
  background: transparent;
  color: inherit;
  text-align: left;
}
.account-settings-row span { display: grid; gap: 5px; }
.account-settings-row strong { font-size: 15px; }
.account-settings-row small { color: #8b9691; line-height: 1.45; }
.account-settings-row em { color: var(--accent, #169978); font-size: 13px; font-style: normal; white-space: nowrap; }
.blocked-user-list { border-top: 1px solid rgba(29, 66, 55, .08); }
.blocked-user-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid rgba(29, 66, 55, .07);
}
.blocked-user-avatar { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; }
.blocked-user-row strong { font-size: 14px; }
.blocked-user-row > span { display: grid; gap: 3px; }
.blocked-user-row > span small { color: #8b9691; font-size: 11px; }
.blocked-user-row button {
  border: 1px solid rgba(22, 153, 120, .25);
  border-radius: 999px;
  padding: 7px 11px;
  background: #fff;
  color: var(--accent, #169978);
  font-size: 12px;
}
.blocked-user-empty { margin: 12px 0 2px; }
.account-danger-zone { border: 1px solid rgba(211, 73, 73, .14); }
.account-delete-button {
  min-height: 44px;
  border: 0;
  border-radius: 13px;
  padding: 0 16px;
  background: #fff0ef;
  color: #c84242;
  font-weight: 700;
}
.account-delete-button:disabled { opacity: .45; }
html[data-theme-color="dark"] .account-delete-button {
  border: 1px solid rgba(255, 132, 142, .38);
  color: #fff;
  background: #c8424d;
  box-shadow: 0 5px 14px rgba(200, 66, 77, .22);
}
html[data-theme-color="dark"] .account-delete-button:disabled {
  color: #ffe9eb;
  background: #7b343b;
  opacity: 1;
}
.safety-dialog-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 10px; margin-top: 18px; }
.account-delete-warning {
  margin: 12px 0 16px;
  border-radius: 14px;
  padding: 13px 14px;
  background: #fff5f3;
  color: #8f3d3d;
  line-height: 1.55;
}
.account-delete-warning p { margin: 6px 0 0; }
.account-delete-dialog form { display: grid; gap: 14px; }
.account-delete-dialog form > label:first-child { display: grid; gap: 8px; color: #43514c; font-size: 13px; }
.account-delete-check { display: flex; align-items: flex-start; gap: 9px; color: #59655f; font-size: 13px; line-height: 1.5; }
.community-chat-more {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(24, 88, 70, .07);
  color: #53645e;
  letter-spacing: 1px;
}

.community-chat-more-sheet .market-detail-more-actions button:nth-child(1) > span { background: #5f8f83; }
.community-chat-more-sheet .market-detail-more-actions button:nth-child(2) > span { background: #f06a76; }
.community-chat-more-sheet .market-detail-more-actions button:nth-child(3) > span { background: var(--accent, #2fa77f); }

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: #e6e4df;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }

.phone-shell {
  width: min(430px, 100vw);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  box-shadow: 0 0 36px rgba(0,0,0,.12);
  position: relative;
  overflow-x: hidden;
}

.pull-refresh-indicator {
  --pull-refresh-distance: 0px;
  position: fixed;
  z-index: 1200;
  /* The hint belongs in the gap revealed directly below the fixed header. */
  top: var(--pull-refresh-header-bottom, max(8px, env(safe-area-inset-top, 0px)));
  left: 50%;
  min-width: 116px;
  height: 36px;
  min-height: 36px;
  box-sizing: border-box;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--topbar-bg);
  box-shadow: 0 8px 20px rgba(22, 48, 57, .16);
  font-size: 12px;
  font-weight: 650;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-50%, calc(-100% + var(--pull-refresh-distance)), 0);
  transition: transform .18s ease, opacity .18s ease;
}

.pull-refresh-indicator.is-visible,
.pull-refresh-indicator.is-refreshing {
  opacity: 1;
}

.pull-refresh-indicator i {
  width: 15px;
  height: 15px;
  box-sizing: border-box;
  flex: 0 0 15px;
  border: 2px solid color-mix(in srgb, var(--accent) 26%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  transition: transform .18s ease;
}

.pull-refresh-indicator.is-ready i {
  border-top-color: transparent;
  border-right-color: var(--accent);
  transform: rotate(135deg);
}

.pull-refresh-indicator.is-refreshing i {
  animation: pull-refresh-spin .75s linear infinite;
}

/* 龟集市、消息与龟友圈下拉刷新：垂直滚动仍完全交给 WKWebView 的
   原生惯性与回弹；提示层只显示状态，绝不再用 JS 移动整页内容。 */
body.pull-refresh-active .content {
  transform: none;
  transition: none;
  will-change: auto;
}

body.pull-refresh-dragging .content {
  transition: none;
}

body.pull-refresh-dragging .pull-refresh-indicator {
  transition: none;
}

html,
body {
  /* Vertical scrolling and the elastic top-edge bounce belong to WKWebView.
     The refresh UI observes that motion but never replaces it. */
  overscroll-behavior-y: auto;
}

.market-detail-video-shell {
  position: relative;
  overflow: hidden;
  background: #111;
}

.market-detail-video-shell .market-detail-video-cover {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #111;
  transition: opacity .16s ease;
}

.market-detail-video-shell > video { position: relative; z-index: 2; }
.market-detail-video-shell.is-ready .market-detail-video-cover { opacity: 0; pointer-events: none; }
.market-detail-video-loading { position: absolute; z-index: 3; left: 50%; top: 50%; padding: 6px 10px; transform: translate(-50%, -50%); border-radius: 999px; color: #fff; background: rgba(0, 0, 0, .48); font-size: 12px; pointer-events: none; }
.market-detail-video-shell.is-ready .market-detail-video-loading { opacity: 0; }

/* Videos keep native inline playback.  Only the explicit top-right control
   opens the zoomed viewer, so pressing play never becomes a preview action. */
.inline-video-shell {
  position: relative;
  width: 100%;
  height: 100%;
}

.inline-video-shell > video {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes pull-refresh-spin {
  to { transform: rotate(360deg); }
}

.force-update-screen {
  min-height: 100vh;
  padding: max(72px, env(safe-area-inset-top, 0px) + 52px) 28px max(40px, env(safe-area-inset-bottom, 0px) + 24px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  text-align: center;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 10%, rgba(47, 167, 127, .18), transparent 34%),
    radial-gradient(circle at 16% 92%, rgba(36, 107, 122, .12), transparent 38%),
    var(--surface);
}

.force-update-mark {
  width: 66px;
  height: 66px;
  margin: 0 auto 24px;
  display: grid;
  place-items: center;
  border-radius: 23px;
  color: #fff;
  background: linear-gradient(145deg, var(--green-2), var(--green));
  box-shadow: 0 16px 30px rgba(34, 115, 91, .2);
  font-size: 34px;
  font-weight: 800;
}

.force-update-eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: .06em;
}

.force-update-screen h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.35;
  letter-spacing: -.02em;
}

.force-update-copy {
  max-width: 310px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.force-update-version {
  width: fit-content;
  max-width: 100%;
  margin: 24px auto 32px;
  padding: 9px 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(34, 115, 91, .12);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(237, 247, 241, .74);
  font-size: 12px;
}

.force-update-version i {
  width: 4px;
  height: 4px;
  flex: 0 0 4px;
  border-radius: 50%;
  background: #a5b7af;
}

.force-update-version strong {
  color: var(--green);
  font-weight: 750;
}

.force-update-primary {
  width: 100%;
  min-height: 52px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 750;
  box-shadow: 0 12px 24px rgba(47, 167, 127, .2);
}

.force-update-recheck {
  margin: 15px auto 0;
  padding: 9px 6px;
  color: var(--green);
  background: transparent;
  font-size: 13px;
}

.status {
  height: 38px;
  padding: 10px 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink);
  font-weight: 700;
}
.topbar {
  background: #fbfaf7;
  color: var(--ink);
  min-height: 96px;
  border-bottom: 1px solid rgba(31,42,51,.08);
}
.nav-title {
  height: 58px;
  display: grid;
  grid-template-columns: 54px 1fr 54px;
  align-items: center;
  padding: 0 10px;
}
.nav-title h1 {
  margin: 0;
  font-size: 18px;
  text-align: center;
  letter-spacing: 0;
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 20px;
  background: transparent;
  color: inherit;
  font-size: 26px;
}
.content {
  padding: 14px 14px 92px;
}
.card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(31, 42, 51, .06);
  border: 1px solid rgba(0,0,0,.03);
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 800;
}
.section-title small {
  color: var(--green-2);
  font-size: 15px;
  font-weight: 600;
}

.stats {
  padding: 20px 16px;
  margin-bottom: 14px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stat {
  min-height: 78px;
  border-radius: 8px;
  background: #fbfcfb;
  display: grid;
  place-items: center;
  color: #777;
}
.stat strong {
  display: block;
  color: var(--green);
  font-size: 28px;
  line-height: 1;
}
.stat.danger strong { color: #e63d43; }
.stat.warn strong { color: var(--amber); }

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0;
}
.module {
  min-height: 94px;
  padding: 14px 8px;
  border-radius: 8px;
  background: white;
  box-shadow: 0 8px 20px rgba(31,45,61,.06);
  color: var(--text);
  display: grid;
  place-items: center;
  gap: 5px;
}
.module span:first-child { font-size: 28px; }
.module small { color: #b7bcc4; }

.recent {
  padding: 18px 14px;
}
.home-redesign {
  background:
    linear-gradient(180deg, #fbfaf7 0, rgba(244,242,238,0) 260px),
    var(--bg);
}
.home-hero {
  min-height: 190px;
  border-radius: 8px;
  padding: 24px 18px 48px;
  display: grid;
  grid-template-columns: 1fr 58px;
  align-items: center;
  color: white;
  background:
    radial-gradient(circle at 82% 18%, rgba(255,255,255,.20), transparent 28%),
    linear-gradient(135deg, var(--ink), var(--green-2));
  box-shadow: 0 18px 32px rgba(36, 67, 90, .20);
}
.home-hero h2 {
  margin: 10px 0 10px;
  font-size: 28px;
  line-height: 1.22;
  letter-spacing: 0;
}
.home-hero p {
  margin: 0;
  color: rgba(255,255,255,.82);
  line-height: 1.55;
  max-width: 230px;
}
.eyebrow {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  font-size: 13px;
  font-weight: 700;
}
.hero-add {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: white;
  color: var(--green);
  font-size: 30px;
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(0,0,0,.15);
  align-self: center;
}
.metric-strip {
  margin: -30px 12px 16px;
  padding: 14px 10px;
  border-radius: 8px;
  background: white;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  box-shadow: 0 12px 26px rgba(31,45,61,.10);
  position: relative;
  z-index: 1;
}
.metric-strip div {
  min-width: 0;
  text-align: center;
}
.metric-strip strong {
  display: block;
  color: var(--green);
  font-size: 23px;
  line-height: 1.1;
}
.metric-strip span {
  color: var(--muted);
  font-size: 12px;
}
.metric-strip .danger strong { color: var(--danger); }
.action-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.action-panel button {
  min-height: 76px;
  border-radius: 8px;
  background: white;
  color: var(--text);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  border: 1px solid rgba(0,0,0,.03);
  box-shadow: 0 8px 18px rgba(31,45,61,.06);
}
.action-panel span {
  width: 30px;
  height: 30px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--mint);
  color: var(--green);
  font-weight: 800;
}
.action-panel strong {
  font-size: 14px;
}

.care-action-panel {
  grid-template-columns: 1fr;
}

.action-panel .care-action {
  min-height: 72px;
  grid-template-columns: 40px minmax(0, 1fr);
  grid-template-rows: auto auto;
  place-items: initial;
  align-items: center;
  justify-items: start;
  column-gap: 12px;
  row-gap: 2px;
  padding: 12px 16px;
  text-align: left;
}

.action-panel .care-action span {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: center;
}

.action-panel .care-action strong,
.action-panel .care-action small {
  grid-column: 2;
  max-width: none;
}

.action-panel .care-action strong {
  grid-row: 1;
  align-self: end;
}

.action-panel .care-action small {
  grid-row: 2;
  align-self: start;
}
.home-turtles {
  padding: 2px 0 0;
}
.home-turtle-grid {
  display: grid;
  gap: 10px;
}
.home-turtle-card {
  min-height: 94px;
  border-radius: 8px;
  background: white;
  padding: 10px;
  display: grid;
  grid-template-columns: 72px 1fr;
  grid-template-rows: auto auto;
  gap: 8px 12px;
  box-shadow: 0 8px 18px rgba(31,45,61,.06);
  border: 1px solid rgba(0,0,0,.03);
}
.home-turtle-card img {
  grid-row: 1 / 3;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--mint);
}
.home-turtle-card strong {
  display: block;
  font-size: 18px;
  margin-top: 4px;
}
.home-turtle-card span {
  color: var(--muted);
  font-size: 13px;
}
.home-turtle-meta {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.home-turtle-meta span {
  padding: 3px 8px;
  border-radius: 99px;
  background: #f4f6f8;
  color: #596270;
  font-weight: 700;
}
.page-fresh {
  background:
    linear-gradient(180deg, #fbfaf7 0, rgba(244,242,238,0) 220px),
    var(--bg);
}
.page-intro {
  min-height: 148px;
  padding: 20px 18px;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 1fr 54px;
  gap: 12px;
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(31,42,51,.06);
  box-shadow: 0 12px 26px rgba(31,42,51,.07);
  margin-bottom: 14px;
}
.page-intro.compact {
  min-height: auto;
  grid-template-columns: 1fr;
}
.page-intro h2 {
  margin: 8px 0 8px;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}
.page-intro p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.eyebrow.dark {
  background: var(--soft-blue);
  color: var(--ink);
}
.round-action {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-size: 28px;
  font-weight: 700;
}
.filter-dock {
  padding: 12px;
  border-radius: 8px;
  background: #ffffff;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  box-shadow: 0 8px 18px rgba(31,42,51,.05);
  margin-bottom: 12px;
}
.list-count {
  color: #68727d;
  font-size: 14px;
  margin: 8px 2px 12px;
}
.fresh-card {
  background: white;
  border-radius: 8px;
  border: 1px solid rgba(31,42,51,.06);
  box-shadow: 0 10px 22px rgba(31,42,51,.055);
}
.fresh-search {
  border: 1px solid rgba(31,42,51,.06);
  box-shadow: 0 8px 18px rgba(31,42,51,.05);
}

.species-search-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  position: sticky;
  top: 88px;
  z-index: 6;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(16px);
}

.species-search-card > span {
  min-width: 48px;
  min-height: 34px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: var(--mint);
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.species-search-card .fresh-search {
  box-shadow: none;
  min-height: 44px;
}
.soft-row {
  width: 100%;
  min-height: 72px;
  border-radius: 8px;
  background: white;
  color: var(--text);
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  text-align: left;
  margin-bottom: 14px;
  border: 1px solid rgba(31,42,51,.06);
  box-shadow: 0 8px 18px rgba(31,42,51,.05);
}
.soft-row > span {
  width: 36px;
  height: 36px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--soft-blue);
  color: var(--ink);
  font-weight: 800;
}
.soft-row strong { font-size: 16px; }
.soft-row small { color: var(--muted); }
.breed-panel {
  overflow: hidden;
  margin-bottom: 14px;
}
.memo-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}
.memo-tabs .tab {
  border-radius: 8px;
  border: 1px solid rgba(31,42,51,.06);
  padding: 12px 6px;
}
.memo-tabs .tab.active {
  background: var(--ink);
  color: white;
  border-bottom: 0;
}
.memo-form {
  padding: 16px;
  margin-bottom: 14px;
}
.memo-form label {
  display: block;
  margin-top: 12px;
}
.memo-form label span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
.memo-form .primary {
  margin-top: 14px;
}
.activity-list {
  display: grid;
  gap: 12px;
}
.activity-row {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  padding: 14px;
}
.activity-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green-2);
  margin: 8px auto 0;
  box-shadow: 0 0 0 5px var(--mint);
}
.activity-row strong {
  color: var(--ink);
}
.activity-row p {
  margin: 4px 0 6px;
  color: var(--text);
  line-height: 1.45;
}
.activity-row small {
  color: var(--muted);
}
.small-empty {
  min-height: 220px;
}
.account-login { margin-bottom: 14px; }

.logout-card {
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  border-radius: 8px;
  background: #e04f5f;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 14px 28px rgba(224, 79, 95, .22);
}

.settings-card {
  padding: 16px;
  margin-bottom: 14px;
}
.settings-title {
  font-weight: 800;
  margin-bottom: 12px;
}
.theme-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.theme-dot {
  min-height: 64px;
  border-radius: 8px;
  background: #f7f8f8;
  color: #596270;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 700;
}
.theme-dot span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}
.theme-dot.teal span { background: #2fa77f; }
.theme-dot.forest span { background: #6aa84f; }
.theme-dot.ocean span { background: #3aa5b5; }
.theme-dot.plum span { background: #a678b5; }
.theme-dot.dark span { background: #080a0f; }
.theme-dot.active {
  border-color: var(--green-2);
  color: var(--ink);
  background: var(--mint);
}
.ledger-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.ledger-summary div {
  min-height: 96px;
  padding: 16px 12px;
  border-radius: 8px;
  background: white;
  box-shadow: 0 8px 18px rgba(31,42,51,.05);
  display: grid;
  align-content: center;
  gap: 6px;
}
.ledger-summary strong {
  color: var(--ink);
  font-size: 22px;
}
.ledger-summary span {
  color: var(--muted);
  font-size: 13px;
}
.ledger-summary .danger strong {
  color: var(--danger);
}
.ledger-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.ledger-actions .secondary {
  width: 100%;
  min-height: 52px;
  border-radius: 28px;
  color: var(--ink);
  font-weight: 800;
}
.ledger-row {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 14px 12px 38px;
  margin-bottom: 10px;
  cursor: pointer;
}
.ledger-row-main {
  min-width: 0;
  display: grid;
  gap: 4px;
  align-content: start;
}
.ledger-row-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  line-height: 1.35;
  flex-wrap: wrap;
}
.ledger-row p {
  margin: 4px 0;
  color: #596270;
}
.ledger-type {
  width: 46px;
  height: 46px;
  border-radius: 23px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 800;
  background: var(--ink);
  font-size: 13px;
}
.ledger-type.loss {
  background: var(--danger);
}
.ledger-type.purchase {
  background: var(--green-2);
}
.ledger-amount {
  color: var(--ink);
  font-weight: 900;
  font-size: 18px;
  align-self: center;
  justify-self: end;
  white-space: nowrap;
}
.ledger-amount.danger {
  color: var(--danger);
}
.ledger-inline-type {
  display: inline-flex;
  align-items: center;
  margin-right: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--soft-blue);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
  vertical-align: 2px;
  flex: 0 0 auto;
}
.ledger-inline-type.sold {
  background: #eaf7f1;
  color: var(--green);
}
.ledger-inline-type.loss {
  background: #fff0f1;
  color: var(--danger);
}
.ledger-inline-type.purchase {
  background: #eef5ff;
  color: #246b7a;
}
.ledger-delete {
  position: absolute;
  right: 12px;
  bottom: 10px;
  font-size: 13px;
}
.ledger-form {
  padding: 16px;
  margin-bottom: 14px;
}
.ledger-shell {
  display: block;
}
.ledger-shell > .primary {
  margin-top: 2px;
}
.ledger-shell .form-block {
  margin-bottom: 14px;
}
.readonly-radio .choice {
  opacity: .72;
  cursor: default;
}
.form-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 14px;
}
.form-head h3 {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 20px;
}
.ledger-photo-picker {
  margin-bottom: 12px;
}
.ledger-photo-box {
  width: 104px;
  height: 104px;
}
.ledger-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.ledger-form-grid label span {
  display: block;
  margin: 0 0 6px;
  color: #596270;
  font-size: 13px;
  font-weight: 700;
}
.ledger-thumb {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--mint);
}
.ledger-dims {
  font-size: 12px;
  color: #68727d;
}
.ledger-detail-hero {
  overflow: hidden;
  margin-bottom: 12px;
}
.ledger-detail-hero img,
.ledger-detail-empty {
  width: 100%;
  aspect-ratio: 1.25;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: var(--mint);
  color: var(--ink);
  font-size: 26px;
  font-weight: 900;
}
.ledger-detail-card {
  padding: 16px;
}
.ledger-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.ledger-detail-head strong {
  color: var(--ink);
  font-size: 24px;
}
.danger-text {
  color: var(--danger) !important;
}
.ledger-detail-card h2 {
  margin: 0 0 6px;
  font-size: 22px;
}
.turtle-row {
  display: grid;
  grid-template-columns: 68px 1fr auto;
  align-items: center;
  gap: 12px;
}
.turtle-photo {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--mint);
}
.tag {
  display: inline-flex;
  align-items: center;
  min-width: 32px;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 99px;
  background: #ffeef4;
  color: #c83f6a;
  font-size: 13px;
  font-weight: 700;
}
.muted { color: var(--muted); }
.weight {
  color: var(--green-2);
  font-weight: 800;
  font-size: 20px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: white;
  border-bottom: 1px solid var(--line);
}
.tab {
  padding: 15px 6px;
  background: white;
  color: var(--muted);
  font-weight: 700;
  font-size: 17px;
}
.tab.active {
  color: var(--green);
  border-bottom: 3px solid var(--green-2);
}
.pill-row {
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 12px 0;
}
.pill-row > * { flex: 1; }
.primary {
  width: 100%;
  min-height: 52px;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--ink), var(--green-2));
  color: white;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 10px 20px rgba(36,67,90,.18);
}
.secondary {
  min-height: 44px;
  border-radius: 22px;
  background: white;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 0 14px;
}
.select, .field, textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 0 14px;
  color: var(--text);
}
textarea {
  padding-top: 12px;
  min-height: 96px;
  resize: vertical;
}

.list-card {
  padding: 14px;
  margin-bottom: 10px;
  position: relative;
  border-radius: 8px;
  cursor: pointer;
}
.delete-floating,
.more-floating {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 30px;
  height: 30px;
  border-radius: 15px;
  background: #f4f6f8;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  z-index: 2;
}
.turtle-menu {
  position: absolute;
  right: 0;
  top: 44px;
  width: 118px;
  border-radius: 0;
  background: white;
  box-shadow: 0 18px 38px rgba(31,42,51,.16);
  border: 1px solid rgba(31,42,51,.08);
  overflow: hidden;
  z-index: 4;
}
.turtle-menu button {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  background: white;
  text-align: left;
  border-bottom: 1px solid #f0f1f3;
  font-size: 16px;
  font-weight: 900;
}
.turtle-menu button:last-child {
  border-bottom: 0;
}
.turtle-detail-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
}
.turtle-detail-hero img {
  display: block;
  width: 100%;
  aspect-ratio: 1.25;
  object-fit: cover;
  background: var(--mint);
}
.detail-more {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 19px;
  background: rgba(255,255,255,.92);
  color: var(--ink);
  font-weight: 900;
}
.turtle-detail-hero .turtle-menu {
  top: 54px;
  right: 12px;
}
.detail-card {
  padding: 16px;
  margin-bottom: 12px;
}
.detail-card h2 {
  margin: 0 0 4px;
  font-size: 24px;
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.detail-grid div {
  min-height: 62px;
  border-radius: 8px;
  background: #f7f8f8;
  padding: 10px;
}
.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.detail-grid strong {
  color: var(--ink);
}
.detail-note {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid #f0f1f3;
  color: #596270;
}
.history-card {
  padding: 16px;
}
.update-card {
  padding: 16px;
  margin-bottom: 12px;
}
.update-card .primary {
  margin-top: 14px;
}
.history-card h3 {
  margin: 0 0 12px;
  color: var(--ink);
}
.history-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid #f0f1f3;
}
.history-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.history-photos {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.history-photos img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--mint);
}
.meta-line {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f1f3;
  display: flex;
  justify-content: space-between;
  color: #66707d;
}

.search {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 8px;
  background: white;
  border-radius: 26px;
  padding: 0 16px;
  min-height: 52px;
  margin-bottom: 12px;
}
.search input {
  border: 0;
  outline: 0;
  min-width: 0;
}
.species-section h2 {
  font-size: 18px;
  margin: 22px 4px 10px;
  color: var(--ink);
}
.species-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.species-card {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 84px 1fr;
  min-height: 92px;
  box-shadow: 0 8px 18px rgba(31,42,51,.05);
  border: 1px solid rgba(31,42,51,.05);
}
.species-card img {
  width: 84px;
  height: 92px;
  object-fit: cover;
  background: var(--mint);
}
.species-card div {
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}
.species-card strong {
  font-size: 15px;
  line-height: 1.25;
}
.text-green {
  color: var(--green-2);
  font-weight: 800;
  background: transparent;
  padding: 0;
  text-align: left;
}

.form-block {
  margin-bottom: 20px;
  padding: 16px;
}
.form-block h3 {
  color: var(--ink);
  font-size: 17px;
  margin: 0 0 12px;
}
.label {
  font-weight: 800;
  margin: 12px 0 8px;
}
.required { color: #e33943; }
.photo-picker {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 20px;
  align-items: center;
}
.photo-box {
  width: 92px;
  height: 92px;
  border: 1px dashed #d8dde3;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  overflow: hidden;
}
.photo-box img { width: 100%; height: 100%; object-fit: cover; }
.radio-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.choice {
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--muted);
  font-weight: 700;
}
.choice.active {
  border-color: var(--green-2);
  color: var(--green);
  background: var(--mint);
}
.hidden-file {
  width: .1px;
  height: .1px;
  opacity: 0;
  position: absolute;
}

.breed-row, .memo-row, .mine-row {
  padding: 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #f0f1f3;
}
.code-badge {
  min-width: 56px;
  padding: 8px 12px;
  border-radius: 4px;
  background: var(--mint);
  color: var(--green-2);
  font-weight: 800;
  text-align: center;
}
.danger-link {
  color: var(--danger);
  background: transparent;
}
.memo-row {
  grid-template-columns: 1fr auto;
  align-items: start;
}
.memo-row p { margin: 6px 0; color: #4e5662; }
.empty {
  min-height: 420px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}
.empty strong { color: var(--text); }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(430px, 100vw);
  height: 72px;
  background: white;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 5;
}
.bottom-nav button {
  background: white;
  color: #8d9299;
  font-size: 13px;
  font-weight: 600;
}
.bottom-nav button span {
  display: block;
  font-size: 22px;
  margin-bottom: 2px;
}
.bottom-nav button.active { color: var(--green-2); }

.section-title small,
.section-title button {
  background: transparent;
  color: var(--green-2);
  font-size: 15px;
  font-weight: 800;
}
.action-panel small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.turtle-row {
  position: relative;
  padding: 12px;
  margin-bottom: 10px;
}
.turtle-row .more-btn {
  width: 38px;
  height: 38px;
  border-radius: 19px;
  background: #f4f6f8;
  color: var(--ink);
  font-weight: 900;
}
.turtle-row .turtle-menu {
  top: 52px;
  right: 0;
}

.turtle-row.menu-open {
  overflow: visible;
  z-index: 12;
}

.turtle-row.menu-open .turtle-menu {
  z-index: 30;
}
.turtle-detail-hero > div {
  padding: 16px;
}
.turtle-detail-hero h2 {
  margin: 0 0 4px;
  font-size: 24px;
}
.turtle-detail-hero p {
  margin: 0 0 4px;
  color: #596270;
}
.detail-grid-card,
.note-card {
  padding: 16px;
  margin-bottom: 12px;
}
.photo-uploader {
  display: grid;
  grid-template-columns: 92px 1fr;
  align-items: center;
  gap: 12px;
  margin: 10px 0 14px;
}
.photo-uploader img,
.photo-uploader > span {
  width: 92px;
  height: 92px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--mint);
  display: grid;
  place-items: center;
  color: var(--green);
  font-weight: 800;
}
.ledger-form label,
.memo-form label {
  display: block;
  margin-top: 12px;
}
.ledger-form label span,
.memo-form label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.profile {
  background: linear-gradient(135deg, var(--ink), var(--green-2));
  color: white;
  padding: 26px 18px 30px;
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 16px;
  align-items: center;
}
.fresh-profile {
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
}
.avatar {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: #ddf6e7;
  display: grid;
  place-items: center;
  font-size: 52px;
  border: 4px solid rgba(255,255,255,.75);
}

.avatar-img,
.profile-avatar {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 4px solid rgba(255,255,255,.75);
  background: var(--mint);
}

.profile-edit-head {
  display: grid;
  grid-template-columns: 86px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
}

.profile-form-inner {
  display: grid;
  gap: 12px;
  margin: 12px 0;
}
.profile h2 { margin: 0 0 4px; font-size: 26px; }
.profile-phone {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 800;
  opacity: .86;
}
.mine-list { margin-top: 16px; overflow: hidden; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 86px;
  transform: translateX(-50%);
  width: min(360px, calc(100vw - 32px));
  padding: 12px 14px;
  background: rgba(30, 35, 42, .92);
  color: white;
  border-radius: 8px;
  text-align: center;
  z-index: 10;
}

@media (max-width: 370px) {
  .home-hero {
    grid-template-columns: 1fr 48px;
    min-height: 198px;
    padding-bottom: 52px;
  }
  .home-hero h2 {
    font-size: 25px;
  }
  .home-hero p {
    max-width: 200px;
  }
  .hero-add {
    width: 48px;
    height: 48px;
  }
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  .species-grid { grid-template-columns: 1fr; }
  .pill-row { flex-wrap: wrap; }
  .radio-row { grid-template-columns: 1fr; }
  .ledger-summary,
  .ledger-actions,
  .ledger-form-grid,
  .filter-dock {
    grid-template-columns: 1fr;
  }
  .theme-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Premium main-page polish: keeps the existing page structure, upgrades the feel. */
:root {
  --surface: #fffdf8;
  --surface-2: #f7fbfa;
  --night: #1f2a33;
  --aqua: #2fa77f;
  --sea: #246b7a;
  --rose: #e75f73;
  --gold: #d99a20;
}

body {
  background:
    radial-gradient(circle at 10% 0%, rgba(47, 167, 127, .16), transparent 28%),
    radial-gradient(circle at 90% 8%, rgba(36, 107, 122, .16), transparent 30%),
    #e8e5df;
}

.phone-shell {
  background: linear-gradient(180deg, #fbfaf7 0%, #f1eee8 42%, #f6f5f0 100%);
}

.topbar {
  min-height: 88px;
  background: rgba(251, 250, 247, .92);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 8;
}

.status {
  height: 30px;
  padding-top: 8px;
  font-size: 12px;
  color: rgba(31,42,51,.72);
}

.nav-title { height: 56px; }

.nav-title h1 {
  font-size: 19px;
  font-weight: 900;
}

.content { padding: 14px 14px 96px; }

.home-redesign,
.page-fresh {
  background:
    linear-gradient(180deg, rgba(255,255,255,.72) 0, rgba(244,242,238,0) 230px),
    transparent;
}

.home-hero {
  min-height: 176px;
  padding: 22px 18px 48px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 88% 18%, rgba(255,255,255,.30), transparent 22%),
    linear-gradient(138deg, #22334a 0%, #246b7a 48%, #2fa77f 100%);
  box-shadow: 0 22px 42px rgba(31,42,51,.20);
  border: 1px solid rgba(255,255,255,.18);
}

.home-hero h2 {
  font-size: 30px;
  font-weight: 950;
}

.eyebrow {
  background: rgba(255,255,255,.20);
  color: inherit;
  letter-spacing: 0;
}

.hero-add,
.round-action,
.action-panel button,
.home-turtle-card,
.turtle-row,
.ledger-row,
.mine-row {
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.hero-add:active,
.round-action:active,
.action-panel button:active,
.turtle-row:active,
.ledger-row:active,
.home-turtle-card:active,
.mine-row:active {
  transform: scale(.985);
}

.metric-strip {
  margin: -28px 10px 16px;
  padding: 12px 8px;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(31,42,51,.06);
  box-shadow: 0 18px 34px rgba(31,42,51,.12);
}

.metric-strip div {
  padding: 6px 2px;
  border-radius: 8px;
}

.metric-strip strong {
  font-size: 24px;
  font-weight: 950;
}

.metric-strip div:nth-child(2) strong { color: var(--aqua); }
.metric-strip div:nth-child(3) strong { color: var(--rose); }
.metric-strip div:nth-child(4) strong { color: var(--sea); }

/* Compact overview with all five counts on one row. */
.home-redesign .home-hero {
  min-height: 88px;
  padding: 16px 16px 44px;
  margin-bottom: 0;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) 58px;
}
.home-redesign .home-hero h2 { margin: 0; font-size: 26px !important; }
.metric-strip.home-overview-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: -28px 10px 16px;
  gap: 4px;
  padding: 8px 4px;
}
.home-overview-metrics > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-height: 66px;
  padding: 10px 2px;
  background: var(--surface, #f3f7f4);
}
.home-overview-metrics > div strong { font-size: 22px; line-height: 1.15; }
.home-overview-metrics > div span { font-size: 12px; line-height: 1.4; white-space: nowrap; }
.home-overview-metrics > div:nth-child(2) strong { color: var(--sea); }
.home-overview-metrics > div:nth-child(3) strong { color: var(--aqua); }
.home-overview-metrics > div:nth-child(4) strong,
.home-overview-metrics > div:nth-child(5) strong { color: var(--rose); }
@media (max-width: 360px) {
  .home-redesign .home-hero h2 { font-size: 22px !important; }
  .home-overview-metrics > div strong { font-size: 18px; }
  .home-overview-metrics > div span { font-size: 11px; }
}

.action-panel {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.action-panel button {
  min-height: 92px;
  padding: 12px 8px;
  border: 1px solid rgba(31,42,51,.07);
  box-shadow: 0 12px 26px rgba(31,42,51,.075);
}

.action-panel button:nth-child(1) span,
.action-panel button:nth-child(4) span { background: #eaf2f7; color: var(--sea); }
.action-panel button:nth-child(2) span,
.action-panel button:nth-child(6) span { background: #edf7f1; color: var(--aqua); }
.action-panel button:nth-child(3) span { background: #fff3df; color: var(--gold); }
.action-panel button:nth-child(5) span { background: #fff0f1; color: var(--rose); }

.action-panel span {
  width: 34px;
  height: 34px;
  border-radius: 17px;
  font-size: 17px;
}

.action-panel strong {
  font-size: 15px;
  font-weight: 900;
}

.action-panel small {
  max-width: 84px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-title {
  margin-top: 4px;
}

.section-title span,
.section-title h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 950;
}

.section-title small,
.section-title button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 17px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(31,42,51,.06);
}

.home-turtle-grid { gap: 12px; }

.home-turtle-card,
.turtle-row,
.ledger-row,
.fresh-card {
  border: 1px solid rgba(31,42,51,.07);
  box-shadow: 0 14px 30px rgba(31,42,51,.07);
}

.home-turtle-card {
  min-height: 104px;
  padding: 12px;
  grid-template-columns: 76px 1fr;
}

.home-turtle-card img {
  width: 76px;
  height: 76px;
}

.home-turtle-meta span { background: #f2f5f4; }

.page-intro {
  min-height: 132px;
  background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(247,251,250,.96));
  box-shadow: 0 14px 32px rgba(31,42,51,.08);
}

.page-intro h2 {
  font-size: 25px;
  font-weight: 950;
}

.archive-strip,
.account-brief {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.archive-strip div,
.account-brief div {
  min-height: 72px;
  padding: 12px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(31,42,51,.07);
  box-shadow: 0 12px 24px rgba(31,42,51,.06);
  text-align: center;
}

.archive-strip strong,
.account-brief strong {
  display: block;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.15;
  font-weight: 950;
}

.archive-strip span,
.account-brief span {
  color: var(--muted);
  font-size: 12px;
}

.archive-strip div:nth-child(1) strong { color: var(--sea); }
.archive-strip div:nth-child(2) strong { color: var(--aqua); }
.archive-strip div:nth-child(3) strong { color: var(--rose); }

.filter-dock {
  position: sticky;
  top: 88px;
  z-index: 6;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px);
}

.select,
.field,
textarea {
  border-color: rgba(31,42,51,.08);
  background: #fffdfa;
}

.select:focus,
.field:focus,
textarea:focus {
  outline: 2px solid rgba(47,167,127,.20);
  border-color: var(--aqua);
}

.turtle-row {
  min-height: 92px;
  grid-template-columns: 64px 1fr 42px;
}

.turtle-photo,
.turtle-row > img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
}

.turtle-row strong {
  font-size: 17px;
  font-weight: 950;
}

.turtle-row p {
  margin: 3px 0;
  color: #596270;
}

.more-btn,
.detail-more {
  display: grid;
  place-items: center;
}

.ledger-actions {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.ledger-date-filter {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  padding: 8px;
  margin-bottom: 12px;
}

.ledger-range {
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  background: rgba(118, 137, 149, 0.1);
  color: var(--muted);
  font: inherit;
  font-weight: 800;
}

.ledger-range.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 22px rgba(47, 167, 127, 0.22);
}

html[data-theme-color="dark"] .ledger-range {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(231, 231, 231, 0.72);
}

html[data-theme-color="dark"] .ledger-range.active {
  background: #06c46d;
  color: #fff;
  box-shadow: none;
}

.ledger-summary {
  margin-bottom: 12px;
}

.ledger-summary div {
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(31,42,51,.07);
  box-shadow: 0 12px 24px rgba(31,42,51,.06);
}

.ledger-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.ledger-summary strong {
  display: block;
  font-size: 20px;
  line-height: 1.2;
}

.ledger-summary small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.ledger-actions .primary,
.ledger-actions .secondary {
  min-height: 52px;
  border-radius: 8px;
  font-size: 15px;
}

.ledger-actions .secondary {
  background: #ffffff;
  border: 1px solid rgba(31,42,51,.08);
  box-shadow: 0 10px 22px rgba(31,42,51,.06);
}

.ledger-row {
  min-height: 92px;
  grid-template-columns: 58px 1fr auto;
  padding: 14px 12px 40px;
}

.ledger-thumb,
.ledger-type {
  width: 52px;
  height: 52px;
  border-radius: 8px;
}

.ledger-amount { font-size: 19px; }
.ledger-inline-type { font-weight: 900; }

.fresh-profile {
  margin: 0;
  padding: 22px 18px;
  background:
    radial-gradient(circle at 88% 12%, rgba(255,255,255,.30), transparent 24%),
    linear-gradient(135deg, #22334a, #246b7a 58%, #2fa77f);
  color: white;
  border-radius: 0 0 8px 8px;
}

.fresh-profile h2,
.fresh-profile p { color: white; }

.fresh-profile .tag {
  background: rgba(255,255,255,.18);
  color: white;
}

.avatar {
  background: rgba(255,255,255,.18);
  color: white;
  border: 1px solid rgba(255,255,255,.25);
}

.settings-card,
.mine-list { overflow: hidden; }

.mine-row {
  min-height: 64px;
  grid-template-columns: 42px 1fr;
}

.mine-row strong {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0;
}

.mine-row span:first-child {
  width: 34px;
  height: 34px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: #eef5ff;
  color: var(--sea);
}

.mine-row:nth-child(2) span:first-child { background: #fff3df; color: var(--gold); }
.mine-row:nth-child(3) span:first-child { background: #edf7f1; color: var(--aqua); }
.mine-row:nth-child(4) span:first-child { background: #fff0f1; color: var(--rose); }

.bottom-nav {
  height: 74px;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(31,42,51,.08);
  box-shadow: 0 -12px 28px rgba(31,42,51,.08);
  grid-template-columns: repeat(5, 1fr);
}

.bottom-nav button { font-size: 12px; }

.bottom-nav button span {
  width: 30px;
  height: 30px;
  margin: 0 auto 2px;
  border-radius: 15px;
  display: grid;
  place-items: center;
}

.bottom-nav button.active span {
  background: var(--mint);
  color: var(--green);
}

@media (max-width: 370px) {
  .action-panel { grid-template-columns: repeat(2, 1fr); }
  .ledger-actions { grid-template-columns: 1fr; }
  .ledger-date-filter { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter-dock { top: 84px; }
}

/* Full-app premium layer. */
* {
  -webkit-tap-highlight-color: transparent;
}

button,
.home-turtle-card,
.turtle-row,
.ledger-row,
.species-card,
.species-row,
.breed-row,
.memo-row,
.activity-row,
.mine-row {
  user-select: none;
}

.fresh-card,
.home-turtle-card,
.turtle-row,
.ledger-row,
.species-card,
.species-row,
.breed-row,
.memo-row,
.activity-row,
.settings-card,
.mine-list,
.form-block,
.ledger-form,
.memo-form,
.detail-grid-card,
.history-card,
.note-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(255,253,248,.96));
  border: 1px solid rgba(31,42,51,.075);
  box-shadow:
    0 14px 30px rgba(31,42,51,.075),
    inset 0 1px 0 rgba(255,255,255,.75);
}

.fresh-card:hover,
.home-turtle-card:hover,
.turtle-row:hover,
.ledger-row:hover,
.species-card:hover,
.species-row:hover,
.breed-row:hover,
.memo-row:hover,
.activity-row:hover,
.mine-row:hover {
  box-shadow:
    0 18px 38px rgba(31,42,51,.10),
    inset 0 1px 0 rgba(255,255,255,.80);
}

.primary {
  border-radius: 8px;
  background:
    linear-gradient(135deg, #1f2a33 0%, #246b7a 48%, #2fa77f 100%);
  box-shadow:
    0 14px 26px rgba(36,107,122,.22),
    inset 0 1px 0 rgba(255,255,255,.18);
  letter-spacing: 0;
}

.primary:active,
.secondary:active,
.text-green:active,
.danger-link:active,
.theme-dot:active,
.choice:active {
  transform: scale(.985);
}

.secondary {
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8faf9);
  box-shadow: 0 8px 18px rgba(31,42,51,.055);
}

.danger-link {
  font-weight: 800;
}

.text-green {
  color: var(--sea);
  font-weight: 900;
}

.select,
.field,
textarea {
  min-height: 50px;
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.82);
}

textarea {
  line-height: 1.5;
}

.label {
  color: #334150;
  font-size: 13px;
}

.form-block {
  margin-bottom: 14px;
}

.form-block h3,
.form-head h3,
.settings-title {
  font-size: 18px;
  font-weight: 950;
  color: var(--night);
}

.photo-uploader,
.photo-picker {
  padding: 12px;
  border-radius: 8px;
  background: #f7fbfa;
  border: 1px dashed rgba(36,107,122,.18);
}

.photo-uploader img,
.photo-uploader > span,
.photo-box,
.ledger-photo-box {
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(31,42,51,.06);
}

.choice {
  border-radius: 8px;
  background: #fffdfa;
}

.choice.active {
  box-shadow: 0 10px 20px rgba(47,167,127,.12);
}

.memo-tabs {
  padding: 4px;
  border-radius: 8px;
  background: rgba(255,255,255,.82);
  border: 1px solid rgba(31,42,51,.06);
  box-shadow: 0 10px 22px rgba(31,42,51,.045);
}

.memo-tabs .tab {
  border: 0;
  min-height: 42px;
  border-radius: 8px;
  background: transparent;
}

.memo-tabs .tab.active {
  background: linear-gradient(135deg, var(--night), var(--sea));
  box-shadow: 0 8px 16px rgba(36,107,122,.16);
}

.species-section h2,
.species-section h3 {
  display: inline-flex;
  min-width: 38px;
  height: 30px;
  padding: 0 12px;
  align-items: center;
  border-radius: 15px;
  background: #ffffff;
  color: var(--sea);
  box-shadow: 0 8px 18px rgba(31,42,51,.06);
}

.species-grid {
  gap: 12px;
}

.species-card,
.species-row {
  overflow: hidden;
  position: relative;
}

.species-card::after,
.species-row::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, rgba(255,255,255,.0), rgba(255,255,255,.32), rgba(255,255,255,0));
  transform: translateX(-120%);
  transition: transform .35s ease;
}

.species-card:active::after,
.species-row:active::after {
  transform: translateX(120%);
}

.species-card img,
.species-row img,
.ledger-thumb,
.turtle-photo,
.home-turtle-card img {
  box-shadow: inset 0 0 0 1px rgba(31,42,51,.06);
}

.breed-row,
.memo-row,
.mine-row {
  border-bottom: 0;
  margin-bottom: 10px;
}

.memo-row {
  min-height: 92px;
}

.memo-row strong,
.breed-row strong,
.activity-row strong {
  font-weight: 950;
  color: var(--night);
}

.activity-list {
  position: relative;
}

.activity-row {
  grid-template-columns: 28px 1fr;
  padding: 16px;
  position: relative;
}

.activity-dot {
  width: 12px;
  height: 12px;
  margin-top: 7px;
  background: linear-gradient(135deg, var(--sea), var(--aqua));
  box-shadow: 0 0 0 6px rgba(47,167,127,.12);
}

.activity-row::before {
  content: "";
  position: absolute;
  left: 29px;
  top: 34px;
  bottom: -18px;
  width: 1px;
  background: rgba(36,107,122,.14);
}

.activity-row:last-child::before {
  display: none;
}

.turtle-detail-hero,
.ledger-detail-hero {
  border-radius: 8px;
  box-shadow: 0 18px 36px rgba(31,42,51,.10);
  border: 1px solid rgba(31,42,51,.06);
  background: #ffffff;
}

.turtle-detail-hero img,
.ledger-detail-hero img,
.ledger-detail-empty {
  aspect-ratio: 1.18;
}

.turtle-detail-hero > div {
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,253,248,.98));
}

.detail-more,
.more-btn {
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 18px rgba(31,42,51,.14);
}

.turtle-menu {
  border-radius: 8px;
  box-shadow: 0 18px 36px rgba(31,42,51,.18);
}

.turtle-menu button {
  min-height: 44px;
  font-weight: 800;
}

.detail-grid {
  gap: 12px;
}

.detail-grid div {
  background:
    linear-gradient(180deg, #f8fbfa, #f3f6f6);
  border: 1px solid rgba(31,42,51,.045);
}

.detail-grid strong {
  font-size: 16px;
  font-weight: 950;
}

.history-card {
  margin-bottom: 10px;
}

.history-photos img {
  width: 48px;
  height: 48px;
}

.ledger-detail-head {
  padding: 10px;
  border-radius: 8px;
  background: #f7fbfa;
}

.ledger-delete {
  padding: 6px 8px;
  border-radius: 8px;
}

.theme-dot {
  background: linear-gradient(180deg, #ffffff, #f7f8f8);
  border-color: rgba(31,42,51,.06);
  box-shadow: 0 8px 18px rgba(31,42,51,.045);
}

.theme-dot.active {
  box-shadow: 0 12px 24px rgba(47,167,127,.12);
}

.empty {
  min-height: 300px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,.42));
  border: 1px dashed rgba(31,42,51,.12);
}

.toast {
  bottom: 96px;
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 16px 36px rgba(31,42,51,.22);
}

.home-turtle-card,
.turtle-row,
.ledger-row,
.species-card,
.species-row,
.breed-row,
.memo-row,
.activity-row,
.mine-row,
.theme-dot,
.choice,
.primary,
.secondary,
.text-green,
.danger-link {
  cursor: pointer;
}

.home-turtle-card:focus-visible,
.turtle-row:focus-visible,
.ledger-row:focus-visible,
button:focus-visible,
.select:focus-visible,
.field:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(47,167,127,.24);
  outline-offset: 2px;
}

.primary,
.secondary,
.round-action,
.hero-add,
.bottom-nav button {
  touch-action: manipulation;
}

.ledger-row strong,
.home-turtle-card strong,
.turtle-row strong,
.species-card strong,
.species-row strong {
  letter-spacing: 0;
}

.home-turtle-card::before,
.turtle-row::before,
.ledger-row::before,
.memo-row::before,
.mine-row::before {
  content: "";
  width: 4px;
  border-radius: 99px;
  background: linear-gradient(180deg, var(--sea), var(--aqua));
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  opacity: 0;
  transition: opacity .16s ease;
}

.home-turtle-card,
.turtle-row,
.ledger-row,
.memo-row,
.mine-row {
  position: relative;
}

.home-turtle-card:hover::before,
.turtle-row:hover::before,
.ledger-row:hover::before,
.memo-row:hover::before,
.mine-row:hover::before {
  opacity: 1;
}

.ledger-row .ledger-inline-type.purchase {
  color: var(--sea);
}

.ledger-row .ledger-inline-type.loss {
  color: var(--rose);
}

.ledger-row .ledger-inline-type.sold {
  color: var(--aqua);
}

.ledger-type.sold {
  background: linear-gradient(135deg, var(--sea), var(--aqua));
}

.ledger-type.purchase {
  background: linear-gradient(135deg, #3d6f8d, var(--sea));
}

.ledger-type.loss {
  background: linear-gradient(135deg, #9b3443, var(--rose));
}

.required {
  padding: 1px 5px;
  border-radius: 6px;
  background: #fff0f1;
}

.soft-row {
  border-radius: 8px;
}

.soft-row > span {
  background: linear-gradient(135deg, #eaf2f7, #edf7f1);
}

.code-badge {
  border-radius: 8px;
}

.muted {
  color: #73808c;
}

.danger-text,
.danger-link {
  color: var(--rose) !important;
}

.account-login {
  margin-top: -2px;
}

@media (max-width: 370px) {
  .memo-tabs {
    grid-template-columns: repeat(3, 1fr);
  }
  .species-grid {
    grid-template-columns: 1fr;
  }
  .photo-uploader,
  .photo-picker {
    grid-template-columns: 88px 1fr;
  }
}

/* Executive refinement pass: calmer hierarchy, richer surfaces, better touch rhythm. */
.phone-shell::before {
  content: "";
  position: fixed;
  top: 0;
  left: 50%;
  width: min(430px, 100vw);
  height: 220px;
  transform: translateX(-50%);
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,0)),
    radial-gradient(circle at 20% 12%, rgba(47,167,127,.12), transparent 34%),
    radial-gradient(circle at 84% 8%, rgba(36,107,122,.12), transparent 30%);
  z-index: 0;
}

.topbar,
.content,
.profile,
.bottom-nav {
  position: relative;
}

.content,
.profile {
  z-index: 1;
}

.topbar {
  border-bottom-color: rgba(31,42,51,.055);
}

.nav-title h1::after {
  content: "";
  display: block;
  width: 26px;
  height: 3px;
  border-radius: 999px;
  margin: 6px auto 0;
  background: linear-gradient(90deg, var(--sea), var(--aqua));
  opacity: .75;
}

.icon-btn {
  background: rgba(255,255,255,.65);
  box-shadow: 0 8px 18px rgba(31,42,51,.065);
}

.home-hero,
.fresh-profile {
  position: relative;
  overflow: hidden;
}

.home-hero::after,
.fresh-profile::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,.20);
}

.home-hero > *,
.fresh-profile > * {
  position: relative;
  z-index: 1;
}

.hero-add,
.round-action {
  box-shadow:
    0 12px 24px rgba(31,42,51,.16),
    inset 0 1px 0 rgba(255,255,255,.75);
}

.metric-strip,
.archive-strip div,
.account-brief div,
.ledger-summary div {
  backdrop-filter: blur(18px);
}

.page-intro {
  position: relative;
  overflow: hidden;
}

.page-intro::before {
  content: "";
  position: absolute;
  right: -26px;
  top: -44px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(47,167,127,.10);
}

.page-intro > * {
  position: relative;
  z-index: 1;
}

.section-title {
  padding: 0 2px;
}

.section-title span::before,
.section-title h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  margin-right: 8px;
  vertical-align: -3px;
  background: linear-gradient(180deg, var(--sea), var(--aqua));
}

.home-turtle-card,
.turtle-row,
.ledger-row,
.memo-row,
.breed-row,
.activity-row,
.mine-row {
  overflow: hidden;
}

.home-turtle-card img,
.turtle-row > img,
.turtle-photo,
.ledger-thumb,
.species-card img,
.species-row img,
.photo-uploader img,
.turtle-detail-hero img,
.ledger-detail-hero img {
  filter: saturate(1.04) contrast(1.02);
}

.home-turtle-card strong,
.turtle-row strong,
.ledger-row strong {
  color: #182530;
}

.home-turtle-meta {
  margin-top: 7px;
}

.home-turtle-meta span,
.ledger-inline-type,
.tag {
  border: 1px solid rgba(31,42,51,.045);
}

.filter-dock,
.memo-tabs {
  box-shadow:
    0 12px 24px rgba(31,42,51,.07),
    inset 0 1px 0 rgba(255,255,255,.82);
}

.select,
.field {
  font-weight: 700;
}

textarea {
  font-weight: 600;
}

.form-block,
.ledger-form,
.memo-form {
  position: relative;
}

.form-block h3::before,
.form-head h3::before,
.settings-title::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
  background: var(--aqua);
  vertical-align: 2px;
}

.photo-uploader,
.photo-picker {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.75);
}

.species-section {
  margin-bottom: 14px;
}

.species-letter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 2px 10px;
}

.species-letter h3 {
  margin: 0;
}

.species-letter span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.species-alpha-nav {
  position: fixed;
  top: 50%;
  right: max(6px, calc((100vw - 430px) / 2 + 6px));
  transform: translateY(-50%);
  z-index: 40;
  width: 22px;
  max-height: calc(100vh - 170px);
  padding: 5px 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .56);
  border: 1px solid rgba(31, 42, 51, .05);
  box-shadow: 0 10px 22px rgba(31, 45, 61, .07);
  backdrop-filter: blur(10px);
  display: grid;
  gap: 1px;
  align-content: center;
}

.species-alpha-nav button {
  width: 18px;
  height: 18px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: transparent;
  color: rgba(34, 115, 91, .62);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.species-alpha-nav button:active {
  background: var(--green);
  color: white;
}

.species-alpha-nav button.muted {
  color: rgba(133, 139, 150, .28);
}

.species-card,
.species-row {
  min-height: 104px;
}

.species-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 28px 10px 10px;
  margin-bottom: 10px;
}

.species-row img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--mint);
}

.species-row strong {
  display: block;
  font-size: 16px;
  line-height: 1.3;
}

.species-row.selected {
  border-color: rgba(47,167,127,.24);
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(239,248,243,.96));
}

.species-add {
  min-width: 54px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--night), var(--sea));
  color: white;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 8px 16px rgba(36,107,122,.16);
}

.species-add.selected {
  background: var(--mint);
  color: var(--green);
  box-shadow: none;
}

.species-card div,
.species-row div {
  gap: 6px;
}

.species-card small,
.species-row small {
  color: var(--muted);
  font-weight: 800;
}

.memo-row p,
.activity-row p,
.ledger-row p {
  line-height: 1.45;
}

.activity-row {
  min-height: 86px;
}

.detail-grid-card,
.ledger-detail-card {
  margin-bottom: 14px;
}

.detail-note,
.note-card {
  line-height: 1.65;
}

.history-card p {
  margin: 10px 0 4px;
  color: #334150;
  font-weight: 800;
}

.theme-row {
  gap: 10px;
}

.theme-dot span {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.40),
    0 6px 12px rgba(31,42,51,.10);
}

.mine-list {
  background: transparent;
  box-shadow: none;
  border: 0;
}

.mine-row {
  border-radius: 8px;
}

.bottom-nav {
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav button {
  font-weight: 800;
}

.bottom-nav button.active {
  color: var(--night);
}

.bottom-nav button.active span {
  box-shadow: 0 8px 16px rgba(47,167,127,.13);
}

@media (hover: hover) {
  .primary:hover,
  .secondary:hover,
  .theme-dot:hover,
  .choice:hover {
    transform: translateY(-1px);
  }
}

.action-panel button,
.ledger-actions button,
.mine-row,
.memo-row,
.breed-row,
.turtle-row,
.ledger-row {
  min-width: 0;
}

.action-panel strong,
.action-panel small,
.home-turtle-card strong,
.home-turtle-card span,
.turtle-row strong,
.turtle-row p,
.turtle-row small,
.ledger-row strong,
.ledger-row p,
.ledger-row small,
.mine-row strong,
.memo-row strong,
.memo-row p,
.species-card strong,
.species-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ledger-amount {
  white-space: nowrap;
}

.ledger-row {
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: start;
}

.ledger-row-main {
  min-width: 0;
}

.ledger-row-title {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  line-height: 1.35;
}

.ledger-row .muted,
.ledger-dims {
  display: block;
  line-height: 1.35;
}

.ledger-amount {
  align-self: center;
  justify-self: end;
  white-space: nowrap;
}

.primary,
.secondary,
.round-action,
.hero-add,
.icon-btn,
.more-btn,
.detail-more,
.bottom-nav button {
  min-width: 44px;
}

.bottom-nav button {
  min-height: 64px;
}

.memo-tabs .tab,
.theme-dot,
.choice {
  min-height: 46px;
}

.turtle-menu {
  min-width: 118px;
}

.turtle-menu button {
  white-space: nowrap;
}

.toast {
  font-weight: 800;
  line-height: 1.45;
}

.breeding-form {
  padding: 16px;
  margin-bottom: 14px;
}

.breeding-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.breeding-form-grid label,
.breeding-note {
  display: block;
  margin-top: 12px;
}

.breeding-manual-mother {
  grid-column: 1 / -1;
}

.breeding-date-field,
.breeding-mother-field,
.breeding-pool-field {
  grid-column: 1 / -1;
}

.breeding-form-grid .breeding-date-field,
.breeding-form-grid .breeding-mother-field,
.breeding-form-grid .breeding-pool-field {
  grid-template-columns: 72px minmax(0, 1fr) !important;
}

.breeding-date-field input,
.breeding-mother-field select,
.breeding-pool-field select {
  min-width: 0 !important;
}

.radio-row.two-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.survey-form {
  padding: 16px;
  margin-bottom: 14px;
}

.rating-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 10px 0 14px;
}

.rating-star {
  min-height: 48px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 24px;
  font-weight: 900;
  border: 1px solid var(--line);
}

.rating-star.active {
  background: #fff3df;
  color: #d99a20;
  border-color: rgba(217,154,32,.22);
}

.survey-field {
  display: block;
  margin-top: 12px;
}

.survey-field span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field-error {
  display: block;
  margin-top: 6px;
  color: #e0485e;
  font-size: 12px;
  font-weight: 900;
}

.field-error[hidden] {
  display: none;
}

.survey-record {
  padding: 14px;
  margin-bottom: 10px;
}

.survey-record strong {
  color: var(--gold);
}

.survey-record p {
  margin: 8px 0 6px;
  line-height: 1.6;
}

.public-review {
  display: grid;
  gap: 10px;
}

.review-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.review-stars {
  display: inline-block;
  letter-spacing: 1px;
}

.review-author {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.review-delete {
  flex: 0 0 auto;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.auth-tabs {
  margin-bottom: 12px;
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 10px;
  align-items: end;
}

.code-row .secondary {
  min-height: 48px;
  margin-top: 12px;
}

.code-row .secondary:disabled {
  cursor: not-allowed;
  opacity: .62;
}

.auth-code-hint {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--mint);
  font-weight: 800;
}

.breeding-form-grid span,
.breeding-note span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.breeding-list {
  display: grid;
  gap: 10px;
}

.breeding-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  overflow: hidden;
}

.breeding-row img,
.breeding-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: linear-gradient(135deg, #eaf2f7, #edf7f1);
  color: var(--sea);
  display: grid;
  place-items: center;
  font-weight: 950;
}

.breeding-row strong {
  color: var(--night);
  font-weight: 950;
}

.breeding-row p {
  margin: 4px 0;
  color: #596270;
  line-height: 1.45;
}

.breeding-row small {
  color: var(--muted);
  line-height: 1.45;
}

.breeding-row:active {
  transform: scale(.985);
}

@media (max-width: 390px) {
  .content {
    padding-left: 12px;
    padding-right: 12px;
  }
  .home-hero h2 {
    font-size: 27px;
  }
  .page-intro h2 {
    font-size: 23px;
  }
  .ledger-summary strong {
    font-size: 18px;
  }
  .action-panel button {
    min-height: 88px;
  }
  .breeding-form-grid,
  .breeding-row {
    grid-template-columns: 1fr;
  }
  .species-row {
    grid-template-columns: 64px minmax(0, 1fr);
  }
  .species-row img {
    width: 64px;
    height: 64px;
  }
  .species-add {
    grid-column: 2;
    justify-self: start;
  }
  .species-search-card {
    top: 84px;
  }
}

/* Final bottom navigation lock. */
.bottom-nav {
  position: fixed !important;
  left: 50%;
  right: auto;
  bottom: 0;
  transform: translateX(-50%);
  width: min(430px, 100vw);
  height: calc(74px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
  z-index: 999;
}

.bottom-nav button {
  min-width: 0;
  min-height: 64px;
}

.home-archive-section {
  margin-top: 4px;
}

.content {
  padding-bottom: calc(112px + env(safe-area-inset-bottom));
}

/* Theme engine: these overrides make the color setting affect the whole app. */
body {
  background: var(--body-bg);
  color: var(--text);
}

.phone-shell {
  background: var(--phone-bg);
  color: var(--text);
}

.topbar,
.bottom-nav {
  background: var(--topbar-bg) !important;
  color: var(--ink);
  border-color: var(--card-border);
}

.fresh-card,
.card,
.home-turtle-card,
.turtle-row,
.ledger-row,
.species-card,
.species-row,
.breed-row,
.memo-row,
.activity-row,
.mine-row,
.settings-card,
.ledger-summary div,
.account-brief div,
.filter-dock,
.ledger-date-filter,
.detail-grid-card,
.ledger-detail-card,
.note-card,
.history-card,
.photo-uploader,
.photo-picker,
.empty,
.theme-dot {
  background: var(--card-bg);
  border-color: var(--card-border);
  color: var(--text);
}

.page-fresh,
.home-redesign {
  background: transparent;
}

.field,
.select,
textarea {
  background: var(--surface);
  color: var(--text);
  border-color: var(--card-border);
}

.field::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 70%, transparent);
}

.primary,
.round-action,
.hero-add,
.species-add {
  background: linear-gradient(135deg, var(--night), var(--sea));
  color: #fff;
}

.secondary {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--card-border);
}

.theme-dot.active {
  background: var(--mint);
  color: var(--ink);
  border-color: var(--green-2);
}

html[data-theme-color="dark"] .home-hero,
html[data-theme-color="dark"] .profile,
html[data-theme-color="dark"] .fresh-profile {
  background:
    radial-gradient(circle at 82% 18%, rgba(255,255,255,.08), transparent 28%),
    linear-gradient(135deg, #05070b, #1f2937);
  color: #fff;
}

html[data-theme-color="dark"] .metric-strip,
html[data-theme-color="dark"] .ledger-summary div,
html[data-theme-color="dark"] .account-brief div {
  box-shadow: 0 14px 30px rgba(0,0,0,.34);
}

html[data-theme-color="dark"] .fresh-card,
html[data-theme-color="dark"] .home-turtle-card,
html[data-theme-color="dark"] .turtle-row,
html[data-theme-color="dark"] .ledger-row,
html[data-theme-color="dark"] .species-row,
html[data-theme-color="dark"] .memo-row,
html[data-theme-color="dark"] .mine-row {
  box-shadow: 0 12px 28px rgba(0,0,0,.28);
}

html[data-theme-color="dark"] .muted,
html[data-theme-color="dark"] small,
html[data-theme-color="dark"] .settings-title,
html[data-theme-color="dark"] .section-title {
  color: var(--muted);
}

html[data-theme-color="dark"] .bottom-nav button {
  color: rgba(245,247,251,.55);
}

html[data-theme-color="dark"] .bottom-nav button.active {
  color: #fff;
}

html[data-theme-color="dark"] .bottom-nav button.active span,
html[data-theme-color="dark"] .action-panel span {
  background: rgba(255,255,255,.08);
  color: #fff;
}

/* Structured palette pass: page / section / row / divider / accent. */
.phone-shell,
.content,
.page-fresh,
.home-redesign {
  background: var(--page-bg) !important;
}

.topbar {
  box-shadow: inset 0 -1px 0 var(--divider);
}

.fresh-card,
.card,
.settings-card,
.metric-strip,
.filter-dock,
.ledger-date-filter,
.detail-grid-card,
.ledger-detail-card,
.note-card,
.history-card,
.photo-uploader,
.photo-picker,
.empty {
  background: var(--section-bg);
  border-color: var(--divider);
}

.home-turtle-card,
.turtle-row,
.ledger-row,
.species-row,
.breed-row,
.memo-row,
.activity-row,
.mine-row,
.ledger-summary div,
.account-brief div {
  background: var(--row-bg);
  border-color: var(--divider);
}

.mine-row,
.activity-row,
.memo-row {
  box-shadow: inset 0 -1px 0 var(--divider);
}

.field,
.select,
textarea {
  background: var(--section-bg);
  border-color: var(--divider);
}

.primary,
.round-action,
.hero-add,
.species-add,
.bottom-nav button.active span {
  background: var(--accent);
  color: #fff;
}

.secondary,
.theme-dot {
  background: var(--raised-bg);
  border-color: var(--divider);
}

.bottom-nav button {
  color: var(--nav-muted);
}

.bottom-nav button.active {
  color: var(--accent);
}

.metric-strip strong,
.archive-strip strong,
.ledger-summary strong,
.account-brief strong,
.section-title small,
.text-green {
  color: var(--accent);
}

html[data-theme-color="dark"] body {
  background: #0b0b0b;
}

html[data-theme-color="dark"] .phone-shell,
html[data-theme-color="dark"] .content,
html[data-theme-color="dark"] .page-fresh,
html[data-theme-color="dark"] .home-redesign {
  background: #111111 !important;
}

html[data-theme-color="dark"] .topbar {
  background: #111111 !important;
}

html[data-theme-color="dark"] .settings-card,
html[data-theme-color="dark"] .fresh-card,
html[data-theme-color="dark"] .card,
html[data-theme-color="dark"] .metric-strip,
html[data-theme-color="dark"] .filter-dock,
html[data-theme-color="dark"] .ledger-date-filter,
html[data-theme-color="dark"] .detail-grid-card,
html[data-theme-color="dark"] .ledger-detail-card,
html[data-theme-color="dark"] .note-card,
html[data-theme-color="dark"] .history-card,
html[data-theme-color="dark"] .photo-uploader,
html[data-theme-color="dark"] .photo-picker,
html[data-theme-color="dark"] .empty {
  background: #181818;
  border-color: #242424;
}

html[data-theme-color="dark"] .home-turtle-card,
html[data-theme-color="dark"] .turtle-row,
html[data-theme-color="dark"] .ledger-row,
html[data-theme-color="dark"] .species-row,
html[data-theme-color="dark"] .breed-row,
html[data-theme-color="dark"] .memo-row,
html[data-theme-color="dark"] .activity-row,
html[data-theme-color="dark"] .mine-row,
html[data-theme-color="dark"] .ledger-summary div,
html[data-theme-color="dark"] .account-brief div {
  background: #181818;
  border-color: #242424;
}

html[data-theme-color="dark"] .profile,
html[data-theme-color="dark"] .fresh-profile,
html[data-theme-color="dark"] .theme-dot.active {
  background: #3a3a3a;
  border-color: #4a4a4a;
}

html[data-theme-color="dark"] .bottom-nav {
  background: #181818 !important;
  border-top: 1px solid #242424;
}

html[data-theme-color="dark"] .primary,
html[data-theme-color="dark"] .round-action,
html[data-theme-color="dark"] .hero-add,
html[data-theme-color="dark"] .species-add,
html[data-theme-color="dark"] .bottom-nav button.active span {
  background: #07c160;
  color: #111111;
}

html[data-theme-color="dark"] .secondary,
html[data-theme-color="dark"] .theme-dot,
html[data-theme-color="dark"] .field,
html[data-theme-color="dark"] .select,
html[data-theme-color="dark"] textarea {
  background: #202020;
  border-color: #2b2b2b;
  color: #e7e7e7;
}

html[data-theme-color="dark"] .danger-link {
  color: #ff5c64;
}

html[data-theme-color="dark"] .mine-row {
  min-height: 76px;
  border-radius: 0;
  box-shadow: inset 0 -1px 0 #242424;
}

html[data-theme-color="dark"] .mine-row span:last-child {
  color: #666;
}

html[data-theme-color="dark"] .mine-row strong,
html[data-theme-color="dark"] .settings-title,
html[data-theme-color="dark"] .nav-title h1 {
  color: #e7e7e7;
}

html[data-theme-color="dark"] .account-profile {
  margin-bottom: 10px;
}

html[data-theme-color="dark"] .theme-dot.dark {
  background: #3a3a3a;
}

html[data-theme-color="dark"] .theme-dot.dark span {
  background: #111111;
  border: 1px solid #666;
}

/* Deep dark final pass: every visible surface follows the provided screenshot. */
html[data-theme-color="dark"],
html[data-theme-color="dark"] body {
  background: #0b0b0b !important;
  color: #e7e7e7 !important;
}

html[data-theme-color="dark"] body *,
html[data-theme-color="dark"] body *::before,
html[data-theme-color="dark"] body *::after {
  border-color: #242424 !important;
}

html[data-theme-color="dark"] body,
html[data-theme-color="dark"] .phone-shell,
html[data-theme-color="dark"] .content,
html[data-theme-color="dark"] main,
html[data-theme-color="dark"] .page-fresh,
html[data-theme-color="dark"] .home-redesign {
  background: #111111 !important;
  color: #e7e7e7 !important;
}

html[data-theme-color="dark"] .topbar,
html[data-theme-color="dark"] .bottom-nav,
html[data-theme-color="dark"] .status,
html[data-theme-color="dark"] .nav-title {
  background: #181818 !important;
  color: #e7e7e7 !important;
}

html[data-theme-color="dark"] section,
html[data-theme-color="dark"] article,
html[data-theme-color="dark"] form,
html[data-theme-color="dark"] .fresh-card,
html[data-theme-color="dark"] .card,
html[data-theme-color="dark"] .settings-card,
html[data-theme-color="dark"] .home-turtle-card,
html[data-theme-color="dark"] .turtle-row,
html[data-theme-color="dark"] .ledger-row,
html[data-theme-color="dark"] .species-row,
html[data-theme-color="dark"] .breed-row,
html[data-theme-color="dark"] .memo-row,
html[data-theme-color="dark"] .activity-row,
html[data-theme-color="dark"] .mine-row,
html[data-theme-color="dark"] .ledger-summary div,
html[data-theme-color="dark"] .account-brief div,
html[data-theme-color="dark"] .metric-strip,
html[data-theme-color="dark"] .archive-strip,
html[data-theme-color="dark"] .filter-dock,
html[data-theme-color="dark"] .ledger-date-filter,
html[data-theme-color="dark"] .detail-grid-card,
html[data-theme-color="dark"] .ledger-detail-card,
html[data-theme-color="dark"] .note-card,
html[data-theme-color="dark"] .history-card,
html[data-theme-color="dark"] .photo-uploader,
html[data-theme-color="dark"] .photo-picker,
html[data-theme-color="dark"] .empty,
html[data-theme-color="dark"] .species-search-card,
html[data-theme-color="dark"] .tabs,
html[data-theme-color="dark"] .tab,
html[data-theme-color="dark"] .choice,
html[data-theme-color="dark"] .theme-dot {
  background: #181818 !important;
  color: #e7e7e7 !important;
  box-shadow: none !important;
}

html[data-theme-color="dark"] .profile,
html[data-theme-color="dark"] .fresh-profile,
html[data-theme-color="dark"] .home-hero {
  background: #181818 !important;
  color: #e7e7e7 !important;
  box-shadow: none !important;
}

html[data-theme-color="dark"] .field,
html[data-theme-color="dark"] .select,
html[data-theme-color="dark"] textarea,
html[data-theme-color="dark"] input,
html[data-theme-color="dark"] select {
  background: #202020 !important;
  color: #e7e7e7 !important;
  border-color: #2b2b2b !important;
}

html[data-theme-color="dark"] .field::placeholder,
html[data-theme-color="dark"] textarea::placeholder,
html[data-theme-color="dark"] input::placeholder {
  color: #8c8c8c !important;
}

html[data-theme-color="dark"] h1,
html[data-theme-color="dark"] h2,
html[data-theme-color="dark"] h3,
html[data-theme-color="dark"] h4,
html[data-theme-color="dark"] p,
html[data-theme-color="dark"] span,
html[data-theme-color="dark"] strong,
html[data-theme-color="dark"] small,
html[data-theme-color="dark"] label,
html[data-theme-color="dark"] div,
html[data-theme-color="dark"] button,
html[data-theme-color="dark"] .muted,
html[data-theme-color="dark"] .settings-title,
html[data-theme-color="dark"] .section-title,
html[data-theme-color="dark"] .ledger-row-title,
html[data-theme-color="dark"] .ledger-dims,
html[data-theme-color="dark"] .breeding-row p,
html[data-theme-color="dark"] .memo-row p,
html[data-theme-color="dark"] .home-turtle-meta span {
  color: #e7e7e7 !important;
}

html[data-theme-color="dark"] .secondary,
html[data-theme-color="dark"] .tab,
html[data-theme-color="dark"] .choice,
html[data-theme-color="dark"] .theme-dot,
html[data-theme-color="dark"] .species-alpha-nav {
  background: #202020 !important;
  color: #e7e7e7 !important;
}

html[data-theme-color="dark"] .primary,
html[data-theme-color="dark"] .round-action,
html[data-theme-color="dark"] .hero-add,
html[data-theme-color="dark"] .species-add,
html[data-theme-color="dark"] .bottom-nav button.active span,
html[data-theme-color="dark"] .tab.active,
html[data-theme-color="dark"] .choice.active {
  background: #07c160 !important;
  color: #e7e7e7 !important;
}

html[data-theme-color="dark"] .bottom-nav button {
  background: transparent !important;
  color: #e7e7e7 !important;
}

html[data-theme-color="dark"] .bottom-nav button.active {
  color: #e7e7e7 !important;
}

html[data-theme-color="dark"] .bottom-nav button.active span {
  color: #e7e7e7 !important;
}

html[data-theme-color="dark"] .mine-row,
html[data-theme-color="dark"] .activity-row,
html[data-theme-color="dark"] .memo-row,
html[data-theme-color="dark"] .ledger-row {
  box-shadow: inset 0 -1px 0 #242424 !important;
}

html[data-theme-color="dark"] .danger-link,
html[data-theme-color="dark"] .danger-text,
html[data-theme-color="dark"] .ledger-amount.danger {
  color: #ff5c64 !important;
}

html[data-theme-color="dark"] .ledger-inline-type,
html[data-theme-color="dark"] .ledger-type,
html[data-theme-color="dark"] .text-green,
html[data-theme-color="dark"] .metric-strip strong,
html[data-theme-color="dark"] .archive-strip strong,
html[data-theme-color="dark"] .ledger-summary strong,
html[data-theme-color="dark"] .account-brief strong {
  color: #e7e7e7 !important;
}

html[data-theme-color="dark"] .activity-dot {
  background: #07c160 !important;
}

/* Remove remaining light blocks in dark mode. */
html[data-theme-color="dark"] .action-panel,
html[data-theme-color="dark"] .home-turtles,
html[data-theme-color="dark"] .breeding-list,
html[data-theme-color="dark"] .ledger-actions,
html[data-theme-color="dark"] .home-turtle-grid {
  background: #111111 !important;
}

html[data-theme-color="dark"] .action-panel button,
html[data-theme-color="dark"] .metric-strip div,
html[data-theme-color="dark"] .archive-strip div,
html[data-theme-color="dark"] .home-turtle-meta span,
html[data-theme-color="dark"] .tag,
html[data-theme-color="dark"] .ledger-inline-type,
html[data-theme-color="dark"] .ledger-type,
html[data-theme-color="dark"] .breeding-thumb,
html[data-theme-color="dark"] .turtle-menu,
html[data-theme-color="dark"] .detail-menu,
html[data-theme-color="dark"] .species-letter h3,
html[data-theme-color="dark"] .eyebrow,
html[data-theme-color="dark"] .eyebrow.dark {
  background: #202020 !important;
  color: #e7e7e7 !important;
  border-color: #2b2b2b !important;
  box-shadow: none !important;
}

html[data-theme-color="dark"] .action-panel span,
html[data-theme-color="dark"] .mine-row span:first-child,
html[data-theme-color="dark"] .species-alpha-nav button,
html[data-theme-color="dark"] .choice.active,
html[data-theme-color="dark"] .tab.active {
  background: #2b2b2b !important;
  color: #e7e7e7 !important;
}

html[data-theme-color="dark"] .home-hero::before,
html[data-theme-color="dark"] .home-hero::after,
html[data-theme-color="dark"] .fresh-profile::before,
html[data-theme-color="dark"] .fresh-profile::after,
html[data-theme-color="dark"] .page-intro::before,
html[data-theme-color="dark"] .page-intro::after,
html[data-theme-color="dark"] .home-turtle-card::before,
html[data-theme-color="dark"] .turtle-row::before,
html[data-theme-color="dark"] .ledger-row::before,
html[data-theme-color="dark"] .mine-row::before,
html[data-theme-color="dark"] .species-row::after {
  background: #242424 !important;
  opacity: .35 !important;
}

html[data-theme-color="dark"] .primary,
html[data-theme-color="dark"] .round-action,
html[data-theme-color="dark"] .hero-add,
html[data-theme-color="dark"] .species-add,
html[data-theme-color="dark"] .bottom-nav button.active span {
  background: #07c160 !important;
  color: #e7e7e7 !important;
}

html[data-theme-color="dark"] img,
html[data-theme-color="dark"] .turtle-photo,
html[data-theme-color="dark"] .ledger-thumb,
html[data-theme-color="dark"] .species-photo,
html[data-theme-color="dark"] .photo-box,
html[data-theme-color="dark"] .photo-uploader img {
  background-color: #202020 !important;
}

html[data-theme-color="dark"] .section-title small,
html[data-theme-color="dark"] .section-title button,
html[data-theme-color="dark"] .account-login,
html[data-theme-color="dark"] .ledger-actions .secondary,
html[data-theme-color="dark"] .ledger-date-filter .secondary,
html[data-theme-color="dark"] .danger-link,
html[data-theme-color="dark"] .text-green {
  background: #202020 !important;
  color: #e7e7e7 !important;
  border-color: #2b2b2b !important;
}

html[data-theme-color="dark"] .rating-star,
html[data-theme-color="dark"] .survey-form,
html[data-theme-color="dark"] .survey-record,
html[data-theme-color="dark"] .auth-code-hint {
  background: #181818 !important;
  color: #e7e7e7 !important;
  border-color: #242424 !important;
}

html[data-theme-color="dark"] .rating-star.active {
  background: #2b2b2b !important;
  color: #e7e7e7 !important;
}

html[data-theme-color="dark"] .review-delete {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html[data-theme-color="dark"] .avatar,
html[data-theme-color="dark"] .avatar-img,
html[data-theme-color="dark"] .profile-avatar {
  background: #202020 !important;
  border-color: #4a4a4a !important;
  color: #e7e7e7 !important;
}

html[data-theme-color="dark"] .logout-card {
  background: #e04f5f !important;
  color: #e7e7e7 !important;
  border-color: #ff6b7b !important;
}

/* Back buttons should be plain arrows without a circular background. */
.icon-btn,
html[data-theme-color="dark"] .icon-btn {
  background: transparent !important;
  box-shadow: none !important;
  border: 0 !important;
}

/* Archive row action menu must reveal all actions. */
.turtle-row.menu-open,
html[data-theme-color="dark"] .turtle-row.menu-open {
  min-height: 0 !important;
  overflow: visible !important;
  z-index: 20 !important;
}

.turtle-row.menu-open .turtle-menu,
html[data-theme-color="dark"] .turtle-row.menu-open .turtle-menu {
  display: block !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  z-index: 40 !important;
}

.page-fresh,
.home-turtle-grid,
.home-turtles {
  overflow: visible;
}

.detail-summary-card {
  position: relative;
  overflow: visible;
  z-index: 18;
}

.detail-summary-card h2,
.detail-summary-card p {
  padding-right: 72px;
}

.detail-summary-card .detail-more {
  top: 16px;
  right: 16px;
  z-index: 120;
}

.detail-summary-card .turtle-menu {
  position: absolute;
  top: 92px;
  right: 0;
  width: 118px;
  height: auto;
  z-index: 80;
  max-height: none;
  overflow: hidden;
  box-shadow: 0 18px 38px rgba(31, 42, 51, .16);
}

.detail-summary-card + .detail-photo-card,
.detail-summary-card + .breeding-form {
  position: relative;
  z-index: 1;
}

.history-card .history-photos {
  margin-bottom: 12px;
}

.history-card p {
  line-height: 1.6;
}

.detail-grid-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-grid-card > div {
  min-height: 70px;
  padding: 12px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .82), rgba(247, 251, 250, .92)),
    var(--raised-bg);
  border: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.detail-grid-card > .detail-grid-wide {
  grid-column: span 2;
}

.detail-grid-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.detail-grid-card strong {
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.2;
  word-break: break-word;
}

.detail-photo-card {
  overflow: hidden;
}

.detail-photo-card > div {
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(247,251,250,.96));
}

html[data-theme-color="dark"] .detail-grid-card > div {
  background: #202020 !important;
  border-color: #2b2b2b !important;
}

html[data-theme-color="dark"] .detail-photo-card > div {
  background: #181818 !important;
}

html[data-theme-color="dark"] .turtle-menu,
html[data-theme-color="dark"] .detail-menu {
  box-shadow: 0 18px 38px rgba(0, 0, 0, .42) !important;
}

/* Final action menu shape: both archive rows and detail pages use the same right-aligned floating sheet. */
.turtle-menu,
.detail-menu,
.turtle-row .turtle-menu,
.detail-summary-card .turtle-menu {
  right: 0 !important;
  width: 118px !important;
  min-width: 118px !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: 0 18px 38px rgba(31, 42, 51, .16) !important;
  overflow: hidden !important;
}

.detail-summary-card .turtle-menu {
  top: 92px !important;
  z-index: 90 !important;
}

.detail-summary-card .detail-more {
  z-index: 120 !important;
}

.turtle-row .turtle-menu {
  top: 52px !important;
}

.turtle-menu button,
.detail-menu button {
  min-height: 46px !important;
  padding: 0 14px !important;
  font-size: 16px !important;
  font-weight: 900 !important;
  text-align: center !important;
  background: #fff !important;
  border-bottom: 1px solid #f0f1f3 !important;
}

html[data-theme-color="dark"] .turtle-menu,
html[data-theme-color="dark"] .detail-menu,
html[data-theme-color="dark"] .turtle-menu button,
html[data-theme-color="dark"] .detail-menu button {
  background: #202020 !important;
  color: #e7e7e7 !important;
  border-color: #2b2b2b !important;
}

/* Ledger detail dark theme: remove remaining light blocks in sold/purchase/loss detail pages. */
html[data-theme-color="dark"] .ledger-detail-hero,
html[data-theme-color="dark"] .ledger-detail-empty,
html[data-theme-color="dark"] .ledger-detail-card,
html[data-theme-color="dark"] .ledger-detail-head,
html[data-theme-color="dark"] .ledger-detail-card .detail-grid div {
  background: #181818 !important;
  border-color: #2b2b2b !important;
  color: #e7e7e7 !important;
}

html[data-theme-color="dark"] .ledger-detail-empty {
  background: #202020 !important;
}

html[data-theme-color="dark"] .ledger-detail-head {
  border: 1px solid #2b2b2b !important;
  border-radius: 8px !important;
  padding: 10px 12px !important;
}

html[data-theme-color="dark"] .ledger-detail-head strong,
html[data-theme-color="dark"] .ledger-detail-card h2,
html[data-theme-color="dark"] .ledger-detail-card p,
html[data-theme-color="dark"] .ledger-detail-card .muted,
html[data-theme-color="dark"] .ledger-detail-card .detail-note,
html[data-theme-color="dark"] .ledger-detail-card .detail-grid span,
html[data-theme-color="dark"] .ledger-detail-card .detail-grid strong {
  color: #e7e7e7 !important;
}

html[data-theme-color="dark"] .ledger-detail-card .detail-grid div {
  box-shadow: none !important;
}

html[data-theme-color="dark"] .ledger-detail-card .ledger-inline-type {
  background: #202020 !important;
  color: #e7e7e7 !important;
  border-color: #2b2b2b !important;
}

/* Final typography pass: closer to the iOS/WeChat dark text tone. */
body,
button,
input,
select,
textarea {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.nav-title h1 {
  font-size: 21px;
  line-height: 1.2;
  font-weight: 800;
}

.page-intro h2,
.home-hero h2 {
  font-size: 28px;
  line-height: 1.16;
  font-weight: 800;
}

.section-title span,
.section-title h3,
.settings-title {
  font-size: 20px;
  line-height: 1.25;
  font-weight: 800;
}

.fresh-profile h2,
.profile h2 {
  font-size: 32px;
  line-height: 1.15;
  font-weight: 750;
}

.mine-row strong {
  font-size: 19px;
  line-height: 1.25;
}

html[data-theme-color="dark"] {
  --text: #d4d4d4;
  --muted: #8f8f8f;
  --wechat-title: #dedede;
  --wechat-text: #d4d4d4;
  --wechat-muted: #8f8f8f;
  --wechat-faint: #676767;
}

html[data-theme-color="dark"],
html[data-theme-color="dark"] body,
html[data-theme-color="dark"] .phone-shell,
html[data-theme-color="dark"] .content {
  color: var(--wechat-text) !important;
}

html[data-theme-color="dark"] h1,
html[data-theme-color="dark"] h2,
html[data-theme-color="dark"] h3,
html[data-theme-color="dark"] h4,
html[data-theme-color="dark"] .nav-title h1,
html[data-theme-color="dark"] .page-intro h2,
html[data-theme-color="dark"] .home-hero h2,
html[data-theme-color="dark"] .profile h2,
html[data-theme-color="dark"] .fresh-profile h2,
html[data-theme-color="dark"] .section-title span,
html[data-theme-color="dark"] .section-title h3,
html[data-theme-color="dark"] .settings-title,
html[data-theme-color="dark"] .ledger-detail-card h2,
html[data-theme-color="dark"] .ledger-detail-title,
html[data-theme-color="dark"] .detail-summary-card h2,
html[data-theme-color="dark"] .turtle-row strong,
html[data-theme-color="dark"] .ledger-row-title,
html[data-theme-color="dark"] .mine-row strong {
  color: var(--wechat-title) !important;
  font-weight: 700;
  letter-spacing: 0;
}

html[data-theme-color="dark"] body,
html[data-theme-color="dark"] p,
html[data-theme-color="dark"] span,
html[data-theme-color="dark"] strong,
html[data-theme-color="dark"] label,
html[data-theme-color="dark"] button,
html[data-theme-color="dark"] .detail-grid-card strong,
html[data-theme-color="dark"] .ledger-detail-card .detail-grid strong,
html[data-theme-color="dark"] .ledger-detail-head strong,
html[data-theme-color="dark"] .memo-row p,
html[data-theme-color="dark"] .breeding-row p,
html[data-theme-color="dark"] .home-turtle-meta span {
  color: var(--wechat-text) !important;
}

html[data-theme-color="dark"] small,
html[data-theme-color="dark"] .muted,
html[data-theme-color="dark"] .profile-phone,
html[data-theme-color="dark"] .page-intro p,
html[data-theme-color="dark"] .home-hero p,
html[data-theme-color="dark"] .metric-strip span,
html[data-theme-color="dark"] .archive-strip span,
html[data-theme-color="dark"] .ledger-summary span,
html[data-theme-color="dark"] .account-brief span,
html[data-theme-color="dark"] .detail-grid-card span,
html[data-theme-color="dark"] .ledger-detail-card .detail-grid span,
html[data-theme-color="dark"] .species-row small,
html[data-theme-color="dark"] .breeding-row small,
html[data-theme-color="dark"] .activity-row small,
html[data-theme-color="dark"] .memo-row small,
html[data-theme-color="dark"] .field::placeholder,
html[data-theme-color="dark"] textarea::placeholder,
html[data-theme-color="dark"] input::placeholder {
  color: var(--wechat-muted) !important;
}

html[data-theme-color="dark"] .status,
html[data-theme-color="dark"] .bottom-nav button,
html[data-theme-color="dark"] .species-alpha-nav button,
html[data-theme-color="dark"] .mine-row span:first-child {
  color: var(--wechat-muted) !important;
}

html[data-theme-color="dark"] .bottom-nav button.active,
html[data-theme-color="dark"] .bottom-nav button.active span,
html[data-theme-color="dark"] .primary,
html[data-theme-color="dark"] .round-action,
html[data-theme-color="dark"] .hero-add,
html[data-theme-color="dark"] .species-add {
  color: #f2f2f2 !important;
}

html[data-theme-color="dark"] .nav-title h1 {
  font-size: 22px;
  line-height: 1.2;
}

html[data-theme-color="dark"] .page-intro h2,
html[data-theme-color="dark"] .home-hero h2 {
  font-size: 29px;
  line-height: 1.16;
}

html[data-theme-color="dark"] .section-title span,
html[data-theme-color="dark"] .section-title h3,
html[data-theme-color="dark"] .settings-title {
  font-size: 20px;
  line-height: 1.25;
}

html[data-theme-color="dark"] .mine-row strong {
  font-size: 19px;
  line-height: 1.25;
}

html[data-theme-color="dark"] .fresh-profile h2,
html[data-theme-color="dark"] .profile h2 {
  font-size: 32px;
  line-height: 1.15;
  font-weight: 750;
}

html[data-theme-color="dark"] .profile-phone {
  font-size: 15px;
  line-height: 1.35;
}

/* iOS/WeChat system typography lock: neutralize old heavy web-style text. */
:root {
  --app-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
}

html,
body,
.phone-shell,
.phone-shell *,
.phone-shell *::before,
.phone-shell *::after,
button,
input,
select,
textarea {
  font-family: var(--app-font) !important;
  letter-spacing: 0 !important;
  text-shadow: none !important;
  -webkit-font-smoothing: auto;
  -moz-osx-font-smoothing: auto;
  text-rendering: optimizeLegibility;
  font-synthesis-weight: none;
}

.phone-shell,
.content,
p,
span,
small,
label,
input,
select,
textarea,
.field,
.select,
.muted {
  font-weight: 400 !important;
}

button,
.primary,
.secondary,
.round-action,
.hero-add,
.species-add,
.tag,
.eyebrow,
.eyebrow.dark,
.theme-dot,
.choice,
.tab,
.species-alpha-nav button,
.bottom-nav button,
.turtle-menu button,
.detail-menu button,
.section-title button {
  font-weight: 500 !important;
}

strong,
.mine-row strong,
.activity-row strong,
.memo-row strong,
.breed-row strong,
.soft-row strong,
.ledger-row-title,
.ledger-summary strong,
.archive-strip strong,
.metric-strip strong,
.account-brief strong,
.detail-grid-card strong,
.ledger-detail-card .detail-grid strong,
.empty strong,
.small-empty strong {
  font-weight: 600 !important;
}

h1,
h2,
h3,
h4,
.nav-title h1,
.section-title span,
.section-title h3,
.settings-title,
.page-intro h2,
.home-hero h2,
.profile h2,
.fresh-profile h2,
.detail-summary-card h2,
.ledger-detail-card h2 {
  font-family: var(--app-font) !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
}

.nav-title h1 {
  font-size: 22px !important;
}

.page-intro h2,
.home-hero h2 {
  font-size: 29px !important;
}

.fresh-profile h2,
.profile h2 {
  font-size: 34px !important;
}

.empty strong,
.small-empty strong {
  font-size: 18px;
  line-height: 1.35;
}

.empty,
.small-empty {
  line-height: 1.45;
}

html[data-theme-color="dark"] {
  --text: #d2d2d2;
  --muted: #909090;
  --wechat-title: #dadada;
  --wechat-text: #d2d2d2;
  --wechat-muted: #909090;
}

html[data-theme-color="dark"] h1,
html[data-theme-color="dark"] h2,
html[data-theme-color="dark"] h3,
html[data-theme-color="dark"] h4,
html[data-theme-color="dark"] .nav-title h1,
html[data-theme-color="dark"] .page-intro h2,
html[data-theme-color="dark"] .home-hero h2,
html[data-theme-color="dark"] .profile h2,
html[data-theme-color="dark"] .fresh-profile h2,
html[data-theme-color="dark"] .section-title span,
html[data-theme-color="dark"] .section-title h3,
html[data-theme-color="dark"] .settings-title,
html[data-theme-color="dark"] .mine-row strong,
html[data-theme-color="dark"] .empty strong,
html[data-theme-color="dark"] .small-empty strong {
  color: var(--wechat-title) !important;
}

html[data-theme-color="dark"] body,
html[data-theme-color="dark"] .phone-shell,
html[data-theme-color="dark"] p,
html[data-theme-color="dark"] span,
html[data-theme-color="dark"] strong,
html[data-theme-color="dark"] label,
html[data-theme-color="dark"] button,
html[data-theme-color="dark"] input,
html[data-theme-color="dark"] select,
html[data-theme-color="dark"] textarea {
  color: var(--wechat-text) !important;
}

html[data-theme-color="dark"] small,
html[data-theme-color="dark"] .muted,
html[data-theme-color="dark"] .profile-phone,
html[data-theme-color="dark"] .page-intro p,
html[data-theme-color="dark"] .home-hero p,
html[data-theme-color="dark"] .metric-strip span,
html[data-theme-color="dark"] .archive-strip span,
html[data-theme-color="dark"] .ledger-summary span,
html[data-theme-color="dark"] .account-brief span,
html[data-theme-color="dark"] .theme-dot,
html[data-theme-color="dark"] .bottom-nav button,
html[data-theme-color="dark"] .species-alpha-nav button {
  color: var(--wechat-muted) !important;
}

/* iOS/WeChat form surface lock: softer cells, thinner borders, plain required stars. */
.required {
  display: inline !important;
  margin-left: 2px !important;
  padding: 0 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #ff3b30 !important;
  font-size: 15px !important;
  font-weight: 500 !important;
  line-height: 1 !important;
  vertical-align: top !important;
}

.form-block,
.memo-form,
.ledger-form,
.ledger-shell .form-block,
.breeding-form,
.survey-form,
.settings-card,
.fresh-card {
  border-radius: 8px !important;
}

.label,
.ledger-form-grid label span,
.memo-form label span,
.survey-field span,
.breeding-form label span,
.breeding-note span,
.ledger-date-filter label span {
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
}

.field,
.select,
textarea,
.choice,
.theme-dot,
.secondary {
  border-radius: 8px !important;
  box-shadow: none !important;
}

.field,
.select,
textarea {
  min-height: 50px !important;
  padding: 0 14px !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  appearance: auto;
}

textarea {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}

.photo-uploader,
.photo-picker {
  border-radius: 8px !important;
  box-shadow: none !important;
}

.choice {
  min-height: 50px !important;
  font-size: 16px !important;
}

.choice.active {
  box-shadow: none !important;
}

html[data-theme-color="dark"] {
  --ios-bg: #111111;
  --ios-section: #181818;
  --ios-cell: #1c1c1e;
  --ios-cell-strong: #242426;
  --ios-line: #2c2c2e;
  --ios-line-soft: #242424;
  --ios-green: #07c160;
}

html[data-theme-color="dark"] .form-block,
html[data-theme-color="dark"] .memo-form,
html[data-theme-color="dark"] .ledger-form,
html[data-theme-color="dark"] .ledger-shell .form-block,
html[data-theme-color="dark"] .breeding-form,
html[data-theme-color="dark"] .survey-form,
html[data-theme-color="dark"] .settings-card,
html[data-theme-color="dark"] .fresh-card {
  background: var(--ios-section) !important;
  border: 1px solid var(--ios-line-soft) !important;
  box-shadow: none !important;
}

html[data-theme-color="dark"] .field,
html[data-theme-color="dark"] .select,
html[data-theme-color="dark"] textarea,
html[data-theme-color="dark"] input,
html[data-theme-color="dark"] select {
  background: var(--ios-cell) !important;
  border: 1px solid var(--ios-line) !important;
  color: var(--wechat-text) !important;
  box-shadow: none !important;
  outline: none !important;
}

html[data-theme-color="dark"] .field:focus,
html[data-theme-color="dark"] .select:focus,
html[data-theme-color="dark"] textarea:focus,
html[data-theme-color="dark"] input:focus,
html[data-theme-color="dark"] select:focus {
  border-color: rgba(7, 193, 96, .72) !important;
  box-shadow: 0 0 0 1px rgba(7, 193, 96, .18) !important;
  outline: none !important;
}

html[data-theme-color="dark"] .photo-uploader,
html[data-theme-color="dark"] .photo-picker {
  background: #161616 !important;
  border: 1px dashed var(--ios-line-soft) !important;
  box-shadow: none !important;
}

html[data-theme-color="dark"] .choice,
html[data-theme-color="dark"] .theme-dot,
html[data-theme-color="dark"] .secondary,
html[data-theme-color="dark"] .tab {
  background: var(--ios-cell) !important;
  border: 1px solid var(--ios-line-soft) !important;
  color: var(--wechat-text) !important;
  box-shadow: none !important;
}

html[data-theme-color="dark"] .choice.active,
html[data-theme-color="dark"] .theme-dot.active,
html[data-theme-color="dark"] .tab.active {
  background: var(--ios-cell-strong) !important;
  border-color: #3a3a3c !important;
  color: #ededed !important;
  box-shadow: none !important;
}

html[data-theme-color="dark"] .label,
html[data-theme-color="dark"] .ledger-form-grid label span,
html[data-theme-color="dark"] .memo-form label span,
html[data-theme-color="dark"] .survey-field span,
html[data-theme-color="dark"] .breeding-form label span,
html[data-theme-color="dark"] .breeding-note span,
html[data-theme-color="dark"] .ledger-date-filter label span {
  color: #d6d6d6 !important;
}

html[data-theme-color="dark"] .form-block h3,
html[data-theme-color="dark"] .form-head h3,
html[data-theme-color="dark"] .settings-title {
  color: #dadada !important;
}

html[data-theme-color="dark"] .form-block h3::before,
html[data-theme-color="dark"] .form-head h3::before,
html[data-theme-color="dark"] .settings-title::before {
  background: var(--ios-green) !important;
  box-shadow: none !important;
}

html[data-theme-color="dark"] .required {
  background: transparent !important;
  color: #ff453a !important;
}

/* iOS/WeChat archive menu trigger: no white circular buttons in dark mode. */
.more-btn,
.detail-more {
  font-family: var(--app-font) !important;
  font-weight: 600 !important;
  letter-spacing: 1px !important;
}

html[data-theme-color="dark"] .more-btn,
html[data-theme-color="dark"] .detail-more {
  background: #242426 !important;
  color: #8e8e93 !important;
  border: 1px solid #2c2c2e !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html[data-theme-color="dark"] .more-btn:active,
html[data-theme-color="dark"] .detail-more:active,
html[data-theme-color="dark"] .turtle-row.menu-open .more-btn,
html[data-theme-color="dark"] .detail-summary-card.menu-open .detail-more {
  background: #2c2c2e !important;
  color: #d1d1d6 !important;
}

/* iPhone safe-area lock: use the native status bar and keep titles below Dynamic Island. */
.status {
  display: none !important;
}

.topbar {
  min-height: calc(62px + max(env(safe-area-inset-top), 16px)) !important;
  padding-top: max(env(safe-area-inset-top), 16px) !important;
  position: sticky !important;
  top: 0 !important;
}

.nav-title {
  height: 62px !important;
  min-height: 62px !important;
  display: grid !important;
  grid-template-columns: 54px minmax(0, 1fr) 54px !important;
  align-items: center !important;
}

.nav-title h1 {
  line-height: 1.2 !important;
  align-self: center !important;
}

.hero-add,
.round-action {
  display: inline-grid !important;
  place-items: center !important;
  align-items: center !important;
  justify-content: center !important;
  align-content: center !important;
  padding: 0 !important;
  line-height: 1 !important;
  text-align: center !important;
}

.hero-add {
  width: 58px !important;
  height: 58px !important;
  font-size: 34px !important;
}

.round-action {
  width: 58px !important;
  height: 58px !important;
  font-size: 34px !important;
}

.content {
  padding-top: 16px !important;
}

/* Final iOS polish: fixed headers, centered menu dots, and full-width settings dividers. */
.topbar {
  left: 0 !important;
  right: 0 !important;
  z-index: 3000 !important;
}

.nav-title .icon-btn {
  display: inline-grid !important;
  place-items: center !important;
  padding: 0 !important;
  line-height: 1 !important;
}

.more-btn,
.detail-more {
  display: inline-grid !important;
  place-items: center !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 !important;
  border-radius: 22px !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  text-align: center !important;
}

.turtle-row .more-btn {
  align-self: center !important;
  justify-self: end !important;
}

.detail-summary-card .detail-more {
  top: 22px !important;
  right: 22px !important;
}

.settings-card.mine-list,
.mine-list {
  padding: 0 !important;
  overflow: hidden !important;
  background: var(--card-bg) !important;
  border: 1px solid var(--card-border) !important;
  border-radius: 8px !important;
}

.mine-row {
  width: 100% !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border-bottom: 1px solid var(--divider) !important;
}

.mine-row:last-child {
  border-bottom: 0 !important;
}

.mine-row::before {
  display: none !important;
}

html[data-theme-color="dark"] .mine-list {
  background: #1c1c1e !important;
  border-color: #2c2c2e !important;
}

html[data-theme-color="dark"] .mine-row {
  border-bottom-color: #2c2c2e !important;
}

/* Center operation feedback and keep settings labels left-aligned. */
.toast {
  top: 50% !important;
  bottom: auto !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 5000 !important;
}

.mine-row {
  display: grid !important;
  grid-template-columns: 42px minmax(0, 1fr) auto !important;
  column-gap: 14px !important;
  justify-items: start !important;
  text-align: left !important;
}

.mine-row strong {
  justify-self: start !important;
  text-align: left !important;
}

/* iOS/WeChat fixed navigation: the title and back button never move while content scrolls. */
.phone-shell {
  --fixed-topbar-height: calc(62px + max(env(safe-area-inset-top), 16px));
}

.topbar {
  position: fixed !important;
  top: 0 !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  width: min(430px, 100vw) !important;
  min-height: var(--fixed-topbar-height) !important;
  height: var(--fixed-topbar-height) !important;
  padding-top: max(env(safe-area-inset-top), 16px) !important;
  z-index: 6000 !important;
  background: rgba(251, 250, 247, .94) !important;
  backdrop-filter: blur(18px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.2) !important;
}

.topbar + .content,
.topbar + .profile,
.topbar + .fresh-profile {
  margin-top: var(--fixed-topbar-height) !important;
}

.nav-title {
  height: 62px !important;
  min-height: 62px !important;
}

.nav-title h1,
.nav-title .icon-btn {
  transform: translateY(0) !important;
}

html[data-theme-color="dark"] .topbar {
  background: rgba(17, 17, 17, .94) !important;
}

/* Compact iOS tab bar: keep gesture safety, remove the oversized empty floor. */
.phone-shell {
  --fixed-tabbar-content-height: 56px;
  --fixed-tabbar-safe: max(env(safe-area-inset-bottom), 8px);
  --fixed-tabbar-height: calc(var(--fixed-tabbar-content-height) + var(--fixed-tabbar-safe));
}

.bottom-nav {
  height: var(--fixed-tabbar-height) !important;
  padding: 0 0 var(--fixed-tabbar-safe) !important;
  align-items: start !important;
  background: rgba(255, 255, 255, .96) !important;
}

.bottom-nav button {
  min-height: var(--fixed-tabbar-content-height) !important;
  height: var(--fixed-tabbar-content-height) !important;
  padding: 4px 0 2px !important;
  display: grid !important;
  align-content: center !important;
  justify-items: center !important;
  gap: 1px !important;
}

.bottom-nav button span {
  margin-bottom: 0 !important;
}

.content {
  padding-bottom: calc(var(--fixed-tabbar-height) + 18px) !important;
}

html[data-theme-color="dark"] .bottom-nav {
  background: rgba(17, 17, 17, .96) !important;
}

/* WeChat/iOS tab bar: one continuous plate through the Home Indicator area. */
.phone-shell {
  --wechat-tabbar-bg: rgba(247, 247, 247, .98);
  --wechat-tabbar-border: rgba(31, 42, 51, .10);
  --wechat-tabbar-text: #7f8c94;
  --wechat-tabbar-active: #07c160;
  --fixed-tabbar-content-height: 60px;
  --fixed-tabbar-safe: max(env(safe-area-inset-bottom), 18px);
  --fixed-tabbar-height: calc(var(--fixed-tabbar-content-height) + var(--fixed-tabbar-safe));
}

.bottom-nav {
  height: var(--fixed-tabbar-height) !important;
  padding: 0 0 var(--fixed-tabbar-safe) !important;
  background: var(--wechat-tabbar-bg) !important;
  border-top: 1px solid var(--wechat-tabbar-border) !important;
  box-shadow: 0 -1px 0 rgba(31, 42, 51, .03) !important;
  backdrop-filter: blur(22px) saturate(1.35) !important;
  -webkit-backdrop-filter: blur(22px) saturate(1.35) !important;
  overflow: hidden !important;
}

.bottom-nav button {
  min-height: var(--fixed-tabbar-content-height) !important;
  height: var(--fixed-tabbar-content-height) !important;
  padding: 7px 0 0 !important;
  display: grid !important;
  align-content: start !important;
  justify-items: center !important;
  gap: 2px !important;
  border: 0 !important;
  outline: 0 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  color: var(--wechat-tabbar-text) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  line-height: 1.15 !important;
}

.bottom-nav button span {
  width: 32px !important;
  height: 28px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 0 !important;
  border: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  color: inherit !important;
  font-size: 24px !important;
  line-height: 1 !important;
  text-shadow: none !important;
}

.bottom-nav .tab-icon svg {
  width: 25px !important;
  height: 25px !important;
  display: block !important;
  overflow: visible !important;
  stroke: currentColor !important;
  stroke-width: 1.9 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  fill: none !important;
}

.bottom-nav .tab-icon svg * {
  fill: none !important;
  stroke: currentColor !important;
  vector-effect: non-scaling-stroke;
}

.bottom-nav button.active,
.bottom-nav button.active span {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  filter: none !important;
  color: var(--wechat-tabbar-active) !important;
  -webkit-text-fill-color: var(--wechat-tabbar-active) !important;
}

.bottom-nav button.active span::before,
.bottom-nav button.active span::after {
  display: none !important;
  content: none !important;
}

.content {
  padding-bottom: calc(var(--fixed-tabbar-height) + 12px) !important;
}

html[data-theme-color="dark"] .phone-shell {
  --wechat-tabbar-bg: rgba(29, 29, 29, .96);
  --wechat-tabbar-border: rgba(255, 255, 255, .10);
  --wechat-tabbar-text: #a7a7aa;
  --wechat-tabbar-active: #07c160;
}

html[data-theme-color="dark"] .bottom-nav {
  background: var(--wechat-tabbar-bg) !important;
  border-top-color: var(--wechat-tabbar-border) !important;
}

/* Final override: active tab icons must stay WeChat-style line icons, never filled tiles. */
.phone-shell .bottom-nav button.active,
html[data-theme-color="dark"] .phone-shell .bottom-nav button.active {
  background: transparent !important;
  background-image: none !important;
  color: var(--wechat-tabbar-active) !important;
  -webkit-text-fill-color: var(--wechat-tabbar-active) !important;
}

.phone-shell .bottom-nav button.active > span,
html[data-theme-color="dark"] .phone-shell .bottom-nav button.active > span,
html[data-theme-color="dark"] .phone-shell .bottom-nav button.active > span.tab-icon {
  width: 32px !important;
  height: 28px !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  color: var(--wechat-tabbar-active) !important;
  -webkit-text-fill-color: var(--wechat-tabbar-active) !important;
}

.phone-shell .bottom-nav button.active > span svg,
html[data-theme-color="dark"] .phone-shell .bottom-nav button.active > span svg,
.phone-shell .bottom-nav button.active > span svg * {
  fill: none !important;
  stroke: currentColor !important;
  color: var(--wechat-tabbar-active) !important;
}

/* Public feedback feed: WeChat-style social records. */
.feedback-page {
  --feedback-author: #58708d;
  --feedback-muted: #7b8792;
  --feedback-line: rgba(31, 42, 51, .10);
  --feedback-menu-bg: #2b2f35;
  --feedback-menu-text: #f6f7f8;
}

.feedback-intro {
  min-height: 156px;
  padding-right: 136px;
}

.feedback-suggest-link {
  position: absolute;
  top: 50%;
  right: 22px;
  z-index: 2;
  transform: translateY(-50%);
  min-width: 96px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(47, 167, 127, .22);
}

.feedback-feed {
  display: grid;
  gap: 14px;
}

.feedback-post {
  position: relative;
  padding: 16px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(31, 42, 51, .06);
  box-shadow: 0 12px 28px rgba(39, 56, 75, .08);
}

.feedback-post.detail {
  min-height: 48vh;
}

.feedback-post-head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.feedback-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 8px;
  object-fit: cover;
  background: linear-gradient(145deg, #244c5c, #2faf83);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
}

.feedback-post-main {
  min-width: 0;
  flex: 1;
}

.feedback-author-line {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}

.feedback-author-line strong {
  color: var(--feedback-author);
  font-size: 15px;
  line-height: 1.25;
}

.feedback-author-line span {
  color: var(--feedback-muted);
  font-size: 12px;
  line-height: 1.25;
}

.feedback-body-button {
  width: 100%;
  margin: 6px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
}

.feedback-body-button p {
  margin: 0;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
  font-size: 15px;
}

.feedback-body-button small {
  display: inline-flex;
  margin-top: 8px;
  color: var(--feedback-muted);
  font-size: 12px;
}

.feedback-post-meta {
  position: relative;
  margin-top: 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--feedback-muted);
  font-size: 12px;
}

.feedback-delete,
.feedback-comment-row button,
.feedback-view-more {
  border: 0;
  background: transparent;
  color: #d95463;
  font: inherit;
  font-size: 12px;
  padding: 0;
}

.feedback-action-wrap {
  position: relative;
  margin-left: auto;
}

.feedback-more {
  width: 34px;
  height: 24px;
  border: 0;
  border-radius: 5px;
  background: rgba(31, 42, 51, .08);
  color: #51616d;
  display: grid;
  place-items: center;
  line-height: 1;
  font-size: 15px;
  letter-spacing: 1px;
}

.feedback-action-popover {
  position: absolute;
  right: 0;
  top: 30px;
  z-index: 20;
  display: grid;
  grid-auto-flow: column;
  overflow: hidden;
  min-width: 142px;
  border-radius: 5px;
  background: var(--feedback-menu-bg);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .22);
}

.feedback-action-popover button {
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, .12);
  background: transparent;
  color: var(--feedback-menu-text);
  min-width: 70px;
  height: 38px;
  font-size: 14px;
  font-weight: 650;
}

.feedback-action-popover button:last-child {
  border-right: 0;
}

.feedback-social-line {
  margin-top: 10px;
  padding: 8px 10px;
  display: flex;
  gap: 14px;
  border-radius: 6px;
  background: rgba(31, 42, 51, .05);
  color: var(--feedback-author);
  font-size: 12px;
  font-weight: 700;
}

.feedback-comment-list {
  margin-top: 8px;
  padding: 8px 10px;
  display: grid;
  gap: 6px;
  border-radius: 6px;
  background: rgba(31, 42, 51, .05);
}

.feedback-comment-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.feedback-comment-row strong {
  color: var(--feedback-author);
}

.feedback-view-more {
  justify-self: start;
  color: var(--feedback-author);
  font-weight: 700;
}

.feedback-detail-page {
  padding-bottom: calc(var(--fixed-tabbar-height) + 84px) !important;
}

.feedback-detail-comment {
  position: fixed;
  left: 50%;
  bottom: max(env(safe-area-inset-bottom), 8px);
  transform: translateX(-50%);
  width: min(430px, 100vw);
  padding: 8px 12px;
  z-index: 6100;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px;
  gap: 8px;
  background: rgba(247, 247, 247, .96);
  border-top: 1px solid rgba(31, 42, 51, .10);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.feedback-detail-comment .field {
  height: 38px;
  border-radius: 4px;
  background: rgba(31, 42, 51, .06);
}

html[data-theme-color="dark"] .feedback-page {
  --feedback-author: #8090a8;
  --feedback-muted: #7f7f85;
  --feedback-line: rgba(255, 255, 255, .10);
  --feedback-menu-bg: #323338;
  --feedback-menu-text: #e7e7e7;
}

html[data-theme-color="dark"] .feedback-suggest-link {
  background: var(--wechat-green);
  color: #f7f7f7;
  box-shadow: none;
}

html[data-theme-color="dark"] .feedback-post {
  background: #151515;
  border-color: #262626;
  box-shadow: none;
}

html[data-theme-color="dark"] .feedback-body-button p,
html[data-theme-color="dark"] .feedback-comment-row {
  color: #d7d7d7;
}

html[data-theme-color="dark"] .feedback-more {
  background: #242426;
  color: #a7a7aa;
}

html[data-theme-color="dark"] .feedback-social-line,
html[data-theme-color="dark"] .feedback-comment-list {
  background: #1f1f21;
}

html[data-theme-color="dark"] .feedback-detail-comment {
  background: rgba(29, 29, 29, .96);
  border-top-color: rgba(255, 255, 255, .10);
}

html[data-theme-color="dark"] .feedback-detail-comment .field {
  background: #242426;
  color: #e7e7e7;
}

@media (max-width: 360px) {
  .feedback-intro {
    min-height: 0;
    padding-right: 24px;
  }

  .feedback-suggest-link {
    position: relative;
    top: auto;
    right: auto;
    transform: none;
    margin-top: 14px;
  }
}

/* 账本流水卡沿用看板档案卡的信息顺序：昵称、品种、体测标签、日期。 */
.ledger-row {
  grid-template-columns: 54px minmax(0, 1fr) auto !important;
  min-height: 0;
  gap: 10px;
  padding: 12px 12px 38px !important;
}

.ledger-row-main {
  display: grid;
  align-content: center;
  gap: 5px;
}

.ledger-row-title-line {
  min-width: 0;
  display: grid !important;
  align-content: start;
  gap: 2px;
}

.ledger-row-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: nowrap;
}

.ledger-row-title .ledger-title-text {
  min-width: 0;
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 780;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-row .ledger-inline-type.purchase,
.ledger-row .ledger-inline-type.sold,
.ledger-row .ledger-inline-type.loss {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid var(--divider);
  border-radius: 999px;
  color: var(--muted);
  background: var(--raised-bg);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
}

.ledger-row-species {
  min-width: 0;
  margin: 0 !important;
  overflow: hidden;
  color: var(--muted) !important;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-row .ledger-turtle-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.ledger-row .ledger-turtle-meta span {
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid var(--divider);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  background: var(--raised-bg);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.ledger-row .muted {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.ledger-row .ledger-amount {
  padding-top: 27px;
  align-self: start;
  justify-self: end;
  font-size: 16px;
}

.ledger-row .ledger-amount.sold { color: var(--aqua) !important; }
.ledger-row .ledger-amount.purchase,
.ledger-row .ledger-amount.loss { color: var(--danger) !important; }

html[data-theme-color="dark"] .ledger-row .ledger-inline-type.purchase,
html[data-theme-color="dark"] .ledger-row .ledger-inline-type.sold,
html[data-theme-color="dark"] .ledger-row .ledger-inline-type.loss,
html[data-theme-color="dark"] .ledger-row .ledger-turtle-meta span {
  color: var(--muted) !important;
  border-color: #303033 !important;
  background: #202020 !important;
}

/* System announcements: a cloud-backed notice is deliberately separate from
   account data, so it can be shown consistently on every signed-in device. */
.announcement-form { gap: 14px; }
.announcement-pin { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.announcement-pin input { accent-color: var(--accent); }
.announcement-pin small { grid-column: 2; color: var(--muted); font-size: 12px; }
.announcement-admin-list { display: grid; gap: 12px; }
.announcement-admin-card { display: grid; gap: 9px; }
.announcement-admin-card > div { display: flex; align-items: center; gap: 7px; }
.announcement-admin-card > div small { margin-left: auto; color: var(--muted); }
.announcement-admin-card strong { font-size: 16px; }
.announcement-admin-card p { margin: 0; color: var(--muted); line-height: 1.65; }
.announcement-admin-card > small { color: var(--muted); }
.announcement-admin-card footer { display: flex; justify-content: flex-end; gap: 9px; }
.announcement-admin-card footer button { border: 1px solid var(--divider); border-radius: 10px; padding: 8px 12px; background: var(--raised-bg); color: var(--text); font-size: 12px; }
.announcement-admin-card footer button.danger { border-color: rgba(224,79,95,.28); color: var(--danger); }
.announcement-status,.announcement-pinned { border-radius: 999px; padding: 3px 7px; font-size: 11px; font-style: normal; }
.announcement-status.active { background: rgba(47,167,127,.14); color: var(--accent); }
.announcement-status.ended { background: var(--raised-bg); color: var(--muted); }
.announcement-pinned { background: rgba(240,165,26,.14); color: #bb7911; }
.system-announcement-overlay { position: fixed; z-index: 260; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(10,16,14,.62); backdrop-filter: blur(8px); }
.system-announcement-dialog { width: min(100%, 430px); max-height: min(680px, calc(100vh - 48px)); overflow: auto; border: 1px solid var(--divider); border-radius: 22px; padding: 24px; background: var(--card-bg); box-shadow: 0 18px 52px rgba(0,0,0,.28); }
.system-announcement-dialog > p { margin: 0 0 10px; color: var(--accent); font-size: 12px; font-weight: 700; }
.system-announcement-dialog h1 { margin: 0; color: var(--text); font-size: 22px; line-height: 1.35; }
.system-announcement-dialog > div { margin-top: 16px; color: var(--text); line-height: 1.75; white-space: normal; }
.system-announcement-dialog > small { display: block; margin-top: 14px; color: var(--muted); }
.system-announcement-dialog .primary { width: 100%; margin-top: 20px; }

.app-review-invite-overlay { position: fixed; z-index: 290; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(8,14,12,.48); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.app-review-invite-dialog { width: min(100%, 360px); padding: 24px 22px 18px; border: 1px solid var(--divider); border-radius: 24px; background: var(--card-bg); box-shadow: 0 24px 70px rgba(0,0,0,.3); text-align: center; }
.app-review-invite-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 14px; border-radius: 18px; background: color-mix(in srgb, var(--accent) 14%, var(--card-bg)); font-size: 30px; }
.app-review-invite-dialog > p { margin: 0 0 6px; color: var(--accent); font-size: 13px; font-weight: 700; }
.app-review-invite-dialog h2 { margin: 0; color: var(--text); font-size: 22px; line-height: 1.3; }
.app-review-invite-dialog > span { display: block; margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.app-review-invite-actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; margin-top: 22px; }
.app-review-invite-actions button { min-height: 46px; border: 0; border-radius: 14px; background: var(--raised-bg); color: var(--text); font: inherit; font-weight: 700; }
.app-review-invite-actions button.primary { background: var(--accent); color: #fff; }

.platform-admin-badge {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 6px;
  border-radius: 999px;
  padding: 2px 6px;
  background: linear-gradient(135deg, #13b985, #0c8f70);
  color: #fff !important;
  font-size: 10px !important;
  font-weight: 760 !important;
  line-height: 1.25;
  letter-spacing: .02em;
  white-space: nowrap;
}

.community-moment-author .community-profile-name,
.community-detail-author-button strong,
.message-friend-copy strong,
.community-friend-row strong,
.following-user-card strong,
.following-profile-head h2,
.market-card-seller i,
.market-seller-name strong,
.community-chat-user-link {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
}

/* Guest tabs retain their normal page chrome.  The login prompt only occupies
   the otherwise unused area immediately above the persistent tab bar. */
.guest-login-slot {
  position: fixed;
  left: 50%;
  bottom: var(--fixed-tabbar-height);
  transform: translateX(-50%);
  width: min(430px, 100vw);
  box-sizing: border-box;
  height: clamp(180px, 26vh, 300px);
  padding: 20px;
  display: grid;
  place-items: center;
  text-align: center;
  background: var(--page-bg);
  z-index: 20;
  overflow: hidden;
}

.guest-login-slot > div {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.guest-login-slot strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

.guest-login-slot span {
  color: var(--muted);
  font-size: 13px;
}

.guest-login-slot button {
  min-height: 38px;
  margin-top: 4px;
  padding: 0 20px;
  border-radius: 20px;
  color: #fff;
  background: var(--accent);
  font-size: 13px;
  font-weight: 650;
}

/* On the guest ledger the empty-record board ends above the fixed login area,
   so the two surfaces never overlap or form a notched background. */
.guest-ledger-content > .empty {
  min-height: 180px;
  padding-block: 42px;
}

/* Community post media: one short video or up to nine still images. */
.community-draft-media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 112px));
  gap: 9px;
  align-items: start;
}

.community-draft-media-item,
.community-media-add {
  position: relative;
  width: 112px;
  height: 112px;
  min-height: 112px;
  overflow: hidden;
  border-radius: 4px;
}

.community-draft-media-item {
  background: #101010;
}

.community-draft-media-item img,
.community-draft-media-item video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.community-draft-media-item > i {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 26px;
  font-style: normal;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .55);
  pointer-events: none;
}

.community-draft-media-item > button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, .62);
  font-size: 20px;
  line-height: 22px;
}

.community-compose-page .community-media-add > span {
  width: 100%;
  height: 100%;
  justify-content: center;
}

.community-draft-media-tip {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.community-media-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  width: 100%;
  background: var(--page-bg);
}

.community-media-gallery .community-media {
  width: 100%;
  height: auto;
  max-height: none;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.community-detail-media-gallery {
  display: grid;
  width: min(100%, 360px);
  gap: 4px;
}

.community-detail-media-gallery.is-gallery {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.community-detail-media-gallery.is-gallery .community-detail-media-button {
  width: 100%;
  min-height: 0;
  aspect-ratio: 1 / 1;
}

.community-detail-media-gallery.is-gallery .community-detail-media-button .community-media {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
}

@media (max-width: 390px) {
  .community-draft-media-grid {
    grid-template-columns: repeat(3, minmax(0, 96px));
  }

  .community-draft-media-item,
  .community-media-add {
    width: 96px;
    height: 96px;
    min-height: 96px;
  }
}

/* Chat header: the return chevron matches the nickname's size and center line. */
.community-chat-nav .icon-btn[data-back] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  align-self: center !important;
  color: var(--ink) !important;
  font-size: 20px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
}

.community-chat-nav .community-chat-user-link {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  align-self: center;
}

/* A real icon avoids the thin, font-dependent \"‹\" glyph and keeps all
   header back arrows visually consistent with the adjacent title weight. */
.back-nav-icon {
  width: 21px;
  height: 21px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Chat header: equal side slots keep the name truly centered; the chevron
   gets a small visual inset while its full touch target remains available. */
.community-chat-nav {
  grid-template-columns: 44px minmax(0, 1fr) 44px !important;
  padding-left: 8px !important;
  padding-right: 8px !important;
}

.community-chat-nav .icon-btn[data-back] {
  justify-content: flex-start !important;
}

.community-chat-nav .icon-btn[data-back] .back-nav-icon {
  transform: translateX(6px);
}

.topbar .nav-title .icon-btn[data-back] .back-nav-icon {
  transform: translateX(6px);
}

.community-chat-nav .community-chat-user-link {
  justify-self: center;
  max-width: 100%;
  text-align: center;
}

.community-chat-nav .community-chat-more {
  width: 44px;
  height: 44px;
  justify-self: end;
}

/* Global navigation: keep every visual back chevron close to the left edge,
   while retaining a full 44px touch target. */
.topbar .nav-title {
  grid-template-columns: 44px minmax(0, 1fr) 44px !important;
  padding-left: 0 !important;
  padding-right: 4px !important;
}

.topbar .nav-title .icon-btn[data-back],
.community-chat-nav .icon-btn[data-back] {
  width: 44px !important;
  min-width: 44px !important;
  height: 44px !important;
  margin-left: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  justify-self: start !important;
  background: transparent !important;
  box-shadow: none !important;
}

.community-chat-nav {
  grid-template-columns: 44px minmax(0, 1fr) max-content !important;
  padding-left: 0 !important;
  padding-right: 4px !important;
}

/* Three-dot triggers are icon-only across every page. The action sheets and
   menus they open are intentionally unchanged. */
.more-btn,
.detail-more,
.market-detail-more-button,
.community-chat-more,
.feedback-more,
.more-floating {
  border-color: transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.more-btn:active,
.detail-more:active,
.market-detail-more-button:active,
.community-chat-more:active,
.feedback-more:active,
.more-floating:active,
.turtle-row.menu-open .more-btn,
.detail-summary-card.menu-open .detail-more,
.content .ledger-row.ledger-menu-open .ledger-more-btn,
.breeding-row.menu-open .breeding-more-btn {
  background: transparent !important;
  box-shadow: none !important;
}

/* Conversation cards: keep the date and entry chevron on one visual baseline. */
.message-friend-meta {
  align-self: flex-start !important;
  height: 20px;
  margin-top: 4px;
  align-items: center !important;
}

.message-friend-time,
.message-friend-meta > b {
  height: 20px;
  display: inline-flex !important;
  align-items: center;
  line-height: 20px !important;
}

.message-friend-meta > b {
  transform: translateY(-1px);
}

/* 私聊输入栏：使用系统键盘发送，更多操作收纳在 + 面板中。 */
.community-chat-form {
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
}

.community-chat-form.has-send-button { grid-template-columns: minmax(0, 1fr) 42px auto; }
.community-chat-form .community-chat-send-btn { height: 42px; padding: 0 12px; }
.community-chat-form .community-chat-send-btn[hidden] { display: none; }
.community-chat-form .community-chat-send-btn:disabled { opacity: .65; }

.community-chat-form .community-chat-plus-btn {
  width: 42px;
  min-width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid var(--divider);
  border-radius: 50%;
  color: var(--ink);
  background: var(--raised-bg);
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
}

.community-chat-form .community-chat-plus-btn.is-open {
  color: var(--muted);
  font-size: 28px;
}

.community-chat-tools {
  position: fixed;
  z-index: 49;
  bottom: calc(62px + env(safe-area-inset-bottom));
  left: 50%;
  width: min(430px, 100vw);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 16px 18px 18px;
  transform: translateX(-50%);
  background: var(--topbar-bg);
  border-top: 1px solid var(--divider);
  box-shadow: 0 -7px 18px rgba(31, 42, 51, .06);
}

.community-chat-tools button {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 0;
  color: var(--text);
  background: transparent;
}

.community-chat-tools button > span {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: var(--ink);
  background: var(--raised-bg);
}

.community-chat-tools svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-chat-tools b {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.community-chat-page.chat-tools-open .community-chat-list {
  padding-bottom: calc(214px + env(safe-area-inset-bottom));
}

.community-message-media {
  width: min(72vw, 258px);
  max-width: 78%;
  aspect-ratio: var(--community-media-ratio, 1 / 1);
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--divider);
  border-radius: 14px;
  background: var(--section-bg);
}

.community-message.mine .community-message-media {
  justify-self: end;
}

.community-message.theirs .community-message-media {
  justify-self: start;
}

.community-message-media img,
.community-message-media video {
  width: 100%;
  height: 100%;
  max-height: none;
  display: block;
  object-fit: cover;
}

/* Long-press actions for text messages: keep the menu out of the layout so
   opening it never shifts or re-renders the chat list. */
.community-chat-text-message {
  -webkit-user-select: text;
  user-select: text;
  touch-action: pan-y;
}

.community-message.is-recalled .community-message-content {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 4px 0 !important;
}

.community-chat-recalled-message {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.community-chat-message-menu {
  position: fixed;
  z-index: 500;
  display: flex;
  min-height: 48px;
  overflow: hidden;
  border-radius: 12px;
  background: rgba(28, 29, 31, .96);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .28);
  opacity: 0;
  transform: translateY(4px) scale(.98);
  transition: opacity .14s ease, transform .14s ease;
}

.community-chat-message-menu.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.community-chat-message-menu::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: inherit;
  transform: translateX(-50%) rotate(45deg);
}

.community-chat-message-menu button {
  position: relative;
  z-index: 1;
  min-width: 78px;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, .16);
  border-radius: 0;
  color: #fff;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
}

.community-chat-message-menu button:last-child { border-right: 0; }
.community-chat-message-menu button:active { background: rgba(255, 255, 255, .14); }

.keyboard-open .community-chat-tools {
  display: none !important;
}

html[data-theme-color="dark"] .community-chat-tools,
html[data-theme-color="dark"] .community-chat-form .community-chat-plus-btn,
html[data-theme-color="dark"] .community-chat-tools button > span,
html[data-theme-color="dark"] .community-message-media {
  border-color: #303033 !important;
  background: #202020 !important;
}

/* 上线前的规则、隐私、举报审核与备份入口 */
.auth-agreement {
  margin: 2px 0 4px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.auth-agreement input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--aqua);
}

.auth-agreement button {
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--aqua);
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-weight: 800;
}

.policy-consent-overlay {
  position: fixed;
  z-index: 11000;
  inset: 0;
  padding: max(22px, env(safe-area-inset-top, 0px) + 18px) 20px max(22px, env(safe-area-inset-bottom, 0px) + 18px);
  display: grid;
  place-items: center;
  overflow: auto;
  background: rgba(14, 27, 31, .62);
  backdrop-filter: blur(7px);
}

.policy-consent-dialog {
  width: min(100%, 420px);
  padding: 24px 20px 18px;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 22px;
  color: var(--ink);
  background: var(--raised-bg);
  box-shadow: 0 28px 70px rgba(9, 23, 29, .34);
}

.policy-consent-kicker {
  margin: 0 0 8px;
  color: var(--aqua);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .08em;
}

.policy-consent-dialog h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
}

.policy-consent-dialog > p:not(.policy-consent-kicker) {
  margin: 10px 0 17px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.policy-consent-links {
  border: 1px solid var(--divider);
  border-radius: 13px;
  overflow: hidden;
  background: var(--surface);
}

.policy-consent-links a {
  min-height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 760;
}

.policy-consent-links a + a { border-top: 1px solid var(--divider); }
.policy-consent-links b { color: var(--aqua); font-size: 20px; font-weight: 500; }

.policy-consent-check {
  margin: 18px 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.policy-consent-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--aqua); }
.policy-consent-error {
  margin: -5px 0 11px;
  color: var(--danger);
  font-size: 12px;
  line-height: 1.5;
}
.policy-consent-submit { width: 100%; min-height: 48px; }
.policy-consent-submit:disabled { opacity: .45; cursor: not-allowed; }

.policy-consent-logout {
  width: 100%;
  min-height: 38px;
  margin-top: 6px;
  border: 0;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font-size: 13px;
}

.push-test-card .secondary { min-height: 42px; margin-top: 5px; }

.mine-row-count {
  min-width: 22px;
  height: 22px;
  margin-left: auto;
  padding: 0 7px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: var(--danger);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.about-compliance-card > div:last-child {
  margin-top: 10px;
  display: flex;
  gap: 9px;
}

.about-compliance-card button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--divider);
  border-radius: 9px;
  color: var(--ink);
  background: var(--raised-bg);
  font-size: 12px;
  font-weight: 800;
  box-shadow: none;
}

.compliance-page {
  padding-bottom: calc(var(--fixed-tabbar-height) + 24px);
}

.compliance-intro h2,
.moderation-intro h2 {
  font-size: 26px;
}

.policy-card {
  margin-bottom: 12px;
  padding: 17px 16px;
}

.policy-card h3 {
  margin: 0 0 9px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
}

.policy-card p,
.policy-card li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.policy-card p { margin: 0; }
.policy-card ol { margin: 0; padding-left: 19px; }
.policy-card strong { color: var(--aqua); }

.compliance-link-card {
  width: 100%;
  min-height: 54px;
  margin: 0 0 10px;
  padding: 0 16px;
  border: 1px solid var(--divider);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  background: var(--raised-bg);
  box-shadow: none;
  font-weight: 850;
}

.compliance-link-card b {
  color: var(--aqua);
  font-size: 22px;
  font-weight: 500;
}

.content-report-overlay {
  position: fixed;
  z-index: 10020;
  inset: 0;
  padding: 20px;
  display: grid;
  place-items: center;
  background: rgba(11, 22, 28, .48);
}

body.content-report-open { overflow: hidden; }

.content-report-dialog {
  width: min(100%, 420px);
  max-height: min(680px, calc(100vh - 40px));
  padding: 19px;
  border: 1px solid var(--divider);
  border-radius: 18px;
  overflow: auto;
  color: var(--ink);
  background: var(--raised-bg);
  box-shadow: 0 28px 60px rgba(15, 33, 41, .26);
}

.content-report-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.content-report-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.content-report-head h2 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 21px;
}

.content-report-head button {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: var(--page-bg);
  box-shadow: none;
  font-size: 22px;
  line-height: 1;
}

.content-report-dialog > p {
  margin: 12px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.content-report-dialog form {
  display: grid;
  gap: 13px;
}

.content-report-dialog label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.content-report-dialog textarea {
  min-height: 90px;
  resize: vertical;
}

.content-report-dialog .primary { min-height: 44px; }

.market-detail-actions .market-report-action {
  min-width: 54px;
  flex: 0 0 auto;
  border: 1px solid var(--divider);
  color: var(--muted);
  background: var(--raised-bg);
}

.moderation-page {
  padding-bottom: calc(var(--fixed-tabbar-height) + 24px);
}

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

.moderation-report-card {
  padding: 15px;
}

.moderation-report-head {
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.moderation-report-head > span,
.moderation-report-head > em {
  min-height: 23px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.moderation-report-head > span {
  color: var(--aqua);
  background: var(--page-bg);
}

.moderation-report-head > em.pending { color: #9b6200; background: #fff2d8; }
.moderation-report-head > em.resolved { color: var(--muted); background: var(--page-bg); }
.moderation-report-head > em.removed { color: var(--danger); background: #fff0f2; }

.moderation-report-card > strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.moderation-report-card > p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.moderation-report-card > p b { color: var(--ink); }
.moderation-report-card > small { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }

.moderation-report-actions {
  margin-top: 13px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.moderation-report-actions button {
  min-height: 37px;
  border: 1px solid var(--divider);
  border-radius: 9px;
  color: var(--ink);
  background: var(--page-bg);
  box-shadow: none;
  font-size: 13px;
  font-weight: 850;
}

.moderation-report-actions .danger {
  border-color: rgba(237, 93, 110, .26);
  color: var(--danger);
  background: #fff2f3;
}

html[data-theme-color="dark"] .content-report-dialog,
html[data-theme-color="dark"] .compliance-link-card,
html[data-theme-color="dark"] .about-compliance-card button,
html[data-theme-color="dark"] .market-detail-actions .market-report-action,
html[data-theme-color="dark"] .moderation-report-actions button {
  border-color: #363638;
  color: #e7e7e8;
  background: #222224;
}

html[data-theme-color="dark"] .moderation-report-head > em.pending { color: #ffd28a; background: #513b18; }
html[data-theme-color="dark"] .moderation-report-head > em.removed,
html[data-theme-color="dark"] .moderation-report-actions .danger { color: #ff9ca8; background: #42262b; }

@media (max-width: 360px) {
  .market-detail-actions .market-report-action { min-width: 45px; padding-inline: 7px; font-size: 12px; }
}

/* 账本信息卡：压缩高度，右侧状态、金额、移除与左侧资料逐行对齐。 */
.content .ledger-row {
  min-height: 0 !important;
  padding: 12px !important;
  align-items: stretch;
}

.content .ledger-row-main {
  gap: 4px;
}

.content .ledger-row-species {
  padding-left: 7px;
}

.content .ledger-row-side {
  min-width: 88px;
  display: grid;
  grid-template-rows: 22px auto auto 1fr;
  row-gap: 2px;
  justify-items: end;
  align-items: start;
}

.content .ledger-linked-status {
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid var(--divider);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  background: var(--raised-bg);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.content .ledger-row-side .ledger-amount {
  grid-row: 2;
  padding-top: 0 !important;
  align-self: start;
  font-size: 18px;
  line-height: 22px;
}

.content .ledger-row-side .ledger-delete {
  position: static;
  grid-row: 4;
  align-self: end;
  padding: 0;
  font-size: 13px;
  line-height: 18px;
}

.content .ledger-row-date {
  grid-row: 3;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
  white-space: nowrap;
}

html[data-theme-color="dark"] .content .ledger-linked-status {
  color: var(--muted);
  border-color: #303033;
  background: #202020;
}

.content .ledger-row-side .ledger-linked-status {
  margin-right: 32px;
}

.content .ledger-row.ledger-menu-open {
  overflow: visible !important;
  z-index: 12;
}

.content .ledger-row .ledger-more-btn {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  z-index: 4;
  width: 28px !important;
  min-width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 8px !important;
  display: grid !important;
  place-items: center !important;
  color: var(--muted) !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: -1px !important;
}

.content .ledger-row .ledger-more-btn > span {
  display: block;
  transform: translateY(-2px);
}

.content .ledger-row .ledger-more-btn:active,
.content .ledger-row.ledger-menu-open .ledger-more-btn {
  color: var(--text) !important;
  background: var(--raised-bg) !important;
}

.content .ledger-action-menu {
  position: absolute;
  top: 39px;
  right: 8px;
  z-index: 16;
  min-width: 88px;
  padding: 4px;
  border: 1px solid var(--divider);
  border-radius: 9px;
  background: var(--section-bg);
  box-shadow: 0 10px 24px rgba(31, 42, 51, .14);
  animation: archive-actions-in .16s ease-out both;
}

.content .ledger-action-menu button {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.content .ledger-action-menu svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

html[data-theme-color="dark"] .content .ledger-action-menu {
  border-color: #303033;
  background: #202020;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .32);
}

/* 经营账本：三种流水采用同一资料卡，仅以金额颜色区分收支。 */
.ledger-row {
  grid-template-columns: 54px minmax(0, 1fr) auto !important;
  min-height: 112px;
  gap: 10px;
  padding: 14px 12px 39px !important;
  align-items: start;
}

.ledger-row .ledger-thumb {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 8px;
}

.ledger-thumb-placeholder {
  display: grid;
  place-items: center;
  border: 1px solid #dceaf0;
  color: #6d8790;
  background: #f2f8fa;
  box-shadow: none;
}

.ledger-thumb-placeholder span {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #4b7782;
  background: #e2f0f2;
  font-size: 13px;
  font-weight: 800;
}

.ledger-row-title-line {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ledger-row-title {
  min-width: 0;
  flex-wrap: nowrap;
}

.ledger-row-title .ledger-inline-type {
  flex: 0 0 auto;
}

.ledger-row .ledger-inline-type.purchase,
.ledger-row .ledger-inline-type.sold,
.ledger-row .ledger-inline-type.loss {
  color: #246b7a;
  background: #eef5ff;
}

.ledger-title-text {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-row-species {
  min-width: 0;
  margin: 0 !important;
  overflow: hidden;
  color: var(--muted) !important;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-row .ledger-turtle-meta {
  flex-wrap: nowrap;
  overflow: hidden;
}

.ledger-row .ledger-turtle-meta span {
  flex: 0 0 auto;
}

.ledger-row .muted {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}

.ledger-amount {
  padding-top: 27px;
  align-self: start;
  font-size: 18px;
}

.ledger-amount.sold {
  color: var(--aqua) !important;
}

.ledger-amount.purchase,
.ledger-amount.loss {
  color: var(--danger) !important;
}

html[data-theme-color="dark"] .ledger-thumb-placeholder {
  border-color: #303d42;
  color: #a4b6c2;
  background: #1d282c;
}

html[data-theme-color="dark"] .ledger-thumb-placeholder span {
  color: #b4d4d6;
  background: #26363a;
}

html[data-theme-color="dark"] .ledger-row .ledger-inline-type.purchase,
html[data-theme-color="dark"] .ledger-row .ledger-inline-type.sold,
html[data-theme-color="dark"] .ledger-row .ledger-inline-type.loss {
  color: #b6d6df !important;
  background: #1d282c !important;
  border-color: #303d42 !important;
}

/* 龟集市：轻量、可信的个人活体交易信息流。 */
.bottom-nav {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

.bottom-nav button {
  min-width: 0 !important;
  padding-inline: 2px !important;
  font-size: 10px !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
}

.bottom-nav .tab-icon {
  width: 24px !important;
  height: 24px !important;
}

.message-discover-preview:not(:empty)::after {
  display: none !important;
}

.market-page {
  padding: 12px 10px 138px !important;
  background: #fff !important;
}

.my-market-page {
  min-height: calc(100vh - 88px);
  padding-bottom: 98px !important;
}

.my-market-notice {
  margin-bottom: 11px;
  padding: 13px 14px;
  border: 1px solid #d8ede3;
  border-radius: 13px;
  color: #28624d;
  background: #f0f9f4;
}

.my-market-notice strong {
  display: block;
  font-size: 14px;
}

.my-market-notice p {
  margin: 5px 0 0;
  color: #678076;
  font-size: 11px;
  line-height: 1.55;
}

.my-market-tabs {
  margin-bottom: 12px;
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  border-radius: 12px;
  background: #edf4f1;
}

.my-market-tabs button {
  min-height: 38px;
  border-radius: 9px;
  color: #688078;
  font-size: 13px;
  font-weight: 700;
  background: transparent;
}

.my-market-tabs button.active {
  color: #187555;
  background: #fff;
  box-shadow: 0 2px 7px rgba(38, 95, 75, .08);
}

.my-market-tabs b {
  margin-left: 3px;
  font-size: 12px;
}

.my-market-list {
  display: grid;
  gap: 10px;
}

.my-market-listing {
  padding: 10px;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.my-market-listing.is-inactive {
  opacity: .72;
}

.my-market-media {
  width: 76px;
  height: 76px;
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 10px;
  background: #eaf1ee;
}

.my-market-media img,
.my-market-media video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.my-market-media.is-video i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-style: normal;
  background: rgba(0, 0, 0, .32);
}

.my-market-listing-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.my-market-listing-main > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.my-market-listing-main strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-market-listing-main em {
  flex: 0 0 auto;
  padding: 2px 5px;
  border-radius: 5px;
  color: #277d5d;
  font-size: 10px;
  font-style: normal;
  background: #e8f6ee;
}

.my-market-listing.is-inactive em {
  color: #7a817d;
  background: #edf0ee;
}

.my-market-listing-main > span,
.my-market-listing-main small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-market-listing-main b {
  color: #ed4d5c;
  font-size: 18px;
}

.my-market-listing-main b i {
  margin-right: 1px;
  font-size: 11px;
  font-style: normal;
}

.my-market-listing-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 8px;
}

.my-market-listing-actions.has-offline {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.my-market-listing-actions.has-confirm {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.my-market-listing-main small {
  white-space: normal;
  line-height: 1.5;
}

.my-market-listing-actions button {
  min-height: 35px;
  border: 1px solid #d7e9e0;
  border-radius: 18px;
  color: #28755a;
  font-size: 12px;
  font-weight: 700;
  background: #f2f9f5;
}

.my-market-listing-actions button.refresh {
  border-color: transparent;
  color: #fff;
  background: #2fa77f;
}

.my-market-listing-actions button.offline {
  border-color: #f0d7d9;
  color: #c65b62;
  background: #fff7f7;
}

.market-top-service {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  justify-self: center;
  align-self: center;
  padding: 0;
  border-radius: 50%;
  color: #8cbfd8;
  background: transparent;
}

.market-top-service svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.market-top-service:active {
  background: #eef8fc;
  transform: scale(.92);
}

.market-top-add {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  justify-self: center;
  align-self: center;
  color: var(--text);
  background: transparent;
  font-size: 28px;
  font-weight: 300;
}

.market-search-area {
  position: relative;
  z-index: 20;
}

/* The upload continues in the background after leaving the publish form. */
.market-publish-progress {
  position: fixed;
  top: calc(var(--fixed-topbar-height, 78px) + 8px);
  left: max(12px, calc(50% - 203px));
  z-index: 5990;
  width: min(244px, calc(100vw - 28px));
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  color: #263c34;
  background: rgba(255, 255, 255, .97);
  border: 1px solid rgba(47, 167, 127, .24);
  border-radius: 13px;
  box-shadow: 0 8px 22px rgba(30, 62, 50, .15);
  pointer-events: none;
  transform: translateZ(0);
}

.market-publish-progress-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 2px solid rgba(47, 167, 127, .24);
  border-top-color: #2fa77f;
  border-radius: 50%;
  animation: market-publish-progress-spin .78s linear infinite;
}

.market-publish-progress-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.market-publish-progress-copy strong,
.market-publish-progress-copy span,
.market-publish-progress > b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-publish-progress-copy strong {
  font-size: 13px;
  line-height: 1.2;
}

.market-publish-progress-copy span {
  color: #6f7c76;
  font-size: 11px;
  line-height: 1.25;
}

.market-publish-progress > b {
  margin-left: auto;
  color: #247d5f;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

@keyframes market-publish-progress-spin {
  to { transform: rotate(360deg); }
}

/* Chat uploads stay visible while the original high-quality video is sent. */
.community-chat-upload-progress {
  position: fixed;
  top: calc(var(--fixed-topbar-height, 78px) + 10px);
  left: 50%;
  z-index: 9000;
  width: min(286px, calc(100vw - 32px));
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: #243c33;
  background: rgba(255, 255, 255, .98);
  border: 1px solid rgba(47, 167, 127, .28);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(22, 52, 41, .2);
  pointer-events: none;
  transform: translateX(-50%) translateZ(0);
}

.community-chat-upload-progress > i {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  border: 2px solid rgba(47, 167, 127, .22);
  border-top-color: #2fa77f;
  border-radius: 50%;
  animation: market-publish-progress-spin .78s linear infinite;
}

.community-chat-upload-progress > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.community-chat-upload-progress strong,
.community-chat-upload-progress small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-chat-upload-progress strong { font-size: 13px; line-height: 1.2; }
.community-chat-upload-progress small { color: #6f7c76; font-size: 11px; line-height: 1.25; }
.community-chat-upload-progress > b { margin-left: auto; color: #247d5f; font-size: 13px; font-variant-numeric: tabular-nums; }

body.dark .community-chat-upload-progress {
  color: #eaf5ef;
  background: rgba(28, 34, 31, .98);
  border-color: rgba(74, 201, 150, .34);
}

body.dark .community-chat-upload-progress small { color: #adbbb4; }

.market-search-wrap {
  height: 44px;
  margin: 0;
  padding: 0 4px 0 15px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(31, 42, 51, .07);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(31, 42, 51, .035);
}

.market-search-wrap input {
  min-width: 0;
  min-height: 0 !important;
  height: auto !important;
  padding: 0 !important;
  flex: 1;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  color: var(--text);
  background: transparent !important;
  box-shadow: none !important;
  /* iOS zooms a focused input below 16px and keeps that zoom after leaving it. */
  font-size: 16px;
  appearance: none;
  -webkit-appearance: none;
}

.market-search-wrap input::-webkit-search-cancel-button {
  display: none;
  -webkit-appearance: none;
}

.market-search-wrap button {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  color: #59666f;
  background: transparent;
}

.market-search-wrap button:active {
  color: #fff;
  background: var(--accent);
}

.market-search-wrap button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
}

.market-search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  max-height: min(272px, 42vh);
  padding: 5px;
  overflow-y: auto;
  border: 1px solid var(--divider);
  border-radius: 12px;
  background: var(--section-bg);
  box-shadow: 0 14px 30px rgba(20, 31, 38, .16);
  overscroll-behavior: contain;
}

.market-search-suggestions[hidden] {
  display: none;
}

.market-search-suggestions button {
  width: 100%;
  min-height: 45px;
  padding: 7px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.market-search-suggestions button:active,
.market-search-suggestions button:hover {
  color: var(--accent);
  background: rgba(47, 167, 127, .11);
}

.market-search-suggestions strong {
  overflow: hidden;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-search-suggestions small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.market-promise-strip {
  margin: 10px 0;
  padding: 10px 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-radius: 10px;
  color: #718078;
  background: #edf6f1;
  font-size: 10px;
  text-align: center;
}

.market-promise-strip b {
  display: block;
  margin-bottom: 2px;
  color: #237a5b;
  font-size: 12px;
}

.market-assist-wrap {
  position: relative;
  z-index: 12;
  margin: 0 0 8px;
  background: var(--section-bg);
  border: 1px solid rgba(31, 42, 51, .08);
  border-radius: 10px;
  overflow: visible;
}

.market-assist-bar {
  min-height: 40px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: stretch;
}

.market-assist-bar button {
  position: relative;
  min-width: 0;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  color: #53606a;
  background: transparent;
  font-size: 12px;
  font-weight: 550;
}

.market-assist-bar button.active {
  color: #22735b;
  font-weight: 700;
}

.market-assist-bar button.active::after {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  content: "";
  background: var(--accent);
  transform: translateX(-50%);
}

.market-assist-bar button i {
  display: inline-flex;
  align-items: center;
  height: 1em;
  line-height: 1;
  font-size: 11px;
  font-style: normal;
  transform: translateY(-2px);
}

.market-assist-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 9px;
  min-width: 150px;
  padding: 6px;
  display: grid;
  gap: 2px;
  border: 1px solid var(--divider);
  border-radius: 11px;
  background: var(--section-bg);
  box-shadow: 0 14px 30px rgba(20, 31, 38, .16);
}

.market-assist-panel > button,
.market-region-panel > div > button,
.market-filter-panel button {
  min-height: 35px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  color: var(--text);
  background: transparent;
  font-size: 13px;
  text-align: left;
}

.market-assist-panel > button.active,
.market-region-panel > div > button.active,
.market-filter-panel button.active {
  color: #22735b;
  background: rgba(47, 167, 127, .12);
  font-weight: 650;
}

.market-region-panel {
  right: 0;
  max-width: none;
  padding: 10px;
}

.market-region-panel > header {
  padding: 1px 4px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.market-region-panel > header strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-region-panel > header small {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 11px;
}

.market-region-panel > div {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.market-region-panel > div > button {
  min-width: 0;
  padding: 0 6px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-region-panel > div > p {
  grid-column: 1 / -1;
  margin: 5px 8px;
  color: var(--muted);
  font-size: 12px;
}

.market-filter-panel {
  min-width: min(270px, calc(100vw - 38px));
  padding: 10px;
}

.market-filter-panel > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.market-filter-panel > div > span {
  width: 100%;
  color: var(--muted);
  font-size: 12px;
}

.market-filter-panel > div button {
  min-height: 31px;
  padding: 0 10px;
  border: 1px solid var(--divider);
}

.market-filter-panel .market-filter-reset {
  margin-top: 5px;
  color: #e85a66;
  text-align: center;
}

.market-stage-tabs {
  margin: 0 0 12px;
  padding: 3px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid rgba(31, 42, 51, .08);
  border-radius: 10px;
  background: var(--section-bg);
}

.market-stage-tabs button {
  min-width: 0;
  width: 100%;
  height: 31px;
  padding: 0 4px;
  border-radius: 16px;
  color: #69737d;
  background: #fff;
  font-size: 12px;
}

.market-stage-tabs button.active {
  color: #fff;
  background: #245f70;
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 10px 8px;
}

.market-grid.is-initial-loading {
  grid-template-columns: minmax(0, 1fr);
}

.market-grid.is-initial-loading .market-empty {
  display: none;
}

.market-feed-initial-loading {
  min-height: 250px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.market-feed-initial-loading > i {
  width: 22px;
  height: 22px;
  border: 2px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: market-publish-progress-spin .78s linear infinite;
}

.market-card {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  display: block;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 0;
  color: var(--text);
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.market-card-photo {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 9px;
  background: #e9eeeb;
}

.market-card-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  image-rendering: auto;
}

.market-card-photo > i {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 4px 7px;
  border-radius: 4px;
  color: #fff;
  background: rgba(27, 34, 31, .72);
  font-size: 10px;
  font-style: normal;
}

.market-card-photo > i.negotiable {
  background: rgba(35, 122, 91, .88);
}

.market-card.is-sold .market-card-photo img,
.market-card.is-sold .market-card-photo video {
  filter: saturate(.35) brightness(.8);
}

.market-card-body {
  padding: 7px 4px 8px;
  display: block;
}

.market-card-body > strong {
  min-height: 0;
  overflow: hidden;
  display: -webkit-box;
  color: #1f2a33;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 650;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.market-card-body > small {
  margin-top: 3px;
  overflow: hidden;
  display: block;
  color: #66727c;
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-card-price {
  margin: 5px 0 4px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.market-card-price b {
  color: #ed4d5c;
  font-size: 18px;
  font-weight: 750;
}

.market-card-price b > i,
.market-detail-price strong > i {
  margin-right: 1px;
  font-size: .68em;
  font-style: normal;
  font-weight: 650;
  vertical-align: .08em;
}

.market-card-price small {
  overflow: hidden;
  color: #737d86;
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-card-delivery {
  min-width: 0;
  padding: 3px 5px;
  border-radius: 4px;
  color: #298464;
  background: #edf8f3;
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
}

.market-card-seller {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  color: #65717b;
  font-size: 11px;
  font-weight: 500;
}

.market-seller-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

.market-default-avatar {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  color: #fff;
  background: #246b7a;
  border: 1px solid rgba(255, 255, 255, .62);
  font-family: inherit;
  font-weight: 700;
}

.market-seller-avatar.market-default-avatar {
  font-size: 11px;
}

.market-card-seller i,
.market-card-seller em {
  overflow: hidden;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-card-seller i {
  min-width: 0;
  max-width: 62px;
}

.market-card-delivery {
  flex: 0 0 auto;
}

.market-card-seller em {
  max-width: 46px;
  margin-left: auto;
}

.market-empty {
  grid-column: 1 / -1;
  min-height: 310px;
  padding: 64px 24px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #7c878f;
  text-align: center;
}

.market-empty > span {
  width: 58px;
  height: 58px;
  margin-bottom: 15px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #2c8062;
  background: #e6f3ed;
  font-size: 24px;
}

.market-empty strong {
  color: #2c3740;
  font-size: 16px;
}

.market-empty p {
  max-width: 260px;
  margin: 8px 0 18px;
  font-size: 12px;
  line-height: 1.6;
}

.market-empty button,
.market-floating-add {
  color: #fff;
  background: #2fa77f;
}

.market-empty button {
  min-height: 38px;
  padding: 0 18px;
  border-radius: 20px;
  font-size: 13px;
}

.market-floating-add {
  position: fixed;
  right: max(18px, calc((100vw - 430px) / 2 + 18px));
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 18;
  height: 44px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 5px;
  border-radius: 22px;
  box-shadow: 0 9px 22px rgba(47, 167, 127, .28);
  font-size: 13px;
  font-weight: 700;
}

.market-floating-add span {
  font-size: 20px;
  font-weight: 300;
}

.market-publish-page {
  padding: 12px 12px 38px !important;
  background: #f5f5f2;
}

.market-publish-form {
  display: grid;
  gap: 10px;
}

.market-form-card,
.market-safe-note {
  padding: 14px;
  border: 1px solid rgba(31, 42, 51, .055);
  border-radius: 10px;
  background: #fff;
}

.market-form-heading {
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.market-form-heading b {
  color: #24323b;
  font-size: 15px;
}

.market-form-heading small {
  color: #8c969e;
  font-size: 10px;
}

.market-photo-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
}

.market-photo-card > button {
  width: 112px;
  height: 112px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px dashed #cdd8d2;
  border-radius: 8px;
  color: #7b8a82;
  background: #f6faf8;
}

.market-photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.market-photo-card button > span {
  font-size: 30px;
  font-weight: 300;
}

.market-photo-card button small {
  display: block;
  margin-top: 4px;
  font-size: 10px;
}

.market-photo-card > p {
  margin: 0;
  color: #87928b;
  font-size: 11px;
  line-height: 1.65;
}

.market-fields-card,
.market-fields-card label,
.market-field-group {
  display: grid;
  gap: 7px;
}

.market-fields-card {
  gap: 14px;
}

.market-fields-card label > span,
.market-field-group > span {
  color: #5f6a73;
  font-size: 12px;
}

.market-title-templates:empty {
  display: none;
}

.market-title-templates {
  display: grid;
  gap: 6px;
}

.market-title-templates > small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
}

.market-title-templates > span {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 1px;
  scrollbar-width: none;
}

.market-title-templates > span::-webkit-scrollbar {
  display: none;
}

.market-title-templates button {
  flex: none;
  max-width: 176px;
  min-height: 28px;
  padding: 0 9px;
  overflow: hidden;
  border: 1px solid rgba(47, 167, 127, .2);
  border-radius: 14px;
  color: #28775b;
  background: #edf8f3;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-title-templates button:active {
  color: #fff;
  background: #2fa77f;
  transform: scale(.97);
}

html[data-theme-color="dark"] .market-title-templates button {
  color: #a9c8bb;
  border-color: #34443e;
  background: #202925;
}

html[data-theme-color="dark"] .market-title-templates button:active {
  color: #e8f5ef;
  border-color: #2f9d78;
  background: #256b55;
}

.required-mark {
  margin-left: 3px;
  color: #fa5151;
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
  line-height: 1;
}

.market-species-picker {
  position: relative;
}

.market-species-search-row {
  height: 48px;
  padding: 0 8px 0 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--divider);
  border-radius: 8px;
  background: var(--raised-bg);
}

.market-species-search-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(47, 167, 127, .12);
}

.market-species-search-row svg {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  fill: none;
  stroke: #7a858d;
  stroke-width: 1.9;
  stroke-linecap: round;
}

.market-species-search-row input {
  min-width: 0;
  height: auto !important;
  padding: 0 !important;
  flex: 1;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  color: var(--text);
  background: transparent !important;
  box-shadow: none !important;
}

.market-species-search-row button {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 18px;
}

.market-species-options {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 100;
  max-height: min(320px, 45vh);
  padding: 6px;
  overflow-y: auto;
  border: 1px solid var(--divider);
  border-radius: 10px;
  background: var(--section-bg);
  box-shadow: 0 16px 38px rgba(20, 31, 38, .18);
  overscroll-behavior: contain;
}

.market-species-options[hidden] {
  display: none;
}

.market-species-options button {
  width: 100%;
  min-height: 46px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: 7px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.market-species-options button:hover,
.market-species-options button.active {
  color: var(--accent);
  background: rgba(47, 167, 127, .12);
}

.market-species-options strong {
  font-size: 14px;
  font-weight: 600;
}

.market-species-options small {
  color: var(--muted);
  font-size: 11px;
}

.market-species-options > p {
  margin: 0;
  padding: 14px 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.market-species-policy-hint {
  margin: 8px 2px 0;
  color: #dc5b61;
  font-size: 12px;
  line-height: 1.45;
}

html[data-theme-color="dark"] .market-species-search-row,
html[data-theme-color="dark"] .market-species-options {
  border-color: #343434 !important;
  background: #181818 !important;
}

html[data-theme-color="dark"] .market-species-search-row input {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

html[data-theme-color="dark"] .market-species-options button:hover,
html[data-theme-color="dark"] .market-species-options button.active {
  color: #bdebd9 !important;
  background: #17352a !important;
}

/* Archive cards: a small top-right trigger with an integrated action tray. */
.turtle-row {
  grid-template-columns: 68px minmax(0, 1fr) !important;
  padding: 12px !important;
}

.turtle-row > .turtle-row-content {
  padding-right: 30px !important;
}

.turtle-row .more-btn {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  width: 28px !important;
  min-width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 8px !important;
  display: grid !important;
  place-items: center !important;
  color: var(--muted) !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: -1px !important;
  z-index: 4 !important;
}

.turtle-row .more-btn > span {
  display: block;
  transform: translateY(-2px);
}

.turtle-row .more-btn:active,
.turtle-row.menu-open .more-btn,
html[data-theme-color="dark"] .turtle-row .more-btn:active,
html[data-theme-color="dark"] .turtle-row.menu-open .more-btn {
  color: var(--text) !important;
  background: var(--raised-bg) !important;
}

.turtle-row.menu-open {
  overflow: hidden !important;
  z-index: 2 !important;
}

.turtle-row .archive-turtle-menu,
.turtle-row.menu-open .archive-turtle-menu,
html[data-theme-color="dark"] .turtle-row .archive-turtle-menu,
html[data-theme-color="dark"] .turtle-row.menu-open .archive-turtle-menu {
  position: static !important;
  grid-column: 1 / -1 !important;
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  margin: 4px 0 0 !important;
  padding: 9px 0 0 !important;
  border: 0 !important;
  border-top: 1px solid var(--divider) !important;
  border-radius: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 3px !important;
  overflow: visible !important;
  color: var(--text) !important;
  background: transparent !important;
  box-shadow: none !important;
  animation: archive-actions-in .16s ease-out both;
}

.turtle-row .archive-turtle-menu button,
html[data-theme-color="dark"] .turtle-row .archive-turtle-menu button {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 42px !important;
  padding: 5px 2px !important;
  border: 0 !important;
  border-radius: 9px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  color: var(--text) !important;
  background: var(--raised-bg) !important;
  font-size: 11px !important;
  font-weight: 550 !important;
  line-height: 1 !important;
  text-align: center !important;
}

.turtle-row .archive-turtle-menu button:active {
  transform: scale(.96);
  background: rgba(47, 167, 127, .13) !important;
}

.archive-turtle-menu svg {
  width: 15px;
  height: 15px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.turtle-row .archive-turtle-menu .danger-link,
html[data-theme-color="dark"] .turtle-row .archive-turtle-menu .danger-link {
  color: #e05260 !important;
  background: rgba(224, 82, 96, .08) !important;
}

.turtle-row .archive-turtle-menu .pin-link.active,
html[data-theme-color="dark"] .turtle-row .archive-turtle-menu .pin-link.active {
  color: var(--accent) !important;
  background: rgba(47, 167, 127, .13) !important;
}

@keyframes archive-actions-in {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Archive detail uses the same compact in-card action treatment. */
.detail-summary-card {
  grid-template-columns: minmax(0, 1fr) !important;
}

.detail-summary-card > div:first-child {
  padding-right: 30px !important;
}

.detail-summary-card h2,
.detail-summary-card p {
  padding-right: 0 !important;
}

.detail-summary-card .detail-more {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  width: 28px !important;
  min-width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 8px !important;
  display: grid !important;
  place-items: center !important;
  color: var(--muted) !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  letter-spacing: -1px !important;
  z-index: 4 !important;
}

.detail-summary-card .detail-more > span {
  display: block;
  transform: translateY(-2px);
}

.detail-summary-card .detail-more:active,
.detail-summary-card.menu-open .detail-more,
html[data-theme-color="dark"] .detail-summary-card .detail-more:active,
html[data-theme-color="dark"] .detail-summary-card.menu-open .detail-more {
  color: var(--text) !important;
  background: var(--raised-bg) !important;
}

.detail-summary-card.menu-open {
  overflow: hidden !important;
}

.detail-summary-card .detail-actions-menu,
.detail-summary-card.menu-open .detail-actions-menu,
html[data-theme-color="dark"] .detail-summary-card .detail-actions-menu,
html[data-theme-color="dark"] .detail-summary-card.menu-open .detail-actions-menu {
  position: static !important;
  grid-column: 1 / -1 !important;
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  margin: 12px 0 0 !important;
  padding: 9px 0 0 !important;
  border: 0 !important;
  border-top: 1px solid var(--divider) !important;
  border-radius: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 3px !important;
  overflow: visible !important;
  color: var(--text) !important;
  background: transparent !important;
  box-shadow: none !important;
  animation: archive-actions-in .16s ease-out both;
  z-index: 2 !important;
}

.detail-summary-card .detail-actions-menu button,
html[data-theme-color="dark"] .detail-summary-card .detail-actions-menu button {
  width: 100% !important;
  min-width: 0 !important;
  min-height: 42px !important;
  padding: 5px 2px !important;
  border: 0 !important;
  border-radius: 9px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 3px !important;
  color: var(--text) !important;
  background: var(--raised-bg) !important;
  font-size: 11px !important;
  font-weight: 550 !important;
  line-height: 1 !important;
  text-align: center !important;
}

.detail-summary-card .detail-actions-menu button:active {
  transform: scale(.96);
  background: rgba(47, 167, 127, .13) !important;
}

.detail-actions-menu svg {
  width: 15px;
  height: 15px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.detail-summary-card .detail-actions-menu .danger-link,
html[data-theme-color="dark"] .detail-summary-card .detail-actions-menu .danger-link {
  color: #e05260 !important;
  background: rgba(224, 82, 96, .08) !important;
}

.detail-summary-card .detail-actions-menu .pin-link.active,
html[data-theme-color="dark"] .detail-summary-card .detail-actions-menu .pin-link.active {
  color: var(--accent) !important;
  background: rgba(47, 167, 127, .13) !important;
}

/* A restrained page-entry motion for cards, add flows, community and detail views. */
#app.page-enter-motion .content {
  transform-origin: 50% 38%;
  animation: page-gentle-expand .22s cubic-bezier(.22, .72, .24, 1) both;
  will-change: transform, opacity;
}

@keyframes page-gentle-expand {
  from {
    opacity: .42;
    transform: translateY(4px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  #app.page-enter-motion .content {
    animation: none !important;
  }
}

.market-form-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.market-city-field {
  display: grid;
  gap: 7px;
  align-content: start;
}

.market-city-label {
  min-height: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #5f6a73;
  font-size: 12px;
}

.market-city-label button {
  min-height: 22px;
  padding: 0 5px;
  border: 0;
  color: var(--accent);
  background: transparent;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.market-city-label button:disabled {
  color: var(--muted);
}

.market-city-field > small {
  min-height: 15px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

/* 发布出售：城市和交付方式共用严格等高的双列结构，避免定位提示拉乱选择框。 */
.market-city-delivery-row {
  align-items: start;
}

.market-city-delivery-row .market-city-field,
.market-city-delivery-row .market-delivery-field {
  min-width: 0;
  display: grid;
  grid-template-rows: 22px 48px 15px;
  gap: 7px;
  align-content: start;
}

.market-city-delivery-row .market-city-label,
.market-city-delivery-row .market-delivery-field > span {
  min-width: 0;
  min-height: 22px;
  display: flex;
  align-items: center;
}

.market-city-delivery-row .market-city-field > .field,
.market-city-delivery-row .market-delivery-field > .select {
  width: 100%;
  min-height: 48px !important;
  height: 48px !important;
  margin: 0;
  box-sizing: border-box;
}

.market-city-delivery-row .market-city-field > small,
.market-city-delivery-row .market-delivery-field > small {
  min-width: 0;
  min-height: 15px;
  margin: 0;
  font-size: 10px;
  line-height: 15px;
}

.market-city-delivery-row .market-delivery-field > small {
  visibility: hidden;
}

.market-price-input {
  height: 48px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--divider);
  border-radius: 8px;
  background: var(--raised-bg);
}

.market-price-input b {
  color: #ed4d5c;
  font-size: 19px;
}

.market-price-input input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 18px;
  font-weight: 700;
}

.market-check {
  grid-template-columns: 20px 1fr !important;
  align-items: center;
  gap: 7px !important;
}

.market-check input {
  width: 18px;
  height: 18px;
  accent-color: #2fa77f;
}

.market-fields-card textarea {
  min-height: 110px;
  padding: 12px;
  border: 1px solid var(--divider);
  border-radius: 8px;
  color: var(--text);
  background: var(--raised-bg);
  line-height: 1.6;
  resize: vertical;
}

.market-safe-note {
  color: #77837c;
  background: #f2f8f5;
}

.market-safe-note b {
  color: #2b7259;
  font-size: 13px;
}

.market-safe-note p {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.65;
}

.market-publish-submit {
  height: 48px;
  border-radius: 8px;
  color: #fff;
  background: #2fa77f;
  font-size: 16px;
  font-weight: 700;
}

.market-detail-page {
  padding: 0 0 calc(94px + env(safe-area-inset-bottom)) !important;
  background: #f5f5f2;
}

.market-detail-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / .88;
  overflow: hidden;
  background: #000;
}

.market-detail-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
  -webkit-transform: translateZ(0);
}

.market-detail-photo img[data-preview-market-image],
.market-detail-secondary-photo img[data-preview-market-image] {
  cursor: zoom-in;
}

.market-detail-photo img[data-preview-market-image]:focus-visible,
.market-detail-secondary-photo img[data-preview-market-image]:focus-visible {
  outline: 3px solid rgba(47, 167, 127, .72);
  outline-offset: -3px;
}

.market-detail-photo > span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(20, 24, 22, .36);
  font-size: 26px;
  font-weight: 700;
}

/* 首图为视频时，其余实拍媒体放在规格信息之后，避免与主视频混排。 */
.market-detail-secondary-media {
  margin: 10px 12px 0;
  display: grid;
  gap: 8px;
}

.market-detail-secondary-photo {
  overflow: hidden;
  border-radius: 10px;
  background: #111;
}

.market-detail-secondary-photo img,
.market-detail-secondary-photo video {
  width: 100%;
  min-height: 220px;
  max-height: 520px;
  display: block;
  object-fit: contain;
  background: #111;
}

.market-detail-main,
.market-detail-specs,
.market-detail-description,
.market-seller-card,
.market-detail-page > .market-safe-note {
  margin: 10px 12px 0;
  border-radius: 10px;
  background: #fff;
}

.market-detail-main {
  padding: 15px;
}

.market-detail-price {
  display: flex;
  align-items: center;
  gap: 9px;
}

.market-detail-price strong {
  color: #ed4d5c;
  font-size: 25px;
}

.market-detail-price span {
  padding: 3px 7px;
  border-radius: 4px;
  color: #278261;
  background: #eaf7f1;
  font-size: 10px;
}

.market-detail-main h2 {
  margin: 8px 0 5px;
  color: #1f2a33;
  font-size: 18px;
  line-height: 1.4;
}

.market-detail-main p {
  margin: 0;
  color: #7b858e;
  font-size: 12px;
}

.market-detail-specs {
  padding: 15px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 12px;
}

.market-detail-specs div {
  min-width: 0;
}

.market-detail-specs span,
.market-detail-specs strong {
  display: block;
}

.market-detail-specs span {
  color: #9099a0;
  font-size: 10px;
}

.market-detail-specs strong {
  margin-top: 4px;
  color: #2d3942;
  font-size: 13px;
}

.market-detail-description {
  padding: 15px;
}

.market-detail-description h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.market-detail-description p {
  margin: 0;
  color: #5f6b74;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.market-seller-card {
  padding: 13px 15px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.market-seller-avatar-slot {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  justify-self: center;
  align-self: center;
}

.market-detail-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 !important;
  line-height: 1;
  text-align: center;
}

.market-detail-avatar.market-default-avatar {
  display: grid;
  place-items: center;
  font-size: 24px;
}

.market-seller-card div {
  min-width: 0;
}

.market-seller-card strong,
.market-seller-card span {
  display: block;
}

.market-seller-card strong {
  color: #2b3740;
  font-size: 14px;
}

.market-seller-card span {
  margin-top: 3px;
  color: #8c969d;
  font-size: 10px;
}

.market-seller-profile-link {
  min-width: 0;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.market-seller-profile-link:active {
  opacity: .68;
}

.market-seller-avatar-slot.market-seller-profile-link {
  cursor: pointer;
}

.market-seller-name {
  display: block;
  cursor: pointer;
}

.market-seller-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.market-seller-actions button {
  height: 34px;
  padding: 0 13px;
  border: 1px solid #2fa77f;
  border-radius: 17px;
  color: #298563;
  background: transparent;
  font-size: 11px;
}

.seller-store-head {
  padding: 14px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
}

.seller-store-avatar {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  object-fit: cover;
}

.seller-store-head > div {
  min-width: 0;
}

.seller-store-head h2,
.seller-store-head p {
  margin: 0;
}

.seller-store-head h2 {
  overflow: hidden;
  color: var(--text);
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seller-store-head p {
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seller-store-head > button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--accent);
  border-radius: 18px;
  color: var(--accent);
  background: transparent;
  font-size: 12px;
}

.seller-store-head > button.active {
  color: #7b8580;
  border-color: #d9dfdc;
  background: #f1f3f2;
}

.seller-store-title {
  margin: 18px 0 12px;
}

.market-detail-page > .market-safe-note {
  padding: 13px 15px;
}

.market-detail-actions {
  position: fixed;
  left: max(0px, calc((100vw - 430px) / 2));
  right: max(0px, calc((100vw - 430px) / 2));
  /* 商品详情不显示导航栏，操作栏直接占用原导航栏位置。 */
  bottom: 0;
  z-index: 19;
  height: calc(74px + env(safe-area-inset-bottom));
  padding: 9px 12px calc(21px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: .8fr 1.35fr;
  gap: 9px;
  border-top: 1px solid var(--divider);
  background: var(--section-bg);
}

.market-detail-actions button {
  border-radius: 22px;
  font-size: 13px;
  font-weight: 700;
}

.market-delete-action {
  color: #2b8263;
  background: #eaf6f1;
}

.market-chat-action,
.market-want-action,
.market-sold-action {
  color: #fff;
  background: #2fa77f;
}

.market-sold-disabled {
  grid-column: 1 / -1;
  color: #8d9690;
  background: #e7ebe8;
}

body.market-sale-open {
  overflow: hidden;
}

.market-sale-overlay {
  position: fixed;
  inset: 0 max(0px, calc((100vw - 430px) / 2));
  z-index: 9000;
  display: grid;
  align-items: end;
  padding: 14px 12px max(14px, env(safe-area-inset-bottom));
  background: rgba(10, 14, 12, .56);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.market-sale-dialog {
  width: 100%;
  padding: 18px;
  border-radius: 18px;
  color: #1f2a33;
  background: #fff;
  box-shadow: 0 22px 58px rgba(0, 0, 0, .24);
}

.market-sale-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.market-sale-head small {
  display: block;
  margin-bottom: 3px;
  color: #78838b;
  font-size: 11px;
}

.market-sale-head h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
}

.market-sale-head > button {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  color: #69747c;
  background: #f1f4f2;
  font-size: 22px;
  line-height: 1;
}

.market-sale-product {
  margin: 11px 0 15px;
  overflow: hidden;
  color: #59656e;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-sale-dialog fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.market-sale-dialog legend,
.market-sale-price > span {
  display: block;
  margin-bottom: 9px;
  color: #35414a;
  font-size: 13px;
  font-weight: 700;
}

.market-sale-methods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.market-sale-methods label {
  position: relative;
  min-width: 0;
}

.market-sale-methods input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.market-sale-methods span {
  min-height: 48px;
  display: grid;
  place-items: center;
  padding: 5px;
  border: 1px solid #dce3df;
  border-radius: 9px;
  color: #68737b;
  background: #f8faf9;
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
}

.market-sale-methods input:checked + span {
  border-color: #2fa77f;
  color: #21775b;
  background: #eaf7f2;
  box-shadow: inset 0 0 0 1px #2fa77f;
}

.market-sale-methods input:focus-visible + span {
  outline: 2px solid rgba(47, 167, 127, .3);
  outline-offset: 2px;
}

.market-sale-price {
  display: block;
  margin-top: 16px;
}

.market-sale-price > div {
  height: 48px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 13px;
  border: 1px solid #dce3df;
  border-radius: 10px;
  background: #fff;
}

.market-sale-price b {
  color: #ed4d5c;
  font-size: 20px;
}

.market-sale-price input {
  min-width: 0;
  height: auto !important;
  padding: 0 !important;
  flex: 1;
  border: 0 !important;
  outline: 0 !important;
  color: #1f2a33;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 20px;
  font-weight: 700;
}

.market-sale-error {
  min-height: 18px;
  margin: 6px 0 2px;
  color: #df5262;
  font-size: 11px;
}

.market-sale-buttons {
  display: grid;
  grid-template-columns: .8fr 1.35fr;
  gap: 9px;
}

.market-sale-buttons button {
  min-height: 44px;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 700;
}

.market-sale-buttons button:first-child {
  color: #477060;
  background: #eaf4f0;
}

.market-sale-buttons button:last-child {
  color: #fff;
  background: #2fa77f;
}

html[data-theme-color="dark"] .market-sale-overlay {
  background: rgba(0, 0, 0, .72);
}

html[data-theme-color="dark"] .market-sale-dialog,
html[data-theme-color="dark"] .market-sale-price > div {
  color: #e7e7e7;
  border-color: #343434;
  background: #1b1b1b;
}

html[data-theme-color="dark"] .market-sale-head h2,
html[data-theme-color="dark"] .market-sale-dialog legend,
html[data-theme-color="dark"] .market-sale-price > span,
html[data-theme-color="dark"] .market-sale-price input {
  color: #e7e7e7 !important;
}

html[data-theme-color="dark"] .market-sale-methods span {
  border-color: #353535;
  color: #b6b6b6;
  background: #242424;
}

html[data-theme-color="dark"] .market-sale-methods input:checked + span {
  border-color: #45b98f;
  color: #bdebd9;
  background: #17352a;
}

/* 龟集市购买咨询：仅引导至平台客服，不在应用内承接支付。 */
body.market-service-open {
  overflow: hidden;
}

.market-service-overlay {
  position: fixed;
  inset: 0 max(0px, calc((100vw - 430px) / 2));
  z-index: 9000;
  display: grid;
  align-items: end;
  padding: 14px 12px max(14px, env(safe-area-inset-bottom));
  background: rgba(10, 14, 12, .56);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.market-service-dialog {
  width: 100%;
  padding: 18px;
  border-radius: 18px;
  color: #1f2a33;
  background: #fff;
  box-shadow: 0 22px 58px rgba(0, 0, 0, .24);
}

.market-top-service-overlay {
  align-items: end;
  padding: 0;
  background: rgba(10, 14, 12, .56);
}

.market-top-service-dialog {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 26px 18px max(20px, env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -14px 42px rgba(0, 0, 0, .22);
  animation: market-service-sheet-in .24s cubic-bezier(.22, .78, .26, 1) both;
}

.market-top-service-dialog::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 38px;
  height: 5px;
  border-radius: 999px;
  background: #d4d8d6;
  transform: translateX(-50%);
}

.market-top-service-dialog .market-service-head h2 {
  font-size: 17px;
}

.market-top-service-dialog .market-service-wechat {
  min-height: 48px;
  margin-top: 12px;
}

.market-top-service-dialog .market-service-tip {
  margin: 10px 2px 0;
  font-size: 13px;
  line-height: 1.55;
}

.market-top-service-note {
  margin: 9px 2px 0;
  color: #8a938e;
  font-size: 12px;
  line-height: 1.5;
}

.market-top-service-copy {
  width: 100%;
  min-height: 48px;
  margin-top: 14px;
  border-radius: 24px;
  color: #fff;
  background: #19805e;
  font-size: 15px;
  font-weight: 700;
}

@keyframes market-service-sheet-in {
  from { transform: translate3d(0, 100%, 0); }
  to { transform: translate3d(0, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .market-top-service-dialog { animation: none; }
}

.market-service-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.market-service-head small {
  display: block;
  margin-bottom: 3px;
  color: #78838b;
  font-size: 11px;
}

.market-service-head h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
}

.market-service-head > button {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  color: #69747c;
  background: #f1f4f2;
  font-size: 22px;
  line-height: 1;
}

.market-service-product {
  margin: 11px 0 13px;
  overflow: hidden;
  color: #59656e;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-service-wechat,
.market-service-code {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 10px 13px;
  border: 1px solid #dce8e2;
  border-radius: 11px;
  background: #f5fbf8;
}

.market-service-wechat span,
.market-service-code span {
  color: #718079;
  font-size: 12px;
}

.market-service-wechat strong {
  color: #187555;
  font-size: 19px;
  letter-spacing: .35px;
}

.market-service-code {
  min-height: 42px;
  margin-top: 8px;
  padding-block: 7px;
  border-color: #e4e8e6;
  background: #fafbfa;
}

.market-service-code b {
  color: #3b4c43;
  font-size: 13px;
  letter-spacing: .55px;
}

.market-service-tip {
  margin: 12px 2px 15px;
  color: #758078;
  font-size: 12px;
  line-height: 1.65;
}

.market-service-buttons {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 9px;
}

.market-service-buttons button {
  min-height: 45px;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 700;
}

.market-service-buttons button:first-child {
  color: #27775a;
  background: #e9f5ef;
}

.market-service-buttons button:last-child {
  color: #fff;
  background: #07c160;
  box-shadow: 0 5px 13px rgba(7, 193, 96, .18);
}

html[data-theme-color="dark"] .market-service-overlay {
  background: rgba(0, 0, 0, .72);
}

html[data-theme-color="dark"] .market-service-dialog {
  color: #e7e7e7;
  background: #1b1b1b;
}

html[data-theme-color="dark"] .market-service-head > button {
  color: #b7bdb9;
  background: #292929;
}

html[data-theme-color="dark"] .market-service-product,
html[data-theme-color="dark"] .market-service-tip,
html[data-theme-color="dark"] .market-service-wechat span,
html[data-theme-color="dark"] .market-service-code span {
  color: #a7b0ab;
}

html[data-theme-color="dark"] .market-service-wechat,
html[data-theme-color="dark"] .market-service-code {
  border-color: #315044;
  background: #15221d;
}

html[data-theme-color="dark"] .market-service-code {
  border-color: #343c38;
  background: #242724;
}

html[data-theme-color="dark"] .market-service-wechat strong {
  color: #7fe2b4;
}

html[data-theme-color="dark"] .market-service-code b {
  color: #d6ded9;
}

html[data-theme-color="dark"] .market-page,
html[data-theme-color="dark"] .market-publish-page,
html[data-theme-color="dark"] .market-detail-page {
  background: #101010 !important;
}

html[data-theme-color="dark"] .market-search-wrap,
html[data-theme-color="dark"] .market-search-suggestions,
html[data-theme-color="dark"] .market-assist-wrap,
html[data-theme-color="dark"] .market-assist-panel,
html[data-theme-color="dark"] .market-stage-tabs button,
html[data-theme-color="dark"] .market-card,
html[data-theme-color="dark"] .market-form-card,
html[data-theme-color="dark"] .market-detail-main,
html[data-theme-color="dark"] .market-detail-specs,
html[data-theme-color="dark"] .market-detail-description,
html[data-theme-color="dark"] .market-seller-card {
  background: #181818 !important;
  border-color: #292929 !important;
}

html[data-theme-color="dark"] .market-search-wrap input {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

html[data-theme-color="dark"] .market-search-wrap button {
  color: #d6d6d6 !important;
  background: transparent !important;
}

html[data-theme-color="dark"] .market-search-wrap button:active {
  color: #fff !important;
  background: var(--accent) !important;
}

html[data-theme-color="dark"] .market-stage-tabs button.active {
  color: #fff !important;
  background: #245f70 !important;
}

html[data-theme-color="dark"] .market-promise-strip,
html[data-theme-color="dark"] .market-safe-note {
  background: #15231d !important;
}

html[data-theme-color="dark"] .market-card-body > strong,
html[data-theme-color="dark"] .market-empty strong,
html[data-theme-color="dark"] .market-form-heading b,
html[data-theme-color="dark"] .market-detail-main h2,
html[data-theme-color="dark"] .market-detail-specs strong,
html[data-theme-color="dark"] .market-seller-card strong {
  color: #e7e7e7 !important;
}

@media (max-width: 360px) {
  .market-card-body {
    padding: 8px;
  }
  .market-form-two {
    grid-template-columns: 1fr;
  }
  .market-promise-strip {
    font-size: 9px;
  }
}

/* 消息入口：采用微信发现页式的单行入口。 */
.message-page {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.message-notification-section {
  margin: 0 0 10px;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
  background: var(--section-bg);
}
.message-notification-section > header,
.message-list-heading {
  min-height: 42px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--divider);
}
.message-notification-section > header strong,
.message-list-heading strong { color: var(--text); font-size: 14px; }
.message-notification-section > header small { color: var(--muted); font-size: 12px; }
.message-notification-row {
  position: relative;
  width: 100%;
  min-height: 72px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 48px minmax(0,1fr) 54px;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--divider);
  color: var(--text);
  background: transparent;
  text-align: left;
}
.message-notification-row:last-child { border-bottom: 0; }
.message-notification-row:active { background: var(--raised-bg); }
.message-notification-row.is-unread::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 15px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fa5151;
}
.message-notification-avatar { position: relative; width: 44px; height: 44px; }
.message-notification-avatar > .community-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.message-notification-type {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border: 2px solid var(--section-bg);
  border-radius: 50%;
  color: #fff;
  background: #ff3b30;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}
.message-notification-type.comment { background: #2f80ed; }
.message-notification-type.follow { background: var(--primary); }
.message-notification-copy { min-width: 0; display: grid; gap: 3px; }
.message-notification-copy strong { overflow: hidden; color: var(--text); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.message-notification-copy > span { overflow: hidden; color: var(--text); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.message-notification-copy time { margin-left: 5px; color: var(--muted); font-size: 11px; }
.message-notification-copy small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.message-notification-thumbnail { width: 48px; height: 48px; justify-self: end; border-radius: 6px; object-fit: cover; background: var(--raised-bg); }
.message-notification-target-icon { justify-self: end; color: var(--muted); font-size: 22px; }
.message-notification-empty { padding: 18px 16px; color: var(--muted); font-size: 13px; text-align: center; }
.message-list-heading { margin-top: 10px; background: var(--section-bg); }

.message-discover-list {
  margin: 12px 0 20px;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
  background: var(--section-bg);
}

.message-discover-row {
  width: 100%;
  min-height: 82px;
  padding: 12px 18px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px 18px;
  align-items: center;
  gap: 12px;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.message-community-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #2aa568;
}

.message-community-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}

.message-discover-row > strong {
  font-size: 17px;
  font-weight: 550;
}

.message-discover-preview,
.message-discover-preview img,
.message-video-thumb {
  width: 42px;
  height: 42px;
  border-radius: 6px;
}

.message-discover-preview img {
  display: block;
  object-fit: cover;
}

.message-video-thumb {
  display: grid;
  place-items: center;
  color: #fff;
  background: #34433d;
  font-size: 12px;
}

.message-discover-row > b,
.message-friend-row > b {
  color: var(--muted);
  font-size: 26px;
  font-weight: 300;
}

.message-page > .section-title {
  position: relative;
  min-height: 58px;
  padding: 0 16px;
  justify-content: center;
}

.message-page > .section-title::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 50%;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  transform: translateY(-50%);
  background: linear-gradient(180deg, var(--sea), var(--aqua));
}

.message-page > .section-title > span::before {
  display: none;
}

.message-page > .section-title > small {
  position: absolute;
  right: 16px;
}

.message-friend-list {
  background: var(--section-bg);
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
}

.message-friend-row {
  width: 100%;
  min-height: 68px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: transparent;
  border-bottom: 1px solid var(--divider);
  text-align: left;
  will-change: transform;
}

.message-friend-row:last-child {
  border-bottom: 0;
}

.message-friend-row > .message-friend-copy {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 4px;
}

.message-friend-row strong {
  color: var(--text);
  font-size: 15px;
}

.message-friend-row span {
  color: var(--muted);
  font-size: 12px;
}

.message-friend-row > div > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-friend-time {
  padding: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.message-friend-meta {
  min-width: max-content;
  margin-left: auto;
  display: inline-flex !important;
  align-items: center;
  align-self: stretch;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
}

.message-friend-meta > b {
  color: var(--muted);
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
}

/* Chat opens like a native conversation: the header settles first, followed
   by the message surface and composer. This is scoped to intentional chat
   entry only, so list refreshes never visibly jump. */
#app.community-chat-enter-motion .community-chat-topbar {
  animation: community-chat-header-in .22s cubic-bezier(.2,.72,.25,1) both;
}

#app.community-chat-enter-motion .community-chat-list {
  animation: community-chat-surface-in .28s cubic-bezier(.2,.72,.25,1) both;
}

#app.community-chat-enter-motion .community-chat-form {
  animation: community-chat-composer-in .26s cubic-bezier(.2,.72,.25,1) both;
}

@keyframes community-chat-header-in {
  from { opacity: .7; transform: translate3d(14px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes community-chat-surface-in {
  from { opacity: .45; transform: translate3d(24px, 0, 0); }
  to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes community-chat-composer-in {
  from { opacity: 0; transform: translate3d(-50%, 10px, 0); }
  to { opacity: 1; transform: translate3d(-50%, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  #app.community-chat-enter-motion .community-chat-topbar,
  #app.community-chat-enter-motion .community-chat-list,
  #app.community-chat-enter-motion .community-chat-form {
    animation: none;
  }
}

.message-empty {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--text);
}

.message-empty span {
  color: var(--muted);
  font-size: 12px;
}

/* 龟友圈：朋友圈式时间流。 */
.community-camera-button {
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--text);
  background: transparent;
}

.community-camera-button svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
}

.community-moments-page {
  padding-left: 14px !important;
  padding-right: 14px !important;
}

.community-moments-page .community-feed {
  gap: 0;
}

.community-moment {
  padding: 16px 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  border-bottom: 1px solid var(--divider);
}

.community-moment > .community-avatar {
  width: 46px;
  height: 46px;
  border-radius: 5px;
}

.community-moment-main {
  min-width: 0;
}

.community-moment-author {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.community-moment-author > strong {
  min-width: 0;
  overflow: hidden;
  color: #576b95;
  font-size: 15px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-moment-author > button {
  flex: none;
  padding: 3px 7px;
  border-radius: 4px;
  color: #576b95;
  background: transparent;
  font-size: 11px;
}

/* The author name is also a profile button. Keep it at the same readable
 * size as the post copy instead of inheriting the compact action-button size. */
.community-moment-author > .community-profile-name-button {
  flex: 1 1 auto;
  font-size: 15px;
}

.space-entry-button {
  width: 56px;
  height: 52px;
  padding: 3px 0 2px;
  display: grid;
  grid-template-rows: 32px auto;
  place-items: center;
  justify-self: end;
  gap: 1px;
  border-radius: 12px;
  background: transparent;
}

.space-entry-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--divider);
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  font-size: 13px;
  font-weight: 750;
  object-fit: cover;
}

.space-entry-label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.space-entry-button:active {
  opacity: .65;
}

.mine-row-hint {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 500;
}

.general-service-dialog {
  padding: 20px 18px max(18px, env(safe-area-inset-bottom));
}

.general-service-intro {
  margin: 14px 2px;
  color: #59656e;
  font-size: 15px;
  line-height: 1.6;
}

.general-service-actions {
  display: grid;
  grid-template-columns: .8fr 1.4fr;
  gap: 9px;
}

.general-service-actions button {
  min-height: 46px;
  border-radius: 23px;
  color: #4e5b54;
  background: #eef2f0;
  font-size: 14px;
  font-weight: 700;
}

.general-service-actions button:last-child {
  color: #fff;
  background: #19805e;
}

html[data-theme-color="dark"] .general-service-intro {
  color: #b3bbb6;
}

html[data-theme-color="dark"] .market-top-service-note {
  color: #929a95;
}

/* 龟友圈论坛：紧凑的主题社区层级，保留 iOS 原生滚动与触控反馈。 */
.forum-circle-section {
  margin: 12px 0 2px;
  padding: 15px 0 14px;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
}

.forum-section-head {
  padding: 0 2px 11px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.forum-section-head strong { color: var(--text); font-size: 16px; }
.forum-section-head span { color: var(--muted); font-size: 12px; }

.forum-circle-strip,
.forum-compose-circle > div {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.forum-circle-strip::-webkit-scrollbar,
.forum-compose-circle > div::-webkit-scrollbar { display: none; }

.forum-circle-card {
  flex: 0 0 174px;
  min-height: 62px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  scroll-snap-align: start;
  border: 1px solid var(--divider);
  border-radius: 14px;
  color: var(--text);
  background: var(--card-bg);
  text-align: left;
}

.forum-circle-card > i,
.forum-selected-circle i,
.forum-detail-context > span {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--raised-bg));
  font-size: 14px;
  font-style: normal;
  font-weight: 800;
}

.forum-circle-card > span { min-width: 0; display: grid; gap: 3px; }
.forum-circle-card b { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.forum-circle-card small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.forum-circle-card.active { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, var(--card-bg)); }

.forum-selected-circle {
  margin: 10px 0 0;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 14px;
  background: var(--raised-bg);
}

.forum-selected-circle > div { min-width: 0; display: flex; align-items: center; gap: 10px; }
.forum-selected-circle span { min-width: 0; display: grid; gap: 2px; }
.forum-selected-circle strong { font-size: 15px; }
.forum-selected-circle small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.forum-selected-circle > button { min-height: 34px; padding: 0 13px; border-radius: 17px; color: #fff; background: var(--primary); font-size: 13px; font-weight: 700; }
.forum-selected-circle > button.active { color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, var(--card-bg)); }

.forum-sort-tabs { margin-top: 7px; }

.community-moments-page .community-feed {
  border-top: 1px solid var(--divider);
}

.forum-thread-card {
  min-height: 122px;
  padding: 15px 2px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  border-bottom: 1px solid var(--divider);
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

.forum-thread-card:active { opacity: .68; }
.forum-thread-main { min-width: 0; }
.forum-thread-badges { min-height: 20px; display: flex; align-items: center; gap: 6px; overflow: hidden; }
.forum-thread-badges b,
.forum-thread-badges span { flex: none; padding: 3px 7px; border-radius: 999px; color: var(--muted); background: var(--raised-bg); font-size: 11px; font-weight: 600; }
.forum-thread-badges b { color: #fff; background: var(--primary); }
.forum-thread-badges b.featured { color: #8c5b00; background: #fff0c7; }
.forum-thread-card h3 { margin: 7px 0 5px; color: var(--text); font-size: 17px; line-height: 1.38; }
.forum-thread-card p { margin: 0; overflow: hidden; color: var(--muted); font-size: 14px; line-height: 1.5; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.forum-thread-card footer { margin-top: 9px; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.forum-thread-card footer span:first-of-type { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.forum-thread-avatar { width: 20px; height: 20px; flex: 0 0 20px; display: grid; place-items: center; border-radius: 50%; object-fit: cover; font-size: 10px; }
.forum-thread-thumb { position: relative; width: 86px; height: 86px; align-self: center; overflow: hidden; border-radius: 12px; background: #111; }
.forum-thread-thumb img,
.forum-thread-thumb video { width: 100%; height: 100%; object-fit: cover; }
.forum-thread-thumb i { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 22px; font-style: normal; text-shadow: 0 2px 8px #000; }

.forum-compose-title,
.forum-compose-circle { display: block; margin-bottom: 18px; }
.forum-compose-title > span,
.forum-compose-circle > span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 14px; }
.forum-compose-title input { width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid var(--divider); border-radius: 13px; color: var(--text); background: var(--card-bg); font-size: 17px; font-weight: 650; outline: 0; }
.forum-compose-title input:focus { border-color: var(--primary); }
.forum-compose-circle button { flex: none; min-height: 36px; padding: 0 14px; scroll-snap-align: start; border-radius: 18px; color: var(--muted); background: var(--raised-bg); font-size: 14px; }
.forum-compose-circle button.active { color: #fff; background: var(--primary); }

.forum-detail-context { display: flex; align-items: center; gap: 10px; }
.forum-detail-context > div { display: grid; gap: 2px; }
.forum-detail-context b { color: var(--primary); font-size: 14px; }
.forum-detail-context small { color: var(--muted); font-size: 12px; }
.forum-detail-title { margin: 15px 0 16px; color: var(--text); font-size: 23px; line-height: 1.35; letter-spacing: -.01em; }
.forum-admin-actions { margin-top: 12px; padding-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--divider); }
.forum-admin-actions button { min-height: 36px; padding: 0 14px; border-radius: 18px; color: var(--muted); background: var(--raised-bg); font-size: 13px; }
.forum-admin-actions button.active { color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, var(--raised-bg)); }

.community-detail-page { padding-bottom: calc(82px + env(safe-area-inset-bottom)) !important; }
.forum-reply-section { margin-top: 12px; border-top: 8px solid var(--raised-bg); }
.forum-reply-heading { min-height: 52px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--divider); }
.forum-reply-heading strong { font-size: 16px; }
.forum-reply-heading span { color: var(--muted); font-size: 13px; }
.forum-floor { padding: 15px 14px; display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 10px; border-bottom: 1px solid var(--divider); cursor: pointer; transition: background-color 110ms ease, box-shadow 110ms ease, transform 110ms ease; -webkit-tap-highlight-color: transparent; }
.forum-floor:active { background: color-mix(in srgb, var(--primary) 7%, var(--card-bg)); }
.forum-reply-avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; object-fit: cover; }
.forum-floor header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.forum-floor header strong { color: var(--muted); font-size: 13px; font-weight: 500; }
.forum-floor header span { flex: none; color: var(--muted); font-size: 11px; }
.forum-floor small { display: block; margin-top: 4px; color: var(--primary); font-size: 12px; }
.forum-floor p { margin: 3px 0 2px; color: var(--text); font-size: 15px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.forum-floor button { min-height: 30px; padding: 0 8px; color: var(--muted); background: transparent; font-size: 12px; }
.forum-comment-thread { padding: 6px 0; border-bottom: 1px solid var(--divider); }
.forum-comment-thread > .forum-floor { padding-top: 10px; padding-bottom: 8px; }
.forum-comment-thread > .forum-floor { border-bottom: 0; }
.forum-floor-content { min-width: 0; }
.forum-comment-actions { min-height: 32px; display: flex; align-items: center; gap: 8px; }
.community-social-panel [data-delete-community-comment] { margin-left: 8px; padding: 0 4px; min-height: 30px; background: transparent; color: var(--muted); font-size: 12px; }
.forum-comment-actions > time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.forum-comment-actions > button { padding: 0; flex-shrink: 0; white-space: nowrap; }
.forum-comment-actions .forum-comment-like { min-width: 32px; margin-left: auto; display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: 14px; }
.forum-comment-actions .forum-comment-like svg { width: 17px; height: 17px; flex: 0 0 17px; }
.forum-comment-like b { min-width: 10px; font-size: 12px; font-weight: 500; }
.forum-comment-like.active,
.forum-comment-like.active span { color: #ef3f46 !important; }
.forum-nested-replies { margin: 0 14px 2px 62px; }
.forum-nested-replies .forum-floor { grid-template-columns: 30px minmax(0,1fr); padding: 10px 0; gap: 8px; border-bottom: 0; }
.forum-nested-replies .forum-floor:last-child { border-bottom: 0; }
.forum-nested-replies .forum-reply-avatar { width: 30px; height: 30px; }
.forum-expand-replies,
.forum-expand-comments { width: auto; min-height: 40px; padding: 0 14px; color: var(--muted); background: transparent; font-size: 13px; font-weight: 600; text-align: left; }
.forum-expand-replies { margin: 0 14px 5px 100px; padding: 0; }
.forum-expand-comments { width: 100%; min-height: 48px; text-align: center; border-bottom: 1px solid var(--divider); }
.forum-expand-replies span,
.forum-expand-comments span { margin-left: 3px; color: var(--primary); }
.forum-reply-composer { position: fixed; left: max(0px, calc((100vw - 430px) / 2)); right: max(0px, calc((100vw - 430px) / 2)); bottom: calc(58px + env(safe-area-inset-bottom)); z-index: 1000; min-height: 60px; margin: 0; padding: 8px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; border-top: 1px solid var(--divider); background: color-mix(in srgb, var(--topbar-bg) 94%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.forum-reply-composer input { min-width: 0; min-height: 42px; padding: 0 13px; border: 1px solid var(--divider); border-radius: 21px; color: var(--text); background: var(--raised-bg); font-size: 14px; }
.forum-reply-composer button { min-width: 58px; min-height: 42px; border-radius: 21px; color: #fff; background: var(--primary); font-size: 14px; font-weight: 700; }

html[data-theme-color="dark"] .forum-thread-badges b.featured { color: #ffd777; background: #4a3511; }

/* 龟友圈视觉精修：墨绿发布面板、紧凑圈子轨道与 iOS 浮层帖子。 */
.community-page.community-moments-page {
  --forum-ink: #123a2f;
  --forum-green: #158661;
  --forum-mint: #dff5ec;
  padding-left: 12px;
  padding-right: 12px;
  background:
    radial-gradient(circle at 92% 0, color-mix(in srgb, var(--primary) 7%, transparent), transparent 240px),
    var(--page-bg);
}

.community-page .community-create-hub {
  position: relative;
  overflow: hidden;
  margin: 12px 0 18px;
  padding: 20px 18px 14px;
  border: 0;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(135deg, #103e32 0%, #176a51 58%, #1a8b65 100%);
  box-shadow: 0 12px 28px rgba(13, 65, 49, .18);
}

.community-page .community-create-hub::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: -60px;
  top: -78px;
  border: 28px solid rgba(255,255,255,.07);
  border-radius: 50%;
  pointer-events: none;
}

.community-page .community-create-head { position: relative; z-index: 1; align-items: flex-start; }
.community-page .community-create-head > div { gap: 4px; }
.community-page .community-create-head > div > small {
  color: rgba(255,255,255,.64);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .16em;
}
.community-page .community-create-head strong { color: #fff; font-size: 19px; line-height: 1.35; letter-spacing: -.01em; }
.community-page .community-create-head > div > span { color: rgba(255,255,255,.72); font-size: 13px; }
.community-page .community-create-head > button {
  min-width: 64px;
  min-height: 64px;
  padding: 0;
  display: grid;
  place-content: center;
  gap: 1px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 20px;
  color: #123e31;
  background: rgba(255,255,255,.94);
  box-shadow: 0 8px 20px rgba(0,0,0,.14);
}
.community-page .community-create-head > button i { font-size: 22px; font-style: normal; font-weight: 450; line-height: 1; }
.community-page .community-create-head > button span { color: inherit; font-size: 12px; line-height: 1.2; }

.community-page .community-create-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 18px -8px -5px;
  padding-top: 13px;
  border-top: 1px solid rgba(255,255,255,.12);
  overflow: visible;
}
.community-page .community-create-strip > button {
  min-width: 0;
  min-height: 68px;
  padding: 5px 2px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: transparent;
  text-align: center;
}
.community-page .community-create-strip > button:active { opacity: 1; background: rgba(255,255,255,.1); transform: scale(.96); }
.community-page .community-create-strip i {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 11px;
  color: #fff;
  background: rgba(255,255,255,.12);
  font-size: 13px;
}
.community-page .community-create-strip span { gap: 1px; }
.community-page .community-create-strip b { color: #fff; font-size: 13px; }
.community-page .community-create-strip small { color: rgba(255,255,255,.55); font-size: 10px; }

.community-page .forum-circle-section {
  margin: 0;
  padding: 0 0 17px;
  border: 0;
}
.community-page .forum-section-head { padding: 0 3px 12px; align-items: flex-end; }
.community-page .forum-section-head > div { display: grid; gap: 1px; }
.community-page .forum-section-head small { color: var(--primary); font-size: 9px; font-weight: 850; letter-spacing: .16em; }
.community-page .forum-section-head strong { font-size: 19px; line-height: 1.25; letter-spacing: -.01em; }
.community-page .forum-section-head > span { font-size: 11px; }
.community-page .forum-circle-strip { gap: 10px; margin: 0 -12px; padding: 0 12px 4px; }
.community-page .forum-circle-card {
  position: relative;
  flex-basis: 152px;
  min-height: 72px;
  padding: 11px;
  gap: 9px;
  border: 0;
  border-radius: 18px;
  background: var(--card-bg);
  box-shadow: 0 3px 14px rgba(18,42,34,.07);
  transition: transform .18s ease, box-shadow .18s ease;
}
.community-page .forum-circle-card:active { transform: scale(.97); }
.community-page .forum-circle-card.active {
  color: #fff;
  background: linear-gradient(140deg, #183e34, #1b7659);
  box-shadow: 0 8px 18px rgba(19, 91, 68, .18);
}
.community-page .forum-circle-card > i {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border-radius: 13px;
  font-size: 13px;
}
.community-page .forum-circle-card.active > i { color: #fff; background: rgba(255,255,255,.14); }
.community-page .forum-circle-card b { font-size: 14px; }
.community-page .forum-circle-card small { max-width: 78px; font-size: 11px; }
.community-page .forum-circle-card.active small { color: rgba(255,255,255,.66); }
.community-page .forum-circle-card em {
  position: absolute;
  right: 8px;
  top: 7px;
  width: 6px;
  height: 6px;
  overflow: hidden;
  border-radius: 50%;
  color: transparent;
  background: #20c98b;
}

.community-page .forum-selected-circle {
  margin: 0 0 10px;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 15%, var(--divider));
  border-radius: 17px;
  background: color-mix(in srgb, var(--primary) 5%, var(--card-bg));
}

.community-page .community-topic-tabs {
  top: calc(58px + env(safe-area-inset-top));
  gap: 3px;
  margin: 0 -12px 10px;
  padding: 7px 12px;
  border-top: 1px solid color-mix(in srgb, var(--divider) 72%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--divider) 72%, transparent);
  background: color-mix(in srgb, var(--page-bg) 90%, transparent);
}
.community-page .community-topic-tabs button {
  min-height: 36px;
  padding: 0 15px;
  border-radius: 12px;
  background: transparent;
  font-size: 14px;
}
.community-page .community-topic-tabs button.active {
  color: var(--text);
  background: var(--card-bg);
  box-shadow: 0 2px 10px rgba(20,45,36,.08);
}

.community-moments-page .community-feed { display: grid; gap: 10px; border: 0; }
.community-page .forum-thread-card {
  min-height: 0;
  padding: 15px;
  gap: 13px;
  border: 1px solid color-mix(in srgb, var(--divider) 72%, transparent);
  border-radius: 18px;
  background: var(--card-bg);
  box-shadow: 0 4px 16px rgba(18,42,34,.055);
  transition: transform .18s ease, box-shadow .18s ease;
}
.community-page .forum-thread-card:active { opacity: 1; transform: none; box-shadow: 0 4px 16px rgba(18,42,34,.055); }
.community-page .forum-thread-card.is-pinned { border-color: color-mix(in srgb, var(--primary) 25%, var(--divider)); }
.community-page .forum-thread-badges { min-height: 18px; gap: 5px; }
.community-page .forum-thread-badges b,
.community-page .forum-thread-badges span { padding: 2px 7px; font-size: 10px; letter-spacing: .01em; }
.community-page .forum-thread-badges span { color: color-mix(in srgb, var(--primary) 82%, var(--text)); background: color-mix(in srgb, var(--primary) 8%, var(--raised-bg)); }
.community-page .forum-thread-card h3 { margin: 8px 0 6px; font-size: 17px; font-weight: 760; line-height: 1.42; letter-spacing: -.01em; }
.community-page .forum-thread-card p { color: color-mix(in srgb, var(--muted) 90%, var(--text)); font-size: 13px; line-height: 1.55; }
.community-page .forum-thread-card footer { margin-top: 12px; gap: 8px; font-size: 11px; }
.community-page .forum-thread-avatar { width: 22px; height: 22px; flex-basis: 22px; box-shadow: 0 0 0 2px var(--raised-bg); }
.community-page .forum-thread-thumb { width: 92px; height: 92px; border-radius: 15px; background: var(--raised-bg); }
.community-page .forum-thread-thumb::after { content: ""; position: absolute; inset: 0; border: 1px solid rgba(0,0,0,.05); border-radius: inherit; pointer-events: none; }
.community-page .community-feed-status { padding: 20px 0 12px; color: var(--muted); font-size: 11px; }

html[data-theme-color="dark"] .community-page.community-moments-page {
  --forum-ink: #e9fff7;
  --forum-mint: #18372e;
  background: radial-gradient(circle at 92% 0, rgba(22,134,97,.12), transparent 240px), var(--page-bg);
}
html[data-theme-color="dark"] .community-page .community-create-hub {
  background: linear-gradient(135deg, #102c25, #14523f 58%, #176b50);
  box-shadow: 0 12px 28px rgba(0,0,0,.25);
}
html[data-theme-color="dark"] .community-page .forum-circle-card,
html[data-theme-color="dark"] .community-page .forum-thread-card { box-shadow: 0 4px 16px rgba(0,0,0,.18); }

@media (max-width: 360px) {
  .community-page .community-create-head strong { font-size: 17px; }
  .community-page .community-create-head > div > span { max-width: 225px; font-size: 12px; }
  .community-page .community-create-head > button { min-width: 58px; min-height: 58px; border-radius: 18px; }
  .community-page .community-create-strip small { display: none; }
  .community-page .community-create-strip > button { min-height: 56px; }
  .community-page .forum-thread-thumb { width: 78px; height: 78px; }
}

.community-moment-author > .community-profile-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: #576b95;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-moment .community-post-copy {
  margin: 5px 0 8px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}

.community-moment .community-post-media {
  width: min(100%, 280px);
  max-height: 390px;
  border-radius: 3px;
  background: #111;
}

.community-moment .community-post-media img,
.community-moment .community-post-media video {
  max-height: 390px;
}

.community-post-location {
  display: block;
  margin-top: 7px;
  color: #576b95;
  font-size: 11px;
}

.community-moment-meta {
  position: relative;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.community-moment-meta > span {
  color: var(--muted);
  font-size: 11px;
}

.community-post-delete {
  margin-left: 10px;
  padding: 2px 0;
  color: #576b95;
  background: transparent;
  font-size: 11px;
}

.community-moment-action-wrap {
  position: relative;
}

.community-moment-action-wrap > button {
  width: 38px;
  height: 24px;
  border-radius: 4px;
  color: #576b95;
  background: var(--raised-bg);
  font-weight: 700;
  letter-spacing: 2px;
}

.community-moment-popover {
  position: absolute;
  right: 43px;
  top: -5px;
  z-index: 12;
  min-width: 136px;
  height: 34px;
  padding: 0 5px;
  border-radius: 5px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #4c5154;
  box-shadow: 0 5px 14px rgba(0, 0, 0, .18);
}

.community-moment-popover button {
  color: #fff;
  background: transparent;
  border-right: 1px solid rgba(255, 255, 255, .13);
  font-size: 12px;
}

.community-moment-popover button:last-child {
  border-right: 0;
}

.community-social-panel {
  position: relative;
  margin-top: 2px;
  padding: 6px 8px;
  border-radius: 3px;
  background: var(--raised-bg);
}

.community-social-panel::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 12px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid var(--raised-bg);
}

.community-social-panel p {
  margin: 2px 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.community-social-panel strong,
.community-like-line {
  color: #576b95 !important;
}

.community-moment .community-comment-form {
  margin-top: 8px;
}

/* 朋友圈式发布页面。 */
.community-compose-nav {
  min-height: calc(58px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--divider);
}

.community-compose-nav > button:first-child {
  color: var(--text);
  background: transparent;
  font-size: 16px;
}

.community-compose-submit {
  min-height: 36px;
  padding: 0 16px;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 5px;
  color: #fff;
  background: #95debd;
  font-size: 15px;
  font-weight: 600;
}

.community-compose-submit.is-ready {
  background: #07c160;
}

.community-compose-page {
  min-height: calc(100vh - 58px);
  padding: 24px 18px 44px;
  background: var(--page-bg);
}

.community-compose-page .community-publish-form {
  padding: 0;
  background: transparent;
}

.community-compose-page .community-publish-form textarea {
  min-height: 120px;
  padding: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.6;
}

.community-compose-page .community-media-preview {
  position: relative;
  width: 168px;
  min-height: 168px;
  padding: 0;
  border: 0;
  border-radius: 3px;
  overflow: hidden;
  background: var(--raised-bg);
}

.community-compose-page .community-media-preview > span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 40px;
}

.community-compose-page .community-media-preview small {
  font-size: 11px;
}

.community-compose-page .community-media-preview img,
.community-compose-page .community-media-preview video {
  width: 100%;
  height: 168px;
  object-fit: cover;
}

.community-compose-page .community-media-preview i {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 28px;
  font-style: normal;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}

.community-compose-options {
  margin-top: 70px;
  border-top: 1px solid var(--divider);
}

.community-compose-options label {
  min-height: 58px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--divider);
  color: var(--text);
}

.community-compose-options label > span {
  color: var(--muted);
  font-size: 23px;
}

.community-compose-options input,
.community-compose-options select {
  min-width: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  font-size: 16px;
}

.community-compose-options b {
  font-size: 16px;
  font-weight: 500;
}

.community-compose-options select {
  text-align: right;
}

html[data-theme-color="dark"] .message-discover-list,
html[data-theme-color="dark"] .message-friend-list,
html[data-theme-color="dark"] .community-compose-nav {
  background: #181818 !important;
  border-color: #292929 !important;
}

html[data-theme-color="dark"] .community-social-panel,
html[data-theme-color="dark"] .community-moment-action-wrap > button {
  background: #202020 !important;
}

html[data-theme-color="dark"] .community-social-panel::before {
  border-bottom-color: #202020 !important;
}

/* 龟友圈发布与讨论：沿用 iOS 的横向原生滚动、轻触反馈和页面转场。 */
.community-create-hub {
  margin: 12px 0 4px;
  padding: 16px 14px 13px;
  border: 1px solid var(--divider);
  border-radius: 16px;
  background: var(--card-bg);
}

.community-create-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.community-create-head > div {
  display: grid;
  gap: 3px;
}

.community-create-head strong {
  color: var(--text);
  font-size: 16px;
}

.community-create-head span {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.community-create-head > button {
  flex: none;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 17px;
  color: #fff;
  background: var(--primary);
  font-size: 14px;
  font-weight: 700;
}

.community-create-strip,
.community-topic-tabs,
.community-compose-modes,
.community-turtle-picker {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.community-create-strip::-webkit-scrollbar,
.community-topic-tabs::-webkit-scrollbar,
.community-compose-modes::-webkit-scrollbar,
.community-turtle-picker::-webkit-scrollbar { display: none; }

.community-create-strip {
  display: flex;
  gap: 9px;
  margin-top: 14px;
}

.community-create-strip > button {
  flex: 0 0 154px;
  min-height: 62px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  scroll-snap-align: start;
  border: 1px solid var(--divider);
  border-radius: 13px;
  color: var(--text);
  background: var(--raised-bg);
  text-align: left;
}

.community-create-strip i {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 13%, transparent);
  font-size: 18px;
  font-style: normal;
  font-weight: 800;
}

.community-create-strip span { display: grid; gap: 2px; }
.community-create-strip b { font-size: 14px; }
.community-create-strip small { color: var(--muted); font-size: 12px; white-space: nowrap; }

.community-topic-tabs {
  position: sticky;
  top: calc(58px + env(safe-area-inset-top));
  z-index: 5;
  display: flex;
  gap: 7px;
  margin: 10px -14px 0;
  padding: 8px 14px;
  background: color-mix(in srgb, var(--page-bg) 93%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.community-topic-tabs button,
.community-compose-modes button {
  flex: none;
  min-height: 34px;
  padding: 0 14px;
  scroll-snap-align: start;
  border-radius: 17px;
  color: var(--muted);
  background: var(--raised-bg);
  font-size: 14px;
  font-weight: 650;
}

.community-topic-tabs button.active,
.community-compose-modes button.active {
  color: #fff;
  background: var(--primary);
}

.community-post-context {
  margin: 6px 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.community-post-context b {
  color: var(--primary);
  font-size: 13px;
}

.community-post-context span {
  padding-left: 7px;
  border-left: 1px solid var(--divider);
}

.community-discussion-hook {
  width: 100%;
  margin-top: 9px;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border-radius: 11px;
  color: var(--text);
  background: color-mix(in srgb, var(--primary) 9%, var(--raised-bg));
  text-align: left;
}

.community-discussion-hook span,
.community-discussion-hook i { color: var(--primary); font-size: 12px; font-style: normal; }
.community-discussion-hook strong { overflow: hidden; font-size: 14px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }

.community-compose-modes {
  display: flex;
  gap: 8px;
  margin: -5px 0 20px;
}

.community-compose-copy { display: block; }
.community-compose-copy > span,
.community-question-field > span,
.community-growth-source > span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

.community-question-field {
  margin: 8px 0 18px;
  padding: 13px 14px;
  display: block;
  border-radius: 12px;
  background: var(--raised-bg);
}

.community-question-field input {
  width: 100%;
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  font-size: 16px;
  outline: 0;
}

.community-growth-source { margin-bottom: 18px; }
.community-turtle-picker { display: flex; gap: 9px; }
.community-turtle-picker button {
  flex: 0 0 156px;
  min-height: 56px;
  padding: 7px;
  display: flex;
  align-items: center;
  gap: 9px;
  scroll-snap-align: start;
  border: 1px solid var(--divider);
  border-radius: 12px;
  color: var(--text);
  background: var(--raised-bg);
  text-align: left;
}
.community-turtle-picker button.active { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.community-turtle-picker img { width: 42px; height: 42px; border-radius: 9px; object-fit: cover; }
.community-turtle-picker button span { min-width: 0; display: grid; gap: 2px; }
.community-turtle-picker b,
.community-turtle-picker small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.community-turtle-picker b { font-size: 14px; }
.community-turtle-picker small { color: var(--muted); font-size: 12px; }
.community-create-archive { min-height: 44px; padding: 0 14px; border-radius: 11px; color: var(--primary); background: var(--raised-bg); font-size: 14px; }

.community-create-strip button:active,
.community-topic-tabs button:active,
.community-discussion-hook:active,
.community-turtle-picker button:active { opacity: .7; }

/* 龟友圈入口精修：严格贴近微信发现页的 60px 单行比例。 */
.message-discover-list {
  margin: 10px 0 20px !important;
  border-top: 1px solid var(--divider) !important;
  border-bottom: 1px solid var(--divider) !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.message-discover-row {
  min-height: 60px !important;
  height: 60px !important;
  padding: 0 14px !important;
  grid-template-columns: 24px minmax(0, 1fr) 36px 14px !important;
  gap: 12px !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.message-community-icon {
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  color: #fff !important;
  background: conic-gradient(#47a657, #d8ae32, #de5a54, #7860be, #398dcb, #47a657) !important;
  box-shadow: none !important;
}

.message-community-icon svg {
  width: 18px !important;
  height: 18px !important;
  stroke-width: 1.45 !important;
}

.message-discover-row > strong {
  color: var(--text) !important;
  font-size: 15px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
}

.message-discover-preview {
  position: relative;
  width: 36px !important;
  height: 36px !important;
  border-radius: 4px !important;
}

.message-discover-preview img,
.message-video-thumb {
  width: 36px !important;
  height: 36px !important;
  border-radius: 4px !important;
}

.message-discover-preview:not(:empty)::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  width: 8px;
  height: 8px;
  border: 1px solid var(--section-bg);
  border-radius: 50%;
  background: #fa5151;
}

.message-discover-row > b {
  color: #8a8a8a !important;
  font-size: 23px !important;
  font-weight: 300 !important;
  line-height: 1 !important;
  text-align: right;
}

html[data-theme-color="dark"] .message-discover-list {
  background: #181818 !important;
  border-color: #272727 !important;
}

html[data-theme-color="dark"] .message-discover-row > strong {
  color: #d2d2d2 !important;
}

html[data-theme-color="dark"] .message-discover-preview:not(:empty)::after {
  border-color: #181818 !important;
}

.membership-hero,
.plan-free-card,
.pro-plan-card,
.feature-card,
.chart-card,
.export-card {
  display: grid;
  gap: 14px;
}

.plan-free-card h3,
.pro-plan-card h3,
.plan-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1.2;
  font-weight: 800;
}

.plan-free-card p,
.pro-plan-card p,
.membership-hero p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.usage-line,
.membership-usage {
  display: grid;
  gap: 8px;
}

.usage-line span,
.membership-usage span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.usage-line b,
.membership-usage b {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 42, 51, .08);
}

.usage-line i,
.membership-usage i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.mine-row em {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.secondary.compact {
  width: fit-content;
  min-height: 40px;
  padding: 0 18px;
}

.plan-free-card,
.pro-plan-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.plan-free-card > strong {
  color: var(--accent);
  font-size: 28px;
  font-weight: 900;
}

.plan-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.plan-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 14px;
  row-gap: 12px;
  min-width: 0;
  padding: 18px;
}

.plan-card > button {
  grid-column: 1 / -1;
}

.plan-card h3,
.pro-plan-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  line-height: 1.25;
  font-weight: 900;
}

.plan-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  font-weight: 700;
}

.plan-headline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.plan-card.highlight,
.pro-plan-card {
  border-color: rgba(47, 167, 127, .32);
  box-shadow: 0 18px 42px rgba(47, 167, 127, .12);
}

.plan-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(47, 167, 127, .12);
  font-size: 12px;
  font-weight: 800;
}

.plan-price {
  margin: 0;
  color: var(--text);
  text-align: right;
  white-space: nowrap;
}

.plan-price strong {
  font-size: 30px;
  font-weight: 900;
}

.plan-price span {
  margin-left: 2px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.feature-list span {
  min-height: 38px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  background: rgba(47, 167, 127, .08);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.feature-list.pro span {
  background: rgba(36, 67, 90, .08);
}

.feature-list.refined {
  grid-template-columns: 1fr;
}

.feature-list.refined > article {
  min-height: 76px;
  padding: 14px 14px 13px;
  border: 1px solid rgba(31, 42, 51, .07);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(47, 167, 127, .08), rgba(255, 255, 255, .62));
}

.feature-list.refined.pro > article {
  background: linear-gradient(135deg, rgba(36, 67, 90, .08), rgba(47, 167, 127, .06));
}

.feature-list.refined strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  line-height: 1.25;
  font-weight: 900;
}

.feature-list.refined span {
  display: block;
  min-height: 0;
  margin-top: 7px;
  padding: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 700;
}

.iap-note {
  margin: 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.space-profile-card {
  grid-template-columns: 66px minmax(0, 1fr) !important;
  gap: 13px !important;
  align-items: center !important;
  padding: 18px 16px 16px !important;
}

.space-profile-card .space-profile-avatar-button {
  width: 58px;
  height: 58px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  justify-self: center;
  background: transparent;
  box-shadow: none;
}

.space-profile-card .avatar,
.space-profile-card .avatar-img {
  width: 58px !important;
  height: 58px !important;
  border-width: 2px !important;
  font-size: 34px !important;
  justify-self: center !important;
  align-self: center !important;
}

.space-profile-main {
  min-width: 0;
}

.space-profile-card .space-profile-name-button {
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  display: block;
  background: transparent;
  box-shadow: none;
  text-align: left;
}

.space-profile-card .space-profile-avatar-button:focus-visible,
.space-profile-card .space-profile-name-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, .92);
  outline-offset: 3px;
}

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

.space-name-line h2 {
  margin: 0;
  max-width: 168px;
  overflow: hidden;
  color: #fff;
  font-size: 24px;
  line-height: 1.18;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-plan-badge {
  display: inline-flex;
  align-items: center;
  height: 19px;
  padding: 0 7px;
  border-radius: 999px;
  color: #0c8f72;
  background: rgba(238, 255, 249, .92);
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
}

.profile-plan-badge.free {
  color: #5f6f7a;
  background: rgba(255, 255, 255, .72);
}

.profile-plan-badge.pro {
  color: #8a5600;
  background: rgba(255, 230, 170, .94);
}

.space-profile-card .profile-phone {
  margin: 4px 0 10px !important;
  color: rgba(255, 255, 255, .86) !important;
  font-size: 13px !important;
  font-weight: 750 !important;
}

.space-profile-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.space-profile-pills span {
  min-height: 28px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, .48);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  box-shadow: none;
}

.membership-ribbon {
  width: 100%;
  min-height: 62px;
  margin-bottom: 14px;
  padding: 13px 16px;
  border: 0;
  border-radius: 9px;
  display: grid;
  justify-items: start;
  gap: 3px;
  color: #7d5000;
  background: linear-gradient(135deg, #ffe7ad, #f5bd64);
  box-shadow: 0 12px 28px rgba(197, 126, 30, .16);
  text-align: left;
}

.membership-ribbon strong {
  color: #8c5200;
  font-size: 18px;
  font-weight: 950;
}

.membership-ribbon span {
  color: rgba(96, 62, 12, .72);
  font-size: 13px;
  font-weight: 800;
}

.membership-page {
  padding-bottom: calc(var(--fixed-tabbar-height) + 22px);
}

.vip-hero-card {
  position: relative;
  overflow: hidden;
  min-height: 184px;
  padding: 24px 20px 20px;
  border-radius: 16px;
  display: grid;
  align-content: space-between;
  gap: 18px;
  color: #442700;
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, .62) 0 58px, transparent 59px),
    linear-gradient(135deg, #ffecc2 0%, #f1be67 48%, #d39132 100%);
  box-shadow: 0 22px 46px rgba(190, 126, 39, .18);
}

.vip-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.vip-hero-top span,
.vip-hero-top strong {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .45);
  color: #7e4d00;
  font-size: 13px;
  font-weight: 950;
}

.vip-hero-card h2 {
  margin: 0;
  max-width: 280px;
  color: #392300;
  font-size: 30px;
  line-height: 1.12;
  font-weight: 950;
}

.vip-hero-card p {
  margin: 0;
  max-width: 300px;
  color: rgba(68, 39, 0, .72);
  font-size: 14px;
  line-height: 1.65;
  font-weight: 800;
}

.vip-hero-usage {
  display: grid;
  gap: 8px;
}

.vip-hero-usage span {
  color: rgba(68, 39, 0, .76);
  font-size: 13px;
  font-weight: 900;
}

.vip-hero-usage b {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .46);
}

.vip-hero-usage i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #177c64;
}

.vip-scroll-section,
.vip-buy-section {
  display: grid;
  gap: 12px;
}

.vip-section-title {
  margin: 0;
}

.vip-section-title small {
  color: var(--muted);
  font-weight: 800;
}

.vip-card-scroll,
.vip-plan-scroll {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(272px, 84%);
  gap: 12px;
  margin: 0 -16px;
  padding: 0 16px 3px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.vip-card-scroll::-webkit-scrollbar,
.vip-plan-scroll::-webkit-scrollbar {
  display: none;
}

.vip-benefit-card,
.vip-price-card {
  scroll-snap-align: start;
}

.vip-benefit-card {
  min-height: 226px;
  padding: 20px;
  border-radius: 18px;
  display: grid;
  align-content: space-between;
  gap: 16px;
  box-shadow: 0 18px 36px rgba(31, 42, 51, .10);
}

.vip-benefit-card.gold {
  color: #4a2d00;
  background: linear-gradient(145deg, #fff4d6, #efbd68);
}

.vip-benefit-card.green {
  color: #073c31;
  background: linear-gradient(145deg, #e2fff4, #61cfae);
}

.vip-benefit-card.blue {
  color: #0f3448;
  background: linear-gradient(145deg, #e8f6ff, #74c3d6);
}

.vip-benefit-card.dark {
  color: #f3f0e8;
  background: linear-gradient(145deg, #24323a, #10211f);
}

.vip-benefit-card > span {
  width: fit-content;
  min-height: 27px;
  padding: 0 11px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, .42);
  font-size: 12px;
  font-weight: 950;
}

.vip-benefit-card h3 {
  margin: 0;
  font-size: 25px;
  line-height: 1.16;
  font-weight: 950;
}

.vip-benefit-card p {
  margin: 0;
  min-height: 68px;
  font-size: 14px;
  line-height: 1.62;
  font-weight: 820;
  opacity: .78;
}

.vip-card-points {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.vip-card-points em {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, .38);
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
}

.vip-scroll-hint {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.vip-scroll-hint span {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(31, 42, 51, .18);
}

.vip-scroll-hint span:first-child {
  width: 16px;
  background: var(--accent);
}

.vip-plan-scroll {
  grid-auto-columns: minmax(190px, 58%);
}

.vip-price-card {
  position: relative;
  min-height: 216px;
  padding: 18px;
  border: 1px solid rgba(31, 42, 51, .08);
  border-radius: 16px;
  display: grid;
  align-content: space-between;
  gap: 14px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 16px 34px rgba(31, 42, 51, .08);
}

.vip-price-card.recommend {
  border-color: rgba(47, 167, 127, .42);
  box-shadow: 0 20px 38px rgba(47, 167, 127, .13);
}

.vip-price-badge {
  width: fit-content;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  background: rgba(47, 167, 127, .12);
  font-size: 12px;
  font-weight: 950;
}

.vip-price-card h3,
.vip-pro-panel h3 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  line-height: 1.25;
  font-weight: 950;
}

.vip-price-card p,
.vip-pro-panel p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  font-weight: 760;
}

.vip-price {
  margin: 0 !important;
  color: var(--text) !important;
  white-space: nowrap;
}

.vip-price strong {
  font-size: 31px;
  line-height: 1;
  font-weight: 950;
}

.vip-price span {
  margin-left: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.vip-price-card .primary,
.vip-pro-panel .primary {
  min-height: 46px;
}

.vip-pro-panel {
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  border-color: rgba(47, 167, 127, .35);
  background:
    radial-gradient(circle at 92% 8%, rgba(47, 167, 127, .13) 0 56px, transparent 57px),
    rgba(255, 255, 255, .92);
}

.vip-compare-card {
  gap: 14px;
}

.vip-compare-grid {
  display: grid;
  gap: 10px;
}

.vip-compare-grid div {
  min-height: 62px;
  padding: 12px;
  border-radius: 10px;
  display: grid;
  gap: 5px;
  background: rgba(47, 167, 127, .07);
}

.vip-compare-grid strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 950;
}

.vip-compare-grid span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 760;
}

.member-benefit-page {
  gap: 0;
  padding-top: 0;
}

.member-benefit-page.tone-member {
  background: #fff6e8;
}

.member-benefit-page.tone-pro {
  background: #fbf2ff;
}

.member-tier-stage {
  position: relative;
  min-height: 346px;
  margin: -12px -16px 0;
  padding: 18px 0 38px;
  overflow: hidden;
  color: #f8faf9;
  background:
    radial-gradient(ellipse at 50% 58%, rgba(255, 255, 255, .18) 0 16%, rgba(255, 255, 255, .05) 17% 45%, transparent 46%),
    linear-gradient(155deg, #26323c 0%, #11181f 58%, #0d1116 100%);
  border-radius: 0 0 48% 48% / 0 0 13% 13%;
}

.member-tier-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .24;
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .24) 0 1px, transparent 1px 9px);
  pointer-events: none;
}

.member-tier-stage::after {
  content: "";
  position: absolute;
  left: -18%;
  right: -18%;
  bottom: -46px;
  height: 116px;
  border-radius: 50% 50% 0 0;
  background: rgba(255, 255, 255, .72);
  pointer-events: none;
}

.member-stage-copy {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 24px 16px;
}

.member-stage-copy span {
  font-size: 13px;
  font-weight: 850;
  color: rgba(255, 255, 255, .64);
}

.member-stage-copy strong {
  min-height: 28px;
  padding: 0 13px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, .88);
  background: rgba(255, 255, 255, .13);
  font-size: 13px;
  font-weight: 900;
}

.member-orbit {
  position: absolute;
  z-index: 1;
  left: 8%;
  right: 8%;
  top: 80px;
  height: 76px;
  border-top: 4px solid rgba(255, 255, 255, .24);
  border-radius: 50% 50% 0 0;
}

.member-orbit i {
  position: absolute;
  top: -10px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .26);
}

.member-orbit i:nth-child(1) { left: 12%; }
.member-orbit i:nth-child(2) {
  left: 50%;
  width: 30px;
  height: 30px;
  transform: translate(-50%, -6px);
  box-shadow: 0 0 0 11px rgba(255, 255, 255, .10);
}
.member-orbit i:nth-child(3) { right: 12%; }

.member-tier-scroll {
  position: relative;
  z-index: 2;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(286px, 76%);
  gap: 28px;
  margin-top: 58px;
  padding: 0 54px 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.member-tier-scroll::-webkit-scrollbar {
  display: none;
}

.member-tier-card {
  appearance: none;
  position: relative;
  min-height: 186px;
  padding: 43px 22px 20px;
  border: 0;
  border-radius: 13px;
  display: grid;
  gap: 9px;
  text-align: left;
  font: inherit;
  cursor: pointer;
  scroll-snap-align: center;
  box-shadow: 0 22px 42px rgba(0, 0, 0, .20);
  transform: scale(.94);
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.member-tier-card.active {
  transform: scale(1);
  box-shadow: 0 28px 56px rgba(0, 0, 0, .28);
}

.member-tier-card.free {
  color: #2c3a45;
  background:
    radial-gradient(circle at 90% 24%, rgba(255, 255, 255, .66) 0 48px, transparent 49px),
    linear-gradient(145deg, #f2f7fb 0%, #d7e4ec 52%, #bcc9d3 100%);
}

.member-tier-card.member {
  color: #654214;
  background:
    radial-gradient(circle at 88% 22%, rgba(255, 255, 255, .48) 0 52px, transparent 53px),
    linear-gradient(145deg, #fff0bd 0%, #efbe61 54%, #dc9832 100%);
}

.member-tier-card.pro {
  color: #efe7ff;
  background:
    radial-gradient(circle at 88% 22%, rgba(255, 255, 255, .16) 0 52px, transparent 53px),
    linear-gradient(145deg, #5a3d72 0%, #2b2037 56%, #15121d 100%);
}

.tier-chip {
  position: absolute;
  left: 50%;
  top: -14px;
  min-height: 29px;
  padding: 0 15px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: inherit;
  background: rgba(255, 255, 255, .78);
  transform: translateX(-50%);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .10);
  font-size: 13px;
  font-weight: 950;
}

.tier-medal {
  position: absolute;
  right: 22px;
  top: 20px;
  width: 66px;
  height: 86px;
  border-radius: 0 0 34px 34px;
  opacity: .9;
}

.tier-medal::before,
.tier-medal::after {
  content: "";
  position: absolute;
  top: 0;
  width: 20px;
  height: 38px;
  background: rgba(255, 255, 255, .72);
  transform: skewX(-20deg);
}

.tier-medal::before { left: 13px; }
.tier-medal::after { right: 13px; transform: skewX(20deg); }

.tier-medal i {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  transform: translateX(-50%);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .88) 0 15px, rgba(255, 255, 255, .25) 16px 25px, transparent 26px),
    rgba(255, 255, 255, .32);
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .42);
}

.member-tier-card h2 {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 180px;
  font-size: 31px;
  line-height: 1.12;
  font-weight: 950;
}

.member-tier-card p {
  position: relative;
  z-index: 1;
  margin: 12px 0 0;
  max-width: 175px;
  color: currentColor;
  opacity: .74;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 850;
}

.member-tier-card small {
  position: relative;
  z-index: 1;
  max-width: 190px;
  color: currentColor;
  opacity: .58;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 760;
}

.member-tier-card strong {
  position: relative;
  z-index: 1;
  width: fit-content;
  min-height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: currentColor;
  background: rgba(255, 255, 255, .35);
  font-size: 12px;
  font-weight: 950;
}

.member-rights-section {
  position: relative;
  z-index: 2;
  margin: 0 -16px;
  padding: 24px 16px 18px;
  background: rgba(255, 255, 255, .72);
}

.member-tier-stage.tone-member {
  background:
    radial-gradient(ellipse at 50% 58%, rgba(239, 190, 97, .30) 0 16%, rgba(239, 190, 97, .12) 17% 45%, transparent 46%),
    linear-gradient(155deg, #5a3c22 0%, #30241b 56%, #14100c 100%);
}

.member-tier-stage.tone-member::after {
  background: #fff6e8;
}

.member-tier-stage.tone-member .member-orbit {
  border-top-color: rgba(239, 190, 97, .62);
}

.member-tier-stage.tone-member .member-orbit i {
  background: rgba(239, 190, 97, .62);
}

.member-tier-stage.tone-pro {
  background:
    radial-gradient(ellipse at 50% 58%, rgba(205, 152, 255, .24) 0 16%, rgba(205, 152, 255, .10) 17% 45%, transparent 46%),
    linear-gradient(155deg, #3e2c58 0%, #251a32 56%, #130f19 100%);
}

.member-tier-stage.tone-pro::after {
  background: #fbf2ff;
}

.member-tier-stage.tone-pro .member-orbit {
  border-top-color: rgba(205, 152, 255, .55);
}

.member-tier-stage.tone-pro .member-orbit i {
  background: rgba(205, 152, 255, .55);
}

.member-rights-section.tone-member {
  background: linear-gradient(180deg, #fff6e8 0%, #fffaf1 68%, rgba(255, 255, 255, .86) 100%);
}

.member-rights-section.tone-pro {
  background: linear-gradient(180deg, #fbf2ff 0%, #fff8ff 68%, rgba(255, 255, 255, .86) 100%);
}

.member-rights-section > p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 780;
}

.member-rights-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.member-rights-title h3 {
  margin: 0;
  color: var(--text);
  font-size: 25px;
  font-weight: 950;
}

.member-rights-title span {
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  background: rgba(47, 167, 127, .10);
  font-size: 13px;
  font-weight: 900;
}

.member-right-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 12px;
  row-gap: 25px;
}

.member-right-item {
  min-width: 0;
  text-align: center;
}

.right-icon {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #8c96a3;
  background: #f3f5f7;
}

.right-icon span {
  font-size: 22px;
  line-height: 1;
  font-weight: 950;
}

.right-icon em {
  position: absolute;
  left: 50%;
  bottom: -8px;
  min-width: 48px;
  min-height: 21px;
  padding: 0 7px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6f7782;
  background: #dfe3e8;
  transform: translateX(-50%);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.member-right-item.member .right-icon,
.member-right-item.member .right-icon em {
  color: #0f8b74;
  background: #e9f8f3;
}

.member-right-item.pro .right-icon,
.member-right-item.pro .right-icon em {
  color: #8b63ca;
  background: #f2eafa;
}

.member-right-item h4 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.25;
  font-weight: 900;
}

.member-right-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.38;
  font-weight: 760;
}

.member-rights-section.tone-member > p,
.member-rights-section.tone-member .member-right-item p {
  color: rgba(122, 80, 24, .68);
}

.member-rights-section.tone-member .member-rights-title h3,
.member-rights-section.tone-member .member-right-item h4 {
  color: #7b4f18;
}

.member-rights-section.tone-member .member-rights-title span {
  color: #8a5a16;
  background: rgba(239, 190, 97, .24);
}

.member-right-item.member .right-icon {
  color: #b77a18;
  background: #fff0ca;
}

.member-right-item.member .right-icon em {
  color: #966119;
  background: #ffdc91;
}

.member-rights-section.tone-pro > p,
.member-rights-section.tone-pro .member-right-item p {
  color: rgba(103, 70, 141, .68);
}

.member-rights-section.tone-pro .member-rights-title h3,
.member-rights-section.tone-pro .member-right-item h4 {
  color: #5f3f86;
}

.member-rights-section.tone-pro .member-rights-title span {
  color: #6e48a6;
  background: rgba(185, 130, 238, .20);
}

.member-right-item.pro .right-icon {
  color: #8a5cc4;
  background: #f4e9ff;
}

.member-right-item.pro .right-icon em {
  color: #6e47a2;
  background: #e7d2fb;
}

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

.member-wide-card {
  min-height: auto;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 16px;
  row-gap: 14px;
}

.member-wide-card .vip-price {
  margin: 0;
  text-align: right;
  white-space: nowrap;
}

.member-wide-card .primary {
  grid-column: 1 / -1;
  width: 100%;
}

.membership-status-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.membership-status-card h3 {
  margin: 2px 0 3px;
  color: var(--text);
  font-size: 24px;
  font-weight: 950;
}

.membership-status-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.membership-status-card > span {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  background: rgba(47, 167, 127, .10);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.upgrade-benefit-list {
  display: grid;
  gap: 10px;
}

.upgrade-benefit-card {
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.upgrade-benefit-card > span {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: rgba(47, 167, 127, .10);
  font-size: 18px;
  font-weight: 950;
}

.upgrade-benefit-card h3 {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 17px;
  font-weight: 950;
}

.upgrade-benefit-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  font-weight: 700;
}

.reports-page {
  gap: 12px;
}

.report-intro {
  position: relative;
  min-height: 158px;
  align-items: flex-end;
  overflow: hidden;
}

.report-intro > div {
  max-width: 82%;
}

.report-intro h2 {
  max-width: 280px;
}

.report-intro::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -52px;
  width: 136px;
  height: 136px;
  border: 26px solid rgba(47, 167, 127, .08);
  border-radius: 50%;
  pointer-events: none;
}

.report-scope {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(31, 42, 51, .06);
  font-size: 11px;
  font-weight: 800;
}

.report-profit-card {
  position: relative;
  min-height: 154px;
  padding: 20px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(135deg, #183f4d 0%, #1d7267 100%);
  border: 0;
}

.report-profit-card.negative {
  background: linear-gradient(135deg, #40323a 0%, #7f3f4d 100%);
}

.report-profit-card::after {
  content: "";
  position: absolute;
  top: -58px;
  right: -46px;
  width: 156px;
  height: 156px;
  border: 28px solid rgba(255, 255, 255, .07);
  border-radius: 50%;
}

.report-profit-copy,
.report-profit-breakdown {
  position: relative;
  z-index: 1;
}

.report-profit-copy {
  display: grid;
  gap: 4px;
}

.report-profit-copy span,
.report-profit-copy small {
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
  font-weight: 700;
}

.report-profit-copy strong {
  color: #fff;
  font-size: 34px;
  line-height: 1.15;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.report-profit-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .15);
}

.report-profit-breakdown div {
  display: grid;
  gap: 2px;
}

.report-profit-breakdown span {
  color: rgba(255, 255, 255, .62);
  font-size: 11px;
  font-weight: 700;
}

.report-profit-breakdown b {
  color: #fff;
  font-size: 13px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.report-section {
  padding: 18px;
  gap: 16px;
}

.report-section-head,
.report-section-head > div,
.report-section-head > div > div {
  min-width: 0;
}

.report-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.report-section-head > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-section-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: rgba(47, 167, 127, .10);
  font-size: 14px;
  font-weight: 900;
}

.report-section-head h3,
.report-section-head p {
  margin: 0;
}

.report-section-head h3 {
  color: var(--text);
  font-size: 17px;
  font-weight: 900;
}

.report-section-head p,
.report-section-head > em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.report-section-head > em {
  white-space: nowrap;
}

.chart-row {
  display: grid;
  gap: 7px;
}

.chart-row > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chart-row span,
.chart-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

.chart-row em {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.chart-row b,
.report-rate-list b {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 42, 51, .08);
}

.chart-row i,
.report-rate-list i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.chart-row.purchase i {
  background: #4c82c6;
}

.chart-row.loss i {
  background: var(--rose);
}

.breeding-report {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.breeding-report div {
  min-height: 86px;
  display: grid;
  grid-template-columns: auto auto;
  justify-content: center;
  align-content: center;
  column-gap: 3px;
  border-radius: 8px;
  background: rgba(47, 167, 127, .08);
}

.breeding-report span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.breeding-report strong {
  color: var(--accent);
  font-size: 26px;
  line-height: 1.2;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.breeding-report small {
  align-self: end;
  padding-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.report-rate-list {
  display: grid;
  gap: 11px;
  padding-top: 2px;
}

.report-rate-list > div {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 9px;
}

.report-rate-list span,
.report-rate-list em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.report-rate-list em {
  text-align: right;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.export-card {
  display: grid;
}

.report-export-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.report-export-actions button {
  min-width: 0;
  min-height: 64px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 10px;
  text-align: left;
}

.report-export-actions button > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--accent);
  background: rgba(47, 167, 127, .10);
  font-size: 13px;
  font-weight: 900;
}

.report-export-actions button > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.report-export-actions strong,
.report-export-actions small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-export-actions strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
}

.report-export-actions small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.batch-area {
  width: 100%;
  min-height: 120px;
  margin: 12px 0;
  padding: 12px;
  line-height: 1.5;
  resize: vertical;
}

.professional-output {
  margin: 14px 0 0;
  padding: 14px;
  white-space: pre-wrap;
  border-radius: 8px;
  color: var(--text);
  background: rgba(31, 42, 51, .06);
  font-family: inherit;
  line-height: 1.55;
}

html[data-theme-color="dark"] .usage-line b,
html[data-theme-color="dark"] .membership-usage b,
html[data-theme-color="dark"] .chart-row b,
html[data-theme-color="dark"] .report-rate-list b {
  background: rgba(255, 255, 255, .10);
}

html[data-theme-color="dark"] .plan-card.highlight,
html[data-theme-color="dark"] .pro-plan-card {
  border-color: rgba(0, 199, 110, .28);
  box-shadow: none;
}

html[data-theme-color="dark"] .plan-badge,
html[data-theme-color="dark"] .feature-list span,
html[data-theme-color="dark"] .breeding-report div {
  background: rgba(0, 199, 110, .12);
}

html[data-theme-color="dark"] .report-scope,
html[data-theme-color="dark"] .report-section-mark,
html[data-theme-color="dark"] .report-export-actions button > span {
  background: rgba(255, 255, 255, .07);
}

html[data-theme-color="dark"] .report-profit-card {
  background: linear-gradient(135deg, #132f38 0%, #14564e 100%);
}

html[data-theme-color="dark"] .report-profit-card.negative {
  background: linear-gradient(135deg, #382b31 0%, #663440 100%);
}

html[data-theme-color="dark"] .feature-list.pro span,
html[data-theme-color="dark"] .professional-output {
  background: rgba(255, 255, 255, .06);
}

html[data-theme-color="dark"] .feature-list.refined > article {
  border-color: rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .04);
}

html[data-theme-color="dark"] .feature-list.refined.pro > article {
  background: rgba(255, 255, 255, .05);
}

html[data-theme-color="dark"] .feature-list.refined span {
  background: transparent;
}

/* Ledger filters and record actions share one stable control grid. */
.ledger-command-panel {
  display: grid;
  gap: 10px;
  padding: 10px;
  margin-bottom: 12px;
}

.ledger-command-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

/* Four accounting actions read best as two balanced rows; date filters stay three across. */
.ledger-command-grid[aria-label="新增账本记录"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ledger-command-button {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 6px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(118, 137, 149, .10);
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  transition: transform .12s ease, background-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.ledger-command-button.active {
  color: #fff;
  background: linear-gradient(135deg, var(--night), var(--sea));
  box-shadow: 0 8px 16px rgba(36, 107, 122, .16);
}

.ledger-command-button:active {
  transform: scale(.97);
}

html[data-theme-color="dark"] .ledger-command-button {
  color: rgba(231, 231, 231, .72);
  background: #202020;
  border: 1px solid #2b2b2b;
}

html[data-theme-color="dark"] .ledger-command-button.active {
  color: #fff;
  background: #07c160;
  border-color: #07c160;
  box-shadow: none;
}

html[data-theme-color="dark"] .membership-ribbon {
  color: #f0c16a;
  background: linear-gradient(135deg, #312514, #7c5520);
  box-shadow: none;
}

html[data-theme-color="dark"] .membership-ribbon strong {
  color: #ffd98b;
}

html[data-theme-color="dark"] .membership-ribbon span {
  color: rgba(255, 230, 180, .72);
}

html[data-theme-color="dark"] .vip-hero-card {
  color: #f4dca4;
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, .07) 0 58px, transparent 59px),
    linear-gradient(135deg, #2a2116 0%, #5b3f1a 52%, #191714 100%);
  box-shadow: none;
}

html[data-theme-color="dark"] .vip-hero-top span,
html[data-theme-color="dark"] .vip-hero-top strong {
  color: #f1d28c;
  background: rgba(255, 255, 255, .10);
}

html[data-theme-color="dark"] .vip-hero-card h2 {
  color: #f2f2f2;
}

html[data-theme-color="dark"] .vip-hero-card p,
html[data-theme-color="dark"] .vip-hero-usage span {
  color: rgba(231, 231, 231, .72);
}

html[data-theme-color="dark"] .vip-hero-usage b {
  background: rgba(255, 255, 255, .12);
}

html[data-theme-color="dark"] .vip-price-card,
html[data-theme-color="dark"] .vip-pro-panel {
  border-color: rgba(255, 255, 255, .08);
  background: #1b1b1b;
  box-shadow: none;
}

html[data-theme-color="dark"] .vip-price-card.recommend,
html[data-theme-color="dark"] .vip-pro-panel {
  border-color: rgba(0, 199, 110, .25);
}

html[data-theme-color="dark"] .vip-scroll-hint span {
  background: rgba(255, 255, 255, .22);
}

html[data-theme-color="dark"] .member-tier-stage {
  background:
    radial-gradient(ellipse at 50% 58%, rgba(255, 255, 255, .12) 0 16%, rgba(255, 255, 255, .04) 17% 45%, transparent 46%),
    linear-gradient(155deg, #232931 0%, #151515 58%, #0b0b0b 100%);
}

html[data-theme-color="dark"] .member-tier-stage::after {
  background: #121212;
}

html[data-theme-color="dark"] .member-rights-section > p,
html[data-theme-color="dark"] .member-right-item p {
  color: rgba(231, 231, 231, .62);
}

html[data-theme-color="dark"] .member-rights-title h3,
html[data-theme-color="dark"] .member-right-item h4 {
  color: #e7e7e7;
}

html[data-theme-color="dark"] .member-rights-title span {
  color: #00c76e;
  background: rgba(0, 199, 110, .14);
}

html[data-theme-color="dark"] .right-icon {
  color: rgba(231, 231, 231, .58);
  background: #222;
}

html[data-theme-color="dark"] .right-icon em {
  color: rgba(231, 231, 231, .70);
  background: #303030;
}

html[data-theme-color="dark"] .member-right-item.member .right-icon,
html[data-theme-color="dark"] .member-right-item.member .right-icon em {
  color: #00c76e;
  background: rgba(0, 199, 110, .14);
}

html[data-theme-color="dark"] .member-right-item.pro .right-icon,
html[data-theme-color="dark"] .member-right-item.pro .right-icon em {
  color: #c5a5ff;
  background: rgba(173, 120, 255, .16);
}

html[data-theme-color="dark"] .member-benefit-page.tone-member {
  background: #19130d;
}

html[data-theme-color="dark"] .member-benefit-page.tone-pro {
  background: #15101b;
}

html[data-theme-color="dark"] .member-tier-stage.tone-member {
  background:
    radial-gradient(ellipse at 50% 58%, rgba(239, 190, 97, .32) 0 16%, rgba(239, 190, 97, .12) 17% 45%, transparent 46%),
    linear-gradient(155deg, #4c321d 0%, #2b2118 58%, #11100d 100%);
}

html[data-theme-color="dark"] .member-tier-stage.tone-member::after {
  background: #19130d;
}

html[data-theme-color="dark"] .member-tier-stage.tone-member .member-orbit {
  border-top-color: rgba(239, 190, 97, .56);
}

html[data-theme-color="dark"] .member-tier-stage.tone-member .member-orbit i {
  background: rgba(239, 190, 97, .62);
}

html[data-theme-color="dark"] .member-tier-stage.tone-pro {
  background:
    radial-gradient(ellipse at 50% 58%, rgba(205, 152, 255, .26) 0 16%, rgba(205, 152, 255, .10) 17% 45%, transparent 46%),
    linear-gradient(155deg, #3c2b52 0%, #231a31 58%, #121018 100%);
}

html[data-theme-color="dark"] .member-tier-stage.tone-pro::after {
  background: #15101b;
}

html[data-theme-color="dark"] .member-tier-stage.tone-pro .member-orbit {
  border-top-color: rgba(205, 152, 255, .50);
}

html[data-theme-color="dark"] .member-tier-stage.tone-pro .member-orbit i {
  background: rgba(205, 152, 255, .56);
}

html[data-theme-color="dark"] .member-rights-section.tone-member {
  background: linear-gradient(180deg, #19130d 0%, #17130f 100%);
}

html[data-theme-color="dark"] .member-rights-section.tone-member > p,
html[data-theme-color="dark"] .member-rights-section.tone-member .member-right-item p {
  color: rgba(244, 208, 146, .66);
}

html[data-theme-color="dark"] .member-rights-section.tone-member .member-rights-title h3,
html[data-theme-color="dark"] .member-rights-section.tone-member .member-right-item h4 {
  color: #f3d08f;
}

html[data-theme-color="dark"] .member-rights-section.tone-member .member-rights-title span {
  color: #f3c46a;
  background: rgba(239, 190, 97, .16);
}

html[data-theme-color="dark"] .member-right-item.member .right-icon {
  color: #f3c46a;
  background: rgba(239, 190, 97, .14);
}

html[data-theme-color="dark"] .member-right-item.member .right-icon em {
  color: #f8d995;
  background: rgba(239, 190, 97, .22);
}

html[data-theme-color="dark"] .member-rights-section.tone-pro {
  background: linear-gradient(180deg, #15101b 0%, #151218 100%);
}

html[data-theme-color="dark"] .member-rights-section.tone-pro > p,
html[data-theme-color="dark"] .member-rights-section.tone-pro .member-right-item p {
  color: rgba(220, 193, 255, .64);
}

html[data-theme-color="dark"] .member-rights-section.tone-pro .member-rights-title h3,
html[data-theme-color="dark"] .member-rights-section.tone-pro .member-right-item h4 {
  color: #d9c0ff;
}

html[data-theme-color="dark"] .member-rights-section.tone-pro .member-rights-title span {
  color: #d7b8ff;
  background: rgba(173, 120, 255, .18);
}

html[data-theme-color="dark"] .member-right-item.pro .right-icon {
  color: #d7b8ff;
  background: rgba(173, 120, 255, .14);
}

html[data-theme-color="dark"] .member-right-item.pro .right-icon em {
  color: #eadbff;
  background: rgba(173, 120, 255, .22);
}

html[data-theme-color="dark"] .vip-scroll-hint span:first-child {
  background: var(--wechat-green);
}

html[data-theme-color="dark"] .vip-compare-grid div {
  background: rgba(255, 255, 255, .05);
}

html[data-theme-color="dark"] .membership-status-card > span,
html[data-theme-color="dark"] .upgrade-benefit-card > span {
  color: var(--wechat-green);
  background: rgba(0, 199, 110, .12);
}

html[data-theme-color="dark"] .profile-plan-badge {
  color: #0b0b0b;
  background: rgba(0, 199, 110, .92);
}

html[data-theme-color="dark"] .profile-plan-badge.free {
  color: #d7d7d7;
  background: rgba(255, 255, 255, .14);
}

html[data-theme-color="dark"] .profile-plan-badge.pro {
  color: #1d1300;
  background: rgba(255, 198, 83, .92);
}

@media (max-width: 520px) {
  .plan-grid {
    grid-template-columns: 1fr;
  }

  .export-card,
  .plan-free-card,
  .pro-plan-card {
    grid-template-columns: 1fr;
  }

  .export-card .secondary {
    width: 100%;
  }
}

/* Final form pass: iOS/WeChat one-line cells and collapsed optional body measurements. */
.form-block {
  display: grid !important;
  grid-template-columns: minmax(92px, 32%) minmax(0, 1fr) !important;
  gap: 10px 12px !important;
  align-items: center !important;
}

.form-block > h3,
.form-block > .form-head,
.form-block > .photo-uploader,
.form-block > .hidden-file,
.form-block > .measure-extra {
  grid-column: 1 / -1 !important;
}

.form-block > .label {
  min-height: 50px !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  color: var(--text) !important;
}

.form-block > .field,
.form-block > .select,
.form-block > textarea,
.form-block > .radio-row {
  grid-column: 2 !important;
  width: 100% !important;
  margin: 0 !important;
}

.form-block > .field,
.form-block > .select {
  text-align: right !important;
}

.form-block > textarea {
  min-height: 92px !important;
  text-align: left !important;
}

.form-block > .text-green {
  grid-column: 2 !important;
  justify-self: start !important;
  margin-top: -4px !important;
}

/* New turtle profile: make the species catalogue shortcut easy to find,
   independent of the two-column form layout above. */
.form-block > .add-species-hint {
  grid-column: 1 / -1 !important;
  justify-self: center !important;
  margin-top: 8px !important;
  background: transparent !important;
  border-color: transparent !important;
}

html[data-theme-color="dark"] .form-block > .add-species-hint {
  color: #07c160 !important;
  background: transparent !important;
  border-color: transparent !important;
}

.archive-mode-card .archive-mode-switch,
.archive-mode-card .archive-mode-tip {
  grid-column: 1 / -1 !important;
}

.archive-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--raised-bg);
}

.archive-mode-switch button {
  min-height: 42px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
}

.archive-mode-switch button.active {
  background: var(--card-bg);
  color: var(--accent);
  box-shadow: 0 2px 10px rgba(20, 42, 34, .1);
}

.archive-mode-tip {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

#turtleForm.batch-mode .single-only {
  display: none !important;
}

.memo-form label,
.breeding-form-grid label,
.ledger-date-filter label,
.survey-field,
.measure-extra label,
.detail-form-grid label {
  display: grid !important;
  grid-template-columns: minmax(92px, 32%) minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 12px !important;
}

.memo-form label > span,
.breeding-form-grid label > span,
.ledger-date-filter label > span,
.survey-field > span,
.measure-extra label > span,
.detail-form-grid label > span {
  min-width: 0 !important;
  margin: 0 !important;
  white-space: nowrap !important;
}

.memo-form label .field,
.memo-form label .select,
.breeding-form-grid label .field,
.breeding-form-grid label .select,
.ledger-date-filter label .field,
.survey-field .field,
.measure-extra label .field,
.detail-form-grid label .field,
.detail-form-grid label .select {
  width: 100% !important;
  margin: 0 !important;
  text-align: right !important;
}

.memo-form label textarea,
.survey-field textarea,
.breeding-form-grid label textarea {
  min-height: 92px !important;
  text-align: left !important;
}

.measure-extra {
  margin-top: 6px !important;
  border: 1px solid rgba(31, 42, 51, .08) !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, .54) !important;
  overflow: hidden !important;
}

.measure-extra summary {
  min-height: 52px !important;
  padding: 0 14px !important;
  display: grid !important;
  grid-template-columns: minmax(92px, 32%) minmax(0, 1fr) 18px !important;
  align-items: center !important;
  gap: 10px !important;
  cursor: pointer !important;
  list-style: none !important;
  color: var(--text) !important;
}

.measure-extra summary::-webkit-details-marker {
  display: none !important;
}

.measure-extra summary::after {
  content: "v";
  justify-self: end;
  color: var(--muted);
  font-size: 18px;
  transform: translateY(-1px);
}

.measure-extra[open] summary::after {
  transform: rotate(180deg);
}

.measure-extra summary small {
  justify-self: end !important;
  color: var(--muted) !important;
  font-size: 13px !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

.measure-extra label {
  padding: 10px 14px !important;
  border-top: 1px solid rgba(31, 42, 51, .07) !important;
}

.detail-form-grid .measure-extra {
  grid-column: 1 / -1 !important;
}

.weekday-field {
  display: grid !important;
  gap: 12px !important;
}

.weekday-field > span {
  color: var(--text) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
}

.weekday-picker {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.weekday-chip {
  width: 42px !important;
  height: 42px !important;
  min-width: 0 !important;
  margin: 0 auto !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 50% !important;
  border: 1px solid rgba(47, 167, 127, .28) !important;
  background: rgba(47, 167, 127, .12) !important;
  color: var(--green-2) !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}

.weekday-chip input {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.weekday-chip.active,
.weekday-chip:has(input:checked) {
  background: #6bc6a1 !important;
  border-color: #6bc6a1 !important;
  color: #fff !important;
}

html[data-theme-color="dark"] .measure-extra {
  background: #191919 !important;
  border-color: #2c2c2e !important;
}

html[data-theme-color="dark"] .measure-extra label {
  border-top-color: #2c2c2e !important;
}

html[data-theme-color="dark"] .measure-extra summary,
html[data-theme-color="dark"] .weekday-field > span {
  color: var(--wechat-text) !important;
}

html[data-theme-color="dark"] .weekday-chip {
  background: rgba(7, 193, 96, .12) !important;
  border-color: rgba(7, 193, 96, .24) !important;
  color: #7adfac !important;
}

html[data-theme-color="dark"] .weekday-chip.active,
html[data-theme-color="dark"] .weekday-chip:has(input:checked) {
  background: #07c160 !important;
  border-color: #07c160 !important;
  color: #fff !important;
}

/* Final iOS/WeChat typography and two-tier membership polish. */
.phone-shell,
.phone-shell button,
.phone-shell input,
.phone-shell select,
.phone-shell textarea {
  font-family: var(--app-font) !important;
  letter-spacing: 0 !important;
  text-rendering: auto;
}

.module strong {
  font-family: var(--app-font) !important;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 600 !important;
}

.module small {
  font-family: var(--app-font) !important;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 400 !important;
}

.member-benefit-page,
.member-benefit-page * {
  font-family: var(--app-font) !important;
  letter-spacing: 0 !important;
}

.member-tier-card {
  height: 210px;
  min-height: 210px;
  grid-template-rows: auto auto auto 1fr;
  align-content: start;
}

.member-tier-card h2 {
  font-size: 28px;
  line-height: 1.16;
  font-weight: 700 !important;
}

.member-tier-card p {
  font-size: 15px;
  line-height: 1.45;
  font-weight: 500 !important;
}

.member-tier-card small {
  font-size: 13px;
  line-height: 1.5;
  font-weight: 400 !important;
}

.member-tier-card > strong {
  align-self: end;
  font-size: 12px;
  font-weight: 500 !important;
}

.tier-chip,
.member-stage-copy span,
.member-stage-copy strong {
  font-weight: 500 !important;
}

.member-rights-section > p {
  font-size: 14px;
  font-weight: 400 !important;
}

.member-rights-title h3 {
  font-size: 25px;
  font-weight: 700 !important;
}

.member-rights-title span,
.right-icon span,
.right-icon em {
  font-weight: 500 !important;
}

.member-right-item h4 {
  font-size: 16px;
  line-height: 1.3;
  font-weight: 500 !important;
}

.member-right-item p {
  font-size: 13px;
  line-height: 1.42;
  font-weight: 400 !important;
}

.vip-price-card h3 {
  font-size: 19px;
  font-weight: 600 !important;
}

.vip-price-card p {
  font-size: 13px;
  font-weight: 400 !important;
}

.vip-price strong {
  font-size: 30px;
  font-weight: 700 !important;
}

.vip-price span,
.vip-price-badge,
.vip-price-card .primary {
  font-weight: 500 !important;
}

.about-contact-card {
  gap: 14px;
}

.about-contact-row {
  min-height: 54px;
  padding: 0 2px;
  border-top: 1px solid rgba(31, 42, 51, .08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.about-contact-row span {
  color: var(--muted);
  font-size: 15px;
}

.about-contact-row strong {
  color: var(--text);
  font-size: 17px;
  font-weight: 600 !important;
}

.about-contact-action {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
}

.about-contact-tip {
  margin: -5px 0 0;
  font-size: 13px;
  line-height: 1.5;
}

html[data-theme-color="dark"] .ledger-command-button.active {
  color: #e7e7e7 !important;
  background: #20252a !important;
  border-color: #31373c !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .025) !important;
}

html[data-theme-color="dark"] .about-contact-row {
  border-top-color: #2c2c2e;
}

html[data-theme-color="dark"] .about-contact-row strong {
  color: #e2e2e2 !important;
}

.action-panel.care-action-panel {
  grid-template-columns: 1fr;
  margin-left: 10px;
  margin-right: 10px;
}

.action-panel.care-action-panel .care-action {
  min-height: 64px;
  padding: 8px 14px;
}

/* Keep the turtle detail editor readable on phone-sized screens. */
.turtle-detail-edit-form .breeding-form-grid {
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 0 !important;
}

.turtle-detail-edit-form .breeding-form-grid > label {
  min-height: 60px !important;
  margin: 0 !important;
  padding: 8px 0 !important;
  grid-template-columns: 104px minmax(0, 1fr) !important;
  gap: 12px !important;
  border-bottom: 1px solid var(--divider) !important;
}

.turtle-detail-edit-form .breeding-form-grid > label:last-child {
  border-bottom: 0 !important;
}

.turtle-detail-edit-form .detail-measure-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--divider);
}

.turtle-detail-edit-form .detail-measure-pair > label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) !important;
  gap: 8px !important;
  min-width: 0;
  margin: 0;
}

.turtle-detail-edit-form .detail-choice-row {
  min-height: 64px !important;
  padding: 8px 0 !important;
  display: grid !important;
  grid-template-columns: 104px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 12px !important;
  border-bottom: 1px solid var(--divider) !important;
}

.turtle-detail-edit-form .detail-choice-row > span {
  color: var(--muted) !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
}

.turtle-detail-edit-form .detail-choice-row .radio-row {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.turtle-detail-edit-form .detail-choice-row .radio-row.two-options {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.turtle-detail-edit-form .detail-choice-row .choice {
  min-height: 44px !important;
  padding: 0 6px !important;
  white-space: nowrap !important;
}

.turtle-detail-edit-form .breeding-form-grid > label > span {
  line-height: 1.35 !important;
  white-space: normal !important;
}

.turtle-detail-edit-form .breeding-form-grid .field,
.turtle-detail-edit-form .breeding-form-grid .select {
  min-width: 0 !important;
}

.turtle-detail-edit-form .measure-extra {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  margin: 10px 0 !important;
}

.turtle-detail-edit-form .measure-extra summary {
  grid-template-columns: 104px minmax(0, 1fr) 18px !important;
}

.turtle-detail-edit-form .breeding-note {
  margin-top: 14px !important;
}

.turtle-detail-edit-form > .primary {
  width: 100% !important;
  margin-top: 12px !important;
}

@media (max-width: 360px) {
  .turtle-detail-edit-form .breeding-form-grid > label,
  .turtle-detail-edit-form .detail-choice-row,
  .turtle-detail-edit-form .measure-extra summary {
    grid-template-columns: 92px minmax(0, 1fr) !important;
  }

  .turtle-detail-edit-form .measure-extra summary::after {
    display: none !important;
  }
}

/* New archive status choices stay on one line, including “正常饲养”. */
#turtleForm .status-choice-row {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

#turtleForm .status-choice-row .choice {
  min-width: 0 !important;
  padding: 0 2px !important;
  font-size: 14px !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
}

/* Growth history: old and new snapshots are compared as two cards on a timeline. */
.growth-history-entry {
  position: relative;
}

.growth-history-card {
  padding: 14px !important;
  margin-bottom: 0 !important;
}

.growth-history-head {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.growth-history-head > strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
}

.growth-history-head > small {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.growth-comparison {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
  align-items: stretch;
  gap: 6px;
}

.growth-snapshot-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--divider);
  border-radius: 10px;
  background: var(--row-bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.growth-snapshot-card.is-new {
  border-color: rgba(7, 193, 96, .42);
  background: rgba(7, 193, 96, .055);
}

.growth-snapshot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.growth-snapshot-head > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.growth-snapshot-card.is-new .growth-snapshot-head > span {
  color: var(--accent);
}

.growth-snapshot-head img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--surface);
}

.growth-preview-photo {
  cursor: zoom-in;
  transition: transform .16s ease, box-shadow .16s ease;
}

.growth-preview-photo:active {
  transform: scale(.94);
}

.growth-preview-photo:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.growth-snapshot-card > strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.growth-snapshot-meta {
  display: grid;
  gap: 5px;
}

.growth-snapshot-meta > span {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.growth-snapshot-meta b {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 550;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.growth-inline-arrow {
  width: 22px;
  height: 22px;
  margin: auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(7, 193, 96, .2);
}

.growth-down-arrow {
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  color: var(--accent);
}

.growth-down-arrow span {
  font-size: 22px;
  line-height: 1;
}

.growth-down-arrow small {
  color: var(--muted);
  font-size: 10px;
}

html[data-theme-color="dark"] .growth-snapshot-card {
  background: #202020;
  border-color: #303033;
}

html[data-theme-color="dark"] .growth-snapshot-card.is-new {
  background: rgba(7, 193, 96, .09);
  border-color: rgba(7, 193, 96, .38);
}

body.image-preview-open {
  overflow: hidden;
}

.image-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  padding: max(64px, env(safe-area-inset-top)) 18px max(34px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(0, 0, 0, .9);
  /* A backdrop blur requires the browser to re-composite the full screen
     during every image drag. The opaque preview layer is both cleaner and
     substantially smoother on iPhone. */
  isolation: isolate;
}

.image-preview-stage {
  position: relative;
  width: min(100%, 760px);
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: none;
}

/* Image galleries use the iOS WebKit scroll view instead of a JavaScript
   translate loop. This preserves direct finger tracking, deceleration and
   native one-page scroll snap. */
.image-preview-stage.uses-native-preview-gallery {
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
  /* Keep horizontal paging native while reserving vertical movement for the
     iOS-style pull-down-to-dismiss gesture. */
  touch-action: pan-x;
  scroll-snap-type: x mandatory;
  scroll-snap-stop: always;
  /* Native user paging must not inherit a CSS animation. Programmatic page
     buttons pass their own smooth behaviour when needed. */
  scroll-behavior: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.image-preview-stage.uses-native-preview-gallery::-webkit-scrollbar {
  display: none;
}

.image-preview-stage.uses-native-preview-gallery.is-zoomed {
  overflow: hidden;
  touch-action: none;
  scroll-snap-type: none;
}

.image-preview-native-track {
  display: flex;
  width: calc(var(--image-preview-slide-count, 1) * 100%);
  min-width: 100%;
  height: 100%;
}

.image-preview-native-slide {
  flex: 0 0 calc(100% / var(--image-preview-slide-count, 1));
  min-width: 0;
  height: 100%;
  display: grid;
  place-items: center;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  contain: paint;
}

.image-preview-stage > img,
.image-preview-stage > .image-preview-slide > img,
.image-preview-stage > .image-preview-native-track > .image-preview-native-slide > img,
.image-preview-stage > video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  object-fit: contain;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .48);
  transition: transform .16s ease, opacity .12s ease;
  will-change: transform, opacity;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: default;
}

.image-preview-slide {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  contain: paint;
}

.image-preview-slide > img {
  pointer-events: auto;
}

.image-preview-slide[hidden] {
  display: none;
}

.image-preview-stage.video-preview-stage > video {
  width: min(100%, 760px);
  height: auto;
  max-height: 100%;
  object-fit: contain;
  background: #000;
}

.image-preview-stage.is-dragging > img,
.image-preview-stage.is-dragging > .image-preview-slide,
.image-preview-stage.is-dragging > .image-preview-slide > img,
.image-preview-stage.is-dragging > video { transition: none; }
.image-preview-stage > img.is-leaving-to-left,
.image-preview-stage > .image-preview-slide > img.is-leaving-to-left { transform: translate3d(-18%, 0, 0); opacity: 0; }
.image-preview-stage > img.is-leaving-to-right,
.image-preview-stage > .image-preview-slide > img.is-leaving-to-right { transform: translate3d(18%, 0, 0); opacity: 0; }
.image-preview-stage > img.is-entering-from-left,
.image-preview-stage > .image-preview-slide > img.is-entering-from-left { transform: translate3d(-14%, 0, 0); opacity: 0; }
.image-preview-stage > img.is-entering-from-right,
.image-preview-stage > .image-preview-slide > img.is-entering-from-right { transform: translate3d(14%, 0, 0); opacity: 0; }

.image-preview-stage.is-bouncing > img,
.image-preview-stage.is-bouncing > .image-preview-slide > img { animation: image-preview-edge-bounce .18s ease-out; }

@keyframes image-preview-edge-bounce {
  0%, 100% { transform: translate3d(0, 0, 0); }
  48% { transform: translate3d(10px, 0, 0); }
}

.image-preview-close {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: 16px;
  z-index: 3;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(255, 255, 255, .16);
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.image-preview-caption {
  color: rgba(255, 255, 255, .78);
  font-size: 13px;
}

.image-preview-gallery-arrow {
  position: absolute;
  top: 50%;
  z-index: 1;
  width: 42px;
  height: 56px;
  padding: 0 0 4px;
  border: 0;
  border-radius: 22px;
  color: #fff;
  background: rgba(0, 0, 0, .34);
  font-size: 42px;
  font-weight: 250;
  line-height: 1;
  transform: translateY(-50%);
  transition: opacity .15s ease, background .15s ease;
}

.image-preview-gallery-arrow.prev { left: max(10px, env(safe-area-inset-left)); }
.image-preview-gallery-arrow.next { right: max(10px, env(safe-area-inset-right)); }
.image-preview-gallery-arrow:active { background: rgba(255, 255, 255, .24); }
.image-preview-gallery-arrow:disabled { opacity: 0; pointer-events: none; }

@media (max-width: 430px) {
  .image-preview-gallery-arrow { width: 36px; height: 50px; font-size: 36px; }
}

/* Archive list: clearer hierarchy with a prominent price badge. */
.turtle-row-content {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 5px;
}

.turtle-row-title {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.turtle-row-title > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.turtle-row-species {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.turtle-keeping-days {
  min-height: 20px;
  padding: 2px 7px;
  border: 1px solid var(--divider);
  border-radius: 999px;
  color: var(--muted);
  background: var(--raised-bg);
  font-size: 11px;
  font-weight: 500;
  line-height: 16px;
  white-space: nowrap;
}

.turtle-row-species > p {
  min-width: 0;
  margin: 0 !important;
  overflow: hidden;
  color: var(--muted) !important;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.turtle-row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.turtle-row-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.turtle-row-bottom .turtle-row-meta {
  min-width: 0;
  flex: 1 1 auto;
}

.turtle-row-meta > span {
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid var(--divider);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  background: var(--raised-bg);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.turtle-price {
  flex: none;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(7, 193, 96, .28);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: #07884a;
  background: rgba(7, 193, 96, .1);
  font-size: 14px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.turtle-row > img {
  border: 1px solid rgba(31, 42, 51, .08);
  box-shadow: 0 6px 14px rgba(31, 42, 51, .09);
}

html[data-theme-color="dark"] .turtle-row-meta > span {
  background: #202020;
  border-color: #303033;
}

.turtle-pool-title-meta {
  min-width: 0;
  max-width: 122px;
  min-height: 22px;
  overflow: hidden;
  padding: 2px 7px;
  border: 1px solid var(--divider);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  background: var(--raised-bg);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme-color="dark"] .turtle-pool-title-meta {
  color: var(--muted);
  border-color: #303033;
  background: #202020;
}

html[data-theme-color="dark"] .turtle-price {
  color: #78dfa9;
  background: rgba(7, 193, 96, .13);
  border-color: rgba(7, 193, 96, .32);
}

/* 看板档案列表：保留全部信息，但缩小卡片和缩略图的垂直占用。 */
.home-archive-section .turtle-row {
  min-height: 0 !important;
  grid-template-columns: 58px minmax(0, 1fr) !important;
  gap: 10px;
  padding: 10px 12px !important;
}

.home-archive-section .turtle-row > img {
  width: 58px;
  height: 58px;
}

/* A pinned archive is identifiable at a glance without taking room away
   from its nickname, price, or measurements. */
.turtle-pinned-badge {
  position: absolute;
  top: 4px;
  left: 12px;
  z-index: 3;
  min-width: 30px;
  padding: 2px 5px;
  border: 1px solid rgba(47, 167, 127, .28);
  border-radius: 999px;
  color: #16835d;
  background: rgba(238, 251, 245, .96);
  box-shadow: 0 2px 7px rgba(22, 131, 93, .16);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: .02em;
  pointer-events: none;
  transform: none;
}

.home-archive-section .turtle-pinned-badge {
  top: 3px;
  left: 12px;
}

html[data-theme-color="dark"] .turtle-pinned-badge {
  border-color: rgba(91, 214, 164, .3);
  color: #8de0b8;
  background: rgba(19, 69, 52, .94);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3);
}

.home-archive-section .turtle-row-content {
  gap: 4px;
}

.home-archive-section .turtle-row-title > strong {
  margin-left: 7px;
  font-size: 16px;
}

.home-archive-section .turtle-row-species > p {
  margin-left: 7px !important;
}

.home-archive-section .turtle-row .more-btn {
  top: 6px !important;
  right: 6px !important;
}

/* A purchase card keeps its original figures and shows when the linked turtle was sold. */
.ledger-row-title-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.ledger-row-title-line .ledger-row-title {
  min-width: 0;
}

.ledger-sold-badge {
  flex: none;
  min-height: 23px;
  padding: 2px 8px;
  border: 1px solid rgba(7, 193, 96, .28);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: #07884a;
  background: rgba(7, 193, 96, .1);
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

html[data-theme-color="dark"] .ledger-sold-badge {
  color: #78dfa9 !important;
  background: rgba(7, 193, 96, .13) !important;
  border-color: rgba(7, 193, 96, .32) !important;
}

/* Bottom navigation: 看板、账本、龟集市、消息、空间。 */
.bottom-nav {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

.care-action-panel .home-module-action.breeding-action > span {
  color: #a46a05;
  background: #fff3df;
}

.care-action-panel .home-module-action.ledger-action > span {
  color: #9e4452;
  background: #fff0f1;
}

html[data-theme-color="dark"] .care-action-panel .home-module-action > span {
  color: #e7e7e7 !important;
  background: #292929 !important;
}

/* Dashboard module launcher: 护理与繁殖两个快捷入口。 */
.action-panel.care-action-panel.home-module-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px !important;
  margin: 2px 0 16px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.action-panel.care-action-panel.home-module-panel .care-action {
  min-width: 0 !important;
  min-height: 106px !important;
  padding: 11px 7px !important;
  border: 1px solid var(--card-border) !important;
  border-radius: 14px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  background: var(--card-bg) !important;
  box-shadow: 0 6px 16px rgba(31, 42, 51, .05) !important;
  text-align: center !important;
}

.action-panel.care-action-panel.home-module-panel .care-action:active {
  background: var(--raised-bg) !important;
  transform: scale(.985);
}

.action-panel.care-action-panel.home-module-panel .care-action > span {
  width: 42px !important;
  height: 42px !important;
  margin: 0 !important;
  border-radius: 13px !important;
  display: grid !important;
  place-items: center !important;
  align-self: center !important;
  font-size: 18px !important;
  font-weight: 650 !important;
}

.action-panel.care-action-panel.home-module-panel .care-action > span:has(img) {
  overflow: hidden !important;
  background: #202020 !important;
}

.action-panel.care-action-panel.home-module-panel .care-action > span > img {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: cover !important;
}

.action-panel.care-action-panel.home-module-panel .care-action:first-child > span {
  color: #16835f;
  background: #e8f6ef;
}

.action-panel.care-action-panel.home-module-panel .care-action > strong {
  color: var(--text);
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.2;
  grid-column: auto !important;
  grid-row: auto !important;
  align-self: center !important;
  justify-self: center !important;
  width: 100%;
  text-align: center !important;
  white-space: nowrap;
}

.action-panel.care-action-panel.home-module-panel .care-action > small {
  display: block !important;
  min-height: 14px;
  overflow: hidden;
  align-self: center !important;
  width: 100%;
  color: var(--muted);
  font-size: 11px !important;
  font-weight: 500;
  line-height: 1.25;
  text-align: center !important;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme-color="dark"] .action-panel.care-action-panel.home-module-panel {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html[data-theme-color="dark"] .action-panel.care-action-panel.home-module-panel .care-action {
  border-color: #303433 !important;
  background: #181818 !important;
  box-shadow: none !important;
}

html[data-theme-color="dark"] .action-panel.care-action-panel.home-module-panel .care-action > span {
  color: #e7e7e7 !important;
  background: #292929 !important;
}

/* A single calm vector treatment keeps all dashboard icons consistent and crisp. */
.action-panel.care-action-panel.home-module-panel .care-action > .home-module-icon {
  color: #5f8579 !important;
  background: #edf3f1 !important;
  box-shadow: inset 0 0 0 1px rgba(95, 133, 121, .1) !important;
}

.home-module-icon svg {
  width: 25px;
  height: 25px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  shape-rendering: geometricPrecision;
}

html[data-theme-color="dark"] .action-panel.care-action-panel.home-module-panel .care-action > .home-module-icon {
  color: #9bbcaf !important;
  background: #252b29 !important;
  box-shadow: inset 0 0 0 1px rgba(155, 188, 175, .12) !important;
}

/* 龟友圈：看板双列动态、完整信息流、好友与聊天。 */
.home-community {
  margin-top: 8px;
}

.community-section-head,
.community-page-actions {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.community-section-head > div:first-child {
  display: grid;
  gap: 3px;
}

.community-section-head strong {
  color: var(--text);
  font-size: 18px;
}

.community-section-head span,
.community-page-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.community-section-head > div:last-child,
.community-page-actions > div:last-child {
  display: flex;
  gap: 7px;
}

.community-section-head button,
.community-page-actions button,
.community-view-all {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  color: var(--accent);
  background: rgba(47, 167, 127, .1);
  font-size: 12px;
  font-weight: 600;
}

.community-home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.community-tile {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--divider);
  border-radius: 12px;
  background: var(--section-bg);
  box-shadow: 0 8px 20px rgba(31, 42, 51, .055);
}

.community-tile-media {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
  display: block;
  background: var(--raised-bg);
}

.community-media,
.community-post-media img,
.community-post-media video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.community-media-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #6a9c8c, #315d55);
  font-size: 15px;
  font-weight: 650;
}

.community-video-mark {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, .5);
  font-size: 11px;
}

.community-tile-body {
  padding: 9px;
}

.community-tile-body > p {
  min-height: 38px;
  margin: 0 0 8px;
  overflow: hidden;
  display: -webkit-box;
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.community-tile-author {
  min-width: 0;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
}

.community-tile-author > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-tile-author b {
  font-weight: 500;
  white-space: nowrap;
}

.community-mini-avatar,
.community-avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--mint);
}

.community-mini-avatar {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 10px;
}

.community-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--accent);
  font-weight: 650;
}

.community-view-all {
  width: 100%;
  margin-top: 10px;
  background: transparent;
}

.community-home-empty,
.community-login-card {
  width: 100%;
  min-height: 120px;
  grid-column: 1 / -1;
  border: 1px dashed var(--divider);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--text);
  background: var(--section-bg);
}

.community-home-empty span,
.community-login-card span {
  color: var(--muted);
  font-size: 12px;
}

.community-page-actions {
  padding: 4px 2px 8px;
}

.community-page-actions h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

.community-page-actions .primary {
  color: #fff;
  background: var(--accent);
}

.community-feed {
  display: grid;
  gap: 12px;
}

.community-feed-card {
  padding: 14px;
}

.community-post-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.community-post-head > div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.community-post-head strong {
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-post-head small {
  color: var(--muted);
  font-size: 11px;
}

.community-friend-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(47, 167, 127, .24);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(47, 167, 127, .08);
  font-size: 12px;
}

.community-friend-button.active {
  color: #fff;
  background: var(--accent);
}

.community-post-copy {
  margin: 12px 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.community-post-media {
  overflow: hidden;
  max-height: 480px;
  border-radius: 10px;
  background: #111;
}

.community-post-media img,
.community-post-media video {
  max-height: 480px;
  object-fit: contain;
}

.community-post-actions {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--divider);
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 12px;
}

.community-post-actions button {
  padding: 0;
  color: var(--muted);
  background: transparent;
}

.community-post-actions button.active {
  color: var(--danger);
}

.community-comment-list {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--raised-bg);
}

.community-comment-list p {
  margin: 3px 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.community-comment-form,
.community-chat-form {
  margin-top: 9px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.community-comment-form input,
.community-chat-form input {
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--divider);
  border-radius: 20px;
  color: var(--text);
  background: var(--raised-bg);
}

.community-comment-form button,
.community-chat-form button {
  min-width: 58px;
  border-radius: 20px;
  color: #fff;
  background: var(--accent);
}

.community-publish-form {
  padding: 14px;
}

.community-publish-form textarea {
  width: 100%;
  min-height: 150px;
  padding: 12px;
  border: 0;
  resize: vertical;
  background: transparent;
}

.community-media-preview {
  min-height: 150px;
  overflow: hidden;
  border: 1px dashed var(--divider);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--raised-bg);
}

.community-media-preview img,
.community-media-preview video {
  width: 100%;
  max-height: 380px;
  object-fit: contain;
}

.community-publish-actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.community-friend-list {
  display: grid;
  gap: 10px;
}

.community-friend-row {
  padding: 12px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.community-friend-row > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.community-friend-row small {
  color: var(--muted);
}

.community-friend-row button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 18px;
  color: #fff;
  background: var(--accent);
}

.community-chat-page {
  touch-action: pan-y pinch-zoom;
  min-height: calc(100vh - 74px);
  padding: 12px 0 0 !important;
  display: flex;
  flex-direction: column;
}

.community-chat-topbar {
  min-height: 0;
  position: relative;
}

.community-chat-nav {
  height: 58px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) max-content;
  align-items: center;
  column-gap: 8px;
  padding: 0 12px;
}

.community-chat-nav .icon-btn {
  width: 40px;
  height: 40px;
  justify-self: start;
}

.community-chat-nav h1 {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.2;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-chat-nav > span {
  justify-self: end;
  color: var(--text);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 2px;
}

.community-chat-service {
  position: static;
  justify-self: end;
  align-self: center;
  min-width: 42px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 6px;
  border: 0;
  border-radius: 17px;
  color: var(--accent-deep);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  font-size: 11px;
  font-weight: 700;
}

.community-chat-service svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.community-chat-product-strip {
  width: calc(100% - 28px);
  min-height: 78px;
  margin: 0 14px 12px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--divider);
  border-radius: 14px;
  color: var(--text);
  text-align: left;
  background: var(--section-bg);
  box-shadow: 0 7px 18px rgba(31, 42, 51, .045);
}

.community-chat-product-strip:active {
  background: var(--raised-bg);
}

.community-chat-product-media {
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  color: #fff;
  background: #edf3f1;
}

.community-chat-product-media img,
.community-chat-product-media video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.community-chat-product-media.is-video::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .15);
}

.community-chat-product-media.is-video i {
  position: absolute;
  z-index: 1;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding-left: 2px;
  border: 1px solid rgba(255, 255, 255, .88);
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-style: normal;
  background: rgba(0, 0, 0, .22);
}

.community-chat-product-media.is-placeholder {
  color: var(--accent-deep);
  font-size: 22px;
  font-weight: 800;
  background: var(--raised-bg);
}

.community-chat-product-media.is-unavailable {
  isolation: isolate;
}

.community-chat-product-media.is-unavailable::before {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  background: rgba(27, 38, 39, .45);
  pointer-events: none;
}

.community-chat-product-unavailable-mark {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 13px;
  font-style: normal;
  font-weight: 850;
  letter-spacing: .04em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .32);
  pointer-events: none;
}

.community-chat-product-info {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.community-chat-product-info span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-chat-product-info strong {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-chat-product-info b {
  color: #ef5661;
  font-size: 18px;
  line-height: 1.25;
}

.community-chat-product-info b i {
  margin-right: 1px;
  font-size: 12px;
  font-style: normal;
}

.community-chat-product-link {
  min-width: 66px;
  min-height: 32px;
  display: grid;
  place-items: center;
  padding: 0 9px;
  border-radius: 17px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  background: #ff6a00;
}

.community-chat-product-link.is-unavailable {
  color: var(--muted);
  background: var(--raised-bg);
}

.community-chat-list {
  flex: 1;
  padding: 0 14px calc(90px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.community-chat-bottom-anchor {
  width: 1px;
  height: 1px;
  flex: 0 0 1px;
  scroll-margin-bottom: calc(82px + env(safe-area-inset-bottom));
}

.community-message {
  width: 100%;
  max-width: none;
  display: grid;
  gap: 5px;
}

.community-message.mine {
  align-self: stretch;
}

.community-message.theirs {
  align-self: stretch;
}

.community-message p {
  width: fit-content;
  max-width: 78%;
  margin: 0;
  padding: 9px 12px;
  border-radius: 14px;
  color: var(--text);
  background: var(--section-bg);
  line-height: 1.5;
}

.community-message.mine p {
  justify-self: end;
  background: #b7e8cb;
}

.community-message.theirs p {
  justify-self: start;
}

.community-message small {
  width: 100%;
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}

.community-message-official {
  gap: 6px;
  margin: 3px 0;
}

.community-official-reminder {
  width: min(100%, 390px);
  justify-self: center;
  padding: 10px 12px;
  border: 1px solid #f0d497;
  border-radius: 12px;
  color: #77561b;
  background: #fff8e8;
  box-shadow: 0 3px 12px rgba(112, 84, 24, .06);
}

.community-official-reminder > div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.community-official-reminder i {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #d79a28;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.community-official-reminder strong {
  font-size: 12px;
}

.community-official-reminder p {
  width: auto;
  max-width: none;
  margin: 5px 0 8px;
  padding: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  font-size: 13px;
}

.community-official-reminder button {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 14px;
  color: #735015;
  background: #f9e8bd;
  font-size: 12px;
  font-weight: 700;
}

.community-chat-empty {
  margin: auto;
  color: var(--muted);
  font-size: 13px;
}

.community-chat-opening {
  margin: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.community-chat-opening i {
  width: 14px;
  height: 14px;
  border: 2px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: chat-opening-spin .65s linear infinite;
}

@keyframes chat-opening-spin { to { transform: rotate(360deg); } }

.community-chat-form {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 50;
  width: min(430px, 100vw);
  margin: 0;
  padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--topbar-bg);
  border-top: 1px solid var(--divider);
}

html[data-theme-color="dark"] .community-tile,
html[data-theme-color="dark"] .community-feed-card,
html[data-theme-color="dark"] .community-home-empty,
html[data-theme-color="dark"] .community-login-card,
html[data-theme-color="dark"] .community-message p {
  background: #181818 !important;
  border-color: #292929 !important;
}

html[data-theme-color="dark"] .community-message.mine p {
  color: #dff7e9 !important;
  background: #24523b !important;
}

html[data-theme-color="dark"] .community-official-reminder {
  border-color: #594927;
  color: #f0d899;
  background: #312b1d;
}

html[data-theme-color="dark"] .community-official-reminder p {
  color: #f0d899 !important;
  background: transparent !important;
}

html[data-theme-color="dark"] .community-official-reminder button {
  color: #f4dfaa;
  background: #4a3d21;
}

@media (max-width: 360px) {
  .community-section-head {
    align-items: flex-start;
  }
  .community-section-head > div:last-child {
    gap: 4px;
  }
  .community-section-head button {
    padding: 0 8px;
  }
}

@media (max-width: 360px) {
  .growth-history-card {
    padding: 11px !important;
  }

  .growth-comparison {
    grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
    gap: 4px;
  }

  .growth-snapshot-card {
    padding: 8px;
  }

  .growth-inline-arrow {
    width: 18px;
    height: 18px;
    font-size: 12px;
  }
}

/* 龟友圈动态不再显示未读红点提示。 */
.message-discover-preview:not(:empty)::after,
html[data-theme-color="dark"] .message-discover-preview:not(:empty)::after {
  content: none !important;
  display: none !important;
}

/* Final five-tab lock: keep every item, including 空间, inside the viewport. */
.phone-shell .bottom-nav {
  width: min(430px, 100vw) !important;
  grid-template-columns: repeat(5, 20%) !important;
}

.phone-shell .bottom-nav > button {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow: hidden !important;
  font-size: 10px !important;
}

/* Unread chat counters: WeChat-style red numeric badges. */
.phone-shell .bottom-nav > .nav-message-tab {
  position: relative !important;
  overflow: visible !important;
}

.nav-unread-badge {
  position: absolute;
  top: 2px;
  left: calc(50% + 7px);
  z-index: 4;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--topbar-bg);
  border-radius: 9px;
  color: #fff;
  background: #fa5151;
  box-shadow: none;
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
  line-height: 1;
}

.message-friend-avatar-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: block !important;
  overflow: visible;
}

.message-friend-avatar-wrap > .community-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  object-fit: cover;
}

.message-friend-avatar-wrap > i {
  position: absolute;
  top: -6px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--section-bg);
  border-radius: 10px;
  color: #fff;
  background: #fa5151;
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
  line-height: 1;
}

html[data-theme-color="dark"] .nav-unread-badge,
html[data-theme-color="dark"] .message-friend-avatar-wrap > i {
  border-color: #181818;
}

/* 社交资料、关注、收藏与空间快捷入口。 */
.community-author-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 5px;
}

.community-author-actions button,
.following-profile-head > button,
.market-seller-actions button {
  min-height: 27px;
  padding: 0 9px;
  border: 1px solid rgba(47, 167, 127, .34);
  border-radius: 14px;
  color: #278261;
  background: #f4fbf8;
  font-size: 10px;
  font-weight: 650;
}

.community-author-actions button.active,
.following-profile-head > button.active,
.market-seller-actions button.active {
  color: #7b8580;
  border-color: #d9dfdc;
  background: #f1f3f2;
}

.community-compose-submit,
.community-compose-submit:disabled {
  color: #fff !important;
  background: #95debd !important;
  opacity: 1 !important;
}

.community-compose-submit.is-ready:not(:disabled) {
  background: #07c160 !important;
  box-shadow: 0 4px 10px rgba(7, 193, 96, .18);
}

.community-compose-submit[data-ready="true"] {
  background: #07c160 !important;
  box-shadow: 0 4px 10px rgba(7, 193, 96, .18);
}

.market-card-wrap {
  position: relative;
  min-width: 0;
}

.market-card-wrap > .market-card {
  width: 100%;
}

.market-favorite-button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  width: 34px;
  height: 34px;
  padding: 7px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(18, 23, 21, .5);
  box-shadow: 0 2px 9px rgba(0, 0, 0, .12);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.market-favorite-button svg,
.market-detail-favorite svg {
  width: 100%;
  height: 100%;
  fill: transparent;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.market-favorite-button.active,
.market-detail-favorite.active {
  color: #ffc83d;
}

.market-favorite-button.active svg,
.market-detail-favorite.active svg {
  fill: currentColor;
}

.market-detail-actions {
  grid-template-columns: 48px .8fr 1.35fr;
}

.market-detail-more-button {
  width: 42px;
  height: 42px;
  padding: 0 0 5px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 1px;
}

.market-detail-more-button:active { background: rgba(31, 42, 51, .08); }

.market-contact-action {
  color: #2b8263;
  background: #eaf6f1;
}

body.market-detail-more-open { overflow: hidden; }

.market-detail-more-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: grid;
  align-items: end;
  background: rgba(12, 18, 20, .44);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.market-detail-more-sheet {
  width: min(100%, 430px);
  margin: 0 auto;
  padding: 25px 20px calc(12px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: var(--section-bg);
  box-shadow: 0 -14px 44px rgba(0, 0, 0, .18);
}

.market-detail-more-sheet h2 {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 700;
}

.market-detail-more-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.market-detail-more-actions button {
  min-width: 0;
  padding: 0 2px 13px;
  display: grid;
  justify-items: center;
  gap: 8px;
  border: 0;
  color: var(--ink);
  background: transparent;
}

.market-detail-more-actions button > span {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #2fa77f;
  font-size: 27px;
  font-weight: 750;
  line-height: 1;
}

.market-detail-more-actions button:nth-child(2) > span { background: #f1a231; }
.market-detail-more-actions button.danger > span { background: #f06a76; }
.market-detail-more-actions small { overflow: hidden; max-width: 100%; color: var(--ink); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }

.market-detail-more-cancel {
  width: 100%;
  min-height: 48px;
  margin-top: 7px;
  border: 0;
  border-top: 1px solid var(--divider);
  color: var(--ink);
  background: transparent;
  font-size: 16px;
  font-weight: 800;
}

html[data-theme-color="dark"] .market-detail-more-sheet { background: #1a1a1b; }
html[data-theme-color="dark"] .market-detail-more-button { color: #e7e7e7; }
html[data-theme-color="dark"] .market-contact-action { color: #9be0c5; background: #1d3932; }

.market-detail-favorite {
  width: 48px;
  padding: 12px;
  color: #77847d;
  background: #eef3f0;
}

.market-seller-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.market-seller-actions button {
  height: 31px;
  min-height: 31px;
  padding: 0 9px;
}

.space-social-links {
  padding: 12px 4px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
}

.space-social-links button {
  min-width: 0;
  padding: 3px 1px;
  display: grid;
  gap: 5px;
  color: var(--text);
  background: transparent;
  text-align: center;
}

.space-social-links button + button {
  border-left: 1px solid var(--divider);
}

.space-social-links strong {
  font-size: 19px;
  line-height: 1;
}

.space-social-links span {
  overflow: hidden;
  font-size: 11px;
  white-space: nowrap;
}

.following-user-list {
  display: grid;
  gap: 9px;
}

.following-user-card {
  width: 100%;
  padding: 12px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-align: left;
}

.following-user-avatar,
.following-profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
}

.following-user-card > div {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.following-user-card span {
  color: var(--muted);
  font-size: 11px;
}

.following-user-card > b {
  color: var(--muted);
  font-size: 23px;
  font-weight: 300;
}

.following-profile-head {
  padding: 14px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
}

.following-profile-head .following-profile-avatar {
  width: 54px;
  height: 54px;
}

.following-profile-head h2,
.following-profile-head p {
  margin: 0;
}

.following-profile-head h2 {
  font-size: 18px;
}

.following-profile-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.profile-content-tabs {
  margin: 12px 0;
  padding: 4px;
  border: 1px solid var(--divider);
  border-radius: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  background: var(--raised-bg);
}

.profile-content-tabs button {
  min-width: 0;
  min-height: 60px;
  padding: 8px 6px;
  border: 0;
  border-radius: 7px;
  display: grid;
  place-content: center;
  gap: 4px;
  color: var(--muted);
  background: transparent;
  text-align: center;
  cursor: pointer;
  transition: color .16s ease, background-color .16s ease, box-shadow .16s ease, transform .12s ease;
  -webkit-tap-highlight-color: transparent;
}

.profile-content-tabs button strong {
  color: inherit;
  font-size: 16px;
  line-height: 1.2;
}

.profile-content-tabs button span {
  color: inherit;
  font-size: 11px;
  line-height: 1.2;
}

.profile-content-tabs button.active {
  color: var(--accent-deep);
  background: var(--section-bg);
  box-shadow: 0 5px 12px rgba(31, 42, 51, .08);
}

.profile-content-tabs button:active {
  transform: scale(.975);
}

.profile-content-panel {
  min-width: 0;
}

.saved-market-page .empty,
.following-market-grid .empty {
  grid-column: 1 / -1;
}

html[data-theme-color="dark"] .community-author-actions button,
html[data-theme-color="dark"] .market-seller-actions button {
  color: #9ed8c1;
  border-color: #345f4f;
  background: #17251f;
}

html[data-theme-color="dark"] .space-social-links,
html[data-theme-color="dark"] .following-user-card,
html[data-theme-color="dark"] .following-profile-head {
  background: #181818;
}

html[data-theme-color="dark"] .profile-content-tabs {
  border-color: #303033;
  background: #202020;
}

html[data-theme-color="dark"] .profile-content-tabs button.active {
  color: #f2f5f4;
  background: #39393d;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .055), 0 3px 9px rgba(0, 0, 0, .2);
}

/* 龟集市九宫格媒体：最多9张图片或视频。 */
.market-card-photo > video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.market-card-photo > .market-card-video-cover {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 1;
  transform: translateZ(0);
  transition: opacity 120ms linear;
  pointer-events: none;
}

.market-card-photo.is-video-playing > .market-card-video-cover {
  opacity: 0;
}

.market-card-photo.is-video-playing > .market-video-mark {
  opacity: 0;
}

.market-card-photo > video {
  transform: translateZ(0);
  background: #e9eeeb;
}

.market-video-mark {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, .36);
  font-size: 14px;
}

.market-media-card {
  display: block;
}

.market-media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.market-media-item,
.market-media-add {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 7px;
}

.market-media-item {
  cursor: grab;
  background: #111;
}

.market-media-item:first-child::after {
  content: "首图";
  position: absolute;
  left: 5px;
  top: 5px;
  z-index: 2;
  padding: 3px 5px;
  border-radius: 4px;
  color: #fff;
  background: rgba(7, 132, 74, .9);
  font-size: 10px;
  line-height: 1;
}

.market-media-item.is-dragging {
  opacity: .42;
  cursor: grabbing;
}

.market-media-item.is-drag-over {
  box-shadow: inset 0 0 0 2px #07c160;
}

.market-media-item > img,
.market-media-item > video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.market-media-item > i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, .35);
  font-size: 11px;
  font-style: normal;
}

.market-media-item > button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, .62);
  font-size: 17px;
  line-height: 1;
}

/* The remove glyph is visually centered inside its circular media control. */
.market-media-item > button {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  text-align: center !important;
}

.market-media-drag-handle {
  position: absolute;
  right: 5px;
  bottom: 5px;
  z-index: 3;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  background: rgba(0, 0, 0, .58);
  cursor: grab;
  font-size: 15px;
  font-style: normal;
  letter-spacing: -2px;
  line-height: 1;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.market-media-drag-handle:active {
  cursor: grabbing;
  background: rgba(7, 193, 96, .8);
}

.market-media-add {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  border: 1px dashed #bdcbc4;
  color: #718179;
  background: #f5faf7;
}

.market-media-add b {
  font-size: 29px;
  font-weight: 300;
  line-height: 1;
}

.market-media-add small {
  font-size: 10px;
}

.market-media-card > p {
  margin: 10px 0 0;
  color: #87928b;
  font-size: 11px;
  line-height: 1.6;
}

.market-detail-gallery {
  width: 100%;
  overflow: hidden;
  touch-action: pan-y;
  background: #0f1110;
  contain: paint;
}

html[data-theme-color="dark"] .turtle-keeping-days {
  color: var(--muted);
  border-color: #303033;
  background: #202020;
}

/* Mobile ordering uses normal tap controls instead of a JavaScript
   long-press drag that competes with the system's scrolling gesture. */
.market-media-order-controls {
  position: absolute;
  z-index: 3;
  right: 4px;
  bottom: 4px;
  display: flex;
  gap: 3px;
}

.market-media-order-controls button {
  width: 22px;
  height: 22px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, .62);
  font-size: 19px;
  line-height: 1;
}

.market-media-order-controls button:disabled {
  opacity: .38;
}

.market-detail-gallery-track {
  display: flex;
  width: 100%;
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  /* Do not use paint containment here: the track itself is one viewport
     wide, while all subsequent slides live outside that layout box until the
     transform brings them in. The outer gallery owns the only clipping. */
  contain: layout style;
}

.market-detail-gallery.is-dragging {
  cursor: grabbing;
}

/* Keep the expensive compositor layer only while the user is moving the
   gallery or its final momentum is playing.  Keeping a full-width layer for
   every high-resolution listing image while the page sits idle can make the
   next gesture begin with a visible hitch on iOS. */
.market-detail-gallery.is-dragging .market-detail-gallery-track,
.market-detail-gallery.is-settling .market-detail-gallery-track {
  will-change: transform;
}

.market-detail-gallery.is-dragging .market-detail-photo img {
  pointer-events: none;
}

.market-detail-gallery-wrap {
  position: relative;
  background: #0f1110;
}

/* The outermost strip belongs solely to the interactive back gesture. A
   gallery page cannot receive that same horizontal pan, so returning and
   changing a picture never compete for one finger movement. */
.market-detail-edge-back-zone {
  position: absolute;
  z-index: 5;
  inset: 0 auto 0 0;
  width: max(22px, env(safe-area-inset-left));
  touch-action: pan-y;
}

.market-detail-gallery-count {
  position: absolute;
  top: 10px;
  right: 11px;
  z-index: 7;
  min-width: 34px;
  padding: 5px 8px;
  border-radius: 999px;
  color: rgba(255, 255, 255, .96);
  background: rgba(0, 0, 0, .42);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: .02em;
  text-align: center;
  pointer-events: none;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.market-detail-gallery-arrow {
  position: absolute;
  top: 50%;
  z-index: 6;
  width: 38px;
  height: 46px;
  padding: 0;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border-radius: 8px;
  color: #fff;
  background: rgba(0, 0, 0, .42);
  font-size: 34px;
  font-weight: 300;
  line-height: 1;
  transition: opacity .16s ease, background-color .16s ease;
}

.market-detail-gallery-arrow.prev {
  left: 10px;
}

.market-detail-gallery-arrow.next {
  right: 10px;
}

.market-detail-gallery-arrow:active:not(:disabled) {
  background: rgba(7, 193, 96, .72);
}

.market-detail-gallery-arrow:disabled {
  opacity: .28;
}

.market-detail-gallery-track .market-detail-photo {
  flex: 0 0 100%;
  min-width: 0;
  contain: paint;
}

/* Current iOS uses the native scrolling compositor for the product gallery.
   It is the only path that can remain attached to the finger during a fast
   drag while preserving inertial release. */
.market-detail-gallery.uses-native-gallery {
  overflow-x: auto;
  overflow-y: hidden;
  touch-action: pan-x pan-y;
  scroll-snap-type: x mandatory;
  /* User drags stay entirely in WebKit's native scroll pipeline. Buttons
     still request smooth scrolling explicitly from JavaScript. */
  scroll-behavior: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.market-detail-gallery.uses-native-gallery::-webkit-scrollbar {
  display: none;
}

.market-detail-gallery.uses-native-gallery .market-detail-gallery-track {
  width: calc(var(--market-gallery-slide-count, 1) * 100%);
  min-width: 100%;
  transform: none;
}

.market-detail-gallery.uses-native-gallery .market-detail-photo {
  flex: 0 0 calc(100% / var(--market-gallery-slide-count, 1));
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.market-feed-status {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  min-height: 44px;
  padding: 14px 8px 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

.community-feed-status {
  min-height: 44px;
  padding: 14px 8px 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

.community-feed-initial-loading {
  min-height: 260px;
  display: grid;
  place-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.community-feed-initial-loading i {
  width: 24px;
  height: 24px;
  border: 2px solid color-mix(in srgb, var(--accent) 24%, transparent);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: market-publish-spin .8s linear infinite;
}

.market-detail-photo > video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

html[data-theme-color="dark"] .market-media-add {
  border-color: #3a4640;
  color: #a6b1ab;
  background: #202421;
}
.market-detail-stats {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid var(--divider);
  color: #8b949b;
  font-size: 11px;
}

.market-detail-stats i {
  width: 1px;
  height: 11px;
  background: var(--divider);
}

.market-detail-stats b {
  color: #ed4d5c;
  font-weight: 700;
}

/* 经营账本：突出本期盈亏，金额符号与数值始终在同一基线。 */
.ledger-profit-card {
  position: relative;
  min-height: 116px;
  margin-bottom: 10px;
  padding: 17px 18px;
  overflow: hidden;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, #1e6c66, #28a37d);
  box-shadow: 0 12px 25px rgba(33, 126, 96, .16);
}

.ledger-profit-card::after {
  content: "";
  position: absolute;
  right: -31px;
  top: -42px;
  width: 132px;
  height: 132px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
}

.ledger-profit-card.negative {
  background: linear-gradient(135deg, #8a4a54, #d26870);
  box-shadow: 0 12px 25px rgba(149, 70, 79, .16);
}

.ledger-profit-card > div {
  position: relative;
  z-index: 1;
}

.ledger-profit-card span,
.ledger-profit-card small {
  display: block;
  color: rgba(255, 255, 255, .78);
}

.ledger-profit-card span {
  margin-bottom: 4px;
  font-size: 12px;
}

.ledger-profit-card strong {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  width: fit-content;
  max-width: 100%;
  color: #fff !important;
  font-size: clamp(25px, 7vw, 31px) !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.7px;
  line-height: 1.15;
  white-space: nowrap;
}

.ledger-profit-card strong i,
.ledger-profit-card strong em,
.ledger-summary-value i,
.ledger-summary-value em {
  font-style: normal;
}

.ledger-profit-card strong i {
  min-width: .62em;
  font-size: .82em;
  text-align: center;
}

.ledger-profit-card strong em,
.ledger-summary-value em {
  min-width: 0;
  letter-spacing: inherit;
}

.ledger-profit-card small {
  margin-top: 5px;
  font-size: 10px;
}

.ledger-profit-card mark {
  position: absolute;
  right: 17px;
  bottom: 16px;
  z-index: 1;
  min-width: 42px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, .16);
  font-size: 10px;
  text-align: center;
}

.ledger-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.ledger-summary div {
  min-width: 0;
  min-height: 100px;
  padding: 13px 10px !important;
}

.ledger-summary span {
  margin-bottom: 7px !important;
  font-size: 11px !important;
}

.ledger-summary-value {
  min-width: 0;
  display: grid !important;
  grid-template-columns: .62em minmax(0, 1fr);
  align-items: baseline;
  color: #299e78 !important;
  font-size: clamp(13px, 4vw, 18px) !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.45px;
  line-height: 1.2;
  white-space: nowrap;
}

.ledger-summary-value i {
  min-width: .62em;
  font-size: .82em;
  text-align: center;
}

.ledger-summary .purchase .ledger-summary-value,
.ledger-summary .loss .ledger-summary-value {
  color: #e65b67 !important;
}

.ledger-summary small {
  margin-top: 7px !important;
  font-size: 11px;
}

html[data-theme-color="dark"] .ledger-profit-card {
  background: linear-gradient(135deg, #164741, #167155);
  box-shadow: none;
}

html[data-theme-color="dark"] .ledger-profit-card.negative {
  background: linear-gradient(135deg, #512f36, #813c49);
}

html[data-theme-color="dark"] .ledger-summary .sold .ledger-summary-value {
  color: #78dfa9 !important;
}

/* 龟友圈动态详情与媒体预览。 */
.community-moment[data-view-community-post] {
  cursor: pointer;
}

.community-moment[data-view-community-post]:active {
  background: rgba(47, 167, 127, .035);
}

.community-moment[data-view-community-post]:focus-visible {
  outline: 2px solid rgba(47, 167, 127, .45);
  outline-offset: 3px;
}

.community-moment .community-post-media {
  position: relative;
}

.community-post-media .community-feed-media-button {
  position: relative;
  width: 100%;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  display: block;
  border: 0;
  border-radius: inherit;
  background: #101010;
  cursor: zoom-in;
}

.community-post-media .community-feed-media-button .community-media {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.community-post-media .community-feed-media-button.is-video {
  cursor: default;
}

.community-post-media .community-feed-media-button.is-video .community-media {
  pointer-events: auto;
}

/* Feed videos use one stable portrait slot.  Previously the outer card was
 * measured as a landscape box and the native player then measured its own
 * portrait content, which looked like a duplicated/blank page while loading. */
.community-moment .community-post-media.is-video {
  width: min(100%, 280px);
  height: auto;
  max-height: none;
  aspect-ratio: 9 / 16;
  background: #000;
}

.community-moment .community-post-media.is-video .community-feed-media-button,
.community-moment .community-post-media.is-video .inline-video-shell,
.community-moment .community-post-media.is-video video {
  width: 100%;
  height: 100%;
  max-height: none;
}

.community-moment .community-post-media.is-video video {
  object-fit: cover;
  background: #000;
}

.community-post-media .community-feed-media-button.is-playing .community-detail-play-mark,
.community-detail-media-button.is-playing .community-detail-play-mark {
  opacity: 0;
}

.community-post-media .community-media-gallery .community-feed-media-button {
  min-width: 0;
  aspect-ratio: 1 / 1;
  border-radius: 0;
}

.community-detail-page {
  padding: 14px 14px 126px !important;
}

.community-detail-card {
  padding: 16px !important;
}

.community-detail-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.community-detail-head > .community-avatar {
  width: 46px;
  height: 46px;
  border-radius: 6px;
}

.community-detail-head > div:nth-child(2) {
  min-width: 0;
}

.community-detail-head > div:nth-child(2) strong,
.community-detail-head > div:nth-child(2) span {
  display: block;
}

.community-detail-head > div:nth-child(2) strong {
  overflow: hidden;
  color: #576b95;
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-detail-head > div:nth-child(2) span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.community-detail-copy {
  margin: 15px 0 13px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.community-detail-media-button {
  position: relative;
  width: min(100%, 360px);
  min-height: 160px;
  padding: 0;
  overflow: hidden;
  display: block;
  border-radius: 9px;
  background: #101010;
}

.community-detail-media-button .community-media {
  width: 100%;
  max-height: 520px;
  display: block;
  object-fit: contain;
}

.community-detail-media-button.is-video .inline-video-shell,
.community-message-media.is-video .inline-video-shell {
  height: 100%;
}

.community-detail-media-button.is-video .community-media,
.community-message-media.is-video video {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}

.community-detail-play-mark,
.community-detail-zoom-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, .82);
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, .38);
  font-size: 18px;
  font-style: normal;
  line-height: 1;
}

.community-detail-zoom-mark {
  left: auto;
  right: 10px;
  top: auto;
  bottom: 10px;
  width: 30px;
  height: 30px;
  transform: none;
  border: 0;
  border-radius: 7px;
  font-size: 18px;
}

.community-detail-actions {
  margin-top: 14px;
  padding-top: 11px;
  border-top: 1px solid var(--divider);
  display: flex;
  align-items: center;
  gap: 19px;
}

.community-detail-actions button {
  padding: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}

.community-detail-actions button.active {
  color: #e85662;
}

.community-detail-actions .community-post-delete {
  margin-left: auto;
  color: #576b95;
}

.community-detail-social {
  position: relative;
  margin-top: 11px;
  padding: 8px 10px;
  border-radius: 7px;
  background: var(--raised-bg);
}

.community-detail-social p {
  margin: 3px 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}

html[data-theme-color="dark"] .community-moment[data-view-community-post]:active {
  background: rgba(255, 255, 255, .04);
}

/* Breeding records use the same compact card and in-card action language as archives. */
.breeding-row {
  position: relative;
  display: block;
  padding: 12px !important;
  overflow: hidden;
  cursor: pointer;
}

.breeding-row-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding-right: 28px;
}

.breeding-row img,
.breeding-row .breeding-thumb {
  width: 54px;
  height: 54px;
  border-radius: 11px;
}

.breeding-row-copy {
  min-width: 0;
}

.breeding-row-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.breeding-row-heading strong {
  min-width: 0;
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breeding-row-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.breeding-row-copy small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breeding-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--divider);
}

.breeding-stat-grid div {
  min-width: 0;
  padding: 1px 9px;
  border-right: 1px solid var(--divider);
}

.breeding-stat-grid div:first-child { padding-left: 1px; }
.breeding-stat-grid div:last-child { padding-right: 1px; border-right: 0; }

.breeding-stat-grid span,
.breeding-stat-grid strong,
.breeding-stat-grid em {
  display: block;
}

.breeding-stat-grid span {
  color: var(--muted);
  font-size: 11px;
}

.breeding-stat-grid strong {
  margin-top: 3px;
  color: var(--text);
  font-size: 19px;
  font-weight: 800;
  line-height: 1.1;
}

.breeding-stat-grid em {
  display: inline;
  margin-left: 2px;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
}

.breeding-row .breeding-more-btn {
  position: absolute !important;
  top: 9px !important;
  right: 9px !important;
  width: 28px !important;
  min-width: 28px !important;
  height: 28px !important;
  min-height: 28px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 8px !important;
  color: var(--muted) !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: -1px !important;
  z-index: 4;
}

.breeding-row .breeding-more-btn > span {
  display: block;
  transform: translateY(-2px);
}

.breeding-row .breeding-more-btn:active,
.breeding-row.menu-open .breeding-more-btn {
  color: var(--text) !important;
  background: var(--raised-bg) !important;
}

.breeding-row.menu-open { overflow: hidden; }

.breeding-actions-menu {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--divider);
  animation: archive-actions-in .16s ease-out both;
}

.breeding-actions-menu button {
  min-width: 0;
  min-height: 48px;
  padding: 5px 2px;
  border: 0;
  border-radius: 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text);
  background: var(--raised-bg);
  font-size: 12px;
  font-weight: 650;
}

.breeding-actions-menu button:active {
  transform: scale(.97);
  background: rgba(47, 167, 127, .13);
}

.breeding-actions-menu svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.breeding-actions-menu .danger-link {
  color: #e05260;
  background: rgba(224, 82, 96, .08);
}

html[data-theme-color="dark"] .breeding-row .breeding-more-btn {
  color: #8e8e93 !important;
}

html[data-theme-color="dark"] .breeding-actions-menu button {
  color: var(--text);
  background: var(--raised-bg);
}

/* Breeding detail fields need full-width rows so native date and mother selectors never truncate. */
#breedingDetailForm .breeding-form-grid .breeding-date-field,
#breedingDetailForm .breeding-form-grid .breeding-mother-field,
#breedingDetailForm .breeding-form-grid .breeding-pool-field {
  grid-column: 1 / -1 !important;
  grid-template-columns: 72px minmax(0, 1fr) !important;
}

#breedingDetailForm .breeding-form-grid .breeding-date-field .field,
#breedingDetailForm .breeding-form-grid .breeding-mother-field .select,
#breedingDetailForm .breeding-form-grid .breeding-pool-field .select {
  min-width: 0 !important;
  text-align: left !important;
}

.breeding-history-snapshot .breeding-history-photo {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--sea);
  background: linear-gradient(135deg, #eaf2f7, #edf7f1);
  font-size: 15px;
  font-style: normal;
  font-weight: 850;
}

html[data-theme-color="dark"] .breeding-history-snapshot .breeding-history-photo {
  color: #bdebd9;
  background: #252c2a;
}

/* Override the generic memo-form label grid: weekday text belongs in the center of each circle. */
.memo-form .weekday-picker .weekday-chip {
  position: relative !important;
  grid-template-columns: 1fr !important;
  grid-template-rows: 1fr !important;
  align-items: center !important;
  justify-items: center !important;
  gap: 0 !important;
  line-height: 1 !important;
}

.memo-form .weekday-picker .weekday-chip > span {
  grid-area: 1 / 1 !important;
  margin: 0 !important;
  color: inherit !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  text-align: center !important;
  white-space: nowrap !important;
}

/* Dashboard module launcher: four equally weighted cards keep the first screen calm. */
.action-panel.care-action-panel.home-module-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.home-archive-section .filter-dock {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px;
}

.home-archive-section .filter-dock .select {
  min-width: 0;
  padding-right: 25px;
  padding-left: 8px;
  font-size: 13px;
}

.action-panel.care-action-panel.home-module-panel .care-action.pool-action > span {
  color: #246b7a !important;
  background: #edf3f1 !important;
}

.action-panel.care-action-panel.home-module-panel .care-action.growth-action > span {
  color: #6a5fa4 !important;
  background: #f0eefb !important;
}

.growth-page {
  padding-bottom: 28px;
}

.growth-intro {
  margin-bottom: 12px !important;
}

.growth-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  margin-bottom: 12px;
}

.growth-summary > div {
  min-width: 0;
  padding: 10px 5px;
  border-radius: 11px;
  background: var(--raised-bg);
  text-align: center;
}

.growth-summary strong,
.growth-summary span {
  display: block;
}

.growth-summary strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1.1;
}

.growth-summary span {
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.growth-filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 1px 11px;
  scrollbar-width: none;
}

.growth-filter-row::-webkit-scrollbar { display: none; }

.growth-filter-row button {
  flex: 0 0 auto;
  min-height: 31px;
  padding: 0 13px;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.growth-filter-row button.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.growth-update-list {
  display: grid;
  gap: 9px;
}

.growth-update-card {
  width: 100%;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto 13px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  background: var(--card-bg);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.growth-update-card:active { transform: scale(.992); }
/* The embedded timeline is an inert drag surface, never a pressable card. */
.growth-update-card.is-history-interacting { transform: none !important; }

.growth-update-card > img {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--raised-bg);
  object-fit: cover;
}

.growth-update-head {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.growth-update-head strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.growth-update-head span {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 6px;
  background: var(--mint);
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}

.growth-update-main > p {
  overflow: hidden;
  margin: 3px 0 6px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.growth-update-chips {
  display: grid;
  justify-items: start;
  gap: 4px;
}

.growth-update-chips em {
  max-width: 100%;
  overflow: hidden;
  padding: 3px 5px;
  border-radius: 5px;
  background: var(--raised-bg);
  color: var(--text);
  font-size: 10px;
  font-style: normal;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.growth-update-chips .growth-trend {
  width: fit-content;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  white-space: normal;
}

.growth-history-flow {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 1px 4px;
  /* Direct pointer dragging must stay under the finger; smooth scrolling
     would make every drag frame visibly lag behind. */
  scroll-behavior: auto;
  overscroll-behavior-x: contain;
  /* Vertical gestures stay native; this strip owns horizontal drags so its
     cards follow the finger instead of competing with WebKit's nested scroll. */
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  scrollbar-width: none;
}

.growth-history-flow:active { cursor: grabbing; }
.growth-history-flow::-webkit-scrollbar { display: none; }

.growth-history-track {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: max-content;
  min-width: 100%;
}

.growth-history-step {
  flex: 0 0 214px;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--card-border);
  border-radius: 9px;
  background: var(--raised-bg);
}

.growth-history-step-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.growth-history-step-head strong {
  font-size: 10px;
  line-height: 1.2;
}

.growth-history-step-head small {
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.growth-history-delete {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-left: 1px;
  padding: 0;
  border: 1px solid var(--card-border);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 14px;
  text-align: center;
}

.growth-history-delete:hover,
.growth-history-delete:focus-visible {
  border-color: #db5f61;
  background: rgba(219, 95, 97, .12);
  color: #e27678;
  outline: none;
}

.growth-history-pair {
  display: grid;
  /* Give the "更新后" column a little more room and pull the green change
     arrow closer to the left-side value, so the comparison reads as one flow. */
  grid-template-columns: minmax(66px, .78fr) 15px minmax(0, 1.22fr);
  gap: 4px;
  align-items: center;
}

.growth-history-pair > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.growth-history-pair span {
  color: var(--muted);
  font-size: 9px;
}

.growth-history-pair b {
  overflow: hidden;
  color: var(--text);
  font-size: 10px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.growth-history-pair > i {
  color: var(--green);
  font-size: 15px;
  font-style: normal;
  line-height: 1;
  text-align: center;
}

.growth-history-interval {
  flex: 0 0 44px;
  display: grid;
  place-content: center;
  gap: 2px;
  color: var(--green);
  text-align: center;
}

.growth-history-interval small {
  color: var(--green);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.growth-history-interval b {
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
}

.growth-trend > strong {
  margin-right: 2px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.growth-trend-value {
  color: var(--text);
  font-weight: 750;
  white-space: nowrap;
}

.growth-trend-transition {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 0 1px;
  color: var(--muted);
  white-space: nowrap;
}

.growth-trend-transition i {
  color: var(--green);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
}

.growth-trend-transition b {
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
}

.growth-update-card > b {
  color: var(--muted);
  font-size: 21px;
  font-weight: 400;
}

.growth-update-timing {
  display: grid;
  gap: 3px;
  min-width: 88px;
  padding: 6px 7px;
  border-left: 1px solid var(--card-border);
  color: var(--muted);
  text-align: right;
}

.growth-update-timing span,
.growth-update-timing small {
  display: block;
  white-space: nowrap;
}

.growth-update-timing span {
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.growth-update-timing small {
  font-size: 10px;
  line-height: 1.25;
}

html[data-theme-color="dark"] .action-panel.care-action-panel.home-module-panel .care-action.growth-action > span {
  color: #c1b9f0 !important;
  background: #2a2936 !important;
}

html[data-theme-color="dark"] .growth-update-head span {
  background: #21352d;
  color: #9fdac0;
}

@media (max-width: 440px) {
  .growth-update-card {
    grid-template-columns: 46px minmax(0, 1fr) 11px;
    gap: 8px;
  }

  .growth-update-card > img {
    width: 46px;
    height: 46px;
    border-radius: 11px;
  }

  .growth-update-timing {
    grid-column: 2 / 4;
    grid-row: 2;
    display: flex;
    justify-content: flex-start;
    gap: 7px;
    min-width: 0;
    padding: 0;
    border: 0;
    text-align: left;
  }

  .growth-update-timing span,
  .growth-update-timing small {
    font-size: 10px;
  }

  .growth-update-card > b {
    grid-column: 3;
    grid-row: 1;
  }
}

.turtle-pools-intro {
  margin-bottom: 12px !important;
}

.turtle-pool-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 12px;
  padding: 12px 0;
}

.turtle-pool-summary > div {
  min-width: 0;
  padding: 0 16px;
  border-right: 1px solid var(--divider);
}

.turtle-pool-summary > div:last-child { border-right: 0; }

.turtle-pool-summary strong,
.turtle-pool-summary span { display: block; }

.turtle-pool-summary strong {
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
}

.turtle-pool-summary span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.turtle-pool-list {
  display: grid;
  gap: 10px;
}

.turtle-pool-row {
  padding: 13px 14px !important;
  cursor: pointer;
}

.turtle-pool-row:active { transform: scale(.985); }

.turtle-pool-row-head {
  min-width: 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.turtle-pool-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: var(--sea);
  background: #eaf2f7;
  font-size: 16px;
  font-weight: 800;
}

.turtle-pool-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.turtle-pool-title strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.turtle-pool-title span {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 5px;
  color: var(--sea);
  background: rgba(36, 107, 122, .1);
  font-size: 10px;
  font-weight: 700;
}

.turtle-pool-row small {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.turtle-pool-row-head > b {
  color: var(--text);
  font-size: 21px;
  font-weight: 800;
  line-height: 1;
  text-align: right;
}

.turtle-pool-row-head > b em {
  margin-left: 2px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
}

.turtle-pool-row > p {
  margin: 10px 0 0;
  padding-top: 9px;
  border-top: 1px solid var(--divider);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.pool-form {
  display: grid;
  gap: 13px;
  padding: 15px !important;
}

.pool-form > label {
  min-width: 0;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.pool-form > label > span {
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}

.pool-form .field,
.pool-form .select {
  min-width: 0;
  width: 100%;
}

.pool-type-field > span {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
}

.pool-type-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.pool-type-choices button {
  min-width: 0;
  min-height: 44px;
  padding: 0 4px;
  border: 1px solid var(--divider);
  border-radius: 9px;
  color: var(--muted);
  background: var(--raised-bg);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.pool-type-choices button.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(47, 167, 127, .1);
}

.pool-dimension-section > small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.pool-dimension-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.pool-dimension-grid label {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.pool-dimension-grid label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.pool-dimension-grid .field {
  min-width: 0;
  padding-right: 7px !important;
  padding-left: 7px !important;
  font-size: 13px;
  text-align: center;
}

.pool-form .pool-note {
  display: block;
}

.pool-note > span {
  display: block;
  margin-bottom: 7px;
}

.pool-note textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
}

.pool-delete-button {
  min-height: 44px;
  border: 1px solid rgba(224, 82, 96, .22);
  border-radius: 10px;
  color: #df5260;
  background: rgba(224, 82, 96, .07);
  font-weight: 650;
}

html[data-theme-color="dark"] .turtle-pool-mark {
  color: #b5ded0;
  background: #25302d;
}

html[data-theme-color="dark"] .turtle-pool-title span {
  color: #b5ded0;
  background: #25302d;
}

html[data-theme-color="dark"] .pool-type-choices button {
  color: var(--muted);
  background: #202020;
  border-color: #303033;
}

html[data-theme-color="dark"] .pool-type-choices button.active {
  color: #b5ded0;
  background: #17352a;
  border-color: #39735e;
}

/* 社交资料入口、聊天商品条与数字胶囊统一对齐。 */
.community-profile-avatar-button {
  width: 46px;
  height: 46px;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: transparent;
}

.community-profile-avatar-button .community-avatar {
  width: 100% !important;
  height: 100% !important;
  display: grid;
  place-items: center;
  border-radius: inherit !important;
  object-fit: cover;
}

.community-profile-name-button,
.community-detail-author-button,
.community-chat-user-link {
  min-width: 0;
  padding: 0;
  color: inherit;
  text-align: left;
  background: transparent;
}

.community-profile-name-button {
  overflow: hidden;
  color: #576b95;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.3;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-detail-author-button {
  display: grid;
  justify-items: start;
  gap: 4px;
}

.community-detail-author-button strong,
.community-detail-author-button span {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-detail-author-button strong {
  color: #576b95;
  font-size: 15px;
}

.community-detail-author-button span {
  color: var(--muted);
  font-size: 11px;
}

.community-chat-user-link {
  overflow: hidden;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-chat-product-context {
  position: fixed;
  top: var(--fixed-topbar-height);
  left: 50%;
  z-index: 5900;
  width: min(430px, 100vw);
  padding: 7px 0;
  transform: translateX(-50%);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--divider);
  box-shadow: 0 5px 13px rgba(31, 42, 51, .05);
}

.community-chat-product-context .community-chat-product-strip {
  width: calc(100% - 28px);
  min-height: 72px;
  margin: 0 14px;
}

.community-chat-page.has-chat-product-context {
  padding-top: 93px !important;
}

.keyboard-open .bottom-nav {
  display: none !important;
}

.section-title > small,
.following-profile-head > button,
.following-user-card > b {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

.following-user-card > b {
  width: 26px;
  height: 26px;
  padding: 0;
  border-radius: 50%;
}

.following-profile-head > button {
  min-width: 58px;
}

.ledger-row-main {
  gap: 6px;
}

.ledger-row-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 780;
}

.ledger-turtle-meta {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ledger-turtle-meta span {
  min-height: 20px;
  max-width: 100%;
  padding: 3px 7px;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid #dceaf0;
  border-radius: 999px;
  color: #718593;
  background: #f2f8fa;
  font-size: 11px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme-color="dark"] .ledger-turtle-meta span {
  color: #a4b6c2;
  border-color: #303d42;
  background: #1d282c;
}

html[data-theme-color="dark"] .community-chat-product-context {
  background: #171717;
  border-color: #303033;
}

@media (max-width: 360px) {
  .action-panel.care-action-panel.home-module-panel .care-action {
    min-height: 96px !important;
    padding-right: 4px !important;
    padding-left: 4px !important;
  }

  .action-panel.care-action-panel.home-module-panel .care-action > small {
    font-size: 10px !important;
  }

  .pool-form > label {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 9px;
  }
}

/* Keep the multi-media composer compact after the legacy compose rules. */
.community-compose-page .community-draft-media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 112px));
  gap: 9px;
  align-items: start;
}

.community-compose-page .community-draft-media-item,
.community-compose-page .community-media-add {
  width: 112px;
  height: 112px;
  min-height: 112px;
}

.community-compose-page .community-media-add {
  display: grid;
  place-items: center;
}

.community-post-media .community-media-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  width: 100%;
}

.community-post-media .community-media-gallery .community-media {
  width: 100%;
  height: auto;
  max-height: none;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.community-detail-media-gallery.is-gallery .community-detail-media-button .community-media {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
}

@media (max-width: 390px) {
  .community-compose-page .community-draft-media-grid {
    grid-template-columns: repeat(3, minmax(0, 96px));
  }

  .community-compose-page .community-draft-media-item,
  .community-compose-page .community-media-add {
    width: 96px;
    height: 96px;
    min-height: 96px;
  }
}

/* 最终覆盖：账本列表与看板档案卡采用同一信息层级。 */
.ledger-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.ledger-summary .other .ledger-summary-value,
.ledger-row .ledger-amount.other {
  color: var(--danger) !important;
}

.ledger-row .ledger-inline-type.other {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid var(--divider);
  border-radius: 999px;
  color: var(--muted);
  background: var(--raised-bg);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
}

html[data-theme-color="dark"] .ledger-row .ledger-inline-type.other {
  color: #b7d6c9 !important;
  border-color: #31473e !important;
  background: #20342b !important;
}

.ledger-row {
  grid-template-columns: 54px minmax(0, 1fr) auto !important;
  min-height: 0;
  gap: 10px;
  padding: 12px 12px 38px !important;
}

.ledger-row-main {
  display: grid;
  align-content: center;
  gap: 5px;
}

.ledger-row-title-line {
  min-width: 0;
  display: grid !important;
  align-content: start;
  gap: 2px;
}

.ledger-row-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: nowrap;
}

.ledger-row-title .ledger-title-text {
  min-width: 0;
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 780;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-row .ledger-inline-type.purchase,
.ledger-row .ledger-inline-type.sold,
.ledger-row .ledger-inline-type.loss {
  flex: 0 0 auto;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid var(--divider);
  border-radius: 999px;
  color: var(--muted);
  background: var(--raised-bg);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
}

.ledger-row-species {
  min-width: 0;
  margin: 0 !important;
  overflow: hidden;
  color: var(--muted) !important;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-row .ledger-turtle-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.ledger-row .ledger-turtle-meta span {
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid var(--divider);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  background: var(--raised-bg);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.ledger-row .muted {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.ledger-row .ledger-amount {
  padding-top: 27px;
  align-self: start;
  justify-self: end;
  font-size: 16px;
}

.ledger-row .ledger-amount.sold { color: var(--aqua) !important; }
.ledger-row .ledger-amount.purchase,
.ledger-row .ledger-amount.loss { color: var(--danger) !important; }

html[data-theme-color="dark"] .ledger-row .ledger-inline-type.purchase,
html[data-theme-color="dark"] .ledger-row .ledger-inline-type.sold,
html[data-theme-color="dark"] .ledger-row .ledger-inline-type.loss,
html[data-theme-color="dark"] .ledger-row .ledger-turtle-meta span {
  color: var(--muted) !important;
  border-color: #303033 !important;
  background: #202020 !important;
}
/* Dashboard archive: long-press a turtle row to arrange the saved default order. */
[data-turtle-reorder-list] > [data-reorder-turtle] {
  cursor: grab;
  touch-action: pan-y;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

[data-turtle-reorder-list] > [data-reorder-turtle].is-turtle-dragging {
  cursor: grabbing;
  opacity: .24;
  transform: scale(.985);
  box-shadow: none;
}

.turtle-row-drag-preview {
  position: fixed !important;
  z-index: 10070;
  margin: 0 !important;
  pointer-events: none;
  transform-origin: top left;
  will-change: transform, opacity;
  cursor: grabbing;
  opacity: .98;
  box-shadow: 0 18px 38px rgba(0, 0, 0, .28) !important;
}

.dashboard-turtle-reordering,
.dashboard-turtle-reordering body {
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
}

.dashboard-turtle-reordering [data-turtle-reorder-list] {
  touch-action: none;
}

html[data-theme-color="dark"] [data-turtle-reorder-list] > [data-reorder-turtle].is-turtle-dragging {
  border-color: rgba(7, 193, 96, .22);
}

html[data-theme-color="dark"] .turtle-row-drag-preview {
  border-color: rgba(7, 193, 96, .52) !important;
  box-shadow: 0 18px 38px rgba(0, 0, 0, .48), 0 0 0 1px rgba(7, 193, 96, .18) !important;
}

/* Admin-only operations centre. */
.operations-tabs { margin-bottom: 14px; }

.operations-month-picker,
.operations-date-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 13px 15px;
}

.operations-month-picker span,
.operations-month-picker strong,
.operations-date-picker span,
.operations-date-picker strong { display: block; }
.operations-month-picker span,
.operations-date-picker span { margin-bottom: 3px; color: var(--muted); font-size: 11px; }
.operations-month-picker .select { width: auto; min-width: 136px; margin: 0; }
.operations-date-picker .field { width: auto; min-width: 148px; margin: 0; padding: 8px 10px; }

.operations-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.operations-page .section-title { flex-wrap: wrap; row-gap: 8px; }
.operations-page .section-title > small { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }

.operations-metric {
  min-width: 0;
  padding: 15px;
}

.operations-metric span,
.operations-metric small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.operations-metric strong {
  display: block;
  margin: 8px 0 5px;
  overflow: hidden;
  color: var(--text);
  font-size: 22px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.operations-note { margin-top: 12px; padding: 15px; }
.operations-note p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

.operations-chat-list { display: grid; gap: 12px; }
.operations-chat-card { padding: 14px; overflow: hidden; }
.operations-chat-card > header { display: flex; justify-content: space-between; gap: 12px; }
.operations-chat-card > header strong,
.operations-chat-card > header small { display: block; }
.operations-chat-card > header small { margin-top: 4px; color: var(--muted); font-size: 12px; }

.operations-product {
  display: grid;
  gap: 3px;
  margin: 12px 0;
  padding: 10px 11px;
  border: 1px solid var(--divider);
  border-radius: 12px;
  background: var(--raised-bg);
}

.operations-product b { color: var(--aqua); font-size: 11px; }
.operations-product strong { font-size: 14px; }
.operations-product span,
.operations-no-product { margin: 0; color: var(--muted); font-size: 12px; }

.operations-chat-thread {
  display: grid;
  gap: 8px;
  max-height: 440px;
  overflow: auto;
  padding-right: 2px;
}

.operations-chat-message { display: grid; gap: 3px; max-width: 88%; }
.operations-chat-message.right { justify-self: end; text-align: right; }
.operations-chat-message small { color: var(--muted); font-size: 11px; }
.operations-chat-message p { margin: 0; padding: 8px 10px; border-radius: 11px; background: var(--raised-bg); font-size: 13px; line-height: 1.45; text-align: left; white-space: pre-wrap; word-break: break-word; }
.operations-chat-message.right p { background: rgba(18, 182, 140, .14); }
.operations-chat-message em { color: var(--muted); font-size: 11px; font-style: normal; }

.operations-simple-list { display: grid; gap: 9px; margin-top: 10px; }
.operations-simple-row { display: grid; gap: 4px; padding: 13px 14px; }
.operations-simple-row strong { font-size: 14px; }
.operations-simple-row span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.operations-usage-row { display: grid; gap: 10px; padding: 13px 14px; }
.operations-usage-row header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.operations-usage-row header > div { display: grid; gap: 4px; min-width: 0; }
.operations-usage-row header strong { font-size: 14px; }
.operations-usage-row header small { color: var(--muted); font-size: 12px; }
.operations-usage-row header > b { color: var(--accent); font-size: 13px; white-space: nowrap; }
.operations-module-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.operations-module-chips span { padding: 4px 7px; border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 11px; }
.operations-feedback-card { display: grid; gap: 8px; padding: 14px; }
.operations-feedback-card > p { margin: 0; color: var(--text); font-size: 14px; line-height: 1.5; white-space: pre-wrap; }
.operations-feedback-card > small { color: var(--muted); font-size: 12px; }
.operations-feedback-card form { display: grid; gap: 8px; margin-top: 3px; }
.operations-feedback-card textarea { min-height: 64px; padding: 10px; border: 1px solid var(--divider); border-radius: 10px; color: var(--text); background: var(--raised-bg); font: inherit; font-size: 13px; resize: vertical; }
.operations-feedback-card .secondary { justify-self: start; }

@media (max-width: 350px) {
  .operations-metric strong { font-size: 19px; }
}
/* Growth rewards: turn each saved measurement into an immediately useful, shareable result. */
.reward-page { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.reward-celebration { display: flex; align-items: center; gap: 14px; margin: 8px 2px 18px; }
.reward-celebration > span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: #fff; background: #16806a; font-size: 23px; box-shadow: 0 8px 20px rgba(22,128,106,.24); }
.reward-celebration p, .reward-celebration h2 { margin: 0; }
.reward-celebration p { color: #16806a; font-size: 13px; font-weight: 700; }
.reward-celebration h2 { margin-top: 3px; font-size: 20px; }
.turtle-profile-card { overflow: hidden; color: #f8f6ee; border-radius: 26px; padding: 22px; background: radial-gradient(circle at 95% 0, rgba(255,255,255,.17), transparent 32%), linear-gradient(145deg,#0e6755,#153f37); box-shadow: 0 18px 42px rgba(13,73,61,.24); }
.turtle-profile-card header { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 16px; }
.turtle-profile-card header small, .turtle-profile-card header p { color: #b9d8d0; }
.turtle-profile-card h1, .turtle-profile-card p { margin: 0; }
.turtle-profile-card h1 { margin: 7px 0 3px; font-size: 29px; }
.turtle-profile-card header > b { min-width: 62px; text-align: center; color: #f4cf78; font-size: 28px; }
.turtle-profile-card header > b small { display: block; font-size: 10px; font-weight: 500; }
.turtle-profile-card > img { width: 100%; height: 245px; object-fit: cover; border-radius: 19px; background: #d7e5df; }
.reward-card-stats { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 8px; margin-top: 18px; }
.reward-card-stats span { min-width: 0; }
.reward-card-stats small, .reward-card-stats strong { display: block; }
.reward-card-stats small { margin-bottom: 5px; color: #9fc8bc; font-size: 10px; }
.reward-card-stats strong { white-space: nowrap; font-size: 14px; }
.turtle-profile-card footer { display: flex; justify-content: space-between; padding-top: 18px; margin-top: 16px; border-top: 1px solid rgba(255,255,255,.15); color: #c9ddd8; font-size: 11px; }
.turtle-profile-card footer b { color: #f4cf78; }
.reward-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: 15px 0 22px; }
.reward-actions button { margin: 0; min-height: 46px; }
.next-growth-card { position: relative; display: grid; grid-template-columns: 82px 1fr; gap: 16px; padding: 18px; }
.next-growth-date { display: grid; place-content: center; text-align: center; border-radius: 16px; background: #e6f3ee; color: #116451; }
.next-growth-date strong { font-size: 18px; }.next-growth-date span { margin-top: 4px; font-size: 9px; }
.next-growth-card h3, .next-growth-card p { margin: 2px 0; }.next-growth-card p { color: var(--muted, #68736f); font-size: 12px; line-height: 1.55; }
.next-growth-card > div > small { color: #16806a; font-weight: 700; }
.reminder-on { position: absolute; right: 14px; top: 14px; padding: 4px 7px; border-radius: 99px; color: #14705c; background: #e8f5f0; font-size: 9px; }
.growth-report-card, .reward-preview-lock { margin-top: 14px; padding: 20px; }
.growth-report-heading { display: flex; justify-content: space-between; align-items: start; }.growth-report-heading h3 { margin: 4px 0 0; }.growth-report-heading > strong { color: #16806a; font-size: 24px; }
.reward-sparkline { width: 100%; height: 112px; margin-top: 12px; overflow: visible; }.reward-sparkline path { stroke: #dce9e4; stroke-width: 2; }.reward-sparkline polyline { fill: none; stroke: #16806a; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }.reward-sparkline circle { fill: #f3c761; stroke: #fff; stroke-width: 3; }
.growth-report-legend { display: flex; justify-content: space-between; color: #77827e; font-size: 11px; }
.photo-compare { display: grid; grid-template-columns: 1fr 28px 1fr; align-items: center; gap: 8px; margin-top: 18px; }.photo-compare figure { margin: 0; }.photo-compare img { width: 100%; height: 118px; object-fit: cover; border-radius: 14px; }.photo-compare figcaption { margin-top: 5px; color: #77827e; font-size: 10px; text-align: center; }.photo-compare > b { text-align: center; color: #16806a; }
.reward-preview-lock { text-align: center; background: linear-gradient(145deg,#fffaf0,#f6f1e7); }.reward-preview-lock span { color: #a06c12; font-size: 11px; font-weight: 700; }.reward-preview-lock h3 { margin: 9px 0 6px; font-size: 17px; }.reward-preview-lock p { margin: 0; color: #7e776a; font-size: 12px; }
.reward-finish { display: block; margin: 20px auto 0; }
html[data-theme-color="dark"] .next-growth-date { background: #173f37; color: #9ed6c7; }
html[data-theme-color="dark"] .reward-preview-lock { background: linear-gradient(145deg,#2d2b26,#24231f); }

/* Reward page polish: a focused, phone-first success flow with a restrained desktop width. */
.reward-page {
  width: min(100%, 680px);
  margin-inline: auto;
  padding-top: 18px;
}
.reward-celebration {
  gap: 12px;
  padding: 0 4px;
  margin: 0 0 16px;
}
.reward-celebration > span {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  font-size: 20px;
}
.reward-celebration p { font-size: 11px; letter-spacing: .03em; }
.reward-celebration h2 { margin-top: 1px; font-size: 19px; line-height: 1.25; }
.reward-celebration small { display: block; margin-top: 3px; color: #7b8984; font-size: 11px; }
.turtle-profile-card {
  padding: 20px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 24px;
  background: radial-gradient(circle at 95% 0, rgba(255,255,255,.15), transparent 32%), linear-gradient(145deg,#0f6b58,#123f36);
  box-shadow: 0 16px 36px rgba(8,55,46,.2);
}
.turtle-profile-card header { margin-bottom: 14px; }
.turtle-profile-card h1 { margin-top: 5px; font-size: clamp(25px, 5vw, 31px); }
.turtle-profile-card > img {
  height: auto;
  max-height: 340px;
  aspect-ratio: 16 / 9;
  border-radius: 17px;
  object-position: center;
}
.reward-card-stats { margin-top: 16px; padding: 0 2px; }
.turtle-profile-card footer { padding-top: 14px; margin-top: 14px; }
.reward-actions { grid-template-columns: 1fr 1fr; margin: 14px 0 16px; }
.reward-actions button { display: flex; align-items: center; justify-content: center; gap: 7px; border-radius: 13px; font-weight: 700; }
.reward-actions .primary { background: #14745f; box-shadow: 0 7px 17px rgba(20,116,95,.18); }
.reward-actions .secondary { border: 1px solid #cbd8d3; background: transparent; color: #36564d; }
.reward-actions button span { font-size: 18px; line-height: 1; }
.next-growth-card {
  grid-template-columns: 92px 1fr;
  align-items: stretch;
  gap: 17px;
  padding: 15px;
  border-color: rgba(17,101,82,.12);
}
.next-growth-date { min-height: 88px; }
.next-growth-date strong { font-size: 22px; line-height: 1; }
.next-growth-date strong small { font-size: 11px; font-weight: 600; }
.next-growth-date span { margin-top: 7px; font-size: 10px; }
.next-growth-copy { min-width: 0; padding: 2px 0; }
.next-growth-copy > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.next-growth-copy > div > small { color: #14745f; font-size: 11px; font-weight: 700; }
.next-growth-card h3 { margin: 6px 0 4px; padding-right: 0; font-size: 16px; line-height: 1.35; }
.next-growth-card p { margin: 0; font-size: 11px; line-height: 1.5; }
.reminder-on {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  white-space: nowrap;
  font-size: 9px;
  font: inherit;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}
.reminder-on i { width: 5px; height: 5px; border-radius: 50%; background: #1b9a7d; box-shadow: 0 0 0 3px rgba(27,154,125,.12); }
.reminder-on:active { transform: scale(.96); }
.reminder-on:focus-visible { outline: 2px solid #16866c; outline-offset: 2px; }
.reminder-on.is-off { color: #7c8783; background: #edf1ef; border-color: #dfe6e3; }
.reminder-on.is-off i { background: #9aa49f; box-shadow: none; }
.reward-preview-lock { padding: 17px 18px 16px; text-align: left; border-color: rgba(166,119,30,.12); }
.reward-lock-head { display: flex; align-items: center; justify-content: space-between; }
.reward-lock-head > span { padding: 4px 8px; border-radius: 99px; background: rgba(177,128,38,.1); }
.reward-lock-head > small { color: #8b8375; font-size: 10px; }
.reward-preview-lock h3 { margin: 12px 0 10px; font-size: 16px; }
.reward-unlock-list { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.reward-unlock-list > span { display: flex; align-items: center; gap: 6px; padding: 9px 8px; border: 1px solid rgba(158,119,48,.13); border-radius: 11px; background: rgba(255,255,255,.48); color: #5d574d; font-size: 10px; }
.reward-unlock-list i { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 6px; background: #f3ead7; color: #a16e15; font-style: normal; }
.reward-preview-lock p { margin-top: 10px; text-align: center; font-size: 10px; }
.reward-finish { margin-top: 17px; padding: 10px 18px; font-size: 12px; }
html[data-theme-color="dark"] .reward-page .turtle-profile-card {
  background: radial-gradient(circle at 95% 0, rgba(255,255,255,.12), transparent 32%), linear-gradient(145deg,#0f604f,#123b33);
  border-color: rgba(255,255,255,.1);
}
html[data-theme-color="dark"] .reward-celebration small { color: #8f9c97; }
html[data-theme-color="dark"] .reward-actions .secondary { border-color: #35433f; color: #d0d9d6; background: #191c1b; }
html[data-theme-color="dark"] .next-growth-card { border-color: #293632; background: #171a19; }
html[data-theme-color="dark"] .reminder-on.is-off { color: #919b97; background: #252a28; border-color: #333a37; }
html[data-theme-color="dark"] .reward-preview-lock { border-color: #38352d; background: linear-gradient(145deg,#211f1b,#191918); }
html[data-theme-color="dark"] .reward-unlock-list > span { border-color: #3a352b; background: #24221e; color: #d1cbc0; }
html[data-theme-color="dark"] .reward-unlock-list i { background: #373025; color: #e1b760; }
@media (max-width: 420px) {
  .reward-page { padding-top: 13px; }
  .turtle-profile-card { padding: 17px; border-radius: 21px; }
  .turtle-profile-card > img { aspect-ratio: 4 / 3; }
  .reward-card-stats { grid-template-columns: 1.15fr .85fr .95fr; gap: 5px; }
  .reward-card-stats strong { font-size: 12px; }
  .next-growth-card { grid-template-columns: 78px 1fr; gap: 12px; }
  .next-growth-date { min-height: 84px; }
  .next-growth-card h3 { font-size: 14px; }
  .reward-unlock-list > span { flex-direction: column; justify-content: center; text-align: center; }
}

/* Persistent growth chart in the archive detail, directly above the timeline. */
.detail-growth-chart {
  margin-top: 14px;
  padding: 18px 18px 14px;
  overflow: hidden;
}
.detail-growth-chart > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.detail-growth-chart > header small { color: #7c8884; font-size: 10px; }
.detail-growth-chart > header h3 { margin: 3px 0 0; font-size: 18px; }
.detail-chart-legend { display: flex; align-items: center; gap: 14px; padding-top: 7px; }
.detail-chart-legend span { display: inline-flex; align-items: center; gap: 6px; color: #68746f; font-size: 10px; }
.detail-chart-legend span::before { content: ""; width: 15px; height: 3px; border-radius: 99px; background: currentColor; }
.detail-chart-legend .weight { color: #16a47f; }
.detail-chart-legend .length { color: #d59c2f; }
.detail-chart-summary { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; margin-top: 15px; }
.detail-chart-summary > span { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 1px 8px; padding: 10px 12px; border-radius: 12px; background: #f4f7f6; }
.detail-chart-summary small { grid-column: 1 / -1; color: #7a8581; font-size: 9px; }
.detail-chart-summary strong { font-size: 17px; }
.detail-chart-summary em { color: #8b9692; font-size: 10px; font-style: normal; }
.detail-chart-summary em.up { color: #15866b; }
.detail-chart-canvas { margin: 8px -5px 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
.detail-chart-canvas::-webkit-scrollbar { display: none; }
.detail-chart-canvas svg { display: block; width: 100%; min-width: 480px; height: auto; }
.detail-chart-grid path { fill: none; stroke: #e3eae7; stroke-width: 1; stroke-dasharray: 4 6; }
.detail-chart-line { fill: none; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.detail-chart-line.weight { stroke: #16a47f; }
.detail-chart-line.length { stroke: #d59c2f; }
.detail-chart-point { stroke: #fff; stroke-width: 3; }
.detail-chart-point.weight { fill: #16a47f; }
.detail-chart-point.length { fill: #d59c2f; }
.detail-chart-canvas text { fill: #8b9692; font: 11px system-ui,sans-serif; }
.detail-growth-chart > footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 11px; border-top: 1px solid #edf1ef; color: #75817c; font-size: 10px; }
.detail-growth-chart > footer strong { color: #315048; font-size: 11px; }
.detail-growth-chart > footer button { border: 0; color: #fff; background: #16866c; border-radius: 99px; padding: 7px 12px; font-size: 10px; font-weight: 700; }
html[data-theme-color="dark"] .detail-growth-chart { border-color: #29322f; background: #171a19; }
html[data-theme-color="dark"] .detail-chart-summary > span { background: #202523; }
html[data-theme-color="dark"] .detail-chart-grid path { stroke: #303835; }
html[data-theme-color="dark"] .detail-chart-point { stroke: #171a19; }
html[data-theme-color="dark"] .detail-growth-chart > footer { border-color: #2a312f; }
html[data-theme-color="dark"] .detail-growth-chart > footer strong { color: #d0dad6; }
.turtle-row .archive-turtle-menu,
html[data-theme-color="dark"] .turtle-row .archive-turtle-menu { grid-template-columns: repeat(6,minmax(0,1fr)) !important; }
.shared-turtle-badge { align-self: center; padding: 5px 9px; border-radius: 99px; color: #16866c; background: #e5f4ef; font-size: 10px; font-weight: 700; }
.shared-turtle-note { margin: 13px 0 2px; color: #7d8985; font-size: 10px; text-align: center; }
html[data-theme-color="dark"] .shared-turtle-badge { color: #85d1bc; background: #173b32; }
@media (max-width: 430px) {
  .turtle-row .archive-turtle-menu,
  html[data-theme-color="dark"] .turtle-row .archive-turtle-menu { grid-template-columns: repeat(3,minmax(0,1fr)) !important; }
}
@media (max-width: 520px) {
  .detail-growth-chart { padding: 16px 14px 12px; }
  .detail-chart-canvas svg { min-width: 520px; }
  .detail-growth-chart > footer:not(.is-empty) { align-items: flex-start; flex-direction: column; gap: 4px; }
}

/* 百度贴吧式帖子流：作者、正文、媒体、互动依次纵向阅读。 */
.community-page .forum-thread-card {
  display: block;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 20px;
  background: var(--card-bg);
  box-shadow: 0 4px 18px rgba(18,42,34,.065);
}

.community-page .forum-thread-author {
  min-height: 0;
  padding: 10px 14px 0;
  display: grid;
  grid-template-columns: 40px minmax(0,1fr) auto auto;
  align-items: center;
  gap: 10px;
}

.community-page .forum-thread-author > button:first-child {
  width: 40px;
  height: 40px;
  padding: 0;
  overflow: hidden;
  border-radius: 50%;
  background: var(--raised-bg);
}

.community-page .forum-thread-author .forum-thread-avatar {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: none;
}

.community-page .forum-thread-author-copy { min-width: 0; display: grid; gap: 3px; }
.community-page .forum-thread-author strong { overflow: hidden; color: var(--text); font-size: 14px; font-weight: 730; text-overflow: ellipsis; white-space: nowrap; }
.community-page .forum-thread-author span { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.community-page .forum-thread-follow {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 15px;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 9%, var(--raised-bg));
  font-size: 12px;
  font-weight: 700;
}
.community-page .forum-thread-follow.active { color: var(--muted); background: var(--raised-bg); }
.community-page .forum-thread-more { width: 30px; height: 30px; padding: 0; color: var(--muted); background: transparent; font-size: 13px; letter-spacing: 1px; }
.community-page .forum-thread-more-wrap { position: relative; width: 30px; height: 30px; }

.community-page .forum-thread-main { padding: 0 14px 13px; }
.community-page .forum-thread-badges:empty { display: none; }
.community-page .forum-thread-card h3 {
  margin: 0 0 7px;
  color: var(--text);
  font-size: 18px;
  font-weight: 780;
  line-height: 1.42;
  letter-spacing: -.018em;
}
.community-page .forum-thread-card p {
  margin: 0;
  color: color-mix(in srgb, var(--text) 84%, var(--muted));
  font-size: 15px;
  line-height: 1.62;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.community-page .forum-thread-media {
  width: 100%;
  margin-top: 11px;
  overflow: hidden;
  border-radius: 14px;
  background: var(--raised-bg);
}
.community-page .forum-thread-media > .community-feed-media-button,
.community-page .forum-thread-media > .community-feed-media-button .community-media,
.community-page .forum-thread-media > .community-feed-media-button .inline-video-shell {
  width: 100%;
}
.community-page .forum-thread-media.is-single > .community-feed-media-button {
  display: block;
  max-width: 100%;
  max-height: 410px;
  overflow: hidden;
  border-radius: inherit;
  background: #0e1110;
}
.community-page .forum-thread-media.is-single img.community-media {
  width: 100%;
  max-height: 410px;
  display: block;
  object-fit: cover;
}
.community-page .forum-thread-media.is-single video.community-media {
  width: 100%;
  max-height: 410px;
  display: block;
  object-fit: contain;
}
.community-page .forum-thread-media .community-media-gallery {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 3px;
  border-radius: inherit;
}
.community-page .forum-thread-media .community-media-gallery .community-feed-media-button {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 0;
  background: #111;
}
.community-page .forum-thread-media .community-media-gallery .community-media { width: 100%; height: 100%; object-fit: cover; }
.community-page .forum-thread-media .community-media-gallery-2 { grid-template-columns: repeat(2,minmax(0,1fr)); }
.community-page .forum-thread-media .community-media-gallery-4 { grid-template-columns: repeat(2,minmax(0,1fr)); }

.community-page .forum-thread-actions {
  min-height: 46px;
  margin: 0 14px;
  display: grid;
  grid-template-columns: repeat(3,1fr);
  border-top: 1px solid var(--divider);
}
.community-page .forum-thread-actions button {
  min-height: 46px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}
.community-page .forum-thread-actions .forum-action-content {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.community-page .forum-thread-actions button:active {
  opacity: .58;
  transform: none;
  background: color-mix(in srgb, var(--primary) 7%, transparent);
  border-radius: 10px;
}
.community-page .forum-thread-actions button.active { color: var(--primary); }
.community-page .forum-thread-actions svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-theme-color="dark"] .community-page .forum-thread-card { box-shadow: 0 4px 18px rgba(0,0,0,.2); }

@media (max-width: 360px) {
  .community-page .forum-thread-author { grid-template-columns: 38px minmax(0,1fr) auto auto; gap: 8px; }
  .community-page .forum-thread-author > button:first-child,
  .community-page .forum-thread-author .forum-thread-avatar { width: 38px; height: 38px; }
  .community-page .forum-thread-follow { padding: 0 8px; }
  .community-page .forum-thread-card h3 { font-size: 17px; }
}

/* 贴吧式发布编辑器：以内容输入为主，所有设置顺序纵向展开。 */
.forum-publish-nav.community-compose-nav {
  min-height: calc(58px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 10px 0;
  display: grid;
  grid-template-columns: 44px minmax(0,1fr) 54px;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--divider);
  background: color-mix(in srgb, var(--topbar-bg) 96%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.forum-publish-nav .forum-publish-close {
  width: 42px;
  height: 42px;
  padding: 0;
  color: var(--text);
  background: transparent;
  font-size: 34px;
  font-weight: 250;
  line-height: 1;
}
.forum-publish-types {
  min-width: 0;
  height: 58px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: clamp(8px,3vw,20px);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.forum-publish-types::-webkit-scrollbar { display: none; }
.forum-publish-types button {
  position: relative;
  flex: none;
  padding: 0 2px;
  color: var(--muted);
  background: transparent;
  font-size: 16px;
  font-weight: 550;
}
.forum-publish-types button.active { color: var(--text); font-weight: 780; }
.forum-publish-types button.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 22px;
  height: 3px;
  border-radius: 3px;
  background: var(--primary);
  transform: translateX(-50%);
}
.forum-publish-nav .community-compose-submit {
  min-width: 52px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 16px;
  color: #fff;
  background: var(--primary);
  font-size: 13px;
  font-weight: 750;
}
.forum-publish-nav .community-compose-submit:disabled { color: var(--muted); background: var(--raised-bg); opacity: .7; }

.forum-publish-page.community-compose-page {
  min-height: calc(100dvh - 58px - env(safe-area-inset-top));
  padding: 0 18px calc(34px + env(safe-area-inset-bottom));
  background: var(--card-bg);
}
.forum-publish-page .community-publish-form { max-width: 100%; padding: 0; }
.forum-publish-page .forum-compose-title { margin: 0; border-bottom: 1px solid var(--divider); }
.forum-publish-page .forum-compose-title input {
  min-height: 68px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 18px;
  font-weight: 680;
}
.forum-publish-page .forum-compose-title input::placeholder,
.forum-publish-page .community-compose-copy textarea::placeholder { color: color-mix(in srgb, var(--muted) 58%, transparent); }
.forum-publish-page .community-compose-copy { margin: 0; }
.forum-publish-page .community-compose-copy textarea {
  width: 100%;
  min-height: 260px;
  padding: 22px 0 14px;
  border: 0;
  border-radius: 0;
  color: var(--text);
  background: transparent;
  font-size: 16px;
  line-height: 1.7;
  resize: none;
}
.forum-publish-page .community-draft-media-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 8px;
  margin: 6px 0 0;
}
.forum-publish-page .community-draft-media-item,
.forum-publish-page .community-media-add {
  width: 100%;
  aspect-ratio: 1;
  min-height: 0;
  border: 0;
  border-radius: 12px;
  background: var(--raised-bg);
}
.forum-publish-page .community-draft-media-item { position: relative; overflow: visible; }
.forum-publish-page .community-draft-media-item img { width: 100%; height: 100%; border-radius: 12px; object-fit: cover; }
.forum-publish-page .community-draft-media-item > button {
  top: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  border: 2px solid var(--card-bg);
  border-radius: 50%;
  color: #fff;
  background: rgba(20,24,22,.82);
  font-size: 16px;
}
.forum-publish-page .community-media-add > span { display: grid; place-items: center; gap: 4px; color: var(--muted); font-size: 40px; font-weight: 220; line-height: .8; }
.forum-publish-page .community-media-add small { color: var(--muted); font-size: 11px; font-weight: 500; }
.forum-publish-page .community-draft-media-tip { margin: 9px 0 22px; color: var(--muted); font-size: 11px; }

.forum-publish-page .forum-publish-growth { margin: 0 0 14px; padding: 14px 0; border-top: 1px solid var(--divider); }
.forum-publish-page .forum-publish-settings { border-top: 1px solid var(--divider); }
.forum-publish-setting-head,
.forum-publish-setting-row {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--divider);
}
.forum-publish-setting-head > span,
.forum-publish-setting-row > span { flex: none; display: flex; align-items: center; gap: 10px; }
.forum-publish-setting-head i,
.forum-publish-setting-row i { width: 22px; color: var(--text); font-size: 19px; font-style: normal; font-weight: 650; text-align: center; }
.forum-publish-setting-head b,
.forum-publish-setting-row b { color: var(--text); font-size: 15px; font-weight: 600; }
.forum-publish-setting-head small,
.forum-publish-setting-row small { overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.forum-publish-setting-row input {
  min-width: 0;
  flex: 1;
  border: 0;
  color: var(--text);
  background: transparent;
  font-size: 13px;
  text-align: right;
  outline: 0;
}
.forum-publish-setting-row input::placeholder { color: color-mix(in srgb, var(--muted) 62%, transparent); }
.forum-publish-circle-strip {
  display: flex;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 10px 0 14px;
  overflow-x: auto;
  border-bottom: 1px solid var(--divider);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.forum-publish-circle-strip::-webkit-scrollbar { display: none; }
.forum-publish-circle-strip button {
  flex: none;
  min-height: 36px;
  padding: 0 12px 0 7px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 18px;
  color: var(--text);
  background: var(--raised-bg);
  font-size: 13px;
}
.forum-publish-circle-strip button i { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: var(--primary); background: var(--card-bg); font-size: 10px; font-style: normal; font-weight: 800; }
.forum-publish-circle-strip button.active { color: #fff; background: var(--primary); }
.forum-publish-circle-strip button.active i { color: var(--primary); background: #fff; }

/* 信息流仅预览前三张；第三张提示详情内剩余数量。 */
.community-page .forum-thread-media .community-feed-media-cell { position: relative; min-width: 0; aspect-ratio: 1; overflow: hidden; background: #111; }
.community-page .forum-thread-media .community-feed-media-cell > .community-feed-media-button { width: 100%; height: 100%; border-radius: 0; }
.community-page .forum-thread-media .community-feed-media-cell .community-media { width: 100%; height: 100%; object-fit: cover; }
.community-page .forum-thread-media .community-media-more {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0,0,0,.43);
  font-size: 24px;
  font-weight: 650;
  pointer-events: none;
}

@media (max-width: 360px) {
  .forum-publish-types { gap: 8px; }
  .forum-publish-types button { font-size: 14px; }
  .forum-publish-page.community-compose-page { padding-left: 14px; padding-right: 14px; }
  .forum-publish-page .community-compose-copy textarea { min-height: 220px; }
}

/* 单图帖子详情：仿贴吧的沉浸式大图阅读顺序。 */
.community-detail-page.is-single-image-detail {
  padding: 0 0 calc(126px + env(safe-area-inset-bottom)) !important;
  background: var(--page-bg);
}
.community-detail-card.is-single-image {
  padding: 0 !important;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--card-bg);
}
.community-detail-card.is-single-image .community-detail-head {
  min-height: 68px;
  padding: 13px 15px 7px;
  grid-template-columns: 42px minmax(0,1fr) auto;
}
.community-detail-card.is-single-image .community-profile-avatar-button {
  width: 42px;
  height: 42px;
  overflow: hidden;
  border-radius: 50%;
}
.community-detail-card.is-single-image .community-detail-author-button strong { color: var(--text); font-size: 14px; }
.community-detail-card.is-single-image .community-detail-author-button span { margin: 0; font-size: 11px; }
.community-detail-card.is-single-image .community-author-actions { gap: 6px; }
.community-detail-card.is-single-image .community-author-actions button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 15px;
  font-size: 11px;
}
.community-detail-card.is-single-image .forum-detail-title {
  margin: 10px 15px 4px;
  font-size: 20px;
  line-height: 1.42;
}
.community-detail-card.is-single-image .community-post-context,
.community-detail-card.is-single-image .community-discussion-hook,
.community-detail-card.is-single-image > .community-post-location { margin-left: 15px; margin-right: 15px; }
.community-detail-card.is-single-image .community-detail-copy {
  margin: 7px 15px 13px;
  font-size: 15px;
  line-height: 1.65;
}
.community-detail-card.is-single-image .community-detail-media-gallery {
  width: 100%;
  margin: 0;
  display: block;
  overflow: visible;
  border-radius: 0;
  background: #101110;
}
.community-detail-card.is-single-image .community-detail-media-button {
  width: 100%;
  height: auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  background: #101110;
}
.community-detail-card.is-single-image .community-detail-media-button .community-media {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: min(54dvh, 560px) !important;
  object-fit: contain !important;
}
.community-detail-card.is-single-image .community-detail-zoom-mark { display: none; }
.community-detail-card.is-single-image .community-detail-actions {
  margin: 0 15px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-top: 0;
  border-bottom: 1px solid var(--divider);
}
.community-detail-card.is-single-image .community-detail-actions button:nth-child(-n+3) {
  min-height: 46px;
  flex: 1 1 33.333%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
}
.community-detail-card.is-single-image .community-detail-actions button:nth-child(n+4) {
  min-height: 36px;
  margin: 0 14px 0 0;
  font-size: 11px;
}
.community-detail-card.is-single-image .community-detail-actions .community-post-delete { margin-left: auto; margin-right: 0; }
.community-detail-card.is-single-image > .forum-detail-context {
  margin: 0;
  padding: 12px 15px;
  border-radius: 0;
  background: var(--card-bg);
}
.is-single-image-detail .forum-reply-section {
  margin-top: 9px;
  border-top: 0;
  background: var(--card-bg);
}

/* 发布可见范围：iOS 底部动作选单。 */
button.forum-publish-setting-row { width: 100%; padding: 0; color: inherit; background: transparent; text-align: left; }
.community-visibility-overlay {
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px 10px calc(10px + env(safe-area-inset-bottom));
  background: rgba(0,0,0,.34);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: communityVisibilityFade .18s ease-out;
}
.community-visibility-sheet {
  width: min(100%,430px);
  padding: 7px 14px 12px;
  border-radius: 22px;
  background: color-mix(in srgb, var(--card-bg) 97%, transparent);
  box-shadow: 0 18px 50px rgba(0,0,0,.24);
  animation: communityVisibilityRise .28s cubic-bezier(.2,.8,.2,1);
}
.community-sheet-handle { width: 36px; height: 5px; display: block; margin: 0 auto 8px; border-radius: 5px; background: color-mix(in srgb, var(--muted) 38%, transparent); }
.community-visibility-sheet > header { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--divider); }
.community-visibility-sheet > header > div { display: grid; gap: 3px; }
.community-visibility-sheet > header strong { color: var(--text); font-size: 17px; }
.community-visibility-sheet > header span { color: var(--muted); font-size: 11px; }
.community-visibility-sheet > header button { width: 34px; height: 34px; border-radius: 50%; color: var(--muted); background: var(--raised-bg); font-size: 23px; font-weight: 300; }
.community-visibility-options { padding-top: 3px; }
.community-visibility-options > button {
  width: 100%;
  min-height: 68px;
  padding: 8px 4px;
  display: grid;
  grid-template-columns: 40px minmax(0,1fr);
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--divider);
  color: var(--text);
  background: transparent;
  text-align: left;
}
.community-visibility-options > button:last-child { border-bottom: 0; }
.community-visibility-options > button > i {
  position: relative;
  width: 18px;
  height: 18px;
  margin-left: 10px;
  display: grid;
  place-items: center;
  border: 1.5px solid transparent;
  border-radius: 50%;
  color: var(--text);
  background: transparent;
  font-style: normal;
}
.community-visibility-options > button > i::after {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.community-visibility-options > button.active > i { border-color: currentColor; }
.community-visibility-options > button > span { min-width: 0; display: grid; gap: 4px; }
.community-visibility-options b { font-size: 15px; }
.community-visibility-options small { color: var(--muted); font-size: 12px; }
.community-visibility-options > button:active { opacity: .58; }
@keyframes communityVisibilityFade { from { opacity: 0; } }
@keyframes communityVisibilityRise { from { opacity: .7; transform: translateY(24px); } }

/* 三层图片呈现：信息流与详情使用页面底色，只有原图预览使用黑底。 */
.community-page .forum-thread-media.is-single,
.community-page .forum-thread-media.is-single > .community-feed-media-button,
.community-detail-card.is-single-image .community-detail-media-gallery,
.community-detail-card.is-single-image .community-detail-media-button {
  background: #fff !important;
}
.community-detail-card.is-single-image .community-detail-media-button .community-media {
  display: block;
  margin: 0 auto;
}
html[data-theme-color="dark"] .community-detail-card.is-single-image .community-detail-media-gallery,
html[data-theme-color="dark"] .community-detail-card.is-single-image .community-detail-media-button {
  background: #fff !important;
}

/* 首页外层的单图同样完整显示，不使用封面裁切。 */
.community-page .forum-thread-media.is-single {
  display: block;
  overflow: visible;
  background: #fff !important;
}
.community-page .forum-thread-media.is-single > .community-feed-media-button {
  width: fit-content;
  height: auto;
  max-width: 100%;
  max-height: none;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  overflow: visible;
  background: #fff !important;
}
.community-page .forum-thread-media.is-single img.community-media {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  /* 信息流只展示完整缩略图；进入详情后再使用更大的图片尺寸。 */
  max-height: min(38dvh, 360px) !important;
  margin: 0;
  object-fit: contain !important;
}

/* 帖子详情是独立层级：隐藏主导航后，回复框贴合底部安全区。 */
.forum-reply-composer {
  bottom: var(--forum-keyboard-bottom, 0px);
  margin: 0;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  background: var(--topbar-bg);
  border-radius: 0;
}
.forum-keyboard-open .forum-reply-composer { padding-bottom: 8px; }
@media (max-width: 600px) {
  .forum-reply-composer { left: 0; right: 0; }
}

/* 点赞采用 iOS 红色确认态，取消后恢复原有中性色。 */
.community-page .forum-thread-actions button.active,
.community-detail-actions button.active { color: #ff3b30; }
.community-page .forum-thread-actions button:first-child svg,
.community-detail-actions button[data-like-community-post] svg {
  fill: none;
  transition: color .16s ease, fill .16s ease, transform .16s ease;
}
.community-page .forum-thread-actions button:first-child.active svg,
.community-detail-actions button[data-like-community-post].active svg {
  fill: currentColor;
  transform: scale(1.08);
}
.community-detail-actions button[data-like-community-post] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.community-detail-actions button > svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Fuzzy search suggestions for the community feed. */
.community-search-shell { position: relative; z-index: 12; margin-bottom: 12px; }
.community-search-shell > label { min-height: 44px; display: flex; align-items: center; gap: 9px; padding: 0 11px; border: 1px solid color-mix(in srgb, var(--divider) 82%, transparent); border-radius: 14px; background: var(--card-bg); box-shadow: 0 4px 16px rgba(18,42,34,.045); }
.community-search-shell > label:focus-within { border-color: color-mix(in srgb, var(--primary) 48%, var(--divider)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 10%, transparent); }
.community-search-shell svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.community-search-shell input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--text); background: transparent; font: inherit; font-size: 14px; }
.community-search-shell [data-community-search-clear] { width: 25px; height: 25px; padding: 0; border-radius: 50%; color: var(--muted); background: var(--raised-bg); font-size: 18px; line-height: 1; }
.community-search-shell [data-community-search-clear][hidden] { display: none; }
.community-search-suggestions, .community-search-state { margin-top: 7px; overflow: hidden; border: 1px solid var(--divider); border-radius: 16px; background: var(--card-bg); box-shadow: 0 12px 30px rgba(13,35,28,.12); }
.community-search-state { padding: 16px; color: var(--muted); font-size: 13px; text-align: center; }
.community-search-suggestions > button { width: 100%; min-height: 61px; display: flex; align-items: center; gap: 12px; padding: 9px 11px 9px 14px; border-bottom: 1px solid var(--divider); border-radius: 0; color: var(--text); background: transparent; text-align: left; }
.community-search-suggestions > button:last-child { border-bottom: 0; }
.community-search-suggestions > button:active { background: var(--raised-bg); }
.community-search-result-copy { min-width: 0; flex: 1; display: grid; gap: 4px; }
.community-search-result-copy strong, .community-search-result-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.community-search-result-copy strong { font-size: 14px; }
.community-search-result-copy small { color: var(--muted); font-size: 12px; }
.community-search-suggestions img, .community-search-suggestions > button > i { width: 43px; height: 43px; flex: 0 0 auto; border-radius: 10px; object-fit: cover; background: var(--raised-bg); }
.community-search-suggestions > button > i { display: grid; place-items: center; color: var(--primary); font-style: normal; font-weight: 750; }

/* Breeding completion and sale archive selection. */
.turtle-hatch-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: 7px;
  background: #ffe17a;
  color: #624600;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}
.breeding-hatch-panel { margin-top: 12px; }
.breeding-hatch-panel > label { display: grid; gap: 8px; margin-top: 12px; }
.breeding-hatch-panel > p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.breeding-hatch-panel > button { width: 100%; }
.ledger-dashboard-picker { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px; margin-bottom: 12px; border: 1px solid var(--divider); border-radius: 14px; background: var(--raised-bg); }
.ledger-dashboard-picker p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.ledger-dashboard-picker > button { flex-shrink: 0; }

.breeding-detail-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.breeding-detail-actions > .primary { display: flex; align-items: center; justify-content: center; width: 100%; min-width: 0; margin: 0; text-align: center; }

/* Cover the full mobile viewport, including phones wider than the 430px shell. */
html .topbar.community-detail-topbar { background: var(--topbar-bg) !important; }
@media (max-width: 600px) {
  .topbar.community-detail-topbar { width: 100vw !important; max-width: none !important; margin-left: 0 !important; margin-right: 0 !important; border-radius: 0 !important; }
}

.custom-species-card { padding: 16px; margin-bottom: 14px; }
.custom-species-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.custom-species-heading h3 { margin: 0; font-size: 16px; }
.custom-species-heading p, #customSpeciesForm > p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.custom-species-heading > button { flex: 0 0 auto; width: auto; padding: 10px 14px; }
#customSpeciesForm { margin-top: 16px; }
#customSpeciesForm[hidden] { display: none; }
#customSpeciesForm > label { display: grid; gap: 8px; margin-top: 14px; }
.custom-species-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }

.species-alpha-nav[hidden] { display: none; }

/* Comment columns: avatar, author/body, and a shared action baseline. */
.forum-floor .forum-comment-avatar-link {
  display: block; width: 38px; height: 38px; min-height: 0; padding: 0;
  border: 0; border-radius: 50%; background: transparent;
}
.forum-nested-replies .forum-comment-avatar-link { width: 30px; height: 30px; }
.forum-floor .forum-comment-author-link {
  display: flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0;
  min-height: 22px; padding: 0; border: 0; text-align: left; background: transparent;
}
.forum-floor .forum-comment-author-link strong {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text); font-size: 13px; font-weight: 600; line-height: 22px;
}
.forum-floor .forum-comment-author-link > :not(strong) { flex-shrink: 0; }
.forum-floor-avatar { align-self: start; }
.forum-floor-content > header { min-height: 22px; align-items: center; }
.forum-floor-content > p { margin: 4px 0 6px; }
.community-detail-page .community-detail-card .community-detail-actions {
  display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between;
  gap: 6px; padding: 0; min-height: 46px;
}
.community-detail-page .community-detail-card .community-detail-actions > button:nth-child(n) {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  flex: 0 1 auto; min-width: 0; min-height: 44px; margin: 0; padding: 0;
  font-size: 12px; line-height: 1.3; white-space: nowrap;
}
.community-detail-page .community-detail-card .community-detail-actions > button > svg {
  width: 16px; height: 16px;
}

/* Community home: one invitation, compact navigation, and a consistent reading rhythm. */
.community-page.community-refined-page { --primary: var(--accent); padding: 12px 12px 100px; }
.community-refined-page .community-search-shell { margin-bottom: 12px; }
.community-refined-page .community-search-shell > label { border-radius: 12px; box-shadow: none; }
.community-refined-page .community-search-shell input { border: 0 !important; box-shadow: none !important; }
.community-refined-page .community-invite {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end;
  gap: 12px; padding: 16px 18px 0; margin-bottom: 14px; overflow: hidden;
  border: 1px solid #2c6b54; border-radius: 20px;
  color: #f1faef; background: radial-gradient(ellipse at 100% 0%, #38775b 0%, transparent 65%), #174c3c;
}
.community-refined-page .community-invite-eyebrow { display: flex; align-items: center; gap: 6px; color: #c3ddcb; font-size: 11px; line-height: 1.6; }
.community-refined-page .community-invite-copy { grid-column: 1 / -1; }
.community-refined-page .community-invite-eyebrow i { width: 5px; height: 5px; border-radius: 50%; background: #b9e1a4; flex: none; }
.community-refined-page .community-invite h2 { margin: 7px 0 6px; color: inherit; font-size: 23px; font-weight: 650; line-height: 1.4; letter-spacing: .01em; }
.community-refined-page .community-invite p { margin: 0; color: #c3ddcb; font-size: 11px; line-height: 1.7; }
.community-refined-page .community-invite-publish {
  grid-column: 2; justify-self: end; display: inline-flex; align-items: center;
  gap: 8px; min-height: 56px; padding: 12px 14px; border-radius: 14px;
  background: #e1efcb; color: #183c2e; font-size: 13px; font-weight: 700;
}
.community-refined-page .community-invite svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.community-refined-page .community-invite-publish > span { margin-left: 10px; font-size: 17px; }
.community-refined-page .community-invite-shortcuts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); border-top: 1px solid #ffffff24; }
.community-refined-page .community-invite-shortcuts > button { display: flex; justify-content: center; align-items: center; gap: 5px; min-height: 46px; padding: 0; color: #dbe9dd; background: transparent; font-size: 12px; white-space: nowrap; }
.community-refined-page .community-invite-shortcuts > button:first-child { justify-content: start; }
.community-refined-page .community-invite-shortcuts > button:last-child { justify-content: end; }
.community-refined-page .forum-circle-section { min-width: 0; margin: 0 0 8px; padding: 0; }
.community-refined-page .forum-circle-strip { display: flex; gap: 7px; margin: 0; padding: 0 0 5px; overflow-x: auto; scrollbar-width: none; }
.community-refined-page .forum-circle-card {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: auto; min-height: 36px; padding: 7px 13px; border: 1px solid var(--divider);
  border-radius: 999px; background: var(--card-bg); color: var(--muted);
  box-shadow: none; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.community-refined-page .forum-circle-card.active { border-color: color-mix(in srgb, var(--primary) 25%, var(--divider)); background: color-mix(in srgb, var(--primary) 10%, var(--card-bg)); color: var(--primary); font-weight: 650; }
.community-page.community-refined-page .forum-circle-card { box-shadow: none; }
.community-refined-page .forum-selected-circle { margin: 4px 0 12px; padding: 12px; border-radius: 12px; box-shadow: none; }
.community-refined-page .community-feed-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; min-height: 44px; }
.community-refined-page .forum-sort-tabs { position: static; display: flex; align-items: center; gap: 18px; flex: 1; min-width: 0; margin: 0; padding: 0 3px; border: 0; background: transparent; box-shadow: none; overflow: visible; backdrop-filter: none; -webkit-backdrop-filter: none; }
.community-refined-page .forum-sort-tabs > button { position: relative; flex: 0 0 auto; min-width: 0; min-height: 44px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--muted); font-size: 14px; font-weight: 500; }
.community-refined-page .forum-sort-tabs > button.active { color: var(--text); font-weight: 750; }
.community-page.community-refined-page .forum-sort-tabs > button.active { background: transparent; box-shadow: none; }
.community-refined-page .forum-sort-tabs > button.active::after { content: ''; position: absolute; bottom: 3px; left: 7px; right: 7px; height: 3px; border-radius: 3px; background: var(--primary); }
.community-refined-page .community-toolbar-publish { display: inline-flex; align-items: center; gap: 3px; flex: none; min-height: 40px; padding: 0 5px; background: transparent; color: var(--primary); font-size: 12px; font-weight: 650; }
.community-refined-page .community-toolbar-publish > span { font-size: 19px; font-weight: 400; }
.community-page.community-refined-page .forum-thread-card { margin: 0 0 14px; padding: 0; border: 1px solid var(--divider); border-radius: 18px; box-shadow: none; background: var(--card-bg); }
.community-page.community-refined-page .community-feed { gap: 0; border: 0; }
.community-page.community-refined-page .forum-thread-author { grid-template-columns: 36px minmax(0,1fr) auto 24px; gap: 8px; padding: 15px 14px 12px; }
.community-page.community-refined-page .forum-thread-author > button:first-child,
.community-page.community-refined-page .forum-thread-author .forum-thread-avatar { width: 36px; height: 36px; }
.community-refined-page .forum-thread-author-name { display: flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%; min-height: 20px; padding: 0; border: 0; background: transparent; text-align: left; }
.community-refined-page .forum-thread-author-name > strong { min-width: 0; font-weight: 650; }
.community-refined-page .forum-thread-author-name > :not(strong) { flex: none; }
.community-page.community-refined-page .forum-thread-more-wrap { grid-column: 4; width: 24px; height: 32px; }
.community-page.community-refined-page .forum-thread-more { width: 24px; height: 32px; }
.community-page.community-refined-page .forum-thread-follow { min-height: 30px; padding: 0 9px; font-size: 11px; font-weight: 600; }
.community-page.community-refined-page .forum-thread-main { padding: 0 14px 12px; }
.community-refined-page .forum-thread-badges { gap: 5px; margin: 0 0 7px; }
.community-refined-page .forum-thread-badges > b,
.community-refined-page .forum-thread-badges > span { padding: 2px 6px; border-radius: 5px; font-size: 10px; font-weight: 500; }
.community-page.community-refined-page .forum-thread-card h3 { margin: 0 0 7px; font-size: 17px; font-weight: 650; line-height: 1.5; letter-spacing: 0; overflow-wrap: anywhere; }
.community-page.community-refined-page .forum-thread-card p { font-size: 14px; line-height: 1.7; -webkit-line-clamp: 3; overflow-wrap: anywhere; }
.community-page.community-refined-page .forum-thread-media { margin-top: 12px; border-radius: 12px; }
.community-page.community-refined-page .forum-thread-media.is-single,
.community-page.community-refined-page .forum-thread-media.is-single > .community-feed-media-button { background: var(--raised-bg) !important; }
.community-page.community-refined-page .forum-thread-media.is-single { overflow: hidden; }
.community-page.community-refined-page .forum-thread-media.is-single > .community-feed-media-button { display: flex; width: 100%; justify-content: center; overflow: hidden; }
.community-page.community-refined-page .forum-thread-actions { margin: 0 14px; min-height: 44px; }
.community-page.community-refined-page .forum-thread-actions button { min-height: 44px; padding: 0; }
.community-refined-page button:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.community-refined-page .community-invite button:focus-visible { outline-color: #e1efcb; }
@media (min-width: 370px) {
  .community-refined-page .community-invite { gap: 12px 10px; }
  .community-refined-page .community-invite-copy { grid-column: 1 / -1; }
  .community-refined-page .community-invite h2 br { display: none; }
  .community-refined-page .community-invite h2 { font-size: 21px; }
}
@media (min-width: 600px) {
  .community-refined-page .community-invite-copy { grid-column: 1; grid-row: 1; }
  .community-refined-page .community-invite-publish { grid-row: 1; align-self: center; }
}

/* Scope overrides for the legacy dark theme's global !important element rules. */
html[data-theme-color="dark"] .community-refined-page .community-invite { background: radial-gradient(ellipse at 100% 0%, #2c654e 0%, transparent 65%), #173f33 !important; }
html[data-theme-color="dark"] .community-refined-page .community-invite h2 { color: #f1faef !important; }
html[data-theme-color="dark"] .community-refined-page .community-invite-eyebrow,
html[data-theme-color="dark"] .community-refined-page .community-invite p { color: #bdd3c4 !important; }
html[data-theme-color="dark"] .community-refined-page .community-invite-publish,
html[data-theme-color="dark"] .community-refined-page .community-invite-publish > span { color: #183c2e !important; }
html[data-theme-color="dark"] .community-refined-page .community-invite-shortcuts > button { color: #dbe9dd !important; }
html[data-theme-color="dark"] .community-refined-page .community-feed,
html[data-theme-color="dark"] .community-refined-page .forum-circle-section,
html[data-theme-color="dark"] .community-refined-page .community-search-shell { background: transparent !important; }
html[data-theme-color="dark"] .community-refined-page .community-search-shell input { background: transparent !important; }
html[data-theme-color="dark"] .community-refined-page .forum-circle-card,
html[data-theme-color="dark"] .community-refined-page .forum-sort-tabs > button,
html[data-theme-color="dark"] .community-refined-page .forum-thread-author-copy > span { color: var(--muted) !important; }
html[data-theme-color="dark"] .community-refined-page .forum-circle-card.active,
html[data-theme-color="dark"] .community-refined-page .community-toolbar-publish,
html[data-theme-color="dark"] .community-refined-page .community-toolbar-publish > span,
html[data-theme-color="dark"] .community-refined-page .forum-thread-follow { color: #70d5a4 !important; }
html[data-theme-color="dark"] .community-refined-page .forum-sort-tabs > button.active { color: var(--text) !important; }
html[data-theme-color="dark"] .community-refined-page .forum-thread-actions .forum-action-content,
html[data-theme-color="dark"] .community-refined-page .forum-thread-actions .forum-action-content > span { color: var(--muted) !important; }
html[data-theme-color="dark"] .community-refined-page .forum-thread-actions button.active .forum-action-content,
html[data-theme-color="dark"] .community-refined-page .forum-thread-actions button.active .forum-action-content > span { color: #ff3b30 !important; }
@media (max-width: 360px) {
  .community-refined-page .forum-sort-tabs { gap: 14px; }
  .community-refined-page .community-invite { padding: 14px 14px 0; gap: 10px; }
  .community-refined-page .community-invite h2 { font-size: 21px; }
}

/* All mobile pages share the full viewport, including 440px iPhones. */
html .topbar,
html .forum-publish-nav.community-compose-nav { background: var(--topbar-bg) !important; }
@media (max-width: 600px) {
  .phone-shell { width: 100%; max-width: none; margin-left: 0; margin-right: 0; }
  .topbar,
  .phone-shell .bottom-nav,
  .community-chat-form,
  .community-chat-tools,
  .community-chat-product-context,
  .feedback-detail-comment,
  .guest-login-slot {
    width: 100vw !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    border-radius: 0 !important;
    box-sizing: border-box;
  }
  .forum-reply-composer,
  .market-detail-actions,
  .market-sale-overlay,
  .market-service-overlay { left: 0; right: 0; }
}

/* Collapsed activity inbox; conversations retain their own independent rows. */
.message-page .message-activity-summary {
  padding: 0; margin: 0 0 14px; overflow: hidden;
  border: 1px solid var(--divider); border-radius: 16px; background: var(--section-bg);
}
.message-activity-summary .message-activity-row {
  display: grid; grid-template-columns: 50px minmax(0, 1fr) auto;
  gap: 12px; align-items: center; width: 100%; min-height: 96px;
  margin: 0; padding: 17px 14px; border: 0; border-radius: 0;
  background: transparent !important; color: var(--text); text-align: left;
}
.message-activity-row + .message-activity-row { border-top: 1px solid var(--divider); }
.message-activity-row .message-activity-icon {
  width: 50px; height: 50px; display: grid; place-items: center;
  border-radius: 50%; background: #ff3885 !important; color: #fff !important;
}
.message-activity-row .message-activity-icon.follows { background: #3599ec !important; }
.message-activity-icon svg { width: 30px; height: 30px; color: inherit; }
.message-activity-row .message-activity-copy { display: grid; gap: 5px; min-width: 0; }
.message-activity-copy > strong { color: var(--text); font-size: 16px; line-height: 1.35; }
.message-activity-copy > span, .message-activity-copy > small {
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--muted) !important;
  font-size: 13px; line-height: 1.4;
}
.message-activity-copy > small { font-size: 11px; }
.message-activity-row .message-activity-meta { display: grid; align-self: stretch; justify-items: end; align-content: space-between; gap: 9px; padding: 2px 0; }
.message-activity-meta time { color: var(--muted) !important; white-space: nowrap; font-size: 11px; }
.message-activity-row .message-activity-badge {
  display: grid; place-items: center; min-width: 21px; height: 21px; padding: 0 5px;
  border-radius: 999px; background: #fa3b56 !important; color: #fff !important;
  font-size: 12px; font-weight: 700; line-height: 1; font-style: normal;
}
.community-activity-page { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.community-activity-page .community-activity-tabs {
  display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 12px;
  padding: 0; background: var(--section-bg); border-bottom: 1px solid var(--divider);
}
.community-activity-tabs > button {
  position: relative; min-height: 50px; padding: 12px 8px; border: 0; border-radius: 0;
  color: var(--muted) !important; background: transparent !important; font-size: 16px; font-weight: 600;
}
.community-activity-tabs > button.active { color: var(--text) !important; }
.community-activity-tabs > button.active::after {
  content: ''; position: absolute; bottom: 0; left: calc(50% - 14px); width: 28px; height: 3px;
  border-radius: 3px; background: var(--primary);
}
.community-activity-list { padding: 0; overflow: hidden; border-radius: 14px; background: var(--section-bg); }
.community-activity-list .message-notification-row {
  min-height: 100px; padding: 18px 12px; gap: 12px;
  grid-template-columns: 48px minmax(0, 1fr) 52px; border-radius: 0; background: transparent !important;
}
.community-activity-list .message-notification-avatar,
.community-activity-list .message-notification-avatar > .community-avatar { width: 48px; height: 48px; }
.community-activity-list .message-notification-copy { gap: 6px; }
.community-activity-list .message-notification-copy strong { font-size: 15px; }
.community-activity-list .message-notification-copy > span { white-space: normal; line-height: 1.5; }
.community-activity-list .message-notification-copy time { display: inline-block; margin: 0; }
.community-activity-list .message-notification-copy small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.5; }
.community-activity-list .message-notification-thumbnail { width: 52px; height: 62px; border-radius: 7px; }
.community-activity-list .message-notification-type { color: white !important; background: #ff3885 !important; }
.community-activity-list .message-notification-type.comment { background: #299be9 !important; }
.community-activity-list .message-notification-type.follow { background: #3599ec !important; }
.community-activity-page .community-activity-more { display: block; margin: 16px auto; min-height: 44px; padding: 10px 24px; background: var(--raised-bg); color: var(--text); border-radius: 22px; }
@media (max-width: 350px) {
  .message-activity-summary .message-activity-row { gap: 9px; padding-left: 11px; padding-right: 11px; grid-template-columns: 44px minmax(0, 1fr) auto; }
  .message-activity-row .message-activity-icon { width: 44px; height: 44px; }
  .community-activity-list .message-notification-row { grid-template-columns: 42px minmax(0, 1fr) 44px; gap: 9px; }
  .community-activity-list .message-notification-avatar, .community-activity-list .message-notification-avatar > .community-avatar { width: 42px; height: 42px; }
  .community-activity-list .message-notification-thumbnail { width: 44px; height: 54px; }
}

/* A market clip has no network source until the user presses play. */
.market-detail-video-shell .market-video-play {
  position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 0; color: #fff !important; background: transparent !important;
}
/* Species directories shared by archive association controls. */
/* Align status labels with measurements, in the reserved menu column. */
.turtle-row-bottom { position: relative; }
.turtle-row-bottom > .turtle-row-status-badge { position: absolute; top: 50%; right: -38px; transform: translateY(-50%); box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; width: 36px; min-height: 0; margin: 0; padding: 4px 2px; border-radius: 12px; font-size: 11px; line-height: 14px; font-weight: 700; white-space: nowrap; pointer-events: none; }
.home-archive-section .turtle-row-bottom > .turtle-row-status-badge { right: -40px; }
.turtle-row-bottom > .turtle-loss-badge { color: #c63b4a !important; background: #ffe8eb !important; }
html[data-theme-color="dark"] .turtle-row-bottom > .turtle-loss-badge { color: #ff9ca7 !important; background: #462b30 !important; }
select[data-archive-directory][hidden] { display: none !important; }
.ledger-batch-form { margin: 18px 0; }
.ledger-batch-form .ledger-batch-selection { display: grid; gap: 10px; margin-bottom: 18px; }
.ledger-batch-selection > span { font-size: 13px; color: var(--muted); }
.ledger-batch-summary { border: 1px solid var(--line); background: var(--surface-2); border-radius: 14px; padding: 16px; margin-bottom: 22px; }
.ledger-batch-identity { display: flex; align-items: center; gap: 12px; }
.ledger-batch-identity > img { width: 62px; height: 62px; border-radius: 12px; object-fit: cover; flex-shrink: 0; }
.ledger-batch-identity > div { display: grid; gap: 5px; flex: 1; min-width: 0; }
.ledger-batch-identity strong { font-size: 16px; overflow-wrap: anywhere; }
.ledger-batch-identity small, .ledger-batch-identity span { font-size: 11px; color: var(--muted); }
.ledger-batch-identity > b { display: grid; gap: 4px; flex-shrink: 0; text-align: right; font-size: 25px; color: var(--green); }
.ledger-batch-summary dl { display: grid; gap: 10px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; }
.ledger-batch-summary dl > div { display: flex; justify-content: space-between; gap: 15px; }
.ledger-batch-summary dt { color: var(--muted); flex-shrink: 0; }
.ledger-batch-summary dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.ledger-batch-form input[readonly] { color: var(--muted); background: var(--surface-2); }
.archive-directory-trigger { width: 100%; min-width: 0; text-align: left !important; white-space: normal; overflow-wrap: anywhere; }
.archive-directory-trigger::after { content: " ›"; }
.modal-overlay.archive-directory-overlay { position: fixed; inset: 0; z-index: 15000; display: grid; place-items: center; padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); background: rgba(24,37,33,.48) !important; backdrop-filter: blur(5px); }
.archive-directory-dialog { width: min(100%, 620px); height: min(780px, 88vh); height: min(780px, 88dvh); max-height: 100%; display: flex; flex-direction: column; border: 1px solid var(--card-border); border-radius: 26px; overflow: hidden; background: var(--surface, #fffdf8); color: var(--text); box-shadow: 0 24px 80px #0e282f33; }
.archive-directory-dialog header { display: flex; align-items: flex-start; justify-content: space-between; flex-shrink: 0; gap: 12px; padding: 24px 24px 18px; }
.directory-heading { min-width: 0; }
.directory-heading > span { display: block; color: var(--green); font-size: 11px; letter-spacing: 2px; margin-bottom: 8px; font-weight: 650; }
.directory-heading > strong { display: block; font-size: 23px; letter-spacing: -.6px; line-height: 1.3; }
.directory-heading > p { margin: 7px 0 0; font-size: 12px; color: var(--muted); }
.archive-directory-dialog [data-directory-close] { width: 36px; height: 36px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--section-bg); color: var(--text); font-size: 24px; line-height: 1; }
.archive-directory-dialog [hidden] { display: none !important; }
.directory-controls { padding: 0 24px; flex-shrink: 0; }
.directory-search { display: flex; align-items: center; gap: 9px; padding: 0 12px; min-height: 46px; border: 1px solid var(--line); background: var(--section-bg); border-radius: 13px; }
.directory-search:focus-within { border-color: var(--green-2); box-shadow: 0 0 0 3px #2fa77f15; }
.directory-search svg { width: 19px; height: 19px; flex-shrink: 0; fill: none; stroke: var(--green); stroke-width: 1.6; }
.directory-search input { flex: 1; min-width: 0; width: 100%; height: 44px; padding: 0; border: 0; outline: none; box-shadow: none; background: transparent; color: var(--text); font-size: 14px; }
.directory-search input::-webkit-search-cancel-button { display: none; }
.directory-search > button { width: 30px; height: 36px; background: transparent; color: var(--muted); font-size: 20px; }
.directory-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.directory-filters label { min-width: 0; }
.directory-filters .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.directory-filters select { width: 100%; min-width: 0; height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: var(--surface-2); color: var(--text); font-size: 12px; text-overflow: ellipsis; }
.directory-types { display: flex; gap: 6px; margin: 16px 0 4px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.directory-types > button { min-width: 60px; min-height: 36px; border-radius: 9px; padding: 6px 16px; background: transparent; color: var(--muted); font-size: 13px; }
.directory-types > button[aria-pressed="true"] { background: var(--green); color: #fff; font-weight: 650; }
.directory-result-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex-shrink: 0; padding: 12px 24px; }
.directory-result-heading > strong { min-width: 0; overflow-wrap: anywhere; font-size: 13px; font-weight: 650; }
.directory-result-heading > span { color: var(--muted); font-size: 11px; margin-left: auto; white-space: nowrap; }
.archive-directory-dialog [data-directory-back] { background: transparent; color: var(--green); padding: 4px 6px 4px 0; font-size: 12px; min-height: 30px; }
.archive-directory-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 24px 16px; scrollbar-width: thin; }
.archive-directory-list.is-species-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: max-content; gap: 12px; align-content: start; }
.archive-directory-list > button { width: 100%; min-width: 0; text-align: left; color: var(--text); }
.archive-directory-list .directory-species-card { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; padding: 0; background: var(--section-bg); }
.directory-species-image { position: relative; display: block; flex-shrink: 0; width: 100%; aspect-ratio: 1.6; background: var(--surface-2); overflow: hidden; }
.directory-photo { display: block; width: 100%; height: 100%; object-fit: cover; }
.directory-species-count { position: absolute; top: 9px; left: 9px; border: 1px solid #ffffff45; border-radius: 7px; padding: 4px 8px; font-size: 10px; color: #fff; background: #193c32b8; backdrop-filter: blur(6px); }
.directory-species-copy { display: grid; gap: 5px; width: 100%; padding: 12px 30px 13px 12px; box-sizing: border-box; }
.directory-species-copy > strong { font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.directory-species-copy > small { font-size: 11px; color: var(--muted); }
.directory-card-arrow { position: absolute; bottom: 19px; right: 12px; font-size: 18px; color: var(--green); }
.archive-directory-list .directory-archive-card { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--section-bg); }
.directory-archive-card > .directory-photo { width: 78px; height: 86px; flex-shrink: 0; border-radius: 11px; background: var(--surface-2); }
.directory-archive-copy { display: grid; gap: 7px; flex: 1; min-width: 0; }
.directory-archive-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.directory-archive-title strong { font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.directory-kind-badge { font-size: 10px; font-weight: 400; padding: 2px 6px; border-radius: 5px; color: var(--green); background: var(--surface-2); white-space: nowrap; }
.directory-archive-subtitle { color: var(--muted); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.directory-member-hint { color: var(--green); font-size: 11px; line-height: 1.5; }
.directory-archive-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.directory-archive-meta small { font-size: 10px; line-height: 1.4; }
.directory-health { padding: 3px 6px; border-radius: 5px; background: var(--raised-bg); color: var(--muted); }
.directory-health.is-healthy { color: var(--green); }
.directory-health.is-sick { color: var(--danger); background: #e04f5f12; }
.directory-pool-label { color: var(--muted); overflow-wrap: anywhere; }
.directory-selection { flex: 0 0 20px; color: var(--muted); text-align: center; font-size: 20px; }
.directory-archive-card[aria-pressed="true"] { border-color: var(--green-2); box-shadow: inset 0 0 0 1px var(--green-2); }
.directory-archive-card[aria-pressed="true"] .directory-selection { color: var(--green); }
.directory-footer { flex-shrink: 0; padding: 12px 24px 16px; border-top: 1px solid var(--line); background: var(--surface); }
.directory-special-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.directory-special-actions > button, .directory-footer > button { flex: 1; padding: 8px 12px; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--section-bg); color: var(--green); font-size: 12px; }
.directory-footer > button { width: 100%; margin-top: 6px; }
.directory-footer > p { margin: 8px 0 0; color: var(--muted); font-size: 10px; text-align: center; line-height: 1.5; }
.directory-empty { display: grid; justify-items: center; align-content: center; min-height: 150px; height: 100%; box-sizing: border-box; text-align: center; padding: 16px 0; }
.directory-empty-symbol { font-size: 32px; color: var(--green); margin-bottom: 8px; }
.directory-empty strong { font-size: 15px; }
.directory-empty p { font-size: 12px; color: var(--muted); line-height: 1.7; }
.directory-empty button { padding: 10px 14px; border-radius: 10px; background: var(--green); color: #fff; font-size: 12px; }
.archive-directory-dialog button:focus-visible, .directory-filters select:focus-visible { outline: 2px solid var(--green-2); outline-offset: -2px; }
@media (max-width: 600px) {
  .modal-overlay.archive-directory-overlay { padding: max(12px, env(safe-area-inset-top)) 0 0; align-items: end; }
  .archive-directory-dialog { width: 100%; height: 90vh; height: 90dvh; border-radius: 25px 25px 0 0; border-bottom: 0; }
  .archive-directory-dialog header { padding: 22px 18px 16px; }
  .directory-heading > strong { font-size: 21px; }
  .directory-controls { padding: 0 18px; }
  .directory-result-heading { padding: 10px 18px; }
  .archive-directory-list { padding: 0 18px 16px; }
  .directory-footer { padding: 10px 18px max(14px, env(safe-area-inset-bottom)); }
  .directory-archive-card > .directory-photo { width: 65px; height: 78px; }
  .directory-search input { font-size: 16px; }
  .directory-search input::placeholder { font-size: 13px; }
}
@media (max-height: 620px) {
  .archive-directory-dialog header { padding-top: 12px; padding-bottom: 10px; }
  .directory-heading > span, .directory-heading > p, .directory-footer > p { display: none; }
  .directory-types { margin-top: 8px; padding-bottom: 6px; }
  .directory-result-heading { padding-top: 5px; padding-bottom: 5px; }
}
html[data-theme-color="dark"] .archive-directory-dialog { background: #202020 !important; }
.market-video-play > span { display: grid; place-items: center; width: 52px; height: 52px; padding-left: 4px; border-radius: 50%; font-size: 22px; color: #fff !important; background: rgba(0,0,0,.55) !important; }
.market-video-play > small { padding: 5px 12px; border-radius: 20px; color: #fff !important; background: rgba(0,0,0,.55) !important; }
.market-detail-video-shell:not(.is-idle) .market-video-play { display: none; }
.market-detail-video-shell:not(.is-loading) .market-detail-video-loading { display: none; }
.community-feed-media-button .inline-video-shell { position: relative; }
.community-feed-media-button .community-video-play-mark {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 42px; height: 42px; padding-left: 3px; display: grid; place-items: center;
  border-radius: 50%; font-size: 17px; color: #fff !important; background: rgba(0,0,0,.55) !important;
  pointer-events: none;
}
/* Batch archives keep quantity and shared care separate from individual measurements. */
.batch-count-badge { display: inline-block; margin-left: 6px; color: var(--primary, #56b5a0); font-size: 12px; }
.batch-form-hint { font-size: 13px; line-height: 1.6; color: var(--muted, #888); margin: 12px 0; }
.batch-summary { gap: 12px; }
.batch-summary > div:last-child { grid-column: 1 / -1; }
.batch-summary strong { overflow-wrap: anywhere; }
.batch-movement-form { margin-top: 20px; }
.archive-search { display: block; margin-bottom: 10px; scroll-margin-top: 80px; }
.archive-search .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.archive-search .field { width: 100%; box-sizing: border-box; }
.archive-page-count { margin: 0 0 10px; font-size: 12px; color: var(--muted); }
.archive-species-count { display: block; line-height: 1.7; overflow-wrap: anywhere; }
.archive-species-count > span { display: inline-block; white-space: nowrap; }
.archive-species-pagination { display: block; margin-top: 2px; line-height: 1.6; }
.archive-pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0; }
.archive-pagination .secondary { width: auto; min-width: 88px; }
.archive-pagination button:disabled { opacity: .4; cursor: default; }
.archive-pagination > span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.local-backup-warning { padding: 14px; margin-bottom: 14px; border: 1px solid var(--amber); border-radius: 12px; background: var(--card-bg); color: var(--text); }
.local-backup-warning p { font-size: 13px; line-height: 1.5; }
.local-backup-warning .secondary { width: auto; margin: 4px 8px 0 0; }
.turtle-batch-row .turtle-row-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.turtle-batch-detail .history-card { margin-bottom: 12px; }
.turtle-batch-detail .history-card p { white-space: pre-wrap; overflow-wrap: anywhere; }
/* A compact batch overview and consistent, touch-friendly forms. */
.turtle-batch-detail {
  --batch-ink: #254b4b;
  --batch-accent: #218b76;
  --batch-tint: #eff8f4;
  --batch-line: #e3ece7;
  --batch-field: #f7faf8;
  --batch-card: #fff;
}
.turtle-batch-detail .fresh-card,
.turtle-batch-detail .batch-identity {
  border: 1px solid var(--batch-line) !important;
  border-radius: 20px !important;
  background: var(--batch-card) !important;
  box-shadow: 0 5px 20px rgba(25, 62, 52, .035) !important;
}
.turtle-batch-detail .batch-identity { display: flex; align-items: center; gap: 16px; padding: 20px; margin: 0 0 12px; }
.turtle-batch-detail .batch-cover { flex: 0 0 76px; width: 76px; height: 88px; object-fit: cover; border-radius: 14px; cursor: zoom-in; }
.turtle-batch-detail .batch-identity > div { min-width: 0; }
.turtle-batch-detail .batch-identity .eyebrow { display: inline-block; margin: 0 0 8px; padding: 4px 9px; border-radius: 6px; font-size: 11px; line-height: 1.3; letter-spacing: .04em; color: var(--batch-accent) !important; background: var(--batch-tint); }
.turtle-batch-detail .batch-identity h2 { margin: 0; font-size: 19px; line-height: 1.45; color: var(--batch-ink); overflow-wrap: anywhere; }
.turtle-batch-detail .batch-identity p:last-child { margin: 7px 0 0; font-size: 12px; line-height: 1.7; color: var(--muted); }
.turtle-batch-detail .batch-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0 0 14px; padding: 0; overflow: hidden; }
.turtle-batch-detail .batch-summary > div { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 20px; min-width: 0; background: transparent; }
.turtle-batch-detail .batch-summary > div:nth-child(2) { border-left: 1px solid var(--batch-line); }
.turtle-batch-detail .batch-summary > div:last-child { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-top: 1px solid var(--batch-line); background: var(--batch-tint); }
.turtle-batch-detail .batch-summary span { color: var(--muted); font-size: 12px; }
.turtle-batch-detail .batch-summary strong { font-size: 30px; line-height: 1.15; letter-spacing: -.5px; font-variant-numeric: tabular-nums; color: var(--batch-ink); }
.turtle-batch-detail .batch-summary > div:first-child strong { color: var(--batch-accent); }
.turtle-batch-detail .batch-summary small { font-size: 12px; font-weight: 500; margin: 0 5px; letter-spacing: 0; }
.turtle-batch-detail .batch-summary > div:last-child strong { font-size: 22px; text-align: right; }
.turtle-batch-detail .batch-profile { padding: 20px; margin: 0 0 12px; }
.turtle-batch-detail .batch-profile h3, .turtle-batch-detail .batch-section-heading h3 { margin: 0; color: var(--batch-ink); font-size: 17px; font-weight: 700; }
.turtle-batch-detail .batch-profile h3 { margin-bottom: 8px; }
.turtle-batch-detail .batch-profile-line { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--batch-line); }
.turtle-batch-detail .batch-profile-line:last-child { border-bottom: 0; padding-bottom: 0; }
.turtle-batch-detail .batch-profile-line > span { flex-shrink: 0; color: var(--muted); font-size: 12px; }
.turtle-batch-detail .batch-profile-line p { margin: 0; font-size: 13px; line-height: 1.65; text-align: right; overflow-wrap: anywhere; }
.turtle-batch-detail .batch-profile-note { margin: 14px 0 0; padding: 12px; border-radius: 10px; background: var(--batch-field); color: var(--muted); font-size: 13px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.turtle-batch-detail .batch-edit-button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; border: 1px solid var(--batch-line) !important; border-radius: 14px; background: var(--batch-card) !important; color: var(--batch-accent) !important; font-weight: 600; box-shadow: none !important; }
.turtle-batch-detail .batch-edit-button span { font-size: 18px; }
.turtle-batch-detail .breeding-form { padding: 20px; margin: 18px 0; }
.turtle-batch-detail .batch-section-heading { margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--batch-line); }
.turtle-batch-detail .batch-section-heading p { margin: 7px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted); }
.turtle-batch-detail .breeding-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 18px 14px !important; }
.turtle-batch-detail .breeding-form-grid > label { display: flex !important; flex-direction: column; align-items: stretch !important; justify-content: flex-start; gap: 8px !important; min-width: 0; min-height: 0 !important; margin: 0 !important; padding: 0 !important; border: 0 !important; }
.turtle-batch-detail .breeding-form-grid > .batch-field-wide { grid-column: 1 / -1; }
.turtle-batch-detail .breeding-form-grid > label > span, .turtle-batch-detail .breeding-note > span { color: var(--muted) !important; font-size: 12px !important; line-height: 1.5 !important; }
.turtle-batch-detail .breeding-form .field, .turtle-batch-detail .breeding-form .select, .turtle-batch-detail .breeding-form textarea { box-sizing: border-box; width: 100% !important; min-width: 0 !important; max-width: 100%; min-height: 48px; padding: 11px 12px !important; border: 1px solid var(--batch-line) !important; border-radius: 11px !important; background: var(--batch-field) !important; color: var(--text) !important; font-size: 16px !important; line-height: 1.5; text-align: left !important; box-shadow: none !important; }
.turtle-batch-detail .breeding-form input[type="date"] { appearance: none; -webkit-appearance: none; }
.turtle-batch-detail .breeding-form input[type="date"]::-webkit-date-and-time-value { text-align: left; min-width: 0; }
.turtle-batch-detail .breeding-form :is(input, select, textarea):focus-visible { outline: 2px solid var(--batch-accent); outline-offset: 2px; }
.turtle-batch-detail .breeding-form input::placeholder, .turtle-batch-detail .breeding-form textarea::placeholder { font-size: 12px; color: var(--muted); opacity: .8; }
.turtle-batch-detail .batch-form-hint { margin: 18px 0; padding: 12px 14px; border-radius: 10px; background: var(--batch-tint); font-size: 12px; line-height: 1.8; }
.turtle-batch-detail .breeding-note { display: flex; flex-direction: column; gap: 8px; }
.turtle-batch-detail .breeding-form textarea { min-height: 92px; resize: vertical; }
.turtle-batch-detail .breeding-form > .primary { width: 100%; min-height: 50px; margin-top: 18px; border-radius: 12px; font-size: 15px; font-weight: 600; background: var(--batch-accent) !important; color: #fff !important; box-shadow: 0 5px 12px rgba(33, 139, 118, .12) !important; }
.turtle-batch-detail .breeding-photo-box { padding: 14px; margin-bottom: 22px; border: 1px dashed var(--batch-line); border-radius: 14px; background: var(--batch-field); }
.turtle-batch-detail .breeding-photo-box img { width: 72px; height: 84px; border-radius: 10px; object-fit: cover; }
.turtle-batch-detail .breeding-photo-box > div { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.turtle-batch-detail .breeding-photo-box button { font-size: 12px; min-height: 40px; padding: 8px 10px; border-radius: 9px; }
.turtle-batch-detail .batch-history-heading { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 14px; }
.turtle-batch-detail .batch-history-heading h3 { font-size: 17px; }
.turtle-batch-detail .batch-history-heading > span { color: var(--muted); font-size: 12px; }
.turtle-batch-detail .batch-history-heading > span::before { display: none; }
.turtle-batch-detail .batch-history-heading > span { font-size: 12px !important; font-weight: 500 !important; color: var(--muted) !important; }
.turtle-batch-detail .batch-history-heading { background: transparent !important; }
.turtle-batch-detail .batch-edit-button { border-radius: 14px !important; }
.turtle-batch-detail .history-card { padding: 16px 18px; border-left: 3px solid var(--batch-accent) !important; }
.turtle-batch-detail .history-card p { font-size: 13px; line-height: 1.8; }
.turtle-batch-detail .history-card small { font-size: 11px; color: var(--muted); }
.turtle-batch-detail .batch-history-empty { display: flex; flex-direction: column; justify-content: center; gap: 8px; min-height: 144px; padding: 24px; border: 1px dashed var(--batch-line); border-radius: 16px; background: transparent !important; text-align: center; }
.turtle-batch-detail .batch-history-empty strong { color: var(--muted); font-size: 14px; font-weight: 500; }
.turtle-batch-detail .batch-history-empty span { color: var(--muted); font-size: 12px; line-height: 1.8; }
html[data-theme-color="dark"] .turtle-batch-detail { --batch-ink: #d7e8e2; --batch-accent: #69bea8; --batch-tint: #21362f; --batch-line: #34463e; --batch-field: #202a25; --batch-card: #1c241f; }
html[data-theme-color="dark"] .turtle-batch-detail .breeding-form > .primary { background: #2b8c72 !important; }
html[data-theme-color="dark"] .turtle-batch-detail .breeding-form { color-scheme: dark; }
@media (max-width: 360px) {
  .turtle-batch-detail .batch-identity { padding: 16px; gap: 12px; }
  .turtle-batch-detail .batch-cover { flex-basis: 60px; width: 60px; height: 76px; }
  .turtle-batch-detail .batch-identity h2 { font-size: 17px; }
  .turtle-batch-detail .breeding-form, .turtle-batch-detail .batch-profile { padding: 16px; }
  .turtle-batch-detail .breeding-form-grid { gap: 16px 10px !important; }
  .turtle-batch-detail .breeding-form .field, .turtle-batch-detail .breeding-form .select { padding: 10px 8px !important; }
}
@media (max-width: 480px) {
  .turtle-batch-row .turtle-row-species p { display: flex; flex-wrap: wrap; gap: 4px; }
  .turtle-batch-row .batch-count-badge { margin-left: 0; }
  .turtle-batch-row .turtle-row-meta { flex-wrap: wrap; }
}
/* Keep both versions readable on a narrow phone; no file-format details. */
.sync-conflict-review { padding: 20px; }
.sync-conflict-review h2 { font-size: 20px; margin-top: 0; }
.sync-conflict-review fieldset { border: 1px solid var(--border, #dce6e4); border-radius: 16px; padding: 16px; margin: 20px 0; min-width: 0; }
.sync-conflict-review legend { font-weight: 700; padding: 0 8px; max-width: 100%; overflow-wrap: anywhere; }
.sync-conflict-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sync-conflict-options label { display: block; padding: 14px; border: 1px solid var(--border, #dce6e4); border-radius: 12px; cursor: pointer; overflow-wrap: anywhere; }
.sync-conflict-options label:has(input:checked) { border-color: #2ba582; background: rgba(43, 165, 130, .08); }
.sync-conflict-options input { margin-right: 8px; }
.sync-conflict-options p, .sync-conflict-options li { font-size: 13px; line-height: 1.7; }
.sync-conflict-options ul { padding-left: 20px; max-height: 220px; overflow: auto; }
.sync-action-status { padding: 12px 14px; border-radius: 10px; background: var(--row-bg, #eef7f3); color: var(--text); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.sync-action-status[aria-busy="true"] { border-left: 3px solid var(--aqua, #2ba682); }
.sync-settings-page button, .sync-settings-page summary { touch-action: manipulation; }
.sync-settings-page .mine-row { width: 100%; text-align: left; }
.sync-settings-page button:disabled { opacity: .6; cursor: wait; }
@media (max-width: 600px) { .sync-conflict-options { grid-template-columns: 1fr; } }

/* Explicit clutch completion, separate from recording a hatch batch. */
.breeding-hatch-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.breeding-hatch-actions > button { width: 100%; min-height: 48px; min-width: 0; }
.breeding-hatch-actions > button:disabled { opacity: .5; cursor: default; }
.breeding-complete-footer { display: flex; justify-content: flex-end; margin-top: 8px; }
.breeding-complete-badge { display: inline-flex; align-items: center; border-radius: 6px; padding: 4px 9px; font-size: 12px; line-height: 1.4; font-weight: 700; color: #1d7862; background: #e8f5ee; }
html[data-theme-color="dark"] .breeding-complete-badge { color: #b2e7ca; background: #244337; }

/* Breeding workspace: scoped to breeding screens, not archive/ledger forms. */
.breeding-workspace { --breeding-accent: var(--green); }
.breeding-workspace .breeding-overview, .breeding-workspace .breeding-section, .breeding-workspace #breedingForm { border: 1px solid var(--line); border-radius: 18px !important; background: var(--card-bg); padding: 20px; box-shadow: none; margin: 0 0 16px; }
.breeding-overview-top, .breeding-section-heading, .breeding-progress-copy { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.breeding-overview-top { font-size: 12px; color: var(--muted); }
.breeding-status { flex-shrink: 0; border-radius: 20px; padding: 5px 10px; color: var(--green); background: var(--raised-bg); font-size: 11px; }
.breeding-workspace .breeding-overview h2 { margin: 16px 0 7px; font-size: 22px; line-height: 1.4; letter-spacing: -.4px; overflow-wrap: anywhere; }
.breeding-overview > p { color: var(--muted); font-size: 12px; margin: 0; line-height: 1.6; }
.breeding-overview-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.breeding-overview-stats > div { display: grid; gap: 5px; padding-left: 16px; border-left: 1px solid var(--line); }
.breeding-overview-stats > div:first-child { padding-left: 0; border-left: 0; }
.breeding-overview-stats span { font-size: 12px; color: var(--muted); }
.breeding-overview-stats strong { font-size: 27px; font-weight: 650; line-height: 1.3; color: var(--text); }
.breeding-overview-stats > div:last-child strong { color: var(--green); }
.breeding-overview-stats small { margin-left: 5px; font-size: 11px; font-weight: 400; color: var(--muted); }
.breeding-workspace #breedingDetailForm.breeding-editor { padding: 0 !important; margin: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
.breeding-section-heading { margin-bottom: 18px; }
.breeding-section-heading h3, .breeding-workspace .form-head h3 { margin: 0; font-size: 17px; color: var(--text); }
.breeding-section-heading > span { font-size: 11px !important; color: var(--muted); }
.breeding-workspace .form-head { margin-bottom: 18px; }
.breeding-workspace .breeding-photo-box { padding: 12px; margin: 0 0 20px; display: flex; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--section-bg); }
.breeding-workspace .breeding-photo-box > img, .breeding-workspace .breeding-photo-box > span { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 10px; object-fit: cover; }
.breeding-workspace .breeding-photo-box > div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-width: 0; }
.breeding-workspace .breeding-photo-box button { min-height: 40px; margin: 0; font-size: 13px; padding: 8px 10px; }
.breeding-workspace .breeding-photo-box p, .breeding-workspace .breeding-photo-box small { flex-basis: 100%; margin: 0; font-size: 11px; line-height: 1.5; }
.breeding-workspace :is(#breedingDetailForm, #breedingForm) .breeding-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
.breeding-workspace :is(#breedingDetailForm, #breedingForm) .breeding-fields > label, .breeding-workspace .breeding-note { display: flex !important; flex-direction: column; align-items: stretch !important; grid-template-columns: none !important; min-width: 0; margin: 0; padding: 0; gap: 8px !important; border: 0; }
.breeding-workspace :is(#breedingDetailForm, #breedingForm) .breeding-fields > :is(.breeding-date-field, .breeding-mother-field, .breeding-pool-field, .breeding-manual-mother, .breeding-field-wide) { grid-column: 1 / -1 !important; }
.breeding-workspace :is(#breedingDetailForm, #breedingForm) label > span { color: var(--muted) !important; font-size: 12px !important; white-space: normal !important; line-height: 1.5 !important; }
.breeding-workspace label small { font-size: 11px; margin-left: 5px; color: var(--muted); }
.breeding-workspace :is(#breedingDetailForm, #breedingForm) :is(.field, .select, textarea) { box-sizing: border-box; width: 100% !important; min-width: 0 !important; max-width: 100%; min-height: 46px; margin: 0 !important; padding: 10px 12px !important; border: 1px solid var(--line) !important; border-radius: 10px !important; background: var(--section-bg) !important; color: var(--text) !important; font-size: 16px !important; text-align: left !important; line-height: 1.5; box-shadow: none !important; }
.breeding-workspace :is(#breedingDetailForm, #breedingForm) input[type="date"] { appearance: none; -webkit-appearance: none; }
.breeding-workspace input[type="date"]::-webkit-date-and-time-value { text-align: left; min-width: 0; }
.breeding-workspace .archive-directory-trigger { white-space: normal; overflow-wrap: anywhere; }
.breeding-workspace :is(input, select, textarea, button):focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.breeding-workspace .breeding-note { margin-top: 18px; }
.breeding-workspace :is(#breedingDetailForm, #breedingForm) textarea { min-height: 88px; resize: vertical; }
.breeding-workspace input::placeholder, .breeding-workspace textarea::placeholder { font-size: 13px; color: var(--muted); }
.breeding-workspace .breeding-detail-actions { margin-top: 16px; }
.breeding-workspace :is(.primary, .secondary) { min-height: 46px; border-radius: 11px; font-size: 14px; box-shadow: none !important; }
.breeding-workspace #breedingForm > .primary { margin-top: 18px; width: 100%; }
.breeding-workspace .breeding-hatch-panel { margin-top: 0; }
.breeding-workspace .breeding-hint, .breeding-workspace .breeding-hatch-panel > p { color: var(--muted); font-size: 12px; line-height: 1.7; margin: 12px 0; }
.breeding-progress-copy { font-size: 13px; margin-bottom: 10px; }
.breeding-progress-copy > span { color: var(--muted); font-size: 12px !important; }
.breeding-progress { display: block; width: 100%; height: 6px; border: 0; border-radius: 9px; overflow: hidden; appearance: none; background: var(--raised-bg); accent-color: var(--green); margin-bottom: 20px; }
.breeding-progress::-webkit-progress-bar { background: var(--raised-bg); border-radius: 9px; }
.breeding-progress::-webkit-progress-value { background: var(--green); border-radius: 9px; }
.breeding-progress::-moz-progress-bar { background: var(--green); border-radius: 9px; }
.breeding-workspace .breeding-hatch-actions { margin-top: 16px; display: flex; gap: 10px; }
.breeding-workspace .breeding-hatch-actions > button { flex: 1; width: auto; margin: 0; }
.breeding-workspace .breeding-history { margin-top: 20px; padding: 0 4px; }
.breeding-history > summary { padding: 12px 0; color: var(--text); font-size: 14px; cursor: pointer; }
.breeding-history > summary span { color: var(--muted); font-size: 12px; margin-left: 8px; }
.breeding-workspace .breeding-intro { padding: 20px; margin-bottom: 18px; border-radius: 18px !important; }
.breeding-workspace .breeding-intro h2 { font-size: 24px; margin: 8px 0; }
.breeding-workspace .breeding-intro p { font-size: 12px; line-height: 1.6; }
.breeding-workspace .breeding-row { padding: 16px; border-radius: 16px !important; box-shadow: none; }
.breeding-workspace .breeding-row-heading strong { font-size: 16px; }
.breeding-workspace [hidden], .breeding-workspace :is(#breedingDetailForm, #breedingForm) [hidden] { display: none !important; }
.breeding-workspace :is(#breedingDetailForm, #breedingForm) .breeding-fields > label[hidden] { display: none !important; }
html[data-theme-color="dark"] .breeding-workspace { color-scheme: dark; --line: #343a37; }
html[data-theme-color="dark"] .breeding-workspace :is(.breeding-overview, .breeding-section, #breedingForm) { background: var(--card-bg) !important; }
@media (max-width: 360px) {
  .breeding-workspace .breeding-overview, .breeding-workspace .breeding-section, .breeding-workspace #breedingForm { padding: 16px; }
  .breeding-workspace .breeding-overview h2 { font-size: 20px; }
  .breeding-workspace #breedingDetailForm .breeding-hatch-fields { grid-template-columns: minmax(0, 1fr); }
}
