/* Sonara web app — one dark surface, one orange mark, nothing else. */
:root {
  --bg: #0d100d;
  --bg-soft: #141814;
  --card: #171c17;
  --stroke: rgba(255, 255, 255, .09);
  --text: #f3f5f0;
  --muted: #9aa79a;
  --accent: #DCF4CA;
  --accent-ink: #10140f;
  --brand: #F26419;
  --radius: 22px;
  --tabbar: 74px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; }
.app { min-height: 100%; display: flex; flex-direction: column; }
main { flex: 1; padding: calc(env(safe-area-inset-top) + 14px) 18px calc(var(--tabbar) + 96px); }
.screen[hidden] { display: none; }

/* brand */
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.brand svg { width: 34px; height: 34px; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: .34em; text-transform: uppercase; }

h1 { font-size: 30px; line-height: 1.1; letter-spacing: -.02em; margin: 0 0 18px; }
h2 { font-size: 16px; margin: 26px 0 12px; letter-spacing: -.01em; }
p.lede { color: var(--muted); margin: -8px 0 18px; font-size: 14px; line-height: 1.5; }

/* hero */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius);
  padding: 20px; margin-bottom: 10px;
  background:
    radial-gradient(90% 110% at 88% 0%, color-mix(in srgb, var(--accent) 38%, transparent) 0%, transparent 62%),
    linear-gradient(160deg, #1b2318 0%, #10140f 72%);
  border: 1px solid var(--stroke);
}
.hero .kicker { font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.hero .headline { font-size: 26px; font-weight: 700; line-height: 1.12; letter-spacing: -.02em; max-width: 80%; }
.hero .headline em { font-style: normal; color: var(--accent); }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: var(--accent-ink);
  border-radius: 999px; padding: 11px 20px; font-weight: 650; font-size: 15px;
}
.hero .pill { margin-top: 18px; }
.pill:disabled { opacity: .5; }

/* search */
.searchbar { display: flex; align-items: center; gap: 10px; background: var(--bg-soft); border: 1px solid var(--stroke); border-radius: 999px; padding: 12px 16px; }
.searchbar svg { flex: none; opacity: .6; }
.searchbar input { flex: 1; background: none; border: 0; outline: 0; color: var(--text); font-size: 16px; min-width: 0; }
.searchbar input::placeholder { color: #6f7a6f; }
.segmented { display: flex; gap: 4px; background: var(--bg-soft); border-radius: 999px; padding: 4px; margin: 12px 0 6px; }
.segmented button { flex: 1; padding: 9px 2px; border-radius: 999px; font-size: 13px; color: var(--muted); }
.segmented button[aria-selected='true'] { background: var(--accent); color: var(--accent-ink); font-weight: 650; }

/* rows */
.row { display: flex; align-items: center; gap: 12px; padding: 8px 0; width: 100%; text-align: left; min-width: 0; }
.row > button.row { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.row img, .row .art { width: 52px; height: 52px; border-radius: 12px; flex: none; object-fit: cover; background: #1d241d; }
.row .meta { min-width: 0; flex: 1; }
.row .title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.row .icon-btn { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); }
.row .icon-btn.liked { color: var(--brand); }
.empty { color: var(--muted); font-size: 14px; line-height: 1.55; padding: 28px 4px; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; padding: 22px 4px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--stroke); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* settings */
.group { background: var(--bg-soft); border: 1px solid var(--stroke); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.group h3 { margin: 0 0 10px; font-size: 14px; font-weight: 650; }
.rowline { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 14px; }
.rowline span { color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; }
.swatch[aria-pressed='true'] { border-color: var(--text); }

/* tabbar + mini player */
.dock { position: fixed; left: 0; right: 0; bottom: 0; padding: 0 12px calc(env(safe-area-inset-bottom) + 10px); pointer-events: none; }
.dock > * { pointer-events: auto; }
.mini {
  display: none; align-items: center; gap: 10px;
  background: rgba(26, 31, 26, .94); backdrop-filter: blur(18px);
  border: 1px solid var(--stroke); border-radius: 18px;
  padding: 8px 10px; margin-bottom: 8px;
}
.mini.on { display: flex; }
.mini img, .mini .art { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: #1d241d; }
.mini .meta { flex: 1; min-width: 0; }
.mini .title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini button { width: 36px; height: 36px; display: grid; place-items: center; }
.tabs { display: flex; background: rgba(22, 27, 22, .92); backdrop-filter: blur(18px); border: 1px solid var(--stroke); border-radius: 24px; padding: 6px; }
.tabs button { flex: 1; display: grid; justify-items: center; gap: 3px; padding: 7px 0 6px; border-radius: 18px; font-size: 11px; color: var(--muted); }
.tabs button[aria-selected='true'] { color: var(--text); background: rgba(255,255,255,.06); }
.tabs svg { width: 22px; height: 22px; }

/* now playing sheet */
.sheet { position: fixed; inset: 0; overflow-y: auto; background: var(--bg); z-index: 20; display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top) + 10px) 20px calc(env(safe-area-inset-bottom) + 20px); transform: translateY(100%); transition: transform .32s cubic-bezier(.2,.8,.2,1); }
.sheet.on { transform: none; }
.sheet header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.sheet .art-wrap { align-self: center; width: min(78vw, 330px); aspect-ratio: 1; border-radius: 26px; overflow: hidden; background: #1c221c; box-shadow: 0 30px 60px rgba(0,0,0,.45); }
.sheet .art-wrap img, .sheet .art-wrap .art { width: 100%; height: 100%; object-fit: cover; }
.sheet .now-title { font-size: 21px; font-weight: 700; margin: 22px 0 4px; letter-spacing: -.01em; }
.sheet .now-sub { color: var(--muted); font-size: 14px; }
.sheet .seek { margin-top: 22px; }
.sheet .seek input { width: 100%; accent-color: var(--accent); }
.sheet .times { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.sheet .controls { display: flex; align-items: center; justify-content: center; gap: 26px; margin-top: 18px; }
.sheet .controls button { width: 54px; height: 54px; display: grid; place-items: center; }
.sheet .controls .big { width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.hidden-yt { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; bottom: 0; left: 0; }
/* toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 46px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px); background: rgba(30, 36, 30, .96); border: 1px solid var(--stroke); color: var(--text); padding: 11px 16px; border-radius: 14px; font-size: 13px; max-width: 86vw; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 30; text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
/* wide screens: keep the phone shape instead of stretching rows */
@media (min-width: 620px) {
  .app { max-width: 470px; margin: 0 auto; border-inline: 1px solid var(--stroke); min-height: 100vh; }
  .dock { max-width: 470px; left: 50%; transform: translateX(-50%); }
  .sheet { max-width: 470px; left: 50%; transform: translateX(-50%) translateY(100%); }
  .sheet.on { transform: translateX(-50%); }
  .toast { max-width: 430px; }
}
.hint { color: var(--muted); font-size: 12px; padding: 6px 4px 2px; letter-spacing: .01em; }
/* offline badges */
.icon-btn.dl { color: var(--muted); }
.icon-btn.dl.saved { color: var(--accent); }
.spinner.small { width: 13px; height: 13px; border-width: 2px; display: inline-block; }
#sheet-dl { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 50%; }
#sheet-dl.saved { color: var(--accent); }
#dl-size { padding: 0 4px 2px; }
.segmented.wrap { flex-wrap: wrap; justify-content: flex-start; }
.segmented.wrap button { flex: 0 0 auto; padding: 9px 14px; }
/* rails and cards */
.rail { display: flex; gap: 12px; overflow-x: auto; padding: 4px 0 10px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.rail::-webkit-scrollbar { display: none; }
.card { flex: 0 0 132px; width: 132px; min-width: 0; overflow: hidden; scroll-snap-align: start; text-align: left; background: none; border: 0; padding: 0; color: inherit; }
.card-art { width: 132px; height: 132px; border-radius: 14px; overflow: hidden; background: var(--bg-soft); border: 1px solid var(--stroke); position: relative; }
.card-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-art .mosaic { display: grid; grid-template-columns: 1fr 1fr; width: 100%; height: 100%; }
.card-art .mosaic img { width: 100%; height: 100%; }
.card-art .mix-tag { position: absolute; inset: auto 0 0 0; padding: 8px 10px; font-weight: 800; letter-spacing: .16em; font-size: 12px;
  background: linear-gradient(transparent, rgba(0,0,0,.78)); text-transform: uppercase; }
.card-title { max-width: 100%; margin-top: 8px; font-size: 13.5px; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-sub { max-width: 100%; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.hero-actions { display: flex; align-items: center; gap: 10px; }
.hero-shuffle { width: 42px; height: 42px; border-radius: 50%; background: rgba(0,0,0,.35); border: 1px solid var(--stroke); display: grid; place-items: center; }
.lib-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chip { font-size: 12px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--stroke); color: var(--text); background: var(--bg-soft); }