/* LineTV: TV Guide (Top Up Balance style) */
.tvg { --b: #e6ebf2; --t: #0f172a; --m: #64748b; --blue: #2361d0; --tvg-chw: 230px; padding: 6px 0 24px; color: var(--t); }
.tvg *, .tvg *::before, .tvg *::after { box-sizing: border-box; }
.tvg-sub { margin: -4px 0 12px; color: var(--m); font-size: 14px; }
.tvg-upd { white-space: nowrap; font-weight: 600; color: #475569; }
.tvg .ltv-lang { margin-left: 0; align-self: center; }
.tvg-card-box { background: #fff; border: 1px solid var(--b); border-radius: 18px; padding: 14px 16px; margin-bottom: 12px; box-shadow: 0 6px 18px rgba(15,23,42,.05); }

/* search */
.tvg-q-w { position: relative; }
.tvg-q-w > i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--blue); font-size: 17px; }
.tvg-q { width: 100%; height: 50px; padding: 8px 44px 8px 46px; border: 2px solid #c7d7f5; border-radius: 14px; background: #f8fbff; font-size: 17px; font-family: inherit; color: var(--t); }
.tvg-q:focus { outline: 0; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgba(35,97,208,.12); }
.tvg-q::-webkit-search-cancel-button, .tvg-chf::-webkit-search-cancel-button { display: none; }
.tvg-q-x { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: #64748b; font-size: 24px; line-height: 1; cursor: pointer; }
.tvg-chips, .tvg-days { display: flex; flex-wrap: wrap; gap: 6px; }
.tvg-chips { margin-top: 10px; }
.tvg-chips button, .tvg-days button, .tvg-nav button, .tvg-tog { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; border: 1px solid #d6dee9; background: #fff;
	color: #334155; font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit; line-height: 1.2; }
.tvg-chips button.is-on, .tvg-days button.is-on, .tvg-tog.is-on { background: linear-gradient(135deg, #0b63e5, #1e90ff); border-color: transparent; color: #fff; box-shadow: 0 6px 14px rgba(11,99,229,.22); }
.tvg-chips .is-live i { width: 8px; height: 8px; border-radius: 50%; background: #dc2626; }
.tvg-chips .is-live.is-on i { background: #fff; animation: tvgBlink 1.4s infinite; }
@keyframes tvgBlink { 50% { opacity: .3; } }
.tvg-res { margin-top: 12px; }
.tvg-res-st { color: var(--m); font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
.tvg-res-list { list-style: none; margin: 0; padding: 0; max-height: 560px; overflow-y: auto; border-top: 1px solid #eef2f7; }
.tvg-r { display: grid; grid-template-columns: 120px minmax(150px, 220px) minmax(0,1fr) auto; gap: 12px; align-items: center; padding: 10px 6px; border-bottom: 1px solid #eef2f7; cursor: pointer; }
.tvg-r:hover { background: #f8fafc; }
.tvg-r.is-past { opacity: .75; }
.tvg-r-time small { display: block; color: var(--m); font-size: 11.5px; }
.tvg-r-time b { font-size: 14.5px; font-variant-numeric: tabular-nums; }
.tvg-r-ch { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 12.5px; font-weight: 700; color: #475569; text-transform: uppercase; }
.tvg-r-ch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tvg-r-t { min-width: 0; }
.tvg-r-t b { display: block; font-size: 15px; line-height: 1.3; }
.tvg-r-t small { color: var(--m); font-size: 12px; }
.tvg-r-t mark { background: #fef08a; padding: 0 1px; border-radius: 3px; }
.tvg-b { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; white-space: nowrap; }
.tvg-b.is-live { background: #fde8e8; color: #b91c1c; }
.tvg-b.is-live i { width: 7px; height: 7px; border-radius: 50%; background: #dc2626; animation: tvgBlink 1.4s infinite; }
.tvg-b.is-arch { background: #e3f6ea; color: #166534; }
.tvg-pbar { display: block; height: 4px; margin-top: 5px; border-radius: 99px; background: #e2e8f0; overflow: hidden; }
.tvg-pbar span { display: block; height: 100%; background: linear-gradient(90deg, #dc2626, #f87171); }
.tvg-logo { flex: 0 0 auto; width: 40px; height: 30px; border-radius: 7px; background: #fff; border: 1px solid #eef2f7; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.tvg-logo img { max-width: 90%; max-height: 85%; object-fit: contain; }

/* guide bar */
.tvg-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.tvg-nav { display: flex; gap: 6px; }
.tvg-nav button { padding: 7px 11px; }
.tvg-nav .is-now { border-color: #93c5fd; color: #1d4ed8; }
.tvg-date { margin-left: auto; color: var(--m); font-weight: 700; font-size: 13.5px; text-transform: capitalize; }
.tvg-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tvg-sel { position: relative; display: inline-flex; align-items: center; margin: 0; flex: 0 1 auto; min-width: 0; }
.tvg-sel i { position: absolute; left: 11px; color: var(--blue); font-size: 13px; pointer-events: none; }
.tvg-sel select { height: 38px; max-width: 320px; padding: 4px 30px 4px 32px; border: 1px solid #d6dee9; border-radius: 11px; background: #f8fafc; color: var(--t); font-weight: 700; font-size: 13.5px; font-family: inherit; }
.tvg-chf { height: 38px; flex: 1 1 160px; min-width: 120px; padding: 4px 12px; border: 1px solid #d6dee9; border-radius: 11px; background: #f8fafc; font-size: 14px; font-family: inherit; }
.tvg-chf:focus, .tvg-sel select:focus { outline: 0; border-color: var(--blue); background: #fff; }
.tvg-st { color: var(--m); font-weight: 600; margin: 8px 2px; }

/* timeline (computers) */
.tvg-scroll { overflow: auto; max-height: 70vh; border: 1px solid var(--b); border-radius: 14px; position: relative; }
.tvg-head { display: flex; position: sticky; top: 0; z-index: 4; background: #f8fafc; border-bottom: 1px solid var(--b); }
.tvg-ch { position: sticky; left: 0; z-index: 3; flex: 0 0 var(--tvg-chw); width: var(--tvg-chw); display: flex; align-items: center; gap: 9px; padding: 6px 10px; background: #fff; border-right: 1px solid var(--b); min-width: 0; }
.tvg-ch.is-h { background: #f8fafc; z-index: 5; }
.tvg-ch > span { min-width: 0; flex: 1 1 auto; }
.tvg-ch b { display: block; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tvg-ch small { display: block; font-size: 11.5px; color: var(--m); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tvg-ch-a { color: #16a34a; font-size: 12px; flex: 0 0 auto; }
.tvg-tl { position: relative; height: 32px; flex: 0 0 auto; }
.tvg-tick { position: absolute; top: 0; bottom: 0; padding: 8px 0 0 6px; border-left: 1px solid #e2e8f0; font-size: 12px; color: var(--m); font-weight: 600; white-space: nowrap; }
.tvg-tick.is-h { color: var(--t); font-weight: 800; border-left-color: #cbd5e1; }
.tvg-body { position: relative; }
.tvg-row { display: flex; border-bottom: 1px solid #eef2f7; min-height: 56px; }
.tvg-cells { position: relative; flex: 0 0 auto; }
.tvg-p { position: absolute; top: 5px; bottom: 5px; display: flex; flex-direction: column; justify-content: center; gap: 1px; padding: 3px 8px; border: 1px solid #e2e8f0; border-radius: 9px;
	background: #f8fafc; text-align: left; overflow: hidden; cursor: pointer; font-family: inherit; color: var(--t); }
.tvg-p:hover { border-color: #93c5fd; background: #eff6ff; z-index: 1; }
.tvg-p small { font-size: 11px; color: var(--m); font-weight: 600; white-space: nowrap; }
.tvg-p small i { color: #16a34a; }
.tvg-p b { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvg-p.is-live { background: #e6efff; border-color: #93c5fd; box-shadow: inset 3px 0 0 #2563eb; }
.tvg-p.is-past { opacity: .65; }
.tvg-noepg { display: inline-block; margin: 18px 10px; font-size: 12px; color: #94a3b8; font-style: italic; position: sticky; left: calc(var(--tvg-chw) + 10px); }
.tvg-nowline { position: absolute; top: 0; bottom: 0; width: 2px; background: #dc2626; z-index: 2; pointer-events: none; }
.tvg-nowline::before { content: ""; position: absolute; top: -1px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: #dc2626; }

/* now / next cards (phones) */
.tvg-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.tvg-card, .tvg-nn { min-width: 0; }
.tvg-nn b { overflow-wrap: anywhere; }
.tvg-card { border: 1px solid var(--b); border-radius: 14px; padding: 9px 10px; background: #fff; }
.tvg-card-h { display: flex; align-items: center; gap: 9px; margin-bottom: 6px; }
.tvg-card-h b { flex: 1 1 auto; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tvg-nn { display: block; width: 100%; text-align: left; padding: 6px 8px; margin-top: 4px; border: 1px solid #eef2f7; border-radius: 10px; background: #f8fafc; cursor: pointer; font-family: inherit; color: var(--t); }
.tvg-nn small { display: block; font-size: 11.5px; color: var(--m); font-weight: 600; }
.tvg-nn b { display: block; font-size: 14px; line-height: 1.3; }
.tvg-nn.is-cur { background: #eff6ff; border-color: #bfdbfe; }
.tvg-nn.is-cur .tvg-pbar span { background: linear-gradient(90deg, #2563eb, #60a5fa); }

/* details */
.tvg-modal { position: fixed; inset: 0; z-index: 100004; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15,23,42,.5); }
.tvg-modal[hidden] { display: none; }
.tvg-m-box { position: relative; width: 100%; max-width: 520px; max-height: 85vh; overflow: auto; padding: 18px 20px; border-radius: 16px; background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.tvg-m-x { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border: 0; border-radius: 9px; background: #f1f5f9; font-size: 22px; line-height: 1; cursor: pointer; color: #334155; }
.tvg-m-time { color: var(--m); font-weight: 700; font-size: 13px; margin-right: 36px; }
.tvg-m-box h4 { margin: 6px 0 4px; font-size: 19px; font-weight: 800; color: var(--t); }
.tvg-m-ch { font-size: 13px; font-weight: 700; color: #475569; text-transform: uppercase; }
.tvg-m-cat { display: inline-block; margin: 8px 0 0; padding: 3px 10px; border-radius: 999px; background: #e6efff; color: #1d4ed8; font-size: 12px; font-weight: 700; }
.tvg-m-box p { margin: 10px 0 0; color: #334155; font-size: 14.5px; line-height: 1.55; }
body.tvg-noscroll { overflow: hidden; }

@media (max-width: 1100px) { .tvg { --tvg-chw: 190px; } .tvg-r { grid-template-columns: 100px minmax(120px, 170px) minmax(0,1fr) auto; } }
@media (max-width: 767px) {
	html body .content-wrapper .content-header:has(.tvg) { padding: 8px 8px 0 !important; }
	.tvg { padding-top: 0; }
	.tvg-sub { font-size: 13px; margin-bottom: 10px; }
	.tvg-card-box { padding: 12px; border-radius: 15px; margin-bottom: 10px; }
	.tvg-q { height: 46px; font-size: 16px; }
	.tvg-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
	.tvg-chips::-webkit-scrollbar { display: none; }
	.tvg-chips button { flex: 0 0 auto; padding: 7px 11px; }
	.tvg-res-list { max-height: none; }
	.tvg-r { grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "t b" "c c" "n n"; gap: 4px 8px; padding: 10px 4px; }
	.tvg-r-time { grid-area: t; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
	.tvg-r-time .tvg-pbar { flex: 1 1 100%; margin-top: 2px; }
	.tvg-r-b { grid-area: b; }
	.tvg-r-ch { grid-area: c; }
	.tvg-r-t { grid-area: n; }
	.tvg-bar { gap: 8px; }
	.tvg-days { flex: 1 1 100%; }
	.tvg-days button { flex: 1 1 0; justify-content: center; }
	.tvg-nav { flex: 0 0 auto; }
	.tvg-date { margin-left: auto; font-size: 12.5px; }
	.tvg-filters { gap: 6px; }
	.tvg-sel { flex: 1 1 100%; }
	.tvg-sel select { max-width: none; width: 100%; }
	.tvg-chf { flex: 1 1 auto; }
}

/* ===== audit round 1: compact top, green live, readability, now label, bigger logos ===== */
.tvg-sub { margin: -6px 0 10px; }
.tvg-card-box { padding: 10px 12px; margin-bottom: 10px; }
.tvg-q { height: 44px; font-size: 16px; }
.tvg-chips button, .tvg-days button, .tvg-nav button, .tvg-tog { padding: 6px 12px; }
.tvg-bar { margin-bottom: 8px; }
.tvg-filters { margin-bottom: 10px; }
.tvg-sel select, .tvg-chf { height: 34px; }
@media (min-width: 768px) {
	/* search + "on now / days" chips in one row */
	.tvg-find { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
	.tvg-find .tvg-q-w { flex: 1 1 360px; min-width: 0; }
	.tvg-find .tvg-chips { margin-top: 0; flex: 0 0 auto; }
	.tvg-find .tvg-res { flex: 1 1 100%; margin-top: 2px; }
}
/* live = green (blue stays for buttons and menus) */
.tvg-p.is-live { background: #e8f8ee; border-color: #86efac; box-shadow: inset 3px 0 0 #16a34a; }
.tvg-p.is-live:hover { background: #dcf5e6; border-color: #4ade80; }
.tvg-p.is-live small { color: #15803d; }
.tvg-nn.is-cur { background: #e8f8ee; border-color: #bbf7d0; }
.tvg-nn.is-cur .tvg-pbar span { background: linear-gradient(90deg, #16a34a, #4ade80); }
/* readability */
.tvg-p b { font-size: 13.5px; }
.tvg-p small { font-size: 11.5px; }
.tvg-ch b { font-size: 14px; }
.tvg-ch small { font-size: 12px; color: #475569; }
.tvg-p.is-past { opacity: 1; background: #f1f5f9; }
.tvg-p.is-past b { color: #334155; font-weight: 600; }
.tvg-p.is-past small { color: #64748b; }
/* exact time on the now line */
.tvg-nowtag { position: absolute; top: 5px; z-index: 3; transform: translateX(-50%); padding: 2px 8px; border-radius: 999px; background: #dc2626; color: #fff;
	font-size: 12px; font-weight: 800; line-height: 1.5; white-space: nowrap; box-shadow: 0 3px 8px rgba(220,38,38,.35); font-variant-numeric: tabular-nums; }
.tvg-tl { height: 34px; }
/* logos: bigger, no frame; white logos on a dark tile */
.tvg-ch .tvg-logo { width: 56px; height: 36px; border: 0; background: transparent; border-radius: 8px; }
.tvg-ch .tvg-logo img { max-width: 100%; max-height: 100%; }
.tvg-logo.is-light { background: #1e293b !important; padding: 3px; }
.tvg-card-h .tvg-logo { width: 48px; height: 32px; border: 0; background: transparent; }
@media (max-width: 767px) { .tvg-card-h .tvg-logo.is-light { background: #1e293b; } }
/* drag the timeline with the mouse */
.tvg-scroll { cursor: grab; }
.tvg-scroll.is-drag, .tvg-scroll.is-drag * { cursor: grabbing !important; user-select: none; }
.tvg-scroll.is-drag .tvg-p:hover { border-color: #e2e8f0; background: #f8fafc; }
.tvg-scroll.is-drag .tvg-p.is-live:hover { background: #e8f8ee; border-color: #86efac; }
/* logos: a fixed slot, the picture fitted inside -> all channel names start at the same place */
.tvg-logo { flex: 0 0 40px; width: 40px; min-width: 40px; max-width: 40px; }
.tvg-logo img { width: auto; height: auto; max-width: 36px; max-height: 26px; }
.tvg-ch .tvg-logo { flex: 0 0 56px; width: 56px; min-width: 56px; max-width: 56px; height: 36px; }
.tvg-ch .tvg-logo img { max-width: 56px; max-height: 34px; }
.tvg-ch .tvg-logo.is-light img { max-width: 50px; max-height: 30px; }
.tvg-card-h .tvg-logo { flex: 0 0 48px; width: 48px; min-width: 48px; max-width: 48px; height: 32px; }
.tvg-card-h .tvg-logo img { max-width: 48px; max-height: 30px; }
.tvg-ch > span, .tvg-ch b, .tvg-ch small { text-align: left; }
/* now line: a bit lighter */
.tvg-nowline { background: rgba(239, 68, 68, .6); }
.tvg-nowline::before { background: #f87171; }
.tvg-nowtag { background: #f05252; box-shadow: 0 2px 6px rgba(239, 68, 68, .25); }

/* ===== LineTV 2026-11-30: "On now" indicator = steady dot + soft pulsing ring (no blinking); archive icons violet (not green like live) ===== */
.tvg-chips .is-live i, .tvg-b.is-live i { position: relative; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; opacity: 1; animation: none; }
.tvg-chips .is-live i::after, .tvg-b.is-live i::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid currentColor; color: rgba(239,68,68,.55); opacity: 0; animation: tvgRing 1.8s ease-out infinite; }
.tvg-chips .is-live.is-on i { background: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.25); animation: none; opacity: 1; }
.tvg-chips .is-live.is-on i::after { color: rgba(255,255,255,.85); }
@keyframes tvgRing { 0% { transform: scale(.55); opacity: .9; } 80%, 100% { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tvg-chips .is-live i::after, .tvg-b.is-live i::after { animation: none; opacity: 0; } }
.tvg-ch-a, .tvg-p small i, .tvg-p.is-live small i { color: #7c3aed; }
.tvg-b.is-arch { background: #f1ebff; color: #5b21b6; }
