:root {
    color-scheme: dark;
    --bg: #07111f;
    --panel: #111d2d;
    --panel-2: #17263a;
    --border: #2a3a50;
    --text: #f8fafc;
    --muted: #9fb0c5;
    --accent: #2f91ff;
    --accent-2: #6fc1ff;
    --good: #54d58c;
    --bad: #ff7272;
    --warning: #ffc45e;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Arial, Helvetica, sans-serif; }
a { color: var(--accent-2); }
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-shell { width: min(100%, 560px); }
.panel, .hero-panel, .metric { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; }
.panel { padding: 26px; }
.brand { font-weight: 800; letter-spacing: .02em; color: white; }
h1 { margin: 10px 0 8px; font-size: clamp(28px, 5vw, 42px); }
h2 { margin-top: 0; }
.muted, .field-help { color: var(--muted); }
.field-help { font-size: 14px; margin: -8px 0 16px; }
label, legend { display: block; font-weight: 700; margin: 16px 0 7px; }
input { width: 100%; border: 1px solid var(--border); border-radius: 10px; background: #0a1524; color: var(--text); padding: 12px 13px; font-size: 16px; }
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button { width: 100%; margin-top: 22px; border: 0; border-radius: 10px; background: var(--accent); color: white; padding: 13px 16px; font-size: 16px; font-weight: 800; cursor: pointer; }
button:hover { filter: brightness(1.08); }
fieldset { border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-top: 22px; }
fieldset legend { padding: 0 7px; margin: 0; }
.check-row { display: flex; align-items: flex-start; gap: 10px; font-weight: 600; }
.check-row input { width: auto; margin-top: 3px; }
.notice { border-radius: 10px; padding: 12px 14px; margin: 16px 0; }
.notice.error { background: rgba(255,114,114,.12); border: 1px solid rgba(255,114,114,.55); }
.notice.success { background: rgba(84,213,140,.12); border: 1px solid rgba(84,213,140,.55); }
.notice.warning { background: rgba(255,196,94,.12); border: 1px solid rgba(255,196,94,.55); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px clamp(20px, 5vw, 60px); background: #0a1626; border-bottom: 1px solid var(--border); }
.topbar-subtitle { color: var(--muted); font-size: 13px; margin-top: 3px; }
.user-menu { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 14px; }
.dashboard-shell { width: min(1180px, calc(100% - 32px)); margin: 34px auto 70px; }
.hero-panel { padding: 30px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.eyebrow { margin: 0; color: var(--accent-2); font-weight: 800; letter-spacing: .12em; font-size: 12px; }
.status-pill { border: 1px solid rgba(84,213,140,.6); background: rgba(84,213,140,.12); color: var(--good); border-radius: 999px; padding: 8px 13px; font-weight: 800; font-size: 13px; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 16px 0; }
.metric { padding: 20px; }
.metric span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.metric strong { font-size: 22px; }
.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checks { width: 100%; border-collapse: collapse; }
.checks td { border-bottom: 1px solid var(--border); padding: 12px 4px; }
.checks td:last-child { text-align: right; font-weight: 800; }
.pass { color: var(--good); }
.fail { color: var(--bad); }
.roadmap { list-style: none; padding: 0; margin: 20px 0 0; }
.roadmap li { border-left: 3px solid var(--border); padding: 8px 0 8px 14px; color: var(--muted); }
.roadmap li.done { border-left-color: var(--good); color: var(--text); }
code { background: #091322; padding: 2px 5px; border-radius: 5px; }
[hidden] { display: none !important; }
@media (max-width: 760px) {
    .topbar, .hero-panel { align-items: flex-start; flex-direction: column; }
    .user-menu { width: 100%; justify-content: space-between; }
    .metric-grid, .content-grid { grid-template-columns: 1fr; }
}
select, textarea { width: 100%; border: 1px solid var(--border); border-radius: 10px; background: #0a1524; color: var(--text); padding: 12px 13px; font-size: 16px; font-family: inherit; }
select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.admin-nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.admin-nav a { color: var(--muted); text-decoration: none; border-radius: 8px; padding: 8px 11px; font-weight: 700; font-size: 14px; }
.admin-nav a:hover, .admin-nav a.active { color: var(--text); background: var(--panel-2); }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 20px; }
.page-heading h1 { margin-bottom: 4px; }
.button-link { display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: white; text-decoration: none; padding: 12px 16px; border-radius: 10px; font-weight: 800; white-space: nowrap; }
.button-link.secondary { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); }
.metric-grid.four { grid-template-columns: repeat(4, 1fr); }
.full-span { grid-column: 1 / -1; }
.tool-links { display: grid; gap: 12px; }
.tool-links a { display: block; border: 1px solid var(--border); border-radius: 12px; padding: 16px; text-decoration: none; background: #0b1726; }
.tool-links strong { display: block; color: var(--text); margin-bottom: 5px; }
.tool-links span { color: var(--muted); font-size: 14px; }
.roadmap.horizontal { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.roadmap.horizontal li { border-left: 0; border-top: 3px solid var(--border); padding: 12px 0 0; }
.roadmap.horizontal li.done { border-top-color: var(--good); }
.filter-panel { margin-bottom: 16px; padding: 18px 22px; }
.filter-grid { display: grid; grid-template-columns: 2fr 1fr 1.3fr auto; align-items: end; gap: 12px; }
.filter-grid label { margin-top: 0; }
.filter-action button { width: auto; margin: 0; min-height: 45px; }
.section-title-row { display: flex; justify-content: space-between; align-items: center; }
.media-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.media-card { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: #0b1726; }
.media-preview { display: grid; place-items: center; aspect-ratio: 16 / 9; background: #050d18; overflow: hidden; text-decoration: none; }
.media-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-icon { color: var(--muted); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; font-weight: 800; letter-spacing: .1em; font-size: 12px; }
.media-card-body { padding: 15px; }
.media-card h3 { margin: 8px 0 5px; font-size: 18px; }
.media-card h3 a { color: var(--text); text-decoration: none; }
.media-meta { display: flex; justify-content: space-between; color: var(--accent-2); font-size: 11px; letter-spacing: .08em; font-weight: 800; }
.small { font-size: 13px; overflow-wrap: anywhere; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag-chip { border-radius: 999px; border: 1px solid var(--border); color: var(--muted); padding: 4px 8px; font-size: 11px; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.narrow-shell { width: min(920px, calc(100% - 32px)); }
.form-panel { padding: 26px; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two-col { grid-template-columns: 1fr 1fr; }
.form-section-title { margin: 30px 0 6px; padding-top: 22px; border-top: 1px solid var(--border); }
.tag-fieldset { margin-top: 16px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 14px; }
.check-row { margin: 0; }
.button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.danger-button { background: rgba(255,114,114,.16); color: var(--bad); border: 1px solid rgba(255,114,114,.5); }
.asset-layout { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
.asset-player video, .asset-player img { display: block; width: 100%; max-height: 520px; object-fit: contain; background: #050d18; border-radius: 10px; }
.asset-player audio { width: 100%; }
.asset-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0 0; }
.asset-facts div { border-top: 1px solid var(--border); padding-top: 10px; }
.asset-facts dt { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.asset-facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 980px) {
    .metric-grid.four, .media-grid { grid-template-columns: repeat(2, 1fr); }
    .filter-grid { grid-template-columns: 1fr 1fr; }
    .asset-layout { grid-template-columns: 1fr; }
    .roadmap.horizontal { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .admin-nav { order: 3; width: 100%; overflow-x: auto; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .metric-grid.four, .media-grid, .form-grid.two-col, .checkbox-grid, .button-row, .filter-grid { grid-template-columns: 1fr; }
}

/* Media Library cards v2 */
.library-panel { padding: 22px; }
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}
.media-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 15px;
    overflow: hidden;
    background: #0b1726;
}
.media-preview {
    position: relative;
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 160px;
    overflow: hidden;
    background: #050d18;
    color: var(--text);
    text-decoration: none;
}
.media-preview img,
.media-preview video {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.media-thumb { opacity: 0; transition: opacity .2s ease; }
.media-thumb.is-ready { opacity: 1; }
.preview-play {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding-left: 3px;
    border-radius: 999px;
    color: white;
    background: rgba(0,0,0,.62);
    border: 1px solid rgba(255,255,255,.32);
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.duration-badge {
    position: absolute;
    right: 9px;
    bottom: 9px;
    z-index: 3;
    padding: 4px 7px;
    border-radius: 6px;
    background: rgba(0,0,0,.78);
    color: white;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
}
.audio-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 86px;
    color: var(--accent-2);
}
.audio-preview span {
    display: block;
    width: 8px;
    border-radius: 999px;
    background: currentColor;
}
.audio-preview span:nth-child(1), .audio-preview span:nth-child(5) { height: 28px; }
.audio-preview span:nth-child(2), .audio-preview span:nth-child(4) { height: 52px; }
.audio-preview span:nth-child(3) { height: 76px; }
.media-card-body { display: flex; flex: 1; flex-direction: column; padding: 16px; }
.media-card h3 { margin: 10px 0 5px; font-size: 19px; }
.media-card h3 a { color: var(--text); text-decoration: none; }
.media-card h3 a:hover { color: var(--accent-2); }
.filename-line { min-height: 20px; margin: 0 0 10px; }
.media-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--accent-2); font-size: 11px; letter-spacing: .08em; font-weight: 800; }
.status-badge { padding: 3px 7px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); letter-spacing: .04em; }
.status-active { color: var(--good); border-color: rgba(84,213,140,.42); background: rgba(84,213,140,.08); }
.status-archived { color: var(--muted); }
.technical-line { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 10px; color: var(--muted); font-size: 12px; }
.technical-line span:not(:last-child)::after { content: "·"; margin-left: 10px; color: var(--border); }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag-chip { display: inline-flex; align-items: center; min-height: 25px; border-radius: 999px; border: 1px solid var(--border); background: #0a1524; color: var(--muted); padding: 4px 9px; font-size: 11px; line-height: 1.2; }
.tag-more { color: var(--accent-2); }
.card-actions { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 16px; }
.card-actions form { margin: 0; }
.small-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 38px;
    margin: 0;
    padding: 8px 11px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--panel-2);
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}
.small-button:hover { filter: brightness(1.08); }
.danger-outline { background: transparent; color: var(--bad); border-color: rgba(255,114,114,.45); }
.detail-tags { margin: 16px 0 2px; }
.full-width-link { width: 100%; margin-top: 20px; }
.three-actions { grid-template-columns: 1fr 1fr 1fr; }
.secondary-button { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); }
.delete-note { margin-top: 10px; }
@media (max-width: 760px) {
    .library-panel { padding: 16px; }
    .media-grid { grid-template-columns: 1fr; }
    .three-actions { grid-template-columns: 1fr; }
}

/* Ticker management */
.ticker-preview-panel { padding: 22px; margin-bottom: 16px; }
.ticker-shell { display: flex; min-height: 60px; margin-top: 18px; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #07101d; }
.ticker-label { position: relative; z-index: 2; display: flex; align-items: center; flex: 0 0 auto; padding: 0 18px; background: var(--accent); color: white; font-size: 13px; font-weight: 900; letter-spacing: .08em; }
.ticker-breaking .ticker-label { background: #b7202e; }
.ticker-breaking { border-color: rgba(255,114,114,.55); }
.ticker-viewport { min-width: 0; flex: 1; overflow: hidden; }
.ticker-track { display: flex; align-items: center; width: max-content; min-height: 58px; animation: hdnTickerScroll 38s linear infinite; }
.ticker-shell:hover .ticker-track { animation-play-state: paused; }
.ticker-entry { display: inline-flex; align-items: center; gap: 10px; padding: 0 28px 0 22px; white-space: nowrap; color: var(--text); }
.ticker-entry::after { content: "◆"; margin-left: 18px; color: var(--accent-2); font-size: 8px; }
.ticker-entry strong { color: var(--accent-2); font-size: 12px; letter-spacing: .08em; }
@keyframes hdnTickerScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ticker-filter-grid { grid-template-columns: 2fr 1fr 1.3fr auto; }
.ticker-list-panel { padding: 22px; }
.ticker-item-list { display: grid; gap: 12px; margin-top: 16px; }
.ticker-item-card { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 18px; border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 12px; background: #0b1726; }
.ticker-item-card.is-breaking { border-left-color: #ff5c69; }
.ticker-item-main { min-width: 0; flex: 1; }
.ticker-item-card h3 { margin: 10px 0 8px; font-size: 18px; line-height: 1.35; }
.ticker-card-topline { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.ticker-category, .breaking-chip { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 999px; color: var(--accent-2); font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.breaking-chip { color: #ff8b94; border-color: rgba(255,114,114,.5); background: rgba(255,114,114,.08); }
.status-live { color: var(--good); border-color: rgba(84,213,140,.42); }
.status-scheduled { color: var(--accent-2); }
.status-draft, .status-expired, .status-archived { color: var(--muted); }
.ticker-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 12px; }
.ticker-card-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.ticker-card-actions form { margin: 0; }
.ticker-editor .ticker-breaking-check { display: flex; align-items: flex-start; gap: 10px; margin: 20px 0 4px; padding: 14px; border: 1px solid rgba(255,114,114,.35); border-radius: 10px; background: rgba(255,114,114,.06); }
.ticker-breaking-check span { display: grid; gap: 3px; }
.ticker-breaking-check small { color: var(--muted); }
.date-input-wrap { width: 100%; min-width: 0; border: 1px solid var(--border); border-radius: 10px; background: #0a1524; padding: 12px 13px; }
.date-input-wrap input { display: block; width: 100%; min-width: 0; padding: 0; border: 0; background: transparent; color: var(--text); font-size: 16px; }
@media (prefers-reduced-motion: reduce) { .ticker-track { animation: none; } }
@media (max-width: 900px) {
    .ticker-item-card { align-items: flex-start; flex-direction: column; }
    .ticker-card-actions { justify-content: flex-start; }
}
@media (max-width: 760px) {
    .ticker-filter-grid { grid-template-columns: 1fr; }
    .ticker-label { padding: 0 10px; font-size: 10px; }
    .ticker-track { animation-duration: 28s; }
}
.ticker-editor .button-row .button-link { width: 100%; }
