@font-face {
  font-family: MiSans;
  src: url("MiSans-Regular.ttf") format("truetype");
  font-display: swap;
}
:root {
  color-scheme: dark;
  color: #e6ecee;
  background: #14191e;
  font: 14px MiSans, sans-serif;
}
body { margin: 0; height: 100dvh; display: flex; flex-direction: column; }
header, nav, .bar { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; }
header { padding: .55rem .8rem; justify-content: space-between; border-bottom: 1px solid #40505b; }
h1, h2 { font-size: 1rem; margin: 0; font-weight: 600; }
button, select { font: inherit; }
button, select {
  color: inherit;
  background: #27333c;
  border: 1px solid #455762;
  border-radius: 4px;
  padding: .35rem .55rem;
}
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
button:not(:disabled):hover { background: #364b56; }
:focus-visible { outline: 2px solid #7cd9f7; outline-offset: 1px; }
.primary { background: #16637c; border-color: #4ca9c7; }
#workspace {
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-rows: minmax(0, var(--viewer, 60fr)) 9px minmax(0, var(--editor, 40fr));
}
#viewer { position: relative; background: #0e151c; min-height: 0; }
#viewer-placeholder { text-align: center; margin: 2rem; color: #b2c0c9; }
iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
iframe.candidate { opacity: 0; pointer-events: none; }
#divider { background: #34444e; cursor: ns-resize; touch-action: none; display: grid; place-items: center; }
#divider::after { content: ""; width: 2rem; height: 2px; background: #8ba1ac; }
#editor { display: grid; min-height: 0; grid-template-rows: auto auto minmax(0, 1fr); }
.bar { padding: .45rem .65rem; }
#status { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 6rem; overflow: auto; }
#status.error { color: #ffb6a5; }
.source { grid-row: 3; display: grid; min-height: 0; grid-template-columns: clamp(7rem, 23%, 15rem) minmax(0, 1fr); }
aside { overflow: auto; padding: .45rem; background: #202a32; }
#files { margin-top: .35rem; }
#files details { margin-left: .35rem; }
#files summary { cursor: pointer; }
#files button { display: block; width: 100%; text-align: left; border-color: transparent; background: transparent; overflow-wrap: anywhere; }
#files button[aria-current="true"] { background: #31586b; }
#viewer, #editor { overflow: hidden; }
#viewer iframe { min-height: 160px; }
#workspace[data-pane="editor"] #viewer,
#workspace[data-pane="viewer"] #editor { visibility: hidden; }
.feedback { padding: 0 .65rem .35rem; min-width: 0; }
.feedback:has(#status:empty):has(#diagnostic-location[hidden]) { display: none; }
#empty-project { color: #b2c0c9; margin: .4rem 0; }
#diagnostic-location { margin-top: .3rem; }
.editor-area { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); }
#tabs { display: flex; overflow-x: auto; min-height: 0; background: #202a32; }
.file-tab { flex: none; display: flex; align-items: center; border-right: 1px solid #40505b; }
.file-tab:has([aria-selected="true"]) { background: #31586b; }
.file-tab button { background: transparent; border: 0; white-space: nowrap; }
.file-tab button:focus-visible { outline-offset: -2px; }
.file-tab [role="tab"][aria-selected="true"] { box-shadow: inset 0 -2px #7cd9f7; }
#xml { position: relative; min-width: 0; min-height: 0; background: #10171d; }
