/* =========================================================================
   SmartLive — dark, RTL-first UI for live IPTV channels
   ========================================================================= */

:root {
  --bg: #07090f;
  --bg-2: #0b0e16;
  --surface: #11141f;
  --surface-2: #171b28;
  --surface-3: #1f2433;
  --line: #242a3b;
  --line-soft: #1b2030;

  --text: #eef1f8;
  --text-2: #a8b0c4;
  --text-3: #6d768d;

  --accent: #6366f1;
  --accent-2: #22d3ee;
  --accent-soft: rgba(99, 102, 241, 0.16);
  --live: #ff3b5c;
  --gold: #f5b544;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --topbar-h: 68px;
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Heebo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1100px 620px at 100% -10%, rgba(99, 102, 241, 0.16), transparent 60%),
    radial-gradient(900px 520px at 0% 0%, rgba(34, 211, 238, 0.10), transparent 55%),
    var(--bg);
}

svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

button { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; }
::selection { background: var(--accent); color: #fff; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #2d3448; background-clip: content-box; }

.app { min-height: 100%; display: flex; flex-direction: column; }

/* ============================== top bar ================================= */

.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  background: rgba(7, 9, 15, 0.78);
  backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid var(--line-soft);
}

.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; flex-shrink: 0; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent), #8b5cf6 55%, var(--accent-2));
  box-shadow: 0 8px 22px rgba(99, 102, 241, 0.42);
  color: #fff;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-size: 19px; font-weight: 900; letter-spacing: -0.02em; }
.brand-text strong span { background: linear-gradient(90deg, var(--accent-2), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-text small { font-size: 10.5px; color: var(--text-3); letter-spacing: 0.04em; }

.search { position: relative; flex: 1; max-width: 520px; margin-inline-start: 12px; }
.search input {
  width: 100%; height: 42px;
  padding-inline: 44px 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { border-color: var(--accent); background: var(--surface-2); box-shadow: 0 0 0 4px var(--accent-soft); }
.search input::-webkit-search-cancel-button { display: none; }
.search-icon { position: absolute; inset-inline-start: 14px; top: 11px; color: var(--text-3); }
.search-clear {
  position: absolute; inset-inline-end: 8px; top: 8px;
  width: 26px; height: 26px; border: 0; border-radius: 8px;
  background: var(--surface-3); color: var(--text-2);
  display: grid; place-items: center;
}
.search-clear svg { width: 14px; height: 14px; }
.search-clear:hover { color: var(--text); }

.topbar-right { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }

.account-chip {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface);
  font-size: 12.5px; color: var(--text-2); white-space: nowrap;
}
.account-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); box-shadow: 0 0 0 3px rgba(255,255,255,.04); }
.account-chip.ok .dot { background: #27d980; box-shadow: 0 0 10px rgba(39, 217, 128, .7); }
.account-chip.bad .dot { background: var(--live); box-shadow: 0 0 10px rgba(255, 59, 92, .7); }

.icon-btn {
  width: 38px; height: 38px; flex-shrink: 0;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface); color: var(--text-2);
  transition: all .16s;
}
.icon-btn:hover { color: var(--text); border-color: #30374c; background: var(--surface-2); transform: translateY(-1px); }
.icon-btn.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(-360deg); } }

.only-mobile { display: none; }

/* ============================== layout ================================== */

.body { flex: 1; display: flex; align-items: flex-start; }

.sidebar {
  position: sticky; top: var(--topbar-h);
  width: var(--sidebar-w); flex-shrink: 0;
  height: calc(100vh - var(--topbar-h));
  padding: 18px 14px;
  display: flex; flex-direction: column;
  border-inline-end: 1px solid var(--line-soft);
  overflow-y: auto;
}

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label { font-size: 10.5px; letter-spacing: .12em; color: var(--text-3); text-transform: uppercase; margin: 16px 10px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border: 0; border-radius: 11px;
  background: transparent; color: var(--text-2);
  text-align: start; font-size: 14.5px; font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item .ico { width: 22px; text-align: center; font-size: 15px; filter: saturate(.9); }
.nav-item .n { flex: 1; }
.nav-item .c { font-size: 11.5px; color: var(--text-3); background: var(--surface-2); padding: 2px 8px; border-radius: 999px; }
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: linear-gradient(90deg, var(--accent-soft), rgba(34, 211, 238, .07)); color: #fff; box-shadow: inset 0 0 0 1px rgba(99,102,241,.3); }
.nav-item.active .c { background: rgba(99, 102, 241, .28); color: #dfe1ff; }

.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 7px; }
.meta-row { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); }
.meta-row b { color: var(--text-2); font-weight: 500; }

.scrim { display: none; }

.content { flex: 1; min-width: 0; padding: 22px 26px 40px; }

/* ================================ hero ================================== */

.hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 26px 28px; margin-bottom: 24px;
  border: 1px solid var(--line); border-radius: 22px;
  background:
    radial-gradient(600px 200px at 100% 0%, rgba(99,102,241,.22), transparent 70%),
    linear-gradient(120deg, var(--surface-2), var(--surface));
}
.hero-kicker { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2); font-weight: 700; }
.hero h1 { margin: 8px 0 6px; font-size: 30px; font-weight: 900; letter-spacing: -0.02em; }
.hero-now { margin: 0 0 16px; color: var(--text-2); font-size: 14px; }
.hero-logo { width: 150px; height: 92px; flex-shrink: 0; display: grid; place-items: center; }
.hero-logo img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 8px 20px rgba(0,0,0,.6)); }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 20px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface-2); color: var(--text);
  font-weight: 600; transition: all .16s;
}
.btn:hover { transform: translateY(-1px); }
.btn.primary { border: 0; background: linear-gradient(135deg, var(--accent), #8b5cf6); box-shadow: 0 10px 26px rgba(99,102,241,.4); color: #fff; }
.btn.primary:hover { box-shadow: 0 14px 32px rgba(99,102,241,.55); }
.btn svg { width: 18px; height: 18px; }

/* ============================== toolbar ================================= */

.toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.toolbar-title { display: flex; align-items: baseline; gap: 10px; }
.toolbar-title h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.count { font-size: 13px; color: var(--text-3); }
.toolbar-actions { display: flex; gap: 8px; }

.segmented { display: flex; padding: 3px; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.segmented button {
  height: 32px; padding: 0 12px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-3); font-size: 13px; font-weight: 500;
  display: grid; place-items: center;
}
.segmented button svg { width: 17px; height: 17px; }
.segmented button:hover { color: var(--text-2); }
.segmented button.active { background: var(--surface-3); color: #fff; }

/* ============================ channel grid ============================== */

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

.card {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(170deg, var(--surface-2), var(--surface));
  text-align: start; padding: 0;
  transition: transform .18s cubic-bezier(.2,.8,.2,1), border-color .18s, box-shadow .18s;
}
.card:hover { transform: translateY(-4px); border-color: #353d55; box-shadow: var(--shadow); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.card-art {
  position: relative; height: 104px;
  display: grid; place-items: center;
  background:
    radial-gradient(130px 70px at 50% 40%, rgba(255,255,255,.07), transparent 70%),
    var(--bg-2);
  border-bottom: 1px solid var(--line-soft);
}
.card-art img { max-width: 76%; max-height: 66px; object-fit: contain; transition: transform .25s; }
.card:hover .card-art img { transform: scale(1.06); }
.card-art .fallback { font-size: 18px; font-weight: 800; color: var(--text-3); letter-spacing: .02em; padding: 0 12px; text-align: center; }

.card-play {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: rgba(7, 9, 15, .55);
  opacity: 0; transition: opacity .18s;
}
.card:hover .card-play { opacity: 1; }
.card-play span {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  box-shadow: 0 8px 20px rgba(0,0,0,.5);
}
.card-play svg { width: 20px; height: 20px; margin-inline-start: 3px; color: #fff; }

.card-body { padding: 11px 13px 13px; }
.card-title { font-size: 14px; font-weight: 700; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { margin-top: 3px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 15px; }

.card-tags { position: absolute; top: 9px; inset-inline-start: 9px; display: flex; gap: 5px; }
.badge {
  padding: 2px 7px; border-radius: 6px;
  font-size: 9.5px; font-weight: 800; letter-spacing: .04em;
  background: rgba(10, 12, 20, .78); border: 1px solid var(--line); color: var(--text-2);
  backdrop-filter: blur(6px);
}
.badge.q4k { background: linear-gradient(135deg, var(--gold), #e9892f); color: #1a1205; border: 0; }
.badge.qhd { color: #bfe9ff; border-color: rgba(34,211,238,.35); }
.badge.plat { color: var(--text-3); }
.badge.live { display: inline-flex; align-items: center; gap: 5px; color: #ffd9e0; border-color: rgba(255,59,92,.4); background: rgba(255,59,92,.16); }
.pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--live); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255,59,92,.6); } 50% { opacity: .6; box-shadow: 0 0 0 5px rgba(255,59,92,0); } }

.fav {
  position: absolute; top: 7px; inset-inline-end: 7px;
  width: 30px; height: 30px; border: 0; border-radius: 9px;
  background: rgba(10, 12, 20, .6); color: var(--text-3);
  display: grid; place-items: center; opacity: 0;
  transition: opacity .15s, color .15s, transform .15s;
  backdrop-filter: blur(6px);
}
.card:hover .fav, .fav.on { opacity: 1; }
.fav:hover { transform: scale(1.1); color: var(--gold); }
.fav.on { color: var(--gold); }
.fav svg { width: 16px; height: 16px; }
.fav.on svg { fill: var(--gold); stroke: var(--gold); }

.progress { height: 3px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }

/* list view */
.grid.list { display: flex; flex-direction: column; gap: 7px; }
.grid.list .card { display: flex; align-items: center; gap: 14px; padding: 9px 14px 9px 9px; border-radius: 12px; }
.grid.list .card:hover { transform: none; }
.grid.list .card-art { width: 74px; height: 44px; flex-shrink: 0; border: 1px solid var(--line-soft); border-radius: 9px; background: var(--bg-2); }
.grid.list .card-art img { max-height: 32px; }
.grid.list .card-art .fallback { font-size: 11px; }
.grid.list .card-body { flex: 1; min-width: 0; padding: 0; display: flex; align-items: center; gap: 12px; }
.grid.list .card-title { flex: 0 1 auto; max-width: 260px; }
.grid.list .card-sub { flex: 1; margin: 0; }
.grid.list .card-tags { position: static; order: 3; }
.grid.list .fav { position: static; order: 4; opacity: 1; background: transparent; }
.grid.list .card-play { display: none; }
.grid.list .progress { display: none; }

/* ============================ empty + foot ============================== */

.empty { padding: 70px 0; text-align: center; color: var(--text-3); }
.empty-art { font-size: 44px; opacity: .5; }
.empty h3 { margin: 14px 0 6px; color: var(--text-2); font-size: 17px; }
.empty p { margin: 0; font-size: 13.5px; }

.foot { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line-soft); display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-3); }

/* ============================== player ================================== */

.player-layer {
  position: fixed; inset: 0; z-index: 90;
  display: flex; flex-direction: column;
  background: #04050a;
  animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } }

.player-head {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; flex-shrink: 0;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(7, 9, 15, .9);
}
.player-ident { display: flex; align-items: center; gap: 12px; min-width: 0; }
.player-ident img { width: 46px; height: 32px; object-fit: contain; flex-shrink: 0; }
.player-ident-text { min-width: 0; }
.player-name { display: flex; align-items: center; gap: 8px; }
.player-name strong { font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-sub { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 56vw; }
.player-head-right { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.stat { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

.player-main { flex: 1; display: flex; min-height: 0; }

.stage { position: relative; flex: 1; background: #000; min-width: 0; }
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }

.stage-overlay { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.spinner {
  width: 54px; height: 54px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.14);
  border-top-color: var(--accent-2);
  animation: spin2 .9s linear infinite;
}
@keyframes spin2 { to { transform: rotate(360deg); } }
.spinner[hidden] { display: none; }

.big-play {
  pointer-events: auto;
  width: 84px; height: 84px; border: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  box-shadow: 0 16px 40px rgba(0,0,0,.6);
  color: #fff;
}
.big-play svg { width: 34px; height: 34px; margin-inline-start: 5px; }
.big-play:hover { transform: scale(1.05); }

.stage-error { pointer-events: auto; text-align: center; max-width: 420px; padding: 26px; }
.stage-error h3 { margin: 0 0 8px; font-size: 19px; }
.stage-error p { margin: 0 0 18px; color: var(--text-2); font-size: 13.5px; line-height: 1.6; }

.controls {
  position: absolute; inset-inline: 0; bottom: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 34px 18px 14px;
  background: linear-gradient(to top, rgba(0,0,0,.88), transparent);
  opacity: 1; transition: opacity .25s;
}
.player-layer.idle .controls { opacity: 0; pointer-events: none; }
.player-layer.idle .stage { cursor: none; }
.ctl {
  width: 40px; height: 40px; border: 0; border-radius: 11px;
  background: rgba(255,255,255,.07); color: #fff;
  display: grid; place-items: center; backdrop-filter: blur(8px);
  transition: background .15s, transform .15s;
}
.ctl:hover { background: rgba(255,255,255,.16); transform: translateY(-1px); }
.ctl[disabled] { opacity: .35; pointer-events: none; }
.spacer { flex: 1; }
.live-chip { font-size: 10px; font-weight: 800; letter-spacing: .06em; }
#liveBtn { width: auto; padding: 0 12px; color: #ffd9e0; background: rgba(255,59,92,.2); }
#liveBtn.behind { color: #fff; background: rgba(255,255,255,.1); }

.volume { display: flex; align-items: center; gap: 6px; }
.vol-range {
  width: 0; opacity: 0; transition: width .2s, opacity .2s;
  -webkit-appearance: none; appearance: none; height: 4px; border-radius: 4px;
  background: rgba(255,255,255,.25); outline: none;
}
.volume:hover .vol-range, .vol-range:focus { width: 92px; opacity: 1; }
.vol-range::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #fff; cursor: pointer; }
.vol-range::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: #fff; cursor: pointer; }

/* player side panel */
.player-panel {
  width: 332px; flex-shrink: 0;
  display: flex; flex-direction: column;
  border-inline-start: 1px solid var(--line-soft);
  background: var(--bg);
  transition: margin .22s ease;
}
.player-panel.collapsed { margin-inline-end: -332px; }
.panel-tabs { display: flex; gap: 2px; padding: 10px; border-bottom: 1px solid var(--line-soft); }
.panel-tabs button {
  flex: 1; height: 34px; border: 0; border-radius: 9px;
  background: transparent; color: var(--text-3); font-size: 13px; font-weight: 600;
}
.panel-tabs button.active { background: var(--surface-2); color: #fff; }
.panel-body { flex: 1; overflow-y: auto; padding: 12px; }

.epg-now { padding: 14px; border-radius: 13px; background: linear-gradient(150deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); margin-bottom: 14px; }
.epg-now .k { font-size: 10px; letter-spacing: .12em; color: var(--accent-2); font-weight: 800; }
.epg-now h4 { margin: 6px 0 4px; font-size: 15.5px; line-height: 1.3; }
.epg-now .t { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.epg-now p { margin: 9px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--text-2); }
.epg-item { display: flex; gap: 11px; padding: 10px 4px; border-bottom: 1px solid var(--line-soft); }
.epg-item:last-child { border-bottom: 0; }
.epg-item .time { font-size: 12px; color: var(--accent-2); font-weight: 700; font-variant-numeric: tabular-nums; width: 42px; flex-shrink: 0; }
.epg-item .ttl { font-size: 13px; line-height: 1.4; color: var(--text-2); }
.panel-note { padding: 24px 10px; text-align: center; color: var(--text-3); font-size: 13px; }

.plist-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 8px; margin-bottom: 3px; border: 0; border-radius: 11px;
  background: transparent; color: var(--text-2); text-align: start;
}
.plist-item:hover { background: var(--surface); color: var(--text); }
.plist-item.active { background: var(--accent-soft); color: #fff; box-shadow: inset 0 0 0 1px rgba(99,102,241,.35); }
.plist-item .lg { width: 42px; height: 28px; flex-shrink: 0; display: grid; place-items: center; background: var(--bg-2); border-radius: 7px; }
.plist-item .lg img { max-width: 100%; max-height: 22px; object-fit: contain; }
.plist-item .nm { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* =============================== toasts ================================= */

.toasts { position: fixed; inset-block-end: 20px; inset-inline-start: 20px; z-index: 200; display: flex; flex-direction: column; gap: 9px; }
.toast {
  min-width: 230px; max-width: 360px;
  padding: 12px 15px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line);
  box-shadow: var(--shadow); font-size: 13.5px;
  animation: slideIn .22s cubic-bezier(.2,.8,.2,1);
}
.toast.err { border-color: rgba(255,59,92,.45); }
.toast.ok { border-color: rgba(39,217,128,.4); }
@keyframes slideIn { from { transform: translateY(12px); opacity: 0; } }

/* ============================= responsive =============================== */

@media (max-width: 1100px) {
  .player-panel { position: absolute; inset-block: 0; inset-inline-end: 0; z-index: 5; box-shadow: var(--shadow); }
  .player-main { position: relative; }
}

@media (max-width: 920px) {
  .only-mobile { display: grid; }
  .sidebar {
    position: fixed; inset-block: var(--topbar-h) 0; inset-inline-start: 0;
    z-index: 50; background: var(--bg-2); width: 272px;
    transform: translateX(100%); transition: transform .24s ease;
  }
  html[dir="rtl"] .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: none !important; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(0,0,0,.6); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .scrim.on { opacity: 1; pointer-events: auto; }
  .brand-text small { display: none; }
  .account-chip { display: none; }
  .content { padding: 16px 16px 32px; }
  .hero { flex-direction: column-reverse; align-items: flex-start; text-align: start; }
  .hero-logo { width: 110px; height: 64px; }
  .hero h1 { font-size: 23px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(144px, 1fr)); gap: 11px; }
  .card-art { height: 84px; }
  .player-sub { max-width: 48vw; }
  .toolbar { flex-wrap: wrap; }
}

@media (max-width: 560px) {
  .brand-text { display: none; }
  .player-panel { width: 100%; }
  .player-panel.collapsed { margin-inline-end: -100%; }
  .grid.list .card-title { max-width: none; }
  .grid.list .card-sub { display: none; }
}

/* ============================ account chip ============================== */

.user-chip {
  display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 12px 0 6px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); font-size: 12.5px; font-weight: 600;
  white-space: nowrap; max-width: 190px; overflow: hidden;
}
.user-chip #userName { overflow: hidden; text-overflow: ellipsis; }
.avatar-sm {
  width: 26px; height: 26px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 50%;
  background: linear-gradient(140deg, var(--accent), #8b5cf6);
  color: #fff; font-size: 11px; font-weight: 800;
}
.playlist-picker {
  height: 38px; padding: 0 12px; max-width: 190px;
  border: 1px solid var(--line); border-radius: 11px;
  background: var(--surface); color: var(--text-2);
  font: inherit; font-size: 12.5px; outline: none;
}
.playlist-picker:focus { border-color: var(--accent); }

@media (max-width: 920px) {
  .user-chip #userName, .playlist-picker { display: none; }
  .user-chip { padding: 0 6px; max-width: none; }
}
