:root {
  --bg: #111315;
  --panel: #1a1d20;
  --line: #2a2f34;
  --text: #e9edf0;
  --muted: #8b959d;
  --me: #2f6df6;
  --danger: #ff6b6b;
  --gold: #C9A961;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.screen { height: 100dvh; display: flex; flex-direction: column; }
.hidden { display: none !important; }

/* ---- login ---- */
#login { align-items: center; justify-content: center; }
#login-form {
  width: min(360px, calc(100% - 48px));
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#login-form h1 {
  margin: 0 0 8px;
  font-size: 22px;
  letter-spacing: .18em;
  text-align: center;
  color: var(--muted);
  font-weight: 600;
}
#login-form input {
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
}
#login-form input:focus { outline: none; border-color: var(--me); }
#login-form button {
  padding: 13px;
  border: 0;
  border-radius: 10px;
  background: var(--me);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}
.error { color: var(--danger); font-size: 14px; min-height: 20px; margin: 0; text-align: center; }

/* ---- app ---- */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
  flex: 0 0 auto;
}
header button {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 14px;
  padding: 4px;
}
header #who { flex: 1; }
/* Jump link to the DTM Machine. No border here: this header is otherwise all
   plain text, so a bordered pill would read as the primary action on the page.
   Gold alone is enough to mark it as the one link out. */
.jump {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 34px; padding: 4px 6px;
  color: var(--gold); text-decoration: none;
  font-size: 13px; font-weight: 600;
  white-space: nowrap;
}
.jump:active { opacity: .6; }
.jump .ext { font-size: 10px; opacity: .75; }

#admin-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 10px;
  position: relative;
}
#admin-badge {
  background: var(--danger);
  color: #fff;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  border-radius: 9px;
  padding: 1px 5px;
  margin-left: 5px;
  vertical-align: 1px;
}

#thread {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 18px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.msg.user { align-self: flex-end; background: var(--me); color: #fff; border-bottom-right-radius: 5px; }
.msg.assistant { align-self: flex-start; background: var(--panel); border-bottom-left-radius: 5px; }
.msg.error { align-self: center; background: none; color: var(--danger); font-size: 14px; max-width: 100%; }
.msg.pending { color: var(--muted); font-style: italic; }

#composer {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 10px 12px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
#input {
  flex: 1;
  resize: none;
  max-height: 40dvh;
  padding: 11px 14px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 16px; /* keeps iOS from zooming on focus */
}
#input:focus { outline: none; border-color: var(--me); }
#send {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--me);
  color: #fff;
  font-size: 19px;
}
#send:disabled { opacity: .45; }

/* Google sign-in, the only way in to the console (2026-10-13). */
.google-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.85rem 1rem;
  margin: 0.5rem 0;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  border-radius: 8px;
  background: #fff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
}
.google-btn:hover { background: #f8f9fa; }

/* The Creed link in the header, and the way out of a rep session. */
#creed-link { margin-right: 10px; }
.tiny-note { margin: 10px 0 0; font-size: 12px; text-align: center; }
.tiny-note a { color: #8fa3bd; }
