:root {
  color-scheme: dark;
  --bg: #090a0c;
  --panel: #111214;
  --panel-raised: #17181b;
  --line: #25262a;
  --text: #f5f5f6;
  --muted: #a1a1a8;
  --soft: #707178;
  --accent: #b6e35a;
  --accent-contrast: #161a0d;
  font-family: "Figtree", system-ui, sans-serif;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f2f4;
  --panel: #fff;
  --panel-raised: #ececef;
  --line: #d8d8dd;
  --text: #19191d;
  --muted: #5e5e67;
  --soft: #777780;
  --accent: #719d18;
  --accent-contrast: #fff;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: var(--bg); color: var(--text); font-size: 14px; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.app-layout { height: 100vh; display: flex; gap: 8px; padding: 8px 8px 86px; }
.sidebar { display: flex; flex: 0 0 280px; flex-direction: column; gap: 8px; min-height: 0; }
.side-box { overflow: hidden; border-radius: 12px; background: var(--panel); }
.brand-box { padding: 14px 15px 19px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font-size: 17px; font-weight: 800; }
.brand-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; background: #0d2618; color: #22d76c; font-size: 21px; }
.primary-nav { display: grid; gap: 4px; margin-top: 20px; }
.nav-item { display: flex; align-items: center; gap: 14px; min-height: 40px; padding: 7px 11px; border: 0; border-radius: 7px; background: transparent; color: #b7b7bd; text-align: left; font-size: 14px; font-weight: 700; }
.nav-item:hover, .nav-item.active { background: var(--panel-raised); color: var(--text); }
.nav-icon { width: 19px; color: currentColor; font-size: 21px; line-height: 1; text-align: center; }
.queue-box { min-height: 132px; padding: 17px 16px; }
.side-title { display: flex; align-items: center; gap: 10px; color: #d4d4d7; font-weight: 700; }
.side-title > .icon-button { margin-left: auto; }
.icon-button { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 20px; }
.icon-button:hover { background: var(--panel-raised); color: var(--text); }
.queue-list { max-height: 128px; overflow-y: auto; }
.empty-small { margin: 13px 4px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.queue-row { display: flex; align-items: center; gap: 9px; padding: 9px 2px 0; cursor: pointer; }
.queue-row img { width: 36px; height: 36px; border-radius: 4px; object-fit: cover; }
.queue-row strong, .queue-row span { display: block; overflow: hidden; max-width: 175px; text-overflow: ellipsis; white-space: nowrap; }
.queue-row strong { font-size: 11px; }.queue-row span { color: var(--muted); font-size: 10px; }
.library-box { position: relative; flex: 1; min-height: 160px; padding: 17px 16px 45px; }
.library-title { display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: transparent; color: inherit; font-weight: 700; }
.library-list { max-height: calc(100% - 45px); margin-top: 16px; overflow: auto; }
.library-empty { display: grid; gap: 5px; margin: 24px 4px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.library-empty strong { color: var(--text); font-size: 13px; }
.library-item { display: flex; align-items: center; gap: 10px; padding: 7px 2px; border: 0; background: transparent; text-align: left; }
.library-item img, .playlist-placeholder { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 4px; object-fit: cover; }
.playlist-placeholder { display: grid; place-items: center; background: linear-gradient(145deg,#514661,#b98264); color: white; font-size: 18px; }
.library-item span { overflow: hidden; color: var(--text); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer { position: absolute; bottom: 14px; left: 19px; margin: 0; color: var(--soft); font-size: 10px; }
.main-panel { display: flex; flex: 1; min-width: 0; flex-direction: column; overflow: hidden; border-radius: 12px; background: linear-gradient(180deg,#193634 0,#101c1c 31%,var(--panel) 58%); }
.topbar { z-index: 2; display: flex; height: 64px; flex: 0 0 64px; align-items: center; gap: 20px; padding: 0 24px; }
.topbar-nav { display: flex; gap: 9px; }
.circle-button { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 50%; background: #08090a9c; color: var(--text); font-size: 24px; line-height: 1; }
.circle-button:hover { background: #202225; }
.search-field { display: flex; width: min(500px, 65%); height: 41px; align-items: center; gap: 11px; padding: 0 15px; border: 1px solid transparent; border-radius: 24px; background: #252629; color: #dedee1; }
.search-field:focus-within { border-color: #929399; background: #2b2c30; }
.search-field > span { font-size: 24px; line-height: 1; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: white; font-size: 14px; }
.search-field input::placeholder { color: #c2c2c6; }
.theme-button { margin-left: auto; font-size: 20px; }
.content-scroll { flex: 1; overflow-y: auto; padding: 8px 24px 40px; }
.welcome { margin: 1px 0 21px; }
.welcome p { margin: 0 0 1px; color: #d0d3d4; font-size: 12px; }
.welcome h1 { margin: 0; font-size: clamp(29px, 3.2vw, 40px); font-weight: 900; letter-spacing: -1.5px; line-height: 1.1; }
.catalog-section { margin: 0 0 34px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 0 0 15px; }
.section-heading h2 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.quiet-button { border: 0; background: transparent; color: var(--muted); font-size: 11px; }
.quiet-button:hover { color: var(--text); }
.quick-grid { display: grid; grid-auto-columns: 164px; grid-auto-flow: column; gap: 20px; overflow-x: auto; padding: 4px 0 15px; scrollbar-color: #727478 #232427; scrollbar-width: thin; }
.quick-card { min-width: 0; padding: 0; border: 0; background: transparent; text-align: left; }
.quick-art { position: relative; overflow: hidden; width: 100%; aspect-ratio: 1; border-radius: 8px; background: #282a2c; box-shadow: 0 8px 20px #0003; }
.quick-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .22s; }
.quick-card:hover .quick-art img { transform: scale(1.04); }
.quick-play { position: absolute; right: 10px; bottom: 10px; display: grid; width: 42px; height: 42px; place-items: center; border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-contrast); box-shadow: 0 5px 12px #0005; font-size: 16px; opacity: 0; transform: translateY(4px); transition: .16s; }
.quick-card:hover .quick-play, .quick-card:focus-visible .quick-play { opacity: 1; transform: none; }
.quick-name { overflow: hidden; margin-top: 9px; font-size: 14px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.quick-sub { display: -webkit-box; overflow: hidden; margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.playlist-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(142px,1fr)); gap: 13px; }
.playlist-card { min-width: 0; padding: 8px; border: 0; border-radius: 7px; background: #191a1c; text-align: left; transition: background .15s; }
.playlist-card:hover { background: #25262a; }
.playlist-art { overflow: hidden; width: 100%; aspect-ratio: 1; border-radius: 5px; background: linear-gradient(135deg,#56426d,#cf8061); }
.playlist-placeholder-large { display: grid; place-items: center; color: #ffffffb8; font-size: 42px; }
.playlist-art img { width: 100%; height: 100%; object-fit: cover; }
.artist-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(112px,1fr)); gap: 12px; margin-bottom: 24px; }
.artist-card { display: grid; justify-items: center; gap: 6px; padding: 10px; border: 0; border-radius: 7px; background: transparent; text-align: center; }
.artist-card:hover { background: var(--panel-raised); }
.artist-card img, .artist-card > span { width: 82px; height: 82px; display: grid; place-items: center; border-radius: 50%; background: var(--panel-raised); object-fit: cover; font-size: 25px; }
.artist-card strong { overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.artist-card small { color: var(--muted); font-size: 10px; }
.playlist-card strong, .playlist-card span { display: block; overflow: hidden; margin: 9px 1px 0; text-overflow: ellipsis; white-space: nowrap; }
.playlist-card strong { font-size: 12px; }.playlist-card span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.song-list { display: grid; gap: 2px; }
.song-row { display: grid; grid-template-columns: 29px 45px minmax(90px,1.3fr) minmax(90px,1fr) 78px; align-items: center; gap: 11px; min-height: 57px; padding: 5px 8px; border-radius: 5px; cursor: pointer; }
.song-row:hover, .song-row.current { background: #ffffff0c; }
.song-index { color: var(--muted); text-align: center; font-size: 12px; }
.song-thumb { width: 43px; height: 43px; border-radius: 4px; object-fit: cover; background: #292b30; }
.song-info { min-width: 0; }.song-info strong, .song-info span, .song-album { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-info strong { font-size: 12px; font-weight: 600; }.song-info span, .song-album { color: var(--muted); font-size: 11px; }
.song-row.current .song-info strong { color: var(--accent); }
.song-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.song-action { display: grid; width: 24px; height: 28px; place-items: center; border: 0; background: transparent; color: var(--muted); font-size: 16px; }
.song-action:hover, .song-action.liked { color: var(--accent); }
.loading-state, .empty-state { grid-column: 1 / -1; padding: 28px; color: var(--muted); text-align: center; }
.error-state { color: #ff9f9f; }
.page-footer { padding: 20px 0 8px; border-top: 1px solid var(--line); color: var(--soft); font-size: 10px; }
.search-page h1 { margin: 3px 0 18px; font-size: 27px; }
.search-filters { display: flex; gap: 8px; margin-bottom: 20px; }
.filter-chip { padding: 8px 14px; border: 0; border-radius: 20px; background: var(--panel-raised); color: var(--text); font-size: 11px; }
.filter-chip.active { background: var(--accent); color: var(--accent-contrast); }
.player-bar { position: fixed; z-index: 4; right: 0; bottom: 0; left: 0; display: grid; height: 78px; grid-template-columns: minmax(190px,1fr) minmax(260px,1.2fr) minmax(150px,1fr); align-items: center; gap: 18px; padding: 0 17px; border-top: 1px solid #292a2d; background: #111214; }
.now-playing { display: flex; min-width: 0; align-items: center; gap: 10px; }
.now-playing > img { display: none; width: 49px; height: 49px; flex: 0 0 auto; border-radius: 4px; object-fit: cover; background: var(--panel-raised); }
.now-playing > img[src]:not([src=""]) { display: block; }
.now-playing-copy { display: grid; min-width: 0; gap: 3px; }
.now-playing-copy strong, .now-playing-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.now-playing-copy strong { font-size: 11px; font-weight: 700; }.now-playing-copy span { color: var(--muted); font-size: 10px; }
.like-button { font-size: 20px; }
.player-center { min-width: 0; }
.player-controls { display: flex; height: 37px; align-items: center; justify-content: center; gap: 18px; }
.player-control { display: grid; width: 28px; height: 28px; place-items: center; border: 0; background: transparent; color: var(--muted); font-size: 18px; }
.player-control:hover, .player-control.active { color: var(--accent); }
.player-play { display: grid; width: 33px; height: 33px; place-items: center; border: 0; border-radius: 50%; background: #f0f0f1; color: #151518; font-size: 13px; }
.player-play:hover { transform: scale(1.05); }
.seek-row { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 9px; }
.seek-row input { width: 100%; height: 3px; accent-color: var(--accent); cursor: pointer; }
.player-extra { display: flex; align-items: center; justify-content: flex-end; gap: 11px; color: var(--muted); }
.player-extra input { width: min(82px, 40%); height: 3px; accent-color: var(--accent); }
.mobile-nav { display: none; }
.toast { position: fixed; z-index: 10; bottom: 94px; left: 50%; padding: 10px 15px; border: 1px solid #404147; border-radius: 7px; background: #242529; color: white; font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%,8px); transition: .18s; }
.toast.visible { opacity: 1; transform: translate(-50%,0); }
.youtube-player-host { position: fixed; width: 200px; height: 200px; right: 0; bottom: 0; overflow: hidden; clip-path: inset(50%); pointer-events: none; }
#youtube-player, #youtube-player iframe { width: 200px; height: 200px; }

@media (min-width: 1450px) {
  .sidebar { flex-basis: 300px; }.content-scroll { padding-right: 34px; padding-left: 34px; }
  .quick-grid { grid-auto-columns: 185px; gap: 23px; }
}
@media (max-width: 880px) {
  .sidebar { flex-basis: 225px; }.topbar { padding: 0 17px; gap: 12px; }.content-scroll { padding-right: 17px; padding-left: 17px; }
  .player-bar { grid-template-columns: minmax(145px,1fr) minmax(230px,1.1fr) minmax(85px,.6fr); gap: 10px; padding: 0 10px; }
  .player-controls { gap: 10px; }.player-extra { gap: 5px; }.player-extra input { width: 55px; }
}
@media (max-width: 650px) {
  .app-layout { height: 100dvh; padding: 0 0 136px; }
  .sidebar { display: none; }
  .main-panel { border-radius: 0; }
  .topbar { height: 57px; flex-basis: 57px; padding: 0 13px; gap: 9px; }.topbar-nav { display: none; }
  .search-field { width: 100%; height: 39px; }.theme-button { flex: 0 0 auto; margin-left: 0; }
  .content-scroll { padding: 9px 14px 31px; }
  .welcome { margin: 5px 0 18px; }.welcome h1 { font-size: 32px; }
  .quick-grid { grid-auto-columns: 140px; gap: 13px; }
  .playlist-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .song-row { grid-template-columns: 21px 40px minmax(0,1fr) 70px; gap: 8px; }
  .song-thumb { width: 38px; height: 38px; }.song-album { display: none; }
  .player-bar { bottom: 59px; height: 77px; grid-template-columns: minmax(0,1fr) auto; gap: 8px; padding: 0 12px; }
  .now-playing > img { width: 42px; height: 42px; }.now-playing-copy strong { max-width: 160px; font-size: 10px; }.now-playing-copy span { max-width: 160px; font-size: 9px; }
  .like-button { display: none; }.player-controls { gap: 9px; }.player-controls #shuffle, .player-controls #previous, .player-controls #repeat { display: none; }.player-extra { display: none; }.seek-row { display: none; }
  .mobile-nav { position: fixed; z-index: 5; right: 0; bottom: 0; left: 0; display: flex; height: 60px; align-items: center; justify-content: space-around; padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: #101113; }
  .mobile-nav .nav-item { min-height: 48px; flex-direction: column; justify-content: center; gap: 2px; padding: 3px 12px; font-size: 9px; }
  .mobile-nav .nav-icon { font-size: 19px; }
  .toast { bottom: 145px; }
}
