:root {
  color-scheme: light;
  --ink: #1f2430;
  --muted: #6d7383;
  --paper: #f6f7fb;
  --panel: #ffffff;
  --line: #e1e4ec;
  --line-strong: #cfd5e1;
  --teal: #0f766e;
  --teal-strong: #0a5a54;
  --client-accent: #0f766e;
  --history-bg: #222826;
  --teal-dark: #202633;
  --mint: #f2f0ff;
  --green: #20834c;
  --coral: #d97820;
  --amber: #bf7a14;
  --charcoal: #151817;
  --charcoal-2: #222826;
  --soft-red: #fff4ea;
  --shadow: 0 20px 60px rgba(31, 36, 48, 0.12);
  --ticker-text: #ffffff;
  --ui-accent: #6d35d6;
  --ui-accent-strong: #5320b2;
  --ui-accent-soft: #f1ebff;
  --ui-warm: #ff9e1b;
  --ui-warm-soft: #fff3df;
  --ui-surface: #fbfbfe;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, rgba(109, 53, 214, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 158, 27, 0.06) 1px, transparent 1px),
    linear-gradient(135deg, #f8f7ff 0%, #fffdf8 100%);
  background-size: 42px 42px;
}

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

.auth-card {
  width: min(448px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 24px;
  display: grid;
  gap: 18px;
}

.auth-logo-panel {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #ece8f8;
  background: #ffffff;
  object-fit: cover;
}

.auth-card span,
.auth-card small {
  color: var(--muted);
  font-weight: 850;
}

.auth-card h1 {
  margin: 2px 0 0;
  font-size: 1.7rem;
}

.auth-card label {
  display: grid;
  gap: 6px;
}

.auth-card small.is-error {
  color: var(--coral);
}

.auth-card small.is-success {
  color: var(--green);
}

.app-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(220px, 0.7fr);
  align-items: center;
  gap: 20px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  position: relative;
  z-index: 30;
  backdrop-filter: blur(14px);
}

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

.brand-logo {
  width: clamp(128px, 13vw, 172px);
  height: auto;
  display: block;
  flex: 0 0 auto;
}

.brand-runtime-label {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.02em;
}

.main-tabs {
  display: grid;
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f6fb;
}

.tab-button {
  min-width: 112px;
  height: 42px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
}

.tab-button.is-active {
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 1px 4px rgba(31, 36, 48, 0.1);
}

.tab-button.is-active .tab-icon {
  color: var(--ui-accent);
}

.tab-icon {
  width: 16px;
  height: 16px;
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
}

.screen-icon {
  border: 2px solid currentColor;
  border-radius: 3px;
}

.screen-icon::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 2px;
  left: 2px;
  bottom: -5px;
  background: currentColor;
}

.grid-icon {
  background:
    linear-gradient(currentColor 0 0) 0 0 / 7px 7px,
    linear-gradient(currentColor 0 0) 9px 0 / 7px 7px,
    linear-gradient(currentColor 0 0) 0 9px / 7px 7px,
    linear-gradient(currentColor 0 0) 9px 9px / 7px 7px;
  background-repeat: no-repeat;
  border-radius: 2px;
}

.station-icon {
  border: 2px solid currentColor;
  border-radius: 50%;
}

.station-icon::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 2px;
  height: 10px;
  background: currentColor;
}

.topbar-actions {
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  min-width: 0;
}

.logout-button {
  min-height: 40px;
  border: 1px solid #f3d8b8;
  border-radius: 7px;
  background: #ffffff;
  color: var(--coral);
  padding: 0 14px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.logout-button[hidden] {
  display: none;
}

.logout-icon {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 2px solid currentColor;
  border-right: 0;
  border-radius: 4px 0 0 4px;
}

.logout-icon::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 7px;
  width: 11px;
  height: 2px;
  background: currentColor;
}

.logout-icon::after {
  content: "";
  position: absolute;
  right: -2px;
  top: 4px;
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
}

.station-logout-button {
  align-self: end;
  min-width: 86px;
}

.terminal-select {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.network-switch {
  min-height: 46px;
  display: grid;
  grid-template-columns: 42px max-content;
  column-gap: 9px;
  align-items: center;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.network-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.network-switch > span {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #cfdad4;
  position: relative;
  transition: background 160ms ease;
}

.network-switch > span::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(29, 36, 33, 0.24);
  transition: transform 160ms ease;
}

.network-switch input:checked + span {
  background: var(--ui-accent);
}

.network-switch input:checked + span::after {
  transform: translateX(18px);
}

.network-switch small {
  color: var(--ink);
  font-size: 0.78rem;
}

.terminal-select select,
label select,
label input,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  padding: 9px 11px;
  outline: none;
}

input[type="color"] {
  min-height: 40px;
  padding: 4px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--ui-accent);
}

textarea {
  resize: vertical;
  min-height: 108px;
}

label select:focus,
label input:focus,
textarea:focus,
.terminal-select select:focus {
  border-color: var(--ui-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-accent) 18%, transparent);
}

main {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.view {
  display: none;
  min-height: 100%;
}

.view.is-active {
  display: block;
  height: 100%;
}

html.player-mode,
body.player-mode {
  background: #000000;
  cursor: none;
}

body.player-mode .app-shell {
  height: 100dvh;
  min-height: 100dvh;
}

body.player-mode .topbar,
body.player-mode #cmsView,
body.player-mode #stationView {
  display: none !important;
}

body.station-mode .topbar,
body.station-mode #playerView,
body.station-mode #cmsView {
  display: none !important;
}

body.station-mode .app-shell {
  height: 100dvh;
  min-height: 100dvh;
}

body.master-mode .app-shell {
  height: 100dvh;
  min-height: 100dvh;
}

body.player-mode main {
  overflow: hidden;
}

body.station-mode main {
  overflow: hidden;
}

body.master-mode main {
  overflow: hidden;
}

body.player-mode #playerView {
  display: block !important;
  height: 100%;
}

body.station-mode #stationView {
  display: block !important;
  height: 100%;
}

body.player-mode .player-shell {
  height: 100dvh;
  min-height: 100dvh;
}

body.station-mode .station-shell {
  min-height: 100dvh;
  display: grid !important;
}

body.station-mode .desktop-warning {
  display: none !important;
}

.player-shell {
  height: 100%;
  min-height: 0;
  max-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  background: var(--charcoal);
  color: #eef7f2;
  overflow: hidden;
}

.blocked-screen {
  display: none;
}

.player-shell.is-service-blocked {
  grid-template-columns: 1fr;
  background: #000000;
}

.player-shell.is-service-blocked .media-stage,
.player-shell.is-service-blocked .history-panel {
  display: none;
}

.player-shell.is-service-blocked .blocked-screen {
  display: grid;
  place-items: center;
  min-height: 100%;
  background: #000000;
  color: #ffffff;
  text-align: center;
  padding: 32px;
}

.blocked-screen strong {
  max-width: 900px;
  font-size: clamp(2.2rem, 5vw, 5.8rem);
  line-height: 1.05;
  font-weight: 950;
}

.media-stage {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.player-logo-bar {
  position: absolute;
  left: 18px;
  top: 18px;
  z-index: 14;
  min-height: 104px;
  min-width: 154px;
  max-width: 190px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}

.logo-frame {
  width: 154px;
  height: 104px;
  border-radius: 0;
  background: transparent;
  display: grid;
  place-items: center;
  overflow: visible;
  color: var(--client-accent);
  font-weight: 950;
  font-size: 1.5rem;
}

.logo-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}

.player-logo-bar span,
.player-logo-bar strong {
  display: none;
}

.player-logo-bar span {
  color: #b8cbc3;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.player-logo-bar strong {
  margin-top: 3px;
  color: #ffffff;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-chrome {
  display: none;
  position: absolute;
  right: 18px;
  top: 18px;
  z-index: 14;
  min-height: 62px;
  max-width: min(420px, calc(100% - 520px));
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(10, 12, 11, 0.62);
  backdrop-filter: blur(12px);
}

.media-chrome span,
.media-chrome strong {
  display: block;
}

.media-chrome span {
  color: #a9bbb4;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.media-chrome strong {
  margin-top: 3px;
  color: #ffffff;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#mediaCachePill {
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(217, 244, 234, 0.12);
  color: #d9f4ea;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
  white-space: nowrap;
}

.media-visual {
  position: relative;
  flex: 1;
  min-height: 500px;
  padding: 120px 64px 150px;
  display: grid;
  align-content: center;
  overflow: hidden;
  isolation: isolate;
  background: #24322e;
}

.media-visual::before,
.media-visual::after {
  content: "";
  position: absolute;
  z-index: -1;
}

.media-visual::before {
  inset: 0;
  background:
    linear-gradient(90deg, rgba(9, 12, 11, 0.4), rgba(9, 12, 11, 0.1)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.08) 0,
      rgba(255, 255, 255, 0.08) 1px,
      transparent 1px,
      transparent 90px
    );
}

.media-visual::after {
  right: 4vw;
  bottom: 92px;
  width: 310px;
  height: 310px;
  border: 44px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}

.media-asset-layer {
  position: absolute;
  inset: 0 0 56px 0;
  z-index: 0;
}

.media-asset-layer img,
.media-asset-layer video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000000;
}

.has-uploaded-media {
  padding: 0;
  background: #000000;
}

.has-uploaded-media::before,
.has-uploaded-media::after,
.has-uploaded-media .visual-band,
.has-uploaded-media .visual-content,
.has-uploaded-media .visual-metrics {
  display: none;
}

.visual-band {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 56px;
  width: 18px;
  background: var(--client-accent);
  z-index: 1;
}

.visual-content {
  position: relative;
  z-index: 1;
  width: min(760px, 72%);
}

.visual-content span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #e5fff4;
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.visual-content h1 {
  margin: 22px 0 16px;
  max-width: 11ch;
  font-size: 4.4rem;
  line-height: 0.96;
  letter-spacing: 0;
}

.visual-content p {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.22rem;
  line-height: 1.55;
}

.visual-metrics {
  position: relative;
  z-index: 1;
  margin-top: 38px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.metric-tile {
  width: 148px;
  min-height: 92px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(10, 12, 11, 0.24);
  backdrop-filter: blur(8px);
}

.metric-tile strong {
  display: block;
  font-size: 1.35rem;
}

.metric-tile span {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.82rem;
}

.theme-care {
  background:
    linear-gradient(135deg, #1f4d44 0%, #466943 52%, #984c43 100%);
}

.theme-prevention {
  background:
    linear-gradient(135deg, #20453e 0%, #3e7a6c 48%, #c69d3b 100%);
}

.theme-comfort {
  background:
    linear-gradient(135deg, #253734 0%, #6f7c5b 54%, #b35a48 100%);
}

.is-logo-fallback .visual-band,
.is-logo-fallback .visual-content,
.is-logo-fallback .visual-metrics,
.is-logo-fallback::before,
.is-logo-fallback::after {
  display: none;
}

.fallback-logo {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  background: #f8fbf9;
  color: var(--ink);
}

.fallback-logo img {
  width: min(360px, 42vw);
  height: min(220px, 28vh);
  object-fit: contain;
  background: transparent;
}

.fallback-logo span {
  width: 180px;
  height: 180px;
  border-radius: 0;
  background: transparent;
  color: var(--client-accent);
  display: grid;
  place-items: center;
  font-size: 4.2rem;
  font-weight: 950;
}

.fallback-logo strong {
  font-size: 2.2rem;
}

.call-overlay {
  position: absolute;
  left: 50%;
  top: 47%;
  width: min(775px, calc(100% - 64px));
  min-height: 375px;
  transform: translate(-50%, -50%) scale(0.96);
  padding: 46px 30px 42px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  color: var(--ink);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
}

.call-overlay.is-visible {
  animation: callBlink 4.5s ease-in-out both;
}

@keyframes callBlink {
  0%,
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.98);
  }
  7%,
  25%,
  42%,
  60%,
  77%,
  93% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  17%,
  34%,
  51% {
    opacity: 0.72;
    transform: translate(-50%, -50%) scale(1.015);
  }
}

.call-overlay span {
  color: var(--muted);
  font-size: 1.25rem;
  font-weight: 900;
  text-transform: uppercase;
}

.call-overlay strong {
  display: block;
  margin-top: 2px;
  font-size: 10.6rem;
  line-height: 0.9;
  font-weight: 950;
}

.call-overlay small {
  display: block;
  margin-top: 18px;
  color: var(--teal-dark);
  font-size: 2.6rem;
  font-weight: 850;
}

.status-widget {
  position: absolute;
  left: 0;
  bottom: 56px;
  width: 138px;
  height: 138px;
  border-radius: 50%;
  color: var(--ink);
  display: grid;
  place-items: center;
  align-content: center;
  z-index: 12;
  border: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.status-widget strong {
  font-size: 2.45rem;
  line-height: 1;
}

.status-widget span {
  margin-top: 8px;
  color: currentColor;
  opacity: 0.72;
  font-size: 0.82rem;
  font-weight: 850;
}

.clock-solid {
  background: rgba(255, 255, 255, 0.94);
}

.clock-accent {
  background: var(--client-accent);
  color: #ffffff;
}

.clock-light {
  background: #f7fbf8;
  color: var(--teal-dark);
}

.clock-contrast {
  background: #0f1312;
  color: #ffffff;
}

.clock-outline {
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  border-top: 4px solid var(--client-accent);
  border-right: 4px solid var(--client-accent);
}

.ticker {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 56px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--client-accent);
  color: var(--ticker-text);
  border-top: 1px solid color-mix(in srgb, var(--ticker-text) 24%, transparent);
  z-index: 80;
  pointer-events: none;
  transform: translateZ(0);
}

.ticker-track {
  display: inline-flex;
  width: max-content;
  white-space: nowrap;
  transform: translate3d(0, 0, 0);
  will-change: transform;
  font-size: 1.06rem;
  font-weight: 850;
  animation: tickerScroll var(--ticker-duration, 32s) linear infinite;
}

.ticker-segment {
  flex: 0 0 var(--ticker-segment-width, 100vw);
  width: var(--ticker-segment-width, 100vw);
  display: inline-flex;
  align-items: center;
  overflow: visible;
  white-space: nowrap;
}

.ticker-text {
  flex: 0 0 auto;
  display: inline-block;
  padding-left: 24px;
}

@keyframes tickerScroll {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(var(--ticker-distance, -100vw), 0, 0);
  }
}

.history-panel {
  min-height: 0;
  height: 100%;
  max-height: 100dvh;
  padding: 22px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  background: var(--history-bg);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 18px;
  overflow: hidden;
}

.panel-heading,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.panel-heading span,
.section-heading span,
.station-header span,
.subheading span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.history-panel .panel-heading span {
  color: #d4e3dd;
}

.panel-heading strong,
.sync-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(217, 244, 234, 0.12);
  color: #b9f0d9;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.current-call {
  min-height: 218px;
  padding: 24px;
  border-radius: 8px;
  background: #f7fbf8;
  color: var(--ink);
  display: grid;
  align-content: center;
}

.current-call span {
  color: var(--muted);
  font-size: 0.87rem;
  font-weight: 900;
  text-transform: uppercase;
}

.current-call strong {
  margin-top: 8px;
  color: var(--green);
  font-size: 5.3rem;
  line-height: 0.95;
  font-weight: 950;
}

.current-call small {
  margin-top: 10px;
  color: var(--teal-dark);
  font-size: 1.15rem;
  font-weight: 850;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

.history-list li {
  min-height: 86px;
  max-height: 96px;
  padding: 14px 15px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  grid-template-columns: 98px 1fr;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.history-list strong {
  font-size: 1.68rem;
}

.history-list span {
  font-size: 1.04rem;
}

.history-list span,
.history-list small {
  display: block;
  color: #eef7f2;
}

.history-list small {
  grid-column: 2;
  color: #c3d7cf;
  font-size: 0.9rem;
}

.empty-history strong,
.empty-history span,
.empty-history small {
  color: #c3d7cf;
}

.cms-shell {
  height: 100%;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  background: var(--paper);
}

.cms-sidebar {
  padding: 18px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(109, 53, 214, 0.03) 0%, rgba(255, 158, 27, 0.03) 100%),
    #ffffff;
  display: grid;
  grid-auto-rows: min-content;
  align-content: stretch;
  gap: 8px;
}

.cms-nav-button {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  text-align: left;
  font-weight: 850;
}

.cms-nav-button.is-active {
  border-color: #dacdfc;
  background: var(--ui-accent-soft);
  color: var(--ui-accent-strong);
  box-shadow: inset 3px 0 0 var(--ui-warm);
}

.cms-logout-button {
  width: 100%;
  justify-content: flex-start;
  margin-top: auto;
  border-color: transparent;
  background: transparent;
  padding: 0 12px;
  text-align: left;
}

.cms-pages {
  min-width: 0;
  overflow: auto;
}

.cms-page {
  display: none;
  padding: 24px;
}

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

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.1fr) minmax(320px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.dashboard-telemetry-only {
  grid-template-columns: minmax(420px, 860px);
}

.cms-layout {
  display: grid;
  gap: 18px;
  align-items: start;
}

.media-page-layout {
  grid-template-columns: minmax(420px, 1.35fr) minmax(320px, 0.95fr);
}

.queue-page-layout {
  grid-template-columns: minmax(360px, 1fr) minmax(320px, 0.85fr);
}

.single-page-layout {
  grid-template-columns: minmax(420px, 760px);
}

.queue-terminal-panel,
.ticker-panel {
  grid-column: 1 / -1;
}

.workspace-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 20px;
  box-shadow: 0 8px 24px rgba(29, 36, 33, 0.06);
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading h2,
.station-header h2 {
  margin: 4px 0 0;
  font-size: 1.15rem;
}

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

.dashboard-action {
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
  padding: 14px;
  text-align: left;
}

.dashboard-action strong,
.dashboard-action span {
  display: block;
}

.dashboard-action strong {
  font-size: 1rem;
}

.dashboard-action span {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.4;
}

.asset-editor-form.is-empty input,
.asset-editor-form.is-empty textarea,
.asset-editor-form.is-empty select {
  opacity: 0.7;
}

.media-upload-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(260px, 1.15fr);
  gap: 14px;
  align-items: stretch;
}

.upload-drop {
  min-height: 88px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: #f8fbf9;
  padding: 14px;
  display: grid;
  gap: 5px;
  cursor: pointer;
}

.upload-drop input[type="file"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.upload-drop span,
.editor-grid label span,
.wide-label span,
.config-row label span,
.identity-config label span,
.sound-grid label span,
.clinic-appearance-grid label span,
.category-row label span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.upload-drop strong {
  color: var(--teal-dark);
}

.upload-drop small {
  color: var(--muted);
}

.asset-preview {
  min-height: 168px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  display: grid;
  place-items: center;
  color: var(--muted);
  overflow: hidden;
}

.asset-preview img,
.asset-preview video {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  display: block;
  background: transparent;
}

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

.editor-grid label,
.wide-label,
.config-row label,
.station-header label,
.identity-config label,
.sound-grid label {
  display: grid;
  gap: 6px;
}

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

.is-hidden {
  display: none !important;
}

.identity-config {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.target-box {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.subheading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 16px 0 12px;
}

.subheading small {
  color: var(--muted);
}

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

.target-option {
  min-height: 58px;
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.target-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.target-option strong,
.target-option small {
  display: block;
}

.target-option small {
  margin-top: 2px;
  color: var(--muted);
}

.clinic-config-card {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 18px;
}

.clinic-appearance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.clinic-appearance-grid label {
  display: grid;
  gap: 6px;
}

.action-row {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 42px;
  border-radius: 7px;
  border: 1px solid transparent;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 850;
}

.primary-button {
  background: var(--teal);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.secondary-button {
  background: var(--ui-accent-soft);
  color: var(--ui-accent-strong);
  border-color: #d9ccfb;
}

.ghost-button {
  background: #fff5f3;
  color: #bf3e2d;
  border-color: #f1b4aa;
}

.full-width {
  width: 100%;
  margin-top: 16px;
}

.plus-small {
  position: relative;
  width: 14px;
  height: 14px;
  display: inline-block;
}

.plus-small::before,
.plus-small::after {
  content: "";
  position: absolute;
  background: currentColor;
  border-radius: 2px;
}

.plus-small::before {
  width: 14px;
  height: 2px;
  left: 0;
  top: 6px;
}

.plus-small::after {
  width: 2px;
  height: 14px;
  left: 6px;
  top: 0;
}

.asset-list,
.telemetry-list,
.terminal-management-list {
  display: grid;
  gap: 10px;
}

.clients-list {
  display: grid;
  gap: 12px;
}

.client-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  background: #ffffff;
  text-align: left;
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  overflow: hidden;
}

.client-card.is-selected {
  border-color: var(--ui-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-accent) 10%, transparent);
}

.client-card-accent {
  background: var(--client-card-color, var(--ui-accent));
}

.client-card-body {
  min-height: 92px;
  padding: 14px 16px;
}

.client-card-content {
  display: grid;
  gap: 14px;
}

.client-card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.client-card-title-stack {
  min-width: 0;
}

.client-card strong,
.client-card small,
.client-card em,
.client-code-pill {
  display: block;
}

.client-card small,
.client-card em {
  color: var(--muted);
}

.client-card small {
  margin-top: 4px;
}

.client-card-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.client-code-pill {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4a34a2;
  display: inline-flex;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 900;
}

.client-name-field {
  margin-top: 10px;
  display: grid;
  gap: 6px;
}

.client-name-field span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.client-name-field input {
  min-height: 42px;
  width: min(420px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
  background: #ffffff;
}

.client-card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.client-plan-pill {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--ui-accent-soft);
  color: var(--ui-accent-strong);
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 850;
}

.clients-panel .section-heading {
  align-items: center;
}

.asset-item {
  width: 100%;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
  text-align: left;
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 10px;
  align-items: center;
}

.asset-item.is-selected {
  border-color: var(--ui-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ui-accent) 12%, transparent);
}

.asset-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.asset-status.is-live {
  background: var(--green);
}

.asset-status.is-expired {
  background: var(--coral);
}

.asset-item strong,
.asset-item small,
.asset-item em {
  display: block;
}

.asset-item small {
  margin-top: 4px;
  color: var(--muted);
}

.asset-item em {
  color: var(--muted);
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 850;
  text-transform: uppercase;
}

.empty-card {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
  display: grid;
  place-items: center;
  padding: 16px;
  color: var(--muted);
  text-align: center;
}

.sync-pill {
  background: var(--mint);
  color: var(--teal-dark);
}

.sync-pill.is-flashing {
  background: #fff1cf;
  color: var(--amber);
}

.terminal-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.terminal-card[open] {
  background: #eef4f1;
  border-color: var(--line-strong);
}

.terminal-card summary {
  min-height: 78px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
}

.terminal-card summary strong,
.terminal-card summary small {
  display: block;
}

.terminal-card summary small {
  margin-top: 4px;
  color: var(--muted);
}

.terminal-card summary em {
  color: var(--teal-dark);
  font-style: normal;
  font-weight: 850;
}

.terminal-editor {
  padding: 18px 16px 16px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, #eef4f1 78%, #ffffff);
}

.logo-upload {
  margin-top: 0;
}

.logo-config-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(220px, 1.15fr);
  gap: 14px;
  align-items: stretch;
}

.terminal-logo-preview {
  min-height: 98px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
  display: grid;
  place-items: center;
}

.small-logo-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.small-logo-preview img {
  width: 70px;
  height: 70px;
  object-fit: contain;
}

.small-logo-preview span {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: var(--ui-accent);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 950;
}

.small-logo-preview strong {
  font-size: 1rem;
}

.category-list,
.queue-terminal-list,
.terminal-ticker-list {
  display: grid;
  gap: 10px;
}

.category-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 74px 72px 100px 100px auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
}

.category-row label {
  display: grid;
  gap: 6px;
}

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

.counter-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.85fr) minmax(280px, 1.4fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.counter-row label {
  display: grid;
  gap: 6px;
}

.counter-row label span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.counter-category-list {
  min-height: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.counter-category-option {
  min-height: 38px;
  display: inline-flex !important;
  flex-direction: row;
  align-items: center;
  gap: 7px !important;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8fbf9;
  color: var(--ink);
  font-weight: 800;
}

.counter-category-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--ui-accent);
}

.printer-status {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef3f0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.printer-status.is-enabled {
  background: var(--mint);
  color: var(--teal-dark);
}

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

.printer-module-grid label {
  display: grid;
  gap: 6px;
}

.printer-module-grid label span,
.printer-payload-preview span,
.printer-summary-card span,
.printer-category-card span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.printer-enable-option,
.printer-endpoint-field {
  grid-column: 1 / -1;
}

.printer-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.printer-category-list,
.printer-queue-list {
  display: grid;
  gap: 10px;
}

.printer-category-card,
.printer-queue-row {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.printer-category-card strong {
  display: block;
  margin-top: 2px;
  color: var(--category-color);
  font-size: 1.75rem;
  line-height: 1;
}

.printer-category-card small,
.printer-queue-row small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-weight: 750;
}

.printer-summary-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.printer-summary-card {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.printer-summary-card strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 1.55rem;
}

.printer-queue-list {
  margin-top: 16px;
}

.printer-queue-row {
  grid-template-columns: 56px minmax(0, 1fr) auto;
  min-height: 58px;
}

.printer-queue-row > span {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--category-color) 14%, #ffffff);
  color: var(--category-color);
  font-weight: 950;
}

.printer-payload-preview {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.printer-payload-preview pre {
  margin: 8px 0 0;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--ink);
  font: 0.86rem/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.counter-config {
  display: grid;
  gap: 12px;
}

.config-row {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 130px repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: center;
}

.sound-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.check-option {
  min-height: 40px;
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 9px !important;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
}

.check-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--coral);
}

.volume-field {
  grid-column: 1 / -1;
}

.telemetry-row {
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 10px;
}

.telemetry-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.telemetry-dot.is-online {
  background: var(--green);
}

.telemetry-dot.is-warning {
  background: var(--amber);
}

.telemetry-dot.is-blocked {
  background: var(--coral);
}

.telemetry-row strong,
.telemetry-row small,
.telemetry-meta span {
  display: block;
}

.telemetry-row small,
.telemetry-meta {
  color: var(--muted);
}

.telemetry-meta {
  text-align: right;
  font-size: 0.8rem;
  font-weight: 750;
}

.remote-link {
  margin-top: 6px;
  min-height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #ffffff;
  color: var(--teal-dark);
  padding: 0 9px;
  font-size: 0.78rem;
  font-weight: 850;
}

.station-shell {
  min-height: calc(100vh - 73px);
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    linear-gradient(90deg, rgba(109, 53, 214, 0.06) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 158, 27, 0.06) 1px, transparent 1px),
    linear-gradient(135deg, #f8f7ff 0%, #fffdf8 100%);
  background-size: 42px 42px;
}

.station-panel {
  width: min(900px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 24px;
}

.station-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.station-brand-logo {
  width: clamp(156px, 24vw, 220px);
  height: auto;
  display: block;
}

.station-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.station-header label {
  width: 210px;
}

.station-counter-field {
  display: block;
  width: min(360px, 100%);
  margin-top: 6px;
}

.station-counter-label {
  display: block;
  min-height: 46px;
  border: 1px solid color-mix(in srgb, var(--ui-accent) 38%, var(--line-strong));
  border-radius: 7px;
  background: color-mix(in srgb, var(--ui-accent) 9%, #ffffff);
  color: var(--ui-accent-strong);
  padding: 9px 11px;
  font-size: 1.15rem;
  font-weight: 950;
}

.station-category-select {
  display: none !important;
}

.station-ticket {
  min-height: 250px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.station-ticket span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: uppercase;
}

.station-ticket strong {
  margin-top: 10px;
  font-size: 7rem;
  line-height: 0.95;
  font-weight: 950;
}

.station-ticket small {
  margin-top: 12px;
  color: var(--teal-dark);
  font-size: 1rem;
  font-weight: 850;
}

.station-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.station-category-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.station-category-button {
  min-height: 72px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: color-mix(in srgb, var(--category-color) 14%, #ffffff);
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
}

.station-category-button strong,
.station-category-button span {
  display: block;
}

.station-category-button strong {
  font-size: 1rem;
}

.station-category-button span {
  margin-top: 4px;
  color: var(--category-color);
  font-size: 1.35rem;
  font-weight: 950;
}

.station-category-button small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-weight: 850;
}

.station-category-button.is-active {
  border-color: var(--category-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--category-color) 16%, transparent);
}

.call-button {
  min-height: 120px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 950;
}

.next-button {
  background: var(--teal);
}

.recall-button {
  background: var(--coral);
}

.return-button {
  background: #ffffff;
  color: #bf3e2d;
  border: 2px solid #f1b4aa;
}

.desktop-warning {
  display: none;
  padding: 18px;
  margin: 18px;
  border: 1px solid #efc6bd;
  border-radius: 8px;
  background: var(--soft-red);
  color: var(--coral);
  font-weight: 850;
}

.save-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  min-height: 46px;
  display: grid;
  place-items: center;
  padding: 0 18px;
  border-radius: 8px;
  background: var(--teal-dark);
  color: #ffffff;
  box-shadow: var(--shadow);
  font-weight: 850;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.save-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.client-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(17, 24, 22, 0.48);
  display: grid;
  place-items: center;
  padding: 24px;
}

.client-modal-backdrop[hidden] {
  display: none !important;
}

.client-modal {
  width: min(760px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 64px rgba(29, 36, 33, 0.24);
  padding: 22px;
}

.client-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.client-modal-header span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.client-modal-header h2 {
  margin: 6px 0 0;
  font-size: 1.4rem;
}

.client-modal-close {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  display: grid;
  place-items: center;
}

.client-modal-close span {
  font-size: 1.45rem;
  line-height: 1;
  transform: rotate(45deg);
}

.client-modal-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.client-modal-hero,
.client-modal-stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf9;
  padding: 16px;
}

.client-modal-hero {
  grid-column: 1 / -1;
  background:
    linear-gradient(135deg, rgba(109, 53, 214, 0.04), rgba(255, 158, 27, 0.06)),
    #f8fbf9;
}

.client-modal-hero strong,
.client-modal-stat strong,
.client-modal-hero small,
.client-modal-stat span {
  display: block;
}

.client-modal-hero strong {
  margin-top: 12px;
  font-size: 1.25rem;
}

.client-modal-hero small,
.client-modal-stat span {
  margin-top: 6px;
  color: var(--muted);
}

.client-modal-stat span {
  margin-top: 0;
  font-size: 0.78rem;
  font-weight: 850;
}

.client-modal-stat strong {
  margin-top: 8px;
  font-size: 1.1rem;
}

.client-modal-status {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 900;
}

.client-modal-status.is-good {
  background: #ddf7e8;
  color: #15703c;
}

.client-modal-status.is-warning {
  background: #fff2d6;
  color: #a06007;
}

.client-modal-status.is-danger {
  background: #ffe0dc;
  color: #b93828;
}

body.has-client-modal {
  overflow: hidden;
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .main-tabs {
    width: 100%;
  }

  .topbar-actions {
    justify-self: stretch;
    justify-content: space-between;
  }

  .player-shell {
    grid-template-columns: 1fr;
  }

  .player-logo-bar {
    min-width: 154px;
  }

  .media-chrome {
    max-width: 340px;
  }

  .history-panel {
    min-height: auto;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

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

  .cms-shell,
  .dashboard-grid,
  .media-page-layout,
  .queue-page-layout,
  .single-page-layout {
    grid-template-columns: 1fr;
  }

  .cms-sidebar {
    grid-auto-flow: column;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .cms-nav-button,
  .cms-logout-button {
    white-space: nowrap;
  }

  .cms-logout-button {
    width: auto;
    margin-top: 0;
  }

  .queue-terminal-panel,
  .ticker-panel {
    grid-column: auto;
  }

  .client-modal-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .client-card-header {
    display: grid;
  }

  .client-card-meta {
    justify-items: start;
  }

  .client-name-field input {
    width: 100%;
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .topbar {
    padding: 12px;
  }

  .brand-block {
    align-items: flex-start;
    gap: 10px;
  }

  .brand-logo {
    width: 124px;
  }

  .brand-runtime-label {
    white-space: normal;
  }

  .main-tabs {
    grid-auto-flow: row;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tab-button {
    min-width: 0;
    padding: 0 6px;
  }

  .media-visual {
    min-height: 520px;
    padding: 118px 22px 150px;
  }

  .media-visual::after {
    width: 180px;
    height: 180px;
    border-width: 28px;
  }

  .player-logo-bar {
    left: 12px;
    right: auto;
    min-width: 0;
    max-width: 150px;
  }

  .logo-frame {
    width: 150px;
    height: 96px;
  }

  .media-chrome {
    left: 12px;
    right: 12px;
    top: 88px;
    max-width: none;
  }

  .visual-content {
    width: 100%;
  }

  .visual-content h1 {
    font-size: 3rem;
  }

  .call-overlay {
    min-height: 300px;
  }

  .call-overlay strong {
    font-size: 6.2rem;
  }

  .call-overlay small {
    font-size: 1.7rem;
  }

  .status-widget {
    width: 124px;
    height: 124px;
  }

  .status-widget strong {
    font-size: 2rem;
  }

  .history-list,
  .editor-grid,
  .media-upload-grid,
  .clinic-appearance-grid,
  .logo-config-grid,
  .station-actions,
  .counter-row,
  .config-row,
  .sound-grid,
  .printer-module-grid,
  .printer-summary-grid,
  .printer-category-card,
  .printer-queue-row,
  .category-row {
    grid-template-columns: 1fr;
  }

  .client-card-body {
    align-items: start;
    flex-direction: column;
  }

  .client-card-meta {
    justify-items: start;
  }

  .cms-page {
    padding: 14px;
  }

  .client-modal-backdrop {
    padding: 12px;
  }

  .client-modal {
    padding: 16px;
  }

  .station-shell {
    display: none;
  }

  .desktop-warning {
    display: block;
  }
}
