:root {
  color-scheme: light;
  --paper: #f6f4ee;
  --paper-deep: #ece8dd;
  --card: rgba(255, 255, 255, 0.78);
  --ink: #1b2430;
  --muted: #6f756f;
  --line: rgba(27, 36, 48, 0.11);
  --accent: #e85f3c;
  --accent-dark: #c94427;
  --navy: #183047;
  --gold: #f2b84b;
  --shadow: 0 18px 60px rgba(34, 42, 46, 0.11);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 3%, rgba(242, 184, 75, 0.18), transparent 28rem),
    radial-gradient(circle at 92% 88%, rgba(75, 129, 149, 0.14), transparent 30rem),
    var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard",
    "Noto Sans KR", "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select {
  font: inherit;
}

button,
label[for],
select {
  touch-action: manipulation;
}

button {
  color: inherit;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  padding: env(safe-area-inset-top) max(22px, env(safe-area-inset-right))
    env(safe-area-inset-bottom) max(22px, env(safe-area-inset-left));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 96px;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.14rem;
  letter-spacing: -0.03em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  gap: 3px;
  border-radius: 14px;
  background: var(--navy);
  box-shadow: 0 8px 24px rgba(24, 48, 71, 0.22);
}

.brand-mark span {
  width: 3px;
  border-radius: 99px;
  background: var(--gold);
}

.brand-mark span:nth-child(1) {
  height: 12px;
}

.brand-mark span:nth-child(2) {
  height: 22px;
}

.brand-mark span:nth-child(3) {
  height: 16px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quiet-button,
.import-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  gap: 8px;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.quiet-button {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.5);
}

.quiet-button svg,
.import-button svg {
  width: 20px;
  height: 20px;
}

.import-button {
  color: white;
  background: var(--accent);
  box-shadow: 0 10px 24px rgba(232, 95, 60, 0.24);
}

.import-button.large {
  min-height: 50px;
  padding-inline: 24px;
}

.quiet-button:hover,
.import-button:hover {
  transform: translateY(-1px);
}

.import-button:hover {
  background: var(--accent-dark);
}

.main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 390px);
  gap: 24px;
  align-items: start;
  padding-bottom: 32px;
}

.library-panel,
.player-panel {
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.library-panel {
  min-height: calc(100vh - 128px);
  padding: 30px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.16em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  letter-spacing: -0.055em;
  line-height: 1.05;
}

.library-summary {
  display: flex;
  align-items: baseline;
  gap: 9px;
  color: var(--muted);
  font-size: 0.86rem;
  white-space: nowrap;
}

.library-summary strong {
  color: var(--ink);
  font-size: 1.05rem;
}

.library-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-top: 26px;
  border-radius: 14px;
  background: var(--paper-deep);
}

.library-tab {
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 780;
}

.library-tab.active {
  color: var(--ink);
  background: white;
  box-shadow: 0 4px 14px rgba(27, 36, 48, 0.08);
}

.collection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 12px;
  margin-top: 14px;
}

.collection-chips {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 7px;
  overflow-x: auto;
  padding: 2px 0;
  scrollbar-width: none;
}

.collection-chips::-webkit-scrollbar {
  display: none;
}

.collection-chip,
.collection-action {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.56);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 750;
}

.collection-chip svg,
.collection-action svg {
  width: 17px;
  height: 17px;
}

.collection-chip small {
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 99px;
  place-items: center;
  color: var(--muted);
  background: var(--paper-deep);
  font-size: 0.6rem;
}

.collection-chip.active {
  color: white;
  border-color: var(--navy);
  background: var(--navy);
}

.collection-chip.active small {
  color: var(--navy);
  background: var(--gold);
}

.collection-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.collection-action {
  min-height: 38px;
  padding-inline: 10px;
  color: var(--ink);
}

.collection-action.icon-only {
  width: 38px;
  padding: 0;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 10px;
  margin-top: 14px;
}

.toolbar-button {
  min-height: 48px;
}

.search-field {
  position: relative;
}

.search-field svg {
  position: absolute;
  top: 50%;
  left: 15px;
  width: 20px;
  height: 20px;
  color: var(--muted);
  transform: translateY(-50%);
}

.search-field input,
.toolbar select,
.player-options select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
}

.toolbar select[hidden] {
  display: none;
}

.search-field input {
  padding: 0 16px 0 44px;
}

.toolbar select,
.player-options select {
  padding: 0 38px 0 14px;
}

.search-field input:focus,
.toolbar select:focus,
.player-options select:focus {
  border-color: rgba(232, 95, 60, 0.7);
  box-shadow: 0 0 0 3px rgba(232, 95, 60, 0.1);
}

.storage-row {
  margin: 18px 0 8px;
}

.device-music-source {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  margin-top: 16px;
  border: 1px solid rgba(24, 48, 71, 0.13);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(233, 239, 240, 0.64));
}

.device-source-icon {
  display: grid;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  place-items: center;
  color: var(--gold);
  background: var(--navy);
}

.device-source-icon svg {
  width: 25px;
  height: 25px;
}

.device-source-copy {
  min-width: 0;
}

.device-source-copy strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.82rem;
}

.device-source-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.5;
}

.device-source-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.compact-action {
  min-height: 38px;
  padding-inline: 12px;
  border-radius: 11px;
  font-size: 0.7rem;
}

.storage-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.73rem;
}

.storage-meter {
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--paper-deep);
}

.storage-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--navy);
  transition: width 240ms ease;
}

.import-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 14px;
  margin: 14px 0;
  border: 1px solid rgba(232, 95, 60, 0.18);
  border-radius: 14px;
  color: var(--accent-dark);
  background: rgba(232, 95, 60, 0.07);
  font-size: 0.84rem;
  font-weight: 700;
}

.import-progress[hidden] {
  display: none;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(232, 95, 60, 0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.track-list {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.bulk-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 12px;
  margin-top: 14px;
  border: 1px solid rgba(24, 48, 71, 0.14);
  border-radius: 14px;
  background: rgba(24, 48, 71, 0.06);
}

.bulk-bar[hidden] {
  display: none;
}

.bulk-bar strong {
  margin-right: auto;
  font-size: 0.76rem;
}

.bulk-bar button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 750;
}

.bulk-bar .danger-text {
  color: #ad382a;
}

.youtube-library[hidden],
#localLibraryContent[hidden] {
  display: none;
}

.youtube-library {
  margin-top: 18px;
}

.youtube-add-card {
  padding: 20px;
  border: 1px solid rgba(214, 48, 49, 0.14);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(255, 246, 242, 0.7));
}

.youtube-form-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.youtube-form-heading strong {
  display: block;
  margin-bottom: 3px;
  font-size: 0.94rem;
}

.youtube-form-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.73rem;
}

.youtube-logo {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  place-items: center;
  color: white;
  background: #d63031;
  box-shadow: 0 8px 20px rgba(214, 48, 49, 0.2);
}

.youtube-logo svg {
  width: 25px;
  height: 25px;
}

.youtube-form-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) 1fr 1fr auto;
  align-items: end;
  gap: 10px;
}

.youtube-form-grid .wide {
  grid-column: 1 / -1;
}

.youtube-form-grid label,
.collection-create-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.youtube-form-grid input,
.youtube-form-grid select,
.collection-create-form input,
.edit-fields select {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: white;
}

.youtube-form-grid input:focus,
.youtube-form-grid select:focus,
.collection-create-form input:focus,
.edit-fields select:focus {
  border-color: rgba(232, 95, 60, 0.7);
  box-shadow: 0 0 0 3px rgba(232, 95, 60, 0.1);
}

.youtube-policy-note {
  padding: 11px 13px;
  margin: 14px 0 0;
  border-radius: 11px;
  color: #786b66;
  background: rgba(214, 48, 49, 0.055);
  font-size: 0.68rem;
  line-height: 1.55;
}

.youtube-list {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.youtube-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 42px;
  align-items: center;
  min-height: 72px;
  border: 1px solid transparent;
  border-radius: 17px;
  transition: background 160ms ease, border 160ms ease;
}

.youtube-row:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.68);
}

.youtube-main {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 13px;
  padding: 8px;
  border: 0;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.youtube-row-art {
  display: grid;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 13px;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, #b91c1c, #ef4444);
  box-shadow: 0 8px 18px rgba(185, 28, 28, 0.16);
}

.youtube-row-art svg {
  width: 28px;
  height: 28px;
}

.youtube-history {
  color: var(--muted);
  font-size: 0.68rem;
  white-space: nowrap;
}

.compact-empty {
  padding-block: 40px;
}

.youtube-empty-art {
  color: #c93b35;
}

.track-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px 42px 42px 42px;
  align-items: center;
  min-height: 72px;
  border: 1px solid transparent;
  border-radius: 17px;
  transition: background 160ms ease, border 160ms ease, transform 160ms ease;
}

.track-select {
  display: none;
  width: 34px;
  height: 42px;
  place-items: center;
  cursor: pointer;
}

.track-select input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.track-select span {
  display: grid;
  width: 22px;
  height: 22px;
  border: 1.5px solid #a6aaa5;
  border-radius: 7px;
  place-items: center;
  background: white;
}

.track-select input:checked + span {
  border-color: var(--navy);
  background: var(--navy);
}

.track-select input:checked + span::after {
  width: 8px;
  height: 4px;
  border-bottom: 2px solid white;
  border-left: 2px solid white;
  content: "";
  transform: rotate(-45deg) translateY(-1px);
}

body.select-mode .track-row {
  grid-template-columns: 34px minmax(0, 1fr) 48px 42px 42px 42px;
}

body.select-mode .track-select {
  display: grid;
}

.track-row:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.68);
  transform: translateY(-1px);
}

.track-row.is-current {
  border-color: rgba(232, 95, 60, 0.16);
  background: rgba(232, 95, 60, 0.075);
}

.track-main {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 13px;
  padding: 7px 8px;
  border: 0;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.track-cover {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 54px;
  height: 54px;
  overflow: hidden;
  border-radius: 13px;
  color: rgba(255, 255, 255, 0.85);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.11), transparent),
    var(--navy);
}

.track-cover > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.track-cover > svg {
  width: 25px;
  height: 25px;
}

.track-copy {
  min-width: 0;
}

.track-copy strong,
.track-copy > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-copy strong {
  margin-bottom: 5px;
  font-size: 0.93rem;
}

.track-copy > span {
  color: var(--muted);
  font-size: 0.76rem;
}

.track-duration {
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}

.favorite-button,
.queue-add-button,
.more-button,
.icon-button,
.close-player {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.favorite-button svg,
.queue-add-button svg,
.more-button svg {
  width: 19px;
  height: 19px;
}

.queue-add-button {
  color: var(--muted);
}

.favorite-button {
  color: #a5a59d;
}

.favorite-button[aria-pressed="true"] {
  color: var(--gold);
}

.favorite-button[aria-pressed="true"] svg {
  fill: currentColor;
}

.more-button {
  color: var(--muted);
}

.favorite-button:hover,
.queue-add-button:hover,
.more-button:hover,
.icon-button:hover {
  background: rgba(27, 36, 48, 0.06);
}

.playing-bars {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: rgba(24, 48, 71, 0.78);
}

.track-row.is-playing .playing-bars {
  display: flex;
}

.playing-bars i {
  width: 3px;
  height: 18px;
  border-radius: 99px;
  background: var(--gold);
  animation: equalize 700ms ease-in-out infinite alternate;
}

.playing-bars i:nth-child(2) {
  height: 10px;
  animation-delay: -400ms;
}

.playing-bars i:nth-child(3) {
  height: 14px;
  animation-delay: -220ms;
}

@keyframes equalize {
  to {
    height: 6px;
  }
}

.empty-state {
  display: grid;
  justify-items: center;
  max-width: 420px;
  padding: clamp(48px, 10vh, 100px) 20px;
  margin: 0 auto;
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-art {
  width: 116px;
  height: 116px;
  margin-bottom: 24px;
  color: var(--navy);
  transform: rotate(-8deg);
}

.empty-art svg {
  width: 100%;
  height: 100%;
  stroke-width: 2.4;
}

.empty-state h2 {
  margin-bottom: 10px;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
}

.empty-state p {
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.7;
}

.player-panel {
  position: sticky;
  top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px;
  overflow: hidden;
}

.close-player {
  display: none;
}

.cover-button {
  width: min(100%, 280px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
  cursor: default;
}

.cover {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 24px;
  aspect-ratio: 1;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.12), transparent 42%),
    var(--navy);
  box-shadow: 0 20px 50px rgba(24, 48, 71, 0.22);
}

.cover::after {
  position: absolute;
  right: -18%;
  bottom: -28%;
  width: 70%;
  height: 70%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  content: "";
}

.cover > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--gold);
}

.cover-placeholder svg {
  width: 35%;
  height: 35%;
  stroke-width: 1.35;
}

.now-playing-copy {
  width: 100%;
  padding: 25px 4px 14px;
  text-align: center;
}

.now-playing-copy .eyebrow {
  margin-bottom: 10px;
}

.now-playing-copy h2,
.now-playing-copy p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.now-playing-copy h2 {
  margin-bottom: 6px;
  font-size: 1.18rem;
  letter-spacing: -0.04em;
}

.now-playing-copy p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.progress-block {
  width: 100%;
}

input[type="range"] {
  width: 100%;
  height: 24px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.time-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}

.primary-controls {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: 16px 0;
}

.icon-button svg {
  width: 22px;
  height: 22px;
}

.icon-button.small {
  width: 40px;
  height: 40px;
}

.transport-button {
  display: grid;
  min-width: 0;
  min-height: 58px;
  gap: 5px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 13px;
  place-items: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
}

.transport-button svg {
  width: 22px;
  height: 22px;
}

.transport-button > span:last-child {
  font-size: 0.62rem;
  font-weight: 750;
}

.transport-button:hover,
.transport-button.is-active {
  color: var(--accent);
  border-color: rgba(232, 95, 60, 0.22);
  background: rgba(232, 95, 60, 0.075);
}

.transport-button:disabled {
  cursor: default;
  opacity: 0.42;
}

.play-button,
.pause-button {
  color: white;
  background: var(--accent);
  box-shadow: 0 11px 28px rgba(232, 95, 60, 0.3);
  transition: transform 160ms ease, background 160ms ease;
}

.pause-button {
  background: var(--navy);
  box-shadow: 0 11px 28px rgba(24, 48, 71, 0.23);
}

.play-button:hover,
.play-button.is-active {
  background: var(--accent-dark);
  transform: scale(1.03);
}

.pause-button:hover,
.pause-button.is-active {
  color: white;
  border-color: var(--navy);
  background: #0d2438;
  transform: scale(1.03);
}

.play-button svg,
.pause-button svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
  stroke: none;
}

.secondary-controls {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.text-icon-button {
  display: grid;
  justify-items: center;
  min-height: 54px;
  gap: 4px;
  padding: 6px 2px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.text-icon-button:hover,
.text-icon-button[aria-pressed="true"],
.text-icon-button[data-mode="all"],
.text-icon-button[data-mode="one"] {
  color: var(--accent);
  background: rgba(232, 95, 60, 0.07);
}

.text-icon-button svg {
  width: 21px;
  height: 21px;
}

.text-icon-button span:last-child {
  font-size: 0.64rem;
  font-weight: 700;
}

.skip-icon {
  display: grid;
  width: 23px;
  height: 23px;
  border: 1.7px solid currentColor;
  border-left-color: transparent;
  border-radius: 50%;
  place-items: center;
  font-size: 0.52rem;
  font-weight: 800;
}

.skip-icon.forward {
  border-right-color: transparent;
  border-left-color: currentColor;
}

.repeat-one {
  display: none;
  fill: currentColor;
  stroke: none;
  font-size: 8px;
  font-weight: 800;
}

.text-icon-button[data-mode="one"] .repeat-one {
  display: block;
}

.player-options {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.player-shortcuts {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 12px;
}

.player-shortcuts button {
  display: grid;
  justify-items: center;
  min-height: 52px;
  gap: 4px;
  padding: 7px 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.56);
  cursor: pointer;
}

.player-shortcuts svg {
  width: 19px;
  height: 19px;
}

.player-shortcuts span {
  font-size: 0.64rem;
  font-weight: 750;
}

.player-shortcuts small {
  display: inline-grid;
  min-width: 17px;
  min-height: 17px;
  padding: 0 4px;
  border-radius: 99px;
  place-items: center;
  color: white;
  background: var(--accent);
  font-size: 0.57rem;
}

audio {
  display: none;
}

.player-options label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 700;
}

.player-options select {
  min-height: 42px;
  font-size: 0.77rem;
}

dialog {
  width: min(92vw, 480px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  color: var(--ink);
  background: transparent;
  box-shadow: var(--shadow);
  overflow-y: auto;
}

dialog.wide-dialog {
  width: min(94vw, 760px);
}

dialog::backdrop {
  background: rgba(24, 35, 45, 0.48);
  backdrop-filter: blur(6px);
}

.dialog-card {
  padding: 26px;
  background: #fffdf8;
}

.dialog-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
}

.dialog-heading h2 {
  margin-bottom: 22px;
  font-size: 1.55rem;
  letter-spacing: -0.045em;
}

.install-steps {
  display: grid;
  gap: 11px;
  padding: 0;
  margin: 0;
  list-style: none;
  counter-reset: install-step;
}

.install-steps li {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: start;
  gap: 10px;
  color: #454d53;
  line-height: 1.55;
  counter-increment: install-step;
}

.install-steps li::before {
  display: grid;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  place-items: center;
  color: white;
  background: var(--navy);
  content: counter(install-step);
  font-size: 0.74rem;
  font-weight: 800;
}

.dialog-note {
  padding: 13px 14px;
  margin: 20px 0 0;
  border-radius: 12px;
  color: var(--muted);
  background: var(--paper);
  font-size: 0.76rem;
  line-height: 1.55;
}

.dialog-install {
  width: 100%;
  margin-top: 14px;
  border: 0;
}

.full-button {
  width: 100%;
}

.dialog-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
}

.dialog-footer button {
  min-height: 42px;
  border-radius: 11px;
}

.tools-card,
.queue-card,
.cleanup-card {
  display: grid;
  gap: 14px;
}

.tools-card .dialog-heading h2,
.queue-card .dialog-heading h2,
.cleanup-card .dialog-heading h2 {
  margin-bottom: 0;
}

.tool-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}

.tool-section strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.86rem;
}

.tool-section p {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.55;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tool-actions button {
  min-height: 40px;
  padding-inline: 12px;
  border-radius: 11px;
  font-size: 0.72rem;
}

.tool-progress {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--accent-dark);
  background: rgba(232, 95, 60, 0.08);
  font-size: 0.72rem;
  font-weight: 700;
}

.tool-progress[hidden] {
  display: none;
}

.settings-grid {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.settings-grid > label:not(.toggle-setting) {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 750;
}

.settings-grid select,
.batch-form select {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: white;
}

.toggle-setting,
.accessibility-settings label {
  display: flex;
  align-items: center;
  min-height: 42px;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  font-size: 0.72rem;
  font-weight: 700;
}

.support-note {
  grid-column: 1 / -1;
}

.accessibility-settings {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.queue-list,
.bookmark-list {
  display: grid;
  gap: 7px;
  max-height: min(52vh, 480px);
  overflow-y: auto;
}

.queue-row,
.bookmark-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
}

.queue-row.dragging {
  opacity: 0.45;
}

.queue-handle {
  display: grid;
  width: 32px;
  height: 36px;
  border: 0;
  place-items: center;
  color: var(--muted);
  background: transparent;
  cursor: grab;
}

.queue-copy strong,
.queue-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-copy strong {
  font-size: 0.78rem;
}

.queue-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.66rem;
}

.queue-actions,
.bookmark-actions {
  display: flex;
  gap: 3px;
}

.queue-actions button,
.bookmark-actions button {
  min-width: 34px;
  min-height: 34px;
  border: 0;
  border-radius: 9px;
  background: white;
  cursor: pointer;
  font-size: 0.7rem;
}

.action-card {
  display: grid;
  gap: 12px;
}

.action-card .dialog-heading h2 {
  margin-bottom: 0;
}

.action-list {
  display: grid;
  gap: 7px;
}

.action-list button {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: left;
  background: var(--paper);
  cursor: pointer;
  font-weight: 720;
}

.bookmark-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.bookmark-main {
  padding: 4px;
  border: 0;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.bookmark-main strong,
.bookmark-main span {
  display: block;
}

.bookmark-main span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.68rem;
}

.rule-fieldset {
  display: grid;
  gap: 7px;
  padding: 0;
  border: 0;
}

.rule-fieldset legend {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
}

.rule-fieldset label {
  display: flex;
  align-items: center;
  min-height: 40px;
  gap: 8px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: var(--paper);
}

.cleanup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cleanup-card-item {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper);
}

.cleanup-card-item.wide {
  grid-column: 1 / -1;
}

.cleanup-card-item strong {
  display: block;
  margin-bottom: 8px;
  font-size: 0.83rem;
}

.cleanup-card-item p,
.cleanup-card-item li {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.55;
}

.cleanup-card-item ul {
  display: grid;
  gap: 5px;
  padding-left: 18px;
  margin: 0;
}

.one-hand-dock {
  display: none;
}

body.large-text {
  font-size: 118%;
}

body.high-contrast {
  --paper: #ffffff;
  --paper-deep: #e7e7e7;
  --card: #ffffff;
  --ink: #000000;
  --muted: #3d3d3d;
  --line: rgba(0, 0, 0, 0.28);
  --accent: #c92f0b;
  --accent-dark: #8f1d03;
  --navy: #001f3f;
}

body.high-contrast button:focus-visible,
body.high-contrast input:focus-visible,
body.high-contrast select:focus-visible {
  outline: 3px solid #005fcc;
  outline-offset: 2px;
}

body.car-mode .library-panel {
  display: none;
}

body.car-mode .main-layout {
  display: block;
  max-width: 720px;
  margin: 0 auto;
}

body.car-mode .player-panel {
  position: static;
  min-height: calc(100vh - 130px);
}

body.car-mode .primary-controls {
  gap: 30px;
}

body.car-mode .play-button {
  min-height: 86px;
}

body.car-mode .transport-button {
  min-height: 78px;
}

body.car-mode .secondary-controls,
body.car-mode .player-shortcuts {
  min-height: 74px;
}

.edit-form {
  display: grid;
  gap: 20px;
}

.edit-form .dialog-heading h2 {
  margin-bottom: 0;
}

.edit-artwork {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}

.edit-artwork img {
  width: 92px;
  height: 92px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(24, 48, 71, 0.15);
}

.edit-artwork strong,
.edit-artwork p {
  display: block;
}

.edit-artwork strong {
  font-size: 0.9rem;
}

.edit-artwork p {
  margin: 5px 0 11px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.5;
}

.quiet-button.compact {
  min-height: 34px;
  padding-inline: 12px;
  border-radius: 10px;
  font-size: 0.72rem;
}

.quiet-button.compact[hidden] {
  display: none;
}

.edit-fields {
  display: grid;
  gap: 13px;
}

.edit-fields label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
}

.edit-fields input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: white;
}

.playlist-fieldset {
  min-width: 0;
  padding: 0;
  border: 0;
}

.playlist-fieldset legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
}

.playlist-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.playlist-choice {
  position: relative;
  display: inline-flex;
}

.playlist-choice input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.playlist-choice span {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  background: white;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 700;
}

.playlist-choice input:checked + span {
  color: white;
  border-color: var(--navy);
  background: var(--navy);
}

.playlist-choice-empty {
  color: var(--muted);
  font-size: 0.72rem;
}

.collection-dialog-card {
  display: grid;
  gap: 18px;
}

.collection-dialog-card .dialog-heading h2 {
  margin-bottom: 0;
}

.collection-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.collection-create-form[hidden] {
  display: none;
}

.collection-manage-list {
  display: grid;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}

.collection-manage-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper);
}

.collection-manage-icon {
  display: grid;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  place-items: center;
  color: var(--navy);
  background: white;
}

.collection-manage-icon svg {
  width: 19px;
  height: 19px;
}

.collection-manage-copy strong,
.collection-manage-copy small {
  display: block;
}

.collection-manage-copy strong {
  font-size: 0.8rem;
}

.collection-manage-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.65rem;
}

.collection-remove {
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  color: #ad382a;
  background: rgba(183, 55, 41, 0.08);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 750;
}

.collection-manage-empty {
  padding: 28px 10px;
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.78rem;
}

.youtube-player-dialog {
  width: min(94vw, 760px);
  max-width: none;
}

.youtube-player-card {
  padding: 18px;
  background: #111;
}

.youtube-player-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 3px 3px 14px;
  color: white;
}

.youtube-player-heading .eyebrow {
  margin-bottom: 5px;
  color: #ff6b61;
}

.youtube-player-heading h2 {
  margin-bottom: 0;
  font-size: 1.08rem;
}

.youtube-player-heading .icon-button {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.youtube-frame-wrap {
  width: 100%;
  min-height: 200px;
  overflow: hidden;
  border-radius: 14px;
  aspect-ratio: 16 / 9;
  background: #000;
}

.youtube-frame-wrap iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 200px;
  border: 0;
}

.youtube-player-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 3px 2px;
  color: #aaa;
  font-size: 0.68rem;
}

.youtube-player-footer a {
  color: #ff8178;
  font-weight: 750;
  text-decoration: none;
}

.edit-fields input:focus {
  border-color: rgba(232, 95, 60, 0.7);
  box-shadow: 0 0 0 3px rgba(232, 95, 60, 0.1);
}

.edit-actions {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 9px;
}

.edit-actions button {
  min-height: 44px;
  border-radius: 12px;
}

.danger-button {
  padding: 0 14px;
  border: 1px solid rgba(183, 55, 41, 0.18);
  color: #ad382a;
  background: rgba(183, 55, 41, 0.07);
  cursor: pointer;
  font-weight: 750;
}

.danger-button:hover {
  background: rgba(183, 55, 41, 0.13);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 100;
  max-width: min(88vw, 460px);
  padding: 12px 17px;
  border-radius: 12px;
  color: white;
  background: rgba(24, 48, 71, 0.95);
  box-shadow: 0 12px 34px rgba(24, 48, 71, 0.25);
  font-size: 0.82rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 920px) {
  .app-shell {
    padding-inline: max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-left));
  }

  .main-layout {
    display: block;
    padding-bottom: 108px;
  }

  .library-panel {
    min-height: calc(100vh - 118px);
    padding: 24px;
  }

  .collection-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .collection-actions {
    align-self: flex-end;
  }

  .player-panel {
    position: fixed;
    top: auto;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    z-index: 20;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) 50px;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 19px;
  }

  .cover-button {
    width: 54px;
    border-radius: 13px;
    cursor: pointer;
  }

  .cover {
    border-radius: 13px;
  }

  .now-playing-copy {
    align-self: center;
    min-width: 0;
    padding: 0;
    text-align: left;
  }

  .now-playing-copy .eyebrow {
    display: none;
  }

  .now-playing-copy h2 {
    margin-bottom: 3px;
    font-size: 0.88rem;
  }

  .now-playing-copy p:last-child {
    font-size: 0.7rem;
  }

  .primary-controls {
    grid-template-columns: 1fr;
    margin: 0;
  }

  .primary-controls .transport-button {
    display: none;
  }

  .play-button {
    display: grid !important;
    width: 48px;
    min-height: 48px;
    border-radius: 50%;
  }

  .play-button svg {
    width: 21px;
    height: 21px;
  }

  .play-button > span {
    display: none;
  }

  .player-panel.is-playing:not(.expanded) .play-button {
    display: none !important;
  }

  .player-panel.is-playing:not(.expanded) .pause-button {
    display: grid;
    width: 48px;
    min-height: 48px;
    border-radius: 50%;
  }

  .player-panel.is-playing:not(.expanded) .pause-button > span {
    display: none;
  }

  .progress-block {
    position: absolute;
    right: 10px;
    bottom: 1px;
    left: 10px;
    width: auto;
  }

  .progress-block input {
    height: 8px;
  }

  .time-row,
  .secondary-controls,
  .player-options,
  .player-shortcuts,
  .close-player {
    display: none;
  }

  .player-panel.expanded {
    top: max(10px, env(safe-area-inset-top));
    bottom: max(10px, env(safe-area-inset-bottom));
    display: flex;
    padding: 24px;
    border-radius: 24px;
    overflow-y: auto;
  }

  .player-panel.expanded .close-player {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: grid;
    background: rgba(255, 255, 255, 0.75);
  }

  .player-panel.expanded .cover-button {
    width: min(56vh, 78vw, 410px);
    margin-top: 22px;
    cursor: default;
  }

  .player-panel.expanded .cover {
    border-radius: 22px;
  }

  .player-panel.expanded .now-playing-copy {
    align-self: auto;
    padding: 24px 4px 12px;
    text-align: center;
  }

  .player-panel.expanded .now-playing-copy .eyebrow,
  .player-panel.expanded .time-row,
  .player-panel.expanded .secondary-controls,
  .player-panel.expanded .player-shortcuts {
    display: flex;
  }

  .player-panel.expanded .now-playing-copy .eyebrow {
    display: block;
  }

  .player-panel.expanded .now-playing-copy h2 {
    margin-bottom: 6px;
    font-size: 1.12rem;
  }

  .player-panel.expanded .now-playing-copy p:last-child {
    font-size: 0.78rem;
  }

  .player-panel.expanded .progress-block {
    position: static;
    width: 100%;
  }

  .player-panel.expanded .progress-block input {
    height: 24px;
  }

  .player-panel.expanded .primary-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    margin: 14px 0;
  }

  .player-panel.expanded .primary-controls .transport-button {
    display: grid;
  }

  .player-panel.expanded .play-button {
    width: auto;
    min-height: 62px;
    border-radius: 13px;
  }

  .player-panel.expanded .play-button > span {
    display: block;
  }

  .player-panel.expanded .player-options {
    display: grid;
  }

  body.one-hand-mode .one-hand-dock {
    position: fixed;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(98px, calc(env(safe-area-inset-bottom) + 92px));
    left: max(12px, env(safe-area-inset-left));
    z-index: 19;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
  }

  .one-hand-dock button {
    min-height: 48px;
    padding: 4px;
    border: 0;
    border-radius: 11px;
    color: white;
    background: var(--navy);
    font-size: 0.66rem;
    font-weight: 750;
  }

  body.one-hand-mode .main-layout {
    padding-bottom: 178px;
  }

  body.car-mode .player-panel {
    position: fixed;
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    left: max(8px, env(safe-area-inset-left));
    z-index: 30;
    display: flex;
    min-height: 0;
    padding: 24px;
    overflow-y: auto;
  }

  body.car-mode .player-panel .cover-button {
    width: min(42vh, 72vw, 390px);
    margin-top: 12px;
  }

  body.car-mode .player-panel .now-playing-copy {
    padding: 18px 4px 10px;
    text-align: center;
  }

  body.car-mode .player-panel .progress-block {
    position: static;
    width: 100%;
  }

  body.car-mode .player-panel .progress-block input {
    height: 28px;
  }

  body.car-mode .player-panel .time-row,
  body.car-mode .player-panel .secondary-controls,
  body.car-mode .player-panel .player-shortcuts,
  body.car-mode .player-panel .player-options {
    display: grid;
  }

  body.car-mode .player-panel .time-row {
    display: flex;
  }

  body.car-mode .player-panel .primary-controls .transport-button {
    display: grid;
  }

  body.car-mode .player-panel .primary-controls {
    grid-template-columns: repeat(3, 1fr);
  }

  body.car-mode .player-panel .play-button,
  body.car-mode .player-panel .pause-button {
    display: grid !important;
    width: auto;
    border-radius: 13px;
  }

  body.car-mode .player-panel .play-button > span,
  body.car-mode .player-panel .pause-button > span {
    display: block;
  }

  body.car-mode .player-panel.is-playing:not(.expanded) .play-button {
    display: grid !important;
  }
}

@media (max-width: 600px) {
  .topbar {
    min-height: 80px;
  }

  .brand small,
  .quiet-button span,
  .import-button span {
    display: none;
  }

  .top-actions > .quiet-button,
  .top-actions > .import-button {
    width: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 13px;
  }

  .library-panel {
    padding: 20px 15px;
    border-radius: 20px;
  }

  .section-heading {
    align-items: center;
  }

  h1 {
    font-size: 1.72rem;
  }

  .library-summary {
    display: grid;
    justify-items: end;
    gap: 2px;
    font-size: 0.7rem;
  }

  .toolbar {
    grid-template-columns: 1fr;
    margin-top: 22px;
  }

  .toolbar-button {
    width: 100%;
  }

  .device-music-source {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .device-source-icon {
    width: 42px;
    height: 42px;
  }

  .device-source-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .library-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .library-tab {
    padding-inline: 8px;
  }

  .collection-actions {
    width: 100%;
  }

  .collection-action {
    flex: 1;
    padding-inline: 6px;
  }

  .collection-action.icon-only {
    flex: 0 0 40px;
  }

  .youtube-add-card {
    padding: 16px;
  }

  .youtube-form-grid {
    grid-template-columns: 1fr;
  }

  .youtube-form-grid .wide {
    grid-column: auto;
  }

  .youtube-row {
    grid-template-columns: minmax(0, 1fr) 40px;
  }

  .youtube-history {
    display: none;
  }

  .youtube-row-art {
    width: 49px;
    height: 49px;
  }

  .collection-create-form {
    grid-template-columns: 1fr;
  }

  .youtube-player-card {
    padding: 12px;
  }

  .youtube-player-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .track-row {
    grid-template-columns: minmax(0, 1fr) 40px 40px 40px;
    min-height: 67px;
  }

  body.select-mode .track-row {
    grid-template-columns: 32px minmax(0, 1fr) 40px 40px 40px;
  }

  .track-duration {
    display: none;
  }

  .track-cover {
    width: 49px;
    height: 49px;
  }

  .track-main {
    gap: 10px;
    padding-inline: 5px;
  }

  .track-copy strong {
    font-size: 0.86rem;
  }

  .edit-artwork {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .edit-artwork img {
    width: 76px;
    height: 76px;
    border-radius: 14px;
  }

  .edit-actions {
    grid-template-columns: 1fr 1fr;
  }

  .tool-section {
    grid-template-columns: 1fr;
  }

  .tool-actions,
  .settings-grid,
  .accessibility-settings {
    grid-column: 1;
  }

  .settings-grid,
  .accessibility-settings,
  .cleanup-grid {
    grid-template-columns: 1fr;
  }

  .cleanup-card-item.wide {
    grid-column: auto;
  }

  .tool-actions button {
    flex: 1;
  }

  .queue-row {
    grid-template-columns: 28px minmax(0, 1fr) auto;
  }

  body.large-text {
    font-size: 108%;
  }

  .edit-actions > span {
    display: none;
  }

  .danger-button {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .empty-state {
    padding-block: 54px;
  }
}

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