:root{
  --bg:#ffffff;
  --panel:#ffffff;
  --muted:#6b7280;
  --text:#0f172a;
  --line:#e5e7eb;

  --thumb:#9ca3af;
  --thumb-border:#6b7280;
  --track:#d1d5db;
  --track-inner:#ffffff;

  --xline: rgba(17,24,39,.78);
  --arrow: rgba(15,23,42,.45);

  --ok-bg:#e7f5f0;
  --ok-text:#0f766e;
  --bad-bg:#fef2f2;
  --bad-text:#b91c1c;
}

*{ box-sizing:border-box; }
html, body{ height:100%; }

body{
  margin:0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.25 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  overflow:hidden;
}

.page{
  height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 12px;
}

.panel{
  width: min(980px, 96vw);
  height: min(820px, 96vh);
  background: var(--panel);
  border:1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 16px 50px rgba(15,23,42,.08);
  padding: 16px;
  display:flex;
  flex-direction:column;
  gap:14px;
}

.spans{
  position:relative;
  flex:1 1 auto;
  min-height:0;
  background: #ffffff;
  border:1px solid var(--line);
  border-radius: 14px;
  padding: 18px 18px 14px;
}

.span-row{ margin-bottom: 22px; }

.row-title{
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 10px;
}

.row-grid{
  display:grid;
  grid-template-columns: 70px 1fr;
  gap: 16px;
  align-items:center;
}

.value-box{
  width: 56px;
  height: 56px;
  border:2px solid #cbd5e1;
  border-radius: 8px;
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.track-wrap{ width:100%; }

.track-labels{
  display:flex;
  justify-content:space-between;
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 8px;
}

.track{ position:relative; padding: 6px 0; }

input[type="range"]{
  width:100%;
  margin:0;
  -webkit-appearance:none;
  appearance:none;
  background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track{
  height: 10px;
  background: var(--track-inner);
  border: 2px solid var(--track);
  border-radius: 999px;
}
input[type="range"]::-moz-range-track{
  height: 10px;
  background: var(--track-inner);
  border: 2px solid var(--track);
  border-radius: 999px;
}

input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none;
  appearance:none;
  width: 18px;
  height: 44px;
  margin-top: -19px;
  background: var(--thumb);
  border-radius: 6px;
  border: 2px solid var(--thumb-border);
}
input[type="range"]::-moz-range-thumb{
  width: 18px;
  height: 44px;
  background: var(--thumb);
  border-radius: 6px;
  border: 2px solid var(--thumb-border);
}

.ticks{
  display:grid;
  grid-template-columns: repeat(10, 1fr);
  margin-top: 10px;
  color:#111827;
  font-size: 16px;
}
.ticks span{ text-align:center; font-variant-numeric: tabular-nums; }

/* NEW: greyed-out tick labels outside “active” range */
.ticks span.inactive{
  color: rgba(17,24,39,.22);
}

/* Gap row */
.gap-row{
  display:grid;
  grid-template-columns: 70px 1fr;
  gap:16px;
  align-items:center;
  margin: -14px 0 10px;
}
.gap-spacer{ height:1px; }
.gap-canvas{ height:70px; }
#gapSvg{ width:100%; height:100%; display:block; }

/* Overlay */
.overlay{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  pointer-events:none;
}

/* Status */
.status{
  flex:0 0 auto;
  border-radius: 14px;
  padding: 14px 16px;
  display:flex;
  align-items:center;
  gap:10px;
  font-size: 18px;
  border: 1px solid var(--line);
}
.status.ok{
  background: var(--ok-bg);
  color: var(--ok-text);
  border-color: rgba(15,118,110,.25);
}
.status.bad{
  background: var(--bad-bg);
  color: var(--bad-text);
  border-color: rgba(185,28,28,.25);
}

.check{
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 700;
  background: rgba(15,118,110,.12);
}
.status.bad .check{ background: rgba(185,28,28,.12); }

@media (max-height: 820px){
  .row-title{ font-size: 20px; }
  .track-labels{ font-size: 14px; }
  .ticks{ font-size: 14px; }
  .value-box{ width: 52px; height: 52px; }
  .span-row{ margin-bottom: 18px; }
}
@media (max-height: 740px){
  .panel{ padding: 12px; }
  .spans{ padding: 14px; }
  .row-title{ font-size: 18px; }
  .status{ font-size: 16px; padding: 12px 14px; }
}
