@import url("design-system.css");

*,
*::before,
*::after {
  box-sizing: border-box;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

video,
video *,
.toy-pulse {
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
}

body {
  display: flex;
  flex-direction: column;
}

a {
  color: var(--partner);
}

header.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
}

.header-left {
  flex-shrink: 0;
}

.logo-link {
  display: block;
  line-height: 0;
}

.logo-link .site-logo {
  display: block;
  height: clamp(3.25rem, 5vw + 2rem, 4rem);
  width: auto;
  max-width: min(320px, 70vw);
}

.header-copy {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.header-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.header-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 1rem;
  cursor: not-allowed;
  opacity: 0.55;
}

.header-icon-btn:not(:disabled) {
  cursor: pointer;
  opacity: 1;
}

.header-icon-btn:not(:disabled):hover {
  color: var(--text);
  border-color: var(--accent);
}

/* ── Account menu (Chaturbate-style, top right) ── */
.main-header {
  position: relative;
  z-index: 10050;
}

.account-menu {
  position: relative;
  z-index: 10051;
}

.account-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border-radius: 999px;
  border: 2px solid transparent;
  background: transparent;
  cursor: pointer;
}

.account-trigger:hover,
.account-menu.is-open .account-trigger {
  border-color: var(--accent);
}

.account-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #5eb8ff 0%, #3d8bfd 100%);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  overflow: hidden;
}

.account-avatar.has-photo {
  background: var(--bg);
}

.account-avatar-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.account-avatar.has-photo [data-profile-initial] {
  visibility: hidden;
}

html[data-theme="cb-dark"] .account-avatar {
  background: linear-gradient(135deg, #4aa3e0 0%, #2f6fad 100%);
}

.account-avatar-lg {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1rem;
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  z-index: 10052;
  min-width: min(280px, 92vw);
  padding: 0.35rem 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

html[data-theme="cb-light"] .account-dropdown {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.account-dropdown-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem 0.65rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
}

.account-dropdown-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.account-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme="cb-light"] .account-name {
  color: #00809a;
}

.account-role.is-host {
  color: var(--accent);
  font-weight: 600;
}

.account-role.is-guest {
  color: #9d8cff;
  font-weight: 600;
}

.account-role.is-admin {
  color: var(--accent);
  font-weight: 700;
}

body.account-is-admin #btnPremiumFromMenu,
body.account-is-admin #headerPremiumBtn {
  display: none !important;
}

.premium-setup-row {
  margin-bottom: 0.75rem;
}

.premium-setup-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.premium-setup-btn .bi-star-fill {
  color: #f97316;
}

button.linkish {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent, #f97316);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
}

.account-role {
  font-size: 0.72rem;
  color: var(--muted);
}

.account-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.62rem 1rem;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.account-dropdown-item:hover,
.account-dropdown-item.is-active {
  background: rgba(255, 69, 0, 0.08);
}

.account-dropdown-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.account-dropdown-item i {
  width: 1.1rem;
  color: var(--muted);
  font-size: 1rem;
}

.account-dropdown-item--stacked {
  align-items: flex-start;
}

.account-dropdown-item--stacked > i {
  margin-top: 0.15rem;
}

.account-dropdown-item-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.account-dropdown-item-label {
  font-weight: 600;
  line-height: 1.25;
}

.account-dropdown-item-hint {
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--muted);
}

.account-dropdown-danger {
  color: var(--danger);
}

.account-dropdown-divider {
  height: 1px;
  margin: 0.35rem 0;
  background: var(--border);
}

.account-theme-picker {
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  cursor: default;
}

.account-theme-picker-label {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.88rem;
  color: var(--text);
}

.theme-segmented {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 65%, var(--surface));
}

.theme-segmented--settings {
  max-width: 26rem;
}

.theme-segment {
  margin: 0;
  padding: 0.45rem 0.35rem;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.theme-segment:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.theme-segment.is-active,
.theme-segment[aria-pressed="true"] {
  color: var(--secondary-text, var(--text));
  background: var(--accent);
  box-shadow: 0 1px 4px color-mix(in srgb, var(--accent) 35%, transparent);
}

html[data-theme="hippie"] .theme-segment.is-active,
html[data-theme="hippie"] .theme-segment[aria-pressed="true"] {
  color: #fff8ed;
}

html[data-theme="neon"] .theme-segment {
  font-size: 0.72rem;
}

.account-toggle-row {
  justify-content: space-between;
  cursor: pointer;
}

.account-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.account-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.account-switch-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.account-switch-track {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #c8c8c8;
  transition: background-color 0.2s ease;
}

.account-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}

.account-switch-input:checked + .account-switch-track {
  background: var(--accent);
}

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

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

/* Account role in header (replaces inactive PRIVATE badge) */
.header-role-badge {
  flex: 0 0 auto;
  width: fit-content;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}

.header-role-badge.is-host {
  color: var(--accent);
  border-color: rgba(244, 115, 33, 0.45);
  background: var(--secondary-bg);
}

.header-role-badge.is-admin {
  color: #fff;
  border-color: rgba(244, 115, 33, 0.55);
  background: linear-gradient(135deg, #f47321 0%, #c85a12 100%);
}

.header-role-badge.is-guest {
  color: #9d8cff;
  border-color: rgba(157, 140, 255, 0.4);
  background: rgba(157, 140, 255, 0.1);
}

html[data-theme="cb-light"] .header-role-badge.is-guest {
  color: #5b4fd6;
  background: rgba(91, 79, 214, 0.1);
}

.header-role-badge.is-visitor {
  color: var(--muted);
}

.header-role-badge.is-member {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface);
}

.header-role-badge.is-test {
  color: var(--partner);
  border-color: color-mix(in srgb, var(--partner) 50%, var(--border));
  background: color-mix(in srgb, var(--partner) 12%, transparent);
}

.header-role-badge.is-expired {
  color: #e67e22;
  border-color: rgba(230, 126, 34, 0.5);
  background: rgba(230, 126, 34, 0.12);
}

.header-role-badge.is-premium-partner,
.header-role-badge.is-premium {
  color: #ffba3a;
  border-color: rgba(255, 186, 58, 0.55);
  background: rgba(255, 186, 58, 0.14);
  box-shadow: 0 0 12px rgba(255, 186, 58, 0.15);
}

.header-role-badge.is-partner {
  color: var(--partner);
  border-color: color-mix(in srgb, var(--partner) 45%, var(--border));
  background: color-mix(in srgb, var(--partner) 10%, transparent);
}

.account-role.is-member {
  color: var(--text);
  font-weight: 600;
}

.account-role.is-test {
  color: var(--partner);
  font-weight: 700;
}

.account-role.is-expired {
  color: #e67e22;
  font-weight: 700;
}

.account-role.is-premium-partner,
.account-role.is-premium {
  color: #ffba3a;
  font-weight: 700;
}

.account-role.is-partner {
  color: var(--partner);
  font-weight: 700;
}

.premium-glow-btn {
  border: 1px solid rgba(255, 186, 58, 0.75);
  border-radius: 999px;
  padding: 0.32rem 0.72rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #fff6d5;
  background: radial-gradient(circle at 20% 20%, #ffd36a 0%, #f08f1a 55%, #b95506 100%);
  animation: privat-glow 2.4s ease-in-out infinite;
}

@keyframes privat-glow {
  0%,
  100% {
    box-shadow:
      0 0 10px rgba(124, 92, 255, 0.5),
      0 0 22px rgba(124, 92, 255, 0.25),
      inset 0 0 10px rgba(255, 255, 255, 0.06);
    transform: scale(1);
    border-color: rgba(180, 140, 255, 0.45);
  }
  50% {
    box-shadow:
      0 0 20px rgba(124, 92, 255, 0.95),
      0 0 42px rgba(255, 107, 53, 0.35),
      inset 0 0 16px rgba(255, 200, 255, 0.12);
    transform: scale(1.04);
    border-color: rgba(255, 180, 220, 0.75);
  }
}

button.logout-link {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--danger);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

button.logout-link:hover {
  color: #ff7a94;
}

button.logout-link:focus-visible {
  outline: 2px solid var(--danger);
  outline-offset: 2px;
}

body.login-locked {
  overflow: hidden;
}

body.login-locked > header,
body.login-locked > main,
body.login-locked > footer {
  visibility: hidden;
}

body.subscription-paywall {
  overflow: auto;
}

body.subscription-paywall > header {
  visibility: visible;
  position: relative;
  z-index: 10001;
}

body.subscription-paywall > main,
body.subscription-paywall > footer {
  visibility: hidden;
}

body.subscription-paywall.has-auth-modal-open {
  overflow: auto;
}

body.subscription-paywall .account-menu.is-open .account-dropdown {
  z-index: 10002;
}

body.subscription-paywall #subscriptionOverlay,
#subscriptionOverlay:not([hidden]) {
  pointer-events: none;
}

#subscriptionOverlay .subscription-overlay-card,
#subscriptionOverlay .login-overlay-card {
  pointer-events: auto;
}

/* Vollbild-Login über die gesamte Seite */
.login-overlay {
  position: fixed;
  inset: 0;
  /* Above header/account menu (10050–10052) so admin & auth modals stay usable */
  z-index: 10060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(16px);
}

.login-overlay[hidden] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

body.has-auth-modal-open {
  overflow: hidden;
}

.login-overlay-card {
  width: 100%;
  max-width: 22rem;
  padding: 1.35rem 1.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(124, 92, 255, 0.12);
}

.login-overlay-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.login-overlay-hint {
  margin: 0 0 1rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.login-overlay-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.auth-models {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  margin-bottom: 0.8rem;
}

.field-optional {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.85em;
}

.invite-share-result {
  margin-top: 0.65rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 6%, var(--bg));
  font-size: 0.82rem;
  line-height: 1.45;
}

.invite-share-result strong {
  display: block;
  margin-bottom: 0.35rem;
}

.invite-share-link {
  word-break: break-all;
  color: var(--accent);
}

.invite-share-code {
  font-size: 1.1rem;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--accent);
}

.invite-share-example {
  margin-top: 0.55rem;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  background: var(--bg);
  border: 1px dashed var(--border);
  white-space: pre-wrap;
  font-size: 0.78rem;
  color: var(--muted);
}

.invite-copy-btn {
  margin-top: 0.45rem;
}

.auth-model-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.5rem;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: left;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

button.auth-model-card {
  appearance: none;
}

.auth-model-card:hover,
.auth-model-card:focus-visible {
  border-color: rgba(244, 115, 33, 0.55);
  box-shadow: 0 0 0 2px rgba(244, 115, 33, 0.16);
  outline: none;
}

.auth-model-card strong {
  font-size: 0.72rem;
}

.auth-model-card span {
  font-size: 0.68rem;
  color: var(--muted);
  line-height: 1.3;
}

.login-overlay-row label {
  min-width: 4.5rem;
}

.password-input-wrap {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  width: 100%;
}

.password-input-wrap input {
  flex: 1;
  min-width: 0;
}

.password-toggle-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.password-toggle-btn:hover,
.password-toggle-btn:focus-visible {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  outline: none;
}

.password-toggle-btn[aria-pressed="true"] {
  color: var(--accent);
}

.profile-form .password-input-wrap,
.settings-mail-form .password-input-wrap {
  margin-top: 0.15rem;
}

.login-overlay-row .password-input-wrap {
  flex: 1;
  min-width: 140px;
}

.login-overlay-row input[type="password"],
.login-overlay-row input[type="text"],
.login-overlay-row .password-input-wrap input {
  flex: 1;
  min-width: 140px;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
}

.login-overlay-error {
  font-size: 0.78rem;
  color: var(--danger);
  margin: 0 0 0.75rem;
}

.login-overlay-card .primary {
  width: 100%;
}

.auth-forgot-row {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  text-align: right;
}

.login-overlay-row input[type="text"],
.login-overlay-row input[type="email"] {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
}

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.auth-page-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 3rem;
  max-width: 28rem;
  margin: 0 auto;
  width: 100%;
}

.auth-page-main-wide {
  max-width: 36rem;
}

.login-overlay-card.auth-card-wide {
  max-width: 32rem;
  width: 100%;
  max-height: min(90vh, 720px);
  overflow-y: auto;
}

.setup-flow-hint {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.45;
}

.setup-flow-hint-member {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.profile-welcome-banner {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(249, 115, 22, 0.35);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.12), rgba(124, 92, 255, 0.08));
  transition: opacity 0.32s ease, transform 0.32s ease, max-height 0.35s ease;
  overflow: hidden;
}

.profile-welcome-banner.is-hiding {
  opacity: 0;
  transform: translateY(-4px);
}

.profile-welcome-banner-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
}

.profile-welcome-manual {
  margin: 0.5rem 0 0 !important;
}

.profile-welcome-manual-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.profile-welcome-manual-link:hover {
  text-decoration: underline;
}

.welcome-card h1 {
  margin-bottom: 0.35rem;
}

.welcome-lead {
  margin-bottom: 0.75rem;
}

.welcome-manual-link {
  margin-bottom: 1.25rem;
}

.welcome-manual-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.welcome-manual-btn:hover {
  border-color: var(--accent);
}

.welcome-actions {
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.welcome-stream-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-decoration: none;
  font-weight: 600;
  color: var(--text);
}

.manual-card {
  max-width: 40rem;
  text-align: left;
}

.manual-section-highlight {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  background: color-mix(in srgb, var(--accent) 6%, var(--bg));
}

.manual-section {
  margin: 1.25rem 0;
}

.manual-section h2 {
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
}

.manual-section h3.manual-subheading {
  font-size: 0.88rem;
  margin: 0.85rem 0 0.35rem;
  font-weight: 600;
  color: var(--text);
}

.manual-section ol,
.manual-section ul {
  margin: 0;
  padding-left: 1.2rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}

.manual-section li + li {
  margin-top: 0.35rem;
}

.manual-intro {
  margin-bottom: 0.5rem;
}

.manual-footer {
  margin-top: 1.5rem;
}

.community-hub-grid {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.25rem;
}

@media (min-width: 520px) {
  .community-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.community-hub-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
  color: inherit;
  text-decoration: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

.community-hub-card:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: 0 4px 18px color-mix(in srgb, var(--accent) 12%, transparent);
  transform: translateY(-1px);
}

.community-hub-card h2 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text);
}

.community-hub-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
  flex: 1;
}

.community-hub-card-link {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}

.manual-table {
  width: 100%;
  margin: 0.75rem 0 0.25rem;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.manual-table th,
.manual-table td {
  padding: 0.45rem 0.65rem;
  text-align: left;
  border: 1px solid var(--border);
}

.manual-table th {
  color: var(--muted);
  font-weight: 600;
}

.auth-logo {
  margin-bottom: 1.25rem;
}

.auth-logo img {
  height: 2.5rem;
  width: auto;
}

.auth-card h1 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
}

.auth-success-panel {
  margin-top: 1rem;
}

.auth-resend-panel {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.profile-field-hint {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Fixed gap before submit — margin alone can collapse with hidden error line */
#registerForm .register-submit-gap {
  height: 1.25rem;
  margin: 0;
  padding: 0;
  border: 0;
  flex: none;
}

#registerForm > button.primary[type="submit"] {
  margin-top: 0;
}

.profile-mail-field {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.profile-mail-field legend {
  font-weight: 600;
  padding: 0 0.25rem;
}

.profile-mail-port-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}

.profile-mail-port-row input[type="number"] {
  max-width: 6rem;
}

.profile-mail-secure-check {
  margin: 0 0 0.35rem;
}

.profile-mail-incoming {
  margin: 0.75rem 0;
  font-size: 0.88rem;
}

.profile-mail-incoming summary {
  cursor: pointer;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.profile-mail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

main {
  flex: 1;
  padding: 0.5rem 0.75rem 1rem;
  max-width: none;
  margin: 0 auto;
  width: 100%;
}

.stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0;
  position: relative;
  isolation: isolate;
  min-height: 0;
}

.stage-shell {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0;
  align-self: start;
  width: 100%;
}

.stage-toolbar {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  justify-content: flex-end;
  align-items: center;
  flex: 0 0 auto;
  min-height: 2.35rem;
  padding: 0.35rem 0.5rem;
  margin: 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.stage-view-controls {
  position: static;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: auto;
  padding: 0.2rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  pointer-events: auto;
  touch-action: manipulation;
}

.stage > .stage-chrome {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
  position: absolute;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}

.stage[data-layout="pip-remote"] > .panel-host .video-media-overlay {
  z-index: 3;
}

body.main-fullscreen-active .stage-toolbar {
  display: none;
}

@media (max-width: 900px) {
  .stage[data-layout="split"] {
    grid-template-columns: 1fr;
  }
}

/* Equal: compact — panels shrink-wrap to video size */
.stage[data-layout="split"] {
  height: fit-content;
  min-height: 0;
  align-items: start;
}

.stage[data-layout="split"] .panel {
  align-self: start;
  width: 100%;
  height: fit-content;
  min-height: 0;
}

.stage[data-layout="split"] .video-wrap {
  width: 100%;
  height: auto;
  flex: 0 0 auto;
}

main.layout-cb > .layout-row-resize-handle[hidden] {
  display: none !important;
  height: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
}

/* Partner large: user-resizable stage height */
.stage[data-layout="pip-remote"],
.stage[data-layout="pip-local"],
.stage[data-layout="theater"] {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
  gap: 0;
  position: relative;
  min-height: var(--cb-stage-height, clamp(360px, 68vh, 85vh));
  flex: 1 1 auto;
}

.stage[data-layout="pip-remote"] > .panel,
.stage[data-layout="pip-local"] > .panel,
.stage[data-layout="theater"] > .panel {
  grid-area: 1 / 1;
}

.stage[data-layout="theater"] > .panel-host {
  display: none;
}

.stage[data-layout="pip-remote"] > .panel:last-child,
.stage[data-layout="pip-local"] > .panel:first-child,
.stage[data-layout="theater"] > .panel-guest {
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.stage[data-layout="theater"] > .panel-guest {
  width: 100%;
  height: 100%;
  margin: 0;
  box-shadow: none;
}

.stage[data-layout="pip-remote"] > .panel:last-child .video-wrap,
.stage[data-layout="pip-local"] > .panel:first-child .video-wrap,
.stage[data-layout="theater"] > .panel-guest .video-wrap {
  flex: 1;
  min-height: 0;
  aspect-ratio: auto;
  height: 100%;
  pointer-events: none;
}

.stage[data-layout="pip-remote"] > .panel:last-child .video-media-overlay,
.stage[data-layout="pip-local"] > .panel:first-child .video-media-overlay,
.stage[data-layout="theater"] > .panel-guest .video-media-overlay {
  pointer-events: auto;
}

.stage[data-layout="pip-remote"] > .panel:first-child,
.stage[data-layout="pip-local"] > .panel:last-child {
  width: min(28vw, 260px);
  max-width: calc(100% - 16px);
  z-index: 2;
  margin: 8px;
  height: fit-content;
  align-self: end;
  justify-self: end;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.65);
  border-radius: var(--radius);
  pointer-events: auto;
}

.stage[data-layout="pip-remote"] > .panel:first-child .panel-head,
.stage[data-layout="pip-local"] > .panel:last-child .panel-head {
  padding: 0.4rem 0.65rem;
  font-size: 0.68rem;
}

.stage[data-layout="pip-remote"] > .panel:first-child .video-wrap,
.stage[data-layout="pip-local"] > .panel:last-child .video-wrap {
  aspect-ratio: 16 / 10;
}

.stage[data-layout="pip-remote"][data-pip-corner="br"] > .panel:first-child,
.stage[data-layout="pip-local"][data-pip-corner="br"] > .panel:last-child {
  align-self: end;
  justify-self: end;
}

.stage[data-layout="pip-remote"][data-pip-corner="bl"] > .panel:first-child,
.stage[data-layout="pip-local"][data-pip-corner="bl"] > .panel:last-child {
  align-self: end;
  justify-self: start;
}

.stage[data-layout="pip-remote"][data-pip-corner="tr"] > .panel:first-child,
.stage[data-layout="pip-local"][data-pip-corner="tr"] > .panel:last-child {
  align-self: start;
  justify-self: end;
}

.stage[data-layout="pip-remote"][data-pip-corner="tl"] > .panel:first-child,
.stage[data-layout="pip-local"][data-pip-corner="tl"] > .panel:last-child {
  align-self: start;
  justify-self: start;
}

.stage[data-layout="split"] .video-wrap {
  pointer-events: none;
}

.stage[data-layout="split"] .video-media-overlay {
  pointer-events: auto;
}

.stage-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1rem;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}

.stage-view-btn:hover,
.stage-view-btn:focus-visible {
  color: var(--accent);
  background: rgba(244, 115, 33, 0.2);
  outline: none;
}

.stage-view-btn.active {
  color: #fff;
  background: var(--accent);
}

.stage-chat-toggle {
  position: absolute;
  right: 0.5rem;
  bottom: 3rem;
  z-index: 2;
  display: none;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.05rem;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}

.stage-chat-toggle.is-active {
  color: var(--accent);
}

.stage-chat-toggle:hover {
  background: rgba(244, 115, 33, 0.35);
}

.layout-row-resize-handle {
  grid-column: 1 / -1;
  grid-row: 2;
  height: 6px;
  margin: -3px 0;
  cursor: row-resize;
  touch-action: none;
  position: relative;
  z-index: 6;
}

.layout-row-resize-handle::before {
  content: "";
  position: absolute;
  left: 15%;
  right: 15%;
  top: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--border);
  opacity: 0.7;
}

.layout-row-resize-handle:hover::before,
.layout-row-resize-handle.is-dragging::before,
.layout-row-resize-handle:focus-visible::before {
  background: var(--accent);
  opacity: 1;
}

body.layout-resize-active-row {
  cursor: row-resize !important;
  user-select: none !important;
}

body.layout-resize-active-row * {
  cursor: row-resize !important;
}

.layout-toolbar {
  display: none !important;
}

.pip-native-msg:empty {
  display: none;
}

.layout-toolbar-label {
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.65rem;
}

.layout-toolbar-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

button.layout-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.78rem;
}

button.layout-btn.active {
  border-color: var(--partner);
  background: var(--secondary-bg);
  color: var(--secondary-text);
}

html[data-theme="cb-dark"] button.layout-btn.active,
html[data-theme="cb-light"] button.layout-btn.active {
  border-color: var(--accent);
  background: rgba(244, 115, 33, 0.14);
  color: var(--text);
}

.pip-corner-select {
  font: inherit;
  font-size: 0.8rem;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.pip-corner-select:focus {
  outline: 2px solid rgba(124, 92, 255, 0.35);
  border-color: var(--partner);
}

.media-source-row {
  align-items: center;
}

.media-source-select {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 0.82rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.media-source-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.media-source-select:focus {
  outline: 2px solid rgba(124, 92, 255, 0.35);
  border-color: var(--partner);
}

.media-source-hint {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.whip-panel {
  margin: 0 0 0.65rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.whip-field {
  margin-bottom: 0.5rem;
}

.whip-field .peer-id-box {
  margin-top: 0.25rem;
  font-size: 0.72rem;
  word-break: break-all;
}

.whip-copy-row {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  margin-top: 0.25rem;
}

.whip-copy-row .whip-copy-value {
  flex: 1;
  margin-top: 0;
  min-width: 0;
}

.whip-copy-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.whip-copy-btn:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--accent);
}

.whip-copy-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.whip-copy-feedback {
  flex-shrink: 0;
  align-self: center;
  font-size: 0.68rem;
  color: var(--ok, #3dd68c);
  white-space: nowrap;
}

.layout-toolbar > button#btnPipNativeRemote,
.layout-toolbar > button#btnPipNativeLocal {
  font-size: 0.76rem;
}

.pip-native-msg {
  flex: 1 1 140px;
  min-width: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.panel-head .tag {
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
}

.panel-head .tag.you {
  background: rgba(255, 107, 53, 0.2);
  color: var(--accent);
}

.panel-head .tag.partner {
  background: rgba(124, 92, 255, 0.2);
  color: #b8a8ff;
}

html[data-theme="cb-dark"] .panel-head .tag.partner,
html[data-theme="cb-light"] .panel-head .tag.partner {
  background: rgba(255, 69, 0, 0.18);
  color: var(--accent);
}

.video-wrap {
  position: relative;
  width: 100%;
  background: var(--video-empty-bg);
  border-radius: var(--video-radius);
  overflow: hidden;
}

/* In-flow spacer — reliable 16:10 box when all children are absolute */
.video-wrap::before {
  content: "";
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
}

.stage[data-layout="pip-remote"] > .panel:last-child .video-wrap::before,
.stage[data-layout="pip-local"] > .panel:first-child .video-wrap::before,
.stage[data-layout="theater"] > .panel-guest .video-wrap::before {
  display: none;
}

.video-wrap > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--video-empty-bg);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem;
  z-index: 3;
  pointer-events: none;
}

.video-placeholder.is-visible {
  display: flex;
}

/* Hide placeholder as soon as the panel has a live feed (set from app.js) */
.video-wrap[data-has-feed="true"] .video-placeholder {
  display: none !important;
  visibility: hidden;
}

.video-wrap[data-obs-source="true"] > video {
  object-fit: contain;
  background: #000;
}

/* Compact corner controls (player-style), theme-aligned */
.video-media-overlay {
  position: absolute;
  left: auto;
  right: 0.55rem;
  bottom: 0.55rem;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.18s ease,
    visibility 0.18s ease;
}

.video-media-overlay.is-ready {
  opacity: 0.9;
  visibility: visible;
}

.video-media-overlay[hidden] {
  display: none !important;
}

.video-wrap:hover .video-media-overlay.is-ready,
.video-media-overlay.is-ready:focus-within {
  opacity: 1;
}

.video-ctrl-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font);
  color: rgba(242, 242, 245, 0.92);
  background: transparent;
  pointer-events: auto;
  transition:
    color 0.15s ease,
    background 0.15s ease;
}

.video-ctrl-btn:hover:not(:disabled),
.video-ctrl-btn:focus-visible:not(:disabled) {
  color: var(--accent);
  background: rgba(244, 115, 33, 0.18);
  outline: none;
}

.video-ctrl-btn:focus-visible:not(:disabled) {
  box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.45);
}

.video-ctrl-btn:disabled {
  opacity: 0.28;
  cursor: not-allowed;
  pointer-events: none;
}

.video-ctrl-btn.is-off {
  color: var(--accent);
}

.video-ctrl-audio-group {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  pointer-events: auto;
}

.video-volume-slider {
  width: 4.75rem;
  height: 0.3rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  accent-color: var(--accent);
  cursor: pointer;
  pointer-events: auto;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.85));
}

.video-volume-slider:disabled {
  opacity: 0.28;
  cursor: not-allowed;
  pointer-events: none;
}

.video-volume-slider:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.45);
}

.video-ctrl-icon {
  font-size: 1.2rem;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.85));
}

.video-ctrl-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 0.4rem);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.35rem 0.55rem;
  border-radius: 6px;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 6;
}

.video-ctrl-btn:hover::after,
.video-ctrl-btn:focus-visible::after {
  opacity: 1;
}

.toy-pulse {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(255, 107, 53, 0.45) 0%,
    transparent 55%
  );
  transition: opacity 0.15s ease;
}

.toy-pulse.active {
  opacity: 1;
  animation: pulse 0.35s ease-out infinite alternate;
}

@keyframes pulse {
  from {
    transform: scale(0.96);
    opacity: 0.35;
  }
  to {
    transform: scale(1.02);
    opacity: 0.85;
  }
}

.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
}

.card h2 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.panel-tabs-card {
  padding-top: 0.75rem;
}

.panel-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
  padding: 0.35rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--border) 28%, var(--bg));
}

.panel-tab {
  appearance: none;
  flex: 1;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.panel-tab:hover:not(.is-active) {
  color: var(--text);
  background: var(--secondary-bg);
  border-color: var(--secondary-border);
}

.panel-tab.is-active {
  color: #ffffff;
  border-color: var(--accent-dim);
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-dim) 100%);
  box-shadow:
    0 2px 8px color-mix(in srgb, var(--accent) 45%, transparent),
    inset 0 1px 0 color-mix(in srgb, #ffffff 22%, transparent);
}

.panel-tab.is-active:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 65%, #ffffff);
  outline-offset: 2px;
}

.panel-tab-panel:not([hidden]) {
  padding-top: 0.15rem;
  border-top: 2px solid var(--accent);
  margin-top: -0.1rem;
  overflow: visible;
}

.panel-tab-title {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
}

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

.stream-tab-hint,
.profile-tab-hint {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 0.65rem;
}

.stream-tab-actions {
  margin-bottom: 0.75rem;
}

.account-profile-mini {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}

.profile-form textarea {
  width: 100%;
  min-height: 4.5rem;
  resize: vertical;
  font: inherit;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.profile-playbook-prefs-hint {
  margin: 0 0 0.65rem;
}

.profile-prefs-field {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  margin: 0 0 0.75rem;
}

.profile-prefs-field legend {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0 0.25rem;
}

.profile-prefs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.35rem 0.65rem;
}

.profile-preset-section {
  margin-bottom: 0.5rem;
}

.profile-preset-section-title {
  margin: 0.35rem 0 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-techniques-field {
  border: none;
  margin: 0 0 0.75rem;
  padding: 0;
}

.profile-techniques-field legend {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.profile-technique-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.profile-technique-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 1rem;
}

@media (max-width: 520px) {
  .profile-technique-grid {
    grid-template-columns: 1fr;
  }
}

.technique-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.technique-check-custom {
  flex-wrap: wrap;
  padding: 0.35rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
}

.technique-check-custom:last-child {
  border-bottom: none;
}

.technique-remove-btn {
  margin-left: auto;
  font: inherit;
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.technique-remove-btn:hover {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 50%, var(--border));
}

.profile-preset-heading,
.profile-custom-heading {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0.65rem 0 0.35rem;
}

.profile-custom-menus-editor {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.35rem;
}

.profile-custom-menu-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  background: color-mix(in srgb, var(--surface) 92%, var(--accent) 8%);
}

.profile-custom-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.profile-custom-menu-head strong {
  font-size: 0.85rem;
}

.profile-custom-menu-items {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.45rem;
}

.profile-custom-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
  padding: 0.2rem 0;
}

.profile-custom-menu-add {
  margin-top: 0.15rem;
}

.profile-technique-add {
  margin-top: 0.5rem;
  margin-bottom: 0.35rem;
}

.profile-technique-add input {
  flex: 1;
  min-width: 8rem;
  font: inherit;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.remote-card.panel-tabs-card {
  padding-top: 0.75rem;
}

.remote-card .panel-tab-panel:not([hidden]) {
  border-top: 2px solid var(--accent);
}

.play-mode-sound-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
}

.play-mode-sound-label {
  color: var(--muted);
  font-weight: 600;
}

.play-mode-sound-select {
  flex: 1 1 8rem;
  min-width: 7rem;
  max-width: 14rem;
  font: inherit;
  font-size: 0.78rem;
  padding: 0.28rem 0.4rem;
  border-radius: 0.25rem;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.play-mode-sound-preview {
  font-size: 0.72rem;
  padding: 0.25rem 0.5rem;
}

.technique-request-list {
  margin-bottom: 0.85rem;
}

.technique-request-section {
  margin-bottom: 0.65rem;
}

.technique-request-section:last-child {
  margin-bottom: 0;
}

.technique-request-section-title {
  margin: 0.35rem 0 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.technique-request-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.technique-request-btn {
  font: inherit;
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  color: var(--text);
  cursor: pointer;
}

.technique-request-btn:hover {
  background: color-mix(in srgb, var(--accent) 28%, var(--surface));
}

.technique-empty-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0;
}

.remote-toys-heading {
  margin-top: 0.25rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.chat-message--technique {
  border-left: none;
  background: transparent;
}

.chat-message--technique .chat-sender {
  font-style: italic;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.65rem;
}

.row:last-child {
  margin-bottom: 0;
}

.chat-card {
  display: flex;
  flex-direction: column;
  min-height: 340px;
  height: 340px;
  background: var(--surface);
}

html[data-theme="cb-dark"] .chat-card {
  background: var(--chat-panel-bg, var(--surface));
}

.chat-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.chat-card-head-titles {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.chat-card-head h2 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chat-card-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.chat-clear-btn {
  flex-shrink: 0;
  font-size: 0.78rem;
  padding: 0.28rem 0.55rem;
}

.chat-clear-status {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
}

.chat-overlay-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.chat-overlay-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.chat-messages {
  flex: 1;
  height: 250px;
  min-height: 250px;
  overflow-y: auto;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  font-size: var(--chat-font-size, 13px);
  line-height: 1.35;
}

html[data-theme="cb-dark"] .chat-messages {
  background: var(--chat-panel-bg, var(--bg));
}

.chat-message {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid var(--chat-remote-border, var(--border));
  background: var(--chat-remote-bg, transparent);
}

.chat-message.local {
  background: var(--chat-local-bg, transparent);
  border-color: var(--chat-local-border, var(--border));
}

.chat-message--compact {
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 0;
}

.chat-line {
  display: inline;
  word-break: break-word;
  white-space: normal;
}

.chat-sender {
  font-weight: 700;
  margin-right: 0.35rem;
}

.chat-message.local .chat-sender,
.chat-message.chat-message--local .chat-sender {
  color: var(--chat-local-name-color, var(--accent));
}

.chat-message.local .chat-text,
.chat-message.chat-message--local .chat-text {
  color: var(--chat-local-text-color, var(--text));
}

.chat-message.remote .chat-sender,
.chat-message.chat-message--remote .chat-sender {
  color: var(--chat-remote-name-color, #fb923c);
}

.chat-message.remote .chat-text,
.chat-message.chat-message--remote .chat-text {
  color: var(--chat-remote-text-color, var(--text));
}

.chat-message--system .chat-line {
  display: block;
  opacity: 0.92;
  border-left: 2px solid var(--accent);
  padding-left: 0.4rem;
}

.chat-message--system .chat-text {
  color: var(--muted);
  white-space: pre-wrap;
}

.chat-message--technique .chat-text {
  font-weight: 600;
}

.chat-message--technique.local .chat-text,
.chat-message--technique.chat-message--local .chat-text {
  color: var(--chat-local-text-color, var(--text));
}

.chat-message--technique.remote .chat-text,
.chat-message--technique.chat-message--remote .chat-text {
  color: var(--chat-remote-text-color, var(--text));
}

.chat-meta {
  font-size: 0.68rem;
  color: var(--muted);
}

.chat-text {
  font-size: inherit;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-settings {
  flex: 0 0 auto;
  margin-top: 0.45rem;
  border-top: 1px solid var(--border);
  padding-top: 0.35rem;
  font-size: 0.78rem;
}

.chat-settings summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  user-select: none;
  list-style: none;
}

.chat-settings summary::-webkit-details-marker {
  display: none;
}

.chat-settings summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 0.15s ease;
}

.chat-settings[open] summary::before {
  transform: rotate(90deg);
}

.chat-settings-body {
  margin-top: 0.45rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.chat-settings-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: flex-end;
}

.chat-settings-group {
  flex: 1 1 9rem;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.45rem 0.45rem;
  margin: 0;
}

.chat-settings-group legend {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0 0.2rem;
}

.chat-settings-color {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  font-size: 0.72rem;
  margin-top: 0.25rem;
}

.chat-settings-color input[type="color"] {
  width: 2rem;
  height: 1.35rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.chat-settings-size-row {
  align-items: center;
}

.chat-settings-size {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1;
  font-size: 0.72rem;
}

.chat-settings-size input[type="range"] {
  flex: 1;
  min-width: 5rem;
}

.chat-settings-group.is-locked {
  opacity: 0.72;
}

.chat-settings-group.is-locked input[type="color"] {
  pointer-events: none;
}

.chat-settings-reset {
  font-size: 0.72rem;
  padding: 0.25rem 0.5rem;
}

.chat-input-row {
  flex: 0 0 auto;
  margin-top: 0.65rem;
  align-items: stretch;
}

.chat-emoji-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.55rem;
}

.chat-emoji-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 999px;
  padding: 0.2rem 0.45rem;
  font-size: 0.92rem;
  line-height: 1.1;
  cursor: pointer;
}

.chat-emoji-btn:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--bg));
}

.toy-control-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.controls-span-all {
  grid-column: 1 / -1;
}

.local-test-card {
  margin-top: 0;
}

.local-toy-test-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
}

.toy-block-head {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.toy-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}

.toy-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
}

.toy-status-chip.is-connected {
  border-color: rgba(76, 175, 120, 0.45);
  color: #8fd4a8;
}

.toy-status-chip.is-on {
  border-color: rgba(255, 107, 53, 0.65);
  color: #ffb089;
  background: rgba(255, 107, 53, 0.12);
  box-shadow: 0 0 10px rgba(255, 107, 53, 0.25);
}

.toy-battery {
  font-size: 0.72rem;
  color: var(--muted);
}

.toy-activity-line {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.35;
  min-height: 1.1em;
}

.toy-block.is-active {
  border-color: rgba(255, 107, 53, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 107, 53, 0.15);
}

.toy-empty-note {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.55rem 0.65rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.toy-block {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 10px;
  padding: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.toy-block-title {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
}

.toy-preset-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
}

.toy-preset-btn {
  padding: 0.38rem 0.2rem;
  font-size: 0.72rem;
  border: 1px solid var(--border);
  background: rgba(124, 92, 255, 0.16);
}

.toy-preset-btn.active {
  background: linear-gradient(135deg, #ff6b35 0%, #c44f28 100%);
  color: #fff;
  border-color: rgba(255, 128, 82, 0.9);
  box-shadow: 0 0 14px rgba(255, 107, 53, 0.35);
}

.toy-slider-row {
  display: flex;
  align-items: center;
}

.toy-slider {
  width: 100%;
  min-height: 28px;
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
  accent-color: #ff6b35;
  -webkit-appearance: none;
  appearance: auto;
}

.toy-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ff6b35;
  border: 2px solid #fff;
  cursor: grab;
}

.toy-block input.toy-slider {
  position: relative;
  z-index: 2;
}

.toy-special-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
}

.toy-special-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 120px;
  font-size: 0.76rem;
  color: var(--muted);
}

#chat-input {
  min-width: 0;
}

#chat-send {
  flex-shrink: 0;
}

label {
  font-size: 0.8rem;
  color: var(--muted);
  min-width: 5rem;
}

input[type="text"],
input[type="number"] {
  flex: 1;
  min-width: 120px;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
}

input:focus {
  outline: 2px solid rgba(124, 92, 255, 0.35);
  border-color: var(--partner);
}

button {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: var(--border);
  color: var(--text);
}

button.primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  color: #fff;
}

button.secondary {
  background: var(--secondary-bg);
  color: var(--secondary-text);
  border: 1px solid var(--secondary-border);
}

button.btn-danger {
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: #fff;
  border: 1px solid rgba(231, 76, 60, 0.85);
  box-shadow: 0 0 12px rgba(231, 76, 60, 0.35);
}

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

.peer-id-box {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  word-break: break-all;
  padding: 0.5rem;
  background: var(--bg);
  border-radius: 8px;
  border: 1px dashed var(--border);
  color: var(--success);
  margin-top: 0.5rem;
}

.status-line {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

.status-line.ok {
  color: var(--success);
}

.status-line.err {
  color: var(--danger);
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

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

.preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.preset-grid button {
  background: var(--bg);
  border: 1px solid var(--border);
}

footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
}

.site-footer {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.site-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.site-footer-links a[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
  text-decoration: none;
}

.site-footer-copyright {
  margin: 0;
  font-size: 0.72rem;
  color: var(--muted);
}

.site-footer-note {
  margin: 0;
}

.footer-admin-link {
  font-size: 0.75rem;
}

.admin-users-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin: 0.65rem 0 0.35rem;
}

.admin-users-search-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-users-search {
  flex: 1 1 12rem;
  min-width: 0;
  max-width: 22rem;
}

.admin-users-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
}

.admin-users-pager-label {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.admin-users-table-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: auto;
  max-height: 50vh;
  margin: 0.5rem 0 0.75rem;
}

#adminUsersModal .auth-card-wide {
  max-width: min(96vw, 1100px);
}

.admin-users-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1420px;
}

.admin-users-table th,
.admin-users-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 0.45rem;
  text-align: left;
  font-size: 0.78rem;
  vertical-align: middle;
}

.admin-actions-cell {
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  width: 1%;
}

#adminUsersModal .admin-actions-cell .primary,
#adminUsersModal .admin-actions-cell .secondary,
#adminUsersModal .admin-actions-cell .admin-delete-btn {
  width: auto !important;
  flex: 0 0 auto;
  margin-left: 0;
}

.admin-billing-cell {
  width: 1%;
  white-space: nowrap;
}

.admin-billing-override {
  width: 6.5rem;
  max-width: 6.5rem;
  font-size: 0.68rem;
  padding: 0.22rem 0.3rem;
}

.admin-delete-btn {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border: 1px solid var(--danger);
  color: var(--danger);
  font-weight: 600;
  padding: 0.4rem 0.65rem;
  margin-left: 0.35rem;
}

.admin-delete-btn:hover {
  background: var(--danger);
  color: #fff;
}

.admin-save-btn {
  font-weight: 600;
  padding: 0.25rem 0.38rem;
  font-size: 0.72rem;
  min-width: 0;
  line-height: 1.2;
}

.admin-pool-btn {
  padding: 0.32rem 0.45rem;
  font-size: 0.76rem;
}

.admin-actions-cell .admin-delete-btn {
  padding: 0.32rem 0.45rem;
  font-size: 0.76rem;
  margin-left: 0.25rem;
}

.admin-status-cell {
  min-width: 7.5rem;
}

.admin-member-since-cell {
  min-width: 6.5rem;
  white-space: nowrap;
  font-size: 0.78rem;
  color: var(--muted);
}

.admin-billing-trial-cell,
.admin-billing-stripe-cell {
  min-width: 6.5rem;
  max-width: 9rem;
  white-space: nowrap;
  font-size: 0.78rem;
  color: var(--muted);
}

.admin-billing-stripe-cell {
  max-width: 10rem;
}

.admin-status-badge {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.admin-status-badge--host {
  background: color-mix(in srgb, #f97316 22%, transparent);
  color: #fdba74;
}

.admin-status-badge--model {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.admin-status-badge--member {
  background: color-mix(in srgb, var(--muted) 14%, transparent);
  color: var(--text);
  border: 1px solid var(--border);
}

.admin-status-badge--test {
  background: color-mix(in srgb, var(--partner) 12%, transparent);
  color: var(--partner);
  border: 1px solid color-mix(in srgb, var(--partner) 40%, var(--border));
}

.admin-status-badge--premium-partner,
.admin-status-badge--premium {
  background: color-mix(in srgb, #ffba3a 18%, transparent);
  color: #ffba3a;
  border: 1px solid color-mix(in srgb, #ffba3a 40%, var(--border));
}

.admin-status-badge--partner {
  background: color-mix(in srgb, var(--partner) 14%, transparent);
  color: var(--partner);
  border: 1px solid color-mix(in srgb, var(--partner) 35%, var(--border));
}

.admin-status-badge--admin {
  background: color-mix(in srgb, #f97316 22%, transparent);
  color: #fdba74;
  border: 1px solid color-mix(in srgb, #f97316 40%, var(--border));
}

.admin-status-badge--visitor {
  background: color-mix(in srgb, var(--muted) 12%, transparent);
  color: var(--muted);
  border: 1px solid var(--border);
}

.admin-status-badge--expired {
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
}

.admin-billing-cell--na {
  color: var(--muted);
  text-align: center;
}

.admin-status-badge--guest {
  background: color-mix(in srgb, #60a5fa 20%, transparent);
  color: #93c5fd;
}

.admin-status-select {
  min-width: 5.5rem;
  margin-top: 0.2rem;
  display: block;
}

.admin-flag-cell {
  text-align: center;
  width: 3.2rem;
}

.admin-flag-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  min-height: 2rem;
  cursor: pointer;
}

.admin-flag-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.admin-flag-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  font-size: 1.35rem;
  line-height: 1;
  font-weight: 400;
  color: var(--muted);
}

.admin-flag-mark::before {
  content: "–";
}

.admin-flag-input:checked + .admin-flag-mark {
  color: #f97316;
  font-weight: 900;
}

.admin-flag-input:checked + .admin-flag-mark::before {
  content: "✕";
}

.admin-flag-input:disabled + .admin-flag-mark {
  opacity: 1;
}

.profile-save-bar {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1rem;
  padding: 0.85rem 0 0.25rem;
  border-top: 1px solid var(--border);
  background: linear-gradient(to top, var(--panel) 78%, transparent);
}

.profile-save-bar .primary {
  min-width: 10rem;
  font-weight: 600;
}

.profile-save-status {
  margin: 0;
  flex: 1 1 12rem;
}

.setup-quick-guide {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 6%, var(--panel));
}

.setup-quick-guide-title {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.setup-quick-guide-intro {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}

.setup-quick-guide-steps {
  margin: 0 0 0.85rem;
  padding-left: 1.2rem;
  font-size: 0.82rem;
  line-height: 1.5;
}

.setup-quick-guide-steps li + li {
  margin-top: 0.55rem;
}

.setup-quick-guide-subtitle {
  margin: 0 0 0.35rem;
  font-size: 0.86rem;
  font-weight: 600;
}

.setup-quick-guide-optional {
  margin: 0 0 0.65rem;
  padding-left: 1.2rem;
  font-size: 0.82rem;
  line-height: 1.5;
}

.lovense-local-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 0.65rem;
}

.lovense-retry-btn {
  font-size: 0.76rem;
  padding: 0.3rem 0.65rem;
}

.toy-special-hint {
  flex-basis: 100%;
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--muted);
}

.setup-quick-guide-tip {
  margin: 0;
  padding: 0.55rem 0.65rem;
  font-size: 0.8rem;
  line-height: 1.45;
  border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-radius: 0 6px 6px 0;
}

.setup-quick-guide-tip a {
  font-weight: 600;
}

.tangent-about-box {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 6%, var(--panel));
}

.tangent-about-box--register {
  margin-bottom: 1rem;
}

.tangent-about-title {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.tangent-about-title:not(:first-child) {
  margin-top: 0.9rem;
}

.tangent-about-text {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  line-height: 1.5;
}

.peer-id-disclosure {
  margin: 0.5rem 0 0;
}

.peer-id-disclosure-summary {
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--muted);
  user-select: none;
}

.peer-id-disclosure[open] .peer-id-disclosure-summary {
  margin-bottom: 0.35rem;
}

.peer-id-disclosure .peer-id-box {
  margin-top: 0.25rem;
}

.floating-messages-panel {
  position: fixed;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  min-width: 280px;
  min-height: 320px;
  max-width: 96vw;
  max-height: 92vh;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.floating-messages-panel[hidden] {
  display: none !important;
}

.floating-messages-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
  border-bottom: 1px solid var(--border);
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.floating-messages-toolbar:active {
  cursor: grabbing;
}

.floating-messages-panel .header-chat-hint {
  margin: 0.4rem 0.55rem 0;
  font-size: 0.7rem;
}

.floating-messages-body {
  flex: 1 1 auto;
  min-height: 120px;
  max-height: none;
  margin: 0 0.55rem;
  overflow-y: auto;
}

.floating-messages-compose {
  flex-shrink: 0;
  margin: 0 0.55rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.floating-messages-input-row {
  margin: 0;
  flex-shrink: 0;
}

.floating-messages-panel .chat-emoji-bar-mount {
  min-height: 0;
}

.floating-messages-panel .chat-emoji-bar {
  margin: 0;
}

.floating-messages-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, var(--accent) 50%);
  border-bottom-right-radius: 10px;
  touch-action: none;
}

.profile-sessions-field,
.setup-sessions-field,
.setup-camera-field {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.profile-sessions-field legend,
.setup-sessions-field legend,
.setup-camera-field legend {
  font-weight: 600;
  padding: 0 0.35rem;
}

.setup-partner-session-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0.5rem 0 0;
}

.setup-partner-card-slot {
  flex: 1 1 12rem;
  max-width: 100%;
}

.setup-partner-instant-col {
  flex: 0 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  justify-content: center;
  min-width: 10rem;
}

.setup-instant-session-btn {
  white-space: nowrap;
}

.setup-partner-instant-status {
  margin: 0;
  font-size: 0.78rem;
}

.meeting-calendar-row {
  margin-bottom: 0.65rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--border);
}

.meeting-calendar-actions {
  margin-top: 0.35rem;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.header-chat-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.header-chat-close {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.header-chat-hint {
  font-size: 0.72rem;
  margin: 0 0 0.45rem;
}

.chat-messages--compact {
  max-height: 220px;
  min-height: 120px;
}

.chat-message--system {
  opacity: 0.92;
  border-left: 2px solid var(--accent);
  padding-left: 0.45rem;
}

.chat-message--system .chat-text {
  white-space: pre-wrap;
}

.chat-card-sub {
  display: block;
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--muted);
  margin-top: 0.15rem;
}

.chat-card-head {
  cursor: pointer;
}

.meeting-menu-wrap,
.meeting-menu-block {
  margin: 0.75rem 0 1rem;
  padding: 0.75rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  overflow: visible;
  position: relative;
}

.profile-sessions-field,
.setup-sessions-field {
  overflow: visible;
}

.meeting-guest-label {
  font-size: 0.78rem;
  color: var(--muted);
}

.meeting-schedule-label {
  font-size: 0.76rem;
  color: var(--muted);
  margin: 0;
}

.meeting-menu-row {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.meeting-menu-dropdown {
  position: relative;
  display: block;
  width: fit-content;
  z-index: 2;
}

.meeting-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  left: auto;
  z-index: 600;
  min-width: 300px;
  width: max-content;
  max-width: min(92vw, 360px);
  height: auto;
  max-height: none;
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  overflow: visible;
}

.meeting-menu-block.is-menu-open .js-meeting-menu-spacer {
  height: 9.75rem;
  flex-shrink: 0;
}

.js-meeting-menu-spacer {
  height: 0;
  transition: height 0.15s ease;
}

.meeting-menu[hidden] {
  display: none !important;
}

.meeting-menu button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: inherit;
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
}

.meeting-menu button:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.meeting-schedule-input {
  max-width: 20rem;
  width: 100%;
  position: relative;
  z-index: 1;
}

.js-meeting-status {
  position: relative;
  z-index: 0;
  min-height: 0;
}

.meeting-list {
  position: relative;
  z-index: 0;
}

.meeting-list-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  font-size: 0.78rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}

.meeting-list-item-body {
  flex: 1 1 auto;
  min-width: 0;
}

.meeting-list-when {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.meeting-list-meta {
  margin-top: 0.15rem;
  font-size: 0.76rem;
  color: var(--muted);
}

.meeting-list-item-actions {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.4rem;
}

.meeting-join-btn {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  white-space: nowrap;
}

.meeting-joined-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ok, #3d9a5c);
  white-space: nowrap;
}

.meeting-delete-btn {
  flex-shrink: 0;
  border: 1px solid var(--danger);
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, transparent);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
}

.meeting-delete-btn:hover {
  background: var(--danger);
  color: #fff;
}

.meeting-peer-id {
  font-size: 0.75rem;
  word-break: break-all;
}

.meeting-cal-link {
  font-size: 0.75rem;
}

.chat-empty-hint {
  font-size: 0.78rem;
  color: var(--muted);
  padding: 0.5rem;
}

.admin-create-row {
  display: grid;
  grid-template-columns: 1.2fr 1.6fr 1.2fr 0.9fr auto auto auto;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.7rem;
}

.admin-create-admin-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-width: auto;
  font-size: 0.76rem;
}

.admin-users-table th {
  background: var(--bg);
  color: var(--muted);
  position: sticky;
  top: 0;
  z-index: 1;
}

.admin-input {
  width: 100%;
  min-width: 130px;
}

.model-pool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}

.model-pool-entry {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.model-pool-entry.is-expanded {
  grid-column: 1 / -1;
}

.model-pool-detail {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 4%, var(--bg));
  padding: 0.75rem 0.85rem;
  text-align: left;
}

.model-pool-detail-title {
  margin: 0 0 0.55rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
}

.model-pool-detail-dl {
  display: grid;
  grid-template-columns: minmax(6.5rem, auto) 1fr;
  gap: 0.25rem 0.75rem;
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
}

.model-pool-detail-dl dt {
  margin: 0;
  color: var(--muted);
  font-weight: 600;
}

.model-pool-detail-dl dd {
  margin: 0;
  color: var(--text);
}

.model-pool-detail-bio {
  margin-bottom: 0.65rem;
  font-size: 0.8rem;
}

.model-pool-detail-bio strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.model-pool-detail-bio p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.45;
}

.model-pool-detail-gallery strong {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.model-pool-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr));
  gap: 0.4rem;
  max-width: 28rem;
}

.model-pool-gallery-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
}

.profile-row-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.profile-row-split > div {
  min-width: 0;
}

.profile-gallery-block {
  margin: 0.35rem 0 0.65rem;
}

.profile-gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.profile-gallery-label {
  font-weight: 600;
  font-size: 0.88rem;
}

.profile-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.75rem, 1fr));
  gap: 0.45rem;
  max-width: 32rem;
}

.profile-gallery-item {
  position: relative;
}

.profile-gallery-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  display: block;
}

.profile-gallery-remove {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}

.profile-gallery-remove:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.profile-gallery-status {
  margin-top: 0.35rem;
}

.profile-gallery-thumb,
.model-pool-gallery-thumb {
  cursor: zoom-in;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.gallery-lightbox[hidden] {
  display: none !important;
}

body.has-gallery-lightbox-open {
  overflow: hidden;
}

.gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(0, 0, 0, 0.88);
  cursor: zoom-out;
}

.gallery-lightbox-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.gallery-lightbox-close:hover {
  background: rgba(0, 0, 0, 0.65);
}

.gallery-lightbox-stage {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 960px);
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-lightbox-img {
  display: block;
  max-width: min(92vw, 960px);
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.gallery-lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.gallery-lightbox-nav:hover {
  background: rgba(0, 0, 0, 0.65);
}

.gallery-lightbox-prev {
  left: 0.85rem;
}

.gallery-lightbox-next {
  right: 0.85rem;
}

.gallery-lightbox-counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  z-index: 2;
  transform: translateX(-50%);
  margin: 0;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.78rem;
}

.profile-avatar-block {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.profile-avatar-preview-wrap {
  position: relative;
  flex-shrink: 0;
  width: 6rem;
  height: 6rem;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg);
}

.profile-avatar-img {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.profile-avatar-preview-wrap.has-photo .profile-avatar-img {
  display: block;
}

.profile-avatar-preview-wrap.has-photo .profile-avatar-placeholder {
  display: none !important;
}

.profile-avatar-placeholder {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--muted);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg));
}

.profile-avatar-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.profile-avatar-upload-label {
  cursor: pointer;
  width: fit-content;
}

.model-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  padding: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
  text-align: center;
}

.model-card-photo {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.model-card strong {
  font-size: 0.82rem;
}

.model-card span {
  color: var(--muted);
  font-size: 0.74rem;
}

.model-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem;
  width: 100%;
}

.model-card-name-row {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem;
  min-width: 0;
}

.model-live-session-badge {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.14rem 0.42rem;
  border-radius: 999px;
  color: #4ade80;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(74, 222, 128, 0.55);
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.45);
  animation: model-live-pulse 2.2s ease-in-out infinite;
}

.model-live-session-meta {
  color: #4ade80 !important;
  font-weight: 600;
}

.model-card.is-session-live {
  border-color: rgba(74, 222, 128, 0.55);
  box-shadow:
    0 0 0 1px rgba(74, 222, 128, 0.25),
    0 0 14px rgba(74, 222, 128, 0.2);
}

.model-card.is-session-live.is-session-partner {
  border-color: rgba(74, 222, 128, 0.7);
  box-shadow:
    0 0 0 1px rgba(74, 222, 128, 0.35),
    0 0 18px rgba(74, 222, 128, 0.28);
}

@keyframes model-live-pulse {
  0%,
  100% {
    box-shadow: 0 0 6px rgba(74, 222, 128, 0.35);
  }
  50% {
    box-shadow: 0 0 14px rgba(74, 222, 128, 0.75);
  }
}

.model-card.is-signed-in {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.model-signed-in-badge {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
}

.model-card--pool {
  cursor: pointer;
}

.model-card--pool:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.model-card--active {
  border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
  cursor: pointer;
}

.model-card--active.is-session-partner {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}

.model-card-remove-btn {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.model-card-remove-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

.members-toolbar-row {
  margin-bottom: 0.5rem;
}

.meeting-invite-row {
  margin-top: 0.35rem;
}

.meeting-invite-row .js-invite-by-email {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.setup-session-actions button.session-action-glow {
  animation: session-action-pulse 1.4s ease-in-out infinite;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent),
    0 0 18px color-mix(in srgb, var(--accent) 55%, transparent);
}

@keyframes session-action-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent),
      0 0 14px color-mix(in srgb, var(--accent) 45%, transparent);
  }
  50% {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent),
      0 0 22px color-mix(in srgb, var(--accent) 70%, transparent);
  }
}

.setup-session-actions-hint {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.setup-add-model-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.setup-add-model-row label {
  flex: 1 1 100%;
  font-size: 0.78rem;
  color: var(--muted);
}

.setup-add-model-row input {
  flex: 1 1 10rem;
  min-width: 0;
}

.member-pool-add-row {
  margin-top: 0.35rem;
}

.member-pool-gender-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin: 0.85rem 0 0.15rem;
}

.member-pool-gender-filter-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.member-pool-gender-filter {
  flex: 1 1 14rem;
  max-width: 100%;
}

.member-pool-section-title {
  margin: 1rem 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.member-pool-premium-section {
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.member-pool-premium-hint {
  margin: 0 0 0.65rem;
}

.model-premium-partner-badge {
  flex: 0 0 auto;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffba3a;
  border: 1px solid rgba(255, 186, 58, 0.45);
  border-radius: 999px;
  padding: 0.12rem 0.45rem;
  background: rgba(255, 186, 58, 0.1);
}

.model-book-btn {
  margin-top: 0.45rem;
  width: 100%;
  font-size: 0.78rem;
  padding: 0.35rem 0.5rem;
}

.model-booking-card {
  max-width: 28rem;
}

.member-pool-bookings-section {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.setup-session-bookings-section {
  margin: 0.85rem 0 1rem;
  padding: 0.85rem 0.75rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.setup-section-title {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.setup-bookings-hint {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
}

.session-bookings-actions {
  margin: 0 0 0.65rem;
  gap: 0.5rem;
  flex-direction: column;
  align-items: flex-start;
}

.setup-bookings-paid-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.setup-session-request-btn {
  white-space: nowrap;
}

.member-pool-bookings-hint {
  margin-bottom: 0.65rem;
}

.session-bookings-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.session-booking-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
}

.session-booking-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.session-booking-status {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.session-booking-meta {
  margin: 0;
  font-size: 0.82rem;
}

.session-booking-note {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--muted);
}

.session-booking-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.session-booking-actions button {
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
}

.model-pool-detail-rate {
  margin: 0 0 0.75rem;
}

.model-pool-detail-rate strong {
  display: block;
  margin-bottom: 0.2rem;
}

.model-pool-detail-book {
  margin: 0 0 1rem;
}

.model-pool-detail-book-btn {
  width: 100%;
  font-size: 0.85rem;
}

.setup-model-pool-field {
  margin: 0.75rem 0;
  padding: 0.75rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
}

.lovense-hint {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 0.5rem;
}

.lovense-rules-setup {
  margin: 0.35rem 0 0.65rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 4%, var(--bg));
  font-size: 0.78rem;
}

.lovense-rules-setup summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
}

.lovense-rules-intro {
  margin: 0.5rem 0 0.55rem;
  font-size: 0.76rem;
  line-height: 1.45;
}

.lovense-rules-table {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.74rem;
}

.lovense-rules-status.err {
  color: var(--danger, #c44);
  font-size: 0.76rem;
  margin: 0.35rem 0 0.5rem;
}

.setup-lovense-field {
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 5%, var(--bg));
}

.setup-lovense-field legend {
  font-weight: 700;
  padding: 0 0.25rem;
}

.lovense-setup-card .lovense-checklist,
.setup-lovense-field .lovense-checklist {
  margin: 0 0 0.75rem;
  padding-left: 1.2rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
}

.lovense-setup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.lovense-url-inline {
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  word-break: break-all;
}

.lovense-url-hint {
  word-break: break-all;
  font-family: ui-monospace, monospace;
  font-size: 0.7rem;
}

/* Default: under-video wrapper transparent to parent grid */
.cb-under-video {
  display: contents;
}

/* ── Chaturbate-style layout ── */
main.layout-cb {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8px var(--cb-chat-width, 340px);
  grid-template-rows: auto 6px auto auto;
  gap: 0.5rem 0.35rem;
  align-items: stretch;
  max-width: none;
  width: 100%;
}

main.layout-cb[data-view-layout="theater"] {
  grid-template-columns: 1fr;
}

main.layout-cb[data-chat-dock="bottom"] {
  grid-template-columns: 1fr;
  grid-template-rows: auto 6px auto auto auto;
}

main.layout-cb[data-chat-dock="bottom-center"] {
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 400px) minmax(220px, 1fr);
  grid-template-rows: auto 6px auto auto;
}

main.layout-cb[data-chat-dock="bottom-center"] > .stage-shell,
main.layout-cb[data-chat-dock="bottom-center"] > .layout-row-resize-handle {
  grid-column: 1 / -1;
}

main.layout-cb[data-chat-dock="bottom-center"] .cb-under-video {
  display: contents;
}

main.layout-cb[data-chat-dock="bottom-center"] .connection-card {
  grid-column: 1;
  grid-row: 3;
}

main.layout-cb[data-chat-dock="bottom-center"] .remote-card {
  grid-column: 3;
  grid-row: 3;
}

/* Partner large: chat flush with video bottom (Chaturbate-style) */
main.layout-cb[data-chat-dock="right"] {
  grid-template-columns: minmax(0, 1fr) 8px var(--cb-chat-width, 340px);
  grid-template-rows: auto 6px auto auto;
  align-items: start;
}

main.layout-cb[data-chat-dock="right"] > .stage-shell {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
  width: 100%;
  min-width: 0;
}

main.layout-cb[data-chat-dock="right"] > .layout-row-resize-handle {
  grid-column: 1;
  grid-row: 2;
}

main.layout-cb[data-chat-dock="right"] .cb-under-video {
  grid-column: 1;
  grid-row: 3;
}

main.layout-cb[data-chat-dock="right"] .local-test-card {
  grid-column: 1;
  grid-row: 4;
}

main.layout-cb[data-chat-dock="right"] .layout-split-handle {
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  height: auto;
}

main.layout-cb[data-chat-dock="right"] .chat-card {
  grid-column: 3;
  grid-row: 1;
  align-self: start;
  width: 100%;
  height: var(--cb-stage-shell-height, auto);
  min-height: 0 !important;
  max-height: var(--cb-stage-shell-height, none);
  overflow: hidden;
}

main.layout-cb[data-chat-dock="right"] .stage-toolbar {
  flex: 0 0 auto;
  width: fit-content;
  max-width: 100%;
  align-self: flex-end;
  justify-content: flex-end;
  margin-left: auto;
  min-height: 2.35rem;
  max-height: 2.35rem;
  padding: 0.3rem 0.45rem;
}

main.layout-cb[data-chat-dock="right"] .stage-view-controls {
  margin-left: auto;
}

main.layout-cb[data-chat-dock="right"] .chat-card .chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

main.layout-cb > .stage-shell {
  grid-column: 1;
  grid-row: 1;
  margin-bottom: 0;
}

main.layout-cb > .stage-shell > .stage[data-layout="pip-remote"],
main.layout-cb > .stage-shell > .stage[data-layout="pip-local"],
main.layout-cb > .stage-shell > .stage[data-layout="theater"] {
  min-height: var(--cb-stage-height, clamp(360px, 68vh, 85vh));
}

main.layout-cb > .stage {
  margin-bottom: 0;
}

main.layout-cb > .layout-row-resize-handle {
  grid-column: 1;
  grid-row: 2;
}

main.layout-cb[data-view-layout="theater"] > .layout-row-resize-handle {
  display: none;
}

main.layout-cb > .layout-toolbar {
  display: none !important;
}

main.layout-cb > .controls {
  display: contents;
}

main.layout-cb .cb-under-video {
  display: grid;
  grid-column: 1;
  grid-row: 3;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.5rem;
  align-items: start;
}

main.layout-cb .connection-card,
main.layout-cb .remote-card {
  min-width: 0;
}

main.layout-cb .connection-card h2,
main.layout-cb .remote-card h2 {
  font-size: 0.85rem;
}

main.layout-cb .layout-split-handle {
  grid-column: 2;
  grid-row: 1;
  width: 8px;
  margin: 0 -4px;
  cursor: col-resize;
  touch-action: none;
  background: transparent;
  position: relative;
  z-index: 8;
  align-self: stretch;
}

main.layout-cb .layout-split-handle:not(.is-visible),
main.layout-cb .layout-split-handle[hidden] {
  display: none !important;
}

main.layout-cb .layout-split-handle::before {
  content: "";
  position: absolute;
  inset: 0.75rem 2px;
  border-radius: 4px;
  background: var(--border);
  opacity: 0.65;
}

main.layout-cb .layout-split-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 28px;
  border-radius: 4px;
  background: var(--muted);
  opacity: 0.45;
}

main.layout-cb .layout-split-handle:hover::before,
main.layout-cb .layout-split-handle.is-dragging::before,
main.layout-cb .layout-split-handle:focus-visible::before {
  opacity: 1;
  background: var(--accent);
}

main.layout-cb[data-view-layout="theater"] .layout-split-handle,
main.layout-cb[data-chat-dock="bottom"] .layout-split-handle,
main.layout-cb[data-chat-dock="bottom-center"] .layout-split-handle {
  display: none !important;
}

main.layout-cb .chat-card {
  grid-column: 3;
  grid-row: 1;
  min-height: 0;
  height: auto;
  max-height: none;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s ease, opacity 0.22s ease, visibility 0.22s ease;
}

main.layout-cb[data-view-layout="theater"] .chat-card {
  grid-column: 1;
  grid-row: 1;
  z-index: 40;
  justify-self: end;
  align-self: stretch;
  width: min(var(--cb-chat-width, 340px), 42vw);
  max-width: 480px;
  min-width: 260px;
  max-height: 100%;
  border-left: 1px solid var(--border);
  box-shadow: -10px 0 36px rgba(0, 0, 0, 0.5);
}

main.layout-cb[data-view-layout="theater"].chat-overlay-hidden .chat-card {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(105%);
}

main.layout-cb[data-view-layout="theater"] .stage-chat-toggle {
  display: inline-flex;
}

main.layout-cb[data-chat-dock="bottom"] .chat-card {
  grid-column: 1;
  grid-row: 3;
  width: 100%;
  height: min(38vh, 440px);
  min-height: 240px;
  max-height: min(38vh, 440px);
}

main.layout-cb[data-chat-dock="bottom-center"] .chat-card {
  grid-column: 2;
  grid-row: 3;
  width: 100%;
  max-width: none;
  justify-self: stretch;
  height: var(--cb-chat-height, min(38vh, 440px));
  min-height: 200px;
  max-height: var(--cb-chat-height, min(38vh, 440px));
}

main.layout-cb[data-chat-dock="bottom"] .cb-under-video {
  grid-row: 4;
}

main.layout-cb[data-chat-dock="bottom"] .chat-card .chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  overflow-y: auto;
}

main.layout-cb[data-chat-dock="bottom"] .local-test-card {
  grid-row: 5;
}

main.layout-cb[data-chat-dock="bottom-center"] .chat-card .chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  overflow-y: auto;
}

.chat-height-resize-handle {
  flex-shrink: 0;
  height: 8px;
  margin: 0.4rem -0.65rem -0.65rem;
  cursor: row-resize;
  touch-action: none;
  position: relative;
  border-radius: 0 0 var(--radius) var(--radius);
}

.chat-height-resize-handle::before {
  content: "";
  position: absolute;
  left: 20%;
  right: 20%;
  top: 3px;
  height: 3px;
  border-radius: 3px;
  background: var(--border);
  opacity: 0.75;
}

.chat-height-resize-handle:hover::before,
.chat-height-resize-handle.is-dragging::before,
.chat-height-resize-handle:focus-visible::before {
  background: var(--accent);
  opacity: 1;
}

/* Browser fullscreen (Esc to exit) */
#hostFsTarget:fullscreen,
#hostFsTarget:-webkit-full-screen,
#guestFsTarget:fullscreen,
#guestFsTarget:-webkit-full-screen,
.stage:fullscreen,
.stage:-webkit-full-screen {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: #000;
  border-radius: 0;
  pointer-events: auto;
}

.stage:fullscreen {
  padding: 0;
  gap: 0;
}

.stage:fullscreen .panel-head {
  display: none;
}

.stage:fullscreen[data-layout="split"] {
  grid-template-columns: 1fr 1fr;
}

#hostFsTarget:fullscreen video,
#hostFsTarget:-webkit-full-screen video,
#guestFsTarget:fullscreen video,
#guestFsTarget:-webkit-full-screen video,
.stage:fullscreen video {
  flex: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#hostFsTarget:fullscreen,
#guestFsTarget:fullscreen {
  flex: 1;
  min-height: 0;
  aspect-ratio: auto;
  height: 100%;
}

.video-fs-hint,
.guest-fs-hint {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.82rem;
  white-space: nowrap;
  pointer-events: none;
}

.stage-fs-hint {
  top: 1rem;
}

.video-fs-hint kbd,
.guest-fs-hint kbd {
  display: inline-block;
  margin: 0 0.15rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  font: inherit;
  font-size: 0.78rem;
}

#hostFsTarget:fullscreen .video-fs-hint,
#hostFsTarget:-webkit-full-screen .video-fs-hint,
#guestFsTarget:fullscreen .video-fs-hint,
#guestFsTarget:-webkit-full-screen .video-fs-hint,
.stage:fullscreen .stage-fs-hint,
.stage:-webkit-full-screen .stage-fs-hint {
  display: block;
}

.stage-fs-btn.active,
.stage-view-btn.stage-fs-btn.active {
  color: #fff;
  background: var(--accent);
}

main.layout-cb .chat-card .chat-messages {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  overflow-y: auto;
}

main.layout-cb .local-test-card {
  grid-column: 1;
  grid-row: 4;
}

main.layout-cb[data-chat-dock="bottom-center"] .local-test-card {
  grid-column: 1 / -1;
  grid-row: 4;
}

main.layout-cb[data-view-layout="theater"] .local-test-card {
  grid-row: 4;
}

main.layout-cb .stage[data-layout="split"] {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

main.layout-cb .stage[data-layout="pip-remote"] > .panel:last-child .panel-head,
main.layout-cb .stage[data-layout="pip-local"] > .panel:first-child .panel-head,
main.layout-cb .stage[data-layout="theater"] > .panel-guest .panel-head {
  background: var(--surface);
  color: var(--text);
}

body.layout-resize-active {
  cursor: col-resize !important;
  user-select: none !important;
}

body.layout-resize-active * {
  cursor: col-resize !important;
}

@media (max-width: 960px) {
  main.layout-cb,
  main.layout-cb[data-chat-dock="bottom"],
  main.layout-cb[data-chat-dock="bottom-center"],
  main.layout-cb[data-view-layout="theater"] {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  main.layout-cb > .stage-shell,
  main.layout-cb > .stage,
  main.layout-cb > .layout-row-resize-handle,
  main.layout-cb > .layout-toolbar,
  main.layout-cb .cb-under-video,
  main.layout-cb .layout-split-handle,
  main.layout-cb .chat-card,
  main.layout-cb .local-test-card {
    grid-column: 1;
    grid-row: auto;
  }

  main.layout-cb .layout-split-handle,
  main.layout-cb > .layout-row-resize-handle {
    display: none !important;
  }

  main.layout-cb[data-chat-dock="bottom-center"] .cb-under-video {
    display: grid;
    grid-template-columns: 1fr;
  }

  main.layout-cb[data-chat-dock="bottom-center"] .connection-card,
  main.layout-cb[data-chat-dock="bottom-center"] .remote-card,
  main.layout-cb[data-chat-dock="bottom-center"] .chat-card {
    grid-column: 1;
  }

  main.layout-cb .cb-under-video {
    grid-template-columns: 1fr;
  }

  main.layout-cb .chat-card {
    min-height: 280px;
    height: 320px;
    max-height: none;
    transform: none !important;
    box-shadow: none;
    border-left: none;
  }

  main.layout-cb[data-view-layout="theater"] .chat-card {
    width: 100%;
    max-width: none;
  }
}

/* ── Settings page ── */
.settings-page main,
.settings-main {
  flex: 1;
  padding: 1.25rem;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

.settings-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
}

.settings-lead {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.settings-section {
  margin-bottom: 1.35rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--border);
}

.settings-section:last-of-type {
  border-bottom: none;
}

.settings-section h2 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
}

.settings-hint {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}

.settings-field input {
  font-weight: 400;
}

.settings-theme-group {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.settings-radio {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem;
  cursor: pointer;
}

.settings-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.88rem;
  margin-bottom: 0.45rem;
  cursor: pointer;
}

.settings-check.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.settings-section-muted {
  opacity: 0.85;
}

.settings-billing-card {
  padding: 1rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.settings-billing-status-row {
  margin-bottom: 0.75rem;
}

.settings-billing-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.settings-billing-badge--ok {
  background: color-mix(in srgb, var(--ok, #2ecc71) 18%, transparent);
  color: var(--ok, #2ecc71);
}

.settings-billing-badge--trial {
  background: color-mix(in srgb, var(--partner) 15%, transparent);
  color: var(--partner);
}

.settings-billing-badge--warn {
  background: color-mix(in srgb, #e67e22 18%, transparent);
  color: #e67e22;
}

.settings-billing-badge--err {
  background: color-mix(in srgb, var(--err, #e74c3c) 18%, transparent);
  color: var(--err, #e74c3c);
}

.settings-billing-badge--muted {
  background: color-mix(in srgb, var(--muted) 20%, transparent);
  color: var(--muted);
}

.settings-billing-details {
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.settings-billing-detail {
  display: grid;
  grid-template-columns: minmax(7rem, 38%) 1fr;
  gap: 0.5rem 0.75rem;
  font-size: 0.88rem;
}

.settings-billing-detail dt {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

.settings-billing-detail dd {
  margin: 0;
  font-weight: 600;
}

.settings-billing-note {
  margin: 0.75rem 0 0 !important;
  font-size: 0.84rem;
  color: var(--muted);
}

.settings-billing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

@media (max-width: 520px) {
  .settings-billing-detail {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.settings-back-link {
  font-size: 0.88rem;
  color: var(--muted);
}

.settings-saved {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--success);
}

.account-banned-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg, #f5f5f5);
  color: var(--text, #111);
  font-family: "DM Sans", system-ui, sans-serif;
}

.account-banned-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border, #ddd);
  background: var(--surface, #fff);
}

.account-banned-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 3rem;
}

.account-banned-card {
  width: min(100%, 640px);
  background: var(--surface, #fff);
  border: 1px solid var(--border, #ddd);
  border-radius: 0.35rem;
  padding: 2rem 2.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.account-banned-card h1 {
  margin: 0 0 1rem;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.25;
}

.account-banned-lead,
.account-banned-reason,
.account-banned-support {
  margin: 0 0 1rem;
  line-height: 1.55;
  color: var(--text, #222);
}

.account-banned-reason {
  padding: 0.75rem 0.9rem;
  border-left: 3px solid var(--accent, #f97316);
  background: rgba(249, 115, 22, 0.08);
  border-radius: 0.2rem;
}

.account-banned-cta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  margin: 1.25rem 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.35rem;
  background: #9fd356;
  color: #1a2e05;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #8ec045;
}

.account-banned-cta:hover {
  filter: brightness(0.97);
}

.account-banned-cta-arrow {
  margin-left: auto;
}

.account-banned-support a {
  color: var(--accent, #2563eb);
}

.account-banned-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.account-banned-home-link {
  font-size: 0.88rem;
  color: var(--muted);
}

.account-banned-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  justify-content: center;
  padding: 1rem;
  font-size: 0.78rem;
  color: var(--muted);
  border-top: 1px solid var(--border, #ddd);
  background: var(--surface, #fff);
}

.admin-ban-reason-input {
  min-width: 10rem;
}

.admin-users-table tr.is-banned-user td {
  background: rgba(239, 68, 68, 0.08);
}

.admin-user-name {
  cursor: pointer;
  text-decoration: underline dotted;
  text-underline-offset: 0.15em;
}

.admin-user-name:hover {
  color: var(--accent);
}

.admin-user-profile-overlay {
  z-index: 10061;
}

.admin-user-profile-card {
  max-width: min(92vw, 36rem);
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
}

.admin-user-profile-body {
  overflow: auto;
  flex: 1;
  min-height: 0;
  margin: 0.5rem 0 0.75rem;
}

.admin-profile-head {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.admin-profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.admin-profile-avatar--initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: var(--accent);
}

.admin-profile-display-name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.admin-profile-username {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.admin-profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.45rem 0 0;
}

.admin-profile-badge {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 80%, var(--accent) 8%);
}

.admin-profile-dl {
  display: grid;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
}

.admin-profile-dl div {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.5rem;
  font-size: 0.82rem;
}

.admin-profile-dl dt {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

.admin-profile-dl dd {
  margin: 0;
  word-break: break-word;
}

.admin-profile-dl--compact div {
  grid-template-columns: 5.5rem 1fr;
}

.admin-profile-section {
  margin-bottom: 0.85rem;
}

.admin-profile-section h3 {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.admin-profile-bio {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.admin-profile-tag-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  line-height: 1.45;
}

.admin-profile-empty {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

/* —— Public landing & auth pages —— */

.public-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.public-site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
}

.public-logo .site-logo {
  height: clamp(2.5rem, 4vw + 1.5rem, 3.25rem);
}

.public-site-nav {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.public-site-nav a {
  color: var(--text);
  text-decoration: none;
  opacity: 0.88;
}

.public-site-nav a:hover {
  opacity: 1;
  color: var(--partner);
}

.public-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.public-header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.public-header-btn.primary {
  color: var(--on-accent, #fff);
}

.public-header-btn.secondary {
  background: transparent;
}

.landing-main {
  flex: 1;
  width: 100%;
  max-width: 56rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.landing-hero {
  text-align: center;
  padding: 1.5rem 0 2.5rem;
}

.landing-eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--partner);
  font-weight: 600;
}

.landing-hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 4vw + 0.5rem, 2.65rem);
  line-height: 1.15;
  font-weight: 700;
}

.landing-lead {
  margin: 0 auto 1.5rem;
  max-width: 40rem;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--muted);
}

/* display:flex/inline-flex on landing/auth elements overrides the [hidden] attribute */
[data-invite-only][hidden],
[data-public-registration][hidden] {
  display: none !important;
}

body.public-registration-open [data-invite-only] {
  display: none !important;
}

body:not(.public-registration-open) [data-public-registration] {
  display: none !important;
}

.landing-cta-row {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.landing-cta-primary,
.landing-cta-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.35rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
}

.landing-trust-line {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.landing-section {
  margin-top: 2.5rem;
}

.landing-section-title {
  margin: 0 0 1.25rem;
  font-size: 1.35rem;
  text-align: center;
}

.landing-benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
}

.landing-benefit-card {
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.landing-benefit-icon {
  display: block;
  font-size: 1.35rem;
  color: var(--partner);
  margin-bottom: 0.55rem;
}

.landing-benefit-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.landing-benefit-card p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--muted);
}

.landing-invite-section {
  margin-top: 3rem;
}

.landing-invite-inner {
  padding: 1.5rem 1.35rem;
  border-radius: calc(var(--radius) + 2px);
  border: 1px solid var(--border);
  background: linear-gradient(145deg, var(--surface) 0%, color-mix(in srgb, var(--partner) 8%, var(--surface)) 100%);
}

.landing-invite-inner h2 {
  margin: 0 0 0.65rem;
  font-size: 1.2rem;
}

.landing-invite-inner > p {
  margin: 0 0 1rem;
  color: var(--muted);
  line-height: 1.5;
}

.landing-steps {
  margin: 0 0 1.25rem;
  padding-left: 1.2rem;
  line-height: 1.55;
  font-size: 0.92rem;
}

.landing-steps li + li {
  margin-top: 0.45rem;
}

.landing-guide-intro {
  text-align: center;
  max-width: 36rem;
  margin: 0 auto 1.25rem;
  color: var(--muted);
  line-height: 1.5;
}

.landing-guide-topics {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
}

.landing-guide-topic {
  display: inline-block;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.84rem;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
}

.landing-guide-topic:hover {
  border-color: var(--partner);
  color: var(--partner);
}

.landing-guide-cta {
  text-align: center;
  margin: 0;
}

.public-site-footer {
  margin-top: auto;
  padding: 1.5rem 1.25rem 2rem;
  border-top: 1px solid var(--border);
  background: var(--header-bg);
  text-align: center;
}

.public-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem 1.1rem;
  margin-bottom: 0.75rem;
  font-size: 0.86rem;
}

.public-footer-nav a {
  text-decoration: none;
}

.public-footer-note {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.public-auth-page .auth-page-main {
  max-width: none;
}

.public-auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem 3rem;
}

.public-auth-columns {
  display: grid;
  grid-template-columns: minmax(0, 22rem) minmax(0, 20rem);
  gap: 1.25rem;
  width: 100%;
  max-width: 44rem;
  align-items: start;
}

.public-auth-card {
  width: 100%;
  max-width: none;
  position: static;
  transform: none;
  margin: 0;
}

.public-auth-card h1 {
  margin: 0 0 0.5rem;
  font-size: 1.45rem;
}

.public-auth-submit {
  width: 100%;
  margin-top: 0.25rem;
}

.public-invite-panel {
  padding: 1.25rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.public-invite-panel h2 {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
}

.public-invite-lead {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.public-invite-hint {
  margin: 0 0 0.85rem !important;
  font-size: 0.84rem;
}

.public-invite-btn {
  width: 100%;
  margin-top: 0.35rem;
}

.public-invite-foot {
  margin: 0.85rem 0 0 !important;
  font-size: 0.82rem;
}

.public-invite-callout {
  border-color: color-mix(in srgb, var(--partner) 35%, var(--border));
}

.subscription-overlay-card {
  max-width: 24rem;
}

.subscription-price-line {
  text-align: center;
  margin: 0.5rem 0 1rem !important;
  font-size: 0.95rem;
}

.subscription-checkout-btn,
.subscription-portal-btn,
.subscription-settings-link {
  width: 100%;
  margin-top: 0.35rem;
}

.subscription-settings-link {
  display: block;
  box-sizing: border-box;
  text-align: center;
  text-decoration: none;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
}

.continue-subscription-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.continue-subscription-header {
  flex-shrink: 0;
}

.continue-subscription-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem 3rem;
}

.continue-subscription-card {
  width: 100%;
  max-width: 30rem;
  padding: 1.5rem 1.4rem;
}

.continue-subscription-card h1 {
  margin: 0 0 0.65rem;
  font-size: 1.55rem;
}

.continue-subscription-lead {
  margin: 0 0 1.25rem;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.92rem;
}

.continue-subscription-card .settings-section {
  margin-bottom: 0;
}

.continue-subscription-card .settings-section h2 {
  font-size: 0.95rem;
  margin-bottom: 0.55rem;
}

.continue-subscription-foot {
  margin: 1.25rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

.continue-subscription-signout {
  margin: 0.85rem 0 0;
  text-align: center;
}

.continue-subscription-header .logout-link {
  margin-right: 0.35rem;
}

.continue-subscription-footer {
  flex-shrink: 0;
  padding: 1rem 1.25rem 1.5rem;
  text-align: center;
}

.continue-subscription-footer p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

@media (max-width: 720px) {
  .public-site-header {
    justify-content: center;
  }

  .public-header-actions {
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }

  .public-site-nav {
    width: 100%;
    justify-content: center;
  }

  .public-auth-columns {
    grid-template-columns: 1fr;
    max-width: 22rem;
  }
}
