:root {
  --bg: #0f1115;
  --panel: #171a21;
  --line: #262b35;
  --fg: #e8eaed;
  --muted: #9aa0a6;
  --accent: #4f8cff;
  --guest: #f5a524;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Inter, Arial, sans-serif;
}

.logo { font-weight: 700; letter-spacing: .2px; }
.logo span { color: var(--accent); font-weight: 500; }

/* ── standalone message card (index, errors) ───────────────────────────── */
.card {
  max-width: 30rem;
  margin: 12vh auto;
  padding: 2rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.card h1 { font-size: 1.25rem; margin: 1.2rem 0 .6rem; }
.card p { color: var(--muted); margin: .4rem 0; }
.card code {
  display: block;
  margin-top: 1rem;
  padding: .6rem .8rem;
  background: #0b0d11;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: .85rem;
  overflow-x: auto;
}

/* ── meeting shell ─────────────────────────────────────────────────────── */
.shell { display: flex; flex-direction: column; height: 100%; }

.bar {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .55rem 1rem;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
  min-height: 3rem;
}
.bar .subject {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar .when { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.bar .spacer { flex: 1 1 auto; }

.badge {
  padding: .12rem .5rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.badge.host  { color: var(--accent); border-color: var(--accent); }
.badge.guest { color: var(--guest);  border-color: var(--guest); }

/* host-only actions in the bar */
.bar button {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .3rem .7rem;
  font: inherit;
  font-size: .85rem;
  cursor: pointer;
  white-space: nowrap;
}
.bar button:hover { border-color: var(--accent); color: var(--accent); }

/* the stage holds the meeting; a panel floats over it, never re-parenting it */
.wrap { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; }
#stage { position: absolute; inset: 0; }
#stage iframe { display: block; width: 100%; height: 100%; border: 0; }

/* host panel: drops down from the header buttons, folds back up into them;
   beside Jitsi's right pane (participants, 315px measured), never over it */
.panel {
  --jitsi-pane: 330px;
  position: absolute;
  top: 0;
  right: 1rem;
  width: min(23rem, calc(100vw - 2rem));
  max-height: min(28rem, calc(100% - .6rem));
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  z-index: 5;
  overflow: hidden;
  transition: transform .18s ease, opacity .18s ease;
}
.panel[hidden] { display: none; }
.panel.collapsed { transform: translateY(-100%); opacity: 0; pointer-events: none; }
.panel.beside-jitsi {
  right: calc(var(--jitsi-pane) + 1rem);
  width: min(23rem, calc(100vw - var(--jitsi-pane) - 2rem));
}
.panel header {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem .8rem;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
.panel header .spacer { flex: 1 1 auto; }
.panel .body { padding: .7rem .8rem; overflow-y: auto; }
.panel input[type="text"], .panel input[type="number"] {
  width: 100%;
  padding: .45rem .6rem;
  background: #0b0d11;
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}
.panel ul { list-style: none; margin: .6rem 0 0; padding: 0; }
.panel li {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .1rem;
  border-bottom: 1px solid var(--line);
}
.panel li .who { flex: 1 1 auto; min-width: 0; }
.panel li .who small { display: block; color: var(--muted); }
.panel li b { font-weight: 500; }
.panel .note { color: var(--muted); font-size: .85rem; margin-top: .5rem; }
.panel .link {
  margin-top: .6rem;
  padding: .5rem .6rem;
  background: #0b0d11;
  border: 1px solid var(--line);
  border-radius: 8px;
  word-break: break-all;
  font-size: .8rem;
}
.panel .ok { color: #4ade80; }

.hint {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--muted);
}

@media (max-width: 640px) {
  .bar .when { display: none; }
}
