:root {
  --bg: #06080c;
  --bg-2: #0b1118;
  --panel: rgba(12, 18, 28, 0.88);
  --panel-strong: rgba(10, 14, 22, 0.96);
  --ink: #f4f8f4;
  --muted: #9aa8b7;
  --muted-2: #6d7d8d;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #1ed760;
  --accent-2: #78f89a;
  --accent-3: #7c5cff;
  --good: #8ef7b1;
  --warn: #ffd479;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-width: thin;
  scrollbar-color: rgba(30, 215, 96, 0.55) rgba(255, 255, 255, 0.06);
}

body {
  margin: 0;
  color: var(--ink);
  font: 14px/1.45 "Segoe UI Variable Text", "Aptos", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at 12% -8%, rgba(30, 215, 96, 0.26), transparent 28%),
    radial-gradient(circle at 88% 0%, rgba(124, 92, 255, 0.19), transparent 24%),
    radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.035), transparent 36%),
    linear-gradient(180deg, #081018 0%, #05080d 58%, #04070b 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(125deg, rgba(255, 255, 255, 0.03), transparent 35%, transparent 64%, rgba(30, 215, 96, 0.04)),
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.02) 0,
      rgba(255, 255, 255, 0.02) 1px,
      transparent 1px,
      transparent 9px
    );
  opacity: 0.55;
}

a {
  color: inherit;
}

code {
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.shell {
  width: min(1040px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 36px;
  display: grid;
  gap: 14px;
}

.install-prompt {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(30, 215, 96, 0.18);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(14, 24, 20, 0.95), rgba(7, 14, 12, 0.98));
  box-shadow: var(--shadow);
}

.install-copy {
  display: grid;
  gap: 3px;
}

.install-copy strong {
  font-size: 15px;
}

.install-copy span {
  color: var(--muted);
  font-size: 13px;
}

.install-eyebrow {
  margin: 0;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 10px;
  font-weight: 700;
}

.install-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.hero,
.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero::before,
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.06), transparent 28%);
}

.hero {
  padding: 24px;
  background:
    radial-gradient(circle at top right, rgba(30, 215, 96, 0.24), transparent 34%),
    radial-gradient(circle at 18% 10%, rgba(124, 92, 255, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(19, 28, 42, 0.96), rgba(8, 12, 20, 0.98));
}

.card {
  padding: 18px;
  display: grid;
  gap: 12px;
  background: linear-gradient(180deg, rgba(14, 21, 31, 0.95), rgba(8, 12, 19, 0.96));
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 11px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
}

h1 {
  max-width: 520px;
  font-size: clamp(34px, 6vw, 54px);
  line-height: 0.94;
  letter-spacing: -0.04em;
}

h2 {
  font-size: 18px;
  line-height: 1.1;
}

.lede,
.hint {
  margin: 0;
  color: var(--muted);
}

.lede {
  max-width: 740px;
  margin-top: 12px;
  font-size: 15px;
}

.hero-actions,
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.hero-actions {
  margin-top: 18px;
}

.spread {
  justify-content: space-between;
}

.stack {
  display: grid;
  gap: 12px;
}

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

.scan-status {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(124, 92, 255, 0.18);
  background: linear-gradient(180deg, rgba(18, 20, 37, 0.92), rgba(11, 14, 24, 0.95));
}

.scan-status-copy {
  display: grid;
  gap: 2px;
}

.scan-status-copy strong {
  font-size: 13px;
}

.scan-status-copy span {
  color: var(--muted);
  font-size: 12px;
}

.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--accent);
  border-right-color: var(--accent-3);
  animation: spin 0.85s linear infinite;
  flex: 0 0 auto;
}

.guide {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.025));
  overflow: hidden;
}

.guide summary {
  cursor: pointer;
  list-style: none;
  padding: 13px 14px;
  font-weight: 700;
}

.guide summary::-webkit-details-marker {
  display: none;
}

.guide summary::after {
  content: "+";
  float: right;
  color: var(--accent-2);
  font-size: 16px;
  line-height: 1;
}

.guide[open] summary::after {
  content: "-";
}

.guide-body {
  padding: 0 14px 14px;
  display: grid;
  gap: 10px;
}

.guide-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.guide-list li + li {
  margin-top: 8px;
}

.inline-form {
  margin: 0;
}

label {
  display: grid;
  gap: 8px;
  color: #dce5ee;
  font-size: 12px;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.04));
  color: var(--ink);
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(30, 215, 96, 0.42);
  box-shadow: 0 0 0 4px rgba(30, 215, 96, 0.08);
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 3px),
    calc(100% - 14px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.button {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  min-height: 42px;
  background: linear-gradient(135deg, var(--accent) 0%, #33e275 52%, var(--accent-2) 100%);
  color: #041107;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 10px 28px rgba(30, 215, 96, 0.24);
}

.button.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  box-shadow: none;
}

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

.badge {
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.06);
}

.badge.connected {
  color: var(--good);
  border-color: rgba(30, 215, 96, 0.18);
  background: rgba(30, 215, 96, 0.1);
}

.badge.working {
  color: #a5ccff;
  border-color: rgba(124, 92, 255, 0.22);
  background: rgba(124, 92, 255, 0.12);
}

.badge.warning {
  color: var(--warn);
  border-color: rgba(255, 212, 121, 0.18);
  background: rgba(255, 212, 121, 0.08);
}

.flash {
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid transparent;
}

.flash.success {
  background: rgba(30, 215, 96, 0.1);
  border-color: rgba(30, 215, 96, 0.18);
}

.flash.error {
  background: rgba(255, 116, 116, 0.12);
  border-color: rgba(255, 116, 116, 0.22);
}

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

.playlist-fields .full {
  grid-column: 1 / -1;
}

.checkbox {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
}

.checkbox input {
  width: auto;
  min-height: auto;
  accent-color: var(--accent);
}

.results {
  max-height: 560px;
  overflow: auto;
  display: grid;
  gap: 9px;
  padding-right: 2px;
}

.result {
  display: block;
  padding: 11px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(180deg, rgba(255,255,255,.055), rgba(255,255,255,.025));
}

.result-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.result-main {
  display: flex;
  gap: 11px;
  min-width: 0;
}

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

.result-cover {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.07);
  flex: 0 0 auto;
}

.result-cover-placeholder {
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 20%, rgba(30, 215, 96, 0.32), transparent 50%), linear-gradient(135deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  color: #e5fff0;
  font-size: 18px;
}

.result-code {
  margin-bottom: 4px;
  color: var(--muted-2);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.result-title {
  font-weight: 800;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.result-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 7px;
}

.result-match {
  margin-top: 9px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.05);
  background: linear-gradient(180deg, rgba(6, 12, 18, 0.78), rgba(9, 14, 24, 0.92));
}

.result-match-line {
  font-weight: 800;
  overflow-wrap: anywhere;
}

.result-match-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.result input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-height: auto;
  accent-color: var(--accent);
}

.small-link {
  display: inline-block;
  margin-top: 8px;
  color: #8feab0;
  text-decoration: none;
  font-size: 12px;
}

.spotify-link {
  margin-right: 10px;
}

body::-webkit-scrollbar,
.results::-webkit-scrollbar {
  width: 10px;
}

body::-webkit-scrollbar-track,
.results::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
}

body::-webkit-scrollbar-thumb,
.results::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 2px solid transparent;
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.85), rgba(30, 215, 96, 0.95)) padding-box;
}

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

@media (max-width: 760px) {
  .shell {
    width: min(100% - 20px, 1040px);
    padding-top: 12px;
  }

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

  .install-actions {
    width: 100%;
  }

  .install-actions .button {
    flex: 1 1 0;
  }

  .hero,
  .card {
    border-radius: 20px;
  }

  .hero,
  .card {
    padding: 16px;
  }

  .playlist-fields {
    grid-template-columns: 1fr;
  }
}
