
:root {
  --bg: #0a0d16;
  --panel: #121827;
  --panel-2: #182033;
  --line: #2a3550;
  --text: #eef3ff;
  --muted: #9aa8c5;
  --accent: #77f2c7;
  --accent-2: #8aa6ff;
  --danger: #ff8398;
  --warning: #ffd37a;
  --shadow: 0 18px 50px rgba(0, 0, 0, .28);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 10%, rgba(79, 99, 209, .20), transparent 34%),
    radial-gradient(circle at 90% 20%, rgba(61, 214, 164, .14), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
button, input, textarea, select { font: inherit; }
button {
  border: 1px solid var(--line);
  background: #1a2337;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 13px;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
button:hover { transform: translateY(-1px); border-color: #52638a; }
button.primary { background: linear-gradient(135deg, var(--accent), #69c8ff); color: #071018; border: none; font-weight: 800; }
button:disabled { opacity: .6; cursor: progress; transform: none; }
input, textarea, select {
  width: 100%; border: 1px solid var(--line); background: #0e1422; color: var(--text); border-radius: 10px; padding: 11px 12px;
}
textarea { resize: vertical; }
.app-shell { max-width: 1800px; margin: 0 auto; padding: 18px; }
.topbar { display: flex; justify-content: space-between; gap: 24px; align-items: end; margin-bottom: 16px; }
.brand { font-size: clamp(28px, 4vw, 48px); font-weight: 900; letter-spacing: -.05em; }
.brand span { color: var(--accent); }
.tagline { color: var(--muted); margin-top: -4px; }
.api-status { margin-top: 8px; font-size: 13px; }
.api-status.good { color: var(--accent); }
.api-status.warn { color: var(--warning); }
.api-status.bad { color: var(--danger); }
.room-controls { display: flex; gap: 10px; align-items: end; }
.room-controls label { min-width: 220px; color: var(--muted); font-size: 12px; }
.dashboard { display: grid; grid-template-columns: 280px minmax(480px, 1fr) 330px; gap: 16px; align-items: start; }
.center-column, .right-column { display: grid; gap: 16px; }
.panel { background: linear-gradient(180deg, rgba(24, 32, 51, .96), rgba(16, 22, 37, .96)); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 16px; }
.panel-title-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 24px; }
h2 { margin-bottom: 0; font-size: 17px; }
h3 { margin-bottom: 0; font-size: 15px; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .13em; font-size: 10px; font-weight: 900; margin-bottom: 5px; }
.pill, .status-badge { font-size: 11px; border-radius: 999px; padding: 5px 9px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.status-badge.live { color: #08120f; background: var(--accent); border-color: transparent; font-weight: 900; }
.participant-list { display: grid; gap: 9px; margin: 15px 0; }
.participant { display: grid; grid-template-columns: 42px 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(9, 14, 25, .58); cursor: pointer; }
.participant.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(119, 242, 199, .12); }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; font-weight: 900; background: linear-gradient(135deg, #2c3b65, #26304b); }
.avatar.human { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #071018; }
.participant-name { font-weight: 800; }
.participant-role { color: var(--muted); font-size: 12px; margin-top: 2px; }
.participant-status { color: var(--muted); font-size: 11px; margin-top: 5px; }
.participant-status.good { color: var(--accent); }
.participant-status.warn { color: var(--warning); }
.participant-status.bad { color: var(--danger); }
.presence { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.constitution-card { border-top: 1px solid var(--line); padding-top: 14px; }
.constitution-card ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.agenda-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 12px; margin-top: 16px; }
.agenda-card, .speaker-card, .motion-card { border: 1px solid var(--line); background: rgba(8, 13, 23, .52); border-radius: 13px; padding: 13px; }
.speaker-card { display: flex; flex-direction: column; justify-content: center; }
.speaker-name { font-size: 20px; font-weight: 900; }
.muted { color: var(--muted); font-size: 13px; margin-top: 4px; }
.motion-card { margin-top: 12px; }
.vote-area { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.vote-tally { color: var(--muted); font-size: 13px; margin-left: auto; }
.hidden { display: none !important; }
.transcript { height: 420px; overflow: auto; display: grid; gap: 10px; margin: 14px 0; padding-right: 4px; }
.message { border: 1px solid var(--line); background: rgba(8, 13, 23, .52); border-radius: 13px; padding: 11px 12px; }
.message .meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.message.system { border-style: dashed; color: var(--muted); }
.message.error { border-color: rgba(255,131,152,.55); }
.composer { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.queue-list, .ledger-list { display: grid; gap: 8px; margin-top: 14px; }
.queue-item, .ledger-item { border: 1px solid var(--line); background: rgba(8, 13, 23, .52); border-radius: 11px; padding: 10px; font-size: 13px; }
.queue-item strong, .ledger-item strong { display: block; margin-bottom: 3px; }
.queue-item span, .ledger-item span { color: var(--muted); }
.procedure-actions { display: grid; gap: 8px; margin-top: 14px; }
dialog { width: min(520px, calc(100vw - 28px)); border: 1px solid var(--line); border-radius: 16px; padding: 0; background: var(--panel); color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, .7); }
dialog form { padding: 18px; }
dialog label { display: grid; gap: 8px; color: var(--muted); }
.dialog-actions { display: flex; justify-content: end; gap: 8px; margin-top: 14px; }
@media (max-width: 1180px) { .dashboard { grid-template-columns: 240px 1fr; } .right-column { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .app-shell { padding: 10px; } .topbar, .room-controls { align-items: stretch; flex-direction: column; } .dashboard { grid-template-columns: 1fr; } .right-column { grid-column: auto; grid-template-columns: 1fr; } .agenda-grid { grid-template-columns: 1fr; } .transcript { height: 340px; } }


.roundtable-card {
  border: 1px solid var(--line);
  background: rgba(8, 13, 23, .52);
  border-radius: 13px;
  padding: 12px;
  margin-top: 14px;
}
.mode-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.mode-block {
  display: grid;
  gap: 7px;
}
.mode-divider {
  height: 1px;
  background: var(--line);
  margin: 13px 0;
}
.captain-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.captain-actions {
  align-items: stretch;
}
.captain-actions button {
  flex: 1;
}


/* Clean phone-style group chat */
body.chat-mode {
  background:
    radial-gradient(circle at 50% 0%, rgba(119, 242, 199, .08), transparent 30%),
    #070a10;
}

.group-chat-view {
  min-height: calc(100vh - 36px);
  display: grid;
  place-items: center;
  padding: 12px;
}

.chat-phone {
  width: min(760px, 100%);
  height: min(900px, calc(100vh - 24px));
  min-height: 600px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  background: #0d111b;
  border: 1px solid #253049;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .48);
}

.chat-header {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  background: rgba(18, 24, 39, .96);
  border-bottom: 1px solid #253049;
}

.chat-back {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0 0 4px;
  border: none;
  background: transparent;
  font-size: 38px;
  line-height: 1;
  color: var(--accent);
}

.chat-avatar-stack {
  display: flex;
  align-items: center;
  min-width: 76px;
}

.chat-avatar-stack span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  margin-left: -9px;
  border: 2px solid #121827;
  border-radius: 50%;
  background: linear-gradient(135deg, #34456f, #24304d);
  font-size: 9px;
  font-weight: 900;
}

.chat-avatar-stack span:first-child {
  margin-left: 0;
}

.chat-title-block h1 {
  margin: 0;
  font-size: 17px;
}

.chat-title-block div {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.group-chat-messages {
  overflow-y: auto;
  padding: 18px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background:
    radial-gradient(circle at 20% 0%, rgba(79, 99, 209, .08), transparent 34%),
    #0a0e17;
}

.chat-message-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 88%;
}

.chat-message-row.mine {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-message-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #273350;
  color: #eef3ff;
  font-size: 9px;
  font-weight: 900;
}

.chat-message-row.mine .chat-message-avatar {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #071018;
}

.chat-bubble-wrap {
  min-width: 0;
}

.chat-author {
  margin: 0 0 4px 7px;
  color: var(--muted);
  font-size: 10px;
}

.chat-message-row.mine .chat-author {
  display: none;
}

.chat-bubble {
  padding: 10px 13px;
  border-radius: 18px 18px 18px 5px;
  background: #182135;
  color: var(--text);
  line-height: 1.42;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-message-row.mine .chat-bubble {
  border-radius: 18px 18px 5px 18px;
  background: linear-gradient(135deg, #77f2c7, #69c8ff);
  color: #071018;
}

.chat-message-row.error .chat-bubble {
  border: 1px solid rgba(255, 131, 152, .55);
}

.chat-time {
  margin: 4px 7px 0;
  color: #71809c;
  font-size: 9px;
}

.chat-message-row.mine .chat-time {
  text-align: right;
}

.group-chat-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 32px;
  padding: 0 18px 8px;
  background: #0a0e17;
  color: var(--muted);
}

.group-chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: chatTyping 1.15s infinite ease-in-out;
}

.group-chat-typing span:nth-child(2) { animation-delay: .13s; }
.group-chat-typing span:nth-child(3) { animation-delay: .26s; }

.group-chat-typing em {
  margin-left: 5px;
  font-size: 11px;
  font-style: normal;
}

@keyframes chatTyping {
  0%, 70%, 100% { transform: translateY(0); opacity: .42; }
  35% { transform: translateY(-4px); opacity: 1; }
}

.group-chat-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  padding: 12px;
  background: #121827;
  border-top: 1px solid #253049;
}

.group-chat-composer input {
  min-height: 46px;
  border-radius: 999px;
  padding-left: 17px;
  background: #0a0e17;
}

.group-chat-send {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  padding: 0 0 2px;
  background: linear-gradient(135deg, var(--accent), #69c8ff);
  color: #071018;
  font-size: 24px;
  font-weight: 900;
}

@media (max-width: 760px) {
  .group-chat-view {
    min-height: 100vh;
    padding: 0;
  }

  .chat-phone {
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    border: none;
    border-radius: 0;
  }

  .chat-header {
    padding-top: max(14px, env(safe-area-inset-top));
  }

  .group-chat-composer {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}


/* USAi private beta access and tester controls */
body {
  padding-top: 0;
}

.beta-login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(circle at 20% 8%, rgba(105, 200, 255, .13), transparent 30%),
    radial-gradient(circle at 84% 18%, rgba(119, 242, 199, .12), transparent 27%),
    #070a10;
}

.beta-login-card {
  width: min(560px, 100%);
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(24, 32, 51, .98), rgba(12, 17, 29, .98));
  box-shadow: 0 34px 100px rgba(0, 0, 0, .52);
}

.beta-login-brand {
  margin-bottom: 5px;
  font-size: 38px;
  font-weight: 950;
  letter-spacing: -.07em;
}

.beta-login-brand span {
  color: var(--accent);
}

.beta-kicker {
  margin-bottom: 25px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.beta-login-card h1 {
  max-width: 470px;
  margin-bottom: 15px;
  font-size: clamp(32px, 7vw, 48px);
  line-height: 1.02;
  letter-spacing: -.045em;
}

.beta-login-card > p,
.beta-login-note {
  color: var(--muted);
}

.beta-login-form {
  display: grid;
  gap: 14px;
  margin-top: 25px;
}

.beta-login-form label,
#feedbackForm label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.beta-login-form input {
  width: 100%;
  min-height: 49px;
}

.beta-login-form button {
  min-height: 49px;
  margin-top: 3px;
}

.beta-form-message {
  min-height: 20px;
  color: var(--accent);
  font-size: 12px;
}

.beta-form-message.error {
  color: var(--danger);
}

.beta-login-note {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.5;
}

.beta-toolbar {
  min-height: 54px;
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 8px max(14px, calc((100vw - 1500px) / 2));
  border-bottom: 1px solid #2a3854;
  background: rgba(7, 10, 16, .94);
  backdrop-filter: blur(18px);
}

.beta-toolbar > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.beta-toolbar strong {
  color: var(--accent);
  font-size: 12px;
}

.beta-toolbar span {
  color: var(--muted);
  font-size: 11px;
}

.beta-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.beta-toolbar button {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 11px;
}

.beta-usage-meter {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}

.feedback-check {
  grid-template-columns: auto 1fr !important;
  align-items: center;
}

.feedback-check input {
  width: auto;
}

#feedbackForm {
  display: grid;
  gap: 13px;
}

#feedbackForm textarea,
#feedbackForm select {
  width: 100%;
}

@media (max-width: 700px) {
  .beta-toolbar {
    position: relative;
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
    padding: 9px 12px;
  }

  .beta-toolbar > div:first-child,
  .beta-toolbar-actions {
    justify-content: space-between;
  }

  .beta-toolbar-actions {
    overflow-x: auto;
  }

  .beta-login-card {
    padding: 26px;
  }
}


.beta-login-brand {
  display: inline-block;
  color: inherit;
  text-decoration: none;
}

.beta-home-link {
  display: inline-block;
  margin-top: 20px;
  color: var(--accent);
  font-size: 12px;
  text-decoration: none;
}

.beta-home-link:hover {
  text-decoration: underline;
}


/* v1.1 — Lobby clarity and central Group Chat launch */
.lobby-header {
  display: grid;
  grid-template-columns: minmax(190px, .55fr) minmax(360px, 1.25fr) minmax(280px, .8fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 18px;
}

.lobby-brand-block,
.lobby-chat-launch,
.lobby-settings-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(24, 32, 51, .96), rgba(14, 20, 33, .96));
  box-shadow: var(--shadow);
}

.lobby-brand-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 20px;
}

.lobby-chat-launch {
  position: relative;
  overflow: hidden;
  padding: 21px;
  text-align: center;
  background:
    radial-gradient(circle at 50% -10%, rgba(119, 242, 199, .18), transparent 48%),
    linear-gradient(180deg, rgba(25, 37, 55, .98), rgba(13, 21, 34, .98));
}

.lobby-chat-launch::after {
  content: "";
  position: absolute;
  inset: auto 18% -65px;
  height: 110px;
  border-radius: 50%;
  background: rgba(105, 200, 255, .12);
  filter: blur(35px);
  pointer-events: none;
}

.lobby-step {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 10px;
  font-weight: 900;
}

.lobby-chat-launch h1 {
  margin: 7px 0 7px;
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: -.035em;
}

.lobby-chat-launch > p {
  max-width: 620px;
  margin: 0 auto 16px;
  color: var(--muted);
  font-size: 13px;
}

.lobby-chat-button {
  position: relative;
  z-index: 1;
  width: min(590px, 100%);
  min-height: 76px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  margin: 0 auto;
  padding: 13px 17px;
  border: 0;
  border-radius: 18px;
  color: #071018;
  text-align: left;
  background: linear-gradient(135deg, var(--accent), #69c8ff);
  box-shadow:
    0 15px 38px rgba(105, 200, 255, .20),
    inset 0 1px 0 rgba(255,255,255,.45);
}

.lobby-chat-button:hover {
  transform: translateY(-2px) scale(1.005);
  border-color: transparent;
}

.lobby-chat-icon {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(7, 16, 24, .10);
  font-size: 23px;
}

.lobby-chat-button strong,
.lobby-chat-button small {
  display: block;
}

.lobby-chat-button strong {
  font-size: 19px;
  letter-spacing: -.02em;
}

.lobby-chat-button small {
  margin-top: 2px;
  color: rgba(7, 16, 24, .72);
  font-size: 11px;
  font-weight: 700;
}

.lobby-chat-arrow {
  font-size: 27px;
  font-weight: 900;
}

.lobby-settings-card {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 18px;
}

.lobby-settings-copy h2 {
  margin: 5px 0;
  font-size: 18px;
}

.lobby-settings-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.lobby-settings-card label {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.lobby-settings-card #startMeetingBtn {
  min-height: 44px;
}

.lobby-divider {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: baseline;
  margin: 0 2px 12px;
  padding: 0 4px;
}

.lobby-divider span {
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.lobby-divider small {
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 1120px) {
  .lobby-header {
    grid-template-columns: .65fr 1.35fr;
  }

  .lobby-settings-card {
    grid-column: 1 / -1;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, .8fr) auto;
    align-items: end;
  }
}

@media (max-width: 760px) {
  .lobby-header {
    grid-template-columns: 1fr;
  }

  .lobby-brand-block {
    padding: 16px;
  }

  .lobby-chat-launch {
    padding: 18px 14px;
    order: -1;
  }

  .lobby-chat-button {
    min-height: 72px;
  }

  .lobby-settings-card {
    grid-column: auto;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .lobby-divider {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    padding: 0 2px;
  }
}
