/* Mylestro Command Center — dark theme, no external resources. */
:root {
  --bg: #0d0f12;
  --surface: #14161a;
  --border: #262b33;
  --text: #e6e9ee;
  --muted: #8b93a1;
  --accent: #6fb1fc;
  --ok: #7ee0a0;
  --ok-bg: #1e4630;
  --err: #f08a8a;
  --err-bg: #4a2626;
  --warn: #e8c468;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
}

.page {
  max-width: 900px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Header */
.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}

.status-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.pill-ok  { background: var(--ok-bg);  color: var(--ok); }
.pill-down { background: var(--err-bg); color: var(--err); }

.server-time {
  font-size: 11px;
  color: var(--muted);
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

/* Token bar */
.token-bar label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.token-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.token-row input {
  flex: 1;
  min-width: 200px;
}

.token-state { font-size: 12px; color: var(--muted); }
.token-state.saved   { color: var(--ok); }
.token-state.unsaved { color: var(--warn); }

/* Inputs & buttons */
input, textarea {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font: inherit;
}

input:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

textarea {
  width: 100%;
  resize: vertical;
}

button {
  background: var(--accent);
  color: #0b1420;
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover:not(:disabled) { filter: brightness(1.1); }

button:disabled {
  background: var(--border);
  color: var(--muted);
  cursor: not-allowed;
}

/* Console */
.console {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 320px;
}

.transcript {
  flex: 1;
  overflow-y: auto;
  min-height: 160px;
  max-height: 55vh;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.exchange {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.exchange:last-child { border-bottom: none; }

.line {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.line + .line { margin-top: 6px; }

.who {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
}

.who-user  { color: var(--accent); }
.who-agent { color: var(--ok); }
.who-error { color: var(--err); }

.msg {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.msg-reply {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.msg-error { color: var(--err); }

.muted { color: var(--muted); }

.prompt-area label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.prompt-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

/* Footer */
.footer {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  font-size: 13px;
}

.footer p { margin: 0; }

/* A11y helper */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
