:root {
  color-scheme: light;
  --ink: #1c1915;
  --muted: #6d645b;
  --line: #e4dcd2;
  --paper: #f7f3ee;
  --card: #fffdfb;
  --accent: #0f6e56;
  --accent-ink: #ffffff;
  --warn: #8a3d12;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

main {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 18px;
}

h1, h2, p { margin: 0; }
h1 { font-size: 40px; font-weight: 600; letter-spacing: -0.03em; }
h2 { font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }

.eyebrow { color: var(--accent); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.profile { color: var(--muted); }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  margin-top: 12px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 10px;
  margin-top: 12px;
}

.wide { grid-column: 1 / -1; }

label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }

input, textarea, button {
  font: inherit;
  color: inherit;
}

input, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
}

textarea { resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

.mono {
  margin-top: 10px;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}

.row { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.connect-bar { margin-top: 0; margin-bottom: 4px; }
.connect-bar .status { font-size: 18px; }

button {
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
}

button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button:disabled { opacity: 0.5; cursor: default; }

.status { color: var(--muted); }
.status.ok { color: var(--accent); }
.status.bad { color: var(--warn); }

.chat { display: grid; gap: 12px; }
#log {
  list-style: none;
  margin: 0;
  padding: 0;
  min-height: 220px;
  max-height: 420px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
}

#log li {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f3eee8;
}

#log li.out { justify-self: end; background: #e5f4ef; }
#log li small { display: block; color: var(--muted); margin-top: 4px; }

#composer { display: grid; grid-template-columns: 1fr auto; gap: 8px; }

.hint { margin-top: 8px; color: var(--muted); font-size: 14px; }

.people { display: grid; gap: 8px; margin-top: 12px; }

.person {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  border-radius: 12px;
  padding: 10px 12px;
}

.person .name { font-size: 18px; }
.person .meta { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.person.selected { outline: 2px solid var(--accent); }

.stage {
  position: relative;
  margin-top: 12px;
  background: #1c1915;
  border-radius: 12px;
  min-height: 180px;
  overflow: hidden;
}

#remoteVideo, #localVideo { display: block; background: #1c1915; }
#remoteVideo { width: 100%; min-height: 180px; }
#localVideo {
  position: absolute;
  width: 140px;
  right: 10px;
  bottom: 10px;
  border-radius: 8px;
}

button[hidden] { display: none; }

@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  h1 { font-size: 32px; }
}
