:root {
  --bg: #07111f;
  --panel: #101c31;
  --panel-2: #152541;
  --line: rgba(255,255,255,0.09);
  --text: #e8edf8;
  --muted: #a6b4cc;
  --accent: #5aa2ff;
  --accent-2: #7ce2c3;
  --danger: #ff8e8e;
  --success: #97f3b6;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: linear-gradient(180deg, #050a14, var(--bg)); color: var(--text); font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
body { min-height: 100vh; }
.container { width: min(1120px, calc(100vw - 32px)); margin: 0 auto; }
.site-header { position: sticky; top: 0; z-index: 10; backdrop-filter: blur(10px); background: rgba(7, 17, 31, 0.82); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 16px; }
.brand { font-size: 1.15rem; font-weight: 700; letter-spacing: 0.02em; }
.header-nav { display: flex; align-items: center; gap: 16px; color: var(--muted); }
.inline-form { margin: 0; }
.page-content { padding: 28px 0 56px; }
.hero, .panel, .card, .empty-state, .form-shell { background: rgba(16, 28, 49, 0.92); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.hero { padding: 28px; display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-bottom: 24px; }
.hero h1, .watch-meta h1, .panel h1, .form-shell h1 { margin: 0 0 10px; }
.hero p, .panel p, .form-shell p, .card p, .watch-meta p { color: var(--muted); line-height: 1.6; }
.button, .ghost-button, button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; padding: 11px 16px; border: 1px solid transparent; background: linear-gradient(135deg, var(--accent), #4b7dff); color: white; font-weight: 600; cursor: pointer; }
.button.secondary, .ghost-button { background: transparent; border-color: var(--line); color: var(--text); }
.danger-button { background: rgba(255, 142, 142, 0.14); border: 1px solid rgba(255, 142, 142, 0.35); color: #ffd3d3; }
.danger-button:hover { background: rgba(255, 142, 142, 0.22); }
.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.card { overflow: hidden; }
.video-preview { aspect-ratio: 16 / 9; background: #000; }
.video-preview video, .player-shell video { width: 100%; height: 100%; display: block; background: #000; }
.card-body { padding: 18px; }
.card-body h2 { margin: 0 0 10px; font-size: 1.15rem; }
.meta-line { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 0.95rem; margin: 12px 0 16px; }
.card-actions, .admin-actions, .copy-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.compact-actions { align-items: center; }
.empty-state { padding: 34px; text-align: center; }
.form-shell, .panel { padding: 24px; }
.form-shell.narrow { width: min(560px, 100%); margin: 0 auto; }
.stack-form { display: grid; gap: 16px; }
.stack-form label, .share-grid label { display: grid; gap: 8px; color: var(--muted); font-size: 0.95rem; }
input[type="text"], input[type="password"], input[type="file"], textarea, select { width: 100%; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font: inherit; }
textarea { resize: vertical; }
.admin-layout { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 20px; margin-bottom: 24px; }
.success-panel { border-color: rgba(151, 243, 182, 0.25); }
.admin-publish-panel { margin-bottom: 24px; }
.section-heading { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 16px; }
.admin-catalog-hint { margin: 0 0 18px; }
.category-toolbar { display: flex; align-items: end; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.category-filter-field { display: grid; gap: 8px; min-width: min(320px, 100%); color: var(--muted); font-size: 0.95rem; }
.category-reset-button { text-decoration: none; }
.admin-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.admin-card { background: rgba(11, 21, 37, 0.82); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; min-height: 100%; }
.admin-card-preview { aspect-ratio: 16 / 9; background: #000; }
.admin-card-preview video { width: 100%; height: 100%; display: block; background: #000; }
.admin-card-body { padding: 18px; display: grid; gap: 10px; }
.inline-title-form { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: center; }
.inline-title-input { font-size: 1rem; font-weight: 700; padding: 10px 12px; transition: border-color 0.18s ease, box-shadow 0.18s ease; }
.inline-title-input.is-saving { border-color: rgba(90, 162, 255, 0.75); box-shadow: 0 0 0 3px rgba(90, 162, 255, 0.15); }
.inline-title-input.is-saved { border-color: rgba(151, 243, 182, 0.75); box-shadow: 0 0 0 3px rgba(151, 243, 182, 0.14); }
.inline-title-input.is-error { border-color: rgba(255, 142, 142, 0.75); box-shadow: 0 0 0 3px rgba(255, 142, 142, 0.14); }
.admin-card-description { margin: 0; color: var(--muted); line-height: 1.55; }
.copy-actions { margin-top: 2px; }
.copy-button { font-size: 0.92rem; }
.compact-actions .inline-form { margin: 0; }
.admin-upload-card { padding: 18px; justify-content: space-between; border-style: dashed; }
.admin-upload-header h3 { margin: 0 0 8px; }
.admin-upload-header p { margin: 0 0 12px; }
.admin-upload-form { margin-top: 8px; }
.upload-topline { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 12px; align-items: end; }
.upload-source-line { display: grid; grid-template-columns: 1fr auto 1.2fr; gap: 12px; align-items: end; }
.muted { color: var(--muted); }
.share-grid { display: grid; gap: 14px; }
.share-grid .full { grid-column: 1 / -1; }
.watch-page { display: grid; gap: 20px; }
.player-shell { border-radius: 20px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.watch-meta { background: rgba(16, 28, 49, 0.92); border: 1px solid var(--line); border-radius: 20px; padding: 24px; box-shadow: var(--shadow); }
.watch-share { margin-top: 18px; }
.or-separator { display: flex; align-items: center; justify-content: center; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.82rem; }
.or-separator::before, .or-separator::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.or-separator span { padding: 0 12px; }
.flash-stack { display: grid; gap: 12px; margin-bottom: 18px; }
.flash { border-radius: 14px; padding: 14px 16px; border: 1px solid var(--line); }
.flash-error { background: rgba(255, 142, 142, 0.14); border-color: rgba(255, 142, 142, 0.35); }
.flash-success { background: rgba(151, 243, 182, 0.14); border-color: rgba(151, 243, 182, 0.35); }

@media (max-width: 860px) {
  .hero, .admin-layout, .admin-item, .header-row { grid-template-columns: 1fr; flex-direction: column; align-items: flex-start; }
  .admin-layout { display: grid; }
  .admin-item { flex-direction: column; }
  .admin-gallery, .upload-topline, .upload-source-line { grid-template-columns: 1fr; }
}
