/* ==========================================================================
   WORLD TV — components
   ========================================================================== */

/* Buttons ---------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    transform var(--dur-fast) var(--ease), color var(--dur) var(--ease);
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--border-strong);
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}

.btn--primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 26px -14px rgba(229, 9, 20, 0.9);
}

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

.btn--ghost {
  background: transparent;
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.07);
}

.btn--danger {
  background: transparent;
  border-color: rgba(255, 90, 90, 0.4);
  color: var(--danger);
}

.btn--danger:hover {
  background: rgba(255, 90, 90, 0.12);
  border-color: var(--danger);
}

.btn--sm {
  min-height: 34px;
  padding: 0 13px;
  font-size: 12.5px;
}

.btn--block {
  width: 100%;
}

.btn--icon {
  width: 42px;
  padding: 0;
}

/* Badges ----------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-sub);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  line-height: 1.5;
  white-space: nowrap;
}

.badge--live {
  color: #fff;
  background: var(--accent);
  border-color: transparent;
  letter-spacing: 0.14em;
}

.badge--live::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  animation: pulse-soft 1.8s infinite;
}

.badge--ok {
  color: var(--success);
  border-color: rgba(56, 211, 159, 0.35);
  background: rgba(56, 211, 159, 0.12);
}

.badge--warn {
  color: var(--warning);
  border-color: rgba(243, 178, 60, 0.35);
  background: rgba(243, 178, 60, 0.1);
}

.badge--danger {
  color: var(--danger);
  border-color: rgba(255, 90, 90, 0.35);
  background: rgba(255, 90, 90, 0.1);
}

.badge--muted {
  color: var(--text-mute);
}

.badge--accent {
  color: var(--accent-hover);
  border-color: rgba(229, 9, 20, 0.35);
  background: var(--accent-soft);
}

.badge--country {
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--text-sub);
}

/* Chips ------------------------------------------------------------------ */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 13px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-sub);
  font-size: 12.5px;
  font-weight: 600;
  transition: all var(--dur) var(--ease);
}

.chip:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.08);
}

.chip.is-active {
  color: #fff;
  background: var(--accent);
  border-color: transparent;
}

.chip__count {
  font-size: 11px;
  opacity: 0.7;
  font-family: var(--font-mono);
}

.chip--static {
  pointer-events: none;
}

/* Channel card ----------------------------------------------------------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease),
    background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  will-change: transform;
}

.card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--border-strong);
  background: var(--card-hover);
  box-shadow: var(--shadow);
}

.card:focus-within {
  border-color: var(--accent);
}

.card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(100% 120% at 50% 0%, rgba(255, 255, 255, 0.055), transparent 70%),
    linear-gradient(160deg, #232733 0%, #14161e 100%);
  overflow: hidden;
}

[data-theme="light"] .card__thumb {
  background: linear-gradient(160deg, #eef1f7 0%, #e3e7f0 100%);
}

.card__logo {
  max-width: 74%;
  max-height: 76%;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.45));
  transition: transform var(--dur-slow) var(--ease-out);
}

.card:hover .card__logo {
  transform: scale(1.06);
}

.card__placeholder {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-strong);
  color: var(--text-sub);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.card__badges {
  position: absolute;
  top: 9px;
  left: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: calc(100% - 56px);
}

.card__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(6, 7, 11, 0.42);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.card:hover .card__play,
.card:focus-within .card__play {
  opacity: 1;
}

.card__play span {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 26px -8px rgba(0, 0, 0, 0.8);
}

.card__play svg {
  width: 20px;
  height: 20px;
  margin-left: 2px;
}

.card__fav {
  position: absolute;
  top: 7px;
  right: 7px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(9, 10, 14, 0.6);
  border: 1px solid var(--border);
  color: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(6px);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease),
    transform var(--dur-fast) var(--ease);
}

.card__fav:hover {
  color: #fff;
  background: rgba(229, 9, 20, 0.9);
  transform: scale(1.08);
}

.card__fav svg {
  width: 16px;
  height: 16px;
}

.card__fav.is-fav {
  color: var(--accent-hover);
  border-color: rgba(229, 9, 20, 0.5);
  background: rgba(9, 10, 14, 0.75);
}

.card__fav.is-fav svg {
  fill: currentColor;
}

.card__body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 13px 14px 15px;
  min-width: 0;
}

.card__title {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 2.7em;
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 8px;
  font-size: 11.5px;
  color: var(--text-mute);
}

.card__meta .sep {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.6;
}

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

/* List / row view -------------------------------------------------------- */
.list {
  display: grid;
  gap: 8px;
}

.row {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--card);
  border: 1px solid var(--border);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
    transform var(--dur-fast) var(--ease);
}

.row:hover {
  background: var(--card-hover);
  border-color: var(--border-strong);
}

.row__logo {
  width: 56px;
  height: 40px;
  object-fit: contain;
  border-radius: var(--radius-xs);
  background: rgba(0, 0, 0, 0.25);
  padding: 4px;
}

.row__logo--placeholder {
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-mute);
  background: var(--bg-3);
  border: 1px solid var(--border);
}

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

.row__title {
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 9px;
  font-size: 11.5px;
  color: var(--text-mute);
}

.row__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.row__link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.row__actions,
.row__fav,
.row__actions * {
  position: relative;
  z-index: 2;
}

.row__fav {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--text-mute);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.row__fav:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.row__fav svg {
  width: 16px;
  height: 16px;
}

.row__fav.is-fav {
  color: var(--accent-hover);
}

.row__fav.is-fav svg {
  fill: currentColor;
}

/* Toolbar & filters ------------------------------------------------------ */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--border);
}

.toolbar__group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toolbar__spacer {
  flex: 1 1 20px;
}

.toolbar__meta {
  font-size: 12px;
  color: var(--text-mute);
  white-space: nowrap;
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field__label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13.5px;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.textarea {
  min-height: 160px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.65;
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-mute);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-2);
}

.select {
  appearance: none;
  padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-mute) 50%),
    linear-gradient(135deg, var(--text-mute) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.field--inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field--inline .field__label {
  margin: 0;
  white-space: nowrap;
}

.search-field {
  position: relative;
  flex: 1 1 220px;
  min-width: 0;
}

.search-field svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-mute);
  pointer-events: none;
}

.search-field .input {
  padding-left: 36px;
}

.view-toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--bg-3);
  border: 1px solid var(--border);
}

.view-toggle button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 30px;
  border-radius: var(--radius-pill);
  color: var(--text-mute);
  transition: all var(--dur) var(--ease);
}

.view-toggle button svg {
  width: 16px;
  height: 16px;
}

.view-toggle button.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

/* Switch ----------------------------------------------------------------- */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 25px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid var(--border);
  transition: background var(--dur) var(--ease);
}

.switch::after {
  content: "";
  position: absolute;
  left: 2px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--dur) var(--ease);
}

.switch[aria-checked="true"] {
  background: var(--accent);
  border-color: transparent;
}

.switch[aria-checked="true"]::after {
  transform: translateX(19px);
}

/* Empty state ------------------------------------------------------------ */
.empty {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 10px;
  padding: clamp(32px, 6vw, 72px) 24px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-strong);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent);
}

.empty__icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-sub);
  margin-bottom: 4px;
}

.empty__icon svg {
  width: 22px;
  height: 22px;
}

.empty__title {
  font-size: 16px;
  font-weight: 800;
}

.empty__text {
  max-width: 54ch;
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.8;
}

.empty__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

/* Skeleton --------------------------------------------------------------- */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.045) 25%,
    rgba(255, 255, 255, 0.1) 37%,
    rgba(255, 255, 255, 0.045) 63%
  );
  background-size: 220% 100%;
  animation: shimmer 1.5s infinite linear;
  border-radius: var(--radius-sm);
}

.skeleton--card {
  aspect-ratio: 16 / 11;
  border-radius: var(--radius);
}

.skeleton--text {
  height: 14px;
}

.skeleton--line {
  height: 10px;
}

.skeleton--chip {
  height: 32px;
  width: 88px;
  border-radius: var(--radius-pill);
}

.skeleton-card-wrap {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 10px;
  display: grid;
  gap: 0;
}

/* Spinner ---------------------------------------------------------------- */
.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.spinner--lg {
  width: 34px;
  height: 34px;
  border-width: 3px;
}

.loading-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-sub);
}

/* Modal ------------------------------------------------------------------ */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  padding: clamp(12px, 4vw, 40px);
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 8, 0.78);
  backdrop-filter: blur(6px);
  animation: fade-in var(--dur) var(--ease);
}

.modal__dialog {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(86vh, 900px);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: fade-up var(--dur) var(--ease-out);
}

.modal--wide .modal__dialog {
  width: min(1080px, 100%);
}

.modal__head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--border);
}

.modal__title {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
}

.modal__sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-mute);
}

.modal__close {
  margin-left: auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--text-sub);
  flex-shrink: 0;
}

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

.modal__close svg {
  width: 18px;
  height: 18px;
}

.modal__body {
  padding: 18px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  gap: 16px;
  align-content: start;
}

.modal__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
}

/* Toast ------------------------------------------------------------------ */
.toast-region {
  position: fixed;
  right: clamp(12px, 2vw, 24px);
  bottom: clamp(12px, 2vw, 24px);
  z-index: var(--z-toast);
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 24px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border-radius: var(--radius);
  background: rgba(22, 25, 33, 0.97);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
  pointer-events: auto;
  animation: fade-up var(--dur) var(--ease-out);
}

.toast::before {
  content: "";
  width: 4px;
  align-self: stretch;
  border-radius: 4px;
  background: var(--info);
  flex-shrink: 0;
}

.toast--success::before {
  background: var(--success);
}

.toast--error::before {
  background: var(--danger);
}

.toast--warning::before {
  background: var(--warning);
}

.toast__body {
  min-width: 0;
}

.toast__title {
  font-weight: 700;
  margin-bottom: 2px;
}

.toast__text {
  color: var(--text-sub);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: all var(--dur) var(--ease);
}

/* Search overlay --------------------------------------------------------- */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
}

.search-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 8, 0.72);
  backdrop-filter: blur(8px);
}

.search-overlay__panel {
  position: relative;
  z-index: 1;
  width: min(880px, calc(100vw - 24px));
  margin: clamp(12px, 7vh, 90px) auto 0;
  max-height: min(76vh, 780px);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: fade-up var(--dur) var(--ease-out);
}

.search-overlay__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.search-overlay__head svg {
  width: 18px;
  height: 18px;
  color: var(--text-mute);
  flex-shrink: 0;
}

.search-overlay__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 16px;
  padding: 6px 0;
}

.search-overlay__input:focus {
  outline: none;
}

.search-overlay__hint {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border-strong);
  color: var(--text-mute);
  white-space: nowrap;
}

.search-overlay__body {
  overflow-y: auto;
  padding: 10px;
  overscroll-behavior: contain;
}

.search-overlay__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 8px 10px;
  font-size: 11.5px;
  color: var(--text-mute);
}

.search-result {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  text-align: left;
  transition: background var(--dur) var(--ease);
}

.search-result:hover,
.search-result.is-focused {
  background: rgba(255, 255, 255, 0.06);
}

.search-result__logo {
  width: 44px;
  height: 32px;
  object-fit: contain;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.25);
}

.search-result__title {
  font-size: 13.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result__meta {
  font-size: 11px;
  color: var(--text-mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-overlay__suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
}

/* Tabs ------------------------------------------------------------------- */
.tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-pill);
  background: var(--bg-2);
  border: 1px solid var(--border);
  overflow-x: auto;
  max-width: 100%;
}

.tab {
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-sub);
  white-space: nowrap;
  transition: all var(--dur) var(--ease);
}

.tab:hover {
  color: var(--text);
}

.tab.is-active {
  background: var(--accent);
  color: #fff;
}

/* Banner ----------------------------------------------------------------- */
.banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 15px;
  border-radius: var(--radius);
  background: rgba(90, 169, 255, 0.08);
  border: 1px solid rgba(90, 169, 255, 0.22);
  color: var(--text-sub);
  font-size: 12.5px;
  line-height: 1.7;
}

.banner svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--info);
}

.banner--warn {
  background: rgba(243, 178, 60, 0.08);
  border-color: rgba(243, 178, 60, 0.26);
}

.banner--warn svg {
  color: var(--warning);
}

.banner strong {
  color: var(--text);
}

/* Stats ------------------------------------------------------------------ */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.stat {
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--border);
}

.stat__value {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat__label {
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mute);
}

/* Settings --------------------------------------------------------------- */
.settings {
  display: grid;
  gap: 18px;
}

.settings__section {
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--border);
  overflow: hidden;
}

.settings__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}

.settings__head h2 {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.settings__head svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

.settings__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}

.settings__row:last-child {
  border-bottom: 0;
}

.settings__row-main {
  min-width: 200px;
  flex: 1;
}

.settings__label {
  font-size: 13.5px;
  font-weight: 700;
}

.settings__desc {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-mute);
  line-height: 1.6;
  max-width: 62ch;
}

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

.settings__control .select,
.settings__control .input {
  width: auto;
  min-width: 160px;
}

.settings__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px;
}

.range {
  -webkit-appearance: none;
  appearance: none;
  width: 180px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.16);
  outline: none;
}

.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid #fff;
}

.range::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.about-list {
  display: grid;
  gap: 12px;
}

.about-list__item {
  display: grid;
  gap: 3px;
}

.about-list__item dt {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.about-list__item dd {
  margin: 0;
  font-size: 13px;
  color: var(--text-sub);
  overflow-wrap: anywhere;
}

.about-list__item a {
  color: var(--info);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Playlist --------------------------------------------------------------- */
.playlist-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--border);
}

.playlist-card.is-disabled {
  opacity: 0.66;
}

.playlist-card__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.playlist-card__title {
  font-size: 14.5px;
  font-weight: 800;
}

.playlist-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--text-mute);
}

.playlist-card__url {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-mute);
  overflow-wrap: anywhere;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 7px 9px;
}

.playlist-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.playlist-card__tail {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: clamp(24px, 5vw, 44px) 20px;
  border-radius: var(--radius);
  border: 1.5px dashed var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
  cursor: pointer;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-sub);
}

.dropzone__icon svg {
  width: 20px;
  height: 20px;
}

.dropzone__title {
  font-size: 14px;
  font-weight: 700;
}

.dropzone__hint {
  font-size: 12px;
  color: var(--text-mute);
}

.import-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.import-panel {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 1px solid var(--border);
  align-content: start;
}

.import-panel h3 {
  font-size: 13.5px;
  font-weight: 800;
}

.import-panel p {
  font-size: 12px;
  color: var(--text-mute);
  line-height: 1.7;
}

.import-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.channel-admin {
  display: grid;
  gap: 6px;
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 4px;
}

.channel-admin__row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  background: var(--bg-3);
  border: 1px solid var(--border);
}

.channel-admin__row img {
  width: 40px;
  height: 28px;
  object-fit: contain;
}

/* EPG guide -------------------------------------------------------------- */
.guide {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-2);
  overflow: hidden;
}

.guide__scroll {
  overflow: auto;
  max-height: min(66vh, 760px);
  overscroll-behavior: contain;
}

.guide__inner {
  position: relative;
  min-width: 900px;
}

.guide__timeline {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding-left: var(--guide-channel-w, 190px);
}

.guide__tick {
  flex: 1 0 0;
  padding: 9px 8px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-mute);
  border-left: 1px solid var(--border);
  white-space: nowrap;
}

.guide__tick--now {
  color: var(--accent-hover);
  font-weight: 700;
}

.guide__row {
  position: relative;
  display: grid;
  grid-template-columns: var(--guide-channel-w, 190px) minmax(0, 1fr);
  border-bottom: 1px solid var(--border);
  min-height: 62px;
}

.guide__row:last-child {
  border-bottom: 0;
}

.guide__channel {
  position: sticky;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  min-width: 0;
}

.guide__channel img {
  width: 38px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.guide__channel-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.guide__channel-code {
  font-size: 10px;
  color: var(--text-mute);
  font-family: var(--font-mono);
}

.guide__slots {
  position: relative;
  min-height: 62px;
}

.guide__program {
  position: absolute;
  top: 5px;
  bottom: 5px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text);
  text-align: left;
  overflow: hidden;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.guide__program:hover {
  background: var(--card-hover);
  border-color: var(--border-strong);
}

.guide__program.is-current {
  background: var(--accent-soft);
  border-color: rgba(229, 9, 20, 0.4);
}

.guide__program-title {
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guide__program-time {
  font-size: 10px;
  color: var(--text-mute);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.guide__nowline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  z-index: 4;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(229, 9, 20, 0.25);
}

.guide__empty-slot {
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  padding-left: 10px;
  font-size: 11.5px;
  color: var(--text-mute);
}

/* Program detail --------------------------------------------------------- */
.program-detail {
  display: grid;
  gap: 12px;
}

.program-detail__time {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12.5px;
  color: var(--text-sub);
  font-family: var(--font-mono);
}

.program-detail__desc {
  font-size: 13px;
  line-height: 1.85;
  color: var(--text-sub);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Tags ------------------------------------------------------------------- */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Load more -------------------------------------------------------------- */
.load-more {
  display: grid;
  place-items: center;
  padding: 22px 0 4px;
  gap: 8px;
}

.load-more__text {
  font-size: 11.5px;
  color: var(--text-mute);
}

/* Inline definition list ------------------------------------------------ */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px 18px;
}

.meta-grid__item {
  display: grid;
  gap: 2px;
}

.meta-grid__label {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.meta-grid__value {
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
