:root {
  --bg: #060a09;
  --bezel: #0a0f0d;
  --panel: #0c1310;
  --panel-deep: #090f0d;
  --line: #22332c;
  --line-soft: #182620;
  --teal: #79e6d5;
  --teal-bright: #a6f4e7;
  --teal-dim: #2c4c45;
  --orange: #ff9a4d;
  --orange-dim: #5a3a1e;
  --cream: #d8cdab;
  --cream-deep: #b3a780;
  --green: #5fd79b;
  --text: #9fb4ac;
  --label: #7d948c;
  --font: 'Space Mono', 'Consolas', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: var(--bg);
  font-family: var(--font);
  color: var(--text);
  display: flex;
  gap: 14px;
  padding: 14px;
  min-width: 1220px;
  overflow: auto;
}

canvas { display: block; width: 100%; height: 100%; }

/* ---------- Sidebar ---------- */

#sidebar {
  width: 218px;
  flex: 0 0 218px;
  background: var(--cream);
  border-radius: 14px;
  border: 1px solid #3a3a32;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(60, 50, 20, 0.18);
}

.poster { overflow: hidden; }
.poster svg { display: block; width: 100%; height: 100%; }
.poster-top { height: 168px; flex: 0 0 auto; }
.poster-bottom { flex: 1 1 auto; min-height: 100px; display: flex; align-items: flex-end; }

/* Launch-pad smoke: each wisp swells, drifts up and to one side, fades. */
.wisp { opacity: 0; }
@keyframes wisp-drift-l {
  0%   { opacity: 0;    transform: translate(0, 0) scale(0.4); }
  12%  { opacity: 0.6; }
  100% { opacity: 0;    transform: translate(-10px, -24px) scale(1.9); }
}
@keyframes wisp-drift-r {
  0%   { opacity: 0;    transform: translate(0, 0) scale(0.4); }
  12%  { opacity: 0.52; }
  100% { opacity: 0;    transform: translate(9px, -20px) scale(1.7); }
}
.wisp.w1 { animation: wisp-drift-l 8s ease-out infinite; }
.wisp.w2 { animation: wisp-drift-r 10s ease-out 3.2s infinite; }
.wisp.w3 { animation: wisp-drift-l 9s ease-out 5.6s infinite; }
.wisp.w4 { animation: wisp-drift-r 8.5s ease-out 1.6s infinite; }
.wisp.w5 { animation: wisp-drift-l 9.5s ease-out 4.4s infinite; }
.wisp.w6 { animation: wisp-drift-r 7.5s ease-out 6.8s infinite; }

.brand { text-align: center; padding: 12px 8px 10px; }
.brand h1 {
  font-size: 25px;
  letter-spacing: 0.08em;
  color: #23312e;
  font-weight: 700;
}
.brand p {
  font-size: 8.5px;
  letter-spacing: 0.12em;
  white-space: nowrap;
  color: #55604f;
  margin-top: 2px;
}

#nav { display: flex; flex-direction: column; gap: 7px; padding: 10px 14px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  padding: 8px 12px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  color: #3c473f;
  cursor: pointer;
  text-align: left;
}
.nav-item svg { width: 15px; height: 15px; flex: 0 0 auto; }
.nav-item:hover { background: rgba(35, 49, 46, 0.08); }
.nav-item.active {
  background: #16211f;
  color: var(--teal);
  border-color: #3f5a54;
  box-shadow: 0 0 0 2px rgba(22, 33, 31, 0.25), 0 0 12px rgba(60, 120, 110, 0.35);
}

.status-box {
  margin: 8px 14px 12px;
  background: #10181688;
  background: #131d1a;
  border: 1px solid #2c3b36;
  border-radius: 8px;
  padding: 7px 11px 9px;
}
.status-label { font-size: 7.5px; letter-spacing: 0.2em; color: #718778; }
.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3px;
}
.status-row span:first-child {
  color: var(--green);
  font-size: 13px;
  letter-spacing: 0.12em;
  text-shadow: 0 0 8px rgba(95, 215, 155, 0.6);
}
.status-lamp {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: lamp 2.4s ease-in-out infinite;
}
.status-lamp.warn { background: var(--orange); box-shadow: 0 0 8px var(--orange); }
@keyframes lamp { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ---------- Main column ---------- */

#main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#frame {
  flex: 1 1 auto;
  min-height: 0;
  background: var(--bezel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Header */

#hdr {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 2px 4px 10px;
  border-bottom: 1px solid var(--line-soft);
}
.hdr-title {
  display: flex; align-items: center; gap: 10px; justify-self: start;
  font-size: 14px; letter-spacing: 0.22em; color: #cfe0da; font-weight: 700;
}
.hdr-right { justify-self: end; }

/* Start / Pause / Stop controls, centred at the top of the monitor */
.mon-controls { justify-self: center; display: flex; gap: 8px; }
.mon-btn {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--font); font-size: 11px; font-weight: 700; letter-spacing: 0.12em;
  padding: 9px 20px; border-radius: 8px; cursor: pointer; border: 1px solid transparent;
}
.mon-ico { font-size: 9px; letter-spacing: 0; }
.mon-btn.start { background: #22C55E; color: #052e16; }
.mon-btn.pause { background: #F59E0B; color: #2a1800; }
.mon-btn.stop  { background: #EF4444; color: #2a0808; }
.mon-btn.start:not(:disabled) { box-shadow: 0 0 14px rgba(34, 197, 94, 0.45); }
.mon-btn.pause:not(:disabled) { box-shadow: 0 0 14px rgba(245, 158, 11, 0.45); }
.mon-btn.stop:not(:disabled)  { box-shadow: 0 0 14px rgba(239, 68, 68, 0.45); }
.mon-btn:hover:not(:disabled) { filter: brightness(1.08); }
.mon-btn:disabled { opacity: 0.28; cursor: default; box-shadow: none; }
.live-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 9px var(--green);
  animation: lamp 1.6s ease-in-out infinite;
}
.hdr-right { display: flex; align-items: stretch; gap: 16px; }
.hdr-sep { width: 1px; background: var(--line-soft); }
.hdr-label { display: block; font-size: 8px; letter-spacing: 0.2em; color: var(--label); margin-bottom: 3px; }
.hdr-value { font-size: 12.5px; color: #d5e4de; letter-spacing: 0.06em; }
.hdr-endpoint { cursor: default; }
.hdr-endpoint .hdr-value i { font-style: normal; color: var(--label); margin-left: 8px; font-size: 10px; }
.hdr-started { text-align: left; }
.dm-elapsed { width: 92px; height: 14px; margin-top: 3px; }

/* Stat cards */

#stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: minmax(0, 1fr);   /* force the row to the basis, not the canvas */
  gap: 12px;
  flex: 0 0 108px;                       /* ~half height */
  min-height: 0;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px 6px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.stat-head { display: flex; align-items: baseline; gap: 8px; }
.stat-name { font-size: 11px; letter-spacing: 0.18em; color: #c8d9d2; font-weight: 700; }
.stat-unit { font-size: 9px; letter-spacing: 0.1em; color: var(--label); }
.badge {
  margin-left: auto;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--teal-dim);
  color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  background: rgba(121, 230, 213, 0.05);
}
.badge svg { width: 13px; height: 13px; }
.dm-big { flex: 1 1 0; min-height: 0; margin: 3px 0 3px; }
.stat-sub {
  display: flex; align-items: center; gap: 7px;
  font-size: 9px; letter-spacing: 0.1em; color: var(--label);
  border-top: 1px solid var(--line-soft);
  padding-top: 5px;
}
.stat-sub svg { width: 12px; height: 12px; color: var(--teal-dim); color: #55786f; flex: 0 0 auto; }

.stat-card.loss .badge { border-color: var(--orange-dim); color: var(--orange); background: rgba(255, 154, 77, 0.05); }
.stat-card.loss .stat-sub svg { color: #8a5c33; }

/* Panels shared */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.panel-title {
  font-size: 10.5px; letter-spacing: 0.2em; color: #c8d9d2; font-weight: 700;
}
.panel-title.centered { text-align: center; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; }

/* Mid row */

#mid-row {
  flex: 1.05 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 11fr) minmax(0, 4.6fr) minmax(0, 4.6fr);
  gap: 12px;
}

.legend { font-size: 8.5px; letter-spacing: 0.16em; color: var(--label); display: flex; align-items: center; gap: 6px; }
.legend .key { width: 14px; height: 2px; display: inline-block; margin-left: 10px; }
.legend .key-dl { background: var(--teal); box-shadow: 0 0 4px var(--teal); }
.legend .key-ul { background: var(--orange); box-shadow: 0 0 4px var(--orange); }
#chart { flex: 1 1 auto; min-height: 0; margin-top: 8px; }

#globe-wrap {
  border-radius: 10px;
  background: radial-gradient(circle at 50% 45%, #0d1714 0%, var(--panel-deep) 70%);
  min-width: 0; min-height: 0;
}

#stability-panel { align-items: stretch; }
.dm-stab { height: 34px; flex: 0 0 34px; margin-top: 10px; }
#stabRating {
  color: var(--green); font-size: 11px; letter-spacing: 0.1em;
  margin: 6px 0 4px; text-shadow: 0 0 8px rgba(95, 215, 155, 0.45);
}
#stabBars { flex: 1 1 auto; min-height: 0; }
.axis-note { font-size: 7.5px; letter-spacing: 0.18em; color: var(--label); margin-top: 6px; }

/* Bottom row */

#bottom-row {
  flex: 1.3 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 3.2fr) minmax(0, 4.4fr);
  gap: 12px;
}

#speed-panel .speed-body {
  flex: 1 1 auto; min-height: 0;
  display: flex; gap: 8px; margin-top: 6px;
}
.gyro-box {
  flex: 0 0 31%;
  background: var(--panel-deep);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  padding: 8px;
}
#gyro { width: 100%; height: 100%; max-height: 210px; }
.ring { transform-origin: 60px 62px; }
.r1 { animation: spin 14s linear infinite; }
.r2 { animation: spin 6s linear infinite; }
.r3 { animation: spin-rev 9s linear infinite; }
.r4 { animation: spin 11s linear infinite reverse; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes spin-rev { from { transform: rotate(360deg); } to { transform: rotate(0deg); } }

.gauge-box {
  flex: 1 1 auto; min-width: 0; min-height: 0;
  display: flex; flex-direction: column; align-items: center;
}
#gauge { flex: 1 1 auto; min-height: 0; }
.dm-gauge { width: 150px; height: 26px; flex: 0 0 26px; }
.gauge-unit { font-size: 10px; letter-spacing: 0.14em; color: var(--label); margin-top: 3px; }

#integrity-panel { align-items: stretch; }
#particles { flex: 1 1 auto; min-height: 0; margin-top: 4px; }
.stream-status {
  text-align: center; font-size: 12px; letter-spacing: 0.22em;
  color: var(--green); text-shadow: 0 0 8px rgba(95, 215, 155, 0.5);
  margin-top: 2px;
}
.stream-status.warn { color: var(--orange); text-shadow: 0 0 8px rgba(255, 154, 77, 0.5); }
.packets-line {
  text-align: center; font-size: 9px; letter-spacing: 0.16em;
  color: var(--label); margin-top: 5px;
}

#path-panel .path-scene { flex: 1 1 auto; min-height: 0; }
.path-scene svg { width: 100%; height: 100%; }
.flow { animation: dash 1.2s linear infinite; }
@keyframes dash { from { stroke-dashoffset: 16; } to { stroke-dashoffset: 0; } }
.path-label {
  fill: #c8d9d2; font-size: 9px; letter-spacing: 0.16em;
  text-anchor: middle; font-family: var(--font); font-weight: 700;
}
.path-sub { fill: var(--label); font-size: 7.5px; letter-spacing: 0.1em; text-anchor: middle; font-family: var(--font); }

.path-footer {
  display: flex; align-items: center; gap: 18px;
  border-top: 1px solid var(--line-soft);
  padding-top: 9px;
}
.pf-label { display: block; font-size: 7.5px; letter-spacing: 0.16em; color: var(--label); margin-bottom: 2px; }
.pf-value { font-size: 11px; color: #d5e4de; letter-spacing: 0.05em; }

.pause-btn {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font); font-size: 10px; letter-spacing: 0.14em;
  color: var(--teal);
  background: rgba(121, 230, 213, 0.06);
  border: 1px solid var(--teal-dim);
  border-radius: 7px;
  padding: 8px 14px;
  cursor: pointer;
}
.pause-btn:hover { background: rgba(121, 230, 213, 0.13); box-shadow: 0 0 10px rgba(121, 230, 213, 0.2); }
.pb-icon { font-size: 8px; letter-spacing: 0; }

/* ---------- Console strip ---------- */

#console {
  flex: 0 0 118px;
  min-height: 0;              /* stay at the 118px basis; don't grow to log content */
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px minmax(0, 1fr);
  gap: 14px;
}

.console-panel {
  background: var(--bezel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 14px;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.console-title { font-size: 8px; letter-spacing: 0.22em; color: var(--label); margin-bottom: 5px; }

.console-panel { overflow: hidden; }   /* keep the log bounded to the strip */

#log {
  flex: 1 1 auto;
  min-height: 0;                        /* allow the scroll area to shrink */
  overflow-y: auto;
  padding-right: 14px;                  /* clear the corner lamp */
  font-size: 10px;
  line-height: 1.55;
  color: var(--green);
  letter-spacing: 0.04em;
  text-shadow: 0 0 6px rgba(95, 215, 155, 0.35);
  scrollbar-width: thin;
  scrollbar-color: var(--teal-dim) transparent;
}
#log::-webkit-scrollbar { width: 6px; }
#log::-webkit-scrollbar-thumb { background: var(--teal-dim); border-radius: 3px; }
#log .warn { color: var(--orange); text-shadow: 0 0 6px rgba(255, 154, 77, 0.35); }
.log-lamp {
  position: absolute; right: 12px; bottom: 12px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--orange); box-shadow: 0 0 7px var(--orange);
  animation: lamp 1.1s ease-in-out infinite;
}

#about-panel p {
  flex: 1 1 auto;
  font-size: 9.5px;
  line-height: 1.6;
  color: #b9ac8d;
  letter-spacing: 0.03em;
  max-width: 70%;
}
#about-logo {
  position: absolute; right: 16px; top: 50%;
  width: 84px; transform: translateY(-50%);
  opacity: 0.85;
}

#console-center {
  background: linear-gradient(180deg, #1b1b16, #101210);
  border: 1px solid #33332a;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  padding: 10px;
}

.key-cluster {
  display: grid;
  grid-template-columns: repeat(2, 30px);
  gap: 6px;
  justify-items: center;
}
.key {
  width: 30px; height: 24px;
  border-radius: 4px;
  font-family: var(--font); font-size: 7.5px; letter-spacing: 0.06em;
  cursor: pointer;
  border: 1px solid #000;
}
.key-cluster.teal .key {
  background: #0f2925; color: #55786f;
  border-color: #234; border-color: #1d3833;
  box-shadow: inset 0 1px 0 rgba(121, 230, 213, 0.14);
}
.key-cluster.teal .key.active {
  background: #1a4a42; color: var(--teal-bright);
  box-shadow: 0 0 10px rgba(121, 230, 213, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.key-cluster.orange .key {
  background: #3a1f0c; color: #c07f45;
  border-color: #2a1608;
  box-shadow: inset 0 1px 0 rgba(255, 154, 77, 0.2);
}
.key-cluster.orange .key:active { background: #6b3a16; color: #ffc99a; }
.key-cluster.teal .key:not(.active):hover { background: #143630; }
.cluster-label {
  grid-column: 1 / -1;
  font-size: 6.5px; letter-spacing: 0.2em; color: #6a6a58;
}

.speaker { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.grille {
  width: 44px; height: 34px;
  border-radius: 5px;
  background: repeating-linear-gradient(90deg, #2a2a22 0 3px, #14140f 3px 6px);
  border: 1px solid #33332a;
}
.dial {
  width: 22px; height: 22px; border-radius: 50%;
  background: conic-gradient(from 210deg, #4a4a3e, #23231c 40%, #4a4a3e 70%);
  border: 2px solid #33332a;
  position: relative;
}
.dial::after {
  content: ''; position: absolute;
  left: 50%; top: 2px; width: 2px; height: 7px;
  background: #cfc5a5; transform: translateX(-50%);
}

/* ---------- Test progress bar (under header) ---------- */

#test-progress {
  height: 3px; margin: -6px 2px 0;
  background: #142019; border-radius: 2px; overflow: hidden;
  flex: 0 0 auto;
}
#test-progress.continuous { visibility: hidden; }
#test-progress-fill {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, #2c4c45, var(--teal));
  box-shadow: 0 0 8px var(--teal);
  transition: width 0.4s linear;
}
#dmRemaining { width: 92px; height: 14px; margin-top: 3px; }
#targetLabel { font-size: 10px; color: var(--label); letter-spacing: 0.06em; }
.mode-pill {
  font-size: 8.5px; letter-spacing: 0.14em; font-weight: 700;
  padding: 3px 9px; border-radius: 10px; margin-left: 4px;
  color: var(--teal); border: 1px solid var(--teal-dim); background: rgba(121, 230, 213, 0.08);
}
.mode-pill.burn { color: var(--orange); border-color: var(--orange-dim); background: rgba(255, 154, 77, 0.1); }
.hdr-endpoint { cursor: pointer; }

/* ---------- Settings page ---------- */

body.on-settings #frame,
body.on-settings #console { display: none; }

#settings-view {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  overflow: auto;
}
#settings-view[hidden] { display: none; }

.settings-frame {
  flex: 1 1 auto;
  background: var(--bezel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.settings-head {
  display: flex; align-items: baseline; gap: 18px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line-soft);
}
.settings-sub { font-size: 8.5px; letter-spacing: 0.18em; color: var(--label); }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 24px;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field.wide { grid-column: 1 / -1; }
.field > label {
  font-size: 10px; letter-spacing: 0.18em; color: #c8d9d2; font-weight: 700;
}
.field > label .opt, .field > label .opt { color: var(--label); font-weight: 400; letter-spacing: 0.12em; }
.field-note { font-size: 9.5px; line-height: 1.5; color: var(--label); letter-spacing: 0.02em; max-width: 52ch; }

.control select {
  width: 100%;
  font-family: var(--font); font-size: 12px; letter-spacing: 0.04em;
  color: #d5e4de;
  background: var(--panel);
  border: 1px solid var(--teal-dim);
  border-radius: 8px;
  padding: 10px 34px 10px 13px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2379e6d5' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 11px;
}
.control select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 10px rgba(121, 230, 213, 0.25); }
.control select option { background: #0c1310; color: #d5e4de; }

.control.seg { display: inline-flex; gap: 0; border: 1px solid var(--teal-dim); border-radius: 8px; overflow: hidden; width: max-content; }
.seg-btn {
  font-family: var(--font); font-size: 11px; letter-spacing: 0.12em;
  padding: 10px 22px; cursor: pointer;
  background: var(--panel); color: var(--label); border: none;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--teal-dim); }
.seg-btn.active { background: #1a4a42; color: var(--teal-bright); box-shadow: inset 0 0 12px rgba(121, 230, 213, 0.25); }
.seg-btn[data-mode="burn"].active { background: #5a3a1e; color: #ffd0a5; box-shadow: inset 0 0 12px rgba(255, 154, 77, 0.3); }

.ns-config { border-top: 1px solid var(--line-soft); padding-top: 16px; }
.ns-config-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 14px; }
.ns-config-item { display: flex; flex-direction: column; gap: 6px; }
.ns-config-label { font-size: 8px; letter-spacing: 0.16em; color: var(--label); }
.ns-config .control input {
  width: 100%; font-family: var(--font); font-size: 12px; color: #d5e4de;
  background: var(--panel); border: 1px solid var(--teal-dim); border-radius: 8px; padding: 9px 12px;
}
.ns-config .control input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 10px rgba(121, 230, 213, 0.25); }
.ns-config .control input::placeholder { color: #4c5f58; }

.estimate { border-top: 1px solid var(--line-soft); padding-top: 16px; }
.estimate-body {
  display: flex; flex-wrap: wrap; gap: 26px;
  font-size: 12px; color: var(--label); letter-spacing: 0.08em;
}
.estimate-body div { opacity: 0.5; transition: opacity 0.2s; }
.estimate-body div.on { opacity: 1; }
.estimate-body b { color: var(--teal); font-weight: 700; font-size: 15px; margin-left: 8px; letter-spacing: 0.02em; }
.estimate-body .burn b { color: var(--orange); }

.settings-actions { display: flex; gap: 12px; margin-top: auto; padding-top: 8px; }

/* ---------- Buttons (shared) ---------- */

.btn-primary, .btn-ghost {
  font-family: var(--font); font-size: 10.5px; letter-spacing: 0.14em;
  padding: 11px 20px; border-radius: 8px; cursor: pointer;
}
.btn-primary {
  color: #061713; font-weight: 700;
  background: linear-gradient(180deg, var(--teal-bright), var(--teal));
  border: 1px solid var(--teal);
  box-shadow: 0 0 14px rgba(121, 230, 213, 0.35);
}
.btn-primary:hover { box-shadow: 0 0 20px rgba(121, 230, 213, 0.55); }
.btn-ghost {
  color: var(--teal);
  background: rgba(121, 230, 213, 0.06);
  border: 1px solid var(--teal-dim);
}
.btn-ghost:hover { background: rgba(121, 230, 213, 0.14); }

/* ---------- Modals ---------- */

.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 6vh 24px;
  background: rgba(4, 8, 7, 0.78);
  backdrop-filter: blur(3px);
}
.modal-overlay[hidden] { display: none; }

/* Styled scrollbar for scrolling modals (methodology etc.) */
.modal.art { scrollbar-width: thin; scrollbar-color: var(--teal-dim) transparent; }
.modal.art::-webkit-scrollbar { width: 9px; }
.modal.art::-webkit-scrollbar-thumb { background: var(--teal-dim); border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
.modal.art::-webkit-scrollbar-thumb:hover { background: #3f6a62; background-clip: padding-box; }
.modal.art::-webkit-scrollbar-track { background: transparent; }

/* Retro lined title bar with a top-right close button */
.modal-topbar {
  display: flex; align-items: center; gap: 14px;
  margin: -26px -30px 18px; padding: 13px 18px;
  border-bottom: 1px solid var(--teal-dim);
  border-radius: 16px 16px 0 0;
  background: rgba(121, 230, 213, 0.04);
  position: sticky; top: -26px; z-index: 2;
}
.modal-topbar .modal-title { margin: 0; text-align: left; white-space: nowrap; }
.modal-topbar-lines {
  flex: 1 1 auto; height: 10px;
  background: repeating-linear-gradient(0deg, var(--teal-dim) 0 1px, transparent 1px 3px);
  opacity: 0.5;
}
.modal-x {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 7px;
  border: 1px solid var(--teal-dim); background: transparent; color: var(--teal);
  font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.modal-x:hover { background: rgba(121, 230, 213, 0.14); color: var(--teal-bright); }

.dt-tldr {
  font-size: 12px; line-height: 1.6; color: var(--text);
  background: rgba(121, 230, 213, 0.06); border: 1px solid var(--teal-dim);
  border-radius: 8px; padding: 12px 14px; margin-bottom: 16px;
}
.dt-tldr b { color: var(--teal); letter-spacing: 0.06em; }

.modal.art {
  position: relative;
  width: 100%; max-width: 560px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background:
    radial-gradient(120% 80% at 50% -10%, #14211d 0%, var(--bezel) 60%);
  border: 1px solid #3f5a54;
  border-radius: 16px;
  padding: 26px 30px 24px;
  box-shadow: 0 0 0 1px rgba(121, 230, 213, 0.08), 0 24px 60px rgba(0, 0, 0, 0.6), inset 0 0 60px rgba(121, 230, 213, 0.05);
  text-align: center;
  animation: modalIn 0.32s cubic-bezier(0.2, 0.8, 0.3, 1);
}
.modal.art.result { max-width: 720px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

.modal-emblem { width: 96px; margin: 2px auto 8px; }
.modal-emblem svg { width: 100%; display: block; }
.modal-emblem .r-spin { transform-origin: 60px 60px; animation: spin 24s linear infinite; }

.modal-title {
  font-size: 17px; letter-spacing: 0.2em; color: var(--teal-bright); font-weight: 700;
  text-shadow: 0 0 12px rgba(121, 230, 213, 0.4); margin-bottom: 12px;
}
.modal-lede { font-size: 12px; line-height: 1.65; color: var(--text); max-width: 46ch; margin: 0 auto 16px; }
.modal-lede.small { font-size: 11px; margin-bottom: 14px; }
.modal-lede em { color: var(--teal); font-style: normal; }

.modal-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 4px 0 16px; }
.mode-card {
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); padding: 12px 14px; text-align: left;
}
.mode-card.cruise { border-color: var(--teal-dim); }
.mode-card.burn { border-color: var(--orange-dim); }
.mode-name { font-size: 11px; letter-spacing: 0.16em; font-weight: 700; color: #c8d9d2; }
.mode-card.burn .mode-name { color: var(--orange); }
.mode-desc { font-size: 9.5px; line-height: 1.5; color: var(--label); margin: 6px 0 8px; }
.mode-data { font-size: 10px; color: var(--text); }
.mode-data span { color: var(--teal); font-weight: 700; }
.mode-card.burn .mode-data span { color: var(--orange); font-weight: 700; }

.modal-foot { font-size: 10px; line-height: 1.6; color: var(--label); max-width: 50ch; margin: 0 auto 18px; }
.modal-foot b { color: var(--teal); }
.modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.report-wrap {
  margin: 4px auto 18px; max-width: 620px;
  border-radius: 12px; overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
#reportCanvas { width: 100%; display: block; }

/* Dropout forensics (result modal) */
.inc-list {
  text-align: left; margin: 0 auto 16px; max-width: 620px;
  background: rgba(255, 90, 90, 0.05); border: 1px solid #7a3030;
  border-radius: 10px; padding: 12px 14px;
  max-height: 240px; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--teal-dim) transparent;
}
.inc-list[hidden] { display: none; }
.inc-head { font-size: 10px; letter-spacing: 0.1em; color: #ff8a8a; font-weight: 700; margin-bottom: 10px; line-height: 1.5; }
.inc-row { border-top: 1px solid rgba(255, 90, 90, 0.15); padding: 9px 0 7px; }
.inc-row-head { display: flex; gap: 10px; align-items: baseline; font-size: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.inc-row-head b { color: #ffb0b0; letter-spacing: 0.08em; }
.inc-row-head span { color: var(--label); }
.inc-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.inc-chip {
  font-size: 8.5px; letter-spacing: 0.04em; padding: 3px 8px; border-radius: 9px;
  border: 1px solid var(--line); color: var(--label); cursor: default;
}
.inc-chip.ok { border-color: var(--teal-dim); color: var(--teal); }
.inc-chip.ok i { color: var(--label); font-style: normal; }
.inc-chip.bad { border-color: #7a3030; color: #ff8a8a; }
.inc-verdict { font-size: 9.5px; line-height: 1.5; color: #e0c79c; margin-top: 7px; }

/* ---------- NAME SERVERS (Route99) page ---------- */

body.on-nameservers #frame,
body.on-nameservers #console { display: none; }

#nameservers-view { flex: 1 1 auto; min-height: 0; display: flex; overflow: auto; }
#nameservers-view[hidden] { display: none; }

.ns-frame {
  flex: 1 1 auto;
  background: var(--bezel); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 20px 18px; display: flex; flex-direction: column; gap: 14px;
}
.ns-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap;
}
.ns-sub-brand { font-size: 8.5px; letter-spacing: 0.18em; color: var(--label); border: 1px solid var(--teal-dim); border-radius: 10px; padding: 3px 8px; margin-left: 8px; }
.ns-controls { display: flex; align-items: center; gap: 10px; }
.ns-inputwrap { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--teal-dim); border-radius: 8px; padding: 6px 12px; }
.ns-inlabel { font-size: 8px; letter-spacing: 0.18em; color: var(--label); }
#nsDomain { background: transparent; border: none; outline: none; color: #d5e4de; font-family: var(--font); font-size: 13px; letter-spacing: 0.03em; width: 200px; }
#nsDomain::placeholder { color: #4c5f58; }

.ns-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.ns-panel { min-height: 120px; }
.ns-panel.wide { grid-column: 1 / -1; }
.ns-tier { font-size: 7.5px; letter-spacing: 0.14em; color: var(--label); border: 1px solid var(--line); border-radius: 8px; padding: 2px 7px; margin-left: 8px; }
.ns-note { font-size: 9px; line-height: 1.5; color: var(--label); margin-top: 10px; letter-spacing: 0.02em; }
.ns-status-line { font-size: 12px; letter-spacing: 0.14em; margin-top: 8px; color: var(--text); }
.ns-empty { font-size: 10px; color: var(--label); line-height: 1.6; padding: 8px 0; }
.ns-empty.warn { color: var(--orange); }

.ns-resolver-body { display: flex; gap: 10px; margin-top: 10px; }
.ns-metric { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--panel-deep); border: 1px solid var(--line-soft); border-radius: 8px; padding: 10px 6px 8px; }
.ns-metric-label { font-size: 7.5px; letter-spacing: 0.1em; color: var(--label); text-align: center; }
.ns-dm { width: 100%; height: 30px; }
.ns-unit { font-size: 8px; letter-spacing: 0.1em; color: var(--label); }
.ns-dm-big { width: 100%; height: 52px; margin-top: 10px; }

.ns-lock { width: 46px; margin: 12px auto 4px; color: var(--teal); }
.ns-lock svg { width: 100%; display: block; filter: drop-shadow(0 0 8px currentColor); }
#nsLockShackle { transition: transform 0.3s; transform-origin: 20px 18px; }
.ns-lock.open #nsLockShackle { transform: translateX(-6px) translateY(-2px) rotate(-18deg); }
#ns-dnssec, #ns-consensus, #ns-resolver { align-items: stretch; text-align: center; }
#ns-dnssec .ns-status-line, #ns-consensus .ns-status-line { text-align: center; font-weight: 700; }

.ns-chain { margin: 8px 0; }
.ns-chain svg { width: 100%; height: 110px; }
.ns-node-ico { fill: var(--teal); font-family: var(--font); font-size: 9px; font-weight: 700; text-anchor: middle; }
.ns-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 20px; margin-top: 6px; }
.ns-fact { display: flex; justify-content: space-between; gap: 12px; font-size: 10px; border-bottom: 1px solid var(--line-soft); padding-bottom: 4px; }
.ns-fact span { color: var(--label); letter-spacing: 0.1em; flex: 0 0 auto; }
.ns-fact b { color: #d5e4de; font-weight: 400; text-align: right; word-break: break-word; }
.ns-fact.warn b, .ns-fact.warn span { color: var(--orange); }

.ns-records { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; max-height: 220px; overflow-y: auto; }
.ns-rec { display: grid; grid-template-columns: 52px 1fr auto; gap: 8px; align-items: center; font-size: 10px; padding: 3px 0; border-bottom: 1px solid var(--line-soft); }
.ns-rec-t { color: var(--teal); letter-spacing: 0.08em; }
.ns-rec-v { color: #d5e4de; word-break: break-all; }
.ns-rec-ttl { color: var(--label); font-size: 9px; }

.ns-authtable { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.ns-auth-row { display: grid; grid-template-columns: 1.6fr 1.3fr 0.7fr 1fr 0.5fr; gap: 8px; font-size: 9.5px; padding: 4px 0; border-bottom: 1px solid var(--line-soft); color: #d5e4de; }
.ns-auth-row.head { color: var(--label); letter-spacing: 0.1em; font-size: 8px; }
.ns-auth-row.warn { color: var(--orange); }
.ns-auth-notes { font-size: 9px; color: var(--label); margin-top: 8px; line-height: 1.5; }

.ns-prop-body { display: flex; gap: 12px; margin-top: 8px; }
.ns-prop-globe { flex: 0 0 130px; height: 130px; background: radial-gradient(circle at 50% 45%, #0d1714 0%, var(--panel-deep) 70%); border-radius: 10px; }
#nsGlobe { width: 100%; height: 100%; }
.ns-vantages { flex: 1 1 auto; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ns-vantage { display: grid; grid-template-columns: 1.2fr 1.6fr auto; gap: 8px; font-size: 9.5px; padding: 4px 0; border-bottom: 1px solid var(--line-soft); align-items: center; }
.ns-v-p { color: var(--teal); letter-spacing: 0.06em; }
.ns-v-ip { color: #d5e4de; word-break: break-all; }
.ns-v-ip i { color: var(--orange); font-style: normal; }
.ns-v-ms { color: var(--label); }

#ns-latency #nsLatChart { width: 100%; height: 150px; margin-top: 8px; flex: 0 0 auto; }

.ns-log-strip {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; height: 92px; display: flex; flex-direction: column; overflow: hidden; flex: 0 0 auto;
}
#nsLog {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; margin-top: 4px;
  font-size: 9.5px; line-height: 1.5; color: var(--green); letter-spacing: 0.03em;
  text-shadow: 0 0 6px rgba(95, 215, 155, 0.3); scrollbar-width: thin; scrollbar-color: var(--teal-dim) transparent;
}
#nsLog .warn { color: var(--orange); text-shadow: 0 0 6px rgba(255, 154, 77, 0.3); }
#nsRun:disabled { opacity: 0.6; cursor: default; }
#nsMonitor.active { background: #5a3a1e; color: #ffd0a5; border-color: var(--orange-dim); }

/* ---------- DNS TEST page ---------- */

body.on-dnstest #frame,
body.on-dnstest #console { display: none; }
#dnstest-view { flex: 1 1 auto; min-height: 0; display: flex; overflow: auto; }
#dnstest-view[hidden] { display: none; }

.dt-frame { flex: 1 1 auto; background: var(--bezel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 22px 20px; display: flex; flex-direction: column; gap: 16px; }
.dt-config[hidden], .dt-live[hidden], .dt-results[hidden] { display: none; }
.dt-head-links { display: flex; gap: 8px; }
.dt-link { font-family: var(--font); font-size: 8.5px; letter-spacing: 0.14em; color: var(--label); background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; cursor: pointer; }
.dt-link:hover { color: var(--teal); border-color: var(--teal-dim); }

/* Config */
.dt-config { display: flex; flex-direction: column; gap: 14px; max-width: 900px; }
.dt-headline { font-size: 22px; letter-spacing: 0.02em; color: #d5e4de; font-weight: 700; margin-top: 6px; }
.dt-lede { font-size: 12px; line-height: 1.6; color: var(--text); max-width: 60ch; }
.dt-config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 4px; }
.dt-checks { display: flex; gap: 18px; flex-wrap: wrap; }
.dt-check { display: flex; align-items: center; gap: 8px; font-size: 11px; letter-spacing: 0.06em; color: #c8d9d2; cursor: pointer; }
.dt-check input { accent-color: var(--teal); width: 15px; height: 15px; }

.dt-resolver-preview { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line-soft); padding-top: 14px; }
.dt-prev-group { display: flex; align-items: baseline; gap: 14px; }
.dt-prev-label { flex: 0 0 130px; font-size: 8.5px; letter-spacing: 0.16em; color: var(--label); }
.dt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dt-chip { font-size: 10px; letter-spacing: 0.03em; color: #d5e4de; background: var(--panel); border: 1px solid var(--teal-dim); border-radius: 12px; padding: 4px 10px; }
.dt-chip i { color: var(--label); font-style: normal; }
.dt-chip.timing { border-color: var(--orange-dim); border-style: dashed; color: #b9a888; }
.dt-chip.timing i { color: #8a7a5c; }
.dt-legend { display: flex; align-items: center; gap: 6px; font-size: 9.5px; color: var(--label); letter-spacing: 0.04em; }
.dt-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; }
.dt-key.verified { background: var(--teal); }
.dt-key.timing { border: 1px dashed var(--orange-dim); }
.dt-unv { color: var(--orange); font-weight: 700; cursor: help; }
.dt-tr.timing .dt-tr-name { color: #c2b48f; }
.dt-reco-unv { color: #061713; background: var(--orange); padding: 1px 6px; border-radius: 8px; font-weight: 700; letter-spacing: 0.1em; }

.dt-doh-note { font-size: 10px; line-height: 1.5; color: var(--label); max-width: 66ch; }
.dt-doh-note b { color: var(--teal); }
.dt-start { align-self: flex-start; padding: 13px 30px; font-size: 12px; }

/* Live */
.dt-live { display: flex; flex-direction: column; gap: 16px; }
.dt-progress { height: 5px; background: #142019; border-radius: 3px; overflow: hidden; }
#dtProgressFill { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, #2c4c45, var(--teal)); box-shadow: 0 0 10px var(--teal); transition: width 0.25s; }
/* Fixed columns so the row doesn't jump as values change. Words left, numbers right. */
.dt-live-stats { display: grid; grid-template-columns: 280px 130px 110px 100px; gap: 20px; margin-top: 12px; }
.dt-live-stats > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dt-live-stats .dt-stat-v { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dt-live-stats .dt-stat-l { text-align: left; }          /* headings always left */
.dt-live-stats .num .dt-stat-v { text-align: right; }    /* number values right */
.dt-live-stats .num .dt-dm { margin-left: auto; }         /* right-align the LAST dot-matrix */
.dt-stat-l { font-size: 8px; letter-spacing: 0.16em; color: var(--label); }
.dt-stat-v { font-size: 14px; color: #d5e4de; letter-spacing: 0.04em; }
.dt-dm { width: 74px; height: 22px; }
.dt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.dt-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; opacity: 0.55; transition: opacity 0.25s, border-color 0.25s; }
.dt-card.active { opacity: 1; border-color: var(--teal-dim); box-shadow: 0 0 12px rgba(121, 230, 213, 0.15); }
.dt-card.done { opacity: 1; }
.dt-card-name { font-size: 11px; color: #c8d9d2; letter-spacing: 0.04em; }
.dt-card-name i { color: var(--label); font-style: normal; }
.dt-card-status { font-size: 8px; letter-spacing: 0.16em; color: var(--label); margin: 8px 0 4px; }
.dt-card.active .dt-card-status { color: var(--teal); }
.dt-card-med { font-size: 16px; color: var(--teal); letter-spacing: 0.02em; }
.dt-card-med span { font-weight: 700; }
.dt-card-bar { height: 3px; background: #142019; border-radius: 2px; margin-top: 8px; overflow: hidden; }
.dt-card-bar span { display: block; height: 100%; width: 0%; background: var(--teal); transition: width 0.25s; }
.dt-stop { align-self: flex-start; }

/* Results */
.dt-results { display: flex; flex-direction: column; gap: 16px; }
.dt-reco { background: radial-gradient(120% 120% at 0% 0%, #14211d, var(--panel) 70%); border: 1px solid #3f5a54; border-radius: 12px; padding: 18px 22px; }
.dt-reco-tag { font-size: 8.5px; letter-spacing: 0.18em; color: var(--green); }
.dt-reco-name { font-size: 22px; font-weight: 700; color: #d5e4de; margin: 6px 0 12px; }
.dt-reco-name i { color: var(--teal); font-style: normal; font-size: 15px; }
.dt-reco-metrics { display: flex; gap: 30px; flex-wrap: wrap; margin-bottom: 12px; }
.dt-reco-metrics > div { display: flex; flex-direction: column; font-size: 9px; letter-spacing: 0.1em; color: var(--label); }
.dt-reco-metrics span { font-size: 20px; color: #d5e4de; font-weight: 700; letter-spacing: 0; }
.dt-reco-metrics .conf span { color: var(--teal); }
.dt-reco-metrics .conf-high span { color: var(--green); }
.dt-reco-metrics .conf-low span { color: var(--orange); }
.dt-reco-text { font-size: 12px; line-height: 1.6; color: var(--text); max-width: 72ch; }
.dt-warn { font-size: 10.5px; color: var(--orange); margin-top: 8px; }

.dt-highlights { display: flex; flex-wrap: wrap; gap: 10px; }
.dt-hl { display: flex; flex-direction: column; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; min-width: 130px; }
.dt-hl-l { font-size: 7.5px; letter-spacing: 0.14em; color: var(--label); }
.dt-hl-v { font-size: 12px; color: #d5e4de; }
.dt-hl-x { font-size: 11px; color: var(--teal); }

.dt-group { display: flex; flex-direction: column; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.dt-group-head { display: flex; align-items: baseline; gap: 12px; }
.dt-tie { font-size: 8px; letter-spacing: 0.14em; color: var(--orange); border: 1px solid var(--orange-dim); border-radius: 8px; padding: 2px 7px; }
.dt-chart { width: 100%; }
.dt-table { display: flex; flex-direction: column; }
.dt-tr { display: grid; grid-template-columns: 28px 1.8fr 0.8fr 0.9fr 0.7fr 0.6fr 0.7fr; gap: 8px; font-size: 10.5px; padding: 7px 4px; border-bottom: 1px solid var(--line-soft); color: #d5e4de; cursor: pointer; align-items: center; }
.dt-tr:not(.head):hover { background: rgba(121, 230, 213, 0.05); }
.dt-tr.head { color: var(--label); letter-spacing: 0.08em; font-size: 8.5px; cursor: default; }
.dt-tr.head:hover { background: none; }
.dt-tr-name { color: #d5e4de; }
.dt-tr.unreliable { color: #8a7a5c; }
.dt-cdn-note { font-size: 10px; line-height: 1.55; color: var(--label); max-width: 74ch; border-left: 2px solid var(--teal-dim); padding-left: 12px; }
.dt-note-strong { font-size: 11px; line-height: 1.55; color: #e0c79c; max-width: 74ch; border-left: 2px solid var(--orange); padding-left: 12px; }
.dt-actions { display: flex; gap: 10px; }

/* Chart key */
.dt-chart-key { display: flex; flex-wrap: wrap; gap: 20px; font-size: 9.5px; color: var(--label); letter-spacing: 0.04em; }
.dt-ck-item { display: inline-flex; align-items: center; gap: 6px; }
.dt-ck-bar { display: inline-block; width: 22px; height: 8px; background: var(--teal); border-radius: 2px; }
.dt-ck-p95 { display: inline-block; width: 2px; height: 13px; background: var(--orange); }

/* Current (user's) resolver — distinct violet accent */
.dt-current-resolver { background: rgba(167, 139, 250, 0.06); border: 1px solid #6d5bb0; border-radius: 12px; padding: 14px 18px; }
.dt-current-resolver[hidden] { display: none; }
.dt-cr-tag { font-size: 8.5px; letter-spacing: 0.18em; color: #b9a6f5; }
.dt-cr-name { font-size: 16px; font-weight: 700; color: #d9d2fb; margin: 5px 0 6px; }
.dt-cr-name i { color: #a99ce0; font-style: normal; font-size: 12px; }
.dt-cr-meta { font-size: 11px; color: var(--text); letter-spacing: 0.02em; }
.dt-cr-verdict { font-size: 11.5px; line-height: 1.5; color: #d9d2fb; margin-top: 9px; }
.dt-cr-verdict b { color: #b9a6f5; }
.dt-tr.mine { background: rgba(167, 139, 250, 0.1); }
.dt-tr.mine .dt-tr-mine { color: #b9a6f5; font-size: 8px; letter-spacing: 0.1em; margin-left: 6px; }

/* Docs + detail modals */
.modal.art.dt-doc { max-width: 660px; text-align: left; }  /* beat .modal.art centre */
.dt-doc-body, .dt-doc-h, .dt-tldr { text-align: left; }
.dt-doc-body p { font-size: 11.5px; line-height: 1.65; color: var(--text); margin-bottom: 10px; }
.dt-doc-body b { color: #d5e4de; }
.dt-doc-body em { color: var(--teal); font-style: normal; }
.dt-doc-h { font-size: 11px; letter-spacing: 0.1em; color: var(--teal); font-weight: 700; margin: 16px 0 6px; }
.dt-doc-h:first-child { margin-top: 0; }
.dt-doc-body code { color: #d5e4de; background: var(--panel); padding: 1px 5px; border-radius: 4px; font-size: 0.92em; }
.dt-inline-link { background: none; border: none; padding: 0; font: inherit; letter-spacing: inherit; color: var(--teal); cursor: pointer; text-decoration: underline; }
.dt-inline-link:hover { color: var(--teal-bright); }
.modal.art.dt-detail { max-width: 620px; text-align: left; }
.dt-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; margin-bottom: 14px; }
.dt-detail-grid > div { display: flex; justify-content: space-between; font-size: 11px; border-bottom: 1px solid var(--line-soft); padding-bottom: 4px; }
.dt-detail-grid span { color: var(--label); letter-spacing: 0.06em; }
.dt-detail-grid b { color: #d5e4de; font-weight: 400; }
.dt-detail-sum { font-size: 10.5px; line-height: 1.5; color: var(--text); margin-bottom: 6px; }
.dt-detail-sum b { color: var(--teal); }
.dt-detail-endpoint { font-size: 10px; color: var(--label); margin: 8px 0; }
.dt-detail-endpoint code { color: #d5e4de; background: var(--panel); padding: 2px 6px; border-radius: 4px; }
.dt-detail-endpoint a { color: var(--teal); }
.dt-detail-raw summary { font-size: 10px; color: var(--teal); cursor: pointer; margin-top: 6px; }
.dt-raw { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 3px; margin-top: 8px; max-height: 160px; overflow-y: auto; }
.dt-raw > div { font-size: 9px; color: #9fb4ac; }
.dt-raw > div.bad { color: var(--orange); }

/* ===== Observatory (aggregate results) page ===== */
body.on-results #frame,
body.on-results #console { display: none; }
#results-view { flex: 1 1 auto; min-height: 0; display: flex; overflow: auto; }
#results-view[hidden] { display: none; }
.rz-frame {
  flex: 1 1 auto;
  background: var(--bezel); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 14px;
}
.rz-refresh {
  margin-left: auto; background: var(--panel); color: var(--teal); border: 1px solid var(--line);
  border-radius: 8px; padding: 5px 12px; font: 600 10px var(--font); letter-spacing: 1px; cursor: pointer;
}
.rz-refresh:hover { border-color: var(--teal-dim); color: var(--teal-bright); }
.rz-lede { font-size: 11px; color: var(--label); line-height: 1.5; max-width: 780px; margin: -4px 0 2px; }
.rz-body { display: flex; flex-direction: column; gap: 18px; }
.rz-empty { color: var(--label); font-size: 12px; padding: 40px 8px; text-align: center; }

.rz-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.rz-tile { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 14px; }
.rz-tile.accent { border-color: var(--orange-dim); }
.rz-tile-val { font-size: 24px; color: var(--teal-bright); font-weight: 700; letter-spacing: 1px; }
.rz-tile.accent .rz-tile-val { color: var(--orange); }
.rz-tile-label { font-size: 9px; color: var(--label); letter-spacing: 1.5px; margin-top: 3px; }
.rz-tile-sub { font-size: 10px; color: var(--cream-deep); margin-top: 2px; }

.rz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.rz-chart, .rz-table-block, .rz-drop {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 14px;
}
.rz-chart-title { font-size: 10px; color: var(--teal); letter-spacing: 1.5px; margin-bottom: 10px; }

.rz-bars { display: flex; flex-direction: column; gap: 6px; }
.rz-bar-row { display: grid; grid-template-columns: 120px 1fr 44px; align-items: center; gap: 8px; }
.rz-bar-label { font-size: 10px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rz-bar-track { height: 12px; background: var(--panel-deep); border-radius: 3px; overflow: hidden; }
.rz-bar-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--teal-dim), var(--teal)); border-radius: 3px; min-width: 2px; }
.rz-bar-fill.accent { background: linear-gradient(90deg, var(--orange-dim), var(--orange)); }
.rz-bar-val { font-size: 10px; color: var(--cream); text-align: right; font-variant-numeric: tabular-nums; }

.rz-table { width: 100%; border-collapse: collapse; }
.rz-table th { font-size: 9px; color: var(--label); letter-spacing: 1px; text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line-soft); }
.rz-table th.num, .rz-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rz-table td { font-size: 10px; color: var(--text); padding: 4px 6px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.rz-table tbody tr:last-child td { border-bottom: none; }
.rz-table tbody tr:hover td { background: rgba(121, 230, 213, 0.04); }
.rz-note { font-size: 9px; color: var(--label); margin-top: 8px; line-height: 1.4; }
.rz-foot { font-size: 9px; color: var(--label); text-align: right; padding-top: 4px; }
