:root {
  --bg-l: #f6f4fb; --bg-d: #14121c;
  --card-l: #ffffff; --card-d: #1e1b2b;
  --text-l: #1b1826; --text-d: #ece9f6;
  --muted-l: #5d5872; --muted-d: #a29cba;
  --line-l: #dcd7ea; --line-d: #34304a;
  --accent-l: #6a35d9; --accent-d: #b292ff;
  --on-accent-l: #ffffff; --on-accent-d: #1a1030;
  --auto-l: #b3a9d1; --auto-d: #5f5880; /* autoplay's share in charts: quieter than the accent */

  /* Fallback for browsers without light-dark() */
  --bg: var(--bg-l); --card: var(--card-l); --text: var(--text-l); --muted: var(--muted-l);
  --line: var(--line-l); --accent: var(--accent-l); --on-accent: var(--on-accent-l); --auto: var(--auto-l);
  @media (prefers-color-scheme: dark) {
    --bg: var(--bg-d); --card: var(--card-d); --text: var(--text-d); --muted: var(--muted-d);
    --line: var(--line-d); --accent: var(--accent-d); --on-accent: var(--on-accent-d); --auto: var(--auto-d);
  }
  @supports (color: light-dark(white, black)) {
    --bg: light-dark(var(--bg-l), var(--bg-d));
    --card: light-dark(var(--card-l), var(--card-d));
    --text: light-dark(var(--text-l), var(--text-d));
    --muted: light-dark(var(--muted-l), var(--muted-d));
    --line: light-dark(var(--line-l), var(--line-d));
    --accent: light-dark(var(--accent-l), var(--accent-d));
    --on-accent: light-dark(var(--on-accent-l), var(--on-accent-d));
    --auto: light-dark(var(--auto-l), var(--auto-d));
  }

  color-scheme: light dark;
  accent-color: var(--accent);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 16px/1.45 system-ui, sans-serif; background: var(--bg); color: var(--text); }
h1 { margin: 0; font-size: 1.4rem; letter-spacing: -0.02em; }
h1 span { color: var(--accent); }
h2 { margin: 0 0 .6rem; font-size: 1rem; }
h3 { margin: 1.1rem 0 .5rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
h3:first-child { margin-top: 0; }
h2 small, label small, legend small, th small { color: var(--muted); font-weight: normal; }
p { margin: 0; }
a { color: var(--accent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.meta { color: var(--muted); font-size: .875rem; }

/* page frame: room at the bottom for the fixed player bar */
.wrap { max-width: 64rem; margin: 0 auto; padding: 0 1rem 7.5rem; }
.top { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; padding: .75rem 0; }
.top h1 { margin-right: auto; }
.top label, .who { display: flex; gap: .4rem; align-items: center; font-size: .875rem; color: var(--muted); }
.top select { padding: .25rem .4rem; max-width: 12rem; }

/* section links (these change the view, so they are links, not ARIA tabs) */
.nav { display: flex; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.nav a { position: relative; flex: none; padding: .7rem 1rem; color: var(--muted); text-decoration: none; font-weight: 600; }
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; inset: auto 0 0; border-block-end: 3px solid var(--accent); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: .75rem; padding: 1rem; margin-bottom: 1rem; }
.row { display: flex; justify-content: space-between; align-items: start; gap: .5rem; }
.row .transport { margin: 0; }
form.row input[type="text"] { flex: 1; min-width: 0; }

input[type="text"], input[type="password"], input[type="search"], input[type="number"], select, textarea {
  font: inherit; color: inherit; background: var(--bg);
  border: 1px solid var(--line); border-radius: .5rem; padding: .45rem .6rem; min-width: 0;
}
textarea { width: 100%; resize: vertical; }
button {
  font: inherit; font-weight: 600; cursor: pointer;
  color: var(--on-accent); background: var(--accent);
  border: 1px solid transparent; border-radius: .5rem; padding: .45rem .9rem;
}
button.quiet, .tracks button { color: var(--text); background: transparent; border-color: var(--line); font-weight: 500; }
button:disabled { opacity: .45; cursor: default; }
input:disabled, select:disabled, textarea:disabled { opacity: .45; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.transport { display: flex; gap: .5rem; margin-top: .5rem; flex-wrap: wrap; align-items: center; }
.why, .locked-note { color: var(--muted); font-size: .875rem; }
.why { margin-top: .5rem; }
.locked-note { background: var(--card); border: 1px dashed var(--line); border-radius: .5rem; padding: .5rem .75rem; margin-bottom: 1rem; }

/* the player bar, fixed to the bottom of every view */
.bar { position: fixed; inset: auto 0 0; z-index: 4; background: var(--card); border-top: 1px solid var(--line); }
.bar progress { display: block; width: 100%; height: .35rem; margin: 0; }
.bar .in { max-width: 64rem; margin: 0 auto; padding: .6rem 1rem; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: .9rem; align-items: center; }
.bar img { width: 5.5rem; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: .35rem; background: var(--bg); }
.bar img:not([src]) { visibility: hidden; }
.bar .title, .bar .meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.title { font-weight: 650; }
.times { font-variant-numeric: tabular-nums; }
.bar .ctl { display: flex; gap: .4rem; }
.bar .ctl button { min-height: 2.75rem; }
.bar .ctl { flex-wrap: wrap; }
.bar .ctl button[aria-pressed="true"] { color: var(--on-accent); background: var(--accent); border-color: transparent; }
.bar .vol { display: flex; gap: .4rem; align-items: center; font-size: .85rem; color: var(--muted); }
.bar .vol input { width: 7rem; }

#add { display: flex; gap: .5rem; }
#add input { flex: 1; }
.add-opts { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; margin-top: .6rem; font-size: .875rem; color: var(--muted); }
.add-opts input[type="text"] { width: 9rem; padding: .25rem .5rem; }

.tracks { list-style: none; margin: 0; padding: 0; }
.tracks li {
  display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) auto; gap: .75rem; align-items: center;
  padding: .5rem 0; border-top: 1px solid var(--line);
}
.tracks li:first-child { border-top: 0; }
#results:not(:empty) { margin-top: .75rem; }
.tracks img { width: 4.5rem; aspect-ratio: 16 / 9; object-fit: cover; border-radius: .35rem; background: var(--bg); }
.tracks img:not([src]) { visibility: hidden; }
.tracks .name { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tracks .actions { display: flex; gap: .25rem; align-items: center; }
.tracks button { padding: .25rem .55rem; min-width: 2rem; }
.tracks .more { display: none; }
.tracks li[data-status="error"] .name { text-decoration: line-through; }
.tracks li.auto .name { font-weight: 400; } /* autoplay filler: lighter than what people asked for */
@media (prefers-reduced-motion: no-preference) {
  .tracks li[data-status="downloading"] .meta, .tracks li[data-status="queued"] .meta { animation: pulse 1.6s ease-in-out infinite; }
}
@keyframes pulse { 50% { opacity: .45; } }

/* one menu for a queue row's actions, used on narrow screens */
.rowmenu { position: fixed; inset: auto; margin: 0; padding: .3rem; border: 1px solid var(--line); border-radius: .6rem; background: var(--card); color: var(--text); box-shadow: 0 .4rem 1.2rem rgb(0 0 0 / .35); }
.rowmenu button { display: block; width: 100%; text-align: left; background: transparent; color: var(--text); border: 0; font-weight: 500; min-height: 2.75rem; }

/* DJ booth and admin: cards that say what a group is set to */
.status { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1rem; align-items: center; }
.status-actions { display: flex; flex-direction: column; gap: .5rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.cards .card { margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.cards h2 { margin: 0; }
.cards p { flex: 1; font-size: .95rem; overflow-wrap: anywhere; }
.cards button { align-self: start; }
h3.section { margin: 1.5rem 0 .6rem; }

/* settings forms (inside dialogs) */
.grid { display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr); gap: .7rem 1rem; align-items: center; margin: .5rem 0 1rem; }
.grid label small { display: block; }
.grid input[type="text"], .grid input[type="password"], .grid input[type="number"], .grid select, .grid textarea { width: 100%; }
dialog > label { display: block; margin-top: .7rem; }
.check { display: block; margin: .6rem 0; }
.checks { max-height: 12rem; overflow-y: auto; }
.checks .check { margin: .25rem 0; }
.sub { margin: .25rem 0 1rem 1.6rem; }
output { color: var(--muted); font-variant-numeric: tabular-nums; }

/* voice picker: what is in rotation, then a searchable list that never grows past its box */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0 .8rem; padding: 0; list-style: none; }
.chips li { display: flex; align-items: center; gap: .15rem; border: 1px solid var(--line); border-radius: 2rem; padding: .1rem .2rem .1rem .7rem; font-size: .9rem; background: var(--bg); }
.chips select.weight { width: auto; padding: .05rem .3rem; font-size: .8rem; border-radius: 1rem; }
.chips li.none { padding: .2rem .7rem; color: var(--muted); }
.chips button { color: var(--text); background: transparent; padding: .1rem .45rem; font-size: .8rem; font-weight: 500; }
.voice-tools { display: flex; gap: .5rem; flex-wrap: wrap; }
.voice-tools input { flex: 1 1 10rem; }
.voice-list { list-style: none; margin: .5rem 0 .3rem; padding: 0 .5rem; max-height: 16rem; overflow-y: auto; border: 1px solid var(--line); border-radius: .5rem; background: var(--bg); }
.voice-list li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .3rem 0; border-top: 1px solid var(--line); }
.voice-list li:first-child { border-top: 0; }
.voice-list label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.voice-list small { margin-left: .4rem; }
button.sample, .rows button.x { color: var(--text); background: transparent; border-color: var(--line); padding: .1rem .45rem; font-size: .8rem; font-weight: 500; flex: none; }
button.sample.playing { background: var(--accent); color: var(--on-accent); }

/* row lists: memory facts */
.rows { list-style: none; margin: .4rem 0; padding: 0; }
.rows li { display: flex; gap: .6rem; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding: .4rem 0; }
.rows li:first-child { border-top: 0; }
.rows input[type="text"], .rows textarea { flex: 1; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.5rem; margin-top: 1rem; }
.plain { margin: 0; padding-left: 1.4rem; font-size: .9rem; }
.plain li { padding: .15rem 0; overflow-wrap: anywhere; }
.plain span { color: var(--muted); }
meter { width: 100%; height: .9rem; margin: .25rem 0 .5rem; }

.events { list-style: none; padding: 0; }
.events li { border-top: 1px solid var(--line); padding: .3rem 0; }
summary { cursor: pointer; }
.events time { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: .5rem; }
.events .kind { display: inline-block; min-width: 5.5rem; color: var(--accent); font-size: .8rem; }

blockquote { margin: .75rem 0; padding: .6rem .9rem; border-left: 4px solid var(--accent); background: var(--bg); border-radius: 0 .5rem .5rem 0; }
audio { width: 100%; margin: .25rem 0 .75rem; }
/* the help guide: a phrase or command, then what it does */
.help dl { margin: 0; display: grid; grid-template-columns: minmax(12rem, 2fr) 3fr; gap: 0 1.25rem; }
.help dt, .help dd { margin: 0; padding: .5rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.help dt { font-weight: 600; }
.help dd small { display: block; color: var(--muted); }
.help .needs { display: inline-block; margin-left: .4rem; padding: 0 .45rem; border: 1px solid var(--line); border-radius: 1rem; font-size: .75rem; font-weight: 500; color: var(--muted); white-space: nowrap; }
@media (max-width: 34rem) {
  .help dl { grid-template-columns: 1fr; }
  .help dd { border-top: 0; padding-top: 0; }
}
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .85rem; font-variant-numeric: tabular-nums; }
caption { text-align: left; font-weight: 600; padding: .4rem 0; }
th, td { text-align: left; padding: .3rem .6rem .3rem 0; border-top: 1px solid var(--line); white-space: nowrap; }
thead th { color: var(--muted); font-weight: 500; border-top: 0; }
tfoot td { font-weight: 600; }
#access-table thead th { vertical-align: top; white-space: normal; min-width: 7rem; }
#access-table th small { display: block; }
#access-table tbody th { font-weight: 500; }
#access-table input { width: 1.2rem; height: 1.2rem; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .8rem; background: var(--bg); padding: .75rem; border-radius: .5rem; }

/* Stats: filters, totals, a bar chart, rankings and a weekday-by-hour grid */
.stats-head { display: flex; flex-wrap: wrap; gap: .5rem 1rem; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.stats-head h2 { margin: 0; }
.stats > .stats-head h2 { font-size: 1.4rem; letter-spacing: -0.02em; }
.seg { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.seg button, .stats .name { color: var(--text); background: transparent; border-color: var(--line); min-height: 2.75rem; }
.seg button[aria-pressed="true"] { color: var(--on-accent); background: var(--accent); border-color: transparent; }
.chips { margin-bottom: 1rem; }
.chips button { border-radius: 2rem; font-weight: 500; font-size: .9rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.kpis .card { margin: 0; }
.kpi-label { color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.kpi-value { font-size: 2.1rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpis .meta { min-height: 1.45em; }
.readout { min-height: 1.45em; margin-bottom: .8rem; font-variant-numeric: tabular-nums; }
.readout .hint { color: var(--muted); }
.bars { display: flex; align-items: flex-end; border-bottom: 1px solid var(--line); }
.bars button { flex: 1 1 0; min-width: 0; height: 12rem; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; padding: 0 2px; background: none; border: 0; border-radius: 0; }
.bars span { display: block; }
.bars .auto, .key.auto { background: var(--auto); }
.bars .req, .key.req { background: var(--accent); }
.bars span:first-child, .bars .auto[style*="height: 0%"] + .req { border-radius: 3px 3px 0 0; }
.bars.dim button:not(.on) { opacity: .45; }
.axis { display: flex; height: 1.5rem; align-items: center; color: var(--muted); font-size: .75rem; }
.axis span { flex: 1 1 0; min-width: 0; text-align: center; white-space: nowrap; display: flex; justify-content: center; }
.legend { display: flex; flex-wrap: wrap; gap: .3rem .4rem; align-items: center; margin-top: .3rem; }
.key { width: .75rem; height: .75rem; border-radius: 2px; }
.key + .key, .legend .key.auto { margin-left: .9rem; }
.duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr)); gap: 1rem; margin-bottom: 1rem; }
.duo .card { margin: 0; min-width: 0; }
.leaders, .skips { list-style: none; margin: 0; padding: 0; }
.leaders li { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr) auto; gap: .1rem .6rem; align-items: baseline; margin-top: .55rem; }
.leaders .rank { color: var(--muted); font-size: .85rem; }
.leaders .num { font-weight: 600; }
.leaders .rank, .leaders .num { font-variant-numeric: tabular-nums; }
.what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.what b { font-weight: 550; }
.what small { color: var(--muted); font-size: .85rem; }
.meter { grid-column: 2 / 4; height: .4rem; border-radius: .2rem; background: var(--line); }
.meter span { display: block; height: 100%; border-radius: .2rem; background: var(--accent); }
.skips { margin-top: .5rem; }
.skips li { display: flex; justify-content: space-between; gap: .75rem; align-items: baseline; padding: .55rem 0; border-top: 1px solid var(--line); }
.skips .meta { flex: none; font-variant-numeric: tabular-nums; }
.heat { display: grid; grid-template-columns: 2.2rem repeat(24, minmax(0, 1fr)); gap: 3px; align-items: center; margin-top: .9rem; }
.heat .day { color: var(--muted); font-size: .8rem; }
.heat i { height: 1.5rem; border-radius: 3px; background: var(--line); background: color-mix(in srgb, var(--accent) var(--level, 0%), var(--line)); }
.hours { display: flex; justify-content: space-between; margin: .4rem 0 0 2.4rem; color: var(--muted); font-size: .75rem; }
.split { display: flex; height: .8rem; border-radius: .4rem; overflow: hidden; background: var(--auto); margin: .6rem 0 .8rem; }
.split span { background: var(--accent); }
.stats table { font-size: .9rem; }
.stats tbody th { font-weight: 500; padding-block: 0; }
.stats .name { border: 0; padding: 0; text-align: left; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.stats .name[aria-pressed="true"] { color: var(--accent); }
.stats .hint { margin-top: .5rem; }
.readout .hint { margin: 0; }
@media (forced-colors: active) {
  .bars .req, .meter span, .split span { background: Highlight; }
  .bars .auto, .split { background: GrayText; }
}

/* Drag to reorder */
#queue { position: relative; }
.handle {
  cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none;
  padding: .25rem .4rem; color: var(--muted); border-radius: .35rem; font-size: 1.1rem; line-height: 1;
}
.handle:hover { background: var(--bg); color: var(--text); }
:root.grabbing, :root.grabbing * { cursor: grabbing !important; }
#queue li.dragging {
  position: relative; z-index: 1; scale: 1.02; pointer-events: none;
  background: var(--card); border-radius: .5rem; box-shadow: 0 .4rem 1.2rem rgb(0 0 0 / .35);
}
#queue[data-drop]::after {
  content: ""; position: absolute; left: 0; right: 0; top: calc(var(--drop-y) - 2px);
  height: 4px; border-radius: 2px; background: var(--accent); pointer-events: none;
}
@media (forced-colors: active) { #queue[data-drop]::after { background: Highlight; } }

/* The status line is a manual popover so that it also shows above an open dialog. */
#status {
  position: fixed; inset: auto 0 6.5rem; margin: 0 auto; width: fit-content; max-width: calc(100% - 2rem);
  background: var(--text); color: var(--bg); padding: .5rem .9rem; border: 0; border-radius: .5rem; font-size: .9rem; z-index: 5;
}
#status:empty { display: none; }

dialog { border: 1px solid var(--line); border-radius: .75rem; background: var(--card); color: var(--text); padding: 1.25rem; width: min(38rem, calc(100% - 1.5rem)); max-height: calc(100dvh - 2rem); }

/* Side panels: every settings group, game and person slides in from the right; full screen on a phone. */
dialog.panel {
  inset: 0 0 0 auto; margin: 0; height: 100dvh; max-height: none; max-width: 100%; width: min(32.5rem, 100%);
  padding: 0 1.25rem; border: 0; border-left: 1px solid var(--line); border-radius: 0; overflow-y: auto;
  box-shadow: -1rem 0 2.5rem rgb(0 0 0 / .35);
}
dialog.panel.narrow { width: min(23.75rem, 100%); }
dialog.panel.wide { width: min(47.5rem, 100%); }
dialog.panel[open] { display: flex; flex-direction: column; }
dialog.panel > * { flex: none; }
dialog.panel::backdrop { background: rgb(0 0 0 / .5); }
@media (prefers-reduced-motion: no-preference) {
  dialog.panel { translate: 100% 0; transition: translate .22s ease-out, overlay .22s allow-discrete, display .22s allow-discrete; }
  dialog.panel[open] { translate: 0 0; }
  @starting-style { dialog.panel[open] { translate: 100% 0; } }
  dialog.panel::backdrop { opacity: 0; transition: opacity .22s, overlay .22s allow-discrete, display .22s allow-discrete; }
  dialog.panel[open]::backdrop { opacity: 1; }
  @starting-style { dialog.panel[open]::backdrop { opacity: 0; } }
}
.panel-head {
  position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: .5rem;
  margin: 0 -1.25rem 1rem; padding: .35rem .5rem; min-height: 3.25rem; background: var(--card); border-bottom: 1px solid var(--line);
}
.panel-head button { color: var(--text); background: transparent; min-width: 2.75rem; min-height: 2.75rem; }
.panel-head .panel-back { display: none; color: var(--accent); padding-inline: .5rem; }
.panel-head .panel-back.deep { display: inline-block; }
.panel-head .panel-x { margin-left: auto; font-size: 1.1rem; }
dialog.panel .done { position: sticky; bottom: 0; margin: auto -1.25rem 0; padding: .75rem 1.25rem; background: var(--card); border-top: 1px solid var(--line); }
dialog.panel .done:has(#item-remove:not([hidden])) { justify-content: space-between; }
dialog.panel .done button { min-height: 2.75rem; }
dialog.panel > :nth-last-child(2) { margin-bottom: 1rem; }
@media (max-width: 40rem) {
  dialog.panel, dialog.panel.narrow, dialog.panel.wide { width: 100%; border-left: 0; }
  .panel-head .panel-back { display: inline-block; }
  .panel-head .panel-x { display: none; }
}

/* Games and People: rows that open a panel, and what the panels show */
.dir-head { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: end; justify-content: space-between; margin-bottom: .9rem; }
.dir-head h2 { margin: 0; font-size: 1.4rem; letter-spacing: -0.02em; }
.addrow { display: flex; flex-wrap: wrap; gap: .5rem; }
.addrow input { flex: 1 1 9rem; }
.dir-head .addrow { flex: 0 1 26rem; }
.addrow button { min-height: 2.75rem; }
.links { list-style: none; margin: 0 0 .75rem; padding: 0; border: 1px solid var(--line); border-radius: .75rem; overflow: hidden; background: var(--card); }
.links li + li { border-top: 1px solid var(--line); }
.links li.none { padding: .9rem 1rem; color: var(--muted); }
.links a { display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; min-height: 4rem; color: inherit; text-decoration: none; }
.links a:hover, .links a[aria-current="true"] { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.links a:focus-visible { outline-offset: -3px; }
.links a::after { content: "›"; flex: none; color: var(--muted); font-size: 1.4rem; line-height: 1; }
.links .txt { flex: 1; min-width: 0; display: grid; }
.links .txt b { font-weight: 600; }
.links .txt b small { font-weight: 400; color: var(--muted); font-size: 1em; }
.links .txt > small { color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.avatar { flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--line); display: grid; place-items: center; font-weight: 700; }
.avatar.big { width: 3.25rem; height: 3.25rem; font-size: 1.25rem; }
.chip { flex: none; font-size: .8rem; font-weight: 600; color: var(--accent); border: 1px solid var(--accent); border-radius: 2rem; padding: .1rem .6rem; white-space: nowrap; }
.kicker { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
#item-body h2 { font-size: 1.5rem; letter-spacing: -0.02em; margin: .1rem 0 .3rem; overflow-wrap: anywhere; }
#item-body h3 small { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: .875rem; }
#item-body .addrow { margin-top: .6rem; }
#item-body .whois { display: flex; gap: .9rem; align-items: center; }
#item-body .links { background: transparent; margin-top: .5rem; }
#item-body .links a { min-height: 3.5rem; padding-inline: .75rem; }
label.f { display: grid; gap: .3rem; margin-top: .9rem; }
label.f > span { font-weight: 600; }
label.f input, label.f textarea { width: 100%; }
.aliases { list-style: none; margin: .5rem 0; padding: 0; display: grid; gap: .6rem; }
.aliases li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .35rem .6rem; align-items: center; border: 1px solid var(--line); border-radius: .6rem; padding: .6rem .75rem; }
.aliases a, .aliases b { font-weight: 600; min-height: 2.75rem; display: flex; align-items: center; }
.aliases input, .aliases .meta { grid-column: 1 / -1; }
.aliases .meta { overflow-wrap: anywhere; }
.aliases button.x { color: var(--text); background: transparent; border-color: var(--line); min-width: 2.75rem; min-height: 2.75rem; font-weight: 500; }
dialog.confirm { width: min(24rem, calc(100% - 1.5rem)); }
dialog::backdrop { background: rgb(0 0 0 / .6); }
.done { display: flex; gap: .5rem; justify-content: end; margin-top: 1rem; }
#login-form { display: flex; gap: .5rem; flex-wrap: wrap; }
#login-form h2 { width: 100%; }
#login-form input { flex: 1; }

@media (max-width: 40rem) {
  .wrap { padding-bottom: 6.5rem; }
  .card { padding: .75rem; }
  .bar .in { grid-template-columns: auto minmax(0, 1fr) auto; gap: .6rem; padding: .5rem .75rem; }
  .bar img { width: 3.5rem; }
  .bar .vol { display: none; } /* volume is in DJ booth > Playback */
  .status { grid-template-columns: 1fr; }
  .status-actions { flex-direction: row; flex-wrap: wrap; }
  .grid { grid-template-columns: 1fr; gap: .25rem; }
  .grid > :nth-child(even) { margin-bottom: .6rem; }
  .tracks li { grid-template-columns: 3.5rem minmax(0, 1fr) auto; gap: .6rem; }
  .tracks img { width: 3.5rem; }
  /* one "more" button per queue row instead of four small ones (where the browser has popovers) */
  :root:not(.no-popover) #queue .actions > :not(.more) { display: none; }
  :root:not(.no-popover) #queue .more { display: inline-block; min-width: 2.75rem; min-height: 2.75rem; font-size: 1.2rem; }
  .tracks button, .transport button, .cards button { min-height: 2.75rem; }
  #status { inset-block-end: 5.5rem; }
}

/* Browsers without accent-color (Safari before 26.2): tint sliders and progress by hand. */
@supports not (accent-color: red) {
  input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; }
  input[type="range"]::-webkit-slider-runnable-track {
    height: .5rem; border-radius: .25rem;
    background: linear-gradient(to right, var(--accent) var(--fill, 50%), var(--line) var(--fill, 50%));
  }
  input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 1rem; height: 1rem; margin-top: -.25rem;
    border-radius: 50%; background: var(--accent);
  }
  progress { -webkit-appearance: none; appearance: none; border: 0; border-radius: .25rem; background: var(--line); }
  progress::-webkit-progress-bar { background: var(--line); border-radius: .25rem; }
  progress::-webkit-progress-value { background: var(--accent); border-radius: .25rem; }
}

/* ---- inference servers (admin) ---- */
.servers { list-style: none; margin: .5rem 0; padding: 0; display: grid; gap: .5rem; }
.servers > li { border: 1px solid var(--line); border-radius: .6rem; padding: .5rem .75rem; background: var(--bg); }
.servers summary { display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: baseline; min-height: 2.75rem; padding: .35rem 0; }
.servers summary strong { flex: none; }
.servers summary .off { color: var(--muted); font-weight: 500; }
.inf-health { display: flex; flex-wrap: wrap; gap: .25rem .5rem; margin: 0; padding: 0; list-style: none; font-size: .85rem; }
.inf-health li { border: 1px solid var(--line); border-radius: 2rem; padding: .05rem .6rem; background: var(--card); }
.inf-health li.down { border-style: dashed; color: var(--muted); }
.servers h3 { margin: .9rem 0 0; font-size: .95rem; }
.servers .grid { margin-top: .4rem; }
.servers .fill { display: flex; gap: .5rem; }
.servers .fill input { flex: 1; min-width: 0; }
.inf-actions, .servers .moves { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 34rem) { .servers .grid { grid-template-columns: minmax(0, 1fr); gap: .25rem; } .servers .grid > :nth-child(even) { margin-bottom: .5rem; } }
.servers .fill { flex-wrap: wrap; }
