:root {
  color-scheme: light;
  --paper: #faf8f8;
  --ink: #302528;
  --muted: #786b6f;
  --red: #b4232f;
  --red-dark: #901c26;
  --line: #eadfe1;
  --soft: #fbecef;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
button, input, a { outline-offset: 4px; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 30px; letter-spacing: -.7px; font-weight: 650; }
h2 { margin-bottom: 20px; font-size: 17px; font-weight: 650; }
.page { max-width: 1050px; margin: 0 auto; padding: 0 32px 40px; }
.account-bar { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px 12px; min-width: 0; font-size: 12px; }
#user-name { overflow-wrap: anywhere; text-align: right; }
.account-bar .text-button { flex-shrink: 0; }
.badge { padding: 5px 8px; border-radius: 6px; background: var(--soft); color: var(--red-dark); font-size: 11px; }
.text-button { border: 0; padding: 6px 0; background: none; color: var(--muted); font-size: 12px; }
.text-button:hover { text-decoration: underline; color: var(--red-dark); }
.login-layout { min-height: 80vh; display: grid; place-items: center; }
.card { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.login-card { width: 100%; max-width: 360px; padding: 30px; }
.login-card h1 { font-size: 25px; margin-bottom: 28px; }
label { display: block; margin-bottom: 9px; font-size: 12px; font-weight: 600; }
input { width: 100%; min-height: 45px; padding: 12px; border: 1px solid #d9c9cd; border-radius: 7px; color: var(--ink); background: #fff; font-size: 13px; }
input::placeholder { color: #95878b; }
input:focus { outline: 2px solid #d6848c; border-color: var(--red); }
.button { display: flex; align-items: center; justify-content: center; min-height: 41px; padding: 10px 14px; border: 1px solid transparent; border-radius: 7px; font-size: 13px; font-weight: 600; }
.primary { width: 100%; margin-top: 12px; background: var(--red); color: #fff; }
.primary:hover { background: var(--red-dark); }
.secondary { width: 100%; margin-top: 10px; border-color: var(--line); background: #fff; color: var(--ink); }
.secondary:hover { background: var(--soft); }
.fine-print, .track-requester { font-size: 11px; line-height: 1.6; color: var(--muted); margin: 14px 0 0; }
.error { font-size: 13px; line-height: 1.6; color: var(--red-dark); margin: 15px 0 0; }
.muted { color: var(--muted); line-height: 1.6; font-size: 13px; margin-bottom: 0; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 12px 0 14px; }
.page-heading h1 { font-size: 24px; line-height: 1.2; }
.queue-layout { display: grid; grid-template-columns: 310px 1fr; align-items: start; gap: 22px; }
.left-column, .queue-column { display: grid; gap: 18px; min-width: 0; }
.student-queue { border-top: 3px solid var(--red); }
.auto-queue .queue-header { background: var(--paper); border-radius: 12px 12px 0 0; }
.queue-note { margin: 9px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.now-playing, .request-card, .admin-card { padding: 23px; }
.now-playing { border-top: 3px solid var(--red); }
.now-playing h2 { color: var(--red-dark); }
.artwork-frame { position: relative; width: 100%; aspect-ratio: 1; border: 1px solid #000; border-radius: 8px; overflow: hidden; margin-bottom: 12px; background: var(--soft); }
.current-artwork { display: block; width: 100%; height: 100%; object-fit: contain; }
.artwork-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 12px; }
.artwork-note { color: var(--red-dark); font-size: 44px; }
.artwork-pause { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; background: rgb(0 0 0 / .5); pointer-events: none; }
.pause-symbol { display: flex; gap: 12px; }
.pause-symbol::before, .pause-symbol::after { content: ""; width: 13px; height: 46px; border-radius: 3px; background: rgb(255 255 255 / .78); box-shadow: 0 2px 12px rgb(0 0 0 / .15); }
.now-playing h3 { font-size: 16px; line-height: 1.3; margin-bottom: 4px; overflow-wrap: anywhere; text-wrap: balance; text-align: center; }
.current-details { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; text-align: center; }
.song-progress { margin-top: 12px; }
.song-progress progress { display: block; appearance: none; width: 100%; height: 6px; border: 0; border-radius: 3px; overflow: hidden; background: var(--line); color: var(--red); }
.song-progress progress::-webkit-progress-bar { background: var(--line); }
.song-progress progress::-webkit-progress-value { background: var(--red); }
.song-progress progress::-moz-progress-bar { background: var(--red); }
.progress-times { display: flex; justify-content: center; gap: 6px; margin-top: 7px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.player-controls { display: flex; gap: 7px; margin-top: 15px; }
.player-controls .button { margin-top: 0; min-height: 35px; padding: 8px 10px; font-size: 11px; }
.danger { color: var(--red-dark); margin-top: 16px; }
.queue-header { padding: 23px; border-bottom: 1px solid var(--line); }
.queue-header h2 { display: flex; align-items: center; gap: 9px; margin: 0; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px; font-size: 11px; background: var(--soft); color: var(--red-dark); }
.queue-list { list-style: none; margin: 0; padding: 0 23px; }
.queue-row { display: flex; align-items: center; gap: 14px; min-height: 85px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.queue-row:last-child { border-bottom: 0; }
.track-number { width: 16px; flex-shrink: 0; text-align: center; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.track-info { min-width: 0; flex: 1; }
.track-title { display: block; font-size: 13px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.track-artist { font-size: 11px; color: var(--muted); margin: 3px 0 0; overflow-wrap: anywhere; }
.track-info .track-requester { font-size: 10px; margin-top: 6px; }
.track-duration { font-size: 10px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 4px; }
.row-actions button { width: 30px; height: 32px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--red-dark); }
.row-actions button:hover { background: var(--soft); }
.empty-state { padding: 45px 23px; margin: 0; text-align: center; color: var(--muted); font-size: 13px; }
.notice { margin-bottom: 12px; padding: 10px 14px; border-radius: 8px; background: var(--soft); color: var(--red-dark); font-size: 12px; line-height: 1.5; }
.warning { border: 1px solid #ebc0c6; }
.toast { position: fixed; bottom: 25px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 40px); padding: 14px 20px; border-radius: 8px; color: #fff; background: var(--ink); font-size: 13px; line-height: 1.5; z-index: 10; }
.toast.is-error { background: var(--red-dark); }
.search-results { list-style: none; margin: 14px 0 0; padding: 0; }
.search-results:empty { margin: 0; }
.search-result { display: flex; align-items: center; gap: 9px; padding: 13px 0; border-top: 1px solid var(--line); }
.search-artwork { position: relative; display: grid; place-items: center; flex: 0 0 44px; height: 44px; overflow: hidden; border-radius: 5px; background: var(--soft); color: var(--red-dark); }
.search-artwork img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.queue-artwork { flex-basis: 72px; height: auto; min-height: 72px; align-self: stretch; }
.search-add { flex-shrink: 0; padding: 8px; min-height: 36px; background: var(--soft); color: var(--red-dark); }
.search-add:hover { background: var(--line); }

@media (max-width: 650px) {
  .page { padding: 0 18px 30px; }
  .account-bar { gap: 4px 10px; }
  .queue-layout { grid-template-columns: 1fr; gap: 18px; }
  .page-heading { margin: 10px 0 12px; }
  .page-heading h1 { font-size: 22px; }
  h1 { font-size: 27px; }
  .login-card { padding: 25px; }
  .now-playing, .request-card, .admin-card, .queue-header { padding: 21px; }
  .queue-list { padding: 0 21px; }
  .queue-row { gap: 10px; }
}
