:root {
  --bg: #08111f;
  --panel: rgba(7, 16, 32, 0.88);
  --panel-soft: rgba(12, 24, 44, 0.72);
  --border: rgba(157, 196, 255, 0.16);
  --text: #eff6ff;
  --muted: #9cb3d1;
  --accent: #56e39f;
  --accent-strong: #2fc77e;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  height: 100vh;
  overflow: hidden;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(86, 227, 159, 0.14), transparent 30%),
    radial-gradient(circle at top right, rgba(88, 164, 255, 0.16), transparent 32%),
    linear-gradient(135deg, #050b16 0%, #0b1729 55%, #111f34 100%);
}

body.manage-page {
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
}

body.watch-view-page {
  min-height: 100vh;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
}

body.blog-public-page {
  min-height: 100vh;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  background: #07101c;
}

.app-shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  min-height: 100vh;
}

.control-panel,
.dashboard {
  padding: 24px;
}

.manage-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.admin-shell {
  place-items: stretch;
  grid-template-columns: 246px minmax(0, 1fr);
  gap: 0;
  padding: 0;
}

.admin-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 100vh;
  padding: 0;
  border-radius: 0;
  background: #141414;
  border-right: 1px solid #2b2b2b;
  box-shadow: none;
  backdrop-filter: none;
}

.admin-sidebar-head h2 {
  margin: 10px 0 0;
  font-size: 1.1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.admin-sidebar-head {
  padding: 20px 22px;
  border-top: 2px solid #ff0f23;
  border-bottom: 1px solid #2b2b2b;
  background: #101010;
}

.admin-brand {
  margin: 0;
  color: #ff0f23;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.01em;
}

.admin-nav {
  display: grid;
  gap: 1px;
  background: #2b2b2b;
}

.admin-nav-link,
.admin-side-action {
  display: block;
  padding: 14px 18px;
  border: 0;
  background: #1f1f1f;
  color: #f3f3f3;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.98rem;
}

.admin-nav-link.is-active {
  background: #ff0f23;
  color: #ffffff;
}

.admin-sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 1px;
  background: #2b2b2b;
}

.manage-panel {
  width: min(760px, 100%);
  padding: 24px;
  border-radius: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.admin-shell .manage-panel {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  padding: 0;
  border-radius: 0;
  border: 0;
  background: #1f1f1f;
  box-shadow: none;
  backdrop-filter: none;
}

.admin-shell .manage-panel > .panel-header {
  padding: 22px 28px;
  border-top: 2px solid #ff0f23;
  border-bottom: 1px solid #2b2b2b;
  background: #101010;
}

.admin-shell .manage-panel > :not(.panel-header) {
  margin-left: 28px;
  margin-right: 28px;
}

.admin-shell .manage-panel > .stream-form,
.admin-shell .manage-panel > .fixture-section,
.admin-shell .manage-panel > .bulk-import-panel,
.admin-shell .manage-panel > .panel-actions {
  margin-top: 18px;
}

.admin-shell .panel-header h1 {
  margin: 6px 0 0;
  font-size: 2rem;
  text-transform: uppercase;
}

.admin-shell .subtitle,
.admin-shell .tips p {
  color: #a9a9a9;
}

.admin-shell .eyebrow,
.admin-shell .card-kicker {
  color: #ff0f23;
}

.admin-shell .stream-entry,
.admin-shell .fixture-card,
.admin-shell .stream-form.watch-form,
.admin-shell .fixture-section,
.admin-shell .bulk-import-panel {
  border-radius: 0;
  border: 1px solid #2b2b2b;
  background: #232323;
}

.admin-shell .field-label {
  color: #ffffff;
  font-weight: 700;
}

.admin-shell input,
.admin-shell select,
.admin-shell textarea {
  border: 1px solid #343434;
  background: #3a3a3a;
  color: #ffffff;
}

.admin-shell .primary-btn {
  background: #ff0f23;
  color: #ffffff;
}

.admin-shell .secondary-btn {
  background: #2b2b2b;
  color: #ffffff;
  border-color: #3a3a3a;
}

.watch-public-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.watch-public-nav a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.seo-form {
  padding-bottom: 32px;
}

.seo-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.seo-textarea,
.code-input,
.blog-content-input {
  height: auto;
  resize: vertical;
  line-height: 1.55;
}

.code-input {
  min-height: 220px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.88rem;
}

.blog-content-input {
  min-height: 420px;
}

.form-notice {
  padding: 13px 16px;
  border: 1px solid;
  font-weight: 700;
}

.form-notice.is-success {
  border-color: rgba(86, 227, 159, 0.45);
  background: rgba(86, 227, 159, 0.12);
  color: #c9f9e0;
}

.form-notice.is-error {
  border-color: rgba(255, 72, 88, 0.5);
  background: rgba(255, 72, 88, 0.12);
  color: #ffd4d8;
}

.blog-admin-list {
  display: grid;
  gap: 10px;
  margin-top: 24px;
  padding-bottom: 40px;
}

.blog-admin-item {
  border: 1px solid #343434;
  background: #232323;
}

.blog-admin-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  padding: 12px 16px;
  cursor: pointer;
}

.blog-admin-item summary span:first-child {
  display: grid;
  gap: 5px;
}

.blog-admin-item summary small {
  color: #a9a9a9;
}

.blog-admin-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid #343434;
}

.blog-admin-actions form {
  margin: 0;
}

.blog-public-header {
  width: min(1120px, calc(100% - 40px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--border);
}

.blog-brand {
  font-size: 1.45rem;
}

.blog-public-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.blog-public-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.blog-public-nav a:hover,
.blog-public-nav a[aria-current="page"] {
  color: var(--accent);
}

.blog-public-main {
  width: min(960px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 80px;
}

.blog-index-head {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.blog-index-head h1,
.blog-article h1,
.blog-empty-state h1 {
  margin: 8px 0 12px;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.blog-public-list {
  display: grid;
  gap: 0;
}

.blog-public-card {
  display: grid;
  gap: 12px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}

.blog-public-card time,
.blog-article time {
  color: var(--muted);
  font-size: 0.9rem;
}

.blog-public-card h2 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: 0;
}

.blog-public-card h2 a,
.blog-read-link,
.blog-back-link {
  color: var(--text);
  text-decoration: none;
}

.blog-public-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.blog-read-link,
.blog-back-link {
  width: fit-content;
  color: var(--accent);
  font-weight: 800;
}

.blog-article {
  max-width: 780px;
  margin: 0 auto;
}

.blog-article .eyebrow {
  margin-top: 36px;
}

.blog-lead {
  margin: 28px 0;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: #cbd9ea;
  font-size: 1.1rem;
  line-height: 1.7;
}

.blog-copy {
  color: #e4edf8;
  font-size: 1.02rem;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.blog-empty-state {
  display: grid;
  gap: 20px;
  justify-items: start;
}

.watch-panel {
  width: min(900px, 100%);
}

.auth-panel {
  width: min(520px, 100%);
}

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

.auth-error {
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(255, 107, 107, 0.26);
  background: rgba(255, 107, 107, 0.08);
  color: #ffd3d3;
}

.auth-success {
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(86, 227, 159, 0.24);
  background: rgba(86, 227, 159, 0.1);
  color: #d9ffec;
}

.watch-view-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  min-height: 100vh;
  height: auto;
}

.watch-main-panel {
  min-width: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
}

.watch-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  min-height: 0;
}

.watch-chat-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 100vh;
  padding: 18px 18px 16px;
  background: var(--panel);
  border-left: 1px solid var(--border);
  gap: 14px;
}

.watch-chat-head {
  margin: 0;
}

.chat-list {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.chat-message {
  border: 1px solid var(--border);
  background: rgba(2, 6, 14, 0.9);
  padding: 10px 12px;
}

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

.chat-message-author {
  font-size: 0.92rem;
}

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

.chat-message-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

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

.chat-input {
  width: 100%;
  resize: none;
  min-height: 90px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: rgba(2, 6, 14, 0.9);
  color: var(--text);
  font: inherit;
}

.chat-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.watch-links {
  margin-top: 0;
}

.admin-links {
  margin-top: 24px;
}

.ads-grid {
  display: grid;
  gap: 14px;
}

.ads-card-title {
  margin: 0 0 8px;
  font-size: 1rem;
}

.watch-fixture-section {
  margin-top: 0;
}

.watch-fixture-list {
  padding-bottom: 8px;
}

.watch-player-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  padding-bottom: 16px;
}

.watch-player-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
}

.watch-player-head h2 {
  margin: 6px 0 0;
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.watch-player-frame {
  flex: 1 1 auto;
  min-height: 420px;
  padding: 0 20px;
}

.watch-media,
.watch-player-empty {
  width: 100%;
  height: 100%;
  min-height: 420px;
  background: #02060e;
  border: 1px solid var(--border);
}

.watch-media {
  display: flex;
}

.watch-player-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
}

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

.channel-list-empty {
  min-height: 88px;
}

.channel-card {
  min-width: 0;
  position: relative;
}

.channel-open {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-height: 88px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: #101925;
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.channel-open:hover {
  border-color: rgba(87, 224, 154, 0.55);
  background: #132233;
}

.channel-title {
  min-width: 0;
  width: 100%;
  font-weight: 800;
  line-height: 1.2;
}

.channel-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.channel-status {
  padding: 3px 7px;
  border: 1px solid rgba(87, 224, 154, 0.3);
  background: rgba(87, 224, 154, 0.15);
  color: #87f0ba;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.channel-share-btn {
  position: absolute;
  right: 10px;
  bottom: 9px;
  z-index: 2;
  min-width: 68px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(116, 174, 255, 0.38);
  background: #172840;
  color: #a9ceff;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.channel-share-btn:hover,
.channel-share-btn:focus-visible {
  border-color: #74aeff;
  background: #203754;
  color: #fff;
}

.watch-overview-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.watch-overview-card {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  background: #02060e;
  cursor: pointer;
}

.watch-overview-title {
  min-width: 0;
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.2;
  font-weight: 800;
  color: var(--text);
}

.watch-overview-header {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 6px 5px 10px;
}

.watch-overview-header .channel-share-btn {
  position: static;
  flex: 0 0 auto;
}

.watch-overview-media {
  flex: 1 1 auto;
  min-height: 0;
  background: #000;
}

.banner-slot {
  flex: 0 0 96px;
  min-height: 96px;
  padding: 0 20px 16px;
}

.banner-slot-top {
  padding-top: 0;
}

.banner-slot-bottom {
  padding-top: 16px;
  padding-bottom: 0;
}

.banner-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border: 1px solid var(--border);
  background: #000;
}

.banner-link {
  text-decoration: none;
}

.banner-link.is-inactive {
  cursor: default;
}

.ad-overlay {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
}

.ad-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.ad-skip-btn {
  position: absolute;
  right: 16px;
  top: 16px;
  min-width: 94px;
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(5, 11, 22, 0.84);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.ad-skip-btn:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.confirm-modal[hidden] {
  display: none;
}

.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
}

.confirm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 14, 0.78);
}

.confirm-modal-card {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--border);
  background: #101925;
  box-shadow: var(--shadow);
}

.confirm-modal-card h2 {
  margin: 0;
  font-size: 1.45rem;
}

.control-panel {
  backdrop-filter: blur(18px);
  background: var(--panel);
  border-right: 1px solid var(--border);
}

.compact-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
}

.dashboard {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100vh;
  position: relative;
}

.dashboard-full {
  height: 100vh;
  padding: 0;
}

.panel-header h1,
.dashboard-header h2 {
  margin: 6px 0 10px;
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  line-height: 1;
}

.watch-home-link {
  color: inherit;
  text-decoration: none;
}

.subtitle,
.tips p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.eyebrow,
.card-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.74rem;
  color: var(--accent);
}

.stream-form {
  margin-top: 28px;
}

.stream-inputs {
  display: grid;
  gap: 12px;
}

.stream-entry {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
}

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

.device-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.accordion-head {
  align-items: stretch;
}

.device-toggle-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.device-toggle-main {
  display: grid;
  gap: 4px;
}

.device-toggle-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 800;
}

.device-entry-body {
  display: grid;
  gap: 14px;
}

.device-entry-body[hidden] {
  display: none;
}

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

.device-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

.user-2fa-box {
  display: grid;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.user-inline-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.inline-check input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.user-2fa-box .panel-actions > form,
.user-entry-form > .panel-actions > form {
  flex: 1;
}

.user-2fa-box .panel-actions button,
.user-entry-form > .panel-actions button {
  width: 100%;
}

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

.field-label {
  font-size: 0.92rem;
  color: #d8e7ff;
}

.stream-url {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--text);
  font: inherit;
}

select.stream-url {
  appearance: none;
}

.stream-url:focus {
  outline: 2px solid rgba(86, 227, 159, 0.25);
  border-color: rgba(86, 227, 159, 0.5);
}

.panel-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.primary-btn,
.secondary-btn {
  flex: 1;
  min-height: 46px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #04110b;
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
}

.tips {
  margin-top: 18px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.stacked-actions {
  flex-direction: column;
}

.action-link {
  width: 100%;
}

.watch-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(170px, 0.55fr) minmax(140px, 0.4fr) minmax(220px, 0.85fr);
  gap: 12px;
}

.kumanda-panel {
  display: grid;
  gap: 18px;
  margin-bottom: 28px;
}

.kumanda-topbar {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: end;
}

.kumanda-select-field {
  margin: 0;
}

.kumanda-meta {
  display: grid;
  gap: 6px;
  min-height: 64px;
  align-content: start;
}

.kumanda-meta .subtitle {
  margin: 0;
}

.kumanda-player-shell {
  min-height: 0;
}

.kumanda-player-shell .watch-media {
  min-height: 300px;
  max-height: 300px;
  aspect-ratio: 16 / 9;
}

.kumanda-controls-shell {
  display: flex;
  justify-content: center;
  min-height: 184px;
  align-items: flex-start;
}

.kumanda-control-grid {
  grid-template-columns: repeat(3, minmax(72px, 96px));
  gap: 8px;
  padding: 10px;
  width: 304px;
}

.kumanda-control-grid.is-offline {
  opacity: 0.72;
}

.kumanda-control-grid .device-command-btn {
  min-width: 72px;
  min-height: 40px;
  font-size: 0.82rem;
}

.fixture-section {
  margin-top: 24px;
}

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

.fixture-section-head h2 {
  margin: 0;
  font-size: 1.1rem;
}

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

.fixture-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.035);
}

.fixture-open,
.fixture-delete {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.fixture-open {
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 0;
  background: transparent;
  color: var(--text);
}

.fixture-open-full {
  width: 100%;
}

.fixture-open.is-selected {
  color: #ffffff;
}

.fixture-open.is-selected .fixture-title {
  color: var(--accent);
}

.fixture-title {
  font-weight: 800;
}

.fixture-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.fixture-time,
.fixture-date,
.fixture-channel-name {
  color: var(--muted);
  font-size: 0.9rem;
}

.fixture-live {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  background: rgba(86, 227, 159, 0.16);
  border: 1px solid rgba(86, 227, 159, 0.22);
  color: #b9f7d7;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.fixture-live[hidden] {
  display: none !important;
}

.fixture-delete {
  min-width: 72px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  flex: 0 0 auto;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(5, 11, 22, 0.94) 0%, rgba(5, 11, 22, 0.62) 72%, rgba(5, 11, 22, 0) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.dashboard:hover .dashboard-header,
.dashboard:focus-within .dashboard-header {
  opacity: 1;
  pointer-events: auto;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.layout-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.layout-btn {
  min-width: 42px;
  height: 34px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.layout-btn-wide {
  padding: 0 12px;
}

.layout-btn.is-active {
  background: rgba(86, 227, 159, 0.16);
  color: var(--text);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(86, 227, 159, 0.12);
  border: 1px solid rgba(86, 227, 159, 0.2);
  color: #b9f7d7;
  font-weight: 700;
}

.stream-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
  height: 100vh;
}

.stream-grid.layout-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
}

.stream-grid.layout-6 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
}

.stream-grid.layout-8 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
}

.stream-grid.layout-12 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
}

.stream-grid.layout-focus {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
}

.stream-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  padding: 0;
  border-radius: 0;
  background: rgba(6, 14, 28, 0.8);
  border: 0;
  box-shadow: none;
  position: relative;
}

.stream-grid.layout-focus .stream-card:first-child {
  grid-column: 2 / span 2;
  grid-row: 1 / span 2;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  padding: 6px 8px 4px;
  flex: 0 0 auto;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.1;
}

.device-status {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.focus-btn {
  display: none;
  height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(86, 227, 159, 0.3);
  background: rgba(4, 10, 20, 0.9);
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.open-link {
  color: #dffceb;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
}

.stream-grid.layout-focus .stream-card:hover .focus-btn,
.stream-grid.layout-focus .stream-card.is-featured .focus-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.frame-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  border: 0;
  background: #02060e;
  flex: 1 1 auto;
  min-height: 0;
}

.stream-media {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.stream-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 0;
}

.stream-video {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
  object-fit: contain;
}

.device-hover-controls {
  position: absolute;
  inset: 10px;
  z-index: 4;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.stream-card:hover .device-hover-controls,
.stream-card:focus-within .device-hover-controls {
  opacity: 1;
  pointer-events: auto;
}

.device-control-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(64px, auto));
  gap: 8px;
  padding: 10px;
  background: rgba(5, 11, 22, 0.86);
  border: 1px solid var(--border);
}

.device-command-btn {
  min-width: 74px;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.device-command-back {
  grid-column: 1 / -1;
}

.device-control-grid .device-command-btn[data-command="up"] {
  grid-column: 2;
  grid-row: 1;
}

.device-control-grid .device-command-btn[data-command="left"] {
  grid-column: 1;
  grid-row: 2;
}

.device-control-grid .device-command-ok {
  grid-column: 2;
  grid-row: 2;
}

.device-control-grid .device-command-btn[data-command="right"] {
  grid-column: 3;
  grid-row: 2;
}

.device-control-grid .device-command-btn[data-command="down"] {
  grid-column: 2;
  grid-row: 3;
}

.device-command-back {
  grid-row: 4;
}

.device-hover-controls.is-offline .device-control-grid {
  opacity: 0.72;
}

.device-command-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.watch-player-audio-row {
  padding: 10px 20px 0;
  display: flex;
  justify-content: flex-end;
}

.player-audio-controls {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  background: rgba(10, 18, 32, 0.92);
  color: var(--text);
}

.player-audio-controls.is-disabled {
  opacity: 0.55;
}

.player-audio-btn {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  white-space: nowrap;
}

.player-audio-btn:disabled {
  cursor: default;
}

.player-volume-slider {
  width: 120px;
  accent-color: var(--accent);
}

@media (max-width: 1100px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    min-height: auto;
  }

  .control-panel {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .watch-view-shell {
    grid-template-columns: 1fr;
  }

  .watch-chat-panel {
    min-height: auto;
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 760px) {
  body,
  body.watch-view-page,
  body.blog-public-page {
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
  }

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

  .blog-public-header {
    width: calc(100% - 28px);
    min-height: auto;
    padding: 16px 0;
    align-items: flex-start;
    flex-direction: column;
  }

  .blog-public-main {
    width: calc(100% - 28px);
    padding: 36px 0 60px;
  }

  .blog-admin-item summary {
    align-items: flex-start;
  }

  .stream-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    height: auto;
    min-height: 100vh;
  }

  .panel-actions,
  .header-actions,
  .dashboard-header {
    flex-direction: column;
    align-items: stretch;
  }

  .layout-switcher {
    justify-content: space-between;
    width: 100%;
  }

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

  .kumanda-topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .kumanda-player-shell .watch-media {
    min-height: 240px;
    max-height: 240px;
  }

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

  .watch-view-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: auto;
  }

  .watch-main-panel {
    display: flex;
    flex-direction: column;
    min-height: auto;
  }

  .watch-sidebar {
    order: 2;
    gap: 14px;
    padding: 16px;
    overflow: visible;
    border-right: 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }

  .watch-chat-panel {
    order: 3;
    display: flex;
    flex-direction: column;
    padding: 16px;
    border-left: 0;
    border-top: 1px solid var(--border);
    max-height: none;
    min-height: auto;
  }

  .watch-player-panel {
    order: 1;
    padding-bottom: 12px;
    min-height: auto;
  }

  .watch-player-head {
    flex-direction: column;
    align-items: stretch;
    padding: 16px 16px 10px;
  }

  .watch-player-head h2 {
    font-size: 1.85rem;
  }

  .player-audio-controls {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .watch-player-audio-row {
    padding: 10px 16px 0;
    justify-content: stretch;
  }

  .banner-slot {
    flex-basis: 72px;
    min-height: 72px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .watch-player-frame {
    padding: 0 16px;
    min-height: 260px;
  }

  .watch-media,
  .watch-player-empty {
    min-height: 260px;
  }

  .watch-overview-card {
    min-height: 170px;
  }

  .watch-overview-media {
    min-height: 120px;
  }

  .watch-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    height: auto;
  }

  .channel-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-list {
    max-height: none;
    min-height: 180px;
  }

  .chat-input {
    min-height: 72px;
  }

  .chat-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .stream-grid.layout-6,
  .stream-grid.layout-8,
  .stream-grid.layout-12,
  .stream-grid.layout-focus {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(auto-fit, minmax(0, 1fr));
  }

  .stream-grid.layout-focus .stream-card:first-child {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .device-hover-controls {
    inset: 6px;
    justify-content: center;
    align-items: center;
    opacity: 1;
    pointer-events: auto;
  }

  .device-control-grid {
    grid-template-columns: repeat(3, minmax(54px, 1fr));
    width: min(100%, 220px);
    padding: 8px;
    gap: 6px;
  }

  .kumanda-control-grid {
    width: min(100%, 320px);
    grid-template-columns: repeat(3, minmax(60px, 1fr));
    padding: 10px;
    gap: 8px;
  }

  .device-command-btn {
    min-width: 0;
    min-height: 34px;
    font-size: 0.78rem;
  }
}

@media (max-width: 520px) {
  body,
  body.watch-view-page {
    overflow-y: auto;
    height: auto;
  }

  .stream-grid {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }

  .stream-grid.layout-4,
  .stream-grid.layout-6,
  .stream-grid.layout-8,
  .stream-grid.layout-12,
  .stream-grid.layout-focus {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(auto-fit, minmax(0, 1fr));
  }

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

  .channel-list {
    grid-template-columns: 1fr;
  }

  .watch-sidebar,
  .watch-chat-panel {
    padding: 14px;
  }

  .watch-player-head {
    padding: 14px 14px 10px;
  }

  .watch-player-frame {
    padding: 0 14px;
    min-height: 220px;
  }

  .watch-media,
  .watch-player-empty,
  .watch-overview-media {
    min-height: 220px;
  }

  .watch-player-head h2 {
    font-size: 1.55rem;
    line-height: 1.12;
  }

  .watch-player-head .status-pill,
  #active-fixture-channel {
    align-self: flex-start;
  }

  .banner-slot {
    padding-left: 14px;
    padding-right: 14px;
    flex-basis: 60px;
    min-height: 60px;
  }

  .player-audio-controls {
    gap: 8px;
    padding: 8px 10px;
  }

  .player-volume-slider {
    width: 100%;
  }

  .channel-open {
    min-height: 72px;
  }

  .watch-sidebar .panel-header h1,
  #watch-page-title {
    font-size: 2rem;
    line-height: 1.05;
  }

  .watch-sidebar .panel-header .subtitle {
    font-size: 0.95rem;
    line-height: 1.4;
  }

  .card-top {
    padding-right: 6px;
  }

  .device-hover-controls {
    inset: auto 6px 6px 6px;
    align-items: flex-end;
  }

  .device-control-grid {
    width: 100%;
    max-width: none;
  }
}
