:root {
  --bg: #0b0e13; --panel: #131820; --border: #232b36; --text: #d6dde6; --muted: #8592a3;
  --accent: #3b82f6; --ok: #22c55e; --warn: #f59e0b; --bad: #ef4444;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.error { color: var(--bad); min-height: 1.2em; margin: 0; }

button { font: inherit; color: var(--text); background: #1c2430; border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 12px; cursor: pointer; }
button:hover:not(:disabled) { border-color: #3a4656; }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { background: #7f1d1d; border-color: #991b1b; color: #fff; }
button.danger:hover:not(:disabled) { background: #991b1b; }
input, textarea { font: inherit; color: var(--text); background: #0d1117; border: 1px solid var(--border);
  border-radius: 6px; padding: 8px 10px; width: 100%; }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { font-family: ui-monospace, monospace; font-size: 12px; resize: vertical; }

/* connexion */
#login { min-height: 100%; display: grid; place-items: center; padding: 20px; }
.card { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; padding: 24px; display: grid; gap: 14px; }
.card h1 { margin: 0; font-size: 20px; }
.card p { margin: 0; }
.card label { display: grid; gap: 6px; font-weight: 500; }
details summary { cursor: pointer; color: var(--muted); margin-bottom: 8px; }

/* application */
#app { height: 100%; display: grid; grid-template-rows: auto 1fr auto; }
header { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--border); }
.title, .actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pill { font-size: 12px; padding: 2px 10px; border-radius: 999px; border: 1px solid currentColor; }
.pill.ok { color: var(--ok); } .pill.warn { color: var(--warn); } .pill.bad { color: var(--bad); }
.live { font-size: 12px; } .live.on { color: var(--ok); } .live.off { color: var(--muted); }

main { position: relative; min-height: 0; background: #0d1117; }
#term { position: absolute; inset: 8px 4px 8px 12px; }
#notice { position: absolute; top: 12px; right: 20px; background: var(--panel); border: 1px solid var(--border);
  border-left: 3px solid var(--warn); padding: 8px 14px; border-radius: 6px; box-shadow: 0 4px 16px #0008; }

#cmd-form { display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  background: var(--panel); border-top: 1px solid var(--border); }
#cmd-form .prompt { font-family: ui-monospace, monospace; color: var(--accent); font-weight: bold; }
#cmd { font-family: ui-monospace, monospace; }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--border); border-radius: 10px;
  padding: 20px 24px; max-width: 420px; }
dialog::backdrop { background: #000a; }
dialog h2 { margin: 0 0 8px; font-size: 18px; }
dialog .row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
