/* ==========================================================================
   Agora na TV — design system
   ========================================================================== */

:root {
    --bg: #09090c;
    --bg-elev: #0f0f14;
    --surface: #14141b;
    --surface-2: #1b1b24;
    --surface-3: #24242f;
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.14);
    --text: #f3f3f6;
    --text-2: #b9b9c6;
    --muted: #7d7d8c;
    --accent: #e50914;
    --accent-2: #ff3d47;
    --accent-soft: rgba(229, 9, 20, 0.14);
    --accent-line: rgba(229, 9, 20, 0.45);
    --gold: #f5c518;
    --success: #22c55e;
    --danger: #ef4444;
    --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --header-h: 64px;
    --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: dark;
}

[data-theme="light"] {
    --bg: #f6f6f8;
    --bg-elev: #ffffff;
    --surface: #ffffff;
    --surface-2: #f1f1f5;
    --surface-3: #e7e7ee;
    --border: rgba(15, 15, 30, 0.08);
    --border-strong: rgba(15, 15, 30, 0.16);
    --text: #121218;
    --text-2: #43434f;
    --muted: #7a7a88;
    --accent-soft: rgba(229, 9, 20, 0.09);
    --accent-line: rgba(229, 9, 20, 0.35);
    --shadow: 0 20px 50px -24px rgba(20, 20, 40, 0.25);
    color-scheme: light;
}

/* Channel logos from the provider are drawn for dark backgrounds */
[data-theme="light"] .channel-cell .logo,
[data-theme="light"] .channel-hero .logo,
[data-theme="light"] .sheet-head .logo,
[data-theme="light"] .article-meta .logo:not(.logo-fallback) {
    background: #1b1b24;
    border-color: #1b1b24;
}

/* Placeholder tile for channels without a logo image */
.logo-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: -0.02em;
    color: #fff;
    background: linear-gradient(135deg, hsl(var(--hue, 0) 55% 42%), hsl(calc(var(--hue, 0) + 40) 60% 30%)) !important;
    border-color: transparent !important;
    line-height: 1;
    text-align: center;
    overflow: hidden;
}

.channel-hero .logo-fallback {
    font-size: 24px;
}

/* ---------- base ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    flex: 1 0 auto;
}

h1, h2, h3, h4 {
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.02em;
    font-weight: 700;
}

p {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: 0;
    padding: 0;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 6px;
}

::selection {
    background: var(--accent);
    color: #fff;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.container {
    width: 100%;
    max-width: 1480px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow {
    max-width: 820px;
}

.muted {
    color: var(--muted);
}

.hidden,
[hidden] {
    display: none !important;
}

/* ---------- header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-h);
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(160%) blur(14px);
    -webkit-backdrop-filter: saturate(160%) blur(14px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 20px;
}

.brand img {
    height: 26px;
    width: auto;
}

.main-nav {
    display: flex;
    gap: 4px;
}

.main-nav a {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-weight: 500;
    font-size: 14px;
    transition: color .15s, background .15s;
}

.main-nav a:hover {
    color: var(--text);
    background: var(--surface-2);
}

.main-nav a[aria-current="page"] {
    color: var(--text);
    background: var(--surface-2);
}

.header-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.search {
    position: relative;
    width: 320px;
}

.search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.search input {
    width: 100%;
    height: 40px;
    padding: 0 14px 0 38px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    outline: none;
    transition: border-color .15s, background .15s;
}

.search input::placeholder {
    color: var(--muted);
}

.search input:focus {
    border-color: var(--border-strong);
    background: var(--surface-2);
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--text-2);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: color .15s, background .15s;
}

.icon-btn:hover {
    color: var(--text);
    background: var(--surface-2);
}

.theme-light-icon { display: none; }
[data-theme="light"] .theme-light-icon { display: block; }
[data-theme="light"] .theme-dark-icon { display: none; }

/* ---------- page head & chips ---------- */

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 28px 0 18px;
}

.page-head h1 {
    font-size: clamp(22px, 3vw, 30px);
}

.page-head p {
    color: var(--muted);
    margin-top: 6px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--accent-2);
    margin-bottom: 8px;
}

.chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 16px;
    scrollbar-width: none;
}

.chips::-webkit-scrollbar {
    display: none;
}

.chip {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    font-size: 14px;
    font-weight: 500;
    transition: all .15s;
    white-space: nowrap;
}

.chip:hover {
    color: var(--text);
    border-color: var(--border-strong);
}

.chip.is-active,
.chip[aria-pressed="true"] {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
}

.chip .count {
    font-size: 12px;
    opacity: .6;
}

.chip svg {
    width: 15px;
    height: 15px;
}

/* ---------- buttons, badges, progress ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    transition: background .15s, border-color .15s, transform .1s;
    white-space: nowrap;
}

.btn:hover {
    background: var(--surface-3);
}

.btn:active {
    transform: scale(.98);
}

.btn:disabled {
    opacity: .5;
    pointer-events: none;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-2);
}

.btn-danger {
    background: transparent;
    border-color: color-mix(in srgb, var(--danger) 45%, transparent);
    color: var(--danger);
}

.btn-danger:hover {
    background: color-mix(in srgb, var(--danger) 12%, transparent);
}

.btn-sm {
    height: 32px;
    padding: 0 12px;
    font-size: 13px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    background: var(--surface-3);
    color: var(--text-2);
}

.badge-live {
    background: var(--accent);
    color: #fff;
}

.badge-live::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .3; }
}

.progress {
    height: 4px;
    border-radius: 999px;
    background: var(--surface-3);
    overflow: hidden;
}

.progress > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width .6s ease;
}

/* ---------- TV guide (timeline) ---------- */

.guide {
    --channel-w: 220px;
    --row-h: 76px;
    --ruler-h: 44px;
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 32px;
}

.guide-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elev);
}

.guide-toolbar .clock {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.guide-toolbar .spacer {
    flex: 1;
}

.guide-scroll {
    position: relative;
    overflow: auto;
    max-height: calc(100vh - var(--header-h) - 190px);
    min-height: 360px;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--surface-3) transparent;
}

.guide-scroll::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.guide-scroll::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border-radius: 10px;
    border: 3px solid var(--surface);
}

.guide-grid {
    position: relative;
    min-width: 100%;
}

.guide-ruler {
    position: sticky;
    top: 0;
    z-index: 6;
    display: flex;
    height: var(--ruler-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.ruler-corner {
    position: sticky;
    left: 0;
    z-index: 7;
    flex: none;
    width: var(--channel-w);
    display: flex;
    align-items: center;
    padding: 0 16px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
}

.ruler-track {
    position: relative;
    flex: none;
}

.tick {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    padding-left: 10px;
    border-left: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.tick.is-hour {
    color: var(--text-2);
    font-weight: 600;
}

.tick .day {
    margin-right: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--surface-3);
    color: var(--text);
    font-size: 11px;
}

.guide-row {
    display: flex;
    height: var(--row-h);
    border-bottom: 1px solid var(--border);
}

.guide-row:last-child {
    border-bottom: 0;
}

.channel-cell {
    position: sticky;
    left: 0;
    z-index: 4;
    flex: none;
    width: var(--channel-w);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px 0 14px;
    background: var(--surface);
    border-right: 1px solid var(--border);
}

.channel-cell .logo {
    flex: none;
    width: 44px;
    height: 44px;
    padding: 6px;
    border-radius: 10px;
    background: var(--surface-2);
    object-fit: contain;
}

.channel-cell .info {
    min-width: 0;
    flex: 1;
}

.channel-cell .name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-cell .name:hover {
    color: var(--accent-2);
}

.channel-cell .number {
    font-size: 12px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.fav-btn {
    flex: none;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--muted);
    opacity: .5;
    transition: opacity .15s, color .15s, background .15s;
}

.guide-row:hover .fav-btn,
.fav-btn:focus-visible {
    opacity: 1;
}

.fav-btn:hover {
    background: var(--surface-2);
    color: var(--text);
}

.is-fav .fav-btn,
.fav-btn[aria-pressed="true"] {
    color: var(--gold);
    opacity: 1;
}

.fav-btn svg {
    width: 18px;
    height: 18px;
}

.fav-btn svg path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.is-fav .fav-btn svg path,
.fav-btn[aria-pressed="true"] svg path {
    fill: currentColor;
}

.row-track {
    position: relative;
    flex: none;
    background-image: repeating-linear-gradient(90deg, transparent 0, transparent 119px, var(--border) 119px, var(--border) 120px);
}

.program {
    position: absolute;
    top: 7px;
    bottom: 7px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 2px;
    padding: 0 12px;
    margin-left: 2px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid transparent;
    text-align: left;
    overflow: hidden;
    overflow: clip; /* clip (not hidden) so the sticky labels below stick to the guide scroller */
    transition: background .15s, border-color .15s;
    isolation: isolate;
}

/* Labels stay readable when the program started before the visible area */
.program .p-title,
.program .p-time {
    position: sticky;
    left: calc(var(--channel-w) + 12px);
    width: fit-content;
    max-width: 100%;
}

.program:hover {
    background: var(--surface-3);
    border-color: var(--border-strong);
}

.program .p-title {
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.program .p-time {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.program.is-narrow {
    padding: 0 6px;
}

.program.is-narrow .p-time {
    display: none;
}

.program.is-live {
    background: var(--accent-soft);
    border-color: var(--accent-line);
}

.program.is-live::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: var(--progress, 0%);
    background: linear-gradient(90deg, transparent, rgba(229, 9, 20, 0.16));
    z-index: -1;
}

.program.is-live .p-time {
    color: var(--accent-2);
}

.program.is-past {
    opacity: .45;
}

.program.is-clipped {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: 0;
}

.program.is-match {
    border-color: var(--gold);
    box-shadow: inset 0 0 0 1px var(--gold);
}

.row-empty {
    position: absolute;
    inset: 7px auto 7px 2px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    color: var(--muted);
    font-size: 13px;
    font-style: italic;
}

.now-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
    background: var(--accent);
    z-index: 3;
    pointer-events: none;
    box-shadow: 0 0 12px rgba(229, 9, 20, .6);
}

.now-flag {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

.guide.only-favs .guide-row:not(.is-fav) {
    display: none;
}

.guide-empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--muted);
}

/* ---------- sheet (program details) ---------- */

.sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(0, 0, 0, .55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
}

.sheet {
    position: fixed;
    top: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 100;
    width: min(440px, calc(100% - 24px));
    display: flex;
    flex-direction: column;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transform: translateX(calc(100% + 24px));
    transition: transform .28s cubic-bezier(.2, .8, .2, 1);
    overflow: hidden;
}

.sheet-open .sheet {
    transform: none;
}

.sheet-open .sheet-backdrop {
    opacity: 1;
    pointer-events: auto;
}

.sheet-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 16px 20px;
    border-bottom: 1px solid var(--border);
}

.sheet-head .logo {
    width: 40px;
    height: 40px;
    padding: 5px;
    border-radius: 10px;
    background: var(--surface-2);
    object-fit: contain;
}

.sheet-head .channel {
    flex: 1;
    min-width: 0;
    font-weight: 600;
}

.sheet-body {
    padding: 22px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sheet-body h2 {
    font-size: 24px;
}

.sheet-time {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
}

.sheet-desc {
    color: var(--text-2);
    line-height: 1.65;
    white-space: pre-line;
}

.sheet-actions {
    margin-top: auto;
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ---------- channel page ---------- */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
}

.back-link:hover {
    color: var(--text);
}

.channel-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 0 28px;
}

.channel-hero .logo {
    width: 88px;
    height: 88px;
    padding: 12px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    object-fit: contain;
}

.channel-hero h1 {
    font-size: clamp(28px, 4vw, 40px);
}

.channel-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: start;
    padding-bottom: 48px;
}

.now-card {
    position: sticky;
    top: calc(var(--header-h) + 16px);
    padding: 22px;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(229, 9, 20, .22), transparent 60%),
        var(--surface);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.now-card h2 {
    font-size: 22px;
}

.now-card .desc {
    color: var(--text-2);
    font-size: 14px;
    line-height: 1.6;
}

.now-card .meta {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.schedule-day {
    margin-bottom: 28px;
}

.schedule-day h2 {
    position: sticky;
    top: var(--header-h);
    z-index: 2;
    padding: 12px 0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--muted);
    background: var(--bg);
}

.schedule {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    overflow: hidden;
}

.schedule-item + .schedule-item {
    border-top: 1px solid var(--border);
}

.schedule-item summary {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto 20px;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    cursor: pointer;
    list-style: none;
    transition: background .15s;
}

.schedule-item summary::-webkit-details-marker {
    display: none;
}

.schedule-item summary:hover {
    background: var(--surface-2);
}

.schedule-item .time {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.schedule-item .title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-item .dur {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.schedule-item .chev {
    color: var(--muted);
    transition: transform .2s;
}

.schedule-item[open] .chev {
    transform: rotate(90deg);
}

.schedule-item .details {
    padding: 0 18px 18px calc(64px + 16px + 18px);
    color: var(--text-2);
    line-height: 1.65;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.schedule-item.is-live summary {
    background: var(--accent-soft);
}

.schedule-item.is-live .time {
    color: var(--accent-2);
}

/* ---------- blog ---------- */

.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding-bottom: 32px;
}

.post-card {
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: transform .2s, border-color .2s;
}

.post-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
}

.post-card img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: var(--surface-2);
}

.post-card .body {
    padding: 16px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.post-card h3 {
    font-size: 17px;
    line-height: 1.35;
}

.post-card a::after {
    content: "";
    position: absolute;
    inset: 0;
}

.post-card .more {
    color: var(--accent-2);
    font-size: 13px;
    font-weight: 600;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding-bottom: 40px;
}

.pagination a,
.pagination span {
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-weight: 600;
    font-size: 14px;
}

.pagination span[aria-current] {
    background: var(--text);
    color: var(--bg);
}

.empty-state {
    padding: 64px 24px;
    text-align: center;
    color: var(--muted);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
}

.empty-state .code {
    font-size: 72px;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text);
    line-height: 1;
}

.empty-state h1 {
    margin: 12px 0 20px;
    font-size: 22px;
    color: var(--text-2);
}

/* ---------- article ---------- */

.article {
    padding: 8px 0 56px;
}

.article-hero {
    margin: 20px 0 28px;
    border-radius: 22px;
    overflow: hidden;
    background: var(--surface-2);
}

.article-hero img {
    width: 100%;
    aspect-ratio: 16 / 8;
    object-fit: cover;
}

.article h1 {
    font-size: clamp(28px, 4.2vw, 44px);
    letter-spacing: -0.03em;
    margin-bottom: 18px;
}

.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 32px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
}

.article-meta .logo {
    width: 40px;
    height: 40px;
    padding: 5px;
    border-radius: 10px;
    background: var(--surface-2);
    object-fit: contain;
}

.article-meta .info {
    flex: 1;
    min-width: 160px;
}

.article-meta .info strong {
    display: block;
}

.article-meta .info span {
    color: var(--muted);
    font-size: 13px;
}

.prose {
    font-size: 17.5px;
    line-height: 1.75;
    color: var(--text-2);
}

.prose h2 {
    margin: 36px 0 12px;
    font-size: 24px;
    color: var(--text);
}

.prose h3 {
    margin: 28px 0 10px;
    font-size: 20px;
    color: var(--text);
}

.prose p {
    margin: 0 0 18px;
}

.prose a {
    color: var(--accent-2);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.prose ul,
.prose ol {
    padding-left: 22px;
    margin: 0 0 18px;
}

.prose blockquote {
    margin: 24px 0;
    padding: 4px 0 4px 18px;
    border-left: 3px solid var(--accent);
    color: var(--text);
}

/* ---------- admin ---------- */

.admin-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 28px 0 20px;
    flex-wrap: wrap;
}

.admin-bar h1 {
    font-size: 26px;
}

.admin-bar .actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.list {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    overflow: hidden;
    margin-bottom: 32px;
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    transition: background .15s;
}

.list-item + .list-item {
    border-top: 1px solid var(--border);
}

a.list-item:hover {
    background: var(--surface-2);
}

.list-item .title {
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-item .meta {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.list-empty {
    padding: 28px 18px;
    text-align: center;
    color: var(--muted);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
}

.input,
.select {
    height: 44px;
    padding: 0 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    outline: none;
}

.input:focus,
.select:focus {
    border-color: var(--border-strong);
}

.form-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-row .field {
    flex: 1;
    min-width: 220px;
}

.editable {
    border-radius: var(--radius);
    padding: 6px 10px;
    margin: 0 -10px;
    outline: 1px dashed transparent;
    transition: outline-color .15s, background .15s;
}

.editable:hover {
    outline-color: var(--border-strong);
}

.editable:focus {
    outline: 1px solid var(--accent-line);
    background: var(--surface);
}

.thumb-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 12px 0 24px;
}

.thumb {
    border-radius: var(--radius);
    overflow: hidden;
    border: 2px solid transparent;
    background: var(--surface-2);
    transition: border-color .15s, transform .15s;
}

.thumb img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.thumb:hover {
    transform: scale(1.01);
}

.thumb[aria-pressed="true"] {
    border-color: var(--accent);
}

.sticky-actions {
    position: sticky;
    bottom: 0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 0;
    background: linear-gradient(transparent, var(--bg) 40%);
}

/* ---------- login ---------- */

.login-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: min(380px, 100%);
    padding: 32px 28px;
    border-radius: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.login-card img {
    height: 30px;
    width: auto;
    align-self: center;
    margin-bottom: 8px;
}

/* ---------- footer ---------- */

.site-footer {
    border-top: 1px solid var(--border);
    padding: 28px 0 36px;
    color: var(--muted);
    font-size: 13px;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-inner nav {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.footer-inner a:hover {
    color: var(--text);
}

/* ---------- responsive ---------- */

@media (max-width: 1100px) {
    .channel-layout {
        grid-template-columns: 1fr;
    }

    .now-card {
        position: static;
        order: -1;
    }
}

@media (max-width: 860px) {
    .main-nav {
        display: none;
    }

    .search {
        width: auto;
        flex: 1;
    }

    .header-actions {
        flex: 1;
    }
}

@media (max-width: 640px) {
    :root {
        --header-h: 58px;
    }

    .container {
        padding: 0 14px;
    }

    .header-inner {
        gap: 12px;
    }

    .brand img {
        height: 20px;
    }

    .page-head {
        padding: 20px 0 14px;
    }

    .page-head .clock-box {
        display: none;
    }

    .guide {
        --channel-w: 76px;
        --row-h: 68px;
        border-radius: var(--radius);
        margin: 0 -14px 24px;
        border-left: 0;
        border-right: 0;
    }

    .guide-scroll {
        max-height: calc(100vh - var(--header-h) - 170px);
    }

    .channel-cell {
        flex-direction: column;
        justify-content: center;
        gap: 2px;
        padding: 0 6px;
    }

    .channel-cell .info {
        display: none;
    }

    .channel-cell .logo {
        width: 38px;
        height: 38px;
    }

    .channel-cell .fav-btn {
        width: 22px;
        height: 22px;
        opacity: 1;
    }

    .channel-cell .fav-btn svg {
        width: 14px;
        height: 14px;
    }

    .ruler-corner {
        padding: 0;
        justify-content: center;
        font-size: 10px;
    }

    .guide-toolbar .legend {
        display: none;
    }

    .sheet {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 86vh;
        border-radius: 22px 22px 0 0;
        transform: translateY(100%);
    }

    .channel-hero .logo {
        width: 64px;
        height: 64px;
    }

    .schedule-item summary {
        grid-template-columns: 52px minmax(0, 1fr) 16px;
        gap: 12px;
        padding: 14px;
    }

    .schedule-item .dur {
        display: none;
    }

    .schedule-item .details {
        padding: 0 14px 16px;
    }

    .thumb-grid {
        grid-template-columns: 1fr;
    }

    .prose {
        font-size: 16.5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
