.error { color: #962c24; }
.demo { max-width: 100%; overflow-wrap: anywhere; }
.card .blank { width: 100%; }
button.key { min-width: 0; }
.admin .kbd {
  grid-template-columns: minmax(45px, .85fr) minmax(0, 4fr);
}
.admin .kbd .key {
  min-height: 52px;
  padding: 6px 2px;
  color: #242b36;
  background: #f7f8fa;
  border: 1px solid #bec4ce;
  box-shadow: 0 2px 0 #c6ccd5;
  font-size: 16px;
  line-height: 1.2;
}
.admin .kbd .key .legend {
  margin-top: 3px;
  font: 600 12px/1.2 "Segoe UI", sans-serif;
  color: #495568;
}
.admin .kbd [data-key="10"] { color: #14643f; }
.admin .kbd [data-key="13"] { color: #9b490e; }
.admin .kbd .side [data-key], .admin .kbd [data-key="15"] { color: #234f92; }
.admin .kbd .key:disabled {
  background: #e8e9ec;
  color: #666a72;
  box-shadow: none;
}
.admin .kbd .key.pressed {
  background: #d9e9ff;
  border-color: #3268a8;
  transform: translateY(1px);
  box-shadow: inset 0 1px 3px #24354c33;
}
.admin .kbd .key.long-press { background: #ffe1a3; border-color: #ae6800; }
#notice:not(:empty) { margin: 0 0 16px; }

.mast-actions, .theme-control { display: flex; align-items: center; gap: 8px; }
.mast-actions { margin-left: auto; min-width: 0; }
.theme-control { color: var(--muted); font-size: 13px; white-space: nowrap; }
.theme-control select {
  min-height: 36px;
  padding: 4px 6px;
  border: 1px solid #a6abb4;
  border-radius: 8px;
  background: white;
  color: var(--ink);
}
.signed-out .mast { position: absolute; inset: 0 0 auto; }
.signed-out .mast :is(.brand, .breadcrumb, #identity) { display: none; }
@media (max-width: 760px) {
  .admin .mast-inner { flex-wrap: wrap; gap: 4px 10px; }
  .mast-actions { max-width: 100%; }
}
.admin.signed-out .shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 74px 16px;
}
.admin.signed-out main {
  width: min(100%, 408px);
  padding: clamp(24px, 5vw, 36px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  box-shadow: var(--card-shadow);
}
.signed-out main:has(#view:empty) { visibility: hidden; }
.admin.signed-out .brand {
  position: static;
  margin-bottom: 24px;
}
.admin.signed-out .panel {
  border: 0;
  padding: 0;
  box-shadow: none;
}
.signed-out .btn.primary { width: 100%; }
.signed-out .field input { min-width: 0; font-size: 16px; }

:root[data-theme="dark"] { color-scheme: dark; background: #14171c; }
[data-theme="dark"] .admin {
  --paper: #14171c;
  --surface: #20252c;
  --raised: #2a313a;
  --ink: #edf1f5;
  --muted: #b8c1cb;
  --line: #414952;
  --accent: #b4d6f7;
  --card-shadow: 0 3px 12px #0003;
}
[data-theme="dark"] .admin :is(nav, .panel, .card, .filter),
[data-theme="dark"] .admin.signed-out main {
  background: var(--surface);
  border-color: var(--line);
}
[data-theme="dark"] .admin :is(.brand em, .demo, .nav-label) { color: var(--muted); }
[data-theme="dark"] .admin .demo { border-color: var(--line); }
[data-theme="dark"] .admin :is(nav a:hover, .filter:hover) { background: var(--raised); }
[data-theme="dark"] .admin :is(nav a[aria-current], .filter[aria-pressed="true"]) {
  background: #34455a;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px #859fbc;
}
[data-theme="dark"] .admin :is(.field input, .field select, .theme-control select, .btn) {
  background: var(--raised);
  border-color: #697583;
  color: var(--ink);
}
[data-theme="dark"] .admin .btn.primary { background: #b5d5f4; color: #162637; }
[data-theme="dark"] .admin :is(.error, .btn.danger) { color: #ffaca8; }
[data-theme="dark"] .admin :focus-visible { outline-color: #9bccff; }
[data-theme="dark"] .admin .blank { background: #303a36; color: #d5dfd9; }
[data-theme="dark"] .admin .tag { background: #163f30; color: #9aebc0; }
[data-theme="dark"] .admin .tag.s1 { background: #493719; color: #ffd48c; }
[data-theme="dark"] .admin .tag.s2 { background: #343e4a; color: #d6dfe9; }
[data-theme="dark"] .admin .kbd .key {
  background: var(--raised);
  border-color: #626e7b;
  color: var(--ink);
  box-shadow: 0 2px 0 #101317;
}
[data-theme="dark"] .admin .kbd .key .legend { color: var(--muted); }
[data-theme="dark"] .admin .kbd [data-key="10"] { color: #96e2ba; }
[data-theme="dark"] .admin .kbd [data-key="13"] { color: #ffc294; }
[data-theme="dark"] .admin .kbd .side [data-key],
[data-theme="dark"] .admin .kbd [data-key="15"] { color: #a8cfff; }
[data-theme="dark"] .admin .kbd .key:disabled {
  background: #23272d;
  border-color: var(--line);
  color: #9fa8b2;
  box-shadow: none;
}
[data-theme="dark"] .admin .kbd .key.pressed { background: #304c69; border-color: #9bcfff; }
[data-theme="dark"] .admin .kbd .key.long-press { background: #58401e; border-color: #efbc75; }

#audio-controls, .station-audio {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem .85rem;
  font-size: .85rem;
}
#audio-controls { margin: 0 0 1rem; }
#audio-controls[hidden] { display: none; }
#audio-controls select {
  padding: .4rem .55rem;
  color: inherit;
  background: var(--raised, Canvas);
  border: 1px solid var(--line);
  border-radius: .45rem;
}
.admin .station-link { display:block; color:inherit; text-decoration:none; }
.station-audio { padding: .65rem .9rem; border-top: 1px solid var(--line); }
.station-audio > div { width: 100%; }
.station-audio label { display:inline-flex; align-items:center; gap:.4rem; }
.station-audio input { width: 5rem; }
.station-audio meter { width: 4rem; }
.station-audio .btn[aria-pressed="true"] { outline: 2px solid currentColor; }
