:root {
  color-scheme: dark;
  --bg: #0a0d0b;
  --surface: #121713;
  --surface-2: #192019;
  --surface-3: #222b22;
  --line: #293229;
  --line-strong: #3c493b;
  --text: #f4f6ee;
  --muted: #98a395;
  --primary: #d6ff73;
  --primary-strong: #c4ef5e;
  --primary-ink: #172200;
  --danger: #ff7f86;
  --warning: #f4ca6c;
  --info: #86c7aa;
  --radius: 18px;
  --radius-small: 11px;
  --shadow: 0 24px 64px rgb(0 0 0 / 0.28);
  --sidebar: 232px;
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Score workflow */
.score-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(260px, .85fr); gap: 18px; align-items: start; }
.score-form, .score-status-panel, .score-result, .score-history { min-width: 0; }
.score-form { display: grid; gap: 16px; }
.score-options { margin: 0; }
.score-submit { min-height: 46px; justify-content: center; }
.score-live-status { display: grid; gap: 14px; }
.score-job-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.score-live-status progress { width: 100%; height: 12px; accent-color: var(--primary); }
.score-result, .score-history { margin-top: 18px; }
.score-viewer-shell { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; border-radius: 12px; background: #fff; color: #111; }
#score-viewer { min-width: 280px; padding: 12px; }
.score-lyrics { margin-top: 14px; }
.score-lyrics summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 800; }
.score-lyrics pre { max-width: 100%; overflow-wrap: anywhere; white-space: pre-wrap; font: inherit; line-height: 1.7; }
.score-job-list { display: grid; gap: 8px; }
.score-job-row { width: 100%; min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; color: inherit; background: var(--surface-2); text-align: left; cursor: pointer; }
.score-job-row > span:first-child { display: grid; gap: 3px; }
.score-job-row small { color: var(--muted); }
.badge[data-status="failed"] { color: var(--danger); }
.badge[data-status="done"] { color: var(--primary); }

@media (max-width: 760px) {
  .score-layout { grid-template-columns: minmax(0, 1fr); }
  .score-options { grid-template-columns: minmax(0, 1fr); }
  .score-result .panel-heading.split { align-items: stretch; }
  .score-result .panel-heading.split .button { width: 100%; justify-content: center; }
  .sidebar a { flex: 1 1 0; min-width: 0; padding-inline: 2px; }
  .sidebar a > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 360px) {
  #score-viewer { padding: 8px; }
  .score-job-row { align-items: flex-start; flex-direction: column; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100dvh; color: var(--text); background: radial-gradient(circle at 82% -15%, rgb(214 255 115 / 0.09), transparent 34rem), var(--bg); }
body, input, select, button { font: inherit; }
a { color: inherit; text-decoration: none; }
button, input, select { min-height: 44px; }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(1.75rem, 3vw, 2.35rem); line-height: 1.15; letter-spacing: -0.035em; }
h2 { margin-bottom: 6px; font-size: 1.15rem; line-height: 1.3; letter-spacing: -0.02em; }
h3 { margin-bottom: 5px; font-size: 1rem; }
p { line-height: 1.58; }
:focus-visible { outline: 3px solid var(--info); outline-offset: 3px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 1000; left: 16px; top: -80px; padding: 10px 14px; border-radius: 8px; background: var(--primary); color: var(--primary-ink); font-weight: 800; }
.skip-link:focus { top: 12px; }
.muted { color: var(--muted); }
.small { font-size: 0.83rem; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.min-width-zero { min-width: 0; }
.eyebrow { margin-bottom: 7px; color: var(--primary); font-size: 0.74rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }

.topbar { position: fixed; z-index: 50; inset: 0 0 auto 0; height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgb(16 18 15 / 0.9); backdrop-filter: blur(16px); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 850; letter-spacing: -0.02em; }
.brand-mark, .login-logo { display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 1.1rem; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-actions form { margin: 0; }
.player-link, .icon-button { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--muted); font-size: 0.82rem; cursor: pointer; }
.player-link:hover, .icon-button:hover { border-color: var(--line-strong); color: var(--text); background: var(--surface-2); }
.app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; padding-top: 68px; }
.sidebar { position: fixed; z-index: 40; top: 68px; bottom: 0; left: 0; width: var(--sidebar); display: flex; flex-direction: column; gap: 6px; padding: 26px 16px; border-right: 1px solid var(--line); background: rgb(16 18 15 / 0.78); }
.sidebar a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 11px; color: var(--muted); font-size: 0.9rem; font-weight: 690; }
.sidebar a > span:first-child { width: 22px; text-align: center; font-size: 1.05rem; }
.sidebar a:hover { color: var(--text); background: rgb(255 255 255 / 0.045); }
.sidebar a[aria-current="page"] { color: var(--primary); background: rgb(199 239 112 / 0.1); box-shadow: inset 2px 0 var(--primary); }
.content { grid-column: 2; width: 100%; max-width: 1400px; margin: 0 auto; padding: 48px clamp(24px, 4vw, 68px) 88px; }

.page-header { margin-bottom: 34px; }
.page-header > p:last-child { max-width: 760px; margin-bottom: 0; }
.page-header.split { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading h2, .section-heading p { margin-bottom: 0; }
.section-heading > a, .section-heading > button { flex: none; color: var(--primary); font-size: 0.84rem; font-weight: 750; }
.section-block { margin-top: 34px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid transparent; border-radius: var(--radius-small); font-weight: 760; font-size: 0.86rem; cursor: pointer; transition: transform 120ms ease, background 120ms ease, border-color 120ms ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: 0.5; transform: none; }
.button.primary { background: var(--primary); color: var(--primary-ink); box-shadow: 0 8px 18px rgb(150 191 67 / 0.15); }
.button.primary:hover { background: var(--primary-strong); }
.button.secondary { border-color: var(--line-strong); background: var(--surface-2); color: var(--text); }
.button.secondary:hover { background: var(--surface-3); }
.button.ghost { min-height: 38px; padding-inline: 10px; border-color: transparent; background: transparent; color: var(--muted); }
.button.ghost:hover { color: var(--text); background: var(--surface-2); }
.button.danger { background: var(--danger); color: #2a0408; }
.button.full { width: 100%; }
.danger-text { color: var(--danger) !important; }

.panel, .link-command { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgb(36 41 31 / 0.93), rgb(24 28 23 / 0.96)); box-shadow: var(--shadow); }
.panel { padding: 22px; }
.link-command { padding: clamp(22px, 4vw, 34px); border-color: rgb(123 224 173 / 0.26); }
.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-bottom: 22px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); }
.metric { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-height: 90px; padding: 24px; background: rgb(25 29 24 / 0.94); }
.metric:hover { background: var(--surface-2); }
.metric span { color: var(--muted); font-size: 0.85rem; }
.metric strong { font-size: 1.75rem; font-variant-numeric: tabular-nums; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.8fr); gap: 22px; }
.current-job { display: grid; grid-template-columns: 130px minmax(0, 1fr); align-items: center; gap: 20px; }
.current-job img { width: 130px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; }
.current-job h3 { margin: 9px 0 12px; font-size: 1.05rem; }
progress { width: 100%; height: 9px; overflow: hidden; border: 0; border-radius: 999px; background: var(--surface-3); color: var(--primary); }
progress::-webkit-progress-bar { border-radius: 999px; background: var(--surface-3); }
progress::-webkit-progress-value { border-radius: 999px; background: var(--primary); }
progress::-moz-progress-bar { border-radius: 999px; background: var(--primary); }
.status-list { margin: 0; }
.status-list > div { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.status-list > div:last-child { border-bottom: 0; }
.status-list dt { color: var(--muted); font-size: 0.84rem; }
.status-list dd { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 0.85rem; font-weight: 700; text-align: right; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 4px rgb(255 125 136 / 0.1); }
.status-dot.ok { background: var(--primary); box-shadow: 0 0 0 4px rgb(123 224 173 / 0.1); }
.music-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.music-card { min-width: 0; }
.cover, .file-cover, .job-thumb { display: grid; place-items: center; overflow: hidden; background: var(--surface-2); color: var(--muted); }
.cover { width: 100%; aspect-ratio: 1; margin-bottom: 11px; border: 1px solid var(--line); border-radius: 12px; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.music-card h3, .music-card p { margin-bottom: 3px; }
.music-card p { font-size: 0.8rem; }

.alert { margin-bottom: 20px; padding: 13px 15px; border: 1px solid; border-radius: 10px; font-size: 0.87rem; line-height: 1.5; }
.alert.error { border-color: rgb(255 125 136 / 0.4); background: rgb(255 125 136 / 0.09); color: #ffadb4; }
.alert.warning { border-color: rgb(245 198 106 / 0.4); background: rgb(245 198 106 / 0.09); color: #f9d995; }
.alert.success { border-color: rgb(123 224 173 / 0.4); background: rgb(123 224 173 / 0.09); color: #a6f0c9; }
.alert a { text-decoration: underline; font-weight: 700; }
.empty { display: flex; min-height: 280px; flex-direction: column; align-items: center; justify-content: center; padding: 36px; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted); text-align: center; }
.empty > span:first-child { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 16px; border-radius: 50%; background: var(--surface-2); color: var(--primary); font-size: 1.4rem; }
.empty h2, .empty h3, .empty h1 { color: var(--text); }
.empty p { max-width: 520px; }
.empty.compact { min-height: 160px; padding: 20px; }
.empty.compact > span:first-child { width: 42px; height: 42px; margin-bottom: 8px; }
.error-state { min-height: 60vh; border: 0; }

label { display: flex; flex-direction: column; gap: 7px; color: #c8d0da; font-size: 0.83rem; font-weight: 680; }
input, select { width: 100%; border: 1px solid var(--line-strong); border-radius: 9px; background: #0e1219; color: var(--text); padding: 0 13px; outline: 0; }
input::placeholder { color: #687487; }
input:focus, select:focus { border-color: var(--info); box-shadow: 0 0 0 3px rgb(120 183 255 / 0.14); }
input[type="checkbox"] { width: 19px; min-height: 19px; height: 19px; accent-color: var(--primary); }
input[type="file"] { padding: 10px; }
label small, .field-help { margin: 0; color: var(--muted); font-size: 0.76rem; font-weight: 450; line-height: 1.55; }
.optional { color: var(--muted); font-weight: 450; }
.form-stack { display: grid; gap: 17px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; padding-top: 4px; }
.inline-form, .filter-row { display: flex; align-items: flex-end; gap: 12px; }
.inline-form label, .filter-row label { min-width: 130px; }
.search-field { flex-direction: row; align-items: center; min-width: min(100%, 340px); }
.search-field input { min-width: 0; }

.link-form > label { margin-bottom: 10px; color: var(--text); font-size: 1rem; }
.input-action { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.input-action input { min-height: 52px; font-size: 1rem; }
.input-action .button { min-height: 52px; padding-inline: 22px; }
.field-help { margin-top: 10px; }
.analysis-region { margin-top: 24px; }
.skeleton-card { display: grid; grid-template-columns: 180px 1fr; gap: 18px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.skeleton-card div { min-height: 18px; border-radius: 8px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: pulse 1.2s linear infinite; }
.skeleton-card div:first-of-type { grid-row: span 3; min-height: 120px; }
@keyframes pulse { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; } }

.preview-card { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.preview-card > img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 11px; }
.preview-card h2 { margin: 8px 0; font-size: 1.35rem; }
.preview-meta { display: flex; flex-wrap: wrap; gap: 7px 16px; color: var(--muted); font-size: 0.82rem; }
.preview-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.metadata-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.metadata-form .wide { grid-column: span 2; }
.choice-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; padding: 14px; border-radius: 10px; background: var(--surface-2); }
.choice-strip > p { width: 100%; margin-bottom: 0; }
.playlist-preview { display: grid; gap: 16px; }

.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border: 1px solid transparent; border-radius: 999px; font-size: 0.69rem; font-weight: 800; white-space: nowrap; }
.status-completed { border-color: rgb(123 224 173 / 0.3); background: rgb(123 224 173 / 0.11); color: #9ee9c1; }
.status-pending, .status-metadata { border-color: rgb(120 183 255 / 0.3); background: rgb(120 183 255 / 0.1); color: #9dccff; }
.status-downloading, .status-converting, .status-tagging, .status-moving { border-color: rgb(245 198 106 / 0.32); background: rgb(245 198 106 / 0.1); color: #f6d590; }
.status-failed, .status-cancelled { border-color: rgb(255 125 136 / 0.3); background: rgb(255 125 136 / 0.09); color: #ffabb3; }
.status-skipped, .badge.neutral { border-color: var(--line-strong); background: var(--surface-2); color: var(--muted); }

.table-panel { padding: 0; overflow: hidden; }
.table-panel > .section-heading { padding: 20px 22px 0; }
.responsive-table { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 14px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; font-size: 0.83rem; }
th { color: var(--muted); font-size: 0.72rem; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; }
tbody tr:hover { background: rgb(255 255 255 / 0.018); }
.video-cell { display: grid; grid-template-columns: 84px minmax(180px, 1fr); align-items: center; gap: 12px; }
.video-cell img { width: 84px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 7px; }
.video-cell span { display: block; margin-top: 3px; font-size: 0.76rem; }
.filter-panel { margin-bottom: 18px; }
.filter-row .search-field { flex: 1; }
.selection-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 16px; }
.chip { min-height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 0.75rem; font-weight: 650; cursor: pointer; }
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.range-select { flex-direction: row; align-items: center; gap: 6px; margin-left: auto; }
.range-select input { width: 62px; min-height: 34px; }
.bulk-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 18px -22px -22px; padding: 14px 22px; border-top: 1px solid var(--line); background: rgb(11 13 18 / 0.45); }
.bulk-bar > div { display: flex; gap: 8px; }
.settings-inline { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; }
.settings-inline h2, .settings-inline p { margin-bottom: 0; }

.job-list, .file-list { display: grid; gap: 12px; }
.job-row { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; align-items: start; gap: 16px; padding: 18px 22px; border-top: 1px solid var(--line); }
.job-row:first-child { border-top: 0; }
.job-thumb { width: 88px; aspect-ratio: 16 / 9; border-radius: 8px; }
.job-thumb img { width: 100%; height: 100%; object-fit: cover; }
.job-title-line { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.job-title-line h3 { min-width: 0; margin: 0; }
.job-meta { margin: 6px 0 0; color: var(--muted); font-size: 0.75rem; }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.job-error { margin-top: 10px; color: var(--danger); font-size: 0.78rem; }
.job-error summary { cursor: pointer; }
.job-error pre { max-width: min(720px, 65vw); overflow: auto; white-space: pre-wrap; color: #f0b2b7; }

.playlist-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.playlist-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); transition: transform 150ms ease, border-color 150ms ease; }
.playlist-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.playlist-card.auto-playlist { border-color: color-mix(in srgb, var(--primary) 48%, var(--line)); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06); }
.playlist-card > div:last-child { padding: 17px; }
.playlist-card h2 { margin-bottom: 4px; }
.playlist-cover { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 8.8; overflow: hidden; background: var(--surface-2); color: var(--muted); }
.playlist-cover img { width: 100%; height: 100%; object-fit: cover; }
.playlist-cover > span { position: absolute; right: 10px; bottom: 10px; padding: 5px 8px; border-radius: 7px; background: rgb(0 0 0 / 0.76); font-size: 0.72rem; font-weight: 750; }
.playlist-header-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.saved-playlists-empty { margin-top: 18px; }
.track-play.is-playing { border-color: var(--primary); color: var(--primary); }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 14px 0; padding: 11px 0; border-block: 1px solid var(--line); }
.mini-stats div { text-align: center; }
.mini-stats dt { color: var(--muted); font-size: 0.67rem; }
.mini-stats dd { margin: 3px 0 0; font-weight: 800; }

.file-row { display: grid; grid-template-columns: 82px minmax(0, 1fr) minmax(180px, auto); align-items: center; gap: 17px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.file-cover { width: 82px; aspect-ratio: 1; border-radius: 10px; }
.file-cover img { width: 100%; height: 100%; object-fit: cover; }
.file-info h2, .file-info p { margin-bottom: 3px; }
audio { display: block; width: min(100%, 420px); height: 36px; margin-top: 9px; }
.playlist-player { position: fixed; z-index: 70; right: 18px; bottom: 18px; left: calc(var(--sidebar) + 18px); display: grid; grid-template-columns: 58px minmax(180px, 1fr) auto; align-items: center; gap: 14px; min-height: 82px; padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: 14px; background: rgb(18 23 32 / 0.97); box-shadow: 0 22px 70px rgb(0 0 0 / 0.48); backdrop-filter: blur(16px); }
.playlist-player[hidden] { display: none; }
.player-artwork { width: 58px; height: 58px; border-radius: 8px; object-fit: cover; }
.player-track { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 3px 12px; }
.player-track > strong, .player-track > span { grid-column: 1 / -1; }
.player-progress { width: 100%; min-height: 24px; padding: 0; accent-color: var(--primary); }
.player-time { font-size: 0.68rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.player-controls { display: flex; align-items: center; gap: 4px; }
.player-controls .icon-button { border: 0; background: transparent; font-size: 1rem; }
.player-controls [aria-pressed="true"] { color: var(--primary); }
.player-controls .player-main-action { border-radius: 50%; background: var(--primary); color: #07111d; font-size: 1.05rem; }
.playlist-player > audio { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.has-playlist-player .content { padding-bottom: 126px; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr); gap: 20px; align-items: start; }

.dialog { width: min(92vw, 500px); padding: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: 0 30px 90px rgb(0 0 0 / 0.58); }
.dialog.wide { width: min(92vw, 720px); }
.dialog::backdrop { background: rgb(0 0 0 / 0.66); backdrop-filter: blur(3px); }
.dialog form { padding: 24px; }
.dialog h2 { font-size: 1.25rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.toast-region { position: fixed; z-index: 100; right: 18px; bottom: 18px; display: grid; gap: 9px; width: min(380px, calc(100vw - 36px)); }
.toast { padding: 13px 15px; border: 1px solid var(--line-strong); border-left: 4px solid var(--primary); border-radius: 10px; background: #202734; box-shadow: var(--shadow); font-size: 0.84rem; }
.toast.error { border-left-color: var(--danger); }

.auth-shell { display: grid; min-height: 100vh; place-items: center; padding: 28px; }
.login-card { width: min(100%, 420px); padding: clamp(28px, 6vw, 42px); border: 1px solid var(--line); border-radius: 18px; background: rgb(25 29 24 / 0.94); box-shadow: 0 30px 100px rgb(0 0 0 / 0.38); }
.login-logo { width: 48px; height: 48px; margin-bottom: 24px; border-radius: 14px; font-size: 1.4rem; }
.login-card h1 { font-size: 1.85rem; }
.login-card > .muted { margin-bottom: 24px; }

@media (max-width: 1100px) {
  :root { --sidebar: 76px; }
  .sidebar { align-items: center; padding-inline: 10px; }
  .sidebar a { width: 52px; justify-content: center; padding: 0; }
  .sidebar a > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .music-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .playlist-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.settings-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .topbar { height: 58px; padding: 0 14px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand > span:last-child { font-size: 0.9rem; }
  .player-link { display: none; }
  .app-shell { display: block; padding-top: 58px; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .content { padding: 26px 15px 44px; }
  .sidebar { position: fixed; z-index: 60; top: auto; right: 0; bottom: 0; width: 100%; height: calc(64px + env(safe-area-inset-bottom)); flex-direction: row; align-items: flex-start; justify-content: space-around; gap: 0; padding: 4px 5px env(safe-area-inset-bottom); border-top: 1px solid var(--line); border-right: 0; background: rgb(16 18 15 / 0.96); backdrop-filter: blur(16px); }
  .sidebar a { width: auto; min-width: 50px; height: 54px; flex-direction: column; justify-content: center; gap: 2px; padding: 0 5px; border-radius: 8px; font-size: 0.63rem; }
  .sidebar a > span:first-child { width: auto; font-size: 1rem; }
  .sidebar a > span:last-child { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .sidebar a[aria-current="page"] { box-shadow: inset 0 2px var(--primary); }
  .page-header { margin-bottom: 22px; }
  .page-header.split { align-items: stretch; flex-direction: column; gap: 15px; }
  .page-header.split > .button { align-self: flex-start; }
  .playlist-header-actions { justify-content: flex-start; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .metric { min-height: 72px; padding: 17px; }
  .metric strong { font-size: 1.45rem; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .current-job { grid-template-columns: 94px minmax(0, 1fr); }
  .current-job img { width: 94px; }
  .music-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 11px; }
  .input-action { grid-template-columns: 1fr; }
  .preview-card { grid-template-columns: 1fr; padding: 17px; }
  .preview-card > img { max-height: 230px; }
  .metadata-form, .form-grid { grid-template-columns: 1fr; }
  .metadata-form .wide { grid-column: auto; }
  .form-actions { grid-column: auto; }
  .playlist-grid { grid-template-columns: 1fr; }
  .filter-row, .inline-form { align-items: stretch; flex-direction: column; }
  .filter-row label, .inline-form label { width: 100%; }
  .selection-tools { flex-wrap: nowrap; margin-inline: -22px; padding: 0 22px 6px; overflow-x: auto; }
  .selection-tools .chip { flex: none; }
  .range-select { display: none; }
  .bulk-bar { align-items: stretch; flex-direction: column; }
  .bulk-bar > div { display: grid; grid-template-columns: 1fr 1fr; }
  .settings-inline { align-items: stretch; flex-direction: column; }
  .job-row { grid-template-columns: 70px minmax(0, 1fr); padding: 16px; }
  .job-thumb { width: 70px; }
  .job-row .row-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .file-row { grid-template-columns: 64px minmax(0, 1fr); align-items: start; }
  .file-cover { width: 64px; }
  .file-row .row-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .search-field { width: 100%; }
  .responsive-table { overflow: visible; }
  table, tbody { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  tbody tr { display: grid; grid-template-columns: 28px 34px minmax(0, 1fr); align-items: center; padding: 12px 10px; border-top: 1px solid var(--line); }
  tbody td { display: block; padding: 4px; border: 0; }
  tbody td:nth-child(4), tbody td:nth-child(5) { grid-column: 3; }
  .video-cell { grid-template-columns: 68px minmax(0, 1fr); }
  .video-cell img { width: 68px; }
  .dialog form { padding: 20px; }
  .toast-region { bottom: calc(74px + env(safe-area-inset-bottom)); }
  .playlist-player { right: 8px; bottom: calc(68px + env(safe-area-inset-bottom)); left: 8px; grid-template-columns: 46px minmax(0, 1fr); min-height: 112px; gap: 8px 11px; padding: 10px 12px; }
  .player-artwork { width: 46px; height: 46px; }
  .player-controls { grid-column: 1 / -1; justify-content: center; }
  .player-controls .icon-button { width: 44px; min-height: 38px; }
  .has-playlist-player .content { padding-bottom: 164px; }
}

@media (max-width: 390px) {
  .content { padding-inline: 12px; }
  .sidebar a { min-width: 45px; font-size: 0.59rem; }
  .panel { padding: 17px; }
  .metric { padding: 14px; }
  .metric strong { font-size: 1.25rem; }
  .current-job { grid-template-columns: 1fr; }
  .current-job img { width: 100%; max-height: 180px; }
  .bulk-bar { margin: 14px -17px -17px; padding: 13px 17px; }
  .selection-tools { margin-inline: -17px; padding-inline: 17px; }
  .topbar-actions .icon-button { width: 42px; padding: 0; font-size: 0; }
  .topbar-actions .icon-button::after { content: "↪"; font-size: 1rem; }
}

/* 2026 music-library visual system */
body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0.32;
  background-image: linear-gradient(rgb(255 255 255 / 0.018) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / 0.018) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 64%);
}

h1 { font-weight: 830; text-wrap: balance; }
h2, h3 { font-weight: 760; }
p { text-wrap: pretty; }
.muted { color: var(--muted); }
.eyebrow { color: var(--primary); font-size: 0.7rem; letter-spacing: 0.16em; }

.topbar {
  height: 72px;
  padding: 0 30px;
  border-color: rgb(255 255 255 / 0.07);
  background: rgb(10 13 11 / 0.94);
}
.brand { gap: 12px; }
.brand-mark {
  display: flex;
  width: 38px;
  height: 38px;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 9px 8px;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-radius: 12px;
  background: var(--primary);
  box-shadow: 0 8px 24px rgb(168 211 70 / 0.15);
}
.brand-mark span { width: 3px; border-radius: 4px; background: var(--primary-ink); }
.brand-mark span:nth-child(1) { height: 9px; }
.brand-mark span:nth-child(2) { height: 18px; }
.brand-mark span:nth-child(3) { height: 13px; }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font-size: 0.94rem; letter-spacing: -0.015em; }
.brand-copy small { color: #71806f; font-size: 0.55rem; font-weight: 800; letter-spacing: 0.19em; }
.player-link, .icon-button {
  min-height: 40px;
  border-color: var(--line);
  border-radius: 10px;
  color: #b5beb2;
  background: rgb(255 255 255 / 0.025);
}
.player-link { gap: 7px; padding-inline: 14px; font-weight: 700; }
.logout-button { padding-inline: 14px; }

.app-shell { padding-top: 72px; }
.sidebar {
  top: 72px;
  gap: 4px;
  padding: 30px 18px;
  border-color: rgb(255 255 255 / 0.07);
  background: #0c100d;
}
.nav-label { margin: 0 12px 8px; color: #596358; font-size: 0.61rem; font-weight: 800; letter-spacing: 0.18em; }
.nav-label-tools { margin-top: 24px; }
.sidebar a {
  gap: 13px;
  min-height: 48px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 0.86rem;
  font-weight: 700;
}
.nav-icon {
  width: 19px;
  height: 19px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sidebar a[aria-current="page"] {
  border-color: rgb(214 255 115 / 0.16);
  color: var(--text);
  background: rgb(214 255 115 / 0.1);
  box-shadow: none;
}
.sidebar a[aria-current="page"] .nav-icon { color: var(--primary); }
.content { max-width: 1360px; padding: 46px clamp(26px, 4.5vw, 72px) 100px; }

.page-header { margin-bottom: 30px; }
.page-header h1 { font-size: clamp(2rem, 4vw, 3rem); }
.section-heading h2 { font-size: 1.22rem; }
.button { border-radius: 12px; font-size: 0.84rem; }
.button.primary { box-shadow: 0 10px 30px rgb(172 218 67 / 0.12); }
.button.secondary { border-color: var(--line-strong); background: #161c17; }
.button.ghost { color: #a7b0a4; }
.panel, .link-command {
  border-color: var(--line);
  background: var(--surface);
  box-shadow: none;
}
.link-command { border-color: rgb(214 255 115 / 0.2); background: linear-gradient(135deg, rgb(214 255 115 / 0.055), transparent 45%), var(--surface); }
.metric-strip { border-color: var(--line); background: var(--line); }
.metric { background: var(--surface); }
.metric:hover { background: var(--surface-2); }
.cover { border-color: var(--line); background: linear-gradient(145deg, var(--surface-3), var(--surface-2)); }
.music-card .cover { transition: transform 180ms ease, border-color 180ms ease; }
.music-card:hover .cover { transform: translateY(-2px); border-color: var(--line-strong); }
label { color: #c2cac0; }
input, select { border-color: var(--line-strong); background: #0c100d; }
input::placeholder { color: #657063; }
.badge { border-radius: 7px; }
.table-panel { border-radius: 16px; }
th { color: #7f8b7d; }
tbody tr { transition: background-color 120ms ease; }
tbody tr:hover { background: rgb(255 255 255 / 0.024); }
.chip { border-radius: 9px; background: var(--surface-2); }
.playlist-card { background: var(--surface); }
.playlist-card.auto-playlist { border-color: rgb(214 255 115 / 0.34); background: linear-gradient(145deg, rgb(214 255 115 / 0.06), transparent 55%), var(--surface); }
.file-row { background: var(--surface); }
.toast { background: #182019; }
.login-card { background: #111612; }

.library-hero {
  position: relative;
  display: grid;
  grid-template-columns: clamp(160px, 18vw, 220px) minmax(0, 1fr);
  align-items: end;
  gap: clamp(26px, 4vw, 48px);
  margin: -6px 0 34px;
  padding: clamp(24px, 4vw, 42px);
  overflow: hidden;
  border: 1px solid rgb(214 255 115 / 0.18);
  border-radius: 24px;
  background: linear-gradient(120deg, rgb(214 255 115 / 0.14), transparent 46%), linear-gradient(150deg, #1b241b, #0f1410 72%);
}
.library-hero::after {
  position: absolute;
  right: -6%;
  bottom: -70%;
  width: 360px;
  aspect-ratio: 1;
  border: 1px solid rgb(214 255 115 / 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 48px rgb(214 255 115 / 0.025), 0 0 0 96px rgb(214 255 115 / 0.018);
  content: "";
  pointer-events: none;
}
.library-cover {
  position: relative;
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: 20px;
  background: linear-gradient(145deg, #d6ff73 0 46%, #91bb36 46% 53%, #1a2516 53%);
  box-shadow: 0 26px 70px rgb(0 0 0 / 0.36);
}
.library-cover::before, .library-cover::after {
  position: absolute;
  width: 74%;
  aspect-ratio: 1;
  border: 1px solid rgb(10 13 11 / 0.25);
  border-radius: 50%;
  content: "";
}
.library-cover::after { width: 46%; }
.library-cover-note { position: relative; z-index: 1; color: #111a05; font-size: clamp(2.8rem, 6vw, 5rem); font-weight: 900; transform: translateY(-4px); }
.library-cover-line { position: absolute; right: 12%; bottom: 16%; left: 12%; height: 2px; background: rgb(214 255 115 / 0.5); }
.library-cover small { position: absolute; right: 12%; bottom: 9%; color: #d6ff73; font-size: 0.54rem; font-weight: 800; letter-spacing: 0.12em; }
.library-hero-copy { position: relative; z-index: 1; padding-bottom: 2px; }
.library-hero h1 { margin-bottom: 12px; font-size: clamp(2.35rem, 5vw, 4.3rem); line-height: 0.98; letter-spacing: -0.055em; }
.library-description { max-width: 660px; margin-bottom: 14px; color: #b4bdb1; }
.library-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 22px; color: #899486; font-size: 0.78rem; }
.library-meta strong { color: var(--text); }
.playlist-header-actions { justify-content: flex-start; }
.hero-play { min-width: 132px; }
.track-list-heading { align-items: center; padding-top: 22px !important; }
.track-count { padding: 5px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); font-size: 0.72rem; }
.track-table th, .track-table td { padding: 11px 18px; }
.track-table th:first-child, .track-table td:first-child { width: 54px; text-align: center; }
.track-table th:last-child, .track-table td:last-child { width: 72px; text-align: right; }
.track-title-cell { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 13px; }
.track-title-cell strong, .track-title-cell span { display: block; }
.track-title-cell strong { margin-bottom: 3px; font-size: 0.9rem; }
.track-title-cell .muted { font-size: 0.74rem; }
.track-cover { display: grid; width: 48px; aspect-ratio: 1; place-items: center; overflow: hidden; border-radius: 8px; background: linear-gradient(145deg, #2b352a, #171e18); color: var(--primary); }
.track-cover img { width: 100%; height: 100%; object-fit: cover; }
.track-number { color: #778274; font-variant-numeric: tabular-nums; }
.track-album { max-width: 340px; font-size: 0.77rem; }
.track-play {
  display: inline-grid;
  width: 44px;
  min-height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: #acb6aa;
  cursor: pointer;
}
.track-play:hover, .track-play.is-playing { border-color: var(--primary); color: var(--primary); background: rgb(214 255 115 / 0.07); }
.playing-bars { display: none; height: 14px; align-items: end; justify-content: center; gap: 2px; }
.playing-bars i { width: 2px; border-radius: 2px; background: var(--primary); animation: player-bars 700ms ease-in-out infinite alternate; }
.playing-bars i:nth-child(1) { height: 7px; }
.playing-bars i:nth-child(2) { height: 13px; animation-delay: -220ms; }
.playing-bars i:nth-child(3) { height: 9px; animation-delay: -420ms; }
.track-table tr.is-current.is-playing-row .track-number > span:first-child { display: none; }
.track-table tr.is-current.is-playing-row .playing-bars { display: inline-flex; }
@keyframes player-bars { to { height: 4px; } }

.playlist-player {
  right: 22px;
  bottom: 20px;
  left: calc(var(--sidebar) + 22px);
  grid-template-columns: 54px minmax(150px, 1fr) auto minmax(180px, 1.2fr);
  min-height: 88px;
  gap: 14px;
  padding: 12px 16px;
  border-color: #445140;
  border-radius: 16px;
  background: #111712;
  box-shadow: 0 24px 80px rgb(0 0 0 / 0.55), inset 0 1px rgb(255 255 255 / 0.04);
  backdrop-filter: none;
}
.player-artwork-wrap { position: relative; display: grid; width: 54px; height: 54px; place-items: center; overflow: hidden; border-radius: 10px; background: linear-gradient(145deg, #33412c, #1b251b); color: var(--primary); }
.player-artwork { width: 100%; height: 100%; border-radius: 0; object-fit: cover; }
#player-artwork-fallback { font-size: 1.3rem; }
.player-track { display: block; }
.player-track strong, .player-track span { display: block; }
.player-track strong { margin-bottom: 4px; font-size: 0.86rem; }
.player-track .muted { font-size: 0.72rem; }
.player-controls { justify-content: center; gap: 3px; }
.player-controls .icon-button { width: 38px; min-height: 38px; padding: 0; color: #9da79a; font-size: 1.2rem; }
.player-controls .player-main-action { width: 44px; min-height: 44px; color: var(--primary-ink); background: var(--primary); font-size: 0.9rem; }
.player-controls [aria-pressed="true"], .player-controls [data-mode="one"] { color: var(--primary); }
.player-timeline { min-width: 0; }
.player-progress { display: block; width: 100%; min-height: 26px; margin: 0; accent-color: var(--primary); }
.player-timeline-meta { display: flex; justify-content: space-between; gap: 10px; color: #778273; font-size: 0.64rem; }
.player-time { color: #8f9a8c; font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 1100px) {
  :root { --sidebar: 82px; }
  .nav-label { display: none; }
  .sidebar { align-items: center; padding-inline: 12px; }
  .sidebar a { width: 54px; justify-content: center; padding: 0; }
  .sidebar a > span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .playlist-player { grid-template-columns: 50px minmax(120px, 1fr) auto minmax(150px, 0.9fr); }
}

@media (max-width: 760px) {
  body::before { opacity: 0.2; }
  .topbar { height: 60px; padding: 0 14px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .brand-copy small { display: none; }
  .logout-button { width: 40px; padding: 0; font-size: 0; }
  .logout-button::after { content: "↪"; font-size: 1rem; }
  .app-shell { padding-top: 60px; }
  .content { padding: 24px 14px 44px; }
  .sidebar { top: auto; right: 0; bottom: 0; left: 0; height: calc(68px + env(safe-area-inset-bottom)); padding: 5px 5px env(safe-area-inset-bottom); }
  .sidebar .nav-label { display: none; }
  .sidebar a { width: auto; min-width: 50px; height: 56px; gap: 3px; border: 0; border-radius: 10px; }
  .sidebar a > span:last-child { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .nav-icon { width: 18px; height: 18px; }
  .sidebar a[aria-current="page"] { background: rgb(214 255 115 / 0.1); box-shadow: inset 0 2px var(--primary); }
  .library-hero { grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 18px; margin: 0 0 20px; padding: 18px; border-radius: 18px; }
  .library-cover { border-radius: 13px; }
  .library-cover small, .library-cover-line { display: none; }
  .library-cover-note { font-size: 2.3rem; }
  .library-hero h1 { margin-bottom: 8px; font-size: clamp(1.75rem, 8vw, 2.5rem); }
  .library-description { display: none; }
  .library-meta { margin-bottom: 13px; }
  .playlist-header-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .playlist-header-actions .button { width: 100%; padding-inline: 10px; }
  .track-list-heading { padding: 17px 16px 0 !important; }
  .track-table, .track-table tbody { display: table; }
  .track-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  .track-table tbody tr { display: table-row; padding: 0; }
  .track-table tbody td { display: table-cell; padding: 9px 8px; border-top: 1px solid var(--line); }
  .track-table th:first-child, .track-table td:first-child { width: 38px; }
  .track-title-cell { display: grid !important; grid-template-columns: 44px minmax(0, 1fr); }
  .track-cover { width: 44px; }
  .track-album { display: none !important; }
  .track-action { width: 56px; }
  .track-play { width: 44px; min-height: 44px; }
  .playlist-player {
    right: 8px;
    bottom: calc(72px + env(safe-area-inset-bottom));
    left: 8px;
    grid-template-columns: 46px minmax(0, 1fr);
    min-height: 160px;
    gap: 8px 10px;
    padding: 10px 11px 8px;
    border-radius: 14px;
  }
  .player-artwork-wrap { width: 46px; height: 46px; }
  .player-controls { grid-column: 1 / -1; justify-content: center; }
  .player-controls .icon-button { display: inline-flex; width: 44px; min-height: 44px; }
  .player-timeline { grid-column: 1 / -1; }
  .player-timeline-meta { margin-top: -2px; }
  .has-playlist-player .content { padding-bottom: 210px; }
  .toast-region { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .has-playlist-player .toast-region { bottom: calc(240px + env(safe-area-inset-bottom)); }
}

@media (max-width: 390px) {
  .content { padding-inline: 11px; }
  .sidebar a { min-width: 46px; padding-inline: 3px; font-size: 0.57rem; }
  .library-hero { grid-template-columns: 78px minmax(0, 1fr); gap: 14px; padding: 14px; }
  .library-hero .eyebrow { font-size: 0.56rem; }
  .library-hero h1 { font-size: 1.65rem; }
  .library-meta { font-size: 0.68rem; }
  .playlist-header-actions { gap: 7px; }
  .playlist-header-actions .button { min-height: 42px; font-size: 0.72rem; }
  .track-table tbody td { padding-inline: 5px; }
  .track-title-cell { grid-template-columns: 40px minmax(0, 1fr); gap: 10px; }
  .track-cover { width: 40px; }
}

@media (max-width: 760px) {
  .sidebar { justify-content: stretch; }
  .sidebar a { flex: 1 1 0; width: auto; min-width: 0; padding-inline: 1px; }
  .sidebar a > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 340px) {
  .sidebar a { font-size: 0.5rem; }
  .nav-icon { width: 17px; height: 17px; }
}
