:root {
  color-scheme: dark;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #101010;
  color: #f4f1ea;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  overflow-y: auto;
  background: #101010;
}

button,
input {
  font: inherit;
}

.viewer-shell {
  display: block;
  width: 100%;
  min-height: 100svh;
  background: #101010;
}

.top-panel {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 4px 10px 5px;
  background: rgba(16, 16, 16, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.title-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 24px;
}

.viewer-title {
  position: absolute;
  left: 50%;
  width: min(68vw, 620px);
  transform: translateX(-50%);
  overflow: hidden;
  text-align: center;
  font-size: clamp(13px, 3.5vw, 20px);
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-title {
  color: #ff4a4a;
}

.course-title {
  color: #fffaf0;
}

.top-actions {
  z-index: 2;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 5px;
}

.download-link,
.version-link {
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #f4f1ea;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}

.version-link {
  color: #9fb0ff;
}

.group-number,
.quick-range {
  color: #2f55ff;
  font-weight: 900;
}

.gauge-panel {
  margin-top: 2px;
}

.gauge-labels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  color: #f3f0e7;
  font-size: 11px;
  font-weight: 800;
}

.gauge-labels span {
  text-align: center;
}

.group-gauge {
  width: 100%;
  height: 16px;
  margin: 0;
  accent-color: #2f55ff;
}

.gauge-actions {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 22px;
  width: 100%;
}

.group-controls {
  position: absolute;
  left: 50%;
  display: grid;
  grid-template-columns: 30px 46px 30px;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
}

.group-controls button,
.group-controls button {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  color: #f4f1ea;
  font-weight: 900;
  line-height: 1;
}

.group-controls button {
  height: 20px;
  font-size: 17px;
}

.group-number {
  height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  background: #f8f6f0;
  color: #395bff;
  text-align: center;
  font-size: 16px;
  line-height: 20px;
}

.quick-range {
  justify-self: end;
  max-width: 34vw;
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-stage {
  position: relative;
  display: block;
  min-height: 0;
  overflow: visible;
  background: #0b0b0b;
  touch-action: pan-y pinch-zoom;
}

#mainImage {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  max-height: none;
  margin: 0;
  user-select: none;
  -webkit-user-drag: none;
  vertical-align: top;
}


