:root {
  font-family: "Segoe UI",-apple-system,BlinkMacSystemFont,Arial,sans-serif;
  color: #edf2f4;
  background: #080f16;
  font-synthesis: none;
  --muted: #a8b7c2;
  --line: #30414d;
  --accent: #a3d8e3;
  --panel: #101e29;
}

.workflow-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
}

.workflow-toolbar label {
  margin: 0;
}

#examples {
  width: 235px;
}

.workflow-toolbar button {
  font-size: 11px;
}

dialog {
  background: #101e29;
  color: #edf2f4;
  border: 1px solid #587481;
  border-radius: 10px;
  width: min(850px, calc(100% - 24px));
  max-height: calc(100% - 30px);
  padding: 24px;
  overflow-y: auto;
}

dialog::backdrop {
  background: rgb(0 0 0 / 75%);
}

.review-table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
  font-size: 11px;
  line-height: 1.6;
  margin: 14px 0;
}

.review-table th, .review-table td {
  border: 1px solid #30414d;
  padding: 8px;
  text-align: left;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.review-actions {
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.review-actions .primary {
  width: auto;
}

#reference {
  border-top: 1px solid #30414d;
  margin-top: 18px;
  font-size: 11px;
  overflow-wrap: anywhere;
}

#reference dl {
  margin: 12px 0;
}

#reference dd {
  margin: 4px 0;
  color: #a3d8e3;
}

.comparison {
  margin-top: 24px;
}

.comparison-files, .comparison-panes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
}

.comparison-files label, .comparison-panes section {
  min-width: 0;
}

.comparison-files input {
  width: 100%;
  margin-top: 10px;
  font-size: 11px;
}

.comparison-panes h3, .comparison-panes p {
  overflow-wrap: anywhere;
}

.comparison-canvas {
  height: 340px;
  background: #0c1821;
}

@media (max-width: 650px) {
  .comparison-files, .comparison-panes {
    grid-template-columns: minmax(0, 1fr);
  }

  dialog {
    padding: 16px;
  }

  .review-table th, .review-table td {
    padding: 5px;
    font-size: 10px;
  }

  .workflow-toolbar button, #examples {
    width: 100%;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,input,select {
  font: inherit;
}

button,input,select,.file-button {
  border-radius: 6px;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: .45;
  cursor: default;
}

a {
  color: inherit;
}

button:focus-visible,input:focus-visible,select:focus-visible,canvas:focus-visible,a:focus-visible,.file-button:focus-within {
  outline: 3px solid #f4cf68;
  outline-offset: 3px;
}

button {
  border: 1px solid var(--line);
  color: #edf2f4;
  background: #1c2d3a;
  padding: 9px 12px;
}

button:hover:not(:disabled) {
  border-color: var(--accent);
}

.masthead {
  height: 76px;
  padding: 0 4%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 23px;
  font-weight: 750;
  letter-spacing: .08em;
  text-decoration: none;
  display: flex;
  gap: 12px;
  align-items: center;
}

.mark {
  background: var(--accent);
  color: #102c27;
  font-size: 20px;
  padding: 5px 10px;
  transform: skew(-8deg);
  border-radius: 2px;
}

.brand-note {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
  margin-left: 12px;
  letter-spacing: .17em;
}

.local-badge {
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--accent);
  border: 1px solid #30414d;
  border-radius: 20px;
  padding: 7px 11px;
}

main {
  padding: 28px 3% 95px;
  max-width: 1800px;
  margin: auto;
}

.intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 27px;
}

.eyebrow {
  color: var(--accent);
  letter-spacing: .16em;
  font-size: 10px;
  font-weight: 700;
}

h1 {
  font-size: clamp(27px,3vw,42px);
  letter-spacing: -.04em;
  line-height: 1.15;
  margin: 9px 0;
}

h2 {
  font-size: 15px;
  margin: 0;
  font-weight: 600;
}

h3 {
  font-size: 12px;
  margin-top: 27px;
}

.subline {
  font-size: 13px;
  color: var(--muted);
  margin: 9px 0;
}

.file-button {
  border: 1px solid #587481;
  padding: 12px 17px;
  position: relative;
  cursor: pointer;
  background: #172e2b;
  font-size: 12px;
  white-space: nowrap;
}

.file-button span {
  margin-left: 24px;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.workbench {
  display: grid;
  grid-template-columns: 255px minmax(0,1fr) 230px;
  gap: 15px;
  align-items: start;
}

.panel,.viewport-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
}

.panel {
  padding: 20px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 19px;
}

.step {
  font-size: 10px;
  color: var(--accent);
  border: 1px solid #30414d;
  padding: 3px 5px;
  border-radius: 3px;
}

.divider {
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-top: 23px;
}

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

.small,.note {
  font-size: 11px;
  line-height: 1.6;
}

.note {
  color: #c1cbbf;
  margin: 9px 0 14px;
}

.unit {
  color: var(--muted);
  font-size: 10px;
}

label {
  font-size: 11px;
  color: #c4d1da;
  display: block;
  margin: 12px 0 7px;
}

input:not([type=checkbox]):not([type=range]):not([type=file]),select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid #30414d;
  background: #0d1b26;
  color: #f0f5f7;
  padding: 9px 10px;
  font-size: 12px;
}

input[type=checkbox] {
  accent-color: #a3d8e3;
  width: 14px;
  height: 14px;
  vertical-align: middle;
  margin: 0 7px 0 0;
}

.material-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 8px;
}

.material-grid label {
  font-size: 10px;
}

.material-grid input {
  margin-top: 5px;
}

fieldset {
  border: 1px solid var(--line);
  padding: 8px;
  margin-top: 12px;
  display: flex;
  gap: 10px;
}

fieldset[hidden] {
  display: none;
}

legend {
  color: var(--muted);
  font-size: 10px;
}

fieldset label {
  margin: 0;
  display: inline-flex;
  align-items: center;
}

.vector {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 5px;
}

.vector label {
  margin: 0;
}

#picked-face {
  font-size: 11px;
  color: var(--accent);
  display: block;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.secondary {
  width: 100%;
  font-size: 11px;
  margin-top: 12px;
}

.assignment-list {
  padding: 0;
  list-style: none;
  font-size: 10px;
  line-height: 1.7;
  color: #ccdadf;
}

.assignment-list li {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  align-items: center;
  margin: 8px 0;
}

.assignment-list button {
  font-size: 10px;
  padding: 3px 7px;
}

.primary {
  width: 100%;
  margin-top: 15px;
  background: var(--accent);
  color: #0d2c24;
  border: 0;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  padding: 12px;
  font-size: 12px;
}

.text-button {
  width: 100%;
  font-size: 10px;
  margin-top: 7px;
  background: transparent;
  border: 0;
  color: var(--muted);
}

.viewport-panel {
  overflow: hidden;
}

.viewport-toolbar {
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 10px;
}

.viewport-toolbar>span {
  font-size: 10px;
  letter-spacing: .12em;
  color: var(--muted);
}

.viewport-toolbar button {
  padding: 5px 7px;
  font-size: 10px;
  background: transparent;
}

.canvas-wrap {
  height: 490px;
  position: relative;
  background: #0c1821;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

#empty-view {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  pointer-events: none;
  padding: 20px;
}

#empty-view[hidden] {
  display: none;
}

.empty-symbol {
  font-size: 70px;
  color: #587481;
  font-weight: 100;
}

#empty-view h2 {
  font-size: 18px;
}

#empty-view p {
  font-size: 12px;
  color: var(--muted);
}

.axis-key {
  position: absolute;
  bottom: 15px;
  left: 18px;
  font: 10px monospace;
  display: flex;
  gap: 10px;
  pointer-events: none;
}

.axis-key span:nth-child(1) {
  color: #ffab9b;
}

.axis-key span:nth-child(2) {
  color: #a3d8e3;
}

.axis-key span:nth-child(3) {
  color: #9ecbff;
}

.view-controls {
  border-top: 1px solid var(--line);
  padding: 15px;
  display: grid;
  grid-template-columns: auto minmax(65px,1fr);
  gap: 8px 13px;
  align-items: center;
}

.view-controls label {
  margin: 0;
  font-size: 10px;
}

.view-controls output {
  font-size: 10px;
  color: var(--muted);
  grid-column: 1/-1;
}

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

.check {
  display: flex;
  align-items: center;
  line-height: 1.5;
}

.legend {
  padding: 4px 18px 15px;
}

.legend>div:first-child,.legend-values {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #edf2f4;
}

.legend strong {
  font-weight: 500;
}

.legend-ramp {
  height: 12px;
  border-radius: 2px;
  margin: 9px 0;
  background: linear-gradient(to right,#440154,#3b528b,#21918c,#5ec962,#fde725);
}

.node-info {
  font-size: 11px;
  color: var(--muted);
  padding: 14px 18px;
  margin: 0;
  border-top: 1px solid var(--line);
  line-height: 1.8;
  overflow-wrap: anywhere;
}

#status {
  font-size: 11px;
  color: var(--accent);
  line-height: 1.6;
}

.metric {
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
}

.metric dt {
  font-size: 10px;
  color: var(--muted);
}

.metric dd {
  font-size: 24px;
  margin: 8px 0 0;
  font-weight: 550;
  letter-spacing: -.03em;
}

.metric dd small {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
  margin-left: 4px;
  color: var(--muted);
}

#warnings {
  font-size: 11px;
  line-height: 1.7;
  padding-left: 15px;
  color: #c7d5de;
}

#warnings li {
  margin-bottom: 12px;
}

#error {
  color: #ffbead;
  font-size: 12px;
  overflow-wrap: anywhere;
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 10px;
}

#advisory {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 5;
  padding: 15px 4%;
  background: #24352e;
  border-top: 1px solid #587481;
  font-size: 11px;
  color: #edf5df;
  line-height: 1.6;
}

#advisory::before {
  content: 'ADVISORY';
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .14em;
  color: #bce1bc;
  margin-right: 20px;
}

[hidden] {
  display: none!important;
}

@media(min-width:1500px) {
  .canvas-wrap {
    height: 650px;
  }
}

@media(max-width:1100px) {
  .workbench {
    grid-template-columns: 230px minmax(0,1fr);
  }
  .results {
    grid-column: 1/-1;
    display: block;
  }
  #summary {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 15px;
  }
  .metric dd {
    font-size: 20px;
  }
}

@media(max-width:650px) {
  .masthead {
    height: 62px;
  }
  .brand-note,.local-badge {
    display: none;
  }
  .intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }
  .workbench {
    grid-template-columns: minmax(0,1fr);
  }
  .viewport-panel {
    grid-row: 1;
  }
  .results {
    grid-column: auto;
  }
  .canvas-wrap {
    height: 340px;
  }
  .panel {
    padding: 17px;
  }
  .viewport-toolbar {
    padding: 10px;
    gap: 4px;
  }
  .viewport-toolbar>span {
    font-size: 8px;
  }
  .viewport-toolbar button {
    font-size: 9px;
    padding: 5px;
  }
  .view-controls {
    padding: 12px;
  }
  .file-button {
    font-size: 11px;
  }
  main {
    padding: 20px 12px 125px;
  }
  .metric dd {
    font-size: 19px;
  }
  #summary {
    grid-template-columns: 1fr 1fr;
  }
  #advisory {
    font-size: 10px;
    padding: 10px 13px;
  }
  #advisory::before {
    margin-right: 8px;
  }
  h1 {
    font-size: 30px;
  }
}
.simplified-label {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 4;
  padding: 7px 10px;
  border: 1px solid #a3d8e3;
  border-radius: 4px;
  background: #0c1821;
  color: #ffffff;
  font-size: 13px;
  pointer-events: none;
}
.detail-controls {
  grid-template-columns: minmax(0, 1fr) minmax(100px, 1fr);
}

.detail-controls > .check {
  grid-column: 1 / -1;
}

.detail-controls label {
  font-size: 12px;
}

.demo-note { margin: 0; padding: 8px 16px; font-size: 13px; background: var(--demo-note-bg, #fff6d6); color: var(--demo-note-fg, #4a3b00); border-bottom: 1px solid rgba(0,0,0,.08); }
