:root {
  color-scheme: dark;
  --bg: #0b1020;
  --bg-elevated: rgba(18, 24, 42, 0.82);
  --text: #f4f1ec;
  --text-muted: #a8b0c7;
  --accent: #8fd3c8;
  --accent-strong: #5ebfb2;
  --accent-warm: #f0b27a;
  --danger: #ff8f8f;
  --warn: #ffd28a;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius-xl: 28px;
  --radius-lg: 18px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Instrument Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  background: radial-gradient(circle at top, #172038 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* Decorative fixed ambients bleed past the edges; keep them from adding scroll. */
  overflow-x: hidden;
  /* Long backend-provided words (titles/messages) wrap instead of overflowing. */
  overflow-wrap: break-word;
}

.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;
}

.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

.ambient--one {
  width: 320px;
  height: 320px;
  top: -80px;
  right: -40px;
  background: #3d6c8d;
}

.ambient--two {
  width: 280px;
  height: 280px;
  bottom: 10%;
  left: -60px;
  background: #7a4d68;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 72px;
}

.wizard-steps {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.wizard-step {
  margin: 0;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.8rem;
}

.wizard-step.is-active {
  color: var(--accent);
  border-color: rgba(143, 211, 200, 0.4);
  background: rgba(143, 211, 200, 0.1);
}

.hero {
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.08;
  font-weight: 600;
}

.lede {
  margin: 0;
  max-width: 38rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero-highlights {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-highlights span {
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #d7e1ff;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.backend-status {
  margin: 18px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.backend-status[data-state="ok"] {
  color: #9fd9cf;
}

.backend-status[data-state="warn"] {
  color: var(--warn);
}

.voice-panel,
.result {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.voice-panel {
  padding: 26px;
  background:
    radial-gradient(
      120% 140% at 100% 0%,
      rgba(129, 74, 200, 0.17),
      transparent 62%
    ),
    var(--bg-elevated);
  box-shadow:
    0 18px 48px rgba(4, 10, 28, 0.36),
    0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

.voice-panel__top {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill[data-tone="active"] {
  color: var(--accent);
  background: rgba(143, 211, 200, 0.12);
}

.status-pill[data-tone="success"] {
  color: #b7f0c8;
  background: rgba(120, 220, 160, 0.12);
}

.status-pill[data-tone="warn"] {
  color: var(--warn);
  background: rgba(255, 210, 138, 0.12);
}

.mic-stage {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 10px 0 20px;
}

.timer-ring {
  width: 148px;
  height: 148px;
  transform: rotate(-90deg);
}

.timer-ring__track,
.timer-ring__progress {
  fill: none;
  stroke-width: 4;
}

.timer-ring__track {
  stroke: rgba(255, 255, 255, 0.08);
}

.timer-ring__progress {
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 339.292;
  transition: stroke-dashoffset 0.2s linear;
}

.mic-button {
  position: relative;
  width: 112px;
  height: 112px;
  margin-top: -130px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #0d1528;
  background: linear-gradient(145deg, #d7fff7, var(--accent));
  box-shadow:
    0 12px 40px rgba(94, 191, 178, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.mic-button:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
}

.mic-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.mic-button[data-state="recording"] {
  color: #fff;
  background: linear-gradient(145deg, #ff9d7a, #e85d4c);
  box-shadow: 0 12px 40px rgba(232, 93, 76, 0.4);
}

.mic-button[data-state="processing"] {
  background: linear-gradient(145deg, #d8e0ff, #9eb0ff);
}

.mic-button__pulse {
  position: absolute;
  inset: -10px;
  border-radius: inherit;
  border: 1px solid rgba(143, 211, 200, 0.35);
  opacity: 0;
}

.mic-button[data-state="recording"] .mic-button__pulse {
  opacity: 1;
  animation: pulse 1.4s ease-out infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0.92);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.18);
    opacity: 0;
  }
}

.mic-button__icon {
  width: 34px;
  height: 34px;
  fill: currentColor;
}

.mic-label,
.timer {
  margin: 0;
}

.mic-label {
  font-weight: 600;
}

.timer {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.timer-hint {
  margin: 0;
  max-width: 18rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.mic-stage[data-near-limit="true"] .timer-ring__progress {
  stroke: var(--warn);
}

.mic-stage[data-near-limit="true"] .timer,
.mic-stage[data-near-limit="true"] .timer-hint {
  color: #ffe6bf;
}

.notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: rgba(255, 210, 138, 0.1);
  color: #ffe6bf;
  font-size: 0.95rem;
}

.error-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: rgba(255, 143, 143, 0.12);
  color: #ffd5d5;
}

.error-banner p {
  margin: 0;
}

.review {
  margin-top: 8px;
}

.review__header h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.review__header p {
  margin: 0 0 14px;
  color: var(--text-muted);
}

.summary-preview {
  margin-bottom: 14px;
  padding: 16px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: linear-gradient(
    135deg,
    rgba(143, 211, 200, 0.11),
    rgba(95, 121, 255, 0.09)
  );
  transition: border-color 0.2s ease;
}

.summary-preview__label {
  margin: 0 0 6px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: #b4c3ee;
}

.summary-preview__text {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
}

.summary-preview__meta {
  margin: 8px 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.summary-preview[data-tone="processing"] {
  border-color: rgba(143, 211, 200, 0.35);
}

.summary-preview[data-tone="success"] {
  border-color: rgba(183, 240, 200, 0.35);
  background: linear-gradient(
    135deg,
    rgba(120, 220, 160, 0.11),
    rgba(143, 211, 200, 0.08)
  );
}

.summary-preview[data-tone="warn"] {
  border-color: rgba(255, 210, 138, 0.35);
  background: linear-gradient(
    135deg,
    rgba(255, 210, 138, 0.13),
    rgba(255, 143, 143, 0.08)
  );
}

.field textarea {
  width: 100%;
  min-height: 148px;
  resize: vertical;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(7, 10, 18, 0.55);
  color: var(--text);
  font: inherit;
  line-height: 1.55;
}

.field textarea:focus {
  outline: 2px solid rgba(143, 211, 200, 0.45);
  outline-offset: 2px;
}

.journey-controls {
  margin-top: 14px;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.journey-controls__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.journey-controls__label {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 500;
}

.journey-controls__value {
  margin: 0;
  font-weight: 600;
  color: var(--accent);
}

.duration-slider {
  width: 100%;
  margin: 10px 0 16px;
  accent-color: var(--accent);
  cursor: pointer;
}

.genre-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.genre-chip {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.86rem;
  line-height: 1;
  border-radius: 999px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.genre-chip:hover {
  border-color: rgba(143, 211, 200, 0.5);
  color: var(--text);
}

.genre-chip.is-selected {
  color: #0b1020;
  border-color: transparent;
  background: linear-gradient(145deg, #d7fff7, var(--accent));
  box-shadow: 0 6px 18px rgba(94, 191, 178, 0.25);
}

.review__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.char-count {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.char-count[data-state="low"] {
  color: var(--warn);
}

.char-count[data-state="ok"] {
  color: #9fd9cf;
}

.review__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button,
.ghost-button,
.text-button {
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease;
}

.primary-button {
  border: 0;
  padding: 12px 20px;
  font-weight: 600;
  color: #0b1020;
  background: linear-gradient(145deg, #fff4e8, var(--accent-warm));
  position: relative;
  overflow: hidden;
}

.ghost-button {
  border: 1px solid var(--border);
  padding: 11px 16px;
  color: var(--text);
  background: transparent;
}

.text-button {
  border: 0;
  padding: 0;
  color: #ffd5d5;
  background: transparent;
  white-space: nowrap;
}

.primary-button:hover:not(:disabled),
.ghost-button:hover:not(:disabled),
.text-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.ghost-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(11, 16, 32, 0.25);
  border-top-color: rgba(11, 16, 32, 0.9);
  animation: button-spin 0.7s linear infinite;
}

.primary-button[data-loading="true"] {
  pointer-events: none;
}

.primary-button[data-loading="true"] .button__spinner {
  display: inline-block;
  margin-left: 8px;
  vertical-align: middle;
}

.result {
  margin-top: 24px;
  padding: 28px 24px 32px;
}

.result__top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.result h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
}

.result__message {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.result__arc {
  margin: 0 0 20px;
  color: var(--text-muted);
}

.result__priority-note {
  margin: -6px 0 14px;
  color: #9fd9cf;
  font-size: 0.9rem;
}

.player-card {
  padding: 14px;
  border-radius: var(--radius-lg);
  background: radial-gradient(
      120% 120% at 100% 0%,
      rgba(129, 74, 200, 0.22),
      transparent 56%
    ),
    rgba(10, 14, 28, 0.75);
  border: 1px solid var(--border);
  margin-bottom: 18px;
}

.player-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.player-card__label {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.player-card__title {
  margin: 0;
  font-weight: 600;
  font-size: clamp(1.1rem, 2.8vw, 1.55rem);
  line-height: 1.25;
  color: #fff;
}

.player-card__priority {
  margin: 0;
  color: #c8d4f5;
  font-size: 0.98rem;
  font-weight: 600;
}

.player-card__identity {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 14px 10px;
  border-radius: 14px 14px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 0;
  background: rgba(255, 255, 255, 0.02);
}

.player-card__art {
  position: relative;
  overflow: hidden;
  width: 72px;
  height: 72px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background:
    radial-gradient(circle at 22% 20%, rgba(255, 255, 255, 0.3), transparent 50%),
    linear-gradient(145deg, rgba(70, 129, 255, 0.45), rgba(167, 76, 232, 0.48));
  display: grid;
  place-items: center;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.32);
}

.player-card__art span {
  color: #fff;
  font-weight: 800;
  font-size: 1.5rem;
}

.player-card__art-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-card__art-img[hidden] {
  display: none;
}

.player-card__art.has-cover span {
  display: none;
}

.player-card__meta {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.player-card__genre {
  margin: 0;
  display: inline-flex;
  width: fit-content;
  padding: 0.2rem 0.58rem;
  border-radius: 999px;
  border: 1px solid rgba(76, 227, 255, 0.26);
  background: rgba(76, 227, 255, 0.1);
  color: rgba(216, 247, 255, 0.94);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 700;
}

.player-card__main {
  display: flex;
  gap: 0;
  align-items: flex-start;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 0;
  border-radius: 0 0 14px 14px;
  background: rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.player-card__wave {
  flex: 1;
  min-width: 0;
  padding: 12px;
}

.waveform-bars {
  height: 88px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.45));
  display: grid;
  /* min 0 lets the 120 bars always fit the container (no clipping on phones). */
  grid-template-columns: repeat(120, minmax(0, 1fr));
  align-items: end;
  gap: 2px;
  padding: 8px;
  overflow: hidden;
}

.waveform-bar {
  width: 100%;
  height: calc(var(--h, 0.5) * 100%);
  min-height: 4px;
  border-radius: 999px;
  background: rgba(240, 240, 240, 0.88);
}

.waveform-bar.is-played {
  background: rgba(255, 132, 51, 0.95);
}

.player-card__time-row {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.time-pill {
  font-size: 0.86rem;
  font-weight: 700;
  color: rgba(76, 227, 255, 0.95);
  background: rgba(76, 227, 255, 0.1);
  border: 1px solid rgba(76, 227, 255, 0.22);
  padding: 0.18rem 0.42rem;
  border-radius: 8px;
}

.player-card__volume {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 12px 12px 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.volume-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  height: 100%;
  min-height: 168px;
}

.player-card__volume-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.72);
}

.player-card__volume-icon svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.volume-control__track {
  --volume-track-length: 130px;
  position: relative;
  flex: 1;
  width: 40px;
  height: var(--volume-track-length);
  min-height: var(--volume-track-length);
  touch-action: none;
  cursor: pointer;
  user-select: none;
}

.volume-control__fill {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 6px;
  height: var(--volume-fill, 80%);
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(
    180deg,
    rgba(223, 122, 254, 0.95),
    rgba(129, 74, 200, 0.95)
  );
  box-shadow: 0 0 10px rgba(129, 74, 200, 0.35);
  pointer-events: none;
}

.volume-control__track::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 6px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.player-range.player-range--volume {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: var(--volume-track-length);
  height: 32px;
  margin: 0;
  transform: translate(-50%, -50%) rotate(-90deg);
  transform-origin: center;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.player-range.player-range--volume::-webkit-slider-runnable-track {
  height: 6px;
  background: transparent;
  border: 0;
}

.player-range.player-range--volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -5px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(223, 122, 254, 0.95),
    rgba(129, 74, 200, 0.95)
  );
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.player-range.player-range--volume::-moz-range-track {
  height: 6px;
  background: transparent;
  border: 0;
}

.player-range.player-range--volume::-moz-range-progress {
  background: transparent;
}

.player-range.player-range--volume::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(223, 122, 254, 0.95),
    rgba(129, 74, 200, 0.95)
  );
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.player-range {
  --range-fill: 0%;
  --range-filled: rgba(76, 227, 255, 0.88);
  --range-track: rgba(255, 255, 255, 0.12);
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: transparent;
  outline: none;
}

.player-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    var(--range-filled) 0,
    var(--range-filled) var(--range-fill),
    var(--range-track) var(--range-fill),
    var(--range-track) 100%
  );
}

.player-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -5px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(223, 122, 254, 0.95),
    rgba(129, 74, 200, 0.95)
  );
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.player-range::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: var(--range-track);
}

.player-range::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--range-filled);
}

.player-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    rgba(223, 122, 254, 0.95),
    rgba(129, 74, 200, 0.95)
  );
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.player-range--progress {
  --range-filled: rgba(76, 227, 255, 0.88);
}

.player-range--volume {
  --range-filled: rgba(129, 74, 200, 0.9);
}

.player-audio-native {
  display: none;
}

audio {
  width: 100%;
}

.playlist-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 14px;
}

.playlist-head__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
}

.genre-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.genre-filter:empty {
  display: none;
}

.filter-chip {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.78rem;
  line-height: 1;
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.filter-chip:hover {
  color: var(--text);
  border-color: rgba(143, 211, 200, 0.5);
}

.filter-chip.is-active {
  color: #0b1020;
  border-color: transparent;
  background: linear-gradient(145deg, #d7fff7, var(--accent));
}

.track-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.track-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: stretch;
  gap: 14px;
  padding: 12px 14px 12px 12px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(12, 16, 30, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

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

.track-card__accent {
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: transparent;
  transition: background 0.2s ease;
}

.track-card:hover {
  border-color: rgba(143, 211, 200, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.track-card.is-active {
  border-color: rgba(143, 211, 200, 0.55);
  background:
    linear-gradient(135deg, rgba(143, 211, 200, 0.12), rgba(129, 74, 200, 0.06)),
    rgba(12, 18, 32, 0.72);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.32),
    0 0 0 1px rgba(143, 211, 200, 0.12) inset;
}

.track-card.is-active .track-card__accent {
  background: linear-gradient(180deg, var(--accent), rgba(129, 74, 200, 0.9));
}

.track-card__thumb {
  position: relative;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.2), transparent 55%),
    linear-gradient(145deg, rgba(70, 129, 255, 0.5), rgba(129, 74, 200, 0.55));
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.track-card__thumb-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.track-card__thumb.has-cover .track-card__thumb-fallback {
  display: none;
}

.track-card__thumb-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.35rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.92);
  pointer-events: none;
}

.track-card__play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(8, 12, 24, 0.55);
  backdrop-filter: blur(6px);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0.92;
  transition:
    transform 0.18s ease,
    opacity 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.track-card:hover .track-card__play,
.track-card.is-active .track-card__play {
  opacity: 1;
}

.track-card__play:hover {
  transform: scale(1.08);
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(143, 211, 200, 0.25);
}

.track-card__play:focus-visible {
  outline: 2px solid rgba(143, 211, 200, 0.65);
  outline-offset: 2px;
}

.track-card.is-active .track-card__play {
  border-color: transparent;
  background: linear-gradient(135deg, rgba(223, 122, 254, 0.95), rgba(129, 74, 200, 0.95));
  box-shadow: 0 4px 14px rgba(129, 74, 200, 0.45);
}

.track-card__play .icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  margin-left: 2px;
}

.track-card__play .icon-pause {
  display: none;
  margin-left: 0;
}

.track-card.is-active.is-playing .track-card__play .icon-play {
  display: none;
}

.track-card.is-active.is-playing .track-card__play .icon-pause {
  display: block;
}

.track-card__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 2px 0;
}

.track-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.track-card__rank {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(143, 211, 200, 0.95);
  background: rgba(143, 211, 200, 0.12);
  border: 1px solid rgba(143, 211, 200, 0.22);
  border-radius: 6px;
  padding: 3px 7px;
}

.track-card__title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #f4f6ff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-card__genre {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(216, 247, 255, 0.92);
  border: 1px solid rgba(76, 227, 255, 0.28);
  background: rgba(76, 227, 255, 0.08);
  border-radius: 999px;
  padding: 4px 8px;
}

.relax-chip {
  --relax: 0;
  width: 100%;
  padding: 8px 10px 9px;
  border-radius: 10px;
  border: 1px solid rgba(143, 211, 200, 0.14);
  background: linear-gradient(
    145deg,
    rgba(143, 211, 200, 0.08),
    rgba(129, 74, 200, 0.05)
  );
}

.relax-chip--high {
  border-color: rgba(143, 211, 200, 0.28);
  background: linear-gradient(
    145deg,
    rgba(143, 211, 200, 0.14),
    rgba(95, 121, 255, 0.06)
  );
}

.relax-chip--mid {
  border-color: rgba(129, 74, 200, 0.22);
}

.relax-chip--low {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.relax-chip--focus {
  border-color: rgba(76, 227, 255, 0.18);
  background: linear-gradient(
    145deg,
    rgba(76, 227, 255, 0.08),
    rgba(95, 121, 255, 0.05)
  );
}

.relax-chip--focus.relax-chip--high {
  border-color: rgba(76, 227, 255, 0.32);
  background: linear-gradient(
    145deg,
    rgba(76, 227, 255, 0.14),
    rgba(95, 121, 255, 0.08)
  );
}

.relax-chip--focus .relax-chip__icon {
  color: rgba(76, 227, 255, 0.9);
}

.relax-chip--focus .relax-chip__title {
  color: rgba(216, 247, 255, 0.95);
}

.relax-chip--focus .relax-chip__score {
  color: #d8f7ff;
}

.relax-chip--focus .relax-chip__fill {
  background: linear-gradient(
    90deg,
    rgba(95, 121, 255, 0.65),
    rgba(76, 227, 255, 0.95)
  );
  box-shadow: 0 0 10px rgba(76, 227, 255, 0.4);
}

.relax-chip--focus.relax-chip--mid .relax-chip__fill {
  background: linear-gradient(
    90deg,
    rgba(70, 129, 255, 0.55),
    rgba(76, 227, 255, 0.85)
  );
  box-shadow: 0 0 8px rgba(76, 227, 255, 0.3);
}

.relax-chip__head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
}

.relax-chip__icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: rgba(143, 211, 200, 0.85);
}

.relax-chip__icon svg {
  width: 16px;
  height: 16px;
}

.relax-chip--mid .relax-chip__icon {
  color: rgba(180, 150, 255, 0.9);
}

.relax-chip--low .relax-chip__icon {
  color: rgba(255, 255, 255, 0.4);
}

.relax-chip__copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.relax-chip__title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(232, 244, 241, 0.92);
}

.relax-chip__sub {
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.42);
}

.relax-chip__score {
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #dff8f2;
  line-height: 1;
}

.relax-chip__score small {
  font-size: 0.62rem;
  font-weight: 600;
  opacity: 0.75;
  margin-left: 1px;
}

.relax-chip--mid .relax-chip__score {
  color: #e8dcff;
}

.relax-chip--low .relax-chip__score {
  color: rgba(255, 255, 255, 0.55);
}

.relax-chip__track {
  position: relative;
  height: 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.relax-chip__fill {
  display: block;
  height: 100%;
  width: calc(var(--relax) * 1%);
  min-width: 4px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgba(95, 121, 255, 0.7),
    rgba(143, 211, 200, 0.95)
  );
  box-shadow: 0 0 10px rgba(143, 211, 200, 0.45);
  transition: width 0.4s ease;
}

.relax-chip--mid .relax-chip__fill {
  background: linear-gradient(
    90deg,
    rgba(129, 74, 200, 0.55),
    rgba(180, 130, 255, 0.9)
  );
  box-shadow: 0 0 8px rgba(129, 74, 200, 0.35);
}

.relax-chip--low .relax-chip__fill {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.45));
  box-shadow: none;
}

.disclaimer {
  margin: 20px 0 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.result__footer {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 18px -24px -32px;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: linear-gradient(180deg, rgba(10, 14, 28, 0), rgba(10, 14, 28, 0.92) 42%);
  backdrop-filter: blur(8px);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.result__count {
  margin-right: auto;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.result__done {
  min-width: 124px;
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 720px);
    padding-top: 24px;
  }

  .voice-panel,
  .result {
    border-radius: 22px;
  }

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

  .review__actions {
    flex-direction: column;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .result__count {
    display: none;
  }

  .result__done {
    flex: 1;
  }

  .waveform-bars {
    height: 72px;
    gap: 1px;
  }
}

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

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