:root {
  --ink: #1c1c1a;
  --paper: #f7f6f2;
  --panel: #ffffff;
  --line: #e2e0d8;
  --accent: #0f6e6e;
  --accent-dim: #0f6e6e22;
  --warn: #b3541e;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

a { color: var(--accent); }

/* ---------- Lobby ---------- */

.lobby {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lobby-card {
  width: 100%;
  max-width: 440px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2.25rem;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.4rem;
}

.lobby-card h1 {
  font-size: 1.5rem;
  margin: 0 0 1.6rem;
  line-height: 1.25;
}

label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 1rem 0 0.35rem;
}

label:first-of-type { margin-top: 0; }

input[type="text"], select {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--sans);
  font-size: 0.92rem;
  background: var(--paper);
  color: var(--ink);
}

input[type="text"]:focus, select:focus, button:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.role-toggle {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.role-toggle button {
  flex: 1;
  padding: 0.55rem;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.85rem;
}

.role-toggle button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.go-btn {
  width: 100%;
  margin-top: 1.6rem;
  padding: 0.75rem;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 3px;
  font-size: 0.95rem;
  cursor: pointer;
}

.go-btn:hover { background: var(--accent); }

.hint {
  font-size: 0.75rem;
  color: #6b6a63;
  margin-top: 0.6rem;
  line-height: 1.4;
}

/* ---------- Room ---------- */

.room {
  display: grid;
  grid-template-columns: 1fr 380px;
  height: 100vh;
}

@media (max-width: 860px) {
  .room { grid-template-columns: 1fr; grid-template-rows: 55vh 1fr; height: auto; min-height: 100vh; }
}

.doc-pane {
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-right: 1px solid var(--line);
  min-width: 0;
}

.doc-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.doc-toolbar button {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 3px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.doc-toolbar button:disabled { opacity: 0.35; cursor: default; }

.page-count {
  font-family: var(--mono);
  font-size: 0.82rem;
  min-width: 5.5rem;
  text-align: center;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
  margin-left: auto;
  flex-shrink: 0;
}

.pulse.live {
  background: var(--accent);
  animation: pulse 0.6s ease-out;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--accent-dim); }
  100% { box-shadow: 0 0 0 8px transparent; }
}

.follow-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

.doc-canvas-wrap {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.25rem;
}

#pdf-canvas {
  box-shadow: 0 2px 14px rgba(0,0,0,0.12);
  background: #fff;
  max-width: 100%;
  height: auto;
}

.jump-back {
  position: sticky;
  bottom: 1rem;
  align-self: center;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  cursor: pointer;
  display: none;
}

.jump-back.show { display: inline-flex; }

.meet-pane {
  display: flex;
  flex-direction: column;
  background: #111;
}

#meet-container { flex: 1; }

.status-bar {
  padding: 0.5rem 0.9rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #b9b7ad;
  background: #1c1c1a;
  border-top: 1px solid #2c2c2a;
}
