@font-face {
  font-family: "Orbitron";
  src: url("assets/fonts/orbitron-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Orbitron";
  src: url("assets/fonts/orbitron-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Orbitron";
  src: url("assets/fonts/orbitron-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Share Tech Mono";
  src: url("assets/fonts/share-tech-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
:root {
  --bg: #000000;
  --surface: #070b0f;
  --surface-2: #0d141a;
  --surface-3: #101b22;
  --text: #f2fbff;
  --muted: #7f9ba3;
  --line: rgba(0, 255, 255, 0.14);
  --line-strong: rgba(0, 245, 255, 0.28);
  --primary: #00f5ff;
  --primary-strong: #00c8ff;
  --secondary: #00c8ff;
  --danger: #ff5c7a;
  --shadow: 0 18px 44px rgba(0, 245, 255, 0.08), 0 18px 54px rgba(0, 0, 0, 0.72);
  --radius: 22px;
  --nav-height: 78px;
  --bottom-nav-height: 88px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background: #000000;
  font-family: "Orbitron", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  font-size: 16px;
}

input,
textarea,
select {
  font-size: 16px;
}

.app-shell {
  width: min(1180px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px calc(var(--nav-height) + 22px);
}

.auth-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 22px 16px calc(22px + env(safe-area-inset-bottom));
}

.auth-screen[hidden] {
  display: none;
}

.auth-card {
  display: grid;
  gap: 18px;
  width: min(520px, 100%);
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(13, 20, 26, 0.98), rgba(7, 11, 15, 0.99));
  box-shadow: var(--shadow);
}

.auth-logo {
  display: block;
  width: min(210px, 62vw);
  max-height: 66px;
  object-fit: contain;
  object-position: left center;
}

.auth-heading {
  display: grid;
  gap: 8px;
}

.auth-heading h1 {
  font-size: clamp(2rem, 9vw, 3.1rem);
}

.auth-heading p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.45;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.58);
}

.auth-tab {
  min-height: 46px;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.auth-tab.is-active {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #001113;
  box-shadow: 0 0 18px rgba(0, 245, 255, 0.18);
}

.auth-form {
  display: none;
  gap: 13px;
}

.auth-form.is-active {
  display: grid;
}

.auth-form button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 2px 22px;
}

.topbar-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.brand-header {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: min(170px, 56vw);
  max-height: 54px;
  object-fit: contain;
  object-position: left center;
}

.eyebrow,
.metric-label,
small,
.section-heading p {
  color: var(--muted);
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 7vw, 3.6rem);
  line-height: 0.98;
}

h2 {
  font-size: 1.12rem;
}

.date-pill {
  flex: 0 0 auto;
  min-width: 94px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 245, 255, 0.04);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  text-align: center;
}

.icon-btn {
  display: inline-grid;
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.74);
  color: var(--primary);
  box-shadow: 0 0 18px rgba(0, 245, 255, 0.12);
  line-height: 1;
}

.settings-gear-btn {
  font-size: 1.1rem;
}

.icon-btn:focus-visible {
  outline: 0;
  border-color: rgba(0, 245, 255, 0.82);
  box-shadow: 0 0 0 4px rgba(0, 245, 255, 0.11), 0 0 20px rgba(0, 245, 255, 0.18);
}

.page {
  display: none;
}

.page.is-active {
  display: block;
}

.dashboard-grid,
.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.card,
.metric-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(13, 20, 26, 0.94), rgba(7, 11, 15, 0.98));
  box-shadow: var(--shadow);
}

.card {
  padding: 18px;
}

.metric-card {
  min-height: 158px;
  padding: 18px;
}

.metric-card.accent {
  background:
    linear-gradient(135deg, rgba(0, 245, 255, 0.16), rgba(0, 200, 255, 0.06)),
    var(--surface);
  border-color: var(--line-strong);
}

.metric-card strong {
  display: block;
  margin: 14px 0 12px;
  font-size: 2.2rem;
  line-height: 1;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-heading p {
  margin-top: 5px;
  line-height: 1.35;
}

.wide-card {
  margin-top: 14px;
}

.progress {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 245, 255, 0.08);
}

.progress span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  box-shadow: 0 0 14px rgba(0, 245, 255, 0.36);
  transition: width 180ms ease;
}

.progress.protein span {
  background: linear-gradient(90deg, #00e7ff, #64f8ff);
}

.progress.carbs span {
  background: linear-gradient(90deg, #00c8ff, #45f3ff);
}

.progress.fat span {
  background: linear-gradient(90deg, #29aaff, #00f5ff);
}

.weight-progress {
  margin-bottom: 14px;
}

.form-stack {
  display: grid;
  gap: 13px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 13px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: 0;
  background: rgba(0, 0, 0, 0.72);
  color: var(--text);
  padding: 0 14px;
}

input:focus {
  border-color: rgba(0, 245, 255, 0.82);
  box-shadow: 0 0 0 4px rgba(0, 245, 255, 0.11), 0 0 18px rgba(0, 245, 255, 0.14);
}

.button-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.primary-btn,
.secondary-btn,
.danger-btn,
.small-btn {
  min-height: 50px;
  border-radius: 16px;
  font-weight: 850;
  color: #07100c;
  transition: transform 120ms ease, opacity 120ms ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  box-shadow: 0 0 18px rgba(0, 245, 255, 0.18);
}

.secondary-btn {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
}

.danger-btn,
.small-btn.danger {
  background: rgba(255, 92, 122, 0.12);
  color: #ffc8d3;
}

.primary-btn:active,
.secondary-btn:active,
.danger-btn:active,
.small-btn:active,
.nav-btn:active {
  transform: translateY(1px);
}

.message {
  min-height: 20px;
  color: var(--danger);
  font-size: 0.88rem;
  font-weight: 700;
}

.message.success {
  color: var(--primary);
}

.item-list,
.compact-list {
  display: grid;
  gap: 10px;
}

.item-list.spaced {
  margin-top: 12px;
}

.list-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0, 245, 255, 0.035);
}

.list-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.list-item strong {
  display: block;
  line-height: 1.25;
}

.meta {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.small-btn {
  min-width: 44px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 13px;
  background: var(--surface-3);
  color: var(--text);
}

.exercise-fields {
  display: grid;
  gap: 12px;
}

.exercise-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0, 245, 255, 0.03);
}

.exercise-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
}

.bottom-nav {
  position: fixed;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  left: 12px;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 6px;
  width: min(620px, calc(100% - 24px));
  height: var(--nav-height);
  margin: 0 auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(0, 0, 0, 0.9);
  box-shadow: 0 0 28px rgba(0, 245, 255, 0.1), 0 20px 50px rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(18px);
}

.nav-btn {
  min-width: 0;
  border-radius: 18px;
  background: transparent;
  color: #6f929b;
  font-size: 0.7rem;
  font-weight: 850;
}

.nav-btn.is-active {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #001113;
  box-shadow: 0 0 18px rgba(0, 245, 255, 0.2);
}

.live-view-page {
  min-height: min(720px, calc(100dvh - var(--bottom-nav-height) - 140px));
}

.live-placeholder-panel {
  display: grid;
  gap: 12px;
  min-height: min(420px, 56dvh);
  align-content: center;
  padding: clamp(22px, 5vw, 44px);
  border: 1px solid rgba(0, 245, 255, 0.28);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(0, 245, 255, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(7, 11, 15, 0.96), rgba(0, 0, 0, 0.98));
  box-shadow: inset 0 0 32px rgba(0, 245, 255, 0.08), 0 0 28px rgba(0, 245, 255, 0.1);
}

.live-placeholder-panel h2 {
  margin: 0;
  color: #f2fbff;
  font-size: clamp(1.55rem, 4vw, 3rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.live-placeholder-panel p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.admin-control-grid {
  display: grid;
  gap: 16px;
  padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 28px);
}

.admin-control-card {
  display: grid;
  gap: 14px;
  padding: clamp(18px, 4vw, 28px);
  border: 1px solid rgba(0, 245, 255, 0.24);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(0, 245, 255, 0.08), transparent 38%),
    rgba(7, 11, 15, 0.96);
  box-shadow: inset 0 0 24px rgba(0, 245, 255, 0.06), 0 0 24px rgba(0, 245, 255, 0.08);
}

.admin-control-card h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.15rem, 3vw, 1.75rem);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.admin-control-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.admin-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-status-grid div {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(0, 245, 255, 0.16);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.38);
}

.admin-status-grid span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.admin-status-grid strong {
  display: block;
  color: var(--text);
  overflow-wrap: anywhere;
}

.admin-button-grid,
.live-pause-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-inline-control {
  display: grid;
  grid-template-columns: minmax(120px, 180px) 1fr;
  gap: 12px;
}

.admin-inline-control input,
.admin-control-card textarea {
  width: 100%;
  border: 1px solid rgba(0, 245, 255, 0.16);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.46);
  color: var(--text);
}

.admin-control-card textarea {
  min-height: 120px;
  resize: vertical;
}

.admin-danger-zone {
  border-color: rgba(255, 79, 116, 0.38);
  background:
    linear-gradient(135deg, rgba(255, 79, 116, 0.12), transparent 34%),
    rgba(7, 11, 15, 0.96);
}

.cyborg-music-card {
  gap: 18px;
}

.cyborg-music-card code {
  color: var(--primary);
  font-family: "Share Tech Mono", monospace;
}

.admin-music-now-playing {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.admin-music-cover {
  width: 112px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(0, 245, 255, 0.36);
  background:
    linear-gradient(135deg, rgba(0, 245, 255, 0.16), rgba(0, 200, 255, 0.08)),
    #05090d;
  box-shadow: 0 0 24px rgba(0, 245, 255, 0.16);
}

.admin-music-cover.placeholder {
  padding: 18px;
  object-fit: contain;
}

.admin-music-info {
  min-width: 0;
}

.admin-music-label,
.admin-music-position,
.admin-music-playlist-header span {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-music-info h3 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: clamp(1.25rem, 4vw, 1.75rem);
  line-height: 1.1;
  word-break: break-word;
}

.admin-music-artist {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 800;
  word-break: break-word;
}

.admin-music-position {
  margin: 10px 0 0;
}

.admin-music-progress-area {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-family: "Share Tech Mono", monospace;
  font-size: 0.92rem;
}

#adminMusicProgressBar {
  width: 100%;
  min-height: 36px;
  accent-color: var(--primary);
  cursor: pointer;
}

.admin-music-controls,
.admin-music-mode-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.admin-music-mode-controls .is-active {
  background: var(--primary);
  color: #02070a;
  border-color: rgba(0, 245, 255, 0.9);
  box-shadow: 0 0 22px rgba(0, 245, 255, 0.34);
}

.admin-music-playlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 2px;
}

.admin-music-playlist-header h3 {
  margin: 0;
  color: var(--text);
}

.admin-music-playlist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.admin-music-playlist li {
  min-height: 62px;
  padding: 13px 14px;
  border: 1px solid rgba(0, 245, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  word-break: break-word;
}

.admin-music-playlist li.is-active {
  background: linear-gradient(135deg, rgba(0, 245, 255, 0.26), rgba(0, 200, 255, 0.12));
  border-color: rgba(0, 245, 255, 0.72);
  box-shadow: 0 0 18px rgba(0, 245, 255, 0.18);
}

.admin-music-playlist li.empty {
  color: var(--muted);
  cursor: default;
}

.admin-music-playlist-title {
  font-weight: 900;
}

.admin-music-playlist-artist {
  color: var(--muted);
  font-size: 0.88rem;
}

.admin-music-playlist li.is-active .admin-music-playlist-artist {
  color: #d8faff;
}

@media (min-width: 620px) {
  .admin-music-controls {
    grid-template-columns: 1fr 1.3fr 1fr;
  }

  .admin-music-mode-controls {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 420px) {
  .admin-music-now-playing {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
  }

  .admin-music-cover {
    width: 92px;
    border-radius: 14px;
  }
}

#liveAdminActionMessage {
  margin: 0;
}

.live-route-layout,
.live-fuel-grid {
  display: grid;
  gap: 14px;
}

.live-map-placeholder,
.live-info-tile,
.live-checkpoint,
.live-timeline-item {
  border: 1px solid rgba(0, 245, 255, 0.2);
  background: rgba(0, 0, 0, 0.42);
  box-shadow: inset 0 0 18px rgba(0, 245, 255, 0.06);
}

.live-map-placeholder {
  display: grid;
  min-height: 220px;
  place-items: center;
  text-align: center;
  background:
    linear-gradient(rgba(0, 245, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 245, 255, 0.07) 1px, transparent 1px),
    rgba(0, 0, 0, 0.52);
  background-size: 28px 28px;
}

.live-map-placeholder span,
.live-info-tile span,
.live-checkpoint span,
.live-timeline-item span {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.live-map-placeholder strong,
.live-info-tile strong,
.live-checkpoint strong,
.live-timeline-item strong {
  display: block;
  margin-top: 6px;
  color: #f2fbff;
  font-size: 1.05rem;
}

.live-checkpoint-list,
.live-timeline-list {
  display: grid;
  gap: 10px;
}

.live-checkpoint,
.live-info-tile,
.live-timeline-item {
  padding: 14px;
  border-radius: 16px;
}

.live-checkpoint.is-current {
  border-color: rgba(0, 245, 255, 0.52);
  box-shadow: inset 0 0 22px rgba(0, 245, 255, 0.09), 0 0 18px rgba(0, 245, 255, 0.12);
}

.live-info-tile p,
.live-timeline-item p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (min-width: 820px) {
  .live-route-layout {
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.7fr);
    align-items: stretch;
  }

  .live-fuel-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.empty-state {
  padding: 18px;
  border: 1px dashed rgba(0, 245, 255, 0.18);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

@media (min-width: 680px) {
  .app-shell {
    padding: 28px 26px calc(var(--nav-height) + 28px);
  }

  .brand-logo {
    width: min(240px, 30vw);
    max-height: 70px;
  }

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

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

@media (min-width: 980px) {
  .app-shell {
    padding-top: 38px;
  }

  .dashboard-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .content-grid {
    grid-template-columns: minmax(320px, 0.82fr) minmax(420px, 1.18fr);
    align-items: start;
  }

  .settings-card {
    max-width: 780px;
  }
}

.auth-profile-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0, 245, 255, 0.035);
}

.auth-profile-box span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.auth-profile-box strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.auth-profile-box button {
  flex: 0 0 auto;
  min-width: 108px;
}

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

.settings-link-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(0, 245, 255, 0.07), transparent 42%),
    rgba(8, 13, 18, 0.92);
  box-shadow: inset 0 0 22px rgba(0, 245, 255, 0.04);
}

.settings-link-card h3 {
  margin-bottom: 6px;
  color: var(--text);
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.settings-link-card p {
  color: var(--muted);
  line-height: 1.55;
}

.settings-contact-line {
  margin-top: 8px;
  color: var(--primary) !important;
  font-weight: 800;
}

.settings-link-card .secondary-btn {
  min-width: 142px;
}

.terms-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(12px);
}

.terms-modal[hidden] {
  display: none;
}

.terms-modal-panel {
  width: min(920px, 100%);
  max-height: min(82dvh, 760px);
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid rgba(0, 245, 255, 0.28);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(0, 245, 255, 0.09), transparent 34%),
    rgba(7, 11, 15, 0.98);
  box-shadow:
    0 0 34px rgba(0, 245, 255, 0.18),
    inset 0 0 28px rgba(0, 245, 255, 0.05);
}

.terms-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border-bottom: 1px solid rgba(0, 245, 255, 0.16);
}

.terms-modal-header h2 {
  color: var(--text);
  font-size: clamp(1.1rem, 3vw, 1.55rem);
}

.terms-close-btn {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 245, 255, 0.08);
  color: var(--text);
  font-weight: 850;
}

.terms-scrollbox {
  max-height: calc(min(82dvh, 760px) - 82px);
  margin: 0;
  padding: 18px;
  overflow: auto;
  white-space: pre-wrap;
  color: rgba(242, 251, 255, 0.88);
  font-family: inherit;
  font-size: 0.96rem;
  line-height: 1.62;
}

.contact-modal-panel {
  width: min(620px, 100%);
}

.contact-modal-body {
  display: grid;
  gap: 16px;
  padding: 20px;
  color: rgba(242, 251, 255, 0.9);
  line-height: 1.6;
}

.contact-email {
  padding: 14px;
  border: 1px solid rgba(0, 245, 255, 0.18);
  border-radius: 14px;
  background: rgba(0, 245, 255, 0.05);
  color: var(--primary);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.contact-mail-link {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid rgba(0, 245, 255, 0.28);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0, 245, 255, 0.16), rgba(0, 200, 255, 0.07));
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 0 18px rgba(0, 245, 255, 0.12);
}

.terms-main-title {
  display: block;
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 1.08rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0 16px rgba(0, 245, 255, 0.28);
}

.terms-section-title {
  display: block;
  margin: 22px 0 8px;
  color: var(--primary);
  font-size: 1.02rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.ai-import-box {
  margin-top: 16px;
  display: flex;
  justify-content: center;
}

#openAiImportBtn {
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #00f5ff, #00c8ff);
  color: #001113;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(0, 245, 255, 0.18);
}

.ai-import-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.72);
}

.ai-import-modal[hidden] {
  display: none;
}

.ai-import-panel {
  width: min(520px, 100%);
  padding: 20px;
  border: 1px solid rgba(0, 245, 255, 0.32);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(13, 20, 26, 0.98), rgba(7, 11, 15, 0.99));
  box-shadow: 0 18px 46px rgba(0, 245, 255, 0.08), 0 22px 70px rgba(0, 0, 0, 0.72);
  color: #f2fbff;
}

.ai-import-panel h2 {
  margin: 0 0 8px;
}

.ai-import-panel p {
  color: #7f9ba3;
}

#aiImportJson {
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(0, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.72);
  color: #f2fbff;
  font: inherit;
  font-size: 16px;
  resize: vertical;
}

.ai-import-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.ai-import-actions button {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  font-weight: 900;
  cursor: pointer;
}

#importAiMealBtn {
  background: linear-gradient(135deg, #00f5ff, #00c8ff);
  color: #001113;
}

#closeAiImportBtn {
  background: rgba(255, 255, 255, 0.08);
  color: #f2fbff;
  border: 1px solid rgba(0, 255, 255, 0.16);
}

.ai-import-message {
  margin-top: 12px;
  min-height: 20px;
  font-weight: 800;
  color: #00f5ff;
}

.ai-import-message.error {
  color: #ff5c7a;
}

.run-card {
  display: grid;
  gap: 16px;
}

.run-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(0, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(0, 245, 255, 0.04);
}

.run-status-row span,
.run-metric span {
  color: #7f9ba3;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.run-status-row strong {
  color: #00f5ff;
  font-size: 1rem;
}

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

.run-metric {
  min-height: 104px;
  padding: 14px;
  border: 1px solid rgba(0, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(0, 245, 255, 0.035);
}

.run-metric strong {
  display: block;
  margin-top: 9px;
  color: #f2fbff;
  font-size: clamp(1.2rem, 7vw, 1.8rem);
  line-height: 1.05;
}

.run-actions {
  display: grid;
  gap: 10px;
}

.run-actions button {
  min-height: 52px;
  border-radius: 16px;
  font-weight: 900;
}

.live-page-shell {
  display: grid;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  place-items: center;
}

.live-stream-wrapper {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  margin-left: 0;
  transform: none;
  display: grid;
  place-items: center;
}

.live-stream-screen {
  container-type: inline-size;
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: none;
  border-radius: 0;
  background: #000000;
  box-shadow: none;
}

.live-hud-container {
  aspect-ratio: 16 / 9;
  background: #000000;
}


.live-overlay-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.live-bg-img {
  position: absolute;
  z-index: 1;

  left: 1.6%;
  top: 6%;
  width: 79%;
  height: auto;

  object-fit: fill;
  object-position: center top;
  pointer-events: none;
}

.live-camera-video {
  position: absolute;
  z-index: 2;
  left: 1.6%;
  top: 6%;
  width: 79%;
  height: auto;
  aspect-ratio: 1672 / 941;
  object-fit: cover;
  object-position: center center;
  pointer-events: none;
}

.live-overlay-img {
  z-index: 3;
  object-fit: fill;
}

.live-countdown-img {
  position: absolute;
  z-index: 4;
  left: 9%;
  top: 34%;
  width: 40%;
  height: auto;
  pointer-events: none;
  object-fit: contain;
}

.logo-100km {
  position: absolute;
  z-index: 5;
  right: 1.1%;
  bottom: 1.5%;
  width: 22.3%;
  height: auto;
  pointer-events: none;
  object-fit: contain;

}

.live-100 {
  position: absolute;
  z-index: 6;
  right: 29%;
  top: 2.2%;
  width: 45%;
  height: auto;
  pointer-events: none;
  object-fit: contain;

}

.live-data-layer {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  color: #f2fbff;
  font-variant-numeric: tabular-nums;
}

.live-state-overlay {
  position: absolute;
  left: 1.6%;
  top: 6%;
  width: 79%;
  height: 79%;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 8%;
  text-align: center;
  pointer-events: none;
  color: var(--text);
  background: rgba(0, 0, 0, 0.64);
  backdrop-filter: blur(6px);
}

.live-state-overlay[hidden] {
  display: none;
}

.live-state-overlay.is-blackout,
.live-state-overlay.is-pause,
.live-state-overlay.is-sleep {
  background: #000;
  backdrop-filter: none;
}

.live-state-overlay strong,
.live-state-overlay span,
.live-state-overlay em {
  display: block;
}

.live-state-overlay strong {
  color: var(--primary);
  font-family: "Orbitron", sans-serif;
  font-size: clamp(1.4rem, 6cqw, 5.6rem);
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 0 24px rgba(0, 245, 255, 0.34);
}

.live-state-overlay span {
  max-width: 70%;
  margin-top: 1.2%;
  color: #f2fbff;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(0.85rem, 2.8cqw, 2.6rem);
  font-weight: 800;
  line-height: 1.25;
}

.live-state-overlay em {
  margin-top: 1.2%;
  color: rgba(242, 251, 255, 0.78);
  font-family: "Share Tech Mono", monospace;
  font-size: clamp(0.75rem, 1.8cqw, 1.6rem);
  font-style: normal;
  letter-spacing: 0.08em;
}

.live-admin-camera {
  position: absolute;
  z-index: 7;
  right: 8px;
  bottom: 8px;
  display: grid;
  max-width: min(260px, 28%);
  gap: 6px;
  pointer-events: auto;
}

.live-admin-camera[hidden] {
  display: none;
}

.live-admin-camera button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(0, 245, 255, 0.58);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(0, 18, 22, 0.92), rgba(0, 5, 8, 0.94)),
    rgba(0, 0, 0, 0.72);
  box-shadow: inset 0 0 18px rgba(0, 245, 255, 0.08), 0 0 18px rgba(0, 245, 255, 0.14);
  color: var(--primary);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 950;
}

.live-admin-camera p {
  min-height: 1em;
  margin: 0;
  color: #f2fbff;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: right;
}

.live-data-layer span {
  display: block;
  color: var(--primary);
  font-size: clamp(0.42rem, 0.82vw, 0.9rem);
  font-weight: 950;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
}

.live-data-layer strong {
  display: block;
  color: #f2fbff;
  font-size: clamp(0.48rem, 0.9vw, 1.1rem);
  font-weight: 900;
  line-height: 1.15;
  text-shadow: 0 0 16px rgba(0, 245, 255, 0.26);
}

.live-elapsed-time {
  position: absolute;
  top: 7.8%;
  left: 1.7%;
  width: 16%;
  text-align: center;
  overflow: hidden;
}

.live-elapsed-time span {
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.35em;
}

.live-elapsed-time strong {
  display: block;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(0.42rem, 1.32vw, 1.78rem);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-shadow: 0 0 10px rgba(0, 245, 255, 0.4), 0 0 22px rgba(0, 245, 255, 0.18);
  white-space: nowrap;
}

.live-countdown-text {
  position: absolute;
  top: 50.8%;
  left: 29%;
  width: 35%;
  text-align: center;
  transform: translate(-50%, -50%);
}

.live-countdown-text span {
  margin-bottom: 1.1%;
  font-family: "Orbitron", sans-serif;
  font-size: clamp(0.48rem, 0.92vw, 1.08rem);
  letter-spacing: 0.35em;
}

.live-countdown-text strong {
  font-family: "Orbitron", sans-serif;
  font-size: clamp(0.82rem, 1.72vw, 2.2rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.18), 0 0 24px rgba(0, 245, 255, 0.16);
  white-space: nowrap;
}

.live-countdown-text em {
  display: block;
  margin-top: 3.2%;
  color: rgba(242, 251, 255, 0.82);
  font-family: "Orbitron", sans-serif;
  font-size: clamp(0.42rem, 0.82vw, 0.98rem);
  font-style: normal;
  font-weight: 850;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  white-space: nowrap;
}

.live-local-time {
  position: absolute;
  top: 20%;
  left: 82%;
  width: 14%;
}

.live-course-values {
  position: absolute;
  top: 31%;
  left: 82%;
  display: grid;
  width: 14%;
  gap: 7.6%;
}

.live-performance-values {
  position: absolute;
  top: 82%;
  left: 6.4%;
  display: grid;
  width: 68%;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2%;
}

.live-performance-values div,
.live-course-values div {
  min-width: 0;
}

.live-performance-values span,
.live-performance-values strong,
.live-course-values span,
.live-course-values strong,
.live-local-time span,
.live-local-time strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-course-values span,
.live-local-time span {
  font-size: clamp(0.3rem, 0.58vw, 0.7rem);
}

.live-course-values strong,
.live-local-time strong {
  font-size: clamp(0.44rem, 0.86vw, 1rem);
}

.live-performance-values span {
  font-size: clamp(0.28rem, 0.58vw, 0.66rem);
  letter-spacing: 0.05em;
}

.live-performance-values strong {
  margin-top: 2%;
  font-size: clamp(0.46rem, 0.9vw, 1.05rem);
}

.live-fullscreen-button {
  position: absolute;
  z-index: 8;
  top: 8px;
  right: 8px;
  display: inline-grid;
  min-width: 42px;
  min-height: 36px;
  place-items: center;
  padding: 0 12px;
  background:
    linear-gradient(180deg, rgba(0, 18, 22, 0.9), rgba(0, 5, 8, 0.92)),
    rgba(0, 0, 0, 0.68);
  box-shadow: inset 0 0 18px rgba(0, 245, 255, 0.08), 0 0 18px rgba(0, 245, 255, 0.14);
  color: var(--primary);
  cursor: pointer;
  font-size: 18px;
  font-weight: 950;
  line-height: 1;
}

.live-fullscreen-button:hover,
.live-fullscreen-button:focus-visible {
  box-shadow: inset 0 0 22px rgba(0, 245, 255, 0.1), 0 0 24px rgba(0, 245, 255, 0.24);
  outline: none;
}

.ai-meal-section {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(0, 245, 255, 0.22);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(13, 20, 26, 0.95), rgba(7, 11, 15, 0.99));
}

.ai-meal-section textarea {
  width: 100%;
  min-height: 140px;
  margin-top: 10px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid rgba(0, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.72);
  color: #f2fbff;
  font: inherit;
  font-size: 16px;
  resize: vertical;
}

.ai-meal-section button {
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, #00f5ff, #00c8ff);
  color: #001113;
  font-weight: 900;
  cursor: pointer;
}

.ai-result-summary {
  margin-top: 14px;
  color: #7f9ba3;
  font-weight: 700;
}

.result-area {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.empty-state,
.warning {
  padding: 18px;
  border: 1px dashed rgba(0, 245, 255, 0.32);
  border-radius: 18px;
  color: #7f9ba3;
  text-align: center;
}

.warning {
  color: #ff5c7a;
}

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

.total-card {
  padding: 14px;
  border: 1px solid rgba(0, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(0, 245, 255, 0.04);
}

.total-card span {
  display: block;
  color: #7f9ba3;
  font-size: 0.82rem;
  font-weight: 750;
}

.total-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.4rem;
}

.food-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid rgba(0, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(0, 245, 255, 0.03);
}

.food-table th,
.food-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(0, 255, 255, 0.1);
  text-align: left;
  vertical-align: top;
}

.food-table th {
  color: #00f5ff;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.food-table tr:last-child td {
  border-bottom: 0;
}

.ai-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.ai-export-actions button {
  flex: 1;
  min-width: 180px;
}

.ai-export-message {
  margin-top: 10px;
  color: #00f5ff;
  font-weight: 800;
}

@media (max-width: 700px) {
  .topbar {
    align-items: flex-start;
  }

  .topbar-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
  }

  .date-pill {
    min-width: 86px;
    padding: 9px 10px;
    font-size: 0.78rem;
  }

  body {
    padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 24px);
  }

  .app-shell,
  main,
  .page,
  .ai-meal-section {
    padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 32px);
  }

  .ai-meal-section {
    margin-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 36px);
  }

  #running {
    padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 42px);
  }

  #live {
    padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 42px);
  }

  .run-actions {
    margin-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 24px);
  }

  .run-card {
    gap: 12px;
  }

  .run-metrics-grid {
    gap: 8px;
  }

  .run-metric {
    min-height: 86px;
    padding: 12px;
  }

  .run-metric strong {
    margin-top: 7px;
    font-size: 1.18rem;
  }

  .result-area {
    padding-bottom: 18px;
  }

  .ai-export-actions {
    margin-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 24px);
    padding-bottom: 0;
  }

  .auth-profile-box {
    align-items: stretch;
    flex-direction: column;
  }

  .auth-profile-box button {
    width: 100%;
  }

  .admin-status-grid,
  .admin-button-grid,
  .live-pause-presets,
  .admin-inline-control {
    grid-template-columns: 1fr;
  }

  .settings-link-card {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .settings-link-card .secondary-btn {
    width: 100%;
  }

  .terms-modal {
    padding: 12px;
  }

  .terms-modal-header {
    align-items: stretch;
    flex-direction: column;
  }

  .terms-close-btn {
    width: 100%;
  }

  .terms-scrollbox {
    font-size: 0.9rem;
  }

  .live-stream-wrapper {
    margin-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 18px);
  }

  .live-stream-screen {
    min-height: 0;
    border-radius: 18px;
  }

  .live-fullscreen-button {
    top: 5px;
    right: 5px;
    min-width: 34px;
    min-height: 32px;
    padding: 0 8px;
    font-size: 15px;
  }

}

@media (min-width: 760px) {
  .run-metrics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

}

.live-stream-screen:fullscreen {
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  border-radius: 0;
  background: #020b0d;
}

.live-stream-screen:fullscreen .live-fullscreen-button {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  z-index: 100000;
}

.live-stream-screen:fullscreen .live-elapsed-time span,
body.live-native-fullscreen .live-elapsed-time span,
body.live-fake-fullscreen .live-elapsed-time span {
  font-size: clamp(8px, 0.78vw, 14px) !important;
}

.live-stream-screen:fullscreen .live-elapsed-time strong,
body.live-native-fullscreen .live-elapsed-time strong,
body.live-fake-fullscreen .live-elapsed-time strong {
  font-size: clamp(45px, 12vw, 38px) !important;
}

.live-stream-screen:fullscreen .live-countdown-text span,
body.live-native-fullscreen .live-countdown-text span,
body.live-fake-fullscreen .live-countdown-text span {
  font-size: clamp(9px, 0.88vw, 16px) !important;
  letter-spacing: 0.26em;
}

.live-stream-screen:fullscreen .live-countdown-text strong,
body.live-native-fullscreen .live-countdown-text strong,
body.live-fake-fullscreen .live-countdown-text strong {
  font-size: clamp(18px, 1.75vw, 36px) !important;
  letter-spacing: 0.035em;
}

.live-stream-screen:fullscreen .live-countdown-text em,
body.live-native-fullscreen .live-countdown-text em,
body.live-fake-fullscreen .live-countdown-text em {
  font-size: clamp(8px, 0.78vw, 14px) !important;
  letter-spacing: 0.22em;
}

.live-stream-screen:fullscreen .live-course-values span,
.live-stream-screen:fullscreen .live-local-time span,
body.live-native-fullscreen .live-course-values span,
body.live-native-fullscreen .live-local-time span,
body.live-fake-fullscreen .live-course-values span,
body.live-fake-fullscreen .live-local-time span {
  font-size: clamp(7px, 0.62vw, 12px) !important;
}

.live-stream-screen:fullscreen .live-course-values strong,
.live-stream-screen:fullscreen .live-local-time strong,
body.live-native-fullscreen .live-course-values strong,
body.live-native-fullscreen .live-local-time strong,
body.live-fake-fullscreen .live-course-values strong,
body.live-fake-fullscreen .live-local-time strong {
  font-size: clamp(9px, 0.82vw, 16px) !important;
}

.live-stream-screen:fullscreen .live-performance-values span,
body.live-native-fullscreen .live-performance-values span,
body.live-fake-fullscreen .live-performance-values span {
  font-size: clamp(6px, 0.55vw, 10px) !important;
}

.live-stream-screen:fullscreen .live-performance-values strong,
body.live-native-fullscreen .live-performance-values strong,
body.live-fake-fullscreen .live-performance-values strong {
  font-size: clamp(9px, 0.82vw, 16px) !important;
}

body.live-fake-fullscreen {
  overflow: hidden;
}

body.live-fake-fullscreen .topbar,
body.live-fake-fullscreen .bottom-nav {
  display: none !important;
}

body.live-fake-fullscreen .app-shell {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  padding: 0;
}

body.live-fake-fullscreen .page {
  display: none;
}

body.live-fake-fullscreen #live {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999 !important;
  display: flex !important;
  width: 100vw !important;
  height: 100dvh !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  padding: 0 !important;
  background: #020b0d !important;
}

body.live-fake-fullscreen .live-stream-wrapper {
  position: fixed;
  inset: 0;
  display: block;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  margin: 0;
}

body.live-fake-fullscreen .live-fullscreen-button {
  position: fixed !important;
  top: max(10px, env(safe-area-inset-top)) !important;
  right: max(10px, env(safe-area-inset-right)) !important;
  z-index: 100000 !important;
  transform: none !important;
}

body.live-fake-fullscreen #live::after {
  display: none;
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 10px);
  z-index: 100001;
  max-width: min(300px, calc(100vw - 28px));
  padding: 7px 10px;
  border: 1px solid rgba(0, 245, 255, 0.4);
  border-radius: 999px;
  background: rgba(0, 8, 12, 0.88);
  box-shadow: 0 0 20px rgba(0, 245, 255, 0.16);
  color: #f2fbff;
  content: "Für beste Ansicht Handy quer drehen.";
  font-size: 0.7rem;
  font-weight: 850;
  text-align: center;
  transform: translateX(-50%);
}

@media (max-width: 700px) {

  #live,
  .live-page-shell,
  .live-stream-wrapper {
    max-width: 100%;
    overflow: hidden;
  }

  #live .live-stream-screen {
    width: 86vw;
    max-width: 86vw;
    margin-inline: auto;
    transform: none;
    transform-origin: center center;
  }

  .live-elapsed-time span {
    font-size: clamp(6px, 1.45vw, 9px);
    letter-spacing: 0.2em;
  }

  .live-elapsed-time strong {
    font-size: clamp(9px, 2.35vw, 15px);
    letter-spacing: 0.025em;
  }

  .live-countdown-text span {
    font-size: clamp(7px, 1.72vw, 10px);
    letter-spacing: 0.2em;
  }

  .live-countdown-text strong {
    font-size: clamp(12px, 3.45vw, 22px);
    letter-spacing: 0.025em;
  }

  .live-countdown-text em {
    font-size: clamp(7px, 1.65vw, 10px);
    letter-spacing: 0.16em;
  }
}

@media (orientation: portrait) {
  body.live-fake-fullscreen .live-stream-screen {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: calc(100vw * 16 / 9) !important;
    height: 100vw !important;
    max-width: none !important;
    max-height: none !important;
    aspect-ratio: 16 / 9 !important;
    margin: 0 !important;
    transform: translate(-50%, -50%) rotate(90deg) !important;
    transform-origin: center center !important;
  }

  body.live-fake-fullscreen #live::after {
    display: none;
  }
}

@media (orientation: landscape) {
  body.live-fake-fullscreen .live-stream-screen {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: min(100vw, calc(100dvh * 16 / 9)) !important;
    height: min(100dvh, calc(100vw * 9 / 16)) !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    transform: translate(-50%, -50%) !important;
  }

  body.live-fake-fullscreen #live::after {
    display: none;
  }
}

.live-corner-logo-slot {
  position: absolute;
  right: 24px;
  bottom: 28px;
  width: 145px;
  height: 90px;
  z-index: 6;
  display: none;
  border: 1px solid rgba(0, 245, 255, 0.35);
  background: rgba(0, 8, 12, 0.62);
  box-shadow: inset 0 0 18px rgba(0, 245, 255, 0.08), 0 0 18px rgba(0, 245, 255, 0.12);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 18px) 100%, 0 100%, 0 12px);
}

/* iPhone-only live text correction. Keep this at the end so it wins over older live rules. */
@media (max-width: 700px) and (orientation: portrait) {
  body:not(.live-fake-fullscreen):not(.live-native-fullscreen) #live .live-stream-screen {
    width: 86vw !important;
    max-width: 86vw !important;
    margin-inline: auto !important;
  }

  body:not(.live-fake-fullscreen):not(.live-native-fullscreen) #live .live-countdown-text {
    left: 29% !important;
    top: 50.8% !important;
    width: 36% !important;
  }

  body:not(.live-fake-fullscreen):not(.live-native-fullscreen) #live .live-countdown-text span {
    font-size: clamp(4px, 1.15vw, 7px) !important;
    letter-spacing: 0.16em !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  body:not(.live-fake-fullscreen):not(.live-native-fullscreen) #live .live-countdown-text strong {
    font-size: clamp(7px, 2.05vw, 12px) !important;
    letter-spacing: 0.01em !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  body:not(.live-fake-fullscreen):not(.live-native-fullscreen) #live .live-countdown-text em {
    margin-top: 2.4% !important;
    font-size: clamp(4px, 1.1vw, 7px) !important;
    letter-spacing: 0.12em !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  body:not(.live-fake-fullscreen):not(.live-native-fullscreen) #live .live-elapsed-time span {
    font-size: clamp(3.5px, 0.95vw, 6px) !important;
    letter-spacing: 0.14em !important;
    line-height: 1 !important;
  }

  body:not(.live-fake-fullscreen):not(.live-native-fullscreen) #live .live-elapsed-time strong {
    font-size: clamp(5px, 1.55vw, 9px) !important;
    letter-spacing: 0 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  body.live-fake-fullscreen #live .live-countdown-text {
    left: 29% !important;
    top: 50.8% !important;
    width: 36% !important;
  }

  body.live-fake-fullscreen #live .live-countdown-text span {
    font-size: clamp(5px, 1.35vw, 8px) !important;
    letter-spacing: 0.14em !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  body.live-fake-fullscreen #live .live-countdown-text strong {
    font-size: clamp(9px, 2.35vw, 15px) !important;
    letter-spacing: 0 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  body.live-fake-fullscreen #live .live-countdown-text em {
    margin-top: 2.4% !important;
    font-size: clamp(5px, 1.25vw, 8px) !important;
    letter-spacing: 0.12em !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  body.live-fake-fullscreen #live .live-elapsed-time span {
    font-size: clamp(4px, 1vw, 6px) !important;
    letter-spacing: 0.12em !important;
    line-height: 1 !important;
  }

  body.live-fake-fullscreen #live .live-elapsed-time strong {
    font-size: clamp(28px, 22vw, 34px) !important;
    letter-spacing: 0 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }
}

/* =========================================================
   FINAL CYBORGFIT LIVE FULLSCREEN TEXT OVERRIDES
   Normaler Live-Screen bleibt unverändert.
   Diese Regeln greifen nur in echtem Fullscreen oder Fake-Fullscreen.
   ========================================================= */

.live-stream-screen:fullscreen .live-countdown-text,
body.live-native-fullscreen #live .live-countdown-text,
body.live-fake-fullscreen #live .live-countdown-text {
  left: 29% !important;
  top: 50.8% !important;
  width: 36% !important;
  text-align: center !important;
  transform: translate(-50%, -50%) !important;
}

/* STREAM STARTET IN */
.live-stream-screen:fullscreen .live-countdown-text span,
body.live-native-fullscreen #live .live-countdown-text span,
body.live-fake-fullscreen #live .live-countdown-text span {
  display: block !important;
  margin-bottom: 1.1% !important;
  font-family: "Orbitron", sans-serif !important;
  font-size: clamp(25px, 1.8vw, 33px) !important;
  font-weight: 950 !important;
  letter-spacing: 0.26em !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  color: var(--primary) !important;
  text-transform: uppercase !important;
}

/* Countdown-Zeit */
.live-stream-screen:fullscreen .live-countdown-text strong,
body.live-native-fullscreen #live .live-countdown-text strong,
body.live-fake-fullscreen #live .live-countdown-text strong {
  display: block !important;
  font-family: "Orbitron", sans-serif !important;
  font-size: clamp(42px, 3.2vw, 58px) !important;
  font-weight: 800 !important;
  letter-spacing: 0.035em !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  color: #f2fbff !important;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.18), 0 0 24px rgba(0, 245, 255, 0.16) !important;
}

/* Datum */
.live-stream-screen:fullscreen .live-countdown-text em,
body.live-native-fullscreen #live .live-countdown-text em,
body.live-fake-fullscreen #live .live-countdown-text em {
  display: block !important;
  margin-top: 3.2% !important;
  font-family: "Orbitron", sans-serif !important;
  font-size: clamp(17px, 1.25vw, 23px) !important;
  font-style: normal !important;
  font-weight: 850 !important;
  letter-spacing: 0.22em !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  color: rgba(242, 251, 255, 0.82) !important;
  text-transform: uppercase !important;
}

/* Elapsed Time im Fullscreen stabil halten */
.live-stream-screen:fullscreen .live-elapsed-time strong,
body.live-native-fullscreen #live .live-elapsed-time strong,
body.live-fake-fullscreen #live .live-elapsed-time strong {
  font-size: clamp(24px, 2.6vw, 46px) !important;
  letter-spacing: 0.03em !important;
  line-height: 1 !important;
  white-space: nowrap !important;
}

/* Mobile uses the same 16:9 frame proportions as desktop. Desktop rules above stay untouched. */
@media (max-width: 700px) {

  #live .live-stream-screen,
  body.live-fake-fullscreen #live .live-stream-screen {
    container-type: inline-size;
  }

  #live .live-elapsed-time,
  body.live-fake-fullscreen #live .live-elapsed-time {
    top: 7.8% !important;
    left: 1.7% !important;
    width: 16% !important;
  }

  #live .live-countdown-text,
  body.live-fake-fullscreen #live .live-countdown-text {
    left: 29% !important;
    top: 50.8% !important;
    width: 35% !important;
    transform: translate(-50%, -50%) !important;
  }

  #live .live-countdown-text span,
  body.live-fake-fullscreen #live .live-countdown-text span {
    font-size: clamp(4px, 0.92cqw, 16px) !important;
    letter-spacing: 0.35em !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  #live .live-countdown-text strong,
  body.live-fake-fullscreen #live .live-countdown-text strong {
    font-size: clamp(7px, 1.72cqw, 36px) !important;
    letter-spacing: 0.06em !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  #live .live-countdown-text em,
  body.live-fake-fullscreen #live .live-countdown-text em {
    margin-top: 3.2% !important;
    font-size: clamp(4px, 0.82cqw, 16px) !important;
    letter-spacing: 0.35em !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  #live .live-elapsed-time span,
  body.live-fake-fullscreen #live .live-elapsed-time span {
    font-size: clamp(3px, 0.72cqw, 12px) !important;
    letter-spacing: 0.35em !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  #live .live-elapsed-time strong,
  body.live-fake-fullscreen #live .live-elapsed-time strong {
    font-size: clamp(5px, 1.32cqw, 28px) !important;
    letter-spacing: 0.05em !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }
}

/* =========================================================
   FINAL MOBILE PORTRAIT FULLSCREEN TEXT SIZE FIX
   Muss der letzte Block in dieser Datei bleiben.
   Betrifft nur Handy-Hochformat im Fake-Fullscreen.
   ========================================================= */

@media (max-width: 700px) and (orientation: portrait) {
  body.live-fake-fullscreen #live::after {
    display: none !important;
  }

  body.live-fake-fullscreen #live .live-countdown-text {
    left: 29% !important;
    top: 50.8% !important;
    width: 36% !important;
    text-align: center !important;
    transform: translate(-50%, -50%) !important;
  }

  body.live-fake-fullscreen #live .live-countdown-text span {
    display: block !important;
    margin-bottom: 1.1% !important;
    font-family: "Orbitron", sans-serif !important;
    font-size: clamp(6px, 1.55dvh, 9px) !important;
    font-weight: 950 !important;
    letter-spacing: 0.13em !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    color: var(--primary) !important;
    text-transform: uppercase !important;
  }

  body.live-fake-fullscreen #live .live-countdown-text strong {
    display: block !important;
    font-family: "Orbitron", sans-serif !important;
    font-size: clamp(10px, 2.85dvh, 29px) !important;
    font-weight: 800 !important;
    letter-spacing: 0.025em !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    color: #f2fbff !important;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.18), 0 0 24px rgba(0, 245, 255, 0.16) !important;
  }

  body.live-fake-fullscreen #live .live-countdown-text em {
    display: block !important;
    margin-top: 2.4% !important;
    font-family: "Orbitron", sans-serif !important;
    font-size: clamp(5px, 1.38dvh, 8px) !important;
    font-style: normal !important;
    font-weight: 850 !important;
    letter-spacing: 0.1em !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    color: rgba(242, 251, 255, 0.82) !important;
    text-transform: uppercase !important;
  }

  body.live-fake-fullscreen #live .live-elapsed-time {
    top: 7.8% !important;
    left: 1.7% !important;
    width: 16% !important;
    text-align: center !important;
    overflow: hidden !important;
  }

  body.live-fake-fullscreen #live .live-elapsed-time strong {
    display: block !important;
    font-family: "Orbitron", sans-serif !important;
    font-size: clamp(7px, 2.05dvh, 12px) !important;
    font-weight: 800 !important;
    letter-spacing: 0.025em !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    color: #f2fbff !important;
    text-shadow: 0 0 10px rgba(0, 245, 255, 0.4), 0 0 22px rgba(0, 245, 255, 0.18) !important;
  }
}

/* =========================================================
   IPAD LIVE TEXT SIZE
   Betrifft iPad / Tablet, nicht Handy
   ========================================================= */

@media (min-width: 701px) and (max-width: 1180px) {
  #live .live-countdown-text span {
    font-size: clamp(12px, 6vw, 18px) !important;
    letter-spacing: 0.28em !important;
  }

  #live .live-countdown-text strong {
    font-size: clamp(21px, 5vw, 37px) !important;
    letter-spacing: 0.04em !important;
  }

  #live .live-countdown-text em {
    font-size: clamp(11px, 4vw, 17px) !important;
    letter-spacing: 0.24em !important;
  }

  #live .live-elapsed-time strong {
    font-size: clamp(14px, 6vw, 26px) !important;
    letter-spacing: 0.04em !important;
  }
}

/* IPAD FULLSCREEN ONLY */

@media (min-width: 701px) and (max-width: 1180px) {

  body.live-fake-fullscreen #live .live-countdown-text span,
  body.live-native-fullscreen #live .live-countdown-text span {
    font-size: clamp(12px, 5vw, 18px) !important;
  }

  body.live-fake-fullscreen #live .live-countdown-text strong,
  body.live-native-fullscreen #live .live-countdown-text strong {
    font-size: clamp(21px, 5vw, 37px) !important;
  }

  body.live-fake-fullscreen #live .live-countdown-text em,
  body.live-native-fullscreen #live .live-countdown-text em {
    font-size: clamp(11px, 4vw, 17px) !important;
  }

  body.live-fake-fullscreen #live .live-elapsed-time strong,
  body.live-native-fullscreen #live .live-elapsed-time strong {
    font-size: clamp(14px, 6vw, 26px) !important;
  }
}

/* TEST VIDEO INSIDE LIVE HUD */
.live-test-video {
  position: absolute !important;
  left: -5% !important;
  top: 6.9% !important;
  width: 88.6% !important;
  height: 72.5% !important;
  border: 0 !important;
  z-index: 2 !important;
  object-fit: cover !important;
  background: #111;
  opacity: 0;
  visibility: hidden;
  pointer-events: none !important;
  transition: opacity 300ms ease;
}

.live-stream-screen.live-is-started .live-test-video {
  opacity: 1;
  visibility: visible;
}

.live-stream-screen.live-before-start .live-bg-img,
.live-stream-screen.live-before-start .live-countdown-img,
.live-stream-screen.live-before-start .live-countdown-text {
  opacity: 1;
  visibility: visible;
}

.live-stream-screen.live-is-started .live-bg-img,
.live-stream-screen.live-is-started .live-countdown-img,
.live-stream-screen.live-is-started .live-countdown-text {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.live-stream-screen.is-live-state-active .live-countdown-text {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.live-bg-img {
  position: absolute;
  z-index: 1;
}

.live-countdown-img {
  position: absolute;
  z-index: 5;
}

.live-state-overlay {
  position: absolute;
  left: 1.6%;
  top: 6%;
  width: 79%;
  height: 79%;
  z-index: 6;
}

.live-overlay-img,
.logo-100km,
.live-100 {
  position: absolute;
  z-index: 7;
}

.live-data-layer {
  position: absolute;
  z-index: 7;
}

.live-fullscreen-button {
  position: absolute;
  z-index: 8;
}

.cyborg-music-launch-card {
  min-height: 220px;
  align-content: center;
}

.cyborg-music-launch-card .primary-btn {
  width: min(100%, 320px);
}

.cyborg-music-app-view {
  padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom) + 28px);
}

.cyborg-music-app-shell {
  min-height: min(980px, calc(100dvh - 180px));
  padding: clamp(18px, 4vw, 34px);
  border: 1px solid rgba(0, 245, 255, 0.28);
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 12%, rgba(0, 245, 255, 0.13), transparent 34%),
    linear-gradient(145deg, rgba(3, 9, 13, 0.98), rgba(0, 0, 0, 0.96));
  box-shadow: 0 0 40px rgba(0, 245, 255, 0.14), inset 0 0 34px rgba(0, 245, 255, 0.07);
}

.cyborg-music-app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: clamp(20px, 4vw, 34px);
}

.cyborg-music-app-header h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(2rem, 8vw, 5rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.cyborg-music-app-header p:not(.eyebrow) {
  margin: 10px 0 0;
  color: var(--muted);
}

.cyborg-music-app-layout {
  display: grid;
  gap: 18px;
}

.cyborg-music-player-panel,
.cyborg-music-playlist-panel {
  display: grid;
  gap: 18px;
  padding: clamp(16px, 4vw, 24px);
  border: 1px solid rgba(0, 245, 255, 0.18);
  border-radius: 22px;
  background: rgba(0, 0, 0, 0.42);
}

@media (min-width: 900px) {
  .cyborg-music-app-layout {
    grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1.1fr);
    align-items: start;
  }

  .cyborg-music-app-view .admin-music-cover {
    width: 160px;
  }

  .cyborg-music-app-view .admin-music-now-playing {
    grid-template-columns: 160px minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  .cyborg-music-app-header {
    display: grid;
  }

  .cyborg-music-app-header .secondary-btn {
    width: 100%;
  }
}

body.cyborg-music-app-open {
  overflow: hidden;
}

body.cyborg-music-app-open .topbar,
body.cyborg-music-app-open .bottom-nav {
  display: none !important;
}

body.cyborg-music-app-open #cyborgMusicAppView {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: block;
  overflow: auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background: #000;
}

.settings-music-logo-btn {
  width: 86px;
  height: 86px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 245, 255, 0.35);
  border-radius: 22px;
  background: rgba(0, 245, 255, 0.08);
  box-shadow: 0 0 22px rgba(0, 245, 255, 0.18);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.settings-music-logo-btn:hover,
.settings-music-logo-btn:focus-visible {
  border-color: rgba(0, 245, 255, 0.68);
  box-shadow: 0 0 28px rgba(0, 245, 255, 0.26);
  outline: none;
}

.settings-music-logo-btn:active {
  transform: scale(0.96);
}

.settings-music-logo {
  width: 68px;
  height: 68px;
  object-fit: contain;
  display: block;
}

@media (max-width: 420px) {
  .settings-music-logo-btn {
    width: 78px;
    height: 78px;
    border-radius: 20px;
  }

  .settings-music-logo {
    width: 62px;
    height: 62px;
  }
}

/* CYBORGFIT MOBILE PWA PROPORTION PASS */
html,
body {
  width: 100%;
  min-height: 100dvh;
  overflow-x: hidden;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

img,
video,
iframe,
canvas,
svg {
  max-width: 100%;
}

.app-shell {
  min-height: 100dvh;
  max-width: 1180px;
  padding-top: calc(clamp(14px, 3.8vw, 28px) + env(safe-area-inset-top));
  padding-inline: clamp(12px, 3.8vw, 26px);
  padding-bottom: calc(var(--bottom-nav-height, 88px) + env(safe-area-inset-bottom) + 34px);
}

.page.is-active {
  width: 100%;
  min-width: 0;
  padding-bottom: calc(var(--bottom-nav-height, 88px) + env(safe-area-inset-bottom) + 28px);
}

.card,
.admin-control-card,
.live-placeholder-panel,
.settings-card,
.settings-link-card,
.cyborg-music-app-shell,
.cyborg-music-player-panel,
.cyborg-music-playlist-panel {
  max-width: 100%;
  min-width: 0;
}

button,
.primary-btn,
.secondary-btn,
.danger-btn,
.nav-btn,
input,
textarea,
select {
  min-height: 44px;
  touch-action: manipulation;
}

.bottom-nav {
  left: max(10px, env(safe-area-inset-left));
  right: max(10px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  max-width: min(920px, calc(100vw - 20px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  margin-inline: auto;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: clamp(4px, 1.5vw, 8px);
  padding: clamp(8px, 2.4vw, 12px);
}

.nav-btn {
  min-width: 0;
  padding-inline: clamp(6px, 2vw, 16px);
  font-size: clamp(0.72rem, 2.8vw, 0.95rem);
  white-space: nowrap;
}

.live-stream-wrapper {
  width: 100%;
  max-width: 100%;
  overflow: visible;
  margin-inline: auto;
}

.live-stream-screen,
.live-hud-container {
  width: min(100%, 1180px);
  max-width: 100%;
  margin-inline: auto;
  aspect-ratio: 16 / 9;
  min-height: 0;
}

.live-test-video {
  max-width: none;
}

.admin-control-grid {
  grid-template-columns: minmax(0, 1fr);
  padding-bottom: calc(var(--bottom-nav-height, 88px) + env(safe-area-inset-bottom) + 34px);
}

.admin-inline-control,
.admin-button-grid,
.live-pause-presets {
  min-width: 0;
}

.cyborg-music-app-view {
  padding-bottom: calc(var(--bottom-nav-height, 88px) + env(safe-area-inset-bottom) + 34px);
}

.cyborg-music-app-header,
.cyborg-music-app-layout,
.admin-music-now-playing,
.admin-music-progress-area,
.admin-music-controls,
.admin-music-mode-controls,
.admin-music-playlist-header {
  min-width: 0;
}

.admin-music-info,
.admin-music-info h3,
.admin-music-artist,
.admin-music-position,
.admin-music-playlist-title,
.admin-music-playlist-artist {
  overflow-wrap: anywhere;
  word-break: normal;
}

.admin-music-progress-area input[type="range"] {
  width: 100%;
}

.admin-music-playlist {
  padding-bottom: calc(env(safe-area-inset-bottom) + 12px);
}

.settings-card {
  overflow: hidden;
}

.settings-music-logo-btn {
  flex: 0 0 auto;
}

.settings-link-card {
  overflow-wrap: anywhere;
}

body.cyborg-music-app-open #cyborgMusicAppView {
  width: 100vw;
  height: 100dvh;
  padding: max(14px, env(safe-area-inset-top)) clamp(12px, 3.4vw, 18px) max(14px, env(safe-area-inset-bottom));
  overscroll-behavior: contain;
}

body.cyborg-music-app-open .cyborg-music-app-shell {
  min-height: calc(100dvh - max(14px, env(safe-area-inset-top)) - max(14px, env(safe-area-inset-bottom)));
}

@media (max-width: 700px) {
  .app-shell {
    width: 100%;
    padding-inline: clamp(10px, 3.2vw, 16px);
    padding-bottom: calc(var(--bottom-nav-height, 88px) + env(safe-area-inset-bottom) + 42px);
  }

  .topbar {
    gap: clamp(12px, 3.5vw, 18px);
    margin-bottom: clamp(18px, 5vw, 28px);
  }

  .page.is-active {
    padding-bottom: calc(var(--bottom-nav-height, 88px) + env(safe-area-inset-bottom) + 40px);
  }

  .bottom-nav {
    min-height: auto;
    border-radius: clamp(22px, 7vw, 34px);
  }

  .nav-btn {
    min-height: 52px;
    border-radius: clamp(18px, 6vw, 28px);
    letter-spacing: 0.01em;
  }

  .live-view-page {
    min-height: auto;
  }

  .live-stream-wrapper {
    margin-bottom: calc(var(--bottom-nav-height, 88px) + env(safe-area-inset-bottom) + 20px);
  }

  #live .live-stream-screen {
    width: min(100%, 92vw);
    max-width: 92vw;
    border-radius: clamp(12px, 4vw, 18px);
  }

  #live .live-data-layer span {
    font-size: clamp(4px, 1.55vw, 9px);
    line-height: 1.05;
  }

  #live .live-data-layer strong {
    font-size: clamp(5px, 1.85vw, 11px);
    line-height: 1.05;
  }

  #live .live-countdown-text span {
    font-size: clamp(4px, 1.35vw, 8px) !important;
    letter-spacing: 0.22em !important;
  }

  #live .live-countdown-text strong {
    font-size: clamp(10px, 3.8vw, 22px) !important;
    letter-spacing: 0.045em !important;
  }

  #live .live-countdown-text em {
    font-size: clamp(4px, 1.32vw, 8px) !important;
    letter-spacing: 0.18em !important;
  }

  #live .live-elapsed-time span {
    font-size: clamp(3px, 1.1vw, 7px) !important;
    letter-spacing: 0.2em !important;
  }

  #live .live-elapsed-time strong {
    font-size: clamp(7px, 2.7vw, 16px) !important;
    letter-spacing: 0.035em !important;
  }

  .admin-control-grid,
  .settings-link-grid {
    gap: clamp(12px, 3.5vw, 16px);
  }

  .admin-control-card,
  .settings-card,
  .settings-link-card,
  .live-placeholder-panel {
    padding: clamp(16px, 4.5vw, 22px);
    border-radius: clamp(18px, 5.5vw, 24px);
  }

  .admin-button-grid,
  .live-pause-presets,
  .admin-inline-control {
    grid-template-columns: 1fr;
  }

  .cyborg-music-launch-card {
    min-height: 170px;
  }

  .cyborg-music-app-header h2 {
    font-size: clamp(2rem, 13vw, 3.4rem);
  }

  .cyborg-music-app-shell {
    min-height: auto;
    padding: clamp(14px, 4vw, 20px);
    border-radius: clamp(20px, 6vw, 28px);
  }

  .cyborg-music-player-panel,
  .cyborg-music-playlist-panel {
    padding: clamp(14px, 4vw, 18px);
    gap: 14px;
  }

  .cyborg-music-app-view .admin-music-now-playing {
    grid-template-columns: clamp(82px, 26vw, 112px) minmax(0, 1fr);
    gap: clamp(12px, 3.5vw, 16px);
  }

  .cyborg-music-app-view .admin-music-cover {
    width: clamp(82px, 26vw, 112px);
  }

  .admin-music-info h3 {
    font-size: clamp(1.05rem, 5vw, 1.45rem);
  }

  .admin-music-progress-area {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    gap: 8px;
    font-size: 0.84rem;
  }

  #adminMusicProgressBar {
    min-height: 44px;
  }

  .admin-music-controls,
  .admin-music-mode-controls {
    grid-template-columns: 1fr;
  }

  .admin-music-playlist li {
    min-height: 58px;
    padding: 12px 13px;
  }

  .settings-music-logo-btn {
    width: clamp(74px, 21vw, 86px);
    height: clamp(74px, 21vw, 86px);
    margin-bottom: clamp(14px, 4vw, 20px);
  }

  .settings-music-logo {
    width: 78%;
    height: 78%;
  }
}

@media (max-width: 390px) {
  .nav-btn {
    font-size: clamp(0.64rem, 2.9vw, 0.78rem);
    padding-inline: 4px;
  }

  .bottom-nav {
    gap: 3px;
    padding-inline: 7px;
  }

  #live .live-stream-screen {
    width: min(100%, 90vw);
    max-width: 90vw;
  }

  .cyborg-music-app-view .admin-music-now-playing {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .cyborg-music-app-view .admin-music-cover {
    width: min(62vw, 180px);
    justify-self: center;
  }
}

@media (orientation: landscape) and (max-height: 520px) {
  .app-shell {
    padding-top: calc(10px + env(safe-area-inset-top));
  }

  .bottom-nav {
    max-width: min(760px, calc(100vw - 28px));
  }

  #live .live-stream-screen {
    width: min(100%, calc((100dvh - 126px) * 16 / 9));
    max-width: min(100%, calc((100dvh - 126px) * 16 / 9));
  }

  .cyborg-music-app-header {
    margin-bottom: 14px;
  }

  .cyborg-music-app-header h2 {
    font-size: clamp(1.8rem, 7vw, 3rem);
  }
}

@media (min-width: 701px) {
  .bottom-nav {
    max-width: min(760px, calc(100vw - 32px));
  }
}

/* =========================================================
   NON-LIVE TYPOGRAPHY COMPACT PASS
   Live HUD / #live typography stays untouched.
   ========================================================= */

.auth-screen,
#route,
#fuel,
#timeline,
#admin,
#settings,
#cyborgMusicAppView {
  font-size: clamp(13px, 3.35vw, 15px);
  line-height: 1.45;
}

.auth-heading h1,
#route .page-title,
#fuel .page-title,
#timeline .page-title,
#admin .page-title,
#settings .page-title,
.cyborg-music-app-header h2 {
  font-size: clamp(2rem, 8vw, 3.4rem);
  line-height: 0.98;
  letter-spacing: 0.01em;
}

.auth-heading p:not(.eyebrow),
#route .section-subtitle,
#fuel .section-subtitle,
#timeline .section-subtitle,
#admin .section-subtitle,
#settings .section-subtitle,
.cyborg-music-app-header p:not(.eyebrow),
.settings-link-card p,
.admin-control-card p {
  font-size: clamp(0.78rem, 2.9vw, 0.92rem);
  line-height: 1.45;
}

.eyebrow,
.auth-profile-box span,
.settings-link-card span,
.admin-control-card label,
.admin-status-grid span,
#route label,
#fuel label,
#timeline label {
  font-size: clamp(0.68rem, 2.55vw, 0.78rem);
  line-height: 1.25;
  letter-spacing: 0.08em;
}

.auth-tab,
.auth-form button,
.primary-btn,
.secondary-btn,
.danger-btn,
.admin-control-card button,
.settings-link-card button,
.auth-profile-box button,
.cyborg-music-launch-card .primary-btn,
.cyborg-music-app-header .secondary-btn,
.admin-music-controls button,
.admin-music-toggle-row button {
  font-size: clamp(0.78rem, 2.85vw, 0.9rem);
  line-height: 1.1;
}

.nav-btn {
  font-size: clamp(0.74rem, 2.75vw, 0.9rem);
  line-height: 1.05;
}

.auth-form input,
.auth-form textarea,
.auth-form select,
.admin-control-card input,
.admin-control-card textarea,
.admin-control-card select,
#settings input,
#settings textarea,
#settings select {
  font-size: max(16px, 0.9rem);
}

.admin-control-card h2,
.settings-link-card h3,
.cyborg-music-launch-card h2,
.cyborg-music-player-panel h3,
.cyborg-music-playlist-panel h3,
#route h2,
#fuel h2,
#timeline h2 {
  font-size: clamp(1rem, 3.8vw, 1.28rem);
  line-height: 1.15;
  letter-spacing: 0.03em;
}

.auth-profile-box strong,
.admin-status-grid strong,
.settings-contact-line,
.settings-link-card strong,
#route strong,
#fuel strong,
#timeline strong {
  font-size: clamp(0.86rem, 3vw, 1rem);
  line-height: 1.25;
}

.admin-music-title,
.cyborg-music-app-view .admin-music-title {
  font-size: clamp(1.05rem, 4.8vw, 1.55rem);
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.admin-music-artist,
.admin-music-count,
.admin-music-time,
.cyborg-music-app-view .admin-music-artist,
.cyborg-music-app-view .admin-music-count,
.cyborg-music-app-view .admin-music-time {
  font-size: clamp(0.76rem, 2.7vw, 0.92rem);
  line-height: 1.3;
}

.admin-music-playlist-item,
.cyborg-music-app-view .admin-music-playlist-item {
  font-size: clamp(0.74rem, 2.65vw, 0.88rem);
  line-height: 1.25;
}

.admin-music-playlist-item strong,
.cyborg-music-app-view .admin-music-playlist-item strong {
  font-size: clamp(0.82rem, 2.9vw, 0.96rem);
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.admin-music-playlist-item span,
.cyborg-music-app-view .admin-music-playlist-item span {
  font-size: clamp(0.68rem, 2.45vw, 0.78rem);
  line-height: 1.2;
}

.terms-modal,
.settings-modal,
.modal-content,
.terms-modal-content,
.settings-modal-content {
  font-size: clamp(0.82rem, 2.9vw, 0.95rem);
  line-height: 1.5;
}

@media (max-width: 700px) {
  .auth-heading h1,
  #route .page-title,
  #fuel .page-title,
  #timeline .page-title,
  #admin .page-title,
  #settings .page-title,
  .cyborg-music-app-header h2 {
    font-size: clamp(1.8rem, 8.4vw, 2.7rem);
  }

  .admin-control-card,
  .settings-link-card,
  .auth-profile-box,
  .cyborg-music-player-panel,
  .cyborg-music-playlist-panel {
    font-size: 0.9rem;
  }

  .admin-music-title,
  .cyborg-music-app-view .admin-music-title {
    font-size: clamp(0.98rem, 4.7vw, 1.35rem);
  }

  .admin-music-controls button,
  .admin-music-toggle-row button {
    font-size: clamp(0.76rem, 3.15vw, 0.88rem);
  }
}

/* =========================================================
   NON-LIVE TYPOGRAPHY EXTRA COMPACT OVERRIDE
   Stronger pass. Does not target #live or .live-* HUD text.
   ========================================================= */

.auth-screen,
#route,
#fuel,
#timeline,
#admin,
#settings,
#cyborgMusicAppView {
  font-size: clamp(12px, 3vw, 14px) !important;
  line-height: 1.38 !important;
}

.auth-heading h1,
#route .page-title,
#fuel .page-title,
#timeline .page-title,
#admin .page-title,
#settings .page-title,
.cyborg-music-app-header h2 {
  font-size: clamp(1.55rem, 6.8vw, 2.55rem) !important;
  line-height: 0.98 !important;
}

.auth-heading p:not(.eyebrow),
#route .section-subtitle,
#fuel .section-subtitle,
#timeline .section-subtitle,
#admin .section-subtitle,
#settings .section-subtitle,
.cyborg-music-app-header p:not(.eyebrow),
.settings-link-card p,
.admin-control-card p {
  font-size: clamp(0.7rem, 2.45vw, 0.82rem) !important;
  line-height: 1.38 !important;
}

.eyebrow,
.auth-profile-box span,
.settings-link-card span,
.admin-control-card label,
.admin-status-grid span,
#route label,
#fuel label,
#timeline label {
  font-size: clamp(0.62rem, 2.15vw, 0.72rem) !important;
  line-height: 1.2 !important;
  letter-spacing: 0.06em !important;
}

.auth-tab,
.auth-form button,
.primary-btn,
.secondary-btn,
.danger-btn,
.admin-control-card button,
.settings-link-card button,
.auth-profile-box button,
.cyborg-music-launch-card .primary-btn,
.cyborg-music-app-header .secondary-btn,
.admin-music-controls button,
.admin-music-toggle-row button {
  font-size: clamp(0.7rem, 2.45vw, 0.8rem) !important;
  line-height: 1.05 !important;
}

.nav-btn {
  font-size: clamp(0.66rem, 2.35vw, 0.78rem) !important;
  line-height: 1 !important;
}

.admin-control-card h2,
.settings-link-card h3,
.cyborg-music-launch-card h2,
.cyborg-music-player-panel h3,
.cyborg-music-playlist-panel h3,
#route h2,
#fuel h2,
#timeline h2 {
  font-size: clamp(0.9rem, 3.15vw, 1.08rem) !important;
  line-height: 1.1 !important;
  letter-spacing: 0.02em !important;
}

.auth-profile-box strong,
.admin-status-grid strong,
.settings-contact-line,
.settings-link-card strong,
#route strong,
#fuel strong,
#timeline strong {
  font-size: clamp(0.78rem, 2.55vw, 0.9rem) !important;
  line-height: 1.2 !important;
}

.admin-music-title,
.cyborg-music-app-view .admin-music-title {
  font-size: clamp(0.86rem, 3.75vw, 1.12rem) !important;
  line-height: 1.08 !important;
  overflow-wrap: anywhere !important;
}

.admin-music-artist,
.admin-music-count,
.admin-music-time,
.cyborg-music-app-view .admin-music-artist,
.cyborg-music-app-view .admin-music-count,
.cyborg-music-app-view .admin-music-time {
  font-size: clamp(0.66rem, 2.25vw, 0.78rem) !important;
  line-height: 1.22 !important;
}

.admin-music-playlist-item,
.cyborg-music-app-view .admin-music-playlist-item {
  font-size: clamp(0.64rem, 2.2vw, 0.76rem) !important;
  line-height: 1.18 !important;
}

.admin-music-playlist-item strong,
.cyborg-music-app-view .admin-music-playlist-item strong {
  font-size: clamp(0.72rem, 2.45vw, 0.84rem) !important;
  line-height: 1.15 !important;
  overflow-wrap: anywhere !important;
}

.admin-music-playlist-item span,
.cyborg-music-app-view .admin-music-playlist-item span {
  font-size: clamp(0.6rem, 2vw, 0.68rem) !important;
  line-height: 1.12 !important;
}

.terms-modal,
.settings-modal,
.modal-content,
.terms-modal-content,
.settings-modal-content {
  font-size: clamp(0.72rem, 2.45vw, 0.84rem) !important;
  line-height: 1.42 !important;
}

@media (max-width: 700px) {
  .auth-heading h1,
  #route .page-title,
  #fuel .page-title,
  #timeline .page-title,
  #admin .page-title,
  #settings .page-title,
  .cyborg-music-app-header h2 {
    font-size: clamp(1.45rem, 6.8vw, 2.15rem) !important;
  }

  .admin-control-card,
  .settings-link-card,
  .auth-profile-box,
  .cyborg-music-player-panel,
  .cyborg-music-playlist-panel {
    font-size: 0.78rem !important;
  }

  .admin-music-title,
  .cyborg-music-app-view .admin-music-title {
    font-size: clamp(0.82rem, 3.8vw, 1.05rem) !important;
  }

  .admin-music-controls button,
  .admin-music-toggle-row button {
    font-size: clamp(0.66rem, 2.75vw, 0.76rem) !important;
  }
}

/* Admin viewer preview */
.viewer-admin-card {
  position: relative;
}

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

.viewer-stats-grid div {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(0, 245, 255, 0.18);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.4);
  box-shadow: inset 0 0 18px rgba(0, 245, 255, 0.04);
}

.viewer-stats-grid span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: clamp(0.62rem, 2.15vw, 0.72rem);
  font-weight: 850;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-transform: uppercase;
}

.viewer-stats-grid strong {
  display: block;
  color: var(--text);
  font-size: clamp(0.78rem, 2.55vw, 0.9rem);
  line-height: 1.2;
}

.viewer-list {
  display: grid;
  gap: 10px;
}

.viewer-empty-state {
  margin: 0;
  padding: 18px;
  border: 1px dashed rgba(0, 245, 255, 0.28);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.28);
  text-align: center;
}

@media (max-width: 720px) {
  .viewer-stats-grid {
    grid-template-columns: 1fr;
  }
}

.viewer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(0, 245, 255, 0.16);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.34);
}

.viewer-row.is-online {
  border-color: rgba(0, 245, 255, 0.38);
  box-shadow: inset 3px 0 0 rgba(0, 245, 255, 0.74);
}

.viewer-main,
.viewer-meta {
  min-width: 0;
}

.viewer-main strong,
.viewer-main span,
.viewer-meta span {
  display: block;
}

.viewer-main strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.viewer-main span,
.viewer-meta span {
  color: var(--muted);
  font-size: clamp(0.68rem, 2.25vw, 0.8rem);
  line-height: 1.35;
}

.viewer-meta {
  display: grid;
  gap: 5px;
  justify-items: end;
  text-align: right;
}

.viewer-role-pill {
  width: fit-content;
  padding: 4px 8px;
  border: 1px solid rgba(0, 245, 255, 0.24);
  border-radius: 999px;
  color: var(--primary) !important;
  text-transform: uppercase;
}

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

  .viewer-meta {
    justify-items: start;
    text-align: left;
  }
}
