/* خطوط النظام تُستخدم لضمان العمل دون اتصال ولتطبيق CSP صارم */
:root {
  --bg: #080b14;
  --bg-2: #0d1220;
  --panel: rgba(19, 25, 42, .82);
  --panel-solid: #131a2a;
  --panel-2: #192136;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .14);
  --text: #eef2ff;
  --muted: #b3bdd6;
  --accent: #6d5efc;
  --accent-2: #22d3ee;
  --accent-soft: rgba(109, 94, 252, .16);
  --danger: #fb7185;
  --success: #34d399;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 60px rgba(0, 0, 0, .45);
  --topbar-h: 72px;
  --status-h: 34px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(109, 94, 252, .18), transparent 60%),
    radial-gradient(700px 420px at 5% 15%, rgba(34, 211, 238, .09), transparent 55%),
    var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg path[fill] { fill: currentColor; stroke: none; }
.hidden { display: none !important; }

.app-shell { height: 100dvh; display: flex; flex-direction: column; }

/* ---------- Top bar ---------- */
.topbar {
  height: var(--topbar-h);
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 0 clamp(14px, 2.5vw, 30px);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 11, 20, .72);
  backdrop-filter: blur(18px);
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 11px; margin-inline-end: auto; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #a855f7 55%, var(--accent-2));
  box-shadow: 0 8px 24px rgba(109, 94, 252, .35);
}
.brand-mark svg { width: 24px; height: 24px; stroke: #fff; stroke-width: 2.2; }
.brand-mark svg path { fill: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 17px; font-weight: 800; letter-spacing: -.2px; }
.brand-text small { color: var(--muted); font-size: 11px; }
.top-actions { display: flex; align-items: center; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-strong); border-radius: 11px;
  padding: 9px 14px; font-size: 13px; font-weight: 700;
  color: var(--text); background: rgba(255, 255, 255, .04);
  transition: transform .15s, background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); background: rgba(255, 255, 255, .09); }
.btn:active { transform: translateY(0); }
.btn svg { width: 17px; height: 17px; }
.btn-primary {
  border-color: transparent; color: #fff;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  box-shadow: 0 8px 24px rgba(109, 94, 252, .28);
}
.btn-primary:hover { background: linear-gradient(135deg, #7c6dff, #9d6bff); }
.btn-ghost { background: rgba(255, 255, 255, .035); }
.btn-danger { color: #fecdd3; border-color: rgba(251, 113, 133, .35); background: rgba(251, 113, 133, .12); }
.btn.full { width: 100%; }
.icon-btn {
  width: 38px; height: 38px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 11px;
  color: var(--muted); background: rgba(255, 255, 255, .035);
  transition: color .15s, background .15s, border-color .15s;
  flex: 0 0 auto;
}
.icon-btn:hover { color: var(--text); background: rgba(255, 255, 255, .1); border-color: var(--line-strong); }
.menu-btn { display: none; }

/* ---------- Workspace ---------- */
.workspace { flex: 1; min-height: 0; display: flex; }
.sidebar {
  width: 264px; flex: 0 0 264px; min-height: 0;
  display: flex; flex-direction: column; gap: 16px;
  padding: 20px 14px 16px;
  border-inline-end: 1px solid var(--line);
  background: rgba(11, 15, 27, .6);
  overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent;
}
.search-box {
  display: flex; align-items: center; gap: 9px;
  background: rgba(255, 255, 255, .045); border: 1px solid var(--line);
  border-radius: 12px; padding: 0 12px; height: 42px;
  transition: border-color .15s, background .15s;
}
.search-box:focus-within { border-color: rgba(109, 94, 252, .6); background: rgba(109, 94, 252, .08); }
.search-box svg { width: 17px; height: 17px; color: var(--muted); flex: 0 0 auto; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 13px; }
.search-box input::placeholder { color: #94a0be; }
.nav-label { color: #a7b1cd; font-size: 11px; font-weight: 800; margin: 10px 10px 7px; letter-spacing: .3px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item, .group-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 11px; border-radius: 11px; border: 1px solid transparent;
  background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; text-align: start;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 17px; height: 17px; flex: 0 0 auto; }
.nav-item:hover, .group-item:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.nav-item.active, .group-item.active {
  color: #fff; background: linear-gradient(90deg, rgba(109, 94, 252, .24), rgba(109, 94, 252, .06));
  border-color: rgba(109, 94, 252, .28);
}
.nav-item span, .group-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.nav-item em, .group-item em { font-style: normal; font-size: 11px; color: var(--muted); background: rgba(255,255,255,.06); padding: 1px 7px; border-radius: 20px; }
.group-list { display: flex; flex-direction: column; gap: 2px; max-height: 32vh; overflow-y: auto; }
.group-item { padding-inline-start: 20px; font-size: 12.5px; }
.group-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-2); flex: 0 0 auto; }
.side-foot { margin-top: auto; }
.playlist-list { display: flex; flex-direction: column; gap: 6px; }
.playlist-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px;
  border-radius: 11px; background: rgba(255,255,255,.035); border: 1px solid var(--line);
}
.playlist-color { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.playlist-meta { min-width: 0; flex: 1; }
.playlist-meta strong { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.playlist-meta small { display: block; font-size: 10.5px; color: var(--muted); }
.playlist-del { border: 0; background: transparent; color: #7d87a5; padding: 3px; border-radius: 6px; }
.playlist-del:hover { color: var(--danger); background: rgba(251,113,133,.12); }
.playlist-del svg { width: 15px; height: 15px; }

.content { flex: 1; min-width: 0; min-height: 0; overflow-y: auto; padding: 24px clamp(16px, 3vw, 36px) 40px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: 210px; display: flex; align-items: center;
  border: 1px solid var(--line); border-radius: 24px;
  padding: 28px clamp(20px, 3.5vw, 40px);
  background:
    linear-gradient(115deg, rgba(109,94,252,.2), rgba(34,211,238,.06) 55%, transparent),
    linear-gradient(180deg, rgba(25,33,54,.9), rgba(15,20,36,.9));
  box-shadow: var(--shadow);
}
.hero-copy { position: relative; z-index: 2; max-width: 620px; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 700; color: #b9c6ff; letter-spacing: .2px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px rgba(52,211,153,.13); }
.hero h1 { margin: 10px 0 8px; font-size: clamp(24px, 3.4vw, 36px); line-height: 1.25; font-weight: 800; letter-spacing: -.6px; }
.hero p { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; line-height: 1.8; max-width: 560px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-visual { position: absolute; inset-inline-start: 4%; top: 0; bottom: 0; width: 40%; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(2px); }
.orb-one { width: 210px; height: 210px; background: radial-gradient(circle at 35% 35%, rgba(109,94,252,.5), transparent 70%); inset-inline-start: 5%; top: -30px; }
.orb-two { width: 170px; height: 170px; background: radial-gradient(circle at 60% 40%, rgba(34,211,238,.35), transparent 70%); inset-inline-end: 0; bottom: -20px; }
.mini-player {
  position: absolute; inset-inline-start: 12%; top: 50%; transform: translateY(-50%) rotate(-6deg);
  width: 260px; border-radius: 20px; padding: 10px;
  background: linear-gradient(145deg, rgba(255,255,255,.13), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.16); backdrop-filter: blur(10px);
  box-shadow: 0 30px 60px rgba(0,0,0,.45);
}
.mini-screen { height: 125px; border-radius: 13px; background: linear-gradient(135deg, #312b6e, #123c55 60%, #0c1528); display: grid; place-items: center; position: relative; overflow: hidden; }
.mini-screen::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.15), transparent 55%); }
.mini-play { width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); display: grid; place-items: center; z-index: 1; }
.mini-play::after { content: ''; width: 0; height: 0; border-top: 9px solid transparent; border-bottom: 9px solid transparent; border-inline-start: 15px solid #fff; margin-inline-start: 4px; }
.mini-lines { display: flex; gap: 8px; padding: 12px 5px 4px; }
.mini-lines i { height: 5px; border-radius: 5px; background: rgba(255,255,255,.18); flex: 1; }
.mini-lines i:first-child { background: linear-gradient(90deg, var(--accent), var(--accent-2)); flex: 2; }

/* ---------- Library ---------- */
.library { margin-top: 26px; }
.library-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.library-head h2 { margin: 0 0 3px; font-size: 20px; font-weight: 800; }
.library-head p { margin: 0; color: var(--muted); font-size: 12.5px; }
.library-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-box.compact { width: 210px; }
.select {
  appearance: none; border: 1px solid var(--line-strong); border-radius: 11px;
  background: rgba(255,255,255,.045) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239aa6c4' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat left 10px center;
  color: var(--text); padding: 9px 28px 9px 12px; font-size: 12px; min-height: 40px;
}
.select option { background: #131a2a; color: #eef2ff; }
.select-dark { background-color: rgba(10,14,24,.85); border-color: rgba(255,255,255,.15); min-height: 34px; padding-block: 6px; font-size: 11.5px; }

.channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 13px; }
.channel-card {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 13px; border-radius: 16px; border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(25,33,54,.92), rgba(15,20,36,.92));
  transition: transform .18s, border-color .18s, box-shadow .18s;
  overflow: hidden; text-align: start; color: var(--text); min-width: 0;
}
.channel-card::before { content: ''; position: absolute; inset-inline-start: 0; top: 18%; bottom: 18%; width: 3px; border-radius: 3px; background: linear-gradient(var(--accent), var(--accent-2)); opacity: 0; transition: opacity .18s; }
.channel-card:hover { transform: translateY(-3px); border-color: rgba(109,94,252,.45); box-shadow: 0 14px 32px rgba(0,0,0,.35); }
.channel-card:hover::before { opacity: 1; }
.card-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; border: 0; background: transparent; color: inherit; padding: 0; text-align: start; }
.channel-card.playing { border-color: rgba(34,211,238,.6); box-shadow: 0 0 0 1px rgba(34,211,238,.2), 0 14px 32px rgba(0,0,0,.35); }
.channel-logo {
  width: 48px; height: 48px; border-radius: 13px; flex: 0 0 auto;
  display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, rgba(109,94,252,.28), rgba(34,211,238,.14));
  border: 1px solid var(--line); font-weight: 800; font-size: 17px; color: #cdd6ff;
}
.channel-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; background: #0d1220; }
.channel-info { min-width: 0; flex: 1; }
.channel-info strong { display: block; font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-info small { display: block; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.channel-badge { position: absolute; inset-inline-end: 10px; top: 9px; font-size: 9.5px; color: #b9c6ff; background: rgba(109,94,252,.18); border-radius: 20px; padding: 2px 7px; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-btn { position: absolute; inset-inline-end: 8px; bottom: 8px; border: 0; background: transparent; color: #66708d; padding: 4px; border-radius: 8px; z-index: 2; }
.fav-btn:hover { background: rgba(255,255,255,.07); color: #fbbf24; }
.fav-btn.is-fav { color: #fbbf24; }
.fav-btn svg { width: 17px; height: 17px; }
.fav-btn.is-fav svg { fill: currentColor; }
.live-tag { display: inline-flex; align-items: center; gap: 4px; color: #fda4af; font-size: 10px; font-weight: 700; }
.live-tag::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #fb7185; }

.empty-state { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty-icon { width: 66px; height: 66px; margin: 0 auto 16px; border-radius: 20px; display: grid; place-items: center; background: var(--accent-soft); color: #b9c6ff; border: 1px solid rgba(109,94,252,.25); }
.empty-icon svg { width: 30px; height: 30px; }
.empty-state h3 { color: var(--text); margin: 0 0 6px; font-size: 18px; }
.empty-state p { margin: 0 auto 18px; max-width: 430px; font-size: 13px; line-height: 1.8; }
.empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Status ---------- */
.statusbar {
  height: var(--status-h); flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(14px, 2.5vw, 30px); border-top: 1px solid var(--line);
  background: rgba(8,11,20,.75); color: var(--muted); font-size: 11px;
}
.status-right { display: flex; align-items: center; gap: 9px; }
.statusbar .dot { width: 4px; height: 4px; border-radius: 50%; background: #4b5574; }

/* ---------- Player ---------- */
.player-overlay { position: fixed; inset: 0; z-index: 100; background: #04060b; }
.player-stage { position: relative; width: 100%; height: 100%; }
#video { width: 100%; height: 100%; background: #04060b; object-fit: contain; display: block; }
.player-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--muted); font-size: 13px; pointer-events: none; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--accent-2); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.player-error { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; padding: 24px; background: rgba(4,6,11,.94); }
.error-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(251,113,133,.16); color: var(--danger); font-size: 24px; font-weight: 800; }
.player-error h3 { margin: 4px 0 0; font-size: 18px; }
.player-error p { margin: 0 0 10px; color: var(--muted); font-size: 12.5px; max-width: 420px; line-height: 1.7; }
.player-topbar { position: absolute; inset-block-start: 0; inset-inline: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; background: linear-gradient(to bottom, rgba(0,0,0,.75), transparent); transition: opacity .25s; }
.now-playing { display: flex; align-items: center; gap: 11px; min-width: 0; }
.now-playing img { width: 42px; height: 42px; object-fit: contain; border-radius: 10px; background: rgba(255,255,255,.06); }
.now-playing strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-playing small { display: block; color: #b6c0d8; font-size: 11px; }
.player-top-actions { display: flex; gap: 8px; }
.player-top-actions .icon-btn { background: rgba(0,0,0,.35); border-color: rgba(255,255,255,.15); color: #e5e9f5; }
.player-controls { position: absolute; inset-block-end: 0; inset-inline: 0; padding: 30px 22px 18px; background: linear-gradient(to top, rgba(0,0,0,.88), transparent); transition: opacity .25s; }
.progress-row { display: flex; align-items: center; gap: 12px; margin-bottom: 9px; }
.progress-track { height: 4px; border-radius: 4px; background: rgba(255,255,255,.2); flex: 1; overflow: hidden; }
.progress-fill { height: 100%; width: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s; }
#timeLabel { font-size: 11px; color: #cbd3e8; min-width: 46px; text-align: center; }
.control-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ctrl-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.07); color: #eef2ff; flex: 0 0 auto; }
.ctrl-btn:hover { background: rgba(255,255,255,.16); }
.ctrl-btn svg { width: 18px; height: 18px; }
.control-spacer { flex: 1; }
.volume-wrap { display: flex; align-items: center; gap: 7px; }
.volume-wrap input { width: 86px; accent-color: var(--accent-2); }
.player-overlay.idle .player-topbar, .player-overlay.idle .player-controls { opacity: 0; }
.epg-panel { position: absolute; inset-block: 0; inset-inline-end: 0; width: min(380px, 92vw); background: rgba(10,14,24,.96); backdrop-filter: blur(20px); border-inline-start: 1px solid var(--line-strong); box-shadow: -20px 0 50px rgba(0,0,0,.5); display: flex; flex-direction: column; }
.epg-head { display: flex; align-items: center; justify-content: space-between; padding: 18px; border-bottom: 1px solid var(--line); }
.epg-head h3 { margin: 0; font-size: 15px; }
.epg-body { padding: 14px 18px 30px; overflow-y: auto; }
.epg-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.epg-item:last-child { border-bottom: 0; }
.epg-item strong { display: block; font-size: 13px; margin-bottom: 4px; }
.epg-item small { color: var(--muted); font-size: 11px; }
.epg-item.now strong { color: var(--accent-2); }
.epg-empty { color: var(--muted); font-size: 12.5px; line-height: 1.8; }

/* ---------- Modals & toasts ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; background: rgba(3,5,10,.72); backdrop-filter: blur(6px); }
.modal-card { width: min(520px, 100%); max-height: 90dvh; overflow-y: auto; border-radius: 22px; border: 1px solid var(--line-strong); background: linear-gradient(160deg, #18203a, #0e1322); box-shadow: var(--shadow); padding: 22px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h2 { margin: 0; font-size: 18px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 7px; font-size: 12.5px; font-weight: 700; color: #c9d2ea; }
.field > span small { color: var(--muted); font-weight: 500; }
.field input { width: 100%; height: 42px; border-radius: 11px; border: 1px solid var(--line-strong); background: rgba(255,255,255,.04); color: var(--text); padding: 0 12px; outline: 0; font-size: 13px; }
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hint { color: var(--muted); font-size: 11.5px; line-height: 1.7; margin: -4px 0 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.dropzone { border: 2px dashed rgba(109,94,252,.4); border-radius: 16px; background: rgba(109,94,252,.07); padding: 28px 18px; text-align: center; margin-bottom: 16px; cursor: pointer; transition: background .15s, border-color .15s; }
.dropzone:hover, .dropzone.dragover { background: rgba(109,94,252,.15); border-color: var(--accent-2); }
.dropzone svg { width: 32px; height: 32px; color: #b9c6ff; margin-bottom: 8px; }
.dropzone strong { display: block; font-size: 13px; margin-bottom: 4px; }
.dropzone small { color: var(--muted); font-size: 11px; }
.settings-body { display: flex; flex-direction: column; gap: 12px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 13px; border: 1px solid var(--line); background: rgba(255,255,255,.035); cursor: pointer; }
.switch-row strong { display: block; font-size: 13px; }
.switch-row small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.switch-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.settings-section h3 { font-size: 12px; color: var(--muted); margin: 4px 0 8px; }
.settings-playlists { display: flex; flex-direction: column; gap: 6px; max-height: 180px; overflow-y: auto; }
.settings-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.toast-stack { position: fixed; inset-block-end: 18px; inset-inline-end: 18px; z-index: 300; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 36px)); }
.toast { border: 1px solid var(--line-strong); border-radius: 13px; background: rgba(20,27,45,.97); box-shadow: var(--shadow); padding: 11px 14px; font-size: 12.5px; line-height: 1.6; animation: toastIn .22s ease-out; }
.toast.error { border-color: rgba(251,113,133,.5); color: #fecdd3; }
.toast.success { border-color: rgba(52,211,153,.4); color: #a7f3d0; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

.scrim { position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.55); }

@media (max-width: 1020px) {
  .hero-visual { opacity: .45; inset-inline-start: 32%; }
  .hero-copy { max-width: 70%; }
}
@media (max-width: 820px) {
  .menu-btn { display: grid; }
  .sidebar { position: fixed; inset-block: var(--topbar-h) var(--status-h); inset-inline-start: 0; z-index: 26; transform: translateX(105%); transition: transform .22s; box-shadow: var(--shadow); background: #0d1220; }
  html[dir='rtl'] .sidebar { transform: translateX(-105%); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .brand-text small { display: none; }
  .top-actions .btn span { display: none; }
  .top-actions .btn { width: 38px; padding: 0; }
  .install-btn span { display: inline; }
  .install-btn { width: auto; padding: 9px 12px; }
  .hero-copy { max-width: 100%; }
  .hero-visual { display: none; }
  .search-box.compact { width: 160px; }
}
@media (max-width: 560px) {
  :root { --topbar-h: 62px; }
  .topbar { gap: 8px; padding-inline: 10px; }
  .brand-text strong { font-size: 15px; }
  .content { padding: 16px 12px 30px; }
  .hero { min-height: auto; padding: 22px 18px; border-radius: 18px; }
  .hero h1 { font-size: 23px; }
  .hero p { font-size: 12.5px; }
  .channels { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
  .channel-logo { width: 40px; height: 40px; }
  .library-tools { width: 100%; }
  .search-box.compact { flex: 1; width: auto; }
  .volume-wrap input { width: 54px; }
  .control-row { gap: 5px; }
  .ctrl-btn { width: 34px; height: 34px; }
  .statusbar { font-size: 10px; }
}
