/* Versetta app UI. Dark studio look shared with VeloMac: graphite ground, blue→violet actions, bolt-yellow accents. */
@font-face { font-family: "Inter"; src: url("../fonts/Inter-VF.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
:root {
  --ground: #0b0e16; --panel: #121725; --panel-2: #182033; --panel-3: #1f2840; --line: #262f47;
  --ink: #eef1f8; --ink-2: #a8b0c6; --ink-3: #6f7891;
  --blue: #2e73fa; --violet: #7a52f5; --bolt: #ffd640; --good: #34c77b; --bad: #ef5050;
  --radius: 12px; --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--ground); color: var(--ink); font: 400 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--bolt); outline-offset: 2px; }
.hidden { display: none !important; }

/* Top bar */
.top { height: 58px; display: flex; align-items: center; gap: 18px; padding: 0 max(16px, env(safe-area-inset-left, 0px)); border-bottom: 1px solid var(--line); background: rgba(11,14,22,.92); padding-top: env(safe-area-inset-top, 0px); box-sizing: content-box; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; letter-spacing: -.03em; text-decoration: none; color: var(--ink); flex: none; }
.brand img { width: 28px; height: 28px; }
.brand span { background: linear-gradient(120deg, #6aa1ff, #a487ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.modes { display: flex; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; overflow-x: auto; scrollbar-width: none; }
.modes button { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 600; white-space: nowrap; }
.modes button.on { background: var(--panel-3); color: var(--ink); box-shadow: 0 1px 0 rgba(255,255,255,.06) inset; }
.spacer { flex: 1; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); font-weight: 600; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #3a4566; }
.btn.primary { border: 0; background: linear-gradient(135deg, var(--blue), var(--violet)); color: #fff; }
.btn.pro { border-color: rgba(255,214,64,.4); color: var(--bolt); background: rgba(255,214,64,.08); }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Layout */
.workspace { display: grid; grid-template-columns: 360px 1fr; height: calc(100% - 59px - env(safe-area-inset-top, 0px)); }
.side { border-right: 1px solid var(--line); overflow-y: auto; padding: 14px 14px 40px; background: var(--panel); }
.stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.preview-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 22px; background: radial-gradient(60% 60% at 50% 40%, #151b2c, var(--ground)); }
#preview { width: auto; height: auto; max-width: 100%; max-height: 100%; min-width: 0; min-height: 0; border-radius: 10px; box-shadow: 0 30px 70px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.06); background: #000; }
.transport { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--panel); }
.play { width: 40px; height: 40px; border-radius: 50%; border: 0; background: linear-gradient(135deg, var(--blue), var(--violet)); color: #fff; display: grid; place-items: center; flex: none; }
.time { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 13px; min-width: 92px; }
.scrub { flex: 1; position: relative; height: 34px; display: flex; align-items: center; }
.scrub input { width: 100%; margin: 0; accent-color: var(--blue); position: relative; z-index: 2; background: transparent; }
.markers { position: absolute; left: 8px; right: 8px; top: 2px; height: 8px; z-index: 1; pointer-events: none; }
.markers i { position: absolute; top: 0; width: 2px; height: 8px; border-radius: 1px; background: var(--bolt); opacity: .8; }

/* Panels */
.sec { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); margin-bottom: 12px; }
.sec > h3 { margin: 0; padding: 12px 14px 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; display: flex; align-items: center; justify-content: space-between; }
.sec .body { padding: 10px 14px 14px; display: grid; gap: 10px; }
label.f { display: grid; gap: 5px; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.in, select.in, textarea.in { width: 100%; background: var(--ground); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; color: var(--ink); font-size: 14px; }
textarea.in { resize: vertical; min-height: 120px; line-height: 1.5; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--ground); color: var(--ink-2); padding: 6px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.chip.on { border-color: transparent; background: linear-gradient(135deg, var(--blue), var(--violet)); color: #fff; }
.drop { border: 1.5px dashed #34405f; border-radius: 10px; padding: 12px; display: flex; align-items: center; gap: 10px; color: var(--ink-2); background: var(--ground); cursor: pointer; }
.drop:hover { border-color: var(--blue); }
.drop .ic { width: 34px; height: 34px; border-radius: 9px; background: var(--panel-3); display: grid; place-items: center; flex: none; }
.drop b { color: var(--ink); display: block; font-size: 13px; }
.drop small { font-size: 12px; }
.drop img.thumb { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; flex: none; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 8px; border: 2px solid transparent; padding: 0; }
.swatch.on { border-color: #fff; }
.colors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.colors label { display: grid; gap: 4px; font-size: 11px; color: var(--ink-3); text-align: center; }
.colors input { width: 100%; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--ground); padding: 2px; }
.toggle { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--ink-2); }
.hint { font-size: 12px; color: var(--ink-3); }

/* Lyric list */
.lines { display: grid; gap: 6px; max-height: 320px; overflow-y: auto; padding-right: 2px; }
.line { display: grid; grid-template-columns: 74px 1fr 30px; gap: 6px; align-items: center; padding: 4px; border-radius: 8px; }
.line.cur { background: rgba(46,115,250,.14); }
.line input.t { width: 74px; font-variant-numeric: tabular-nums; text-align: center; padding: 6px 4px; font-size: 13px; }
.line .tx { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line button { border: 0; background: var(--panel-3); color: var(--ink-2); width: 30px; height: 30px; border-radius: 7px; }
.syncbar { display: none; position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 30; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px; box-shadow: 0 20px 50px rgba(0,0,0,.6); align-items: center; gap: 14px; max-width: calc(100vw - 32px); }
.syncbar.on { display: flex; }
.syncbar .next { max-width: 360px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tap { height: 54px; padding: 0 26px; border-radius: 12px; border: 0; background: var(--bolt); color: #1a1400; font-weight: 800; font-size: 16px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(5,7,12,.7); display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.on { display: flex; }
.dialog { width: 520px; max-width: 100%; max-height: calc(100% - 20px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.dialog .hd { padding: 20px 22px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.dialog .hd h2 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.dialog .hd .x { margin-left: auto; border: 0; background: var(--panel-3); width: 32px; height: 32px; border-radius: 8px; color: var(--ink-2); }
.dialog .bd { padding: 18px 22px 22px; display: grid; gap: 14px; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plan { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--panel-2); display: grid; gap: 6px; }
.plan.best { border-color: rgba(255,214,64,.5); }
.plan .p { font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.plan .p small { font-size: 13px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.plan .tag { font-size: 11px; font-weight: 800; color: #1a1400; background: var(--bolt); border-radius: 999px; padding: 3px 8px; justify-self: start; }
.perks { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; color: var(--ink-2); }
.perks li::before { content: "✓  "; color: var(--good); font-weight: 800; }
.err { color: #ff8b8b; font-size: 13px; }
.ok { color: #6ee7a8; font-size: 13px; }
.bar { height: 8px; border-radius: 4px; background: var(--panel-3); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--violet)); transition: width .2s; }
.opt { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--panel-2); }
.opt p { margin: 0; color: var(--ink-3); font-size: 12px; grid-column: 1; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: rgba(52,199,123,.14); color: #6ee7a8; }
.toast { position: fixed; left: 50%; top: 74px; transform: translateX(-50%); background: var(--panel-3); border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; z-index: 60; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.5); display: none; max-width: calc(100vw - 32px); }
.toast.on { display: block; }

/* Phones and tablets: stack the preview above the controls */
@media (max-width: 860px) {
  body { overflow: auto; }
  .workspace { grid-template-columns: 1fr; height: auto; }
  .stage { order: -1; position: sticky; top: 0; z-index: 5; background: var(--ground); }
  .preview-wrap { height: 42vh; padding: 10px; }
  .side { border-right: 0; padding-bottom: 120px; }
  .top { gap: 10px; }
  .top .label { display: none; }
  .modes button { padding: 7px 9px; }
  .plans { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---- Reels clips, templates and library ---- */
.clips { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.clip { position: relative; aspect-ratio: 9 / 13; border-radius: 10px; overflow: hidden; background: var(--panel-3); border: 1px solid var(--line); }
.clip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.clip .n { position: absolute; left: 5px; top: 5px; font-size: 11px; font-weight: 800; background: rgba(0,0,0,.6); border-radius: 6px; padding: 1px 6px; }
.clip .vid { position: absolute; right: 5px; top: 5px; font-size: 10px; font-weight: 700; background: rgba(0,0,0,.6); border-radius: 6px; padding: 1px 5px; }
.clip .acts { position: absolute; right: 3px; bottom: 3px; display: flex; gap: 2px; }
.clip .acts button { width: 22px; height: 22px; border-radius: 6px; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; cursor: pointer; padding: 0; }
.clip .acts button:focus-visible { outline: 2px solid var(--bolt); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; max-height: 62vh; overflow: auto; padding: 2px; }
.tpl { display: grid; gap: 6px; text-align: left; background: none; border: 0; padding: 0; color: var(--ink); cursor: pointer; font: inherit; }
.tpl .frame { background: var(--panel-3); border-radius: 12px; border: 1px solid var(--line); overflow: hidden; display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 5; }
.tpl canvas { max-width: 100%; max-height: 100%; display: block; }
.tpl b { font-size: 13px; } .tpl small { color: var(--ink-3); font-size: 11px; }
.tpl:hover .frame, .tpl:focus-visible .frame { border-color: var(--bolt); }
.tpl:focus-visible { outline: none; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; max-height: 56vh; overflow: auto; }
.lib-grid button { position: relative; aspect-ratio: 1; padding: 0; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: var(--panel-3); cursor: pointer; }
.lib-grid button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-grid button.on { border-color: var(--bolt); }
.lib-grid button .vid { position: absolute; left: 5px; bottom: 5px; font-size: 10px; font-weight: 700; background: rgba(0,0,0,.6); border-radius: 6px; padding: 1px 5px; color: #fff; }

/* Top bar: buttons keep their size, the mode tabs scroll when space runs out */
.top > * { flex-shrink: 0; }
.top > .modes { flex-shrink: 1; min-width: 0; }
.top > .spacer { flex-shrink: 1; min-width: 0; }
@media (max-width: 1320px) { .top { gap: 10px; } .top .label { display: none; } }
@media (max-width: 1000px) { .top .brand b { display: none; } }
@media (max-width: 640px) {
  .top { flex-wrap: wrap; height: auto; padding-top: calc(8px + env(safe-area-inset-top, 0px)); padding-bottom: 8px; row-gap: 8px; gap: 8px; }
  .top > .modes { order: 10; flex: 1 1 100%; }
  .top .btn { padding: 7px 10px; font-size: 13px; }
  .top a.btn[href="tools.html"] { display: none; }
}

/* ---------- AI studio, insights, cover generator, release kit, brand kit ---------- */
.ai-sec { background: linear-gradient(160deg, rgba(46,115,250,.14), rgba(122,82,245,.1) 60%, var(--panel-2)); border-color: #34407a; }
.ai-sec h3 > span:first-child { display: flex; align-items: center; gap: 6px; color: var(--ink); }
.insights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.insights > div { background: var(--ground); border: 1px solid var(--line); border-radius: 9px; padding: 7px 9px; display: grid; min-width: 0; }
.insights .k { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 700; }
.insights b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insights .energy { grid-column: 1 / -1; gap: 6px; }
.undo { display: flex; gap: 4px; }
.undo .btn { width: 32px; padding: 0; font-size: 16px; }
.tr-box summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.warn { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(255,214,64,.1); border: 1px solid rgba(255,214,64,.35); color: #ffe58a; font-size: 13px; }
.cover-gen { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; }
.cg-preview canvas { width: 100%; height: auto; aspect-ratio: 1; border-radius: 12px; box-shadow: 0 20px 50px rgba(0,0,0,.5); display: block; background: #000; }
.cover-gen .opt textarea { margin: 6px 0; min-height: 60px; }
.kit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.kit { background: var(--ground); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 8px; align-content: start; }
.kit .frame { height: 150px; display: grid; place-items: center; background: #05060a; border-radius: 8px; overflow: hidden; }
.kit .frame canvas { max-width: 100%; max-height: 150px; }
.kit > div:last-child { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 6px; font-size: 13px; }
.kit small { color: var(--ink-3); grid-column: 1; }
.kit .btn { grid-row: 1 / span 2; grid-column: 2; }
.brand-now { display: flex; align-items: center; gap: 6px; min-height: 30px; }
.brand-now i { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line); }
.brand-now span { color: var(--ink-2); font-size: 13px; margin-left: 6px; }
@media (max-width: 760px) { .cover-gen { grid-template-columns: 1fr; } .insights { grid-template-columns: repeat(2, 1fr); } }
.cover-gen .opt { grid-template-columns: 1fr; }

/* =====================================================================
   Versetta 2.2 layout: icon rail + one panel, stage toolbar, waveform timeline
   ===================================================================== */
:root { --rail: 76px; --side: 344px; --glow: 0 0 0 1px rgba(122,140,255,.35), 0 8px 30px rgba(46,115,250,.18); }
body { background: radial-gradient(1200px 600px at 70% -10%, rgba(122,82,245,.10), transparent 60%), var(--ground); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--bolt); color: #1a1400; padding: 8px 12px; border-radius: 8px; font-weight: 700; text-decoration: none; }
.skip:focus { top: 8px; }

/* Top bar */
.top { gap: 8px; background: rgba(11,14,22,.86); backdrop-filter: saturate(140%) blur(10px); -webkit-backdrop-filter: saturate(140%) blur(10px); position: relative; z-index: 20; }
.brand b { font-weight: 800; font-size: 19px; letter-spacing: -.035em; }
.brand span { background: linear-gradient(120deg, #8db4ff, #b69cff 60%, #ffd640); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand { margin-right: 8px; }
.btn { transition: background .15s, border-color .15s, transform .08s; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover, .btn.ghost.on { background: var(--panel-2); border-color: var(--line); color: var(--ink); }
.btn.primary { box-shadow: 0 6px 20px rgba(76,92,250,.35); }
.btn.primary:hover { filter: brightness(1.08); }
@media (max-width: 1320px) { .top .label { display: inline; } }
@media (max-width: 1120px) { .top .label { display: none; } }
.saved { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); margin-left: 6px; white-space: nowrap; }
.saved i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px rgba(52,199,123,.15); }
.saved.saving i { background: var(--bolt); box-shadow: 0 0 0 3px rgba(255,214,64,.15); }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 6px; box-shadow: 0 24px 60px rgba(0,0,0,.55); display: grid; z-index: 40; }
.menu [role=menuitem] { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--ink); text-decoration: none; background: none; border: 0; text-align: left; font: inherit; cursor: pointer; }
.menu [role=menuitem]:hover, .menu [role=menuitem]:focus-visible { background: var(--panel-2); outline: none; }
.menu [role=menuitem] > span { width: 20px; text-align: center; color: var(--ink-3); }

/* Workspace: rail | panel | stage */
.workspace { grid-template-columns: var(--rail) var(--side) minmax(0, 1fr); }
.rail { display: flex; flex-direction: column; gap: 4px; padding: 10px 8px; border-right: 1px solid var(--line); background: rgba(14,18,30,.9); overflow-y: auto; }
.rail button { display: grid; justify-items: center; gap: 4px; padding: 10px 2px 8px; border: 0; border-radius: 12px; background: none; color: var(--ink-3); font: 600 11px/1.1 var(--font); cursor: pointer; position: relative; }
.rail button i { font-style: normal; width: 36px; height: 30px; display: grid; place-items: center; border-radius: 10px; font-size: 16px; transition: background .15s, color .15s; }
.rail button:hover { color: var(--ink); } .rail button:hover i { background: var(--panel-2); }
.rail button[aria-selected="true"] { color: var(--ink); }
.rail button[aria-selected="true"] i { background: linear-gradient(135deg, var(--blue), var(--violet)); color: #fff; box-shadow: 0 6px 16px rgba(76,92,250,.35); }
.rail button[hidden] { display: none; }
.side { padding: 0 14px 40px; background: var(--panel); }
.side-head { position: sticky; top: 0; z-index: 2; background: linear-gradient(var(--panel) 80%, transparent); padding: 16px 2px 10px; }
.side-head h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.side-head .hint { margin: 2px 0 0; }
.sec.tab-off { display: none !important; }
.sec { background: var(--panel-2); border-color: #283250; transition: border-color .15s; }
.sec:focus-within { border-color: #3b4a78; }
.sec > h3 { color: var(--ink-2); }

/* Stage */
.stage-bar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: rgba(14,18,30,.6); min-width: 0; }
.stage-bar .modes { overflow-x: auto; scrollbar-width: none; flex-shrink: 1; min-width: 0; }
.stage-bar .modes::-webkit-scrollbar { display: none; }
.stage-bar .modes button { display: inline-flex; align-items: center; gap: 6px; }
.stage-bar .modes button i { font-style: normal; opacity: .75; }
.stage-bar .modes button.on { background: linear-gradient(135deg, rgba(46,115,250,.28), rgba(122,82,245,.28)); color: #fff; }
.stage-bar .spacer { flex: 1 1 0; min-width: 0; }
.sizes { flex-wrap: nowrap; flex-shrink: 0; }
.sizes .chip { padding: 5px 9px; font-variant-numeric: tabular-nums; }
.preview-wrap { position: relative; flex-direction: column; gap: 8px; }
.canvas-box { position: relative; line-height: 0; }
#preview { max-width: none; max-height: none; transition: box-shadow .2s; }
.preview-wrap:fullscreen { background: #000; padding: 0; }
.safe { position: absolute; inset: 0; pointer-events: none; border-radius: 10px; overflow: hidden; }
.safe i { position: absolute; background: repeating-linear-gradient(45deg, rgba(239,80,80,.28) 0 8px, rgba(239,80,80,.12) 8px 16px); }
.safe .s-top { left: 0; right: 0; top: 0; height: 13%; }
.safe .s-bottom { left: 0; right: 0; bottom: 0; height: 22%; }
.safe .s-right { right: 0; top: 13%; bottom: 22%; width: 14%; }
.safe b { position: absolute; left: 50%; top: 14%; transform: translateX(-50%); font: 700 11px var(--font); line-height: 1; color: #fff; background: rgba(0,0,0,.55); padding: 4px 8px; border-radius: 999px; white-space: nowrap; }
.now-line:empty { display: none; }

/* Transport with waveform and draggable lyric markers */
.transport { gap: 10px; padding: 10px 18px 6px; }
.tbtn { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink-2); font-size: 15px; flex: none; }
.tbtn:hover { color: var(--ink); border-color: #3a4566; }
.play { width: 44px; height: 44px; box-shadow: 0 6px 18px rgba(76,92,250,.4); font-size: 15px; }
.scrub { height: 48px; }
.scrub .wave { position: absolute; left: 8px; right: 8px; top: 4px; bottom: 4px; width: calc(100% - 16px); height: 40px; pointer-events: none; }
.scrub input[type=range] { -webkit-appearance: none; appearance: none; height: 48px; background: transparent; cursor: pointer; }
.scrub input[type=range]::-webkit-slider-runnable-track { height: 48px; background: transparent; }
.scrub input[type=range]::-moz-range-track { height: 48px; background: transparent; }
.scrub input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 3px; height: 48px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.15); }
.scrub input[type=range]::-moz-range-thumb { width: 3px; height: 48px; border: 0; border-radius: 2px; background: #fff; }
.markers { top: 0; height: 100%; z-index: 3; pointer-events: none; }
.markers i { pointer-events: auto; cursor: ew-resize; top: 0; height: 12px; width: 12px; margin-left: -6px; background: none; opacity: 1; touch-action: none; }
.markers i::before { content: ""; position: absolute; left: 50%; top: 0; width: 10px; height: 10px; margin-left: -5px; background: var(--bolt); border-radius: 3px 3px 50% 50%; box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.markers i::after { content: ""; position: absolute; left: 50%; top: 10px; width: 2px; height: 34px; margin-left: -1px; background: rgba(255,214,64,.45); }
.markers i:hover::before, .markers i.drag::before { transform: scale(1.3); }
.markers i.drag::after { background: var(--bolt); }
.markers i.drag[data-time]::before { content: attr(data-time); width: auto; height: auto; margin-left: 0; transform: translate(-50%, -110%); padding: 2px 6px; border-radius: 6px; font: 700 11px var(--font); color: #1a1400; white-space: nowrap; }
.wave-hint { margin: 0 18px 8px 160px; }
.wave-hint.seen, body:not(.has-lyrics) .wave-hint { display: none; }

/* Quick start */
.dialog.start { width: 920px; }
.dialog.start .hd { align-items: flex-start; }
.dialog.start .hd .hint { margin: 4px 0 0; font-size: 14px; }
.start-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.start-card { display: grid; gap: 6px; align-content: start; text-align: left; padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: linear-gradient(160deg, var(--panel-2), var(--ground)); color: var(--ink); font: inherit; cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; min-height: 156px; }
.start-card:hover, .start-card:focus-visible { border-color: #5a6cff; transform: translateY(-2px); box-shadow: var(--glow); outline: none; }
.start-card i { font-style: normal; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; background: linear-gradient(135deg, var(--blue), var(--violet)); color: #fff; margin-bottom: 4px; }
.start-card b { font-size: 15px; letter-spacing: -.01em; }
.start-card span { font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.start-card small { font-size: 11px; color: var(--ink-3); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-top: auto; }
.start-foot { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; margin-top: 4px; }
.big-drop { padding: 16px; border-width: 2px; }
.big-drop.over { border-color: var(--bolt); background: rgba(255,214,64,.06); }
.big-drop .ic { width: 42px; height: 42px; font-size: 18px; background: rgba(255,214,64,.12); color: var(--bolt); }
#continueBtn[hidden] { display: none; }

/* Template tools, shortcuts, regions, presets */
.tpl-tools { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.tpl-tools input[type=search] { padding: 10px 12px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; align-items: center; }
.keys dt { white-space: nowrap; } .keys dd { margin: 0; color: var(--ink-2); }
kbd { display: inline-block; min-width: 22px; text-align: center; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--line); border-bottom-width: 2px; background: var(--panel-2); font: 600 12px var(--font); }
.region-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.region { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; text-align: left; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--ground); color: var(--ink); font: inherit; cursor: pointer; }
.region .flag { grid-row: 1 / span 2; font-size: 24px; } .region small { color: var(--ink-3); }
.region.on, .region:hover { border-color: var(--blue); box-shadow: var(--glow); }
.presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.presets-t { grid-column: 1 / -1; font-size: 13px; }
.preset { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--ground); color: var(--ink); font: inherit; cursor: pointer; }
.preset span { font-weight: 700; font-size: 13px; } .preset small { color: var(--ink-3); font-size: 11px; }
.preset.on, .preset:hover { border-color: var(--blue); box-shadow: var(--glow); }
.export-sum { margin: 0; }

/* Drop overlay, tour */
.drop-overlay { position: fixed; inset: 0; z-index: 70; display: none; align-items: center; justify-content: center; background: rgba(11,14,22,.72); backdrop-filter: blur(4px); pointer-events: none; }
.drop-overlay.on { display: flex; }
.drop-overlay > div { border: 2px dashed var(--bolt); border-radius: 24px; padding: 40px 56px; text-align: center; display: grid; gap: 8px; background: rgba(255,214,64,.05); }
.drop-overlay b { font-size: 26px; letter-spacing: -.02em; } .drop-overlay span { color: var(--ink-2); }
.tour { position: fixed; z-index: 80; background: var(--panel); border: 1px solid #4a5aa0; border-radius: 14px; padding: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.6), var(--glow); display: grid; gap: 10px; animation: pop .18s ease-out; }
.tour p { margin: 0; font-size: 14px; line-height: 1.45; }
.tour-hi { outline: 2px solid var(--bolt) !important; outline-offset: 3px; border-radius: 12px; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.modal.on .dialog { animation: pop .16s ease-out; }
.toast { top: auto; bottom: 26px; border-color: #3a4566; background: rgba(31,40,64,.96); backdrop-filter: blur(6px); }

/* Accessibility: visible focus everywhere, and larger hit areas on touch */
:focus-visible { outline: 2px solid var(--bolt); outline-offset: 2px; border-radius: 6px; }
@media (pointer: coarse) { .chip { padding: 8px 12px; } .btn.small { height: 36px; } .markers i { width: 22px; margin-left: -11px; } }

/* Tablets and phones: preview on top, panel below, rail becomes a bottom tab bar */
@media (max-width: 860px) {
  :root { --rail: 0px; }
  body { overflow: auto; padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .workspace { display: flex; flex-direction: column; height: auto; }
  .stage { order: 0; position: sticky; top: 0; z-index: 6; background: var(--ground); }
  .side { order: 1; border-right: 0; padding: 0 12px 24px; }
  body:not(.panel-open) .side { display: none; }
  .rail { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; flex-direction: row; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); border-right: 0; border-top: 1px solid var(--line); background: rgba(14,18,30,.96); backdrop-filter: blur(10px); overflow-x: auto; }
  .rail button { flex: 1 0 auto; min-width: 48px; padding: 4px 2px; font-size: 10px; }
  .rail button i { width: 32px; height: 26px; font-size: 14px; }
  .preview-wrap { height: 38vh; padding: 8px; }
  .stage-bar { padding: 8px 10px; flex-wrap: wrap; row-gap: 6px; }
  .stage-bar .modes { order: 5; flex: 1 1 100%; }
  .stage-bar .spacer { display: none; }
  .wave-hint { margin-left: 18px; }
  .saved, .undo { display: none; }
  .start-grid { grid-template-columns: 1fr 1fr; }
  .start-foot { grid-template-columns: 1fr; }
  .presets { grid-template-columns: 1fr 1fr; }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 520px) {
  .top .brand b { display: inline; font-size: 17px; }
  #kitBtn, #newBtn .label { display: none; }
  .top .btn.pro { display: none; }
  .start-card { min-height: 0; padding: 12px; }
  .start-card span { display: none; }
  .region-grid { grid-template-columns: 1fr; }
}
.menu[hidden] { display: none; }

.brand .studio { font-style: normal; font-weight: 600; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; margin-left: -2px; align-self: center; }
@media (max-width: 1000px) { .brand .studio { display: none; } }

.nudge { position: fixed; right: 20px; bottom: 20px; z-index: 65; display: flex; align-items: center; gap: 6px; padding: 8px 10px 8px 14px; border-radius: 14px; background: rgba(31,40,64,.97); border: 1px solid #3a4566; box-shadow: 0 16px 40px rgba(0,0,0,.5); animation: pop .2s ease-out; font-weight: 600; }
.nudge button { border: 0; background: none; font-size: 22px; cursor: pointer; padding: 2px 3px; border-radius: 8px; line-height: 1; transition: transform .12s; }
.nudge button:hover { transform: scale(1.2); background: var(--panel-2); }
.nudge .x { font-size: 13px; color: var(--ink-3); margin-left: 4px; }
@media (max-width: 860px) { .nudge { left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); justify-content: center; } }
.ai-sec > h3 { display: none; } .ai-sec .body { padding-top: 14px; }
[hidden] { display: none !important; }
@media (max-width: 640px) {
  .top { flex-wrap: nowrap; height: 54px; padding-top: env(safe-area-inset-top, 0px); padding-bottom: 0; gap: 4px; }
  .top .btn { padding: 0 10px; height: 34px; }
  .transport { flex-wrap: wrap; row-gap: 4px; padding: 8px 12px 4px; }
  .transport .scrub { order: 5; flex: 1 1 100%; }
  .transport .time { margin-left: auto; }
  .wave-hint { margin: 0 12px 6px; }
}
@media (max-width: 400px) { .top .brand b, .top .brand .studio { display: none; } }

/* ---------- Font picker ---------- */
.font-tabs { gap: 4px; }
.font-tabs .chip { font-size: 12px; padding: 5px 10px; }
.font-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-height: 236px; overflow-y: auto; padding: 2px; scrollbar-width: thin; }
.font-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 66px; padding: 8px 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.font-tile:hover { border-color: rgba(255,255,255,.35); }
.font-tile.on { border-color: var(--bolt); background: rgba(255,214,64,.08); box-shadow: inset 0 0 0 1px var(--bolt); }
.font-tile .aa { font-size: 24px; line-height: 1.1; font-weight: 700; }
.font-tile .nm { font-size: 11px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---------- Music library ---------- */
.music-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 300px; overflow-y: auto; scrollbar-width: thin; }
.music-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.music-row.on { border-color: var(--bolt); }
.music-row .mplay { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; cursor: pointer; font-size: 12px; }
.music-row .mplay:hover { filter: brightness(1.15); }
.music-row .minfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.music-row .minfo b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-row .minfo small { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#musicFilters .chip { font-size: 12px; padding: 5px 10px; }

/* ---------- Pickers: search, tabs with counts, New badges ---------- */
.pick-search { display: flex; gap: 6px; align-items: center; }
.pick-search .in { flex: 1; min-width: 0; height: 34px; padding: 0 10px 0 30px; font-size: 13px; background: var(--panel-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23959bb6' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 10px 50%; }
.seg { display: inline-flex; flex: none; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: var(--panel-2); }
.seg button { border: 0; background: transparent; color: var(--ink-3); font: inherit; font-size: 12px; font-weight: 700; padding: 0 10px; height: 32px; cursor: pointer; }
.seg button.on { background: var(--panel-3); color: var(--ink); }
.pick-tabs { gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.pick-tabs::-webkit-scrollbar { display: none; }
.pick-tabs .chip { flex: none; font-size: 12px; padding: 5px 10px; white-space: nowrap; }
.pick-tabs .chip small { opacity: .6; font-weight: 600; margin-left: 2px; }
.pick-head { display: flex; align-items: baseline; justify-content: space-between; }
i.new { position: absolute; top: 5px; right: 5px; font-style: normal; font-size: 9.5px; font-weight: 800; letter-spacing: .02em; padding: 2px 6px; border-radius: 999px; background: var(--bolt); color: #1a1400; pointer-events: none; }
.hint.empty { grid-column: 1 / -1; text-align: center; padding: 16px 8px; margin: 0; }

/* Fonts: preview with your own title */
.font-tile { position: relative; }
.font-grid { max-height: 300px; }
.font-grid.sample { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.font-grid.sample .font-tile { align-items: flex-start; padding: 10px 10px 8px; min-height: 62px; }
.font-grid.sample .font-tile .aa { font-size: 19px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 26px; }
.font-grid.sample .font-tile .nm { max-width: calc(100% - 4px); }

/* Lyric styles: live preview cards */
.style-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-height: 360px; overflow-y: auto; padding: 2px; margin-top: 2px; scrollbar-width: thin; }
.style-card { position: relative; display: flex; flex-direction: column; gap: 5px; padding: 5px; border-radius: 11px; border: 1px solid var(--line); background: var(--panel-2); color: inherit; cursor: pointer; text-align: left; transition: border-color .15s, transform .15s; }
.style-card canvas { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border-radius: 7px; background: #0b0e16; }
.style-card .nm { font-size: 12px; font-weight: 700; padding: 0 3px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.style-card:hover { border-color: rgba(255,255,255,.35); }
.style-card.on { border-color: var(--bolt); box-shadow: inset 0 0 0 1px var(--bolt); background: rgba(255,214,64,.08); }
.style-card.on .nm::before { content: "✓ "; color: var(--bolt); }
.style-card i.new { top: 9px; right: 9px; }
@media (prefers-reduced-motion: no-preference) { .style-card:active { transform: scale(.98); } }

/* Music: tags, progress and state */
.music-list { max-height: 360px; }
.music-row { position: relative; }
.music-row .minfo b { display: flex; align-items: center; gap: 6px; }
.music-row .minfo b span { overflow: hidden; text-overflow: ellipsis; }
.music-row .minfo b i { position: static; flex: none; font-style: normal; font-size: 9.5px; font-weight: 800; padding: 2px 6px; border-radius: 999px; }
.music-row .minfo b i.using { background: rgba(52,199,123,.16); color: var(--good); }
.music-row .mtags { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.music-row .mtag { border: 1px solid var(--line); background: transparent; color: var(--ink-3); font: inherit; font-size: 10.5px; padding: 1px 7px; border-radius: 999px; cursor: pointer; }
.music-row .mtag:hover { color: var(--ink); border-color: var(--ink-3); }
.music-row .mprog { height: 4px; border-radius: 2px; background: var(--panel-3); margin-top: 6px; cursor: pointer; overflow: hidden; }
.music-row .mprog i { display: block; height: 100%; width: 0; background: var(--bolt); border-radius: 2px; transition: width .25s linear; }
.music-row.playing { border-color: var(--blue); }
.music-row.playing .mplay { background: var(--bolt); color: #1a1400; }
.music-row .btn.small[disabled] { opacity: .8; }

/* ---------- Upload zone ---------- */
.upload-zone { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 18px 14px; border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--panel-2); cursor: pointer; transition: border-color .15s, background .15s; }
.upload-zone:hover, .upload-zone.over { border-color: var(--bolt); background: rgba(255,214,64,.06); }
.upload-zone .uz-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; font-size: 18px; margin-bottom: 4px; }
.upload-zone b { font-size: 13.5px; }
.upload-zone small { font-size: 11.5px; color: var(--ink-3); max-width: 30ch; }

/* ---------- Light mode (html[data-theme=light], set by js/theme.js) ---------- */
[data-theme=light] {
  --ground: #eef0f7; --panel: #ffffff; --panel-2: #f5f6fb; --panel-3: #e6e9f4; --line: #d9dceb;
  --ink: #12163a; --ink-2: #454c6e; --ink-3: #6b7190; color-scheme: light;
}
[data-theme=light] .top { background: rgba(255,255,255,.9); }
[data-theme=light] .rail { background: rgba(255,255,255,.92); }
[data-theme=light] .stage-bar { background: rgba(255,255,255,.7); }
[data-theme=light] .preview-wrap, [data-theme=light] .stage { background: #e3e6f1; }
[data-theme=light] .btn:hover, [data-theme=light] .tbtn:hover { border-color: #b8bdd6; }
[data-theme=light] .drop { border-color: #c4c9e2; }
[data-theme=light] .modal { background: rgba(18,22,58,.45); }
[data-theme=light] .drop-overlay { background: rgba(238,240,247,.8); }
[data-theme=light] .toast { background: #12163a; color: #fff; border-color: #12163a; }
[data-theme=light] .brand span { background: linear-gradient(120deg, #3a5bff, #6b3ff0); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-theme=light] .badge { background: #e7f8ef; color: #13804b; }
[data-theme=light] .btn.pro { color: #8a5a00; border-color: #e6c463; background: #fff6db; }
[data-theme=light] .err { color: #b42318; }
[data-theme=light] .font-tile.on, [data-theme=light] .music-row.on, [data-theme=light] .style-card.on { border-color: #3d4cff; box-shadow: inset 0 0 0 1px #3d4cff; background: #eceefe; }
[data-theme=light] .upload-zone:hover, [data-theme=light] .upload-zone.over { border-color: #3d4cff; background: #eceefe; }
[data-theme=light] .chip.on { color: #fff; }
.theme-item .moon { display: none; } [data-theme=dark] .theme-item .moon, :root:not([data-theme]) .theme-item .moon { display: inline; } [data-theme=dark] .theme-item .sun { display: none; }

/* Account button in the editor */
.acct-btn { display: inline-flex; align-items: center; gap: 8px; }
.acct-btn .av { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, #3a5bff, #4b3ff0); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.saved.cloud i { background: var(--blue); }
/* Right-to-left languages */
[dir=rtl] .rail { border-right: 0; border-left: 1px solid var(--line); }

/* Interface fonts for Arabic and Hindi */
html[lang=ar] { --font: "Cairo", "Noto Sans Arabic", "Inter", -apple-system, sans-serif; }
html[lang=hi] { --font: "Mukta", "Noto Sans Devanagari", "Inter", -apple-system, sans-serif; }
html[lang=ar] *, html[lang=hi] * { letter-spacing: normal !important; }
[dir=rtl] .time,[dir=rtl] #time{direction:ltr;unicode-bidi:isolate}
[data-theme=light] .stage-bar .modes button.on { background: linear-gradient(135deg, #3a5bff, #6b3ff0); color: #fff; }
[data-theme=light] .swatch.on { border-color: #12163a; }

/* Save exports to the account */
.save-acct{display:flex;gap:12px;align-items:flex-start;padding:12px 14px;border:1px solid var(--line,#2a3150);border-radius:12px;margin:10px 0;cursor:pointer}
.save-acct input{width:18px;height:18px;margin-top:2px;accent-color:#3d4cff;flex:none}
.save-acct span{display:grid;gap:2px}
.save-acct small{color:var(--ink-2,#9aa3c7);font-size:13px}
.lib-pill{position:fixed;left:16px;bottom:16px;z-index:90;display:flex;align-items:center;gap:12px;width:min(380px,calc(100vw - 32px));padding:12px 12px 12px 14px;border-radius:14px;background:#141a30;color:#eef1f8;border:1px solid #2a3260;box-shadow:0 12px 36px rgba(0,0,0,.35);overflow:hidden}
.lib-pill.hidden{display:none}
.lib-pill .lib-ic{width:34px;height:34px;border-radius:10px;flex:none;background:#3d4cff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 18a5 5 0 01-.9-9.9A6 6 0 0118 9a4 4 0 01-1 9'/%3E%3Cpath d='M12 12v8M9 15l3-3 3 3'/%3E%3C/svg%3E") center/20px no-repeat}
.lib-pill.done .lib-ic{background-color:#13804b;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E")}
.lib-pill.err .lib-ic{background-color:#b42318;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M12 7v6M12 17h.01'/%3E%3C/svg%3E")}
.lib-pill .lib-txt{display:grid;gap:2px;flex:1;min-width:0}
.lib-pill .lib-txt b{font-size:14px}
.lib-pill .lib-txt small{font-size:12.5px;color:#aab2d4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lib-pill .lib-bar{position:absolute;left:0;right:0;bottom:0;height:3px;background:rgba(255,255,255,.08)}
.lib-pill .lib-bar i{display:block;height:100%;width:0;background:#ffd23f;transition:width .2s}
.lib-pill.done .lib-bar,.lib-pill.err .lib-bar{display:none}
.lib-pill .lib-x{background:none;border:0;color:#aab2d4;font-size:22px;line-height:1;cursor:pointer;padding:4px 6px}
[data-theme=light] .lib-pill{background:#fff;color:#12163a;border-color:#dcdfec;box-shadow:0 12px 36px rgba(18,22,58,.18)}
[data-theme=light] .lib-pill .lib-txt small,[data-theme=light] .lib-pill .lib-x{color:#5b6285}
[data-theme=light] .lib-pill .lib-bar{background:#eceefe}
[dir=rtl] .lib-pill{left:auto;right:16px}
@media (max-width:600px){.lib-pill{bottom:84px}}
[data-theme=light] .style-card:hover, [data-theme=light] .font-tile:hover { border-color: #b8bdd6; }
[data-theme=light] .style-card.on .nm::before { color: #3d4cff; }
[data-theme=light] .music-row .mprog i { background: #3d4cff; }
[data-theme=light] .music-row.playing .mplay { background: #3d4cff; color: #fff; }
/* Pickers never widen the side panel */
.side { overflow-x: hidden; }
.sec .body > * { min-width: 0; }
.pick-tabs { max-width: 100%; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); padding-right: 18px; }
[dir=rtl] .pick-tabs { -webkit-mask-image: linear-gradient(270deg, #000 88%, transparent); mask-image: linear-gradient(270deg, #000 88%, transparent); padding-right: 0; padding-left: 18px; }
.font-grid.sample .font-tile .aa { font-size: 16px; }
.music-row { min-width: 0; }
.music-row .minfo b span { white-space: nowrap; min-width: 0; }
