@font-face {
  font-family: "Hebert Sans";
  src: url("/assets/hebert-sans/HebertSans-Thin.ttf") format("truetype");
  font-style: normal;
  font-weight: 100;
  font-display: swap;
}

@font-face {
  font-family: "Hebert Sans";
  src: url("/assets/hebert-sans/HebertSans-ThinItalic.ttf") format("truetype");
  font-style: italic;
  font-weight: 100;
  font-display: swap;
}

@font-face {
  font-family: "Hebert Sans";
  src: url("/assets/hebert-sans/HebertSans-ExtraLight.ttf") format("truetype");
  font-style: normal;
  font-weight: 200;
  font-display: swap;
}

@font-face {
  font-family: "Hebert Sans";
  src: url("/assets/hebert-sans/HebertSans-ExtraLightItalic.ttf") format("truetype");
  font-style: italic;
  font-weight: 200;
  font-display: swap;
}

@font-face {
  font-family: "Hebert Sans";
  src: url("/assets/hebert-sans/HebertSans-Light.ttf") format("truetype");
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Hebert Sans";
  src: url("/assets/hebert-sans/HebertSans-LightItalic.ttf") format("truetype");
  font-style: italic;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: "Hebert Sans";
  src: url("/assets/hebert-sans/HebertSans-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Hebert Sans";
  src: url("/assets/hebert-sans/HebertSans-Italic.ttf") format("truetype");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Hebert Sans";
  src: url("/assets/hebert-sans/HebertSans-Medium.ttf") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Hebert Sans";
  src: url("/assets/hebert-sans/HebertSans-MediumItalic.ttf") format("truetype");
  font-style: italic;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Hebert Sans";
  src: url("/assets/hebert-sans/HebertSans-SemiBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Hebert Sans";
  src: url("/assets/hebert-sans/HebertSans-SemiBoldItalic.ttf") format("truetype");
  font-style: italic;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Hebert Sans";
  src: url("/assets/hebert-sans/HebertSans-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Hebert Sans";
  src: url("/assets/hebert-sans/HebertSans-BoldItalic.ttf") format("truetype");
  font-style: italic;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Hebert Sans";
  src: url("/assets/hebert-sans/HebertSans-ExtraBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "Hebert Sans";
  src: url("/assets/hebert-sans/HebertSans-ExtraBoldItalic.ttf") format("truetype");
  font-style: italic;
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: "Hebert Sans";
  src: url("/assets/hebert-sans/HebertSans-Black.ttf") format("truetype");
  font-style: normal;
  font-weight: 900;
  font-display: swap;
}

@font-face {
  font-family: "Hebert Sans";
  src: url("/assets/hebert-sans/HebertSans-BlackItalic.ttf") format("truetype");
  font-style: italic;
  font-weight: 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --page: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f2f2f2;
  --surface-strong: #f8f8f8;
  --ink: #0f0f0f;
  --muted: #606060;
  --line: #e5e5e5;
  --accent: #b3265f;
  --accent-strong: #921a4b;
  --accent-soft: #f8e8f0;
  --ok: #087f5b;
  --warn: #996500;
  --bad: #c1121f;
  /* Theme-aware tokens. These resolve to the values below in light mode and are
     overridden in the dark block so hardcoded chrome colors flip cleanly. */
  --border-input: #d3d3d3;
  --border-hover: #bdbdbd;
  --border-focus: #9f9f9f;
  --topbar-bg: rgba(255, 255, 255, 0.96);
  --on-ink: #ffffff;
  --overlay-surface: #282828;
  --badge-ink: #303030;
  --ok-soft: #dff7ec;
  --warn-soft: #fff4d6;
  --bad-soft: #ffe3e7;
  --rail-width: 88px;
  --topbar-height: 64px;
  --font-sans:
    "Hebert Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-family: var(--font-sans);
}

/* Dark theme. The active theme is resolved in JS (light/dark/system) and the
   chosen mode is written to the <html data-theme> attribute, so these overrides
   apply whenever the resolved theme is dark. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0f0f0f;
  --surface: #1f1f1f;
  --surface-soft: #2a2a2a;
  --surface-strong: #272727;
  --ink: #f1f1f1;
  --muted: #aaaaaa;
  --line: #383838;
  --accent: #e25a8c;
  --accent-strong: #ef6f9c;
  --accent-soft: #3a1e2a;
  --ok: #3fcf8e;
  --warn: #e0b252;
  --bad: #ff6b6b;
  --border-input: #4a4a4a;
  --border-hover: #5a5a5a;
  --border-focus: #6e6e6e;
  --topbar-bg: rgba(15, 15, 15, 0.96);
  --on-ink: #0f0f0f;
  --overlay-surface: #383838;
  --badge-ink: #d0d0d0;
  --ok-soft: #103328;
  --warn-soft: #33290f;
  --bad-soft: #3a1d1f;
}

* {
  box-sizing: border-box;
}

html {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  background: var(--page);
}

body {
  width: 100%;
  max-width: 100%;
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  color: var(--ink);
  background: var(--page);
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(260px, 760px) minmax(220px, 1fr);
  align-items: center;
  gap: 24px;
  height: var(--topbar-height);
  padding: 0 24px;
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
}

.brand-cluster,
.top-actions,
.brand-link,
.create-chip,
.sign-in-button,
.rail-link,
.pane-head,
.feed-meta,
.account-hero,
.account-identity {
  display: flex;
  align-items: center;
}

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

.round-action,
.icon-button {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.material-icons.app-icon,
.rail-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  color: currentColor;
  font-size: 24px;
  font-style: normal;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  direction: ltr;
  font-feature-settings: "liga";
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}

.round-action:hover,
.icon-button:hover,
.rail-link:hover,
.create-chip:hover,
.sign-in-button:hover,
.secondary-button:hover {
  background: var(--surface-soft);
}

.brand-link {
  gap: 8px;
  min-width: 0;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-link img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}

.rechat-mark {
  transition: filter 120ms ease;
}

:root[data-theme="dark"] .rechat-mark {
  filter: invert(1) hue-rotate(180deg);
}

.topbar-tagline {
  justify-self: center;
  max-width: min(100%, 760px);
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  text-wrap: balance;
}

.top-actions {
  position: relative;
  justify-content: end;
  gap: 12px;
  min-width: 0;
}

.create-chip {
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--surface-soft);
  font-weight: 800;
}

.create-chip span {
  font-size: 1.5rem;
}

.round-action {
  position: relative;
  width: 42px;
  height: 42px;
}

.sign-in-button {
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--border-input);
  border-radius: 999px;
  font-weight: 800;
  white-space: nowrap;
}

.nav-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.notification-popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 10px);
  right: 0;
  display: grid;
  gap: 12px;
  width: min(380px, calc(100vw - 32px));
  max-height: calc(100vh - var(--topbar-height) - 24px);
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(15, 15, 15, 0.22);
}

.notification-popover-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.notification-popover-header h2,
.notification-popover-header p,
.notification-preview-empty {
  margin: 0;
}

.notification-popover-header h2 {
  font-size: 1rem;
  line-height: 1.2;
}

.notification-popover-header p {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
  white-space: nowrap;
}

.notification-preview-list {
  gap: 6px;
}

.notification-item--compact {
  gap: 10px;
  padding: 11px 12px;
  border-radius: 8px;
}

.notification-item--compact .notification-title {
  font-size: 0.9rem;
}

.notification-item--compact .notification-detail {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 0.84rem;
}

.notification-item--compact .notification-meta {
  font-size: 0.78rem;
}

.notification-preview-status,
.notification-preview-empty {
  padding: 14px 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

.notification-view-all {
  justify-content: center;
  min-height: 40px;
  width: 100%;
}

.avatar-button,
.large-avatar {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #ffffff;
  background: var(--accent);
  font-weight: 900;
  cursor: pointer;
  background-position: center;
  background-size: cover;
}

.avatar-button {
  width: 42px;
  height: 42px;
  font-size: 1rem;
}

.user-menu-anchor {
  position: relative;
  display: grid;
  place-items: center;
}

.user-menu {
  position: absolute;
  z-index: 100;
  top: calc(100% + 10px);
  right: 0;
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100vh - var(--topbar-height) - 20px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 12px 38px rgba(15, 15, 15, 0.18);
}

.user-menu-profile {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 16px;
  padding: 22px 22px 20px;
}

.user-menu-avatar {
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--accent);
  background-position: center;
  background-size: cover;
  font-size: 1.35rem;
  font-weight: 900;
}

.user-menu-profile-copy {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
}

.user-menu-profile-copy strong,
.user-menu-profile-copy > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-profile-copy strong {
  font-size: 1.08rem;
}

.user-menu-profile-copy > span {
  color: var(--muted);
  font-size: 0.94rem;
}

.user-menu-channel {
  justify-self: start;
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  font-weight: 750;
}

.user-menu-channel:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.user-menu-section {
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.user-menu-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 52px;
  padding: 8px 20px;
  border: 0;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.user-menu-item:hover,
.user-menu-item:focus-visible {
  background: var(--surface-soft);
  outline: none;
}

.user-menu-icon {
  justify-self: center;
  font-size: 25px;
}

.user-menu-item-copy {
  display: grid;
  gap: 1px;
}

.user-menu-item-copy small {
  color: var(--muted);
  font-size: 0.78rem;
}

.user-menu-chevron {
  color: var(--muted);
  font-size: 22px;
}

.side-rail {
  position: fixed;
  z-index: 15;
  top: var(--topbar-height);
  bottom: 0;
  left: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  width: var(--rail-width);
  padding: 12px 8px;
  background: var(--surface);
}

.rail-link {
  position: relative;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  height: 76px;
  border-radius: 10px;
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 700;
}

.rail-link.is-active {
  background: var(--surface-soft);
}

.rail-icon {
  width: 28px;
  height: 28px;
  font-size: 28px;
}

.app-main {
  min-height: 100vh;
  padding: calc(var(--topbar-height) + 18px) 28px 44px calc(var(--rail-width) + 24px);
}

[hidden] {
  display: none !important;
}

.home-browse {
  display: grid;
  gap: 24px;
}

.feed-controls {
  position: sticky;
  top: var(--topbar-height);
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 0 0 8px;
  background: var(--page);
}

.feed-control {
  position: relative;
}

.feed-control-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface-soft);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.feed-control-button:hover,
.feed-control.is-open > .feed-control-button {
  border-color: var(--ink);
  color: var(--on-ink);
  background: var(--ink);
}

.feed-control-button .app-icon {
  font-size: 20px;
}

.feed-control-current {
  color: var(--muted);
  font-weight: 800;
}

.feed-control-button:hover .feed-control-current,
.feed-control.is-open > .feed-control-button .feed-control-current {
  color: inherit;
}

.feed-control-count {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  color: var(--on-ink);
  background: var(--ink);
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1;
}

.feed-control-button:hover .feed-control-count,
.feed-control.is-open > .feed-control-button .feed-control-count {
  color: inherit;
  background: rgba(255, 255, 255, 0.18);
}

.feed-control-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  display: grid;
  gap: 4px;
  min-width: 210px;
  padding: 8px;
  border-radius: 10px;
  color: #ffffff;
  background: var(--overlay-surface);
  box-shadow: 0 16px 44px rgba(15, 15, 15, 0.32);
}

.feed-filter-menu {
  min-width: 238px;
}

.feed-control-option,
.feed-filter-option,
.feed-filter-clear {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 750;
  text-align: left;
}

.feed-control-option:hover,
.feed-filter-option:hover,
.feed-filter-clear:hover {
  background: rgba(255, 255, 255, 0.1);
}

.feed-filter-option {
  position: relative;
}

.feed-filter-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.feed-control-option .app-icon,
.feed-filter-option .app-icon {
  width: 20px;
  color: #ffffff;
  font-size: 20px;
  opacity: 0;
}

.feed-control-option.is-active .app-icon,
.feed-filter-option.is-active .app-icon,
.feed-filter-option input:checked + .app-icon {
  opacity: 1;
}

.feed-filter-clear {
  justify-content: center;
  margin-top: 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.84);
}

.feed-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 34px 24px;
}

.feed-card {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.feed-link {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.feed-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: #0f0f0f;
}

.feed-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #0f0f0f;
}

.feed-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: #ffffff;
  background:
    radial-gradient(circle at 28% 24%, rgba(179, 38, 95, 0.48), transparent 34%),
    linear-gradient(135deg, #151515, #323232);
}

.feed-placeholder img {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  object-fit: cover;
  opacity: 0.86;
}

.thumb-status {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 4px 7px;
  border-radius: 6px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.82);
  font-size: 0.74rem;
  font-weight: 900;
}

.feed-meta {
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.channel-avatar {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-soft);
}

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

.feed-copy-link {
  color: inherit;
  text-decoration: none;
}

.feed-copy-link:hover .feed-title {
  text-decoration: underline;
}

.feed-title,
.job-name {
  overflow-wrap: anywhere;
  font-weight: 850;
}

.feed-title {
  display: -webkit-box;
  margin: 0 0 5px;
  overflow: hidden;
  font-size: 1rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.feed-subtitle,
.feed-detail,
.status-text,
.job-meta,
.empty-preview,
.panel-copy,
.account-empty-state p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.feed-subtitle,
.feed-detail {
  margin: 0;
}

.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
}

.feed-empty,
.empty-preview {
  display: grid;
  min-height: 320px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface);
}

.feed-empty {
  padding: clamp(24px, 7vw, 48px);
  text-align: center;
}

.create-shell,
.friends-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  align-items: start;
  gap: 18px;
  max-width: 1120px;
  min-height: calc(100vh - var(--topbar-height) - 62px);
}

.create-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}

.create-tab {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 850;
}

.create-tab:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

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

.create-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.create-tab-panel {
  min-width: 0;
  align-self: start;
}

.create-tab-panel[hidden] {
  display: none;
}

.create-layout,
.history-layout {
  display: grid;
  align-items: start;
  gap: 24px;
}

.create-layout {
  grid-template-columns: minmax(280px, 512px);
}

.history-layout {
  grid-template-columns: minmax(280px, 1fr);
}

.create-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.create-panel {
  padding: 22px;
}

.upload-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: var(--surface-strong);
}

.queue-panel {
  display: flex;
  flex-direction: column;
  min-height: 320px;
}

.panel-heading {
  display: grid;
  gap: 10px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: 0;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.2rem;
}

.panel-copy {
  margin: 0;
}

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

.link-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.link-field input,
.link-field textarea {
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  font: inherit;
  font-weight: 500;
}

.link-field input {
  height: 44px;
}

.link-field textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.45;
}

.expected-duration {
  display: flex;
  min-height: 44px;
  align-items: center;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-soft);
  font-size: 1rem;
  font-weight: 700;
}

.visibility-switch-field {
  min-width: 0;
}

.visibility-switch {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 850;
}

.visibility-switch:hover {
  border-color: var(--border-hover);
  background: var(--surface-strong);
}

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

.visibility-switch-track {
  position: relative;
  display: inline-flex;
  width: 48px;
  height: 28px;
  flex: 0 0 auto;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  transition:
    border-color 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease;
}

.visibility-switch-thumb {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 1px 3px rgba(15, 15, 15, 0.2);
  transform: translateX(0);
  transition: transform 140ms ease;
}

.visibility-switch-input:focus-visible + .visibility-switch-track {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.visibility-switch-input:checked + .visibility-switch-track {
  border-color: var(--accent);
  background: var(--accent-soft);
}

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

.visibility-switch-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  white-space: nowrap;
}

.visibility-switch-icon {
  color: var(--muted);
  font-size: 17px;
}

.link-field span small {
  font-weight: 600;
}

.link-field input:focus,
.link-field textarea:focus {
  border-color: var(--border-focus);
}

.link-field input.is-invalid {
  border-color: var(--bad);
}

.link-field-error {
  margin: -4px 0 0;
  color: var(--bad);
  font-size: 0.82rem;
  font-weight: 700;
}

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

.share-branding-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.share-branding-label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.share-branding-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.share-branding-summary {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.share-branding-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--surface-soft);
  object-fit: contain;
}

.share-branding-copy {
  display: grid;
  min-width: 0;
}

.share-branding-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 0.92rem;
}

.share-branding-customize {
  display: inline-flex;
  min-height: 34px;
  width: fit-content;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  font-weight: 850;
}

.share-branding-customize:hover {
  background: var(--surface-soft);
}

.share-branding-customize .app-icon {
  color: var(--accent);
  font-size: 16px;
}

.share-branding-custom-fields {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.share-branding-custom-fields[hidden] {
  display: none;
}

.more-options-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.more-options-label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.customization-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.customization-panel > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 9px 12px;
  border-radius: 7px;
  cursor: pointer;
  list-style: none;
}

.customization-panel summary::-webkit-details-marker {
  display: none;
}

.customization-panel > summary:hover {
  background: var(--surface-soft);
}

.customization-panel > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.customization-summary-icon {
  color: var(--accent);
}

.customization-summary-value {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.customization-panel[open] > summary {
  background: var(--surface-soft);
}

.customization-content {
  position: absolute;
  z-index: 12;
  top: 0;
  left: calc(100% + 24px);
  display: grid;
  gap: 22px;
  width: min(512px, calc(100vw - var(--rail-width) - 588px));
  max-height: calc(100vh - var(--topbar-height) - 36px);
  padding: 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 18px 42px rgba(15, 15, 15, 0.12);
}

.customization-panel:not([open]) .customization-content {
  display: none;
}

.customization-mobile-header {
  display: none;
}

.customization-menu-list {
  display: grid;
  gap: 14px;
}

.customization-section {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.customization-section-head,
.customization-section-body {
  display: grid;
  gap: 4px;
}

.customization-section-head h3,
.customization-section-head p {
  margin: 0;
}

.customization-section-head h3 {
  font-size: 0.95rem;
}

.customization-section-head p {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.customization-section-body {
  gap: 13px;
}

.visibility-selector {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.visibility-selector legend {
  margin-bottom: 8px;
  padding: 0;
  font-size: 0.82rem;
  font-weight: 800;
}

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

.visibility-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

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

.visibility-option-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 66px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  transition:
    border-color 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease;
}

.visibility-option:hover .visibility-option-card {
  border-color: var(--border-hover);
  background: var(--surface-strong);
}

.visibility-option input:focus-visible + .visibility-option-card {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.visibility-option input:checked + .visibility-option-card {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.visibility-option-icon {
  color: var(--accent);
}

.visibility-option-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.visibility-option-copy strong {
  font-size: 0.84rem;
}

.visibility-option-copy small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
}

.category-selector {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.category-selector legend {
  margin-bottom: 8px;
  padding: 0;
  font-size: 0.82rem;
  font-weight: 800;
}

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

.category-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

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

.category-option-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 74px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  transition:
    border-color 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease;
}

.category-option:hover .category-option-card {
  border-color: var(--border-hover);
  background: var(--surface-strong);
}

.category-option input:focus-visible + .category-option-card {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.category-option input:checked + .category-option-card {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.category-option-icon {
  color: var(--accent);
}

.category-option-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.category-option-copy strong {
  font-size: 0.84rem;
}

.category-option-copy small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
}

.typing-speed-selector {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.typing-speed-selector legend {
  margin-bottom: 8px;
  padding: 0;
  font-size: 0.82rem;
  font-weight: 800;
}

.typing-speed-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.typing-speed-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.typing-speed-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.typing-speed-option-card {
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  transition:
    border-color 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease;
}

.typing-speed-option:hover .typing-speed-option-card {
  border-color: var(--border-hover);
  background: var(--surface-strong);
}

.typing-speed-option input:focus-visible + .typing-speed-option-card {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.typing-speed-option input:checked + .typing-speed-option-card {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.typing-speed-option-card strong {
  font-size: 0.84rem;
}

.typing-speed-option-card small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
}

.typing-acceleration {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  cursor: pointer;
}

.typing-acceleration input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.typing-acceleration-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.typing-acceleration-copy strong {
  font-size: 0.84rem;
}

.typing-acceleration-copy small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
}

.customization-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.customization-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.customization-field input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
}

.customization-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.customization-field input[aria-invalid="true"] {
  border-color: var(--bad);
  box-shadow: 0 0 0 2px rgba(193, 18, 31, 0.1);
}

.customization-field small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.customization-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--bad);
  background: var(--bad-soft);
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.4;
}

.branding-group {
  display: grid;
  gap: 12px;
}

.branding-none {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.branding-group.is-no-branding .typing-acceleration:not(.branding-none) {
  opacity: 0.55;
}

.branding-upgrade {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid var(--accent-soft);
  border-radius: 9px;
  background: var(--accent-soft);
}

.branding-upgrade .app-icon {
  color: var(--accent);
}

.branding-upgrade strong {
  display: block;
  font-size: 0.84rem;
}

.branding-upgrade small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
}

.branding-group.is-locked .customization-fields,
.branding-group.is-locked .typing-acceleration {
  opacity: 0.55;
}

.branding-group.is-locked .typing-acceleration {
  cursor: not-allowed;
}

.style-group {
  gap: 12px;
}

.style-font-selector,
.style-theme-selector {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.style-font-selector legend,
.style-theme-selector legend {
  padding: 0;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.style-font-options,
.style-theme-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.style-font-option,
.style-theme-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.style-font-option input,
.style-theme-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.style-font-option-card,
.style-theme-option-card {
  position: relative;
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  transition:
    border-color 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease;
}

.style-font-option:hover .style-font-option-card,
.style-theme-option:hover .style-theme-option-card {
  border-color: var(--border-hover);
  background: var(--surface-strong);
}

.style-font-option input:focus-visible + .style-font-option-card,
.style-theme-option input:focus-visible + .style-theme-option-card {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.style-font-option input:checked + .style-font-option-card,
.style-theme-option input:checked + .style-theme-option-card {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.style-font-option-card strong,
.style-theme-option-card strong {
  font-size: 0.84rem;
}

.style-font-option-card small,
.style-theme-option-card small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
}

.style-theme-lock {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 16px;
  color: var(--muted);
  opacity: 0;
}

.style-theme-option.is-locked {
  cursor: not-allowed;
}

.style-theme-option.is-locked .style-theme-option-card {
  opacity: 0.55;
}

.style-theme-option.is-locked .style-theme-lock {
  opacity: 1;
}

.style-upgrade {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid var(--accent-soft);
  border-radius: 9px;
  background: var(--accent-soft);
}

.style-upgrade .app-icon {
  color: var(--accent);
}

.style-upgrade strong {
  display: block;
  font-size: 0.84rem;
}

.style-upgrade small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
}

/* Live preview of the selected chat style. The background and bubble colors
   mirror the renderer palettes, and the font family/size mirror the chosen
   typeface and text-size presets. */
.style-preview {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b1020;
  transition:
    background 150ms ease,
    border-color 150ms ease;
}

.style-preview-bubble {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  box-shadow: 0 1px 2px rgba(5, 8, 22, 0.35);
}

.style-preview-bubble--left {
  justify-self: start;
  border-bottom-left-radius: 5px;
  background: #f8fafc;
  color: #111827;
}

.style-preview-bubble--right {
  justify-self: end;
  border-bottom-right-radius: 5px;
  background: #2563eb;
  color: #ffffff;
}

/* Theme palettes. Classic is the base; midnight and daylight override it. */
.style-preview[data-theme="midnight"] {
  background: #0a0a1f;
}

.style-preview[data-theme="midnight"] .style-preview-bubble--left {
  background: #1e1e3f;
  color: #e9e9ff;
}

.style-preview[data-theme="midnight"] .style-preview-bubble--right {
  background: #6d5dfc;
  color: #ffffff;
}

.style-preview[data-theme="daylight"] {
  background: #f1f5f9;
}

.style-preview[data-theme="daylight"] .style-preview-bubble--left {
  background: #ffffff;
  color: #0f172a;
}

.style-preview[data-theme="daylight"] .style-preview-bubble--right {
  background: #2563eb;
  color: #ffffff;
}

/* Typeface families. */
.style-preview[data-font="sans"] .style-preview-bubble {
  font-family: var(--font-sans);
}

.style-preview[data-font="serif"] .style-preview-bubble {
  font-family: Georgia, "Times New Roman", "DejaVu Serif", serif;
}

.style-preview[data-font="mono"] .style-preview-bubble {
  font-family: "SFMono-Regular", "DejaVu Sans Mono", "Courier New", monospace;
}

/* Text-size presets. */
.style-preview[data-size="small"] .style-preview-bubble {
  font-size: 0.82rem;
}

.style-preview[data-size="medium"] .style-preview-bubble {
  font-size: 0.95rem;
}

.style-preview[data-size="large"] .style-preview-bubble {
  font-size: 1.12rem;
}

.audio-group {
  gap: 12px;
}

.audio-selector {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.audio-selector legend {
  padding: 0;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

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

.audio-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

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

.audio-option-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 72px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  transition:
    border-color 120ms ease,
    background 120ms ease,
    box-shadow 120ms ease;
}

.audio-option:hover .audio-option-card {
  border-color: var(--border-hover);
  background: var(--surface-strong);
}

.audio-option input:focus-visible + .audio-option-card {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.audio-option input:checked + .audio-option-card {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.audio-option-icon {
  color: var(--accent);
}

.audio-option-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.audio-option-copy strong {
  font-size: 0.84rem;
}

.audio-option-copy small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
}

.audio-option-lock {
  position: absolute;
  top: 8px;
  right: 8px;
  color: var(--muted);
  font-size: 16px;
  opacity: 0;
}

.audio-option.is-locked {
  cursor: not-allowed;
}

.audio-option.is-locked .audio-option-card {
  opacity: 0.55;
}

.audio-option.is-locked .audio-option-lock {
  opacity: 1;
}

.audio-upgrade {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid var(--accent-soft);
  border-radius: 9px;
  background: var(--accent-soft);
}

.audio-upgrade .app-icon {
  color: var(--accent);
}

.audio-upgrade strong {
  display: block;
  font-size: 0.84rem;
}

.audio-upgrade small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
}

.audio-library-field,
.audio-upload-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
}

.audio-library-field select,
.audio-upload-field input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
}

.audio-library-field select:focus,
.audio-upload-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.audio-library-field select[aria-invalid="true"],
.audio-upload-field input[aria-invalid="true"] {
  border-color: var(--bad);
  box-shadow: 0 0 0 2px rgba(193, 18, 31, 0.1);
}

.audio-library-field small,
.audio-upload-field small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.audio-library-field [data-audio-library-attribution]::before {
  content: " ";
}

.audio-library-field a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.audio-library-field a:hover {
  color: var(--accent);
}

.primary-button,
.secondary-button,
.download-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 850;
  text-decoration: none;
}

.primary-button {
  padding: 0 18px;
  color: #ffffff;
  background: var(--accent);
}

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

.primary-button:disabled {
  cursor: wait;
  background: #a9a9a9;
}

#generate-button:disabled {
  cursor: not-allowed;
}

.secondary-button,
.download-link {
  padding: 0 16px;
  color: var(--ink);
  background: var(--surface-soft);
}

.pane-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.icon-button {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
}

.jobs-list {
  display: grid;
  min-height: 0;
  overflow: visible;
}

.history-table {
  position: relative;
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: visible;
}

.history-row {
  display: grid;
  grid-template-areas: "thumbnail title duration status actions";
  grid-template-columns: 192px minmax(320px, 1.35fr) minmax(156px, 0.38fr) minmax(220px, 0.7fr) 104px;
  align-items: center;
  min-height: 112px;
  border-top: 1px solid var(--line);
}

.history-row:first-child {
  border-top: 0;
  border-radius: 8px 8px 0 0;
}

.history-row:last-child {
  border-radius: 0 0 8px 8px;
}

.history-row:not(.history-head):hover {
  background: var(--surface-strong);
}

.history-head {
  grid-template-areas: "thumbnail title duration status actions";
  min-height: 40px;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.history-head .date-cell {
  display: none;
}

.history-cell {
  min-width: 0;
  padding: 8px 12px;
}

.thumbnail-cell {
  grid-area: thumbnail;
  display: flex;
  align-items: center;
  align-self: stretch;
}

.history-thumb {
  position: relative;
  width: 168px;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-soft);
}

.history-thumb-image,
.history-thumb-placeholder {
  width: 100%;
  height: 100%;
}

.history-thumb-image {
  display: block;
  object-fit: cover;
}

.history-thumb-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.history-thumb-placeholder .app-icon {
  font-size: 26px;
}

.history-title {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.title-cell {
  grid-area: title;
  display: grid;
  align-content: center;
  gap: 12px;
}

.duration-cell {
  grid-area: duration;
  display: grid;
  align-content: center;
  gap: 4px;
}

.status-cell {
  grid-area: status;
}

.history-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.history-timestamp {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.2;
}

.history-age {
  white-space: nowrap;
}

.history-visibility-tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
}

.history-visibility-tag--public {
  color: var(--ok);
  background: var(--ok-soft);
}

.history-visibility-tag--private {
  color: var(--muted);
  background: var(--surface-soft);
}

.history-row:not(.history-head) .duration-cell {
  color: var(--muted);
  font-weight: 750;
}

.history-row:not(.history-head) .duration-cell {
  font-size: 0.95rem;
  white-space: nowrap;
}

.history-duration-value,
.history-word-count {
  display: block;
}

.history-duration-value {
  color: var(--ink);
  font-weight: 850;
}

.history-word-count {
  color: var(--muted);
  font-size: 0.86rem;
}

.history-row:not(.history-head) .status-cell {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.history-empty-value {
  color: var(--muted);
}

.status-cell {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.actions-cell {
  grid-area: actions;
  display: flex;
  align-self: stretch;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.history-action {
  width: 34px;
  height: 34px;
}

.history-action .app-icon {
  font-size: 20px;
}

.danger-action {
  color: var(--bad);
}

.history-row.is-clickable {
  cursor: pointer;
}

.history-row.is-clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.history-card-menu .feed-menu-button {
  width: 34px;
  height: 34px;
}

.history-card-menu .feed-menu-button .app-icon {
  font-size: 22px;
}

.history-card-menu.is-open {
  z-index: 60;
}

.feed-menu-item.danger-action,
.feed-menu-item.danger-action .app-icon {
  color: #ff6b6b;
}

.history-progress {
  width: min(100%, 132px);
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.history-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.history-progress-label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.history-player-row {
  display: grid;
}

.history-player-row.is-open {
  border-top: 1px solid var(--line);
  background: var(--surface-strong);
}

.history-player-cell {
  padding: 12px;
}

.history-video {
  display: block;
  width: min(100%, 760px);
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 8px;
  background: #0f0f0f;
}

.badge {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--badge-ink);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.badge.completed {
  color: var(--ok);
  background: var(--ok-soft);
}

.badge.processing,
.badge.rendering,
.badge.queued {
  color: var(--warn);
  background: var(--warn-soft);
}

.badge.failed {
  color: var(--bad);
  background: var(--bad-soft);
}

.signin-screen {
  display: grid;
  min-height: calc(100vh - var(--topbar-height) - 62px);
  place-items: center;
  padding: 32px 16px;
}

.signin-panel {
  display: grid;
  width: min(100%, 420px);
  gap: 20px;
}

.signin-header {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}

.signin-header img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
}

.signin-options {
  display: grid;
  gap: 20px;
}

.signin-provider-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  font-weight: 850;
}

.signin-provider-button:hover {
  background: var(--surface-soft);
}

.signin-provider-button:disabled {
  cursor: wait;
  color: var(--muted);
  background: var(--surface-soft);
}

.google-mark {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.signin-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.signin-divider span {
  height: 1px;
  background: var(--line);
}

.signin-screen.is-otp-step .signin-panel {
  width: min(100%, 420px);
  gap: 18px;
}

.signin-screen.is-otp-step .signin-header,
.signin-screen.is-otp-step .signin-options {
  display: none;
}

.auth-step {
  display: grid;
  gap: 12px;
}

.signin-screen.is-otp-step .auth-step {
  gap: 18px;
}

.otp-heading {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-bottom: 6px;
  text-align: center;
}

.otp-heading h1 {
  color: var(--ink);
  font-size: 2rem;
  font-weight: 850;
  line-height: 1.12;
}

.otp-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.otp-copy strong {
  color: inherit;
}

.signin-screen.is-otp-step .otp-copy {
  max-width: 460px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
}

.signin-screen.is-otp-step .otp-copy strong {
  display: block;
  color: var(--ink);
  font-weight: 800;
}

.otp-continue-button {
  min-height: 48px;
  font-size: 1rem;
}

.resend-email-button {
  justify-self: center;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 850;
}

.auth-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.25;
}

.auth-footer-links a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button {
  width: fit-content;
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  font-weight: 850;
}

.text-button:disabled {
  cursor: wait;
  color: var(--muted);
}

.account-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: start;
  gap: 22px;
  max-width: 1120px;
  min-height: calc(100vh - var(--topbar-height) - 62px);
}

.account-hero {
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0 6px;
}

.account-identity {
  gap: 18px;
  min-width: 0;
}

.account-identity > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.large-avatar {
  flex: 0 0 auto;
  width: 84px;
  height: 84px;
  font-size: 2rem;
}

.account-email,
.account-handle {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 750;
}

.account-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: var(--border-hover) transparent;
}

.account-tabs::-webkit-scrollbar {
  height: 6px;
}

.account-tabs::-webkit-scrollbar-track {
  background: transparent;
}

.account-tabs::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--border-hover);
}

.account-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 850;
}

.account-tab:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

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

.account-tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.tab-badge {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent);
  font-size: 0.7rem;
  font-weight: 850;
  line-height: 1;
}

.account-tab-panel {
  min-width: 0;
}

.friends-tab-panel[data-friends-tab-panel="messages"] {
  padding-top: 0;
}

.account-empty-state {
  display: grid;
  min-height: 360px;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 36px 24px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface-strong);
  text-align: center;
}

.account-empty-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 30px;
}

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

.account-empty-state h2 {
  color: var(--ink);
}

.account-empty-state p {
  max-width: 440px;
  line-height: 1.5;
}

.notification-feed {
  display: grid;
  gap: 14px;
  padding-top: 18px;
}

.downloads-panel {
  display: grid;
  gap: 14px;
  padding-top: 18px;
}

.friends-panel {
  display: grid;
  gap: 14px;
  padding-top: 0;
}

.friends-status,
.downloads-status {
  margin: 0;
  padding: 14px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.friends-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.friends-table {
  --friends-table-columns: minmax(0, 1fr) 64px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: var(--surface);
}

.friends-table-header,
.friend-row {
  display: grid;
  grid-template-columns: var(--friends-table-columns);
  column-gap: 12px;
  align-items: center;
}

.friends-table-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.friends-table-header span:last-child {
  text-align: center;
}

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

.friend-item {
  margin: 0;
  border-bottom: 1px solid var(--line);
}

.friend-item:last-child {
  border-bottom: 0;
}

.friend-row {
  padding: 8px 14px;
  cursor: pointer;
}

.download-item {
  margin: 0;
}

.friend-link {
  display: grid;
  grid-column: 1;
  align-items: center;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.friend-row:hover {
  background: var(--surface-strong);
}

.friend-row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.friend-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.friend-message-cell {
  position: relative;
  display: grid;
  grid-column: 2;
  width: 40px;
  height: 40px;
  justify-self: center;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted);
}

.friend-message-cell.is-unread {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.friend-message-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: 0.68rem;
  font-weight: 850;
}

.download-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.download-record:hover {
  background: var(--surface-strong);
}

.download-record--job {
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
}

.download-record-main {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.download-record-title,
.download-record-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-record-title {
  color: var(--ink);
  font-weight: 850;
}

.download-record-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.download-orientation-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: start;
  padding: 1px 8px 1px 6px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.01em;
  color: var(--muted);
  background: var(--surface-soft);
}

.download-orientation-badge .app-icon {
  font-size: 15px;
}

.download-orientation-badge--vertical {
  color: color-mix(in srgb, var(--accent) 75%, var(--ink));
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-soft));
}

.download-record-action {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: var(--surface-soft);
}

.download-record-action:hover {
  background: var(--line);
}

.download-progress {
  display: block;
  width: min(280px, 100%);
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-soft);
}

.download-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.friend-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-soft);
}

.friend-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.friend-body {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.friend-name,
.friend-handle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-name {
  color: var(--ink);
  font-weight: 850;
}

.friend-handle {
  color: var(--muted);
  font-size: 0.9rem;
}

.notification-feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notification-feed-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 750;
}

.notification-mark-all:disabled {
  cursor: default;
  opacity: 0.5;
}

.notification-feed-status {
  margin: 0;
  padding: 14px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.notification-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.notification-item.is-unread {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  cursor: pointer;
}

.notification-indicator {
  width: 9px;
  height: 9px;
  margin-top: 7px;
  border-radius: 50%;
  background: transparent;
}

.notification-item.is-unread .notification-indicator {
  background: var(--accent);
}

.notification-body {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.notification-title {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
  overflow-wrap: anywhere;
}

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

.notification-actor-link:hover {
  text-decoration: underline;
}

.notification-detail {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.notification-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.85rem;
}

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

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

/* ---- Direct messaging ---------------------------------------------------- */

.friends-overview,
.messaging-thread-pane {
  display: grid;
  gap: 12px;
}

.message-thread {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.messaging-thread-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.messaging-thread-header {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.messaging-back-button {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.messaging-back-button:hover {
  background: var(--surface-strong);
}

.messaging-thread-identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.messaging-thread-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-strong);
}

.messaging-thread-name {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-thread {
  max-height: 52vh;
  overflow-y: auto;
  padding: 4px 0;
}

.message-bubble-row {
  display: flex;
  justify-content: flex-start;
}

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

.message-rechat-card {
  display: grid;
  grid-template-columns: minmax(120px, 42%) minmax(0, 1fr);
  width: min(520px, 88%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
}

.message-bubble-row.is-mine .message-rechat-card {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.message-rechat-media {
  display: grid;
  min-height: 112px;
  place-items: center;
  overflow: hidden;
  background: var(--surface-strong);
}

.message-rechat-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-rechat-icon {
  color: var(--muted);
  font-size: 26px;
}

.message-rechat-copy {
  display: grid;
  align-content: center;
  min-width: 0;
  gap: 5px;
  padding: 12px 14px;
}

.message-rechat-title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink);
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.message-rechat-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-bubble-time {
  color: var(--muted);
  font-size: 0.72rem;
}

.message-rechat-card.is-unavailable {
  cursor: default;
  opacity: 0.72;
}

@media (max-width: 600px) {
  .message-rechat-card {
    grid-template-columns: minmax(0, 1fr);
    width: min(100%, 420px);
  }

  .message-rechat-media {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .message-rechat-copy {
    align-content: start;
    padding: 12px 14px 14px;
  }

  .message-rechat-meta {
    white-space: normal;
  }
}

.message-composer {
  display: flex;
  justify-content: flex-end;
  padding-top: 4px;
}

.message-composer-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.message-rechat-picker {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(15, 15, 15, 0.28);
}

.message-rechat-picker::backdrop {
  background: rgba(15, 15, 15, 0.68);
  backdrop-filter: blur(3px);
}

.message-rechat-picker-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  max-height: calc(100vh - 32px);
}

.message-rechat-picker-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 24px 16px;
}

.message-rechat-picker-heading > div {
  display: grid;
  gap: 4px;
}

.message-rechat-picker-heading h1 {
  margin: 0;
  font-size: clamp(1.45rem, 4vw, 1.9rem);
  line-height: 1.15;
}

.message-rechat-picker-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
}

.message-rechat-picker-tabs {
  display: flex;
  gap: 4px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
}

.message-rechat-picker-tab {
  position: relative;
  padding: 11px 14px 13px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.message-rechat-picker-tab::after {
  position: absolute;
  right: 10px;
  bottom: -1px;
  left: 10px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: transparent;
  content: "";
}

.message-rechat-picker-tab.is-active {
  color: var(--ink);
}

.message-rechat-picker-tab.is-active::after {
  background: var(--accent);
}

.message-rechat-picker-body {
  min-height: 220px;
  overflow-y: auto;
  padding: 12px;
}

.message-rechat-picker-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.message-rechat-picker-item {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) auto;
  width: 100%;
  align-items: center;
  gap: 14px;
  padding: 8px;
  border: 0;
  border-radius: 12px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.message-rechat-picker-item:hover,
.message-rechat-picker-item:focus-visible {
  background: var(--surface-strong);
}

.message-rechat-picker-media {
  display: grid;
  aspect-ratio: 16 / 9;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background: var(--surface-strong);
}

.message-rechat-picker-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-rechat-picker-icon {
  color: var(--muted);
  font-size: 26px;
}

.message-rechat-picker-copy {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.message-rechat-picker-title {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.message-rechat-picker-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-rechat-picker-arrow {
  padding-right: 6px;
  color: var(--accent);
  font-size: 20px;
}

.message-rechat-picker-status {
  margin: 0;
  padding: 44px 20px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 560px) {
  .message-rechat-picker {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    border-radius: 16px;
  }

  .message-rechat-picker-shell {
    max-height: calc(100vh - 20px);
  }

  .message-rechat-picker-heading {
    padding: 20px 18px 12px;
  }

  .message-rechat-picker-tabs {
    padding: 0 10px;
  }

  .message-rechat-picker-tab {
    flex: 1;
    padding-inline: 8px;
  }

  .message-rechat-picker-body {
    padding: 8px;
  }

  .message-rechat-picker-item {
    grid-template-columns: 104px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 7px;
  }

  .message-rechat-picker-meta {
    white-space: normal;
  }
}

.profile-settings-form,
.settings-panel {
  display: grid;
  gap: 28px;
  padding-top: 18px;
}

.profile-section,
.settings-section {
  display: grid;
  gap: 16px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.profile-section-heading {
  display: grid;
  gap: 8px;
}

.profile-section-heading h2,
.profile-section-heading p,
.settings-section h2,
.settings-section p,
.profile-url-preview,
.profile-settings-status {
  margin: 0;
}

.profile-section-heading h2,
.settings-section h2 {
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1.2;
}

.profile-section-heading p,
.settings-section p,
.profile-picture-copy,
.profile-url-preview {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.appearance-options {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, 420px);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.preferred-style-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 210px));
  gap: 16px;
  align-items: end;
}

.preferred-style-form .profile-field select {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
}

.preferred-style-form .profile-field select:focus {
  border-color: var(--accent);
  outline: 3px solid var(--accent-soft);
}

.preferred-style-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.preferred-style-actions .status-text {
  margin: 0;
}

.preferred-style-actions .primary-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.appearance-option {
  display: inline-flex;
  min-width: 0;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 850;
}

.appearance-option .app-icon {
  flex: 0 0 auto;
  font-size: 20px;
}

.appearance-option:hover {
  color: var(--ink);
  background: var(--surface);
}

.appearance-option.is-active {
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(15, 15, 15, 0.14);
}

.appearance-option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.profile-picture-editor {
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(0, 1fr);
  gap: 36px;
  align-items: center;
}

.profile-picture-preview {
  display: grid;
  min-height: 210px;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-strong);
}

.profile-picture-preview img,
.profile-picture-fallback {
  width: 156px;
  height: 156px;
  border-radius: 50%;
}

.profile-picture-preview img {
  object-fit: cover;
}

.profile-picture-fallback {
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--accent);
  font-size: 3rem;
  font-weight: 900;
}

.profile-picture-copy {
  display: grid;
  gap: 18px;
}

.profile-picture-copy p {
  margin: 0;
  max-width: 520px;
}

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

.profile-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.profile-field input,
.profile-handle-field {
  width: 100%;
  min-width: 0;
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  font-size: 1rem;
  font-weight: 650;
}

.profile-field > input {
  padding: 0 16px;
}

.profile-handle-field {
  display: flex;
  align-items: center;
  padding-left: 16px;
  color: var(--muted);
}

.profile-handle-field input {
  height: 100%;
  padding: 0 16px 0 2px;
  border: 0;
  outline: none;
}

.profile-field > input:focus,
.profile-handle-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

.profile-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.profile-settings-status {
  min-height: 20px;
}

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

.panel-copy-helper {
  margin: -6px 0 0;
}

.supported-platforms-link {
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.supported-platforms-link:hover {
  opacity: 0.82;
}

.supported-platforms-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 20px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(15, 15, 15, 0.28);
}

.supported-platforms-dialog::backdrop {
  background: rgba(15, 15, 15, 0.68);
  backdrop-filter: blur(3px);
}

.supported-platforms-content {
  display: grid;
  gap: 22px;
  padding: 30px;
}

.supported-platforms-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
}

.supported-platforms-heading > div {
  display: grid;
  gap: 6px;
}

.supported-platforms-heading h1 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.15;
}

.supported-platforms-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
}

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

.supported-platforms-item {
  display: grid;
  grid-template-columns: minmax(132px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.supported-platforms-provider {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.supported-platforms-logo {
  display: inline-grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.supported-platforms-logo img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.supported-platforms-name {
  min-width: 0;
  font-weight: 800;
}

.supported-platforms-host {
  min-width: 0;
  justify-self: end;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  text-align: right;
}

.share-sheet-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(15, 15, 15, 0.28);
}

.share-sheet-dialog::backdrop {
  background: rgba(15, 15, 15, 0.68);
  backdrop-filter: blur(3px);
}

.share-sheet-content {
  display: grid;
  gap: 28px;
  padding: 30px;
}

.share-sheet-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.share-sheet-heading h1 {
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  font-weight: 600;
  line-height: 1.15;
}

.share-sheet-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
}

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

.share-friend-field {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 0 12px 12px;
  border: 2px solid var(--accent);
  border-radius: 6px;
}

.share-friend-field label {
  justify-self: start;
  margin-top: -15px;
  padding: 0 6px;
  background: var(--surface);
  color: var(--accent);
  font-size: 1rem;
  font-weight: 600;
}

.share-friend-field input {
  min-height: 54px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.share-friend-results {
  position: absolute;
  z-index: 5;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  display: grid;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 45px rgba(15, 15, 15, 0.18);
}

.share-friend-option {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.share-friend-option:last-child {
  border-bottom: 0;
}

.share-friend-option:hover,
.share-friend-option:focus-visible {
  background: var(--surface-soft);
  outline: 0;
}

.share-friend-empty {
  padding: 14px;
  color: var(--muted);
}

.share-access-section,
.share-general-section {
  display: grid;
  gap: 14px;
}

.share-access-section h2,
.share-general-section h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.share-access-list {
  display: grid;
  gap: 14px;
}

.share-person-row,
.share-general-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.share-person-avatar,
.share-general-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--ink);
  overflow: hidden;
}

.share-person-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.share-person-fallback {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.share-person-copy,
.share-general-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.share-person-name {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.share-person-subtitle,
.share-general-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.share-person-subtitle {
  display: block;
}

.share-person-role {
  color: var(--muted);
  font-weight: 600;
}

.share-person-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
}

.share-person-remove {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.share-person-remove:hover,
.share-person-remove:focus-visible {
  background: var(--surface-soft);
  color: var(--ink);
  outline: 0;
}

.share-general-row {
  grid-template-columns: 52px minmax(0, 1fr);
}

.share-general-copy select {
  width: auto;
  min-width: 140px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.share-general-copy select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.share-sheet-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.share-sheet-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid var(--muted);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.share-sheet-copy:hover {
  border-color: var(--accent);
}

.share-sheet-done {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 110px;
  padding: 13px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.share-sheet-done:hover,
.share-sheet-done:focus-visible {
  filter: brightness(0.96);
  outline: 0;
}

.share-sheet-status {
  margin: 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.share-sheet-dialog.is-copy-only .share-friend-field,
.share-sheet-dialog.is-copy-only .share-access-section,
.share-sheet-dialog.is-copy-only .share-general-section {
  display: none;
}

.download-orientation-popover {
  position: fixed;
  z-index: 1200;
  display: grid;
  gap: 6px;
  width: min(280px, calc(100vw - 24px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 18px 48px rgba(15, 15, 15, 0.22);
}

.download-orientation-popover[hidden] {
  display: none;
}

.download-orientation-title {
  margin: 2px 6px 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.download-orientation-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.download-orientation-option:hover,
.download-orientation-option:focus-visible {
  background: var(--surface-soft);
  outline: none;
}

.download-orientation-option .app-icon {
  font-size: 26px;
  color: var(--accent);
}

.download-orientation-option-copy {
  display: grid;
  gap: 1px;
}

.download-orientation-option-copy small {
  color: var(--muted);
  font-size: 0.78rem;
}

.download-orientation-option:disabled {
  opacity: 0.55;
  cursor: default;
}

.download-orientation-status {
  margin: 2px 6px 4px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.35;
}

@media (max-width: 560px) {
  .supported-platforms-content {
    padding: 22px;
  }

  .supported-platforms-item {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 8px;
    padding: 12px;
  }

  .supported-platforms-host {
    justify-self: start;
    text-align: left;
  }
}

.creator-profile-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 20px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(15, 15, 15, 0.28);
}

.creator-profile-dialog::backdrop {
  background: rgba(15, 15, 15, 0.68);
  backdrop-filter: blur(3px);
}

.creator-profile-form {
  display: grid;
  gap: 26px;
  padding: 30px;
}

.creator-profile-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
}

.creator-profile-heading > div {
  display: grid;
  gap: 5px;
}

.creator-profile-heading h1 {
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2.2rem);
  line-height: 1.15;
}

.creator-profile-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
}

.creator-profile-avatar-wrap {
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
}

.creator-profile-avatar-preview {
  width: 176px;
  height: 176px;
  border-radius: 50%;
}

.creator-profile-picture-button {
  padding: 5px 8px;
  border: 0;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
}

.creator-profile-picture-button:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.creator-profile-fields {
  display: grid;
  gap: 16px;
  width: min(100%, 500px);
  margin: 0 auto;
}

.creator-profile-fields label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.creator-profile-fields input,
.creator-profile-handle-input {
  width: 100%;
  min-width: 0;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
}

.creator-profile-fields > label > input {
  padding: 0 15px;
  outline: none;
}

.creator-profile-handle-input {
  display: flex;
  align-items: center;
  padding-left: 15px;
  color: var(--muted);
  font-size: 1rem;
}

.creator-profile-handle-input input {
  height: 100%;
  padding: 0 15px 0 2px;
  border: 0;
  outline: none;
}

.creator-profile-fields > label > input:focus,
.creator-profile-handle-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.creator-profile-status {
  min-height: 20px;
  margin: -8px 0 0;
  text-align: center;
}

.creator-profile-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.video-edit-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 20px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(15, 15, 15, 0.28);
}

.video-edit-dialog::backdrop {
  background: rgba(15, 15, 15, 0.68);
  backdrop-filter: blur(3px);
}

.video-edit-form {
  display: grid;
  gap: 22px;
  padding: 30px;
}

.video-edit-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
}

.video-edit-heading > div {
  display: grid;
  gap: 5px;
}

.video-edit-heading h1 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.15;
}

.video-edit-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
}

.video-edit-text-fields {
  display: grid;
  gap: 14px;
}

.video-edit-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.video-edit-field small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.video-edit-field input,
.video-edit-field textarea {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  font-weight: 700;
  outline: none;
}

.video-edit-field input {
  height: 44px;
  padding: 0 12px;
}

.video-edit-field textarea {
  min-height: 104px;
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.45;
}

.video-edit-field input:focus,
.video-edit-field textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 115, 255, 0.12);
}

.video-edit-status {
  min-height: 1.2em;
  margin: 0;
}

.video-edit-status.is-error {
  color: var(--bad);
}

.video-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.feedback-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 20px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 24px 80px rgba(15, 15, 15, 0.28);
}

.feedback-dialog::backdrop {
  background: rgba(15, 15, 15, 0.68);
  backdrop-filter: blur(3px);
}

.feedback-form {
  display: grid;
  gap: 18px;
  padding: 30px;
}

.feedback-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
}

.feedback-heading > div {
  display: grid;
  gap: 5px;
}

.feedback-heading h1 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.15;
}

.feedback-close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
}

.feedback-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.feedback-field small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.feedback-field input,
.feedback-field select,
.feedback-field textarea {
  min-width: 0;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  font: inherit;
  font-weight: 700;
  outline: none;
}

.feedback-field input,
.feedback-field select {
  height: 44px;
  padding: 0 12px;
}

.feedback-field textarea {
  min-height: 132px;
  padding: 11px 12px;
  resize: vertical;
  line-height: 1.45;
}

.feedback-field input:focus,
.feedback-field select:focus,
.feedback-field textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(0, 115, 255, 0.12);
}

.feedback-status {
  min-height: 1.2em;
  margin: 0;
}

.feedback-status.is-error {
  color: var(--bad);
}

.feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

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

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.auth-form input {
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
}

.auth-form input:focus {
  border-color: var(--border-focus);
}

.status-text[data-tone="error"] {
  color: var(--bad);
}

.upload-form.is-auth-disabled {
  opacity: 0.62;
}

.hidden {
  display: none;
}

@media (max-width: 1220px) {
  .topbar {
    grid-template-columns: minmax(180px, 240px) minmax(240px, 1fr) auto;
  }

  .feed-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }

  .create-shell,
  .friends-shell {
    max-width: 960px;
  }
}

@media (max-width: 959px) {
  body.is-customization-open {
    overflow: hidden;
  }

  .customization-content {
    position: fixed;
    z-index: 14;
    inset: var(--topbar-height) 0 0 var(--rail-width);
    align-content: start;
    gap: 16px;
    width: auto;
    max-height: none;
    padding: 0 16px 20px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    animation: customization-view-in 160ms ease-out;
  }

  .customization-mobile-header {
    position: sticky;
    z-index: 1;
    top: 0;
    display: flex;
    min-height: 58px;
    margin: 0 -16px;
    padding: 0 16px;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
  }

  .customization-mobile-header strong {
    font-size: 1rem;
  }

  .customization-back-button {
    margin-left: -8px;
  }

  .customization-menu-list {
    gap: 12px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  .customization-section {
    padding: 14px;
  }
}

@keyframes customization-view-in {
  from {
    transform: translateX(24px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@media (max-width: 820px) {
  :root {
    --rail-width: 0px;
    --topbar-height: 86px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    gap: 12px;
    row-gap: 4px;
    align-content: center;
    height: var(--topbar-height);
    padding: 0 12px;
  }

  .brand-cluster {
    gap: 8px;
  }

  .topbar-tagline {
    order: 3;
    grid-column: 1 / -1;
    justify-self: center;
    max-width: 100%;
    margin-block: 8px 0;
    color: var(--muted);
    font-size: 1.00rem;
    text-align: center;
  }

  .side-rail {
    top: auto;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: auto;
    height: 72px;
    padding: 6px 10px;
    border-top: 1px solid var(--line);
  }

  .rail-link {
    height: 58px;
    font-size: 0.72rem;
  }

  .app-main {
    padding: calc(var(--topbar-height) + 12px) 12px 92px;
  }

  .customization-content {
    inset: var(--topbar-height) 0 72px;
  }

  .feed-controls {
    top: var(--topbar-height);
  }

  .feed-grid,
  .create-layout,
  .history-layout {
    grid-template-columns: 1fr;
  }

  .create-tabs {
    overflow-x: auto;
  }

  .create-panel {
    padding: 18px;
  }

  .customization-fields {
    grid-template-columns: 1fr;
  }

  .visibility-options {
    grid-template-columns: 1fr;
  }

  .category-options {
    grid-template-columns: 1fr;
  }

  .typing-speed-options {
    grid-template-columns: 1fr;
  }

  .style-font-options,
  .style-theme-options {
    grid-template-columns: 1fr;
  }

  .upload-panel,
  .queue-panel {
    min-height: auto;
    max-height: none;
  }

  .history-head {
    display: none;
  }

  .history-row {
    grid-template-areas:
      "thumbnail thumbnail"
      "title actions"
      "duration actions"
      "status actions";
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 8px;
    min-height: 0;
    padding: 10px 12px;
  }

  .history-cell {
    padding: 0;
  }

  .thumbnail-cell {
    grid-area: thumbnail;
    align-self: stretch;
  }

  .history-thumb {
    width: 100%;
    margin-bottom: 8px;
  }

  .title-cell {
    grid-area: title;
  }

  .duration-cell {
    grid-area: duration;
  }

  .status-cell {
    grid-area: status;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
  }

  .actions-cell {
    grid-area: actions;
    align-self: center;
  }

  .history-player-row.is-open {
    padding: 0 12px 12px;
  }

  .history-player-cell {
    padding: 0;
  }

  h1 {
    font-size: 1.6rem;
  }

  .signin-screen.is-otp-step .signin-panel {
    width: min(100%, 420px);
  }

  .signin-screen.is-otp-step .otp-heading {
    gap: 10px;
    margin-bottom: 4px;
  }

  .signin-screen.is-otp-step .otp-continue-button {
    min-height: 48px;
  }

  .signin-screen.is-otp-step .resend-email-button {
    margin-bottom: 0;
  }

  .account-shell {
    min-height: calc(100vh - 216px);
  }

  .account-hero {
    align-items: flex-start;
  }

  .account-identity {
    align-items: flex-start;
  }

  .large-avatar {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
  }

  .account-empty-state {
    min-height: 300px;
  }
}

@media (max-width: 560px) {
  .create-chip {
    min-height: 38px;
    padding: 0 12px;
  }

  .round-action {
    width: 38px;
    height: 38px;
  }

  .sign-in-button {
    min-height: 38px;
    padding: 0 12px;
  }

  .notification-popover {
    position: fixed;
    top: calc(var(--topbar-height) - 4px);
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100vh - var(--topbar-height) - 92px);
  }

  .user-menu {
    position: fixed;
    top: calc(var(--topbar-height) - 2px);
    right: 8px;
    width: min(360px, calc(100vw - 16px));
    max-height: calc(100vh - var(--topbar-height) - 8px);
  }

  .feed-grid {
    gap: 26px;
  }

  .feed-thumb,
  .history-video {
    border-radius: 10px;
  }

  .signin-screen.is-otp-step .otp-heading h1 {
    font-size: 1.7rem;
  }

  .signin-screen.is-otp-step .otp-copy,
  .signin-screen.is-otp-step .resend-email-button {
    font-size: 0.96rem;
  }

  .signin-screen.is-otp-step .auth-footer-links {
    gap: 10px;
    font-size: 0.82rem;
  }

  .account-hero {
    display: grid;
  }

  .account-tab {
    padding: 0 14px;
  }

  .profile-picture-editor,
  .settings-section,
  .preferred-style-form {
    grid-template-columns: 1fr;
  }

  .preferred-style-actions {
    grid-column: 1;
    align-items: stretch;
    flex-direction: column;
  }

  .profile-form-footer {
    display: grid;
    justify-items: start;
  }

  .profile-form-actions {
    width: 100%;
  }

  .profile-form-actions > button {
    flex: 1 1 160px;
  }

  .creator-profile-form {
    gap: 22px;
    padding: 22px;
  }

  .creator-profile-avatar-preview {
    width: 144px;
    height: 144px;
  }

  .creator-profile-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 380px) {
  .top-actions {
    gap: 8px;
  }

  .create-chip {
    width: 38px;
    padding: 0;
    justify-content: center;
    overflow: hidden;
    font-size: 0;
  }
}

/* Watch page */
.watch-content {
  display: block;
  min-width: 0;
}

.watch-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px 32px;
  align-items: start;
}

.watch-page--message {
  grid-template-columns: 1fr;
}

.watch-empty {
  padding: 48px 0;
  color: var(--muted);
  font-size: 1rem;
}

.watch-primary {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.watch-stage {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  background: #0f0f0f;
}

.watch-stage.is-reader {
  background: #050816;
}

.watch-stage.is-player-fullscreen,
.history-reader.is-player-fullscreen {
  position: fixed;
  z-index: 2147483647;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  border-radius: 0;
}

.watch-video {
  width: 100%;
  height: 100%;
  display: block;
  background: #0f0f0f;
}

.rechat-player-island,
.rechat-native-player,
.rechat-player-status {
  width: 100%;
  height: 100%;
}

.rechat-native-player {
  position: relative;
  display: block;
  overflow: hidden;
  color: #e5e7eb;
  background: #050816;
  outline: none;
}

.rechat-native-player:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(179, 38, 95, 0.48);
}

.rechat-player-viewport {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  color: #e5e7eb;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    #0b1020;
  background-size: 28px 28px;
  font-family: var(--font-sans);
}

.rechat-player-viewport[data-player-theme="midnight"] {
  color: #e9e9ff;
  background-color: #0a0a1f;
}

.rechat-player-viewport[data-player-theme="daylight"] {
  color: #0f172a;
  background-color: #f1f5f9;
}

.rechat-player-viewport[data-player-font="serif"] {
  font-family: Georgia, "Times New Roman", serif;
}

.rechat-player-viewport[data-player-font="mono"] {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.rechat-player-viewport[data-player-viewport-mode="mobile"] {
  width: auto;
  height: 100%;
  margin: 0 auto;
}

.rechat-player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 12%;
  padding: clamp(10px, 2vw, 24px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(17, 24, 39, 0.94);
}

.rechat-player-header span {
  min-width: 0;
  overflow: hidden;
  font-size: clamp(0.78rem, 1.8vw, 1.3rem);
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

[data-player-theme="daylight"] .rechat-player-header > span {
  color: #ffffff;
}

.rechat-player-messages {
  min-height: 0;
  padding: clamp(12px, 2.5vw, 30px);
  padding-bottom: clamp(86px, 12vw, 120px);
  overflow: auto;
  overscroll-behavior: contain;
  scroll-behavior: auto;
  scrollbar-color: rgba(90, 90, 105, 0.35) transparent;
  scrollbar-width: thin;
  outline: none;
}

.rechat-player-messages:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(179, 38, 95, 0.28);
}

.rechat-player-conversation {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.6vw, 18px);
  min-height: 100%;
  justify-content: flex-end;
}

.rechat-player-row {
  display: flex;
  align-items: flex-end;
  width: 100%;
}

.rechat-player-row.is-right {
  justify-content: flex-end;
}

.rechat-player-row.has-media {
  justify-content: space-between;
  gap: clamp(12px, 2vw, 24px);
}

.rechat-player-row.is-right.has-media {
  flex-direction: row-reverse;
}

.rechat-player-bubble {
  position: relative;
  width: fit-content;
  max-width: min(74%, 760px);
  padding: clamp(9px, 1.6vw, 18px) clamp(12px, 2vw, 22px);
  border-radius: clamp(12px, 2vw, 22px);
  background: #f8fafc;
  color: #111827;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

.rechat-player-row.has-media .rechat-player-bubble {
  max-width: min(64%, 680px);
}

.is-right .rechat-player-bubble {
  background: #2563eb;
  color: #ffffff;
}

[data-player-theme="midnight"] .rechat-player-bubble {
  background: #1e1e3f;
  color: #e9e9ff;
}

[data-player-theme="midnight"] .is-right .rechat-player-bubble {
  background: #6d5dfc;
  color: #ffffff;
}

[data-player-theme="daylight"] .rechat-player-bubble {
  background: #ffffff;
  color: #0f172a;
}

.rechat-player-speaker {
  display: block;
  margin-bottom: 4px;
  font-size: 0.72em;
  opacity: 0.72;
}

.rechat-player-copy {
  min-width: 0;
  color: inherit;
  font-size: clamp(0.74rem, 1.55vw, 1.25rem);
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.rechat-player-plain {
  white-space: pre-wrap;
}

.rechat-player-copy > :first-child,
.rechat-player-copy > :first-child > :first-child {
  margin-top: 0;
}

.rechat-player-copy > :last-child,
.rechat-player-copy > :last-child > :last-child {
  margin-bottom: 0;
}

.rechat-player-copy p,
.rechat-player-copy ul,
.rechat-player-copy ol,
.rechat-player-copy blockquote,
.rechat-player-copy pre {
  margin: 0.55em 0;
}

.rechat-player-copy ul,
.rechat-player-copy ol {
  padding-left: 1.35em;
}

.rechat-player-copy h1,
.rechat-player-copy h2,
.rechat-player-copy h3,
.rechat-player-copy h4 {
  margin: 0.65em 0 0.3em;
  color: inherit;
  line-height: 1.18;
}

.rechat-player-copy h1 {
  font-size: 1.35em;
}

.rechat-player-copy h2 {
  font-size: 1.2em;
}

.rechat-player-copy h3,
.rechat-player-copy h4 {
  font-size: 1.05em;
}

.rechat-player-copy blockquote {
  padding-left: 0.8em;
  border-left: 3px solid currentColor;
  opacity: 0.82;
}

.rechat-player-copy code {
  padding: 0.08em 0.28em;
  border-radius: 0.3em;
  background: rgba(0, 0, 0, 0.12);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.88em;
}

.rechat-player-copy pre {
  overflow-x: auto;
  padding: 0.75em;
  border-radius: 0.55em;
  background: rgba(0, 0, 0, 0.16);
}

.rechat-player-copy pre code {
  padding: 0;
  background: transparent;
}

.rechat-player-copy a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

[data-player-font-size="small"] .rechat-player-copy {
  font-size: clamp(0.68rem, 1.35vw, 1.05rem);
}

[data-player-font-size="large"] .rechat-player-copy {
  font-size: clamp(0.82rem, 1.8vw, 1.45rem);
}

.rechat-player-caret {
  display: inline-block;
  width: 0.12em;
  height: 1em;
  margin-left: 0.14em;
  vertical-align: -0.14em;
  background: currentColor;
  animation: rechat-player-blink 0.7s steps(1) infinite;
}

.rechat-player-image {
  display: block;
  width: 100%;
  max-height: min(50vh, 380px);
  border-radius: clamp(8px, 1.5vw, 16px);
  object-fit: contain;
  background: rgba(0, 0, 0, 0.08);
  animation: rechat-player-image-in 240ms ease both;
}

.rechat-player-media {
  display: flex;
  width: min(34%, 360px);
  min-width: 160px;
  margin: 0;
  flex-direction: column;
  align-self: flex-end;
}

.rechat-player-media-item {
  width: 100%;
  margin-right: 0;
  margin-bottom: 0;
  margin-left: 0;
}

.rechat-player-branding {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 28px);
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(4, 8, 20, 0.64);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
}

.rechat-player-branding:hover,
.rechat-player-branding:focus-visible {
  color: #ffffff;
  background: rgba(24, 30, 48, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
}

.rechat-player-branding img {
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  padding: 2px;
  border-radius: 50%;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.94);
}

.rechat-player-branding span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rechat-player-controls {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 4;
  display: grid;
  gap: 6px;
  padding: 0 14px 12px;
  visibility: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 150ms ease,
    transform 150ms ease,
    visibility 0s linear 150ms;
  pointer-events: none;
}

.rechat-native-player:hover .rechat-player-controls,
.rechat-native-player:focus-visible .rechat-player-controls,
.rechat-native-player:has(.rechat-player-controls :focus-visible) .rechat-player-controls {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0s;
}

.rechat-player-seek-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 18px;
  pointer-events: auto;
}

.rechat-player-control-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rechat-player-control-left {
  display: flex;
  align-items: center;
  min-width: 0;
}

.rechat-player-autoplay {
  position: absolute;
  left: 0;
  bottom: calc(100% + 28px);
  padding: 4px 7px;
  border: 0;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(4, 8, 20, 0.5);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  pointer-events: auto;
}

.rechat-player-autoplay-icon {
  display: none;
}

.rechat-player-autoplay:hover,
.rechat-player-autoplay:focus-visible,
.rechat-player-autoplay.is-active {
  color: #ffffff;
  background: rgba(179, 38, 95, 0.74);
}

.rechat-player-control-cluster {
  display: flex;
  align-items: center;
  gap: 3px;
  min-height: 44px;
  padding: 4px 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  color: #ffffff;
  background: rgba(4, 8, 20, 0.7);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px);
  pointer-events: auto;
}

.rechat-player-control {
  display: inline-grid;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}

.rechat-player-control:hover,
.rechat-player-control:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
}

.rechat-player-control.is-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
}

.rechat-player-control.is-disabled {
  cursor: default;
  opacity: 0.34;
}

.rechat-player-control:disabled {
  cursor: wait;
  opacity: 0.58;
}

.rechat-player-settings {
  position: absolute;
  right: 14px;
  bottom: 82px;
  z-index: 5;
  display: flex;
  box-sizing: border-box;
  width: calc(50% - 21px);
  max-height: calc(100% - 96px);
  min-width: 320px;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(247, 247, 250, 0.96);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(16px);
}

.rechat-player-setting {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 0;
  color: #676773;
  font-size: 0.72rem;
  font-weight: 800;
}

.rechat-player-setting-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rechat-player-setting-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.rechat-player-settings input[type="range"] {
  width: 100%;
  min-width: 0;
  accent-color: #b3265f;
}

.rechat-player-settings input[type="range"]:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.rechat-player-settings select {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 9px;
  border: 1px solid rgba(25, 25, 35, 0.16);
  border-radius: 7px;
  color: #30303a;
  background: #ffffff;
}

.rechat-player-settings output {
  min-width: 4.6rem;
  color: #30303a;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.rechat-player-settings .rechat-player-check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #30303a;
  font-size: 0.7rem;
}

.rechat-player-settings .rechat-player-check input {
  accent-color: #b3265f;
}

.rechat-player-setting-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.rechat-player-progress {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 7px 0 5px;
  color: #ffffff;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  white-space: nowrap;
}

.rechat-player-progress-separator {
  color: rgba(255, 255, 255, 0.5);
}

.rechat-player-export-error {
  position: absolute;
  right: 12px;
  bottom: 58px;
  z-index: 3;
  max-width: min(420px, calc(100% - 24px));
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  color: #ffffff;
  background: #a61b3d;
  font-size: 0.78rem;
}

.rechat-player-volume {
  display: flex;
  align-items: center;
}

.rechat-player-volume input {
  width: 0;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  accent-color: #ff275d;
  transition:
    width 160ms ease,
    margin 160ms ease,
    opacity 160ms ease;
}

.rechat-player-volume:hover input,
.rechat-player-volume:focus-within input {
  width: 74px;
  margin: 0 8px 0 2px;
  opacity: 1;
}

.rechat-player-seek {
  width: 100%;
  height: 18px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.rechat-player-seek::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background:
    linear-gradient(
      to right,
      #ff275d 0,
      #ff275d var(--seek-progress, 0%),
      rgba(255, 255, 255, 0.32) var(--seek-progress, 0%),
      rgba(255, 255, 255, 0.32) 100%
    );
}

.rechat-player-seek::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  appearance: none;
  background: #ff275d;
  box-shadow: 0 0 0 3px rgba(255, 39, 93, 0.16);
}

.rechat-player-seek::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
}

.rechat-player-seek::-moz-range-progress {
  height: 4px;
  border-radius: 999px;
  background: #ff275d;
}

.rechat-player-seek::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: #ff275d;
}

.rechat-player-preview {
  position: absolute;
  bottom: calc(100% + 10px);
  z-index: 8;
  display: grid;
  justify-items: center;
  gap: 6px;
  width: min(256px, 72vw);
  transform: translateX(-50%);
  pointer-events: none;
}

.rechat-player-preview-frame {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 5px;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  padding: 12px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 12px;
  color: #e5e7eb;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    #0b1020;
  background-size: 14px 14px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
}

.rechat-player-preview-frame[data-player-theme="midnight"] {
  background: #0a0a1f;
}

.rechat-player-preview-frame[data-player-theme="daylight"] {
  color: #0f172a;
  background: #f1f5f9;
}

.rechat-player-preview-row {
  display: flex;
  width: 100%;
}

.rechat-player-preview-row.is-right {
  justify-content: flex-end;
}

.rechat-player-preview-bubble {
  max-width: 72%;
  padding: 5px 7px;
  border-radius: 7px;
  color: #111827;
  background: #f8fafc;
  font-size: 0.5rem;
  line-height: 1.3;
  white-space: pre-wrap;
}

.rechat-player-preview-row.is-right .rechat-player-preview-bubble {
  color: #ffffff;
  background: #2563eb;
}

.rechat-player-preview-bubble img {
  display: block;
  width: 100%;
  max-height: 54px;
  margin-top: 4px;
  border-radius: 4px;
  object-fit: cover;
}

.rechat-player-preview > span {
  padding: 4px 9px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(4, 8, 20, 0.8);
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.rechat-native-player:fullscreen,
.rechat-native-player:-webkit-full-screen,
.rechat-native-player[data-player-fullscreen-mode="fallback"] {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  border-radius: 0;
}

.rechat-native-player[data-player-fullscreen-mode="fallback"] {
  position: fixed;
  z-index: 2147483647;
  inset: 0;
  max-width: none;
  max-height: none;
}

.rechat-native-player:fullscreen .rechat-player-conversation,
.rechat-native-player:-webkit-full-screen .rechat-player-conversation,
.rechat-native-player[data-player-fullscreen-mode="fallback"] .rechat-player-conversation {
  width: min(100%, 1180px);
  margin: 0 auto;
}

.history-player-cell .history-reader {
  width: min(100%, 920px);
  height: min(70vh, 720px);
  min-height: 480px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.rechat-player-status {
  position: relative;
  display: grid;
  place-items: center;
  gap: 12px;
  overflow: hidden;
  padding: 24px;
  color: #ffffff;
  text-align: center;
  background:
    radial-gradient(circle at 28% 24%, rgba(179, 38, 95, 0.48), transparent 34%),
    linear-gradient(135deg, #151515, #323232);
  background-position: center;
  background-size: cover;
}

.rechat-player-status > div {
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.rechat-player-status img {
  width: 58px;
  height: 58px;
  border-radius: 14px;
}

.rechat-player-status p {
  max-width: 52ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
}

.rechat-player-status .watch-video {
  position: absolute;
  inset: 0;
}

@keyframes rechat-player-blink {
  50% {
    opacity: 0;
  }
}

@keyframes rechat-player-image-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }
}

@media (max-width: 700px) {
  .watch-stage.is-reader {
    min-height: 0;
  }

  .rechat-player-header {
    padding: 14px 18px;
  }

  .rechat-player-branding {
    max-width: 46%;
    padding: 5px 8px;
    font-size: 0.65rem;
  }

  .rechat-player-messages {
    padding: 12px;
    padding-bottom: 0;
  }

  .rechat-player-conversation {
    box-sizing: border-box;
    padding-bottom: 32px;
  }

  .rechat-native-player::after {
    position: absolute;
    z-index: 2;
    inset: 0;
    background:
      linear-gradient(
        180deg,
        rgba(4, 8, 20, 0.46) 0%,
        rgba(4, 8, 20, 0.1) 38%,
        rgba(4, 8, 20, 0.16) 64%,
        rgba(4, 8, 20, 0.5) 100%
      );
    content: "";
    opacity: 0;
    transition: opacity 160ms ease;
    pointer-events: none;
  }

  .rechat-native-player[data-player-controls-visible="true"]::after {
    opacity: 1;
  }

  .rechat-player-row.has-media {
    gap: 8px;
  }

  .rechat-player-row.has-media .rechat-player-bubble {
    max-width: 64%;
  }

  .rechat-player-media {
    width: 34%;
    min-width: 0;
  }

  .rechat-player-controls {
    inset: 0;
    display: block;
    padding: 0;
    visibility: hidden;
    opacity: 0;
    transform: none;
    transition:
      opacity 160ms ease,
      visibility 0s linear 160ms;
    pointer-events: none;
  }

  .rechat-native-player[data-player-controls-visible="true"] .rechat-player-controls {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
  }

  .rechat-native-player[data-player-controls-visible="false"] .rechat-player-controls {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }

  .rechat-native-player[data-player-controls-visible="false"] .rechat-player-controls * {
    pointer-events: none;
  }

  .rechat-player-seek-wrap {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 3;
    height: 14px;
  }

  .rechat-player-seek {
    height: 14px;
  }

  .rechat-player-control-row {
    position: absolute;
    inset: 0;
    display: block;
    pointer-events: none;
  }

  .rechat-player-control-left,
  .rechat-player-primary-controls,
  .rechat-player-utility-controls {
    display: contents;
  }

  .rechat-player-control {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(4, 8, 20, 0.52);
    backdrop-filter: blur(8px);
    pointer-events: auto;
  }

  .rechat-player-control--previous,
  .rechat-player-control--play,
  .rechat-player-control--next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
  }

  .rechat-player-control--previous {
    left: calc(50% - 96px);
  }

  .rechat-player-control--play {
    left: 50%;
    width: 56px;
    height: 56px;
    transform: translate(-50%, -50%);
    background: rgba(4, 8, 20, 0.68);
  }

  .rechat-player-control--next {
    right: calc(50% - 96px);
  }

  .rechat-player-control--play .material-icons {
    font-size: 34px;
  }

  .rechat-player-control--previous .material-icons,
  .rechat-player-control--next .material-icons {
    font-size: 28px;
  }

  .rechat-player-autoplay,
  .rechat-player-volume,
  .rechat-player-control--download,
  .rechat-player-control--settings {
    position: absolute;
    top: max(8px, env(safe-area-inset-top));
    bottom: auto;
  }

  .rechat-player-autoplay {
    right: calc(max(8px, env(safe-area-inset-right)) + 132px);
    left: auto;
    display: grid;
    width: 40px;
    height: 40px;
    padding: 0;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    background: rgba(4, 8, 20, 0.52);
    backdrop-filter: blur(8px);
  }

  .rechat-player-autoplay-icon {
    display: inline-flex;
    font-size: 25px;
  }

  .rechat-player-autoplay-label {
    display: none;
  }

  .rechat-player-volume {
    right: calc(max(8px, env(safe-area-inset-right)) + 88px);
    pointer-events: auto;
  }

  .rechat-player-volume input {
    display: none;
  }

  .rechat-player-control--download {
    right: calc(max(8px, env(safe-area-inset-right)) + 44px);
  }

  .rechat-player-control--settings {
    right: max(8px, env(safe-area-inset-right));
  }

  .rechat-player-control--fullscreen {
    position: absolute;
    right: max(8px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
  }

  .rechat-player-progress {
    position: absolute;
    left: max(8px, env(safe-area-inset-left));
    bottom: max(18px, env(safe-area-inset-bottom));
    display: inline-flex;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(4, 8, 20, 0.68);
    backdrop-filter: blur(8px);
    font-size: 0.72rem;
    pointer-events: none;
  }

  .rechat-player-progress-detail {
    display: none;
  }

  .rechat-player-settings {
    top: 52px;
    right: 8px;
    bottom: auto;
    width: min(92%, 380px);
    max-height: calc(100% - 60px);
    min-width: 0;
    padding: 12px;
  }

  .history-player-cell .history-reader {
    height: min(72vh, 640px);
    min-height: 440px;
  }
}

.watch-stage-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  color: #ffffff;
  background:
    radial-gradient(circle at 28% 24%, rgba(179, 38, 95, 0.48), transparent 34%),
    linear-gradient(135deg, #151515, #323232);
}

.watch-stage-placeholder img {
  width: 76px;
  height: 76px;
  border-radius: 18px;
  object-fit: cover;
  opacity: 0.86;
}

.watch-continuity {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.watch-nav-button,
.watch-autoplay-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 800;
}

.watch-nav-button {
  min-width: 118px;
}

.watch-nav-button:hover,
.watch-autoplay-toggle:hover {
  background: var(--line);
}

.watch-nav-button.is-disabled {
  color: #9a9a9a;
  cursor: not-allowed;
}

.watch-autoplay-toggle {
  cursor: pointer;
}

.watch-autoplay-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.watch-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.3;
}

.watch-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.watch-author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  min-width: 0;
}

.watch-author-name {
  margin: 0;
  font-weight: 700;
}

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

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

.watch-share-button,
.watch-action-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.watch-share-button:hover,
.watch-action-button:hover {
  background: var(--line);
}

.watch-action-button.is-active,
.watch-follow-button.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

.watch-info-card {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.watch-stats {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.watch-description {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.5;
}

.watch-category-tags {
  margin-top: 0;
}

.watch-related {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.watch-related-heading {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.watch-related-list {
  display: grid;
  gap: 12px;
}

.watch-related-card {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.watch-related-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  background: #0f0f0f;
}

.watch-related-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #0f0f0f;
}

.watch-related-copy {
  min-width: 0;
}

.watch-related-title {
  margin: 0 0 4px;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.watch-related-subtitle,
.watch-related-detail {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.watch-related-empty {
  color: var(--muted);
  font-size: 0.9rem;
}

.library-page {
  display: grid;
  gap: 22px;
  max-width: 1240px;
}

.you-shell {
  display: grid;
  align-content: start;
  gap: 22px;
  max-width: 1240px;
  min-height: calc(100vh - var(--topbar-height) - 62px);
}

#you-content[hidden],
#you-account[hidden] {
  display: none;
}

.library-header {
  display: grid;
  gap: 5px;
  padding-top: 8px;
}

.library-header h1,
.library-header p {
  margin: 0;
}

.library-header > p:last-child {
  color: var(--muted);
  line-height: 1.5;
}

.library-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.library-tabs::-webkit-scrollbar {
  display: none;
}

.library-tab {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 16px;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-weight: 850;
  line-height: 44px;
}

.library-tab:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

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

.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 240px));
  gap: 18px 14px;
  justify-content: start;
}

.library-card,
.library-card-link,
.library-card-copy {
  min-width: 0;
}

.library-card-link {
  display: grid;
  gap: 8px;
}

.library-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #0f0f0f;
}

.library-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0f0f0f;
}

.library-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.42);
}

.library-progress > span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.library-card-copy {
  display: grid;
  gap: 4px;
}

.library-card-copy h2,
.library-card-copy p,
.library-card-copy strong {
  margin: 0;
}

.library-card-copy h2 {
  overflow: hidden;
  font-size: 0.9rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-card-copy p {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-card-author {
  color: var(--ink);
  font-weight: 700;
}

.library-card-copy strong {
  color: var(--accent);
  font-size: 0.76rem;
}

.library-empty {
  display: grid;
  min-height: 320px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface-strong);
}

.library-shelf {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.library-shelf-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.library-shelf-header h2,
.library-shelf-header p {
  margin: 0;
}

.library-shelf-header h2 {
  font-size: 1.05rem;
  font-weight: 850;
}

.library-shelf-header p,
.library-shelf-empty {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.library-rail {
  display: flex;
  gap: 12px;
  min-width: 0;
  margin-inline: -2px;
  padding: 2px 2px 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}

.library-rail-card {
  flex: 0 0 min(210px, 63vw);
  scroll-snap-align: start;
}

.library-shelf-empty {
  margin: 0;
  padding: 18px 20px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--surface-strong);
}

@media (max-width: 1100px) {
  .watch-page {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .library-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 240px));
  }
}

/* YouTube-style mobile watch experience */
@media (max-width: 820px) {
  body[data-active-view="watch"] .topbar {
    display: none;
  }

  body[data-active-view="watch"] .app-main {
    width: 100%;
    max-width: 100%;
    padding-top: 0;
  }

  .watch-page {
    gap: 16px;
    min-width: 0;
    max-width: 100%;
  }

  .watch-primary {
    gap: 12px;
    min-width: 0;
    max-width: 100%;
  }

  /* Full-bleed player that pins to the top edge while you scroll */
  .watch-stage {
    position: sticky;
    top: 0;
    z-index: 9;
    margin: 0 -12px;
    border-radius: 0;
  }

  .watch-title {
    padding: 0 2px;
    font-size: 1.06rem;
    font-weight: 700;
    line-height: 1.35;
  }

  .watch-meta-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
    max-width: 100%;
  }

  .watch-author {
    margin-right: 0;
    padding: 0 2px;
  }

  .watch-follow-button {
    justify-self: end;
  }

  .watch-actions {
    flex-wrap: nowrap;
    gap: 8px;
    width: calc(100% + 24px);
    max-width: 100vw;
    grid-column: 1 / -1;
    margin: 0 -12px;
    padding: 0 12px 2px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .watch-actions::-webkit-scrollbar {
    display: none;
  }

  /* Flatten the wrapper so like, save, and share share one scroll row */
  .watch-library-actions {
    display: contents;
  }

  .watch-action-button,
  .watch-share-button {
    flex: 0 0 auto;
    gap: 6px;
    padding: 8px 14px;
    white-space: nowrap;
  }

  .watch-info-card {
    padding: 12px 14px;
  }

  .watch-stats {
    font-size: 0.82rem;
  }

  /* Up-next list becomes full-width rows */
  .watch-continuity {
    align-items: stretch;
  }

  .watch-nav-button,
  .watch-autoplay-toggle {
    flex: 1 1 100%;
  }

  .watch-related-card {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .watch-related-title {
    font-size: 0.98rem;
  }
}

@media (max-width: 600px) {
  .library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Public sharing and watch comments */
.feed-card-menu {
  position: relative;
  align-self: start;
  justify-self: end;
  margin-left: auto;
}

.feed-menu-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
  cursor: pointer;
}

.feed-menu-button:hover,
.feed-card-menu.is-open > .feed-menu-button {
  background: var(--surface-soft);
}

.feed-menu-button .app-icon {
  font-size: 28px;
  line-height: 1;
}

.feed-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  gap: 3px;
  min-width: 228px;
  padding: 8px;
  border: 0;
  border-radius: 12px;
  color: #ffffff;
  background: var(--overlay-surface);
  box-shadow: 0 16px 44px rgba(15, 15, 15, 0.32);
}

.feed-menu[hidden] {
  display: none;
}

.feed-menu-item {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: left;
}

.feed-menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.feed-menu-item .app-icon {
  color: #ffffff;
  font-size: 23px;
}

.feed-menu-item.is-active .app-icon {
  color: #ffffff;
}

.watch-comments {
  display: grid;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.comments-panel {
  display: grid;
  gap: 14px;
}

.comments-heading {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.comments-message,
.comments-empty {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.comment-form {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.reply-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

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

.comment-input,
.reply-input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  resize: vertical;
}

.comment-input:focus,
.reply-input:focus {
  border-color: var(--border-focus);
  outline: none;
}

.comment-submit,
.reply-submit {
  padding: 8px 14px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.comment-submit:hover,
.reply-submit:hover {
  background: var(--accent-strong);
}

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

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

.comment {
  display: grid;
  gap: 4px;
}

.comment-main,
.reply-form {
  margin-left: var(--comment-indent, 0);
}

.comment-replies-disclosure {
  display: grid;
  gap: 8px;
}

.comment-replies-toggle {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  margin-left: var(--comment-indent, 0);
}

.comment-replies-toggle::-webkit-details-marker {
  display: none;
}

.comment-replies-toggle:hover {
  background: var(--surface-soft);
}

.comment-replies-toggle .app-icon {
  font-size: 20px;
  transition: transform 160ms ease;
}

.comment-replies-disclosure[open] > .comment-replies-toggle .app-icon {
  transform: rotate(180deg);
}

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

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

.comment-author {
  font-size: 13px;
  font-weight: 600;
}

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

.comment-body {
  margin: 2px 0 0;
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.comment-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.comment-ratings {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.comment-rating-button {
  display: inline-flex;
  min-width: 36px;
  height: 30px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 7px;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.comment-rating-button:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.comment-rating-button.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

.comment-rating-button .app-icon {
  font-size: 18px;
}

.comment-reply-button,
.comment-delete,
.reply-cancel {
  justify-self: start;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.comment-reply-button:hover,
.reply-cancel:hover {
  text-decoration: underline;
}

.comment-delete {
  color: var(--muted);
  font-weight: 500;
}

.comment-delete:hover {
  color: #ff6b6b;
  text-decoration: underline;
}

@media (max-width: 600px) {
  .reply-form {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .reply-input {
    grid-column: 1 / -1;
  }
}

.watch-author-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.watch-author-link:hover .watch-author-name {
  text-decoration: underline;
}

.creator-content {
  display: block;
  min-width: 0;
}

.creator-page {
  display: grid;
  gap: 28px;
  min-width: 0;
}

.creator-page--message {
  gap: 0;
}

.creator-empty {
  padding: 48px 0;
  color: var(--muted);
  font-size: 1rem;
}

.creator-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.creator-avatar {
  flex: 0 0 auto;
  display: block;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
}

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

.creator-name {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.2;
}

.creator-handle {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
}

.creator-stats {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.creator-follow {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.creator-follow-button {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.creator-follow-button:hover {
  opacity: 0.9;
}

.creator-follow-button.is-following {
  background: var(--surface-soft);
  color: var(--ink);
}

.creator-follow-self {
  color: var(--muted);
  font-weight: 600;
}

.creator-follower-count {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}

.creator-videos {
  display: grid;
  gap: 16px;
}

.creator-videos-heading {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.creator-videos-empty {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Admin tools ------------------------------------------------------------- */
.admin-content {
  width: 100%;
}

.admin-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 920px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.admin-page--message {
  align-items: center;
  text-align: center;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.admin-version {
  flex: 0 0 auto;
  border: 1px solid var(--border-input);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  line-height: 1;
  padding: 8px 12px;
}

.admin-subtitle,
.admin-card-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-empty {
  color: var(--muted);
  font-size: 0.95rem;
}

.admin-card {
  border: 1px solid var(--border-input);
  border-radius: 14px;
  background: var(--surface);
  padding: 20px;
}

.admin-card-head {
  margin-bottom: 16px;
}

.admin-card-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.admin-card-foot {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.admin-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.admin-stat--primary {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.admin-stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
}

.admin-stat-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.admin-stat--primary .admin-stat-label {
  color: var(--accent-strong);
}

.admin-status {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.admin-status--ok {
  color: var(--ok);
  background: var(--ok-soft);
}

.admin-status--error {
  color: var(--bad);
  background: var(--bad-soft);
}

.admin-feedback-table {
  border: 1px solid var(--border-input);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

.admin-feedback-table-head,
.admin-feedback-summary {
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) minmax(96px, 0.55fr) minmax(0, 1fr) 32px;
  align-items: center;
  gap: 12px;
}

.admin-feedback-table-head {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border-input);
  color: var(--muted);
  background: var(--surface-soft);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-feedback-row {
  border-bottom: 1px solid var(--border-input);
}

.admin-feedback-row:last-child {
  border-bottom: 0;
}

.admin-feedback-summary {
  min-height: 52px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
}

.admin-feedback-summary::-webkit-details-marker {
  display: none;
}

.admin-feedback-summary:hover,
.admin-feedback-summary:focus-visible {
  background: var(--surface-soft);
  outline: none;
}

.admin-feedback-row[open] .admin-feedback-summary {
  background: var(--surface-soft);
}

.admin-feedback-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.admin-feedback-cell-label {
  display: none;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-feedback-summary time,
.admin-feedback-account {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
}

.admin-feedback-account span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-feedback-expand {
  justify-self: end;
  color: var(--muted);
  font-size: 22px;
  transition: transform 0.16s ease;
}

.admin-feedback-row[open] .admin-feedback-expand {
  transform: rotate(180deg);
}

.admin-feedback-details {
  display: grid;
  gap: 12px;
  padding: 0 12px 14px;
  background: var(--surface-soft);
}

.admin-feedback-message {
  margin: 0;
  padding: 12px;
  border-radius: 10px;
  background: var(--surface);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.45;
  font-weight: 650;
}

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

.admin-feedback-meta div {
  min-width: 0;
}

.admin-feedback-meta dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-feedback-meta dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 0.85rem;
  overflow-wrap: anywhere;
}

.admin-feedback-meta a {
  color: var(--accent);
}

.admin-feedback-id {
  color: var(--muted);
  background: transparent;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.admin-audio-add,
.admin-track-edit-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-audio-add {
  padding: 16px;
  border: 1px dashed var(--border-input);
  border-radius: 12px;
  margin-bottom: 20px;
}

.admin-audio-add h3 {
  margin: 0;
  font-size: 1rem;
}

.admin-upload-field input[type="file"] {
  min-height: 44px;
}

.admin-field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.admin-field input {
  padding: 9px 11px;
  border: 1px solid var(--border-input);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.95rem;
}

.admin-field input:focus {
  outline: none;
  border-color: var(--border-focus);
}

.admin-field--hint {
  justify-content: center;
  line-height: 1.4;
}

.admin-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--ink);
}

.admin-track-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-track {
  border: 1px solid var(--border-input);
  border-radius: 12px;
  padding: 16px;
}

.admin-track--disabled {
  opacity: 0.7;
}

.admin-track-head {
  margin-bottom: 4px;
}

.admin-track-table-wrap {
  overflow: visible;
  border: 1px solid var(--border-input);
  border-radius: 10px;
}

.admin-track-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  background: var(--surface);
}

.admin-track-table th,
.admin-track-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border-input);
  text-align: left;
  vertical-align: middle;
}

.admin-track-table th {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
}

.admin-track-col-status {
  width: 22%;
}

.admin-track-col-title {
  width: 42%;
}

.admin-track-col-duration {
  width: 18%;
}

.admin-track-col-actions {
  width: 18%;
}

.admin-track-table th:nth-child(4),
.admin-track-table td:nth-child(4) {
  text-align: right;
}

.admin-track-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-track-row--disabled {
  background: var(--surface-soft);
}

.admin-track-title {
  display: block;
  max-width: 100%;
  font-weight: 750;
  color: var(--ink);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-track-duration {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.88rem;
}

.admin-track-action-menu {
  width: max-content;
  margin-left: auto;
}

.admin-track-action-menu .feed-menu-button {
  width: 36px;
  height: 36px;
}

.admin-track-action-menu .feed-menu-button .app-icon {
  font-size: 24px;
}

.admin-track-menu {
  width: min(360px, calc(100vw - 32px));
  max-height: min(660px, calc(100vh - 140px));
  overflow-y: auto;
  text-align: left;
}

.admin-track-edit-form {
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.admin-track-menu-title {
  margin: 2px 4px 0;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-track-menu-field {
  color: rgba(255, 255, 255, 0.72);
}

.admin-track-menu-field input {
  width: 100%;
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--ink);
  background: var(--surface);
}

.admin-track-menu-checkbox {
  color: #ffffff;
}

.admin-track-menu-submit {
  margin-top: 2px;
}

.badge.badge-success {
  color: var(--ok);
  background: var(--ok-soft);
}

.badge.badge-muted {
  color: var(--muted);
  background: var(--surface-soft);
}

@media (max-width: 600px) {
  .admin-feedback-table-head {
    display: none;
  }

  .admin-feedback-summary,
  .admin-feedback-meta {
    grid-template-columns: 1fr;
  }

  .admin-feedback-summary {
    align-items: start;
    gap: 10px;
    padding: 12px;
  }

  .admin-feedback-cell {
    display: grid;
    gap: 4px;
  }

  .admin-feedback-cell-label {
    display: block;
  }

  .admin-feedback-account span:last-child {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .admin-feedback-expand {
    justify-self: start;
  }

  .admin-track-menu {
    position: fixed;
    top: 120px;
    right: 12px;
    bottom: 80px;
    width: calc(100vw - 24px);
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
}
