:root {
  --bg-color: #000000;
  --text-green: #00ff41;
  --text-dim: #008f24;
  --text-bright: #33ff66;
  --amber: #f5a623;
  --cyan: #00e5ff;
  --red: #ff3333;
  --font-mono: "Fira Code", "VT323", ui-monospace, monospace;
  --font-vt: "VT323", monospace;
}

body[data-theme="amber"] {
  --text-green: #ffb000;
  --text-dim: #9a6b00;
  --text-bright: #ffd36a;
  --cyan: #ffcc66;
}

body[data-theme="phosphor"] {
  --text-green: #7dff9a;
  --text-dim: #2d8a48;
  --text-bright: #c8ffd4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100vh;
  background: var(--bg-color);
  color: var(--text-green);
  font-family: var(--font-mono);
  font-size: 15px;
  line-height: 1.45;
  overflow: hidden;
}

#status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #021405;
  border-bottom: 1px solid var(--text-green);
  padding: 6px 16px;
  font-family: var(--font-vt);
  font-size: 1.25rem;
  letter-spacing: 1px;
  height: 38px;
  z-index: 10;
}

.status-brand {
  color: #fff;
  text-shadow: 0 0 5px rgba(0, 255, 65, 0.8);
}

.status-items { display: flex; gap: 20px; }
.status-item strong { color: #fff; text-transform: uppercase; }

#toggle-drawer-btn {
  background: transparent;
  border: 1px solid var(--text-green);
  color: var(--text-green);
  font-family: var(--font-vt);
  font-size: 1.1rem;
  padding: 2px 10px;
  cursor: pointer;
}

#toggle-drawer-btn:hover { background: var(--text-green); color: #000; }

#workspace {
  display: flex;
  height: calc(100vh - 38px);
  width: 100%;
}

#terminal-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow-y: auto;
  position: relative;
  background: radial-gradient(circle at center, #020c03 0%, #000 100%);
  cursor: text;
}

.scanline {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 5;
  opacity: 0.55;
}

#terminal-output {
  flex: 1;
  min-height: 0;
}

.output-line {
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 3px;
  line-height: 1.4;
}

.line-cmd { color: #fff; font-weight: 600; }
.line-muted { color: #00aa2d; }
.line-info { color: var(--cyan); }
.line-success { color: var(--text-bright); }
.line-warning { color: var(--amber); }
.line-error { color: var(--red); }
.line-wrangler-header { color: #f6821f; font-weight: 700; }
.line-coach { color: #b8ffce; }
.line-code { font-size: 13px; }

.tok-kw { color: #7ee787; }
.tok-str { color: #a5d6ff; }
.tok-num { color: #ffa657; }
.tok-com { color: #6e7681; }
.tok-tag { color: #7ee787; }
.tok-key { color: #79c0ff; }
.tok-sel { color: #d2a8ff; }

#prompt-row {
  display: flex;
  align-items: center;
  margin-top: 8px;
  position: relative;
  z-index: 6;
}

.prompt-green {
  color: var(--text-bright);
  font-weight: 700;
  margin-right: 10px;
  white-space: nowrap;
}

.input-wrapper { display: flex; align-items: center; flex: 1; }

#cli-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 15px;
  caret-color: var(--text-green);
}

#drawer {
  width: 320px;
  background: #030d04;
  border-left: 1px solid var(--text-green);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  transition: margin-right 0.3s ease;
  z-index: 8;
}

#drawer.drawer-closed { margin-right: -320px; }

.drawer-header h3 {
  font-family: var(--font-vt);
  font-size: 1.4rem;
  letter-spacing: 1px;
  border-bottom: 1px dashed var(--text-green);
  padding-bottom: 6px;
  color: #fff;
}

.drawer-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.drawer-val {
  color: #fff;
  font-size: 0.9rem;
  word-break: break-all;
  background: #000;
  padding: 6px 10px;
  border: 1px solid #004d13;
}

.drawer-val a { color: var(--cyan); }

.zones-list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.zones-list li {
  background: #000;
  border: 1px solid #004d13;
  padding: 4px 8px;
  font-size: 0.85rem;
  cursor: pointer;
}
.zones-list li:hover { border-color: var(--text-green); }

.chips-container { display: flex; flex-wrap: wrap; gap: 6px; }

.chip-btn {
  background: #001a06;
  border: 1px solid var(--text-green);
  color: var(--text-green);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 5px 8px;
  cursor: pointer;
  border-radius: 3px;
}

.chip-btn:hover { background: var(--text-green); color: #000; }

#nano-modal {
  position: absolute;
  inset: 0;
  background: #000;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

#nano-modal.hidden { display: none !important; }

#nano-header {
  background: #fff;
  color: #000;
  padding: 4px 12px;
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
}

#nano-body {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#nano-highlight,
#nano-textarea {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 12px;
  border: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  white-space: pre;
  overflow: auto;
  tab-size: 2;
}

#nano-highlight {
  color: #b6f5c4;
  background: #050a05;
  pointer-events: none;
  z-index: 1;
}

#nano-textarea {
  z-index: 2;
  background: transparent;
  color: transparent;
  caret-color: var(--text-green);
  resize: none;
  outline: none;
}

#nano-footer {
  background: #031705;
  border-top: 1px solid var(--text-green);
  padding: 6px 12px;
}

#nano-status { font-size: 0.85rem; color: var(--amber); }

#nano-shortcuts {
  display: flex;
  gap: 20px;
  font-size: 0.8rem;
  margin-top: 4px;
}

#nano-shortcuts span {
  background: #002208;
  padding: 2px 6px;
  border: 1px solid #005214;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #005214; }

@media (max-width: 800px) {
  #drawer { position: absolute; right: 0; top: 0; bottom: 0; }
  .status-items { display: none; }
}
