
:root {
  --bg: #f3f0e9;
  --surface: #fffdf8;
  --surface-2: #ebe6dc;
  --text: #17181b;
  --muted: #6d6b66;
  --line: #d8d2c8;
  --accent: #d24b2f;
  --accent-dark: #a83420;
  --good: #2e7d52;
  --warn: #b7791f;
  --bad: #b23a31;
  --shadow: 0 14px 40px rgba(30, 25, 18, .08);
  --radius: 18px;
}
[data-theme="dark"] {
  --bg: #111318;
  --surface: #191c22;
  --surface-2: #242832;
  --text: #f4f1ea;
  --muted: #a9a9a6;
  --line: #313641;
  --accent: #f06a49;
  --accent-dark: #ff8569;
  --good: #65c48f;
  --warn: #e0ad58;
  --bad: #ed7468;
  --shadow: 0 16px 48px rgba(0, 0, 0, .25);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  color-scheme: light;
}
[data-theme="dark"] body { color-scheme: dark; }
.login-screen {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(circle at 15% 15%, color-mix(in srgb, var(--accent) 24%, transparent), transparent 34%),
    radial-gradient(circle at 85% 85%, rgba(255, 190, 92, .18), transparent 32%),
    #101217;
}
.login-card {
  position: relative; width: min(460px, 100%); padding: 42px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 28px;
  background: rgba(28, 30, 36, .88); color: #f8f5ee;
  box-shadow: 0 32px 100px rgba(0,0,0,.48); backdrop-filter: blur(18px);
}
.login-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(135deg, rgba(255,255,255,.08), transparent 45%); }
.login-card h1 { font-size: clamp(2.3rem, 8vw, 3.4rem); line-height: .98; margin: 14px 0 18px; }
.login-card h1 span { color: #f06a49; }
.login-card .muted { line-height: 1.55; color: #aaa9a6; margin-bottom: 26px; }
.login-logo { display: block; width: 100%; height: auto; margin: 0 auto 24px; filter: drop-shadow(0 10px 24px rgba(0,0,0,.3)); }
.login-field { display: grid; gap: 8px; font-size: .84rem; font-weight: 750; }
.password-control { position: relative; display: block; }
.password-control input { width: 100%; padding: 14px 88px 14px 14px; border: 1px solid #444852; border-radius: 13px; outline: 0; background: #15171c; color: white; }
.password-control input:focus { border-color: #f06a49; box-shadow: 0 0 0 3px rgba(240,106,73,.16); }
.password-toggle { position: absolute; right: 1px; top: 1px; bottom: 1px; min-width: 86px; border: 0; border-radius: 10px; padding: 0 10px; background: transparent; color: #aaa9a6; font-size: .78rem; }
.login-submit { width: 100%; display: flex; justify-content: space-between; margin-top: 14px; padding: 14px 16px; }
.error { min-height: 22px; padding-top: 10px; color: #ff9486; font-size: .86rem; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 2px;
}
.topbar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 24px 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.admin-toggle { display: inline-flex; align-items: center; gap: 7px; }
.admin-toggle > span:first-child { font-size: 1.05rem; line-height: 1; }
.theme-toggle { display: inline-flex; align-items: center; gap: 7px; }
.theme-toggle > span:first-child { width: 1.1em; font-size: 1.05rem; line-height: 1; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.6rem); letter-spacing: -.055em; margin-bottom: 0; }
h1 span { color: var(--accent); font-weight: 500; }
h2 { letter-spacing: -.025em; }
.eyebrow { font-size: .72rem; font-weight: 800; letter-spacing: .18em; color: var(--accent); margin-bottom: 6px; }
main { max-width: 1180px; margin: 0 auto; padding: 0 24px 60px; }
.icon-button {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 8px 0 22px;
}
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.stat strong { display: block; font-size: 1.8rem; letter-spacing: -.04em; }
.stat span { color: var(--muted); font-size: .84rem; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab { border: 0; background: transparent; color: var(--muted); padding: 12px 16px; white-space: nowrap; }
.tab.active { color: var(--text); border-bottom: 3px solid var(--accent); font-weight: 700; }
.view { display: none; }
.view.active { display: block; }
.toolbar { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-bottom: 12px; }
.toolbar > input[type="search"] { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; background: var(--surface); color: var(--text); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin: 8px 0 15px; }
.section-heading h2 { margin-bottom: 0; }
.songs-playlist-link { margin: 0 0 14px; }
.songs-playlist-link > a {
  position: relative; display: grid; grid-template-columns: 68px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  min-height: 84px; overflow: hidden; padding: 8px 16px 8px 8px; border: 1px solid color-mix(in srgb, #1ed760 28%, var(--line));
  border-radius: 16px; background: linear-gradient(105deg, color-mix(in srgb, #1ed760 10%, var(--surface)), var(--surface) 62%);
  color: var(--text); text-decoration: none; box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease;
}
.songs-playlist-link > a::after { content: ""; position: absolute; right: 3%; width: 150px; height: 100px; border-radius: 50%; background: rgba(30,215,96,.08); filter: blur(24px); pointer-events: none; }
.songs-playlist-link > a:hover { transform: translateY(-2px); border-color: #1ed760; }
.songs-playlist-link > a:focus-visible { outline: 3px solid color-mix(in srgb, #1ed760 45%, transparent); outline-offset: 2px; }
.songs-playlist-cover { width: 68px; height: 68px; overflow: hidden; border-radius: 11px; box-shadow: 0 8px 20px rgba(0,0,0,.22); }
.songs-playlist-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.songs-playlist-copy { display: grid; min-width: 0; gap: 4px; }
.songs-playlist-copy strong { overflow: hidden; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.songs-playlist-kicker { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .72rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; }
.songs-playlist-kicker img { width: 16px; height: 16px; }
.songs-playlist-arrow { position: relative; z-index: 1; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #1ed760; color: #101712; font-weight: 900; }
.playlist-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 22px; align-items: center;
  margin-bottom: 12px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 16px;
  background: color-mix(in srgb, #1ed760 6%, var(--surface)); box-shadow: var(--shadow);
}
.admin-dialog { width: min(980px, calc(100% - 24px)); max-height: min(92dvh, 980px); overflow-y: auto; background: var(--bg); }
.admin-dialog-content { padding: 26px; }
.admin-heading { position: relative; margin: 0 0 18px; padding-right: 44px; }
.admin-heading .dialog-close { right: 0; top: 0; }
.admin-card { margin-bottom: 16px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.members-admin .section-heading { margin-top: 0; }
.members-admin h3 { margin: 0; font-size: 1.25rem; }
.playlist-loading, .playlist-main { display: flex; min-width: 0; align-items: center; gap: 12px; }
.playlist-main strong, .playlist-loading strong { display: block; }
.playlist-main p, .playlist-loading p { margin: 3px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.playlist-logo { display: grid; flex: 0 0 auto; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2); }
.playlist-logo.connected { background: color-mix(in srgb, #1ed760 15%, var(--surface)); }
.playlist-logo img { width: 25px; height: 25px; }
.playlist-title-line { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.connection-badge { padding: 3px 7px; border-radius: 999px; background: color-mix(in srgb, #1ed760 16%, var(--surface)); color: color-mix(in srgb, #16883f 82%, var(--text)); font-size: .68rem; font-weight: 800; }
.playlist-meta { display: grid; gap: 2px; min-width: 0; font-size: .78rem; }
.playlist-meta .has-missing { color: var(--warn); font-weight: 750; }
.playlist-meta .is-complete { color: var(--good); font-weight: 750; }
.playlist-missing-names { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.playlist-settings { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(260px, 1fr) minmax(300px, 1fr); gap: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.playlist-name-form { display: grid; align-content: start; gap: 7px; }
.playlist-name-form label, .playlist-cover-setting strong { font-size: .8rem; font-weight: 800; }
.playlist-name-form > div { display: flex; gap: 7px; }
.playlist-name-form input { min-width: 0; width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; background: var(--surface); color: var(--text); }
.playlist-cover-setting { display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: center; }
.playlist-cover-setting p { margin: 3px 0 8px; color: var(--muted); font-size: .76rem; }
.playlist-cover-preview { width: 76px; height: 76px; overflow: hidden; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 1.5rem; }
.playlist-cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.cover-file-label { display: inline-flex; align-items: center; cursor: pointer; }
.playlist-cover-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.cover-file-label input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.cover-file-label:focus-within { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 2px; }
.spotify-permission-link { display: inline-flex; width: fit-content; align-items: center; text-decoration: none; }
.playlist-cover-feedback { display: block; margin-top: 5px; color: var(--muted); font-size: .72rem; }
.playlist-actions { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.playlist-actions a { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
.spotify-connect, .spotify-sync { min-height: 40px; border: 0; border-radius: 10px; padding: 9px 13px; background: #1ed760; color: #101712; font-weight: 800; text-decoration: none; white-space: nowrap; }
.spotify-connect:hover, .spotify-sync:hover { background: #1fdf64; }
.playlist-disconnect { min-height: 36px; border: 0; padding: 7px 5px; background: transparent; color: var(--muted); font-size: .76rem; }
.playlist-disconnect:hover { color: var(--bad); }
.search { display: flex; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 0 13px; }
.search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--text); padding: 13px 0; }
select, input[type="date"], textarea {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 12px; padding: 11px 12px;
}
.song-list { display: grid; gap: 9px; }
.song-card {
  display: grid; grid-template-columns: 60px 1fr auto; gap: 15px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px 15px; transition: transform .15s ease, border-color .15s ease;
}
.cover-art {
  position: relative; width: 60px; aspect-ratio: 1; overflow: hidden; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(145deg, var(--surface-2), color-mix(in srgb, var(--accent) 18%, var(--surface)));
  color: var(--accent); font-size: .84rem; font-weight: 850; letter-spacing: .05em;
}
.cover-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.song-year { margin-bottom: 3px; }
.song-card:hover { transform: translateY(-1px); border-color: var(--accent); }
.song-card:focus-visible { border-color: var(--accent); outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent); outline-offset: 2px; }
.year { font-size: 1.05rem; font-weight: 800; color: var(--accent); }
.song-title { font-weight: 760; }
.song-meta { color: var(--muted); font-size: .86rem; margin-top: 3px; }
.song-status, .status { display: flex; align-items: center; gap: 10px; }
.song-actions { display: flex; align-items: center; gap: 6px; }
.song-provider-link, .media-link {
  display: inline-grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--line);
  background: var(--surface-2); text-decoration: none; transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
.song-provider-link { width: 34px; height: 34px; border-radius: 9px; }
.song-provider-link img { display: block; width: 20px; height: 20px; object-fit: contain; }
.song-provider-link.youtube img { width: 22px; }
.song-provider-link:hover, .media-link:hover { transform: translateY(-1px); border-color: var(--muted); background: var(--surface); }
.song-provider-link:focus-visible, .media-link:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 42%, transparent); outline-offset: 2px; }
.song-provider-link.unavailable, .media-link.unavailable { cursor: not-allowed; background: var(--surface-2); border-color: var(--line); transform: none; }
.song-provider-link.unavailable img, .media-link.unavailable img { filter: grayscale(1); opacity: .28; }
.compact-button { min-height: 44px; padding: 8px 12px; border-radius: 10px; font-size: .82rem; }
.rating { font-size: 1.05rem; letter-spacing: 1px; color: var(--warn); white-space: nowrap; }
.last-date { font-size: .8rem; color: var(--muted); min-width: 92px; text-align: right; }
.rate-button, .primary, .secondary, .danger {
  min-height: 44px; border-radius: 12px; padding: 11px 14px; font-weight: 750;
}
.rate-button { border: 1px solid var(--line); background: var(--surface-2); color: var(--text); }
.primary { border: 0; background: var(--accent); color: white; }
.primary:hover { background: var(--accent-dark); }
.secondary { border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.danger { border: 1px solid var(--bad); background: transparent; color: var(--bad); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.date-field { display: grid; gap: 5px; color: var(--muted); font-size: .78rem; font-weight: 750; }
.muted { color: var(--muted); }
.helper { margin: 0; font-size: .84rem; }
.attendance-fieldset { margin: 20px 0 26px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.choice-chip { min-height: 46px; display: inline-flex; align-items: center; gap: 8px; padding: 5px 14px 5px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-weight: 700; }
.choice-chip.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); box-shadow: inset 0 0 0 1px var(--accent); }
.member-avatar { width: 34px; height: 34px; display: inline-grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: var(--surface-2); color: var(--accent); font-weight: 850; }
.choice-chip.selected .member-avatar { background: var(--accent); color: white; }
.choice-chip > span:last-child { display: grid; text-align: left; }
.choice-chip small { color: var(--muted); font-size: .66rem; font-weight: 650; }
.session-subheading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.session-subheading h3 { margin: 0 0 4px; }
.selection-count { white-space: nowrap; padding: 6px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: .78rem; font-weight: 750; }
.session-list { display: grid; gap: 8px; }
.session-row {
  display: grid; grid-template-columns: auto 1fr 180px; gap: 12px; align-items: center;
  padding: 11px; border: 1px solid var(--line); border-radius: 13px;
}
.session-row.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.session-row input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }
.session-rating { display: flex; gap: 5px; }
.rating-btn {
  display: grid; place-items: center; width: 36px; height: 44px; padding: 0; line-height: 1;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--muted);
}
.rating-btn.selected { background: var(--accent); color: white; border-color: var(--accent); }
.member-rating-toggle { grid-column: 2 / -1; justify-self: start; min-height: 36px; padding: 4px 0; border: 0; background: transparent; color: var(--accent); font-weight: 750; }
.member-ratings { grid-column: 2 / -1; display: grid; gap: 8px; padding: 12px; border-radius: 11px; background: var(--surface-2); }
.member-rating-row { display: grid; grid-template-columns: minmax(90px, 1fr) auto; gap: 10px; align-items: center; }
.member-rating-row > span { font-size: .86rem; font-weight: 700; }
.mini-rating { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.mini-rating .rating-btn { width: 36px; height: 44px; }
.rating-inherit { min-height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 0 9px; background: var(--surface); color: var(--muted); font-size: .74rem; }
.rating-inherit.selected { border-color: var(--accent); color: var(--accent); font-weight: 750; }
.member-list { display: grid; gap: 9px; }
.member-card { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.member-actions { display: flex; gap: 6px; }
.overview-intro { margin-bottom: 24px; }
.overview-section + .overview-section { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.overview-section h3 { margin: 0 0 12px; }
.overview-song-list { display: grid; gap: 4px; }
.overview-song-row { display: grid; grid-template-columns: minmax(170px, 1fr) 2fr; gap: 14px; align-items: center; min-height: 48px; padding: 8px 10px; border-radius: 10px; }
.overview-song-row:nth-child(odd) { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.overview-song-row > div:first-child { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.overview-song-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.play-count { flex: 0 0 auto; color: var(--muted); font-size: .72rem; }
.tally { min-height: 30px; display: flex; align-items: flex-end; flex-wrap: wrap; gap: 4px; }
.tally-mark { position: relative; width: 7px; height: 27px; display: inline-block; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.tally-mark::after { content: attr(data-tooltip); position: absolute; left: 50%; bottom: calc(100% + 8px); z-index: 4; width: max-content; max-width: 220px; padding: 6px 8px; border-radius: 7px; background: var(--text); color: var(--surface); font-size: .72rem; line-height: 1.3; opacity: 0; pointer-events: none; transform: translate(-50%, 4px); transition: opacity .12s ease, transform .12s ease; }
.tally-mark:hover::after, .tally-mark:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.tally-mark.rating-bad { background: var(--bad); }
.tally-mark.rating-warn { background: var(--warn); }
.tally-mark.rating-good { background: var(--good); }
.tally-mark.rating-bad { height: 14px; }
.tally-mark.rating-warn { height: 21px; }
.tally-mark.rating-good { height: 28px; }
.older-count { align-self: center; margin-left: 4px; color: var(--muted); font-size: .72rem; }
.tally-mark:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 2px; }
.never-played { font-size: .78rem; }
.rehearsal-card { padding: 12px 0; border-top: 1px solid var(--line); }
.rehearsal-card summary { display: flex; justify-content: space-between; gap: 12px; cursor: pointer; }
.rehearsal-card summary > div { min-width: 0; }
.rehearsal-card summary > span { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.rehearsal-song-details { display: grid; gap: 6px; margin: 12px 0 0 18px; }
.rehearsal-card-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.rehearsal-song-details > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 9px; border-radius: 9px; background: var(--surface-2); }
.rehearsal-song-details small { display: block; color: var(--muted); margin-top: 2px; }
.traffic-text { padding: 4px 7px; border-radius: 7px; color: white; font-size: .78rem; }
.traffic-text.rating-bad { background: var(--bad); }
.traffic-text.rating-warn { background: var(--warn); color: #17181b; }
.traffic-text.rating-good { background: var(--good); }
.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; }
.sticky-action { position: sticky; bottom: 10px; padding-top: 16px; display: flex; justify-content: flex-end; }
.session-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 16px; }
.history-group { border-top: 1px solid var(--line); padding: 16px 0; }
.history-group:first-child { border-top: 0; }
.history-date { font-weight: 800; margin-bottom: 10px; }
.history-entry { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; padding: 8px 0; }
.history-notes { grid-column: 1 / -1; color: var(--muted); font-size: .87rem; }
.settings-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.file-button input { display: none; }
dialog {
  width: min(520px, calc(100% - 24px)); border: 1px solid var(--line); border-radius: 20px;
  background: var(--surface); color: var(--text); padding: 0; box-shadow: 0 30px 90px rgba(0,0,0,.3);
}
dialog::backdrop { background: rgba(0,0,0,.5); backdrop-filter: blur(3px); }
.song-details-dialog { width: min(760px, calc(100% - 24px)); max-height: min(88vh, 900px); overflow-y: auto; }
#songDetailsContent { padding: 28px; }
.song-detail-hero { display: grid; grid-template-columns: 180px 1fr; gap: 24px; align-items: center; padding-right: 24px; }
.song-detail-cover { width: 180px; aspect-ratio: 1; overflow: hidden; display: grid; place-items: center; border-radius: 20px; background: linear-gradient(145deg, var(--surface-2), color-mix(in srgb, var(--accent) 18%, var(--surface))); color: var(--accent); font-size: 2rem; font-weight: 850; box-shadow: var(--shadow); }
.song-detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.song-detail-hero h2 { margin: 0 0 18px; font-size: clamp(1.8rem, 5vw, 2.7rem); line-height: 1.05; }
.detail-kpis { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-kpis span { padding: 8px 11px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: .8rem; }
.detail-kpis strong { color: var(--text); font-size: 1rem; }
.detail-section { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.detail-section h3 { margin: 0; }
.detail-section-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.detail-section-heading > span { color: var(--muted); font-size: .82rem; }
.song-detail-timeline { display: grid; gap: 9px; }
.song-detail-event { display: grid; grid-template-columns: 58px 1fr; gap: 13px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.event-rating { width: 58px; height: 58px; display: grid; place-content: center; text-align: center; border-radius: 13px; color: white; }
.event-rating.rating-bad { background: var(--bad); }
.event-rating.rating-warn { background: var(--warn); color: #17181b; }
.event-rating.rating-good { background: var(--good); }
.event-rating strong { font-size: 1.35rem; line-height: 1; }
.event-rating span { margin-top: 3px; font-size: .66rem; }
.event-body { min-width: 0; }
.event-heading { display: flex; justify-content: space-between; gap: 10px; }
.event-heading span, .event-meta { color: var(--muted); font-size: .78rem; }
.event-meta { margin-top: 5px; }
.member-overrides { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.member-overrides span { padding: 5px 8px; border-radius: 8px; background: var(--surface-2); font-size: .75rem; }
.event-notes, .initial-assessment p { margin: 9px 0 0; color: var(--muted); font-size: .84rem; }
.initial-assessment { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; padding: 11px; border-radius: 12px; background: var(--surface-2); }
.compact-empty { padding: 24px 12px; }
.media-links { display: flex; flex-wrap: nowrap; gap: 7px; margin-top: 12px; }
.media-link { width: 38px; height: 38px; border-radius: 10px; }
.media-link img { display: block; width: 23px; height: 23px; object-fit: contain; }
.media-link.youtube img { width: 25px; }
.song-detail-actions { margin: 8px 0 10px; }
.song-detail-actions button { min-height: 36px; padding: 7px 10px; }
.media-editor .detail-section-heading p { margin: 5px 0 0; max-width: 620px; color: var(--muted); font-size: .84rem; line-height: 1.45; }
.media-link-form { display: grid; gap: 11px; }
.media-link-form label { display: grid; gap: 6px; color: var(--text); font-size: .82rem; font-weight: 750; }
.media-link-form label small { color: var(--muted); font-weight: 500; }
.media-link-form input { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; background: var(--surface); color: var(--text); }
.media-editor-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.media-candidate-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.media-candidate-results h4 { margin: 0 0 8px; font-size: .82rem; letter-spacing: .05em; text-transform: uppercase; }
.media-candidate-list { display: grid; gap: 8px; }
.media-candidate { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 9px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.media-provider-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: white; font-size: .8rem; font-weight: 900; }
.media-provider-mark.spotify { background: #16883f; }
.media-provider-mark.youtube { border-radius: 10px; background: #c51f1a; }
.media-provider-mark.songsterr { border-radius: 10px; background: #25292f; color: #f2a900; font-size: .66rem; letter-spacing: -.03em; }
.media-candidate-copy { min-width: 0; display: grid; gap: 2px; }
.media-candidate-copy strong, .media-candidate-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-candidate-copy strong { font-size: .82rem; }
.media-candidate-copy span { color: var(--muted); font-size: .7rem; }
.choose-media { grid-column: 1 / -1; width: 100%; min-height: 40px; }
.media-editor-state { min-height: 94px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 13px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); text-align: center; font-size: .75rem; }
.media-editor-state[role="status"] { flex-direction: row; }
.media-editor-state strong { color: var(--text); }
.media-editor-error { border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); color: var(--bad); }
.songsterr-search-link { margin-top: 5px; color: #b67700; font-weight: 800; text-underline-offset: 3px; }
[data-theme="dark"] .songsterr-search-link { color: #ffc144; }
.cover-editor .detail-section-heading { margin-bottom: 14px; }
.cover-editor .detail-section-heading p { margin: 5px 0 0; color: var(--muted); font-size: .84rem; line-height: 1.45; }
.cover-editor-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cover-upload-button { position: relative; display: inline-grid; place-items: center; min-height: 44px; border-radius: 12px; padding: 11px 14px; font-weight: 750; cursor: pointer; }
.cover-upload-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cover-upload-button:focus-within { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 2px; }
.cover-upload-button.uploading { cursor: wait; opacity: .65; }
.cover-upload-help { margin: 8px 0 0; color: var(--muted); font-size: .74rem; }
.cover-candidate-list { display: grid; gap: 8px; margin-top: 14px; }
.cover-candidate { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.candidate-art { width: 72px; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--accent); font-size: 1.3rem; }
.candidate-art img { width: 100%; height: 100%; object-fit: cover; }
.candidate-copy { min-width: 0; display: grid; gap: 2px; }
.candidate-copy strong, .candidate-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.candidate-copy span { color: var(--muted); font-size: .82rem; }
.candidate-copy small { color: var(--muted); font-size: .72rem; }
.choose-cover { white-space: nowrap; }
.cover-editor-state { min-height: 76px; display: flex; align-items: center; justify-content: center; gap: 9px; padding: 16px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); text-align: center; font-size: .82rem; }
.cover-editor-state strong { color: var(--text); }
.cover-editor-state:not([role="status"]) { flex-direction: column; }
.cover-editor-error { border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); color: var(--bad); }
.loading-dot { width: 12px; height: 12px; flex: 0 0 auto; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: cover-spin .7s linear infinite; }
@keyframes cover-spin { to { transform: rotate(360deg); } }
#songForm, #entryForm, #memberForm { padding: 25px; display: grid; gap: 15px; }
#songForm label, #entryForm label, #memberForm label { display: grid; gap: 7px; font-weight: 700; font-size: .88rem; }
#songForm label input:not([type="checkbox"]), #entryForm label input, #memberForm label input { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; background: var(--surface); color: var(--text); }
#songForm .checkbox-label { display: flex; align-items: center; gap: 9px; }
#songForm .checkbox-label input { width: 18px; height: 18px; accent-color: var(--accent); }
#entryForm .checkbox-label { display: flex; align-items: center; gap: 9px; color: var(--muted); font-weight: 600; }
#entryForm .checkbox-label input { width: 19px; height: 19px; accent-color: var(--accent); flex: 0 0 auto; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 4px; }
#songForm textarea, #entryForm textarea { resize: vertical; min-height: 100px; }
.optional { color: var(--muted); font-weight: 500; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 700; font-size: .88rem; margin-bottom: 8px; }
.rating-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.rating-picker .rating-btn { width: 100%; height: 48px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--text); }
.rating-picker button.selected { background: var(--accent); border-color: var(--accent); color: #fff; }
.dialog-close { position: absolute; right: 14px; top: 12px; border: 0; background: transparent; color: var(--muted); font-size: 1.8rem; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 999px;
  max-width: calc(100% - 28px); text-align: center; opacity: 0; pointer-events: none; transition: .2s ease; z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.empty { display: grid; gap: 6px; text-align: center; color: var(--muted); padding: 42px 12px; border: 1px dashed var(--line); border-radius: 16px; }
.empty strong { color: var(--text); }
.cover-credit { margin: 18px 2px 0; color: var(--muted); font-size: .75rem; }
.cover-credit a { color: inherit; text-underline-offset: 2px; }
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .song-card { grid-template-columns: 60px 1fr; }
  .song-status, .status { grid-column: 1 / -1; justify-content: space-between; flex-wrap: wrap; }
  .song-actions { width: 100%; align-items: center; }
  .song-actions .delete-song { margin-left: auto; min-height: 38px; }
  .last-date { text-align: left; min-width: auto; }
  .session-row { grid-template-columns: auto 1fr; }
  .session-rating { grid-column: 2; }
  .overview-song-row { grid-template-columns: 1fr; gap: 5px; }
  .media-candidate-results { grid-template-columns: 1fr; }
  .playlist-card { grid-template-columns: 1fr; }
  .playlist-meta { padding-left: 54px; }
  .playlist-actions { grid-column: 1; grid-row: auto; justify-content: flex-start; padding-left: 54px; flex-wrap: wrap; }
  .playlist-settings { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .topbar { padding-top: 22px; }
  main, .topbar { padding-left: 14px; padding-right: 14px; }
  .toolbar { grid-template-columns: 1fr; }
  .songs-playlist-link > a { grid-template-columns: 58px minmax(0, 1fr) auto; min-height: 74px; gap: 11px; padding: 8px 10px 8px 8px; }
  .songs-playlist-cover { width: 58px; height: 58px; }
  .songs-playlist-arrow { width: 30px; height: 30px; }
  .stats { gap: 8px; }
  .stat { padding: 14px; }
  .panel { padding: 16px; }
  .panel-header { flex-direction: column; }
  .login-card { padding: 30px 22px; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .playlist-card { padding: 14px; }
  .admin-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); border-radius: 18px; }
  .admin-dialog-content { padding: 18px 14px 14px; }
  .admin-heading { flex-direction: row; align-items: center; }
  .playlist-meta, .playlist-actions { padding-left: 0; }
  .playlist-actions > * { flex: 1 1 auto; justify-content: center; text-align: center; }
  .playlist-disconnect { flex: 0 0 auto; }
  .tabs { position: sticky; top: 0; z-index: 5; background: var(--bg); }
  .tab { flex: 0 0 auto; padding-left: 12px; padding-right: 12px; }
  #songForm, #entryForm, #memberForm { padding: 22px 18px 18px; }
  .dialog-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .dialog-actions button { min-height: 44px; }
  .member-card { grid-template-columns: auto 1fr; }
  .member-actions { grid-column: 1 / -1; }
  .member-actions button { flex: 1; }
  .member-rating-row { grid-template-columns: 1fr; }
  .mini-rating { justify-content: flex-start; }
  .session-subheading { flex-direction: column; }
  .session-actions button { flex: 1; }
  .theme-toggle { width: 44px; padding-left: 0; padding-right: 0; justify-content: center; }
  .admin-toggle { width: 44px; padding-left: 0; padding-right: 0; justify-content: center; }
  .theme-label, .admin-toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  #songDetailsContent { padding: 22px 18px 18px; }
  .song-detail-hero { grid-template-columns: 1fr; gap: 15px; padding-right: 0; align-items: start; }
  .song-detail-cover { width: 140px; border-radius: 16px; }
  .song-detail-hero h2 { font-size: 1.7rem; margin-bottom: 11px; }
  .detail-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
  .song-detail-event { grid-template-columns: 48px 1fr; padding: 10px; }
  .event-rating { width: 48px; height: 52px; }
  .event-heading { display: grid; gap: 2px; }
  .media-links { display: flex; }
  .media-links .media-link { flex: 0 0 38px; }
  .media-editor-actions { display: grid; }
  .media-editor-actions > * { width: 100%; justify-content: center; }
  .cover-editor-actions { display: grid; }
  .cover-editor-actions > * { width: 100%; }
  .cover-candidate { grid-template-columns: 64px 1fr; align-items: start; }
  .candidate-art { width: 64px; }
  .choose-cover { grid-column: 1 / -1; width: 100%; }
}

@media (max-width: 340px) {
  .topbar { gap: 8px; }
  .topbar h1 { font-size: 1.65rem; }
  .topbar #logout { min-height: 40px; padding: 8px 8px; font-size: .74rem; }
  .topbar-actions { gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

.hidden{display:none!important}.sticky{position:sticky;bottom:10px;margin-top:16px}
