:root {
  --bg: #0f0d13; --panel: #1a1622; --line: #2c2537; --ink: #f3eee6; --muted: #b3a9c2;
  --gold: #e2b86e; --gold-ink: #241a08; --ok: #6fd39b; --warn: #f0b35a; --bad: #ef7d7d;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(1200px 600px at 20% -10%, #2a1f3d 0%, var(--bg) 55%) fixed; color: var(--ink);
       font: 16px/1.55 Inter, system-ui, sans-serif; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; max-width: 980px; margin: 0 auto; }
.brand { display: flex; gap: 12px; align-items: center; }
.brand b { font: 700 20px "Playfair Display", serif; display: block; }
.brand small { color: var(--gold); letter-spacing: .04em; }
.logo { width: 40px; height: 40px; border-radius: 12px; background: var(--gold); color: var(--gold-ink); display: grid; place-items: center; font-size: 22px; }
#account { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 14px; }
#account img { width: 30px; height: 30px; border-radius: 50%; }
main { max-width: 980px; margin: 0 auto; padding: 0 16px 40px; }
.hero { text-align: center; padding: 48px 8px 28px; }
.hero h1 { font: 700 clamp(30px, 6vw, 52px)/1.1 "Playfair Display", serif; margin: 0 0 14px; }
.hero p { color: var(--muted); max-width: 620px; margin: 0 auto 22px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px; margin: 18px 0; }
.card h2 { font: 600 22px "Playfair Display", serif; margin: 0 0 14px; }
.hidden { display: none !important; }
label { display: block; margin: 0 0 14px; font-weight: 500; }
.hint { color: var(--muted); font-weight: 400; font-size: 13px; }
input, select, textarea { width: 100%; margin-top: 6px; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: #120f18; color: var(--ink); font: inherit; }
textarea { resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
input[type=range] { padding: 0; accent-color: var(--gold); }
.row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .row { grid-template-columns: 1fr; } }
button { font: 600 15px Inter, sans-serif; border-radius: 12px; padding: 12px 18px; cursor: pointer; border: 1px solid var(--line);
  background: transparent; color: var(--ink); }
button.primary { background: var(--gold); color: var(--gold-ink); border: 0; }
button:disabled { opacity: .5; cursor: not-allowed; }
.fine { color: var(--muted); font-size: 13px; }
.msg { min-height: 1.4em; margin: 10px 0 0; color: var(--warn); }
.plan { background: #120f18; border: 1px dashed var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 16px; color: var(--muted); }
.plan b { color: var(--gold); }
.song { border-top: 1px solid var(--line); padding: 14px 0; display: grid; gap: 8px; }
.song:first-child { border-top: 0; }
.song-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.song-head b { font-size: 17px; }
.chip { font-size: 12px; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); }
.chip.ready { color: var(--ok); border-color: var(--ok); }
.chip.composing, .chip.queued, .chip.new { color: var(--warn); border-color: var(--warn); }
.chip.failed, .chip.rejected { color: var(--bad); border-color: var(--bad); }
.wallet { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: linear-gradient(90deg, #2a2113, #1a1622); border: 1px solid var(--gold); border-radius: 14px; padding: 12px 16px; margin-bottom: 18px; }
.wallet b { font-size: 20px; color: var(--gold); }
.wallet .coin { font-size: 20px; }
.topup { background: var(--gold); color: var(--gold-ink); font-weight: 600; text-decoration: none; padding: 8px 16px; border-radius: 10px; }
.compose-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cost { color: var(--muted); font-size: 14px; }
.cost b { color: var(--gold); }
.cost.short { color: var(--bad); }
.plans .best { border-color: var(--gold); position: relative; }
.plans .best::after { content: "Most popular"; position: absolute; top: -10px; right: 10px; background: var(--gold); color: var(--gold-ink);
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.preset-box { background: #211a2c; border: 1px solid var(--gold); border-radius: 14px; padding: 14px; margin-bottom: 18px; }
.tip { background: #2a2113; border-left: 3px solid var(--gold); border-radius: 8px; padding: 10px 12px; margin: 0 0 12px; font-size: 14px; color: var(--ink); }
.tip b { color: var(--gold); }
.lyric-help .fit.short { color: var(--bad); font-weight: 600; }
.lyric-help { margin: -6px 0 14px; font-size: 13px; color: var(--muted); }
.lyric-help .fit { min-height: 1.4em; margin-bottom: 4px; }
.lyric-help .fit.good { color: var(--ok); } .lyric-help .fit.warn { color: var(--warn); }
.lyric-help summary { cursor: pointer; color: var(--gold); }
.lyric-help ul { margin: 6px 0; padding-left: 18px; }
.lyric-help code, .lyric-help pre { background: #120f18; border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; color: var(--ink); }
.lyric-help pre { padding: 8px 10px; white-space: pre-wrap; }
label.check { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-weight: 500; }
label.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--gold); }
label.check .hint { flex-basis: 100%; padding-left: 28px; }
.progress { background: #120f18; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.progress .bar { height: 12px; border-radius: 99px; background: #2a2335; overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .25s linear;
  background: linear-gradient(90deg, #b8873a, var(--gold), #f6d79c, var(--gold)); background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite; }
.progress.queued .bar i, .progress.new .bar i { animation: shimmer 1.6s linear infinite, breathe 1.6s ease-in-out infinite; }
.progress.late .bar i { animation: shimmer 1.2s linear infinite, breathe 1.4s ease-in-out infinite; }
.progress-msg { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 15px; font-weight: 500; color: var(--ink); }
.progress-msg .pct { color: var(--gold); font-variant-numeric: tabular-nums; }
.progress.late .step { color: var(--gold); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: 0 0; } }
@keyframes breathe { 50% { opacity: .55; } }
audio { width: 100%; }
.song a { color: var(--gold); font-size: 14px; }
.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 760px) { .plans { grid-template-columns: repeat(2, 1fr); } }
.plans > div { border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.plans b { display: block; font: 600 18px "Playfair Display", serif; }
.plans .price { color: var(--gold); font-size: 20px; font-weight: 600; margin: 6px 0; }
.doc { max-width: 780px; margin: 0 auto; }
.doc h1 { font: 700 34px/1.2 "Playfair Display", serif; margin: 24px 0 6px; }
.doc h2 { font: 600 21px "Playfair Display", serif; margin: 26px 0 8px; color: var(--gold); }
.doc p, .doc li { color: #ddd5e6; }
.doc li { margin: 4px 0; }
.doc .updated { color: var(--muted); font-size: 13px; }
.doc a, footer a { color: var(--gold); }
.fill { background: #5a3d0c; color: #ffd58a; padding: 0 4px; border-radius: 4px; }
.brand { color: inherit; text-decoration: none; }
footer nav { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 16px 40px; }
.plans .buy { width: 100%; margin-top: 10px; padding: 9px; }
.msg.good { color: var(--ok); }
.billing { background: #120f18; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; margin-top: 8px; }
@media (max-width: 640px) { .row2 { grid-template-columns: 1fr; } }
#purchases h3 { font: 600 17px "Playfair Display", serif; margin: 18px 0 6px; }
.purchase { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding: 8px 0; font-size: 14px; }
.share-row { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.share-row .shared { color: var(--ok); font-weight: 600; }
.small { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.share { max-width: 720px; margin: 0 auto; padding: 0 16px 30px; }
.share-card { text-align: center; padding: 32px 22px; }
.share-card h1 { font: 700 clamp(28px, 6vw, 44px)/1.15 "Playfair Display", serif; margin: 8px 0 12px; }
.share-eyebrow { color: var(--gold); font-size: 14px; letter-spacing: .03em; }
.share-note { font: 500 italic 20px/1.5 "Playfair Display", serif; color: #f6d79c; margin: 0 0 18px; }
.share-card audio { margin: 6px 0 14px; }
.share-actions { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.share-actions a { color: var(--gold); }
.share-lyrics { text-align: left; margin-top: 18px; color: #ddd5e6; }
.share-lyrics summary { cursor: pointer; color: var(--gold); text-align: center; }
.share-cta { text-align: center; }
.cta { display: inline-block; margin-top: 8px; background: var(--gold); color: var(--gold-ink); font-weight: 600; text-decoration: none; padding: 12px 20px; border-radius: 12px; }
/* tabs: sticky under the header on desktop, fixed at the bottom on phones */
.tabs { position: sticky; top: 0; z-index: 10; display: flex; gap: 8px; justify-content: center; padding: 10px 16px;
  background: rgba(15, 13, 19, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.tabs button { border-radius: 99px; padding: 9px 18px; font-size: 15px; background: transparent; border: 1px solid var(--line); }
.tabs button.active { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.tabs .badge { font-size: 12px; opacity: .8; margin-left: 2px; }
.tabs .badge:empty { display: none; }
@media (max-width: 640px) {
  .tabs { position: fixed; top: auto; bottom: 0; left: 0; right: 0; border-bottom: 0; border-top: 1px solid var(--line); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); }
  .tabs button { flex: 1; padding: 9px 6px; font-size: 13px; }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
}
video.vid { width: 100%; max-height: 70vh; border-radius: 12px; background: #000; }
video.vid.vertical { width: auto; max-width: 100%; height: 60vh; display: block; margin: 0 auto; }
.free-banner { max-width: 980px; margin: 10px auto 0; padding: 10px 16px; border-radius: 12px; background: #3a2a0d;
  border: 1px solid var(--gold); color: #ffd58a; font-weight: 600; text-align: center; }
.price-table { font-size: 14px; color: var(--muted); margin-top: 12px; }
.price-table summary { cursor: pointer; color: var(--gold); }
.price-table table { border-collapse: collapse; margin-top: 8px; }
.price-table td, .price-table th { padding: 4px 12px 4px 0; text-align: left; }
.signin-choices { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
button.primary.alt { background: transparent; color: var(--gold); border: 1px solid var(--gold); }
.phone-box { max-width: 520px; margin: 18px auto; }
.phone-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.phone-row span { padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #120f18; color: var(--muted); }
.phone-row input { margin-top: 0; letter-spacing: .05em; }
#pb-code { letter-spacing: .4em; font-size: 20px; text-align: center; }
.signin-choices.pulse { animation: pulse 1.2s ease-out 2; border-radius: 16px; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(226,184,110,.6); } 100% { box-shadow: 0 0 0 18px rgba(226,184,110,0); } }
fieldset.photos { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 0 0 14px; }
fieldset.photos legend { padding: 0 6px; font-weight: 600; }
fieldset.photos input[type=radio] { width: 18px; height: 18px; margin: 0; accent-color: var(--gold); }
.thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.thumbs figure { position: relative; margin: 0; }
.thumbs img { height: 120px; border-radius: 10px; border: 1px solid var(--line); display: block; }
.thumbs button { position: absolute; top: 4px; right: 4px; padding: 2px 8px; font-size: 13px; border-radius: 99px; background: rgba(0,0,0,.65); }
.thumbs figcaption { text-align: center; font-size: 12px; color: var(--gold); margin-top: 4px; }
.howto { font-size: 14px; color: #ddd5e6; margin-top: 10px; }
.howto summary { cursor: pointer; color: var(--gold); font-weight: 600; }
.howto li { margin: 6px 0; }
.top-right { display: flex; gap: 10px; align-items: center; }
button.install { padding: 8px 12px; font-size: 14px; border-color: var(--gold); color: var(--gold); }
@media (max-width: 640px) { button.install { padding: 7px 10px; font-size: 13px; } }
.logo-img { width: 44px; height: 44px; display: block; }
.home-btn { color: var(--gold); text-decoration: none; border: 1px solid var(--gold); border-radius: 10px; padding: 7px 12px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.invited { background: #3a2a0d; border: 1px solid var(--gold); color: #ffd58a; border-radius: 12px; padding: 10px 14px; display: inline-block; }
.invite { background: linear-gradient(90deg, #2a2113, #1a1622); border: 1px solid var(--gold); border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.invite-code { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; }
.invite-code span { color: var(--muted); font-size: 13px; }
.invite-code b { font: 700 24px ui-monospace, Consolas, monospace; letter-spacing: .15em; color: var(--gold); }
.small-link { color: var(--gold); font-size: 14px; }
.status-video { display: grid; gap: 8px; }
video.vid.vertical.small { height: 46vh; }
.gift-row, .gift-form, .gift-done { display: grid; gap: 8px; }
.gift-row { grid-template-columns: auto 1fr; align-items: center; }
.gift-form, .gift-done { background: #211a2c; border: 1px solid var(--gold); border-radius: 12px; padding: 12px; }
.report-link { background: none; border: 0; color: var(--muted); font-size: 13px; padding: 2px 0; justify-self: start; cursor: pointer; }
.report-link:hover { color: var(--bad); }
.account-zone { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 12px; }
.account-zone h3 { font: 600 17px "Playfair Display", serif; margin: 0 0 6px; }
button.danger { border-color: var(--bad); color: var(--bad); }
.play-app .web-only, .play-app .topup, .play-app #plans { display: none !important; }
.last-frame { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: start; background: #120f18; border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.last-frame img { width: 110px; border-radius: 8px; display: block; }
.last-frame > button { grid-column: 1 / -1; justify-self: start; }
.last-frame p { margin: 4px 0 8px; }
button.primary-ish { border-color: var(--gold); color: var(--gold); }

/* ---- Help: chatbot + support requests ---- */
.help-fab { position: fixed; right: 16px; bottom: 16px; z-index: 50; background: var(--gold); color: var(--gold-ink); border: 0;
  border-radius: 999px; padding: 12px 18px; box-shadow: 0 6px 24px rgba(0,0,0,.45); }
.help-badge { display: inline-block; min-width: 20px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 12px; }
.help-panel { position: fixed; right: 16px; bottom: 16px; z-index: 51; width: min(400px, calc(100vw - 32px)); height: min(640px, calc(100vh - 32px));
  display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 10px 40px rgba(0,0,0,.55); overflow: hidden; }
.help-panel > header { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.help-tabs { display: flex; gap: 6px; padding: 8px 14px 0; }
.help-tabs button { padding: 6px 12px; font-size: 13px; border-radius: 8px 8px 0 0; background: transparent; color: var(--muted); }
.help-tabs button.on { color: var(--gold); border-color: var(--gold); }
.help-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px 14px 14px; overflow-y: auto; }
#help-chat.help-body { overflow: hidden; }
.help-log { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.hm { margin: 0; padding: 8px 12px; border-radius: 12px; max-width: 88%; white-space: pre-wrap; font-size: 14px; line-height: 1.45; }
.hm.user { align-self: flex-end; background: #3a2d4f; }
.hm.bot { align-self: flex-start; background: #120f18; border: 1px solid var(--line); }
.hm.note { align-self: center; color: var(--muted); font-size: 13px; text-align: center; max-width: 100%; }
.hm small { color: var(--muted); font-size: 11px; }
.hm button { margin-top: 8px; }
.help-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.help-form { display: flex; gap: 8px; align-items: center; }
.help-form input { margin: 0; }
.help-human { align-self: center; background: transparent; color: var(--gold); border: 0; }
.help-panel textarea { font-family: inherit; }
.ticket { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.ticket header { display: flex; justify-content: space-between; gap: 8px; }
.ticket .tstate { margin: 0; font-size: 13px; color: var(--gold); }
.ticket .tthread { display: flex; flex-direction: column; gap: 6px; }
.ticket .tactions { display: flex; flex-wrap: wrap; gap: 6px; }
.ticket .tactions form { flex-basis: 100%; }
@media (max-width: 640px) { .help-panel { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0;
  padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); } }
/* phones that draw edge-to-edge (Android 15+, the Play app): keep the page clear of the status bar and side cut-outs */
body { padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }

.rules-banner { max-width: 980px; margin: 10px auto 0; padding: 10px 16px; border-radius: 12px; background: #1d1828; border: 1px solid var(--line);
  color: var(--muted); font-size: 13px; display: flex; gap: 12px; align-items: center; }
.rules-banner a { color: var(--gold); }
@media (max-width: 640px) { .rules-banner { flex-direction: column; align-items: flex-start; margin: 10px 16px 0; } }
label.check.needs { outline: 1px dashed var(--gold); outline-offset: 4px; border-radius: 8px; }

/* ---- contest ---- */
.contest-prize { font: 600 20px "Playfair Display", serif; color: var(--gold); margin: 0 0 6px; }
.contest-steps { padding-left: 20px; } .contest-steps li { margin: 6px 0; }
.contest-slots { font-weight: 600; color: var(--warn); min-height: 1.2em; }
.contest-entry { background: #142017; border: 1px solid #2c4a33; border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
#k-form h3 { font: 600 18px "Playfair Display", serif; margin: 14px 0 10px; }
/* Song tab: 3 numbered steps, style hint, instrument chips, "More options" */
h3.step { display: flex; align-items: center; gap: 10px; margin: 22px 0 12px; padding-top: 16px; border-top: 1px solid var(--line);
          font: 600 18px "Playfair Display", serif; }
h3.step span { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--gold);
               color: var(--gold-ink); font: 700 15px Inter, sans-serif; }
#song-form .preset-box + h3.step { border-top: 0; padding-top: 0; }
.style-hint { margin: -6px 0 14px; color: var(--muted); }
.field { margin: 0 0 14px; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { margin: 0; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-block; padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel);
             font-size: 14px; color: var(--ink); user-select: none; }
.chip input:checked + span { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.chip input:checked + span::before { content: "✓ "; }
.chip input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }
details.more { margin: 0 0 14px; }
details.more summary { cursor: pointer; color: var(--gold); margin-bottom: 10px; }
/* Video tab: auto-change note, photos box, step-heading hint */
.auto-note { margin: -4px 0 12px; color: var(--warn); }
h3.step .hint { font: 400 13px Inter, sans-serif; }
details.photos-box > summary { font-weight: 600; }
details.photos-box[open] > summary { margin-bottom: 12px; }
#v-adv .price-table { margin-top: 6px; }
/* My creations: filter chips, compact card button row, panels, "Not made" */
.lib-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 6px; }
.lib-chips button { padding: 7px 14px; font-size: 14px; border-radius: 999px; background: var(--panel); color: var(--muted); }
.lib-chips button span { opacity: .75; font-weight: 500; }
.lib-chips button.on { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.song-media { display: grid; gap: 8px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card-actions .on { border-color: var(--gold); color: var(--gold); }
.song a.btn-link { display: inline-block; border: 1px solid var(--line); background: var(--panel); color: var(--ink); text-decoration: none; font-weight: 600; }
.card-panel:not(:empty) { display: grid; gap: 10px; background: #120f18; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.card-text summary { cursor: pointer; color: var(--gold); font-size: 14px; }
.card-text pre { white-space: pre-wrap; font: 14px/1.5 Inter, sans-serif; margin: 8px 0 0; color: var(--ink); }
.lib-more { justify-self: start; margin-top: 12px; }
.lib-notmade { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.lib-notmade summary { cursor: pointer; color: var(--muted); }
/* Credits tab: balance box, history, picked pack, folded account settings */
.balance { background: #120f18; border: 1px solid var(--gold); border-radius: 14px; padding: 14px 16px; margin: 0 0 18px; }
.bal-big { font-size: 18px; }
.bal-big b { font: 700 30px "Playfair Display", serif; color: var(--gold); margin: 0 4px; }
.balance .fine { margin: 4px 0 8px; }
table.ledger { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 6px; }
table.ledger td { padding: 6px 4px; border-top: 1px solid var(--line); vertical-align: top; }
table.ledger td.amt { text-align: right; white-space: nowrap; }
table.ledger .plus { color: var(--ok); } table.ledger .minus { color: var(--muted); }
table.ledger a { color: var(--gold); }
h3.sub { margin: 4px 0 6px; }
.plans > div.picked { border-color: var(--gold); box-shadow: 0 0 0 2px #e2b86e55; }
#billing { margin-top: 14px; }
details.account-zone { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 12px; }
/* Contest tab: prize chips, chosen-song preview */
.contest-prizes { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 10px; }
.prize-chip { display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: center; padding: 8px 14px;
  border: 1px solid var(--gold); border-radius: 14px; background: #211a2c; }
.prize-chip i { font-style: normal; font-size: 24px; grid-row: span 2; }
.prize-chip b { font: 700 20px "Playfair Display", serif; color: var(--gold); }
.prize-chip small { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.contest-steps .primary-ish { margin-left: 6px; }
.k-preview { margin: -6px 0 10px; }
.k-preview summary { cursor: pointer; color: var(--gold); font-size: 14px; }
.k-preview pre { white-space: pre-wrap; font: 14px/1.5 Inter, sans-serif; margin: 6px 0 0; }
.k-cert { margin-top: 8px; } .k-cert a { color: var(--gold); }
/* phones: when the bottom tab bar is shown, the Help button sits above it instead of covering the Credits tab */
@media (max-width: 640px) {
  body:has(#tabs:not(.hidden)) .help-fab { bottom: calc(84px + env(safe-area-inset-bottom)); right: 12px; padding: 10px 15px; }
}
/* contest: "Results are out!" card at the top of the Contest tab (shown once results/<id> is published) */
.k-results { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 12px 0 16px; padding: 18px 20px;
  border-radius: 16px; border: 2px solid var(--gold); background: linear-gradient(135deg, #3a2c12, #1a1622 70%);
  box-shadow: 0 0 24px rgba(226, 184, 110, .25); animation: kr-glow 2.4s ease-in-out infinite alternate; }
.k-results.hidden { display: none; }
.k-results .kr-icon { font-size: 48px; line-height: 1; }
.k-results .kr-text { flex: 1 1 260px; }
.k-results .kr-kicker { color: var(--gold); text-transform: uppercase; letter-spacing: .08em; font-size: 13px; font-weight: 700; }
.k-results .kr-head { font: 700 24px "Playfair Display", serif; margin: 2px 0 4px; }
.k-results .kr-sub { color: var(--muted); }
.k-results .kr-btn { padding: 12px 20px; border-radius: 12px; background: var(--gold); color: var(--gold-ink); font-weight: 700;
  text-decoration: none; white-space: nowrap; }
@keyframes kr-glow { from { box-shadow: 0 0 10px rgba(226, 184, 110, .15); } to { box-shadow: 0 0 28px rgba(226, 184, 110, .4); } }
@media (prefers-reduced-motion: reduce) { .k-results { animation: none; } }
/* group song card (Song tab) */
.group-box { border: 2px solid var(--gold); border-radius: 16px; padding: 14px 16px; margin: 12px 0 16px;
  background: linear-gradient(135deg, #2f2412, #1a1622 70%); }
.group-box > summary { display: flex; gap: 12px; align-items: center; cursor: pointer; list-style: none; font-size: 18px; }
.group-box > summary::-webkit-details-marker { display: none; }
.group-box .gb-icon { font-size: 36px; }
.group-box .new-badge { background: var(--gold); color: var(--gold-ink); font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 8px; vertical-align: middle; }
.group-box .gp-how { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; font-size: 13px; }
.group-box .gp-how span { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.group-box .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.group-box h4 { margin: 14px 0 4px; }
.wa-btn { display: block; text-align: center; padding: 12px; border-radius: 12px; background: #25d366; color: #062b14; font-weight: 700; text-decoration: none; }
@media (max-width: 520px) { .group-box .row2 { grid-template-columns: 1fr; } }
/* gift reply loop */
.reply-cta { display: block; text-align: center; margin: 16px auto 4px; font-size: 18px; padding: 14px 20px; }
.reply-note { background: #2f2412; border: 1px solid var(--gold); border-radius: 12px; padding: 10px 14px; margin: 0 0 12px; }
/* festival campaign banner (config/campaign) */
.camp-banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin: 12px 0; border-radius: 16px; text-decoration: none;
  color: var(--ink); border: 2px solid #f0a14a; background: linear-gradient(135deg, #4a2a0c, #2a1630 75%); box-shadow: 0 0 22px rgba(240, 161, 74, .25); }
.camp-banner.hidden { display: none; }
.camp-banner .cb-icon { font-size: 40px; } .camp-banner b { display: block; font-size: 18px; } .camp-banner small { color: var(--muted); }
.camp-banner > span:nth-child(2) { flex: 1; }
.camp-banner .cb-go { background: var(--gold); color: var(--gold-ink); font-weight: 700; padding: 10px 14px; border-radius: 12px; white-space: nowrap; }

/* Video tab: engine choice (Studio = our MiniMax H3 / Google Veo) + selfie camera */
.engine-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 6px; }
.engine-opt { display: flex; gap: 10px; align-items: flex-start; border: 2px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; }
.engine-opt:has(input:checked) { border-color: var(--gold); background: rgba(226, 184, 110, .08); }
.engine-opt input { margin-top: 4px; } .engine-opt b { display: block; font-size: 16px; } .engine-opt small { color: var(--muted); }
.engine-credit { margin: 0 0 10px; }
.photo-pick { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.file-btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; cursor: pointer; border: 1px solid var(--line);
  border-radius: 10px; padding: 6px 12px; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.camera-box { position: fixed; inset: 0; background: rgba(0, 0, 0, .85); z-index: 60; display: flex; align-items: center; justify-content: center;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.camera-box.hidden { display: none; }
.camera-inner { position: relative; width: min(92vw, 520px); text-align: center; }
.camera-inner video { width: 100%; border-radius: 14px; transform: scaleX(-1); background: #000; }
.face-guide { position: absolute; left: 50%; top: 42%; width: 46%; aspect-ratio: 3 / 4; transform: translate(-50%, -50%);
  border: 3px dashed rgba(226, 184, 110, .9); border-radius: 50%; pointer-events: none; }
@media (max-width: 520px) { .engine-pick { grid-template-columns: 1fr; } }

/* ---- description helper (quick choices) ---- */
.ph-box { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; margin: 0 0 14px; }
.ph-moods { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.chip-btn.on { border-color: var(--gold); color: var(--gold); }

.improve-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -6px 0 12px; }

/* ---- 🎤 lip-sync mode of the Video tab ---- */
#videostudio.lip-mode .no-lip { display: none !important; }
.lip-only { display: none; }
#videostudio.lip-mode .lip-only { display: block; }
.lip-duet { margin: 10px 0 4px; }
.lip-duet .fine { margin: 4px 0 0 26px; }
.lip-box { border: 1px solid var(--gold); border-radius: 14px; padding: 12px 14px; margin: 0 0 14px; background: rgba(226, 184, 110, .07); }
.lip-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.lip-box audio { width: 100%; margin: 8px 0 4px; }

/* ---- ✨ Ask chat (CHAT_TAB_PLAN.md) ---- */
.card.ask { padding: 0; overflow: hidden; }
.ask-wrap { display: grid; grid-template-columns: 240px 1fr; min-height: min(720px, calc(100dvh - 190px)); }
.ask-side { border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 6px; background: #15111c; }
.ask-new { width: 100%; }
.ask-h { margin: 14px 4px 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ask-tools { display: grid; gap: 4px; }
.ask-tools button, .ask-open { text-align: left; padding: 8px 10px; font-size: 14px; font-weight: 500; border: 0; border-radius: 10px; }
.ask-tools button:hover, .ask-open:hover, .ask-thread.active .ask-open { background: rgba(226, 184, 110, .12); }
.ask-threads { overflow-y: auto; max-height: 40vh; display: grid; gap: 2px; }
.ask-thread { display: flex; align-items: center; }
.ask-open { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-del { border: 0; padding: 6px 8px; font-size: 13px; opacity: .55; }
.ask-del:hover { opacity: 1; }
.ask-main { display: flex; flex-direction: column; min-width: 0; padding: 12px 16px 10px; }
.ask-top { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.ask-menu { display: none; padding: 6px 12px; }
.ask-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 14px 2px;
  max-height: calc(100dvh - 300px); min-height: 320px; }
.ask-msg { max-width: 82%; padding: 10px 14px; border-radius: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.ask-msg.user { align-self: flex-end; background: var(--gold); color: var(--gold-ink); border-bottom-right-radius: 4px; }
.ask-msg.bot { align-self: flex-start; background: #120f18; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ask-typing span { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: var(--muted);
  animation: askdot 1.2s infinite ease-in-out; }
.ask-typing span:nth-child(2) { animation-delay: .2s; } .ask-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes askdot { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.ask-card { margin-top: 10px; padding: 12px; border: 1px solid var(--gold); border-radius: 12px; background: rgba(226, 184, 110, .07); }
.ask-card pre { white-space: pre-wrap; font: 14px/1.5 Inter, system-ui, sans-serif; margin: 6px 0 0; }
.ask-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ask-empty { margin: auto 0; text-align: center; padding: 20px 4px; }
.ask-empty h3 { margin: 0 0 6px; }
.ask-starters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.ask-form { display: flex; gap: 8px; align-items: flex-end; padding-top: 8px; }
.ask-form textarea { margin: 0; resize: none; min-height: 46px; max-height: 160px; }
.ask-form button { padding: 12px 16px; }
.ask-note { margin: 6px 2px 0; text-align: center; }
.ask-shade { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 39; }
body.ask-on .help-fab { display: none; }
@media (max-width: 760px) {
  .ask-wrap { grid-template-columns: 1fr; }
  .ask-menu { display: inline-block; }
  .ask-side { position: fixed; top: 0; bottom: 0; left: 0; width: min(80vw, 300px); z-index: 40; transform: translateX(-105%);
    transition: transform .2s ease; padding-top: calc(16px + env(safe-area-inset-top)); padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .ask-side.open { transform: none; }
  .ask-main { padding: 10px 10px 8px; }
  .ask-log { max-height: calc(100dvh - 290px - env(safe-area-inset-bottom)); }
  .ask-msg { max-width: 90%; }
}

.delete-row { margin-top: 8px; }
.danger-ish { color: var(--bad); border-color: rgba(239, 125, 125, .4); }

.ask-result { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(111, 211, 155, .07); border: 1px solid rgba(111, 211, 155, .35); }
.ask-result audio, .ask-result video { width: 100%; margin-top: 8px; }
.ask-result video.vertical { max-height: 60vh; width: auto; max-width: 100%; display: block; }
.ask-card.used .ask-acts .primary { background: transparent; color: var(--ink); border-color: var(--line); }
.doc-table { width: 100%; border-collapse: collapse; margin: 10px 0 14px; font-size: 14px; }
.doc-table th, .doc-table td { text-align: left; padding: 8px 10px; border: 1px solid var(--line); vertical-align: top; }
.doc-table th { background: #120f18; }

/* ---- Ask: formatted answers + Copy / Report ---- */
.ask-msg.bot p { margin: 0 0 8px; } .ask-msg.bot p:last-of-type { margin-bottom: 4px; }
.ask-msg.bot ul, .ask-msg.bot ol { margin: 4px 0 8px; padding-left: 22px; } .ask-msg.bot li { margin: 3px 0; }
.ask-h1, .ask-h2 { font: 600 18px "Playfair Display", serif; color: var(--gold); margin: 10px 0 6px; }
.ask-h3 { font-weight: 700; margin: 8px 0 4px; }
.ask-msg.bot code { background: #241c30; padding: 1px 5px; border-radius: 5px; font-size: 13px; }
.ask-code { background: #0b0910; border: 1px solid var(--line); border-radius: 10px; padding: 10px; overflow-x: auto; font-size: 13px; white-space: pre; }
.ask-tbl { overflow-x: auto; margin: 6px 0 10px; } .ask-tbl table { border-collapse: collapse; font-size: 14px; }
.ask-tbl th, .ask-tbl td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; vertical-align: top; } .ask-tbl th { color: var(--gold); }
.ask-msg.bot hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
.ask-tools { display: flex; gap: 6px; margin-top: 6px; opacity: .75; }
.ask-tool { background: transparent; border: 1px solid var(--line); color: var(--muted); padding: 3px 9px; font-size: 12px; border-radius: 8px; }
.ask-tool:hover { color: var(--ink); opacity: 1; }

.lip-longer p { margin: 0 0 8px; } .lip-longer-opts { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 8px; }

/* ---- lip-sync with the user's own audio ---- */
.lip-upload { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.lip-up-note { margin: 0; }
.lip-upload-cta { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; margin: 4px 0 14px;
  padding: 12px 14px; border-radius: 14px; background: rgba(226, 184, 110, .10); border: 1px solid var(--gold); color: var(--ink); cursor: pointer; }
.lip-upload-cta small { color: var(--muted); font-weight: 400; font-size: 13px; }

/* =====================================================================
   UI refinement, Phase 1 (16 Oct 2026): readable links, layered shades, controls that look like what they are
   ===================================================================== */
:root { --line: #43395a; --panel2: #231d2f; --panel3: #2d2639; --inset: #0e0b14; --link: #f2d08f; --muted: #c2b8d1; }
/* links: never default blue; always visible on every shade */
a, a:visited { color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover, a:focus-visible { color: #fff; }
a.btn-link, a.cta, a.topup, a.home-btn, a.wa-btn, a.kr-btn, a.cb-go, .camp-banner, .tabs a { text-decoration: none; }
a.cta, a.topup, a.kr-btn, a.cb-go { color: var(--gold-ink); }
a.wa-btn { color: #062b14; }
.camp-banner, .camp-banner:visited { color: var(--ink); }
/* boxes sit on a lighter shade than the page so their edges and contents read clearly */
.card { background: var(--panel); border-color: var(--line); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 6px 22px rgba(0,0,0,.35); }
.card .card, .card-panel:not(:empty), .plan, .billing, .progress, .last-frame, .ask-msg.bot, .hm.bot { background: var(--panel2); border-color: var(--line); }
input, select, textarea { background: var(--inset); border: 1px solid #5a4e72; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
::placeholder { color: #8f84a3; }
/* buttons: three clear levels */
button { min-height: 44px; background: var(--panel3); border: 1px solid #62567d; color: var(--ink); }
button:hover:not(:disabled) { background: #382f48; border-color: var(--gold); }
button.primary { background: var(--gold); color: var(--gold-ink); border: 1px solid var(--gold); font-weight: 700; }
button.primary:hover:not(:disabled) { background: #f0cd8c; }
button.primary.alt, button.primary-ish, button.install { background: transparent; color: var(--link); border: 1px solid var(--gold); }
button.small, .small { min-height: 36px; }
button:focus-visible, summary:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.report-link, .help-human, .ask-del, .thumbs button { min-height: 0; background: none; border: 0; }
.thumbs button { background: rgba(0,0,0,.7); }
.report-link { color: var(--muted); text-decoration: underline; }
.help-human { color: var(--link); text-decoration: underline; }
/* checkboxes and radios: big, bordered, obvious when on */
input[type=checkbox], input[type=radio] { -webkit-appearance: none; appearance: none; width: 24px !important; height: 24px !important; flex: none;
  margin: 0 !important; padding: 0; border: 2px solid #8e82a8; background: var(--inset); display: inline-grid; place-content: center; cursor: pointer; }
input[type=checkbox] { border-radius: 7px; } input[type=radio] { border-radius: 50%; }
input[type=checkbox]::after { content: ""; width: 12px; height: 7px; border: 3px solid var(--gold-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px,-1px); opacity: 0; }
input[type=radio]::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--gold-ink); opacity: 0; }
input[type=checkbox]:checked, input[type=radio]:checked { background: var(--gold); border-color: var(--gold); }
input[type=checkbox]:checked::after, input[type=radio]:checked::after { opacity: 1; }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.chip input { position: absolute; opacity: 0; width: 1px !important; height: 1px !important; }
label.check { padding: 10px 12px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
label.check:has(input:checked) { border-color: var(--gold); background: rgba(226,184,110,.10); }
label.check .hint { padding-left: 34px; }
/* option cards (engine, photos, lip choices): whole card is the target */
.engine-opt, fieldset.photos label { background: var(--panel2); border: 2px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; }
.engine-opt:has(input:checked), fieldset.photos label:has(input:checked) { border-color: var(--gold); background: rgba(226,184,110,.14); }
.engine-opt { align-items: center; }
/* folded panels: look like buttons with a chevron */
details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--panel2); color: var(--link); font-weight: 600; min-height: 44px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "\25B8"; font-size: 15px; color: var(--gold); transition: transform .15s; }
details[open] > summary::before { transform: rotate(90deg); }
details[open] > summary { border-color: var(--gold); margin-bottom: 10px; }
details > summary:hover { background: var(--panel3); }
.group-box > summary { background: none; border: 0; padding: 0; color: var(--ink); } .group-box > summary::before { content: none; }
.lib-notmade summary { color: var(--muted); }
/* tabs and filters: real segmented controls with a visible selected state */
.tabs { background: rgba(14,11,20,.96); }
.tabs button, .lib-chips button { background: var(--panel2); color: var(--ink); border: 1px solid #62567d; }
.tabs button.active, .lib-chips button.on, .chip-btn.on { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); font-weight: 700; box-shadow: 0 0 0 2px rgba(226,184,110,.3); }
.lib-chips button span { opacity: 1; font-weight: 700; margin-left: 4px; background: rgba(0,0,0,.28); padding: 1px 7px; border-radius: 99px; font-size: 12px; }
.lib-chips button.on span { background: rgba(0,0,0,.18); }
.lib-chips { padding: 6px; background: var(--inset); border: 1px solid var(--line); border-radius: 16px; }
.chip span { background: var(--panel2); border-color: #62567d; }
.card-actions .on { background: rgba(226,184,110,.15); }
.card-text summary, .k-preview summary, .lyric-help summary, .howto summary, .price-table summary, details.more summary { color: var(--link); }
.doc a, footer a, .song a, .small-link, .share-actions a, .rules-banner a, table.ledger a, .k-cert a { color: var(--link); }
.hint, .fine, .muted { color: var(--muted); }

/* Phase 1b: Ask sidebar tools as a list, clear delete button, real tabs for the My creations filter */
.ask-side .ask-tools { display: grid; grid-template-columns: 1fr; gap: 6px; margin: 0; opacity: 1; }
.ask-side .ask-tools button { width: 100%; text-align: left; min-height: 44px; font-size: 15px; background: var(--panel3); border: 1px solid #62567d; }
.ask-del { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 4px 10px; margin-left: 6px; opacity: 1; font-size: 13px;
  color: #ff9d9d; background: rgba(239,125,125,.10); border: 1px solid rgba(239,125,125,.55); border-radius: 10px; }
.ask-del:hover { background: rgba(239,125,125,.25); color: #fff; }
@media (max-width: 760px) { .ask-del span { display: none; } }
.ask-thread { gap: 0; }
.ask-open { background: var(--panel3); border: 1px solid var(--line); }
.lib-chips { gap: 0; padding: 0; background: none; border: 0; border-bottom: 2px solid var(--line); border-radius: 0; margin: 6px 0 14px; }
.lib-chips button { background: none; border: 0; border-bottom: 4px solid transparent; border-radius: 10px 10px 0 0; margin-bottom: -2px; padding: 10px 20px;
  color: var(--muted); font-size: 16px; box-shadow: none; }
.lib-chips button:hover:not(:disabled) { background: var(--panel2); border-color: transparent; color: var(--ink); }
.lib-chips button.on { background: var(--panel2); color: var(--gold); border-bottom-color: var(--gold); box-shadow: none; }
.lib-chips button.on:hover { border-bottom-color: var(--gold); }

/* Phase 1c: delete = icon only; filter tabs get visible borders */
.ask-del span { display: none; }
.ask-del { padding: 4px 9px; }
.lib-chips button { border: 1px solid var(--line); border-bottom: 4px solid transparent; border-radius: 12px 12px 0 0; margin-right: 6px; background: var(--inset); }
.lib-chips button.on { border-color: var(--gold); border-bottom-color: var(--gold); background: var(--panel2); }
.lib-chips button:hover:not(:disabled) { border-color: #62567d; border-bottom-color: transparent; }
.lib-chips button.on:hover { border-color: var(--gold); border-bottom-color: var(--gold); }

/* Phase 1d: the three filter tabs always stay on one line, even on narrow phones */
.lib-chips { flex-wrap: nowrap; }
.lib-chips button { flex: 1 1 0; min-width: 0; padding: 10px 6px; margin-right: 4px; white-space: nowrap; font-size: 15px; }
.lib-chips button:last-child { margin-right: 0; }
@media (max-width: 400px) { .lib-chips button { font-size: 14px; padding: 10px 2px; } .lib-chips button span { padding: 1px 5px; margin-left: 2px; } }

/* ---- Phase 2: launcher tiles on Ask home, Video | Lip-sync switch, audio chooser ---- */
.launch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px auto 12px; max-width: 640px; text-align: left; }
.tile { display: grid; gap: 2px; align-content: start; min-height: 112px; padding: 14px; border-radius: 16px; background: var(--panel3); border: 1px solid #62567d; }
.tile:hover { border-color: var(--gold); background: #382f48; }
.tile i { font-style: normal; font-size: 30px; line-height: 1.1; } .tile b { font-size: 16px; } .tile small { color: var(--muted); font-weight: 400; font-size: 13px; line-height: 1.3; }
@media (max-width: 520px) { .launch-grid { grid-template-columns: repeat(2, 1fr); } }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; margin: 0 0 16px; background: var(--inset); border: 1px solid var(--line); border-radius: 16px; }
.seg button { min-height: 48px; border-radius: 12px; background: transparent; border: 1px solid transparent; color: var(--muted); font-size: 15px; }
.seg button.on { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
@media (max-width: 420px) { .seg button { font-size: 13px; padding: 8px 6px; } }
#videostudio.lip-pick-mode #video-form, #videostudio.lip-pick-mode > h2 + p { display: none !important; }
.pick-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 12px; }
.pick-card { display: grid; gap: 2px; justify-items: start; text-align: left; padding: 14px; border-radius: 16px; background: var(--panel3); border: 2px solid #62567d; }
.pick-card i { font-style: normal; font-size: 26px; } .pick-card small { color: var(--muted); font-weight: 400; }
.pick-card:hover { border-color: var(--gold); }
@media (max-width: 520px) { .pick-cards { grid-template-columns: 1fr; } }
.pick-list { display: grid; gap: 6px; max-height: 320px; overflow-y: auto; margin: 0 0 12px; }
.pick-song { text-align: left; justify-content: flex-start; }
.lip-steps { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; counter-reset: s; padding: 0; margin: 10px 0 4px; font-size: 13px; }
.lip-steps li { counter-increment: s; padding: 4px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--inset); color: var(--muted); }
.lip-steps li::before { content: counter(s) ". "; font-weight: 700; } .lip-steps li.done { color: var(--ok); border-color: var(--ok); }
#lip-from-upload { display: none !important; }

/* Phase 2b: on phones the Ask message box is always on screen from the first visit (tiles are compact, the box sticks above the tab bar) */
@media (max-width: 760px) {
  .card.ask { overflow: visible; }
  .ask-log { min-height: 0; max-height: none; }
  .ask-empty { padding: 8px 0; margin: 0; }
  .ask-empty h3 { font-size: 18px; }
  .ask-empty > .fine { margin: 4px 0; }
  .launch-grid { gap: 8px; margin: 10px auto 8px; }
  .tile { min-height: 84px; padding: 10px; } .tile i { font-size: 24px; } .tile b { font-size: 15px; } .tile small { display: none; }
  .ask-form { position: sticky; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 5; background: var(--panel); padding: 8px 0; border-top: 1px solid var(--line); }
}

/* Phase 2c: on phones the Ask box is docked (fixed) right above the tab bar */
@media (max-width: 760px) {
  body.ask-on .ask-form { position: fixed; left: 0; right: 0; bottom: calc(60px + env(safe-area-inset-bottom)); margin: 0; padding: 8px 12px; background: var(--panel2); border-top: 1px solid var(--line); z-index: 20; }
  body.ask-on .ask-main { padding-bottom: 84px; }
}

/* ---- Phase 3: My creations action buttons: icon over a name; "open" ones show a panel below (▾), "go" ones act at once ---- */
.card-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; }
.card-actions .act { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 8px 4px; border-radius: 14px;
  background: var(--panel3); border: 1px solid #62567d; color: var(--ink); font: 600 13px Inter, sans-serif; text-decoration: none; cursor: pointer; }
.card-actions .act i { font-style: normal; font-size: 22px; line-height: 1.1; }
.card-actions .act.open span::after { content: " \25BE"; color: var(--gold); }
.card-actions .act.go { border-color: var(--gold); }
.card-actions .act:hover { background: #382f48; border-color: var(--gold); }
.card-actions .act.on { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.card-actions .act.on span::after { content: " \25B4"; color: var(--gold-ink); }

/* Ask answers: tap-to-open links to the right tab */
.ask-go { display: inline-flex; min-height: 36px; padding: 4px 14px; margin: 2px 2px; border-radius: 99px; background: var(--gold); color: var(--gold-ink); border: 1px solid var(--gold); font-weight: 700; font-size: 14px; }
.ask-go:hover:not(:disabled) { background: #f0cd8c; }

.lip-part { background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin: 0 0 14px; }
.lip-part p { margin: 4px 0 8px; } .lip-part-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.lip-part-row label { margin: 0; display: flex; align-items: center; gap: 8px; } .lip-part-row input { margin: 0; }

button.nudge { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); animation: pulse 1.6s ease-out 3; }

/* ---- Phase 4b: Song tab switch, step order, sticky Make bar; Credits tab folds ---- */
#studio:not(.group-mode) #group-box { display: none; }
#studio.group-mode #song-form, #studio.group-mode .preset-box { display: none; }
.group-box > summary { display: none; }
h3.step.first { border-top: 0; padding-top: 0; margin-top: 8px; }
#lyric-ask { margin: 0 0 8px; }
.credits-guide { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; font-size: 14px; }
.credits-guide b { color: var(--gold); }
#purchases { margin-top: 14px; }
#song-form .compose-row { position: sticky; bottom: 0; z-index: 4; background: var(--panel); padding: 10px 0; border-top: 1px solid var(--line); margin-top: 10px; }
@media (max-width: 640px) { #song-form .compose-row { bottom: calc(64px + env(safe-area-inset-bottom)); } }

/* 🔔 notifications bell (the festival campaign lives here) and no always-on credits strip on the Song tab */
#wallet { display: none; }
.bell-wrap { position: relative; }
#bell { position: relative; min-height: 44px; min-width: 44px; padding: 8px 12px; font-size: 18px; border-radius: 12px; }
.bell-n { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font: 700 12px/20px Inter, sans-serif; text-align: center; }
.bell-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: min(340px, calc(100vw - 24px)); background: var(--panel2); border: 1px solid var(--gold);
  border-radius: 14px; padding: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.55); }
.bell-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 10px; border-radius: 10px; background: var(--panel3); }
.bell-item .bi-ic { font-size: 28px; } .bell-item b { display: block; } .bell-item small { color: var(--muted); font-weight: 400; }
.bell-item em { font-style: normal; background: var(--gold); color: var(--gold-ink); padding: 6px 10px; border-radius: 10px; font-weight: 700; font-size: 13px; }

/* bell box: on phones it is a full-width sheet under the header, never cut off at the left edge */
@media (max-width: 760px) {
  .bell-wrap { position: static; }
  .bell-panel { position: fixed; left: 12px; right: 12px; top: calc(72px + env(safe-area-inset-top)); width: auto; }
}
