:root {
  color-scheme: dark;
  --bg: #101412;
  --panel: #141916;
  --line: #29322c;
  --text: #e2e9e3;
  --muted: #87968b;
  --green: #c4ee9c;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    13px system-ui,
    sans-serif;
}
button,
input,
textarea {
  font: inherit;
}
button,
a,
input,
textarea {
  outline-offset: 4px;
}
button {
  border: 1px solid var(--line);
  color: var(--text);
  background: transparent;
  padding: 9px 13px;
  border-radius: 5px;
  cursor: pointer;
}
button:hover {
  background: #28342c;
  border-color: #607c5e;
}
button.primary {
  background: var(--green);
  border-color: var(--green);
  color: #192417;
  font-weight: 650;
}
button.primary:hover {
  background: #d4ffb0;
}
header {
  height: 76px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  gap: 0;
  align-items: center;
  color: var(--text);
  text-decoration: none;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -1px;
}
.brand > span:not(.brand-icon):not(.version) {
  font-weight: 400;
  color: #a6b8a7;
}
.brand-icon {
  color: var(--green);
  font-size: 33px;
  margin-right: 12px;
}
.version {
  font: 9px var(--mono);
  letter-spacing: 1px;
  background: #243024;
  color: var(--green);
  padding: 5px 7px;
  border-radius: 3px;
  margin-left: 15px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.local {
  font: 11px var(--mono);
  color: #9bae9b;
  margin-right: 10px;
}
.local i,
.graph-foot i {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  margin-right: 7px;
}
.top-actions button span {
  margin-left: 9px;
}
.projectbar {
  height: 59px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: #171d19;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
}
.eyebrow {
  color: var(--muted);
  font: 10px var(--mono);
  letter-spacing: 1.4px;
}
.projectbar strong {
  margin: 0 12px;
  font-size: 12px;
  font-weight: 500;
}
.badge {
  font: 9px var(--mono);
  color: #a8b8aa;
  border: 1px solid #3d4a3f;
  border-radius: 3px;
  padding: 3px 5px;
}
.project-actions {
  display: flex;
  gap: 8px;
}
.project-actions button {
  border: 0;
  color: #aab9ac;
  font-size: 11px;
  padding: 8px;
}
main {
  display: grid;
  grid-template-columns: 250px minmax(320px, 1fr) 330px;
  height: calc(100vh - 173px);
  min-height: 580px;
}
.sidebar {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #131815;
}
.panel-title {
  font: 10px var(--mono);
  letter-spacing: 1.3px;
  padding: 24px 20px 19px;
  color: #a7b4aa;
  display: flex;
  justify-content: space-between;
}
.panel-title span {
  color: #667b6a;
}
.search {
  margin: 0 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #343f36;
  border-radius: 5px;
  padding: 9px;
  color: var(--muted);
}
.search input {
  min-width: 0;
  width: 100%;
  background: transparent;
  color: var(--text);
  border: 0;
  font-size: 11px;
}
.search kbd {
  border: 1px solid #3a443c;
  border-radius: 3px;
  padding: 0 4px;
  font-size: 10px;
}
.filter {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 13px 15px 20px;
  font-size: 10px;
  color: var(--muted);
}
input[type="checkbox"] {
  accent-color: var(--green);
}
#tree {
  overflow: auto;
  flex: 1;
  padding: 0 10px 20px;
}
.tree-row {
  display: flex;
  align-items: center;
  min-height: 32px;
  margin: 2px 0;
  border-radius: 4px;
  white-space: nowrap;
}
.tree-row.selected {
  background: #2d3c28;
  box-shadow: inset 2px 0 var(--green);
}
.tree-row:hover {
  background: #253027;
}
.tree-row button {
  border: 0;
  padding: 6px 0;
  font: 11px var(--mono);
  background: none;
  color: #b4c2b7;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.tree-row.selected button {
  color: var(--green);
}
.tree-row .toggle {
  width: 20px;
  flex-shrink: 0;
  color: #758a79;
  text-align: center;
}
.tree-row .node-label {
  flex: 1;
}
.tree-row .status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #829f75;
  margin: 0 8px;
}
.tree-row.off {
  opacity: 0.5;
}
.sidebar-bottom {
  display: flex;
  gap: 11px;
  align-items: center;
  border-top: 1px solid var(--line);
  padding: 18px;
  font: 9px var(--mono);
  line-height: 1.9;
  letter-spacing: 0.6px;
}
.tinylogo {
  font-size: 21px;
  color: #b8caad;
}
.sidebar-bottom div span {
  color: #6b7b70;
  letter-spacing: 0;
}
.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.graph-head {
  padding: 25px 25px 21px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  gap: 10px;
}
.graph-head h1 {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.6px;
  margin: 8px 0 0;
}
.segmented {
  display: flex;
  background: #0d110e;
  border: 1px solid var(--line);
  padding: 3px;
  border-radius: 6px;
}
.segmented button {
  font-size: 10px;
  padding: 7px 9px;
  border: 0;
  color: #8b9c90;
}
.segmented .active {
  background: #2b362a;
  color: var(--green);
}
#graphArea {
  position: relative;
  min-height: 320px;
  flex: 1;
  overflow: hidden;
}
#graph {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#graph:active {
  cursor: grabbing;
}
.graph-guide {
  position: absolute;
  bottom: 23px;
  left: 22px;
  display: flex;
  align-items: center;
  gap: 7px;
  font: 9px var(--mono);
  color: #8c9d90;
  pointer-events: none;
}
.line {
  width: 19px;
  border-top: 1px solid #56685a;
  display: inline-block;
}
.line.reference {
  margin-left: 9px;
  border-top: 1px dashed #a0bf8f;
}
.graph-controls {
  position: absolute;
  right: 19px;
  bottom: 15px;
  background: #18201b;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  border-radius: 5px;
}
.graph-controls button {
  border: 0;
  padding: 8px 10px;
}
.graph-controls span {
  font: 10px var(--mono);
  width: 40px;
  text-align: center;
  color: #95a598;
}
.graph-foot {
  display: flex;
  justify-content: space-between;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  font: 9px var(--mono);
  color: #7b8e80;
  gap: 10px;
}
.inspector {
  border-left: 1px solid var(--line);
  overflow: auto;
  background: #151a17;
}
.inspector > .panel-title {
  border-bottom: 1px solid var(--line);
}
#inspection {
  padding: 23px 20px;
}
.inspect-label {
  font: 11px var(--mono);
  color: var(--green);
}
.node-name {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.6px;
  margin: 9px 0;
}
.node-path {
  font: 10px var(--mono);
  overflow-wrap: anywhere;
  color: var(--muted);
  line-height: 1.8;
}
.node-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #bed6ab;
  background: #263324;
  border: 1px solid #3d4e32;
  font: 9px var(--mono);
  padding: 4px 7px;
  border-radius: 4px;
  margin: 13px 0 20px;
}
.node-status.off {
  color: #d1b68c;
  background: #342c21;
  border-color: #655334;
}
.section-title {
  font: 10px var(--mono);
  color: #91a195;
  letter-spacing: 1px;
  display: flex;
  justify-content: space-between;
  margin: 6px 0 13px;
}
.props {
  border-top: 1px solid var(--line);
  margin-bottom: 26px;
}
.prop {
  padding: 10px 0;
  border-bottom: 1px solid #242d27;
}
.prop-name {
  font: 10px var(--mono);
  color: #9cac9e;
  margin-bottom: 5px;
}
.prop-value {
  font: 11px var(--mono);
  color: #d2dcd3;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.prop-value button {
  padding: 1px 4px;
  margin: 0 1px;
  border: 0;
  color: var(--green);
  background: #2d3928;
  font: inherit;
}
.ref-row {
  width: 100%;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  margin-bottom: 6px;
  background: #1b241e;
  border-color: #303e32;
  font: 10px var(--mono);
  gap: 7px;
}
.ref-row small {
  display: block;
  color: #8a9d8c;
  font: 9px var(--mono);
  margin-bottom: 5px;
}
.ref-row b {
  font-weight: 400;
  color: #c9dbbf;
  overflow-wrap: anywhere;
}
.no-refs {
  font: 11px var(--mono);
  color: #6f8276;
  line-height: 1.7;
  margin-bottom: 22px;
}
.source-line {
  font: 10px var(--mono);
  color: #738879;
  margin: 25px 0 0;
}
.source-line button {
  font: 10px var(--mono);
  border: 0;
  color: #b8d4a7;
  padding: 0 0 0 5px;
}
footer {
  height: 38px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 25px;
  border-top: 1px solid var(--line);
  font: 9px var(--mono);
  color: #7d8f82;
}
footer button {
  border: 0;
  font: 9px var(--mono);
  color: #91a195;
  padding: 4px;
}
.footer-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: #86a976;
  margin-right: 7px;
}
.muted {
  color: #405146;
  margin: 0 8px;
}
dialog {
  border: 1px solid #465740;
  background: #151c17;
  color: var(--text);
  border-radius: 10px;
  max-width: min(860px, 94vw);
  width: 860px;
  padding: 0;
  box-shadow: 0 30px 130px #0009;
}
dialog::backdrop {
  background: #050a07c9;
  backdrop-filter: blur(5px);
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 25px 28px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 {
  font-size: 23px;
  font-weight: 450;
  letter-spacing: -0.7px;
  margin: 9px 0 0;
}
.close {
  font-size: 23px;
  border: 0;
  padding: 0 5px;
  color: #92a58e;
}
.modal-hint {
  padding: 0 28px;
  color: #a1b19f;
  font-size: 12px;
}
textarea {
  display: block;
  width: calc(100% - 56px);
  margin: 20px 28px;
  background: #0b100d;
  color: #c1d5b7;
  border: 1px solid #334330;
  border-radius: 5px;
  height: 50vh;
  padding: 18px;
  resize: vertical;
  line-height: 1.65;
  font: 12px var(--mono);
  tab-size: 4;
}
.modal-foot {
  padding: 0 28px 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.modal-foot span {
  font: 10px var(--mono);
  color: #8da18d;
}
.help-body {
  padding: 10px 28px 28px;
  line-height: 1.8;
  color: #adbcaf;
  font-size: 13px;
  max-height: 70vh;
  overflow: auto;
}
.help-body h3 {
  color: #d6e1d4;
  font-size: 14px;
  margin: 22px 0 5px;
}
.help-body pre {
  background: #0d130f;
  border: 1px solid #354332;
  padding: 14px;
  color: var(--green);
  white-space: pre-wrap;
  font-size: 12px;
}
.fine {
  font-size: 11px;
  color: #7f9582;
}
#parseError {
  margin: 0 28px 20px;
  padding: 12px;
  background: #382421;
  color: #edb5a1;
  border: 1px solid #6e4132;
  font: 12px var(--mono);
}
#toast {
  position: fixed;
  bottom: 55px;
  left: 50%;
  transform: translateX(-50%);
  background: #cee9b6;
  color: #24341e;
  padding: 12px 22px;
  border-radius: 6px;
  font-size: 12px;
  box-shadow: 0 4px 30px #0007;
  z-index: 10;
}
#warningbar {
  background: #302a1d;
  padding: 10px 20px;
  color: #c9b486;
  font: 10px var(--mono);
  max-height: 70px;
  overflow: auto;
}
#empty {
  position: absolute;
  inset: 40% 10% auto;
  text-align: center;
  color: #9cae9b;
  font: 12px var(--mono);
}
.node-card {
  cursor: pointer;
  outline: none;
}
.node-card:focus rect {
  stroke: #fff;
  stroke-width: 3;
}
.node-card:hover rect {
  stroke: #d5f4b8;
}
.node-card rect {
  transition: stroke 0.15s;
}
.graph-node-label {
  font: 11px var(--mono);
  fill: #91a58c;
}
.graph-node-name {
  font: 13px var(--mono);
  fill: #d6e0d0;
}
.graph-node-type {
  font: 9px var(--mono);
  fill: #7d927d;
}
.edge-label {
  font: 9px var(--mono);
  fill: #a9c294;
  paint-order: stroke;
  stroke: #101412;
  stroke-width: 5px;
  stroke-linejoin: round;
}
.graph-heading {
  font: 9px var(--mono);
  letter-spacing: 1.5px;
  fill: #6b826d;
}
@media (min-width: 1600px) {
  main {
    grid-template-columns: 280px minmax(320px, 1fr) 370px;
  }
}
@media (max-width: 1150px) {
  main {
    grid-template-columns: 210px minmax(280px, 1fr) 285px;
  }
  .graph-head {
    padding: 20px 16px;
    align-items: flex-start;
    flex-direction: column;
  }
  .local {
    display: none;
  }
  .graph-foot > span:last-child {
    display: none;
  }
  .graph-guide {
    bottom: 61px;
  }
  #inspection {
    padding: 18px 15px;
  }
}
@media (max-width: 850px) {
  main {
    grid-template-columns: 200px 1fr;
    height: auto;
    min-height: 0;
  }
  .workspace {
    height: 650px;
  }
  .inspector {
    grid-column: 1/-1;
    border-top: 1px solid var(--line);
    max-height: none;
  }
  #inspection {
    display: block;
  }
  .sidebar-bottom {
    display: none;
  }
  header {
    padding: 0 15px;
    height: 65px;
  }
  .version {
    display: none;
  }
  .top-actions {
    gap: 6px;
  }
  .top-actions button {
    font-size: 10px;
    padding: 8px;
  }
  .projectbar {
    padding: 0 15px;
    gap: 10px;
    height: 65px;
  }
  .projectbar .eyebrow {
    display: none;
  }
  .projectbar strong {
    margin: 0 7px 0 0;
    font-size: 10px;
  }
  .project-actions {
    gap: 2px;
  }
  .project-actions button {
    font-size: 9px;
    padding: 6px;
  }
  .project-actions button:first-child {
    display: none;
  }
  footer > span:first-child {
    display: none;
  }
  .graph-guide {
    font-size: 8px;
    gap: 4px;
  }
  .modal-head {
    padding: 20px;
  }
  .modal-head h2 {
    font-size: 20px;
  }
}
@media (max-width: 520px) {
  main {
    grid-template-columns: 145px minmax(0, 1fr);
  }
  .sidebar .panel-title {
    font-size: 8px;
    padding: 20px 10px;
  }
  .search {
    margin: 0 8px;
    padding: 8px 5px;
  }
  .search input {
    font-size: 10px;
  }
  .search kbd {
    display: none;
  }
  .filter {
    font-size: 9px;
    margin: 12px 7px;
  }
  .tree-row button {
    font-size: 9px;
  }
  .tree-row .status-dot {
    display: none;
  }
  .tree-row .toggle {
    width: 14px;
  }
  .graph-head h1 {
    font-size: 17px;
  }
  .graph-head {
    padding: 19px 12px;
  }
  .segmented button {
    font-size: 9px;
    padding: 7px;
  }
  .graph-guide {
    left: 10px;
  }
  .workspace {
    height: 570px;
  }
  .badge {
    display: none;
  }
  .brand {
    font-size: 21px;
  }
  .brand-icon {
    font-size: 25px;
    margin-right: 6px;
  }
  .top-actions button:first-of-type {
    font-size: 9px;
  }
  .modal-foot {
    flex-direction: column;
  }
  .projectbar strong {
    display: block;
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .graph-foot {
    padding: 13px 8px;
    font-size: 8px;
  }
  #tree {
    padding-left: 3px;
    padding-right: 3px;
  }
}

/* Kernel Noise identity */
.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  margin-right: 12px;
  border-radius: 4px;
}
.labs-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #b8caad;
  text-decoration: none;
}
.labs-brand img {
  object-fit: contain;
  border-radius: 3px;
}
.labs-brand:hover {
  color: var(--green);
}
.sponsor-button {
  color: var(--green);
  white-space: nowrap;
}
.sponsor-button span {
  margin-right: 5px;
  font-size: 15px;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
button:disabled:hover {
  background: transparent;
  border-color: var(--line);
}

/* Always-visible document identity prevents confusing the sample for an upload. */
.document-notice {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 11px 28px;
  min-height: 48px;
  background: #19261b;
  border-bottom: 1px solid #354b35;
  font-size: 11px;
}
.document-notice strong {
  margin-right: 10px;
  font-weight: 600;
  color: #c2d4b6;
}
.document-notice span {
  color: #91a58f;
}
.document-marker {
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  flex-shrink: 0;
}
.document-notice.example {
  background: #2a261a;
  border-color: #4c432a;
}
.document-notice.example strong {
  color: #e6cd8e;
}
.document-notice.example .document-marker {
  background: #e6cd8e;
}
.document-notice.example span {
  color: #b3a782;
}
.badge.example-badge {
  color: #e6cd8e;
  border-color: #6a5932;
  background: #332d1c;
}
.replace-actions > div {
  display: flex;
  gap: 10px;
}
.donation-link {
  display: inline-block;
  padding: 10px 15px;
  margin-top: 10px;
  background: var(--green);
  border-radius: 5px;
  color: #192417;
  text-decoration: none;
  font-weight: 600;
}
.donation-link[hidden] {
  display: none;
}
main {
  height: calc(100vh - 221px);
}
@media (max-width: 1350px) {
  .local {
    display: none;
  }
}
@media (max-width: 850px) {
  main {
    height: auto;
  }
  header {
    height: auto;
    min-height: 76px;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 15px;
  }
  .top-actions {
    flex-wrap: wrap;
  }
  .document-notice {
    padding: 11px 15px;
  }
  .document-notice strong,
  .document-notice #documentDetail {
    display: block;
    line-height: 1.7;
  }
  .brand-logo {
    width: 34px;
    height: 34px;
  }
}

.incoming-title {
  margin-top: 25px;
}

/* Compact app shell: reserve the remaining viewport for the map, not a banner. */
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
body {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
header,
.projectbar,
footer {
  flex-shrink: 0;
}
.projectbar {
  min-height: 48px;
  height: 48px;
}
main {
  --tree-width: 250px;
  --inspector-width: 330px;
  position: relative;
  grid-template-columns: var(--tree-width) minmax(0, 1fr) var(--inspector-width);
  height: auto;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}
main.hierarchy-hidden {
  --tree-width: 0px;
}
main.inspector-hidden {
  --inspector-width: 0px;
}
.sidebar {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}
.workspace {
  grid-column: 2;
  grid-row: 1;
  min-height: 0;
  height: auto;
}
.inspector {
  grid-column: 3;
  grid-row: 1;
  min-width: 0;
}
.panel-title {
  align-items: center;
  padding: 14px 16px;
  min-height: 52px;
  gap: 8px;
}
.panel-title #nodecount {
  margin-left: 5px;
}
.panel-close {
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px;
  min-width: 32px;
  min-height: 32px;
  border: 0;
  color: #a9bca5;
  flex-shrink: 0;
}
.graph-head {
  flex-direction: row;
  align-items: center;
  padding: 14px 18px;
  flex-wrap: wrap;
  gap: 12px;
}
.graph-head h1 {
  font-size: 18px;
  margin-top: 5px;
}
.map-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.panel-toggles {
  display: flex;
  gap: 5px;
}
.panel-toggles button {
  font-size: 10px;
  padding: 8px 9px;
}
.panel-toggles button[aria-expanded="true"] {
  background: #283627;
  color: var(--green);
  border-color: #4b6441;
}
#graphArea {
  min-height: 0;
}
#graph {
  touch-action: none;
  overscroll-behavior: contain;
  user-select: none;
  -webkit-user-select: none;
}
.panel-backdrop {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: #050a07a8;
  border: 0;
  border-radius: 0;
  padding: 0;
}
.panel-backdrop:hover {
  background: #050a07a8;
}
#demoBadge {
  display: inline-block;
  cursor: pointer;
  white-space: nowrap;
}
footer {
  height: 30px;
}

/* The textarea and its highlighted mirror must share exact typography/spacing. */
.source-editor {
  position: relative;
  width: calc(100% - 56px);
  height: 50vh;
  min-height: 160px;
  max-height: 65vh;
  margin: 20px 28px;
  background: #0b100d;
  border: 1px solid #334330;
  border-radius: 5px;
  overflow: hidden;
}
.source-editor:focus-within {
  border-color: #9bba80;
}
.source-editor #source,
#sourceHighlight {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 16px;
  border: 0;
  border-radius: 0;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  line-height: 20px;
  letter-spacing: normal;
  tab-size: 4;
  white-space: pre;
  overflow: auto;
  box-sizing: border-box;
  text-align: left;
}
.source-editor #source {
  z-index: 2;
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: #e4f4d8;
  background: transparent;
  resize: none;
  outline: none;
}
.source-editor #source::selection {
  background: #8baf684d;
}
#sourceHighlight {
  z-index: 1;
  color: #d4e1cd;
  pointer-events: none;
  scrollbar-width: none;
}
#sourceHighlight::-webkit-scrollbar {
  display: none;
}
#sourceTokens {
  font: inherit;
}
.syntax-comment {
  color: #7f9384;
}
.syntax-string {
  color: #93d6ca;
}
.syntax-reference {
  color: #c4ee9c;
}
.syntax-directive {
  color: #ceb6ef;
}
.syntax-number {
  color: #edc78a;
}
.syntax-label {
  color: #b5c6ff;
}
.syntax-punctuation {
  color: #8ea58b;
}

@media (min-width: 1600px) {
  main {
    --tree-width: 280px;
    --inspector-width: 370px;
  }
}
@media (min-width: 851px) and (max-width: 1150px) {
  main {
    --tree-width: 215px;
    --inspector-width: 280px;
  }
}
@media (max-width: 850px) {
  main,
  main.hierarchy-hidden,
  main.inspector-hidden {
    display: block;
    height: auto;
    min-height: 0;
  }
  .workspace {
    height: 100%;
    width: 100%;
  }
  .sidebar,
  .inspector {
    position: absolute;
    top: 0;
    bottom: 0;
    width: min(340px, calc(100% - 32px));
    max-height: none;
    z-index: 20;
    box-shadow: 0 0 45px #000a;
    border-top: 0;
  }
  .sidebar {
    left: 0;
  }
  .inspector {
    right: 0;
  }
  .sidebar-bottom {
    display: flex;
  }
  .tree-row {
    min-height: 42px;
  }
  .tree-row button {
    font-size: 12px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .tree-row .toggle {
    width: 25px;
  }
  .tree-row .status-dot {
    display: inline-block;
  }
  .sidebar .panel-title {
    padding: 12px 16px;
    font-size: 10px;
  }
  .panel-close {
    min-width: 44px;
    min-height: 44px;
  }
  #tree {
    padding: 0 10px 20px;
  }
  .search input {
    font-size: 16px;
  }
  .filter {
    font-size: 12px;
    padding: 7px 0;
  }
  .map-tools button {
    min-height: 40px;
  }
  .graph-controls button {
    min-width: 42px;
    min-height: 44px;
  }
  .graph-foot {
    min-height: 32px;
    padding: 10px 12px;
  }
  .graph-guide {
    bottom: 65px;
  }
  .source-editor #source,
  #sourceHighlight {
    font-size: 16px;
    line-height: 24px;
  }
  .source-editor {
    width: calc(100% - 32px);
    margin: 16px;
    height: 45dvh;
  }
  dialog {
    max-height: 94dvh;
    overflow: auto;
  }
}
@media (max-width: 600px) {
  header {
    min-height: 64px;
    padding: 10px 12px;
    gap: 8px;
  }
  .brand {
    font-size: 21px;
  }
  .brand-logo {
    width: 30px;
    height: 30px;
    margin-right: 7px;
  }
  .top-actions {
    gap: 5px;
  }
  .top-actions button {
    min-height: 40px;
    padding: 7px 9px;
    font-size: 10px;
  }
  #sponsor {
    font-size: 0;
    width: 38px;
    padding: 5px;
  }
  #sponsor span {
    font-size: 21px;
    margin: 0;
  }
  .projectbar {
    height: auto;
    min-height: 65px;
    padding: 9px 12px;
    flex-wrap: wrap;
    gap: 5px;
  }
  .projectbar > div:first-child {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    min-width: 0;
  }
  .projectbar strong {
    font-size: 10px;
    max-width: calc(100vw - 170px);
    margin: 0;
  }
  .badge {
    font-size: 8px;
    padding: 3px 5px;
  }
  .project-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .project-actions button {
    font-size: 10px;
    padding: 6px 8px;
  }
  .project-actions button:first-child {
    display: inline-block;
    margin-right: auto;
  }
  .graph-head {
    padding: 8px 10px;
    min-height: 58px;
  }
  .graph-head > div:first-child {
    display: none;
  }
  .map-tools {
    width: 100%;
    justify-content: space-between;
    gap: 5px;
    flex-wrap: nowrap;
  }
  .panel-toggles button,
  .segmented button {
    font-size: 10px;
    padding: 7px 8px;
  }
  .graph-guide {
    display: none;
  }
  .graph-controls {
    bottom: 10px;
    right: 10px;
  }
  footer {
    padding: 0 12px;
    font-size: 8px;
  }
  footer button {
    font-size: 8px;
  }
}
