/*
 * MEPPP community interface.
 * Structure independently adapted from the MIT-licensed PaoPao CE interface;
 * the blue scale is validated against the MIT-licensed go-postery project.
 * See THIRD_PARTY_NOTICES.md. No upstream brand assets or source code are used.
 */

:root {
  --primary: #0369a1;
  --primary-hover: #075985;
  --primary-strong: #0c4a6e;
  --primary-soft: #e0f2fe;
  --primary-faint: #f0f9ff;
  --focus: #075985;
  --text: #0f172a;
  --muted: #64748b;
  --muted-strong: #475569;
  --line: #e5e7eb;
  --line-strong: #cbd5e1;
  --line-soft: #eef2f6;
  --surface: #ffffff;
  --surface-subtle: #f7f9f9;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --success: #15803d;
  --content-main: 620px;
  --sidebar-left: 200px;
  --sidebar-right: 240px;
  --shell-gap: 10px;
  --shell-width: calc(var(--sidebar-left) + var(--content-main) + var(--sidebar-right) + var(--shell-gap) * 2);
  color-scheme: light;
}

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

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background: var(--surface);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-hover);
}

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

button,
summary {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible,
.field-control:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

html.has-mobile-menu-open,
html.has-mobile-menu-open body {
  overflow: hidden;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3,
strong {
  font-weight: 700;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 1000;
  padding: 10px 14px;
  color: #fff;
  background: var(--primary-strong);
  border-radius: 4px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

.page-shell {
  min-height: 100vh;
}

.inner-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 58px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.inner-header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100% - 32px, 960px);
  height: 100%;
  margin: 0 auto;
}

.brand,
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.brand-mark,
.sidebar-brand-mark {
  display: block;
  object-fit: contain;
}

.brand-mark {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
}

.brand-lockup-copy {
  display: grid;
  gap: 2px;
  justify-items: start;
  min-width: 0;
  line-height: 1;
  text-align: left;
}

.brand-name {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.brand-tagline {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
  line-height: 1.15;
  white-space: nowrap;
}

.inner-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.inner-nav > a,
.nav-form button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--muted-strong);
  background: transparent;
  border: 0;
  border-radius: 20px;
  cursor: pointer;
}

.inner-nav > a:hover,
.nav-form button:hover {
  color: var(--primary-hover);
  background: var(--primary-faint);
}

.inner-nav > a[aria-current="page"] {
  color: var(--primary-hover);
  background: var(--primary-faint);
  font-weight: 700;
}

.inner-nav .nav-join {
  color: #fff;
  background: var(--primary);
}

.nav-form {
  margin: 0;
}

.notification-link {
  gap: 5px;
}

.notification-count,
.sidebar-badge {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  color: #fff;
  background: var(--danger);
  border-radius: 10px;
  font-size: 11px;
  line-height: 1;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  width: min(100% - 32px, 960px);
  margin: 48px auto 0;
  padding: 24px 0 40px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.site-footer p {
  margin: 0;
}

.message-stack {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 200;
  display: grid;
  gap: 8px;
  width: min(calc(100% - 32px), 460px);
  transform: translateX(-50%);
  pointer-events: none;
}

.message {
  padding: 12px 16px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.12);
}

.message-error {
  border-left-color: var(--danger);
}

.community-page .inner-header,
.community-page .site-footer {
  display: none;
}

.community-page main {
  min-height: 100vh;
}

.community-page .message-stack {
  top: auto;
  bottom: 24px;
}

/* PaoPao-compatible application shell: 200 / 620 / 240. */
.paopao-shell {
  display: grid;
  grid-template-columns: var(--sidebar-left) var(--content-main) var(--sidebar-right);
  gap: var(--shell-gap);
  width: var(--shell-width);
  margin: 0 auto;
  align-items: start;
}

.paopao-sidebar,
.paopao-rightbar {
  position: sticky;
  top: 0;
  height: 100vh;
}

.paopao-sidebar {
  padding: 18px 0 12px;
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  min-width: 52px;
  min-height: 52px;
  margin: 0 0 14px 16px;
  padding: 8px 12px 8px 8px;
  border-radius: 14px;
}

.sidebar-brand:hover {
  background: var(--primary-faint);
}

.sidebar-brand-mark {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
}

.sidebar-brand-copy {
  padding-right: 4px;
}

.sidebar-nav {
  display: grid;
  gap: 4px;
}

.sidebar-nav > a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 50px;
  padding: 0 18px;
  color: var(--text);
  border-radius: 25px;
  font-size: 17px;
  font-weight: 600;
}

.sidebar-nav > a span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.sidebar-nav > a:hover {
  color: var(--primary-hover);
  background: var(--surface-subtle);
}

.sidebar-nav > a.is-active {
  color: var(--primary-hover);
  background: var(--primary-soft);
}

.sidebar-nav svg {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  stroke-width: 1.9;
}

.sidebar-nav .sidebar-create {
  justify-content: center;
  margin-top: 10px;
  color: #fff;
  background: var(--primary);
}

.sidebar-nav .sidebar-create:hover {
  color: #fff;
  background: var(--primary-hover);
}

.sidebar-badge {
  margin-left: auto;
}

.sidebar-admin-pill {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 10px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.sidebar-admin-link:hover .sidebar-admin-pill,
.sidebar-content-management-link:hover .sidebar-admin-pill {
  color: #fff;
  background: var(--primary);
}

.sidebar-account {
  margin-top: auto;
  padding: 14px 10px 4px;
  color: var(--muted);
  font-size: 13px;
}

.sidebar-account > p {
  margin-bottom: 10px;
  text-align: center;
}

.sidebar-auth-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 6px;
}

.sidebar-auth-actions a {
  padding-inline: 8px;
  font-size: 13px;
}

.sidebar-user {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 9px;
  align-items: center;
  min-width: 0;
  color: var(--text);
}

.sidebar-user > span:last-child {
  min-width: 0;
}

.sidebar-user strong,
.sidebar-user small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user small {
  color: var(--muted);
  font-size: 12px;
}

.sidebar-logout {
  min-height: 44px;
  margin: 6px 0 0 43px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.sidebar-logout:hover {
  color: var(--danger);
}

.stream-panel {
  min-height: 100vh;
  background: #fff;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.stream-header,
.stream-page-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  min-height: 51px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
}

.stream-header h1,
.stream-page-header h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.stream-title {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.stream-mobile-brand {
  display: none;
}

.stream-title h1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stream-title > span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.stream-header-action {
  margin: 0 0 0 auto;
}

.stream-header-action button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  color: var(--primary-strong);
  background: transparent;
  border: 0;
  border-radius: 22px;
  font-weight: 700;
  cursor: pointer;
}

.stream-header-action button:hover {
  background: var(--primary-faint);
}

.stream-privacy-note {
  margin: 0;
  padding: 10px 16px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.45;
}

.stream-back {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin-right: 5px;
  color: var(--text);
  border-radius: 50%;
}

.stream-back:hover {
  color: var(--text);
  background: var(--surface-subtle);
}

.stream-back svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

.mobile-menu {
  display: none;
}

.quick-composer {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.quick-composer-main {
  min-width: 0;
}

.topic-context-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(225, 243, 255, 0.72), rgba(255, 255, 255, 0.9));
}

.topic-context-card div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.topic-context-kicker {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.topic-context-card strong {
  color: var(--text);
  font-size: 18px;
}

.topic-context-card p,
.composer-context-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.topic-context-action {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 13px;
  color: var(--primary-hover);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.topic-context-action:hover {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.composer-context-note {
  margin-bottom: 8px;
}

.composer-prompt {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: #94a3b8;
  font-size: 17px;
}

.composer-prompt:hover {
  color: var(--muted-strong);
}

.composer-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 8px;
}

.composer-tool {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 0 9px;
  color: var(--primary);
  border-radius: 19px;
  font-size: 13px;
}

.composer-tool:hover {
  background: var(--primary-faint);
}

.composer-tool svg {
  width: 21px;
  height: 21px;
}

.composer-submit {
  min-width: 74px;
  margin-left: auto;
}

.guest-composer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 96px;
}

.guest-composer > div:first-child {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  gap: 3px;
}

.guest-composer strong {
  font-size: 16px;
}

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

.guest-composer-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.feed-filters {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  min-height: 49px;
  border-bottom: 1px solid var(--line);
}

.feed-filters a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 600;
}

.feed-filters a:hover {
  color: var(--text);
  background: var(--surface-subtle);
}

.feed-filters a[aria-current="page"] {
  color: var(--text);
  font-weight: 800;
}

.feed-filters a[aria-current="page"]::after {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 32px;
  height: 3px;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  content: "";
  transform: translateX(-50%);
}

.feed-context-actions {
  display: flex;
  justify-content: flex-end;
  min-height: 52px;
  padding: 4px 12px;
  border-bottom: 1px solid var(--line);
}

.feed-context-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--primary-strong);
  border-radius: 22px;
  font-size: 13px;
  font-weight: 700;
}

.feed-context-actions a:hover {
  background: var(--primary-faint);
}

.entry-list {
  display: block;
}

.entry-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  transition: background-color 120ms ease;
}

.entry-card:hover {
  background: var(--surface-subtle);
}

.entry-card-detail:hover {
  background: #fff;
}

.avatar,
.profile-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border: 1px solid #bae6fd;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
}

.avatar-small {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.avatar-image,
.avatar-initial {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.avatar-image {
  object-fit: cover;
}

.avatar-initial {
  display: grid;
  place-items: center;
}

.entry-content {
  min-width: 0;
}

.identity-line {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  line-height: 1.3;
}

.identity-copy {
  display: flex;
  align-items: baseline;
  flex: 1 1 auto;
  gap: 5px;
  min-width: 0;
}

.identity-name {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-name:hover {
  color: var(--text);
  text-decoration: underline;
}

.verified-badge {
  display: inline-grid;
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  place-items: center;
  color: #0ea5e9;
  vertical-align: -3px;
}

.verified-badge svg {
  width: 100%;
  height: 100%;
}

.verified-badge svg > path:first-child {
  fill: currentColor;
  stroke: none;
}

.verified-badge svg > path:last-child {
  fill: none;
  stroke: #fff;
  stroke-width: 2;
}

.comment-identity-name,
.suggested-member-name,
.sidebar-user-name,
.profile-name-line {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.identity-handle,
.entry-time {
  color: var(--muted);
  font-size: 13px;
}

.identity-handle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-time {
  white-space: nowrap;
}

.entry-header-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 4px;
  margin-left: auto;
}

.entry-follow-form {
  flex: 0 0 auto;
  margin: 0;
}

.entry-more-menu {
  position: relative;
  flex: 0 0 auto;
}

.entry-more-menu > summary {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--muted);
  border-radius: 50%;
  cursor: pointer;
  list-style: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.entry-more-menu > summary::-webkit-details-marker {
  display: none;
}

.entry-more-menu > summary svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  stroke: none;
}

.entry-more-menu > summary:hover,
.entry-more-menu > summary:focus-visible,
.entry-more-menu[open] > summary {
  color: var(--primary);
  background: var(--primary-faint);
}

.entry-more-popover {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  right: 0;
  width: max-content;
  min-width: 190px;
  overflow: hidden;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.16);
}

.entry-more-form {
  margin: 0;
}

.entry-more-action {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-radius: 9px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.entry-more-action:hover,
.entry-more-action:focus-visible {
  color: var(--primary-hover);
  background: var(--primary-faint);
}

.entry-more-action.is-danger {
  color: var(--danger);
}

.entry-more-action.is-danger:hover,
.entry-more-action.is-danger:focus-visible {
  background: var(--danger-soft);
}

.entry-more-action svg {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
}

.entry-follow-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  color: var(--primary);
  background: var(--primary-faint);
  border: 1px solid #bae6fd;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition:
    background-color 120ms ease,
    border-color 120ms ease,
    color 120ms ease;
}

.entry-follow-button:hover {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.entry-follow-button.is-following {
  color: var(--muted-strong);
  background: #fff;
  border-color: var(--line-strong);
}

.entry-follow-button.is-following:hover,
.profile-follow-button.is-following:hover {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #fecaca;
}

.entry-edited {
  margin-left: 6px;
  color: var(--muted);
  font-size: 12px;
}

.entry-body {
  margin: 8px 0 10px;
  color: #172033;
  font-size: 15px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.entry-body-source-snapshot {
  margin-top: 6px;
  margin-bottom: 7px;
  line-height: 1.45;
}

.text-paragraph-gap {
  display: block;
  height: 0.24em;
}

.entry-body-source-snapshot + .source-read-more {
  margin-top: -2px;
  margin-bottom: 3px;
}

.mention-link {
  color: var(--primary-strong);
  font-weight: 700;
  text-decoration: none;
}

.mention-link:hover {
  text-decoration: underline;
}

.external-body-link {
  color: var(--primary-strong);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.external-body-link:hover {
  text-decoration: underline;
}

.entry-card-detail .entry-body {
  font-size: 16px;
  line-height: 1.75;
}

.entry-card-detail .entry-body-source-snapshot {
  line-height: 1.55;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  margin: 7px 0 8px;
  overflow: hidden;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.media-grid img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  background: #eef2f6;
}

.media-count-1 {
  display: block;
  background: #eef2f6;
}

.media-count-1 img {
  width: 100%;
  height: auto;
  max-height: 660px;
  object-fit: contain;
}

.media-count-3 img:first-child {
  grid-row: span 2;
  height: 424px;
}

.topic-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin: 9px 0 2px;
}

.topic-row a {
  color: var(--primary);
  font-size: 14px;
}

.quoted-entry-card {
  display: grid;
  gap: 4px;
  margin: 10px 0 2px;
  padding: 10px 12px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.quoted-entry-card:hover {
  border-color: rgba(15, 132, 201, 0.34);
  background: var(--primary-faint);
}

.quoted-entry-author {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.quoted-entry-author span {
  color: var(--muted);
  font-weight: 500;
}

.quoted-entry-body {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.quoted-entry-card-missing {
  color: var(--muted);
}

.interaction-bar {
  display: grid;
  grid-template-columns: repeat(5, minmax(44px, 1fr));
  align-items: center;
  gap: 0;
  width: 100%;
  margin-top: 8px;
}

.interaction-bar .inline-action {
  width: 100%;
  margin: 0;
}

.interaction-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 22px;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.interaction-button svg {
  width: 20px;
  height: 20px;
  transition: transform 0.15s ease;
}

.interaction-button > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.interaction-button:hover svg {
  transform: scale(1.12);
}

.interaction-button:hover,
.interaction-button.is-active {
  color: var(--primary);
  background: var(--primary-faint);
}

.interaction-button strong {
  font-weight: 500;
  white-space: nowrap;
}

.quiet-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 42px;
  min-height: 44px;
  padding: 0 7px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 19px;
  margin-left: auto;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.quiet-action:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.entry-moderate-link {
  min-width: 44px;
}

.entry-edit-link {
  color: var(--primary-hover);
}

.entry-admin-tools {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 6px;
  margin-left: auto;
  padding-left: 4px;
  color: var(--muted);
  font-size: 12px;
}

.entry-admin-action,
.record-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 34px;
  padding: 0 10px;
  color: var(--primary-hover);
  background: var(--primary-faint);
  border: 0;
  border-radius: 17px;
  font: inherit;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

.entry-admin-action.is-danger,
.record-action-button.is-danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.entry-admin-action:hover,
.record-action-button:hover {
  color: #fff;
  background: var(--primary);
}

.entry-admin-action.is-danger:hover,
.record-action-button.is-danger:hover {
  color: #fff;
  background: var(--danger);
}

.empty-feed,
.empty-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 44px 24px;
  color: var(--muted);
  text-align: center;
  background: var(--surface-subtle);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  margin: 16px 0;
}

.state-logo {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.empty-feed h2,
.empty-feed p,
.empty-state h2,
.empty-state h3,
.empty-state p {
  margin: 0;
}

.empty-feed h2,
.empty-state h2,
.empty-state h3 {
  color: var(--text);
  font-size: 18px;
  font-weight: 650;
}

.empty-feed p,
.empty-state p {
  max-width: 420px;
  font-size: 14px;
  line-height: 1.5;
}

.empty-state-compact {
  padding: 28px 16px;
}

.pagination,
.compact-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.pagination a,
.pagination span,
.compact-pagination a,
.compact-pagination span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 19px;
}

.pagination a:hover,
.compact-pagination a:hover {
  background: var(--primary-faint);
}

.paopao-rightbar {
  padding-top: 14px;
  overflow: auto;
  scrollbar-width: none;
}

.rightbar-search,
.mobile-discovery form {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  background: var(--surface-subtle);
  border: 1px solid transparent;
  border-radius: 22px;
}

.rightbar-search:focus-within,
.mobile-discovery form:focus-within {
  background: #fff;
  border-color: var(--primary);
}

.rightbar-search svg,
.mobile-discovery svg {
  width: 20px;
  height: 20px;
  color: var(--muted);
}

.rightbar-search input,
.mobile-discovery input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  outline: 0;
}

.mobile-discovery-sections {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.mobile-discovery-sections section {
  display: grid;
  gap: 8px;
}

.mobile-discovery-sections h2 {
  font-size: 14px;
}

.mobile-discovery-sections p,
.mobile-discovery-sections small {
  color: var(--muted);
}

.mobile-topic-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mobile-topic-links a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 6px 10px;
  color: var(--muted-strong);
  background: var(--surface-subtle);
  border-radius: 18px;
}

.rightbar-section {
  margin-top: 12px;
  padding: 16px;
  background: var(--surface-subtle);
  border-radius: 6px;
}

.rightbar-section h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

.member-suggestion-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.member-suggestion-list a {
  display: grid;
  min-width: 0;
  align-items: center;
  color: var(--text);
  gap: 9px;
  grid-template-columns: 36px minmax(0, 1fr);
}

.member-suggestion-list a > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.member-suggestion-list strong,
.member-suggestion-list small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-suggestion-list strong {
  white-space: nowrap;
}

.member-suggestion-list small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.topic-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.topic-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  color: var(--primary-hover);
  font-size: 14px;
}

.topic-list a:hover span {
  text-decoration: underline;
}

.topic-list small {
  color: var(--muted);
  font-size: 12px;
}

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

.rightbar-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  padding: 14px 8px;
  color: var(--muted);
  font-size: 12px;
}

.rightbar-footer a {
  color: var(--muted);
}

/* Controls and forms */
.button-primary,
.button-secondary,
.button-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 21px;
  font-weight: 650;
  line-height: 1.2;
  cursor: pointer;
}

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

.button-primary:hover {
  color: #fff;
  background: var(--primary-hover);
}

.button-secondary {
  color: var(--primary-hover);
  background: #fff;
  border-color: #bae6fd;
}

.button-secondary:hover {
  color: var(--primary-strong);
  background: var(--primary-faint);
}

.button-danger {
  color: #fff;
  background: var(--danger);
}

.button-danger:hover {
  color: #fff;
  background: #b91c1c;
}

.button-block {
  width: 100%;
}

.button-small {
  min-height: 44px;
  padding-inline: 13px;
  font-size: 13px;
}

.stacked-form {
  display: grid;
  gap: 16px;
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-field > label,
.image-composer > legend {
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
}

.field-control {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text);
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

textarea.field-control {
  min-height: 112px;
  resize: vertical;
  line-height: 1.65;
}

.composer-form textarea.field-control {
  min-height: 140px;
  padding: 4px 0 14px;
  border-width: 0 0 1px;
  border-radius: 0;
  font-size: 17px;
}

.composer-lead {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.composer-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 8px;
}

.composer-shortcuts a,
.composer-shortcuts button {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 68px;
  padding: 7px 4px;
  color: var(--primary-hover);
  background: var(--primary-faint);
  border: 1px solid #bae6fd;
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

.composer-shortcuts a:hover,
.composer-shortcuts button:hover {
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.composer-shortcuts a > span,
.composer-shortcuts button > span {
  display: grid;
  place-items: center;
  min-width: 30px;
  min-height: 30px;
  font-size: 15px;
  font-weight: 750;
}

.composer-shortcuts svg {
  width: 22px;
  height: 22px;
}

.composer-form.is-enhanced [data-composer-panel] {
  display: none;
}

.composer-form.is-enhanced [data-composer-panel].is-active {
  display: block;
}

.composer-shortcuts a[aria-current="true"],
.composer-shortcuts button[aria-current="true"] {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.inline-composer-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inline-composer-form #composer-body {
  order: 1;
}

.inline-composer-form #composer-body > label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.inline-composer-form textarea.field-control {
  height: 54px;
  min-height: 54px;
  padding: 4px 0 10px;
  border: 0;
  font-size: 17px;
  resize: none;
}

.inline-composer-form textarea.field-control:focus {
  box-shadow: none;
}

.inline-composer-form #composer-body > .field-help {
  display: none;
}

.inline-composer-shortcuts {
  order: 2;
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  overflow-x: auto;
  padding: 5px 0 2px;
  border-top: 1px solid var(--line);
  scrollbar-width: none;
}

.inline-composer-shortcuts::-webkit-scrollbar {
  display: none;
}

.inline-composer-shortcuts a,
.inline-composer-shortcuts button {
  display: inline-flex;
  flex: 0 0 auto;
  grid-template-columns: none;
  gap: 5px;
  width: auto;
  min-height: 44px;
  padding: 0 9px;
  color: var(--primary);
  background: transparent;
  border: 0;
  border-radius: 22px;
  font-size: 13px;
}

.inline-composer-shortcuts a > span,
.inline-composer-shortcuts button > span {
  min-width: 22px;
  min-height: 22px;
}

.inline-composer-shortcuts a > strong,
.inline-composer-shortcuts button > strong {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  clip-path: none;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.inline-composer-form > [data-composer-panel] {
  order: 3;
}

.inline-composer-form .source-composer {
  padding: 7px 0 1px;
  border-bottom: 0;
}

.inline-composer-form .source-composer > legend {
  display: none;
}

.inline-composer-form > .source-media-rights {
  order: 4;
}

.inline-composer-footer {
  order: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 4px;
}

.inline-composer-footer .composer-meta {
  min-width: 0;
  gap: 8px;
  padding-top: 0;
}

.inline-composer-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
}

.inline-composer-actions .button-primary {
  min-width: 78px;
}

.composer-mode-note {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.field-control:hover {
  border-color: #94a3b8;
}

.field-control:focus {
  border-color: var(--primary);
}

.field-help,
.registration-legal,
.auth-intro,
.form-lead {
  color: var(--muted);
  font-size: 13px;
}

.topic-suggestion-box {
  position: relative;
  z-index: 8;
}

.mention-suggestion-box {
  position: relative;
  z-index: 9;
}

.topic-suggestion-list {
  position: absolute;
  inset: 4px 0 auto;
  display: grid;
  max-height: min(240px, 45vh);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid #bae6fd;
  border-radius: 10px;
  box-shadow: 0 12px 28px rgb(15 23 42 / 14%);
  animation: popoverFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.mention-suggestion-list {
  position: absolute;
  inset: 4px 0 auto;
  display: grid;
  max-height: min(260px, 45vh);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid #bae6fd;
  border-radius: 12px;
  box-shadow: 0 14px 32px rgb(15 23 42 / 16%);
  animation: popoverFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popoverFadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.topic-suggestion-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 9px 12px;
  color: var(--text);
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}

.mention-suggestion-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-height: 48px;
  padding: 9px 12px;
  color: var(--text);
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}

.topic-suggestion-option:last-child {
  border-bottom: 0;
}

.mention-suggestion-option:last-child {
  border-bottom: 0;
}

.topic-suggestion-option:hover,
.topic-suggestion-option[aria-selected="true"] {
  background: var(--primary-faint);
}

.mention-suggestion-option:hover,
.mention-suggestion-option[aria-selected="true"] {
  background: var(--primary-faint);
}

.topic-suggestion-option strong {
  color: var(--primary-hover);
}

.mention-suggestion-option strong {
  color: var(--primary-hover);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-suggestion-option span {
  color: var(--muted);
  font-size: 12px;
}

.mention-suggestion-option span {
  color: var(--muted);
  font-size: 12px;
}

.mention-suggestion-option small {
  align-self: center;
  color: var(--muted);
  font-size: 12px;
}

.topic-existing-choices {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.field-label {
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
}

.field-help,
.registration-legal,
.auth-intro {
  margin: 0;
}

.field-errors,
.error-summary {
  color: #991b1b;
  font-size: 13px;
}

.duplicate-publish-confirm {
  padding: 12px 14px;
  margin-top: 12px;
  border: 1px solid #f4d38b;
  border-radius: 8px;
  background: #fff8e6;
}

.duplicate-publish-confirm label {
  display: flex;
  align-items: flex-start;
  color: #7c4705;
  font-size: 13px;
  font-weight: 650;
  gap: 9px;
}

.field-errors ul,
.error-summary ul {
  margin: 5px 0 0;
  padding-left: 20px;
}

.error-summary {
  padding: 12px;
  background: var(--danger-soft);
  border: 1px solid #fecaca;
  border-radius: 6px;
}

.has-error .field-control {
  border-color: var(--danger);
}

.form-field-check {
  display: block;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 44px;
  cursor: pointer;
}

.check-input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--primary);
}

.choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.choice-grid > div label,
.choice-grid label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  color: var(--primary-hover);
  background: var(--primary-faint);
  border: 1px solid #bae6fd;
  border-radius: 19px;
  cursor: pointer;
}

.choice-grid input {
  accent-color: var(--primary);
}

.form-actions,
.comment-actions,
.member-console-actions,
.profile-actions,
.record-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.form-actions {
  justify-content: flex-end;
}

.composer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}

.composer-meta .is-near-limit,
.is-near-limit {
  color: var(--danger);
}

.status-pill,
.content-state {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 13px;
  font-size: 12px;
  font-weight: 650;
}

.image-composer,
.video-composer,
.source-composer {
  min-width: 0;
  margin: 0;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 130px;
}

.image-picker,
.video-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  margin-top: 10px;
  padding: 0 14px;
  color: var(--primary-hover);
  background: var(--primary-faint);
  border: 1px dashed #7dd3fc;
  border-radius: 6px;
  cursor: pointer;
}

.image-picker span,
.image-status,
.video-picker span,
.video-status {
  color: var(--muted);
  font-size: 12px;
}

.image-status,
.video-status {
  margin: 7px 0 0;
}

.image-status.has-error,
.video-status.has-error {
  color: var(--danger);
}

.video-composer > legend,
.source-composer > legend {
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
}

.source-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0 10px;
}

.source-platform {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 14px;
  font-size: 12px;
  font-weight: 650;
}

.source-platform-youtube {
  color: #991b1b;
  background: #fef2f2;
}

.source-status {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.source-status.is-ready {
  color: var(--success);
  font-weight: 650;
}

.source-status.has-error {
  color: var(--danger);
}

.source-import-preview {
  display: grid;
  gap: 9px;
  margin-top: 10px;
  padding: 12px;
  background: var(--primary-faint);
  border: 1px solid #bae6fd;
  border-radius: 8px;
}

.source-import-preview[hidden] {
  display: none;
}

.source-import-preview p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.source-import-preview footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  color: var(--muted);
  font-size: 12px;
}

.source-import-preview a {
  color: var(--primary-hover);
}

.source-advanced,
.source-guidance {
  margin-top: 9px;
  color: var(--muted);
  font-size: 12px;
}

.source-advanced {
  padding-top: 2px;
}

.source-advanced[open] {
  padding-top: 10px;
}

.source-advanced summary,
.source-guidance summary {
  width: fit-content;
  min-height: 44px;
  padding: 7px 0;
  color: var(--primary-hover);
  cursor: pointer;
  font-weight: 650;
}

.source-advanced summary {
  padding: 6px 10px;
  color: var(--primary-strong);
  background: var(--primary-faint);
  border-radius: 999px;
}

.source-guidance p {
  margin: 3px 0 0;
  padding: 9px 10px;
  background: var(--surface-subtle);
  border-radius: 6px;
  line-height: 1.6;
}

.source-media-rights {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--primary-faint);
  border: 1px solid #bae6fd;
  border-radius: 8px;
}

.source-media-rights[hidden] {
  display: none;
}

.x-article-composer {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.x-article-composer[hidden],
.x-article-fields[hidden] {
  display: none;
}

.x-source-mode {
  display: grid;
  gap: 8px;
}

.x-source-mode-label {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.x-source-mode > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.x-source-mode > div > div {
  min-width: 0;
}

.x-source-mode label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 10px;
  color: var(--primary-strong);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.x-source-mode label:has(input:checked) {
  color: var(--primary-hover);
  background: var(--primary-faint);
  border-color: var(--primary);
}

.x-source-mode input {
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  accent-color: var(--primary);
}

.x-article-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  background: #f8fbff;
  border: 1px solid #bae6fd;
  border-radius: 9px;
}

.x-article-intro,
.x-article-fields .form-field:has(textarea),
.x-article-fields .form-field-check {
  grid-column: 1 / -1;
}

.x-article-intro {
  display: grid;
  gap: 4px;
}

.x-article-intro strong {
  color: var(--text);
  font-size: 14px;
}

.x-article-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.x-article-fields .form-field {
  margin: 0;
}

.x-article-fields textarea {
  min-height: 220px;
  resize: vertical;
}

.video-preview {
  position: relative;
  margin-top: 10px;
  overflow: hidden;
  background: #0f172a;
  border-radius: 8px;
}

.video-preview[hidden] {
  display: none;
}

.video-preview video {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
}

.video-preview .button-secondary {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.94);
}

.entry-video {
  margin-top: 12px;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.entry-video video {
  display: block;
  width: 100%;
  max-height: 620px;
  object-fit: contain;
}

.external-reference {
  margin-top: 7px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.external-reference-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

.external-provider-x {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #0f172a;
  font-weight: 750;
}

.external-provider-x svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.external-origin {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.external-origin a {
  color: var(--primary-hover);
  overflow-wrap: anywhere;
}

.external-local-media {
  width: fit-content;
  padding: 3px 7px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.external-reference-notice {
  margin: 0;
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
}

.x-source-copy {
  padding: 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.x-source-copy p {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.x-embed-shell {
  display: grid;
  justify-items: center;
  min-height: 132px;
  padding: 0 12px 12px;
  background: #fff;
}

.x-embed-shell .twitter-tweet {
  width: 100%;
  max-width: 550px;
  margin: 12px 0 0;
  padding: 14px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.x-embed-shell .twitter-tweet p {
  margin: 0 0 8px;
}

.x-embed-source-link {
  color: var(--primary-hover);
  font-size: 12px;
}

.x-article-copy {
  padding: 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.x-article-copy-heading {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.x-article-copy-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.x-article-copy-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(19px, 3vw, 25px);
  line-height: 1.3;
}

.x-article-copy-body {
  color: var(--text);
  font-size: 15px;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.x-article-copy-body-preview {
  display: -webkit-box;
  max-height: 14.8em;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 8;
}

.x-article-read-more {
  display: inline-flex;
  margin-top: 12px;
  color: var(--primary-hover);
  font-size: 13px;
  font-weight: 700;
}

.x-embed-shell-article {
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.x-embed-label {
  width: 100%;
  max-width: 550px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.external-reference-copy {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
}

.external-reference-copy-compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 12px;
  padding: 10px 14px;
}

.external-reference-copy-summary {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.external-reference-copy-summary strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.external-reference-copy strong,
.external-reference-copy p,
.external-reference-copy span {
  margin: 0;
}

.external-source-url {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.external-provider,
.external-author {
  color: var(--muted);
  font-size: 12px;
}

.external-reference-copy a {
  width: fit-content;
  color: var(--primary-hover);
  font-size: 13px;
  font-weight: 650;
}

.source-read-more {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  color: var(--primary-hover);
  font-size: 13px;
  font-weight: 700;
}

.external-reference-line {
  display: flex;
  min-width: 0;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  white-space: nowrap;
}

.external-reference-line .external-provider-x {
  flex: 0 0 auto;
  gap: 4px;
  font-size: 12px;
}

.external-reference-line .external-author {
  flex: 0 1 auto;
  max-width: 34%;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.external-source-address {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.external-reference-line .external-source-url {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.external-reference-line > a {
  flex: 0 0 auto;
  font-size: 12px;
}

.source-access-note {
  margin: 0;
  padding: 0 14px 12px;
  color: var(--muted);
  font-size: 12px;
}

.source-access-note summary {
  width: fit-content;
  min-height: 44px;
  padding: 6px 0;
  color: var(--primary-hover);
  cursor: pointer;
  font-weight: 650;
}

.source-access-note p {
  margin: 2px 0 0;
  padding: 9px 10px;
  background: var(--surface-subtle);
  border-radius: 8px;
  line-height: 1.65;
}

.youtube-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0f172a;
}

.youtube-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 560px) {
  .x-source-mode > div,
  .x-article-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .x-article-intro,
  .x-article-fields .form-field:has(textarea),
  .x-article-fields .form-field-check {
    grid-column: 1;
  }

  .x-article-fields,
  .x-article-copy {
    padding: 12px;
  }
}

.image-preview-list {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.image-preview-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.image-preview-frame {
  display: grid;
  place-items: center;
  height: 96px;
  overflow: hidden;
  background: var(--surface-subtle);
  border-radius: 4px;
}

.image-preview-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-details {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 10px;
  min-width: 0;
}

.image-position,
.image-filename {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-position {
  color: var(--muted);
  font-size: 12px;
}

.image-filename {
  grid-column: 1;
  font-size: 13px;
}

.image-preview-details label,
.image-alt-input {
  grid-column: 1 / -1;
}

.image-preview-details label {
  font-size: 12px;
}

.image-remove {
  grid-column: 2;
  grid-row: 1 / 3;
  min-width: 64px;
  min-height: 46px;
}

/* Authentication follows PaoPao's compact 360px card instead of a marketing page. */
.auth-page {
  background: var(--surface-subtle);
}

.paopao-auth-layout {
  display: grid;
  place-items: start center;
  min-height: calc(100vh - 58px);
  padding: 42px 16px;
}

.auth-card {
  width: min(100%, 380px);
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

.auth-brand {
  margin-bottom: 18px;
}

.auth-brand .brand-mark {
  width: 36px;
  height: 36px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 -2px 20px;
  border-bottom: 1px solid var(--line);
}

.auth-tabs a {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 46px;
  color: var(--muted);
  font-weight: 650;
}

.auth-tabs a[aria-current="page"] {
  color: var(--primary-hover);
}

.auth-tabs a[aria-current="page"]::after {
  position: absolute;
  right: 18px;
  bottom: -1px;
  left: 18px;
  height: 2px;
  background: var(--primary);
  content: "";
}

.auth-card h1 {
  margin-bottom: 4px;
  font-size: 21px;
}

.auth-intro {
  margin-bottom: 18px;
}

.registration-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -8px 0 18px;
}

.registration-features span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  color: var(--primary-strong);
  background: var(--primary-faint);
  border: 1px solid #bae6fd;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 650;
}

.auth-switch {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.closed-register {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 8px 0;
  text-align: center;
}

.closed-register h1,
.closed-register p {
  margin: 0;
}

.closed-register p {
  color: var(--muted);
  font-size: 13px;
}

/* Inner stream, detail, profile, and operational pages. */
.reading-column,
.composer-page {
  width: min(100%, var(--content-main));
  min-height: calc(100vh - 98px);
  margin: 20px auto 0;
  background: #fff;
  border: 1px solid var(--line);
}

.reading-column > .stream-page-header,
.composer-page > .stream-page-header {
  top: 58px;
}

.stream-page-header .back-link {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-right: 7px;
  color: var(--text);
  border-radius: 50%;
}

.stream-page-header .back-link:hover {
  background: var(--surface-subtle);
}

.form-surface {
  padding: 18px 20px 22px;
  background: #fff;
}

.composer-page .form-surface {
  padding-top: 16px;
}

.community-composer-page {
  width: 100%;
  min-height: auto;
  margin: 0;
  border: 0;
}

.community-composer-page .form-surface {
  padding: 16px;
}

.quote-compose-surface {
  display: grid;
  gap: 14px;
}

.quote-compose-preview {
  display: grid;
  gap: 7px;
  padding: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.quote-compose-preview > span {
  color: var(--muted);
  font-size: 13px;
}

.quote-compose-preview a {
  display: grid;
  gap: 3px;
  color: var(--text);
}

.quote-compose-preview strong {
  font-size: 14px;
}

.reading-column > .entry-card {
  border-bottom: 1px solid var(--line);
}

.comments-section {
  border-top: 1px solid var(--line);
}

.quote-thread-section {
  border-top: 1px solid var(--line);
}

.quote-thread-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.quote-thread-heading h2 {
  margin: 0;
  font-size: 17px;
}

.quote-thread-heading a {
  color: var(--primary);
  font-size: 14px;
  font-weight: 700;
}

.quote-thread-list {
  display: block;
}

.quote-thread-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.quote-thread-item .identity-line,
.comment-item .identity-line {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.quote-thread-item .identity-line > div,
.comment-item .identity-line > div {
  display: grid;
  min-width: 0;
}

.quote-thread-body,
.comment-body {
  margin-left: 50px;
  margin-top: 7px;
  color: var(--text);
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.comments-heading {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.comments-heading h2 {
  margin: 0;
  font-size: 17px;
}

.comment-form {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.comment-actions {
  justify-content: space-between;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.comment-list {
  display: block;
}

.comment-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.comment-body {
  color: var(--text);
}

.sign-in-note,
.status-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  color: var(--muted);
  background: var(--primary-faint);
  border-bottom: 1px solid var(--line);
}

.sign-in-note p {
  margin: 0;
}

.policy-page > .back-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  color: var(--muted-strong);
}

.profile-summary {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.profile-cover {
  height: 126px;
  background:
    radial-gradient(circle at 22% 32%, rgba(255, 255, 255, 0.28), transparent 25%),
    linear-gradient(135deg, var(--primary-soft), #7dd3fc);
}

.profile-leading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 0 16px;
}

.profile-summary .profile-avatar {
  width: 88px;
  height: 88px;
  margin-top: -44px;
  background: var(--primary-soft);
  border: 4px solid #fff;
  font-size: 30px;
}

.profile-avatar-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.profile-avatar-preview .profile-avatar {
  width: 64px;
  height: 64px;
  margin: 0;
  border-width: 1px;
  font-size: 22px;
}

.profile-avatar-preview > span:last-child {
  display: grid;
  gap: 3px;
}

.profile-avatar-preview small {
  color: var(--muted);
  line-height: 1.5;
}

.profile-copy {
  min-width: 0;
  padding: 8px 16px 0;
}

.profile-name,
.profile-bio {
  overflow-wrap: anywhere;
}

.profile-name {
  display: block;
  color: var(--text);
  font-size: 21px;
  line-height: 1.25;
}

.profile-name-line .verified-badge {
  width: 19px;
  height: 19px;
  flex-basis: 19px;
}

.profile-handle {
  margin: 1px 0 12px;
  color: var(--muted);
}

.profile-bio {
  margin-bottom: 14px;
  line-height: 1.65;
}

.profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 0;
}

.profile-stats > div {
  display: flex;
  gap: 5px;
}

.profile-stats dt {
  color: var(--muted);
}

.profile-stats dd {
  order: -1;
  margin: 0;
  font-weight: 700;
}

.profile-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
  padding-top: 10px;
}

.profile-actions form {
  margin: 0;
}

.profile-more-menu .entry-more-popover {
  max-width: calc(100vw - 24px);
}

.profile-tabs {
  display: grid;
  place-items: center;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
}

.profile-tabs h2 {
  position: relative;
  display: grid;
  place-items: center;
  align-self: stretch;
  min-width: 112px;
  margin: 0;
  font-size: 14px;
}

.profile-tabs h2::after {
  position: absolute;
  right: 24px;
  bottom: 0;
  left: 24px;
  height: 4px;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  content: "";
}

.member-notes .feed-heading,
.records-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.feed-heading h2,
.records-heading h2 {
  margin: 0;
  font-size: 17px;
}

.form-layout,
.member-console,
.narrow-form-page,
.error-page {
  width: min(calc(100% - 32px), 960px);
  margin: 26px auto 0;
}

.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 620px) 280px;
  gap: 16px;
  align-items: start;
}

.member-settings-layout,
.member-password-layout {
  display: grid;
  gap: 0;
}

.member-settings-layout > .form-surface,
.member-settings-layout > .form-aside,
.member-password-layout > section {
  padding: 20px;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.member-settings-layout > .form-surface > h2,
.member-password-layout h2 {
  margin-bottom: 6px;
  font-size: 21px;
}

.member-settings-layout .account-security-card {
  display: grid;
  gap: 10px;
}

.member-settings-layout .account-security-card p {
  margin: 0;
}

.member-settings-layout .account-security-card .button-block {
  justify-self: start;
  width: auto;
}

.member-password-layout .account-safety-card {
  margin: 0;
}

.membership-hero,
.membership-confirm {
  padding: 24px 20px 28px;
  border-bottom: 1px solid var(--line);
}

.membership-status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.membership-mark {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: #0ea5e9;
}

.membership-mark svg > path:first-child {
  fill: currentColor;
  stroke: none;
}

.membership-mark svg > path:last-child {
  fill: none;
  stroke: #fff;
  stroke-width: 2;
}

.membership-hero h2,
.membership-confirm h2 {
  margin-bottom: 6px;
  font-size: 25px;
  letter-spacing: -0.02em;
}

.membership-hero > p,
.membership-confirm > p {
  max-width: 510px;
  margin-bottom: 18px;
  color: var(--muted-strong);
}

.membership-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 20px 0 14px;
}

.membership-price strong {
  color: var(--text);
  font-size: 36px;
  letter-spacing: -0.04em;
  line-height: 1;
}

.membership-price strong span {
  margin-right: 2px;
  font-size: 20px;
}

.membership-price > span {
  color: var(--muted);
  font-size: 13px;
}

.membership-benefits {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0 0 22px;
  list-style: none;
}

.membership-benefits li {
  position: relative;
  padding-left: 23px;
  color: var(--muted-strong);
}

.membership-benefits li::before {
  position: absolute;
  left: 2px;
  color: var(--primary);
  font-weight: 800;
  content: "✓";
}

.membership-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 240px;
  text-decoration: none;
}

.membership-cta:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.membership-notice {
  padding: 10px 12px;
  color: var(--muted-strong);
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.membership-resume-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.membership-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin: 18px 0 22px;
}

.membership-facts > div {
  display: grid;
  gap: 2px;
}

.membership-facts dt {
  color: var(--muted);
  font-size: 12px;
}

.membership-facts dd {
  margin: 0;
  font-weight: 700;
}

.membership-history {
  border-bottom: 1px solid var(--line);
}

.membership-history ol {
  padding: 0;
  margin: 0;
  list-style: none;
}

.membership-history li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 10px 16px;
  border-top: 1px solid var(--line-soft);
}

.membership-history li > span:first-child {
  color: var(--muted);
}

.membership-confirm {
  text-align: center;
}

.membership-confirm-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin: 8px auto 16px;
  color: #fff;
  background: var(--primary);
  border-radius: 50%;
  font-size: 24px;
  font-weight: 800;
}

.membership-confirm > p {
  margin-right: auto;
  margin-left: auto;
}

.membership-confirm .membership-facts {
  justify-content: center;
}

.membership-handoff {
  max-width: 600px;
  margin: 0 auto;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.membership-paypal-icon {
  background: #0070ba;
  font-family: Georgia, serif;
  font-style: italic;
}

.membership-handoff .membership-eyebrow {
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.membership-sandbox-help {
  margin-top: 14px;
  margin-bottom: 8px;
  font-size: 13px;
}

.membership-payment-fallback {
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  text-underline-offset: 3px;
}

.form-layout > .form-surface,
.form-aside,
.narrow-form-page,
.member-console-heading,
.state-summary,
.member-records,
.page-heading,
.error-page {
  background: #fff;
  border: 1px solid var(--line);
}

.form-layout > .form-surface,
.form-aside,
.narrow-form-page,
.error-page {
  padding: 22px;
}

.form-aside h2 {
  margin-bottom: 8px;
  font-size: 18px;
}

.form-aside ul {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--muted-strong);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--muted-strong);
}

.form-surface > h1,
.narrow-form-page > h1 {
  margin-bottom: 6px;
  font-size: 24px;
}

.narrow-form-page {
  width: min(calc(100% - 32px), 520px);
}

.member-console-heading {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 22px;
}

.member-console-stream {
  width: 100%;
  margin: 0;
}

.member-console-stream .member-console-heading,
.member-console-stream .state-summary,
.member-console-stream .member-records {
  border-right: 0;
  border-left: 0;
}

.member-console-stream .member-console-heading {
  align-items: center;
  padding: 14px 16px;
  border-top: 0;
}

.member-console-stream .member-console-heading > p {
  max-width: 330px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.member-console-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.member-console-actions {
  justify-content: flex-end;
}

.member-tools-menu {
  position: relative;
}

.member-tools-menu > summary {
  display: inline-grid;
  place-items: center;
  min-width: 64px;
  min-height: 44px;
  padding: 0 12px;
  color: var(--muted-strong);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.member-tools-menu > summary::-webkit-details-marker {
  display: none;
}

.member-tools-menu > summary:hover {
  color: var(--primary-strong);
  background: var(--primary-faint);
}

.member-tools-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  display: grid;
  gap: 6px;
  width: 210px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
}

.member-tools-panel a {
  justify-content: flex-start;
  width: 100%;
}

.state-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 0;
}

.state-summary > div {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 15px;
  border-right: 1px solid var(--line);
}

.state-summary > div:last-child {
  border-right: 0;
}

.state-summary strong {
  color: var(--primary-hover);
  font-size: 21px;
}

.state-summary span {
  color: var(--muted);
  font-size: 12px;
}

.member-console-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: 0;
}

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

.member-record-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.member-record-list > li {
  padding: 15px 16px;
  border-bottom: 1px solid var(--line);
}

.member-record-list > li:last-child {
  border-bottom: 0;
}

.record-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.record-meta time,
.record-actions {
  color: var(--muted);
  font-size: 12px;
}

.record-actions > a,
.empty-state-compact > a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.member-record-list p {
  margin: 10px 0;
  overflow-wrap: anywhere;
}

.withdraw-control {
  position: relative;
}

.withdraw-control summary {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--danger);
  cursor: pointer;
}

.withdraw-control form {
  position: absolute;
  right: 0;
  z-index: 10;
  width: 220px;
  padding: 12px;
  background: #fff;
  border: 1px solid #fecaca;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.withdraw-control form p {
  margin: 0 0 8px;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
}

.page-heading h1,
.page-heading p {
  margin-bottom: 2px;
}

.notification-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.notification-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.notification-item.is-unread {
  background: var(--primary-faint);
}

.notification-item:hover {
  background: var(--surface-subtle);
}

.notification-identity {
  position: relative;
  display: grid;
  place-items: center;
  align-self: start;
  width: 44px;
  height: 44px;
}

.notification-identity .avatar {
  width: 40px;
  height: 40px;
}

.notification-system-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--primary);
  background: var(--primary-faint);
  border-radius: 50%;
}

.notification-system-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.notification-dot {
  position: absolute;
  top: 0;
  right: 0;
  width: 7px;
  height: 7px;
  background: var(--primary);
  border: 2px solid #fff;
  border-radius: 50%;
  box-sizing: content-box;
}

.notification-copy {
  min-width: 0;
}

.notification-item p {
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.notification-item time,
.notification-reason {
  color: var(--muted);
  font-size: 12px;
}

.notification-target-unavailable {
  max-width: 72px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.notification-open {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--muted-strong);
  border-radius: 50%;
}

.notification-open:hover {
  color: var(--primary-strong);
  background: var(--primary-faint);
}

.notification-open svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.community-empty-state {
  min-height: 300px;
  padding: 64px 24px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}

.target-summary {
  display: grid;
  gap: 4px;
  margin: 16px 0;
  padding: 12px;
  background: var(--surface-subtle);
  border-left: 3px solid var(--primary);
}

.target-summary span {
  color: var(--muted);
  font-size: 12px;
}

.policy-page {
  padding: 22px;
}

.policy-page > header {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.policy-page h1 {
  margin-bottom: 7px;
  font-size: 26px;
}

.policy-page section {
  padding-top: 20px;
}

.policy-page section h2 {
  margin-bottom: 6px;
  font-size: 18px;
}

.policy-page section p {
  color: var(--muted-strong);
  line-height: 1.75;
}

.error-page {
  max-width: 520px;
  text-align: center;
}

.error-code {
  margin-bottom: 0;
  color: var(--primary);
  font-size: 48px;
  font-weight: 800;
}

@media (max-width: 1100px) {
  .paopao-shell {
    grid-template-columns: 80px var(--content-main) var(--sidebar-right);
    width: calc(80px + var(--content-main) + var(--sidebar-right) + var(--shell-gap) * 2);
  }

  .paopao-sidebar {
    padding-inline: 8px;
  }

  .sidebar-brand {
    gap: 0;
    width: 52px;
    padding: 8px;
    margin-left: 6px;
    border-radius: 50%;
  }

  .sidebar-brand-copy {
    display: none;
  }

  .sidebar-nav > a {
    justify-content: center;
    padding: 0;
  }

  .sidebar-nav > a span,
  .sidebar-nav .sidebar-badge,
  .sidebar-account {
    display: none;
  }
}

@media (max-width: 959px) {
  body {
    padding-bottom: 0;
  }

  body:not(.community-page) .message-stack {
    top: 66px;
  }

  .inner-header-content {
    width: min(100% - 20px, 620px);
  }

  .inner-nav > a:not(.nav-join):not(:first-child),
  .inner-nav .nav-form {
    display: none;
  }

  .site-footer {
    display: grid;
    gap: 8px;
    margin-top: 24px;
  }

  .paopao-shell {
    display: block;
    width: min(100%, var(--content-main));
  }

  .paopao-sidebar,
  .paopao-rightbar {
    display: none;
  }

  .stream-panel {
    width: 100%;
    border-left: 0;
    border-right: 0;
  }

  .stream-header {
    min-height: 52px;
    padding-left: 8px;
    background: #fff;
    backdrop-filter: none;
  }

  .stream-mobile-brand {
    display: grid;
    flex: 0 0 36px;
    place-items: center;
    margin-right: 4px;
  }

  .stream-mobile-brand img {
    display: block;
    width: 30px;
    height: 30px;
  }

  .mobile-menu {
    display: block;
    margin-right: 4px;
  }

  .mobile-menu > summary,
  .mobile-menu-close {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
  }

  .mobile-menu > summary {
    list-style: none;
  }

  .mobile-menu > summary::-webkit-details-marker {
    display: none;
  }

  .mobile-menu > summary:hover {
    background: var(--surface-subtle);
  }

  .mobile-menu > summary svg {
    width: 23px;
    height: 23px;
  }

  .external-reference-line {
    gap: 6px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .external-reference-line .external-author {
    max-width: 30%;
  }

  .external-reference-line > a {
    font-size: 12px;
  }

  .mobile-menu-backdrop {
    display: none;
  }

  .mobile-menu[open] .mobile-menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 80;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(15, 23, 42, 0.38);
    cursor: default;
  }

  .mobile-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 90;
    width: min(82vw, 312px);
    padding: 14px;
    overflow-y: auto;
    background: #fff;
    box-shadow: 10px 0 28px rgba(15, 23, 42, 0.16);
  }

  .mobile-menu-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1;
    padding: 0;
    color: var(--text);
    border: 0;
    background: var(--surface-subtle);
  }

  .mobile-menu-close:hover {
    color: var(--primary-strong);
    background: var(--primary-soft);
  }

  .mobile-menu-close svg {
    width: 22px;
    height: 22px;
  }

  .mobile-drawer .sidebar-inner {
    min-height: calc(100vh - 28px);
  }

  .mobile-drawer .sidebar-brand {
    gap: 10px;
    width: fit-content;
    padding: 8px 12px 8px 8px;
    margin-left: 10px;
    border-radius: 14px;
  }

  .mobile-drawer .sidebar-brand-copy {
    display: grid;
  }

  .mobile-drawer .sidebar-nav > a {
    justify-content: flex-start;
    padding: 0 18px;
  }

  .mobile-drawer .sidebar-nav > a span,
  .mobile-drawer .sidebar-nav .sidebar-badge,
  .mobile-drawer .sidebar-account {
    display: flex;
  }

  .mobile-drawer .sidebar-account {
    display: block;
  }

  .mobile-discovery {
    margin: 0 4px 14px;
  }

  .mobile-discovery form {
    grid-template-columns: 1fr 44px;
    padding-right: 1px;
  }

  .mobile-discovery button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    color: var(--primary);
    background: transparent;
    border: 0;
    border-radius: 50%;
  }

  .quick-composer,
  .entry-card {
    padding: 14px 12px;
  }

  .quick-composer.inline-composer {
    grid-template-columns: minmax(0, 1fr);
  }

  .quick-composer.inline-composer > .avatar {
    display: none;
  }

  .guest-composer {
    min-height: 96px;
  }

  .guest-composer-actions {
    width: auto;
  }

  .guest-composer-actions a {
    flex: 0 0 auto;
    min-width: 84px;
  }

  .composer-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .composer-tool {
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    min-height: 54px;
    padding: 5px 2px;
    background: var(--primary-faint);
  }

  .composer-tool span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .composer-submit {
    grid-column: 1 / -1;
    width: 100%;
    margin: 2px 0 0;
  }

  .composer-page .form-actions {
    position: sticky;
    bottom: 0;
    z-index: 20;
    margin: 0 -12px -12px;
    padding: 10px 12px 12px;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(10px);
  }

  .composer-page .field-control,
  .composer-page button,
  .composer-page a {
    scroll-margin-bottom: 88px;
  }

  .composer-shortcuts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .composer-form textarea.field-control {
    min-height: 120px;
  }

  .composer-form.inline-composer-form textarea.field-control {
    height: 58px;
    min-height: 58px;
  }

  .interaction-button,
  .quiet-action,
  .button-primary,
  .button-secondary,
  .button-danger {
    min-height: 44px;
  }

  .media-grid img {
    height: min(44vw, 220px);
  }

  .media-count-1 img {
    height: auto;
    max-height: 620px;
  }

  .media-count-3 img:first-child {
    height: calc(min(44vw, 220px) * 2 + 4px);
  }

  .reading-column,
  .composer-page {
    width: 100%;
    min-height: calc(100vh - 58px);
    margin-top: 0;
    border-right: 0;
    border-left: 0;
  }

  .reading-column > .stream-page-header,
  .composer-page > .stream-page-header {
    top: 58px;
  }

  .form-layout,
  .member-console,
  .narrow-form-page,
  .error-page {
    width: min(100% - 20px, 620px);
    margin-top: 14px;
  }

  .form-layout {
    grid-template-columns: 1fr;
  }

  .member-console-heading {
    display: grid;
  }

  .member-console-actions {
    justify-content: flex-start;
  }

  .member-console-grid {
    grid-template-columns: 1fr;
  }

  .profile-cover {
    height: 112px;
  }

  .profile-summary .profile-avatar {
    width: 80px;
    height: 80px;
    margin-top: -40px;
    font-size: 26px;
  }

  .notification-item {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 8px;
    padding-inline: 12px;
  }

  .notification-item > .notification-target-unavailable {
    grid-column: 2 / -1;
    justify-self: start;
    max-width: none;
    text-align: left;
  }
}

@media (max-width: 520px) {
  .guest-composer {
    align-items: flex-start;
    flex-direction: column;
    min-height: 0;
    gap: 9px;
  }

  .guest-composer-actions {
    width: 100%;
  }

  .guest-composer-actions a {
    flex: 1 1 0;
    min-width: 0;
  }

  .inline-composer-shortcuts {
    justify-content: space-between;
    gap: 0;
    overflow: visible;
  }

  .inline-composer-shortcuts a,
  .inline-composer-shortcuts button {
    flex: 1 1 0;
    min-width: 44px;
    padding: 0;
  }

  .inline-composer-shortcuts a > strong,
  .inline-composer-shortcuts button > strong {
    display: none;
  }

  .external-reference-line .external-author {
    max-width: 25%;
  }

  .inner-header-content {
    width: calc(100% - 16px);
  }

  .inner-nav > a:first-child {
    display: none;
  }

  .auth-page .inner-header {
    display: none;
  }

  body.auth-page .message-stack {
    top: 14px;
  }

  .topic-context-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .topic-context-action {
    width: 100%;
  }

  .paopao-auth-layout {
    min-height: 100vh;
    padding: 20px 12px;
  }

  .auth-card {
    padding: 18px;
  }

  .entry-card {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
  }

  .entry-card > .avatar {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .identity-line,
  .identity-copy {
    gap: 4px;
  }

  .interaction-bar {
    grid-template-columns: repeat(5, minmax(40px, 1fr));
  }

  .image-preview-item {
    grid-template-columns: 1fr;
  }

  .image-preview-frame {
    height: 128px;
  }

  .image-remove {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }

  .state-summary {
    grid-template-columns: 1fr 1fr;
  }

  .state-summary > div:nth-child(2) {
    border-right: 0;
  }

  .state-summary > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .profile-summary {
    display: block;
  }

  .profile-avatar {
    margin-bottom: 0;
  }

  .profile-actions {
    margin-top: 0;
    justify-content: flex-end;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}

.registration-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.recovery-code-card {
  gap: 14px;
}

.recovery-code-value {
  width: 100%;
  border: 1px solid var(--focus);
  border-radius: 10px;
  background: var(--primary-faint);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  line-height: 1.5;
  padding: 12px;
  text-align: center;
}

.account-safety-card {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.account-safety-card h2 {
  margin: 0 0 8px;
  font-size: 19px;
}

.account-safety-card > p {
  color: var(--muted);
  margin: 0 0 16px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
