:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  background: #1e1e1e;
  color: #e9e9e6;
  --mono: "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  --muted: #a1a1a1;
  --line: #383838;
}
* { box-sizing: border-box; }
body { margin: 0; height: 100vh; height: 100dvh; display: grid; grid-template-rows: auto minmax(0,1fr) auto; }
button, textarea, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid #a6c4b0; outline-offset: -3px; }
.titlebar { height: 36px; display: grid; place-items: center; position: relative; background: #292929; border-bottom: 1px solid #242424; }
h1 { color: #c1c1c1; font-weight: 550; font-size: 13px; margin: 0; display: flex; align-items: center; gap: 6px; }
.terminal-icon { font: bold 12px/13px var(--mono); border: 1px solid #858585; border-radius: 3px; padding: 0 2px; color: #aeaeae; }
.lights { position: absolute; left: 15px; display: flex; gap: 8px; }
.lights i { width: 11px; height: 11px; border-radius: 50%; background: #eb6c62; }
.lights i:nth-child(2) { background: #e7b455; }
.lights i:last-child { background: #66b96b; }
.tabbar { background: #222; padding: 3px 6px 5px; display: flex; align-items: center; gap: 5px; border-bottom: 1px solid #353535; }
#tabs { display: flex; flex: 1; min-width: 0; overflow-x: auto; background: #363636; border-radius: 9px; scrollbar-width: thin; }
.tab { flex: 1 0 auto; min-width: 0; background: transparent; color: #b5b5b5; border: 1px solid transparent; border-radius: 9px; padding: 6px 12px; font-size: 13px; white-space: nowrap; }
.tab:hover { background: #404040; color: white; }
.tab[aria-selected=true] { color: #f0f0ed; background: linear-gradient(#333,#2a2a2a); border-color: #505050; box-shadow: inset 0 -1px 3px #222; }
.path { opacity: .76; }
.add { border-radius: 50%; height: 28px; width: 28px; flex: 0 0 auto; border: 1px solid #494949; background: linear-gradient(#333,#282828); font-size: 22px; line-height: 22px; font-weight: 300; }
.add:hover, .close:hover { color: white; background: #444; }
#screen { min-height: 0; overflow-y: auto; scrollbar-color: #555 #202020; padding: 22px clamp(14px,2vw,32px) 28px; font: 14px/1.57 var(--mono); }
#screen:focus-visible { outline-offset: -2px; }
.record { max-width: 122ch; margin: 0 0 27px; }
.meta { color: var(--muted); font-size: 11.5px; line-height: 1.55; margin-bottom: 4px; }
.command, .output { margin: 0; font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4; }
.command { color: #f4f4f1; font-weight: 600; }
.sigil { color: #a6c2ac; font-weight: 400; }
.output { color: #dededb; }
.end { color: #989898; }
.end i { display: inline-block; height: 1.04em; width: .6em; background: #c0c0bb; vertical-align: -.12em; }
footer { min-height: 26px; border-top: 1px solid #363636; background: #242424; padding: 4px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #aaa; font: 11px/1.5 var(--mono); }
dialog { width: min(474px,calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; color: #eee; background: #272727; border: 1px solid #535353; border-radius: 11px; box-shadow: 0 15px 65px #0009; }
dialog::backdrop { background: #0009; }
form { padding: 16px 20px 20px; }
form header, .actions { display: flex; align-items: center; justify-content: space-between; }
h2 { font-size: 16px; margin: 0; }
.close { border: 0; border-radius: 4px; background: transparent; font-size: 22px; color: #aaa; }
label { display: grid; gap: 6px; margin: 14px 0 0; font-size: 13px; }
label[hidden], [hidden] { display: none !important; }
textarea, select, input { width: 100%; border: 1px solid #505050; border-radius: 4px; background: #1c1c1c; padding: 7px 9px; font: 13px/1.5 var(--mono); }
textarea { resize: vertical; }
.hint, #error { font-size: 12px; color: #b3b3b3; }
#error { color: #ffb4a9; }
.actions { justify-content: flex-end; gap: 8px; margin-top: 18px; }
.actions button { border-radius: 5px; border: 1px solid #555; padding: 6px 12px; background: #333; }
.actions .save { color: #1b211e; background: #d2ded4; border-color: #d2ded4; }
@media(max-width: 980px) { .tab .path { display: none; } }
@media(max-width: 540px) {
  .tab { font-size: 12px; padding: 8px 10px; }
  #screen { font-size: 13px; padding-top: 16px; }
  footer { font-size: 10px; }
  .lights { gap: 5px; left: 10px; } .lights i { height: 8px; width: 8px; }
}
