/* Nauqworks Vocals — lacquer black & peony pink. Mobile first. */
:root {
  --ink: #0a0607;
  --ink-2: #120a0d;
  --ink-3: #1b1015;
  --card: #150c10;
  --card-2: #1d1117;
  --line: rgba(255, 143, 183, 0.13);
  --line-strong: rgba(255, 143, 183, 0.32);
  --pink: #ff8fb7;
  --pink-hot: #ff5c97;
  --pink-deep: #c93a6f;
  --blush: #ffd3e3;
  --paper: #f7e9ef;
  --muted: #a98c99;
  --faint: #6f5864;
  --ok: #8fe3b6;
  --warn: #ffc778;
  --bad: #ff7a85;
  --radius: 16px;
  --display: "Cormorant Garamond", Georgia, serif;
  --body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --bar-h: 58px;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  color: var(--paper); font: 15px/1.5 var(--body);
  background-color: var(--ink);
  background-image:
    radial-gradient(900px 480px at 100% -10%, rgba(255, 92, 151, 0.13), transparent 60%),
    radial-gradient(700px 420px at -20% 40%, rgba(201, 58, 111, 0.09), transparent 60%);
  background-attachment: fixed;
}
a { color: var(--pink); }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--pink-deep); color: #fff; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); font-weight: 500; }
.hint { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
code { font-family: var(--mono); font-size: .9em; color: var(--blush); }

/* ---------------------------------------------------------------- seal */
.seal {
  flex: none; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  background: var(--pink-hot); color: var(--ink); position: relative; transform: rotate(-4deg);
}
.seal::after { content: ""; position: absolute; inset: 3px; border: 1.5px solid var(--ink); border-radius: 5px; opacity: .85; }
.seal span { font: 700 22px/1 var(--display); transform: translateY(-1px); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px;
  padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--ink-3);
  color: var(--paper); cursor: pointer; font-weight: 700; font-size: 15px; text-decoration: none;
  transition: transform .1s, background .2s, border-color .2s, box-shadow .2s, opacity .2s; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--pink); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--pink-hot), var(--pink-deep)); border-color: transparent; color: #fff; box-shadow: 0 10px 28px -12px rgba(255, 92, 151, .8); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.danger { border-color: rgba(255, 122, 133, .45); color: #ffd2d6; background: transparent; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 13.5px; border-radius: 10px; }
.btn.big { min-height: 54px; font-size: 17px; border-radius: 16px; }
.text-btn { background: none; border: 0; padding: 4px 0; color: var(--pink); cursor: pointer; font-weight: 700; font-size: 13.5px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: var(--ink-3); color: var(--paper); font-size: 15px; }

/* ---------------------------------------------------------------- header */
.bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px; padding: 0 16px;
  padding-top: env(safe-area-inset-top, 0px); height: calc(var(--bar-h) + env(safe-area-inset-top, 0px));
  background: rgba(10, 6, 7, .9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; margin-right: auto; }
.brand-name { font: 600 24px/1 var(--display); letter-spacing: .01em; }
.gpu-pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 14px 6px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--ink-3); color: var(--paper); font-weight: 700; font-size: 13.5px; cursor: pointer;
}
.gpu-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: #5b4049; flex: none; }
.gpu-pill .timer { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.gpu-pill .timer:empty { display: none; }
.gpu-pill[data-state="ready"] .dot, .gpu-pill[data-state="busy"] .dot { background: var(--pink); box-shadow: 0 0 10px 2px rgba(255, 143, 183, .7); }
.gpu-pill[data-state="provisioning"] .dot, .gpu-pill[data-state="setting_up"] .dot, .gpu-pill[data-state="loading"] .dot,
.gpu-pill[data-state="stopping"] .dot { background: var(--warn); animation: pulse 1.4s infinite; }
.gpu-pill[data-state="error"] .dot { background: var(--bad); }
@keyframes pulse { 50% { opacity: .35; } }
.top-links { display: none; gap: 4px; }
.top-links .link { background: none; border: 0; color: var(--muted); font-weight: 700; padding: 8px 12px; border-radius: 10px; cursor: pointer; }
.top-links .link[aria-current="page"] { color: var(--paper); background: var(--ink-3); }

/* ---------------------------------------------------------------- layout & views */
.layout { max-width: 1240px; margin: 0 auto; padding: 16px 16px calc(var(--tab-h) + var(--safe-b) + 24px); }
body.has-player .layout { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 96px); }
.view { display: none; }
body[data-view="create"] .view-create, body[data-view="library"] .view-library, body[data-view="settings"] .view-settings { display: block; }
.view-title { margin: 4px 0 14px; font: 600 30px/1.1 var(--display); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card.compact { padding-bottom: 8px; }
.card-title { display: block; font-weight: 700; font-size: 13px; letter-spacing: .09em; text-transform: uppercase; color: var(--blush); margin-bottom: 12px; }

/* ---------------------------------------------------------------- forms */
.field { display: grid; gap: 7px; margin-bottom: 12px; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field > label, .label-like, .field-head label, .pk-add > label {
  font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--blush);
}
.field > label .muted, .field-head .muted { text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.field-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.field-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: 12.5px; }
input[type="text"], input[type="number"], input[type="password"], input[type="search"], textarea, select {
  width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--ink-2); outline: none; font-size: 16px; /* 16px stops iOS zooming on focus */
  transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 143, 183, .14); }
::placeholder { color: var(--faint); }
textarea { resize: vertical; line-height: 1.6; }
textarea.lyrics { min-height: 220px; }
textarea.code { font: 13px/1.55 var(--mono); min-height: 220px; white-space: pre; margin-top: 10px; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23ff8fb7' stroke-width='1.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
select.mini-select { width: auto; min-height: 34px; padding: 4px 32px 4px 12px; font-size: 14px; border-radius: 999px; background-position: right 11px center; color: var(--pink); font-weight: 700; }
.style-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.style-grid .field { margin: 0; }
.style-grid select { font-size: 15px; }
.style-grid select.unset { color: var(--faint); }
.style-preview { margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
.style-preview b { color: var(--blush); font-weight: 600; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-2 .field { margin-bottom: 12px; }
input[type="range"] { width: 100%; accent-color: var(--pink-hot); min-height: 30px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--paper); cursor: pointer; text-transform: none; letter-spacing: 0; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--pink-hot); }

.switch { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 999px; background: #3a2830; position: relative; cursor: pointer; transition: background .2s; margin: 0; flex: none; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--paper); transition: transform .2s; }
.switch:checked { background: var(--pink-hot); }
.switch:checked::after { transform: translateX(18px); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; cursor: pointer; }
.switch-row span { font-weight: 600; }
.switch-row small, .list-btn small { display: block; color: var(--muted); font-weight: 500; font-size: 12.5px; margin-top: 2px; }

details.inline-more { margin-top: 2px; }
details.inline-more > summary { cursor: pointer; list-style: none; color: var(--pink); font-weight: 700; font-size: 14px; padding: 8px 0 10px; }
details.inline-more > summary::-webkit-details-marker { display: none; }
details.inline-more > summary::before { content: "+ "; }
details.inline-more[open] > summary::before { content: "– "; }

/* segmented */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); margin-bottom: 14px; }
.seg button { min-height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 700; font-size: 14.5px; cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--ink-3); color: var(--paper); box-shadow: inset 0 0 0 1px var(--line-strong); }
/* model switch: YuE2 or MiniMax Music 3 (each hides the other's controls) */
.model-seg { max-width: 320px; margin-bottom: 10px; }
.model-seg button { min-height: 34px; font-size: 13.5px; }
.seg button[aria-checked="true"] { background: var(--ink-3); color: var(--paper); box-shadow: inset 0 0 0 1px var(--line-strong); }
.seg button:disabled { opacity: .55; cursor: default; }
.sheet-model { max-width: none; margin-bottom: 0; }
.mm-only, .mm-tag { display: none; }
body[data-model="minimax"] .mm-only { display: block; }
body[data-model="minimax"] .yue-only { display: none !important; }
.mode-only { display: none; }
body[data-mode="cover"] .mode-only[data-mode="cover"], body[data-mode="score"] .mode-only[data-mode="score"] { display: block; }
body[data-mode="cover"] .mode-hide[data-mode~="cover"], body[data-mode="score"] .mode-hide[data-mode~="score"] { display: none; }

.drop { display: grid; place-items: center; gap: 4px; text-align: center; padding: 22px 16px; border-radius: 14px; border: 1.5px dashed var(--line-strong); background: rgba(255, 143, 183, .04); cursor: pointer; margin-bottom: 12px; }
.drop.over { border-color: var(--pink); background: rgba(255, 143, 183, .1); }
.drop .drop-icon { font-size: 22px; color: var(--pink); }
.drop b { font-weight: 700; }
.drop span { color: var(--muted); font-size: 13px; }

.create-bar { position: sticky; bottom: calc(var(--tab-h) + var(--safe-b)); z-index: 5; display: grid; gap: 6px; padding: 18px 0 10px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; background: linear-gradient(rgba(10, 6, 7, 0), var(--ink) 40%); }
body.has-player .create-bar { bottom: calc(var(--tab-h) + var(--safe-b) + 74px); }
.create-bar .btn { width: 100%; }
.create-note { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
.create-note:empty { display: none; }

/* ---------------------------------------------------------------- library */
.lib-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lib-head input { max-width: 220px; min-height: 40px; padding: 8px 14px; border-radius: 999px; }
.songs { display: grid; gap: 10px; }
.song { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: start; padding: 12px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.song.running { border-color: rgba(255, 199, 120, .35); }
.art { width: 64px; height: 64px; border-radius: 12px; overflow: hidden; position: relative; border: 0; padding: 0; cursor: pointer; background: var(--ink-3); }
.art svg { display: block; width: 100%; height: 100%; }
.art .art-play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 18px; background: rgba(10, 6, 7, .25); opacity: 0; transition: opacity .2s; }
.art:hover .art-play, .art:focus-visible .art-play, .song.playing .art .art-play { opacity: 1; }
.song-info { min-width: 0; }
.song h3 { margin: 0; font: 600 20px/1.2 var(--display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song .tags { margin: 2px 0 0; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song .meta { margin: 4px 0 0; color: var(--faint); font-size: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pill { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); }
.pill.running { color: var(--warn); border-color: rgba(255, 199, 120, .45); }
.pill.failed { color: var(--bad); border-color: rgba(255, 122, 133, .45); }
.pill.queued { color: var(--blush); }
.takes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.take-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 12px 4px 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--ink-2); color: var(--paper); font-weight: 700; font-size: 13px; cursor: pointer; }
.take-btn .t-icon { color: var(--pink); width: 12px; }
.take-btn.playing { background: rgba(255, 92, 151, .18); border-color: var(--pink); }
.take-btn small { color: var(--muted); font-weight: 600; }
.progress { margin-top: 10px; }
.progress .bar-track { height: 5px; border-radius: 5px; background: #2a1820; overflow: hidden; }
.progress .bar-track i { display: block; height: 100%; width: 30%; background: linear-gradient(90deg, var(--pink-deep), var(--pink)); border-radius: 5px; transition: width .6s; }
.progress .bar-track.indeterminate i { animation: slide 1.4s infinite ease-in-out; }
.progress small { display: block; color: var(--muted); margin-top: 5px; font-size: 12.5px; }
@keyframes slide { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }
.song .err { margin-top: 8px; font-size: 13px; color: #ffc9ce; }
.song .warn { margin-top: 6px; font-size: 12.5px; color: var(--warn); }
.song-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

/* overflow menu */
.more { position: relative; }
.more > summary { list-style: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; cursor: pointer; color: var(--muted); font-size: 20px; }
.more > summary::-webkit-details-marker { display: none; }
.more[open] > summary { background: var(--ink-3); color: var(--paper); }
.more .menu { position: absolute; right: 0; top: 44px; z-index: 20; min-width: 210px; padding: 6px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line-strong); box-shadow: 0 20px 50px -12px rgba(0, 0, 0, .8); display: grid; }
.menu a, .menu button { display: block; text-align: left; padding: 11px 12px; border-radius: 10px; border: 0; background: none; color: var(--paper); font-weight: 600; font-size: 14.5px; text-decoration: none; cursor: pointer; }
.menu a:hover, .menu button:hover { background: var(--ink-3); }
.menu .danger { color: #ffb3ba; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 6px; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty b { display: block; font: 600 24px/1.2 var(--display); color: var(--paper); margin-bottom: 6px; }

/* ---------------------------------------------------------------- settings */
.settings-group h2 { margin: 0 0 12px; font: 600 22px/1.2 var(--display); }
details.settings-group > summary { list-style: none; cursor: pointer; display: grid; gap: 2px; }
details.settings-group > summary::-webkit-details-marker { display: none; }
details.settings-group > summary h2 { margin: 0; display: flex; justify-content: space-between; }
details.settings-group > summary h2::after { content: "+"; color: var(--pink); font: 400 24px/1 var(--body); }
details.settings-group[open] > summary h2::after { content: "–"; }
details.settings-group > summary .muted { font-size: 13px; margin-bottom: 4px; }
.ft-group { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.ft-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.ft-head h3 { margin: 0; font-size: 15px; }
.param-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.param { display: grid; gap: 4px; min-width: 0; }
.param label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.param input, .param select { min-height: 42px; padding: 8px 10px; font-size: 15px; }
.param.changed input, .param.changed select { border-color: var(--pink); }
.list-btn { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 2px; background: none; border: 0; border-top: 1px solid var(--line); color: var(--paper); font-weight: 600; text-align: left; cursor: pointer; min-height: 52px; }
.settings-group h2 + .list-btn { border-top: 0; }
.list-btn > span:last-child { color: var(--muted); font-size: 20px; }
.list-btn.danger { color: #ffb3ba; }
.fineprint { text-align: center; color: var(--faint); font-size: 12px; margin: 18px 0 0; }
.fineprint a { color: var(--muted); }
.desktop-only { display: none; }

/* ---------------------------------------------------------------- player */
.player {
  position: fixed; left: 8px; right: 8px; bottom: calc(var(--tab-h) + var(--safe-b) + 6px); z-index: 25;
  display: grid; grid-template-columns: 44px 1fr auto auto; gap: 10px; align-items: center;
  padding: 8px; border-radius: 16px; background: rgba(29, 17, 23, .96); border: 1px solid var(--line-strong);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .8);
}
.player-art { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; }
.player-art svg { width: 100%; height: 100%; display: block; }
.player-info { min-width: 0; display: grid; }
.player-info b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-info span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-info input[type="range"] { min-height: 18px; height: 18px; margin: 2px 0 0; }
.player-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.play-main { background: var(--pink-hot); color: var(--ink); font-size: 13px; letter-spacing: -1px; }

/* ---------------------------------------------------------------- tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(10, 6, 7, .94); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
}
.tabbar button { position: relative; display: grid; place-content: center; gap: 2px; background: none; border: 0; color: var(--faint); font-weight: 700; font-size: 12px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tabbar button span { font-size: 19px; line-height: 1; }
.tabbar button[aria-current="page"] { color: var(--pink); }
.badge-dot { position: absolute; top: 10px; left: calc(50% + 10px); width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }

/* ---------------------------------------------------------------- sheets */
dialog.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 88dvh; background: transparent; color: inherit; }
dialog.sheet::backdrop { background: rgba(5, 2, 3, .7); backdrop-filter: blur(3px); }
.sheet-body { background: var(--card-2); border: 1px solid var(--line-strong); border-bottom: 0; border-radius: 22px 22px 0 0; padding: 10px 18px calc(18px + var(--safe-b)); overflow: auto; max-height: 88dvh; }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto 12px; }
.sheet-body h2 { margin: 0 0 4px; font: 600 26px/1.2 var(--display); }
.sheet-body > .muted { margin: 0 0 14px; }
.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.sheet-actions .btn { flex: 1; }
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0; margin: 0 0 14px; }
.steps li { font-size: 12px; font-weight: 700; color: var(--faint); text-align: center; padding-top: 10px; border-top: 3px solid #2e1c24; }
.steps li.done { color: var(--pink); border-color: var(--pink); }
.steps li.now { color: var(--paper); border-color: var(--warn); }
.usage { text-align: center; }
.error-box { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 122, 133, .1); border: 1px solid rgba(255, 122, 133, .35); color: #ffd7db; font-size: 13.5px; }
ol.log { list-style: none; margin: 8px 0 0; padding: 0; font: 12px/1.6 var(--mono); color: var(--muted); max-height: 60dvh; overflow: auto; }
.log li { padding: 4px 0; border-bottom: 1px solid var(--line); word-break: break-word; }
.log li span { color: var(--faint); margin-right: 8px; }
.log li.warn { color: var(--warn); }
.log li.error { color: var(--bad); }

/* passkeys */
.pk-list { display: grid; gap: 8px; margin: 10px 0 16px; }
.pk { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--ink-2); }
.pk b { font-weight: 700; }
.pk small { color: var(--muted); font-size: 12.5px; grid-column: 1; }
.pk .acts { grid-row: span 2; grid-column: 2; display: flex; gap: 6px; }
.pk-add { display: grid; gap: 10px; padding: 14px; border-radius: 14px; border: 1px dashed var(--line-strong); }
.pk-mode { margin: 0 0 4px; color: var(--blush) !important; }

/* people (owner only; members never see these controls) */
body[data-role="member"] .owner-only { display: none !important; }
.gpu-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.gpu-checks label { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; cursor: pointer; }
.invite-out { display: grid; gap: 8px; margin: 0 0 14px; padding: 14px; border-radius: 14px; border: 1px solid var(--pink); background: var(--ink-2); }
.invite-out[hidden] { display: none; }
.invite-out > label { font-size: 13px; color: var(--muted); }
.invite-out input { font: 12.5px/1.4 var(--mono); }

/* toasts */
.toasts { position: fixed; left: 12px; right: 12px; top: calc(var(--bar-h) + env(safe-area-inset-top, 0px) + 8px); display: grid; gap: 8px; z-index: 60; pointer-events: none; }
.toast { justify-self: center; max-width: 520px; padding: 12px 16px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line-strong); box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .8); font-size: 14px; font-weight: 600; animation: rise .25s ease-out; pointer-events: auto; }
.toast.error { border-color: rgba(255, 122, 133, .6); color: #ffd7db; }
@keyframes rise { from { transform: translateY(-6px); opacity: 0; } }

/* ---------------------------------------------------------------- desktop */
@media (min-width: 1000px) {
  :root { --tab-h: 0px; }
  .tabbar { display: none; }
  .brand { margin-right: 0; }
  .top-links { display: flex; order: 2; margin-left: 24px; }
  .gpu-pill { margin-left: auto; order: 3; }
  .layout { display: grid; grid-template-columns: 440px minmax(0, 1fr); gap: 28px; padding: 24px 32px 120px; align-items: start; }
  body.has-player .layout { padding-bottom: 130px; }
  body[data-view="create"] .view-library, body[data-view="library"] .view-create { display: block; }
  body[data-view="create"] .view-create, body[data-view="library"] .view-create { position: sticky; top: calc(var(--bar-h) + 16px); max-height: calc(100vh - var(--bar-h) - 32px); overflow: auto; padding-right: 6px; scrollbar-width: thin; }
  body[data-view="settings"] .layout { grid-template-columns: minmax(0, 720px); justify-content: center; }
  .create-bar { bottom: 0; background: linear-gradient(transparent, var(--ink) 30%); padding-bottom: 8px; }
  body.has-player .create-bar { bottom: 0; }
  body.has-player[data-view="create"] .view-create, body.has-player[data-view="library"] .view-create { max-height: calc(100vh - var(--bar-h) - 132px); }
  .player { left: 50%; right: auto; transform: translateX(-50%); width: min(760px, calc(100% - 64px)); bottom: 16px; grid-template-columns: 48px 1fr auto auto; }
  dialog.sheet { margin: auto; }
  .sheet-body { border-radius: 22px; border-bottom: 1px solid var(--line-strong); }
  .sheet-grip { display: none; }
  .toasts { left: auto; right: 24px; top: auto; bottom: 24px; }
  .desktop-only { display: inline-flex; }
  .song { grid-template-columns: 72px 1fr auto; }
  .art { width: 72px; height: 72px; }
}
@media (max-width: 340px) {
  .style-grid, .row-2, .param-grid { grid-template-columns: 1fr; }
  .gpu-pill #gpu-label { max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------------------------------------------------------------- login */
.login-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; overflow: hidden; position: relative; }
.moongate {
  width: min(440px, 100%); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 40%, #1d0f15, #0d0709 70%);
  box-shadow: 0 0 0 10px #140a0e, 0 0 0 11px var(--line-strong), 0 0 0 22px #0f080b, 0 0 0 23px var(--line), 0 40px 120px -20px rgba(255, 92, 151, .35);
  position: relative; z-index: 1;
}
.moongate form { width: 68%; display: grid; gap: 12px; text-align: center; }
.moongate .seal { margin: 0 auto 4px; width: 54px; height: 54px; }
.moongate .seal span { font-size: 32px; }
.moongate h1 { margin: 0; font: 600 32px/1 var(--display); }
.moongate h1 em { color: var(--pink); }
.moongate p { margin: 0 0 6px; color: var(--muted); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; }
.moongate input { text-align: center; }
.moongate .err { min-height: 20px; color: var(--bad); font-size: 13px; }
.moongate .pk-only-note { margin: 0; font-size: 12.5px; color: var(--muted); letter-spacing: 0; text-transform: none; }
.passkey-btn svg { flex: none; }
.or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.petal { position: absolute; top: -20px; width: 12px; height: 10px; background: var(--pink); border-radius: 80% 0 80% 0; opacity: .55; animation: fall linear infinite; z-index: 0; }
@keyframes fall { to { transform: translate(-120px, 110vh) rotate(540deg); } }
@media (max-width: 640px) {
  .moongate { aspect-ratio: auto; border-radius: 220px 220px 28px 28px; padding: 60px 0 40px; }
  .moongate form { width: 82%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .petal { display: none; }
}

/* phone app */
.link-code { font: 700 28px/1.2 var(--mono); letter-spacing: .12em; color: var(--pink); }
.sub-h { margin: 18px 0 0; font-size: 14px; color: var(--muted); font-weight: 600; }
#phone-apk { margin: 0 0 12px; display: inline-flex; }
#phone-apk[hidden] { display: none; }
