.gsr-shell {
  --ink: #172229;
  --muted: #53616b;
  --paper: #f7f2e4;
  --steel: #7d8790;
  --signal: #d68e45;
  --green: #61ab81;
  --card: #fff;
  --panel: #f9faf7;
  --soft: #f5f7f6;
  --cloth: #ece4d2;
  --range-bg: #eef1ee;
  --border: rgba(23, 34, 41, 0.12);
  --border-soft: rgba(23, 34, 41, 0.1);
  --shadow: rgba(23, 34, 41, 0.08);

  color: var(--ink);
  margin: 0 auto;
  padding: 0.75rem;
  width: 100%;
}

.gsr-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 18px 44px var(--shadow);
  display: grid;
  gap: 0.75rem;
  overflow: hidden;
  padding: 0.75rem;
}

.gsr-visual {
  background: var(--cloth);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  overflow: hidden;
}

.gsr-target-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 0.85rem 1rem;
}

.gsr-target-head span,
.gsr-target-head strong {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.gsr-target-head strong {
  color: var(--muted);
}

#gsr-canvas {
  aspect-ratio: 1;
  display: block;
  height: auto;
  object-fit: contain;
  width: 100%;
}

.gsr-controls {
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  display: grid;
  gap: 0.75rem;
  padding: 0.75rem;
}

.gsr-slider,
.gsr-select {
  display: grid;
  gap: 0.55rem;
}

.gsr-unit-toggle {
  background: var(--soft);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  display: grid;
  gap: 0.25rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 0.25rem;
}

.gsr-unit-toggle button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: inherit;
  min-height: 36px;
  text-transform: uppercase;
}

.gsr-unit-toggle button[data-active="true"] {
  background: var(--card);
  box-shadow: 0 8px 18px var(--shadow);
  color: var(--ink);
}

.gsr-slider span,
.gsr-select span,
.gsr-reading small,
.gsr-metrics span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.gsr-slider strong {
  font-size: 1.85rem;
  line-height: 1;
}

.gsr-slider input {
  accent-color: var(--signal);
  width: 100%;
}

.gsr-select select {
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink);
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
}

.gsr-cone {
  align-items: center;
  background: linear-gradient(90deg, #101820, #25353d);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 22px 1fr 8px;
  min-height: 86px;
  overflow: hidden;
  padding: 0.75rem;
  position: relative;
}

.gsr-muzzle {
  background: #cfd5d7;
  border-radius: 3px;
  height: 42px;
  width: 18px;
  z-index: 2;
}

.gsr-cone-beam {
  background: linear-gradient(90deg, rgba(214, 142, 69, 0.9), rgba(97, 171, 129, 0.08));
  clip-path: polygon(0 42%, 100% 0, 100% 100%, 0 58%);
  height: 64px;
  transform-origin: left center;
  transition: transform 180ms ease;
}

.gsr-plane {
  background: var(--paper);
  height: 64px;
  opacity: 0.9;
  width: 8px;
}

.gsr-reading {
  border-left: 5px solid var(--signal);
  display: grid;
  gap: 0.45rem;
  padding-left: 0.9rem;
}

.gsr-reading h3 {
  font-size: 1.08rem;
  margin: 0;
}

.gsr-reading p,
.gsr-disclaimer {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  margin: 0;
}

.gsr-metrics {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gsr-metrics div {
  background: var(--soft);
  border-radius: 8px;
  display: grid;
  gap: 0.35rem;
  min-height: 72px;
  padding: 0.7rem;
}

.gsr-metrics strong {
  font-size: 1.55rem;
}

.gsr-range-strip {
  display: grid;
  gap: 0.4rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gsr-range-strip span {
  background: var(--range-bg);
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.65rem;
  text-align: center;
  text-transform: uppercase;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.gsr-range-strip span[data-active="true"] {
  background: var(--ink);
  color: #fff;
  transform: translateY(-1px);
}

.gsr-range-strip span:nth-child(2)[data-active="true"] {
  background: var(--signal);
}

.gsr-range-strip span:nth-child(3)[data-active="true"] {
  background: var(--green);
}

.gsr-range-strip span:nth-child(4)[data-active="true"] {
  background: var(--steel);
}

.gsr-disclaimer {
  border-top: 1px solid var(--border-soft);
  padding-top: 0.75rem;
}

.theme-dark .gsr-shell {
  --ink: #eef4f2;
  --muted: #a9b6b7;
  --paper: #ded2b5;
  --steel: #82909b;
  --signal: #f0a35a;
  --green: #77c696;
  --card: #12191d;
  --panel: #172126;
  --soft: #202b31;
  --cloth: #383329;
  --range-bg: #202b31;
  --border: rgba(238, 244, 242, 0.14);
  --border-soft: rgba(238, 244, 242, 0.1);
  --shadow: rgba(0, 0, 0, 0.32);
}

.theme-dark .gsr-cone {
  background: linear-gradient(90deg, #070b0d, #142127);
}

.theme-dark .gsr-muzzle {
  background: #d7dedc;
}

.theme-dark .gsr-plane {
  opacity: 0.82;
}

@media (min-width: 860px) {
  .gsr-shell {
    padding: 1rem;
  }

  .gsr-card {
    align-items: stretch;
    grid-template-columns: minmax(420px, 1fr) minmax(300px, 0.34fr);
  }

  .gsr-range-strip {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .gsr-disclaimer {
    grid-column: 1 / -1;
  }
}
