:root {
  color-scheme: light;
  --bg: #f8f5ee;
  --panel: #ffffff;
  --text: #12110f;
  --muted: #625d54;
  --line: #e5ddcf;
  --accent: #ffc840;
  --accent-dark: #d29500;
  --accent-ink: #111111;
  --soft: #fff1c3;
  --shadow: 0 10px 28px rgba(40, 33, 25, 0.10);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-transform: uppercase;
}

body:not(.app-ready) .hitlist-subnav,
body:not(.app-ready) .list-mode-switcher,
body:not(.app-ready) [data-portal-settings-section],
body:not(.app-ready) [data-manage-section] {
  visibility: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
  font-weight: 700;
  min-height: 42px;
  padding: 0 14px;
}

button:hover {
  background: var(--accent-dark);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  padding: 0 14px;
  text-decoration: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  padding: 0 14px;
  text-decoration: none;
}

.button-link:hover,
.button:hover {
  background: var(--accent-dark);
}

button.secondary,
.button.secondary {
  background: #ece7df;
  color: var(--text);
}

.button[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

button.compact {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

button.ghost {
  min-height: 32px;
  background: transparent;
  color: var(--accent);
  padding: 0 8px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  min-height: 44px;
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: rgba(18, 17, 15, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.brand img {
  width: 72px;
  height: 44px;
  object-fit: contain;
}

body[data-page="vote"] .brand img {
  width: 56px;
  height: 34px;
}

.topbar strong {
  display: block;
  font-size: 20px;
  color: #fff;
}

.topbar span,
.section-head p,
.custom-entry small,
.summary span {
  color: var(--muted);
}

.topbar span {
  color: #d8d0c1;
}

.topbar a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  min-height: 36px;
  min-width: 0;
  max-width: 100%;
  justify-content: flex-end;
  overflow-x: auto;
  scrollbar-width: thin;
}

body:not(.app-ready) .topbar .nav-links:empty::before {
  content: "";
  display: block;
  width: min(420px, 42vw);
  height: 36px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .08) 0 22%, rgba(255, 200, 64, .24) 38%, rgba(255, 255, 255, .08) 54% 100%);
  background-size: 220% 100%;
  box-shadow: inset 0 0 0 1px rgba(255, 200, 64, .16);
  animation: nav-placeholder-sheen 1.25s ease-in-out infinite;
}

@keyframes nav-placeholder-sheen {
  from {
    background-position: 120% 0;
  }

  to {
    background-position: -120% 0;
  }
}

.nav-links a,
.nav-button {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid rgba(255, 200, 64, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-weight: 900;
  padding: 0 14px;
  text-decoration: none;
  transition: transform 0.16s ease, background-color 0.16s ease, border-color 0.16s ease;
}

.nav-button {
  cursor: pointer;
  font-family: inherit;
  flex: 0 0 auto;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 200, 64, 0.12);
  border-color: rgba(255, 200, 64, 0.42);
}

.nav-links a.active,
.nav-links a[aria-current="page"] {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  box-shadow: 0 10px 20px rgba(255, 200, 64, 0.22);
}

.hitlist-subnav {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 24px 12px;
  border-bottom: 1px solid rgba(255, 200, 64, 0.16);
  background: rgba(58, 46, 19, 0.94);
  backdrop-filter: blur(10px);
}

.hitlist-subnav a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 8px;
  color: #fff3cc;
  font-weight: 900;
  padding: 0 12px;
  text-decoration: none;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.hitlist-subnav a:hover {
  background: rgba(255, 200, 64, 0.14);
}

.hitlist-subnav a.active,
.hitlist-subnav a[aria-current="page"] {
  background: var(--accent);
  color: var(--accent-ink);
}

.portal-layout {
  display: grid;
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px;
}

.portal-layout.ris-layout {
  max-width: none;
  width: min(1760px, calc(100vw - 24px));
}

.portal-hero-panel,
.empty-portal-panel {
  display: grid;
  gap: 10px;
  padding: clamp(18px, 3vw, 32px);
}

.portal-hero-panel h1,
.empty-portal-panel h1 {
  font-size: clamp(28px, 4vw, 48px);
}

.portal-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 14px;
}

.portal-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  border: 1px solid #ead69f;
  border-radius: 8px;
  background: linear-gradient(180deg, #fffef9 0%, #fff7df 100%);
  color: var(--text);
  padding: 18px;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.portal-card span {
  color: #8b6500;
  font-weight: 900;
  text-transform: uppercase;
}

.portal-card strong {
  font-size: 22px;
  line-height: 1.1;
}

.ris-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .95fr) minmax(320px, .85fr);
  grid-template-areas:
    "weather weather weather"
    "news traffic suggestions"
    "today today today";
  gap: 14px;
  align-items: start;
}

.ris-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.ris-weather-panel {
  grid-area: weather;
}

.ris-news-panel {
  grid-area: news;
}

.ris-suggestions-panel {
  grid-area: suggestions;
}

.ris-traffic-panel {
  grid-area: traffic;
}

.ris-today-panel {
  grid-area: today;
}

.ris-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.ris-font-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid #ead69f;
  border-radius: 999px;
  background: #fffaf0;
  padding: 4px 10px;
  color: #4a3820;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.ris-font-control input {
  width: 110px;
}

.ris-refresh-button {
  --ris-refresh-ring: #3b8b53;
  --ris-refresh-progress: 4%;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid #3b8b53;
  border-radius: 999px;
  background: #dff5e8;
  color: #12602f;
  padding: 0 16px 0 42px;
  font-weight: 900;
  box-shadow: 0 0 0 3px rgba(59, 139, 83, .12);
  text-transform: uppercase;
}

.ris-refresh-button::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 47%, transparent 49%),
    conic-gradient(var(--ris-refresh-ring) var(--ris-refresh-progress), rgba(5, 5, 5, .12) 0);
  transform: translateY(-50%);
  box-shadow: inset 0 0 0 1px rgba(5, 5, 5, .18);
}

.ris-refresh-button.is-stale {
  --ris-refresh-ring: #d5a300;
  border-color: #d5a300;
  background: #fff1bd;
  color: #755400;
  box-shadow: 0 0 0 4px rgba(213, 163, 0, .18);
}

.ris-refresh-button.is-old {
  --ris-refresh-ring: #c13a2f;
  border-color: #c13a2f;
  background: #ffe1dc;
  color: #9d2118;
  box-shadow: 0 0 0 4px rgba(193, 58, 47, .2);
  animation: ris-refresh-urge 1.35s ease-in-out infinite;
}

.ris-refresh-button:disabled {
  opacity: .72;
  cursor: wait;
  animation: none;
}

.ris-refresh-button:disabled::before {
  animation: ris-refresh-spin .8s linear infinite;
}

@keyframes ris-refresh-spin {
  to {
    transform: translateY(-50%) rotate(1turn);
  }
}

@keyframes ris-refresh-urge {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.035);
  }
}

.ris-script-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  border: 1px solid #ead69f;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff8df 0%, #fffdf7 100%);
  padding: 18px;
}

.ris-weather-icon {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 3px solid #050505;
  border-radius: 18px;
  background: var(--accent);
  color: #050505;
  font-size: 40px;
  box-shadow: 5px 5px 0 #050505;
}

.ris-script-card p:first-child {
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.32;
}

.ris-list,
.ris-track-list {
  display: grid;
  gap: 8px;
}

.ris-news-panel .ris-list,
.ris-traffic-panel .ris-list,
.ris-suggestions-panel .ris-track-list,
.ris-today-column .ris-list {
  max-height: min(64vh, 620px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 5px;
  scrollbar-color: var(--accent-dark) #fff4d8;
}

.ris-news-panel .ris-list {
  max-height: min(64vh, 610px);
}

.ris-traffic-panel .ris-list {
  max-height: min(64vh, 520px);
}

.ris-suggestions-panel .ris-track-list {
  max-height: min(64vh, 620px);
}

.ris-today-column .ris-list {
  max-height: min(60vh, 560px);
}

.ris-news-item,
.ris-traffic-item,
.ris-track-item,
.ris-empty {
  min-width: 0;
  border: 1px solid #efe6d8;
  border-radius: 8px;
  background: #fffdf8;
  padding: 10px;
}

.ris-news-item {
  color: var(--text);
}

.ris-news-item:hover,
.ris-news-item[open] {
  border-color: var(--accent-dark);
  background: #fff7df;
}

.ris-news-item summary {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 130px;
  gap: 10px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.ris-news-item summary::-webkit-details-marker {
  display: none;
}

.ris-news-item summary::after {
  content: "+";
  display: none;
}

.ris-news-item span {
  display: inline-flex;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: #1f1600;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.ris-news-briefing {
  display: grid;
  gap: 12px;
  margin-top: 10px;
  border-top: 1px solid #f0dfbd;
  padding-top: 12px;
}

.ris-news-readout {
  margin: 0;
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: #fffbe8;
  padding: 12px 14px;
  color: var(--text);
  font-family: "Courier New", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: calc(var(--ris-dynamic-font-size, 20px) * .76);
  font-weight: 800;
  line-height: 1.52;
  max-width: 68ch;
  white-space: pre-line;
}

.ris-news-readout-label {
  justify-self: start;
  margin: 0;
  border-radius: 999px;
  background: #050505;
  color: var(--accent);
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.ris-news-link {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  background: #050505;
  color: var(--accent);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
}

.ris-news-item strong,
.ris-track-item strong {
  font-size: calc(var(--ris-dynamic-font-size, 20px) * .78);
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.ris-news-item small,
.ris-track-item small,
.ris-traffic-item small {
  color: var(--muted);
  font-size: calc(var(--ris-dynamic-font-size, 20px) * .62);
  font-weight: 800;
}

.ris-track-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
}

.ris-track-rank {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #050505;
  color: var(--accent);
  font-weight: 900;
}

.ris-track-item div {
  display: grid;
  gap: 3px;
}

.ris-track-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.ris-track-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  background: #ffe9a6;
  color: #5a3f00;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.ris-track-badge.is-spotify {
  background: #dff5e8;
  color: #12602f;
}

.ris-track-item p {
  margin: 0;
  color: #6c4d00;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

.ris-traffic-item {
  display: grid;
  gap: 4px;
}

.ris-traffic-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ris-traffic-delay {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #ffe1dc;
  color: #b7281c;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 900;
}

.ris-traffic-route {
  color: var(--text);
  font-size: calc(var(--ris-dynamic-font-size, 20px) * .74);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.ris-traffic-item strong {
  color: #b7281c;
  font-size: calc(var(--ris-dynamic-font-size, 20px) * .82);
  line-height: 1.2;
}

.ris-today-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ris-today-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.ris-today-column h3 {
  margin: 0;
  border-bottom: 3px solid var(--accent);
  padding-bottom: 6px;
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
}

.ris-today-item {
  display: grid;
  gap: 4px;
  border: 1px solid #efe6d8;
  border-radius: 8px;
  background: #fffdf8;
  padding: 10px;
}

.ris-today-item[title] {
  cursor: pointer;
}

.ris-today-item strong {
  color: var(--text);
  font-size: calc(var(--ris-dynamic-font-size, 20px) * .76);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.ris-today-item p {
  margin: 0;
  color: #5b4630;
  font-size: calc(var(--ris-dynamic-font-size, 20px) * .66);
  font-weight: 800;
  line-height: 1.35;
}

.ris-today-item small {
  color: var(--muted);
  font-size: calc(var(--ris-dynamic-font-size, 20px) * .58);
  font-weight: 900;
}

.ris-today-item.is-deceased {
  border-color: #f1c6bf;
  background: #fff7f4;
}

.ris-empty {
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 900px) {
  .ris-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "weather"
      "news"
      "suggestions"
      "traffic"
      "today";
  }

  .ris-news-item summary {
    grid-template-columns: 1fr;
  }

  .ris-today-grid {
    grid-template-columns: 1fr;
  }

  .ris-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .ris-script-card {
    grid-template-columns: 1fr;
  }
}

.portal-settings-layout {
  gap: 14px;
}

.portal-settings-nav {
  top: 76px;
  background: linear-gradient(to bottom, rgba(248, 245, 238, 0.99), rgba(248, 245, 238, 0.94) 75%, rgba(248, 245, 238, 0));
}

.portal-settings-nav a {
  min-height: 40px;
  border-radius: 999px;
  background: #f1ebdf;
  padding: 0 14px;
}

.portal-settings-panel {
  padding: 18px;
}

.portal-settings-form {
  gap: 14px;
}

body[data-page="info-screen"] {
  --tec-clock-scale: 1.12;
  --tec-outer-gap: clamp(42px, 6vw, 104px);
  --tec-vu-panel-width: clamp(600px, 49vw, 720px);
  --tec-side-width: clamp(140px, 14vw, 210px);
  --tec-clock-width: clamp(360px, 35vw, 570px);
  min-height: 100vh;
  background: #000;
  color: #ff262d;
  overflow-x: hidden;
}

body[data-page="info-screen"] .topbar {
  gap: 10px;
  padding: 10px 24px;
  border-bottom-color: rgba(255, 38, 45, .16);
  background: #000;
  box-shadow: none;
}

body[data-page="info-screen"] .brand {
  gap: 10px;
}

body[data-page="info-screen"] .brand img {
  width: 58px;
  height: 36px;
}

body[data-page="info-screen"] .topbar strong {
  font-size: 18px;
  line-height: 1;
}

body[data-page="info-screen"] .topbar span {
  font-size: 13px;
  line-height: 1.1;
}

body[data-page="info-screen"] .nav-links {
  gap: 8px;
  flex-wrap: nowrap;
  min-height: 32px;
  overflow: visible;
}

body[data-page="info-screen"] .nav-links a,
body[data-page="info-screen"] .nav-button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
  letter-spacing: .01em;
}

body[data-page="info-screen"].tec-is-fullscreen .topbar {
  display: none;
}

.tecstumo-screen {
  min-height: calc(100vh - 78px);
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  justify-items: center;
  align-content: start;
  gap: clamp(4px, .7vh, 9px);
  padding: clamp(26px, 3.5vh, 46px) var(--tec-outer-gap) clamp(18px, 2.4vh, 28px);
}

body[data-page="info-screen"].tec-is-fullscreen .tecstumo-screen {
  min-height: 100vh;
  padding-top: clamp(42px, 5.4vh, 68px);
}

.tecstumo-logo {
  width: min(100%, 172px);
  height: auto;
  opacity: .92;
  filter: drop-shadow(0 0 14px rgba(255, 191, 49, .16));
  pointer-events: none;
}

.tec-header-logo {
  width: clamp(132px, 12vw, 198px);
  max-height: 70px;
  object-fit: contain;
  object-position: center;
  margin-bottom: clamp(2px, .6vh, 8px);
}

.tec-top-strip {
  position: static;
  z-index: 8;
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  width: min(100%, 1320px);
  margin-bottom: clamp(8px, 1.35vh, 18px);
  transform: none;
}

body[data-page="info-screen"].tec-is-fullscreen .tec-top-strip {
  top: auto;
}

.tec-now-playing {
  display: grid;
  justify-items: center;
  row-gap: clamp(3px, .55vh, 8px);
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 clamp(12px, 1.8vw, 22px);
  text-align: center;
  box-shadow: none;
}

.tec-now-playing-kicker,
.tec-now-playing small {
  color: rgba(255, 38, 45, .68);
  font-size: clamp(10px, .92vw, 13px);
  font-weight: 1000;
  letter-spacing: .14em;
  line-height: 1;
  text-transform: uppercase;
}

.tec-now-playing strong {
  width: 100%;
  color: #ffc83d;
  font-size: clamp(27px, 3.45vw, 52px);
  font-weight: 1000;
  line-height: .9;
  text-transform: uppercase;
  text-shadow:
    0 0 10px rgba(255, 200, 61, .56),
    0 0 28px rgba(255, 155, 28, .28);
  overflow: visible;
  overflow-wrap: anywhere;
  white-space: normal;
}

.tec-now-playing-version {
  width: 100%;
  color: rgba(255, 200, 61, .82);
  font-size: clamp(14px, 1.45vw, 25px);
  font-style: normal;
  font-weight: 1000;
  line-height: .95;
  text-transform: uppercase;
  text-shadow:
    0 0 8px rgba(255, 200, 61, .34),
    0 0 18px rgba(255, 155, 28, .16);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tec-now-playing span:not(.tec-now-playing-kicker) {
  width: 100%;
  color: rgba(255, 214, 105, .86);
  font-size: clamp(19px, 2.05vw, 34px);
  font-weight: 1000;
  line-height: 1;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tec-now-playing small.is-error {
  color: #ff9f1c;
}

.tec-left-stack {
  position: relative;
  z-index: 7;
  display: grid;
  justify-items: center;
  gap: clamp(5px, .8vh, 9px);
  width: min(100%, 420px);
  margin-top: clamp(6px, 1vh, 14px);
}

body[data-page="info-screen"].tec-is-fullscreen .tec-left-stack {
  top: auto;
}

.tec-vu-logo {
  position: static;
  z-index: 6;
  width: clamp(104px, 11vw, 168px);
  max-height: 58px;
  object-fit: contain;
  object-position: center;
}

.tec-monitor-grid {
  display: grid;
  grid-template-columns: minmax(600px, var(--tec-vu-panel-width)) minmax(390px, var(--tec-clock-width));
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 4.2vw, 72px);
  width: min(100%, 1320px);
  min-height: 0;
  margin-top: clamp(0px, 1vh, 10px);
}

.tec-vu-column {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: clamp(10px, 1.4vh, 16px);
  min-width: 0;
}

.tec-main-block {
  position: relative;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: min(41vh, 450px);
  box-sizing: border-box;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  transform: none;
}

.tec-side-stack {
  position: relative;
  z-index: 6;
  display: grid;
  justify-items: center;
  gap: clamp(12px, 2vw, 24px);
  width: var(--tec-side-width);
  flex: 0 0 var(--tec-side-width);
}

.tecstumo-clock {
  --tec-ring-size: min(calc(42vmin * var(--tec-clock-scale)), calc(400px * var(--tec-clock-scale)), calc(var(--tec-clock-width) - 12px));
  --tec-ring-radius: calc(var(--tec-ring-size) * .5);
  position: relative;
  display: grid;
  place-items: center;
  width: var(--tec-clock-width);
  min-height: min(36.5vh, 400px);
  border: 0;
  background: transparent;
  box-shadow: none;
  flex: 0 1 var(--tec-clock-width);
}

.tecstumo-clock::before {
  content: none;
}

.tec-clock-face {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 0;
  width: calc(var(--tec-ring-size) * .64);
  max-width: calc(var(--tec-ring-size) * .64);
  transform: none;
}

.tec-dot-text {
  --tec-dot-size: min(calc(clamp(5px, 1.45vmin, 9px) * var(--tec-clock-scale)), calc(var(--tec-ring-size) / 56));
  --tec-dot-gap: min(calc(clamp(3px, .72vmin, 5px) * var(--tec-clock-scale)), calc(var(--tec-ring-size) / 110));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: min(clamp(8px, 2vmin, 14px), calc(var(--tec-ring-size) / 46));
  max-width: 100%;
}

.tec-dot-seconds {
  display: none;
}

.tec-dot-char {
  display: grid;
  grid-template-columns: repeat(var(--tec-dot-cols), var(--tec-dot-size));
  gap: var(--tec-dot-gap);
}

.tec-dot-char i,
.tec-clock-ring i {
  width: var(--tec-dot-size);
  height: var(--tec-dot-size);
  border-radius: 50%;
  background: rgba(255, 35, 42, .1);
}

.tec-dot-char i.is-on {
  background: #ff202a;
  box-shadow:
    0 0 6px rgba(255, 32, 42, .92),
    0 0 16px rgba(255, 32, 42, .46);
}

.tec-dot-char.is-colon {
  margin-inline: calc(var(--tec-dot-gap) * 1.15);
}

.tec-clock-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--tec-ring-size);
  aspect-ratio: 1;
  z-index: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.tec-clock-ring i {
  --tec-dot-size: calc(clamp(4px, 1.2vmin, 8px) * var(--tec-clock-scale));
  position: absolute;
  left: 50%;
  top: 50%;
  margin-left: calc(var(--tec-dot-size) * -.5);
  margin-top: calc(var(--tec-dot-size) * -.5);
  transform:
    rotate(var(--tec-ring-angle))
    translateY(calc(var(--tec-ring-radius) * -1))
    rotate(calc(var(--tec-ring-angle) * -1));
}

.tec-clock-ring i.is-active {
  background: #ff202a;
  box-shadow:
    0 0 7px rgba(255, 32, 42, .88),
    0 0 16px rgba(255, 32, 42, .45);
}

.tec-clock-ring i.is-current {
  transform:
    rotate(var(--tec-ring-angle))
    translateY(calc(var(--tec-ring-radius) * -1))
    rotate(calc(var(--tec-ring-angle) * -1))
    scale(1.55);
}

.tec-vu-panel {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, .82fr) repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, clamp(126px, 16vh, 178px));
  gap: clamp(10px, 1vw, 14px);
  width: var(--tec-vu-panel-width);
  max-width: calc(100vw - (2 * var(--tec-outer-gap)));
  box-sizing: border-box;
  align-items: stretch;
  transform: none;
}

.tec-vu-panel[hidden] {
  display: none;
}

.tec-vu-meter {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 18px 20px;
  gap: 6px;
  justify-items: center;
  align-self: stretch;
  min-width: 0;
  min-height: 0;
  overflow: visible;
  isolation: isolate;
  color: #d5d7dc;
  font-weight: 1000;
}

.tec-vu-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(34px, 3.8vw, 42px) minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  width: 100%;
  height: auto;
  min-height: 0;
  box-sizing: border-box;
  padding-bottom: 0;
  overflow: visible;
}

.tec-vu-meter:not(.is-large) {
  grid-template-rows: minmax(0, 1fr) 18px 18px;
  gap: 5px;
  overflow: hidden;
}

.tec-vu-meter:not(.is-large) .tec-vu-body {
  grid-template-columns: minmax(18px, 1fr) 44px minmax(18px, 1fr);
  gap: 8px;
  padding-bottom: 0;
  overflow: hidden;
}

.tec-vu-meter[data-meter-slot="0"] {
  grid-column: 1;
  grid-row: 1;
}

.tec-vu-meter[data-meter-slot="1"] {
  grid-column: 2;
  grid-row: 1;
}

.tec-vu-meter[data-meter-slot="2"] {
  grid-column: 1;
  grid-row: 2;
}

.tec-vu-meter[data-meter-slot="3"] {
  grid-column: 2;
  grid-row: 2;
}

.tec-vu-meter[data-meter-slot="4"] {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.tec-vu-meter[data-meter-slot="5"] {
  grid-column: 4;
  grid-row: 1 / span 2;
}

.tec-vu-meter[data-meter-slot="6"] {
  grid-column: 5;
  grid-row: 1 / span 2;
}

.tec-vu-meter.is-large {
  overflow: visible;
  align-self: stretch;
  grid-template-rows: minmax(0, 1fr) 20px 24px;
  gap: 8px;
}

.tec-vu-meter.is-large .tec-vu-body {
  grid-template-columns: minmax(0, 1fr) clamp(40px, 4.4vw, 52px) minmax(0, 1fr);
  gap: 10px;
  height: auto;
  min-height: 0;
  padding-bottom: 0;
}

.tec-vu-channel {
  display: grid;
  grid-template-rows: repeat(12, minmax(0, 1fr));
  gap: 3px;
  min-width: 0;
  overflow: hidden;
}

.tec-vu-channel i {
  display: block;
  min-height: 0;
  border-radius: 1px;
  background: linear-gradient(#060606, #151515);
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, .05);
}

.tec-vu-channel i.is-on.hot {
  background: linear-gradient(#ff331f, #ff1a16);
  box-shadow: 0 0 10px rgba(255, 40, 28, .45);
}

.tec-vu-channel i.is-on.warn {
  background: linear-gradient(#ff331f, #ff1a16);
  box-shadow: 0 0 10px rgba(255, 40, 28, .45);
}

.tec-vu-channel i.is-on.green {
  background: linear-gradient(#ffd55a, #ffc83d 52%, #f5a918);
  box-shadow: 0 0 9px rgba(255, 200, 61, .42);
}

.tec-vu-channel i.is-on.cool {
  background: linear-gradient(#ffd55a, #ffc83d 52%, #f5a918);
  box-shadow: 0 0 9px rgba(255, 200, 61, .42);
}

.tec-vu-scale {
  display: grid;
  grid-column: 2;
  grid-template-rows: repeat(12, minmax(0, 1fr));
  gap: 2px;
  align-items: center;
  justify-items: center;
  position: relative;
  z-index: 2;
  min-width: 0;
  width: 100%;
  border-radius: 2px;
  background: #000;
  color: #d9dce3;
  font-size: clamp(9px, .72vw, 12px);
  line-height: 1;
  text-align: center;
  text-shadow: 0 0 8px rgba(0, 0, 0, .85);
  font-variant-numeric: tabular-nums;
}

.tec-vu-meter:not(.is-large) .tec-vu-scale {
  min-width: 44px;
  width: 44px;
  font-size: 10px;
  box-shadow: 0 0 0 4px #000;
  overflow: hidden;
}

.tec-vu-scale span {
  display: block;
  width: 100%;
  border-radius: 2px;
  padding-inline: 4px;
  background: transparent;
}

.tec-vu-meter:not(.is-large) .tec-vu-scale span {
  padding-inline: 0;
}

.tec-vu-meter.is-large .tec-vu-scale {
  min-width: 0;
  width: 100%;
  grid-template-rows: repeat(12, minmax(5px, 1fr));
  gap: 4px;
  font-size: clamp(12px, .92vw, 16px);
}

.tec-vu-meter.is-large .tec-vu-channel {
  grid-template-rows: repeat(12, minmax(5px, 1fr));
  gap: 4px;
}

.tec-vu-meter.is-large .tec-vu-channel i {
  min-height: 6px;
}

.tec-vu-meter.is-large .tec-vu-status {
  width: auto;
  padding-inline: 11px;
  font-size: 11px;
}

.tec-vu-label {
  position: static;
  z-index: 3;
  align-self: stretch;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  background: #d8d8d8;
  color: #050505;
  margin-top: 0;
  padding: 3px 3px 4px;
  text-align: center;
  font-size: clamp(9px, .85vw, 13px);
  line-height: 1;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tec-vu-status {
  position: static;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 20px;
  border-radius: 999px;
  padding: 4px 7px;
  color: rgba(255, 32, 42, .78);
  font-size: 9px;
  font-weight: 1000;
  line-height: 1;
  text-align: center;
  background: rgba(255, 32, 42, .08);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tec-vu-meter:not(.is-large) .tec-vu-label {
  align-self: stretch;
  margin-top: 0;
  padding: 3px 2px;
  font-size: clamp(8px, .66vw, 10px);
  line-height: 1;
}

.tec-vu-meter:not(.is-large) .tec-vu-status {
  min-height: 17px;
  padding: 2px 3px;
  font-size: clamp(7px, .58vw, 9px);
  letter-spacing: -.02em;
  line-height: 1;
}

.tec-vu-meter:not(.is-large) .tec-vu-status.ok::before {
  display: none;
}

.tec-vu-status.ok {
  color: #88ff89;
  background: rgba(47, 213, 67, .14);
  box-shadow: inset 0 0 0 1px rgba(104, 226, 110, .28), 0 0 12px rgba(104, 226, 110, .12);
}

.tec-vu-status.is-muted {
  color: #fff5f5;
  background: #ff202a;
  box-shadow: inset 0 0 0 1px rgba(255, 126, 132, .72), 0 0 14px rgba(255, 32, 42, .34);
}

.tec-vu-status.ok::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #67ff6a;
  box-shadow: 0 0 8px rgba(103, 255, 106, .8);
}

.tec-vu-start {
  appearance: none;
  border: 1px solid rgba(255, 38, 45, .55);
  border-radius: 999px;
  background: rgba(255, 38, 45, .14);
  color: #ff262d;
  padding: 3px 9px;
  font: inherit;
  font-size: 9px;
  line-height: 1;
  cursor: pointer;
}

.tec-clock-date {
  position: static;
  width: auto;
  margin: 0;
  color: rgba(255, 46, 52, .88);
  font-size: clamp(18px, 2.05vw, 34px);
  font-weight: 900;
  letter-spacing: .02em;
  text-align: center;
  text-transform: lowercase;
  line-height: 1;
  text-shadow:
    0 0 10px rgba(255, 32, 42, .55),
    0 0 28px rgba(255, 32, 42, .28);
  transform: none;
}

.tec-hour-countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 292px);
  min-height: clamp(82px, 8.5vw, 138px);
  box-sizing: border-box;
  border-radius: 8px;
  background: #ff202a;
  padding: clamp(8px, 1vw, 14px) clamp(10px, 1.4vw, 18px);
  box-shadow:
    0 0 0 2px rgba(255, 32, 42, .45),
    0 0 34px rgba(255, 32, 42, .32);
  color: #050000;
}

.tec-hour-countdown-label {
  display: none;
  font-size: clamp(12px, 1.2vw, 18px);
  font-weight: 1000;
  letter-spacing: .16em;
  line-height: 1;
}

.tec-hour-countdown strong {
  display: block;
  width: 100%;
  font-variant-numeric: tabular-nums;
  font-size: clamp(48px, 6.1vw, 94px);
  font-weight: 1000;
  letter-spacing: -.06em;
  line-height: .78;
  text-align: center;
}

.tec-fullscreen-toggle {
  position: fixed;
  left: clamp(86px, 8.5vw, 122px);
  bottom: clamp(10px, 1.8vw, 22px);
  z-index: 20;
  min-width: 46px;
  border: 1px solid rgba(255, 32, 42, .28);
  border-radius: 999px;
  background: rgba(255, 32, 42, .1);
  color: rgba(255, 32, 42, .62);
  padding: 7px 10px;
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: .08em;
  line-height: 1;
  opacity: .42;
  cursor: pointer;
  transition: opacity .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.tec-fullscreen-toggle:hover,
.tec-fullscreen-toggle:focus-visible {
  background: rgba(255, 32, 42, .2);
  color: #ff202a;
  opacity: 1;
  outline: none;
  transform: translateY(-1px);
}

.tec-fullscreen-toggle.is-fullscreen {
  opacity: .3;
}

.tec-source-window-button {
  position: fixed;
  left: clamp(10px, 1.8vw, 22px);
  bottom: clamp(10px, 1.8vw, 22px);
  z-index: 20;
  border: 1px solid rgba(255, 200, 61, .34);
  border-radius: 999px;
  background: rgba(255, 200, 61, .1);
  color: rgba(255, 200, 61, .78);
  padding: 7px 11px;
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: .08em;
  line-height: 1;
  opacity: .58;
  cursor: pointer;
  transition: opacity .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.tec-source-window-button:hover,
.tec-source-window-button:focus-visible {
  background: rgba(255, 200, 61, .18);
  color: #ffc83d;
  opacity: 1;
  outline: none;
  transform: translateY(-1px);
}

body[data-page="tec-vu-source"] {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #000;
  color: #ff262d;
}

.tec-source-screen {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(100% - 32px, 360px);
  box-sizing: border-box;
  border: 1px solid rgba(255, 38, 45, .2);
  border-radius: 10px;
  background: rgba(255, 38, 45, .045);
  padding: 24px 22px;
  text-align: center;
  box-shadow: 0 0 36px rgba(255, 38, 45, .12);
}

.tec-source-screen img {
  width: 150px;
  max-width: 70%;
  height: auto;
  object-fit: contain;
}

.tec-source-screen h1 {
  margin: 0;
  color: #ffc83d;
  font-size: 28px;
  font-weight: 1000;
  line-height: .95;
  text-transform: uppercase;
}

.tec-source-screen p {
  margin: 0;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.35;
}

.tec-source-name {
  display: grid;
  gap: 6px;
  width: 100%;
  color: rgba(255, 200, 61, .9);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tec-source-name input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255, 200, 61, .35);
  border-radius: 8px;
  background: rgba(0, 0, 0, .68);
  color: #ffc83d;
  padding: 9px 10px;
  font: inherit;
  letter-spacing: 0;
  text-align: center;
  text-transform: none;
  outline: none;
}

.tec-source-screen small {
  color: rgba(255, 38, 45, .72);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.tec-source-screen button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: #ffc83d;
  color: #060606;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 1000;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
}

@media (min-width: 981px) and (max-width: 1180px) {
  body[data-page="info-screen"] {
    --tec-outer-gap: clamp(16px, 2.8vw, 30px);
    --tec-vu-panel-width: min(calc(100vw - (2 * var(--tec-outer-gap))), 760px);
    --tec-clock-width: min(44vw, 330px);
  }

  .tecstumo-screen {
    padding-top: clamp(18px, 2.4vh, 30px);
    gap: 8px;
  }

  .tec-header-logo {
    width: clamp(124px, 14vw, 176px);
    max-height: 58px;
  }

  .tec-top-strip {
    width: 100%;
    margin-bottom: 8px;
  }

  .tec-now-playing strong {
    font-size: clamp(24px, 3.4vw, 38px);
  }

  .tec-now-playing span:not(.tec-now-playing-kicker) {
    font-size: clamp(18px, 2.15vw, 26px);
  }

  .tec-left-stack {
    margin-top: 2px;
  }

  .tec-monitor-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: clamp(8px, 1.2vh, 14px);
    width: 100%;
  }

  .tec-vu-panel {
    grid-template-columns: minmax(0, .82fr) minmax(0, .82fr) repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, clamp(112px, 14.5vh, 148px));
    gap: 8px;
    width: var(--tec-vu-panel-width);
    max-width: calc(100vw - (2 * var(--tec-outer-gap)));
  }

  .tec-vu-body {
    grid-template-columns: minmax(0, 1fr) clamp(28px, 4vw, 34px) minmax(0, 1fr);
    gap: 6px;
  }

  .tec-vu-meter.is-large .tec-vu-body {
    grid-template-columns: minmax(0, 1fr) clamp(32px, 4.5vw, 40px) minmax(0, 1fr);
    gap: 7px;
  }

  .tec-vu-scale,
  .tec-vu-meter.is-large .tec-vu-scale {
    min-width: 0;
    width: 100%;
    font-size: clamp(8px, .86vw, 11px);
  }

  .tec-vu-meter.is-large .tec-vu-status {
    font-size: 9px;
    padding-inline: 8px;
  }

  .tec-main-block {
    min-height: min(36vh, 330px);
  }

  .tecstumo-clock {
    --tec-ring-size: min(39vmin, 320px, calc(var(--tec-clock-width) - 10px));
    min-height: min(36vh, 330px);
  }
}

@media (max-width: 980px) {
  body[data-page="info-screen"] {
    --tec-outer-gap: clamp(12px, 3vw, 24px);
    --tec-vu-panel-width: min(100%, 620px);
    --tec-side-width: clamp(112px, 20vw, 162px);
    --tec-clock-width: min(78vw, 330px);
  }

  body[data-page="info-screen"] .topbar {
    padding-block: 6px;
  }

  body[data-page="info-screen"] .brand img {
    width: 48px;
    height: 30px;
  }

  .tecstumo-screen {
    min-height: calc(100dvh - 58px);
    padding: clamp(8px, 1.4vh, 16px) var(--tec-outer-gap) clamp(10px, 1.8vh, 18px);
    gap: clamp(5px, .9vh, 9px);
  }

  .tec-top-strip {
    grid-template-columns: 1fr;
    justify-items: center;
    width: 100%;
    margin-bottom: 2px;
  }

  .tec-now-playing strong {
    font-size: clamp(18px, 4.6vw, 34px);
    line-height: .88;
  }

  .tec-now-playing span:not(.tec-now-playing-kicker) {
    font-size: clamp(15px, 2.8vw, 24px);
  }

  .tec-now-playing-kicker,
  .tec-now-playing small {
    font-size: clamp(8px, 1.3vw, 11px);
  }

  .tec-left-stack {
    width: min(100%, 230px);
    margin-top: 0;
  }

  body[data-page="info-screen"].tec-is-fullscreen .tec-left-stack {
    top: auto;
  }

  .tec-monitor-grid {
    grid-template-columns: 1fr;
    gap: clamp(6px, 1.1vh, 11px);
    width: 100%;
  }

  .tec-main-block {
    width: 100%;
    min-height: min(32vh, 300px);
  }

  .tecstumo-clock {
    --tec-ring-size: min(36vmin, 260px, calc(var(--tec-clock-width) - 18px));
    min-height: min(32vh, 285px);
  }

  .tec-dot-text {
    --tec-dot-size: min(calc(clamp(4px, 1.2vmin, 7px) * var(--tec-clock-scale)), calc(var(--tec-ring-size) / 56));
    --tec-dot-gap: min(calc(clamp(2px, .55vmin, 4px) * var(--tec-clock-scale)), calc(var(--tec-ring-size) / 110));
    gap: min(clamp(6px, 1.4vmin, 10px), calc(var(--tec-ring-size) / 46));
  }

  .tec-vu-panel {
    grid-template-columns: minmax(0, .82fr) minmax(0, .82fr) repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, clamp(112px, 13.8vh, 150px));
    gap: 8px;
    width: min(100%, var(--tec-vu-panel-width));
    max-width: calc(100vw - (2 * var(--tec-outer-gap)));
  }

  .tec-vu-logo {
    display: none;
  }

  .tec-vu-meter:nth-child(n + 3) {
    display: grid;
  }

  .tec-vu-body {
    grid-template-columns: minmax(0, 1fr) clamp(28px, 4.4vw, 34px) minmax(0, 1fr);
    height: auto;
  }

  .tec-vu-meter:not(.is-large) {
    grid-template-rows: minmax(0, 1fr) 18px 18px;
    gap: 5px;
  }

  .tec-vu-meter:not(.is-large) .tec-vu-body {
    grid-template-columns: minmax(18px, 1fr) 44px minmax(18px, 1fr);
    gap: 8px;
    overflow: hidden;
  }

  .tec-vu-meter:not(.is-large) .tec-vu-scale {
    min-width: 44px;
    width: 44px;
    font-size: 10px;
  }

  .tec-vu-meter:not(.is-large) .tec-vu-label {
    padding-block: 3px;
    font-size: 10px;
  }

  .tec-vu-meter:not(.is-large) .tec-vu-status {
    min-height: 18px;
    font-size: clamp(7px, .92vw, 9px);
  }

  .tec-vu-meter.is-large .tec-vu-body {
    grid-template-columns: minmax(0, 1fr) clamp(32px, 4.8vw, 40px) minmax(0, 1fr);
    gap: 7px;
  }

  .tec-vu-meter.is-large .tec-vu-scale {
    min-width: 0;
    width: 100%;
    font-size: clamp(9px, 1.15vw, 12px);
  }

  .tec-hour-countdown {
    width: min(100%, 210px);
    min-height: 76px;
    padding: 7px 10px;
  }

  .tec-hour-countdown strong {
    font-size: clamp(38px, 8.2vw, 58px);
  }

  .tec-clock-date {
    font-size: clamp(15px, 2.8vw, 23px);
  }
}

@media (max-width: 640px) {
  body[data-page="info-screen"] {
    --tec-vu-panel-width: min(100%, 230px);
  }

  .tec-vu-panel {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(2, clamp(132px, 24vh, 190px));
    gap: 6px;
    width: min(100%, var(--tec-vu-panel-width));
  }

  .tec-vu-meter:nth-child(n + 3) {
    display: none;
  }
}

.ris-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.ris-settings-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid #ead69f;
  border-radius: 8px;
  background: #fffaf0;
  padding: 14px;
}

.ris-settings-card h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
}

.ris-settings-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.tecstumo-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tecstumo-clock-settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf0;
  padding: 14px;
}

.tecstumo-clock-settings label {
  margin: 0;
}

.tecstumo-clock-settings output {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  min-height: 34px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 1000;
}

.tecstumo-now-playing-settings {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid #ead69f;
  border-radius: 8px;
  background: #fffaf0;
  padding: 14px;
}

.tecstumo-now-playing-settings .section-head {
  margin-bottom: 0;
}

.tecstumo-meter-settings {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid #ead69f;
  border-radius: 8px;
  background: #fffaf0;
  padding: 14px;
}

.tecstumo-meter-settings-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.tecstumo-meter-settings-head label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.tecstumo-meter-settings-head .eyebrow {
  margin-right: auto;
}

.tecstumo-device-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.tecstumo-device-actions .meta {
  margin: 0;
}

@media (max-width: 760px) {
  .ris-settings-grid,
  .tecstumo-settings-grid {
    grid-template-columns: 1fr;
  }
}

.portal-menu-builder {
  display: grid;
  gap: 10px;
}

.portal-menu-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 104px 112px;
  gap: 10px;
  align-items: end;
  border: 1px solid #efe6d8;
  border-radius: 8px;
  background: #fffdf8;
  padding: 12px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.portal-menu-row label {
  margin: 0;
}

.portal-menu-drag {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px dashed #d7c394;
  border-radius: 8px;
  background: #fff5d8;
  color: #5b3d00;
  cursor: grab;
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
  user-select: none;
}

.portal-menu-drag[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .55;
}

.portal-menu-row.dragging {
  opacity: .68;
  transform: scale(.99);
}

.portal-menu-row.drag-over {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(255, 198, 53, .22);
}

.portal-menu-order input {
  text-align: center;
  font-weight: 900;
}

.portal-menu-visible,
.portal-menu-fixed {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  border: 1px solid #efe6d8;
  border-radius: 8px;
  background: #fff;
  color: #4a3820;
  font-size: 13px;
  font-weight: 900;
}

.portal-menu-visible input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.portal-menu-fixed {
  background: #f2eadc;
  font-size: 12px;
  text-transform: uppercase;
}

@media (max-width: 720px) {
  .portal-menu-row {
    grid-template-columns: 1fr;
  }
}

.hero {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  align-items: center;
  max-width: 1440px;
  margin: 0 auto;
  padding: 34px 18px 14px;
}

.status-panel {
  max-width: 1440px;
  margin: 18px auto 0;
  padding: 16px 18px;
  border: 1px solid var(--accent-dark);
  border-radius: 8px;
  background: var(--soft);
  color: #4a3200;
  font-weight: 800;
}

.hero > div:first-child {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  justify-self: stretch;
  align-self: center;
  width: 100%;
  height: clamp(150px, 18vw, 210px);
  padding: 10px;
  overflow: hidden;
  border-radius: 8px;
  background: #050505;
}

.hero > div:last-child {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.hero img {
  position: absolute;
  inset: 10px;
  display: block;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  transform: scale(1.45);
  transform-origin: center;
}

.hero h1 {
  max-width: 720px;
}

.hero span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 18px;
}

.eyebrow {
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px;
}

.admin-layout {
  display: grid;
  gap: 18px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px;
}

body[data-page="motivations"] .admin-layout {
  max-width: 1560px;
  padding: clamp(8px, 1.5vw, 18px);
}

body[data-page="motivations"] .admin-layout .panel {
  min-height: calc(100vh - 96px);
  padding: clamp(12px, 1.5vw, 18px);
}

.manage-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px;
}

.manage-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  position: sticky;
  top: 76px;
  z-index: 8;
  margin: 0 auto;
  width: 100%;
  max-width: 1180px;
  padding: 10px 0 0;
  background: linear-gradient(to bottom, rgba(248, 245, 238, 0.98), rgba(248, 245, 238, 0.92) 70%, rgba(248, 245, 238, 0));
  backdrop-filter: blur(8px);
}

.manage-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  border-radius: 8px;
  background: #ece7df;
  color: var(--text);
  font-weight: 900;
  padding: 0 12px;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(40, 33, 25, 0.08);
}

.manage-nav a.active {
  background: var(--accent);
}

.list-mode-switcher {
  position: fixed;
  left: 18px;
  top: 50%;
  z-index: 20;
  display: grid;
  gap: 10px;
  width: 208px;
  padding: 12px;
  border: 1px solid rgba(255, 200, 64, 0.24);
  border-radius: 16px;
  background: rgba(255, 250, 241, 0.96);
  box-shadow: 0 18px 34px rgba(40, 33, 25, 0.16);
  backdrop-filter: blur(12px);
  transform: translateY(-50%);
}

.list-mode-switcher button {
  position: relative;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  border: 1px solid rgba(210, 149, 0, 0.18);
  border-radius: 12px;
  background: linear-gradient(180deg, #fffdf7 0%, #f7efe1 100%);
  color: var(--text);
  box-shadow: 0 8px 18px rgba(40, 33, 25, 0.09);
  font-size: 15px;
  line-height: 1.08;
  padding: 10px 12px;
  text-align: left;
  text-transform: uppercase;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.list-mode-switcher button span,
.list-mode-switcher button small {
  display: block;
  margin: 0;
  font-size: inherit;
  line-height: inherit;
  font-weight: 900;
}

.list-mode-switcher button small {
  font-size: 14px;
  opacity: 0.88;
}

.list-mode-switcher button:hover {
  transform: translateX(2px);
  border-color: rgba(210, 149, 0, 0.38);
  box-shadow: 0 12px 22px rgba(40, 33, 25, 0.13);
}

.list-mode-switcher button.active {
  background: linear-gradient(180deg, #ffd96f 0%, var(--accent) 100%);
  border-color: rgba(210, 149, 0, 0.66);
  color: var(--accent-ink);
  box-shadow: 0 14px 26px rgba(255, 200, 64, 0.30);
}

.list-mode-switcher button.active::before {
  content: "";
  width: 8px;
  height: 8px;
  position: absolute;
  right: 12px;
  top: 50%;
  margin-right: 0;
  border-radius: 999px;
  background: #111;
  transform: translateY(-50%);
}

.list-mode-switcher button:not(.active)::before {
  content: "";
  width: 8px;
  height: 8px;
  position: absolute;
  right: 12px;
  top: 50%;
  margin-right: 0;
  border-radius: 999px;
  background: rgba(98, 93, 84, 0.34);
  transform: translateY(-50%);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top, rgba(255, 200, 64, 0.16), transparent 34rem),
    #050505;
}

.login-card {
  width: min(460px, 100%);
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid rgba(255, 200, 64, 0.32);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
}

.login-card > img {
  width: min(240px, 100%);
  justify-self: center;
  border-radius: 6px;
  background: #000;
}

.login-form {
  display: grid;
  gap: 12px;
}

.login-form label {
  display: grid;
  gap: 7px;
  font-weight: 900;
  color: var(--text);
}

.login-form input {
  min-height: 44px;
  border: 1px solid #d8cfbf;
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
}

.login-form button {
  min-height: 46px;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: #b42318;
  font-weight: 800;
}

.login-back {
  color: var(--text);
  font-weight: 900;
  text-align: center;
}

.reset-panel {
  border: 1px solid #efe6d8;
  border-radius: 8px;
  background: #fffdf8;
  padding: 10px 12px;
}

.reset-panel summary {
  cursor: pointer;
  font-weight: 900;
}

.reset-panel form {
  margin-top: 12px;
}

.accounts-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 12px;
  margin-top: 12px;
}

.accounts-layout.full {
  align-items: start;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr);
}

.account-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.account-card-primary {
  border-color: rgba(255, 200, 64, 0.42);
  background: #fffaf0;
}

.account-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin: 12px 0 4px;
}

.account-summary div {
  display: grid;
  gap: 3px;
  border: 1px solid #ead69f;
  border-radius: 8px;
  background: #fff8df;
  padding: 9px 11px;
}

.account-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.account-summary strong {
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}

.account-create-details {
  display: grid;
  min-width: 0;
}

.account-create-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  cursor: pointer;
  list-style: none;
}

.account-create-details summary::-webkit-details-marker {
  display: none;
}

.account-create-details summary::after {
  content: "Open";
  flex: 0 0 auto;
  border: 1px solid #d9c283;
  border-radius: 999px;
  background: var(--accent);
  color: #201600;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.account-create-details[open] summary {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ead69f;
}

.account-create-details[open] summary::after {
  content: "Sluit";
  background: #fff;
}

.account-create-details summary > span {
  display: grid;
  gap: 2px;
}

.account-create-details summary strong {
  font-size: 18px;
}

.account-create-details summary small {
  color: var(--muted);
  font-weight: 800;
}

.account-create-details .manage-form {
  gap: 12px;
}

.account-list-head {
  display: grid;
  gap: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid #efe6d8;
}

.account-list-head h2 {
  margin: 0;
}

.accounts-list {
  display: grid;
  gap: 8px;
}

.account-row {
  display: grid;
  gap: 8px;
  border: 1px solid #efe6d8;
  border-radius: 8px;
  background: #fffdf8;
  padding: 9px;
}

.account-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.account-row-head strong {
  display: block;
  overflow-wrap: anywhere;
}

.account-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.account-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 24px;
  border-radius: 999px;
  background: #f2eadc;
  color: #4a3820;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.account-badge.owner {
  background: var(--accent);
  color: #1e1600;
}

.account-edit-details,
.permission-details {
  border: 1px solid #f0e4d2;
  border-radius: 8px;
  background: #fff;
  padding: 0;
  overflow: hidden;
}

.account-edit-details summary,
.permission-details summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  font-weight: 900;
  list-style: none;
}

.account-edit-details summary::-webkit-details-marker,
.permission-details summary::-webkit-details-marker {
  display: none;
}

.account-edit-details summary::after,
.permission-details summary::after {
  content: "Open";
  border-radius: 999px;
  background: #f2eadc;
  color: #4a3820;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.account-edit-details[open],
.permission-details[open] {
  padding-bottom: 10px;
}

.account-edit-details[open] summary,
.permission-details[open] summary {
  border-bottom: 1px solid #f0e4d2;
  margin-bottom: 10px;
}

.account-edit-details[open] summary::after,
.permission-details[open] summary::after {
  content: "Sluit";
  background: var(--accent);
  color: #1e1600;
}

.account-edit-details > :not(summary),
.permission-details > :not(summary) {
  margin-left: 10px;
  margin-right: 10px;
}

.account-row-actions {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.account-form-actions {
  display: flex;
  justify-content: flex-end;
}

.account-edit-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  margin: 0;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 7px;
}

.permission-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid #efe6d8;
  border-radius: 8px;
  background: #fff;
  padding: 7px 9px;
  font-weight: 800;
}

.compact-permission-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 165px), 1fr));
}

.compact-permission-grid label {
  min-height: 32px;
  font-size: 13px;
}

.permission-grid input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.permission-grid span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.permission-matrix {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
}

.permission-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(92px, auto) minmax(92px, auto);
  align-items: center;
  gap: 7px;
  border: 1px solid #efe6d8;
  border-radius: 8px;
  background: #fff;
  padding: 7px 9px;
}

.permission-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.permission-grid .permission-choice,
.permission-choice {
  min-height: 28px;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 13px;
  font-weight: 900;
}

.permission-choice.unavailable {
  opacity: 0.35;
}

.readonly {
  opacity: 0.72;
}

@media (max-width: 640px) {
  .accounts-layout.full {
    grid-template-columns: 1fr;
  }

  .account-row-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-badges {
    justify-content: flex-start;
  }

  .permission-row {
    grid-template-columns: 1fr 1fr;
  }

  .permission-row strong {
    grid-column: 1 / -1;
  }
}

.stats-layout {
  max-width: 1460px;
  margin: 0 auto;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.stats-layout > .panel {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.stats-layout > .panel .section-head {
  align-items: start;
  margin-bottom: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid #efe6d8;
}

.search-panel,
.ballot-panel,
.admin-layout .panel,
.manage-layout .panel {
  padding: 18px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 16px;
}

.section-head.compact {
  align-items: center;
}

.ballot-counter {
  min-width: 180px;
  display: grid;
  gap: 6px;
  justify-items: end;
  text-align: right;
}

.ballot-counter-top {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  line-height: 1;
}

.ballot-counter-top strong {
  font-size: 32px;
  color: var(--accent);
}

.ballot-counter-total {
  font-size: 18px;
  font-weight: 900;
  color: var(--text-soft);
}

.ballot-progress {
  width: min(220px, 100%);
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #efe3cd;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

.ballot-progress span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffd05a 0%, #f0a710 100%);
  transition: width 0.18s ease;
}

.ballot-counter-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-soft);
}

.ballot-bonus-label {
  font-size: 12px;
  font-weight: 900;
  color: #8b6200;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.03;
}

h2 {
  font-size: 22px;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 14px;
}

.jump-link {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(80, 20, 12, 0.22);
  background: #b7281c;
  color: #fff;
  font-weight: 900;
  padding: 0 14px;
  text-decoration: none;
}

.jump-link:hover {
  background: #8f1d14;
}

.back-top-link {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(22, 114, 59, 0.22);
  background: #16723b;
  color: #fff;
  font-weight: 900;
  padding: 0 14px;
  text-decoration: none;
}

.back-top-link:hover {
  background: #10572d;
}

.results,
.ranking {
  display: grid;
  gap: 8px;
}

.schedule-controls-panel {
  display: grid;
  gap: 12px;
}

.schedule-toolbar {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(220px, 320px);
  gap: 14px;
  align-items: end;
}

.schedule-view-toggle {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.schedule-view-toggle button {
  min-width: 0;
  background: #efe7dc;
  color: var(--muted);
}

.schedule-view-toggle button.active {
  background: var(--accent);
  color: #fff;
}

.schedule-end-field {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}

.schedule-end-field input {
  width: 100%;
}

.schedule-jumpbar {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(220px, 1fr) repeat(3, max-content);
  gap: 10px;
  align-items: end;
  border: 1px solid rgba(255, 200, 64, 0.34);
  border-radius: 8px;
  background: #fff8e8;
  padding: 10px;
}

.schedule-jumpbar label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.schedule-jumpbar input,
.schedule-jumpbar select {
  width: 100%;
}

.schedule-blocks {
  display: grid;
  gap: 12px;
}

.schedule-block {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 14px;
  scroll-margin-top: 96px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.schedule-block-highlight {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(255, 200, 64, 0.26);
}

.schedule-block-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 4px;
  border-radius: 8px;
  background: #fff5d8;
  border: 1px solid rgba(255, 200, 64, 0.45);
  padding: 10px 12px;
}

.schedule-block-head h2 {
  margin: 0;
  font-size: 18px;
  text-transform: none;
}

.schedule-block-head .meta strong {
  color: var(--text);
}

.schedule-talk-time {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  border-radius: 999px;
  background: #e5f8ec;
  color: #167142;
  font-size: 16px;
  font-weight: 950;
  padding: 6px 10px;
  white-space: nowrap;
}

.schedule-track-list {
  display: grid;
  gap: 8px;
}

.schedule-track-row {
  display: grid;
  grid-template-columns: 56px 44px minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf3;
  padding: 10px;
}

.schedule-track-row .rank-number {
  align-self: start;
}

.schedule-cover-slot {
  width: 44px;
  height: 44px;
}

.schedule-cover-slot .cover {
  width: 44px;
  height: 44px;
}

.schedule-badges {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 88px;
}

.schedule-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0;
  white-space: nowrap;
}

.schedule-badges .badge.database {
  margin-left: 0;
}

.movement-badge.up {
  background: #dff5e5;
  color: #136b2f;
}

.movement-badge.down {
  background: #ffe1dc;
  color: #b7281c;
}

.movement-badge.same {
  background: #fff1c3;
  color: #8b6200;
}

.movement-badge.new {
  background: #e8edf3;
  color: #51606f;
}

.schedule-duration {
  justify-self: end;
  min-width: 52px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.schedule-info-link {
  justify-self: end;
  min-height: 34px;
}

@media (max-width: 840px) {
  .schedule-toolbar {
    grid-template-columns: 1fr;
  }

  .schedule-view-toggle {
    width: 100%;
  }

  .schedule-jumpbar {
    grid-template-columns: 1fr;
  }

  .schedule-track-row {
    grid-template-columns: 1fr;
  }

  .schedule-badges {
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    min-width: 0;
  }

  .schedule-duration {
    justify-self: start;
    text-align: left;
  }

  .schedule-info-link {
    justify-self: end;
  }

  .schedule-badges {
    margin-bottom: 2px;
  }
}

.track,
.rank-row,
.ballot li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.rank-row {
  grid-template-columns: 44px 44px minmax(190px, 1.25fr) minmax(190px, 0.8fr) minmax(112px, auto);
}

.rank-row > * {
  min-width: 0;
}

.rank-row .meta {
  min-width: 0;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.rank-actions {
  display: grid;
  grid-template-columns: minmax(88px, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.track-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.preview-button.playing {
  background: #16723b;
  color: #fff;
}

.near-miss-panel {
  border-color: #d64b3a;
  background: #fff7f5;
}

.near-miss-panel .section-head h1,
.near-miss-row .rank-number {
  color: #b7281c;
}

.near-miss-row {
  border-color: #e7a099;
  background: #fff1ef;
}

.near-miss-row .cover {
  background: linear-gradient(135deg, #4a0e09, #ffc840);
}

.near-miss-row .info-link {
  background: #b7281c;
  color: #fff;
}

.no-covers .track,
.no-covers .rank-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.no-covers .cover {
  display: none;
}

.cover {
  width: 44px;
  height: 44px;
  border-radius: 7px;
  object-fit: cover;
  background: linear-gradient(135deg, #111, #ffc840);
  color: #111;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
}

.track-title,
.rank-title {
  min-width: 0;
}

.track-title strong,
.rank-title strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.track-title span,
.rank-title span,
.meta {
  color: var(--muted);
  font-size: 13px;
}

.rank-title .rank-artist-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.rank-title .rank-artist-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  background: #eee9e2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0 8px;
  margin-left: 6px;
}

.badge.warn {
  background: var(--soft);
  color: #6b4a00;
}

.badge.database {
  display: inline-flex;
  width: fit-content;
  max-width: max-content;
  flex: 0 0 auto;
  justify-self: end;
  background: #dff5e5;
  color: #136b2f;
  min-height: 15px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  padding: 1px 6px;
  margin-left: 4px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0;
}

.movement-cell {
  display: grid;
  place-items: center;
  min-width: 88px;
  border-radius: 8px;
  font-weight: 900;
  padding: 6px 7px;
  text-align: center;
  width: 100%;
}

.movement-cell span {
  color: inherit;
  font-size: 8px;
  line-height: 1;
  opacity: 0.78;
}

.movement-cell strong {
  font-size: 15px;
  line-height: 1;
}

.movement-cell.up {
  background: #dff5e8;
  color: #16723b;
}

.movement-cell.down {
  background: #ffe1dc;
  color: #b7281c;
}

.movement-cell.same {
  background: #fff1c3;
  color: #8b6200;
}

.movement-cell.new {
  background: #e8edf3;
  color: #51606f;
}

.ballot-panel {
  position: sticky;
  top: 84px;
  align-self: start;
  max-height: calc(100vh - 102px);
  overflow: auto;
}

.custom-entry {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.custom-entry button,
.custom-entry small {
  grid-column: 1 / -1;
}

.custom-suggestion {
  display: grid;
  gap: 12px;
  border: 1px solid var(--accent-dark);
  border-radius: 8px;
  background: #fffaf0;
  padding: 14px;
}

.custom-suggestion > button {
  justify-self: start;
}

.suggestion-box {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.suggestion-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ballot {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding-left: 0;
  list-style-position: inside;
}

.ballot li {
  grid-template-columns: 28px minmax(0, 1fr) auto;
}

.ballot-content {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.ballot-track-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.bonus-toggle {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid #e4d6b2;
  background: #fff8e4;
  color: #8b6200;
  font-size: 12px;
  font-weight: 900;
}

.bonus-toggle.active {
  background: #f4c142;
  border-color: #d8a300;
  color: #2a1a00;
}

.motivation-input {
  min-height: 58px;
  font-size: 13px;
}

.info-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 8px;
  background: #ece7df;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  padding: 0 10px;
  text-decoration: none;
  white-space: nowrap;
}

.position {
  color: var(--accent);
  font-weight: 900;
  text-align: right;
}

.move-buttons {
  display: flex;
  gap: 2px;
}

.details {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.survey-section {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  margin-top: 16px;
  padding-top: 16px;
}

.survey-section summary {
  cursor: pointer;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
}

.survey-section form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.optional-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.required-star {
  color: #c71919;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff8df;
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
  margin: 2px 0 10px;
  padding: 8px 10px;
  box-sizing: border-box;
}

.checkbox-line input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.confirmation-panel {
  display: grid;
  gap: 8px;
  border: 1px solid var(--accent-dark);
  border-radius: 8px;
  background: #fffaf0;
  color: #4a3200;
  padding: 16px;
}

.confirmation-panel strong {
  font-size: 20px;
}

.confirmation-panel[hidden] {
  display: none;
}

.thanks-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--text);
  padding: 24px;
  text-align: center;
}

.thanks-screen strong {
  font-size: clamp(32px, 6vw, 64px);
}

.survey-builder {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.survey-question-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.survey-question-card.dragging {
  opacity: 0.72;
  transform: scale(0.99);
}

.survey-question-card.drag-over {
  border-color: var(--accent-dark);
  box-shadow: 0 0 0 3px rgba(255, 199, 64, 0.28);
}

.survey-question-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.survey-question-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.drag-handle {
  display: inline-flex;
  align-items: center;
  border: 1px solid #f0cf71;
  border-radius: 8px;
  min-height: 0;
  background: #fff4cf;
  color: var(--accent-dark);
  cursor: grab;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  padding: 6px 9px;
  user-select: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.survey-question-fields {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 1fr);
  gap: 8px;
  align-items: start;
}

.survey-question-fields label {
  min-width: 0;
}

.survey-question-main-fields {
  display: grid;
  gap: 8px;
}

.survey-question-fields textarea {
  min-height: 172px;
  resize: vertical;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}

.manage-form {
  display: grid;
  gap: 12px;
}

.settings-stack {
  display: grid;
  gap: 14px;
}

.settings-block {
  display: grid;
  gap: 12px;
  border: 1px solid #efe6d8;
  border-radius: 8px;
  background: #fffdf8;
  padding: 0;
  overflow: hidden;
}

.settings-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  cursor: pointer;
  padding: 14px;
}

.settings-block-head::-webkit-details-marker {
  display: none;
}

.settings-block-head::after {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255, 200, 64, 0.45);
  background: #fff5d8;
  color: #7b5a00;
  font-size: 20px;
  font-weight: 900;
  flex: 0 0 auto;
}

.settings-block[open] .settings-block-head::after {
  content: "−";
}

.settings-block-head h2 {
  font-size: 19px;
}

.settings-block-head p {
  margin: 0;
}

.settings-block-head > div {
  display: grid;
  gap: 4px;
}

.settings-block-body {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
  border-top: 1px solid #f3eadc;
}

.settings-block .grid {
  margin: 0;
}

.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.options-grid label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 14px;
}

.upload-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #fffdf8 100%);
  padding: 16px;
}

.upload-card h2 {
  margin-bottom: 4px;
}

.general-upload-card {
  margin-top: 14px;
  border-color: #ead69f;
  background: #fffaf0;
}

.upload-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.upload-actions button {
  width: 100%;
}

.general-upload-card .upload-actions {
  grid-template-columns: minmax(0, 260px);
}

.compact-options {
  grid-template-columns: 1fr;
  margin: 0;
}

.upload-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #efe6d8;
  border-radius: 8px;
  background: #fff8df;
  color: #4a3200;
  font-weight: 800;
  line-height: 1.35;
  padding: 10px;
}

.upload-summary.has-upload {
  border-color: #cfe9d7;
  background: #f0fbf3;
  color: #173f24;
}

.source-files-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.extra-upload-list {
  display: grid;
  gap: 8px;
}

.extra-upload-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  box-shadow: 0 6px 16px rgba(40, 33, 25, 0.05);
}

.extra-upload-info {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.extra-upload-info strong {
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.extra-upload-info small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.extra-upload-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  align-items: stretch;
}

.extra-upload-row label {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid #efe6d8;
  border-radius: 8px;
  background: #fffaf0;
  color: var(--text);
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.extra-upload-row input[type="checkbox"] {
  width: 16px;
  min-width: 16px;
  height: 16px;
  min-height: 16px;
  flex: 0 0 16px;
  margin: 0;
  padding: 0;
}

.extra-upload-row input[type="number"] {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 0 8px;
}

.extra-upload-bonus {
  display: grid !important;
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
  align-items: center;
  white-space: normal;
}

.extra-upload-row button {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  font-size: 12px;
}

.source-files-list {
  display: grid;
  gap: 8px;
}

.source-file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 6px 16px rgba(40, 33, 25, 0.05);
}

.source-file-row-primary {
  border-color: rgba(244, 193, 66, 0.65);
  background: linear-gradient(180deg, #fffaf0 0%, #fff 100%);
  box-shadow: 0 10px 24px rgba(122, 86, 0, 0.12);
}

.source-file-row.is-missing {
  background: #f7f2ea;
  color: var(--muted);
}

.source-file-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.source-file-body strong,
.source-file-body p,
.source-file-body small {
  overflow-wrap: anywhere;
}

.source-file-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.source-file-priority {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f4c142;
  color: #2a1a00;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.source-file-status {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  background: #fff1c3;
  color: #4a3200;
  font-weight: 900;
  padding: 5px 9px;
}

.source-file-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, auto));
  gap: 8px;
}

.source-file-label-control {
  display: grid;
  gap: 4px;
  grid-column: 1 / -1;
  min-width: 0;
}

.source-file-label-control span {
  font-size: 11px;
  font-weight: 900;
  color: var(--muted);
  text-transform: uppercase;
}

.source-file-label-control input {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}

.source-file-actions .button,
.source-file-actions button {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  font-size: 13px;
}

.source-editor-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fffdf8;
  padding: 14px;
}

.source-editor-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.source-editor-list {
  display: grid;
  gap: 8px;
  max-height: 68vh;
  overflow: auto;
  padding-right: 4px;
}

.source-editor-row {
  display: grid;
  grid-template-columns: 72px minmax(180px, 1fr) minmax(180px, 1fr) 90px minmax(120px, 0.8fr) 92px auto;
  gap: 8px;
  align-items: end;
  border: 1px solid #efe6d8;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.source-editor-row label {
  display: grid;
  gap: 4px;
  min-width: 0;
  font-size: 11px;
  font-weight: 900;
  color: var(--muted);
  text-transform: uppercase;
}

.source-editor-row input {
  min-width: 0;
  min-height: 34px;
  padding: 0 10px;
}

.source-editor-row .danger {
  min-height: 34px;
  align-self: end;
}

.source-editor-empty {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
}

.upload-summary span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.upload-summary strong,
.upload-summary small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.upload-remove {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  min-height: 24px;
  flex: 0 0 auto;
  border-radius: 6px;
  padding: 0;
  font-size: 17px;
  line-height: 1;
}

.options-grid input {
  width: auto;
  min-height: auto;
}

.image-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 12px;
}

.image-preview img {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050505;
  padding: 12px;
}

.fraud-summary {
  margin-bottom: 14px;
}

.fraud-tools {
  display: grid;
  gap: 12px;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.submission-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.submission-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.submission-select {
  align-content: start;
  display: flex;
  gap: 8px;
  min-width: 104px;
  color: var(--text);
}

.submission-select input {
  width: auto;
  min-height: auto;
  margin-top: 3px;
}

.submission-card.suspicious {
  border-color: var(--accent-dark);
  background: #fffaf0;
}

.submission-card.disabled {
  opacity: 0.62;
}

.stats-panel {
  display: grid;
  gap: 12px;
  margin: 16px 0 4px;
}

.motivation-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: clamp(10px, 1.4vw, 18px);
  align-items: start;
}

.motivation-header {
  display: flex;
  gap: 14px;
  align-items: center;
  min-width: 0;
}

.motivation-header .cover {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  flex: 0 0 auto;
  font-size: 16px;
}

.motivation-header h1 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}

.motivation-rank {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 950;
  padding: 0 12px;
  white-space: nowrap;
}

.motivation-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: -6px 0 16px;
}

.pager-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px;
  text-decoration: none;
}

.pager-card:not(.disabled):hover,
.artist-nav-card:not(.disabled):hover {
  border-color: var(--accent-dark);
  background: #fffaf0;
}

.pager-card.disabled,
.artist-nav-card.disabled {
  opacity: 0.5;
}

.pager-label {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.pager-body {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.pager-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.pager-text small,
.pager-text span {
  color: var(--muted);
  font-size: 12px;
}

.pager-text strong {
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

#motivationTitle {
  text-transform: uppercase;
}

.motivation-source-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
}

.motivation-source-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(244, 193, 66, 0.18);
  border: 1px solid rgba(244, 193, 66, 0.35);
  color: #7a5600;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
}

.artist-track-stats-section {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.artist-track-stats {
  display: grid;
  gap: 12px;
}

.artist-track-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.artist-track-count-button {
  align-items: start;
  justify-items: start;
  min-height: auto;
  text-align: left;
}

.artist-track-count-button:hover {
  background: #fff4cf;
}

.artist-full-track-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}

.artist-full-track-list[hidden] {
  display: none;
}

.artist-nav-card {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px;
  text-decoration: none;
}

.motivation-page-grid h2 {
  margin: 0 0 10px;
}

.motivation-column {
  position: sticky;
  top: 94px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  max-height: calc(100vh - 104px);
  min-height: 0;
  border-left: 1px solid var(--line);
  padding-left: 12px;
}

.motivation-list-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.motivation-column .submission-list {
  grid-template-columns: 1fr;
  gap: 8px;
  height: clamp(340px, calc(100vh - 188px), 760px);
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

.motivation-entry {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(40, 33, 25, 0.06);
}

.motivation-entry strong {
  display: block;
  margin-bottom: 4px;
}

.motivation-name-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
}

.motivation-name-line > strong {
  margin: 0;
}

.motivation-call-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  min-height: 24px;
  border: 1px solid #98d7a5;
  border-radius: 999px;
  background: #eaffee;
  color: #0b5c22;
  padding: 0;
}

.motivation-call-badge svg {
  display: block;
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.motivation-person-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid #f0cf71;
  border-radius: 999px;
  background: #fff4cf;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  padding: 4px 8px;
}

.motivation-person {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 7px 0 2px;
}

.motivation-person span {
  display: grid;
  gap: 2px;
  min-width: 106px;
  border: 1px solid #f0cf71;
  border-radius: 8px;
  background: #fff4cf;
  padding: 6px 8px;
}

.motivation-person small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.motivation-person strong {
  margin: 0;
  color: var(--text);
  font-size: 15px;
}

.motivation-text {
  margin: 8px 0 0;
  border-radius: 8px;
  background: #fff8df;
  color: var(--text);
  font-size: 16px;
  font-weight: 750;
  line-height: 1.38;
  padding: 10px 12px;
}

.motivation-text.empty {
  background: #f7f3ea;
  color: var(--muted);
  font-style: italic;
  font-weight: 750;
}

.motivation-survey {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.motivation-survey summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  list-style: none;
  padding: 6px 8px;
}

.motivation-survey summary::-webkit-details-marker {
  display: none;
}

.motivation-survey summary::before {
  content: ">";
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff4cf;
  color: var(--accent-dark);
  font-size: 12px;
  line-height: 1;
  transition: transform 0.15s ease;
}

.motivation-survey[open] summary::before {
  transform: rotate(90deg);
}

.motivation-phone-slot:empty {
  display: none;
}

.motivation-phone {
  display: grid;
  gap: 2px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid #b7e2bf;
  background: #eaffee;
  color: #14652a;
  padding: 9px 10px;
}

.motivation-phone span {
  font-size: 12px;
  font-weight: 900;
}

.motivation-phone strong {
  color: #0b5c22;
  font-size: 17px;
  font-weight: 950;
  letter-spacing: 0.02em;
}

.motivation-survey.empty summary {
  color: var(--muted);
  cursor: default;
}

.motivation-survey dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}

.motivation-survey dt,
.motivation-survey dd {
  margin: 0;
  padding: 7px 10px;
}

.motivation-survey dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  padding-bottom: 2px;
}

.motivation-survey dd {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  padding-top: 0;
}

.motivation-survey dd:not(:last-child) {
  border-bottom: 1px solid #f4ead5;
  padding-bottom: 8px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 8px;
}

.stats-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 8px;
  margin-top: 10px;
}

.stats-layout .stats-grid,
.stats-layout .stats-overview-grid,
.stats-layout .cover-stats-grid {
  align-items: stretch;
}

.stats-layout .stats-grid > *,
.stats-layout .stats-overview-grid > *,
.stats-layout .cover-stats-grid > * {
  min-height: 100%;
}

#generalStatsSummary {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

#listStatsSummary {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
}

.cover-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 8px;
  margin-top: 10px;
}

.cover-stat-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  height: 100%;
}

.cover-stat-card h2 {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.cover-version-list {
  display: grid;
  gap: 6px;
}

.cover-version-list a {
  display: block;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  border-radius: 6px;
  background: #fffaf0;
  color: var(--text);
  font-weight: 800;
  padding: 7px 8px;
  text-decoration: none;
  white-space: normal;
}

.cover-version-list a:hover {
  background: var(--soft);
}

.artist-stats-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.artist-list,
.artist-track-list {
  display: grid;
  gap: 8px;
}

.artist-list {
  align-content: start;
  padding: 0;
  max-height: min(660px, calc(100vh - 240px));
  overflow: auto;
  scrollbar-gutter: stable;
}

.artist-track-list {
  max-height: min(620px, calc(100vh - 210px));
  overflow: auto;
  padding-right: 4px;
}

.artist-stat-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) minmax(50px, auto);
  gap: 8px;
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  text-align: left;
}

.artist-stat-row span {
  color: var(--accent-dark);
  font-weight: 950;
}

.artist-stat-row small {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.artist-stat-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artist-stat-row.active {
  border-color: var(--accent-dark);
  background: #fff4cf;
}

.artist-detail {
  position: sticky;
  top: 94px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  min-width: 0;
  overflow: hidden;
  max-height: calc(100vh - 112px);
  align-self: start;
  box-shadow: 0 10px 24px rgba(40, 33, 25, 0.06);
}

.artist-detail h2 {
  overflow-wrap: anywhere;
}

.artist-track-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 8px;
  text-decoration: none;
}

.artist-track-row:hover {
  border-color: var(--accent-dark);
  background: #fffaf0;
}

.artist-track-row span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.artist-track-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.artist-track-row small {
  color: var(--muted);
  font-size: 12px;
}

.stat-card,
.fact-box,
.insight-list {
  display: grid;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  height: 100%;
  align-content: start;
}

.stat-card strong {
  font-size: 22px;
  overflow-wrap: anywhere;
  line-height: 1.05;
}

.movement-stat-card.up {
  border-color: #7bc99b;
  background: #dff5e8;
}

.movement-stat-card.up strong {
  color: #16723b;
}

.movement-stat-card.down {
  border-color: #e7a099;
  background: #ffe1dc;
}

.movement-stat-card.down strong {
  color: #b7281c;
}

.movement-stat-card.same strong {
  color: #8b6200;
}

.movement-stat-card.same {
  border-color: #e4c565;
  background: #fff1c3;
}

.stat-card span,
.stat-card small {
  color: var(--muted);
  font-size: 13px;
}

.fact-box {
  background: #fffaf0;
  border-color: var(--accent-dark);
  text-transform: none;
}

.insight-list.chart-card {
  align-content: start;
}

.fact-box ul,
.insight-list ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
}

.bar-chart {
  display: grid;
  gap: 3px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  grid-template-rows: auto auto;
  gap: 0 8px;
  align-items: end;
  font-size: 13px;
  min-width: 0;
}

.bar-row > span:first-child {
  grid-column: 1 / -1;
  grid-row: 1;
  overflow-wrap: anywhere;
  line-height: 1;
  min-width: 0;
  margin-bottom: -4px;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.bar-wrap {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #eee9e2;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.bar-row strong {
  grid-column: 2;
  grid-row: 2;
  align-self: end;
  font-size: 12px;
  white-space: nowrap;
  justify-self: end;
  text-align: right;
}

.insight-list h2,
.fact-box h2 {
  font-size: 18px;
  overflow-wrap: anywhere;
}

.stats-layout .section-head p,
.stats-layout .meta {
  max-width: 70ch;
}

body[data-page="stats"] .stats-layout .search-row {
  max-width: 560px;
  margin-bottom: 4px;
}

body[data-page="stats"] .stats-layout .artist-detail .meta,
body[data-page="stats"] .stats-layout .artist-track-row small {
  max-width: none;
}

.submission-card details {
  grid-column: 1 / -1;
}

.submission-actions {
  display: flex;
  gap: 8px;
  align-items: start;
  flex-wrap: wrap;
}

.upload-submit-bar {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}

.upload-submit-bar button {
  min-width: 220px;
}

button.danger {
  background: #2a2520;
  color: #fff;
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-weight: 700;
}

.submit {
  width: 100%;
}

.message {
  min-height: 24px;
  margin-top: 10px;
  color: #6b4a00;
  font-weight: 700;
}

.message.ok {
  color: #1f7a45;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: center;
}

.summary div {
  display: grid;
  gap: 2px;
}

.summary strong {
  font-size: 30px;
}

.summary-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.summary-actions button {
  min-width: 190px;
}

.rank-number {
  font-size: 18px;
  color: var(--accent);
  font-weight: 900;
  text-align: right;
}

@media (max-width: 920px) {
  .list-mode-switcher {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: auto;
    margin: 12px 18px 0;
    padding: 10px;
    transform: none;
  }

  .list-mode-switcher button {
    text-align: center;
    justify-content: center;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .section-head.compact {
    align-items: start;
    flex-direction: column;
  }

  .ballot-counter {
    width: 100%;
    justify-items: start;
    text-align: left;
  }

  .ballot-progress {
    width: 100%;
  }

  .source-file-row {
    grid-template-columns: 1fr;
  }

  .source-file-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .source-editor-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .extra-upload-row {
    grid-template-columns: 1fr;
  }

  .extra-upload-row label {
    white-space: normal;
  }

  .upload-submit-bar {
    justify-content: stretch;
  }

  .upload-submit-bar button {
    min-width: 0;
    width: 100%;
  }

  .motivation-page-grid {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  }

  .motivation-column {
    order: 0;
    position: sticky;
  }

  .ballot-panel {
    position: static;
    max-height: none;
  }

  .rank-row {
    grid-template-columns: 34px 40px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
  }

  .rank-row .cover {
    width: 40px;
    height: 40px;
  }

  .rank-row .rank-title {
    grid-column: 3;
  }

  .rank-row .meta,
  .rank-row .rank-actions {
    grid-column: 3;
  }

  .rank-row .meta {
    font-size: 12px;
    line-height: 1.35;
  }

  .rank-row .rank-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
  }

  .rank-row .movement-cell {
    width: auto;
    min-width: 88px;
  }
}

@media (max-width: 640px) {
  .topbar,
  .hero,
  .section-head,
  .summary {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .hero > div:first-child {
    min-height: 132px;
    grid-column: auto;
    grid-row: auto;
  }

  .hero > div:last-child {
    grid-column: auto;
    grid-row: auto;
  }

  .layout,
  .admin-layout {
    padding: 10px;
  }

  .motivation-page-grid,
  .artist-stats-layout,
  .submission-card {
    grid-template-columns: 1fr;
  }

  .motivation-column {
    position: static;
    max-height: none;
    border-left: 0;
    padding-left: 0;
  }

  .motivation-column .submission-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .artist-detail {
    position: static;
  }

  .artist-list {
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  .grid,
  .custom-entry {
    grid-template-columns: 1fr;
  }

  .source-editor-row {
    grid-template-columns: 1fr;
  }

  .track {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .track-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .rank-row {
    grid-template-columns: 34px 40px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
  }

  .rank-row .cover {
    width: 40px;
    height: 40px;
  }

  .rank-row .rank-title {
    grid-column: 3;
  }

  .track button,
  .rank-row .meta,
  .rank-row .rank-actions {
    grid-column: 3;
  }

  .rank-row .meta {
    font-size: 12px;
    line-height: 1.35;
  }

  .rank-row .rank-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-start;
  }

  .rank-row .movement-cell strong {
    font-size: 14px;
  }

  .motivation-header {
    align-items: flex-start;
  }

  .motivation-header .cover {
    width: 56px;
    height: 56px;
  }

  .motivation-pager {
    grid-template-columns: 1fr;
  }

  .artist-track-nav {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .survey-question-fields {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 560px) and (max-width: 700px) {
  body[data-page="motivations"] .motivation-page-grid {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 280px);
  }

  body[data-page="motivations"] .motivation-column {
    position: sticky;
    top: 84px;
    max-height: calc(100vh - 96px);
    border-left: 1px solid var(--line);
    padding-left: 10px;
  }

  body[data-page="motivations"] .motivation-column .submission-list {
    height: clamp(320px, calc(100vh - 170px), 680px);
    overflow: auto;
    padding-right: 6px;
  }
}

.theme-mode-toggle {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 80;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  border: 1px solid rgba(255, 200, 64, .42);
  border-radius: 50%;
  background: rgba(18, 17, 15, .94);
  color: var(--accent);
  padding: 0;
  box-shadow: 0 8px 22px rgba(0, 0, 0, .22);
  backdrop-filter: blur(10px);
}

.theme-mode-toggle:hover,
.theme-mode-toggle:focus-visible {
  background: #2a2518;
  outline: none;
}

.theme-mode-icon {
  position: relative;
  display: block;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: inset -7px 0 0 #16130d;
}

body.dark-mode .theme-mode-icon {
  box-shadow:
    0 -11px 0 -7px var(--accent),
    0 11px 0 -7px var(--accent),
    11px 0 0 -7px var(--accent),
    -11px 0 0 -7px var(--accent),
    8px 8px 0 -7px var(--accent),
    -8px -8px 0 -7px var(--accent),
    8px -8px 0 -7px var(--accent),
    -8px 8px 0 -7px var(--accent);
}

body.has-theme-toggle .topbar {
  padding-right: 72px;
}

body.dark-mode {
  color-scheme: dark;
  --bg: #0e0d0b;
  --panel: #181612;
  --text: #f7f1e5;
  --muted: #c8bcaa;
  --line: #3a3327;
  --accent: #ffc840;
  --accent-dark: #f0b018;
  --accent-ink: #111111;
  --soft: #2a2417;
  --shadow: 0 10px 28px rgba(0, 0, 0, .38);
  background:
    radial-gradient(circle at top left, rgba(255, 200, 64, .08), transparent 34vw),
    #0e0d0b;
}

body.dark-mode .topbar {
  background: rgba(5, 5, 5, .96);
  border-color: #31291c;
}

body.dark-mode .topbar span {
  color: #bfb5a6;
}

body.dark-mode .hitlist-subnav,
body.dark-mode .list-mode-switcher {
  background: rgba(14, 13, 11, .96);
  border-color: var(--line);
}

body.dark-mode input,
body.dark-mode textarea,
body.dark-mode select {
  background: #11100e;
  color: var(--text);
  border-color: var(--line);
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: #8d8272;
}

body.dark-mode button.secondary,
body.dark-mode .button.secondary {
  background: #28231b;
  color: var(--text);
}

body.dark-mode button.ghost {
  color: var(--accent);
}

body.dark-mode :is(
  .panel,
  .card,
  .track,
  .rank-row,
  .submission-card,
  .stat-card,
  .stats-card,
  .artist-detail,
  .artist-card,
  .artist-track-row,
  .motivation-card,
  .motivation-note,
  .survey-question,
  .survey-card,
  .question-card,
  .portal-card,
  .portal-settings-card,
  .menu-editor-row,
  .account-card,
  .group-card,
  .permission-card,
  .source-card,
  .source-file-card,
  .source-file-row,
  .source-editor,
  .upload-slot,
  .schedule-block,
  .schedule-row,
  .admin-card,
  .fraud-card,
  .summary,
  .custom-entry,
  .suggestion-card,
  .result-card,
  .ballot,
  .contact-card,
  .ris-card,
  .ris-panel,
  .news-card,
  .traffic-card,
  .today-card
) {
  background: var(--panel);
  color: var(--text);
  border-color: var(--line);
  box-shadow: var(--shadow);
}

body.dark-mode :is(.rank-row, .track, .submission-card, .artist-track-row, .source-file-row, .schedule-row):hover {
  background: #211d17;
}

body.dark-mode :is(.meta, .empty-results, small, .section-head p, .custom-entry small, .summary span) {
  color: var(--muted);
}

body.dark-mode :is(table, .source-editor-table, .ranking-table) {
  background: var(--panel);
  color: var(--text);
  border-color: var(--line);
}

body.dark-mode :is(th, td) {
  border-color: var(--line);
}

body.dark-mode :is(thead, .table-head) {
  background: #211d17;
}

body.dark-mode :is(details, summary) {
  color: var(--text);
}

body.dark-mode :is(.hero, .hero-card, .vote-shell, .admin-layout, .stats-layout, .portal-shell, .manage-layout) {
  color: var(--text);
}

body.dark-mode :is(.badge, .db-badge, .source-label, .tag) {
  border-color: rgba(255, 200, 64, .42);
}

body.dark-mode .near-miss,
body.dark-mode .danger,
body.dark-mode button.danger {
  color: #fff7f4;
}

body.dark-mode :is(.chart-bar, .bar-track, .percentage-bar) {
  background: #2b251c;
}

body.dark-mode :is(.chart-fill, .bar-fill, .percentage-fill) {
  background: linear-gradient(90deg, #ffc840, #f0a710);
}

body[data-page="info-screen"] .theme-mode-toggle,
body[data-page="tec-vu-source"] .theme-mode-toggle {
  display: none;
}

body.dark-mode {
  --dark-surface-1: #181612;
  --dark-surface-2: #211d17;
  --dark-surface-3: #2a241b;
  --dark-surface-warm: #302717;
  --dark-red-soft: #351a17;
  --dark-green-soft: #153322;
  --dark-yellow-soft: #332812;
}

body.dark-mode :is(.login-page) {
  background:
    radial-gradient(circle at top, rgba(255, 200, 64, .12), transparent 34rem),
    #070605;
}

body.dark-mode :is(
  .login-card,
  .reset-panel,
  .portal-card,
  .ris-font-control,
  .ris-script-card,
  .ris-news-item,
  .ris-traffic-item,
  .ris-track-item,
  .ris-empty,
  .ris-news-readout,
  .ris-today-item,
  .ris-settings-card,
  .tecstumo-clock-settings,
  .tecstumo-now-playing-settings,
  .tecstumo-meter-settings,
  .portal-menu-row,
  .portal-menu-visible,
  .portal-menu-fixed,
  .account-card,
  .account-summary div,
  .account-row,
  .account-edit-details,
  .permission-details,
  .permission-grid label,
  .permission-row,
  .schedule-block,
  .schedule-track-row,
  .track,
  .rank-row,
  .ballot li,
  .custom-suggestion,
  .suggestion-box,
  .survey-question-card,
  .settings-block,
  .extra-upload-row,
  .source-file-row,
  .source-editor-panel,
  .source-editor-row,
  .source-editor-empty,
  .fraud-tools,
  .submission-card,
  .pager-card,
  .artist-nav-card,
  .motivation-entry,
  .motivation-survey,
  .cover-stat-card,
  .artist-stat-row,
  .artist-detail,
  .stat-card,
  .fact-box,
  .insight-list
) {
  background: var(--dark-surface-1);
  color: var(--text);
  border-color: var(--line);
}

body.dark-mode :is(
  .portal-card,
  .ris-script-card,
  .source-file-row-primary,
  .upload-card
) {
  background: linear-gradient(180deg, #1f1a12 0%, #151310 100%);
}

body.dark-mode :is(
  .ris-news-item:hover,
  .ris-news-item[open],
  .rank-row:hover,
  .track:hover,
  .source-file-row:hover,
  .source-editor-row:hover,
  .extra-upload-row:hover,
  .pager-card:not(.disabled):hover,
  .artist-nav-card:not(.disabled):hover,
  .artist-track-row:hover,
  .portal-menu-row.drag-over
) {
  background: var(--dark-surface-2);
  border-color: rgba(255, 200, 64, .42);
}

body.dark-mode :is(
  .portal-settings-nav,
  .manage-nav,
  .motivation-sticky-head
) {
  background: linear-gradient(to bottom, rgba(14, 13, 11, .98), rgba(14, 13, 11, .88) 72%, rgba(14, 13, 11, 0));
}

body.dark-mode :is(
  .portal-settings-nav a,
  .manage-nav a,
  .account-badge,
  .account-edit-details summary::after,
  .permission-details summary::after,
  .portal-menu-drag,
  .drag-handle,
  .checkbox-line,
  .source-file-status,
  .motivation-person-badge,
  .motivation-person span,
  .motivation-survey summary::before,
  .artist-track-count-button:hover,
  .artist-stat-row.active,
  .cover-version-list a
) {
  background: var(--dark-surface-3);
  color: var(--text);
  border-color: var(--line);
}

body.dark-mode :is(
  .account-card-primary,
  .status-panel,
  .schedule-block-head,
  .bonus-toggle,
  .settings-block-head::after,
  .general-upload-card,
  .upload-summary,
  .submission-card.suspicious,
  .confirmation-panel,
  .extra-upload-row label,
  .source-file-label-control input,
  .fact-box,
  .custom-suggestion,
  .checkbox-line,
  .source-editor-panel,
  .cover-version-list a
) {
  background: var(--dark-yellow-soft);
  color: var(--text);
  border-color: rgba(255, 200, 64, .34);
}

body.dark-mode :is(
  .list-mode-switcher,
  .schedule-jumpbar
) {
  background: rgba(18, 16, 12, .96);
  border-color: rgba(255, 200, 64, .26);
  box-shadow: 0 18px 34px rgba(0, 0, 0, .36);
}

body.dark-mode .list-mode-switcher button {
  background: linear-gradient(180deg, #211d17 0%, #17140f 100%);
  color: var(--text);
  border-color: var(--line);
  box-shadow: none;
}

body.dark-mode .list-mode-switcher button:not(.active)::before {
  background: rgba(255, 255, 255, .28);
}

body.dark-mode .list-mode-switcher button.active {
  background: linear-gradient(180deg, #ffd96f 0%, var(--accent) 100%);
  color: var(--accent-ink);
  border-color: rgba(255, 200, 64, .72);
}

body.dark-mode :is(.ris-news-briefing, .ris-news-readout) {
  border-color: rgba(255, 200, 64, .34);
}

body.dark-mode :is(.ris-track-badge, .ris-track-badge.is-spotify, .ris-traffic-delay) {
  background: var(--dark-surface-3);
  color: var(--text);
  border: 1px solid var(--line);
}

body.dark-mode :is(
  .ris-track-item p,
  .ris-today-item p,
  .portal-card span,
  .eyebrow,
  .artist-stat-row strong,
  .cover-version-list a,
  .login-back
) {
  color: var(--accent);
}

body.dark-mode :is(
  .movement-badge.down,
  .movement-cell.down,
  .movement-stat-card.down,
  .near-miss-panel,
  .near-miss-row,
  .submission-card.disabled,
  .ris-today-item.is-deceased
) {
  background: var(--dark-red-soft);
  border-color: rgba(255, 91, 78, .38);
  color: #ffe7e4;
}

body.dark-mode :is(
  .upload-summary.has-upload,
  .movement-badge.up,
  .movement-cell.up,
  .movement-stat-card.up
) {
  background: var(--dark-green-soft);
  border-color: rgba(91, 220, 130, .34);
  color: #d9ffe3;
}

body.dark-mode :is(
  .movement-badge.same,
  .movement-cell.same,
  .movement-stat-card.same,
  .bonus-toggle.active,
  .source-file-priority
) {
  background: var(--dark-yellow-soft);
  border-color: rgba(255, 200, 64, .42);
  color: #ffe7a3;
}

body.dark-mode :is(.source-file-row.is-missing, .motivation-text.empty, .portal-menu-fixed) {
  background: #24211b;
  color: var(--muted);
}

body.dark-mode :is(.motivation-text, .ris-news-readout, .source-editor-empty) {
  background: #120f0a;
}

body.dark-mode :is(.source-file-label-control input, .login-form input) {
  background: #11100e;
  color: var(--text);
  border-color: var(--line);
}

body.dark-mode :is(.theme-mode-toggle, .nav-links a, .nav-button) {
  border-color: rgba(255, 200, 64, .28);
}

body.dark-mode :is(.nav-links a:hover, .nav-button:hover, .hitlist-subnav a:hover) {
  background: rgba(255, 200, 64, .16);
}

body.dark-mode :is(.cover, .near-miss-row .cover) {
  background: linear-gradient(135deg, #050505, #3b2a05 55%, #ffc840);
}

body.dark-mode :is(.ris-news-link, .ris-news-readout-label, .ris-track-rank) {
  background: #050505;
  color: var(--accent);
}

body.dark-mode :is(.schedule-block-head, .portal-menu-drag, .drag-handle) {
  box-shadow: none;
}

body.dark-mode :is(.rank-row, .track, .schedule-track-row, .source-file-row, .submission-card, .motivation-entry) {
  box-shadow: 0 8px 18px rgba(0, 0, 0, .2);
}

body.dark-mode .ballot-progress {
  background: #2b251c;
  box-shadow: inset 0 0 0 1px rgba(255, 200, 64, .16);
}

body.dark-mode :is(button, .button, .button-link) {
  border: 1px solid rgba(255, 200, 64, .36);
  background: linear-gradient(180deg, #ffd25d 0%, #ffc840 100%);
  color: #111;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .22);
}

body.dark-mode :is(button, .button, .button-link):hover {
  border-color: rgba(255, 200, 64, .68);
  background: linear-gradient(180deg, #ffe082 0%, #f0b018 100%);
}

body.dark-mode :is(button, .button, .button-link):focus-visible {
  outline: 2px solid rgba(255, 200, 64, .72);
  outline-offset: 2px;
}

body.dark-mode :is(button, .button, .button-link):disabled,
body.dark-mode :is(button, .button, .button-link)[aria-disabled="true"] {
  opacity: .46;
  cursor: not-allowed;
  box-shadow: none;
}

body.dark-mode :is(button.secondary, .button.secondary, .secondary, .info-link, .schedule-info-link) {
  border-color: rgba(255, 200, 64, .22);
  background: #28231b;
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .03);
}

body.dark-mode :is(button.secondary, .button.secondary, .secondary, .info-link, .schedule-info-link):hover {
  border-color: rgba(255, 200, 64, .46);
  background: #342b1c;
  color: #fff6df;
}

body.dark-mode :is(button.ghost, .ghost) {
  border-color: transparent;
  background: transparent;
  color: var(--accent);
  box-shadow: none;
}

body.dark-mode :is(button.ghost, .ghost):hover {
  border-color: rgba(255, 200, 64, .28);
  background: rgba(255, 200, 64, .1);
}

body.dark-mode :is(button.danger, .danger, .near-miss-row .info-link) {
  border-color: rgba(255, 91, 78, .42);
  background: linear-gradient(180deg, #823027 0%, #5e211b 100%);
  color: #fff4f2;
  box-shadow: 0 8px 18px rgba(88, 22, 16, .26);
}

body.dark-mode :is(button.danger, .danger, .near-miss-row .info-link):hover {
  border-color: rgba(255, 126, 113, .62);
  background: linear-gradient(180deg, #9b392f 0%, #742920 100%);
}

body.dark-mode :is(.jump-link, .back-top-link) {
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .36);
}

body.dark-mode .jump-link {
  background: linear-gradient(180deg, #823027 0%, #5e211b 100%);
  color: #fff4f2;
}

body.dark-mode .back-top-link {
  background: linear-gradient(180deg, #236b3c 0%, #17492b 100%);
  color: #effff4;
}

body.dark-mode .schedule-view-toggle {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #11100e;
  padding: 4px;
}

body.dark-mode .schedule-view-toggle button {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

body.dark-mode .schedule-view-toggle button:hover {
  background: rgba(255, 200, 64, .1);
  color: var(--text);
}

body.dark-mode .schedule-view-toggle button.active {
  border-color: rgba(255, 200, 64, .52);
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 18px rgba(255, 200, 64, .16);
}

body.dark-mode :is(.bonus-toggle, .artist-track-count-button, .source-file-actions .button) {
  border-color: rgba(255, 200, 64, .28);
  background: #28231b;
  color: var(--text);
}

body.dark-mode .bonus-toggle.active {
  border-color: rgba(255, 200, 64, .68);
  background: var(--accent);
  color: var(--accent-ink);
}

body.dark-mode .preview-button.playing {
  border-color: rgba(91, 220, 130, .48);
  background: linear-gradient(180deg, #236b3c 0%, #17492b 100%);
  color: #effff4;
}

body.dark-mode .theme-mode-toggle {
  border-color: rgba(255, 200, 64, .42);
  background: rgba(18, 17, 15, .96);
  color: var(--accent);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .36);
}

body.dark-mode .ris-refresh-button {
  --ris-refresh-ring: #67d986;
  border-color: rgba(103, 217, 134, .44);
  background: #14281a;
  color: #dfffe8;
  box-shadow: 0 0 0 3px rgba(103, 217, 134, .08);
}

body.dark-mode .ris-refresh-button::before {
  background:
    radial-gradient(circle at center, #11100e 0 47%, transparent 49%),
    conic-gradient(var(--ris-refresh-ring) var(--ris-refresh-progress), rgba(255, 255, 255, .14) 0);
}

body.dark-mode .ris-refresh-button.is-stale {
  --ris-refresh-ring: #ffc840;
  border-color: rgba(255, 200, 64, .52);
  background: #332812;
  color: #ffe7a3;
}

body.dark-mode .ris-refresh-button.is-old {
  --ris-refresh-ring: #ff6d5f;
  border-color: rgba(255, 109, 95, .55);
  background: #351a17;
  color: #ffe7e4;
}
