/* CrownCast Africa — UI */

:root {
  color-scheme: light dark;
  --cc-bg: Canvas;
  --cc-text: CanvasText;
  --cc-accent: #e8a317;
  --cc-accent-dim: color-mix(in oklab, #e8a317 65%, Canvas 35%);
  --border: color-mix(in oklab, CanvasText 14%, Canvas 86%);
  --muted: color-mix(in oklab, CanvasText 52%, Canvas 48%);
  --surface: color-mix(in oklab, CanvasText 4%, Canvas 96%);
  --shadow: 0 1px 3px color-mix(in oklab, CanvasText 12%, transparent);
  --radius: 14px;
  --radius-sm: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* Top bar: matches logo black and gold line */
  --header-bg: #0c0c10;
  --header-bg2: #12121a;
  --header-border: color-mix(in oklab, var(--cc-accent) 32%, #0a0a0c);
  --header-nav: rgba(247, 247, 252, 0.93);
  --header-nav-muted: rgba(186, 188, 202, 0.82);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  background: var(--cc-bg);
  color: var(--cc-text);
  line-height: 1.5;
}

/* ——— Header ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--header-border);
  background: linear-gradient(180deg, var(--header-bg2) 0%, var(--header-bg) 100%);
  box-shadow: 0 1px 0 color-mix(in oklab, var(--cc-accent) 12%, transparent);
}

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

.brand-lockup {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-sm);
  outline-offset: 4px;
  transition: transform 0.18s ease;
}

.brand-lockup:hover {
  transform: translateY(-1px);
}

.brand-lockup:hover .brand-logo-img {
  opacity: 0.95;
  filter: brightness(1.05);
}

.brand-lockup:hover .wm-crown {
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.45),
    0 0 32px rgba(232, 163, 23, 0.35);
}

.brand-lockup:hover .wm-cast {
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.35),
    0 0 26px rgba(232, 163, 23, 0.65);
}

.brand-lockup:hover .wm-africa {
  color: #47d696;
  text-shadow: 0 0 14px rgba(47, 181, 115, 0.35);
}

.brand-logo-img {
  display: block;
  flex-shrink: 0;
  height: clamp(44px, 10vw, 56px);
  width: auto;
  max-width: min(240px, 58vw);
  object-fit: contain;
}

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

/* Wordmark: Crown (light) + Cast (gold) / Africa (green) — matches logo lockup */
.brand-wordmark {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.06rem;
  min-width: 0;
  line-height: 1.02;
}

.brand-wordmark-title {
  display: block;
  font-weight: 800;
  font-size: clamp(1.15rem, 3.2vw, 1.5rem);
  letter-spacing: -0.04em;
}

.wm-crown {
  color: #f4f4f8;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.45),
    0 0 28px rgba(232, 163, 23, 0.22);
}

.wm-cast {
  color: #e8a317;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.35),
    0 0 20px rgba(232, 163, 23, 0.45);
}

.wm-africa {
  display: block;
  font-weight: 800;
  font-size: clamp(0.72rem, 2vw, 0.88rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #2fb573;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

@media (max-width: 380px) {
  .brand-lockup {
    gap: 0.45rem 0.65rem;
  }

  .brand-wordmark-title {
    font-size: 1.05rem;
  }
}

.brand {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: inherit;
}

.brand:hover {
  color: var(--cc-accent);
}

.brand-tag {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav-link {
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s, color 0.15s;
}

.site-header .nav-link {
  color: var(--header-nav);
}

.site-header .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.site-header .nav-link.is-active {
  background: color-mix(in oklab, var(--cc-accent) 42%, #1a1206);
  color: #fffaf0;
}

.site-header .nav-account {
  color: var(--header-nav-muted);
}

.nav-link:hover {
  background: var(--surface);
}

.nav-link.is-active {
  background: color-mix(in oklab, var(--cc-accent) 22%, Canvas 78%);
  color: inherit;
}

/* ——— Main ——— */
.site-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2.5rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem;
  margin-top: auto;
}

.site-footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.site-footer .sep {
  opacity: 0.5;
}

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

.small {
  font-size: 0.875rem;
}

/* ——— Page head ——— */
.page-head {
  margin-bottom: 1.5rem;
}

.page-head--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.page-lead {
  margin: 0;
  font-size: 0.95rem;
}

.page-lead a {
  color: inherit;
  font-weight: 600;
}

/* ——— Cards & surfaces ——— */
.card {
  background: var(--cc-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem;
  box-shadow: var(--shadow);
}

.card.elevated {
  box-shadow:
    var(--shadow),
    0 12px 40px color-mix(in oklab, CanvasText 8%, transparent);
}

.toolbar-card {
  padding: 0.85rem 1rem;
}

.table-wrap {
  overflow-x: auto;
  padding: 0;
}

.table-wrap .table {
  margin: 0;
}

/* ——— Home hero ——— */
.home-hero {
  background: linear-gradient(
    145deg,
    color-mix(in oklab, var(--cc-accent) 12%, Canvas 88%) 0%,
    color-mix(in oklab, CanvasText 6%, Canvas 94%) 45%,
    var(--cc-bg) 100%
  );
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.home-kicker {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--muted);
}

.home-title {
  font-size: clamp(1.85rem, 4vw, 2.4rem);
  font-weight: 800;
  margin: 0 0 0.6rem;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.home-section {
  margin-bottom: 2rem;
}

.home-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}

.home-section-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.home-section-head a {
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}

.home-section-head a:hover {
  text-decoration: underline;
}

/* ——— Rail ——— */
.rail {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.rail::-webkit-scrollbar {
  height: 7px;
}

.rail::-webkit-scrollbar-thumb {
  background: color-mix(in oklab, CanvasText 22%, Canvas 78%);
  border-radius: 99px;
}

.rail-card {
  flex: 0 0 156px;
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
  display: grid;
  gap: 0.45rem;
  transition: transform 0.15s;
}

.rail-card:hover {
  transform: translateY(-2px);
}

.rail-thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
}

.rail-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rail-thumb-ph {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    color-mix(in oklab, CanvasText 14%, Canvas 86%),
    color-mix(in oklab, CanvasText 6%, Canvas 94%)
  );
}

.rail-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 7px;
  border-radius: 6px;
  background: color-mix(in oklab, CanvasText 88%, transparent);
  color: Canvas;
}

.rail-name {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ——— Watch grid ——— */
.grid-watch {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 920px) {
  .grid-watch {
    grid-template-columns: minmax(280px, 380px) 1fr;
  }
}

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

.grow {
  flex: 1;
  min-width: 140px;
}

.ch-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
  max-height: min(70vh, 560px);
  overflow-y: auto;
}

.ch-btn {
  width: 100%;
  display: flex;
  gap: 0.65rem;
  align-items: center;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  background: var(--cc-bg);
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ch-btn:hover {
  border-color: color-mix(in oklab, var(--cc-accent) 45%, var(--border));
}

.ch-btn.is-active {
  border-color: var(--cc-accent);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--cc-accent) 35%, transparent);
}

.logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.logo.placeholder {
  display: inline-block;
  min-width: 40px;
  background: var(--surface);
}

.player-wrap {
  margin-top: 0.75rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}

.player {
  width: 100%;
  display: block;
}

video.player {
  min-height: 200px;
}

audio.player {
  margin: 0;
  padding: 0.75rem;
  background: var(--surface);
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  border: 1px solid var(--border);
  cursor: pointer;
  font-family: inherit;
  background: var(--cc-bg);
  color: inherit;
  transition: transform 0.1s, box-shadow 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(
    165deg,
    color-mix(in oklab, var(--cc-accent) 95%, #000 5%),
    color-mix(in oklab, var(--cc-accent) 75%, #000 25%)
  );
  color: #1a1206;
  border-color: transparent;
  box-shadow: 0 2px 8px color-mix(in oklab, var(--cc-accent) 35%, transparent);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

/* ——— Forms ——— */
input[type="text"],
input[type="search"],
input[type="password"],
input[type="number"],
input[type="file"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--cc-bg);
  color: inherit;
  font: inherit;
}

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

.admin-form {
  display: grid;
  gap: 0.85rem;
}

.admin-form label {
  display: grid;
  gap: 0.35rem;
}

code {
  font-size: 0.85em;
  padding: 0.1em 0.35em;
  border-radius: 6px;
  background: var(--surface);
}

/* ——— Tables ——— */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th,
.table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.table thead th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
  color: var(--muted);
  background: var(--surface);
}

.table-striped tbody tr:nth-child(even) {
  background: color-mix(in oklab, CanvasText 3%, Canvas 97%);
}

.pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--surface);
}

.link-edit {
  font-weight: 700;
  color: inherit;
}

.link-edit:hover {
  color: var(--cc-accent);
}

/* ——— Login / install ——— */
.login-card {
  max-width: 420px;
  margin: 2rem auto;
}

.error {
  color: #c62828;
  font-weight: 600;
}

.flash {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-weight: 600;
}

.flash-ok {
  background: color-mix(in oklab, #2e7d32 18%, Canvas 82%);
  border: 1px solid color-mix(in oklab, #2e7d32 35%, transparent);
}

.flash-neutral {
  background: var(--surface);
  border: 1px solid var(--border);
}

.flash-warn {
  background: color-mix(in oklab, #e65100 14%, Canvas 86%);
  border: 1px solid color-mix(in oklab, #e65100 32%, transparent);
  color: var(--cc-text);
}

/* ——— RTMP credentials (admin) ——— */
.credential-card {
  border-color: color-mix(in oklab, var(--cc-accent) 28%, var(--border));
  background: color-mix(in oklab, var(--cc-accent) 6%, var(--cc-bg));
}

.credential-grid {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .credential-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.credential-field {
  display: grid;
  gap: 0.35rem;
  margin: 0;
}

.credential-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.credential-input {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.8rem;
  cursor: text;
  width: 100%;
}

hr.admin-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.85rem 0;
}

/* ——— Admin shell ——— */
.admin-shell {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 880px) {
  .admin-shell {
    grid-template-columns: 220px 1fr;
    align-items: start;
  }
}

.admin-aside-inner {
  position: sticky;
  top: 5rem;
}

.admin-aside-title {
  margin: 0 0 0.65rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.admin-menu {
  display: grid;
  gap: 0.2rem;
}

.admin-menu-link {
  display: block;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  color: inherit;
}

.admin-menu-link:hover {
  background: var(--surface);
}

.admin-panel {
  min-width: 0;
}

/* ——— Dashboard ——— */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.dash-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.15rem;
  transition: transform 0.15s, border-color 0.15s;
}

.dash-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in oklab, var(--cc-accent) 45%, var(--border));
}

.dash-card-title {
  font-weight: 800;
  font-size: 1.05rem;
}

.nav-account {
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.35rem 0.5rem;
}

.engage-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1rem;
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}

.engage-sep {
  user-select: none;
}

.btn-small {
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
}

.btn-subscribed {
  border-color: color-mix(in oklab, var(--cc-accent) 55%, var(--border));
  background: color-mix(in oklab, var(--cc-accent) 14%, Canvas);
}

.ffmpeg-box {
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.45;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  resize: vertical;
}

/* ——— Focus ——— */
:focus-visible {
  outline: 2px solid var(--cc-accent);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

/* ——— Netflix-style browse shell (logo colours preserved) ——— */
body.browse-ui {
  color-scheme: dark;
  --cc-bg: #0b0b0f;
  --cc-text: #e8e8ed;
  --border: rgba(255, 255, 255, 0.12);
  --muted: #a3a3b0;
  --surface: rgba(255, 255, 255, 0.06);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  background: var(--cc-bg);
  color: var(--cc-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.browse-ui .site-header {
  border-bottom-color: rgba(232, 163, 23, 0.22);
  background: linear-gradient(180deg, #14141c 0%, #0a0a0e 100%);
}

body.browse-ui .site-main {
  flex: 1;
  width: 100%;
  max-width: min(1920px, 100%);
  margin: 0 auto;
  padding: 0.75rem clamp(1rem, 4vw, 3.5rem) 3rem;
  box-sizing: border-box;
}

body.browse-ui .site-footer {
  border-top-color: rgba(255, 255, 255, 0.08);
  background: #070709;
}

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

body.browse-ui .home-section {
  padding-left: 0;
  padding-right: 0;
  margin-bottom: 2.25rem;
}

body.browse-ui .browse-live-strip {
  padding: 0.5rem 0 0;
  margin-bottom: 0.25rem;
}

body.browse-ui .browse-live-strip-inner {
  padding-left: 0;
  padding-right: 0;
}

body.browse-ui .browse-strip-hint {
  margin: -0.25rem 0 0.85rem;
  max-width: 52rem;
}

body.browse-ui .browse-rail-section .home-section-head {
  margin-bottom: 0.65rem;
}

body.browse-ui .home-section-more {
  font-weight: 700;
  font-size: 0.88rem;
  color: rgba(232, 163, 23, 0.95);
  text-decoration: none;
}

body.browse-ui .home-section-more:hover {
  text-decoration: underline;
}

body.browse-ui .home-section-title {
  font-size: clamp(1.05rem, 1.35vw, 1.35rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Hero band */
.browse-hero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  min-height: clamp(300px, 42vh, 520px);
  display: flex;
  align-items: flex-end;
  padding: 2.5rem clamp(1rem, 4vw, 3.5rem) 3rem;
  margin-bottom: 2.5rem;
  overflow: hidden;
}

.browse-hero-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 80% at 0% 0%, rgba(232, 163, 23, 0.18), transparent 55%),
    radial-gradient(ellipse 80% 60% at 100% 20%, rgba(47, 181, 115, 0.12), transparent 50%),
    linear-gradient(195deg, #16161f 0%, #0b0b0f 38%, #050506 100%);
  pointer-events: none;
}

.browse-hero-gradient::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    #0b0b0f 0%,
    rgba(11, 11, 15, 0.72) 28%,
    transparent 62%
  );
}

.browse-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 36rem;
}

.browse-hero-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244, 244, 248, 0.88);
}

.browse-hero-kicker-gold {
  color: #e8a317;
}

.browse-hero-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.85rem, 4.2vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.08;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.55);
}

.browse-hero-lead {
  margin: 0 0 1.35rem;
  font-size: clamp(0.95rem, 1.35vw, 1.1rem);
  line-height: 1.55;
  color: rgba(232, 232, 237, 0.82);
  max-width: 34rem;
}

.browse-hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

body.browse-ui .btn-hero-primary {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(232, 163, 23, 0.28);
}

body.browse-ui .btn-hero-ghost {
  padding: 0.75rem 1.35rem;
  font-size: 1rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f4f4f8;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
}

body.browse-ui .btn-hero-ghost:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

/* Rails on dark canvas */
body.browse-ui .rail {
  gap: 0.85rem;
  padding-bottom: 0.65rem;
}

body.browse-ui .rail-card {
  flex: 0 0 clamp(148px, 14vw, 200px);
}

body.browse-ui .rail-thumb {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

body.browse-ui .rail-card:hover .rail-thumb {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

body.browse-ui .rail-card--offline .rail-thumb img,
body.browse-ui .rail-card--offline .rail-thumb-ph {
  filter: grayscale(0.35) brightness(0.78);
}

body.browse-ui .rail-card--offline:hover .rail-thumb img,
body.browse-ui .rail-card--offline:hover .rail-thumb-ph {
  filter: grayscale(0.2) brightness(0.88);
}

.rail-signal {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 8px 4px 7px;
  border-radius: 4px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.rail-signal-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2fb573;
  box-shadow: 0 0 0 2px rgba(47, 181, 115, 0.35);
  animation: cc-live-pulse 1.6s ease-in-out infinite;
}

@keyframes cc-live-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.75;
    transform: scale(0.92);
  }
}

.rail-signal--live {
  background: rgba(8, 12, 10, 0.92);
  color: #e8fff1;
  border: 1px solid rgba(47, 181, 115, 0.55);
}

.rail-signal--offline {
  background: rgba(28, 12, 12, 0.92);
  color: #ffc9c9;
  border: 1px solid rgba(198, 40, 40, 0.45);
}

.rail-signal--radio {
  background: rgba(20, 20, 28, 0.92);
  color: rgba(232, 163, 23, 0.95);
  border: 1px solid rgba(232, 163, 23, 0.35);
}

body.browse-ui .rail-badge {
  background: rgba(0, 0, 0, 0.72);
  color: #f4f4f8;
}

.rail-meta-line {
  display: block;
  line-height: 1.35;
}

/* Watch page — live / offline chips */
.ch-btn {
  align-items: flex-start;
}

.ch-btn-body {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
  text-align: left;
}

.ch-btn-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ch-btn-top strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ch-signal {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ch-signal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2fb573;
  animation: cc-live-pulse 1.6s ease-in-out infinite;
}

.ch-signal--live {
  background: color-mix(in oklab, #2fb573 22%, Canvas);
  color: inherit;
  border: 1px solid color-mix(in oklab, #2fb573 45%, var(--border));
}

.ch-signal--offline {
  background: color-mix(in oklab, #c62828 16%, Canvas);
  border: 1px solid color-mix(in oklab, #c62828 28%, var(--border));
}

.ch-signal--radio {
  background: color-mix(in oklab, #e8a317 18%, Canvas);
  border: 1px solid color-mix(in oklab, #e8a317 35%, var(--border));
}

.ch-btn--offline {
  opacity: 0.92;
}

.ch-btn--offline:not(.is-active):hover {
  opacity: 1;
}

/* ——— browse-ui: cards, forms, admin, watch (shared dark shell) ——— */
body.browse-ui .browse-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: min(70vh, 560px);
  padding: 1rem 0 2rem;
}

body.browse-ui .login-card {
  width: 100%;
  max-width: 420px;
}

body.browse-ui .card {
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--border);
  color: var(--cc-text);
  box-shadow: var(--shadow);
}

body.browse-ui .card.elevated {
  box-shadow:
    var(--shadow),
    0 16px 48px rgba(0, 0, 0, 0.35);
}

body.browse-ui .page-head {
  margin-bottom: 1.35rem;
}

body.browse-ui .page-title {
  color: #f4f4f8;
}

body.browse-ui .toolbar-card {
  background: rgba(255, 255, 255, 0.04);
}

body.browse-ui .toolbar .btn {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: #f0f0f5;
}

body.browse-ui .toolbar .btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

body.browse-ui .btn:not(.btn-primary):not(.btn-hero-ghost) {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border);
  color: #f0f0f5;
}

body.browse-ui .btn:not(.btn-primary):not(.btn-hero-ghost):hover {
  background: rgba(255, 255, 255, 0.12);
}

body.browse-ui input[type="text"],
body.browse-ui input[type="search"],
body.browse-ui input[type="password"],
body.browse-ui input[type="number"],
body.browse-ui input[type="email"],
body.browse-ui input[type="file"],
body.browse-ui select,
body.browse-ui textarea {
  background: rgba(0, 0, 0, 0.35);
  border-color: var(--border);
  color: var(--cc-text);
}

body.browse-ui select option {
  background: #14141c;
  color: #e8e8ed;
}

body.browse-ui code {
  background: rgba(255, 255, 255, 0.08);
  color: #f0e6d2;
}

body.browse-ui .site-main a {
  color: #e8c468;
}

body.browse-ui .site-main a:hover {
  color: #ffe9a8;
}

body.browse-ui .site-main .btn,
body.browse-ui .site-main .btn-primary,
body.browse-ui .site-main .brand-lockup,
body.browse-ui .site-main .nav-link,
body.browse-ui .site-main .rail-card,
body.browse-ui .site-main .dash-card,
body.browse-ui .site-main .admin-menu-link,
body.browse-ui .site-main .home-section-more {
  color: inherit;
}

body.browse-ui .site-main .link-edit {
  color: #e8c468;
}

body.browse-ui .site-main .link-edit:hover {
  color: #e8a317;
}

body.browse-ui .site-main .btn-primary {
  color: #1a1206;
}

body.browse-ui .site-main .btn-hero-ghost {
  color: #f4f4f8;
}

body.browse-ui .ch-signal--live {
  background: rgba(47, 181, 115, 0.2);
  color: #e8fff1;
  border: 1px solid rgba(47, 181, 115, 0.5);
}

body.browse-ui .ch-signal--offline {
  background: rgba(198, 40, 40, 0.22);
  color: #ffc9c9;
  border: 1px solid rgba(198, 40, 40, 0.45);
}

body.browse-ui .ch-signal--radio {
  background: rgba(232, 163, 23, 0.16);
  color: #ffe9c2;
  border: 1px solid rgba(232, 163, 23, 0.42);
}

body.browse-ui .grid-watch {
  gap: 1.35rem;
}

body.browse-ui .player-wrap {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

body.browse-ui audio.player {
  background: rgba(255, 255, 255, 0.06);
}

body.browse-ui .engage-strip {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border);
}

body.browse-ui .flash-ok {
  background: rgba(47, 181, 115, 0.14);
  border-color: rgba(47, 181, 115, 0.35);
  color: var(--cc-text);
}

body.browse-ui .flash-neutral {
  background: rgba(255, 255, 255, 0.05);
}

body.browse-ui .flash-warn {
  background: rgba(230, 81, 0, 0.16);
  border-color: rgba(230, 81, 0, 0.35);
  color: var(--cc-text);
}

body.browse-ui .table thead th {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

body.browse-ui .table-striped tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

body.browse-ui .pill {
  background: rgba(255, 255, 255, 0.08);
  color: var(--cc-text);
}

body.browse-ui .admin-aside-inner.card {
  background: rgba(255, 255, 255, 0.045);
}

body.browse-ui .admin-menu-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

body.browse-ui .credential-card {
  background: rgba(232, 163, 23, 0.08);
  border-color: rgba(232, 163, 23, 0.28);
}

body.browse-ui .ffmpeg-box {
  background: rgba(0, 0, 0, 0.35);
  border-color: var(--border);
  color: #e2e2ea;
}

body.browse-ui .btn-subscribed {
  background: rgba(232, 163, 23, 0.14);
  border-color: rgba(232, 163, 23, 0.4);
}

body.browse-ui hr.admin-divider {
  border-top-color: var(--border);
}

body.browse-ui .home-hero {
  background: linear-gradient(
    145deg,
    rgba(232, 163, 23, 0.12) 0%,
    rgba(255, 255, 255, 0.04) 45%,
    rgba(11, 11, 15, 0.96) 100%
  );
  border-color: var(--border);
}
