:root {
  --bg: #ffffff;
  --ink: #1b2430;
  --muted: #667085;
  --line: #e4e7ec;
  --accent: #0f4c81;
  --bar-h: 56px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1419;
    --ink: #e6e9ee;
    --muted: #9aa4b2;
    --line: #232b36;
    --accent: #6aa8e6;
  }
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
}

.bar {
  height: var(--bar-h);
  flex: 0 0 var(--bar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  align-self: center;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.brand-name {
  font-weight: 600;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.who {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
}

.signout {
  color: var(--accent);
  text-decoration: none;
}

.signout:hover { text-decoration: underline; }

.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

#chat {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--bg);
}

#chat[hidden] { display: none; }

.status {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

.status.error { color: #b42318; }

.status button {
  margin-left: 10px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}

@media (max-width: 560px) {
  .brand-sub, #userName { display: none; }
}
