:root {
  --bg: #0f1115;
  --panel: #171a21;
  --line: #2a2f3a;
  --text: #e6e8ee;
  --muted: #9aa3b2;
  --accent: #d97757;
  --danger: #f2777a;
  --ok: #7fd18b;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[hidden] { display: none !important; }
button, input, textarea { font: inherit; color: inherit; }
button {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
}
button:hover { border-color: var(--muted); }
button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.login { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.card {
  width: min(360px, 100%);
  display: grid;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
}
.card h1 { margin: 0; font-size: 20px; }
.hint { margin: 0 0 6px; color: var(--muted); }
.card label { color: var(--muted); font-size: 14px; }
.card input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}
.card button[type="submit"] { background: var(--accent); border-color: var(--accent); color: #1a0f0a; font-weight: 600; }
.error { min-height: 1.4em; margin: 0; color: var(--danger); }

.console { height: 100%; display: flex; flex-direction: column; }
.bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.title { font-weight: 600; white-space: nowrap; }
.status { color: var(--muted); font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status.ok { color: var(--ok); }
.status.bad { color: var(--danger); }
.actions { display: flex; gap: 8px; }
.actions button { padding: 6px 10px; font-size: 14px; }

.screen { position: relative; flex: 1; min-height: 0; }
.terminal { position: absolute; inset: 0; padding: 6px 4px 0 8px; }
.closed {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 12px;
  text-align: center;
  padding: 16px;
  background: rgb(15 17 21 / 0.92);
}
.closed p { margin: 0; color: var(--muted); max-width: 420px; }

.keys {
  display: flex;
  gap: 6px;
  padding: 6px 8px;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.keys button { padding: 6px 10px; font-size: 14px; flex: none; }
.compose {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: var(--panel);
  border-top: 1px solid var(--line);
}
.compose textarea {
  flex: 1;
  min-width: 0;
  resize: vertical;
  max-height: 40vh;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
}
.compose button { align-self: end; background: var(--accent); border-color: var(--accent); color: #1a0f0a; font-weight: 600; }

@media (max-width: 600px) {
  .title { display: none; }
  .bar { gap: 8px; padding: 6px 8px; }
}
