:root {
  --app-h: 100dvh;
  --fg: #1c1c1e;
  --muted: #6b6b70;
  --line: #e5e5ea;
  --accent: #0a84ff;
  --ok: #2e7d32;
  --err: #c62828;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #fff;
  color: var(--fg);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}
body {
  display: flex;
  flex-direction: column;
  height: var(--app-h);
  height: 100dvh;
  overflow: hidden;
}
.statusbar {
  flex: 0 0 auto;
  padding: max(6px, env(safe-area-inset-top)) 14px 6px;
  border-bottom: 1px solid var(--line);
  background: #fafafa;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 30px;
  display: flex;
  align-items: center;
}
.statusbar.busy #status::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}
.statusbar.ok { color: var(--ok); }
.statusbar.err { color: var(--err); }
@keyframes pulse { 0%,100% { opacity: .25; } 50% { opacity: 1; } }

deep-chat {
  flex: 1 1 auto;
  min-height: 0;
  display: block;
  width: 100%;
  height: 100%;
}
/* Keep long words / URLs from forcing a horizontal scrollbar on 390px. */
deep-chat { overflow-wrap: anywhere; }

.login {
  max-width: 420px;
  margin: 12vh auto 0;
  padding: 0 24px;
}
.login h1 { font-size: 20px; margin: 0 0 8px; }
.login p { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.login label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.login input {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
}
.login input:focus { border-color: var(--accent); }
.login button {
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  font-size: 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
}
.login .error { color: var(--err); font-size: 14px; margin-top: 12px; min-height: 1.4em; }