:root {
  color-scheme: light;
  --bg: #f3f6f8;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #66727f;
  --line: #d9e1e7;
  --accent: #d94635;
  --accent-strong: #b83224;
  --teal: #0f766e;
  --amber: #b7791f;
  --blue: #2563eb;
  --shadow: 0 16px 42px rgba(29, 41, 57, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, "Segoe UI", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", Arial, sans-serif;
  min-width: 320px;
}

body:not([data-auth="app"]):not([data-auth="public"]) .app-shell {
  display: none;
}

body[data-auth="app"] .auth-screen,
body[data-auth="public"] .auth-screen {
  display: none;
}

.public-login-action {
  display: none;
}

body[data-auth="public"] .public-login-action {
  display: inline-flex;
  align-items: center;
}

body[data-auth="public"] .top-actions,
body[data-auth="public"] .tabs,
body[data-auth="public"] .mobile-bottom-nav,
body[data-auth="public"] .feed-switcher {
  display: none;
}

button,
select,
input {
  font: inherit;
}

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

button {
  cursor: pointer;
}

.app-shell {
  width: min(1420px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 36px;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(460px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.auth-feedback {
  margin: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
  color: var(--ink);
  line-height: 1.5;
}

.auth-feedback[data-tone="success"] {
  border-color: #8bc9ae;
  background: #edf9f2;
  color: #17613f;
}

.auth-feedback[data-tone="info"] {
  border-color: #9dbce8;
  background: #f0f6ff;
  color: #194f91;
}

.auth-feedback[data-tone="error"] {
  border-color: #e7a69f;
  background: #fff3f1;
  color: #9f2f24;
}

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

.link-button {
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  padding: 0;
  min-height: auto;
  font-weight: 750;
}

.password-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.password-control input {
  border: 0;
  min-width: 0;
}

.password-toggle {
  min-height: 40px;
  border: 0;
  border-left: 1px solid var(--line);
  background: #f8fafb;
  color: var(--muted);
  padding: 0 12px;
  font-weight: 750;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.user-menu-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px 0 7px;
  background: #fff;
  color: var(--ink);
  font-weight: 750;
}

.user-avatar {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-weight: 700;
}

.language-field select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 28px 0 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

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

.brand-mark {
  width: 48px;
  height: 48px;
  display: block;
  object-fit: cover;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
  flex: 0 0 auto;
}

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

h1 {
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.12;
  letter-spacing: 0;
}

.brand p,
.section-heading span,
.meta,
.comment-meta,
.status-grid span,
.select-field span,
.range-field span {
  color: var(--muted);
}

.brand p {
  margin-top: 4px;
  font-size: 14px;
}

.playback-language {
  display: grid;
  gap: 6px;
  min-width: 180px;
}

.playback-language span {
  color: var(--muted);
}

.playback-language strong {
  font-size: 14px;
}

.top-actions,
.player-controls,
.voice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.icon-button,
.primary-action,
.ghost-action,
.tab {
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 42px;
  transition:
    transform 120ms ease,
    background 120ms ease,
    border-color 120ms ease;
}

.icon-button {
  width: 44px;
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: 0 2px 10px rgba(29, 41, 57, 0.06);
}

.primary-action {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  padding: 0 18px;
  font-weight: 750;
}

.ghost-action {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--line);
  padding: 0 16px;
}

.icon-button:hover,
.primary-action:hover,
.ghost-action:hover,
.tab:hover {
  transform: translateY(-1px);
}

.primary-action:hover {
  background: var(--accent-strong);
}

#refreshBtn:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.auth-card .primary-action:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.status-grid {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.status-grid div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  min-width: 0;
}

.status-grid span,
.status-grid strong {
  display: block;
}

.status-grid strong {
  margin-top: 6px;
  font-size: 20px;
  line-height: 1.2;
  word-break: break-word;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tab {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
  padding: 0 18px;
}

.tab.is-active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.mobile-bottom-nav {
  display: none;
}

.feed-switcher {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  align-items: end;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 6px 20px rgba(29, 41, 57, 0.04);
}

.app-shell[data-view="recommend"] .feed-switcher {
  display: none;
}

.app-shell[data-view="messages"] .feed-switcher,
.app-shell[data-view="space"] .feed-switcher,
.app-shell[data-view="notifications"] .feed-switcher,
.app-shell[data-view="listen"] .feed-switcher,
.app-shell[data-view="profile"] .feed-switcher {
  display: none;
}

.country-field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.country-field select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
  font-weight: 750;
}

.category-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 1px;
  scrollbar-width: thin;
}

.category-tab {
  flex: 0 0 auto;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 0 13px;
  font-weight: 800;
}

.category-tab.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.workspace {
  display: grid;
  gap: 16px;
  align-items: start;
}

.app-shell[data-view="feed"] .workspace,
.app-shell[data-view="recommend"] .workspace {
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.88fr);
}

.app-shell[data-view="listen"] .workspace,
.app-shell[data-view="space"] .workspace,
.app-shell[data-view="messages"] .workspace,
.app-shell[data-view="notifications"] .workspace,
.app-shell[data-view="profile"] .workspace {
  grid-template-columns: minmax(0, 900px);
  justify-content: center;
}

.app-shell[data-view="messages"] .workspace {
  grid-template-columns: minmax(0, 1120px);
}

.app-shell[data-view="feed"]
  .workspace
  > [data-panel]:not([data-panel="feed"]):not([data-panel="detail"]),
.app-shell[data-view="recommend"]
  .workspace
  > [data-panel]:not([data-panel="recommend"]):not([data-panel="detail"]),
.app-shell[data-view="listen"] .workspace > [data-panel]:not([data-panel="listen"]),
.app-shell[data-view="space"] .workspace > [data-panel]:not([data-panel="space"]),
.app-shell[data-view="messages"] .workspace > [data-panel]:not([data-panel="messages"]),
.app-shell[data-view="notifications"] .workspace > [data-panel]:not([data-panel="notifications"]),
.app-shell[data-view="profile"] .workspace > [data-panel]:not([data-panel="profile"]) {
  display: none;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-heading h2,
.listen-stage h2,
.settings-block h2 {
  font-size: 22px;
  line-height: 1.2;
}

.feed-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.source-selector {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.inline-selector {
  margin-bottom: 12px;
}

.source-card {
  width: 100%;
  display: grid;
  gap: 5px;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 6px 20px rgba(29, 41, 57, 0.05);
}

.source-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.source-card strong {
  color: var(--ink);
  font-size: 20px;
  line-height: 1.25;
}

.source-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.recommend-column,
.space-column,
.messages-column {
  display: grid;
  gap: 14px;
}

.compact-list .article-card {
  padding-bottom: 28px;
}

.recommendation-empty {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.recommendation-empty p {
  margin: 0;
}

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

.article-card {
  display: grid;
  position: relative;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 4px solid transparent;
  border-radius: 8px;
  padding: 14px 14px 34px;
  box-shadow: 0 6px 20px rgba(29, 41, 57, 0.05);
}

.article-card.is-active {
  border-left-color: var(--accent);
}

.rank {
  width: 48px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #eef2f4;
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
}

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

.article-main h3 {
  margin: 0 0 7px;
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: 0;
}

.article-main .ja {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 8px;
}

.summary-line {
  display: -webkit-box;
  margin-top: 9px;
  color: #3b4754;
  font-size: 14px;
  line-height: 1.55;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.meta {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 13px;
}

.recommendation-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 9px;
}

.recommendation-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 8px;
  border-radius: 999px;
  background: #edf7f5;
  color: var(--teal);
  font-size: 12px;
  font-weight: 750;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  background: #edf7f5;
  color: var(--teal);
  font-weight: 700;
}

.pill.status-error {
  background: #fff1f0;
  color: #b83224;
}

.pill.status-warn {
  background: #fff7e6;
  color: #9a5b13;
}

.pill.status-neutral {
  background: #eef2f6;
  color: #526171;
}

.rank-change {
  position: absolute;
  bottom: 10px;
  right: 12px;
  min-width: 22px;
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 7px;
  background: #f4f7f9;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
}

.rank-change.up {
  background: #eefaf7;
  color: var(--accent);
}

.rank-change.down {
  background: #eef5ff;
  color: var(--blue);
}

.detail-column,
.listen-column {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.mobile-back-button {
  display: none;
}

.detail-header {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.detail-header h2 {
  font-size: 24px;
  line-height: 1.28;
}

.summary {
  font-size: 16px;
  line-height: 1.75;
  color: #273241;
  margin-bottom: 16px;
}

.notice {
  border: 1px solid #f1c4bd;
  border-radius: 8px;
  background: #fff4f2;
  color: #8f2e22;
  padding: 11px 12px;
  line-height: 1.55;
  margin-bottom: 14px;
  display: grid;
  gap: 8px;
}

.inline-action {
  justify-self: start;
}

.zh-empty {
  margin-bottom: 12px;
}

.article-image {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin-bottom: 16px;
  background: #eef2f4;
}

.body-text {
  display: grid;
  gap: 13px;
  color: #273241;
  font-size: 16px;
  line-height: 1.85;
}

.body-text p {
  margin: 0;
}

.source-short-note {
  margin-top: 12px;
  border-left: 3px solid #8aa5b8;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  background: #f5f8fa;
}

.original-block {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.original-block summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 750;
  margin-bottom: 10px;
}

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

.key-points,
.viewpoints,
.comments {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.key-point,
.viewpoint,
.comment-item,
.script-item {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.comments-block {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.comments-block h3 {
  font-size: 18px;
}

.comment-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
}

.comment-rank {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #edf3f7;
  color: var(--ink);
  font-weight: 850;
}

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

.comment-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.comment-metrics span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  color: var(--muted);
  background: #fff;
  font-size: 12px;
  font-weight: 750;
}

.comment-source-label {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.4;
}

.comment-source-label.external {
  color: #8f2c19;
  background: #fff0eb;
}

.comment-source-label.internal {
  color: #076b63;
  background: #e8f7f3;
}

.reaction-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.reaction-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 5px 10px;
  font-weight: 800;
  cursor: pointer;
}

.reaction-button.is-active {
  border-color: var(--accent);
  color: var(--accent-strong);
  background: #eaf5ff;
}

.site-discussion {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.site-discussion h3,
.site-comment-list h4 {
  font-size: 18px;
}

.site-comment-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.site-comment-form.compact {
  margin-top: 10px;
}

.site-comment-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
  line-height: 1.55;
  background: #fff;
}

.site-comment-form button {
  justify-self: start;
}

.site-replies,
.site-comments {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.site-comment {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdff;
}

.site-comment.is-mine {
  background: #f1fbf8;
}

.site-comment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

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

.site-comment-delete {
  margin-left: auto;
}

.site-comment p {
  margin: 8px 0 0;
  line-height: 1.65;
}

.site-comment-translation-note {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.site-comment .site-comment-moderation {
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.site-reply-composer {
  margin-top: 9px;
}

.site-reply-composer summary {
  width: fit-content;
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.small-empty {
  padding: 16px;
}

.key-point {
  display: flex;
  align-items: center;
  gap: 8px;
}

.key-point::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--amber);
  flex: 0 0 auto;
}

.viewpoint {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 10px;
  align-items: center;
}

.bar {
  height: 8px;
  margin-top: 7px;
  border-radius: 999px;
  background: #e7edf2;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  width: var(--share);
  background: var(--teal);
}

.comment-item p {
  line-height: 1.65;
}

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

.comment-meta {
  margin-top: 7px;
  font-size: 13px;
}

.source-link {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

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

.listen-column {
  display: grid;
  gap: 18px;
}

.broadcast-source-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.broadcast-source-panel [hidden] {
  display: none;
}

.broadcast-recommend-refresh {
  min-width: 110px;
  min-height: 42px;
}

.listen-stage {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.anchor {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #fff;
  font-weight: 850;
  flex: 0 0 auto;
  border: 5px solid #f4c8c1;
}

.anchor.is-speaking {
  box-shadow: 0 0 0 8px rgba(217, 70, 53, 0.16);
}

.listen-stage p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.large {
  min-height: 56px;
  font-size: 20px;
}

.large-square {
  width: 56px;
  height: 56px;
}

.progress-panel {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--panel);
}

.playback-console {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.playback-console .progress-panel {
  padding: 0;
  border: 0;
  background: transparent;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.progress-track {
  height: 12px;
  border-radius: 999px;
  background: #e5ebf0;
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.select-field,
.range-field {
  display: grid;
  gap: 6px;
  min-width: 150px;
}

.select-field select,
.range-field input {
  min-height: 42px;
}

select {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

input {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 42px;
  padding: 0 10px;
}

textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  line-height: 1.5;
  padding: 10px;
  resize: vertical;
}

input[type="range"] {
  accent-color: var(--accent);
}

.script-list {
  display: grid;
  gap: 12px;
  max-height: min(46vh, 560px);
  overflow: auto;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
  padding-right: 6px;
}

.script-item {
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: #f7f9fb;
  line-height: 1.7;
  color: #303b48;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.script-item.is-active {
  border-color: var(--accent);
  background: #fff5f2;
  color: var(--ink);
  font-weight: 650;
}

.script-spoken {
  color: var(--accent-strong);
}

.script-current {
  margin: 0 -1px;
  padding: 1px 3px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.broadcast-script-panel {
  display: grid;
  gap: 12px;
  min-height: 220px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.broadcast-script-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.broadcast-script-heading h3 {
  font-size: 20px;
}

.broadcast-script-heading span {
  color: var(--muted);
  font-size: 13px;
}

.voice-row {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}

.player-controls {
  display: grid;
  grid-template-columns: 56px minmax(0, 260px) 56px;
  justify-content: center;
  width: min(100%, 392px);
  margin-inline: auto;
  padding: 0;
}

#playBtn {
  width: 100%;
  min-width: 0;
}

.settings-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

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

.form-field span,
.form-note {
  color: var(--muted);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.checkbox-field input {
  width: 18px;
  height: 18px;
}

.form-note {
  margin: 0;
  line-height: 1.5;
}

.compact {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.danger {
  color: var(--accent-strong);
  border-color: #f1c4bd;
}

.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 31, 0.45);
}

.modal-backdrop[hidden] {
  display: none;
}

.profile-panel {
  width: min(100%, 680px);
  max-height: min(86vh, 820px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(15, 23, 31, 0.24);
  padding: 18px;
}

.profile-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.profile-panel-header h2 {
  font-size: 24px;
  line-height: 1.2;
}

.profile-panel-header p {
  margin-top: 5px;
  color: var(--muted);
}

.profile-form {
  display: grid;
  gap: 14px;
}

.profile-section {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: grid;
  gap: 12px;
}

.profile-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.profile-section h3 {
  font-size: 17px;
  line-height: 1.3;
}

.profile-column .profile-panel {
  width: 100%;
  max-height: none;
  overflow: visible;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.profile-back-button {
  width: auto;
  min-width: 64px;
  padding: 0 12px;
}

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

.profile-utility-sections,
.verification-history,
.verification-file-list,
.verification-document-list {
  display: grid;
  gap: 10px;
}

.profile-utility-sections {
  margin-top: 14px;
}

.verification-application-form .profile-section:first-child {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.verification-active-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.verification-file-field input[type="file"] {
  padding: 9px;
  border: 1px dashed #b9c7d1;
  border-radius: 8px;
  background: #f8fafb;
}

.warning-note {
  color: #7b4c19;
}

.verification-selected-file,
.verification-document,
.verification-file-total {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
}

.verification-selected-file > span,
.verification-document {
  min-width: 0;
}

.verification-selected-file strong,
.verification-selected-file small,
.verification-document strong,
.verification-document small {
  display: block;
  overflow-wrap: anywhere;
}

.verification-selected-file small,
.verification-document small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.verification-file-total {
  justify-content: flex-end;
  border: 0;
  padding: 2px 0;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
}

.verification-document {
  color: var(--ink);
  text-decoration: none;
}

.verification-document:hover {
  border-color: #9eb3c2;
  background: #fff;
}

.verification-document.is-purged {
  color: var(--muted);
}

.verification-history-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
  background: #fbfcfd;
}

.verification-history-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.verification-history-card header > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.verification-history-card header span {
  color: var(--muted);
  line-height: 1.4;
}

.verification-status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 9px;
  background: #eef2f5;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.verification-status.status-approved {
  background: #e7f5ec;
  color: #236a3f;
}

.verification-status.status-pending {
  background: #fff3dc;
  color: #7b5515;
}

.verification-status.status-rejected,
.verification-status.status-revoked {
  background: #fae9e7;
  color: #913d36;
}

.verification-meta-grid,
.verification-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin: 0;
}

.verification-meta-grid div,
.verification-detail-grid div {
  min-width: 0;
}

.verification-meta-grid dt,
.verification-detail-grid dt {
  color: var(--muted);
  font-size: 12px;
}

.verification-meta-grid dd,
.verification-detail-grid dd {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.verification-review-reason {
  margin: 0;
  padding: 9px 10px;
  border-left: 3px solid #d8a653;
  background: #fff9ef;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.certified-author-line,
.related-opinion-meta {
  min-width: 0;
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
}

.public-author-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.public-author-link:hover {
  color: var(--accent);
}

.certification-badge {
  min-width: 0;
  max-width: min(240px, 48vw);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  vertical-align: middle;
}

.certification-icon {
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

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

.certification-badge.is-full {
  max-width: 100%;
}

.certification-badge.is-full .certification-title {
  white-space: normal;
  overflow-wrap: anywhere;
}

.profile-utility-actions button {
  flex: 1 1 130px;
}

.space-form {
  display: grid;
  gap: 12px;
}

.space-feed,
.message-list,
.space-comment-list,
.notification-list,
.related-opinion-list {
  display: grid;
  gap: 10px;
}

.space-column,
.notifications-column {
  display: grid;
  gap: 14px;
}

.space-toolbar,
.space-toolbar-actions,
.inline-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.space-toolbar {
  align-items: flex-start;
  justify-content: space-between;
}

.space-view-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid var(--line);
}

.space-view-nav .ghost-action {
  flex: 0 0 auto;
  min-height: 44px;
}

.space-post-actions .is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.space-page-heading {
  display: grid;
  gap: 4px;
}

.space-page-heading h1 {
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.15;
}

.space-page-heading p,
.space-composer-header p {
  color: var(--muted);
  line-height: 1.45;
}

.space-composer-backdrop {
  z-index: 90;
}

.space-composer-panel {
  width: min(720px, calc(100vw - 36px));
  max-height: min(88vh, 820px);
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(15, 23, 31, 0.28);
  padding: 20px;
}

.account-dialog-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 14px 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f4f6f8;
}

.account-dialog-tabs[hidden] {
  display: none;
}

.account-dialog-tab {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
}

.account-dialog-tab.is-active {
  border-color: var(--line);
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 3px 12px rgba(29, 41, 57, 0.08);
}

.account-dialog-tab:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.space-composer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.space-composer-header > div {
  min-width: 0;
}

.space-composer-header .icon-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.space-composer-header h2 {
  font-size: 24px;
  line-height: 1.2;
}

.space-composer-header p {
  margin-top: 5px;
}

.space-composer-panel .space-form,
.space-composer-panel .form-field {
  min-width: 0;
}

.space-composer-panel input,
.space-composer-panel select,
.space-composer-panel textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.space-composer-panel select {
  text-overflow: ellipsis;
}

.space-composer-panel #spacePostBody {
  min-height: 180px;
  max-height: 42vh;
}

.space-composer-actions {
  justify-content: flex-end;
}

.compact-heading {
  align-items: center;
}

.space-load-more {
  width: 100%;
  margin-top: 12px;
}

.space-profile-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.space-profile-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 22px;
  font-weight: 850;
}

.space-profile-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.space-profile-main > span,
.space-profile-stats dt,
.space-profile-main p {
  color: var(--muted);
}

.space-profile-main p {
  line-height: 1.55;
}

.space-profile-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.space-profile-name {
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.space-profile-stats div {
  display: grid;
  gap: 3px;
  text-align: center;
}

.space-profile-stats dd {
  margin: 0;
  font-size: 20px;
  font-weight: 850;
}

.space-post,
.message-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.space-post-header,
.space-post-header > div,
.space-post-actions,
.space-comment header,
.space-comment footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.space-post-header,
.space-comment header {
  justify-content: space-between;
}

.space-post-header time,
.space-comment time {
  color: var(--muted);
  font-size: 12px;
}

.space-author {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  min-height: auto;
  font-weight: 850;
}

.space-author:not(.is-deleted):hover {
  color: var(--blue);
}

.space-author.is-deleted {
  color: var(--muted);
}

.verified-badge {
  width: 17px;
  height: 17px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.content-status,
.space-tag {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  border-radius: 999px;
  background: #eef2f5;
  color: var(--muted);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 750;
}

.content-status.draft {
  background: #fff3cd;
  color: #7c5500;
}

.content-status.hidden,
.content-status.deleted {
  background: #fce8e6;
  color: #9f2f24;
}

.space-post-title {
  margin-top: 13px;
  font-size: 22px;
  line-height: 1.35;
}

.space-post-title-link {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font: inherit;
  line-height: inherit;
  text-align: left;
}

.space-post-body,
.space-post-summary {
  margin: 10px 0;
  color: #273241;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.space-post-summary {
  padding-left: 11px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}

.space-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.space-tag {
  background: #eaf2ff;
  color: #285eaa;
}

.space-post-actions {
  margin-top: 12px;
}

.space-count {
  color: var(--muted);
  font-size: 13px;
}

.space-tombstone,
.anonymous-interaction-note {
  margin-top: 10px;
  padding: 12px;
  border-radius: 8px;
  background: #f4f6f8;
  color: var(--muted);
}

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

.space-detail-panel > .ghost-action {
  margin-bottom: 14px;
}

.space-article-link {
  width: 100%;
  display: grid;
  gap: 4px;
  text-align: left;
  border: 1px solid #d8e3ea;
  background: #f7fafc;
  border-radius: 8px;
  padding: 10px;
}

.space-article-link strong {
  color: var(--blue);
  line-height: 1.45;
}

.space-article-kicker {
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.space-article-link span,
.message-item span {
  color: var(--muted);
  font-size: 13px;
}

.space-comments-section,
.related-opinions {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.space-comment-form {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.space-comment-form textarea {
  width: 100%;
}

.space-replying {
  color: var(--blue);
  font-size: 13px;
  font-weight: 750;
}

.space-comment-thread {
  display: grid;
  gap: 8px;
}

.space-comment {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.space-comment.is-reply {
  margin-left: 34px;
  background: #f8fafb;
}

.space-comment p {
  margin: 8px 0;
  line-height: 1.55;
  white-space: pre-wrap;
}

.space-comment footer button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-size: 12px;
}

.space-comment footer button:hover {
  color: var(--blue);
}

.related-opinion-card,
.notification-item {
  width: 100%;
  display: grid;
  gap: 5px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.related-opinion-card:hover,
.notification-item:hover {
  border-color: #b7c7d3;
  background: #f8fafb;
}

.related-opinion-card span,
.notification-item span {
  color: var(--muted);
  font-size: 12px;
}

.notification-item.is-unread {
  border-left: 4px solid var(--accent);
  background: #fffaf9;
}

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

.notification-filters {
  display: flex;
  align-items: center;
  gap: 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.notification-filter {
  flex: 0 0 auto;
  min-height: 44px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 2px;
  font-weight: 800;
}

.notification-filter.is-active {
  border-bottom-color: var(--accent);
  color: var(--ink);
}

.notification-group {
  display: grid;
  gap: 4px;
}

.notification-group > h3 {
  margin: 0;
  padding: 18px 0 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.notification-group-list {
  display: grid;
}

.notification-item {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
}

.notification-kind,
.direct-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 850;
}

.notification-copy,
.notification-meta {
  min-width: 0;
  display: flex;
}

.notification-copy {
  flex-direction: column;
  gap: 5px;
}

.notification-meta {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notification-route-label {
  color: var(--accent);
  font-weight: 800;
}

.notification-read-action {
  align-self: center;
  min-height: 36px;
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 0 4px;
  font-weight: 800;
}

.message-item {
  display: grid;
  gap: 4px;
}

.tab[data-view="messages"],
.mobile-nav-item[data-view="messages"],
.tab[data-view="notifications"],
.mobile-nav-item[data-view="notifications"] {
  position: relative;
}

.nav-unread-badge,
.direct-total-unread,
.direct-conversation-unread {
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #c0392b;
  color: #fff;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 800;
}

.mobile-unread-badge {
  position: absolute;
  top: 5px;
  right: 11px;
}

.direct-chat-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.38fr) minmax(0, 0.62fr);
  min-height: 640px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(29, 41, 57, 0.06);
}

.direct-chat-sidebar,
.direct-chat-panel {
  min-width: 0;
}

.direct-chat-sidebar {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  padding: 16px;
  border-right: 1px solid var(--line);
  background: #f8fafb;
}

.direct-chat-heading,
.direct-chat-header,
.direct-search-row,
.direct-user-row,
.direct-conversation-row,
.direct-message-form {
  display: flex;
  align-items: center;
}

.direct-chat-heading,
.direct-chat-header,
.direct-user-row,
.direct-conversation-row {
  justify-content: space-between;
  gap: 10px;
}

.direct-chat-heading h2,
.direct-chat-heading p,
.direct-chat-header strong,
.direct-chat-header span {
  margin: 0;
}

.direct-chat-heading p,
.direct-chat-header span,
.direct-user-row span,
.direct-conversation-preview,
.direct-conversation-time,
.direct-message-bubble time {
  color: var(--muted);
  font-size: 12px;
}

.direct-user-search {
  margin: 16px 0 10px;
}

.direct-search-row {
  gap: 8px;
}

.direct-search-row input {
  min-width: 0;
  flex: 1;
}

.direct-user-results,
.direct-conversation-list {
  display: grid;
  gap: 8px;
}

.direct-conversation-list {
  min-height: 0;
  align-content: start;
  overflow-y: auto;
}

.direct-user-results:not(:empty) {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.direct-user-row,
.direct-conversation-row {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  padding: 10px;
  text-align: left;
}

.direct-user-row .direct-avatar,
.direct-conversation-row .direct-avatar {
  width: 42px;
  height: 42px;
}

.direct-conversation-row.is-active {
  border-color: var(--accent);
  background: #eef7fb;
}

.direct-user-identity,
.direct-conversation-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.direct-user-identity span,
.direct-conversation-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.direct-conversation-side {
  flex: 0 0 auto;
  display: grid;
  justify-items: end;
  gap: 5px;
}

.direct-chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 640px;
}

.direct-chat-header {
  min-height: 66px;
  justify-content: flex-start;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}

.direct-chat-identity-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.direct-chat-identity {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.direct-chat-identity-action {
  display: none;
}

.direct-chat-avatar {
  width: 42px;
  height: 42px;
}

.direct-chat-back {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.direct-load-older {
  justify-self: center;
  margin: 10px 0 0;
}

.direct-thread-region {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}

.direct-thread-region > .direct-load-older {
  grid-row: 1;
}

.direct-thread-region > .direct-message-thread {
  grid-row: 2;
}

.direct-message-thread {
  min-height: 420px;
  max-height: 58vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: #f5f8fa;
}

.direct-message-bubble {
  align-self: flex-start;
  max-width: min(78%, 540px);
  display: grid;
  gap: 5px;
  border: 1px solid #dce5ea;
  border-radius: 12px 12px 12px 3px;
  background: #fff;
  padding: 9px 11px;
}

.direct-message-bubble.is-mine {
  align-self: flex-end;
  border-color: #b9ddeb;
  border-radius: 12px 12px 3px 12px;
  background: #e7f5fb;
}

.direct-message-bubble p {
  margin: 0;
  color: #273241;
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.direct-message-bubble time {
  justify-self: end;
}

.direct-message-form {
  align-items: end;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 12px;
}

.direct-message-form .form-field {
  min-width: 0;
  flex: 1;
}

.direct-message-form textarea {
  min-height: 48px;
  max-height: 130px;
  resize: vertical;
}

.direct-message-form[hidden] {
  display: none;
}

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

.settings-block {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.settings-block:first-child {
  border-top: 0;
  padding-top: 0;
}

dl {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
}

dl div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
}

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

dd {
  margin: 0;
  min-width: 0;
  word-break: break-word;
}

.plain-list {
  margin: 12px 0 0;
  padding-left: 20px;
  line-height: 1.8;
  color: #303b48;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 28px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.64);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(18px);
  background: var(--ink);
  color: #fff;
  padding: 11px 16px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
  max-width: min(560px, calc(100% - 32px));
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 980px) {
  .app-shell[data-view="feed"] .workspace,
  .app-shell[data-view="recommend"] .workspace {
    grid-template-columns: 1fr;
  }

  .app-shell[data-mobile-flow="on"][data-mobile-detail="list"] .status-grid {
    display: none;
  }

  .app-shell[data-mobile-flow="on"][data-mobile-detail="list"] .detail-column,
  .app-shell[data-mobile-flow="on"][data-mobile-detail="open"] .feed-column,
  .app-shell[data-mobile-flow="on"][data-mobile-detail="open"] .recommend-column {
    display: none;
  }

  .app-shell[data-news-focus="on"] {
    padding-top: 10px;
  }

  .app-shell[data-news-focus="on"] .topbar,
  .app-shell[data-news-focus="on"] .status-grid {
    display: none;
  }

  .app-shell[data-news-focus="on"] .detail-column {
    border: 0;
    box-shadow: none;
    padding-top: 10px;
  }

  .mobile-back-button {
    display: inline-flex;
    position: fixed;
    right: 16px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 40;
    width: fit-content;
    min-height: 44px;
    margin-bottom: 0;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 28px rgba(29, 41, 57, 0.18);
    backdrop-filter: blur(10px);
  }

  .direct-chat-layout {
    grid-template-columns: 1fr;
    min-height: 560px;
  }

  .direct-chat-sidebar {
    border-right: 0;
  }

  .direct-chat-panel {
    display: none;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-height: 560px;
  }

  .direct-chat-layout.is-chat-open .direct-chat-sidebar {
    display: none;
  }

  .direct-chat-layout.is-chat-open .direct-chat-panel {
    display: grid;
  }

  .direct-chat-back {
    display: inline-flex;
    min-height: 44px;
  }

  .direct-message-thread {
    min-height: 360px;
    max-height: calc(100vh - 330px);
  }

  .direct-thread-region {
    min-height: 0;
  }

  body.direct-chat-open {
    overflow: hidden;
    overscroll-behavior: none;
  }

  .app-shell[data-view="messages"][data-message-mode="thread"] {
    --mobile-bottom-nav-reserve: calc(65px + env(safe-area-inset-bottom));
    position: fixed;
    inset: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding-bottom: var(--mobile-bottom-nav-reserve);
    overflow: hidden;
  }

  .app-shell[data-view="messages"][data-message-mode="thread"] .workspace,
  .app-shell[data-view="messages"][data-message-mode="thread"] .messages-column {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .app-shell[data-view="messages"][data-message-mode="thread"] .workspace {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
  }

  .app-shell[data-view="messages"][data-message-mode="thread"] .messages-column {
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
    gap: 0;
  }

  .app-shell[data-view="messages"][data-message-mode="thread"] .direct-chat-layout {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
  }

  .app-shell[data-view="messages"][data-message-mode="thread"] .direct-chat-panel {
    width: 100%;
    height: 100%;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .app-shell[data-view="messages"][data-message-mode="thread"] .direct-thread-region {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .app-shell[data-view="messages"][data-message-mode="thread"] .direct-message-thread {
    min-height: 0;
    max-height: none;
    overflow-y: auto;
  }

  .app-shell[data-view="messages"][data-message-mode="thread"] .direct-message-form {
    padding-bottom: 12px;
  }
}

@media (max-width: 760px) {
  .broadcast-source-panel {
    grid-template-columns: 1fr 1fr;
  }

  .broadcast-recommend-refresh {
    width: 100%;
  }

  .player-controls {
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    gap: 8px;
  }

  .player-controls .large-square {
    width: 48px;
    height: 56px;
  }

  #playBtn {
    padding-inline: 12px;
    font-size: 18px;
    white-space: nowrap;
  }
}

@media (max-width: 380px) {
  .player-controls {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 6px;
  }

  .player-controls .large-square {
    width: 44px;
  }

  #playBtn {
    padding-inline: 6px;
    font-size: 15px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 720px);
    padding-top: 14px;
  }

  .topbar {
    align-items: center;
    flex-direction: row;
    margin-bottom: 12px;
  }

  .top-actions {
    display: none;
  }

  body[data-auth="public"] .public-login-action {
    min-height: 38px;
    padding: 0 12px;
  }

  .feed-switcher {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 9px;
    padding: 10px;
  }

  .country-field {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  .tabs {
    display: none;
  }

  .mobile-back-button {
    bottom: calc(92px + env(safe-area-inset-bottom));
  }

  .brand-mark {
    width: 44px;
    height: 44px;
  }

  .brand h1 {
    font-size: 26px;
  }

  .brand p {
    font-size: 12px;
  }

  .app-shell {
    padding-bottom: calc(86px + env(safe-area-inset-bottom));
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 45;
    display: flex;
    align-items: stretch;
    gap: 2px;
    min-height: 64px;
    border: 1px solid rgba(207, 218, 226, 0.82);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 12px 34px rgba(29, 41, 57, 0.18);
    backdrop-filter: blur(14px);
    padding: 6px;
  }

  .mobile-nav-item {
    flex: 1 1 0;
    min-width: 0;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--muted);
    display: grid;
    place-items: center;
    gap: 2px;
    padding: 5px 2px;
    font-weight: 760;
  }

  .mobile-nav-item.is-active {
    background: #f0f4f7;
    color: var(--ink);
  }

  .mobile-nav-icon {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: inherit;
    font-size: 15px;
    line-height: 1;
    font-weight: 850;
  }

  .mobile-nav-item span:last-child {
    font-size: 11px;
    line-height: 1.1;
    white-space: nowrap;
  }

  .article-card {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px;
    padding: 11px 10px 30px;
  }

  .rank {
    width: 44px;
    height: 46px;
    font-size: 22px;
  }

  .rank-change {
    bottom: 8px;
    right: 10px;
  }

  .detail-column,
  .listen-column {
    padding: 14px;
  }

  .player-controls,
  .voice-row {
    align-items: stretch;
  }

  .player-controls .primary-action,
  .select-field,
  .range-field {
    flex: 1 1 180px;
  }

  .space-profile-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .space-profile-stats {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .space-profile-actions {
    grid-column: 1 / -1;
  }

  .space-toolbar {
    align-items: stretch;
  }

  .space-toolbar-actions {
    flex: 1 1 100%;
  }

  .space-toolbar-actions button {
    flex: 1 1 120px;
  }

  .space-composer-backdrop {
    align-items: end;
    padding: 0;
  }

  .space-composer-panel {
    width: 100%;
    max-height: 90dvh;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 14px 14px 0 0;
    padding: 16px;
  }

  .space-composer-panel #spacePostBody {
    min-height: 150px;
    max-height: 34dvh;
  }

  .space-comment.is-reply {
    margin-left: 18px;
  }

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

  .verification-active-form button {
    width: 100%;
  }

  .verification-history-card > header {
    align-items: stretch;
    flex-direction: column;
  }

  .profile-panel {
    max-height: calc(100vh - 24px);
    padding: 14px;
  }

  .profile-column .profile-panel {
    max-height: none;
    padding: 0;
  }

  .profile-panel-header {
    align-items: center;
  }

  .profile-actions {
    justify-content: stretch;
  }

  .profile-actions button {
    flex: 1 1 auto;
  }
}

@media (max-width: 460px) {
  .verification-meta-grid,
  .verification-detail-grid {
    grid-template-columns: 1fr;
  }

  .verification-selected-file {
    align-items: stretch;
    flex-direction: column;
  }

  .verification-selected-file button {
    width: 100%;
  }

  .certification-badge {
    max-width: min(190px, 52vw);
  }

  .direct-message-form {
    align-items: stretch;
    flex-direction: column;
  }

  .direct-message-form button {
    width: 100%;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }

  .tab {
    padding: 0 8px;
  }

  .listen-stage {
    align-items: flex-start;
  }

  .anchor {
    width: 68px;
    height: 68px;
    border-width: 4px;
  }
}
