.dashboard {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 22px;
  min-height: 58vh;
}

.community-view {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 16px;
  min-height: calc(100svh - 190px);
}

.settings-view {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 28px;
  min-height: 58vh;
}

.capture-view {
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 18px;
}

body.has-bottom-tabs .app-shell {
  padding-bottom: calc(var(--bottom-tabs-rendered-height, var(--bottom-tabs-total-height)) + 32px);
}

.community-share-panel {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(31, 122, 90, 0.14);
  border-radius: 8px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 34px rgba(25, 42, 35, 0.07);
}

.community-share-panel > div {
  min-width: 0;
}

.community-share-title {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.community-share-copy {
  min-height: 20px;
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.share-switch {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  cursor: pointer;
}

.share-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.share-switch-track {
  width: 46px;
  height: 26px;
  display: block;
  border-radius: 999px;
  padding: 3px;
  background: #b9c4bf;
  transition: background 160ms ease;
}

.share-switch-track span {
  width: 20px;
  height: 20px;
  display: block;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 7px rgba(25, 42, 35, 0.22);
  transition: transform 160ms ease;
}

.share-switch:active .share-switch-track {
  transform: scale(0.96);
}

.share-switch input:checked + .share-switch-track {
  background: var(--primary);
}

.share-switch input:checked + .share-switch-track span {
  transform: translateX(20px);
}

.share-switch input:focus-visible + .share-switch-track {
  outline: 3px solid rgba(31, 122, 90, 0.2);
  outline-offset: 2px;
}

.share-switch input:disabled + .share-switch-track,
.share-switch input:disabled ~ .share-switch-text {
  opacity: 0.5;
  cursor: wait;
}

.share-switch-text {
  min-width: 42px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.community-section {
  min-width: 0;
  min-height: min(460px, 52svh);
}

.community-content-tabs {
  height: 46px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  align-items: stretch;
  border: 1px solid rgba(31, 122, 90, 0.13);
  border-radius: 8px;
  padding: 4px;
  background: #eef5f1;
  box-shadow: 0 10px 28px rgba(25, 42, 35, 0.05);
}

.community-content-tab {
  min-height: 0;
  height: 100%;
  border-radius: 6px;
  background: #eef5f1;
  background-clip: padding-box;
  color: var(--muted);
  box-shadow: none;
  font-size: 14px;
  font-weight: 780;
  line-height: 1;
  transition: border-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.community-content-tab:hover:not(:disabled),
.community-content-tab:focus-visible {
  background: #eef5f1;
  color: var(--muted);
  box-shadow: none;
  outline: none;
  transform: none;
}

.community-content-tab:active:not(:disabled) {
  background: #e3eee8;
  color: var(--primary-strong);
  box-shadow: none;
  transform: scale(0.985);
}

.community-content-tab.is-active,
.community-content-tab.is-active:hover:not(:disabled),
.community-content-tab.is-active:focus-visible {
  border: 1px solid rgba(31, 122, 90, 0.18);
  background: #fff;
  color: var(--primary-strong);
  box-shadow: 0 4px 14px rgba(25, 42, 35, 0.07);
  outline: none;
}

.community-ranking {
  min-width: 0;
  border-block: 1px solid rgba(31, 122, 90, 0.12);
  padding: 18px 0;
}

.community-ranking-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.community-ranking-kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.community-ranking h2 {
  margin: 0;
  font-size: 24px;
}

.ranking-periods {
  height: 42px;
  display: inline-grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px;
  background: #eef5f1;
}

.ranking-period {
  min-height: 0;
  height: 100%;
  border-radius: 5px;
  padding: 0 13px;
  background: #eef5f1;
  background-clip: padding-box;
  color: var(--muted);
  box-shadow: none;
  font-size: 12px;
  line-height: 1;
  transition: border-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.ranking-period:hover:not(:disabled),
.ranking-period:focus-visible {
  background: #eef5f1;
  color: var(--muted);
  box-shadow: none;
  outline: none;
  transform: none;
}

.ranking-period:active:not(:disabled) {
  background: #e3eee8;
  color: var(--primary-strong);
  box-shadow: none;
  transform: scale(0.985);
}

.ranking-period.is-active,
.ranking-period.is-active:hover:not(:disabled),
.ranking-period.is-active:focus-visible {
  border: 1px solid rgba(31, 122, 90, 0.18);
  background: #fff;
  color: var(--primary-strong);
  box-shadow: 0 3px 10px rgba(25, 42, 35, 0.06);
  outline: none;
}

html[data-theme^="glass-"] .community-content-tab:not(.is-active),
html[data-theme^="glass-"] .community-content-tab:not(.is-active):hover:not(:disabled),
html[data-theme^="glass-"] .community-content-tab:not(.is-active):focus-visible,
html[data-theme^="glass-"] .community-content-tab:not(.is-active):active:not(:disabled),
html[data-theme^="glass-"] .ranking-period:not(.is-active),
html[data-theme^="glass-"] .ranking-period:not(.is-active):hover:not(:disabled),
html[data-theme^="glass-"] .ranking-period:not(.is-active):focus-visible,
html[data-theme^="glass-"] .ranking-period:not(.is-active):active:not(:disabled) {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: rgba(37, 49, 58, 0.78);
  transform: none;
}

html[data-theme^="glass-"] .community-content-tab.is-active,
html[data-theme^="glass-"] .community-content-tab.is-active:hover:not(:disabled),
html[data-theme^="glass-"] .community-content-tab.is-active:focus-visible,
html[data-theme^="glass-"] .ranking-period.is-active,
html[data-theme^="glass-"] .ranking-period.is-active:hover:not(:disabled),
html[data-theme^="glass-"] .ranking-period.is-active:focus-visible {
  border-color: rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.38)),
    radial-gradient(120% 120% at 0% 0%, rgba(255, 218, 246, 0.18), rgba(255, 255, 255, 0) 56%);
  color: #2f7280;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 8px 22px rgba(80, 102, 119, 0.1);
}

.ranking-list {
  min-height: 82px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  margin-top: 14px;
  transition: opacity 140ms ease;
}

.ranking-item {
  width: 100%;
  min-width: 0;
  min-height: 72px;
  display: grid;
  grid-template-columns: 32px 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.76);
  background-clip: padding-box;
  color: var(--ink);
  text-align: left;
  overflow: hidden;
}

.ranking-item:hover:not(:disabled) {
  border-color: rgba(31, 122, 90, 0.28);
  background: #fff;
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(25, 42, 35, 0.09);
}

.ranking-item:active:not(:disabled) {
  border-color: rgba(31, 122, 90, 0.24);
  background: #f1f8f4;
  box-shadow: 0 5px 14px rgba(25, 42, 35, 0.08);
  transform: scale(0.992);
}

.ranking-item.rank-1,
.ranking-item.rank-2,
.ranking-item.rank-3 {
  border-color: rgba(214, 159, 54, 0.3);
}

.ranking-number {
  color: var(--muted);
  font-size: 17px;
  font-weight: 850;
  text-align: center;
}

.rank-1 .ranking-number {
  color: #ad7820;
}

.ranking-avatar {
  width: 42px;
  height: 42px;
  font-size: 14px;
}

.ranking-main {
  min-width: 0;
}

.ranking-main strong,
.ranking-main small,
.ranking-score strong,
.ranking-score small {
  display: block;
}

.ranking-main strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-main small {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-score {
  color: var(--primary-strong);
  text-align: right;
}

.ranking-score strong {
  font-size: 18px;
}

.ranking-score small {
  color: var(--muted);
  font-size: 9px;
}

.ranking-empty {
  grid-column: 1 / -1;
  margin: 8px 0;
  color: var(--muted);
  font-size: 13px;
}

.community-heading {
  align-items: flex-end;
  min-height: 0;
}

.community-heading > div > span {
  display: block;
}

.community-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
  margin-top: 8px;
  min-height: 260px;
}

.community-masonry-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-self: start;
  gap: 12px;
}

.community-card {
  --community-media-width: 112px;
  --community-cover-height: 149px;
  --community-food-row-height: 56px;
  --community-media-gap: 8px;
  --community-card-content-height: calc(var(--community-cover-height) + var(--community-media-gap) + var(--community-food-row-height));
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-self: start;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: rgba(255, 255, 255, 0.92);
  background-clip: padding-box;
  box-shadow: 0 12px 32px rgba(25, 42, 35, 0.07);
  cursor: pointer;
  overflow: hidden;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

@supports (content-visibility: auto) {
  .community-card {
    content-visibility: auto;
    contain-intrinsic-size: 360px;
  }
}

.community-card:hover,
.community-card:focus-visible {
  border-color: rgba(31, 122, 90, 0.3);
  box-shadow: 0 16px 36px rgba(25, 42, 35, 0.11);
  outline: none;
  transform: translateY(-2px);
}

.community-card:active {
  border-color: rgba(31, 122, 90, 0.26);
  background: #f4faf7;
  box-shadow: 0 7px 18px rgba(25, 42, 35, 0.09);
  transform: translateY(0) scale(0.992);
}

.community-card-media {
  width: 100%;
  height: auto;
  min-width: 0;
  align-self: start;
  display: grid;
  grid-auto-rows: max-content;
  gap: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.community-cover {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  align-self: start;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 7px 7px 0 0;
  background: transparent;
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 780;
}

.community-card.community-cover-type-body .community-cover {
  aspect-ratio: 3 / 4;
}

.community-card.community-cover-type-food .community-cover,
.community-card.has-no-community-cover .community-cover {
  aspect-ratio: 1 / 1;
}

.community-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.community-food-preview {
  width: 100%;
  height: var(--community-food-row-height);
  min-width: 0;
  align-self: start;
  position: relative;
  display: block;
  overflow: hidden;
  pointer-events: none;
}

.community-food-carousel {
  --community-food-index: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  scroll-snap-type: none;
  scrollbar-width: none;
  touch-action: pan-y;
  pointer-events: none;
}

.community-food-carousel::-webkit-scrollbar {
  display: none;
}

.community-food-group {
  flex: 0 0 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  aspect-ratio: auto;
  gap: 4px;
  scroll-snap-align: none;
  transform: translateX(calc(var(--community-food-index) * -100%));
  transition: transform 520ms cubic-bezier(0.22, 0.84, 0.28, 1);
  will-change: transform;
}

.community-food-thumb {
  min-width: 0;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(31, 122, 90, 0.1);
  border-radius: 6px;
  background: transparent;
}

.community-food-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
}

.community-food-thumb.is-empty {
  border-color: transparent;
  background: transparent;
}

.community-food-dots {
  position: absolute;
  right: 4px;
  bottom: 4px;
  left: 4px;
  display: flex;
  justify-content: center;
  gap: 4px;
  line-height: 0;
  pointer-events: none;
}

.community-food-dots span {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(31, 122, 90, 0.22);
}

.community-food-dots span.is-active {
  width: 10px;
  background: rgba(31, 122, 90, 0.68);
}

.community-card-body {
  min-width: 0;
  width: 100%;
  height: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  row-gap: 6px;
  overflow: visible;
  padding: 10px;
}

.community-card-identity {
  grid-area: identity;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

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

.community-card-time {
  flex: 0 0 auto;
  color: rgba(82, 98, 91, 0.62);
  font-size: 10px;
  font-weight: 720;
  line-height: 1;
  white-space: nowrap;
}

.community-member-avatar,
.ranking-avatar,
.community-detail-avatar,
.community-comment-avatar {
  position: relative;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(31, 122, 90, 0.12);
  border-radius: 50%;
  background: linear-gradient(145deg, #dcefe6, #f7fbf8);
  background-position: center;
  background-size: cover;
  color: var(--primary-strong);
  font-weight: 850;
}

.community-member-avatar {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.community-member-avatar img,
.ranking-avatar img,
.community-detail-avatar img,
.community-comment-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.community-alias {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 17px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-weight-mini {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  margin-top: 8px;
  border: 1px solid rgba(111, 169, 143, 0.18);
  border-radius: 8px;
  padding: 3px 6px;
  background: linear-gradient(135deg, rgba(242, 248, 245, 0.98), rgba(255, 255, 255, 0.86));
  color: var(--chart-loss);
}

.community-card .community-weight-mini {
  grid-area: chart;
  min-height: 54px;
  height: 72px;
  flex: 0 0 72px;
  margin-top: 0;
  padding: 2px 5px;
}

.community-card .community-weight-mini.is-empty {
  min-height: 54px;
  height: 72px;
}

.community-weight-mini svg {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: block;
  align-self: stretch;
  overflow: visible;
}

.community-weight-mini.is-gain {
  border-color: rgba(216, 149, 130, 0.22);
  color: var(--chart-gain);
}

.community-weight-mini.is-empty {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-style: dashed;
  padding: 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.community-self-badge {
  display: inline-block;
  margin-left: 5px;
  color: var(--primary);
  font-size: 11px;
  vertical-align: 2px;
}

.community-card-meta,
.community-card-date,
.community-card-mood {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.community-card-mood {
  grid-area: mood;
  display: block;
  overflow: hidden;
  min-height: 0;
  margin: 0;
  color: var(--ink);
  line-height: 1.28;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-card-mood.is-empty {
  color: var(--muted);
}

.community-card-separator {
  grid-area: separator;
  width: 100%;
  height: 1px;
  margin: 0;
  background: var(--line);
}

.community-card-footer {
  grid-area: footer;
  width: 100%;
  min-height: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.community-card-records {
  min-width: 0;
  overflow: hidden;
  color: var(--primary-strong);
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-card-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  white-space: nowrap;
}

.community-message {
  min-height: 22px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.community-empty {
  grid-column: 1 / -1;
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(31, 122, 90, 0.2);
  border-radius: 8px;
  padding: 28px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  text-align: center;
  line-height: 1.65;
}

.bottom-tabs {
  position: fixed;
  z-index: 1100;
  right: 0;
  bottom: 0;
  left: 0;
  height: var(--bottom-tabs-total-height);
  min-height: var(--bottom-tabs-total-height);
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 220px));
  align-items: start;
  justify-content: center;
  border-top: 1px solid rgba(31, 122, 90, 0.14);
  padding: 5px max(12px, env(safe-area-inset-right, 0px)) calc(5px + var(--bottom-safe-area)) max(12px, env(safe-area-inset-left, 0px));
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -8px 24px rgba(25, 42, 35, 0.07);
  backdrop-filter: blur(20px);
  contain: paint;
}

body.community-feature-disabled .bottom-tabs {
  grid-template-columns: repeat(2, minmax(120px, 220px));
}

body.community-feature-disabled #communityTabButton {
  display: none;
}

.bottom-tab {
  position: relative;
  align-self: start;
  width: 100%;
  height: 52px;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 0;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  line-height: 1.1;
  transform-origin: center;
  transition: color 140ms ease, background 140ms ease, transform 140ms ease;
  -webkit-tap-highlight-color: transparent;
}

.bottom-tab:hover:not(:disabled) {
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  transform: none;
}

.bottom-tab.is-active,
.bottom-tab.is-active:hover:not(:disabled),
.bottom-tab.is-active:focus-visible {
  background: transparent;
  color: var(--primary-strong);
}

.bottom-tab:active:not(:disabled) {
  background: transparent;
  color: var(--primary-strong);
  box-shadow: none;
  transform: scale(0.98);
}

.bottom-tab:focus {
  outline: none;
}

.bottom-tab:focus-visible {
  outline: none;
}

.bottom-tab.is-active::before {
  position: absolute;
  top: -5px;
  left: 50%;
  width: 34px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--primary);
  content: "";
  transform: translateX(-50%);
}

.bottom-tab svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.consent-backdrop {
  position: fixed;
  z-index: 1400;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--modal-safe-top-gap) var(--modal-safe-right-gap) var(--modal-safe-bottom-gap) var(--modal-safe-left-gap);
  background: rgba(15, 24, 20, 0.52);
  opacity: 0;
  backdrop-filter: blur(8px);
  transition: opacity 190ms ease, background-color 190ms ease;
}

.consent-backdrop.is-open {
  opacity: 1;
}

#feedbackModal {
  z-index: 1510;
}

#manualFoodModal {
  z-index: 1530;
}

#actionConfirmModal {
  z-index: 1580;
}

.consent-dialog {
  width: min(460px, 100%);
  max-height: calc(100dvh - var(--modal-safe-top-gap) - var(--modal-safe-bottom-gap));
  overflow-y: auto;
  border: 1px solid rgba(31, 122, 90, 0.18);
  border-radius: 8px;
  padding: 26px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(10, 24, 18, 0.28);
  opacity: 0.96;
  transform: translate3d(0, 8px, 0) scale(0.985);
  transition: opacity 190ms ease, transform 190ms cubic-bezier(0.22, 0.84, 0.2, 1);
  will-change: opacity, transform;
  scrollbar-width: none;
}

.consent-backdrop.is-open .consent-dialog {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.consent-dialog h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
}

.consent-dialog > p:not(.eyebrow),
.consent-dialog li {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.consent-dialog ul {
  margin: 16px 0 0;
  padding-left: 20px;
}

.consent-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}

.community-detail-backdrop {
  position: fixed;
  z-index: 1450;
  inset: 0;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 0 4vw;
  background: transparent;
  overscroll-behavior: contain;
  transition: none;
}

.community-detail-panel {
  width: min(1040px, 92vw);
  height: min(820px, 92dvh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: #f8faf9;
  box-shadow: 0 34px 100px rgba(4, 12, 8, 0.38);
  overscroll-behavior: contain;
  backface-visibility: hidden;
  transform: translate3d(0, 100%, 0);
  transition: transform 320ms cubic-bezier(0.32, 0, 0.18, 1);
  will-change: transform;
}

.community-detail-backdrop.is-open .community-detail-panel {
  transform: translate3d(0, 0, 0);
}

.community-detail-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 16px 20px;
  background: #fff;
}

.community-detail-header > div {
  flex: 1 1 auto;
  min-width: 0;
}

.community-detail-header p {
  margin: 0 0 3px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
}

.community-detail-header h2 {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 24px;
  line-height: 1;
}

.community-detail-title-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  max-width: 100%;
}

.community-detail-name-row {
  display: flex;
  min-width: 0;
  height: 44px;
  align-items: center;
  gap: 8px;
  line-height: 1;
}

.community-detail-avatar {
  width: 44px;
  height: 44px;
  font-size: 17px;
  box-shadow: 0 10px 24px rgba(25, 42, 35, 0.08);
}

.community-detail-gender {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-left: 0;
  background: none;
  color: currentColor;
  line-height: 0;
  box-shadow: none;
  transform: none;
}

.community-detail-gender svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-detail-gender[data-gender="male"] {
  color: #2f7dde;
}

.community-detail-gender[data-gender="female"] {
  color: #d94672;
}

.community-detail-avatar.has-image {
  border-color: rgba(31, 122, 90, 0.12);
  background-color: #eef6f2;
}

.community-detail-avatar img {
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

@media (max-width: 620px) {
  .community-detail-title-row {
    grid-template-columns: 42px minmax(0, 1fr);
    column-gap: 10px;
  }

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

  .community-detail-name-row {
    height: 42px;
    gap: 7px;
  }

  .community-detail-gender {
    width: 18px;
    height: 18px;
  }
}

.community-detail-close {
  min-height: 38px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: none;
}

.community-detail-content {
  flex: 1 1 auto;
  min-height: 0;
  display: block;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.community-detail-loading {
  min-height: 100%;
  color: var(--muted);
}

.community-detail-skeleton-profile,
.community-detail-skeleton-record-area {
  pointer-events: none;
}

.community-detail-skeleton-block,
.community-detail-skeleton-line,
.community-detail-skeleton-pill,
.community-detail-skeleton-circle,
.community-detail-skeleton-card {
  display: block;
  background: rgba(31, 122, 90, 0.09);
  background: color-mix(in srgb, var(--primary, #1f7a5a) 10%, var(--surface, #fff));
  animation: community-detail-skeleton-pulse 1100ms ease-in-out 400ms infinite alternate;
}

.community-detail-skeleton-profile .community-detail-cover {
  color: transparent;
}

.community-detail-skeleton-line {
  width: 100%;
  height: 13px;
  border-radius: 999px;
}

.community-detail-skeleton-line.is-short {
  width: 34%;
  height: 10px;
}

.community-detail-skeleton-line.is-medium {
  width: 68%;
}

.community-detail-skeleton-actions {
  pointer-events: none;
}

.community-detail-skeleton-pill {
  width: min(100%, 220px);
  height: 42px;
  border-radius: 999px;
}

.community-detail-skeleton-action-group {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.community-detail-skeleton-circle {
  width: 48px;
  height: 42px;
  border-radius: 999px;
}

.community-detail-skeleton-card {
  min-height: 128px;
  border: 1px solid color-mix(in srgb, var(--line, #d8e1dd) 74%, transparent);
  border-radius: 18px;
}

.community-detail-skeleton-card.is-primary {
  min-height: 236px;
}

.community-detail-error {
  min-height: 320px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 7px;
  padding: 32px;
  color: var(--muted);
  text-align: center;
}

.community-detail-error strong {
  color: var(--ink);
  font-size: 18px;
}

.community-detail-error span {
  max-width: 42ch;
  overflow-wrap: anywhere;
}

.community-detail-error small {
  font-size: 12px;
}

.community-detail-content.is-community-detail-entering > .community-detail-profile {
  animation:
    community-detail-content-enter
    220ms
    cubic-bezier(0.22, 0.82, 0.24, 1)
    0ms
    1
    backwards;
}

.community-detail-content.is-community-detail-entering > .community-detail-record-area {
  animation:
    community-detail-content-enter
    220ms
    cubic-bezier(0.22, 0.82, 0.24, 1)
    60ms
    1
    backwards;
}

@keyframes community-detail-skeleton-pulse {
  from {
    opacity: 0.62;
  }

  to {
    opacity: 1;
  }
}

@keyframes community-detail-content-enter {
  from {
    opacity: 0;
    transform: translate3d(0, 6px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.community-detail-profile {
  position: relative;
  z-index: 20;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(148px, 220px) minmax(0, 1fr);
  align-content: start;
  gap: 14px 18px;
  border-bottom: 1px solid rgba(31, 122, 90, 0.1);
  padding: 20px 24px 24px;
  background:
    linear-gradient(135deg, rgba(31, 122, 90, 0.08), transparent 40%),
    #fff;
}

.community-detail-media {
  min-width: 0;
  align-self: start;
}

.community-detail-content::-webkit-scrollbar,
.community-detail-profile::-webkit-scrollbar,
.community-comments::-webkit-scrollbar {
  display: none;
}

.community-detail-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #e7f0eb;
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 760;
}

.community-detail-cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.community-detail-cover-image {
  opacity: 0;
  transition: opacity 180ms ease;
}

.community-detail-cover-image.is-loaded {
  opacity: 1;
}

.community-detail-summary {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto;
  align-content: start;
  gap: 10px;
  min-height: 0;
}

.community-detail-latest {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.community-detail-mood {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.community-detail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
  border: 1px solid rgba(31, 122, 90, 0.1);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.community-detail-stats span {
  min-width: 0;
  text-align: center;
}

.community-detail-stats strong,
.community-detail-stats small {
  display: block;
}

.community-detail-stats strong {
  color: var(--primary-strong);
  font-size: 22px;
}

.community-detail-stats small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.community-detail-actions {
  position: relative;
  z-index: 35;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  align-self: start;
  height: 42px;
  margin-top: 0;
  margin-left: auto;
}

.community-detail-action-row {
  position: relative;
  z-index: 30;
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(148px, 220px) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.community-detail-trend {
  grid-column: 1 / -1;
  position: relative;
  min-width: 0;
  min-height: 236px;
  display: block;
  margin-top: 2px;
  border: 1px solid rgba(31, 122, 90, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(25, 42, 35, 0.06);
}

.community-detail-trend.is-empty {
  min-height: 120px;
}

.community-detail-trend-empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.community-detail-trend .chart-scroll {
  touch-action: auto;
}

.community-detail-trend svg {
  height: 236px;
  display: block;
  min-width: 100%;
}

.community-detail-trend-day-label {
  fill: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.community-detail-trend-bar {
  transition: stroke 140ms ease, stroke-width 140ms ease, opacity 140ms ease;
}

.community-detail-record-area {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  padding: 18px;
}

.community-detail-weight-chart {
  min-height: 398px;
}

.community-detail-record-area > .weight-calendar {
  width: 100%;
  min-width: 0;
}

.community-detail-record-area > .community-detail-goal-chart {
  width: 100%;
  min-width: 0;
}

.community-detail-history-section {
  padding: 16px;
  box-shadow: 0 14px 38px rgba(25, 42, 35, 0.06);
}

.community-detail-history-section .history-list {
  max-height: none;
}

.community-detail-history-section .history-item.is-body-record {
  grid-template-columns: 72px minmax(0, 1fr) auto;
}

.community-detail-history-section .history-item.is-food,
.community-detail-history-section .history-item.is-health-record {
  grid-template-columns: 72px minmax(0, 1fr);
}

@media (prefers-reduced-motion: reduce) {
  .community-detail-skeleton-block,
  .community-detail-skeleton-line,
  .community-detail-skeleton-pill,
  .community-detail-skeleton-circle,
  .community-detail-skeleton-card,
  .community-detail-content.is-community-detail-entering > .community-detail-profile,
  .community-detail-content.is-community-detail-entering > .community-detail-record-area {
    animation: none;
  }

  .community-detail-cover-image {
    opacity: 1;
    transition: none;
  }
}

.community-comments-backdrop {
  position: fixed;
  z-index: 1465;
  inset: 0;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 0 4vw;
  background: transparent;
  overscroll-behavior: contain;
  transition: none;
}

.community-comments-panel {
  width: min(840px, 92vw);
  height: min(650px, calc(100dvh - var(--modal-safe-top-gap) - 88px));
  max-height: calc(100dvh - var(--modal-safe-top-gap) - 88px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: #f8faf9;
  box-shadow: 0 28px 86px rgba(4, 12, 8, 0.28);
  transform: translate3d(0, 100%, 0);
  transition: transform 320ms cubic-bezier(0.32, 0, 0.18, 1);
  will-change: transform;
}

.community-comments-backdrop.is-open .community-comments-panel {
  transform: translate3d(0, 0, 0);
}

.community-comments-modal-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.92);
}

.community-comments-modal-header p,
.community-comments-modal-header h2 {
  margin: 0;
}

.community-comments-modal-header p {
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 820;
}

.community-comments-modal-header h2 {
  color: var(--ink);
  font-size: 20px;
}

.community-comments-close {
  min-height: 36px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: none;
}

.community-comments-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.community-comments-panel .community-comments {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 12px 14px max(10px, calc(env(safe-area-inset-bottom, 0px) + 8px));
  overflow: hidden;
}

.community-comments-panel .community-comment-list {
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

.community-detail-utility {
  display: grid;
  justify-items: end;
  gap: 12px;
  margin-top: 18px;
}

.community-detail-replay {
  width: 100%;
  min-width: 0;
  height: 42px;
  min-height: 42px;
  border-color: rgba(31, 122, 90, 0.18);
  background: #e8f6ef;
  color: var(--primary-strong);
}

.community-detail-replay:hover:not(:disabled),
.community-detail-replay:focus-visible {
  border-color: rgba(31, 122, 90, 0.26);
  background: #ddf0e7;
  color: var(--primary-strong);
}

html[data-theme^="glass-"] .community-detail-replay {
  border-color: rgba(105, 183, 207, 0.26);
  background: rgba(255, 255, 255, 0.34);
  color: #2f7280;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 8px 20px rgba(80, 102, 119, 0.08);
}

html[data-theme^="glass-"] .community-detail-replay:hover:not(:disabled),
html[data-theme^="glass-"] .community-detail-replay:focus-visible {
  border-color: rgba(105, 183, 207, 0.38);
  background: rgba(255, 255, 255, 0.48);
  color: #2f7280;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 10px 24px rgba(80, 102, 119, 0.1);
}

html[data-theme^="glass-"] .community-self-badge,
html[data-theme^="glass-"] .community-card-records {
  color: #2f7280;
}

.community-social-button {
  width: 44px;
  height: 42px;
  min-height: 42px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid rgba(31, 122, 90, 0.14);
  border-radius: 999px;
  padding: 0;
  background: rgba(255, 255, 255, 0.84);
  background-clip: padding-box;
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(25, 42, 35, 0.06);
  font-size: 13px;
  overflow: hidden;
}

.community-social-button:disabled {
  cursor: default;
}

.community-social-button:disabled:not(.is-pending) {
  color: rgba(38, 52, 45, 0.46);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: none;
}

.community-icon-button .community-action-icon {
  width: 19px;
  height: 19px;
}

.community-comment-button,
.community-like-button.community-social-button {
  width: 62px;
  min-width: 62px;
}

.community-action-count {
  min-width: 17px;
  color: currentColor;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.community-share-button {
  width: 44px;
  min-width: 44px;
}

.community-member-more-wrap {
  position: relative;
  z-index: 50;
  display: inline-flex;
}

.community-more-button {
  width: 44px;
  min-width: 44px;
}

.community-more-button .community-comment-more-icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
}

.community-member-more-wrap .community-member-more-menu {
  z-index: 120;
  top: calc(100% + 8px);
  right: 0;
  min-width: 104px;
  border-color: rgba(76, 159, 178, 0.24);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(243, 250, 252, 0.94));
  box-shadow: 0 18px 42px rgba(72, 108, 119, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.community-member-more-wrap .community-member-more-menu button:disabled {
  opacity: 0.52;
  cursor: default;
}

.community-member-more-wrap .community-member-more-menu button {
  color: var(--ink);
}

.community-member-more-wrap .community-member-more-menu button:hover:not(:disabled),
.community-member-more-wrap .community-member-more-menu button:focus-visible {
  background: rgba(103, 174, 190, 0.12);
  color: var(--primary-strong);
}

.community-report-button {
  width: 44px;
  min-width: 44px;
  color: #8a641d;
}

.community-social-button:hover:not(:disabled),
.community-social-button:focus-visible {
  border-color: rgba(31, 122, 90, 0.26);
  transform: none;
}

.community-social-button:hover:not(:disabled) {
  background: #f4faf7;
  color: var(--primary-strong);
  box-shadow: 0 10px 22px rgba(31, 122, 90, 0.1);
}

.community-social-button:focus-visible {
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  box-shadow: none;
  outline: 2px solid rgba(31, 122, 90, 0.18);
  outline-offset: 2px;
}

.community-social-button:focus:not(:focus-visible) {
  outline: none;
}

.community-social-button:active:not(:disabled) {
  background: #e8f4ee;
  box-shadow: 0 5px 14px rgba(31, 122, 90, 0.1);
  transform: scale(0.97);
}

.community-social-button small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.community-action-icon,
.community-like-icon {
  position: relative;
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.community-action-icon svg,
.community-like-icon svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.community-like-button {
  --like-surface: rgba(255, 255, 255, 0.84);
  --like-surface-hover: #f4faf7;
  --like-line: rgba(216, 157, 43, 0.22);
  --like-line-strong: rgba(216, 157, 43, 0.36);
  --like-gold: #f5b82e;
  --like-gold-deep: #a76506;
  --like-gold-soft: rgba(245, 184, 46, 0.2);
  position: relative;
  width: auto;
  height: 42px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(31, 122, 90, 0.14);
  border-radius: 999px;
  background: var(--like-surface);
  background-clip: padding-box;
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(25, 42, 35, 0.06);
  line-height: 1;
  overflow: hidden;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.community-like-button.community-social-button {
  padding: 0 10px;
}

.community-like-button:hover:not(:disabled) {
  border-color: rgba(31, 122, 90, 0.26);
  background: var(--like-surface-hover);
  color: var(--primary-strong);
  box-shadow: 0 10px 22px rgba(31, 122, 90, 0.1);
  transform: none;
}

.community-like-button:focus-visible {
  border-color: rgba(31, 122, 90, 0.26);
  background: var(--like-surface);
  color: var(--ink);
  box-shadow: none;
  outline: 2px solid rgba(31, 122, 90, 0.18);
  outline-offset: 2px;
  transform: none;
}

.community-like-button:active:not(:disabled) {
  border-color: rgba(31, 122, 90, 0.26);
  background: #e8f4ee;
  color: var(--primary-strong);
  box-shadow: 0 5px 14px rgba(31, 122, 90, 0.1);
  transform: scale(0.97);
}

.community-like-button.is-liked {
  --like-surface: #fffaf0;
  --like-surface-hover: #fff5df;
  border-color: var(--like-line);
  background: var(--like-surface);
  color: var(--like-gold-deep);
  box-shadow: 0 8px 20px rgba(216, 157, 43, 0.08);
}

.community-like-button.is-liked:hover:not(:disabled) {
  border-color: var(--like-line-strong);
  background: var(--like-surface-hover);
  color: var(--like-gold-deep);
  box-shadow: 0 12px 28px rgba(216, 157, 43, 0.16);
}

.community-like-button.is-liked:focus-visible {
  border-color: var(--like-line);
  background: var(--like-surface);
  color: var(--like-gold-deep);
  outline-color: rgba(216, 157, 43, 0.24);
}

.community-like-button.is-liked .community-like-icon svg path:nth-child(2),
.community-like-button.is-liked .community-like-icon svg path:nth-child(3) {
  fill: var(--like-gold);
  stroke: var(--like-gold-deep);
}

.community-like-button.is-liked .community-like-icon svg {
  filter: drop-shadow(0 2px 4px rgba(245, 184, 46, 0.24));
}

.community-like-button.is-just-liked {
  overflow: visible;
}

.community-like-button.is-just-liked .community-like-icon {
  animation: community-like-pop 520ms cubic-bezier(0.16, 1, 0.3, 1);
}

.community-like-button.is-just-liked .community-like-icon::before {
  position: absolute;
  inset: -14px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 0%, rgba(245, 184, 46, 0.95) 0 2px, transparent 3px),
    radial-gradient(circle at 86% 28%, rgba(255, 213, 102, 0.9) 0 2px, transparent 3px),
    radial-gradient(circle at 72% 88%, rgba(245, 184, 46, 0.8) 0 1.8px, transparent 3px),
    radial-gradient(circle at 18% 72%, rgba(255, 199, 72, 0.82) 0 1.8px, transparent 3px),
    radial-gradient(circle at 10% 24%, rgba(245, 184, 46, 0.75) 0 1.6px, transparent 3px);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: scale(0.42) rotate(-12deg);
  animation: community-like-spark 520ms ease-out;
}

.community-like-button.is-just-liked .community-like-icon::after {
  position: absolute;
  inset: -9px;
  border-radius: 999px;
  background: var(--like-gold-soft);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: scale(0.35);
  animation: community-like-ring 520ms ease-out;
}

.community-like-button.is-just-liked .community-like-count {
  animation: community-like-count-pop 460ms cubic-bezier(0.16, 1, 0.3, 1);
}

.community-like-button.is-pending {
  cursor: pointer;
  opacity: 1;
}

.community-like-button:disabled {
  opacity: 1;
}

.community-like-button:disabled:not(.is-pending) {
  cursor: not-allowed;
  opacity: 0.72;
}

.community-like-button.is-basic-disabled {
  color: rgba(38, 52, 45, 0.46);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: none;
}

.community-like-count {
  display: inline-block;
  min-width: 0;
}

.community-like-count {
  min-width: 1.4em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: left;
}

.community-comments {
  min-width: 0;
  min-height: 0;
  display: block;
  padding: 14px 18px max(30px, calc(env(safe-area-inset-bottom, 0px) + 18px));
  overflow: visible;
  scrollbar-width: none;
  background: #f8faf9;
}

.community-comments-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.community-comments-heading h3 {
  margin: 0;
  font-size: 16px;
}

.community-comments-heading span {
  color: var(--muted);
  font-size: 12px;
}

.community-comment-form {
  position: relative;
  z-index: 2;
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  margin-top: 4px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  margin-bottom: 0;
}

.community-comment-form::before {
  display: none;
  content: none;
}

.community-comment-form input {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 999px;
  padding: 0 18px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.66), rgba(244, 252, 255, 0.42)),
    rgba(255, 255, 255, 0.52);
  box-shadow:
    0 14px 34px rgba(78, 127, 150, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px) saturate(1.14);
  font-size: 16px;
}

.community-comment-form input:focus {
  border-color: rgba(103, 174, 190, 0.42);
  box-shadow:
    0 0 0 3px rgba(103, 174, 190, 0.1),
    0 14px 34px rgba(78, 127, 150, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.community-comment-form button {
  min-width: 62px;
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 999px;
  padding: 0 16px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(244, 252, 255, 0.48)),
    rgba(255, 255, 255, 0.58);
  color: var(--ink);
  box-shadow:
    0 12px 28px rgba(78, 127, 150, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px) saturate(1.14);
}

.community-reply-target {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  border: 1px solid rgba(103, 174, 190, 0.18);
  border-radius: 999px;
  padding: 6px 8px 6px 12px;
  background: rgba(229, 247, 251, 0.42);
  color: #2f7280;
  font-size: 12px;
  font-weight: 760;
}

.community-reply-target span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-reply-target button {
  width: auto;
  min-width: 44px;
  min-height: 28px;
  border-color: rgba(103, 174, 190, 0.18);
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.58);
  color: #2f7280;
  font-size: 12px;
  box-shadow: none;
}

.community-detail-message {
  min-height: 0;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.community-detail-message:empty {
  margin: 0;
}

.ai-summary-backdrop {
  position: fixed;
  z-index: 1460;
  inset: 0;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 0 4vw;
  background: transparent;
  overscroll-behavior: contain;
}

.ai-summary-panel {
  width: min(820px, 92vw);
  height: min(680px, 84dvh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: #f8faf9;
  box-shadow: 0 34px 100px rgba(4, 12, 8, 0.34);
  overscroll-behavior: contain;
  transform: translate3d(0, 100%, 0);
  transition: transform 350ms cubic-bezier(0.34, 0, 0.2, 1);
  will-change: transform;
}

.ai-summary-backdrop.is-open .ai-summary-panel {
  transform: translate3d(0, 0, 0);
}

.ai-summary-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 16px 20px;
  background: #fff;
}

.ai-summary-header p {
  margin: 0 0 3px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 840;
}

.ai-summary-header h2 {
  margin: 0;
  font-size: 24px;
}

.ai-summary-close {
  min-height: 38px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  box-shadow: none;
}

.ai-summary-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(240, 248, 244, 0.85), rgba(248, 250, 249, 0.96)),
    #f8faf9;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.ai-summary-content::-webkit-scrollbar {
  display: none;
}

.ai-summary-status {
  min-height: 22px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.ai-summary-status.is-loading::after {
  width: 1.2em;
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  animation: ai-loading-dots 1.05s steps(4, end) infinite;
  content: "...";
}

@keyframes ai-loading-dots {
  from {
    width: 0;
  }
  to {
    width: 1.2em;
  }
}

.ai-summary-output {
  min-height: 180px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  font-weight: 620;
  line-height: 1.82;
  overflow-wrap: anywhere;
  box-shadow: none;
}

.ai-summary-output h2,
.ai-summary-output h3,
.ai-summary-output h4 {
  margin: 20px 0 8px;
  color: var(--ink);
  line-height: 1.28;
}

.ai-summary-output h2 {
  font-size: 20px;
}

.ai-summary-output h3 {
  font-size: 18px;
}

.ai-summary-output p,
.ai-summary-output ul,
.ai-summary-output ol,
.ai-summary-output blockquote,
.ai-summary-output .markdown-table-wrap {
  margin: 10px 0;
}

.ai-summary-output p:first-child,
.ai-summary-output h2:first-child,
.ai-summary-output h3:first-child {
  margin-top: 0;
}

.ai-summary-output ul,
.ai-summary-output ol {
  padding-left: 1.2em;
}

.ai-summary-output li + li {
  margin-top: 4px;
}

.ai-summary-output strong {
  color: var(--primary-strong);
  font-weight: 860;
}

.ai-summary-output code {
  border-radius: 5px;
  padding: 2px 5px;
  background: #edf5f1;
  color: var(--primary-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.ai-summary-output blockquote {
  border-left: 3px solid rgba(31, 122, 90, 0.32);
  padding: 8px 0 8px 12px;
  color: var(--muted);
  background: rgba(240, 248, 244, 0.72);
}

.ai-summary-output img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  margin: 12px 0;
  user-select: none;
  -webkit-user-drag: none;
}

.markdown-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(31, 122, 90, 0.1);
  border-radius: 8px;
  background: #fff;
}

.markdown-table-wrap table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.55;
}

.markdown-table-wrap th,
.markdown-table-wrap td {
  border-bottom: 1px solid rgba(31, 122, 90, 0.1);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.markdown-table-wrap th {
  background: #eef7f2;
  color: var(--primary-strong);
  font-weight: 860;
}

.markdown-table-wrap tr:last-child td {
  border-bottom: 0;
}

.ai-summary-output.is-typing::after {
  display: inline-block;
  width: 0.52em;
  height: 1.15em;
  margin-left: 2px;
  border-right: 2px solid rgba(31, 122, 90, 0.72);
  transform: translateY(0.16em);
  animation: ai-cursor-blink 880ms steps(2, start) infinite;
  content: "";
}

@keyframes ai-cursor-blink {
  50% {
    opacity: 0;
  }
}

.community-comment-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  margin-top: 8px;
  overflow: visible;
  overscroll-behavior-y: auto;
  padding: 0 2px 0 0;
  scrollbar-width: none;
  touch-action: auto;
}

.community-comment-list::-webkit-scrollbar {
  display: none;
}

.community-comment-item {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: start;
  margin-left: calc(var(--comment-depth, 0) * 20px);
  padding: 6px 0 1px;
}

.community-comment-item.is-own {
  margin-left: calc(var(--comment-depth, 0) * 20px);
}

.community-comment-avatar {
  width: 30px;
  height: 30px;
  margin-top: 2px;
  font-size: 11px;
}

.community-comment-avatar.is-deleted {
  border-style: dashed;
  background: rgba(116, 131, 125, 0.12);
  color: var(--muted);
}

.community-comment-bubble {
  min-width: 0;
  max-width: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.community-comment-children {
  grid-column: 2 / 4;
  display: grid;
  gap: 4px;
  margin-top: 2px;
  border-left: 1px solid rgba(108, 123, 131, 0.18);
  padding-left: 12px;
}

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

.community-comment-meta strong {
  min-width: 0;
  color: rgba(102, 116, 128, 0.68);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-comment-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
  line-height: 1;
}

.community-comment-footer time {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.community-comment-reply {
  width: auto;
  min-width: 0;
  min-height: 14px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: rgba(63, 77, 86, 0.78);
  font-size: 11px;
  font-weight: 760;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.community-comment-reply:hover:not(:disabled),
.community-comment-reply:focus-visible {
  background: transparent;
  color: var(--primary-strong);
  box-shadow: none;
  outline: none;
}

.community-comment-side {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  padding-top: 18px;
}

.community-comment-like,
.community-comment-more {
  width: auto;
  min-width: 0;
  min-height: 16px;
  height: 16px;
  display: inline-flex;
  place-items: center;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: rgba(72, 82, 88, 0.72);
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.community-comment-like {
  font-size: 11px;
  font-weight: 760;
  line-height: 16px;
}

.community-comment-like-icon,
.community-comment-more-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.community-comment-like-icon svg,
.community-comment-more-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}

.community-comment-like-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  shape-rendering: geometricPrecision;
}

.community-comment-more-icon svg {
  fill: currentColor;
}

.community-comment-like-count {
  min-width: 0;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.community-comment-like:hover:not(:disabled),
.community-comment-like:focus-visible,
.community-comment-more:hover:not(:disabled),
.community-comment-more:focus-visible {
  background: transparent;
  color: var(--primary-strong);
  box-shadow: none;
  outline: none;
  transform: none;
}

.community-comment-like:active:not(:disabled),
.community-comment-more:active:not(:disabled) {
  background: transparent;
  transform: scale(0.94);
}

.community-comment-like.is-liked {
  color: #f2365b;
}

.community-comment-like.is-liked:hover:not(:disabled),
.community-comment-like.is-liked:focus-visible,
.community-comment-like.is-liked:active:not(:disabled) {
  background: transparent;
  color: #f2365b;
  box-shadow: none;
}

.community-comment-like.is-liked .community-comment-like-icon svg {
  fill: currentColor;
  stroke: currentColor;
  filter: drop-shadow(0 2px 5px rgba(242, 54, 91, 0.22));
}

.community-comment-like.is-pending {
  cursor: pointer;
  opacity: 1;
}

.community-comment-like:disabled:not(.is-pending) {
  opacity: 0.58;
}

.community-comment-action-sheet-backdrop {
  position: fixed;
  z-index: 1475;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 4vw max(12px, calc(env(safe-area-inset-bottom, 0px) + 12px));
  background: rgba(24, 34, 36, 0.26);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.community-comment-action-sheet-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.community-comment-action-sheet-scrim {
  position: absolute;
  inset: 0;
  width: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
  color: transparent;
  transform: none;
  transition: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

html[data-theme^="glass-"] .community-comment-action-sheet-scrim,
html[data-theme^="glass-"] .community-comment-action-sheet-scrim:hover:not(:disabled),
html[data-theme^="glass-"] .community-comment-action-sheet-scrim:focus-visible,
html[data-theme^="glass-"] .community-comment-action-sheet-scrim:active:not(:disabled) {
  border-color: transparent;
  background: transparent;
  color: transparent;
  box-shadow: none;
  outline: none;
  transform: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.community-comment-action-sheet {
  position: relative;
  z-index: 1;
  width: min(840px, 92vw);
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  padding: 10px 12px 12px;
  background: rgba(248, 250, 249, 0.96);
  box-shadow: 0 20px 56px rgba(24, 34, 36, 0.22);
  transform: translate3d(0, calc(100% + 18px), 0);
  transition: transform 240ms cubic-bezier(0.34, 0, 0.2, 1);
}

.community-comment-action-sheet-backdrop.is-open .community-comment-action-sheet {
  transform: translate3d(0, 0, 0);
}

.community-comment-action-sheet-handle {
  width: 42px;
  height: 4px;
  justify-self: center;
  border-radius: 999px;
  background: rgba(120, 134, 142, 0.24);
}

.community-comment-action-button {
  width: 100%;
  min-height: 54px;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.96);
  color: var(--primary-strong);
  box-shadow: 0 10px 24px rgba(24, 34, 36, 0.08);
  font-size: 15px;
  font-weight: 820;
}

.community-comment-action-button:hover:not(:disabled),
.community-comment-action-button:focus-visible {
  background: #fff;
  color: var(--primary-strong);
  box-shadow: 0 12px 28px rgba(24, 34, 36, 0.12);
  outline: none;
}

.community-comment-action-button:active:not(:disabled) {
  transform: translateY(1px);
}

.community-comment-action-button.is-danger {
  color: #cf304f;
}

.community-comment-menu-wrap {
  position: absolute;
  z-index: 8;
  top: 22px;
  right: 0;
}

.community-comment-menu {
  position: absolute;
  z-index: 8;
  top: 0;
  right: 0;
  min-width: 92px;
  overflow: hidden;
  border: 1px solid rgba(125, 145, 156, 0.18);
  border-radius: 8px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 34px rgba(25, 42, 35, 0.14);
}

.community-comment-menu button {
  width: 100%;
  min-height: 34px;
  justify-content: flex-start;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  font-size: 13px;
  font-weight: 760;
  text-align: left;
}

.community-comment-menu button:hover:not(:disabled),
.community-comment-menu button:focus-visible {
  background: rgba(103, 174, 190, 0.1);
  color: var(--primary-strong);
  box-shadow: none;
  outline: none;
}

html[data-theme^="glass-"] .community-comment-reply,
html[data-theme^="glass-"] .community-comment-reply:hover:not(:disabled),
html[data-theme^="glass-"] .community-comment-reply:focus-visible,
html[data-theme^="glass-"] .community-comment-reply:active:not(:disabled),
html[data-theme^="glass-"] .community-comment-like,
html[data-theme^="glass-"] .community-comment-like:hover:not(:disabled),
html[data-theme^="glass-"] .community-comment-like:focus-visible,
html[data-theme^="glass-"] .community-comment-like:active:not(:disabled),
html[data-theme^="glass-"] .community-comment-more,
html[data-theme^="glass-"] .community-comment-more:hover:not(:disabled),
html[data-theme^="glass-"] .community-comment-more:focus-visible,
html[data-theme^="glass-"] .community-comment-more:active:not(:disabled) {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

html[data-theme^="glass-"] .community-comment-like.is-liked,
html[data-theme^="glass-"] .community-comment-like.is-liked:hover:not(:disabled),
html[data-theme^="glass-"] .community-comment-like.is-liked:focus-visible,
html[data-theme^="glass-"] .community-comment-like.is-liked:active:not(:disabled) {
  background: transparent;
  color: #f2365b;
  box-shadow: none;
}

@media (prefers-color-scheme: dark) {
  html[data-theme^="glass-"] .community-comment-action-sheet-backdrop.is-open {
    background: rgba(1, 8, 16, 0.46);
  }

  html[data-theme^="glass-"] .community-comment-action-sheet {
    border-color: rgba(189, 239, 255, 0.18);
    background:
      linear-gradient(145deg, rgba(23, 38, 54, 0.96), rgba(9, 18, 31, 0.96));
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }

  html[data-theme^="glass-"] .community-comment-action-sheet-handle {
    background: rgba(189, 239, 255, 0.22);
  }

  html[data-theme^="glass-"] .community-comment-action-button {
    background: rgba(255, 255, 255, 0.08);
    color: var(--primary);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }

  html[data-theme^="glass-"] .community-comment-action-button:hover:not(:disabled),
  html[data-theme^="glass-"] .community-comment-action-button:focus-visible {
    background: rgba(111, 207, 226, 0.12);
    color: var(--primary);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }

  html[data-theme^="glass-"] .community-comment-action-button.is-danger {
    color: #ff6f8a;
  }
}

.community-comment-bubble p {
  margin: 5px 0 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 450;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.community-comment-bubble .community-comment-reply-context {
  margin-top: 3px;
  color: var(--primary-strong);
  font-size: 11px;
  font-weight: 760;
}

.community-comment-bubble .community-comment-deleted {
  color: var(--muted);
  font-style: italic;
}

.community-comment-item.is-deleted .community-comment-bubble {
  border-style: dashed;
  background: transparent;
}

.community-comment-empty {
  min-height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  border: 1px dashed rgba(31, 122, 90, 0.14);
  border-radius: 8px;
  margin: 0;
  padding: 24px 16px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.community-comment-empty-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef6f1;
  color: var(--primary-strong);
}

.community-comment-empty-icon .community-action-icon {
  width: 18px;
  height: 18px;
}

.community-comment-empty strong,
.community-comment-empty small {
  display: block;
}

.community-comment-empty strong {
  color: var(--ink);
  font-size: 14px;
}

.community-comment-empty small {
  font-size: 12px;
}

@keyframes community-like-pop {
  0% {
    transform: scale(1) rotate(0deg);
  }
  32% {
    transform: scale(1.28) rotate(-7deg);
  }
  58% {
    transform: scale(0.94) rotate(3deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

@keyframes community-like-spark {
  0% {
    opacity: 0;
    transform: scale(0.42) rotate(-12deg);
  }
  24% {
    opacity: 1;
  }
  78% {
    opacity: 0.08;
    transform: scale(1.22) rotate(10deg);
  }
  100% {
    opacity: 0;
    transform: scale(1.28) rotate(10deg);
  }
}

@keyframes community-like-ring {
  0% {
    opacity: 0.64;
    transform: scale(0.35);
  }
  76% {
    opacity: 0;
    transform: scale(1.15);
  }
  100% {
    opacity: 0;
    transform: scale(1.15);
  }
}

@keyframes community-like-count-pop {
  0% {
    transform: translateY(0) scale(1);
  }
  36% {
    transform: translateY(-3px) scale(1.08);
  }
  62% {
    transform: translateY(1px) scale(0.98);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

.replay-modal-backdrop {
  position: fixed;
  z-index: 1500;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--modal-safe-top-gap) var(--modal-safe-right-gap) var(--modal-safe-bottom-gap) var(--modal-safe-left-gap);
  background: rgba(12, 20, 17, 0);
  transition: background 260ms ease;
  overscroll-behavior: contain;
}

.replay-modal-backdrop.is-open {
  background: rgba(225, 236, 242, 0.42);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.replay-modal-panel {
  width: 80vw;
  height: 80dvh;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(246, 251, 255, 0.46)),
    radial-gradient(120% 120% at 0% 0%, rgba(255, 219, 246, 0.2), rgba(255, 255, 255, 0) 52%),
    radial-gradient(120% 110% at 100% 16%, rgba(184, 238, 255, 0.28), rgba(255, 255, 255, 0) 56%);
  box-shadow: 0 34px 100px rgba(69, 88, 105, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  opacity: 0;
  transform: scale(0.94);
  transform-origin: center;
  transition: transform 220ms ease, opacity 180ms ease;
  will-change: transform, opacity;
}

.replay-modal-backdrop.is-open .replay-modal-panel {
  opacity: 1;
  transform: scale(1);
}

.replay-modal-backdrop.is-settled .replay-modal-panel {
  transform: none;
  will-change: auto;
}

.replay-modal-backdrop.is-closing .replay-modal-panel {
  transform: none;
}

.replay-modal-backdrop.is-closing,
.image-preview-backdrop.is-closing {
  will-change: opacity;
}

.replay-modal-backdrop.is-exiting,
.image-preview-backdrop.is-exiting {
  opacity: 0;
  transition: opacity 180ms ease;
}

.replay-modal-panel iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #f4fbff;
}

html[data-theme^="glass-"] .replay-modal-backdrop.is-open {
  background: rgba(225, 236, 242, 0.38);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

html[data-theme^="glass-"] .replay-modal-panel {
  border-color: rgba(255, 255, 255, 0.72);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(246, 251, 255, 0.46)),
    radial-gradient(120% 120% at 0% 0%, rgba(255, 219, 246, 0.2), rgba(255, 255, 255, 0) 52%),
    radial-gradient(120% 110% at 100% 16%, rgba(184, 238, 255, 0.28), rgba(255, 255, 255, 0) 56%);
  box-shadow: 0 34px 100px rgba(69, 88, 105, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

html[data-theme^="glass-"] .replay-modal-panel iframe {
  background: #f4fbff;
}

.image-preview-backdrop {
  position: fixed;
  z-index: 1700;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--modal-safe-top-gap) var(--modal-safe-right-gap) var(--modal-safe-bottom-gap) var(--modal-safe-left-gap);
  background: rgba(12, 20, 17, 0);
  transition: background 190ms ease;
  overscroll-behavior: contain;
}

.image-preview-backdrop.is-open {
  background: rgba(232, 243, 249, 0.24);
  -webkit-backdrop-filter: blur(12px) saturate(1.12);
  backdrop-filter: blur(12px) saturate(1.12);
}

.image-preview-panel {
  width: min(960px, 100%);
  max-height: calc(100dvh - var(--modal-safe-top-gap) - var(--modal-safe-bottom-gap));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 8px;
  padding: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.82), rgba(247, 252, 255, 0.68)),
    radial-gradient(120% 120% at 0% 0%, rgba(255, 219, 246, 0.14), rgba(255, 255, 255, 0) 54%),
    radial-gradient(120% 110% at 100% 16%, rgba(184, 238, 255, 0.2), rgba(255, 255, 255, 0) 58%);
  box-shadow: 0 34px 100px rgba(69, 88, 105, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.86);
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 160ms ease, transform 190ms ease;
}

.image-preview-backdrop.is-open .image-preview-panel {
  opacity: 1;
  transform: scale(1);
}

.image-preview-backdrop.is-closing {
  -webkit-backdrop-filter: blur(12px) saturate(1.12);
  backdrop-filter: blur(12px) saturate(1.12);
}

.image-preview-backdrop.is-closing .image-preview-panel {
  transform: none;
}

.image-preview-header {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.image-preview-header h2 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 820;
}

.image-preview-close {
  min-height: 34px;
  border: 1px solid rgba(83, 111, 122, 0.2);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: 13px;
  font-weight: 780;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.image-preview-stage {
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.image-preview-stage img {
  max-width: 100%;
  max-height: calc(100dvh - var(--modal-safe-top-gap) - var(--modal-safe-bottom-gap) - 118px);
  display: block;
  border-radius: 7px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.52);
}

.image-preview-caption {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

[data-image-preview-src] {
  cursor: zoom-in;
}

[data-image-preview-src]:focus-visible {
  outline: 3px solid rgba(90, 177, 197, 0.32);
  outline-offset: 3px;
}

body.image-preview-open {
  overflow: hidden;
}

@media (prefers-color-scheme: dark) {
  html[data-theme^="glass-"] .replay-modal-backdrop.is-open {
    background: rgba(8, 13, 19, 0.12);
  }

  html[data-theme^="glass-"] .image-preview-backdrop.is-open {
    background: rgba(8, 13, 19, 0.38);
  }

  html[data-theme^="glass-"] .image-preview-panel {
    border-color: rgba(255, 255, 255, 0.18);
    background:
      linear-gradient(145deg, rgba(29, 41, 55, 0.9), rgba(16, 25, 36, 0.76)),
      radial-gradient(120% 120% at 0% 0%, rgba(216, 134, 181, 0.12), rgba(16, 25, 36, 0) 52%),
      radial-gradient(120% 110% at 100% 16%, rgba(111, 207, 226, 0.16), rgba(16, 25, 36, 0) 56%);
    box-shadow: 0 36px 104px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.13);
  }

  html[data-theme^="glass-"] .image-preview-header h2 {
    color: #f7fbff;
  }

  html[data-theme^="glass-"] .image-preview-close {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.1);
    color: #f7fbff;
    box-shadow: none;
  }

  html[data-theme^="glass-"] .image-preview-stage img {
    background: rgba(255, 255, 255, 0.08);
  }

  html[data-theme^="glass-"] .image-preview-caption {
    color: rgba(247, 251, 255, 0.78);
  }

  html[data-theme^="glass-"] .replay-modal-panel {
    border-color: rgba(255, 255, 255, 0.18);
    background:
      linear-gradient(145deg, rgba(29, 41, 55, 0.84), rgba(16, 25, 36, 0.68)),
      radial-gradient(120% 120% at 0% 0%, rgba(216, 134, 181, 0.12), rgba(16, 25, 36, 0) 52%),
      radial-gradient(120% 110% at 100% 16%, rgba(111, 207, 226, 0.16), rgba(16, 25, 36, 0) 56%);
    box-shadow: 0 36px 104px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.13);
  }

  html[data-theme^="glass-"] .replay-modal-panel iframe {
    background: #101823;
  }
}
