:root {
  --accent: #0F6E56;
  --accent-hover: #0b5c48;
  --accent-soft: #E1F5EE;
  --accent-ink: #085041;
  --bg: #F6F6F3;
  --surface: #FFFFFF;
  --ink: #17181A;
  --ink-2: #4E5154;
  --ink-3: #6E7175;
  --line: #E6E6E1;
  --line-2: #CFCFC8;
  --danger-bg: #FCEEEC;
  --danger-ink: #8E2626;
  --radius: 12px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #1D9E75;
    --accent-hover: #23b386;
    --accent-soft: #0b3b31;
    --accent-ink: #9FE1CB;
    --bg: #0F1011;
    --surface: #18191B;
    --ink: #F2F2EF;
    --ink-2: #C3C4C0;
    --ink-3: #9A9C98;
    --line: #2A2C2E;
    --line-2: #3A3D40;
    --danger-bg: #3a1514;
    --danger-ink: #F4A9A6;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
[hidden] { display: none !important; }
a { color: var(--accent); }

.top {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}
.brand {
  max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
}
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
}
.brand-logo { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; }
.brand-name { font-weight: 600; font-size: 15px; letter-spacing: -0.2px; }

.wrap {
  width: 100%; max-width: 560px; margin: 0 auto;
  padding: 24px 16px 32px;
  display: flex; flex-direction: column; gap: 16px;
  flex: 1;
}
.hero { display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.pill {
  align-self: flex-start;
  font-size: 12px; padding: 3px 10px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent-ink);
}
h1 { margin: 0; font-size: 26px; line-height: 1.2; letter-spacing: -0.5px; font-weight: 650; }
.lead { margin: 0; color: var(--ink-2); font-size: 15px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 0; }
.field {
  display: flex; align-items: center; gap: 8px;
  border: 1.5px solid var(--line-2); border-radius: var(--radius);
  padding: 0 6px 0 12px; background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.field-icon { color: var(--ink-3); flex: none; }
.field input {
  flex: 1; min-width: 0; height: 48px; border: 0; outline: 0; background: transparent;
  color: var(--ink); font: inherit; font-size: 16px;
}
.field input::placeholder { color: var(--ink-3); }
.icon-btn {
  flex: none; width: 40px; height: 40px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink-3); display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { background: var(--bg); color: var(--ink); }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 18px; border-radius: var(--radius);
  border: 0; background: var(--accent); color: #fff;
  font: inherit; font-size: 15.5px; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .15s, transform .08s;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(.99); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line-2); font-weight: 500; }
.btn.ghost:hover { background: var(--bg); }
.btn:focus-visible, .icon-btn:focus-visible, .link-btn:focus-visible, .opt:focus-within {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.spin {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.note { margin: 0; text-align: center; font-size: 12.5px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; justify-content: center; }
.ts:empty { display: none; }
.ts { display: flex; justify-content: center; }

.alert {
  border-radius: var(--radius); padding: 12px 14px;
  background: var(--danger-bg); color: var(--danger-ink); font-size: 14px;
}

.result { gap: 14px; }
.song { display: flex; gap: 14px; align-items: center; }
.cover {
  width: 84px; height: 84px; flex: none; border-radius: 10px; overflow: hidden;
  background: var(--bg); color: var(--ink-3); display: grid; place-items: center;
  border: 1px solid var(--line);
}
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.song-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.song-title { margin: 0; font-size: 16px; line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }
.song-artist { margin: 0; font-size: 14px; color: var(--ink-2); }
.song-meta { margin: 0; font-size: 12.5px; color: var(--ink-3); }

.formats { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.format-list { display: flex; flex-direction: column; gap: 8px; }
.opt {
  display: flex; align-items: center; gap: 10px;
  min-height: 46px; padding: 8px 12px; border-radius: 10px;
  border: 1.5px solid var(--line-2); cursor: pointer; font-size: 14px; color: var(--ink-2);
  transition: border-color .15s, background .15s;
}
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt .dot {
  width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-2); flex: none;
  display: grid; place-items: center;
}
.opt .name { flex: 1; }
.opt .size { color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.opt.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.opt.on .dot { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--accent-soft); }
.opt.on .size { color: var(--accent-ink); }
.formats[disabled] .opt { cursor: default; opacity: .65; }

.prog { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.prog-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 500; }
.prog-pct { color: var(--accent); font-variant-numeric: tabular-nums; }
.bar { height: 6px; border-radius: 6px; background: var(--bg); overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--accent); border-radius: 6px; transition: width .6s ease; }
.bar-fill.busy { width: 35% !important; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(290%); } }
.prog-detail { margin: 0; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.fine { margin: 0; font-size: 12.5px; color: var(--ink-3); text-align: center; }
.link-btn {
  align-self: center; background: none; border: 0; color: var(--accent);
  font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; padding: 8px 10px; border-radius: 8px;
}
.link-btn:hover { text-decoration: underline; }

.how { padding: 4px 2px; }
.how-title { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
.how ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.how li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.how li span {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 12px; color: var(--ink-2);
}

.ad { display: flex; justify-content: center; overflow: hidden; }

.foot {
  border-top: 1px solid var(--line); background: var(--surface);
  padding: 14px 16px; text-align: center; font-size: 12.5px; color: var(--ink-3);
}

@media (min-width: 640px) {
  .wrap { padding-top: 48px; gap: 18px; }
  h1 { font-size: 32px; }
  .card { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
