html:has(body.fiptv-standalone-body) {
  background: #f4f8ff;
  overflow-x: hidden;
}

body.fiptv-standalone-body {
  margin: 0 !important;
  padding: 0 !important;
  background: #f4f8ff !important;
  overflow-x: hidden !important;
}

body.fiptv-standalone-body #wpadminbar { position: fixed; }

.fiptv-shell,
.fiptv-shell * { box-sizing: border-box; }

.fiptv-shell {
  --page: #f4f8ff;
  --page2: #eef4ff;
  --panel: #ffffff;
  --panel2: #f8fbff;
  --text: #111827;
  --muted: #607089;
  --line: rgba(28, 47, 80, .12);
  --brand: #18b7ff;
  --brand2: #865dff;
  --accent: #31d083;
  --danger: #ef4444;
  width: 100%;
  max-width: 100%;
  min-height: 100svh;
  overflow-x: clip;
  background:
    radial-gradient(circle at 8% 0%, rgba(24,183,255,.26), transparent 34rem),
    radial-gradient(circle at 96% 0%, rgba(134,93,255,.24), transparent 34rem),
    linear-gradient(180deg, #ffffff 0%, var(--page) 28%, #eef6ff 100%);
  color: var(--text);
  clear: both;
  isolation: isolate;
}

.fiptv-shell h1,
.fiptv-shell h2,
.fiptv-shell h3,
.fiptv-shell p,
.fiptv-shell figure,
.fiptv-shell ul,
.fiptv-shell ol { margin-top: 0; }

.fiptv-shell button,
.fiptv-shell input,
.fiptv-shell select,
.fiptv-shell textarea { font: inherit; }

.fiptv-shell button {
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  margin: 0;
}

.fiptv-app {
  width: min(100%, 1240px);
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(14px, 2vw, 28px);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.45;
}

.fiptv-layout-boxed .fiptv-app {
  width: min(1180px, calc(100vw - 24px));
  min-height: 80vh;
  border-radius: 28px;
  margin: 18px auto;
  overflow: hidden;
}

.fiptv-hero,
.fiptv-player-wrap,
.fiptv-toolbar,
.fiptv-listbar,
.fiptv-grid {
  width: 100%;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.fiptv-hero { margin-bottom: clamp(14px, 2vw, 22px); }

.fiptv-hero__content,
.fiptv-player-wrap,
.fiptv-toolbar,
.fiptv-listbar,
.fiptv-card,
.fiptv-empty {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(34, 62, 108, .08);
}

.fiptv-hero__content {
  position: relative;
  overflow: hidden;
  border-radius: clamp(22px, 2vw, 32px);
  padding: clamp(24px, 4.2vw, 58px);
  min-width: 0;
  background:
    linear-gradient(135deg, rgba(24,183,255,.98), rgba(134,93,255,.94)),
    var(--panel);
  color: #fff;
}

.fiptv-hero__content::after {
  content: "";
  position: absolute;
  inset: auto -70px -150px auto;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: rgba(255,255,255,.20);
  pointer-events: none;
}

.fiptv-hero h1 {
  position: relative;
  z-index: 1;
  color: #fff !important;
  font-size: clamp(38px, 5.2vw, 74px);
  line-height: .96;
  letter-spacing: -0.06em;
  margin: 16px 0 18px;
  max-width: 820px;
  font-weight: 950;
}

.fiptv-hero p {
  position: relative;
  z-index: 1;
  color: rgba(255,255,255,.88) !important;
  font-size: clamp(15px, 1.25vw, 18px);
  max-width: 760px;
  margin: 0;
}

.fiptv-hero__actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.fiptv-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255,255,255,.35);
  color: #fff;
  background: rgba(255,255,255,.18);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
}

.fiptv-pill--soft {
  color: #fff;
  border-color: rgba(255,255,255,.26);
  background: rgba(255,255,255,.14);
}

.fiptv-muted { color: rgba(255,255,255,.88); }

.fiptv-btn,
.fiptv-open-current {
  cursor: pointer;
  text-decoration: none !important;
  border-radius: 999px;
  padding: 13px 18px;
  min-height: 44px;
  color: var(--text) !important;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  white-space: nowrap;
}

.fiptv-btn--primary {
  background: #fff;
  color: #0f172a !important;
}

.fiptv-btn--ghost,
.fiptv-open-current,
.fiptv-btn--small {
  border: 1px solid var(--line) !important;
  background: var(--panel2) !important;
  color: var(--text) !important;
}

.fiptv-btn--small {
  min-height: 36px;
  padding: 9px 13px;
  font-size: 13px;
}

.fiptv-player-wrap {
  border-radius: clamp(20px, 2vw, 30px);
  padding: clamp(10px, 1.1vw, 14px);
  display: block;
  margin-bottom: clamp(12px, 1.6vw, 18px);
}

.fiptv-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 330px;
  border-radius: clamp(16px, 1.5vw, 22px);
  overflow: hidden;
  background: #05070d;
}

.fiptv-player video,
.fiptv-player iframe {
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  display: block;
  background: #05070d;
}

.fiptv-player-source {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 5;
  color: #fff !important;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  text-decoration: none !important;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(0,0,0,.16);
}

.fiptv-player__placeholder {
  width: 100%;
  height: 100%;
  min-height: 330px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  text-align: center;
  padding: 24px;
  color: rgba(255,255,255,.72);
  background:
    radial-gradient(circle at center, rgba(24,183,255,.18), transparent 32rem),
    linear-gradient(135deg, #0b1220, #05070d);
}

.fiptv-player__placeholder strong { color: #fff; font-size: 20px; }
.fiptv-player__placeholder span { max-width: 620px; }
.fiptv-player__placeholder--error .fiptv-play-icon { background: rgba(239,68,68,.18); color: #fecaca; }

.fiptv-play-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-weight: 900;
  font-size: 22px;
}

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

.fiptv-nowbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 6px 2px;
  min-width: 0;
}

.fiptv-nowbar .fiptv-pill { color: var(--brand2); border-color: rgba(134,93,255,.2); background: rgba(134,93,255,.08); }

.fiptv-nowbar h2 {
  color: var(--text) !important;
  font-size: clamp(22px, 2.4vw, 34px);
  line-height: 1.02;
  letter-spacing: -.04em;
  margin: 9px 0 4px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.fiptv-nowbar p { color: var(--muted) !important; margin: 0; }

.fiptv-toolbar {
  border-radius: clamp(20px, 2vw, 26px);
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  overflow: hidden;
  position: sticky;
  top: 0;
  z-index: 9;
}

.admin-bar .fiptv-toolbar { top: 32px; }

.fiptv-search { min-width: 0; }

.fiptv-search input {
  width: 100%;
  max-width: none !important;
  border: 1px solid var(--line) !important;
  background: #f8fbff !important;
  color: var(--text) !important;
  border-radius: 999px !important;
  min-height: 44px;
  padding: 0 14px !important;
  outline: 0;
  box-shadow: none !important;
}

.fiptv-search input::placeholder { color: #8b98ad; }

.fiptv-groups {
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 6px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.fiptv-chip {
  flex: 0 0 auto;
  cursor: pointer;
  border: 1px solid var(--line) !important;
  color: var(--muted) !important;
  background: #f8fbff !important;
  border-radius: 999px !important;
  padding: 9px 12px !important;
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
}

.fiptv-chip.is-active {
  color: #fff !important;
  border-color: transparent !important;
  background: linear-gradient(135deg, var(--brand), var(--brand2)) !important;
}

.fiptv-listbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-radius: 18px;
  padding: 10px 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
}

.fiptv-listbar__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.fiptv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: clamp(9px, 1vw, 13px);
  align-items: stretch;
  padding-bottom: 28px;
}

.fiptv-card {
  width: 100%;
  min-width: 0;
  color: var(--text) !important;
  border-radius: 18px !important;
  padding: 12px !important;
  display: grid !important;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  text-align: left !important;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
  position: relative;
  min-height: 78px;
  content-visibility: auto;
  contain-intrinsic-size: 78px;
}

.fiptv-card:hover { transform: translateY(-1px); background: #f7fbff !important; }
.fiptv-card.is-active { border-color: rgba(24,183,255,.72) !important; box-shadow: 0 0 0 2px rgba(24,183,255,.12); }

.fiptv-card__logo {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  overflow: hidden;
  background: #eef4ff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand2);
  font-weight: 900;
  line-height: 1;
}

.fiptv-card__logo img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  padding: 7px;
}

.fiptv-card__body { min-width: 0; padding-right: 44px; }

.fiptv-card__body strong {
  display: block;
  color: var(--text) !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
  line-height: 1.25;
  font-weight: 950;
}

.fiptv-card__body span {
  color: var(--muted) !important;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-top: 4px;
}

.fiptv-card em {
  position: absolute;
  top: 9px;
  right: 9px;
  font-size: 10px;
  line-height: 1;
  font-style: normal;
  color: #64748b;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 6px;
  max-width: 58px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fiptv-empty {
  grid-column: 1 / -1;
  border-radius: 20px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 760px) {
  .fiptv-app { padding: 10px; }
  .fiptv-hero { margin-bottom: 10px; }
  .fiptv-hero__content,
  .fiptv-player-wrap,
  .fiptv-toolbar,
  .fiptv-card,
  .fiptv-listbar { border-radius: 17px !important; }
  .fiptv-hero__content { padding: 22px; }
  .fiptv-hero h1 { font-size: clamp(34px, 10.8vw, 48px); letter-spacing: -0.055em; }
  .fiptv-hero p { font-size: 15px; }
  .fiptv-btn { width: 100%; }
  .fiptv-toolbar { grid-template-columns: 1fr; top: 0; }
  .admin-bar .fiptv-toolbar { top: 46px; }
  .fiptv-player { min-height: 215px; }
  .fiptv-player__placeholder { min-height: 215px; }
  .fiptv-nowbar { align-items: stretch; flex-direction: column; }
  .fiptv-open-current { width: 100%; }
  .fiptv-listbar { flex-direction: column; align-items: stretch; }
  .fiptv-listbar__actions { justify-content: stretch; }
  .fiptv-listbar__actions .fiptv-btn { flex: 1 1 160px; }
  .fiptv-grid { grid-template-columns: 1fr; }
  .fiptv-card { min-height: 74px; grid-template-columns: 50px minmax(0, 1fr); }
  .fiptv-card__logo { width: 50px; height: 50px; border-radius: 14px; }
  .fiptv-player-source { right: 8px; top: 8px; font-size: 11px; }
}

@media (max-width: 420px) {
  .fiptv-app { padding: 8px; }
  .fiptv-hero__content { padding: 20px; }
  .fiptv-card__body { padding-right: 34px; }
  .fiptv-card em { max-width: 46px; padding-left: 5px; padding-right: 5px; }
}
