:root {
    --bg: #07111f;
    --bg-2: #0f1b2e;
    --card: #13233a;
    --line: #243955;
    --text: #e8eef7;
    --muted: #9fb0c7;
    --accent: #38bdf8;
    --accent-2: #0284c7;
    --danger: #f87171;
    --ok: #34d399;
    --warn: #fbbf24;
    --shadow: 0 20px 50px rgba(0, 0, 0, .28);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    overflow-x: hidden;
    font-family: "Segoe UI", sans-serif;
    background: radial-gradient(1200px 500px at 10% -10%, #123, transparent), var(--bg);
    color: var(--text);
    line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
header.top {
    position: sticky; top: 0; z-index: 10;
    background: rgba(7, 17, 31, .92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 16px; }
.brand { color: white; font-weight: 800; letter-spacing: .06em; font-size: 22px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.menu { display: flex; gap: 18px; align-items: center; }
.menu-pills { margin-left: auto; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.menu-pills form { display: inline-flex; margin: 0; }
.pill {
    display: inline-flex; align-items: center; gap: 8px;
    border: 0; border-radius: 999px; padding: 8px 14px;
    color: white; font-weight: 800; font-size: 13px; letter-spacing: .03em;
    text-decoration: none; cursor: pointer; line-height: 1;
}
.pill:hover { text-decoration: none; filter: brightness(1.1); }
.pill svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pill-epg { background: #0284c7; }
.pill-backup { background: #7c3aed; }
.pill-channels { background: #059669; }
.pill-central { background: #334155; }
.pill-admin { background: #9f1239; }
.pill-login, .pill-logout { background: #f59e0b; color: #1c1405; }
.pill-logout { padding: 8px 12px; }
.pill[aria-current="page"] { outline: 2px solid white; outline-offset: 2px; }
.actions { display: flex; gap: 8px; }
.btn, button.btn {
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 999px; padding: 10px 16px; font-weight: 700;
    background: var(--accent); color: #042033; cursor: pointer; text-decoration: none;
}
.btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: #7f1d1d; color: white; }
.btn.small { padding: 6px 10px; font-size: 14px; }
.hero { padding: 64px 0 32px; display: grid; grid-template-columns: 1.3fr .7fr; gap: 28px; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.1; margin: 0 0 12px; }
.muted { color: var(--muted); }
.admin-links { display: flex; flex-wrap: wrap; gap: 8px; }
.site-card h2 { margin-bottom: 4px; }
.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.card h2, .card h3 { margin-top: 0; }
.stat strong { display: block; font-size: 28px; }
body:has(.hero-onair) {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
body:has(.hero-onair) header.top {
    position: absolute;
    inset: 0 0 auto 0;
    z-index: 20;
    background: transparent;
    border-bottom: none;
    backdrop-filter: none;
}
body:has(.hero-onair) main.wrap {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    display: flex;
    flex-direction: column;
}
.hero.hero-onair {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 18px;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    margin: 0;
    padding: 92px max(16px, calc((100vw - 1120px) / 2)) 96px;
    border-radius: 0;
}
.hero-pitch, .onair-panel { position: relative; z-index: 2; min-width: 0; }
.hero-pitch { align-self: start; max-width: 680px; }
.hero-pitch h1 { font-size: clamp(22px, 3.4vw, 40px); line-height: 1.15; margin: 0; text-shadow: 0 2px 16px rgba(0, 0, 0, .85); }
.hero-onair .onair-copy { max-width: min(680px, calc(100% - 300px)); }
.hire {
    position: absolute;
    z-index: 3;
    right: max(20px, calc((100vw - 1120px) / 2));
    bottom: 112px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 20px 12px 12px;
    border-radius: 18px 28px 28px 8px;
    color: #1c1405;
    text-decoration: none;
    background: linear-gradient(145deg, #ffe7a3 0%, #f6b423 46%, #e08900 100%);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .42), 0 0 0 1px rgba(255, 255, 255, .45) inset, 0 0 28px rgba(245, 158, 11, .38);
}
.hire:hover { text-decoration: none; filter: brightness(1.05); }
.hire-mark {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #1c1405;
    color: #fbbf24;
    flex: none;
}
.hire-mark svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hire-mark circle { fill: currentColor; stroke: none; }
.hire-label { display: block; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.hire-price { display: block; margin-top: 2px; font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.hire-price small { margin-left: 3px; font-size: 13px; font-weight: 700; letter-spacing: 0; }
.onair-image {
    position: absolute; inset: 0; z-index: 0; opacity: 1; pointer-events: none;
    background-position: center; background-size: cover; background-repeat: no-repeat;
    transition: opacity .35s ease;
}
.onair-scrim {
    position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(90deg, rgba(5, 12, 24, .82) 0%, rgba(5, 12, 24, .48) 34%, rgba(5, 12, 24, .18) 68%, rgba(5, 12, 24, .28) 100%);
}
.onair-copy {
    display: flex; align-items: center; gap: 14px; width: fit-content; max-width: 100%;
    padding: 14px 18px; border-radius: 16px;
    background: rgba(5, 12, 24, .82);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .72), 0 0 0 1px rgba(255, 255, 255, .08);
}
.onair-lines { min-width: 0; overflow: hidden; }
.onair-poster { width: 92px; height: 92px; object-fit: contain; border-radius: 12px; flex: none; padding: 8px; box-sizing: border-box; background: rgba(8, 15, 28, .72); }
.onair-poster[hidden] { display: none; }
.onair-panel h2, .onair-copy h2 { margin: 0; font-size: 14px; font-weight: 600; color: #bae6fd; }
.onair-kicker { display: block; margin: 0 0 8px; font-size: 12px; color: #d5e2f2; }
.onair-channel, .onair-title, .onair-time { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.onair-channel { display: block; font-size: 26px; line-height: 1.2; text-shadow: 0 2px 12px rgba(0, 0, 0, .9); }
.onair-title { display: block; margin-top: 4px; font-size: 18px; line-height: 1.2; text-shadow: 0 2px 12px rgba(0, 0, 0, .9); }
.onair-time, .onair-count, .onair-note { color: #d5e2f2; }
.onair-time { display: block; margin-top: 4px; text-shadow: 0 2px 12px rgba(0, 0, 0, .9); }
.onair-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; }
.onair-note { margin: 10px 0 0; font-size: 13px; }
.badge { display: inline-block; border-radius: 999px; padding: 2px 8px; background: #1e3a5f; font-size: 12px; }
.badge.ok { background: #064e3b; color: var(--ok); }
.badge.warn { background: #451a03; color: var(--warn); }
.badge.bad { background: #450a0a; color: var(--danger); }
.price { font-size: 32px; font-weight: 800; }
section { padding: 18px 0 28px; }
label { display: block; font-size: 14px; margin-bottom: 6px; }
input, select, textarea {
    width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
    background: #0b1728; color: var(--text); margin-bottom: 12px;
}
textarea { min-height: 120px; }
.alert { padding: 12px 14px; border-radius: 12px; margin: 12px 0; }
.alert.ok { background: #064e3b; }
.alert.bad { background: #450a0a; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.layout { display: grid; grid-template-columns: 220px 1fr; gap: 20px; padding: 24px 0 48px; }
.side a { display: block; padding: 8px 10px; border-radius: 10px; color: var(--text); }
.side a.active, .side a:hover { background: #1e3a5f; text-decoration: none; }
.check { display: flex; gap: 8px; align-items: flex-start; }
.check input { width: auto; margin-top: 4px; }
code, .mono { font-family: ui-monospace, monospace; word-break: break-all; }
.site-foot {
    position: relative;
    z-index: 20;
    text-align: center;
    color: #fff;
    padding: 42px 16px 16px;
    background: linear-gradient(to top, #000 0%, rgba(0, 0, 0, .82) 46%, transparent 100%);
    font-size: 14px;
    letter-spacing: .02em;
}
.site-foot .heart { color: #ef4444; }
body:has(.hero-onair) .site-foot {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
}
@media (max-width: 860px) {
    .hero, .grid.cols-3, .grid.cols-4, .grid.cols-2, .layout { grid-template-columns: 1fr; }
    .hero.hero-onair { min-height: 0; padding-top: 108px; padding-bottom: 108px; }
    .hero-onair .onair-copy { max-width: 100%; }
    .hire { position: relative; right: auto; bottom: auto; align-self: flex-end; }
    .nav { align-items: flex-start; padding-top: 12px; padding-bottom: 12px; }
    .menu-pills { justify-content: flex-end; }
    .pill { font-size: 12px; padding: 7px 10px; }
}
