:root {
  color-scheme: dark;
  --bg: #101111;
  --panel: #151717;
  --panel-raised: #1b1e1e;
  --line: #282c2b;
  --line-soft: #202323;
  --text: #f1f3f0;
  --muted: #909894;
  --quiet: #646d69;
  --accent: #c6f36a;
  --accent-strong: #b5e850;
  --warning: #efbb73;
  --danger: #fa817d;
  --header-height: 76px;
  --player-height: 112px;
  font-family: 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  min-width: 760px;
  overflow: hidden;
}

body {
  background: var(--bg);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

.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 {
  min-height: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at 75% 45%, rgba(94, 119, 56, .055), transparent 40%), var(--bg);
}

.topbar {
  height: var(--header-height);
  flex: 0 0 var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 34px;
  border-bottom: 1px solid var(--line-soft);
  gap: 32px;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-family: 'Segoe UI', sans-serif;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
}

.button {
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 10px 15px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

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

.button-primary {
  color: #171b12;
  background: var(--accent);
}

.button-primary:hover {
  background: var(--accent-strong);
}

.button-primary svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.4;
}

.button-secondary {
  background: var(--panel-raised);
  border-color: #343a36;
  color: var(--text);
}

.button-secondary:hover {
  border-color: #576147;
}

.workspace {
  min-height: 0;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(440px, 45%) 1fr;
}

.playlist-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line-soft);
  padding: 31px 28px 20px 34px;
}

.panel-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px 19px;
}

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

h1 {
  font-family: 'Segoe UI', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.04em;
  margin: 0;
}

.track-count {
  color: var(--muted);
  font-size: 11px;
  padding-bottom: 3px;
}

.playlist-toolbar {
  height: 42px;
  flex: 0 0 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--quiet);
  font-size: 10px;
}

.text-button {
  background: transparent;
  border: 0;
  padding: 5px 0 5px 8px;
  color: var(--quiet);
  font-size: 10px;
  cursor: pointer;
}

.text-button:hover,
.text-button.active {
  color: var(--accent);
}

.track-list-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-color: #3b423c transparent;
  scrollbar-width: thin;
}

.track-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.track-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg);
}

.track-table th {
  height: 35px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-weight: 500;
}

.track-table th:nth-child(1) {
  width: 28px;
}

.track-table th:nth-child(2) {
  width: 33%;
}

.track-table th:nth-child(3) {
  width: 24%;
}

.track-table th.album-col {
  width: 23%;
}

.track-table th.duration-col {
  width: 63px;
}

.track-table th.remove-col {
  width: 30px;
}

.sort-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  padding: 0 5px 0 0;
  color: #777f7a;
  cursor: pointer;
  text-align: left;
  font-size: 9px;
  font-weight: 600;
}

.sort-button:hover,
.sort-button[aria-sort="ascending"],
.sort-button[aria-sort="descending"] {
  color: var(--accent);
}

.sort-indicator {
  font-size: 9px;
}

.track-row {
  height: 58px;
  border-bottom: 1px solid #202322;
  cursor: pointer;
  transition: background .14s ease;
}

.track-row:hover {
  background: rgba(255, 255, 255, .025);
}

.track-row.is-current {
  background: rgba(198, 243, 106, .055);
}

.track-row.is-current td:first-child::before {
  content: '';
  display: inline-block;
  width: 2px;
  height: 20px;
  margin-left: -12px;
  margin-right: 10px;
  vertical-align: middle;
  background: var(--accent);
  border-radius: 4px;
}

.track-row.is-dragging {
  opacity: .38;
}

.track-row.drop-before td {
  box-shadow: inset 0 2px 0 var(--accent);
}

.track-row.drop-after td {
  box-shadow: inset 0 -2px 0 var(--accent);
}

.track-row td {
  padding-right: 10px;
  color: var(--muted);
  font-size: 11px;
}

.track-row td:not(.title-cell) {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.track-row td:first-child {
  padding-left: 5px;
  color: #69716c;
  font-size: 10px;
}

.track-row.is-current td:first-child {
  color: var(--accent);
}

.track-row td.title-cell {
  color: #e0e4df;
  font-size: 11px;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.track-row.is-current td.title-cell {
  color: var(--accent);
}

.track-row .duration-cell {
  color: #7c8580;
  font-variant-numeric: tabular-nums;
}

.track-row .meta-pending {
  color: #656d68;
  font-style: italic;
}

.remove-track {
  width: 25px;
  height: 25px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  color: #69716c;
  background: transparent;
  cursor: pointer;
  opacity: 0;
}

.track-row:hover .remove-track,
.remove-track:focus-visible {
  opacity: 1;
}

.remove-track:hover {
  color: var(--danger);
  background: rgba(250, 129, 125, .1);
}

.remove-track svg {
  width: 14px;
  height: 14px;
}

.grab-handle {
  display: inline-block;
  color: #57605a;
  cursor: grab;
  font-size: 13px;
  letter-spacing: -3px;
  margin-right: 3px;
  vertical-align: 1px;
}

.grab-handle:active {
  cursor: grabbing;
}

.empty-state {
  position: absolute;
  inset: 40px 0 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 24px;
}

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

.empty-disc {
  width: 54px;
  height: 54px;
  border: 1px solid #333a34;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: radial-gradient(circle, #2b3321 0, #191d19 68%);
  font-size: 23px;
  margin-bottom: 17px;
}

.empty-state h2 {
  margin-bottom: 7px;
  font-family: 'Segoe UI', sans-serif;
  font-size: 15px;
}

.empty-state p {
  max-width: 220px;
  margin: 0 0 15px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.empty-state .button {
  padding: 8px 12px;
  font-size: 10px;
}

.now-playing {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px;
}

.now-playing-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: min(100%, 700px);
}

.current-title {
  max-width: 100%;
  overflow-wrap: anywhere;
  margin: 0 0 8px;
  font-family: 'Segoe UI', sans-serif;
  font-size: clamp(21px, 2.3vw, 30px);
  font-weight: 700;
  letter-spacing: -.03em;
}

.current-artist {
  max-width: 100%;
  overflow-wrap: anywhere;
  margin: 0;
  color: #a5ada7;
  font-size: 13px;
}

.now-album {
  max-width: 100%;
  overflow-wrap: anywhere;
  margin: 9px 0 0;
  color: #69736b;
  font-size: 11px;
}

.player-bar {
  height: var(--player-height);
  flex: 0 0 var(--player-height);
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(360px, 1.5fr) minmax(180px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 0 34px;
  border-top: 1px solid #303431;
  background: rgba(19, 21, 21, .97);
  box-shadow: 0 -16px 45px rgba(0, 0, 0, .13);
}

.bar-track-info {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mini-art {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--accent);
  background: radial-gradient(circle at 45% 42%, #33412a, #1b211a 72%);
  font-family: Georgia, serif;
  font-size: 20px;
}

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

.bar-track-title,
.bar-track-artist {
  max-width: 220px;
  overflow-wrap: anywhere;
}

.bar-track-title {
  color: #e8ebe6;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 5px;
}

.bar-track-artist {
  color: var(--muted);
  font-size: 10px;
}

.playback-center {
  min-width: 0;
  width: 100%;
  max-width: 540px;
  justify-self: center;
}

.transport-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 21px;
  height: 43px;
  margin-bottom: 12px;
}

.icon-button,
.play-button {
  display: inline-grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  border: 0;
  background: transparent;
}

.icon-button {
  width: 27px;
  height: 27px;
  color: #a4aca6;
  position: relative;
}

.icon-button:hover {
  color: var(--text);
}

.icon-button:disabled {
  opacity: .35;
  cursor: default;
}

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

.mode-button {
  color: #79827b;
}

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

.mode-button:disabled {
  color: #565d58;
  opacity: .45;
}

.repeat-one {
  opacity: 0;
  transition: opacity .15s ease;
}

#repeat-button[aria-pressed="true"] .repeat-one {
  opacity: 1;
}

.play-button {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #151912;
  background: var(--accent);
  transition: transform .15s ease, background .15s ease;
}

.play-button:hover {
  transform: scale(1.06);
  background: var(--accent-strong);
}

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

.play-button .pause-icon {
  display: none;
}

.play-button.is-playing .play-icon {
  display: none;
}

.play-button.is-playing .pause-icon {
  display: block;
}

.progress-row {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) 35px;
  align-items: center;
  gap: 10px;
}

.time-label {
  color: #838b85;
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.range {
  appearance: none;
  height: 4px;
  border-radius: 6px;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--range-progress, 0%), #39403b var(--range-progress, 0%), #39403b 100%);
  cursor: pointer;
}

.range::-webkit-slider-thumb {
  appearance: none;
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(198, 243, 106, .12);
}

.range::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(198, 243, 106, .12);
}

.range:disabled {
  cursor: default;
  opacity: .45;
}

.volume-control {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 12px;
  width: min(100%, 190px);
  color: #8f9891;
}

.volume-control svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
}

.volume-range {
  width: 100%;
}

.toast-region {
  position: fixed;
  z-index: 10;
  right: 26px;
  bottom: calc(var(--player-height) + 22px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: 380px;
  padding: 12px 15px;
  border: 1px solid #454a42;
  border-radius: 7px;
  color: #e9ece7;
  background: #202421;
  box-shadow: 0 14px 35px rgba(0, 0, 0, .35);
  font-size: 11px;
  animation: toast-in .2s ease-out;
}

.toast.warning {
  border-color: rgba(239, 187, 115, .5);
  color: #f2d3a7;
}

.toast.error {
  border-color: rgba(250, 129, 125, .5);
  color: #ffc0bd;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.is-drag-over::after {
  content: 'Перетащите аудиофайлы сюда';
  position: fixed;
  z-index: 20;
  inset: 12px;
  display: grid;
  place-items: center;
  border: 2px dashed var(--accent);
  border-radius: 14px;
  color: var(--accent);
  background: rgba(16, 17, 17, .93);
  font-family: 'Segoe UI', sans-serif;
  font-size: 20px;
  font-weight: 700;
  pointer-events: none;
}

@media (max-width: 1050px) {
  :root {
    --player-height: 106px;
  }

  .topbar {
    padding-inline: 24px;
    gap: 20px;
  }

  .playlist-panel {
    padding-left: 24px;
    padding-right: 19px;
  }

  .workspace {
    grid-template-columns: minmax(420px, 49%) 1fr;
  }

  .player-bar {
    grid-template-columns: minmax(140px, .8fr) minmax(330px, 1.5fr) minmax(130px, .8fr);
    gap: 15px;
    padding-inline: 22px;
  }

  .transport-controls {
    gap: 15px;
  }
}

@media (max-height: 680px) {
  :root {
    --header-height: 64px;
    --player-height: 96px;
  }

  .playlist-panel {
    padding-top: 20px;
  }
}
