/* Karen OS Music (music.js): now playing, rooms, playlists, and the admin settings.
   Karen green, calm, every control at least 44px, status always in words. Uses the colour
   tokens from styles.css. No inline styles (CSP style-src 'self'). */

.music .mu-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mu-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.mu-h { font-size: 16px; margin: 0 0 10px; }
.mu-h + * { margin-top: 0; }
.mu-side .mu-h:not(:first-child) { margin-top: 20px; }
.mu-h3 { font-size: 16px; font-weight: 700; margin: 20px 0 6px; color: var(--ink); }

/* Now playing */
.mu-now { display: flex; flex-direction: column; gap: 18px; }
.mu-nowrow { display: flex; gap: 18px; align-items: center; min-width: 0; }
.mu-art { width: 120px; height: 120px; border-radius: 12px; object-fit: cover; flex: none; background: var(--green-100); }
.mu-noart { display: flex; align-items: center; justify-content: center; }
.mu-noart svg { width: 48px; height: 48px; fill: none; stroke: var(--green-700); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mu-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mu-meta .mu-state { align-self: flex-start; margin-bottom: 6px; }
.mu-track { font-size: 22px; font-weight: 800; color: var(--ink); margin: 0; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.mu-artist { font-size: 16px; color: var(--grey-ink); margin: 0; overflow-wrap: anywhere; }
.mu-album { font-size: 14px; margin: 0; }
.mu-none p { margin: 4px 0 0; }

.mu-controls { display: flex; align-items: center; gap: 12px; }
.mu-controls svg { width: 22px; height: 22px; fill: currentColor; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.mu-ctl { width: 56px; min-height: 56px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; }
.mu-play { min-height: 56px; min-width: 140px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; font-size: 16px; }
.mu-play svg { width: 20px; height: 20px; }
.mu-controls [aria-busy="true"] { opacity: 0.7; }

.mu-vol { display: flex; flex-direction: column; gap: 6px; }
.mu-vollabel { font-size: 14px; font-weight: 600; color: var(--grey-ink); }
.mu-vollabel span { font-weight: 700; color: var(--ink); margin-left: 6px; }
.mu-vol input[type=range] { max-width: none; height: 44px; margin: 0; cursor: pointer; }
.mu-vol input[type=range]:disabled { cursor: default; opacity: 0.5; }

/* Rooms and playlists: big tap targets, pressed state in colour and weight */
.mu-rooms, .mu-lists { display: flex; flex-wrap: wrap; gap: 10px; }
.mu-room, .mu-list { min-height: 56px; min-width: 120px; padding: 8px 16px; border: 1px solid var(--input); border-radius: var(--r-ctl);
  background: var(--surface); color: var(--ink); font: 600 15px var(--font); display: inline-flex; flex-direction: column;
  align-items: flex-start; justify-content: center; gap: 2px; cursor: pointer; text-align: left; }
.mu-room small, .mu-list small { font-size: 12px; font-weight: 500; color: var(--muted); }
.mu-room:hover, .mu-list:hover { border-color: var(--grey-ink); }
.mu-room.on, .mu-list.on { background: var(--green-100); border-color: var(--green-700); color: var(--green-900); font-weight: 700; }
.mu-room.on small, .mu-list.on small { color: var(--green-900); }
.mu-list.quiet { border-style: dashed; }
.mu-list:disabled { opacity: 0.5; cursor: default; }
.mu-roomnote { margin: 10px 0 0; font-size: 14px; color: var(--amber); }
.mu-roomnote:empty { display: none; }

/* Admin settings */
.mu-admin h2 { margin-bottom: 0; }
.mu-adminnote { margin: 0 0 4px; }
.mu-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }
.mu-edit { display: flex; flex-direction: column; gap: 10px; }
.mu-editrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 44px; gap: 10px; align-items: end; }
.mu-editrow label, .mu-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--grey-ink); min-width: 0; }
.mu-field { margin-top: 12px; max-width: 520px; }
.mu-editrow input, .mu-field input, .mu-field select { min-height: 44px; width: 100%; }
.mu-favs { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-width: 520px; }
.mu-favs li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0 6px 12px;
  border: 1px solid var(--line); border-radius: var(--r-ctl); font-size: 15px; }
.mu-favs li.calm { border: 0; padding: 0; }
.mu-favs .btn.small { min-height: 44px; }
.mu-who { border: 0; margin: 16px 0 0; padding: 0; min-width: 0; }
.mu-who legend { font-size: 16px; font-weight: 700; padding: 0; margin-bottom: 6px; color: var(--ink); }
.mu-who label { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; cursor: pointer; }

@media (max-width: 1100px) {
  .mu-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .mu-art { width: 88px; height: 88px; }
  .mu-track { font-size: 19px; }
  .mu-room, .mu-list { flex: 1 1 calc(50% - 10px); min-width: 0; }
  .mu-editrow { grid-template-columns: minmax(0, 1fr) 44px; }
  .mu-editrow label:nth-child(2) { grid-column: 1; }
  .mu-editrow .btn.icon { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
}

/* Calm pass: rooms and playlists as quiet choices; the chosen one tinted, no heavy edges */
.mu-room, .mu-list { border-color: var(--line); }
.mu-room:hover, .mu-list:hover { border-color: var(--input); }
.mu-room.on, .mu-list.on { border-color: var(--green-100); }

/* Calm pass (Oct 2026): settings folded under their heading */

/* Record player (Oct 2026): the album cover is the label on a record that turns while the
   music plays, and the arm swings onto the record. Flat and calm: hairline plinth, no shadows.
   The record pauses where it is rather than snapping back. Still for reduced motion. */
.mu-deck { position: relative; flex: none; width: 236px; height: 196px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 14px; background: var(--ground); }
.mu-platter { position: absolute; left: 14px; top: 14px; width: 168px; height: 168px; border-radius: 50%; background: #2b2d2e; }
.mu-disc { position: absolute; inset: 4px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: repeating-radial-gradient(circle at 50% 50%, #151617 0 1px, #1e2021 1px 3px);
  animation: mu-spin 1.8s linear infinite; animation-play-state: paused; }
.mu-deck.on .mu-disc { animation-play-state: running; }
.mu-label { position: relative; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; display: block; background: var(--green-100); }
.mu-nolabel { display: flex; align-items: center; justify-content: center; }
.mu-nolabel svg { width: 26px; height: 26px; fill: none; stroke: var(--green-700); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
/* Light catching the grooves: stays still while the record turns under it */
.mu-sheen { position: absolute; inset: 4px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 20deg, transparent 0deg 30deg, rgba(255, 255, 255, 0.07) 45deg, transparent 60deg 200deg, rgba(255, 255, 255, 0.05) 215deg, transparent 230deg); }
.mu-spindle { position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #d9dcde; }
/* The arm pivots at its base (top right) and swings onto the record when playing */
.mu-arm { position: absolute; left: 196px; top: 20px; width: 20px; height: 136px; transform-origin: 10px 10px;
  transform: rotate(0deg); transition: transform 0.9s ease; }
.mu-deck.on .mu-arm { transform: rotate(24deg); }
.mu-armbase { position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; background: #c4c9cc; border: 3px solid #8f979c; box-sizing: border-box; }
.mu-armrod { position: absolute; left: 8.5px; top: 10px; width: 3px; height: 112px; border-radius: 2px; background: #b4bbbf; }
.mu-armhead { position: absolute; left: 4px; top: 116px; width: 12px; height: 20px; border-radius: 3px; background: #6f777c; }
@keyframes mu-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .mu-disc { animation: none; }
  .mu-arm { transition: none; }
}
@media (max-width: 520px) {
  .mu-nowrow { flex-direction: column; align-items: flex-start; }
}

/* Find a song (Nov 2026): search box, then songs, albums and playlists. Plain buttons, rows quiet. */
.mu-find { margin-top: 20px; }
.mu-q { width: 100%; max-width: 560px; min-height: 48px; font-size: 16px; }
.mu-findnote { margin: 8px 0 0; font-size: 14px; }
.mu-findnote:empty { display: none; }
.mu-fh { font-size: 14px; font-weight: 700; color: var(--grey-ink); margin: 18px 0 6px; }
.mu-flist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.mu-frow { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 0; border-top: 1px solid var(--line); }
.mu-frow:first-child { border-top: 0; }
.mu-fart { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; flex: none; background: var(--green-100); display: block; }
.mu-ftext { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.mu-fname { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mu-fsub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mu-fbtns { display: flex; gap: 8px; flex: none; }
.mu-fbtns .btn.small { min-height: 44px; min-width: 64px; }
@media (min-width: 1101px) {
  .mu-flist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
  .mu-frow:nth-child(2) { border-top: 0; }
}

/* Jukebox (Nov 2026): the whole player is one arched cabinet. Dark green body, neon trim and tubes
   that glow brighter while music plays, a glass window with the record, an amber display for the
   track, chrome buttons, and playlists as numbered title strips (A1, A2…). Colours are local to the
   cabinet so the rest of Karen OS stays calm. Status is always in words; tubes and lamps only add to it. */
.mu-juke { --ju-body: #10201a; --ju-body2: #183429; --ju-chrome: #d5dcd8; --ju-chrome2: #9aa6a0; --ju-glow: #ffb547;
  --ju-red: #e0533f; --ju-cream: #f6ecd2; --ju-ink: #2a1d0a; --ju-dim: rgba(246, 236, 210, 0.78);
  position: relative; max-width: 1040px; margin: 4px auto 24px; padding: 20px 56px 32px; box-sizing: border-box;
  border-radius: 180px 180px 20px 20px / 120px 120px 20px 20px;
  background: linear-gradient(180deg, var(--ju-body2), var(--ju-body) 40%);
  box-shadow: inset 0 0 0 8px #0b1511, inset 0 0 0 10px var(--ju-chrome2), 0 0 0 1px var(--line); color: var(--ju-cream); }
.mu-juke::before, .mu-juke::after { content: ""; position: absolute; top: 130px; bottom: 40px; width: 10px; border-radius: 6px;
  background: linear-gradient(180deg, var(--ju-glow), var(--ju-red)); opacity: 0.3; transition: opacity 0.6s ease; }
.mu-juke::before { left: 24px; }
.mu-juke::after { right: 24px; }
.mu-juke.on::before, .mu-juke.on::after { opacity: 1; box-shadow: 0 0 14px 2px rgba(255, 181, 71, 0.6); animation: mu-tube 2.4s ease-in-out infinite alternate; }
.mu-juke :focus-visible { outline: 3px solid var(--ju-cream); outline-offset: 2px; }
.mu-arch { display: flex; justify-content: center; padding: 6px 0 22px; }
.mu-marquee { font-size: 13px; font-weight: 800; letter-spacing: 0.34em; text-transform: uppercase; color: var(--ju-glow);
  padding: 6px 20px; border: 2px solid var(--ju-glow); border-radius: 999px; }
.mu-juke.on .mu-marquee { text-shadow: 0 0 10px rgba(255, 181, 71, 0.8); }
.mu-juke .mu-grid { gap: 28px; align-items: stretch; }
.mu-juke .mu-now { align-items: stretch; gap: 16px; }
.mu-juke .mu-nowrow { flex-direction: column; align-items: center; gap: 14px; }
/* The window: arched glass with the record behind it */
.mu-juke .mu-deck { width: 236px; height: 196px; border: 3px solid var(--ju-chrome); border-radius: 118px 118px 14px 14px;
  background: radial-gradient(circle at 50% 40%, #1d3a2f, #08100d); box-shadow: inset 0 0 0 3px #08100d; }
/* The display: track, artist and where it's playing, in amber */
.mu-juke .mu-meta { align-self: stretch; align-items: center; text-align: center; gap: 2px; padding: 12px 16px;
  background: #08100d; border: 2px solid var(--ju-chrome2); border-radius: 10px; }
.mu-juke .mu-meta .mu-state { align-self: center; color: var(--ju-dim); font-weight: 600; }
.mu-juke .mu-track { color: var(--ju-glow); }
.mu-juke.on .mu-meta .mu-track { text-shadow: 0 0 10px rgba(255, 181, 71, 0.55); }
.mu-juke .mu-artist { color: var(--ju-cream); }
.mu-juke .mu-album { color: var(--ju-dim); }
.mu-juke .mu-none { align-self: stretch; text-align: center; padding: 12px 16px; background: #08100d; border: 2px solid var(--ju-chrome2); border-radius: 10px; color: var(--ju-dim); }
.mu-juke .mu-none .mu-track { color: var(--ju-glow); }
.mu-juke .calm { color: var(--ju-dim); }
.mu-juke .mu-controls { justify-content: center; }
/* Chrome push buttons; play is the lit amber one */
.mu-juke .mu-ctl { background: linear-gradient(180deg, #eef2f0, var(--ju-chrome2)); border: 2px solid var(--ju-chrome); color: var(--ju-body); }
.mu-juke .mu-ctl:hover:not(:disabled) { background: #fff; }
.mu-juke .mu-play { background: var(--ju-glow); border: 2px solid #ffd27a; color: var(--ju-ink); font-weight: 800; }
.mu-juke .mu-play:hover:not(:disabled) { background: #ffc468; border-color: #ffd27a; color: var(--ju-ink); }
.mu-juke .mu-controls .btn:disabled { opacity: 0.45; }
.mu-juke .mu-vollabel { color: var(--ju-dim); }
.mu-juke .mu-vollabel span { color: var(--ju-glow); }
.mu-juke .mu-vol input[type=range] { accent-color: var(--ju-glow); }
/* Selector panel: rooms, then playlists */
.mu-juke .mu-side { background: rgba(0, 0, 0, 0.28); border: 2px solid var(--ju-chrome2); border-radius: 12px; padding: 18px; min-width: 0; }
.mu-juke .mu-h { color: var(--ju-glow); font-size: 13px; font-weight: 800; letter-spacing: 0.22em; text-transform: uppercase; }
.mu-juke .mu-rooms { gap: 8px; }
.mu-juke .mu-room { min-width: 0; flex-direction: row; align-items: center; gap: 10px; padding: 8px 14px 8px 12px; border-radius: 999px;
  background: linear-gradient(180deg, #eef2f0, var(--ju-chrome2)); border: 2px solid var(--ju-chrome); color: var(--ju-body); }
.mu-juke .mu-room small { color: var(--ju-body); margin-left: 2px; }
.mu-juke .mu-room:hover { background: #fff; border-color: var(--ju-chrome); }
.mu-lamp { flex: none; width: 12px; height: 12px; border-radius: 50%; background: #5d6a64; border: 1px solid #2f3a35; }
.mu-juke .mu-room.on { background: #fff4d8; border-color: var(--ju-glow); color: var(--ju-ink); }
.mu-juke .mu-room.on small { color: var(--ju-ink); }
.mu-juke .mu-room.on .mu-lamp { background: var(--ju-glow); border-color: #ffd27a; box-shadow: 0 0 8px 2px rgba(255, 181, 71, 0.8); }
.mu-juke .mu-roomnote { color: #ffd27a; }
.mu-juke .mu-lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.mu-juke .mu-list { min-width: 0; flex-direction: row; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; border-radius: 6px;
  background: var(--ju-cream); border: 2px solid #cdbf98; color: var(--ju-ink); }
.mu-juke .mu-list small { color: var(--ju-ink); font-weight: 700; }
.mu-juke .mu-list:hover:not(:disabled) { background: #fff8e6; border-color: var(--ju-glow); }
.mu-juke .mu-list.quiet { border-style: dashed; }
.mu-juke .mu-list:disabled { opacity: 0.55; }
.mu-slot { flex: none; min-width: 34px; height: 34px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--ju-body); color: var(--ju-glow); font-size: 14px; font-weight: 800; letter-spacing: 0.04em; }
.mu-lname { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; overflow-wrap: anywhere; }
.mu-juke .mu-list.on { background: #ffd27a; border-color: var(--ju-glow); box-shadow: 0 0 10px rgba(255, 181, 71, 0.6); }
@keyframes mu-tube { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(-25deg); } }
@media (prefers-reduced-motion: reduce) {
  .mu-juke::before, .mu-juke::after { transition: none; }
  .mu-juke.on::before, .mu-juke.on::after { animation: none; }
}
@media (max-width: 720px) {
  .mu-juke { padding: 16px 28px 24px; border-radius: 90px 90px 16px 16px / 70px 70px 16px 16px; }
  .mu-juke::before, .mu-juke::after { width: 6px; top: 90px; }
  .mu-juke::before { left: 12px; }
  .mu-juke::after { right: 12px; }
  .mu-juke .mu-lists { grid-template-columns: minmax(0, 1fr); }
  .mu-juke .mu-room { flex: 0 1 auto; }
}

/* Jukebox browse (Nov 2026): the lower half of the cabinet. Tiles for decades, styles and moods each
   run a search, so anything on Spotify can be played or queued. Decades are big lit labels. */
.mu-juke .mu-find { margin: 28px 0 0; padding: 22px 0 0; border-top: 2px solid var(--ju-chrome2); }
.mu-juke .mu-cat { margin-top: 4px; }
.mu-juke .mu-fh { color: var(--ju-dim); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; margin: 14px 0 8px; }
.mu-juke .mu-qlabel { display: block; margin-top: 22px; }
.mu-tiles { display: flex; flex-wrap: wrap; gap: 8px; }
.mu-tile { min-height: 44px; padding: 8px 16px; border-radius: 6px; background: var(--ju-cream); border: 2px solid #cdbf98; color: var(--ju-ink);
  font: 700 15px var(--font); cursor: pointer; }
.mu-tile:hover { background: #fff8e6; border-color: var(--ju-glow); }
.mu-tile.on { background: #ffd27a; border-color: var(--ju-glow); box-shadow: 0 0 10px rgba(255, 181, 71, 0.6); }
.mu-catbig .mu-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mu-catbig .mu-tile { min-height: 64px; font-size: 24px; font-weight: 800; background: #08100d; border-color: var(--ju-chrome2); color: var(--ju-glow); }
.mu-catbig .mu-tile:hover { border-color: var(--ju-glow); background: #0d1b15; }
.mu-catbig .mu-tile.on { background: var(--ju-glow); color: var(--ju-ink); border-color: #ffd27a; }
.mu-juke .mu-q { max-width: none; background: #08100d; border: 2px solid var(--ju-chrome2); color: var(--ju-cream); }
.mu-juke .mu-q::placeholder { color: var(--ju-dim); }
.mu-juke .mu-findnote { color: var(--ju-dim); }
.mu-juke .mu-frow { border-top-color: rgba(213, 220, 216, 0.22); }
.mu-juke .mu-fname { color: var(--ju-cream); }
.mu-juke .mu-fsub { color: var(--ju-dim); }
.mu-juke .mu-fart { background: #08100d; }
.mu-juke .mu-fbtns .btn { background: linear-gradient(180deg, #eef2f0, var(--ju-chrome2)); border: 2px solid var(--ju-chrome); color: var(--ju-body); }
.mu-juke .mu-fbtns .btn:hover:not(:disabled) { background: #fff; }
.mu-juke .mu-fbtns .btn:disabled { opacity: 0.5; }
@media (max-width: 720px) {
  .mu-catbig .mu-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
