/*
 * This is a manifest file that'll be compiled into application.css.
 */

/* ─── Palette ──────────────────────────────────────────────────────────────── */
:root {
  --clr-bg:        #151515;
  --clr-surface:   #1e1e1e;
  --clr-surface-2: #2a2a2a;
  --clr-border:    #333333;
  --clr-text:      #f2f2f2;
  --clr-muted:     #888888;
  --clr-cyan:      #00e8ff;
  --clr-cyan-dim:  rgba(0, 232, 255, 0.12);
  --clr-red:       #ff3b30;

  /* Bootstrap token overrides */
  --bs-body-bg:            #151515;
  --bs-body-color:         #f2f2f2;
  --bs-border-color:       #333333;
  --bs-primary:            #00e8ff;
  --bs-primary-rgb:        0, 232, 255;
  --bs-secondary-color:    #888888;
  --bs-dark-rgb:           242, 242, 242;
  --bs-light-rgb:          30, 30, 30;
  --bs-emphasis-color:     #f2f2f2;
  --bs-link-color:         #00e8ff;
  --bs-link-hover-color:   #33eeff;
}

/* ─── UI tier tokens (Elevated/Glass vs Glass — Lite) ─────────────────────────
   device_tier_controller.js benchmarks this device's backdrop-filter cost and
   sets data-ui-tier on <html> (cached in localStorage) — no third "default"
   state, every page load resolves to one of these two. "glass" uses real
   backdrop-filter blur; "glass-lite" fakes the same look with a near-opaque
   flat color plus a static gradient sheen, so it never pays the blur
   compositing cost on weaker devices. */
[data-ui-tier="glass"] {
  --ui-radius-card: 20px;
  --ui-sidebar-bg: rgba(30, 30, 32, 0.55);
  --ui-card-bg: rgba(30, 30, 32, 0.55);
  --ui-card-border: 1px solid rgba(255, 255, 255, 0.08);
  --ui-card-shadow: 0 10px 34px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --ui-active-bg: rgba(0, 232, 255, 0.10);
  --ui-active-glow: 0 0 0 1px rgba(0, 232, 255, 0.25), 0 0 22px rgba(0, 232, 255, 0.20);
  --ui-icon-glow: 0 0 10px rgba(0, 232, 255, 0.55);
  --ui-thumb-bg: rgba(0, 232, 255, 0.14);
  --ui-thumb-border: 1px solid rgba(0, 232, 255, 0.4);
  --ui-thumb-shadow: 0 0 18px rgba(0, 232, 255, 0.25);
  --ui-track-bg: rgba(255, 255, 255, 0.04);
  --ui-blur: blur(16px);
}

[data-ui-tier="glass-lite"] {
  --ui-radius-card: 20px;
  --ui-sidebar-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 35%), rgba(26, 26, 28, 0.97);
  --ui-card-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 45%), rgba(30, 30, 32, 0.97);
  --ui-card-border: 1px solid rgba(255, 255, 255, 0.09);
  --ui-card-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
  --ui-active-bg: rgba(0, 232, 255, 0.10);
  --ui-active-glow: 0 0 0 1px rgba(0, 232, 255, 0.28);
  --ui-icon-glow: 0 0 6px rgba(0, 232, 255, 0.4);
  --ui-thumb-bg: rgba(0, 232, 255, 0.14);
  --ui-thumb-border: 1px solid rgba(0, 232, 255, 0.4);
  --ui-thumb-shadow: 0 0 0 1px rgba(0, 232, 255, 0.3);
  --ui-track-bg: rgba(255, 255, 255, 0.04);
  --ui-blur: none;
}

/* ─── Base ──────────────────────────────────────────────────────────────────── */
body {
  background-color: var(--clr-bg);
  color: var(--clr-text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

/* ─── Bootstrap utility overrides ──────────────────────────────────────────── */
.bg-white  { background-color: var(--clr-surface)   !important; }
/* --bs-dark-rgb is remapped to near-white above, so a .badge.bg-dark
   (Vault only, Archived) would be white text on white — give it dark text. */
.badge.bg-dark { color: #151515; }
.bg-light  { background-color: var(--clr-bg)        !important; }
.text-dark { color: var(--clr-text)                 !important; }
.text-body { color: var(--clr-text)                 !important; }
.text-muted { color: var(--clr-muted)               !important; }
.border,
.border-bottom,
.border-top,
.border-start { border-color: var(--clr-border)     !important; }

/* ─── Navbar ────────────────────────────────────────────────────────────────── */
.navbar {
  background-color: var(--clr-surface) !important;
  border-color: var(--clr-border) !important;
}
.navbar .nav-link {
  color: var(--clr-muted);
  transition: color 0.15s;
}
.navbar .nav-link:hover,
.navbar .nav-link:focus {
  color: var(--clr-cyan);
}
.navbar-brand { color: var(--clr-text) !important; }

/* ─── Sidebar nav links ─────────────────────────────────────────────────────── */
aside {
  background: var(--ui-sidebar-bg) !important;
  backdrop-filter: var(--ui-blur);
  -webkit-backdrop-filter: var(--ui-blur);
}
aside .nav-link {
  color: var(--clr-text);
  transition: color 0.15s, background-color 0.15s, box-shadow 0.15s;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 999px;
  padding: 0.5rem 0.75rem;
}
aside .nav-link:hover,
aside .nav-link:focus {
  color: var(--clr-cyan);
}
/* Current-page state (set via ApplicationHelper#sidebar_active?) — a filled
   pill with the tier's glow/gradient tokens rather than a plain color swap. */
aside .nav-link.active {
  color: var(--clr-cyan);
  background: var(--ui-active-bg);
  box-shadow: var(--ui-active-glow);
}
aside .btn-link {
  color: var(--clr-text);
  transition: color 0.15s;
}
aside .btn-link:hover,
aside .btn-link:focus {
  color: var(--clr-cyan);
}

/* "New Post" pill CTA (replaces a plain .nav-link for that one item). */
.compose-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--ui-active-bg);
  box-shadow: var(--ui-active-glow);
  color: var(--clr-cyan);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.compose-btn:hover,
.compose-btn:focus {
  color: var(--clr-cyan);
  text-decoration: none;
  transform: translateY(-1px);
}

/* Account card pinned to the bottom of the sidebar. */
.sidebar-account-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.6rem;
  border-radius: 12px;
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  color: var(--clr-text);
  text-decoration: none;
  transition: border-color 0.15s;
}
.sidebar-account-card:hover,
.sidebar-account-card:focus {
  border-color: var(--clr-cyan);
  color: var(--clr-text);
}
.sidebar-account-avatar {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 50%;
  flex-shrink: 0;
}
.sidebar-account-avatar.post-avatar-placeholder {
  width: 32px;
  height: 32px;
  font-size: 0.8rem;
}
.sidebar-account-name {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-account-handle {
  font-size: 0.75rem;
  color: var(--clr-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Unread dot (Messages/Activity/Verifications) ────────────────────────────
   Replaces the old numeric .activity-badge pill — signals "something's here"
   without a count. Sits inside the existing .position-relative.d-inline-block
   wrapper each icon is already given in the sidebar and mobile bottom nav. */
.nav-unread-dot {
  position: absolute;
  top: -2px;
  inset-inline-end: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--clr-cyan);
}

/* ─── Dropdown ──────────────────────────────────────────────────────────────── */
.dropdown-menu {
  background-color: var(--clr-surface-2);
  border-color: var(--clr-border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
.dropdown-item {
  color: var(--clr-text);
}
.dropdown-item:hover,
.dropdown-item:focus {
  background-color: var(--clr-border);
  color: var(--clr-text);
}
.dropdown-divider { border-color: var(--clr-border); }
.dropdown-item.text-danger { color: var(--clr-red) !important; }
.dropdown-item.text-danger:hover { background-color: rgba(255,59,48,0.1); }

/* ─── Page transitions ─────────────────────────────────────────────────────────
   Full page loads between our own pages — switching apps (the switcher's
   links skip Turbo), the language switcher — crossfade instead of flashing
   blank. Browsers without cross-document view transitions just navigate. */
@view-transition { navigation: auto; }
::view-transition-group(root) { animation-duration: 200ms; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* ─── App switcher (shared/_app_switcher, shared/_app_switcher_tiles) ──────── */
.app-switcher-toggle {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--clr-text);
}
.app-switcher-toggle:hover,
.app-switcher-toggle:focus-visible,
.app-switcher-toggle[aria-expanded="true"] {
  background-color: var(--clr-cyan-dim);
  color: var(--clr-cyan);
}
.app-switcher-menu {
  width: 340px;
  max-width: calc(100vw - 32px);
  padding: 8px;
  border-radius: 12px;
}
.app-switcher-heading {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #a3a3a3;
}
.app-switcher-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  white-space: normal;
}
.app-switcher-item.active,
.app-switcher-item.active:hover,
.app-switcher-item.active:focus {
  background-color: var(--clr-cyan-dim);
  color: var(--clr-text);
}
.app-switcher-tile {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--clr-surface);
}
.app-switcher-item.active .app-switcher-tile {
  background-color: var(--clr-cyan);
  color: var(--clr-bg);
}
.app-switcher-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.app-switcher-name { font-weight: 600; }
.app-switcher-description { font-size: 13px; color: #a3a3a3; }
.app-switcher-check { color: var(--clr-cyan); }
/* "For this video" links a page adds above the app list. */
.app-switcher-context-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
}
.app-switcher-context-item i { width: 20px; text-align: center; color: var(--clr-cyan); }

.app-switcher-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--clr-border);
  border-radius: 12px;
  background-color: var(--clr-bg);
}
.app-switcher-tile-link {
  min-height: 56px;
  border-radius: 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  color: var(--clr-text);
}
.app-switcher-tile-link:hover { background-color: var(--clr-surface-2); color: var(--clr-text); }
.app-switcher-tile-link.active,
.app-switcher-tile-link.active:hover {
  background-color: var(--clr-cyan);
  color: var(--clr-bg);
  font-weight: 700;
}
/* Inside the main app's mobile hamburger dropdown. */
.dropdown-menu .app-switcher-tiles { margin: 4px 8px 8px; min-width: 240px; }

/* ─── List group (e.g. the tier picker on channel_memberships/new) ────────────
   Unstyled, this falls back to Bootstrap's light-theme colors — hovering an
   item swaps in a near-white background while the text stays this theme's
   light --clr-text, which is nearly unreadable. Re-themed the same way
   .dropdown-item is just above: explicit color alongside every background
   change, not just the background. */
.list-group-item {
  background-color: var(--clr-surface);
  border-color: var(--clr-border);
  color: var(--clr-text);
}
.list-group-item-action:hover,
.list-group-item-action:focus {
  background-color: var(--clr-surface-2);
  color: var(--clr-text);
}
.list-group-item.active {
  background-color: var(--clr-cyan-dim);
  border-color: var(--clr-cyan);
  color: var(--clr-text);
}

/* ─── Cards ─────────────────────────────────────────────────────────────────── */
.card {
  background-color: var(--clr-surface);
  border-color: var(--clr-border);
  color: var(--clr-text);
}
.card-title, .card-text { color: var(--clr-text); }

/* Selectable plan cards (verification wizard's tier step): a <label class="card
   plan-card"> wraps a radio input, so :has(input:checked) highlights the
   chosen plan with no JS. */
.plan-card {
  border-width: 1px;
  transition: border-color 0.15s, background-color 0.15s;
}
.plan-card:has(input:checked) {
  border-color: var(--clr-cyan);
  background-color: var(--clr-cyan-dim);
}
.plan-card-ribbon {
  background-color: var(--clr-cyan);
  color: #000;
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  padding: 0.35rem 0;
  border-top-left-radius: var(--bs-card-inner-border-radius, 0.3125rem);
  border-top-right-radius: var(--bs-card-inner-border-radius, 0.3125rem);
}

/* Admin-authored markdown feature lists (billing_plans.features, rendered
   via PricingHelper#plan_feature_html) — a plain "- item" bullet list gets
   a checkmark look via ::marker rather than a Font Awesome glyph, so it
   doesn't depend on the icon font having loaded. */
.plan-features ul {
  list-style: none;
  padding-inline-start: 0;
  margin-bottom: 0;
}
.plan-features li {
  padding-inline-start: 0.25rem;
  margin-bottom: 0.5rem;
}
.plan-features li::marker {
  content: "✓  ";
  color: #28a745;
}

/* ─── Buttons ───────────────────────────────────────────────────────────────── */
/* Pill design language: every button fully rounded, matching the composer's
   "Post" button (previously the only .rounded-pill exception to an all-square
   default). (Direct property beats the --bs-btn-border-radius vars that
   .btn-sm/.btn-lg set.) Admin (/admin/*) is untouched — layouts/admin.html.erb
   never loads this stylesheet, it ships its own separate Bootstrap theme. */
.btn,
.btn-close {
  border-radius: 50rem;
}

/* Glass style — the same translucent cyan-pill treatment as a selected
   sidebar nav item (aside .nav-link.active) and the composer's Post button,
   now the app's one primary-button language instead of a solid fill.
   !important throughout: Bootstrap's own compiled :hover/:focus-visible/
   :active rules (the last with :not(:disabled):not(.disabled) guards, which
   out-specificities a plain :active override) still carry its stock blue —
   background-color alone isn't enough to beat them, box-shadow and color
   need it too, or Bootstrap's own blue focus ring/active state shows through
   on click. */
.btn-primary {
  background: var(--ui-active-bg) !important;
  border-color: transparent !important;
  box-shadow: var(--ui-active-glow) !important;
  color: var(--clr-cyan) !important;
  font-weight: 600;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:focus-visible {
  background: rgba(0, 232, 255, 0.18) !important;
  border-color: transparent !important;
  box-shadow: var(--ui-active-glow) !important;
  color: var(--clr-cyan) !important;
}
.btn-primary:active,
.btn-primary:active:focus-visible {
  background: rgba(0, 232, 255, 0.26) !important;
  border-color: transparent !important;
  box-shadow: var(--ui-active-glow) !important;
  color: var(--clr-cyan) !important;
}

.btn-outline-secondary {
  border-color: var(--clr-border);
  color: var(--clr-text);
}
.btn-outline-secondary:hover {
  background-color: var(--clr-surface-2);
  border-color: var(--clr-border);
  color: var(--clr-text);
}

/* Segmented glass toggle (verify/apply/tier's Monthly/Yearly switch, and
   link-based ones like the Gifts filter via .active) — the checked option gets the same translucent glass-pill treatment as a
   selected sidebar item; scoped to .glass-toggle rather than the bare
   .btn-outline-primary/.btn-check pattern, which other unrelated toggles
   (poll voting, the pricing page) also use and shouldn't be affected by
   this. */
.glass-toggle .btn-outline-primary {
  border-color: var(--clr-border);
  background: transparent;
  color: var(--clr-text);
}
.glass-toggle .btn-outline-primary:hover {
  border-color: var(--clr-cyan);
  color: var(--clr-cyan);
  background: transparent;
}
.glass-toggle .btn-check:checked + .btn-outline-primary,
.glass-toggle .btn-outline-primary.active {
  background: var(--ui-active-bg);
  border-color: transparent;
  box-shadow: var(--ui-active-glow);
  color: var(--clr-cyan);
}

.btn-link {
  color: var(--clr-cyan);
}
.btn-link:hover { color: #33eeff; }

.btn-link.no-underline,
.btn-link.no-underline:hover,
.btn-link.no-underline:focus {
  text-decoration: none;
}

/* Close button: invert for dark backgrounds */
.btn-close,
.modal .btn-close { filter: invert(1) grayscale(1); }

/* ─── Modal ─────────────────────────────────────────────────────────────────── */
.modal-content {
  background-color: var(--clr-surface);
  border-color: var(--clr-border);
  color: var(--clr-text);
}
.modal-header {
  border-color: var(--clr-border);
}
.modal-footer {
  border-color: var(--clr-border);
}
.modal-title { color: var(--clr-text); }

/* ─── Forms ─────────────────────────────────────────────────────────────────── */
.form-control,
.form-select {
  background-color: var(--clr-surface-2);
  border-color: var(--clr-border);
  color: var(--clr-text);
}
/* Bootstrap's built-in dropdown caret is a dark stroke that all but
   disappears against this app's dark surfaces — recolor it to the accent
   cyan so a select clearly reads as "more options available". */
.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2300e8ff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}
.form-select:hover {
  border-color: var(--clr-cyan);
}
.form-control:focus,
.form-select:focus {
  background-color: var(--clr-surface-2);
  color: var(--clr-text);
  border-color: var(--clr-cyan);
  box-shadow: 0 0 0 0.2rem rgba(0, 232, 255, 0.15);
}
.form-control::placeholder { color: var(--clr-muted); }
/* The native "Choose file" button inherits .form-control's light text
   color but keeps the browser's default light button background,
   making the label unreadable — give it its own dark-theme colors.
   appearance: none drops the browser's native button chrome, which
   otherwise shades the button on hover/active regardless of any
   :hover CSS we write. */
.form-control[type="file"]::file-selector-button,
.form-control[type="file"]::-webkit-file-upload-button {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  color: var(--clr-text);
  border-radius: 0.25rem;
  padding: 0.25rem 0.75rem;
  margin-inline-end: 0.75rem;
}
/* Bootstrap's input-group addon (e.g. the "/@user/c/" prefix on the
   channel URL field) defaults to a light background — same
   unreadable-light-text-on-light-bg problem as the file button. */
.input-group-text {
  background-color: var(--clr-surface-2);
  border-color: var(--clr-border);
  color: var(--clr-text);
}
.form-floating > label { color: var(--clr-muted); }
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
  color: var(--clr-muted);
}
.form-check-input {
  background-color: var(--clr-surface-2);
  border-color: var(--clr-border);
}
/* An off/false checkbox or switch must still be visible on the dark
   surfaces — give the idle track/box a muted (not border-dark) outline. */
.form-check-input:not(:checked) {
  border-color: var(--clr-muted);
}
.form-check-input:checked {
  background-color: var(--clr-cyan);
  border-color: var(--clr-cyan);
}
/* Bootstrap's unchecked switch thumb is 25%-black — invisible on this
   palette until :focus swaps in its blue thumb (which is why a toggle only
   "appeared" after being clicked). Use a solid gray thumb for every
   unchecked switch, focused or not; the checked state keeps Bootstrap's
   white thumb on the cyan track above. */
.form-switch .form-check-input,
.form-switch .form-check-input:focus {
  --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23888888'/%3e%3c/svg%3e");
}
.form-switch .form-check-input:focus { box-shadow: 0 0 0 0.2rem rgba(0,232,255,0.15); }

/* ─── Badge ─────────────────────────────────────────────────────────────────── */
.text-bg-light {
  background-color: var(--clr-surface-2) !important;
  color: var(--clr-muted) !important;
}
.badge.text-bg-light { font-weight: 500; }

/* ─── Auth (glass) ──────────────────────────────────────────────────────────── */
/* "Elevated / glass" treatment for the login card: translucent surfaces over
   a soft cyan-tinted radial glow, matching the glass redesign direction. */
.auth-glass-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% -10%, rgba(0, 232, 255, 0.07), transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(0, 232, 255, 0.04), transparent 40%),
    var(--clr-bg);
}

.auth-glass-card {
  background-color: rgba(32, 32, 34, 0.55) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 20px !important;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.auth-glass-divider { border-color: rgba(255, 255, 255, 0.08) !important; }

.auth-glass-card .form-control {
  background-color: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}
.auth-glass-card .form-control:focus {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: var(--clr-cyan);
  box-shadow: 0 0 0 0.2rem rgba(0, 232, 255, 0.15);
}

.auth-glass-card .btn-outline-secondary {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.12);
}
.auth-glass-card .btn-outline-secondary:hover {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: var(--clr-cyan);
  color: var(--clr-cyan);
}

.auth-glass-card .btn-primary {
  background-color: rgba(0, 232, 255, 0.16);
  border: 1px solid rgba(0, 232, 255, 0.35);
  color: var(--clr-cyan);
  box-shadow: 0 0 0 1px rgba(0, 232, 255, 0.35) inset, 0 8px 24px rgba(0, 232, 255, 0.18);
}
.auth-glass-card .btn-primary:hover,
.auth-glass-card .btn-primary:focus {
  background-color: rgba(0, 232, 255, 0.24);
  border-color: rgba(0, 232, 255, 0.5);
  color: var(--clr-cyan);
}
.auth-glass-card .btn-primary:active {
  background-color: rgba(0, 232, 255, 0.3);
  color: var(--clr-cyan);
}

/* Enroll wizard steps (birth_date's <select>, interests'/recommendations'
   search field + result list) reuse the glass card too. */
.auth-glass-card .form-select {
  background-color: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}
.auth-glass-card .form-select:hover { border-color: var(--clr-cyan); }
.auth-glass-card .form-select:focus {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: var(--clr-cyan);
  box-shadow: 0 0 0 0.2rem rgba(0, 232, 255, 0.15);
}
.auth-glass-card .input-group-text {
  background-color: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}
.auth-glass-card .list-group-item {
  background-color: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}
.auth-glass-card .list-group-item-action:hover,
.auth-glass-card .list-group-item-action:focus {
  background-color: rgba(255, 255, 255, 0.07);
}

/* The wizards' left brand panel (layouts/enroll.html.erb): dark glass under
   the cyan word logo, which would vanish on a cyan fill. */
.wizard-brand-panel {
  background:
    radial-gradient(circle at 50% 45%, rgba(0, 232, 255, 0.12), transparent 60%),
    var(--clr-surface);
  border-inline-end: 1px solid rgba(255, 255, 255, 0.08);
}

/* Picked items in the enroll wizard: checked zone pills (interests step),
   the "Selected"/"Following" chips above each list, and followed rows on the
   who-to-follow step all get the glass active treatment, not Bootstrap's
   blue fill. Unpicked pills stay neutral so the picked ones stand out. */
.auth-glass-card .btn-check + .btn-outline-primary {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--clr-text);
}
.auth-glass-card .btn-check + .btn-outline-primary:hover {
  border-color: var(--clr-cyan);
  color: var(--clr-cyan);
}
.auth-glass-card .btn-check:checked + .btn-outline-primary,
.auth-glass-card .selected-chip {
  background: var(--ui-active-bg);
  border-color: transparent;
  box-shadow: var(--ui-active-glow);
  color: var(--clr-cyan);
}
.auth-glass-card .btn-check:checked + .btn-outline-primary::before {
  content: "\2713";
  margin-inline-end: 0.35em;
}
.auth-glass-card .selected-chip:hover,
.auth-glass-card .selected-chip:focus-visible {
  background: rgba(0, 232, 255, 0.18);
  color: var(--clr-cyan);
}
.auth-glass-card .is-followed {
  background: var(--ui-active-bg);
  border-radius: 12px;
}

/* ─── Misc ──────────────────────────────────────────────────────────────────── */
.zone-row { cursor: pointer; }
.zone-checkbox {
  margin-inline-start: auto;
  border-radius: 50%;
  width: 1.2em;
  height: 1.2em;
}

/* Sticky header */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  transition: transform 0.2s ease-in-out;
}
.sticky-header.hide-header { transform: translateY(-100%); }
.sticky-header.show-header  { transform: translateY(0); }

.app-main.pt-header { padding-top: 0.5rem; }

/* Quoted post box */
.quoted-post-box {
  border-color: var(--clr-border) !important;
  background-color: var(--clr-surface-2);
}

/* ─── Mobile bottom nav ─────────────────────────────────────────────────────── */
#mobileBottomNav {
  display: none; /* shown only inside the mobile media query below */
  justify-content: space-around;
  align-items: center;
  background: var(--ui-sidebar-bg);
  backdrop-filter: var(--ui-blur);
  -webkit-backdrop-filter: var(--ui-blur);
  border-top: 1px solid var(--clr-border);
  height: 56px;
  flex-shrink: 0; /* never shrink inside the flex-column body */
}

.mobile-nav-btn {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  height: 56px;
  color: var(--clr-text);
  font-size: 1.35rem;
  text-decoration: none;
  transition: color 0.15s, text-shadow 0.15s;
  background: none;
  border: none;
}
.mobile-nav-btn:hover,
.mobile-nav-btn:focus {
  color: var(--clr-cyan);
}
.mobile-nav-btn.active {
  color: var(--clr-cyan);
  text-shadow: var(--ui-icon-glow, none);
}

.mobile-top-nav {
  background: var(--ui-sidebar-bg);
  backdrop-filter: var(--ui-blur);
  -webkit-backdrop-filter: var(--ui-blur);
  border-bottom: 1px solid var(--clr-border);
}

/* The top nav's hamburger (and its invisible right-side twin) live in slots
   sized like one #mobileBottomNav column — five equal columns — so the
   hamburger centers exactly above the Home button instead of hugging the
   screen edge. */
.mobile-top-slot {
  width: 20%;
  display: flex;
  justify-content: center;
}

@media (max-width: 767px) {
  /* ── Safari toolbar collapse ──────────────────────────────────────────
     iOS Safari only shrinks its URL bar in response to the *document*
     scrolling. The old layout capped html/body at height:100% with
     overflow:hidden and delegated all scrolling to an inner div
     (body > .container-fluid { overflow-y: auto }) — that inner element's
     scroll position is invisible to Safari's chrome, so the toolbar never
     collapsed no matter how far the feed scrolled. There is deliberately no
     height/overflow rule on html or body below: they stay in normal flow,
     .container-fluid is never given its own overflow, and the page simply
     grows as tall as the feed requires with the document itself scrolling.
     (This also means -webkit-overflow-scrolling: touch is no longer
     needed anywhere — that was only for momentum-scrolling the old inner
     container; native document scroll already gets it for free.) ── */

  /* Sticky header stack (masquerade banner + mobile top nav, wrapped in
     .sticky-top-stack in the layout): pins to the top of the document
     scroll. Sticky — not fixed — because it's meant to participate in the
     normal box that pushes the feed down; a sibling `position: fixed`
     header would need the feed to carry matching top padding instead. */
  .sticky-top-stack {
    position: sticky;
    top: 0;
    z-index: 1030; /* below the toast layer (1090) and masquerade banner's own 1091 */
  }

  /* Bottom tab bar: fixed, not sticky. It has no natural place in document
     flow to "stick" to (it's the last element on the page, past the end of
     the feed) — position:fixed pins it to the visual viewport directly.
     Because it's fixed, it's taken out of flow entirely and adds zero
     height to the document, which is exactly why main needs the
     compensating padding-bottom below. */
  #mobileBottomNav {
    display: flex;
    position: fixed;
    inset-inline-start: 0;
    inset-inline-end: 0;
    bottom: 0;
    z-index: 1030;
    padding-bottom: env(safe-area-inset-bottom); /* clears the home-indicator area */
  }

  /* The fixed nav floats over whatever is under it unless something
     reserves its height. 56px matches #mobileBottomNav's own height above;
     env(safe-area-inset-bottom) matches the nav's own safe-area padding so
     the reserved space and the bar's actual footprint stay in sync.
     !important is required, not decorative: Bootstrap's own `.py-3`
     utility already on this element sets padding-bottom:1rem!important,
     and only another !important declaration can beat an !important one
     regardless of selector specificity. */
  .container-fluid main {
    padding-bottom: calc(56px + env(safe-area-inset-bottom)) !important;
  }

  /* min-vh-100 is still safe: the document is free to grow past it and
     scroll normally now. Swapped px-vh for dvh so the floor tracks
     Safari's *current* toolbar state — with plain 100vh this used to size
     against the toolbar-collapsed (largest) viewport, leaving a sliver of
     dead space under short feeds until the first scroll. */
  .row.min-vh-100 {
    min-height: 100dvh !important;
  }

  /* layouts/enroll.html.erb's split-screen shell (post-signup wizard,
     verification wizards) shared the old html/body overflow:hidden trap,
     which is why /verify/apply/tier's tall content used to get clipped —
     removing that trap above fixes it structurally. This just keeps short
     wizard steps pinned to the top instead of vertically centered. */
  .wizard-content-panel {
    align-items: flex-start !important;
  }

  /* Full-bleed composer on mobile (references/post-twitter.png,
     post-bluesky.png, post-threads.png all render as an edge-to-edge native
     screen, not a boxed dialog). modal-dialog-scrollable (added on the
     .modal-dialog itself, in _composer_modal.html.erb) already makes
     .modal-content a bounded flex column with .modal-body as the only
     scrolling region, so the header/footer stay pinned without any extra
     position:sticky here — this block only needs to remove the dialog's
     margin/rounding and let it fill the viewport. */
  #postComposerModal .modal-dialog {
    margin: 0;
    max-width: 100%;
    width: 100%;
    height: 100dvh;
  }
  #postComposerModal .modal-content {
    height: 100%;
    border-radius: 0;
    border: none;
  }
}

/* ─── Profile page (references/profile.png) ─────────────────────────────────── */
.profile-avatar {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 50%;
}

.profile-avatar-placeholder {
  background-color: var(--clr-surface-2);
  color: var(--clr-muted);
  font-size: 1.75rem;
}

.profile-display-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--clr-text);
  overflow-wrap: anywhere;
}

/* Name/@username block doubles as the About-this-profile modal trigger */
.profile-about-trigger {
  cursor: pointer;
}

/* Full-screen image lightbox (shared/image_lightbox_modal) — a
   dark viewer; click anywhere, the ✕, or Escape closes it. */
[data-lightbox-url] {
  cursor: zoom-in;
}

.image-lightbox-modal .modal-content {
  background: rgba(0, 0, 0, 0.92);
  cursor: zoom-out;
}

.image-lightbox-img {
  max-width: 100vw;
  max-height: 100vh;
  object-fit: contain;
}

.image-lightbox-close {
  position: absolute;
  top: 1rem;
  inset-inline-start: 1rem;
  z-index: 1;
  padding: 0.75rem;
}

/* "About this profile" modal (references/about-user.png) */
.about-profile-card {
  border: 1px solid var(--clr-border);
  border-radius: 12px;
  padding: 1rem;
}

.about-profile-avatar {
  width: 56px;
  height: 56px;
  object-fit: cover;
}

.profile-username {
  font-size: 0.95rem;
}

.profile-bio {
  color: var(--clr-text);
  font-size: 0.95rem;
}

.profile-bio p {
  margin-bottom: 0.25rem;
}

.profile-tag {
  background-color: var(--clr-cyan-dim);
  color: var(--clr-cyan);
  font-weight: 600;
  border-radius: 999px;
  padding: 0.35em 0.75em;
}

/* User-created topics (Zone#kind_user?) get the same neutral treatment as
   .zone-overflow-badge below, rather than the cyan-tinted pill — see
   ApplicationHelper#zone_link_classes. */
.profile-tag.zone-link-plain {
  background-color: var(--clr-surface-2);
  color: var(--clr-text);
}

/* "+N" overflow trigger for the profile zones row — a neutral/outlined pill
   (mirrors posts.css's .composer-pill treatment) so it reads as "more",
   not as an active zone like the cyan .profile-tag pills. Explicit
   background/border are needed since this is a <button>, not a <span> like
   .profile-tag, so it doesn't inherit default browser button chrome. */
.zone-overflow-badge {
  background-color: transparent;
  border: 1px solid var(--clr-border);
  color: var(--clr-text);
  font-weight: 600;
  border-radius: 999px;
  padding: 0.35em 0.75em;
  line-height: 1;
}
.zone-overflow-badge:hover,
.zone-overflow-badge:focus {
  border-color: var(--clr-cyan);
  color: var(--clr-cyan);
}

.profile-stats {
  font-size: 0.9rem;
}

/* Profile tabs (Posts/Replies/Media/Reposts) and the home feed's
   Following/For You — the same cyan glass pills as Studio, Syndication and
   the channel page, scrolling sideways on narrow screens. */
.profile-tabs {
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.profile-tabs .nav-link {
  white-space: nowrap;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 0;
  border-radius: 0.375rem;
  background: none;
  color: var(--clr-text);
  font-weight: 600;
}

.profile-tabs .nav-link:hover {
  color: var(--clr-cyan);
}

.profile-tabs .nav-link.active {
  background: var(--clr-cyan-dim);
  color: var(--clr-cyan);
  box-shadow: inset 0 0 0 1px rgba(0, 232, 255, 0.35);
}


/* ─── Schedule calendar (references/threads-schedule.png) ────────────────────── */
/* Rendered by posts/_schedule_fields + schedule_calendar_controller.js. */

.schedule-cal .cal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.schedule-cal .cal-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.schedule-cal .cal-nav {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--clr-text);
}

.schedule-cal .cal-nav:hover,
.schedule-cal .cal-nav:focus-visible {
  background: var(--clr-surface-2);
}

.schedule-cal .cal-week,
.schedule-cal .cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.schedule-cal .cal-dow {
  text-align: center;
  color: var(--clr-muted);
  font-size: 0.8rem;
  padding: 0.25rem 0;
}

.schedule-cal .cal-day {
  aspect-ratio: 1;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--clr-text);
  font-size: 0.9rem;
}

.schedule-cal .cal-day:hover:not(:disabled) {
  background: var(--clr-surface-2);
}

.schedule-cal .cal-day.is-outside,
.schedule-cal .cal-day:disabled {
  color: var(--clr-muted);
  opacity: 0.55;
}

.schedule-cal .cal-day.is-selected {
  background: var(--clr-text);
  color: var(--clr-bg);
  font-weight: 700;
}

.schedule-cal .cal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  border-top: 1px solid var(--clr-border);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
}

/* The "01 : 00 AM" pill — one control, like the reference — whose hour,
   minute and AM/PM are each a small chip with a caret, so it's clear each
   part can be changed. */
.schedule-cal .cal-time {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  background: var(--clr-bg);
  border-radius: 0.75rem;
  padding: 0.45rem 0.7rem;
  color: var(--clr-muted);
}

.schedule-cal .cal-time-select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--clr-border);
  border-radius: 0.4rem;
  background-color: var(--clr-surface-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239aa0a6' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.35rem center;
  background-size: 0.55rem;
  color: var(--clr-text);
  font-weight: 600;
  padding: 0.1rem 1.15rem 0.1rem 0.4rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.schedule-cal .cal-time-select:hover { border-color: rgba(0, 232, 255, 0.45); }
.schedule-cal .cal-time-select:focus-visible { outline: 2px solid var(--clr-cyan); outline-offset: 1px; }

/* Also used standalone by the edit form's "Publish Now" submit. */
.cal-done {
  border: 0;
  border-radius: 0;
  background: var(--clr-text);
  color: var(--clr-bg);
  font-weight: 700;
  padding: 0.45rem 1.1rem;
}

.schedule-cal .cal-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Glass badges — every status/label badge in UltrZn, UltrZn TV and UZ
   Studio (not /admin, which keeps its own light theme, and not the dark
   overlays on thumbnails): a translucent, color-tinted pill, the same
   recipe as the username badges and profile tags, instead of Bootstrap's
   solid fills. The text-bg-* (or older bg-*) class beside it picks the
   tint, so markup without this class still reads right. */
.badge-glass {
  --glass: #c9c9c9;
  background: color-mix(in srgb, var(--glass) 14%, transparent) !important;
  color: var(--glass) !important;
  border: 1px solid color-mix(in srgb, var(--glass) 32%, transparent);
  border-radius: 999px;
  font-weight: 600;
  backdrop-filter: var(--ui-blur);
  -webkit-backdrop-filter: var(--ui-blur);
}
.badge-glass.text-bg-info, .badge-glass.text-bg-primary,
.badge-glass.bg-info, .badge-glass.bg-primary { --glass: var(--clr-cyan); }
.badge-glass.text-bg-success, .badge-glass.bg-success { --glass: #3ddc84; }
.badge-glass.text-bg-warning, .badge-glass.bg-warning { --glass: #ffb020; }
.badge-glass.text-bg-danger, .badge-glass.bg-danger { --glass: #ff6b6b; }
.badge-glass.text-bg-light, .badge-glass.bg-light { --glass: #f2f2f2; }
.badge-glass.text-bg-secondary, .badge-glass.bg-secondary,
.badge-glass.bg-secondary-subtle { --glass: #a8a8a8; }
/* Vault-only, "Hidden": quieter than secondary. */
.badge-glass.text-bg-dark, .badge-glass.bg-dark { --glass: #8a8a8a; }

/* The line under a video's title in video lists (videos/_meta_line):
   channel + badge, views, time — one line, the channel name truncating. */
.video-meta-line {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  white-space: nowrap;
}
.video-meta-channel { min-width: 0; }
.video-meta-line .user-badges { flex-shrink: 0; }
/* The reaction widget's flame (ReactionsHelper#reaction_icon), outlined in
   the line's muted color — styled here too since reactions.css isn't on
   every page with a video list. */
.video-meta-line .rx-flame {
  width: 1em; height: 1em; margin-inline-end: 0.25rem;
  vertical-align: -0.125em; overflow: visible;
}
.video-meta-line .rx-flame .fo { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; }
.video-meta-line .rx-flame .fi { fill: none; }
/* On video cards the flame is in color — the selected reaction's gradient
   (reactions/_defs), solid orange where a page doesn't carry the defs. */
.video-card .video-meta-line .rx-flame .fo { fill: url(#rxFlameGradient) #ff8a00; stroke: #ff6a00; }
.video-card .video-meta-line .rx-flame .fi { fill: #ffe07a; }

/* The channel owner's "Post to <channel>…" prompt (user_channels/
   _composer_launch) — opens the shared composer as the channel, on the
   channel's Posts tab and in UZ Studio ▸ Content ▸ Posts. */
.channel-composer-launch {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 14px; text-align: start;
  color: var(--clr-muted); background: var(--clr-surface);
  border: 1px solid var(--clr-border); border-radius: 999px;
}
.channel-composer-launch:hover, .channel-composer-launch:focus-visible { color: var(--clr-text); border-color: rgba(0, 232, 255, 0.35); }
.channel-composer-launch .post-avatar { width: 32px; height: 32px; }

/* ─── Right-to-left (Arabic) ──────────────────────────────────────────────────
   Layout flips through Bootstrap's RTL build (LocaleHelper#bootstrap_css_url)
   and logical properties (margin-inline-start, inset-inline-end, text-align:
   start …) — use those, never left/right, in new CSS. What must NOT flip:
   media and time run left-to-right in every language (the video player, the
   swipeable media gallery whose JS scrolls by scrollLeft, the clip editor's
   range sliders). Directional icons mirror so "back" still points back. */
[dir="rtl"] mux-player,
[dir="rtl"] .post-media-gallery,
[dir="rtl"] [data-controller~="clip-editor"] input[type="range"] {
  direction: ltr;
}
[dir="rtl"] .fa-arrow-left,
[dir="rtl"] .fa-arrow-right,
[dir="rtl"] .fa-chevron-left,
[dir="rtl"] .fa-chevron-right,
[dir="rtl"] .fa-angle-left,
[dir="rtl"] .fa-angle-right,
[dir="rtl"] .fa-caret-left,
[dir="rtl"] .fa-caret-right,
[dir="rtl"] .fa-arrow-up-right-from-square,
[dir="rtl"] .fa-right-to-bracket,
[dir="rtl"] .fa-right-from-bracket {
  transform: scaleX(-1);
}

/* ─── Japanese and Korean line breaks ─────────────────────────────────────────
   Japanese has no spaces, so browsers break headings anywhere ("起きてい / る。").
   auto-phrase keeps phrases together (Chrome; others fall back to the normal
   break) — headings only, since long body text wraps better with the default.
   Korean words are space-separated, so keep-all keeps every word whole, body
   text included; break-word still wraps an overlong word (a URL). */
:lang(ja) :is(h1, h2, h3, h4, h5, h6, .display-1, .display-2, .display-3, .display-4, .display-5, .display-6) {
  word-break: auto-phrase;
}
:lang(ko) {
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* ── Navbar search box (shared/_search_box + search_box_controller.js) ──
   UltrZn TV now, UltrZn next. Logical properties, so it flips for Arabic.
   Below md it's an icon until opened (.search-box-open), then spans the
   navbar. */
.search-box { position: relative; flex: 1 1 auto; max-width: 560px; min-width: 0; margin-inline: 1rem; }
.search-box-field { position: relative; }
.search-box-icon {
  position: absolute; inset-inline-start: .75rem; top: 50%; transform: translateY(-50%);
  color: var(--bs-secondary-color); font-size: .85rem; pointer-events: none;
}
.search-box-input { padding-inline-start: 2.1rem; border-radius: 999px; }
.search-box-menu {
  position: absolute; top: calc(100% + 4px); inset-inline: 0;
  max-height: 70vh; overflow-y: auto; min-width: 260px;
}
.search-box-item { white-space: normal; }
.search-box-text { display: flex; flex-direction: column; min-width: 0; }
.search-box-label { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.search-box-sublabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 767.98px) {
  /* The icon sits with the other navbar icons on the end side: it takes the
     free space, so the next group's own auto margin mustn't split it. */
  .search-box { flex: 0 0 auto; margin-inline: auto .25rem; }
  .search-box + .ms-auto { margin-inline-start: 0 !important; }
  .search-box .search-box-field { display: none; }
  .search-box.search-box-open {
    position: absolute; inset: 0; z-index: 1031; margin: 0; max-width: none;
    display: flex; align-items: center; padding-inline: .5rem;
    background: var(--bs-body-bg);
  }
  .search-box.search-box-open .search-box-field { display: block; flex: 1; }
  .search-box.search-box-open .search-box-toggle { display: none; }
}

/* UltrZn's desktop sidebar box fills the column; the mobile top nav's sits
   in the right-hand slot and, opened, covers the whole bar. */
.search-box.search-box-sidebar { margin-inline: 0; max-width: none; flex: none; }
.search-box.search-box-mobile-top { margin: 0; }
.mobile-top-nav { position: relative; }

/* ── Search results (ultrzntv/search, search) ─────────────────────────── */
.search-channel-avatar { width: 56px; height: 56px; background-color: var(--clr-surface-2); }
.search-playlist-count { background: rgba(0, 0, 0, 0.7); }
