/* =========================================================================
   PriTube design system — derived from the approved prototype.
   Light + dark themes via CSS variables. Mobile-first responsive.
   ========================================================================= */

:root, [data-theme="light"] {
  --bg:#F6F7FB; --surface:#FFFFFF; --surface-2:#F1F2F7;
  --text:#0F1424; --text-2:#5B6577; --text-3:#9AA2B1;
  --border:#E7E9F0; --border-2:#DCDFEA;
  --accent:#4F46E5; --accent-2:#7C3AED; --accent-soft:#EEEDFF; --accent-text:#4338CA;
  --premium:#B45309; --premium-soft:#FBF0DC;
  --success:#16A34A; --success-soft:#E7F6EC;
  --error:#DC2626; --error-soft:#FBEAEA;
  --info:#2563EB; --info-soft:#E8EFFE;
  --shadow:0 1px 2px rgba(16,20,36,.06),0 2px 6px rgba(16,20,36,.05);
  --shadow-lg:0 18px 50px rgba(16,20,36,.16);
}
[data-theme="dark"] {
  --bg:#0F1117; --surface:#181B23; --surface-2:#20242E;
  --text:#F4F6FB; --text-2:#A2AAB8; --text-3:#6B7280;
  --border:#262A34; --border-2:#30353F;
  --accent:#7D7AF5; --accent-2:#B57BF7; --accent-soft:#23253A; --accent-text:#C8C6FF;
  --premium:#F59E0B; --premium-soft:#372A10;
  --success:#34D399; --success-soft:#11261D;
  --error:#F87171; --error-soft:#311819;
  --info:#60A5FA; --info-soft:#16243B;
  --shadow:0 1px 2px rgba(0,0,0,.4); --shadow-lg:0 18px 50px rgba(0,0,0,.55);
}

* { box-sizing:border-box; margin:0; }
html,body { height:100%; }
body {
  font-family:system-ui,-apple-system,'Helvetica Neue',Arial,sans-serif;
  background:var(--bg); color:var(--text);
  -webkit-font-smoothing:antialiased;
  padding-bottom:calc(64px + env(safe-area-inset-bottom));
}
@media (min-width:861px){ body{ padding-bottom:0; } }
a { color:inherit; text-decoration:none; }
input,textarea,button,select { font-family:inherit; }
input:focus,textarea:focus,select:focus { outline:none; }
img { max-width:100%; display:block; }

::-webkit-scrollbar{ width:11px; height:11px; }
::-webkit-scrollbar-thumb{ background:var(--border-2); border-radius:7px; border:3px solid var(--bg); }
::-webkit-scrollbar-track{ background:transparent; }
.noscroll{ scrollbar-width:none; }
.noscroll::-webkit-scrollbar{ display:none; width:0; height:0; }

@keyframes shimmer{0%{background-position:-450px 0}100%{background-position:450px 0}}
@keyframes toastIn{from{opacity:0;transform:translate(-50%,12px)}to{opacity:1;transform:translate(-50%,0)}}
@keyframes fadeUp{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}

/* ---- Layout shell ---------------------------------------------------- */
.app-shell{ min-height:100%; display:flex; flex-direction:column; }
.app-header{
  position:sticky; top:0; z-index:30; height:62px; flex:0 0 auto;
  display:flex; align-items:center; gap:18px; padding:0 22px;
  background:var(--surface); border-bottom:1px solid var(--border);
}
.brand{ display:flex; align-items:center; gap:9px; font-weight:800; font-size:18px; letter-spacing:-.02em; color:var(--text); }
.brand .mark{ width:28px; height:28px; border-radius:8px; background:linear-gradient(135deg,var(--accent),var(--accent-2)); display:grid; place-items:center; font-size:15px; color:#fff; }
.search-bar{ flex:1; max-width:540px; margin:0 auto; display:flex; height:42px; border:1px solid var(--border-2); border-radius:23px; overflow:hidden; background:var(--surface-2); }
.search-bar input{ flex:1; border:none; background:transparent; padding:0 20px; font-size:14px; color:var(--text); }
.search-bar button{ width:60px; border:none; background:var(--surface-2); border-left:1px solid var(--border); cursor:pointer; display:grid; place-items:center; color:var(--text-2); }
.header-actions{ display:flex; align-items:center; gap:10px; }
.avatar{ width:40px; height:40px; border-radius:50%; background:linear-gradient(135deg,var(--accent),var(--accent-2)); display:grid; place-items:center; color:#fff; font-weight:700; font-size:15px; }

.app-body{ display:flex; flex:1; min-height:0; }
.sidebar{
  flex:0 0 234px; align-self:flex-start; position:sticky; top:62px;
  max-height:calc(100vh - 62px); overflow:auto; padding:16px 12px;
  border-right:1px solid var(--border); background:var(--surface);
  display:flex; flex-direction:column; gap:4px;
}
.nav-item{ display:flex; align-items:center; gap:12px; padding:10px 12px; border-radius:10px; cursor:pointer; color:var(--text-2); font-weight:600; font-size:14px; }
.nav-item:hover{ background:var(--surface-2); }
.nav-item.active{ background:var(--accent-soft); color:var(--accent-text); }
.promo-card{ margin-top:14px; padding:16px; border-radius:14px; background:linear-gradient(150deg,var(--accent),var(--accent-2)); color:#fff; }
.promo-card .t{ font-weight:700; font-size:14px; }
.promo-card .d{ font-weight:500; font-size:12.5px; line-height:1.5; opacity:.9; margin-top:5px; }

.main{ flex:1; min-width:0; padding:26px 30px 70px; }
.container-narrow{ max-width:760px; margin:0 auto; }
.container-wide{ max-width:1080px; margin:0 auto; }

/* ---- Buttons --------------------------------------------------------- */
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px; height:42px; padding:0 18px; border-radius:11px; font-weight:600; font-size:14px; cursor:pointer; border:1px solid transparent; white-space:nowrap; }
.btn-primary{ background:linear-gradient(135deg,var(--accent),var(--accent-2)); color:#fff; border:none; }
.btn-secondary{ background:var(--surface); color:var(--text); border:1px solid var(--border-2); }
.btn-danger{ background:transparent; color:var(--error); border:1px solid var(--error); }
.btn-success{ background:var(--success); color:#fff; border:none; }
.btn-ghost{ background:transparent; color:var(--accent-text); border:none; }
.btn-sm{ height:34px; padding:0 13px; font-size:12.5px; border-radius:9px; }
.btn-lg{ height:48px; padding:0 26px; font-size:14.5px; border-radius:12px; }
.btn[disabled]{ background:var(--surface-2); color:var(--text-3); cursor:not-allowed; border:none; }
.btn-block{ width:100%; }

/* ---- Forms ----------------------------------------------------------- */
.field{ display:block; }
.field > span.label{ font-weight:600; font-size:13px; color:var(--text-2); }
.input, .textarea, .select{
  margin-top:7px; width:100%; height:46px; border:1px solid var(--border-2);
  border-radius:11px; background:var(--surface-2); padding:0 15px; font-size:14.5px; color:var(--text);
}
.textarea{ height:auto; padding:12px 15px; resize:vertical; }
.input:focus, .textarea:focus{ border-color:var(--accent); background:var(--surface); }
.form-stack{ display:flex; flex-direction:column; gap:16px; }

/* ---- Cards & grid ---------------------------------------------------- */
.card{ border:1px solid var(--border); border-radius:16px; background:var(--surface); }
.video-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(282px,1fr)); gap:22px 20px; }
.video-card{ cursor:pointer; }
.thumb{ position:relative; aspect-ratio:16/9; border-radius:14px; overflow:hidden; background:linear-gradient(135deg,var(--accent),var(--accent-2)); }
.thumb img{ width:100%; height:100%; object-fit:cover; }
.thumb .dur{ position:absolute; bottom:9px; right:9px; background:rgba(0,0,0,.78); color:#fff; font-weight:600; font-size:11px; padding:3px 7px; border-radius:6px; }
.thumb .badge{ position:absolute; top:9px; left:9px; }
.video-meta{ display:flex; gap:11px; margin-top:12px; }
.vavatar{ flex:0 0 auto; width:36px; height:36px; border-radius:50%; background:linear-gradient(135deg,var(--accent),var(--accent-2)); display:grid; place-items:center; color:#fff; font-weight:700; font-size:14px; line-height:1; overflow:hidden; text-transform:uppercase; }
.video-title{ font-weight:600; font-size:14.5px; line-height:1.35; color:var(--text); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.video-sub{ font-weight:500; font-size:13px; color:var(--text-2); margin-top:4px; }
.video-sub.muted{ font-weight:400; font-size:12.5px; color:var(--text-3); margin-top:1px; }

/* ---- Badges ---------------------------------------------------------- */
.badge{ display:inline-flex; align-items:center; gap:5px; height:24px; padding:0 10px; border-radius:7px; font-weight:700; font-size:11.5px; }
.badge-lg{ height:28px; padding:0 13px; font-size:12.5px; border-radius:8px; }
.badge-success{ background:var(--success-soft); color:var(--success); }
.badge-premium{ background:var(--premium-soft); color:var(--premium); }
.badge-error{ background:var(--error-soft); color:var(--error); }
.badge-info{ background:var(--info-soft); color:var(--info); }
.badge-muted{ background:var(--surface-2); color:var(--text-2); }
.badge-accent{ background:var(--accent-soft); color:var(--accent-text); }

/* ---- Page headers ---------------------------------------------------- */
.page-title{ font-weight:800; font-size:24px; line-height:1.1; letter-spacing:-.02em; }
.page-sub{ font-weight:500; font-size:14px; color:var(--text-2); margin-top:6px; }
.section-title{ font-weight:700; font-size:15px; margin:26px 0 12px; }

/* ---- Hero ------------------------------------------------------------ */
.hero{ position:relative; overflow:hidden; border-radius:18px; padding:32px 36px; margin-bottom:24px; background:linear-gradient(120deg,var(--accent) 0%,var(--accent-2) 60%,#DB2777 120%); color:#fff; }
.hero .eyebrow{ font-weight:600; font-size:12px; letter-spacing:.12em; opacity:.85; }
.hero h1{ font-weight:800; font-size:30px; line-height:1.15; letter-spacing:-.02em; margin-top:10px; }
.hero p{ font-weight:500; font-size:15px; line-height:1.55; opacity:.92; margin-top:10px; max-width:560px; }
.hero .blob{ position:absolute; right:-40px; top:-40px; width:240px; height:240px; border-radius:50%; background:rgba(255,255,255,.12); }

/* ---- Chips row ------------------------------------------------------- */
.chips{ display:flex; gap:10px; overflow:auto; padding-bottom:18px; margin-bottom:6px; }
.chip{ flex:0 0 auto; display:inline-flex; align-items:center; gap:6px; padding:8px 16px; border-radius:9px; border:1px solid var(--border); background:var(--surface); color:var(--text-2); font-weight:600; font-size:13px; cursor:pointer; white-space:nowrap; text-decoration:none; }
.chip:hover, .chip.active{ border-color:var(--accent); color:var(--accent-text); }
.chip.active{ background:var(--accent); color:#fff; border-color:transparent; }
.chip.active:hover{ color:#fff; }
.chip-sm{ padding:6px 12px; font-size:12px; }
.chip-count{ font-size:11px; opacity:.7; font-weight:700; }
.chips[data-noscroll]{ scrollbar-width:none; }
.chips[data-noscroll]::-webkit-scrollbar{ display:none; width:0; height:0; }

/* ---- Catalog toolbar (chips + sort) ---------------------------------- */
.catalog-toolbar{ display:flex; align-items:flex-start; gap:16px; flex-wrap:wrap; }
.catalog-toolbar .chips{ flex:1 1 320px; min-width:0; margin-bottom:0; }
.catalog-sort{ display:flex; align-items:center; gap:8px; flex:0 0 auto; padding-bottom:18px; }
.catalog-sort__label{ font-weight:600; font-size:13px; color:var(--text-2); white-space:nowrap; }
.input-sm{ margin-top:0; height:auto; padding:7px 30px 7px 11px; font-size:13px; width:auto; min-width:160px; }

/* ---- Tags ------------------------------------------------------------ */
.tag-pill{ display:inline-flex; align-items:center; padding:3px 9px; border-radius:7px; background:var(--surface-2); color:var(--text-2); font-weight:600; font-size:11.5px; white-space:nowrap; text-decoration:none; }
a.tag-pill:hover{ background:var(--accent-soft); color:var(--accent-text); }
.tag-pill--active{ background:var(--accent-soft); color:var(--accent-text); }
.card-tags{ display:flex; gap:6px; flex-wrap:wrap; margin-top:8px; overflow:hidden; max-height:23px; }
.thumb-cat{ position:absolute; top:9px; left:9px; background:rgba(0,0,0,.7); color:#fff; font-weight:600; font-size:11px; padding:3px 8px; border-radius:7px; backdrop-filter:blur(2px); }
.watch-tags{ display:flex; gap:8px; flex-wrap:wrap; margin-top:14px; }
.active-tag{ display:flex; align-items:center; gap:8px; margin:2px 0 16px; font-size:13px; color:var(--text-2); }
.active-tag__clear{ display:inline-grid; place-items:center; width:20px; height:20px; border-radius:50%; background:var(--surface-2); color:var(--text-2); text-decoration:none; font-size:12px; }
.active-tag__clear:hover{ background:var(--accent-soft); color:var(--accent-text); }
.field-hint{ display:block; font-size:12px; color:var(--text-2); margin-top:5px; }

/* ---- Player ---------------------------------------------------------- */
.player-wrap{ position:relative; width:100%; aspect-ratio:16/9; background:#111; border-radius:16px; overflow:hidden; display:grid; place-items:center; }
.player-wrap iframe{ width:100%; height:100%; border:0; }
.player-placeholder{ position:absolute; inset:0; display:grid; place-items:center; background:linear-gradient(135deg,#4F46E5,#7C3AED); color:#fff; text-align:center; padding:20px; }
.player-placeholder .play{ width:74px; height:74px; border-radius:50%; background:rgba(255,255,255,.92); display:grid; place-items:center; }

/* ---- Alerts / flash -------------------------------------------------- */
.alert{ display:flex; gap:11px; align-items:flex-start; padding:13px 16px; border-radius:12px; font-weight:500; font-size:13.5px; line-height:1.5; margin-bottom:16px; }
.alert-info{ background:var(--info-soft); color:var(--info); }
.alert-success{ background:var(--success-soft); color:var(--success); }
.alert-error{ background:var(--error-soft); color:var(--error); }

/* ---- Empty state ----------------------------------------------------- */
.empty{ text-align:center; padding:70px 20px; border:1.5px dashed var(--border-2); border-radius:18px; }
.empty .t{ font-weight:700; font-size:16px; margin-top:16px; }
.empty .d{ font-weight:500; font-size:13.5px; color:var(--text-2); margin-top:6px; }

/* ---- Toast ----------------------------------------------------------- */
.toast{ position:fixed; left:50%; bottom:84px; transform:translateX(-50%); z-index:200; display:flex; align-items:center; gap:10px; padding:12px 18px; border-radius:11px; background:#101522; color:#fff; font-weight:600; font-size:13.5px; box-shadow:var(--shadow-lg); animation:toastIn .25s ease; }
@media (min-width:861px){ .toast{ bottom:28px; } }

/* ---- Modal (auth-required dialog) ----------------------------------- */
.modal{ position:fixed; inset:0; z-index:300; display:grid; place-items:center; padding:20px; }
.modal[hidden]{ display:none; }
.modal__backdrop{ position:absolute; inset:0; background:rgba(15,17,23,.55); backdrop-filter:blur(4px); }
.modal__card{ position:relative; z-index:1; width:100%; max-width:380px; background:var(--surface); border:1px solid var(--border); border-radius:20px; padding:30px 28px 26px; text-align:center; box-shadow:var(--shadow-lg); animation:modalIn .2s ease; }
.modal__close{ position:absolute; top:12px; right:12px; width:34px; height:34px; display:grid; place-items:center; border:none; background:transparent; color:var(--text-2); cursor:pointer; border-radius:9px; }
.modal__close:hover{ background:var(--surface-2); color:var(--text); }
.modal__icon{ width:60px; height:60px; margin:0 auto 14px; border-radius:16px; display:grid; place-items:center; background:var(--accent-soft); color:var(--accent-text); }
.modal__actions{ display:flex; flex-direction:column; gap:10px; margin-top:22px; }
@keyframes modalIn{ from{ opacity:0; transform:translateY(10px) scale(.98); } to{ opacity:1; transform:translateY(0) scale(1); } }

/* ---- Auth screens ---------------------------------------------------- */
.auth-screen{ min-height:100vh; display:flex; align-items:center; justify-content:center; padding:40px 20px; background:radial-gradient(1100px 600px at 50% -10%,var(--accent-soft),var(--bg)); }
.auth-card{ width:440px; max-width:100%; background:var(--surface); border:1px solid var(--border); border-radius:20px; padding:38px 36px; box-shadow:var(--shadow-lg); }
.auth-card h1{ font-weight:800; font-size:24px; line-height:1.2; letter-spacing:-.02em; margin-top:24px; }
.auth-card .lead{ font-weight:500; font-size:14px; color:var(--text-2); margin-top:6px; }
.auth-alt{ text-align:center; font-weight:500; font-size:14px; color:var(--text-2); margin-top:22px; }
.auth-alt a{ color:var(--accent-text); font-weight:700; }

/* ---- Privacy selector ----------------------------------------------- */
.privacy-grid{ display:grid; grid-template-columns:1fr 1fr 1fr; gap:10px; margin-top:9px; }
.privacy-opt{ text-align:left; padding:14px; border:1px solid var(--border-2); border-radius:11px; background:var(--surface); cursor:pointer; }
.privacy-opt.active{ border-color:var(--accent); background:var(--accent-soft); }
.privacy-opt .t{ font-weight:700; font-size:13.5px; color:var(--text); }
.privacy-opt .d{ font-weight:500; font-size:11.5px; line-height:1.4; color:var(--text-2); margin-top:3px; }

/* ---- Dropzone -------------------------------------------------------- */
.dropzone{ border:1.5px dashed var(--accent); border-radius:18px; background:var(--accent-soft); padding:46px 24px; text-align:center; }
.dropzone .ico{ width:60px; height:60px; margin:0 auto; border-radius:16px; background:var(--surface); display:grid; place-items:center; color:var(--accent-text); box-shadow:var(--shadow); }
.dropzone .t{ font-weight:700; font-size:17px; margin-top:16px; }
.dropzone .d{ font-weight:500; font-size:13.5px; color:var(--text-2); margin-top:6px; }
.dropzone input[type=file]{ display:none; }

/* ---- Upload progress overlay ---------------------------------------- */
.upload-overlay{ position:fixed; inset:0; z-index:120; display:grid; place-items:center; background:rgba(15,17,23,.55); backdrop-filter:blur(4px); }
.upload-overlay[hidden]{ display:none; }
.upload-overlay__card{ background:var(--surface); border:1px solid var(--border); border-radius:20px; padding:34px 40px; text-align:center; box-shadow:var(--shadow-lg); min-width:260px; }
.upload-overlay__ring{ position:relative; width:120px; height:120px; margin:0 auto; }
.upload-overlay__ring .ring-bg{ stroke:var(--border-2); }
.upload-overlay__ring .ring-fg{ stroke:var(--accent); transform:rotate(-90deg); transform-origin:50% 50%; transition:stroke-dashoffset .25s ease; }
.upload-overlay__pct{ position:absolute; inset:0; display:grid; place-items:center; font-weight:800; font-size:24px; color:var(--text); }
.upload-overlay__status{ margin-top:18px; font-weight:600; font-size:14.5px; color:var(--text-2); }
.upload-overlay__ring.is-indeterminate .ring-fg{ animation:upload-spin 1s linear infinite; transition:none; }
.upload-overlay__ring.is-done .ring-fg{ stroke:#16A34A; }
.upload-overlay__ring.is-error .ring-fg{ stroke:#DC2626; }
@keyframes upload-spin{ from{ transform:rotate(-90deg); } to{ transform:rotate(270deg); } }

/* ---- Stats / admin --------------------------------------------------- */
.stat-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-top:22px; }
.stat{ padding:18px; border:1px solid var(--border); border-radius:15px; background:var(--surface); }
.stat .k{ font-weight:500; font-size:12.5px; color:var(--text-2); }
.stat .v{ font-weight:800; font-size:28px; margin-top:6px; }
.list-row{ display:flex; align-items:center; gap:12px; padding:13px 18px; border-bottom:1px solid var(--border); }
.list-row:last-child{ border-bottom:none; }

.table{ width:100%; border-collapse:collapse; }
.table th{ text-align:left; font-weight:600; font-size:12px; color:var(--text-2); padding:12px 14px; border-bottom:1px solid var(--border); text-transform:uppercase; letter-spacing:.04em; }
.table td{ padding:13px 14px; border-bottom:1px solid var(--border); font-size:13.5px; }

/* ---- Mobile bottom nav ---------------------------------------------- */
.bottom-nav{
  position:fixed; left:0; right:0; bottom:0; z-index:50;
  display:flex; border-top:1px solid var(--border); background:var(--surface);
  padding:4px 4px calc(8px + env(safe-area-inset-bottom));
}
.bottom-nav a{ flex:1; display:flex; flex-direction:column; align-items:center; gap:3px; padding:8px 0; color:var(--text-3); font-weight:600; font-size:10.5px; }
.bottom-nav a.active{ color:var(--accent-text); }
.bottom-nav a.fab span{ width:40px; height:40px; margin-top:-14px; border-radius:14px; background:linear-gradient(135deg,var(--accent),var(--accent-2)); display:grid; place-items:center; color:#fff; box-shadow:var(--shadow); }
@media (min-width:861px){ .bottom-nav{ display:none; } }

/* ---- Responsive ------------------------------------------------------ */
@media (max-width:860px){
  .app-header{ height:54px; padding:0 14px; gap:11px; }
  .sidebar{ display:none; }
  .main{ padding:16px 16px 24px; }
  .search-bar{ display:none; }
  .video-grid{ grid-template-columns:1fr; gap:18px; }
  .hero{ padding:24px 20px; }
  .hero h1{ font-size:22px; }
  .privacy-grid{ grid-template-columns:1fr; }
  .stat-grid{ grid-template-columns:1fr 1fr; }
  .header-search-toggle{ display:grid; }
}
@media (min-width:861px){
  .header-search-toggle{ display:none; }
  .mobile-only{ display:none !important; }
}
.watch-layout{ display:grid; grid-template-columns:minmax(0,1fr) 360px; gap:28px; align-items:start; }
@media (max-width:980px){ .watch-layout{ grid-template-columns:1fr; } }

/* ---- Likes / dislikes -------------------------------------------------- */
.like-group{ display:inline-flex; align-items:stretch; background:var(--surface-2); border:1px solid var(--border-2); border-radius:11px; overflow:hidden; }
.like-group form{ display:flex; }
.like-group form + form .like-btn{ border-left:1px solid var(--border); }
.like-btn{ display:inline-flex; align-items:center; gap:7px; height:34px; padding:0 13px; background:transparent; border:none; color:var(--text); font-weight:600; font-size:13px; cursor:pointer; }
.like-btn:hover{ background:var(--surface); }
.like-btn.is-active{ color:var(--accent-text); }
.like-btn.is-active svg{ fill:currentColor; }

/* ---- Comment actions --------------------------------------------------- */
.comment-action{ background:none; border:none; padding:0; cursor:pointer; color:var(--text-2); font-weight:600; font-size:12.5px; }
.comment-action:hover{ color:var(--text); }
.comment-action--danger:hover{ color:var(--error); }

/* ---- Playlists & "Watch later" ---------------------------------------- */
/* Active state for toggle-style secondary buttons (e.g. Watch later). */
.btn.is-active{ background:var(--accent-soft); border-color:var(--accent-soft); color:var(--accent-text); }
.btn.is-active svg{ stroke:currentColor; }

/* "Remove from playlist" overlay button on playlist cards. */
.playlist-remove{ display:grid; place-items:center; width:30px; height:30px; border:none; border-radius:50%;
  background:rgba(0,0,0,.62); color:#fff; cursor:pointer; opacity:.85; backdrop-filter:blur(2px); }
.playlist-remove:hover{ opacity:1; background:var(--error); }

/* Playlist picker rows in the "Save to playlist" modal. */
.playlist-row{ display:flex; align-items:center; gap:12px; width:100%; padding:10px 10px; border:none;
  background:transparent; border-radius:11px; cursor:pointer; color:var(--text); text-align:left; font:inherit; }
.playlist-row:hover{ background:var(--surface-2); }
.playlist-row__box{ flex:0 0 auto; display:grid; place-items:center; width:22px; height:22px; border-radius:6px;
  border:1.8px solid var(--border-2); color:#fff; }
.playlist-row__box svg{ opacity:0; }
.playlist-row.is-checked .playlist-row__box{ background:var(--accent); border-color:var(--accent); }
.playlist-row.is-checked .playlist-row__box svg{ opacity:1; }
.playlist-row__title{ flex:1; min-width:0; font-weight:600; font-size:14px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.playlist-row__count{ flex:0 0 auto; font-size:12.5px; color:var(--text-3); font-weight:600; }

/* ----------------------------------------------------------------------- */
/* Notifications: header bell, dropdown, subscription bell, feed page       */
/* ----------------------------------------------------------------------- */
.notif{ position:relative; display:inline-flex; }
.notif-toggle{ position:relative; }
.notif-badge{ position:absolute; top:-5px; right:-5px; min-width:17px; height:17px; padding:0 4px;
  display:grid; place-items:center; border-radius:9px; background:var(--error,#dc2626); color:#fff;
  font-size:10.5px; font-weight:700; line-height:1; }
/* The display rules here would otherwise beat the [hidden] attribute, so the
   badge / push prompt could never be hidden via element.hidden = true. */
.notif-badge[hidden], .notif-push[hidden]{ display:none !important; }
.notif-panel{ position:absolute; top:calc(100% + 9px); right:0; width:360px; max-width:92vw; z-index:60;
  background:var(--surface,#fff); border:1px solid var(--border,#e5e7eb); border-radius:14px;
  box-shadow:0 18px 50px rgba(0,0,0,.22); overflow:hidden; }
.notif-head{ display:flex; align-items:center; justify-content:space-between; padding:12px 14px;
  border-bottom:1px solid var(--border,#e5e7eb); }
.notif-head strong{ font-size:14.5px; }
.notif-link{ border:none; background:transparent; color:var(--accent,#2563eb); font:inherit; font-size:12.5px;
  font-weight:600; cursor:pointer; padding:0; }
.notif-push{ display:flex; align-items:center; gap:10px; padding:11px 14px; background:var(--surface-2,#f3f4f6);
  border-bottom:1px solid var(--border,#e5e7eb); font-size:12.5px; color:var(--text-2,#4b5563); }
.notif-push span{ flex:1; }
.notif-list{ list-style:none; margin:0; padding:6px; max-height:60vh; overflow-y:auto; }
.notif-empty{ padding:24px 14px; text-align:center; color:var(--text-3,#9ca3af); font-size:13px; }
.notif-item a{ display:block; padding:10px 11px; border-radius:10px; color:inherit; text-decoration:none; }
.notif-item a:hover{ background:var(--surface-2,#f3f4f6); }
.notif-item.is-unread a{ background:var(--accent-soft,#eff6ff); }
.notif-item-title{ display:block; font-weight:600; font-size:13.5px; }
.notif-item-text{ display:block; font-size:12.5px; color:var(--text-2,#4b5563); margin-top:2px;
  overflow:hidden; text-overflow:ellipsis; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.notif-item-time{ display:block; font-size:11.5px; color:var(--text-3,#9ca3af); margin-top:3px; }
.notif-all{ display:block; padding:11px 14px; text-align:center; font-size:13px; font-weight:600;
  color:var(--accent,#2563eb); border-top:1px solid var(--border,#e5e7eb); text-decoration:none; }
.notif-all:hover{ background:var(--surface-2,#f3f4f6); }

/* Subscription "bell" dropdown (native <details>). */
.subbell{ position:relative; display:inline-block; }
.subbell > summary{ list-style:none; cursor:pointer; display:inline-flex; align-items:center; gap:7px; }
.subbell > summary::-webkit-details-marker{ display:none; }
.subbell-menu{ position:absolute; top:calc(100% + 7px); right:0; width:280px; z-index:55;
  background:var(--surface,#fff); border:1px solid var(--border,#e5e7eb); border-radius:13px;
  box-shadow:0 16px 44px rgba(0,0,0,.2); padding:6px; }
.subbell-menu form{ margin:0; }
.subbell-item{ display:flex; align-items:flex-start; gap:9px; width:100%; padding:9px 10px; border:none;
  background:transparent; border-radius:9px; cursor:pointer; color:var(--text,#111); text-align:left; font:inherit; }
.subbell-item:hover{ background:var(--surface-2,#f3f4f6); }
.subbell-item.is-active{ background:var(--accent-soft,#eff6ff); }
.subbell-item strong{ display:block; font-size:13.5px; font-weight:600; }
.subbell-item small{ display:block; font-size:11.5px; color:var(--text-2,#6b7280); margin-top:1px; }
.subbell-check{ flex:0 0 auto; width:16px; text-align:center; color:var(--accent,#2563eb); font-weight:700; }
.subbell-danger strong{ color:var(--error,#dc2626); }

/* Full notifications page. */
.notif-page-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; }
.notif-row{ display:flex; align-items:flex-start; gap:13px; padding:13px 14px; border-radius:13px;
  background:var(--surface,#fff); border:1px solid var(--border,#e5e7eb); }
.notif-row.is-unread{ border-color:var(--accent,#2563eb); background:var(--accent-soft,#eff6ff); }
.notif-row-body{ flex:1; min-width:0; color:inherit; text-decoration:none; }
.notif-row-title{ display:block; font-weight:600; font-size:14px; }
.notif-row-text{ display:block; font-size:13px; color:var(--text-2,#4b5563); margin-top:3px; }
.notif-row-time{ display:block; font-size:12px; color:var(--text-3,#9ca3af); margin-top:5px; }
.notif-row-thumb{ flex:0 0 auto; width:96px; height:54px; border-radius:8px; background:var(--surface-2,#f3f4f6);
  background-size:cover; background-position:center; }
.notif-ico{ flex:0 0 auto; width:34px; height:34px; border-radius:50%; background:var(--surface-2,#f3f4f6); }
