:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --background: #100e17;
  --sidebar: #121019;
  --surface: #191621;
  --field: #13111a;
  --border: #312b3d;
  --text: #f5f1fb;
  --muted: #b4aabd;
  --accent: #c3adff;
  --primary: #b49aff;
  --ink: #180d32;
  --sidebar-width: 224px;
  --dock: 80px;
  --nav: 0px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--background); scroll-padding: 1rem 0 calc(var(--dock) + var(--nav) + var(--safe-bottom) + 1rem); }
body { min-width: 0; margin: 0; color: var(--text); background: var(--background); line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; }
button:disabled, input:disabled { cursor: default; opacity: .48; }
:focus-visible { outline: 2px solid #debaff; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.12; overflow-wrap: anywhere; }
h1 { font-size: clamp(2.15rem, 5vw, 3.5rem); letter-spacing: -.065em; }
h2 { font-size: 1.18rem; letter-spacing: -.025em; }
h3 { font-size: 1rem; }
svg { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: fixed; z-index: 10; top: .5rem; left: .5rem; transform: translateY(-200%); padding: .7rem; background: var(--surface); }
.skip:focus { transform: none; }
.shell { min-height: 100vh; padding-left: calc(var(--sidebar-width) + var(--safe-left)); padding-right: var(--safe-right); }
.sidebar { position: fixed; inset: 0 auto calc(var(--dock) + var(--safe-bottom)) 0; width: calc(var(--sidebar-width) + var(--safe-left)); padding: calc(22px + env(safe-area-inset-top, 0px)) 16px 16px calc(16px + var(--safe-left)); display: flex; flex-direction: column; background: var(--sidebar); border-right: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 10px; align-self: flex-start; min-height: 44px; padding-inline: 5px; font-size: 1rem; font-weight: 850; letter-spacing: .085em; line-height: 1.1; }
.brand img { display: block; border-radius: 11px; }
.brand small { display: block; margin-top: 6px; color: #b6a5cd; font-size: .69rem; font-weight: 700; letter-spacing: .14em; }
.nav-label { margin: 43px 11px 10px; color: var(--muted); font-size: .75rem; letter-spacing: .13em; text-transform: uppercase; font-weight: 750; }
.navigation { display: grid; gap: 5px; }
.navigation a { display: flex; align-items: center; gap: 11px; min-height: 48px; padding: 10px 12px; border: 1px solid transparent; border-radius: 10px; color: var(--muted); font-weight: 650; font-size: .91rem; }
.navigation a:hover, .quiet-button:hover, .tool-row:hover { background: #211a30; color: var(--text); }
.navigation a[aria-current="page"] { color: #e6d9ff; background: #2b2141; border-color: #483667; }
.navigation a[aria-current="page"] svg { color: var(--accent); }
.sidebar-footer { display: flex; gap: 9px; align-items: center; margin-top: auto; padding: 12px 8px; border-top: 1px solid var(--border); font-size: .81rem; }
.sidebar-footer small { display: block; color: var(--muted); font-size: .75rem; }
.local-icon { display: grid; place-items: center; width: 31px; height: 34px; border-radius: 8px; color: #bda9e2; background: #241c33; }
.local-icon svg { width: 17px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 73px; padding: calc(10px + env(safe-area-inset-top, 0px)) clamp(20px, 3.2vw, 48px) 10px; border-bottom: 1px solid var(--border); background: #13101a; }
.breadcrumb, .top-actions { display: flex; align-items: center; gap: 12px; }
.breadcrumb { color: var(--muted); font-size: .91rem; }
.breadcrumb strong { color: var(--text); }
.mobile-brand { display: none; }
main { max-width: 1460px; margin: auto; padding: 28px clamp(20px, 3.2vw, 48px) calc(var(--dock) + var(--nav) + var(--safe-bottom) + 28px); }
.hero { display: flex; align-items: center; min-height: 225px; padding: 25px clamp(21px, 4vw, 55px); border: 1px solid #493565; border-radius: 17px; overflow: hidden; background: linear-gradient(90deg, #191126 4%, #191126d9 30%, #170e2700 79%), #181024 url("./assets/signal.webp") right 55% / cover no-repeat; }
.hero h1 { margin: 8px 0 10px; }
.hero p:last-child { color: #dfd3eb; font-size: clamp(.94rem, 2vw, 1.13rem); }
.eyebrow { display: flex; align-items: center; gap: 9px; color: #dfcaff; text-transform: uppercase; font-weight: 750; letter-spacing: .13em; font-size: .73rem; }
.eyebrow span { display: block; width: 16px; height: 2px; background: var(--accent); }
.create-grid, .editor-grid, .settings-grid { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.create-grid { margin-top: 22px; }
.editor-grid { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rail, .project-grid { display: grid; gap: 16px; }
.project-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 255px), 1fr)); }
.panel { min-width: 0; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); }
.panel-pad, .compose, .engine, .shortcuts { padding: clamp(16px, 2vw, 24px); }
.panel-heading { display: flex; align-items: center; gap: 12px; }
.panel-heading p { margin-top: 4px; color: var(--muted); font-size: .89rem; }
.panel-icon { display: grid; flex: 0 0 auto; place-items: center; width: 40px; height: 40px; border-radius: 10px; }
.purple { color: #d3b9ff; background: #34254c; }
.amber { color: #f7c67f; background: #392916; }
.mint { color: #91e0c7; background: #1b3934; }
.blue { color: #a9c8fa; background: #25334b; }
.engine { border-color: #3b3044; background: linear-gradient(135deg, #221a2b, var(--surface) 68%); }
.engine-status { display: flex; align-items: center; gap: 7px; color: #f3c481 !important; }
.engine-status span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.engine > p, .panel-pad > p, .queue-notice p { margin: 13px 0; color: var(--muted); }
.engine .button { width: 100%; margin-top: 5px; }
.shortcuts h2 { margin-bottom: 11px; }
.tool-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) 18px; align-items: center; gap: 11px; padding: 10px 0; min-height: 56px; border-radius: 7px; }
.tool-row + .tool-row { border-top: 1px solid var(--border); }
.tool-row .panel-icon { width: 36px; height: 36px; }
.tool-row strong, .tool-row small { display: block; }
.tool-row strong { font-size: .91rem; }
.tool-row small, .chevron { color: var(--muted); font-size: .82rem; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 20px 0 16px; padding: 4px; border: 1px solid var(--border); background: var(--field); border-radius: 10px; }
.mode-switch button { min-height: 44px; border: 1px solid transparent; border-radius: 7px; background: transparent; font-weight: 700; font-size: .91rem; color: var(--muted); }
.mode-switch button[aria-pressed="true"] { color: #e8deff; border-color: #544270; background: #36294f; }
.field { margin-block: 15px; }
.field label, .field-label, .filters label, .dialog-field label { display: block; font-size: .89rem; font-weight: 700; margin-bottom: 6px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid > :only-child { grid-column: 1 / -1; }
input:not([type="checkbox"], [type="range"]), select, textarea { display: block; width: 100%; min-height: 46px; padding: 10px 12px; color: var(--text); background: var(--field); border: 1px solid #42384e; border-radius: 9px; font-size: 1rem; }
input::placeholder, textarea::placeholder { color: #a49aaf; opacity: 1; }
textarea { resize: vertical; line-height: 1.55; }
select { appearance: none; padding-right: 35px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15' viewBox='0 0 15 15'%3E%3Cpath d='m3 5 4.5 4.5L12 5' fill='none' stroke='%23c3adff' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.chips, .form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chips button { min-height: 44px; padding: 4px 11px; border: 1px solid var(--border); border-radius: 8px; background: #211b2d; color: #ded3ef; font-size: .85rem; }
.chips button:hover, .chips button[aria-pressed="true"] { background: #3d2c5c; border-color: #896db1; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 13px; border: 1px solid transparent; border-radius: 9px; font-size: .9rem; font-weight: 730; text-align: center; line-height: 1.25; }
.button svg { width: 18px; height: 18px; }
.primary-button { background: var(--primary); color: var(--ink); border-color: #d0bcff; }
.primary-button:not(:disabled):hover { background: #cfbaff; }
.outline-button { background: #211b2c; border-color: #453754; color: #eee3fa; }
.outline-button:not(:disabled):hover { background: #342642; }
.quiet-button { background: transparent; color: #ddd0ee; }
.quiet-button[aria-current="page"] { border-color: #755ea3; background: #2b2141; }
.view-heading { margin: 16px 0 24px; }
.view-heading p { margin-top: 9px; color: var(--muted); }
.view-actions { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.editor-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; color: var(--muted); font-size: .81rem; }
.section-tools { margin-bottom: 8px; }
#lyric-body { font-family: ui-monospace, monospace; }
.items { margin-top: 12px; }
.item { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.item:last-child { border-bottom: 0; }
.item-title { min-width: 0; flex: 1 1 140px; overflow-wrap: anywhere; }
.item-title small { color: var(--muted); display: block; margin-top: 3px; }
.item-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { margin-top: 14px; padding: 22px 15px; color: var(--muted); border: 1px dashed #494053; border-radius: 10px; }
.project-card .panel-icon { margin-bottom: 13px; }
.project-card h2 { overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; font-size: .91rem; margin: 12px 0; }
.stats dt { color: var(--muted); }
.stats dd { margin: 0; overflow-wrap: anywhere; }
.queue-notice { display: flex; gap: 12px; margin-bottom: 16px; }
.queue-notice p { margin-bottom: 0; }
.muted { color: var(--muted); }
.player { position: fixed; z-index: 3; inset: auto 0 0; display: grid; grid-template-columns: minmax(150px, .9fr) auto minmax(120px, 1.4fr) auto; align-items: center; gap: clamp(10px, 2vw, 25px); min-height: calc(var(--dock) + var(--safe-bottom)); padding: 8px calc(22px + var(--safe-right)) calc(8px + var(--safe-bottom)) calc(22px + var(--safe-left)); border-top: 1px solid #40354e; background: #17131f; }
.player-track, .transport, .timeline { display: flex; align-items: center; min-width: 0; }
.player-track { gap: 10px; }
.player-art { display: grid; place-items: center; flex: 0 0 auto; width: 43px; height: 43px; border: 1px solid #4b3666; border-radius: 10px; color: var(--accent); background: #2a1e40; }
.track-text { min-width: 0; font-size: .92rem; }
.track-text > * { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.track-text small { color: var(--muted); font-size: .78rem; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 9px; background: transparent; color: #eee3fa; }
.icon-button:not(:disabled):hover { background: #352a49; }
.play-button { border-radius: 50%; background: #c0a6ff; color: var(--ink); }
.play-button:not(:disabled):hover { background: #d9c6ff; }
.timeline { gap: 8px; font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.waveform { position: relative; flex: 1; height: 44px; min-width: 0; }
.waveform canvas, .waveform input { position: absolute; width: 100%; height: 44px; inset: 0; margin: 0; }
.waveform input { opacity: 0; cursor: pointer; }
.waveform:focus-within { outline: 2px solid #debaff; outline-offset: 2px; border-radius: 4px; }
dialog { width: min(460px, calc(100% - 28px)); max-height: calc(100% - env(safe-area-inset-top, 0px) - var(--safe-bottom) - 20px); padding: 22px; border: 1px solid #624d7b; border-radius: 15px; background: var(--surface); color: var(--text); }
dialog::backdrop { background: #08060dd9; }
dialog p { margin-top: 9px; color: var(--muted); }
.dialog-field { margin: 12px 0; }
.dialog-check { display: flex; align-items: center; min-height: 44px; gap: 10px; }
.dialog-check input { width: 21px; height: 21px; accent-color: var(--primary); }
.error-text { color: #ffadaf; }
.error-text:empty { margin: 0; }
.notice:empty { clip-path: inset(50%); }
.notice, .storage-error { z-index: 4; padding: 11px 14px; border-radius: 10px; background: #2e2242; border: 1px solid #6d558b; color: var(--text); overflow-wrap: anywhere; }
.notice { position: fixed; bottom: calc(var(--dock) + var(--nav) + var(--safe-bottom) + 12px); right: calc(12px + var(--safe-right)); max-width: min(410px, calc(100% - 30px - var(--safe-left) - var(--safe-right))); }
.storage-error { position: fixed; top: calc(7px + env(safe-area-inset-top, 0px)); left: calc(8px + var(--safe-left)); right: calc(8px + var(--safe-right)); }
@media (max-width: 1050px) {
  :root { --sidebar-width: 183px; }
  .create-grid { grid-template-columns: minmax(0, 1.5fr) minmax(223px, 1fr); }
}
@media (max-width: 850px) {
  :root { --sidebar-width: 0px; --nav: 64px; }
  .sidebar { position: static; width: auto; padding: 0; border: 0; background: transparent; }
  .sidebar > .brand, .sidebar-footer, .nav-label, .breadcrumb, .desktop-label { display: none; }
  .navigation { position: fixed; z-index: 4; inset: auto 0 0; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; min-height: calc(var(--nav) + var(--safe-bottom)); padding: 4px calc(6px + var(--safe-right)) calc(4px + var(--safe-bottom)) calc(6px + var(--safe-left)); background: #15111e; border-top: 1px solid var(--border); }
  .navigation a { flex-direction: column; justify-content: center; gap: 3px; padding: 3px 1px; font-size: .75rem; }
  .navigation a:focus-visible { outline-offset: -2px; }
  .mobile-brand { display: inline-flex; align-self: center; padding: 0; }
  .topbar { min-height: 65px; padding-inline: 16px; }
  .player { bottom: calc(var(--nav) + var(--safe-bottom)); min-height: var(--dock); padding: 7px calc(14px + var(--safe-right)) 7px calc(14px + var(--safe-left)); }
}
@media (max-width: 620px) {
  :root { --dock: 85px; }
  :root[data-player="empty"] { --dock: 60px; }
  main { padding: 14px 13px calc(var(--dock) + var(--nav) + var(--safe-bottom) + 20px); }
  .topbar { padding-inline: 13px; }
  .top-actions { gap: 2px; }
  .top-actions .button { padding: 7px; gap: 5px; }
  .mobile-brand { font-size: .86rem; gap: 6px; }
  .mobile-brand img { width: 31px; height: 31px; }
  .hero { min-height: 172px; background-position: right center; padding: 17px; }
  .hero > div { text-shadow: 0 1px 12px #0a0514; }
  .chips { gap: 6px; }
  .chips button { padding-inline: 8px; }
  .create-grid, .editor-grid, .settings-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .create-grid { margin-top: 14px; }
  .player { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-rows: 44px 23px; column-gap: 2px; row-gap: 0; }
  .player-art { width: 34px; height: 34px; border-radius: 8px; }
  .player-track { gap: 7px; }
  .transport { grid-row: 1; grid-column: 2; }
  .download-player { grid-row: 1; grid-column: 3; }
  .timeline { grid-column: 1 / -1; grid-row: 2; padding-inline: 3px; }
  .waveform, .waveform canvas, .waveform input { height: 23px; }
  .waveform input { height: 44px; top: -15px; }
  [data-player="empty"] .player { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 44px; }
  [data-player="empty"] :is(.timeline, #previous, #next, .download-player) { display: none; }
}
@media (max-width: 360px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .top-actions .button svg { display: none; }
  .top-actions .button { min-width: 44px; }
  .transport .icon-button { width: 44px; }
}
@media (max-height: 560px) and (min-width: 851px) {
  .sidebar { overflow-y: auto; }
}
