:root {
  color-scheme: light;
  font-family: "Segoe UI", "Noto Sans", sans-serif;
  background: #f2f5fb;
  color: #172033;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(74, 123, 255, 0.10), transparent 32%),
    linear-gradient(180deg, #f7f9fd 0%, #edf2fb 100%);
}

code {
  font-family: "Cascadia Code", "SFMono-Regular", monospace;
}

.app-shell {
  display: grid;
  gap: 20px;
  padding: 24px;
  height: 100vh;
  overflow: hidden;
}

.picker-hint {
  margin: -8px 4px 0;
  color: #5e6b85;
}

.toolbar,
.track-pane,
.player-pane {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(23, 32, 51, 0.08);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
}

.toolbar__group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar__meta {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.toolbar__group > button,
.track-list__item {
  border: none;
  border-radius: 999px;
  background: #1e4ed8;
  color: #fff;
  cursor: pointer;
  font: inherit;
  padding: 10px 16px;
}

.toolbar__group > button[disabled] {
  background: #96a2bc;
  cursor: not-allowed;
}

.locale-switcher {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(23, 32, 51, 0.06);
}

.locale-switcher__button {
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #5e6b85;
  cursor: pointer;
  font: inherit;
  padding: 8px 12px;
  transition: background-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.locale-switcher__button.is-active,
.locale-switcher__button[aria-pressed="true"] {
  background: #fff;
  color: #16338f;
  box-shadow: 0 8px 18px rgba(23, 32, 51, 0.10);
}

.workspace {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(280px, 340px) 1fr;
  min-height: 0;
  align-items: stretch;
}

.track-pane,
.player-pane {
  padding: 20px;
  min-height: 0;
  min-width: 0;
}

.track-pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pane-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 18px;
}

.pane-heading h1,
.pane-heading h2,
.pane-heading p {
  margin: 0;
}

.pane-heading p {
  color: #5e6b85;
}

.track-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  min-height: 0;
  flex: 1 1 auto;
  padding-right: 6px;
}

.track-list__item {
  flex: 0 0 auto;
  justify-content: flex-start;
  text-align: left;
}

.track-list__item.is-selected {
  background: #16338f;
}

.track-list__item.is-current {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.68);
}

.track-list__empty {
  margin: 0;
  color: #5e6b85;
}

.player-pane {
  display: grid;
  gap: 18px;
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.player-pane__current,
.player-pane__time {
  margin: 0;
}

.player-pane audio {
  width: 100%;
}

.player-meta,
.metrics-panel ul {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.player-meta p,
.metrics-panel li {
  margin: 0;
}

.player-meta {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(23, 32, 51, 0.04);
}

.player-meta p {
  display: grid;
  gap: 4px;
}

.meta-label {
  color: #5e6b85;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metrics-panel {
  padding: 16px;
  border-radius: 16px;
  background: rgba(23, 32, 51, 0.04);
}

.metrics-panel h3 {
  margin: 0 0 12px 0;
}

.doc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.doc-links a {
  color: #16338f;
  text-decoration: none;
  font-weight: 600;
}

body[data-page-type="docs"] {
  height: auto;
  min-height: 100vh;
  overflow: auto;
}

.docs-shell {
  max-width: 980px;
  margin: 0 auto;
  display: grid;
  gap: 20px;
  padding: 24px;
  min-height: 100vh;
}

.docs-header,
.docs-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(23, 32, 51, 0.08);
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(23, 32, 51, 0.08);
}

.docs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
}

.docs-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.docs-back {
  color: #16338f;
  text-decoration: none;
  font-weight: 700;
}

.docs-repo {
  color: #16338f;
  text-decoration: none;
  font-weight: 600;
}

.docs-panel {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.docs-panel[hidden] {
  display: none;
}

.docs-panel h1,
.docs-panel h2,
.docs-panel p {
  margin: 0;
}

.docs-panel p,
.docs-panel li {
  color: #31405f;
  line-height: 1.7;
}

.docs-panel ul,
.docs-panel ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.docs-panel pre {
  margin: 0;
  overflow-x: auto;
  padding: 16px 18px;
  border-radius: 16px;
  background: #172033;
  color: #eff4ff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.docs-panel code {
  font-family: "Cascadia Code", "SFMono-Regular", monospace;
}

.docs-panel a {
  color: #16338f;
}

@media (max-width: 900px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .track-list {
    max-height: 240px;
    flex: none;
  }

  .player-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .toolbar__meta {
    justify-items: start;
  }

  .docs-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .docs-header__actions {
    justify-content: flex-start;
  }
}
