:root {
  --bg: #1f1b24;
  --bar: #2d2638;
  --text: #e1def5;
  --green: #48b969;
  --blue: #3d72d9;
  --muted: #8b859b;
  --font: "DejaVu Sans Mono", "Fira Code", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: clamp(14px, 1.2vw + 10px, 19px);
  line-height: 1.3;
}

#terminal {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

#titlebar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  background: var(--bar);
  color: var(--muted);
  font-size: 0.85em;
}
.dots { display: flex; gap: 6px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: #e95420; }
.dots i:nth-child(2) { background: #f5c211; }
.dots i:nth-child(3) { background: var(--green); }
.title { flex: 1; text-align: center; }

#fullscreen-btn {
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--muted);
  border-radius: 4px;
  padding: 2px 10px;
  cursor: pointer;
}
#fullscreen-btn:hover { background: rgba(255, 255, 255, 0.12); }
#fullscreen-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
#fullscreen-btn[hidden] { display: none; }

#body { position: relative; flex: 1 1 auto; min-height: 0; }

#screen {
  height: 100%;
  overflow-y: auto;
  padding: 10px 14px 24px;
  cursor: text;
}

.line { white-space: pre; }
.line.error { color: #ff7b72; }
.line.hint { color: var(--muted); }

.p-user { color: var(--green); font-weight: bold; }
.p-dir { color: var(--blue); font-weight: bold; }

#input-line { display: flex; white-space: pre; }
#input-line[hidden] { display: none; }
#input {
  flex: 1;
  min-width: 0;
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 0;
  caret-color: var(--text);
  caret-shape: block;
}

.probe { position: absolute; visibility: hidden; white-space: pre; pointer-events: none; }

#overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: #000;
  overflow: hidden;
  cursor: pointer;
}
#overlay.active { display: block; }
#overlay pre { margin: 0; font: inherit; color: var(--text); }
#overlay canvas { display: block; width: 100%; height: 100%; }
#overlay .quit-hint {
  position: absolute;
  top: 8px;
  right: 12px;
  padding: 2px 8px;
  font-size: 0.8em;
  color: #cfc;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid #2a5;
  border-radius: 4px;
}
