/* ============================================================
   lightyer — modern UI
   Dark + Light · Display: Sora · Body: Inter · Data: JetBrains Mono
   ============================================================ */

/* ===================== THEME TOKENS ===================== */
:root,
:root[data-theme="dark"] {
  --bg:        #0a0a0d;
  --bg-soft:   #0e0e12;
  --surface:   #15151b;
  --surface-2: #1c1c24;
  --surface-3: #24242e;
  --hair:      rgba(255,255,255,0.07);
  --hair-2:    rgba(255,255,255,0.12);

  --ink:   #f4f3f1;
  --muted: #a2a1ac;
  --dim:   #66666f;

  --accent:        #ff7a1a;
  --accent-bright: #ff944a;
  --accent-ink:    #1a0c00;       /* text on accent fills */
  --accent-soft:   rgba(255,122,26,0.14);
  --accent-line:   rgba(255,122,26,0.30);
  --accent-glow:   rgba(255,90,10,0.40);
  --on-thumb:      #ffffff;
  --good: #46d17e;
  --gold: #ffb24d;
  --danger: #ff5a6a;

  --grad: linear-gradient(105deg, #ff5a0a 0%, #ff7a1a 45%, #ffb24d 100%);
  --ph-grad: linear-gradient(135deg, #1d1d25, #121016 70%, #1a120c);

  --shadow-card: 0 2px 4px rgba(0,0,0,.3);
  --shadow-pop:  0 24px 60px -18px rgba(0,0,0,.7), 0 2px 8px rgba(0,0,0,.4);
  --glow: 0 0 0 1px var(--accent-line), 0 16px 40px -12px var(--accent-glow);

  --nav-bg: rgba(10,10,13,0.72);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg:        #f5f3ef;
  --bg-soft:   #efece6;
  --surface:   #ffffff;
  --surface-2: #f4f1ec;
  --surface-3: #ece8e1;
  --hair:      rgba(25,20,12,0.10);
  --hair-2:    rgba(25,20,12,0.16);

  --ink:   #19160f;
  --muted: #6c685f;
  --dim:   #a39d92;

  --accent:        #e5590c;
  --accent-bright: #c64a06;
  --accent-ink:    #fff7f0;
  --accent-soft:   rgba(229,89,12,0.10);
  --accent-line:   rgba(229,89,12,0.28);
  --accent-glow:   rgba(229,89,12,0.30);
  --on-thumb:      #ffffff;

  --grad: linear-gradient(105deg, #ec5a06 0%, #f47216 50%, #f59a3c 100%);
  --ph-grad: linear-gradient(135deg, #e9e4db, #efe9df 70%, #f0e6da);

  --shadow-card: 0 1px 2px rgba(40,30,15,.08), 0 6px 16px -10px rgba(40,30,15,.18);
  --shadow-pop:  0 24px 60px -20px rgba(40,30,15,.30), 0 2px 8px rgba(40,30,15,.10);
  --glow: 0 0 0 1px var(--accent-line), 0 16px 38px -14px var(--accent-glow);

  --nav-bg: rgba(245,243,239,0.78);
  color-scheme: light;
}

:root {
  --r-xl: 22px; --r-lg: 18px; --r: 13px; --r-sm: 9px; --pill: 999px;
  --maxw: 1400px;
  --font-display: "Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .35s ease, color .35s ease;
}

/* faint ambient glow at top (only dark gets the strong version) */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(1000px 540px at 50% -10%, var(--accent-soft), transparent 68%);
  opacity: .9;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }
img, video { display: block; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: 30px; }

/* ===================== NAVBAR ===================== */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid var(--hair);
}
.navbar-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 13px 30px;
  display: flex; align-items: center; gap: 18px;
}
.logo { display: flex; align-items: center; gap: 11px; font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -.5px; }
.logo-mark {
  position: relative; width: 32px; height: 32px; border-radius: 9px;
  background: var(--grad); display: grid; place-items: center;
  color: var(--accent-ink); font-weight: 800; font-size: 17px; overflow: hidden;
  box-shadow: 0 5px 16px -5px var(--accent-glow), inset 0 1px 0 rgba(255,255,255,.4);
}
.logo-mark::after {
  content: ""; position: absolute; top: -40%; left: -12%; width: 55%; height: 180%;
  background: linear-gradient(transparent, rgba(255,255,255,.5), transparent);
  transform: rotate(20deg); filter: blur(2px);
}
.logo-text span { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.nav-spacer { flex: 1; }
.nav-actions { display: flex; align-items: center; gap: 8px; }

/* icon button (theme toggle etc.) */
.icon-btn {
  width: 38px; height: 38px; border-radius: var(--pill);
  display: grid; place-items: center;
  border: 1px solid var(--hair-2); color: var(--muted);
  transition: color .15s, border-color .15s, background .15s, transform .15s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--dim); background: var(--surface-2); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }
/* sun/moon swap */
[data-theme-toggle] .i-moon { display: none; }
[data-theme-toggle] .i-sun  { display: block; }
:root[data-theme="light"] [data-theme-toggle] .i-moon { display: block; }
:root[data-theme="light"] [data-theme-toggle] .i-sun  { display: none; }

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--r-sm);
  font-weight: 600; font-size: 14px; white-space: nowrap;
  border: 1px solid var(--hair-2); color: var(--ink);
  transition: transform .14s, background .15s, border-color .15s, box-shadow .2s, color .15s;
}
.btn:hover { transform: translateY(-1px); border-color: var(--dim); background: var(--surface-2); }
.btn:active { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--grad); color: var(--accent-ink); border: none; font-weight: 700;
  box-shadow: 0 8px 22px -10px var(--accent-glow);
}
.btn-primary:hover { background: var(--grad); filter: brightness(1.06); box-shadow: 0 12px 28px -10px var(--accent-glow); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; filter: grayscale(.2); }
.btn-ghost { border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); border-color: transparent; }
.btn-danger { color: var(--danger); border-color: transparent; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 14%, transparent); border-color: transparent; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* ===================== LAYOUT ===================== */
.main { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: 24px 30px 110px; }

/* ===================== HERO ===================== */
.hero { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: 50px 30px 8px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 2.5px;
  text-transform: uppercase; color: var(--accent-bright); margin-bottom: 16px;
}
.hero-eyebrow::before { content: ""; width: 24px; height: 1px; background: var(--grad); }
.hero-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(34px, 6vw, 64px); line-height: .98; letter-spacing: -2px; max-width: 16ch;
}
.hero-title .glow { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-sub { margin-top: 16px; max-width: 50ch; font-size: 16px; color: var(--muted); }

/* ===================== TOOLBAR ===================== */
.toolbar {
  position: sticky; top: 59px; z-index: 40;
  margin: 26px 0 22px;
  padding: 12px 0;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: linear-gradient(var(--bg) 65%, transparent);
}
.filter-tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--hair); padding: 4px; border-radius: var(--pill); }
.filter-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border-radius: var(--pill);
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  transition: background .15s, color .15s;
}
.filter-tab:hover { color: var(--ink); }
.filter-tab.active { background: var(--surface-3); color: var(--ink); }
.filter-tab .badge {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--pill);
  display: inline-grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-bright);
}
.filter-tab .badge[hidden] { display: none; }
.filter-tab svg { width: 15px; height: 15px; }

.toolbar-spacer { flex: 1; }

/* search */
.search-wrap { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 13px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search-input {
  width: 230px; max-width: 46vw;
  background: var(--surface); border: 1px solid var(--hair-2); border-radius: var(--pill);
  padding: 9px 16px 9px 38px; font-size: 14px; color: var(--ink);
  transition: border-color .15s, box-shadow .15s, width .2s, background .3s;
}
.search-input::placeholder { color: var(--dim); }
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); width: 280px; }

/* sort select */
.sort {
  position: relative; display: inline-flex; align-items: center;
}
.sort select {
  appearance: none; -webkit-appearance: none;
  background: var(--surface); border: 1px solid var(--hair-2); border-radius: var(--pill);
  padding: 9px 36px 9px 16px; font-size: 13.5px; font-weight: 600; color: var(--ink);
  cursor: pointer; transition: border-color .15s, background .3s;
}
.sort select:hover { border-color: var(--dim); }
.sort select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sort::after {
  content: ""; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-65%) rotate(45deg); pointer-events: none;
}
.section-count { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); white-space: nowrap; }

.toolbar-link {
  font-size: 13px; font-weight: 600; color: var(--accent-bright);
  display: inline-flex; align-items: center; gap: 6px;
}
.toolbar-link:hover { text-decoration: underline; }

/* ===================== VIDEO GRID ===================== */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px 22px; }

.video-card { position: relative; display: flex; flex-direction: column; }
.card-link { display: flex; flex-direction: column; cursor: pointer; }

.thumb {
  position: relative; aspect-ratio: 16/9; border-radius: var(--r); overflow: hidden;
  background: var(--surface); border: 1px solid var(--hair);
  transition: box-shadow .25s, border-color .25s, transform .25s cubic-bezier(.2,.7,.2,1);
}
.video-card:hover .thumb { transform: translateY(-4px); border-color: var(--accent-line); box-shadow: var(--glow); }
.thumb::before { content: ""; position: absolute; inset: 0; background: var(--ph-grad); z-index: 0; }
.thumb img, .thumb video { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
/* sheen sweep on hover */
.thumb::after {
  content: ""; position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(115deg, transparent 32%, rgba(255,255,255,.10) 48%, transparent 64%);
  transform: translateX(-120%); transition: transform .6s ease;
}
.video-card:hover .thumb::after { transform: translateX(120%); }

.play-overlay {
  position: absolute; inset: 0; z-index: 3; display: grid; place-items: center;
  background: radial-gradient(closest-side, rgba(0,0,0,.34), rgba(0,0,0,.06));
  opacity: 0; transition: opacity .2s;
}
.video-card:hover .play-overlay { opacity: 1; }
.play-icon {
  width: 54px; height: 54px; border-radius: 50%; background: var(--grad);
  display: grid; place-items: center; color: var(--accent-ink);
  box-shadow: 0 6px 24px -2px var(--accent-glow); transform: scale(.8);
  transition: transform .22s cubic-bezier(.2,.8,.2,1.4);
}
.video-card:hover .play-icon { transform: scale(1); }
.play-icon svg { width: 22px; height: 22px; margin-left: 3px; }

.thumb-badge {
  position: absolute; z-index: 4; right: 8px; bottom: 8px;
  padding: 3px 7px; border-radius: 6px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: .3px;
  color: #fff; background: rgba(6,6,9,.82); backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.1);
}

/* save (bookmark) button on card */
.save-btn {
  position: absolute; z-index: 5; top: 8px; right: 8px;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(6,6,9,.6); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.14); color: #fff;
  opacity: 0; transform: translateY(-4px) scale(.9);
  transition: opacity .18s, transform .18s, background .15s, color .15s;
}
.video-card:hover .save-btn, .save-btn:focus-visible { opacity: 1; transform: none; }
.save-btn:hover { background: rgba(6,6,9,.85); }
.save-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.save-btn.on { opacity: 1; transform: none; background: var(--grad); color: var(--accent-ink); border-color: transparent; }
.save-btn.on svg { fill: currentColor; stroke: currentColor; }

/* watched progress bar at thumb bottom */
.progress-line { position: absolute; z-index: 4; left: 0; bottom: 0; height: 3px; background: rgba(0,0,0,.4); width: 100%; }
.progress-line > span { display: block; height: 100%; background: var(--grad); }

.card-body { padding: 12px 2px 0; display: flex; gap: 11px; }
.card-grip { display: none; }
.card-info { min-width: 0; flex: 1; }
.card-title {
  font-size: 15px; font-weight: 600; line-height: 1.34; letter-spacing: -.1px; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: color .15s;
}
.video-card:hover .card-title { color: var(--accent-bright); }
.card-meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.card-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--dim); }

/* ===================== EMPTY / LOADING ===================== */
.empty { text-align: center; padding: 84px 24px; color: var(--muted); }
.empty-icon { width: 62px; height: 62px; margin: 0 auto 16px; color: var(--accent); opacity: .85; filter: drop-shadow(0 6px 18px var(--accent-glow)); }
.empty h2 { font-family: var(--font-display); font-size: 21px; font-weight: 700; margin-bottom: 8px; color: var(--ink); }

.spinner { width: 32px; height: 32px; border: 3px solid var(--surface-3); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 64px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* skeleton shimmer */
.skel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px 22px; }
.skel-card .sk-thumb { aspect-ratio: 16/9; border-radius: var(--r); }
.skel-card .sk-line { height: 13px; border-radius: 6px; margin-top: 12px; }
.skel-card .sk-line.short { width: 55%; margin-top: 9px; height: 11px; }
.sk { background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%); background-size: 220% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -220% 0; } }

/* card entrance */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.video-card { animation: rise .4s both; }

/* ===================== WATCH PAGE ===================== */
.back-link { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 14px; font-weight: 500; margin-bottom: 18px; transition: color .15s, gap .15s; }
.back-link:hover { color: var(--accent-bright); gap: 11px; }
.back-link svg { width: 16px; height: 16px; }

.watch-layout { display: grid; grid-template-columns: minmax(0,1fr) 384px; gap: 36px; align-items: start; }

.player-wrap {
  background: #000; border-radius: var(--r); overflow: hidden;
  aspect-ratio: 16/9; position: relative; border: 1px solid var(--hair);
  box-shadow: var(--shadow-pop);
}
.player-wrap video { width: 100%; height: 100%; object-fit: contain; }
.player-wrap.portrait { aspect-ratio: 9/16; max-width: min(430px,100%); margin-inline: auto; }
/* resume toast inside player */
.resume-pop {
  position: absolute; left: 14px; bottom: 64px; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 10px 14px; border-radius: var(--r-sm);
  background: rgba(10,10,13,.86); backdrop-filter: blur(8px);
  border: 1px solid var(--hair-2); color: #fff; font-size: 13.5px;
  box-shadow: var(--shadow-pop); transition: opacity .3s, transform .3s;
}
.resume-pop button { font-weight: 700; color: var(--accent-bright); font-size: 13.5px; }
.resume-pop.hide { opacity: 0; transform: translateY(8px); pointer-events: none; }

.watch-title { font-family: var(--font-display); font-size: 24px; font-weight: 700; margin-top: 20px; letter-spacing: -.5px; line-height: 1.22; }
.watch-bar { display: flex; align-items: center; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.watch-meta { display: flex; align-items: center; gap: 11px; font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.watch-meta .accent-line { width: 24px; height: 2px; border-radius: 2px; background: var(--grad); }
.watch-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--dim); }
.watch-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.pill-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: var(--pill);
  border: 1px solid var(--hair-2); background: var(--surface); color: var(--ink);
  font-size: 13px; font-weight: 600; transition: border-color .15s, background .15s, transform .15s, color .15s;
}
.pill-btn:hover { border-color: var(--accent); background: var(--surface-2); transform: translateY(-1px); }
.pill-btn svg { width: 16px; height: 16px; }
.pill-btn.on { background: var(--grad); color: var(--accent-ink); border-color: transparent; }
.pill-btn.on svg { fill: currentColor; }

.watch-description {
  margin-top: 20px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--hair);
  border-left: 3px solid var(--accent); border-radius: var(--r);
  font-size: 14.5px; color: var(--ink); white-space: pre-wrap; line-height: 1.65;
}
.watch-description:empty { display: none; }

.sidebar-title { font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: var(--accent-bright); margin-bottom: 16px; display: flex; align-items: center; gap: 9px; }
.sidebar-title::before { content: ""; width: 18px; height: 1px; background: var(--grad); }
.sidebar-list { display: flex; flex-direction: column; gap: 10px; }
.sidebar-item { display: grid; grid-template-columns: 160px 1fr; gap: 12px; cursor: pointer; padding: 7px; border-radius: var(--r-sm); border: 1px solid transparent; transition: background .16s, border-color .16s; }
.sidebar-item:hover { background: var(--surface); border-color: var(--hair); }
.sidebar-thumb { aspect-ratio: 16/9; border-radius: var(--r-sm); overflow: hidden; position: relative; background: var(--surface); }
.sidebar-thumb::before { content: ""; position: absolute; inset: 0; background: var(--ph-grad); }
.sidebar-thumb img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.sidebar-thumb .sb-badge { position: absolute; z-index: 2; right: 5px; bottom: 5px; padding: 1px 5px; border-radius: 5px; font-family: var(--font-mono); font-size: 10.5px; color: #fff; background: rgba(6,6,9,.82); }
.sidebar-info { min-width: 0; padding-top: 2px; }
.sidebar-item-title { font-size: 13.5px; font-weight: 600; line-height: 1.34; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 5px; }
.sidebar-item:hover .sidebar-item-title { color: var(--accent-bright); }
.sidebar-item-meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }

/* ===================== ADMIN ===================== */
.admin-container { max-width: 780px; margin: 0 auto; padding: 40px 30px 110px; }
.admin-head { margin-bottom: 26px; }
.admin-head .eyebrow { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent-bright); }
.admin-head h1 { font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -1px; margin-top: 8px; }
.admin-stats { display: flex; gap: 16px; margin-top: 12px; font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.admin-stats b { color: var(--accent-bright); font-weight: 500; }

.admin-card { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-lg); padding: 28px; margin-bottom: 20px; box-shadow: var(--shadow-card); }
.admin-card h2 { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin-bottom: 20px; display: flex; align-items: center; gap: 11px; }
.admin-card h2::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--grad); }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.input, .textarea {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--hair-2); border-radius: var(--r-sm);
  padding: 11px 14px; font-size: 14.5px; color: var(--ink); transition: border-color .15s, box-shadow .15s, background .3s;
}
.input::placeholder, .textarea::placeholder { color: var(--dim); }
.input:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.textarea { min-height: 92px; resize: vertical; line-height: 1.6; }
select.input { cursor: pointer; }

.file-drop { position: relative; border: 1.5px dashed var(--hair-2); border-radius: var(--r); padding: 34px 16px; text-align: center; cursor: pointer; transition: border-color .18s, background .18s; }
.file-drop:hover, .file-drop.dragover { border-color: var(--accent); background: var(--accent-soft); }
.file-drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-drop-icon { width: 40px; height: 40px; margin: 0 auto 12px; color: var(--muted); transition: color .18s, transform .18s; }
.file-drop:hover .file-drop-icon { color: var(--accent); transform: translateY(-2px); }
.file-name { margin-top: 10px; font-family: var(--font-mono); font-size: 13px; color: var(--accent-bright); font-weight: 500; }

.progress { margin-top: 16px; height: 7px; background: var(--bg-soft); border-radius: var(--pill); overflow: hidden; display: none; }
.progress.active { display: block; }
.progress-bar { height: 100%; background: var(--grad); width: 0%; border-radius: var(--pill); transition: width .2s; }
.progress-text { text-align: center; font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); margin-top: 8px; }

.tabs { display: flex; gap: 4px; margin-bottom: 20px; background: var(--bg-soft); padding: 4px; border-radius: var(--r-sm); width: fit-content; }
.tab { padding: 8px 18px; border-radius: 7px; font-size: 13.5px; font-weight: 600; color: var(--muted); transition: background .15s, color .15s; }
.tab.active { background: var(--surface-3); color: var(--ink); }
.tab:hover:not(.active) { color: var(--ink); }

.admin-video-list { display: flex; flex-direction: column; gap: 9px; }
.admin-video-item { display: flex; align-items: center; gap: 13px; padding: 12px 14px; background: var(--bg-soft); border-radius: var(--r-sm); border: 1px solid var(--hair); transition: border-color .15s; }
.admin-video-item:hover { border-color: var(--hair-2); }
.admin-video-item .info { flex: 1; min-width: 0; }
.admin-video-item .title { font-size: 14.5px; font-weight: 600; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-video-item .meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); }
.admin-video-item .info.edit { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.admin-video-item .info.edit .input, .admin-video-item .info.edit .textarea { font-size: 13.5px; padding: 9px 12px; }
.admin-video-item .info.edit .textarea { min-height: 60px; }
.edit-actions { display: flex; gap: 8px; }

.vis-badge { display: inline-block; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: .3px; padding: 1px 7px; border-radius: var(--pill); vertical-align: middle; border: 1px solid transparent; }
.vis-badge.public { color: var(--good); background: color-mix(in srgb, var(--good) 12%, transparent); border-color: color-mix(in srgb, var(--good) 28%, transparent); }
.vis-badge.unlisted { color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, transparent); border-color: color-mix(in srgb, var(--gold) 28%, transparent); }
.vis-badge.private { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: color-mix(in srgb, var(--danger) 28%, transparent); }

.jobs { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.job { background: var(--bg-soft); border: 1px solid var(--hair); border-radius: var(--r-sm); padding: 12px 14px; }
.job-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
.job-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-state { font-family: var(--font-mono); font-size: 11.5px; color: var(--accent-bright); white-space: nowrap; }
.job-state.error { color: var(--danger); }
.job-state.done { color: var(--good); }
.job-bar { height: 6px; background: var(--bg); border-radius: var(--pill); overflow: hidden; }
.job-bar > div { height: 100%; background: var(--grad); width: 0; transition: width .3s; border-radius: var(--pill); }

/* ===================== LOGIN ===================== */
.login-box { max-width: 410px; margin: 84px auto; padding: 36px 32px; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-lg); text-align: center; box-shadow: var(--shadow-pop); position: relative; overflow: hidden; }
.login-box::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--grad); }
.login-mark { width: 50px; height: 50px; margin: 0 auto 16px; border-radius: 14px; background: var(--grad); display: grid; place-items: center; color: var(--accent-ink); font-family: var(--font-display); font-weight: 800; font-size: 25px; box-shadow: 0 10px 26px -8px var(--accent-glow); }
.login-box h1 { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.login-box p { color: var(--muted); font-size: 14px; margin-bottom: 22px; }

/* ===================== TOAST ===================== */
.toast {
  position: fixed; bottom: 24px; left: 50%; z-index: 1000;
  padding: 13px 20px; background: var(--surface-2); color: var(--ink);
  border: 1px solid var(--hair-2); border-left: 3px solid var(--accent);
  border-radius: var(--r-sm); font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-pop);
  transform: translate(-50%, 140%); transition: transform .32s cubic-bezier(.2,.8,.2,1);
}
.toast.show { transform: translate(-50%, 0); }
.toast.error { border-left-color: var(--danger); }

/* ===================== FOOTER ===================== */
.footer { position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto; padding: 26px 30px; border-top: 1px solid var(--hair); display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--dim); font-family: var(--font-mono); font-size: 12px; letter-spacing: .4px; }
.footer a:hover { color: var(--accent-bright); }

/* ===================== UTILITY ===================== */
.hidden { display: none !important; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1024px) { .watch-layout { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .wrap, .navbar-inner { padding-inline: 16px; }
  .main { padding: 18px 16px 80px; }
  .hero { padding: 34px 16px 4px; }
  .hero-sub { font-size: 15px; }
  .toolbar { top: 57px; gap: 10px; }
  .filter-tabs { order: 1; width: 100%; justify-content: space-between; }
  .toolbar-spacer { display: none; }
  .search-wrap { order: 2; flex: 1; }
  .search-input, .search-input:focus { width: 100%; max-width: none; }
  .sort { order: 3; }
  .section-count { display: none; }
  .video-grid { grid-template-columns: 1fr; gap: 22px; }
  .watch-title { font-size: 20px; }
  .watch-actions { margin-left: 0; }
  .player-wrap.portrait { max-width: 320px; }
  .sidebar-item { grid-template-columns: 130px 1fr; }
  .admin-container { padding: 28px 16px 80px; }
  .admin-card { padding: 20px; }
  .admin-head h1 { font-size: 25px; }
  .admin-video-item { flex-wrap: wrap; }
  .admin-video-item .info { flex-basis: 100%; }
  .login-box { margin: 40px auto; padding: 28px 20px; }
  .footer { flex-direction: column; text-align: center; gap: 8px; }
}
@media (max-width: 380px) { .hero-title { letter-spacing: -1px; } .filter-tab { padding: 8px 11px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
