.tv {
  --tv-green: #2f9e41;
  --tv-green-dark: #19612a;
  --tv-ink: #17221b;
  --tv-muted: #5b6760;
  --tv-line: #dfe4e1;
  --tv-soft: #f3f6f4;
  margin: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--tv-soft);
  color: var(--tv-ink);
  font-family: "Open Sans", "Segoe UI", Arial, sans-serif;
  overflow: hidden;
}
.tv *,
.tv *::before,
.tv *::after {
  box-sizing: border-box;
}
.tv-top {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 1.2vh 3vw;
  background: var(--tv-green-dark);
  color: #fff;
}
.tv-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.tv-brand .tv-ifsp {
  height: clamp(44px, 6vh, 72px);
  width: auto;
}
.tv-title {
  padding-left: clamp(18px, 2.4vw, 36px);
  margin-left: clamp(6px, 1vw, 14px);
  border-left: 2px solid rgba(255, 255, 255, 0.35);
}
.tv-brand strong {
  display: block;
  font-size: clamp(16px, 2.2vh, 26px);
  font-weight: 700;
}
.tv-brand span {
  display: block;
  font-size: clamp(12px, 1.5vh, 17px);
  opacity: 0.85;
}
.tv-clock {
  text-align: right;
  line-height: 1.15;
}
.tv-clock span {
  display: block;
  font-size: clamp(20px, 3.2vh, 38px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tv-clock small {
  font-size: clamp(11px, 1.4vh, 16px);
  opacity: 0.85;
  text-transform: capitalize;
}

.tv-stage {
  position: relative;
  flex: 1;
  min-height: 0;
}
.tv-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 2.4vh;
  padding: 2.4vh 3vw;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease;
}
.tv-slide.is-active {
  opacity: 1;
  visibility: visible;
}
.tv-media {
  position: relative;
  justify-self: center;
  align-self: stretch;
  height: 100%;
  width: auto;
  max-width: 100%;
  min-height: 0;
  aspect-ratio: 900 / 400;
  border-radius: 14px;
  overflow: hidden;
  background: #e6ebe8;
  box-shadow: 0 18px 40px -18px rgba(20, 35, 25, 0.45);
}
.tv-media.has-img::before {
  content: "";
  position: absolute;
  inset: -20px;
  background: var(--bn) center / cover;
  filter: blur(20px) brightness(0.85);
}
.tv-media img,
.tv-media .vg-fallback {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: flex;
}
.tv-media .vg-fallback span {
  font-size: 8vh;
}
.tv-info {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 2vw;
  min-width: 0;
}
.tv-head {
  display: flex;
  flex-direction: column;
  gap: 1.2vh;
  min-width: 0;
}
.tv-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tv-tag {
  padding: 0.4vh 1vw;
  border-radius: 999px;
  border: 1px solid var(--tv-line);
  background: #fff;
  font-size: clamp(12px, 1.6vh, 18px);
  font-weight: 700;
  color: var(--tv-muted);
}
.tv-tag-type {
  background: var(--tv-green);
  border-color: var(--tv-green);
  color: #fff;
}
.tv-tag-star {
  background: #fff6d6;
  border-color: #efdc93;
  color: #7a5b00;
}
.tv-info h1 {
  margin: 0;
  font-size: clamp(22px, 4.2vh, 54px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
  display: block;
  max-height: 2.25em;
  overflow: hidden;
  color: var(--tv-ink);
}
.tv-company {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(16px, 2.6vh, 30px);
  font-weight: 600;
}
.tv-company .ui-logo {
  width: clamp(40px, 5.5vh, 64px) !important;
  height: clamp(40px, 5.5vh, 64px) !important;
  border-radius: 10px;
  border: 1px solid var(--tv-line);
  background: #fff;
  object-fit: contain;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--tv-green-dark);
}
.tv-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  background: #fff;
  border: 1px solid var(--tv-line);
  border-radius: 12px;
}
.tv-facts div {
  padding: 1.4vh 1.2vw;
  border-top: 1px solid var(--tv-line);
  border-left: 1px solid var(--tv-line);
  min-width: 0;
}
.tv-facts div:nth-child(-n + 2) {
  border-top: 0;
}
.tv-facts div:nth-child(odd) {
  border-left: 0;
}
.tv-facts dt {
  font-size: clamp(11px, 1.45vh, 16px);
  font-weight: 600;
  color: var(--tv-muted);
}
.tv-facts dd {
  margin: 0.3vh 0 0;
  font-size: clamp(15px, 2.3vh, 28px);
  font-weight: 700;
  overflow-wrap: anywhere;
}
.tv-facts dd small {
  display: block;
  font-size: 0.6em;
  font-weight: 600;
  color: #9a5b00;
}
.tv-qr {
  display: flex;
  align-items: center;
  gap: 1.4vw;
  padding: 1.4vh 1.2vw;
  background: #fff;
  border: 1px solid var(--tv-line);
  border-left: 5px solid var(--tv-green);
  border-radius: 12px;
}
.tv-qr-img {
  flex: none;
  width: clamp(96px, 15vh, 190px);
  aspect-ratio: 1;
}
.tv-qr-img svg {
  width: 100%;
  height: 100%;
  display: block;
}
.tv-qr strong {
  display: block;
  font-size: clamp(15px, 2.3vh, 28px);
}
.tv-qr span {
  display: block;
  font-size: clamp(13px, 1.8vh, 21px);
  color: var(--tv-muted);
}
.tv-qr small {
  display: inline-block;
  margin-top: 0.8vh;
  font-family: Consolas, Menlo, monospace;
  font-size: clamp(12px, 1.6vh, 18px);
  color: var(--tv-ink);
  background: var(--tv-soft);
  border-radius: 6px;
  padding: 2px 8px;
}

.tv-bottom {
  flex: none;
  background: #fff;
  border-top: 1px solid var(--tv-line);
}
.tv-progress {
  height: 5px;
  background: #e5ebe7;
}
.tv-progress i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--tv-green);
}
.tv-bottom-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 1.2vh 3vw;
  font-size: clamp(13px, 1.8vh, 20px);
  color: var(--tv-muted);
}
.tv-next {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tv-count {
  flex: none;
  font-weight: 700;
  color: var(--tv-ink);
  font-variant-numeric: tabular-nums;
}
.tv-empty {
  flex: 1;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 24px;
}
.tv-empty h1 {
  margin: 0;
  font-size: clamp(24px, 4vh, 48px);
}
.tv-empty p {
  color: var(--tv-muted);
  font-size: clamp(15px, 2.2vh, 24px);
}

@media (max-width: 900px), (orientation: portrait) {
  .tv {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }
  .tv-top {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 10px 16px;
  }
  .tv-stage {
    flex: none;
  }
  .tv-slide {
    position: absolute;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }
  .tv-slide.is-active {
    position: relative;
  }
  .tv-slide {
    grid-template-rows: auto;
  }
  .tv-media {
    width: 100%;
    height: auto;
    border-radius: 10px;
  }
  .tv-info {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .tv-info h1 {
    font-size: 24px;
    max-height: none;
  }
  .tv-facts div {
    padding: 10px 12px;
  }
  .tv-qr {
    padding: 12px;
    gap: 14px;
  }
  .tv-qr-img {
    width: 110px;
  }
  .tv-bottom {
    position: sticky;
    bottom: 0;
  }
  .tv-bottom-row {
    padding: 8px 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tv-slide {
    transition: none;
  }
}
.tv-info > * {
  flex: none;
}
