* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Courier New', monospace;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: #000;
  color: #0f0;
}

/* ==================== LOGIN ==================== */
#login-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  height: 100dvh;
  padding: 20px;
  gap: 24px;
}

.login-banner {
  color: #0f0;
  white-space: pre;
  font-size: 12px;
  text-align: center;
  line-height: 1.4;
}

#login-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}

.login-title {
  color: #0f0;
  font-size: 14px;
  text-align: center;
  margin-bottom: 4px;
}

.login-input {
  background: transparent;
  border: 1px solid #0f0;
  color: #0f0;
  font-family: inherit;
  font-size: 16px;
  padding: 10px 12px;
  border-radius: 4px;
  outline: none;
  caret-color: #0f0;
  width: 100%;
  text-align: center;
  letter-spacing: 4px;
}

.login-input:focus {
  box-shadow: 0 0 8px rgba(0, 255, 0, 0.5);
}

.login-btn {
  background: #0f0;
  color: #000;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: bold;
  padding: 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.1s;
  touch-action: manipulation;
  width: 100%;
}

.login-btn:active {
  transform: scale(0.97);
}

.login-message {
  color: #0f0;
  font-size: 13px;
  text-align: center;
  min-height: 18px;
}

.login-message.error {
  color: #f33;
  text-decoration: underline;
  text-decoration-color: #ffff00;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.login-message.info {
  color: #0ff;
}

.login-hint {
  color: #080;
  font-size: 12px;
  text-align: center;
}

.login-link {
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s;
}

.login-link:hover,
.login-link:active {
  color: #0f0;
}

.login-btn-danger {
  background: transparent;
  color: #f33;
  border: 1px solid #f33;
  margin-top: 8px;
}

.login-btn-danger:active {
  background: #f33;
  color: #000;
  transform: scale(0.97);
}

/* ==================== SHELL ==================== */
#shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding: 12px;
  font-size: 14px;
  line-height: 1.5;
}

#banner {
  color: #0f0;
  margin-bottom: 8px;
  white-space: pre;
  font-size: 12px;
}

#output {
  flex: 1;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #0f0 #000;
}

#output::-webkit-scrollbar { width: 6px; }
#output::-webkit-scrollbar-track { background: #000; }
#output::-webkit-scrollbar-thumb { background: #0f0; border-radius: 3px; }

.line { color: #0f0; }
.line.info { color: #0ff; }
.line.dim { color: #080; }

/* ==================== ERRORS ==================== */
.line.error {
  color: #f33;
  text-decoration: underline;
  text-decoration-color: #ffff00;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* ==================== INPUT ==================== */
#input-line {
  display: flex;
  align-items: center;
  border-top: 1px solid #0f0;
  padding-top: 6px;
  margin-top: 6px;
}

#prompt {
  color: #0f0;
  white-space: nowrap;
  margin-right: 6px;
}

#cmd {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #0f0;
  font-family: inherit;
  font-size: inherit;
  caret-color: #0f0;
}

/* ==================== NANO EDITOR ==================== */
#editor-screen {
  display: none;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: #000;
  color: #0f0;
  padding: 8px;
}

#editor-screen.active {
  display: flex;
}

#editor-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  border: 1px solid #0f0;
  border-bottom: none;
  position: relative;
}

#editor-lines {
  color: #080;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
  padding: 8px;
  text-align: right;
  user-select: none;
  white-space: pre;
  overflow: hidden;
  border-right: 1px solid #0f0;
  background: #000;
  min-width: 46px;
}

#editor-textarea {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #0f0;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.5;
  padding: 8px;
  resize: none;
  caret-color: #0f0;
  white-space: pre;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #0f0 #000;
}

#editor-textarea::-webkit-scrollbar { width: 6px; height: 6px; }
#editor-textarea::-webkit-scrollbar-track { background: #000; }
#editor-textarea::-webkit-scrollbar-thumb { background: #0f0; border-radius: 3px; }

#editor-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid #0f0;
  font-size: 13px;
  background: #000;
  white-space: nowrap;
  overflow-x: auto;
}

.editor-action-btn {
  background: transparent;
  color: #0f0;
  border: 1px solid #0f0;
  font-family: inherit;
  font-size: 13px;
  font-weight: bold;
  padding: 4px 12px;
  border-radius: 3px;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}

.editor-action-btn:active {
  background: #0f0;
  color: #000;
}

#editor-filename {
  color: #0ff;
  margin-left: auto;
}

#editor-flag {
  color: #080;
  margin-left: 8px;
}

#editor-flag.saved {
  color: #0f0;
}