/* ==========================================================================
   SkarNet EPG · hoja de estilos
   ========================================================================== */
:root {
  --bg: #0b0e14;
  --bg-elev: #10141c;
  --surface: #141a24;
  --surface-2: #1a2230;
  --border: #222c3b;
  --border-strong: #2e3a4d;
  --text: #e6eaf0;
  --text-2: #b4bccb;
  --muted: #7d889b;
  --accent: #3d7bff;
  --accent-hover: #2f6ae6;
  --accent-soft: rgba(61, 123, 255, .14);
  --ok: #2fbf71;
  --ok-soft: rgba(47, 191, 113, .14);
  --warn: #e5a53a;
  --warn-soft: rgba(229, 165, 58, .14);
  --err: #e5484d;
  --err-soft: rgba(229, 72, 77, .14);
  --info-soft: rgba(61, 123, 255, .14);
  --radius: 8px;
  --radius-sm: 6px;
  --sidebar: 236px;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px -12px rgba(0,0,0,.6);
  --font: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", Consolas, "SFMono-Regular", Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 13.5px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11", "ss01";
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 20px; margin: 0; }
h2 { font-size: 14px; margin: 0 0 14px; color: var(--text); }
h3 { font-size: 11.5px; margin: 0 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
p { margin: 0 0 10px; }
code, pre { font-family: var(--mono); font-size: 12px; }
pre { background: var(--bg-elev); border: 1px solid var(--border); padding: 10px 12px; border-radius: var(--radius-sm); overflow-x: auto; white-space: pre-wrap; word-break: break-all; color: var(--text-2); margin: 8px 0; }
code.inline { background: var(--bg-elev); border: 1px solid var(--border); padding: 1px 6px; border-radius: 4px; color: var(--text-2); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
b, strong { font-weight: 600; }

/* ---------- Layout con barra lateral ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); flex: 0 0 var(--sidebar);
  background: var(--bg-elev); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; border-bottom: 1px solid var(--border); }
.brand .mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), #7aa8ff); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; box-shadow: 0 4px 12px -4px rgba(61,123,255,.7); }
.brand .name { font-weight: 650; font-size: 14px; letter-spacing: -0.01em; }
.brand .name small { display: block; color: var(--muted); font-weight: 500; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.brand img.logo { max-height: 36px; max-width: 190px; object-fit: contain; }
.nav a .count { margin-left: auto; background: var(--warn); color: #1b1200; font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 1px 7px; }
.nav { padding: 12px 10px; flex: 1; overflow-y: auto; }
.nav .group { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; padding: 12px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; font-size: 13px; }
.nav a:hover { background: var(--surface); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: #cfe0ff; }
.nav a svg { width: 16px; height: 16px; flex: 0 0 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.userbox { border-top: 1px solid var(--border); padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.userbox .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border-strong); display: grid; place-items: center; font-weight: 600; font-size: 12px; color: var(--text-2); }
.userbox .who { flex: 1; min-width: 0; }
.userbox .who b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userbox .who span { color: var(--muted); font-size: 11px; }
.userbox a { color: var(--muted); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; }
.userbox a:hover { background: var(--surface); color: var(--text); }
.userbox a svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 26px 28px 40px; }
.container.wide { max-width: none; padding: 18px 22px 22px; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.head h1 { display: flex; align-items: center; gap: 10px; }
.head .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.head > div:last-child { display: flex; gap: 8px; flex-wrap: wrap; }
.row { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-start; }
.col { flex: 1 1 400px; min-width: 0; }

/* ---------- Tarjetas y KPIs ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.card.tight { padding: 12px 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--border-strong); }
.stat .n { font-size: 24px; font-weight: 650; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 12px; margin-top: 5px; }
.stat.ok::before { background: var(--ok); } .stat.ok .n { color: var(--ok); }
.stat.warn::before { background: var(--warn); } .stat.warn .n { color: var(--warn); }
.stat.err::before { background: var(--err); } .stat.err .n { color: var(--err); }

/* ---------- Tablas ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255,255,255,.018); }
.table-wrap { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
td.actions { white-space: nowrap; text-align: right; }
td.actions form { display: inline; }
td.trunc, .trunc { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.ua { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.path { word-break: break-all; }

/* ---------- Etiquetas ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .02em; line-height: 1.6; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.error, .badge.err { background: var(--err-soft); color: var(--err); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.never, .badge.muted { background: rgba(125,136,155,.14); color: var(--muted); }
.badge.info { background: var(--info-soft); color: #8fb4ff; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: #fff; border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 7px 13px; font-size: 13px; font-weight: 600; cursor: pointer; line-height: 1.3; font-family: inherit; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--accent-hover); text-decoration: none; }
.btn.secondary { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.btn.secondary:hover { background: #222c3c; }
.btn.danger { background: transparent; color: var(--err); border-color: rgba(229,72,77,.35); }
.btn.danger:hover { background: var(--err-soft); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn.icon { padding: 6px 8px; }
.btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Formularios ---------- */
form .field { margin-bottom: 14px; }
label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 5px; font-weight: 500; }
input[type=text], input[type=password], input[type=url], input[type=number], input[type=email], input[type=date], select, textarea {
  width: 100%; background: var(--bg-elev); border: 1px solid var(--border-strong); color: var(--text);
  padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13px; font-family: inherit; transition: border-color .12s, box-shadow .12s;
}
input::placeholder, textarea::placeholder { color: #5b6677; }
textarea { min-height: 110px; font-family: var(--mono); font-size: 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237d889b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
input[type=file] { color: var(--muted); font-size: 12.5px; }
input[type=file]::file-selector-button { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); border-radius: 5px; padding: 5px 10px; margin-right: 10px; font-family: inherit; font-size: 12px; cursor: pointer; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.check label { margin: 0; color: var(--text); font-weight: 500; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { margin: 0; flex: 1; min-width: 150px; }
.help { color: var(--muted); font-size: 11.5px; margin-top: 5px; line-height: 1.45; }

/* ---------- Avisos ---------- */
.flash { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid; font-weight: 500; font-size: 13px; }
.flash::before { content: ""; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: 0 0 8px; background: currentColor; }
.flash.ok { background: var(--ok-soft); border-color: rgba(47,191,113,.3); color: #9be3bb; }
.flash.error { background: var(--err-soft); border-color: rgba(229,72,77,.3); color: #f3a5a8; }
.flash.warn { background: var(--warn-soft); border-color: rgba(229,165,58,.3); color: #f1cf8d; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.7fr 1fr; }
.login .hero { background: radial-gradient(1200px 600px at 20% 10%, rgba(61,123,255,.22), transparent 60%), radial-gradient(800px 500px at 90% 90%, rgba(122,168,255,.10), transparent 60%), var(--bg-elev); border-right: 1px solid var(--border); padding: 28px 40px 22px; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; }
.login .brand.centered { padding: 0; border: none; justify-content: center; }
.login .hero .brand img.logo { max-height: 48px; max-width: 260px; }
.login .intro { text-align: center; max-width: 820px; margin: 0 auto; }
.login .eyebrow { display: inline-block; background: var(--accent-soft); color: #9dbcff; border: 1px solid rgba(61,123,255,.3); border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 12px; }
.login .hero h2 { font-size: 27px; line-height: 1.18; font-weight: 650; letter-spacing: -0.02em; margin: 0 0 10px; }
.login .hero .lead { color: var(--text-2); font-size: 14px; line-height: 1.55; margin: 0; }
.login .cols { display: grid; grid-template-columns: 1.05fr 1fr; gap: 22px; align-items: start; max-width: 1240px; width: 100%; margin: 4px auto 0; }
.login .blocks { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.login .block { background: rgba(20,26,36,.7); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.login .block h4, .login .steps-title { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: #9dbcff; text-transform: uppercase; letter-spacing: .06em; }
.login .block p { color: var(--text-2); font-size: 12.5px; line-height: 1.5; margin: 0; }
.login .steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.login .steps li { display: flex; gap: 12px; align-items: flex-start; }
.login .steps li span { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; margin-top: 1px; }
.login .steps li b { display: block; font-size: 13.5px; }
.login .steps li small { display: block; color: var(--text-2); font-size: 12.5px; line-height: 1.45; margin-top: 2px; }
.login .contact { margin-top: 18px; padding: 11px 14px; border-radius: var(--radius-sm); background: rgba(61,123,255,.1); border: 1px solid rgba(61,123,255,.3); font-size: 13px; color: var(--text); }
.login .contact b { display: block; margin-bottom: 2px; }
.login .channels { padding: 18px 20px; border-radius: var(--radius); background: linear-gradient(180deg, rgba(47,191,113,.10), rgba(47,191,113,.04)); border: 1px solid rgba(47,191,113,.3); }
.login .channels .free { display: inline-block; background: var(--ok); color: #04210f; font-weight: 700; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; border-radius: 999px; padding: 3px 10px; margin-bottom: 10px; }
.login .channels h3 { color: var(--text); text-transform: none; letter-spacing: -0.01em; font-size: 16px; font-weight: 650; margin-bottom: 8px; }
.login .channels p { color: var(--text-2); font-size: 13px; line-height: 1.5; }
.login .channels .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.login .channels .perks { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 5px; }
.login .channels .perks li { color: var(--text-2); font-size: 12.5px; display: flex; gap: 8px; align-items: flex-start; }
.login .channels .perks li::before { content: "✓"; color: var(--ok); font-weight: 700; flex: 0 0 auto; }
.login .hero.has-bg { background-size: cover; background-position: center; }
.login .form.has-bg { background-size: cover; background-position: center; }
.login .form.has-bg .box { background: rgba(11,14,20,.72); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 26px 22px; backdrop-filter: blur(6px); }
.login .channels .contact-line { color: var(--text-2); font-size: 12.5px; margin-top: 10px; }
.login .reqform { margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(47,191,113,.25); }
.login .reqform .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.login .reqform .field { margin-bottom: 10px; }
.login .reqform textarea { min-height: 64px; font-family: inherit; font-size: 13px; }
.login .hero .foot { margin-top: auto; text-align: center; }
.login .form { display: grid; place-items: center; padding: 40px 28px; }
.login .box { width: 100%; max-width: 360px; }
.login .box h1 { font-size: 22px; margin-bottom: 6px; }
.login .box .sub { color: var(--muted); margin-bottom: 22px; font-size: 13px; }
.login .box .btn { width: 100%; justify-content: center; padding: 10px; font-size: 14px; }
.login .foot { color: var(--muted); font-size: 12px; }
@media (max-width: 1500px) {
  .login .hero { padding: 20px 28px 16px; gap: 12px; }
  .login .hero h2 { font-size: 23px; }
  .login .hero .lead { font-size: 13px; }
  .login .block { padding: 11px 13px; }
  .login .block p, .login .steps li small { font-size: 12px; }
  .login .steps { gap: 7px; }
  .login .channels { padding: 14px 16px; }
  .login .channels p { font-size: 12.5px; }
  .login .form { padding: 28px 22px; }
}
@media (max-width: 1250px) {
  .login { grid-template-columns: 1.4fr 1fr; }
  .login .cols { grid-template-columns: 1fr; }
}

/* ---------- Portal del canal: opciones de envío ---------- */
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.option { position: relative; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 16px 18px; }
.option .num { position: absolute; top: 14px; right: 14px; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--muted); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.option h4 { margin: 0 34px 6px 0; font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.option p { color: var(--text-2); font-size: 12.5px; line-height: 1.5; margin-bottom: 12px; }
.option.featured { background: linear-gradient(180deg, rgba(47,191,113,.12), rgba(47,191,113,.04)); border-color: rgba(47,191,113,.4); }
.option.featured .num { background: var(--ok); color: #04210f; border-color: transparent; }
.btn.download { background: var(--ok); color: #04210f; font-size: 14px; padding: 10px 16px; width: 100%; justify-content: center; box-shadow: 0 6px 18px -8px rgba(47,191,113,.8); }
.btn.download:hover { background: #3bd483; }
.btn.download svg { width: 16px; height: 16px; }
.option .upload { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(47,191,113,.25); }
.option .url-box { margin-bottom: 8px; }
details summary::-webkit-details-marker { color: var(--muted); }

/* ---------- Varios ---------- */
.coverage { display: inline-block; width: 90px; height: 6px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; vertical-align: middle; margin-right: 6px; }
.coverage i { display: block; height: 100%; background: var(--ok); }
.coverage.low i { background: var(--warn); }
.coverage.none i { background: var(--err); }
.logo-sm { width: 26px; height: 26px; object-fit: contain; border-radius: 5px; background: #fff; vertical-align: middle; margin-right: 8px; }
.copy { cursor: pointer; color: var(--accent); font-size: 12px; margin-left: 6px; font-weight: 600; white-space: nowrap; }
.url-box { display: flex; align-items: center; gap: 8px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 8px; font-family: var(--mono); font-size: 12px; word-break: break-all; color: var(--text-2); }
.url-box span:first-child { flex: 1; }
.error-page { text-align: center; margin-top: 80px; }
.error-page .code { font-size: 64px; font-weight: 800; color: var(--border-strong); letter-spacing: -0.04em; }

/* ---------- Guía ---------- */
.guide-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.guide-toolbar .group { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; }
.guide-toolbar .group .btn { background: transparent; border-color: transparent; color: var(--text-2); padding: 5px 9px; }
.guide-toolbar .group .btn:hover { background: var(--surface-2); color: var(--text); }
.guide-toolbar .group .btn.primary { background: var(--accent); color: #fff; }
.guide-toolbar input[type=date] { width: auto; padding: 5px 8px; background: transparent; border-color: transparent; color: var(--text-2); }
.guide-toolbar input[type=text] { width: 230px; }
.guide-toolbar select { width: auto; }
.guide-toolbar .spacer { flex: 1; }
.guide-toolbar .zoom { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; min-width: 52px; text-align: center; }
.tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; }
.tabs button { background: transparent; border: none; color: var(--text-2); padding: 5px 14px; border-radius: 5px; cursor: pointer; font-weight: 600; font-size: 12.5px; font-family: inherit; }
.tabs button.active { background: var(--accent); color: #fff; }
.clock { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); font-size: 13px; }
.clock small { color: var(--muted); font-weight: 500; margin-left: 6px; }

.timeline { position: relative; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); height: calc(100vh - 150px); user-select: none; }
.tl-inner { position: relative; display: grid; grid-template-columns: 210px 1fr; }
.tl-corner { position: sticky; left: 0; top: 0; z-index: 6; background: var(--bg-elev); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); height: 52px; display: flex; align-items: center; padding: 0 14px; color: var(--muted); font-size: 12px; }
.tl-head { position: sticky; top: 0; z-index: 4; background: var(--bg-elev); border-bottom: 1px solid var(--border); height: 52px; }
.tl-days { position: relative; height: 22px; border-bottom: 1px solid var(--border); }
.tl-day { position: absolute; top: 0; height: 22px; padding: 3px 8px; font-size: 11px; font-weight: 600; color: var(--text-2); border-left: 1px solid var(--border-strong); white-space: nowrap; overflow: hidden; text-transform: capitalize; }
.tl-day.today { color: #9dbcff; }
.tl-hours { position: relative; height: 30px; }
.tl-hour { position: absolute; top: 0; height: 100%; border-left: 1px solid var(--border); padding: 7px 0 0 6px; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.tl-hour.major { color: var(--text-2); }
.tl-chan { position: sticky; left: 0; z-index: 3; background: var(--surface); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); height: 60px; display: flex; align-items: center; padding: 0 14px; gap: 10px; overflow: hidden; }
.tl-chan .name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-chan .sub { color: var(--muted); font-size: 11px; font-family: var(--mono); }
.tl-row { position: relative; height: 60px; border-bottom: 1px solid var(--border); background-image: linear-gradient(90deg, var(--border) 1px, transparent 1px); }
.tl-prog { position: absolute; top: 7px; height: 46px; background: var(--surface-2); border: 1px solid var(--border-strong); border-left: 3px solid var(--cat, #5b6677); border-radius: 5px; padding: 5px 8px 5px 8px; overflow: hidden; cursor: pointer; transition: border-color .1s, background .1s; }
.tl-prog:hover { border-color: var(--accent); background: #1f2a3b; z-index: 1; }
.tl-prog.live { background: linear-gradient(180deg, rgba(61,123,255,.22), rgba(61,123,255,.12)); border-color: rgba(61,123,255,.7); }
.tl-prog.past { opacity: .5; }
.tl-prog .in { position: relative; will-change: transform; }
.tl-prog .t { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-prog.filler { border-style: dashed; border-left-style: solid; --cat: #4b5563; background: transparent; }
.tl-prog.filler .t { font-style: italic; font-weight: 500; color: var(--muted); }
.tl-prog.live.narrow .t::before { display: none; }
.tl-prog.live.narrow { box-shadow: inset 0 0 0 1px var(--err); }
.tl-prog.live .t::before { content: "EN VIVO"; display: inline-block; background: var(--err); color: #fff; font-size: 9.5px; font-weight: 700; letter-spacing: .06em; border-radius: 999px; padding: 1px 6px; margin-right: 6px; vertical-align: 1px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: -4px 0 10px; font-size: 12px; color: var(--muted); }
.legend .lg-title { font-weight: 600; }
.legend .lg-item { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.legend .lg-item i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tl-prog .h { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--err); z-index: 2; pointer-events: none; box-shadow: 0 0 8px rgba(229,72,77,.6); }
.tl-now::before { content: ""; position: absolute; top: 52px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--err); }
.tl-empty { position: absolute; left: 0; right: 0; top: 0; bottom: 0; display: flex; align-items: center; padding-left: 12px; color: var(--muted); font-size: 12px; }
.tl-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; background: rgba(11,14,20,.5); z-index: 7; }

.now-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.now-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.now-card .ch { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-weight: 600; }
.now-card .ch .logo-sm { margin: 0; }
.now-card .cur { font-size: 14px; font-weight: 600; }
.now-card .times { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; margin: 2px 0 8px; }
.now-card .bar { height: 4px; background: var(--bg-elev); border-radius: 3px; overflow: hidden; margin-bottom: 10px; }
.now-card .bar i { display: block; height: 100%; background: var(--accent); }
.now-card .nxt { color: var(--muted); font-size: 12.5px; }
.now-card .nxt b { color: var(--text); font-weight: 600; }
.now-card.nodata { opacity: .6; }

.detail { position: fixed; right: 0; top: 0; bottom: 0; width: 400px; max-width: 100%; background: var(--bg-elev); border-left: 1px solid var(--border); padding: 22px 24px; overflow: auto; z-index: 40; box-shadow: -12px 0 32px rgba(0,0,0,.45); }
.detail .close { float: right; cursor: pointer; color: var(--muted); font-size: 20px; line-height: 1; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; }
.detail .close:hover { background: var(--surface); color: var(--text); }
.detail .chan { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.detail h2 { margin: 6px 0 4px; font-size: 18px; line-height: 1.25; }
.detail .sub { color: var(--text-2); margin-bottom: 8px; }
.detail .meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.detail .meta span { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; font-size: 11.5px; color: var(--text-2); }
.detail p { line-height: 1.55; color: var(--text-2); }
.detail img { max-width: 100%; border-radius: 8px; margin-bottom: 10px; }

.search-results { margin-top: 10px; }
.search-results .item { padding: 9px 10px; border-bottom: 1px solid var(--border); cursor: pointer; display: flex; gap: 12px; align-items: center; }
.search-results .item:hover { background: rgba(255,255,255,.02); }
.search-results .item .when { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 120px; font-size: 12px; }
.search-results .item .chan { color: var(--accent); min-width: 140px; font-weight: 600; }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; }
  .nav { display: flex; gap: 2px; overflow-x: auto; padding: 8px; }
  .nav .group { display: none; }
  .nav a { white-space: nowrap; }
  .userbox { display: none; }
  .container { padding: 16px; }
  .tl-inner { grid-template-columns: 140px 1fr; }
  .detail { width: 100%; }
  .login { grid-template-columns: 1fr; }
  .login .hero { border-right: none; border-bottom: 1px solid var(--border); padding: 28px 22px; }
  .login .blocks { grid-template-columns: 1fr; }
  .login .form { padding: 28px 22px; }
}
