:root {
  --bg: #fff;
  --fg: #111;
  --dim: #777;
  --line: #ccc;
}

html { color-scheme: light; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.5;
}

#page {
  max-width: 760px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
}

#header,
#footer {
  flex: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
#footer { border-bottom: 0; border-top: 1px solid var(--line); padding: 8px 0 0; }

#header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}
#header .brand { font-weight: bold; margin-right: 8px; }
#header .field { color: var(--dim); }

input, button {
  font: inherit;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line);
  padding: 2px 5px;
}
button { cursor: pointer; }
button:hover { background: #eee; }
button:active { background: #ddd; }

#room-input { width: 9ch; }
#name-input { width: 12ch; }

#log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 0;
  white-space: pre-wrap;
  word-break: break-word;
}

#log .line { margin: 0 0 2px; }
#log .sys { color: var(--dim); font-style: italic; }
#log .name { font-weight: bold; }
#log .time { color: var(--dim); margin-right: 6px; }
#log .mine .name { text-decoration: underline; }

#status { color: var(--dim); min-height: 1.2em; font-size: 12px; }
#presence { color: var(--dim); font-size: 12px; margin-bottom: 6px; }

#form { display: flex; gap: 6px; }
#form input { flex: 1; min-width: 0; }
