:root {
  color-scheme: dark;
  --bg: #05080d;
  --bg-2: #0a111b;
  --panel: rgba(12, 22, 34, 0.82);
  --panel-solid: #0c1622;
  --ink: #d7e6f2;
  --muted: #7d93a8;
  --line: #1b2c3d;
  --line-bright: #24425a;
  /* theme.js overrides the accent variables with the colour picked on the account page. */
  --accent: #35e0ff;
  --accent-rgb: 53, 224, 255;
  --accent-2: #9b7bff;
  --accent-2-rgb: 155, 123, 255;
  --accent-ink: #021117;
  --ok: #3cf29a;
  --warn: #ffc857;
  --danger: #ff5c7a;
  --glow: 0 0 0 1px rgba(var(--accent-rgb), 0.28), 0 0 18px rgba(var(--accent-rgb), 0.14);
  --mono: "Cascadia Code", "JetBrains Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  --sans: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html { background: #07090c; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  background: transparent;
}
/* Fine 2x2 twill under the corner glows. The texture is 2x so it stays sharp on dense screens. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: #07090c;
  background-image:
    radial-gradient(1200px 640px at 88% -8%, rgba(var(--accent-2-rgb), 0.16), transparent 58%),
    radial-gradient(880px 520px at -8% 108%, rgba(var(--accent-rgb), 0.13), transparent 58%),
    radial-gradient(ellipse at center, transparent 46%, rgba(0, 0, 0, 0.5) 100%),
    url("/admin/static/carbon.png");
  background-repeat: no-repeat, no-repeat, no-repeat, repeat;
  background-size: auto, auto, auto, 256px 256px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-shadow: 0 0 10px rgba(var(--accent-rgb), 0.6); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  color: color-mix(in srgb, var(--accent) 55%, #ffffff);
  overflow-wrap: anywhere;
}

.skip { position: absolute; left: 0.5rem; top: -3rem; }
.skip:focus { top: 0.5rem; background: var(--panel-solid); padding: 0.4rem 0.6rem; z-index: 10; }

/* Icons */

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  vertical-align: -0.2em;
}

/* App shell: a sidebar beside the page, collapsing to a top bar on small screens */

body.shell {
  --player-space: 0px;
  display: grid;
  grid-template-columns: 15.5rem minmax(0, 1fr);
  align-items: start;
}
body.shell.has-player { --player-space: 4.5rem; }

.top {
  grid-column: 1;
  position: sticky;
  top: 0;
  z-index: 5;
  height: calc(100vh - var(--player-space));
  height: calc(100dvh - var(--player-space));
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb), 0.45) transparent;
  background: rgba(5, 8, 13, 0.9);
  backdrop-filter: blur(10px);
  border-right: 1px solid var(--line);
  box-shadow: 1px 0 0 rgba(var(--accent-rgb), 0.1);
}
.top::-webkit-scrollbar { width: 10px; }
.top::-webkit-scrollbar-track { background: transparent; }
.top::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-rgb), 0.35);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}
.top::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--accent-rgb), 0.7);
  border: 3px solid transparent;
  background-clip: padding-box;
}
.top-inner {
  min-height: 100%;
  padding: 1.1rem 0.8rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 1.3rem;
}
.top-bar { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.brand {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  color: var(--ink);
}
.brand:hover { text-decoration: none; text-shadow: none; color: var(--ink); }
.brand-name {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.brand .vu-face {
  flex: none;
  width: 2.5rem;
  height: 1.55rem;
  gap: 2px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.brand .vu-face span { flex: 1; width: auto; min-width: 0; }
.nav-fold { border-top: 1px solid rgba(255, 255, 255, 0.14); padding-top: 0.75rem; }
.nav-fold summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 35px;
  padding: 0.3rem 0.65rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  list-style: none;
}
.nav-fold summary::-webkit-details-marker { display: none; }
.nav-fold summary::after {
  content: "";
  margin-left: auto;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
}
.nav-fold[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.nav-fold summary:hover { color: var(--ink); background: rgba(var(--accent-rgb), 0.05); }
.nav-fold.is-here summary { color: var(--accent); }
.nav-fold summary .icon { width: 1.05rem; height: 1.05rem; }
.nav-fold nav { margin-top: 0.35rem; }
.nav-fold nav + nav { margin-top: 0.7rem; }
.top nav a[aria-current="true"] {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.08);
  box-shadow: inset 3px 0 0 var(--accent);
}
.nav-toggle { display: none; }
.nav-body { flex: 1; display: flex; flex-direction: column; gap: 1rem; }
.top nav { display: grid; gap: 0.15rem; }
.nav-split {
  margin-top: -0.15rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.nav-heading {
  margin: 0 0 0.3rem 0.65rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #4e6378;
}
.top nav a, .account-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 35px;
  padding: 0.3rem 0.65rem;
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 6px;
}
.top nav a .icon, .account-nav a .icon { width: 1.05rem; height: 1.05rem; }
.top nav a:hover, .account-nav a:hover { color: var(--ink); background: rgba(var(--accent-rgb), 0.05); text-decoration: none; text-shadow: none; }
.top nav a[aria-current="page"], .account-nav a[aria-current="page"] {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.35);
  background: rgba(var(--accent-rgb), 0.08);
  box-shadow: inset 3px 0 0 var(--accent);
}
.account-nav {
  margin-top: auto;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.account-nav a { flex: 1; min-width: 0; text-transform: none; letter-spacing: 0.02em; font-size: 0.82rem; }
.account-nav a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-nav button:hover { color: var(--danger); border-color: var(--danger); box-shadow: none; }

/* Layout */

main {
  grid-column: 2;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.8rem 2rem 4rem;
}
body.shell main {
  display: flex;
  flex-direction: column;
  max-width: none;
  margin: 0;
  padding: 0 0 4rem;
}
body.shell main > :not(h1):not(.page-head):not(.area-nav):not(dialog) {
  width: min(1240px, calc(100% - 4rem));
  max-width: calc(100% - 4rem);
  margin-left: auto;
  margin-right: auto;
  min-width: 0;
}
body.bare main { grid-column: auto; }

@media (max-width: 900px) {
  body.shell { display: block; }
  .top {
    height: auto;
    max-height: calc(100dvh - var(--player-space));
    z-index: 20;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(var(--accent-rgb), 0.14);
  }
  .top-inner { padding: 0.6rem 1rem; gap: 0.8rem; }
  .nav-toggle { display: inline-flex; }
  html.js .top:not(.open) .nav-body { display: none; }
  .nav-body { padding-bottom: 0.4rem; }
  .top nav { grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); }
  .nav-heading { grid-column: 1 / -1; }
  .account-nav { margin-top: 0; }
  main { padding: 1.3rem 1rem 3.5rem; }
  body.shell main { padding: 0 0 3.5rem; }
  body.shell main > :not(h1):not(.page-head):not(.area-nav):not(dialog) {
    width: min(1240px, calc(100% - 2rem));
    max-width: calc(100% - 2rem);
  }
}

h1 {
  font-family: var(--mono);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
main > h1,
.page-head {
  margin: 0 0 1.35rem;
  padding: 0.85rem 1.15rem;
  background:
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.12), transparent 28rem),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: inset 3px 0 0 var(--accent);
  backdrop-filter: blur(4px);
}
body.shell main > .area-nav {
  order: -1;
  align-self: stretch;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0.55rem max(2rem, calc((100% - 1240px) / 2));
  background: rgba(5, 8, 13, 0.72);
  border-bottom: 1px solid var(--line);
}
.area-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.area-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 32px;
  padding: 0.15rem 0.7rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.area-nav a .icon { width: 0.95rem; height: 0.95rem; }
.area-nav a:hover { color: var(--ink); text-decoration: none; text-shadow: none; }
.area-nav a[aria-current="page"] {
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.4);
  background: rgba(var(--accent-rgb), 0.1);
}
body.shell main > h1,
body.shell main > .page-head {
  order: -2;
  align-self: stretch;
  width: auto;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  padding-left: max(2rem, calc((100% - 1240px) / 2));
  padding-right: max(2rem, calc((100% - 1240px) / 2));
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
}
@media (max-width: 900px) {
  body.shell main > .area-nav,
  body.shell main > h1,
  body.shell main > .page-head {
    padding-left: max(1rem, calc((100% - 1240px) / 2));
    padding-right: max(1rem, calc((100% - 1240px) / 2));
  }
}
h1::before {
  content: "//";
  color: var(--accent);
  text-shadow: 0 0 12px rgba(var(--accent-rgb), 0.7);
}
h2 {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin: 1.6rem 0 0.7rem;
}
.panel h2 { margin-top: 0; }

/* Controls */

button, input, select { font: inherit; color: inherit; }

button, a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.95), color-mix(in srgb, var(--accent) 78%, #000000));
  color: var(--accent-ink);
  border: 1px solid rgba(var(--accent-rgb), 0.9);
  border-radius: 6px;
  min-height: 44px;
  padding: 0.45rem 1rem;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
button .icon, a.button .icon { width: 1.1rem; height: 1.1rem; }
button:hover, a.button:hover { box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.45); text-decoration: none; text-shadow: none; }
button:active, a.button:active { transform: translateY(1px); }
button.secondary, a.button.secondary {
  background: rgba(var(--accent-rgb), 0.08);
  color: var(--accent);
  border-color: rgba(var(--accent-rgb), 0.5);
}
button.secondary:hover, a.button.secondary:hover { background: rgba(var(--accent-rgb), 0.16); }
button.icon-only { width: 40px; height: 40px; min-height: 40px; padding: 0; }
button.round { border-radius: 50%; }
button.round .icon { width: 1rem; height: 1rem; margin-left: 2px; }
button:disabled {
  background: transparent;
  color: #4e6378;
  border: 1px dashed #2a3d50;
  box-shadow: none;
  cursor: not-allowed;
}

input, select, textarea {
  min-height: 44px;
  background: rgba(3, 7, 12, 0.85);
  border: 1px solid var(--line-bright);
  border-radius: 4px;
  padding: 0.4rem 0.7rem;
  font-family: var(--mono);
  font-size: 0.9rem;
}
textarea { min-height: 7rem; width: min(28rem, 100%); resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow); }
input[type="checkbox"] {
  min-height: auto;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--danger);
}
label {
  display: grid;
  gap: 0.3rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
label input, label select { text-transform: none; letter-spacing: normal; color: var(--ink); }

.narrow {
  max-width: 26rem;
  margin: 8vh auto 0;
  padding: 1.6rem;
  background: var(--panel);
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  box-shadow: var(--glow);
}
.stack { display: grid; gap: 0.9rem; }
.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end; margin-bottom: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; }
.actions.spaced { margin: 0 0 1rem; }
.confirm {
  display: grid;
  gap: 0.5rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(255, 92, 122, 0.4);
  border-radius: 6px;
  background: rgba(255, 92, 122, 0.06);
}
.confirm label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #ffb3c1;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.8rem;
}
.confirm button {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.confirm button:hover { background: rgba(255, 92, 122, 0.12); box-shadow: 0 0 16px rgba(255, 92, 122, 0.35); }

/* Messages */

.flash {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 6px;
  margin: 0 0 1rem;
  border-left: 3px solid;
}
.flash .icon { margin-top: 0.1rem; }
.flash.error { background: rgba(255, 92, 122, 0.08); color: #ffb3c1; border-color: var(--danger); }
.flash.ok { background: rgba(60, 242, 154, 0.08); color: #aaf7d0; border-color: var(--ok); }
.note, .empty, .meta, .meta-list { color: var(--muted); }
.note { font-size: 0.88rem; }
.empty {
  font-family: var(--mono);
  font-size: 0.85rem;
  padding: 1.8rem 1.2rem;
  border: 1px dashed var(--line-bright);
  border-radius: 8px;
  text-align: center;
}
.empty > .icon { display: block; width: 1.8rem; height: 1.8rem; margin: 0 auto 0.6rem; color: var(--line-bright); }

/* Panels and stats */

.panel, .stats article, .stats .stat, .album, .facts, .table-wrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  backdrop-filter: blur(4px);
}
.panel { padding: 1rem 1.1rem; margin-bottom: 1rem; position: relative; }
.panel::before, .stats article::before, .stats .stat::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 14px;
  height: 14px;
  border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
  border-top-left-radius: 6px;
  opacity: 0.8;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.8rem;
  margin-bottom: 0.5rem;
}
.stats article, .stats .stat {
  position: relative;
  padding: 0.9rem 3rem 0.9rem 1rem;
  display: grid;
  gap: 0.2rem;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}
.stats .stat:hover {
  border-color: var(--accent);
  text-decoration: none;
  text-shadow: none;
}
.stats article::after, .stats .stat::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), transparent);
  opacity: 0.6;
}
.stats .stat-icon {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 1.35rem;
  height: 1.35rem;
  color: var(--accent);
  opacity: 0.55;
}
.stats span {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.stats strong {
  font-family: var(--mono);
  font-size: 1.65rem;
  font-weight: 600;
  color: #effaff;
  text-shadow: 0 0 16px rgba(var(--accent-rgb), 0.35);
  font-variant-numeric: tabular-nums;
}

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: 1rem; margin-top: 1rem; }
.dash-columns { align-items: start; }
.dash-columns .panel { margin-bottom: 0; }

.readout { list-style: none; margin: 0; padding: 0; }
.readout li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.9rem;
}
.readout li:last-child { border-bottom: 0; }
.readout li.sub { padding-left: 0.85rem; }
.readout span { color: var(--muted); }
.readout b { font-weight: 500; font-family: var(--mono); font-size: 0.85rem; text-align: right; overflow-wrap: anywhere; min-width: 0; }
.readout b.clip { max-width: min(22rem, 62%); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.storage-path { width: min(42rem, 100%); }

.state { display: inline-flex; align-items: center; gap: 0.45rem; }
.state::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}
.state.ok { color: var(--ok); }
.state.bad { color: var(--danger); }
.state.idle { color: var(--warn); }
th.power, td.power { width: 1%; text-align: center; vertical-align: middle; white-space: nowrap; }
td .inline-form button.power-switch,
.house-switches button.home-switch {
  position: relative;
  flex: none;
  width: 52px;
  min-width: 52px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line-bright);
  background: #071018;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}
td .inline-form button.power-switch::before,
.house-switches button.home-switch::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.15s ease, background 0.15s ease;
}
td .inline-form button.power-switch[aria-checked="true"],
.house-switches button.home-switch[aria-checked="true"] {
  background: var(--accent);
  border-color: transparent;
  box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.4);
}
td .inline-form button.power-switch[aria-checked="true"]::before,
.house-switches button.home-switch[aria-checked="true"]::before {
  transform: translateX(22px);
  background: var(--accent-ink);
}
td .inline-form button.power-switch:hover,
.house-switches button.home-switch:hover { box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.35); }
td .inline-form button.power-switch[aria-checked="true"]:hover,
.house-switches button.home-switch[aria-checked="true"]:hover { box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.55); }
td .inline-form button.power-switch:active,
.house-switches button.home-switch:active { transform: none; }
.subhead { margin: 1.2rem 0 0.5rem; font-size: 1rem; font-weight: 600; }
.room-list { list-style: none; margin: 0.6rem 0 0; padding: 0; }
.room-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--line);
}
.room-list li:last-child { border-bottom: 0; }
.room-list li > span { flex: 1; min-width: 0; }
.room-list li b { color: var(--muted); font-weight: 500; font-family: var(--mono); font-size: 0.8rem; }
td.room .inline-form { align-items: center; flex-wrap: nowrap; }
td.room select { min-height: 32px; width: 11rem; max-width: 14rem; padding: 0.15rem 0.45rem; font-size: 0.8rem; }

.status { padding-left: 1.1rem; font-family: var(--mono); font-size: 0.88rem; }
.status li { padding: 0.15rem 0; }
.status li::marker { color: var(--accent); }

/* Tables */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(3, 7, 12, 0.6);
  position: sticky;
  top: 0;
}
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: rgba(var(--accent-rgb), 0.05); box-shadow: inset 2px 0 0 var(--accent); }
tbody tr:last-child td { border-bottom: 0; }
td { font-variant-numeric: tabular-nums; }
th.num, td.num { text-align: right; }
th .icon { width: 0.95rem; height: 0.95rem; }
.tracklist td, .playlist-entries td, table.compact td { vertical-align: middle; }
.tracklist td.row-actions:first-child, .tracklist th:first-child { width: 1%; padding-right: 0.2rem; }
td .icon-only, td .inline-form button.icon-only { width: 32px; height: 32px; min-height: 32px; padding: 0; }
td .icon-only .icon { width: 0.95rem; height: 0.95rem; }
td button.round .icon { width: 0.8rem; height: 0.8rem; }
.with-icon { display: inline-flex; align-items: center; gap: 0.6rem; }
.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.85rem;
  color: color-mix(in srgb, var(--accent-2) 40%, #ffffff);
  border: 1px solid rgba(var(--accent-2-rgb), 0.35);
  background: rgba(var(--accent-2-rgb), 0.16);
}
a.with-icon:hover { text-decoration: none; }
a.with-icon:hover span:last-child { text-decoration: underline; }

/* Album and track detail */

/* Page headers */

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.page-head h1 { margin-bottom: 0.25rem; }
.page-head h1:last-child { margin-bottom: 0; }
.page-head .actions { align-items: center; justify-content: flex-end; margin: 0; }
button.ghost.danger, a.button.ghost.danger {
  color: #ffb3c1;
  border-color: rgba(255, 92, 122, 0.5);
}
.page-head .actions button,
.page-head .actions a.button {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.page-head .title-block { flex: 1 1 0; min-width: 0; }
.page-head .title-block h1 { display: block; overflow-wrap: anywhere; }
.page-head .chips { margin: 0.45rem 0 0; }
.page-head .note { margin: 0.45rem 0 0; }
.page-head .meta { margin: 0; }
.page-head .filters { margin: 0; flex-wrap: nowrap; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.3rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.search-field { position: relative; display: block; }
.search-field > .icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search-field input { width: min(22rem, 100%); padding-left: 2.4rem; }
.search-field.grow input { width: 100%; }
input[type="search"]::-webkit-search-cancel-button { filter: grayscale(1) brightness(1.6); }

.hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.7rem;
  align-items: end;
  padding: 1.5rem;
  margin-bottom: 1.6rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.1), rgba(var(--accent-2-rgb), 0.08) 55%, transparent),
    var(--panel);
}
.hero-art img, .hero-art .cover-missing, .hero-initial {
  display: grid;
  place-items: center;
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line-bright);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), 0 0 26px rgba(var(--accent-rgb), 0.12);
}
.hero-art.small img, .hero-art.small .cover-missing { width: 160px; height: 160px; }
.hero-art.shared .cover-missing { color: var(--accent-2); }
.hero-initial {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 4.5rem;
  color: #effaff;
  background: radial-gradient(circle at 30% 25%, rgba(var(--accent-2-rgb), 0.6), rgba(var(--accent-rgb), 0.14) 70%);
}
.cover-missing {
  color: var(--muted);
  background:
    repeating-linear-gradient(45deg, rgba(var(--accent-rgb), 0.05) 0 8px, transparent 8px 16px),
    var(--bg-2);
}
.cover-missing .icon { width: 36%; height: 36%; }
.hero h1 {
  font-family: var(--sans);
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.15;
  margin: 0 0 0.35rem;
}
.hero h1::before { content: none; }
.hero-sub { margin: 0 0 0.8rem; font-size: 1.05rem; }
.hero .meta { margin: 0 0 1rem; }
.hero .actions { align-items: center; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1.1rem; padding: 0; }
.chips li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--line-bright);
  border-radius: 999px;
  background: rgba(3, 7, 12, 0.4);
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}
.chips .icon { width: 0.95em; height: 0.95em; }
@media (max-width: 700px) {
  .hero { grid-template-columns: 1fr; align-items: start; padding: 1.1rem; }
  .hero-art img, .hero-art .cover-missing { width: 150px; height: 150px; }
  .hero-initial { width: 120px; height: 120px; font-size: 3rem; }
}

/* Cover and tile grids */

.card-grid {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 1rem;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  padding: 0.6rem 0.6rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(12, 22, 34, 0.45);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.card:hover, .card:focus-within { background: var(--panel); border-color: var(--line-bright); }
.cover-wrap { position: relative; margin-bottom: 0.5rem; }
.cover {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 7px;
  border: 1px solid var(--line);
  color: var(--muted);
  background:
    repeating-linear-gradient(45deg, rgba(var(--accent-rgb), 0.05) 0 8px, transparent 8px 16px),
    var(--bg-2);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}
.cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cover .icon { width: 38%; height: 38%; }
.card-play {
  position: absolute;
  right: 0.5rem;
  bottom: 0.5rem;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.card:hover .card-play, .card:focus-within .card-play { opacity: 1; transform: none; }
@media (hover: none) {
  .card-play { opacity: 1; transform: none; }
}
.card-play button.icon-only { width: 44px; height: 44px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); }
.card-title, .card-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-title { color: var(--ink); font-weight: 600; }
.card-sub { color: var(--muted); font-size: 0.86rem; }
.card-meta { color: #56708a; font-family: var(--mono); font-size: 0.72rem; }

.tile-grid {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 0.8rem;
}
.tile-grid.wide { grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); }
.tile {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.tile:hover, .tile:focus-within { border-color: var(--line-bright); background: rgba(16, 30, 46, 0.9); }
.tile-link {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0.8rem;
  align-items: center;
  color: var(--ink);
}
.tile-link:hover { text-decoration: none; text-shadow: none; }
.tile-link:hover .tile-title { color: var(--accent); }
.tile-icon {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 9px;
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.2), rgba(var(--accent-rgb), 0.04));
}
.tile-icon.shared {
  color: var(--accent-2);
  border-color: rgba(var(--accent-2-rgb), 0.35);
  background: linear-gradient(135deg, rgba(var(--accent-2-rgb), 0.25), rgba(var(--accent-2-rgb), 0.04));
}
.tile-icon .icon { width: 1.3rem; height: 1.3rem; }
.tile-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-meta { color: var(--muted); font-size: 0.8rem; }
.tile-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.6rem; }
.tile-actions { flex: none; }
.tile-actions button.icon-only { width: 36px; height: 36px; min-height: 36px; }
.warn-text { color: var(--warn); }
.meta-list { list-style: none; padding: 0; margin: 0.6rem 0 1rem; font-family: var(--mono); font-size: 0.85rem; }
.meta-list li { padding: 0.12rem 0; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0;
  padding: 0.4rem;
  margin: 0 0 1rem;
}
.facts > div { padding: 0.6rem 0.7rem; border-bottom: 1px dashed var(--line); }
.facts dt {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}
.facts dd { margin: 0.2rem 0 0; font-family: var(--mono); font-size: 0.9rem; }

/* Playback */

.player { padding: 1.1rem; }
.player .actions { margin-bottom: 0.9rem; }
audio {
  display: block;
  width: min(100%, 36rem);
  margin: 0.4rem 0 1rem;
  color-scheme: dark;
  border-radius: 999px;
  box-shadow: 0 0 0 1px var(--line-bright), 0 0 18px rgba(var(--accent-rgb), 0.12);
}
video.library-video {
  display: block;
  width: min(100%, 64rem);
  max-height: 70vh;
  margin: 0.4rem 0 1.2rem;
  background: #000;
  border-radius: 12px;
  box-shadow: 0 0 0 1px var(--line-bright);
}
.now-playing { font-family: var(--mono); font-size: 0.85rem; color: var(--accent); margin: 0.6rem 0 0; }
.inline-form { display: inline-flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; }
button.small, td .inline-form button { min-height: 32px; padding: 0.2rem 0.7rem; font-size: 0.7rem; }
button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent-2), 0 0 18px rgba(var(--accent-2-rgb), 0.45); }
.end-session { margin: 1rem 0 0.4rem; }
.end-session button { background: transparent; color: var(--danger); border-color: var(--danger); }
.end-session button:hover { background: rgba(255, 92, 122, 0.12); box-shadow: 0 0 16px rgba(255, 92, 122, 0.35); }
tbody tr.playing { background: rgba(var(--accent-rgb), 0.1); box-shadow: inset 3px 0 0 var(--accent); }

/* Endpoint reference */

.toc { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; }
.toc a {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line-bright);
  border-radius: 4px;
}
.toc a span { color: var(--muted); margin-left: 0.3rem; }
.toc a:hover { border-color: var(--accent); text-decoration: none; }
.toc a[aria-current="page"] { color: var(--accent); border-color: var(--accent); background: rgba(var(--accent-rgb), 0.07); }
.endpoint-group { padding: 1.1rem; margin-bottom: 1rem; scroll-margin-top: 5rem; }
.endpoint-group h2 { display: flex; align-items: center; gap: 0.8rem; }
.access {
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line-bright);
  color: var(--muted);
}
.access-streaming { color: var(--warn); border-color: var(--warn); }
.access-admin { color: var(--accent-2); border-color: var(--accent-2); }
table.endpoints td { font-size: 0.85rem; }
table.endpoints td code { white-space: nowrap; }
.methods { white-space: nowrap; }
.method {
  display: inline-block;
  min-width: 3.6rem;
  margin: 0 0.25rem 0.25rem 0;
  padding: 0.1rem 0.4rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-align: center;
  border-radius: 3px;
  border: 1px solid currentColor;
}
.method-get { color: var(--accent); }
.method-head { color: var(--muted); }
.method-post { color: var(--accent-2); }
.method-put, .method-patch { color: var(--warn); }
.method-delete { color: var(--danger); }
.params { list-style: none; margin: 0; padding: 0; font-size: 0.8rem; }
.params li { padding: 0.12rem 0; }
.params details summary { cursor: pointer; }
.params details .params { margin: 0.25rem 0 0 0.9rem; }
.params .where { color: var(--muted); font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; }
.type { color: var(--ok); font-family: var(--mono); font-size: 0.78rem; }
.req { color: var(--warn); font-family: var(--mono); font-size: 0.72rem; }
.rule { color: var(--muted); font-family: var(--mono); font-size: 0.72rem; }
.status { font-family: var(--mono); color: var(--ink); }

/* Diagnostic tools */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.filters .grow, .simulator-form .grow { flex: 1 1 18rem; }
.meta.small, .small.meta { font-size: 0.78rem; }
.score { font-family: var(--mono); }
.score.ok { color: var(--ok); }
.score.idle { color: var(--warn); }
.readout.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); column-gap: 1.5rem; }
.readout.columns li:last-child { border-bottom: 1px dashed var(--line); }

.simulator-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; }
.offset-field { width: 13rem; }
.checks-grid .meta-list li, .status-grid .readout b, .now-card .readout b { overflow-wrap: anywhere; min-width: 0; }
.status-grid .readout span, .now-card .readout span { flex-shrink: 0; }
.examples { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 0.4rem; }
button.ghost, a.button.ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--line-bright);
  text-transform: none;
  letter-spacing: 0.02em;
}
button.ghost:hover, a.button.ghost:hover { color: var(--accent); border-color: var(--accent); }
button.ghost:disabled { border-style: solid; border-color: var(--line); color: #34495d; }
.events { align-items: center; margin-top: 0.8rem; }

.pipeline { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.pipeline > li {
  position: relative;
  padding: 0 0 1rem 2.4rem;
  border-left: 1px solid var(--line-bright);
  margin-left: 0.8rem;
  counter-increment: step;
}
.pipeline > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.pipeline > li::before {
  content: counter(step);
  position: absolute;
  left: -0.8rem;
  top: 0;
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.75rem;
}
.pipeline h3 {
  margin: 0.1rem 0 0.4rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-2);
}
table.compact { margin-top: 0.6rem; font-size: 0.82rem; }
.queue-preview { margin: 0.6rem 0 0; padding-left: 2.4rem; font-size: 0.88rem; }
.queue-preview li { padding: 0.1rem 0; }
.queue-preview li.current { color: var(--accent); }
.checks { list-style: none; margin: 0.6rem 0 0; padding: 0; font-family: var(--mono); font-size: 0.85rem; }
.checks li { padding: 0.15rem 0; }
.checks .pass span { color: var(--ok); }
.checks .fail span { color: var(--danger); }

.checks-grid, .status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.status-grid .panel { margin-bottom: 0; }
.status-grid h3 { margin-top: 0; }
.check-card { margin-bottom: 0; }
.check-card h2 { display: flex; align-items: center; gap: 0.6rem; font-size: 1rem; }
.check-mark {
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 0.85rem;
  border: 1px solid currentColor;
}
.check-ok .check-mark { color: var(--ok); }
.check-warn .check-mark { color: var(--warn); }
.check-fail { border-color: var(--danger); }
.check-fail .check-mark { color: var(--danger); }
.check-summary { margin: 0 0 0.4rem; }

.now-cards { display: grid; gap: 1rem; margin-bottom: 1.5rem; }
.now-card { display: grid; grid-template-columns: 120px 1fr; gap: 1.1rem; margin-bottom: 0; }
.now-art {
  width: 120px;
  height: 120px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-bright);
  border-radius: 6px;
  overflow: hidden;
  font-size: 2.4rem;
  color: var(--muted);
}
.now-art img { width: 100%; height: 100%; object-fit: cover; }
.now-body h2 { margin: 0; font-size: 1.3rem; text-transform: none; letter-spacing: 0.02em; }
.now-sub { margin: 0.2rem 0 0.6rem; color: var(--muted); }
progress.progress {
  width: 100%;
  height: 0.4rem;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
progress.progress::-webkit-progress-bar { background: var(--line); }
progress.progress::-webkit-progress-value { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
progress.progress::-moz-progress-bar { background: var(--accent); }
@media (max-width: 700px) {
  .now-card { grid-template-columns: 1fr; }
}

/* Playlists and accounts */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line-bright);
  border-radius: 999px;
  padding: 0.05rem 0.55rem;
  vertical-align: middle;
}
.badge.shared { color: var(--accent-2); border-color: var(--accent-2); }
.badge .icon { width: 0.85rem; height: 0.85rem; }
body.bare main:has(.login-stage) {
  display: grid;
  place-items: center;
  max-width: none;
  min-height: 100dvh;
  padding: 1.25rem 1rem;
  overflow: hidden;
}
.login-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(26rem, 100%);
}
.login-glow {
  position: absolute;
  width: min(36rem, 120%);
  height: 22rem;
  background:
    radial-gradient(closest-side, rgba(var(--accent-rgb), 0.22), transparent 72%),
    radial-gradient(closest-side at 72% 28%, rgba(var(--accent-2-rgb), 0.2), transparent 70%);
  filter: blur(6px);
  pointer-events: none;
  animation: login-pulse 5.5s ease-in-out infinite;
}
.login {
  position: relative;
  z-index: 1;
  width: min(26rem, 100%);
  margin: 0;
  padding: 2rem 1.7rem 1.55rem;
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(16, 30, 46, 0.9), rgba(7, 12, 18, 0.86));
  border-color: rgba(var(--accent-rgb), 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 24px 60px rgba(0, 0, 0, 0.48),
    0 0 42px rgba(var(--accent-rgb), 0.12);
  backdrop-filter: blur(16px);
}
.login::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
}
.vu {
  display: flex;
  justify-content: center;
  margin: 0.15rem auto 1rem;
}
.vu-face {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 4.6rem;
  padding: 0.75rem 0.9rem;
  border-radius: 16px;
  background: rgba(3, 8, 14, 0.9);
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.vu-face span {
  position: relative;
  width: 8px;
  height: 100%;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(var(--accent-rgb), 0.1);
}
.vu-face span::after {
  content: "";
  position: absolute;
  inset: 0;
  transform-origin: bottom;
  border-radius: inherit;
  background: linear-gradient(to top, var(--accent) 0 58%, var(--warn) 76%, var(--danger));
  animation: vu-bar 1.05s ease-in-out infinite;
}
.vu-face span:nth-child(1)::after { animation-duration: 0.82s; animation-delay: -0.2s; }
.vu-face span:nth-child(2)::after { animation-duration: 1.18s; animation-delay: -0.55s; }
.vu-face span:nth-child(3)::after { animation-duration: 0.94s; animation-delay: -0.1s; }
.vu-face span:nth-child(4)::after { animation-duration: 1.28s; animation-delay: -0.72s; }
.vu-face span:nth-child(5)::after { animation-duration: 0.88s; animation-delay: -0.34s; }
.vu-face span:nth-child(6)::after { animation-duration: 1.22s; animation-delay: -0.48s; }
.vu-face span:nth-child(7)::after { animation-duration: 0.96s; animation-delay: -0.16s; }
.vu-face span:nth-child(8)::after { animation-duration: 1.12s; animation-delay: -0.63s; }
.vu-face span:nth-child(9)::after { animation-duration: 0.86s; animation-delay: -0.28s; }
.login-kicker {
  margin: 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
}
.login h1 {
  justify-content: center;
  margin: 0.15rem 0 0.15rem;
  font-size: 1.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.login h1::before { content: none; }
.login > .meta { text-align: center; margin: 0 0 1.15rem; }
.login-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.login-label .icon { width: 0.9rem; height: 0.9rem; color: var(--accent); }
.login input { border-radius: 8px; background: rgba(3, 7, 12, 0.72); }
.login button[type="submit"] {
  width: 44px;
  min-height: 44px;
  margin-top: 0.25rem;
  justify-self: center;
  border-radius: 10px;
}
@keyframes vu-bar {
  0%, 100% { transform: scaleY(0.2); }
  30% { transform: scaleY(0.96); }
  48% { transform: scaleY(0.4); }
  68% { transform: scaleY(0.82); }
  84% { transform: scaleY(0.28); }
}
/* Sidebar mark: stacked lamp segments, still until something is playing. */
.brand .vu-face span {
  border-radius: 2px;
  background: repeating-linear-gradient(
    to top,
    rgba(var(--accent-rgb), 0.22) 0 4px,
    transparent 4px 7px
  );
}
.brand .vu-face span::after {
  border-radius: 0;
  transform: none;
  background: linear-gradient(to top, var(--accent) 0 58%, var(--warn) 74%, var(--danger));
  -webkit-mask-image: repeating-linear-gradient(to top, #000 0 4px, transparent 4px 7px);
  mask-image: repeating-linear-gradient(to top, #000 0 4px, transparent 4px 7px);
  animation-name: none;
  clip-path: inset(100% 0 0 0);
}
body.is-playing .brand .vu-face span::after { animation-name: vu-segments; }
@keyframes vu-segments {
  0%, 100% { clip-path: inset(80% 0 0 0); }
  30% { clip-path: inset(4% 0 0 0); }
  48% { clip-path: inset(60% 0 0 0); }
  68% { clip-path: inset(18% 0 0 0); }
  84% { clip-path: inset(72% 0 0 0); }
}
@media (min-width: 901px) {
  .brand .vu-face { height: 1.55rem; }
}
@keyframes login-pulse {
  0%, 100% { opacity: 0.72; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}
@media (prefers-reduced-motion: reduce) {
  .login-glow, .vu-face span::after, body.is-playing .brand .vu-face span::after { animation: none; }
  .vu-face span::after { transform: scaleY(0.55); }
  .vu-face span:nth-child(odd)::after { transform: scaleY(0.82); }
  .brand .vu-face span::after { transform: none; }
  body.is-playing .brand .vu-face span::after { clip-path: inset(42% 0 0 0); }
}
label.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.85rem;
  color: var(--ink);
}
label.check input[type="checkbox"] { accent-color: var(--accent); }
.spaced-top { margin-top: 1.2rem; }
.totp-secret code { font-size: 1.05rem; letter-spacing: 0.12em; }
.backup-codes {
  columns: 2;
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}
.backup-codes li { break-inside: avoid; margin: 0.2rem 0; }
.backup-codes code { font-size: 0.95rem; }
.add-to-playlist select { max-width: 18rem; }
.row-actions { white-space: nowrap; }
.row-actions .inline-form { flex-wrap: nowrap; gap: 0.3rem; margin-right: 0.3rem; }
button.ghost.danger:hover { color: var(--danger); border-color: var(--danger); box-shadow: none; }
tr.unavailable td { color: var(--muted); }
.playlist-settings { margin-top: 1.5rem; }

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.25rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  background: rgba(3, 7, 12, 0.6);
}
.segmented a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 36px;
  padding: 0.2rem 0.85rem;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.segmented a:hover { color: var(--accent); text-decoration: none; text-shadow: none; }
.segmented a[aria-current="page"] { color: var(--accent); background: rgba(var(--accent-rgb), 0.12); box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.45); }
.segmented .count { font-size: 0.7rem; padding: 0 0.4rem; border-radius: 999px; background: rgba(255, 255, 255, 0.06); color: var(--ink); }

.playlist-table td { vertical-align: middle; }
.playlist-table td.row-actions, .playlist-table th:first-child { width: 1%; padding-right: 0.2rem; }
.playlist-table td.row-actions .inline-form { margin: 0; }
.playlist-name { display: flex; align-items: center; gap: 0.75rem; min-width: 12rem; color: var(--ink); }
.playlist-name:hover { text-decoration: none; text-shadow: none; }
.playlist-name:hover .playlist-title { color: var(--accent); }
.playlist-name > span:last-child { display: grid; gap: 0.1rem; min-width: 0; }
.playlist-title { font-weight: 600; }
.playlist-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 8px;
  color: var(--accent);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.2), rgba(var(--accent-rgb), 0.04));
}
.playlist-icon.shared {
  color: var(--accent-2);
  border-color: rgba(var(--accent-2-rgb), 0.35);
  background: linear-gradient(135deg, rgba(var(--accent-2-rgb), 0.25), rgba(var(--accent-2-rgb), 0.04));
}
.playlist-icon .icon { width: 1.1rem; height: 1.1rem; }
.empty.welcome { display: grid; justify-items: center; gap: 0.8rem; padding: 2.6rem 1.2rem; }
.empty.welcome p { margin: 0; }
.playlist-form-panel { max-width: 36rem; }
.show-narrow { display: none; }
@media (max-width: 700px) {
  .hide-narrow { display: none; }
  .show-narrow { display: inline; }
  .playlist-name { min-width: 0; }
  .playlist-table th, .playlist-table td { padding-left: 0.5rem; padding-right: 0.5rem; }
  .segmented { display: flex; }
  .segmented a { flex: 1 1 auto; justify-content: center; padding: 0.2rem 0.5rem; letter-spacing: 0.04em; }
}

/* Home */

.home-head h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
.home-head .filters { flex: 0 1 20rem; }
.home-head .search-field { flex: 1; }
.home-head .search-field input { width: 100%; }
.home-section { margin-bottom: 0; }
.home-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(16rem, 0.85fr);
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.8rem;
}
.resume-list, .home-playlists { grid-template-columns: 1fr; }
.home-albums {
  grid-auto-flow: column;
  grid-auto-columns: minmax(9.5rem, 11.5rem);
  grid-template-columns: none;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  scroll-snap-type: x mandatory;
}
.home-albums .card { scroll-snap-align: start; }
.home-albums .card-play { opacity: 1; transform: none; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 0 0 0.7rem; }
.section-head h2 { margin: 0; }
.section-head > a { display: inline-flex; align-items: center; gap: 0.35rem; font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; }
.section-head > a .icon { width: 0.95rem; height: 0.95rem; }
.resume-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 0.8rem; }
.resume-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.resume-card:hover, .resume-card:focus-within { border-color: var(--line-bright); background: rgba(16, 30, 46, 0.9); }
.resume-art {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  overflow: hidden;
  border-radius: 7px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: repeating-linear-gradient(45deg, rgba(var(--accent-rgb), 0.05) 0 8px, transparent 8px 16px), var(--bg-2);
}
.resume-art img { width: 100%; height: 100%; object-fit: cover; }
.resume-art .icon { width: 1.5rem; height: 1.5rem; }
.resume-body { display: grid; gap: 0.15rem; min-width: 0; }
.resume-title, .resume-track { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resume-title { color: var(--ink); font-weight: 600; }
.resume-track { color: var(--muted); font-size: 0.86rem; }
.resume-body .progress { height: 4px; margin-top: 0.3rem; }
.resume-go {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--accent-ink);
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.95), color-mix(in srgb, var(--accent) 78%, #000000));
  border: 1px solid rgba(var(--accent-rgb), 0.9);
}
.resume-go:hover { box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.45); text-decoration: none; text-shadow: none; }
.resume-go .icon { width: 1rem; height: 1rem; margin-left: 2px; }
.home-browse {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 0;
  margin: 0 0 1.4rem;
}
.browse-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.browse-group + .browse-group {
  margin-left: 0.9rem;
  padding-left: 0.9rem;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}
@media (max-width: 1100px) {
  .home-browse { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .browse-group + .browse-group {
    width: 100%;
    margin-left: 0;
    padding-left: 0;
    padding-top: 0.75rem;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
  }
}
.home-browse a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 600;
}
.home-browse a:hover { border-color: var(--accent); text-decoration: none; text-shadow: none; }
.home-browse .icon { width: 1.2rem; height: 1.2rem; color: var(--accent); }
.home-browse b { font-family: var(--mono); font-size: 0.8rem; font-weight: 500; color: var(--muted); }

/* Household screen */

.house-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.house-switches { margin-bottom: 1.2rem; }
.switch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.75rem;
}
.home-switch-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 4.75rem;
  padding: 0.85rem 0.85rem 0.85rem 1.05rem;
  border-radius: 16px;
  background: #071018;
  border: 1px solid var(--line-bright);
}
.home-switch-copy { flex: 1; min-width: 0; display: grid; gap: 0.1rem; }
.home-switch-name { font-size: 1.15rem; font-weight: 600; overflow-wrap: anywhere; }
.home-switch-room { font-size: 0.95rem; color: var(--muted); }
.home-switch-state {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.home-switch-card form { margin: 0; }
.home-switch-remove { margin: 0; }
.house-switches .home-switch-remove button {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  background: rgba(3, 7, 12, 0.45);
  color: var(--ink);
  border-color: transparent;
}
.house-time {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(2.6rem, 7vw, 4.5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.house-date { margin: 0.2rem 0 0; color: var(--muted); font-size: 1.05rem; }
.house-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(18rem, 1fr);
  gap: 1.2rem;
  align-items: start;
}
.house-side .panel:last-child { margin-bottom: 0; }
.house-frame { padding: 0; overflow: hidden; }
.house-frame .empty.welcome { padding: 4rem 1.2rem; }
.frame-stage {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #000000;
}
.frame-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.frame-stage img.is-shown { opacity: 1; }
.frame-caption {
  position: absolute;
  left: 0.8rem;
  bottom: 0.7rem;
  margin: 0;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--ink);
  font-size: 0.8rem;
}
.house-now-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.house-now-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
}
.house-state { display: grid; place-items: center; color: var(--muted); }
.house-state.playing { color: var(--accent); }
.house-state .icon { width: 1.2rem; height: 1.2rem; }
.house-playlists { grid-template-columns: 1fr; }
.weather-now {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
}
.weather-now .weather-icon { width: 3.2rem; height: 3.2rem; color: var(--accent); }
.weather-temp {
  margin: 0;
  font-family: var(--mono);
  font-size: 2.6rem;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.weather-label { margin: 0.25rem 0 0; color: var(--muted); }
.weather-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; color: var(--muted); font-size: 0.9rem; text-align: right; }
.weather-facts li { display: flex; align-items: center; justify-content: flex-end; gap: 0.35rem; }
.weather-facts .icon { width: 1rem; height: 1rem; }
.weather-days {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0.9rem 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(4.5rem, 1fr));
  gap: 0.6rem;
}
.weather-days li { display: grid; justify-items: center; gap: 0.3rem; text-align: center; font-variant-numeric: tabular-nums; }
.weather-days .icon { width: 1.5rem; height: 1.5rem; }
.weather-day { color: var(--muted); font-size: 0.85rem; }
.weather-rain { display: inline-flex; align-items: center; gap: 0.2rem; color: var(--muted); font-size: 0.8rem; }
.weather-rain .icon { width: 0.8rem; height: 0.8rem; }
.weather-credit { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem; margin: 0.9rem 0 0; }
.weather-credit .icon { width: 0.9rem; height: 0.9rem; }

/* To-do list */

.todo-add { display: flex; gap: 0.6rem; margin: 0 0 1rem; }
.todo-add input[type="text"] { flex: 1; min-width: 0; }
.house-todos .todo-add { margin: 1rem 0 0; }
.todo-list { list-style: none; margin: 0; padding: 0; display: grid; }
.todo {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--line);
}
.todo:last-child { border-bottom: 0; }
.todo-body { display: grid; gap: 0.1rem; min-width: 0; }
.todo-text { overflow-wrap: anywhere; }
.todo-check .icon { width: 1.35rem; height: 1.35rem; }
.todo.done .todo-text { color: var(--muted); text-decoration: line-through; }
.todo.done .todo-check { color: var(--accent); }
@media (max-width: 900px) {
  .house-grid { grid-template-columns: 1fr; }
}

.choice-cards { display: grid; gap: 0.6rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.choice-cards legend {
  padding: 0;
  margin-bottom: 0.4rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
label.choice {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.7rem;
  row-gap: 0.15rem;
  align-items: center;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  background: rgba(3, 7, 12, 0.5);
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
label.choice:hover { border-color: rgba(var(--accent-rgb), 0.5); }
label.choice:has(input:checked) { border-color: var(--accent); background: rgba(var(--accent-rgb), 0.08); }
label.choice input { grid-row: span 2; min-height: auto; width: 1.1rem; height: 1.1rem; margin: 0; accent-color: var(--accent); }
.choice-title { display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--sans); font-size: 0.95rem; font-weight: 600; color: var(--ink); }
.choice-title .icon { width: 1rem; height: 1rem; color: var(--accent); }
.choice-note { font-family: var(--sans); font-size: 0.82rem; color: var(--muted); }

dialog.modal {
  width: min(32rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background: linear-gradient(var(--panel), var(--panel)), #05090e;
  border: 1px solid var(--line-bright);
  border-radius: 10px;
  box-shadow: var(--glow), 0 24px 70px rgba(0, 0, 0, 0.65);
}
dialog.modal.wide { width: min(56rem, calc(100vw - 2rem)); }
.modal-body .facts, .modal-body .card-grid, .modal-body .filters, .modal-body .note { margin: 0; }
.modal-body .facts dd { overflow-wrap: anywhere; }
dialog.modal::backdrop { background: rgba(2, 5, 9, 0.72); backdrop-filter: blur(3px); }
dialog.modal[open] { animation: modal-in 0.16s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.modal-body { display: grid; gap: 1.1rem; padding: 1.2rem 1.3rem 1.3rem; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.modal-head h2 { margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; flex-wrap: wrap; }

/* Player bar */

main:focus { outline: none; }
.mini-player {
  --player-height: 4.5rem;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: var(--player-height);
  padding: 0.55rem 1rem;
  background: rgba(8, 14, 22, 0.96);
  border-top: 1px solid var(--line-bright);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
}
.mini-player[hidden] { display: none; }
body.has-player { padding-bottom: 4.5rem; }
body.has-player .debug-toggle { bottom: 5.5rem; }
.mini-art { flex: none; display: block; width: 48px; height: 48px; border-radius: 6px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.mini-art[hidden] { display: none; }
.mini-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mini-info { flex: 1 1 14rem; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.mini-info a { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-info a:hover { color: var(--accent); }
.mini-info .meta { font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-info .meta.bad { color: var(--danger); }
.mini-controls { flex: none; display: flex; gap: 0.3rem; }
.mini-player button.icon-only { width: 38px; height: 38px; min-height: 38px; }
.mini-player audio { flex: 2 1 20rem; min-width: 12rem; height: 40px; }
html.app-loading main { opacity: 0.6; transition: opacity 0.2s ease 0.15s; }
html.app-loading::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
  background-size: 50% 100%;
  background-repeat: no-repeat;
  animation: app-loading 1s linear infinite;
}
@keyframes app-loading {
  from { background-position: -50% 0; }
  to { background-position: 150% 0; }
}
@media (max-width: 900px) {
  .home-split { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .mini-player { flex-wrap: wrap; gap: 0.5rem 0.6rem; padding: 0.5rem 0.7rem; }
  .mini-info { flex: 1 1 0; }
  .mini-art { width: 40px; height: 40px; }
  .mini-player audio { flex-basis: 100%; order: 5; }
  body.has-player { padding-bottom: 8.5rem; }
  body.has-player .debug-toggle { bottom: 8.5rem; }
  .debug-toggle { padding: 0.3rem 0.6rem; }
  .debug-toggle span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html.app-loading::before { animation: none; background-position: 50% 0; }
}

/* Debug console */

.debug-toggle {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  min-height: 36px;
  padding: 0.3rem 0.9rem;
  background: rgba(5, 8, 13, 0.92);
  color: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: var(--glow);
}
.debug-toggle.has-errors { color: var(--danger); border-color: var(--danger); }
.debug-toggle.has-errors::after {
  content: attr(data-errors);
  margin-left: 0.5rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--danger);
  color: #05080d;
  font-weight: 700;
}
.debug-console {
  position: fixed;
  inset: auto 1rem 1rem 1rem;
  z-index: 50;
  width: auto;
  max-width: none;
  height: min(62vh, 36rem);
  margin: 0;
  padding: 0;
  display: none;
  flex-direction: column;
  background: rgba(3, 6, 10, 0.97);
  color: var(--ink);
  border: 1px solid var(--line-bright);
  border-radius: 8px;
  box-shadow: var(--glow), 0 24px 70px rgba(0, 0, 0, 0.65);
}
.debug-console[open], .debug-console.standalone { display: flex; }
.debug-console.standalone { position: static; height: calc(100vh - 5.5rem); }
.debug-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid var(--line-bright);
  background: rgba(12, 22, 34, 0.7);
}
.debug-title {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.debug-tabs, .debug-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.debug-tools { margin-left: auto; }
.debug-console button, .debug-console select, .debug-console input[type="search"] {
  min-height: 30px;
  padding: 0.15rem 0.6rem;
  font-size: 0.7rem;
}
.debug-console input[type="search"] { width: 11rem; }
.debug-tabs button, .debug-tools button {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line-bright);
}
.debug-tabs button[aria-selected="true"] { color: var(--accent); border-color: var(--accent); box-shadow: var(--glow); }
.debug-tabs button span { margin-left: 0.3rem; color: var(--muted); }
.debug-tools button:hover { color: var(--accent); border-color: var(--accent); }
.debug-live {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
}
.debug-live input[type="checkbox"] { accent-color: var(--accent); }
.debug-body { flex: 1; min-height: 0; overflow: auto; }
.debug-body [hidden] { display: none; }
.debug-log { list-style: none; margin: 0; padding: 0.25rem 0; font-family: var(--mono); font-size: 0.74rem; }
.debug-entry {
  display: grid;
  grid-template-columns: 7rem 4.8rem minmax(6rem, 11rem) 1fr;
  gap: 0.2rem 0.7rem;
  padding: 0.2rem 0.8rem;
  border-bottom: 1px solid rgba(27, 44, 61, 0.45);
}
.debug-entry:hover { background: rgba(var(--accent-rgb), 0.04); }
.debug-time, .debug-logger { color: var(--muted); }
.debug-logger { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.debug-message { overflow-wrap: anywhere; }
.debug-fields { grid-column: 4; color: #6f8aa3; overflow-wrap: anywhere; }
.debug-entry pre {
  grid-column: 1 / -1;
  margin: 0.2rem 0 0.3rem;
  padding: 0.5rem;
  max-height: 16rem;
  overflow: auto;
  background: rgba(255, 92, 122, 0.06);
  border-left: 2px solid var(--danger);
  color: #ffb3c1;
  white-space: pre-wrap;
}
.debug-level { font-weight: 600; }
.level-debug .debug-level { color: var(--muted); }
.level-info .debug-level { color: var(--accent); }
.level-warning .debug-level { color: var(--warn); }
.level-error .debug-level, .level-critical .debug-level { color: var(--danger); }
.level-error, .level-critical { background: rgba(255, 92, 122, 0.05); }
.debug-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 1rem;
  padding: 0.9rem;
}
.debug-status h3 {
  margin: 0 0 0.4rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-2);
}
.debug-status dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1rem;
  margin: 0;
  font-size: 0.8rem;
}
.debug-status dt { color: var(--muted); }
.debug-status dd { margin: 0; font-family: var(--mono); overflow-wrap: anywhere; }
.debug-foot {
  margin: 0;
  padding: 0.35rem 0.8rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
}

/* Paging and progress */

.pager {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--muted);
}
.pager a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line-bright);
  border-radius: 4px;
}
.pager a:hover { border-color: var(--accent); text-decoration: none; }

progress {
  width: min(100%, 32rem);
  height: 0.55rem;
  appearance: none;
  border: 1px solid var(--line-bright);
  border-radius: 999px;
  background: var(--bg-2);
  overflow: hidden;
}
progress::-webkit-progress-bar { background: var(--bg-2); }
progress::-webkit-progress-value { background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 12px var(--accent); }
progress::-moz-progress-bar { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

#scan-progress { border-color: rgba(var(--accent-rgb), 0.45); box-shadow: var(--glow); }
#scan-progress h2::after {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-left: 0.6rem;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  50% { opacity: 0.25; }
}

/* Theme colour picker (account page) */

.swatches { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 0.2rem 0 1rem; }
.swatch {
  width: 2.5rem;
  height: 2.5rem;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(135deg, var(--swatch) 0 55%, var(--swatch-2) 55% 100%);
}
.swatch:hover { box-shadow: 0 0 16px var(--swatch); }
.swatch[aria-pressed="true"] { border-color: #ffffff; box-shadow: 0 0 0 2px var(--swatch), 0 0 18px var(--swatch); }
.colour-field { display: flex; align-items: center; gap: 0.6rem; }
.colour-field input[type="color"] { width: 3rem; min-height: 40px; height: 40px; padding: 0.2rem; cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Picture galleries */

.photo-grid {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.55rem;
}
.photo-grid a {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-2);
}
.photo-grid img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-grid a:hover { border-color: var(--accent); }
.photo-grid .photo-video {
  display: grid;
  place-items: center;
  color: var(--muted);
}
.photo-grid .photo-video svg { width: 2rem; height: 2rem; }
.photo-grid a.photo-folder {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.2rem;
  padding: 0.45rem;
  text-align: center;
  color: var(--ink);
  text-decoration: none;
}
.photo-grid a.photo-folder svg { width: 1.7rem; height: 1.7rem; color: var(--muted); }
.photo-grid a.photo-folder span,
.photo-grid a.photo-folder small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.photo-grid a.photo-folder small { color: var(--muted); font-size: 0.75rem; }
dialog.modal.photo-modal {
  width: calc(100vw - 2rem);
  max-width: calc(100vw - 2rem);
  height: calc(100vh - 2rem);
  max-height: calc(100vh - 2rem);
  overflow: hidden;
  background: #05090e;
  color: #fff;
}
.photo-stage {
  display: grid;
  place-items: center;
  height: 100%;
  margin: 0;
}
.photo-stage img,
.photo-stage video {
  max-width: calc(100vw - 9rem);
  max-height: calc(100vh - 7rem);
  width: auto;
  height: auto;
  margin: 0;
  object-fit: contain;
  background: transparent;
}
.photo-stage figcaption {
  position: absolute;
  bottom: 0.8rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  color: #d5dee8;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}
.photo-close, .photo-nav {
  position: absolute;
  z-index: 2;
  background: rgba(5, 9, 14, 0.78);
  color: #fff;
}
.photo-close { top: 0.7rem; right: 0.7rem; }
.photo-nav { top: 50%; transform: translateY(-50%); }
.photo-nav.prev { left: 0.7rem; }
.photo-nav.next { right: 0.7rem; }
.photo-view { margin: 0 0 1rem; }
.photo-view img,
.photo-view video {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 75vh;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 10px;
  background: #000;
}
input[type="file"] {
  width: 100%;
  padding: 0.45rem;
  text-transform: none;
  letter-spacing: 0;
}
.drop-zone {
  display: grid;
  gap: 0.55rem;
  justify-items: center;
  padding: 1.4rem 1rem;
  border: 1px dashed var(--line-bright);
  border-radius: 10px;
  background: var(--bg-2);
  text-align: center;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.95rem;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
}
.drop-zone strong { font-size: 1.05rem; font-weight: 600; }
.drop-zone .meta { margin: 0; font-size: 0.85rem; }
.drop-zone.dropping {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
}
.drop-files:empty { display: none; }
.drop-files { margin: 0; color: var(--ink); font-size: 0.85rem; word-break: break-word; }

@media (max-width: 700px) {
  .stats strong { font-size: 1.35rem; }
  .page-head .filters { flex-wrap: wrap; width: 100%; }
  .page-head .search-field { flex: 1; }
  .search-field input { width: 100%; }
}

/* Icon actions: the label stays for the tooltip and for assistive tech. */
button:has(> .icon),
a.button:has(> .icon) {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
}
td button:has(> .icon),
td .inline-form button:has(> .icon) {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
}
button:has(> .icon) > span,
a.button:has(> .icon) > span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
