:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #eef3f5;
  --ink: #172026;
  --muted: #63717a;
  --line: #dce4e8;
  --teal: #0f766e;
  --teal-dark: #0b4f4a;
  --coral: #e85d4f;
  --gold: #d99c1f;
  --blue: #4267b2;
  --shadow: 0 18px 45px rgba(20, 33, 43, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.08), transparent 28%),
    linear-gradient(270deg, rgba(232, 93, 79, 0.08), transparent 26%), var(--bg);
  letter-spacing: 0;
}

button,
input,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.app {
  min-height: 100vh;
}

.app-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.auth-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 18px;
  background: var(--bg);
  box-shadow: var(--shadow);
}

.auth-panel {
  width: 100%;
  display: grid;
  gap: 16px;
  padding: 18px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.auth-brand {
  align-items: center;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.auth-tabs button {
  height: 40px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.auth-tabs button.is-active {
  background: var(--ink);
  color: #fff;
}

.auth-heading {
  margin: 0;
  font-size: 22px;
}

.auth-forgot-link {
  justify-self: center;
  margin-top: 2px;
}

.auth-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.auth-legal-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.auth-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 10px 16px;
  background: rgba(244, 246, 248, 0.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(220, 228, 232, 0.7);
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

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

.brand-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
}

.brand-subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 22px;
  line-height: 1;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-button {
  position: relative;
  font-size: 15px;
  font-weight: 800;
}

.badge-dot {
  position: absolute;
  right: -3px;
  top: -3px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 11px;
  border: 2px solid #fff;
}

.icon-button:active,
.primary-button:active,
.secondary-button:active,
.tab-button:active,
.feed-card:active,
.script-row:active,
.rank-card:active {
  transform: translateY(1px);
}

.main {
  min-height: calc(100vh - 64px);
  padding: 12px 14px 112px;
}

.feed-list,
.script-list,
.rank-list,
.comment-list,
.user-list,
.profile-grid {
  display: grid;
  gap: 12px;
}

.feed-control-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.feed-control-panel strong {
  display: block;
  font-size: 16px;
}

.feed-control-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.feed-control-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.compact-button.is-active {
  border-color: var(--teal);
  background: #ecf7f5;
  color: var(--teal);
}

.load-more-button {
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.feed-empty-state {
  display: grid;
  gap: 8px;
  justify-items: start;
  text-align: left;
}

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

.feed-card,
.script-row,
.user-row,
.comment-card,
.rank-card,
.profile-panel,
.publish-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.feed-card,
.rank-card,
.script-row,
.user-row {
  text-align: left;
  color: inherit;
  overflow: hidden;
}

.thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--surface-soft);
  overflow: hidden;
}

.thumb-wrap img,
.avatar img,
.mini-avatar img,
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.score-badge,
.rank-badge,
.play-badge,
.ai-badge,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  white-space: nowrap;
}

.score-badge {
  position: absolute;
  right: 10px;
  top: 10px;
  min-width: 62px;
  height: 30px;
  padding: 0 10px;
  background: rgba(23, 32, 38, 0.84);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.play-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  height: 30px;
  padding: 0 11px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.status-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.status-badge.is-offline,
.status-pill.is-offline {
  background: #fff0ec;
  color: #b3261e;
}

.status-badge.is-reviewing,
.status-pill.is-reviewing {
  background: #fff7df;
  color: #8a5a00;
}

.status-badge.is-rejected,
.status-pill.is-rejected {
  background: #fff0ec;
  color: #b3261e;
}

.status-badge.is-private,
.status-pill.is-private {
  background: #eef1ff;
  color: #30428a;
}

.status-pill.is-public {
  background: #e8f8ef;
  color: #116b38;
}

.script-type-badge {
  background: rgba(15, 122, 110, 0.9);
}

.feed-body {
  padding: 12px;
}

.meta-row,
.stats-row,
.video-meta,
.profile-stat-row,
.rank-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.user-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.user-inline.is-mini {
  gap: 7px;
}

.text-link {
  display: inline;
  padding: 0;
  background: transparent;
  color: var(--teal-dark);
  font-weight: 800;
}

.light-link {
  color: #fff;
}

.avatar,
.mini-avatar {
  flex: 0 0 auto;
  overflow: hidden;
  background: var(--surface-soft);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.76);
}

.avatar {
  width: 34px;
  height: 34px;
}

.mini-avatar {
  width: 28px;
  height: 28px;
}

.user-name {
  font-weight: 750;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.dot {
  width: 4px;
  height: 4px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #9aa7ad;
}

.video-title {
  margin: 10px 0 8px;
  font-size: 18px;
  line-height: 1.25;
}

.script-feed-excerpt {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.script-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 32px;
  padding: 6px 9px;
  border-radius: 8px;
  background: #edf7f4;
  color: var(--teal-dark);
  font-weight: 700;
  font-size: 13px;
  text-align: left;
}

.script-link span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  width: min(100%, 480px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  padding: 8px 12px 12px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.tab-button {
  position: relative;
  height: 48px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 760;
}

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

.publish-tab-button {
  width: 54px;
  height: 54px;
  justify-self: center;
  margin-top: -18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  font-size: 34px;
  font-weight: 720;
  line-height: 1;
  box-shadow: 0 12px 24px rgba(232, 93, 79, 0.32);
}

.nav-dot {
  position: absolute;
  right: 6px;
  top: 5px;
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 10px;
  border: 2px solid #fff;
}

.back-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.back-title h1 {
  margin: 0;
  font-size: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mock-player {
  position: relative;
  aspect-ratio: 9 / 13;
  overflow: hidden;
  border-radius: 8px;
  background: #101820;
}

.mock-player img,
.mock-player video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.player-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.42)),
    linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.22) 45%, transparent 70%);
  background-size: auto, 220% 100%;
  animation: sweep 3s linear infinite;
}

.player-control {
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 2;
  min-width: 62px;
  min-height: 36px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-weight: 800;
}

.player-copy {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 44px;
  color: #fff;
}

.player-copy h2 {
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 1.15;
}

.player-copy p {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.84);
}

.video-support-warning {
  display: grid;
  gap: 8px;
}

.video-error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-section {
  margin-top: 14px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.video-meta-grid div {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.video-meta-grid dt {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.video-meta-grid dd {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.video-support-warning {
  margin-top: 10px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.quick-action {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  text-align: center;
}

.quick-action.is-active {
  background: #fff4f2;
  border-color: #f1b3ac;
  color: #a13a30;
}

.quick-action.is-danger,
.danger-button {
  background: #fff4f2;
  border-color: #f1b3ac;
  color: var(--coral);
}

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

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

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

.section-head h2,
.section-head h3 {
  margin: 0;
  font-size: 17px;
}

.script-excerpt,
.script-full {
  margin: 0;
  color: #27343b;
  line-height: 1.75;
  white-space: pre-line;
}

.script-formatted {
  display: grid;
  gap: 14px;
  color: #27343b;
  line-height: 1.75;
}

.script-paragraph {
  display: grid;
  gap: 6px;
}

.script-paragraph p {
  margin: 0;
}

.script-dialogue {
  display: grid;
  grid-template-columns: minmax(56px, 108px) 1fr;
  gap: 10px;
}

.script-dialogue strong {
  color: var(--teal-dark);
}

.script-narration {
  color: #34444c;
}

.ai-badge {
  height: 26px;
  padding: 0 9px;
  background: #fff1df;
  color: #8a5a00;
  font-weight: 750;
  font-size: 12px;
}

.main-comment {
  border-left: 4px solid var(--gold);
  padding: 10px 10px 10px 12px;
  background: #fffaf0;
  border-radius: 0 8px 8px 0;
  line-height: 1.65;
}

.comment-card {
  padding: 12px;
}

.comment-composer,
.search-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 12px;
}

.comment-composer input,
.search-box input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: #fbfcfd;
  color: var(--ink);
}

.comment-card p {
  margin: 8px 0 0;
  color: #2f3d45;
  line-height: 1.55;
}

.reply-target {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
}

.comment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.danger-link {
  color: var(--coral);
}

.comment-replies {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-left: 14px;
  border-left: 3px solid var(--line);
}

.comment-replies .comment-card {
  background: #f8fafb;
}

.comment-report-button {
  margin-left: auto;
  font-size: 12px;
}

.profile-hero {
  position: relative;
  overflow: hidden;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(9, 23, 27, 0.18), rgba(9, 23, 27, 0.74)),
    var(--profile-bg, none) center / cover,
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #fff;
}

.profile-cover-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(13, 29, 34, 0.7), rgba(13, 29, 34, 0.14));
  pointer-events: none;
}

.profile-top {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  overflow: hidden;
  border-radius: 50%;
  grid-row: 1 / span 2;
  align-self: start;
  flex: 0 0 auto;
  background: var(--surface-soft);
  border: 3px solid rgba(255, 255, 255, 0.88);
}

.profile-info {
  min-width: 0;
  align-self: start;
}

.profile-info h2 {
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  overflow: hidden;
  white-space: nowrap;
}

.profile-info h2 > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-info p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.45;
  word-break: normal;
  overflow-wrap: break-word;
}

.profile-action-row {
  grid-column: 2;
  align-self: start;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}

.profile-action-row .compact-button {
  min-width: 104px;
}

.profile-stat-row {
  position: relative;
  z-index: 1;
  justify-content: space-between;
  margin-top: 14px;
}

.profile-stat {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  text-align: center;
}

.profile-stat strong {
  display: block;
  font-size: 20px;
}

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

.profile-panel {
  padding: 14px;
}

.profile-panel h3 {
  margin: 0 0 10px;
  font-size: 17px;
}

.profile-edit-preview {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(9, 23, 27, 0.12), rgba(9, 23, 27, 0.78)),
    var(--profile-bg, none) center / cover,
    var(--surface-soft);
  color: #fff;
}

.profile-edit-preview > *:not(.profile-cover-shade) {
  position: relative;
  z-index: 1;
}

.profile-edit-preview p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.82);
}

.edit-avatar {
  width: 64px;
  height: 64px;
}

.settings-media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.media-picker {
  width: 100%;
}

.profile-work-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.profile-work-tab {
  min-height: 38px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 780;
}

.profile-work-tab.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(23, 32, 38, 0.08);
}

.user-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.user-row-profile {
  min-width: 0;
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 10px;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.user-row-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.user-row-main strong {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  overflow: hidden;
  white-space: nowrap;
}

.user-row-main strong > .relationship-chip {
  flex: 0 0 auto;
}

.relationship-chip {
  display: inline-grid;
  place-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--teal-dark);
  border: 1px solid rgba(12, 132, 122, 0.18);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.user-row-main .relationship-chip {
  background: #eef8f6;
}

.user-row-main span,
.user-row-main em {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-self-tag {
  color: #30428a;
}

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

.profile-works h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.script-row {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 12px;
  padding: 10px;
}

.script-cover {
  width: 78px;
  height: 96px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-soft);
}

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

.script-row h4,
.rank-card h4 {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.3;
}

.script-row p,
.rank-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  min-height: 24px;
  padding: 3px 8px;
  background: #eef1ff;
  color: #30428a;
  font-size: 12px;
  font-weight: 700;
}

.script-hero {
  display: grid;
  gap: 12px;
}

.script-page-cover {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-soft);
}

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

.rank-card {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 12px;
  padding: 10px;
}

.rank-controls {
  display: grid;
  gap: 8px;
  margin: 10px 0 12px;
}

.rank-controls .segmented-control {
  grid-auto-columns: minmax(0, 1fr);
}

.rank-limit-note,
.rank-extra {
  font-size: 12px;
}

.rank-thumb {
  position: relative;
  width: 118px;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-soft);
}

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

.rank-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 34px;
  height: 28px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.rank-score {
  color: var(--coral);
  font-weight: 800;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 780;
}

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

.secondary-button {
  background: var(--surface-soft);
  color: var(--ink);
  border: 1px solid var(--line);
}

.compact-button {
  min-height: 36px;
  padding: 0 12px;
  white-space: nowrap;
}

.empty-state {
  padding: 32px 18px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.legal-page {
  padding-bottom: 28px;
}

.legal-doc {
  display: grid;
  gap: 14px;
}

.legal-section {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.legal-section h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.legal-section p {
  margin: 0;
  color: #34444c;
  line-height: 1.68;
}

.legal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  align-items: end;
  justify-items: center;
  background: rgba(23, 32, 38, 0.36);
}

.sheet {
  width: min(100%, 480px);
  max-height: min(80vh, 680px);
  overflow: auto;
  padding: 14px;
  background: var(--surface);
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -18px 45px rgba(23, 32, 38, 0.18);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.sheet-head h2 {
  margin: 0;
  font-size: 19px;
}

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

.publish-options {
  display: grid;
  gap: 10px;
}

.search-results,
.notification-list,
.draft-list {
  display: grid;
  gap: 10px;
}

.search-toolbar {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.segmented-control {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
  background: #edf3f4;
}

.segmented-control button {
  min-height: 34px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 900;
}

.segmented-control button.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(18, 34, 42, 0.08);
}

.search-tabs button span {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  margin-left: 5px;
  border-radius: 999px;
  background: rgba(18, 34, 42, 0.08);
  font-size: 11px;
}

.search-suggestion-block {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.search-suggestion-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.search-suggestion-head strong {
  color: var(--ink);
}

.search-suggestion-head button {
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.search-chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.search-chip-row::-webkit-scrollbar {
  display: none;
}

.search-chip {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #f3f6f6;
  color: var(--ink);
  font-weight: 800;
}

.search-chip.is-tag {
  background: #ecf7f5;
  color: var(--teal);
}

.search-results h3 {
  margin: 6px 0 0;
  font-size: 16px;
}

.sheet-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.notification-card,
.draft-card {
  padding: 12px;
  border-radius: 8px;
  background: #fbfcfd;
  border: 1px solid var(--line);
}

.notification-card {
  cursor: pointer;
}

.notification-card:focus-visible {
  outline: 3px solid rgba(20, 130, 122, 0.24);
  outline-offset: 2px;
}

.notification-card.is-unread {
  border-color: #b8ded6;
  background: #f3fbf9;
}

.notification-card p,
.draft-card p {
  margin: 6px 0;
  color: var(--muted);
  line-height: 1.45;
}

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

.messages-page {
  display: grid;
  gap: 12px;
}

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

.message-thread-swipe {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  touch-action: pan-y;
}

.message-thread-delete {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 84px;
  border: 0;
  background: var(--coral);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.message-thread-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: transform 0.18s ease;
  width: 100%;
}

.message-thread-swipe.is-open .message-thread-card {
  transform: translateX(-84px);
}

.message-thread-main {
  min-width: 0;
}

.message-thread-main div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.message-thread-main strong,
.message-thread-main p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-thread-main strong {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.message-thread-badges {
  display: inline-flex;
  gap: 4px;
  flex: 0 0 auto;
}

.message-thread-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 6px;
  background: #eef6f5;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
}

.message-thread-main p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.message-thread-main span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.message-unread {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.message-thread-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.message-thread-head .user-inline {
  flex: 1 1 auto;
  overflow: hidden;
}

.message-thread-head .user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-thread-action-delete {
  flex: 0 0 auto;
  border-color: #f1b3ac;
  background: #fff4f2;
  color: var(--coral);
}

.message-thread-tools {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.message-bubble-list {
  display: grid;
  gap: 10px;
  min-height: 300px;
  align-content: end;
  padding: 12px;
  border-radius: 8px;
  background: #f8fafb;
  border: 1px solid var(--line);
}

.message-bubble {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.message-bubble.is-mine {
  justify-content: flex-end;
}

.message-bubble-body {
  max-width: 78%;
}

.message-bubble p {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  line-height: 1.5;
}

.message-bubble.is-mine p {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.message-bubble-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.message-bubble-meta span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.message-bubble.is-mine .message-bubble-meta {
  justify-content: flex-end;
}

.message-bubble.is-mine .message-bubble-meta span {
  text-align: right;
}

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

.message-status.is-failed {
  color: var(--coral);
  font-weight: 800;
}

.message-bubble-actions {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 4px;
}

.message-bubble.is-mine .message-bubble-actions {
  justify-content: flex-end;
}

.message-inline-action {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 0;
  cursor: pointer;
}

.message-inline-action:hover,
.message-inline-action:focus-visible {
  color: var(--teal);
}

.message-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.message-composer input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: #fbfcfd;
  color: var(--ink);
}

.message-composer input:disabled,
.message-composer button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.draft-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
}

.draft-preview {
  width: 100%;
  max-height: 240px;
  display: block;
  border-radius: 8px;
  background: #101820;
}

.draft-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}

.script-draft-preview,
.script-format-preview {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.script-draft-preview .script-formatted,
.script-format-preview .script-formatted {
  margin-top: 8px;
  gap: 10px;
  font-size: 14px;
}

.publish-card {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  padding: 12px;
  text-align: left;
}

.publish-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--teal-dark);
  font-size: 24px;
  font-weight: 800;
}

.publish-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.publish-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
}

.form-stack {
  display: grid;
  gap: 10px;
}

.video-composer {
  display: grid;
  gap: 12px;
}

.video-composer.is-camera-fullscreen {
  width: 100%;
  max-width: none;
  max-height: 100vh;
  min-height: 100vh;
  border-radius: 0;
  align-content: start;
}

.video-composer.is-camera-fullscreen .selected-script-summary,
.video-composer.is-camera-fullscreen .composer-tabs {
  display: none;
}

.video-composer.is-camera-fullscreen .record-primary {
  position: static;
}

.video-composer.is-recording-fullscreen {
  width: 100%;
  max-width: none;
  height: 100vh;
  max-height: 100vh;
  min-height: 100vh;
  padding: 0;
  gap: 0;
  overflow: hidden;
  border-radius: 0;
  background: #101820;
}

.video-composer.is-recording-fullscreen .sheet-head,
.video-composer.is-recording-fullscreen .selected-script-summary,
.video-composer.is-recording-fullscreen .composer-tabs,
.video-composer.is-recording-fullscreen .preview-panel,
.video-composer.is-recording-fullscreen .inline-alert,
.video-composer.is-recording-fullscreen .record-controls,
.video-composer.is-recording-fullscreen .cover-editor,
.video-composer.is-recording-fullscreen .form-stack {
  display: none;
}

.video-composer.is-recording-fullscreen .camera-frame {
  height: 100vh;
  min-height: 100vh;
  border-radius: 0;
}

.video-composer.is-recording-fullscreen .camera-overlay {
  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}

.selected-script-summary {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.selected-script-summary h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.selected-script-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.composer-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.composer-tab {
  min-height: 38px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 760;
}

.composer-tab.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(23, 32, 38, 0.08);
}

.upload-zone {
  min-height: 148px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 18px;
  border: 1px dashed #9bb6bc;
  border-radius: 8px;
  background: #f6fbfa;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
}

.upload-zone.has-file {
  border-style: solid;
  background: #eef8f6;
}

.upload-zone strong {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.upload-zone span:last-child {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.upload-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: 28px;
  font-weight: 800;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.upload-progress {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: #fbfcfd;
  border: 1px solid var(--line);
}

.upload-progress-head,
.preview-head,
.camera-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.upload-progress-head {
  color: var(--muted);
  font-size: 13px;
}

.upload-progress-head span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.upload-progress-head strong {
  color: var(--ink);
}

.upload-progress-head em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.upload-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.upload-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width 160ms ease;
}

.preview-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.capture-preview {
  border-color: #b8ded6;
  background: #f3fbf9;
}

.cover-editor {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.cover-editor-body {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 12px;
  align-items: center;
}

.cover-preview {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 8px;
  background: #101820;
}

.cover-preview img,
.cover-placeholder {
  width: 100%;
  height: 100%;
}

.cover-preview img {
  object-fit: cover;
  display: block;
}

.cover-placeholder {
  display: grid;
  place-items: center;
  padding: 8px;
  color: #fff;
  background: linear-gradient(135deg, #314f51, #0f181c);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.cover-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.cover-copy p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.cover-picker {
  justify-self: start;
  cursor: pointer;
}

.publish-settings-grid {
  display: grid;
  gap: 10px;
}

.publish-toggle-row {
  justify-content: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
}

.upload-task-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfb;
}

.upload-task-head,
.task-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.upload-task-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.task-status-pill {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e9f3f2;
  color: var(--accent);
  font-weight: 800;
  font-size: 13px;
}

.task-status-pill.is-ready {
  background: #e8f8ef;
  color: #116b38;
}

.task-status-pill.is-error {
  background: #fff0ec;
  color: #b3261e;
}

.video-management-sheet {
  display: grid;
  gap: 12px;
}

.video-management-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.video-tag-row {
  margin-top: 12px;
}

.preview-head strong,
.preview-head span {
  min-width: 0;
}

.preview-head span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-panel video {
  width: 100%;
  max-height: 300px;
  display: block;
  border-radius: 8px;
  background: #101820;
}

.camera-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 8px;
  background: #101820;
}

.camera-frame.is-fullscreen {
  aspect-ratio: auto;
  min-height: min(72vh, 720px);
}

.camera-frame img,
.camera-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.camera-frame img {
  filter: saturate(0.9) brightness(0.75);
}

.camera-frame video {
  object-position: center center;
}

.camera-live.is-mirrored {
  transform: scaleX(-1);
}

.is-hidden {
  display: none !important;
}

.camera-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
  color: #fff;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.54));
}

.record-countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2;
  color: #fff;
  font-size: clamp(72px, 18vw, 160px);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 12px 34px rgba(0, 0, 0, 0.42);
  pointer-events: none;
}

.camera-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.camera-top-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.camera-exit-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(15, 23, 28, 0.58);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
}

.record-time {
  min-height: 26px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 28, 0.48);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.rec-indicator {
  align-self: flex-start;
  min-height: 26px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 12px;
  font-weight: 800;
}

.rec-indicator.is-recording {
  background: var(--coral);
}

.teleprompter {
  padding: 10px;
  border-radius: 8px;
  background: rgba(15, 23, 28, 0.72);
}

.teleprompter.is-collapsed {
  justify-self: end;
  min-width: 112px;
}

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

.teleprompter strong {
  display: block;
  font-size: 12px;
}

.teleprompter-actions {
  display: flex;
  gap: 4px;
}

.cue-button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.teleprompter-tools {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.teleprompter-chip-group {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
}

.teleprompter-chip-group::-webkit-scrollbar {
  display: none;
}

.teleprompter-chip {
  min-width: 30px;
  height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.teleprompter-chip.is-active {
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

.teleprompter p {
  margin: 8px 0 0;
  line-height: 1.55;
  font-size: 14px;
}

.teleprompter-size-small p {
  font-size: 13px;
}

.teleprompter-size-large p {
  font-size: 18px;
}

.teleprompter p span {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.8em;
  font-weight: 900;
}

.teleprompter.is-auto-scroll p {
  max-height: 4.8em;
  overflow: hidden;
  animation: teleprompterAutoScroll 9s linear infinite alternate;
}

.teleprompter.is-auto-scroll {
  overflow: hidden;
}

@keyframes teleprompterAutoScroll {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-22px);
  }
}

.camera-bottom-stack {
  display: grid;
  gap: 12px;
}

.camera-bottom-controls {
  display: grid;
  grid-template-columns: 84px 1fr 84px;
  align-items: center;
  min-height: 84px;
}

.camera-corner-control {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.camera-corner-control:last-child {
  justify-content: flex-end;
}

.camera-record-control {
  display: flex;
  justify-content: center;
}

.camera-tool-button {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(15, 23, 28, 0.62);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.camera-tool-button:disabled {
  cursor: progress;
  opacity: 0.5;
}

.record-circle-button {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 5px solid rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  background: rgba(15, 23, 28, 0.28);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.record-circle-button:disabled {
  cursor: progress;
  opacity: 0.58;
}

.record-circle-button:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.9);
  outline-offset: 4px;
}

.record-circle-core {
  width: 52px;
  height: 52px;
  display: block;
  border-radius: 50%;
  background: #e5483d;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.16);
  transition: width 0.16s ease, height 0.16s ease, border-radius 0.16s ease, background 0.16s ease;
}

.record-circle-button.is-recording .record-circle-core {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #fff;
}

.inline-alert {
  padding: 10px;
  border-radius: 8px;
  background: #fff1f0;
  color: #9a2c21;
  border: 1px solid #ffd4d0;
  line-height: 1.45;
  font-size: 13px;
}

.inline-alert.is-info {
  background: #eef8f6;
  color: var(--teal-dark);
  border-color: #cbe4df;
}

.auth-security-banner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.auth-security-banner span {
  color: #476b68;
}

.record-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.record-upload-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.record-upload-actions.has-secondary {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.record-action-bar {
  display: grid;
  grid-template-columns: minmax(148px, 0.85fr) 1.15fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  background: #fff4f2;
  border: 1px solid #f1b3ac;
}

.record-action-bar span {
  color: #7a3a33;
  line-height: 1.4;
  font-size: 13px;
}

.record-primary {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(132px, 0.9fr) 1.1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  background: #fff4f2;
  border: 1px solid #f1b3ac;
}

.record-primary span {
  color: #7a3a33;
  line-height: 1.4;
  font-size: 13px;
}

.record-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 18px;
  background: var(--coral);
  color: #fff;
  font-weight: 800;
  text-align: center;
}

.primary-record-button {
  min-height: 52px;
  width: 100%;
  border-radius: 8px;
  font-size: 16px;
}

.native-record-label {
  cursor: pointer;
}

.record-button.is-recording {
  background: var(--ink);
}

.native-capture {
  display: grid;
}

.capture-card {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px dashed #9bb6bc;
  border-radius: 8px;
  background: #f6fbfa;
  cursor: pointer;
}

.capture-card.is-primary {
  border-style: solid;
  border-color: #f1b3ac;
  background: #fff4f2;
}

.capture-card.is-primary .publish-icon {
  background: var(--coral);
  color: #fff;
}

.capture-card strong {
  display: block;
  margin-bottom: 4px;
}

.capture-card small {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 8px;
}

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

.field span {
  font-weight: 750;
  font-size: 13px;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: #fbfcfd;
  color: var(--ink);
}

.field textarea {
  min-height: 118px;
  resize: vertical;
}

.script-text-input {
  min-height: 220px;
}

.script-editor-sheet {
  max-height: min(88vh, 780px);
}

.script-editor-actions {
  grid-template-columns: 1fr 1fr;
}

.settings-form {
  gap: 12px;
}

.settings-group {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.settings-group h3 {
  margin: 0;
  font-size: 15px;
}

.admin-page,
.admin-list {
  display: grid;
  gap: 12px;
}

.admin-head {
  align-items: flex-start;
}

.admin-head h2 {
  margin: 0 0 4px;
}

.admin-head p {
  margin: 0;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.admin-stat-grid article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.admin-stat-grid strong {
  font-size: 24px;
}

.admin-stat-grid span {
  color: var(--muted);
  font-size: 12px;
}

.admin-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.admin-report-row {
  grid-template-columns: 1fr;
}

.admin-thumb {
  width: 74px;
  height: 92px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-soft);
}

.admin-row-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.admin-row-main strong {
  word-break: break-word;
}

.admin-row-main p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.admin-row-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}

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

.moderation-context-card h3,
.moderation-context-card p {
  margin: 0;
}

.moderation-context-media {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-soft);
}

.quote-text {
  padding: 12px;
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: 6px;
}

.security-status-row,
.security-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.security-status-row {
  justify-content: space-between;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.security-status-row span,
.settings-note {
  color: var(--muted);
}

.settings-note {
  margin: 0;
  line-height: 1.45;
  font-size: 13px;
}

.security-status-row em {
  font-style: normal;
  font-weight: 800;
}

.security-status-row em.is-ok {
  color: var(--teal-dark);
}

.security-status-row em.is-warning {
  color: #ad5b00;
}

.session-list {
  display: grid;
  gap: 8px;
}

.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.session-row div {
  min-width: 0;
}

.session-row-actions {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.session-row strong,
.session-row p,
.session-row span {
  display: block;
}

.session-row p,
.session-row div span {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.toggle-row {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 152px;
  z-index: 60;
  width: min(calc(100% - 32px), 448px);
  transform: translateX(-50%);
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
}

@keyframes sweep {
  0% {
    background-position: 0 0, 170% 0;
  }
  100% {
    background-position: 0 0, -70% 0;
  }
}

@media (max-width: 720px) and (orientation: portrait) {
  .camera-frame {
    aspect-ratio: 9 / 16;
    max-height: 78vh;
  }

  .camera-frame.is-fullscreen {
    min-height: 82vh;
    max-height: none;
  }

  .video-composer.is-recording-fullscreen .camera-frame {
    height: 100vh;
    min-height: 100vh;
    max-height: none;
  }

  .camera-frame video {
    object-position: center center;
  }

  .teleprompter {
    max-height: 28vh;
    overflow: auto;
  }
}

@media (orientation: landscape) {
  .camera-frame {
    aspect-ratio: 16 / 9;
  }

  .video-composer.is-camera-fullscreen .camera-frame {
    min-height: min(86vh, 720px);
  }

  .video-composer.is-recording-fullscreen .camera-frame {
    height: 100vh;
    min-height: 100vh;
  }
}

@media (max-width: 390px) {
  .main {
    padding-inline: 10px;
  }

  .feed-control-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .feed-control-actions {
    justify-content: flex-start;
  }

  .tab-button {
    font-size: 13px;
  }

  .publish-tab-button {
    width: 50px;
    height: 50px;
  }

  .rank-card {
    grid-template-columns: 96px 1fr;
  }

  .rank-thumb {
    width: 96px;
  }

  .profile-stat-row {
    gap: 6px;
  }

  .profile-stat {
    padding-inline: 6px;
  }

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

  .auth-security-banner {
    grid-template-columns: 1fr;
  }

  .comment-composer,
  .search-box,
  .message-composer,
  .draft-actions,
  .video-meta-grid,
  .cover-editor-body {
    grid-template-columns: 1fr;
  }

  .record-primary {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 481px) {
  .app-shell {
    min-height: calc(100vh - 32px);
    margin-top: 16px;
    margin-bottom: 16px;
    border-radius: 8px;
  }

  .bottom-nav {
    bottom: 16px;
    border-radius: 0 0 8px 8px;
  }
}
