:root {
    --bg: #0b0e11;
    --panel: #12161c;
    --panel-alt: #1a1f27;
    --text: #eef1f4;
    --muted: #8b96a3;
    --accent: #14b8a6;
    --accent-hover: #0d9488;
    --accent-2: #0ea5e9;
    --border: #232a34;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }

.site-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 12px 24px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.logo { font-size: 22px; font-weight: 700; color: var(--text); }
.logo span { color: var(--accent); }

.search-form { flex: 1; display: flex; max-width: 480px; }
.search-form input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 4px 0 0 4px;
    background: var(--panel-alt);
    color: var(--text);
}
.search-form button {
    padding: 8px 16px;
    border: none;
    border-radius: 0 4px 4px 0;
    background: var(--accent);
    color: #04201c;
    font-weight: 600;
    cursor: pointer;
}
.search-form button:hover { background: var(--accent-hover); }

.nav-links { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.btn-small, .btn {
    background: var(--accent);
    color: #04201c !important;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 4px;
}
.btn-small:hover, .btn:hover { background: var(--accent-hover); color: #04201c !important; }
.link-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 14px;
    padding: 0;
}
.link-btn:hover { color: var(--accent); }
.inline-form { display: inline; }

.site-main { max-width: 1200px; margin: 0 auto; padding: 24px; min-height: 70vh; }
.site-footer { text-align: center; padding: 24px; color: var(--muted); font-size: 13px; }

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.video-card { display: block; }
.video-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--panel-alt);
    border-radius: 6px;
    overflow: hidden;
}
.video-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-duration {
    position: absolute;
    right: 6px;
    bottom: 6px;
    background: rgba(0,0,0,0.8);
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 3px;
}
.video-title { margin: 8px 0 2px; font-size: 15px; color: var(--text); line-height: 1.3; }
.video-meta { color: var(--muted); font-size: 13px; }

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
}

.form-panel { max-width: 420px; margin: 40px auto; }
.form-panel h1 { margin-top: 0; }
.form-row { margin-bottom: 14px; display: flex; flex-direction: column; gap: 6px; }
.form-row label { font-size: 13px; color: var(--muted); }
.form-row input, .form-row textarea, .form-row select {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--panel-alt);
    color: var(--text);
    font-size: 14px;
}
.form-row textarea { min-height: 100px; resize: vertical; }
.submit-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    background: var(--accent);
    color: #04201c;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
}
.submit-btn:hover { background: var(--accent-hover); }
.form-error { color: var(--accent); font-size: 14px; margin-bottom: 12px; }
.form-hint { color: var(--muted); font-size: 13px; }

.watch-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; align-items: start; }
.video-js { width: 100%; aspect-ratio: 16/9; }
.watch-title { font-size: 22px; margin: 16px 0 4px; }
.watch-meta { color: var(--muted); font-size: 14px; display: flex; gap: 16px; align-items: center; }
.vote-btn {
    background: var(--panel-alt);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
}
.vote-btn:hover { border-color: var(--accent); }
.watch-description { margin-top: 16px; color: var(--text); white-space: pre-wrap; line-height: 1.5; }

.embed-box textarea {
    width: 100%;
    background: var(--panel-alt);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
    padding: 8px;
    border-radius: 4px;
    min-height: 60px;
}

.comments-section { margin-top: 32px; }
.comment { border-bottom: 1px solid var(--border); padding: 12px 0; }
.comment-author { font-weight: 600; font-size: 14px; }
.comment-body { margin: 4px 0 0; color: var(--text); }
.comment-form textarea { width: 100%; }

.sidebar-box { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.sidebar-box h3 { margin-top: 0; font-size: 15px; }

.table-scroll { overflow-x: auto; }
table.admin-table { width: 100%; border-collapse: collapse; min-width: 480px; }
table.admin-table th, table.admin-table td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.badge { padding: 2px 8px; border-radius: 10px; font-size: 12px; }
.badge-ready { background: #1b4332; color: #74c69d; }
.badge-processing { background: #4a3b1b; color: #e0b84a; }
.badge-failed { background: #4a1b1b; color: #e07a7a; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 16px; }
.stat-card .value { font-size: 28px; font-weight: 700; }
.stat-card .label { color: var(--muted); font-size: 13px; }

.category-pills { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.category-pills a {
    background: var(--panel-alt);
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 13px;
    border: 1px solid var(--border);
}
.category-pills a.active { background: var(--accent); color: #04201c; font-weight: 600; }

.section-heading { font-size: 18px; margin: 0 0 16px; color: var(--text); }

.hero {
    background: linear-gradient(135deg, #0f766e 0%, #0a4f49 100%);
    border-radius: 16px;
    padding: 56px 40px;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: wrap;
}
.hero-copy { max-width: 540px; }
.hero-title {
    font-size: 36px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 14px;
    line-height: 1.2;
    letter-spacing: -0.5px;
}
.hero-subtitle {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 28px;
    line-height: 1.55;
}
.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #ffffff;
    color: #0a4f49;
    font-weight: 700;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 15px;
}
.hero-cta:hover { background: #d6fff6; color: #0a4f49; }
.hero-art { flex-shrink: 0; color: rgba(255, 255, 255, 0.9); }
.hero-art svg { width: 160px; height: 160px; }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
}
.feature-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
}
.feature-icon { font-size: 26px; margin-bottom: 12px; }
.feature-title { font-size: 15px; font-weight: 700; margin: 0 0 8px; color: var(--text); }
.feature-desc { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0; }

@media (max-width: 720px) {
    .hero { padding: 32px 22px; text-align: center; justify-content: center; }
    .hero-copy { max-width: none; }
    .hero-art { display: none; }
    .hero-title { font-size: 26px; }
    .hero-subtitle { font-size: 14px; }
    .hero-cta { padding: 12px 22px; font-size: 14px; }
}

.danger-btn { background: #7a2525; color: white; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; }
.processing-note { color: var(--muted); font-size: 14px; margin-top: 10px; }

.progress-bar-outer {
    background: var(--panel-alt);
    border: 1px solid var(--border);
    border-radius: 4px;
    height: 10px;
    overflow: hidden;
    margin-top: 10px;
}
.progress-bar-inner {
    background: var(--accent);
    height: 100%;
    width: 0%;
    transition: width 0.4s ease;
}

.queue-list { display: flex; flex-direction: column; gap: 16px; }
.queue-row {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}
.queue-row-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.queue-source-url {
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.queue-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 10px;
    font-size: 13px;
    color: var(--muted);
}
.queue-meta form { margin-left: auto; }

.monitor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}
.monitor-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
}
.monitor-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}
.monitor-label { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.monitor-value { font-size: 22px; font-weight: 700; color: var(--text); }
.monitor-big { font-size: 26px; font-weight: 700; color: var(--text); margin-bottom: 6px; }

@media (max-width: 860px) {
    .watch-layout { grid-template-columns: 1fr; }
    .site-header { flex-wrap: wrap; }
    .nav-links { flex-wrap: wrap; margin-left: 0; }
}

@media (max-width: 480px) {
    .site-header { padding: 10px 16px; gap: 12px; }
    .site-main { padding: 16px; }
    .logo { font-size: 19px; }
    .search-form { order: 3; flex-basis: 100%; max-width: none; }
    .watch-meta { flex-wrap: wrap; gap: 10px; }
}
