:root {
  --overlay: rgba(6, 6, 7, 0.6);
  --surface-strong: rgba(13, 13, 16, 0.7);
  --panel-bg: rgba(13, 13, 16, 0.62);
  --surface-2: rgba(19, 19, 22, 0.7);
  --surface-3: rgba(26, 26, 30, 0.72);
  --surface-soft: rgba(6, 6, 7, 0.3);
  --row-bg: rgba(255, 255, 255, 0.025);
  --input-bg: rgba(6, 6, 7, 0.45);
  --menu-bg: rgba(19, 19, 22, 0.9);
  --bar-bg: rgba(10, 10, 12, 0.72);
  --dialog-bg: #131316;
  --card-gradient: linear-gradient(160deg, rgba(30, 30, 36, 0.8), rgba(16, 16, 19, 0.8));
  --bg: #060607;
  --panel: #0d0d10;
  --card: #131316;
  --card-2: #1a1a1e;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.15);
  --text: #e8e8ec;
  --muted: #9a9aa3;
  --faint: #60606a;
  --accent: #e9397c;   /* pink ala Suno */
  --accent-hover: #f45592;
  --danger: #f9636b;
  --ok: #34d399;
  --bar-h: 76px;
  --radius: 12px;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14.5px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

button { font: inherit; }
a { color: var(--accent); }

/* ── Latar gradasi tipis (untuk efek glass) ─────────────── */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(720px 460px at 8% -10%, rgba(233, 57, 124, 0.14), transparent 65%),
    radial-gradient(640px 420px at 52% 18%, rgba(124, 43, 217, 0.13), transparent 70%),
    radial-gradient(760px 480px at 94% 46%, rgba(37, 99, 235, 0.10), transparent 70%),
    radial-gradient(900px 520px at 30% 112%, rgba(233, 57, 124, 0.08), transparent 65%);
  animation: glow-drift 22s ease-in-out infinite alternate;
}

@keyframes glow-drift {
  to { transform: translate3d(0, -26px, 0) scale(1.05); }
}

/* ── Login overlay ──────────────────────────────────────── */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--overlay);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.login-overlay[hidden] { display: none; }

.login-card {
  width: min(380px, 100%);
  background: var(--surface-strong);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 30px 26px 22px;
  animation: card-in 0.35s ease both;
}

.brand.center { justify-content: center; }

.login-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 8px 0 20px; }

.login-label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.login-label input {
  width: 100%;
  margin-top: 6px;
  padding: 11px 13px;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.login-label input:focus-visible { outline: none; border-color: var(--line-strong); }

.login-err {
  background: rgba(249, 99, 107, 0.12);
  border: 1px solid rgba(249, 99, 107, 0.35);
  color: var(--danger);
  font-size: 12.5px;
  padding: 9px 12px;
  border-radius: 9px;
  margin: 0 0 12px;
}

.login-note { text-align: center; font-size: 11.5px; color: var(--faint); margin: 14px 0 0; }

/* ── Profile ────────────────────────────────────────────── */
.profile-wrap { position: relative; margin-left: auto; }

.profile-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: linear-gradient(var(--card-2), var(--card-2)) padding-box, linear-gradient(120deg, #f5b25c, var(--accent)) border-box;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 210px;
  background: var(--menu-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  padding: 8px;
  z-index: 60;
  animation: card-in 0.18s ease both;
}

.profile-email {
  margin: 0;
  padding: 8px 10px 10px;
  font-size: 12px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
}
.profile-item:hover { background: var(--card-2); }
.profile-item.danger { color: var(--danger); }
.profile-item.danger:hover { background: rgba(249, 99, 107, 0.12); }

@keyframes card-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* ── Shell ──────────────────────────────────────────────── */
.shell {
  display: flex;
  gap: 18px;
  padding: 14px;
  padding-bottom: calc(var(--bar-h) + 14px); /* ruang untuk player bar */
  min-height: 100vh;
}

/* ── Panel Create (kiri) ────────────────────────────────── */
.sidebar {
  flex: none;
  width: 400px;
  align-self: flex-start;
  position: sticky;
  top: 14px;
  /* tinggi selalu memenuhi layar (bukan max-height), jadi kotaknya tetap
     memanjang ke bawah walau bagian lebih Options sedang dilipat */
  height: calc(100vh - var(--bar-h) - 28px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel-bg);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 18px 14px;
}

/* bagian isi form yang discroll; tombol Create & status dipaku di bawah */
#form {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: 3px;
}

.panel-foot {
  flex: none;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* input judul di atas tombol Create — tampil di kedua mode */
.title-block { margin-bottom: 10px; }
.title-block .field-head { font-size: 12.5px; }

/* cover dengan gambar asli (hasil imagegemini) */
.cover .cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* cover yang sedang diminta — berdenyut halus di atas huruf */
.cover.pending { animation: cover-pulse 1.3s ease-in-out infinite; }
@keyframes cover-pulse {
  50% { filter: brightness(1.35) saturate(1.2); }
}

.pb-thumb .cover-mini.imgwrap { position: relative; overflow: hidden; }
.pb-thumb .cover-mini.imgwrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* kartu brand terpisah di atas panel Create */
.brand-card {
  position: relative;
  z-index: 20;
  flex: none;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(260px 120px at 0% 0%, rgba(233, 57, 124, 0.3), transparent 70%),
    radial-gradient(240px 120px at 100% 110%, rgba(245, 162, 92, 0.24), transparent 70%),
    var(--panel-bg);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}
.brand-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.09) 50%, transparent 60%) no-repeat;
  background-size: 250% 100%;
  background-position: 150% 0;
  animation: brand-shine 7s ease-in-out infinite;
  pointer-events: none;
}
@keyframes brand-shine { 0%, 70% { background-position: 150% 0; } 100% { background-position: -50% 0; } }
.brand-card .brand { position: relative; z-index: 1; gap: 12px; }
.brand-card .profile-wrap { position: relative; z-index: 2; }
.brand-badge {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(135deg, #f5a25c 0%, var(--accent) 55%, #b02ad0 100%);
  box-shadow: 0 8px 22px rgba(233, 57, 124, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.brand-badge .logo-music { width: 24px; height: 24px; color: #fff; }
.brand-text { display: grid; line-height: 1.15; }
.brand-card .brand-name { font-size: 20px; }
.brand-tag { margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; }

.brand { display: flex; align-items: center; gap: 10px; }

.brand-name {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(100deg, #fff 55%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* equalizer logo */
.logo-music {
  flex: none;
  display: block;
  width: 28px;
  height: 28px;
  color: var(--accent);
  animation: none;
}
.logo-music.sm { width: 22px; height: 22px; }
.logo-music * { animation: none; }

@keyframes eq-bounce {
  0%, 100% { transform: scaleY(0.35); }
  50% { transform: scaleY(1); }
}


/* seg tab Simple/Advanced style */
.seg {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  background: var(--card-2);
  border-radius: 999px;
}

/* ── Smart wizard 3 langkah ─────────────────────────────── */
.smart-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 2px 0 18px;
  padding: 0;
  list-style: none;
}
.smart-steps::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 16.6%;
  right: 16.6%;
  height: 2px;
  background: var(--line-strong);
}
.smart-steps li { position: relative; display: grid; justify-items: center; gap: 6px; color: var(--faint); font-size: 11.5px; font-weight: 600; }
.step-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  transition: background 0.25s, border-color 0.25s, color 0.25s, box-shadow 0.25s;
}
.smart-steps li.is-active { color: var(--text); }
.smart-steps li.is-active .step-dot { border-color: var(--accent); background: var(--accent); color: #fff; box-shadow: 0 0 0 5px rgba(233, 57, 124, 0.18); }
.smart-steps li.is-done { color: var(--muted); }
.smart-steps li.is-done .step-dot { border-color: var(--accent); background: var(--accent); color: #fff; font-size: 0; }
.smart-steps li.is-done .step-dot::after { content: "✓"; font-size: 13px; }

.smart-step { min-width: 0; animation: smart-in 0.28s ease both; }
@keyframes smart-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.smart-step-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.smart-step-title { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -0.2px; }
.smart-step-sub { margin: 4px 0 12px; color: var(--muted); font-size: 12.5px; }

.smart-idea {
  display: block;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.smart-idea:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233, 57, 124, 0.16); }
.smart-idea-meta { margin: 5px 2px 0; text-align: right; color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.smart-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.smart-chip {
  min-height: 34px;
  padding: 6px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.smart-chip:hover:not(:disabled) { color: var(--text); border-color: var(--accent); background: rgba(233, 57, 124, 0.08); }

.smart-link {
  flex: none;
  min-height: 36px;
  padding: 6px 2px;
  border: 0;
  background: none;
  color: var(--accent-hover);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.smart-link:hover:not(:disabled) { text-decoration: underline; }
#smartResume { margin-top: 10px; }

.smart-cards { display: grid; gap: 10px; min-width: 0; }
.smart-card {
  display: grid;
  gap: 7px;
  width: 100%;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--card-gradient);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s, border-color 0.2s, box-shadow 0.2s;
}
.smart-card:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 10px 26px rgba(233, 57, 124, 0.14); }
.smart-card-head { display: flex; align-items: center; gap: 8px; }
.smart-card-badge { padding: 2px 9px; border-radius: 999px; background: rgba(233, 57, 124, 0.14); color: var(--accent-hover); font-size: 10.5px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; }
.smart-card-edited { color: var(--ok); font-size: 11px; font-weight: 600; }
.smart-card-title { margin: 0; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.smart-card-style, .smart-card-lyrics { margin: 0; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.smart-card-style { -webkit-line-clamp: 2; }
.smart-card-lyrics { -webkit-line-clamp: 3; white-space: pre-line; color: var(--faint); font-style: italic; }
.smart-card-cta { justify-self: end; color: var(--accent-hover); font-size: 12px; font-weight: 700; }

.smart-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.smart-tag { padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: var(--input-bg); color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }

.smart-editor { display: grid; gap: 12px; margin-top: 12px; }
.smart-field { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.smart-field :is(input, textarea) {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.6;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.smart-field input { font-size: 15px; font-weight: 600; }
.smart-field textarea { display: block; resize: vertical; }
.smart-field :is(input, textarea):focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233, 57, 124, 0.16); }
#smartRevert { justify-self: start; }

.smart-regenerate {
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  padding: 9px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.smart-regenerate:hover:not(:disabled) { color: var(--text); border-color: var(--accent); }
.smart-choices-status { margin: 12px 2px 0; color: var(--muted); font-size: 12px; }
.smart-choices-status:empty { display: none; }
[data-panel="smart"] :is(button, input, textarea):focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
[data-panel="smart"] :is(button, input, textarea):disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.smart-loading { display: grid; justify-items: center; gap: 6px; padding: 36px 8px 12px; text-align: center; animation: smart-in 0.28s ease both; }
.smart-loading .gen-eq { height: 34px; margin-bottom: 8px; }
.smart-loading .gen-eq span { width: 5px; }
.smart-loading .gen-sub { justify-content: center; }
.smart-loading .gen-bar { width: min(220px, 80%); margin: 12px 0 0; }

.smart-settings { display: grid; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.smart-settings .slider-field { padding-bottom: 8px; }
.smart-settings .slider-heading label { font-size: 12px; }
.smart-settings .slider-field input[type="range"] {
  display: block;
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  accent-color: var(--accent);
  cursor: pointer;
}
.smart-settings select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  font-weight: 400;
}
.smart-settings select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(233, 57, 124, 0.16); }
.smart-loading[hidden], .smart-step[hidden], #smartResume[hidden], #smartRevert[hidden], #titleBlock[hidden], #model[hidden], #manualSettings[hidden] { display: none; }

.seg .tab {
  flex: 1;
  min-width: 0;
  padding: 8px 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.seg .tab:hover { color: var(--text); }
.seg .tab.active { background: var(--bg); color: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }

/* baris tab mode; pill model di baris berikutnya (desktop & mobile sama) */
.mode-row { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 14px; }
.mode-row .seg { margin-bottom: 0; width: 100%; }

.model-pill {
  width: 100%;
  margin: 0;
  padding: 9px 14px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
}

/* blok input (Lyrics/Style/Deskripsi) — jadi kartu collapsible seperti referensi */
.field-block {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 13px;
  margin-bottom: 12px;
}

.field-block .field-head { font-size: 13px; font-weight: 600; margin-bottom: 9px; }

.field-block textarea,
.field-block input:not([type="checkbox"]) {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  resize: vertical;
  line-height: 1.55;
}

/* versi details: summary dengan chevron kanan */
details.field-block { padding: 0; }
details.field-block summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
}
details.field-block summary::-webkit-details-marker { display: none; }
details.field-block summary:hover { color: var(--text); }
details.field-block > textarea,
details.field-block > .more-body,
details.field-block > input { margin: 0 13px 13px; }
details.field-block[open] > textarea,
details.field-block[open] > .more-body,
details.field-block[open] > input { width: calc(100% - 26px); }

.chev {
  flex: none;
  width: 7px;
  height: 7px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.18s;
}
details.field-block[open] .chev { transform: rotate(45deg); }

.opt { color: var(--faint); font-weight: 400; font-size: 11.5px; }

label { display: block; font-size: 12px; color: var(--muted); }
label.check { display: flex; align-items: center; gap: 8px; margin: 4px 2px 12px; font-size: 13px; color: var(--text); }
label.check input { width: auto; accent-color: var(--accent); }

.more-body input,
.more-body select {
  width: 100%;
  margin-top: 5px;
  padding: 9px 11px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  transition: border-color 0.15s;
}

.more-body { display: grid; gap: 10px; }
.more-body .row { display: flex; gap: 10px; }
.more-body .row label { flex: 1; min-width: 0; }

.field-block :is(textarea, input):focus-visible,
.more-body :is(input, select):focus-visible {
  outline: none;
}
.field-block:focus-within { border-color: var(--line-strong); }

.slider-field { min-width: 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.slider-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.slider-heading label { color: var(--text); font-weight: 600; }
.slider-heading output { color: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; }
.more-body .slider-auto { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.more-body .slider-auto input {
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.field-block .slider-field input[type="range"] {
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  accent-color: var(--accent);
  cursor: pointer;
}
.slider-field input[type="range"]::-webkit-slider-runnable-track { height: 6px; background: var(--muted); border-radius: 999px; }
.slider-field input[type="range"]::-moz-range-track { height: 6px; background: var(--muted); border-radius: 999px; }
.slider-field input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -8px;
  border: 2px solid var(--text);
  border-radius: 50%;
  background: var(--accent);
}
.slider-field input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 2px solid var(--text);
  border-radius: 50%;
  background: var(--accent);
}
.field-block .slider-field input:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
.field-block .slider-field input:disabled { opacity: 0.4; cursor: not-allowed; }
.slider-limits { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
#musicAutoHint { color: var(--muted); }

input[type="file"] { font-size: 12.5px; color: var(--muted); }
input[type="file"]::file-selector-button {
  margin-right: 10px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--card-2);
  color: var(--text);
  cursor: pointer;
}

.hint { font-size: 11.5px; color: var(--faint); margin: 8px 0 0; }

/* tombol Create */
button.primary {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
}

button.primary:hover:not(:disabled) { background: var(--accent-hover); }
button.primary:active:not(:disabled) { transform: scale(0.985); }
button.primary:disabled { opacity: 0.4; cursor: not-allowed; }

.status { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); min-height: 17px; text-align: center; }
.status.error { color: var(--danger); }
.status.ok { color: var(--ok); }

/* ── Area utama (kanan) ─────────────────────────────────── */
.main { flex: 1; min-width: 0; }

.topnav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

#panelToggle { display: none; }

.topnav-items {
  display: flex;
  gap: 4px;
  background: var(--surface-3);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.nav-tab {
  padding: 7px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.nav-tab:hover { color: var(--text); }
.nav-tab.active { background: var(--bg); color: #fff; }

.chip {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-3);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.chip:hover { color: var(--text); border-color: var(--accent); }

.results-title { margin: 4px 2px 14px; font-size: 16px; font-weight: 700; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;  
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--card-2); color: var(--text); }
.icon-btn[hidden] { display: none; }

/* ── Daftar lagu (rows) ─────────────────────────────────── */
.list { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }

.row-track {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--row-bg);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  animation: row-in 0.35s ease both;
}
.row-track:nth-child(2) { animation-delay: 0.05s; }
.row-track:nth-child(3) { animation-delay: 0.1s; }
.row-track:nth-child(4) { animation-delay: 0.15s; }

@keyframes row-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.row-track:hover { background: var(--surface-2); border-color: var(--line-strong); }
.row-track.playing { background: var(--surface-2); border-color: rgba(233, 57, 124, 0.45); box-shadow: 0 0 0 1px rgba(233, 57, 124, 0.12); backdrop-filter: blur(8px); }

/* cover + tombol play overlay */
.cover {
  position: relative;
  flex: none;
  width: 62px;
  height: 62px;
  border-radius: 9px;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.cover-dur {
  position: absolute;
  right: 5px;
  bottom: 4px;
  font-size: 10.5px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  background: rgba(0, 0, 0, 0.4);
  padding: 1px 5px;
  border-radius: 5px;
}

.cover-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.row-track:hover .cover-play { opacity: 1; }
.row-track.playing .cover-play { opacity: 1; }
.cover-play svg { width: 24px; height: 24px; }

.track-info { flex: 1; min-width: 0; }
.track-top { display: flex; align-items: baseline; gap: 8px; }
.track-top h3 { margin: 0; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.model-chip {
  flex: none;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 999px;
  background: linear-gradient(120deg, #f5b25c, #ee7a4b);
  color: #1d1203;
}

.track-desc {
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted);
  /* maks 2 baris dengan ellipsis */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.track-acts { display: flex; gap: 6px; margin-top: 5px; }
.track-acts .icon-btn { width: 28px; height: 28px; }
.track-acts .icon-btn svg { width: 15px; height: 15px; }

/* equalizer kecil saat diputar */
.track-eq { flex: none; display: flex; align-items: flex-end; gap: 3px; height: 18px; margin-right: 4px; opacity: 0; transition: opacity 0.2s; }
.track-eq span { width: 3px; border-radius: 2px; background: var(--accent); transform: scaleY(0.3); transform-origin: bottom; }
.row-track.playing .track-eq { opacity: 1; }
.row-track.playing .track-eq span { animation: eq-bounce 0.8s ease-in-out infinite; }
/* musik dijeda: equalizer membeku */
.row-track.is-paused .track-eq span { animation-play-state: paused; transform: scaleY(0.5); }
.track-eq span:nth-child(1) { height: 55%; animation-delay: -0.6s !important; }
.track-eq span:nth-child(2) { height: 100%; animation-delay: -0.4s !important; }
.track-eq span:nth-child(3) { height: 75%; animation-delay: -0.2s !important; }

/* lirik membuka penuh di baris bawah track, bukan menyempit di ujung flex */
.track-lyric-pop {
  display: none;
  flex-basis: 100%;
  order: 3;
  gap: 16px;
  align-items: start;
  margin: 6px 0 2px;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: default;
  animation: row-in 0.25s ease both;
}
.track-lyric-pop.open { display: grid; grid-template-columns: 170px minmax(0, 1fr); }
.lyric-art {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 12px;
  color: #fff;
  font-size: 48px;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}
.lyric-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lyric-body { display: grid; gap: 8px; min-width: 0; }
.lyric-title { margin: 0; color: var(--text); font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.lyric-text {
  max-height: 240px;
  overflow: auto;
  padding-right: 4px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  scrollbar-width: thin;
}
@media (max-width: 560px) {
  .track-lyric-pop.open { grid-template-columns: minmax(0, 1fr); }
  .lyric-art { width: min(100%, 260px); justify-self: center; }
  .lyric-text { max-height: 300px; }
}
html[data-theme="light"] .lyric-art { box-shadow: 0 12px 30px rgba(200, 90, 120, 0.2); }

#generationProgress ~ #results > .empty-state { display: none; }

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--faint);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}
.empty-eq { display: inline-flex; align-items: flex-end; gap: 4px; height: 30px; margin-bottom: 14px; opacity: 0.45; }
.empty-eq span { width: 5px; border-radius: 3px; background: linear-gradient(180deg, #fff, var(--accent)); }
.empty-eq span:nth-child(1) { height: 35%; }
.empty-eq span:nth-child(2) { height: 70%; }
.empty-eq span:nth-child(3) { height: 100%; }
.empty-eq span:nth-child(4) { height: 55%; }
.empty-eq span:nth-child(5) { height: 85%; }
.empty-eq span:nth-child(6) { height: 45%; }
.empty-eq span:nth-child(7) { height: 65%; }

/* ── Skeleton ───────────────────────────────────────────── */
/* indikator progres generate — tanpa kartu */
.gen-status { display: flex; align-items: center; gap: 14px; padding: 4px 2px 10px; animation: row-in 0.35s ease both; }
.gen-eq { display: flex; align-items: center; gap: 3px; flex: none; height: 28px; }
.gen-eq span {
  width: 4px;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(180deg, #f5a25c, var(--accent));
  animation: eq-bounce 0.9s ease-in-out infinite;
}
.gen-eq span:nth-child(1) { animation-delay: -0.8s; }
.gen-eq span:nth-child(2) { animation-delay: -0.3s; }
.gen-eq span:nth-child(3) { animation-delay: -0.6s; }
.gen-eq span:nth-child(4) { animation-delay: -0.1s; }
.gen-copy { display: grid; gap: 2px; min-width: 0; }
.gen-title { margin: 0; color: var(--text); font-size: 15px; font-weight: 700; letter-spacing: -0.2px; animation: gen-fade 0.4s ease; }
@keyframes gen-fade { from { opacity: 0.3; } to { opacity: 1; } }
.gen-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.gen-step { display: inline-flex; align-items: center; gap: 5px; transition: color 0.3s; }
.gen-step::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.gen-step[data-state="active"]::before { animation: gen-dot 1.2s ease-out infinite; }
@keyframes gen-dot { 0% { box-shadow: 0 0 0 0 rgba(233, 57, 124, 0.6); } 100% { box-shadow: 0 0 0 6px rgba(233, 57, 124, 0); } }
.gen-step[data-state="done"] { color: var(--ok); }
.gen-step[data-state="done"]::before { content: "✓"; width: auto; height: auto; background: none; font-size: 11px; font-weight: 900; }
.gen-step[data-state="failed"] { color: var(--faint); }
.gen-step[data-state="failed"]::before { background: var(--faint); }
.gen-bar { position: relative; height: 2px; margin: 0 2px 14px; overflow: hidden; border-radius: 2px; background: var(--line); }
.gen-bar span {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 35%;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #f5a25c, var(--accent), transparent);
  animation: gen-bar 1.6s ease-in-out infinite;
}
@keyframes gen-bar { from { left: -35%; } to { left: 100%; } }

.spinner {
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton { display: flex; gap: 14px; margin-bottom: 8px; padding: 10px 12px; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: var(--row-bg); }
.skeleton:nth-child(3) .sk { animation-delay: 0.25s; }

.sk {
  border-radius: 7px;
  background: linear-gradient(90deg, var(--card) 25%, var(--card-2) 37%, var(--card) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.sk-cover { flex: none; width: 62px; height: 62px; }
.sk-lines { flex: 1; min-width: 0; display: grid; gap: 8px; }
.sk-title { height: 13px; width: 40%; }
.sk-meta { height: 11px; width: 65%; }

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* ── Player bar (bawah, fixed) ──────────────────────────── */
.playerbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: var(--bar-bg);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border-top: 1px solid var(--line);
}

.song-preview {
  width: min(840px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--dialog-bg);
  color: var(--text);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.5);
  overflow: auto;
  overscroll-behavior: contain;
}
.song-preview::backdrop { background: rgba(0, 0, 0, 0.75); }
body:has(.song-preview[open]) { overflow: hidden; }
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 18px;
  background: var(--dialog-bg);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}
.preview-toolbar .icon-btn { width: 44px; height: 44px; }
.preview-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; padding: 24px; align-items: start; }
.preview-artwork { position: relative; aspect-ratio: 1; overflow: hidden; border-radius: 12px; background: var(--card-2); }
.preview-artwork img { display: block; width: 100%; height: 100%; object-fit: contain; position: absolute; inset: 0; }
.preview-placeholder { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); }
.preview-placeholder[hidden] { display: none; }
.preview-details { min-width: 0; }
.preview-details h2 { margin: 0 0 24px; overflow-wrap: anywhere; font-size: 24px; line-height: 1.3; }
.preview-details h3 { color: var(--muted); font-size: 13px; font-weight: 500; }
.preview-lyrics { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.85; margin-bottom: 0; }
@media (max-width: 560px) {
  .preview-layout { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 20px; }
}

.pb-thumb {
  border: 0;
  padding: 0;
  cursor: pointer;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--card-2);
  overflow: hidden;
}
.pb-thumb:disabled { cursor: default; }
.pb-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.pb-thumb.has-track { background: transparent; }
.pb-thumb.has-track .logo-eq { display: none; }
.pb-thumb .cover-mini {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
}

.pb-info { width: 200px; flex: none; min-width: 0; }
.pb-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-meta { font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pb-controls { flex: none; display: flex; align-items: center; gap: 2px; }

.pb-play {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #000;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.15s;
}
.pb-play:hover { transform: scale(1.06); }
.pb-play:disabled { opacity: 0.35; transform: none; cursor: not-allowed; }

.pb-seek {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.time { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; min-width: 34px; text-align: center; }

.seek {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: var(--card-2);
  cursor: pointer;
  position: relative;
}

.seek-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: var(--accent);
  position: relative;
  transition: width 0.1s linear;
}
.seek-fill::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%) scale(0);
  transition: transform 0.12s;
}
.playerbar:hover .seek-fill::after { transform: translateY(-50%) scale(1); }

.pb-xtr { flex: none; display: flex; align-items: center; }
#pbDownload { text-decoration: none; }

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.55);
  animation: fade-in 0.2s ease both;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ── Responsif ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar { width: 340px; }
  .pb-info { width: 150px; }
}

/* Tablet portrait ke bawah: panel tampil langsung di atas, hasil di bawahnya.
   Tidak ada drawer/hamburger — semuanya satu kolom scroll biasa. */
@media (max-width: 850px) {
  .shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 12px;
    padding-bottom: calc(var(--bar-h) + 24px);
  }
  .main { padding: 0; }

  .sidebar {
    position: static;
    width: auto;
    height: auto;
    align-self: stretch;
    gap: 10px;
  }
  .panel {
    flex: none;
    position: static;
    width: auto;
    height: auto;
    max-height: none;
    overflow: visible;
    align-self: stretch;
    border-radius: 16px;
    /* hormati notch/home indicator */
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }
  #panelToggle { display: none !important; }
  #backdrop { display: none !important; }

  /* profil dipindah JS ke bar logo (panel-head): sejajar kanan dengan logo */
  .panel-head .profile-wrap { margin-left: auto; }
  /* topnav tinggal tab — rapikan ke tengah */
  .topnav { justify-content: center; }
  .profile-menu { right: 0; }

  /* blok collapsible + tombol sentuh lebih besar */
  details.field-block summary { padding: 15px 13px; font-size: 14px; }
  .seg .tab { padding: 10px 6px; }
  .model-pill { padding: 10px 12px; }
  button.primary { padding: 15px; }

  .pb-info { width: 110px; }
  .pb-xtr { display: none; }
}

@media (max-width: 560px) {
  :root { --bar-h: 68px; }
  .playerbar { gap: 8px; padding: 0 12px; }
  .pb-thumb { display: grid; width: 40px; height: 40px; }
  .pb-info { flex: 1; width: auto; }

  /* seek bar menjadi strip tipis selebar layar di tepi atas player bar,
     tetap bisa diklik/ditarik untuk maju-mundur */
  .pb-seek { position: absolute; top: -8px; left: 0; right: 0; gap: 0; }
  .pb-seek .time { display: none; }
  #pbSeek { flex: 1; height: 14px; border-radius: 0; background: transparent; }
  #pbFill {
    position: absolute;
    top: 1px;
    left: 0;
    height: 2px;
    background: var(--accent);
    border-radius: 0;
    transition: width 0.1s linear;
  }
  #pbFill::after {
    /* knob diperbesar sedikit agar mudah disentuh */
    width: 12px;
    height: 12px;
    right: -6px;
  }
  .more-body .row { flex-wrap: wrap; }
  .more-body .row label { flex: 1 1 46%; }
}

@media (hover: none) and (pointer: coarse) {
  .nav-tab, .seg .tab { padding-block: 10px; }
  button.primary { padding: 15px; }
  .icon-btn { width: 40px; height: 40px; }
  .cover-play { opacity: 1; }
  input, textarea, select { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ── Public feed ────────────────────────────────────────── */
.main[data-view="public"] #generationProgress { display: none; }
.main[data-view="public"] .results-title { display: none; }
.main[data-view="public"] #results { display: block; }
.pub-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 2px 0 18px;
  padding: 22px 22px 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(420px 220px at 0% 0%, rgba(233, 57, 124, 0.28), transparent 70%),
    radial-gradient(380px 220px at 100% 100%, rgba(245, 162, 92, 0.22), transparent 70%),
    var(--surface-2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.pub-hero-copy { min-width: 0; }
.pub-eyebrow { display: inline-flex; align-items: center; gap: 7px; color: var(--accent-hover); font-size: 11px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; }
.pub-live { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(233, 57, 124, 0.6); animation: pub-pulse 1.8s ease-out infinite; }
@keyframes pub-pulse { to { box-shadow: 0 0 0 9px rgba(233, 57, 124, 0); } }
.pub-hero-title { margin: 8px 0 4px; font-size: clamp(18px, 2.4vw, 24px); font-weight: 800; letter-spacing: -0.4px; }
.pub-hero-sub { margin: 0; color: var(--muted); font-size: 13px; }
.pub-refresh, .pub-more {
  flex: none;
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}
.pub-refresh:hover, .pub-more:hover:not(:disabled) { border-color: var(--accent); }
.pub-more { display: block; margin: 20px auto 8px; padding: 10px 26px; }
.pub-more:disabled { opacity: 0.6; cursor: progress; }

.pub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.pub-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
  cursor: pointer;
  outline: none;
  transition: transform 0.2s ease, border-color 0.2s, box-shadow 0.2s;
  animation: pub-in 0.35s ease both;
}
@keyframes pub-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pub-card:hover, .pub-card:focus-visible { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28); }
.pub-card:focus-visible { border-color: var(--accent); }
.pub-card.playing { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 14px 34px rgba(233, 57, 124, 0.22); }
.pub-art {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 13px;
  color: #fff;
}
.pub-letter { font-size: 44px; font-weight: 800; text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); }
.pub-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.pub-card:hover .pub-img { transform: scale(1.05); }
.pub-dur, .pub-mine {
  position: absolute;
  z-index: 1;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
}
.pub-dur { right: 8px; bottom: 8px; font-variant-numeric: tabular-nums; }
.pub-mine { left: 8px; top: 8px; background: var(--accent); }
.pub-art .pub-play {
  position: absolute;
  z-index: 2;
  inset: auto;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translate(-50%, -40%) scale(0.9);
  transition: opacity 0.2s, transform 0.2s;
}
.pub-art .pub-play svg { width: 22px; height: 22px; }
.pub-card:hover .pub-play, .pub-card:focus-visible .pub-play, .pub-card.playing .pub-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.pub-card.playing:not(.is-paused) .pub-play { opacity: 0; }
.pub-card.playing:not(.is-paused):hover .pub-play { opacity: 1; }
.pub-eq { position: absolute; z-index: 1; left: 10px; bottom: 10px; height: 20px; margin: 0; }
.pub-eq span { background: #fff; box-shadow: 0 0 6px rgba(0, 0, 0, 0.4); }
.pub-card.playing .pub-eq { opacity: 1; }
.pub-card.playing .pub-eq span { animation: eq-bounce 0.8s ease-in-out infinite; }
.pub-card.is-paused .pub-eq span { animation-play-state: paused; transform: scaleY(0.5); }

.pub-body { display: grid; gap: 5px; min-width: 0; padding: 10px 4px 2px; }
.pub-title-row { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.pub-title { flex: 1; min-width: 0; margin: 0; font-size: 14px; font-weight: 700; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-lyric { flex: none; width: 28px; height: 28px; margin: -4px -4px 0 0; }
.pub-style { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; min-height: 2.9em; }
.pub-meta { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--faint); font-size: 11.5px; }
.pub-avatar { display: grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 50%; background: linear-gradient(135deg, #f5a25c, var(--accent)); color: #fff; font-size: 10px; font-weight: 800; }
.pub-creator { color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pub-time { white-space: nowrap; }
.pub-model { justify-self: start; margin-top: 2px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 10.5px; }
.pub-skeleton { cursor: default; animation: none; gap: 10px; }
.pub-skeleton .pub-art { border-radius: 13px; }
.pub-sk-line { height: 12px; width: 80%; }
.pub-sk-line.short { width: 50%; }
.pub-empty { margin-top: 6px; }

@media (max-width: 640px) {
  .pub-hero { flex-direction: column; align-items: flex-start; padding: 18px 16px; border-radius: 16px; }
  .pub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pub-card { padding: 7px; border-radius: 14px; }
  .pub-art { border-radius: 10px; }
  .pub-body { padding: 8px 2px 2px; }
  .pub-title { font-size: 13px; }
  .pub-art .pub-play { width: 44px; height: 44px; opacity: 0.95; transform: translate(-50%, -50%); }
  .pub-lyric { width: 32px; height: 32px; }
}
html[data-theme="light"] .pub-card:hover, html[data-theme="light"] .pub-card:focus-visible { box-shadow: 0 14px 34px rgba(200, 90, 120, 0.16); }

/* ── Toggle tema ────────────────────────────────────────── */
.theme-toggle .icon-moon { display: none; }
.theme-toggle span#themeLabel { flex: 1; }
.theme-switch {
  position: relative;
  flex: none;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--line-strong);
  transition: background 0.2s;
}
.theme-switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}
.theme-toggle[aria-checked="true"] .theme-switch { background: linear-gradient(120deg, #f5a25c, var(--accent)); }
.theme-toggle[aria-checked="true"] .theme-switch span { transform: translateX(14px); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 1px; }
body, .panel, .create-panel, .playerbar, .profile-menu { transition: background-color 0.3s, color 0.3s, border-color 0.3s; }

/* ── Light mode: gradasi lembut pink · oranye · putih ───── */
html[data-theme="light"] {
  color-scheme: light;
  --bg: #fffaf7;
  --panel: #ffffff;
  --card: #fbeff0;
  --card-2: #f7e6e8;
  --line: rgba(120, 40, 70, 0.1);
  --line-strong: rgba(120, 40, 70, 0.18);
  --text: #2b1b23;
  --muted: #6e5963;
  --faint: #a08b95;
  --accent: #e5306f;
  --accent-hover: #cf2461;
  --overlay: rgba(255, 240, 236, 0.6);
  --surface-strong: rgba(255, 255, 255, 0.82);
  --panel-bg: rgba(255, 255, 255, 0.62);
  --surface-2: rgba(255, 255, 255, 0.66);
  --surface-3: rgba(255, 255, 255, 0.78);
  --surface-soft: rgba(255, 255, 255, 0.45);
  --row-bg: rgba(255, 255, 255, 0.55);
  --input-bg: rgba(255, 255, 255, 0.8);
  --menu-bg: rgba(255, 255, 255, 0.94);
  --bar-bg: rgba(255, 255, 255, 0.78);
  --dialog-bg: #ffffff;
  --card-gradient: linear-gradient(160deg, rgba(255, 255, 255, 0.92), rgba(255, 243, 238, 0.85));
}
html[data-theme="light"] body {
  background: linear-gradient(135deg, #ffffff 0%, #ffe8f0 32%, #fff0e2 64%, #ffffff 100%) fixed;
}
html[data-theme="light"] .bg-glow {
  background:
    radial-gradient(700px 460px at 6% -8%, rgba(255, 138, 180, 0.32), transparent 65%),
    radial-gradient(640px 420px at 55% 16%, rgba(255, 190, 140, 0.26), transparent 70%),
    radial-gradient(760px 480px at 96% 50%, rgba(255, 160, 190, 0.22), transparent 70%),
    radial-gradient(900px 520px at 30% 112%, rgba(255, 200, 150, 0.28), transparent 65%);
}
html[data-theme="light"] .theme-toggle .icon-sun { display: none; }
html[data-theme="light"] .theme-toggle .icon-moon { display: inline; }
html[data-theme="light"] .brand-card::after { background-image: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.55) 50%, transparent 60%); }
html[data-theme="light"] .brand-name { background-image: linear-gradient(100deg, #2b1b23 50%, var(--accent)); }
html[data-theme="light"] .profile-btn {
  background: linear-gradient(#fff, #fff) padding-box, linear-gradient(120deg, #f5b25c, var(--accent)) border-box;
  color: var(--text);
}
html[data-theme="light"] :is(.seg .tab.active, .nav-tab.active) {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 6px rgba(120, 40, 70, 0.14);
}
html[data-theme="light"] .empty-eq span { background: linear-gradient(180deg, #f5a25c, var(--accent)); }
html[data-theme="light"] .pb-play { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(229, 48, 111, 0.3); }
html[data-theme="light"] .seek-fill::after { background: var(--accent); }
html[data-theme="light"] .song-preview::backdrop,
html[data-theme="light"] .backdrop { background: rgba(80, 30, 50, 0.3); }
html[data-theme="light"] .song-preview { box-shadow: 0 24px 70px rgba(120, 40, 70, 0.22); }
html[data-theme="light"] :is(.panel, .brand-card, .playerbar, .login-card, .profile-menu) { box-shadow: 0 10px 34px rgba(200, 90, 120, 0.1); }
