:root { color-scheme: dark; font-family: "Segoe UI", system-ui, sans-serif; color: #e7eefb; background: #090e1b; --muted: #9aaac3; --line: #ffffff14; --accent: #6de6da; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 85% 0, #523e8524, transparent 55%), radial-gradient(ellipse at 0 35%, #146b7020, transparent 55%); }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; background-image: linear-gradient(#ffffff02 1px, transparent 1px), linear-gradient(90deg, #ffffff02 1px, transparent 1px); background-size: 48px 48px; z-index: -1; }
header { min-height: 56px; padding: 8px max(24px, calc((100% - 1100px) / 2)); background: #090e1bcc; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; backdrop-filter: blur(18px); }
.brand { color: #f3f6ff; font-weight: 750; font-size: 1.25rem; letter-spacing: -.05em; text-decoration: none; display: inline-flex; align-items: center; }
.brand svg { width: 25px; height: 25px; color: var(--accent); margin-right: 10px; }
.brand-dot { color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 12px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 42px; min-height: 42px; padding: 9px; border: 1px solid #6de6da38; border-radius: 50%; background: #6de6da08; color: var(--accent); text-decoration: none; }
.icon-button svg { width: 21px; height: 21px; }
.icon-button:hover { background: #6de6da1a; border-color: var(--accent); }
.account-avatar { font-size: .8rem; letter-spacing: .04em; }
main { max-width: 1100px; margin: auto; padding: 14px 24px 60px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: .35rem; font-size: clamp(1.6rem, 5vw, 2.1rem); letter-spacing: -.04em; font-weight: 650; }
h2 { font-size: 1.05rem; font-weight: 600; }
p { line-height: 1.5; color: var(--muted); }
a { color: var(--accent); }
.eyebrow { color: var(--accent); font-size: .64rem; font-weight: 650; letter-spacing: .18em; margin-bottom: .5rem; }
.page-head, .section-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 20px; }
.actions { display: flex; gap: 8px; align-items: center; }
.wrap { flex-wrap: wrap; }
button, input, textarea, select { font: inherit; }
select { display: block; width: 100%; padding: 10px; margin-top: 6px; min-height: 44px; color: #e7eefb; border: 1px solid #ffffff25; border-radius: 8px; background: #101a2d; }
.enable-search { display: inline-block; width: auto; margin-right: 8px; }
.chart-preview { white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, monospace; }
button { cursor: pointer; border: 1px solid #ffffff25; border-radius: 10px; color: #d6e2f5; background: #152034; min-height: 44px; padding: 9px 14px; font-weight: 600; transition: background .16s, border-color .16s, box-shadow .16s; }
button:hover { border-color: #6de6da70; background: #1b2b42; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, .grid-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button:disabled { opacity: .45; cursor: not-allowed; }
.primary { color: #062825; background: linear-gradient(120deg, #80f0d7, #5ed6df); border-color: #90fff12e; box-shadow: 0 3px 20px #45d6cb15; }
.primary:hover { color: #062825; background: #a0f8e6; box-shadow: 0 3px 24px #45d6cb30; }
.secondary { color: #ccbcff; border-color: #b69aff4d; background: #aa86fa10; }
.secondary:hover { background: #aa86fa20; border-color: #b69aff; }
.danger { color: #ff9aab; }
.song-toolbar { justify-content: flex-end; }
.song-toolbar .icon-button { flex-shrink: 0; }
.song-line { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px 8px; margin: 0 0 4px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.song-line h1 { margin: 0; min-width: 2.5em; max-width: 100%; font-size: 1.05rem; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-line .event-menu-trigger { flex: 0 1 auto; min-width: 3em; min-height: 30px; padding: 0; font-size: .8rem; }
.song-line .event-menu-trigger span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-divider { color: var(--muted); }
.line-event { min-width: 2em; color: #c7b2ff; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-meta, .play-state { flex-shrink: 1; min-width: 0; color: var(--muted); font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-actions { display: flex; flex-shrink: 0; gap: 6px; margin-left: auto; }
.song-line .icon-button { width: 32px; min-height: 32px; padding: 6px; }
.song-line .icon-button svg { width: 17px; height: 17px; }
.performance-line { position: sticky; top: 0; z-index: 3; padding-top: 6px; background: #090e1bf2; backdrop-filter: blur(12px); }
.performance-line.playing [data-action="start"] { box-shadow: 0 0 0 3px #6de6da40; }
.song-line .scroll-toggle[aria-pressed="true"] { background: #6de6da26; border-color: var(--accent); }
.song-line .scroll-toggle[aria-pressed="false"] { color: var(--muted); border-color: #ffffff25; background: none; position: relative; }
.scroll-toggle[aria-pressed="false"]::after { content: ""; position: absolute; left: 7px; right: 7px; top: 50%; height: 1.5px; background: currentColor; transform: rotate(-45deg); }
.event-tuning { display: flex; flex-shrink: 0; align-items: center; gap: 3px; font-size: .72rem; }
.tuning-label { color: var(--muted); margin: 0 2px 0 8px; }
.tuning-label:first-child { margin-left: 0; }
.event-tuning .tuning-step { min-height: 26px; width: 26px; padding: 0; border-radius: 7px; font-size: .9rem; line-height: 1; }
.tuning-value { min-width: 3em; margin-left: 3px; font: 650 .8rem ui-monospace, monospace; color: var(--accent); }
.tuning-value small { color: var(--muted); font-weight: 400; }
.event-tuning input { width: 3.8em; min-height: 26px; margin: 0 0 0 3px; padding: 2px 4px; text-align: center; font: .8rem ui-monospace, monospace; }
.event-tuning .tuning-reset { display: inline-flex; align-items: center; justify-content: center; min-height: 26px; width: 26px; padding: 4px; margin-left: 4px; border-radius: 7px; }
.tuning-reset svg { width: 15px; height: 15px; }
.tuning-reset[hidden] { display: none; }
.song-sheet { columns: 26rem; column-gap: 24px; }
.song-sheet-section { break-inside: avoid-column; padding: 7px 0 9px; border-top: 1px solid var(--line); scroll-margin-top: 52px; }
.song-sheet-section:first-child { border-top: 0; }
.song-sheet-section h2 { margin: 0 0 5px; font-size: .67rem; letter-spacing: .07em; color: var(--accent); }
.song-sheet-section pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; font: .84rem/1.45 ui-monospace, monospace; }
.sheet-cue { min-height: 0; padding: 1px 6px; margin-left: -6px; border: 0; border-radius: 5px; background: none; color: inherit; font: inherit; letter-spacing: inherit; }
.sheet-cue:hover { background: #6de6da1a; }
.sheet-progress { margin-left: 8px; color: var(--muted); font: .64rem ui-monospace, monospace; letter-spacing: 0; }
.performing .song-sheet-section { padding-left: 8px; padding-right: 8px; border-left: 2px solid transparent; transition: background .2s, border-color .2s; }
.performing .song-sheet-section.current { background: #6de6da0d; border-left-color: var(--accent); }
.performing .current .sheet-cue { background: var(--accent); color: #062825; }
.performing .song-sheet-section.queued { border-left-color: #b69aff; }
.performing .queued .sheet-cue { background: #b69aff30; color: #e4d9ff; }
.song-category-menu { position: relative; }
.song-category-menu summary { list-style: none; cursor: pointer; }
.song-category-menu summary::-webkit-details-marker { display: none; }
.song-category-content { position: absolute; right: 0; top: calc(100% + 8px); width: min(320px, calc(100vw - 48px)); z-index: 4; }
.song-category-content .actions { margin-top: 12px; }
.panel { background: linear-gradient(135deg, #131e31ee, #0f1729ee); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 16px; box-shadow: 0 8px 30px #00000012; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 16px 0; }
label { display: block; font-size: .85rem; font-weight: 600; }
input, textarea { display: block; width: 100%; min-width: 0; color: #e7eefb; border: 1px solid #ffffff25; border-radius: 8px; padding: 10px; margin-top: 6px; background: #0b1322; }
input::placeholder, textarea::placeholder { color: #8596b2; opacity: 1; }
input[type="checkbox"] { display: inline-block; width: auto; accent-color: var(--accent); }
textarea { resize: vertical; font-family: ui-monospace, monospace; line-height: 1.5; }
input:user-invalid { border-color: #ff809b; }
.hint { display: block; font-weight: normal; color: var(--muted); font-size: .8rem; margin-top: 8px; }
.new-song-head h1 { font-size: clamp(2rem, 6vw, 2.8rem); letter-spacing: -.05em; }
.song-title-field { max-width: 760px; }
.title-input-row, .field-heading { display: flex; align-items: center; gap: 8px; position: relative; }
.title-input-row { margin-top: 6px; }
.title-input-row input { flex: 1; margin: 0; width: 0; }
.field-heading h2 { margin: 0; }
.section-header > div { flex: 1; min-width: 0; }
.help-tooltip { display: inline-flex; flex: 0 0 auto; align-items: center; }
.help-icon { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; width: 32px; padding: 6px; border: 0; border-radius: 50%; background: none; color: var(--muted); }
.help-icon svg { width: 19px; height: 19px; }
.warning .help-icon { color: #ffcf7e; }
.tooltip-text { display: none; position: absolute; z-index: 6; left: 0; top: 100%; width: min(460px, 100%); padding: 12px; color: #d6e2f5; background: #152034; border: 1px solid #6de6da38; border-radius: 10px; box-shadow: 0 8px 24px #0006; font: 400 .8rem/1.5 "Segoe UI", system-ui, sans-serif; overflow-wrap: anywhere; }
.warning .tooltip-text { left: auto; right: 0; border-color: #ffcf7e50; }
.help-tooltip:hover .tooltip-text, .help-tooltip:focus-within .tooltip-text { display: block; }
#import-form > .panel > .actions { margin-top: 12px; }
.song-suggestions { margin-top: 8px; border: 1px solid #6de6da38; border-radius: 10px; background: #0c1728; overflow: hidden; }
.suggestion-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 6px 2px 12px; }
.suggestion-head .search-status { font-size: .75rem; color: var(--muted); overflow-wrap: anywhere; }
.dismiss-suggestions { flex: 0 0 32px; min-height: 36px; padding: 2px; border: none; background: none; font-size: 1.3rem; }
.suggestion-results { display: grid; }
.song-suggestion { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; text-align: left; padding: 10px 12px; border: none; border-top: 1px solid var(--line); border-radius: 0; background: none; }
.song-suggestion strong { font-size: .87rem; overflow-wrap: anywhere; }
.suggestion-artist { grid-column: 1; font-size: .74rem; font-weight: 400; color: var(--muted); overflow-wrap: anywhere; }
.suggestion-chords { grid-column: 2; grid-row: 1 / 3; align-self: center; font: .78rem ui-monospace, monospace; color: var(--accent); overflow-wrap: anywhere; max-width: 260px; }
.section-list, .grid-scroll { display: flex; overflow-x: auto; gap: 8px; padding: 4px 0 12px; }
.section-tab { flex: 0 0 auto; }
.arrangement-heading { align-items: center; margin: 8px 0 14px; }
.arrangement-heading .actions { justify-content: flex-end; }
.arrangement-heading button { font-size: .78rem; min-height: 36px; padding: 6px 10px; }
.arrangement-combine { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-size: .78rem; white-space: nowrap; cursor: pointer; }
.arrangement-combine input { margin: 0; padding: 0; }
.arrangement-combine:has(input:disabled) { color: var(--muted); cursor: not-allowed; }
.arrangement-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 18px; align-items: start; }
.section-outline { position: sticky; top: 16px; max-height: calc(100dvh - 80px); overflow-y: auto; display: grid; gap: 6px; padding: 4px; background: #0b1322db; border: 1px solid var(--line); border-radius: 12px; scrollbar-width: thin; }
.section-link { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; min-height: 48px; padding: 9px 8px; text-align: left; font-size: .78rem; font-weight: 500; background: #131e31; border-radius: 8px; user-select: none; }
.outline-label { min-width: 0; overflow-wrap: anywhere; }
.section-drag-handle { flex: 0 0 20px; color: var(--muted); font-size: 1.2rem; cursor: grab; touch-action: none; user-select: none; }
.section-link.dragging { opacity: .4; }
.section-link.drop-before { box-shadow: 0 -3px var(--accent); }
.section-link.drop-after { box-shadow: 0 3px var(--accent); }
.arrangement-document { min-width: 0; }
.arrangement-section { min-width: 0; scroll-margin-top: 16px; padding: 16px; }
.arrangement-section.active-section { border-color: #6de6da50; }
.arrangement-section-heading { display: grid; grid-template-columns: auto minmax(0, 1fr) 64px; align-items: end; gap: 10px; }
.section-number { align-self: center; font: .8rem ui-monospace, monospace; color: var(--accent); }
.arrangement-section-heading label { font-size: .72rem; color: var(--muted); }
.arrangement-section-heading input { margin-top: 4px; min-height: 38px; padding: 7px 8px; color: #e7eefb; }
.section-tools { gap: 5px; margin: 10px 0 12px; }
.section-tools button { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; padding: 5px 8px; font-size: .75rem; }
.section-tools svg { width: 17px; height: 17px; }
.section-tools [data-arrangement-action="delete-section"] { margin-left: auto; color: #ff9aab; }
.section-chart { min-height: 110px; resize: none; overflow-y: hidden; overflow-x: auto; font-size: .9rem; }
.section-beats { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.section-beats summary { cursor: pointer; font-size: .82rem; font-weight: 600; }
.section-beats summary span { color: var(--muted); font-size: .7rem; font-weight: 400; margin-left: 8px; }
.section-beats .field-heading { margin: 12px 0; }
.section-beats h3 { margin: 0; font-size: .85rem; }
.section-beats .actions { margin: 10px 0; }
.section-beats .actions button { font-size: .75rem; min-height: 36px; padding: 6px 10px; }
.selected { color: #a0f8e6; border-color: #6de6da80; background: #6de6da1a; }
.selected:hover { color: #c9fff3; background: #6de6da2a; }
.queued { outline: 3px solid #dd9b39; outline-offset: -3px; }
.grid-scroll { display: block; }
.grid-row { display: flex; gap: 4px; width: max-content; align-items: center; margin-bottom: 4px; }
.instrument { width: 74px; position: sticky; left: 0; background: #131e31; font-weight: 650; z-index: 1; }
.step { display: grid; place-items: center; min-width: 43px; padding: 5px; font-size: .75rem; }
.step span { font-size: 1.1rem; }
.step.on { background: #6de6da20; border-color: var(--accent); color: var(--accent); }
.song-list { display: grid; gap: 10px; margin: 18px 0; }
.song-card { text-align: left; padding: 18px; display: grid; grid-template-columns: 1fr auto; gap: 4px; }
.song-card span { grid-row: 2; color: var(--muted); font-weight: 400; }
.song-card b { grid-column: 2; grid-row: 1 / 3; align-self: center; }
.home-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.home-search { display: flex; align-items: center; flex: 1 1 auto; min-width: 0; position: relative; }
.home-search > svg { position: absolute; left: 14px; width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.home-search input { margin-top: 0; min-height: 42px; padding-left: 40px; border-color: #ffffff1f; border-radius: 11px; background: #10192bd9; font-size: .86rem; }
.home-bar .icon-button { flex-shrink: 0; }
.group-head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.group-head::after { content: ""; height: 1px; background: var(--line); flex: 1; margin-left: 6px; }
.home-group h2 { font-size: .85rem; margin: 0; color: #c7d4e9; }
.count { font: .67rem ui-monospace, monospace; color: var(--muted); padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 164px), 1fr)); gap: 10px; margin-bottom: 28px; }
.tile { position: relative; min-width: 0; text-align: left; padding: 14px; display: flex; flex-direction: column; gap: 5px; min-height: 116px; border: 1px solid #ffffff13; border-radius: 13px; background: linear-gradient(135deg, #172439c7, #10182bd9); box-shadow: inset 0 1px #ffffff04; }
.tile:hover { background: linear-gradient(135deg, #1a3545, #15203a); border-color: #6de6da65; box-shadow: 0 6px 26px #45d6cb0c; }
.tile strong { display: block; width: 100%; font-size: .87rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile .tile-meta { width: 100%; font-size: .72rem; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-top { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 9px; }
.tile-icon { display: inline-flex; color: var(--accent); }
.tile-icon svg { width: 21px; height: 21px; }
.tile-badge { border: 1px solid #6de6da26; border-radius: 5px; padding: 2px 5px; font-size: .58rem; font-weight: 500; color: var(--accent); letter-spacing: .02em; }
.tile.pinned { border-color: #6de6da36; }
.tile.event { background: linear-gradient(135deg, #302441a3, #15192dd9); border-color: #b69aff26; }
.tile.event:hover { border-color: #b69aff80; background: linear-gradient(135deg, #392d52, #1a2137); }
.tile.event .tile-icon, .tile.event .tile-badge { color: #c7b2ff; }
.tile.event .tile-badge { border-color: #b69aff30; }
.tile-grid .empty { grid-column: 1 / -1; padding: 18px 0; margin: 0; font-size: .8rem; }
.panel.compact { padding: 14px 16px; }
.event-heading { align-items: center; gap: 8px; margin-bottom: 12px; }
.event-menu-trigger { display: inline-flex; align-items: center; gap: 9px; min-width: 0; padding: 5px 0; min-height: 36px; border: 0; background: none; font-size: .88rem; color: var(--accent); text-align: left; }
.event-menu-trigger span { overflow-wrap: anywhere; }
.event-menu-trigger svg { width: 19px; height: 19px; flex-shrink: 0; }
.event-heading > [data-action="library"] { flex-shrink: 0; min-height: 36px; padding: 6px 10px; font-size: .76rem; }
.event-drawer { position: fixed; inset: 0 auto 0 0; margin: 0; padding: 16px; width: min(340px, 90vw); height: 100dvh; max-height: 100dvh; border: 0; border-right: 1px solid #6de6da38; background: #10192b; color: inherit; }
.event-drawer[open] { display: flex; flex-direction: column; gap: 16px; animation: event-menu-enter .18s ease-out; }
.event-drawer::backdrop { background: #0009; backdrop-filter: blur(3px); }
body:has(.event-drawer[open]) { overflow: hidden; }
.drawer-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.drawer-heading h2 { margin: 0; overflow-wrap: anywhere; }
.drawer-heading button { flex-shrink: 0; min-height: 36px; padding: 6px 10px; }
.event-outline { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 6px; padding: 4px; }
.event-drawer-actions { border-top: 1px solid var(--line); padding-top: 12px; }
@keyframes event-menu-enter { from { transform: translateX(-100%); } to { transform: translateX(0); } }
.event-song-link { display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 10px 8px; text-align: left; min-width: 0; }
.event-song-link > span:last-child { min-width: 0; }
.event-song-link strong, .event-song-link small { display: block; overflow-wrap: anywhere; }
.event-song-link strong { font-size: .8rem; }
.event-song-link small { margin-top: 4px; font-size: .68rem; font-weight: 400; color: var(--muted); }
#event-song-editor { min-width: 0; }
.event-song { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.event-song:last-child { border-bottom: none; }
.event-song .pos { min-width: 1.5em; text-align: right; color: var(--muted); font-weight: 650; font-size: .85rem; }
.event-song .tile-link { flex: 1; min-width: 0; text-align: left; display: grid; gap: 1px; border: none; background: none; padding: 6px 4px; min-height: 0; }
.event-song .tile-link:disabled { opacity: 1; cursor: default; }
.event-song .tile-link strong { font-size: .92rem; overflow-wrap: anywhere; }
.event-song .tile-link span { font-size: .76rem; color: var(--muted); font-weight: 400; }
.event-song .actions button { min-height: 36px; min-width: 36px; padding: 4px 8px; }
.search { max-width: 440px; }
.empty, .note { padding: 16px 0; }
#status { position: fixed; bottom: 0; left: 0; right: 0; min-height: 36px; padding: 8px 20px; background: #112b2a; color: #a0f8e6; border-top: 1px solid #6de6da26; font-size: .8rem; z-index: 5; }
#status:empty { display: none; }
#status.error { background: #351c2b; color: #ffb1c0; border-color: #ff809b40; }
@media (max-width: 600px) {
  header { min-height: 52px; padding: 6px 16px; }
  main { padding: 10px 12px 60px; }
  .page-head { flex-wrap: wrap; }
  .song-line { flex-wrap: wrap; }
  .event-tuning { flex-wrap: wrap; }
  .panel { padding: 15px; }
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .suggestion-chords { grid-column: 1 / -1; grid-row: 3; max-width: none; margin-top: 4px; }
  .arrangement-layout { grid-template-columns: 92px minmax(0, 1fr); gap: 10px; }
  .section-link { padding: 8px 4px; gap: 2px; font-size: .67rem; }
  .outline-label { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .arrangement-section { padding: 12px; }
  .arrangement-section-heading { gap: 6px; grid-template-columns: auto minmax(0, 1fr) 54px; }
  .arrangement-heading { gap: 8px; flex-wrap: wrap; }
  .arrangement-heading > .field-heading { flex-basis: 100%; }
  .section-chart { font-size: .8rem; }
}
@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
  .event-drawer[open] { animation: none; }
}
