@font-face {
  font-family: "TSPureBlack";
  src: url("/TSPureBlack.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #08080f;
  --surface: #101019;
  --surface-2: #151323;
  --surface-purple: #1c1231;
  --line: #292837;
  --line-strong: #3d315d;
  --text: #f1eff6;
  --muted: #9d99ab;
  --purple: #9b6cff;
  --purple-light: #bd9aff;
  --green: #20e2a1;
  --danger: #ff8c9b;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.35);
  font-family: "TSPureBlack", "Apple SD Gothic Neo", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 16%, rgba(85, 41, 147, 0.18), transparent 28%),
    radial-gradient(circle at 86% 32%, rgba(54, 24, 97, 0.13), transparent 30%),
    var(--bg);
  padding-bottom: 150px;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.site-header {
  min-height: 94px;
  padding: 18px clamp(20px, 4vw, 58px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: rgba(8, 8, 15, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
}

.brand-mark {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  border-radius: 15px;
  object-fit: cover;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.32);
}

.brand-product {
  color: #efedf4;
  font-size: clamp(29px, 3.2vw, 43px);
  font-weight: 400;
  line-height: 0.86;
  letter-spacing: 0;
  transform: translateY(4px);
}

.brand-signature {
  color: #f0ad45;
  font-size: clamp(15px, 1.6vw, 20px);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: 0.01em;
  align-self: flex-end;
  transform: translateY(-8px);
}

.brand-admin {
  padding: 5px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--purple-light);
  font-size: 10px;
  letter-spacing: 0.1em;
}

.connection-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #c8c5d0;
  font-size: 17px;
  white-space: nowrap;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #777381;
  box-shadow: 0 0 0 transparent;
}

.connection-badge.is-connected .status-dot {
  background: var(--green);
  box-shadow: 0 0 16px rgba(32, 226, 161, 0.9);
}

.connection-badge.is-demo .status-dot {
  background: #f0ad45;
  box-shadow: 0 0 16px rgba(240, 173, 69, 0.55);
}

.tab-bar {
  height: 88px;
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 8, 15, 0.94);
  scrollbar-width: none;
  position: sticky;
  top: 0;
  z-index: 20;
}

.tab-bar::-webkit-scrollbar {
  display: none;
}

.tab-button {
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #cac7d1;
  letter-spacing: 0.04em;
  font-size: clamp(17px, 1.3vw, 25px);
  font-weight: 700;
  cursor: pointer;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.tab-button:hover,
.tab-button:focus-visible {
  color: var(--purple-light);
  background: rgba(155, 108, 255, 0.05);
  outline: 0;
}

.tab-button.is-active {
  color: var(--purple-light);
  border-bottom-color: var(--purple);
  text-shadow: 0 0 18px rgba(155, 108, 255, 0.7);
}

main {
  width: min(1480px, calc(100% - 36px));
  margin: 0 auto;
}

.ai-setup-notice {
  margin-top: 20px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid rgba(240, 173, 69, 0.36);
  border-radius: 18px;
  background:
    linear-gradient(120deg, rgba(83, 54, 22, 0.4), rgba(28, 20, 39, 0.9)),
    var(--surface);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.22);
}

.ai-setup-notice[hidden] {
  display: none;
}

.ai-setup-copy {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.ai-setup-symbol {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #f5c46f;
  background: rgba(240, 173, 69, 0.13);
  font-size: 18px;
}

.ai-setup-copy strong {
  display: block;
  color: #f8e5bd;
  font-size: 15px;
}

.ai-setup-copy p {
  margin: 5px 0 0;
  color: #b9ac9f;
  font-size: 13px;
  line-height: 1.65;
}

.ai-admin-link {
  min-height: 42px;
  padding: 0 16px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(240, 173, 69, 0.5);
  border-radius: 12px;
  color: #f5c46f;
  background: rgba(240, 173, 69, 0.08);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.ai-admin-link:hover,
.ai-admin-link:focus-visible {
  border-color: #f0ad45;
  background: rgba(240, 173, 69, 0.15);
  outline: 0;
}

.tab-panel {
  display: none;
  padding: 22px 0 60px;
  animation: panel-in 220ms ease;
}

.tab-panel.is-active {
  display: block;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero-card,
.score-card,
.profile-hero,
.lyrics-heading,
.work-hero {
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(125deg, rgba(28, 18, 49, 0.94), rgba(15, 15, 24, 0.96)),
    var(--surface);
  box-shadow: var(--shadow);
}

.hero-card {
  min-height: 420px;
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(260px, 400px) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  overflow: hidden;
}

.hero-art-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-height: 400px;
}

.hero-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 1px solid #35313f;
  border-radius: 16px;
  background: #0d0d15;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}

.source-pill,
.mini-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--purple-light);
  background: rgba(18, 15, 29, 0.88);
  letter-spacing: 0.08em;
}

.source-pill {
  position: absolute;
  top: 14px;
  right: 14px;
  min-height: 34px;
  padding: 0 14px;
  font-size: 11px;
}

.mini-badge {
  min-height: 30px;
  padding: 0 12px;
  font-size: 11px;
}

.eyebrow,
.section-label {
  color: var(--purple-light);
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 700;
}

.hero-copy {
  min-width: 0;
  width: 100%;
}

.hero-topline {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.hero-topline .eyebrow {
  margin: 0;
}

.zone-picker {
  position: relative;
  flex: 0 0 auto;
}

.zone-button {
  min-width: 210px;
  min-height: 66px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  border: 1px solid #373344;
  border-radius: 14px;
  color: #dedbe5;
  background: rgba(13, 13, 21, 0.76);
  cursor: pointer;
  text-align: left;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.zone-button:hover,
.zone-button:focus-visible,
.zone-button[aria-expanded="true"] {
  border-color: #654a94;
  background: rgba(25, 20, 38, 0.96);
  outline: 0;
}

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

.zone-device-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  opacity: 0.9;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35));
}

.zone-button-copy {
  min-width: 0;
}

.zone-button-copy small,
.zone-button-copy strong {
  display: block;
}

.zone-button-copy small {
  margin-bottom: 4px;
  color: #777181;
  font-size: 8px;
  letter-spacing: 0.16em;
}

.zone-button-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}

.zone-button-copy strong::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: #777381;
  vertical-align: 1px;
}

.zone-button.is-connected .zone-button-copy strong::before {
  background: var(--green);
  box-shadow: 0 0 12px rgba(32, 226, 161, 0.85);
}

.zone-chevron {
  color: #8a8493;
  font-size: 18px;
  transition: transform 160ms ease;
}

.zone-button[aria-expanded="true"] .zone-chevron {
  transform: rotate(180deg);
}

.zone-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 50;
  width: min(390px, calc(100vw - 48px));
  padding: 17px;
  border: 1px solid #3b354b;
  border-radius: 17px;
  background: rgba(15, 15, 24, 0.98);
  box-shadow: 0 24px 75px rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(24px);
}

.zone-menu-heading {
  padding: 2px 2px 13px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #2b2935;
}

.zone-menu-heading strong,
.zone-menu-heading small {
  display: block;
}

.zone-menu-heading strong {
  color: #8c8597;
  font-size: 10px;
  letter-spacing: 0.16em;
}

.zone-menu-heading small {
  margin-top: 5px;
  color: #645f6d;
  font-size: 10px;
}

.zone-close {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: #8f8998;
  background: #201e29;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.zone-close:hover,
.zone-close:focus-visible {
  color: #fff;
  background: #302b3d;
  outline: 0;
}

.zone-options {
  max-height: 310px;
  padding-top: 9px;
  display: grid;
  gap: 5px;
  overflow-y: auto;
}

.zone-option {
  width: 100%;
  min-height: 58px;
  padding: 10px 11px;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #d7d3dc;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.zone-option:hover,
.zone-option:focus-visible {
  border-color: #3f3652;
  background: #1a1823;
  outline: 0;
}

.zone-option.is-selected {
  border-color: #4d3a6a;
  background: linear-gradient(90deg, rgba(155, 108, 255, 0.13), transparent);
}

.zone-option:disabled {
  cursor: wait;
  opacity: 0.56;
}

.zone-state-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6f6a77;
}

.zone-option.is-playing .zone-state-dot {
  background: var(--green);
  box-shadow: 0 0 13px rgba(32, 226, 161, 0.8);
}

.zone-option-copy {
  min-width: 0;
}

.zone-option-copy strong,
.zone-option-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zone-option-copy strong {
  font-size: 13px;
}

.zone-option-copy small {
  margin-top: 4px;
  color: #77717f;
  font-size: 10px;
}

.zone-check {
  min-width: 18px;
  color: var(--purple-light);
  text-align: center;
}

.zone-empty {
  padding: 24px 12px;
  color: #817b89;
  text-align: center;
  font-size: 12px;
  line-height: 1.7;
}

.zone-save-state {
  min-height: 15px;
  margin: 7px 2px 0;
  color: #8b8594;
  font-size: 10px;
}

.zone-save-state.is-error {
  color: var(--danger);
}

.hero-copy h1,
.score-card h1,
.profile-hero h1,
.lyrics-heading h1,
.work-hero h1 {
  margin: 12px 0 14px;
  font-size: clamp(34px, 5vw, 70px);
  line-height: 1.06;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.hero-copy h1 {
  font-size: clamp(30px, 4vw, 60px);
}

.hero-artist {
  margin: 0 0 8px;
  color: #e4e1e9;
  font-size: clamp(18px, 2.2vw, 27px);
}

.hero-album {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

.progress-block {
  margin-top: 42px;
}

.progress-labels,
.footer-time {
  display: flex;
  justify-content: space-between;
  color: #807b8e;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 4px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #353342;
}

.progress-value {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7848df, #b47fff);
  box-shadow: 0 0 12px rgba(155, 108, 255, 0.6);
  transition: width 400ms linear;
}

.content-grid {
  margin-top: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

#panel-home.is-active {
  display: grid;
  gap: 22px;
}

.content-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(24px, 4vw, 46px);
  background:
    linear-gradient(135deg, rgba(18, 17, 29, 0.96), rgba(13, 13, 20, 0.98)),
    var(--surface);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
}

.content-card-wide {
  grid-column: 1 / -1;
  border-top-color: #473269;
}

.content-card h2 {
  margin: 14px 0 22px;
  font-size: clamp(25px, 3vw, 38px);
  letter-spacing: -0.025em;
}

.prose {
  color: #c3bfca;
  font-size: clamp(15px, 1.65vw, 19px);
  line-height: 1.9;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.card-footer {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #6f6a7b;
  font-size: 10px;
  letter-spacing: 0.14em;
}

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

.history-list {
  display: grid;
  gap: 12px;
}

.history-item {
  min-width: 0;
  padding: 12px 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  border-bottom: 1px solid #23222d;
}

.history-item:last-child {
  border: 0;
}

.history-index {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--purple-light);
  background: rgba(155, 108, 255, 0.11);
  font-size: 11px;
}

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

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

.history-copy span,
.history-time {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.score-card,
.profile-hero,
.lyrics-heading {
  min-height: 220px;
  margin-bottom: 18px;
  padding: clamp(28px, 5vw, 54px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.lyrics-guide-card {
  padding: clamp(22px, 2.5vw, 30px);
  display: grid;
  grid-template-columns: minmax(210px, 0.32fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(22px, 4vw, 58px);
  border-color: rgba(155, 108, 255, 0.34);
  background:
    radial-gradient(circle at 88% 18%, rgba(155, 108, 255, 0.11), transparent 35%),
    rgba(16, 16, 25, 0.96);
}

.lyrics-guide-card h2 {
  margin-bottom: 0;
  font-size: clamp(22px, 2.5vw, 32px);
}

.lyrics-guide-card .prose {
  padding-top: 2px;
}

.score-card h1,
.profile-hero h1,
.lyrics-heading h1 {
  font-size: clamp(36px, 5vw, 62px);
}

.score {
  min-width: 180px;
  text-align: right;
  color: var(--purple-light);
}

.score > span {
  display: block;
  margin-bottom: 8px;
  color: #aaa1b8;
  font-size: 11px;
  letter-spacing: 0.16em;
}

.score strong {
  font-size: clamp(58px, 8vw, 92px);
  font-weight: 300;
  line-height: 1;
}

.score small {
  color: #817890;
  font-size: 16px;
}

#panel-album,
#panel-artists,
#panel-composer,
#panel-lyrics,
#panel-works {
  display: none;
}

#panel-album.is-active,
#panel-artists.is-active,
#panel-composer.is-active,
#panel-lyrics.is-active,
#panel-works.is-active {
  display: grid;
  gap: 18px;
}

.radar-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.radar-legend {
  color: var(--muted);
  font-size: 12px;
}

.radar-legend i {
  display: inline-block;
  width: 24px;
  height: 3px;
  margin-right: 8px;
  vertical-align: middle;
  border-radius: 3px;
  background: var(--purple);
}

#radar-chart {
  display: block;
  width: min(100%, 840px);
  max-width: 100%;
  height: auto;
  margin: 16px auto 0;
}

.home-current-lyric-card {
  position: relative;
  top: auto;
  z-index: 1;
  margin: 0;
  padding: clamp(22px, 3vw, 34px);
  background:
    radial-gradient(circle at 86% 24%, rgba(155, 108, 255, 0.2), transparent 36%),
    linear-gradient(125deg, rgba(19, 15, 31, 0.98), rgba(30, 20, 50, 0.96));
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.25);
}

.home-current-lyric-card > strong {
  font-size: clamp(24px, 2.7vw, 38px);
}

.home-current-lyric-card > p {
  font-size: clamp(17px, 1.8vw, 23px);
}

.profile-hero {
  display: block;
  background:
    radial-gradient(circle at 80% 20%, rgba(155, 108, 255, 0.22), transparent 33%),
    linear-gradient(125deg, #181126, #0f0f18);
}

.composer-hero {
  background:
    radial-gradient(circle at 80% 20%, rgba(233, 164, 85, 0.16), transparent 33%),
    linear-gradient(125deg, #1b1422, #0f0f18);
}

.lyrics-heading {
  background:
    radial-gradient(circle at 78% 20%, rgba(91, 57, 151, 0.25), transparent 35%),
    linear-gradient(125deg, #15101f, #0e0e17);
}

.lyrics-list {
  display: grid;
  gap: 0;
}

.lyrics-timing-note {
  margin: 0 0 14px;
  padding: 14px 16px;
  color: #b8afc7;
  border: 1px solid rgba(155, 108, 255, 0.28);
  border-radius: 12px;
  background: rgba(155, 108, 255, 0.07);
  font-size: 14px;
  line-height: 1.65;
}

.current-lyric-card {
  position: sticky;
  top: 86px;
  z-index: 12;
  margin: 0 0 22px;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid rgba(155, 108, 255, 0.55);
  border-radius: 18px;
  background:
    radial-gradient(circle at 86% 24%, rgba(155, 108, 255, 0.18), transparent 35%),
    rgba(19, 15, 31, 0.96);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
}

.current-lyric-card[hidden] {
  display: none;
}

.current-lyric-meta {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--purple-light);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.current-lyric-meta time {
  color: #80778e;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.current-lyric-card > strong {
  display: block;
  color: #fff;
  font-size: clamp(22px, 3.2vw, 42px);
  line-height: 1.35;
  text-shadow: 0 0 26px rgba(155, 108, 255, 0.22);
}

.current-lyric-card > p {
  margin: 10px 0 0;
  color: var(--purple-light);
  font-size: clamp(16px, 2vw, 24px);
  line-height: 1.55;
}

.lyric-line {
  position: relative;
  padding: 19px 22px;
  border-left: 2px solid transparent;
  border-bottom: 1px solid #24222d;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    opacity 180ms ease;
}

.lyric-line:last-child {
  border-bottom: 0;
}

.lyric-original {
  display: block;
  color: #dbd7e1;
  font-size: clamp(16px, 2vw, 22px);
  line-height: 1.55;
}

.lyric-korean {
  display: block;
  margin-top: 7px;
  color: #8e889b;
  font-size: clamp(14px, 1.6vw, 18px);
  line-height: 1.55;
}

.lyric-time {
  position: absolute;
  top: 22px;
  right: 20px;
  color: #625c6d;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.lyric-line.is-active {
  border-left-color: var(--purple);
  background: linear-gradient(90deg, rgba(155, 108, 255, 0.16), transparent);
}

.lyric-line.is-active .lyric-original {
  color: #fff;
  text-shadow: 0 0 20px rgba(155, 108, 255, 0.34);
}

.lyric-line.is-active .lyric-korean {
  color: var(--purple-light);
}

.empty-state {
  min-height: 150px;
  padding: 30px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
  border: 1px dashed #302e3c;
  border-radius: 15px;
  line-height: 1.8;
}

.work-hero {
  min-height: 350px;
  padding: clamp(30px, 5vw, 60px);
  background:
    radial-gradient(circle at 82% 26%, rgba(234, 169, 85, 0.25), transparent 6%),
    radial-gradient(circle at 82% 26%, rgba(155, 76, 84, 0.24), transparent 24%),
    linear-gradient(120deg, #421a22, #2c1621 58%, #1b1320);
}

.work-hero h1 {
  max-width: 1000px;
  color: #f5d48d;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.02em;
}

.work-hero > p:last-child {
  color: #c8a987;
}

.error-banner {
  position: fixed;
  right: 18px;
  bottom: 124px;
  z-index: 40;
  max-width: min(520px, calc(100% - 36px));
  padding: 14px 18px;
  border: 1px solid rgba(255, 140, 155, 0.4);
  border-radius: 13px;
  color: #ffdce1;
  background: rgba(73, 24, 35, 0.95);
  box-shadow: var(--shadow);
  font-size: 13px;
}

.now-playing-bar {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 14px;
  z-index: 30;
  min-height: 104px;
  padding: 12px 20px;
  display: grid;
  grid-template-columns:
    76px minmax(180px, 1fr) minmax(220px, 1.7fr) minmax(255px, auto);
  align-items: center;
  gap: 18px;
  border: 1px solid #343141;
  border-radius: 18px;
  background: rgba(13, 13, 21, 0.94);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(22px);
}

.now-playing-bar img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 10px;
  background: #15141e;
}

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

.footer-track > * {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer-track strong {
  margin: 5px 0;
  font-size: 15px;
}

.footer-track > span:last-child {
  color: var(--muted);
  font-size: 12px;
}

.footer-zone {
  color: var(--purple-light);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.footer-controls {
  min-width: 255px;
  display: grid;
  grid-template-columns: minmax(90px, auto) auto;
  align-items: center;
  justify-content: end;
  gap: 7px 15px;
}

.footer-device {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.footer-device > span:last-child {
  min-width: 0;
}

.footer-device small,
.footer-device strong {
  display: block;
}

.footer-device small {
  color: #686270;
  font-size: 7px;
  letter-spacing: 0.12em;
}

.footer-device strong {
  max-width: 112px;
  margin-top: 4px;
  overflow: hidden;
  color: #c8c4ce;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.footer-device-icon {
  flex: 0 0 auto;
  width: 34px !important;
  height: 34px !important;
  object-fit: contain !important;
  border-radius: 0 !important;
  background: transparent !important;
  opacity: 0.82;
}

.transport-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.transport-button {
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  color: #d7d2df;
  background: transparent;
  cursor: pointer;
  transition:
    color 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    transform 140ms ease;
}

.transport-button:hover:not(:disabled),
.transport-button:focus-visible:not(:disabled) {
  color: white;
  outline: 0;
  transform: scale(1.06);
}

.transport-button:disabled {
  color: #4f4b57;
  cursor: not-allowed;
}

.transport-skip {
  width: 34px;
  height: 40px;
  font-size: 11px;
}

.transport-playpause {
  width: 52px;
  height: 52px;
  border: 1px solid var(--purple);
  border-radius: 50%;
  color: var(--purple-light);
  background: rgba(20, 16, 30, 0.8);
  box-shadow: 0 0 0 rgba(155, 108, 255, 0);
  font-size: 16px;
}

.transport-playpause:hover:not(:disabled),
.transport-playpause:focus-visible:not(:disabled) {
  border-color: var(--purple-light);
  background: rgba(155, 108, 255, 0.12);
  box-shadow: 0 0 22px rgba(155, 108, 255, 0.16);
}

.transport-playpause:disabled {
  border-color: #423b4d;
}

.control-state {
  grid-column: 1 / -1;
  overflow: hidden;
  color: #6f6878;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 7px;
  letter-spacing: 0.08em;
}

@media (max-width: 820px) {
  body {
    padding-bottom: 126px;
  }

  .site-header {
    min-height: 74px;
    padding: 13px 16px;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 12px;
  }

  .brand-product {
    font-size: 27px;
    transform: translateY(3px);
  }

  .brand-signature {
    font-size: 12px;
    transform: translateY(-6px);
  }

  .connection-badge {
    font-size: 13px;
  }

  .tab-bar {
    height: 66px;
    grid-template-columns: repeat(6, minmax(108px, 1fr));
  }

  .tab-button {
    font-size: 14px;
    font-weight: 700;
  }

  main {
    width: min(100% - 22px, 1480px);
  }

  .ai-setup-notice {
    margin-top: 12px;
    padding: 15px;
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    border-radius: 15px;
  }

  .ai-admin-link {
    width: 100%;
  }

  .tab-panel {
    padding-top: 12px;
  }

  .hero-card {
    min-height: auto;
    padding: 12px;
    grid-template-columns: 115px minmax(0, 1fr);
    gap: 16px;
    border-radius: 17px;
  }

  .hero-art-wrap {
    max-height: none;
  }

  .hero-art {
    border-radius: 10px;
  }

  .eyebrow {
    margin: 0 0 5px;
    font-size: 9px;
  }

  .hero-topline {
    align-items: flex-start;
  }

  .zone-button {
    min-width: 0;
    min-height: 34px;
    padding: 5px 7px;
    grid-template-columns: 17px minmax(0, 1fr) 11px;
    gap: 6px;
    border-radius: 9px;
  }

  .zone-device-icon {
    width: 18px;
    height: 18px;
  }

  .zone-button-copy small {
    display: none;
  }

  .zone-button-copy strong {
    max-width: 86px;
    font-size: 9px;
  }

  .zone-button-copy strong::before {
    width: 5px;
    height: 5px;
    margin-right: 5px;
  }

  .zone-chevron {
    font-size: 12px;
  }

  .zone-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    width: min(390px, calc(100vw - 28px));
    max-height: min(560px, calc(100vh - 48px));
    transform: translate(-50%, -50%);
  }

  .hero-copy h1 {
    margin: 0 0 6px;
    font-size: clamp(20px, 6vw, 30px);
  }

  .hero-artist {
    font-size: 14px;
  }

  .hero-album {
    display: -webkit-box;
    overflow: hidden;
    font-size: 11px;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .progress-block {
    margin-top: 14px;
  }

  .content-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 0;
  }

  #panel-home.is-active {
    gap: 12px;
  }

  .content-card {
    padding: 23px 20px;
    border-radius: 17px;
  }

  .content-card h2 {
    margin: 10px 0 14px;
  }

  .prose {
    line-height: 1.8;
  }

  .score-card,
  .profile-hero,
  .lyrics-heading {
    min-height: 170px;
    padding: 24px 20px;
    border-radius: 17px;
  }

  .lyrics-guide-card {
    display: block;
  }

  .lyrics-guide-card .prose {
    margin-top: 12px;
  }

  .score-card h1,
  .profile-hero h1,
  .lyrics-heading h1 {
    font-size: clamp(28px, 8vw, 40px);
  }

  .score {
    min-width: 100px;
  }

  .score strong {
    font-size: 56px;
  }

  .radar-heading {
    display: block;
  }

  .radar-legend {
    margin-top: 12px;
  }

  /*
   * The radar canvas used to measure the card's border box, including its
   * horizontal padding. On narrow Samsung/Android viewports that made the
   * Album panel wider than the page and mobile browsers auto-fitted the whole
   * desktop-sized document. Keep these guards scoped to mobile so the desktop
   * Album layout is unchanged.
   */
  #panel-album.is-active {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  #panel-album > .score-card,
  #panel-album > .content-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  #panel-album > .score-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
  }

  #panel-album > .score-card > :first-child {
    min-width: 0;
  }

  #panel-album .radar-card {
    overflow: hidden;
  }

  #panel-album #radar-chart {
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
  }

  .work-hero {
    min-height: 260px;
    border-radius: 17px;
  }

  .work-hero h1 {
    font-size: clamp(34px, 10vw, 55px);
  }

  .lyric-line {
    padding: 16px 6px 16px 15px;
  }

  .current-lyric-card {
    top: 70px;
    margin-bottom: 14px;
    padding: 18px;
    border-radius: 14px;
  }

  .home-current-lyric-card {
    position: relative;
    top: auto;
    margin: 0;
  }

  .lyric-time {
    display: none;
  }

  .now-playing-bar {
    left: 8px;
    right: 8px;
    bottom: 8px;
    min-height: 88px;
    padding: 9px;
    grid-template-columns: 60px minmax(0, 1fr) 142px;
    gap: 10px;
    border-radius: 14px;
  }

  .now-playing-bar img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
  }

  .footer-progress-wrap {
    position: absolute;
    left: 79px;
    right: 161px;
    bottom: 9px;
  }

  .footer-time {
    display: none;
  }

  .footer-controls {
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .footer-device {
    justify-content: center;
  }

  .footer-device-icon {
    width: 23px !important;
    height: 23px !important;
  }

  .footer-device small {
    display: none;
  }

  .footer-device strong {
    max-width: 93px;
    margin: 0;
    font-size: 8px;
  }

  .transport-buttons {
    gap: 3px;
  }

  .transport-skip {
    width: 29px;
    height: 34px;
    font-size: 9px;
  }

  .transport-playpause {
    width: 38px;
    height: 38px;
    font-size: 13px;
  }

  .control-state {
    display: none;
  }
}

@media (max-width: 480px) {
  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .brand-product {
    font-size: 22px;
    letter-spacing: 0;
    transform: translateY(2px);
  }

  .brand-signature {
    display: inline;
    font-size: 10px;
    transform: translateY(-5px);
  }

  .brand-admin {
    display: none;
  }

  #connection-text {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .now-playing-bar {
    grid-template-columns: 52px minmax(0, 1fr) 126px;
  }

  .hero-card {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .now-playing-bar img {
    width: 52px;
    height: 52px;
  }

  .footer-progress-wrap {
    left: 70px;
    right: 143px;
  }

  .hero-copy h1 {
    font-size: 20px;
  }

  .score-card {
    align-items: flex-start;
  }

  .score {
    min-width: 74px;
  }

  .score strong {
    font-size: 44px;
  }
}
