:root {
  --bg: #f4efe6;
  --panel: rgba(255, 252, 248, 0.92);
  --line: rgba(69, 54, 37, 0.14);
  --ink: #2b241b;
  --muted: #6b6258;
  --brand: #1f6a5f;
  --brand-deep: #124740;
  --warn: #a24a2b;
  --ok: #1f6a5f;
  --shadow: 0 24px 60px rgba(36, 26, 16, 0.12);
  --radius: 22px;
  font-family: "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(31, 106, 95, 0.18), transparent 24%),
    radial-gradient(circle at left bottom, rgba(162, 74, 43, 0.14), transparent 22%),
    linear-gradient(180deg, #f8f4ee 0%, var(--bg) 100%);
  color: var(--ink);
}

button,
.button-link {
  border: none;
  border-radius: 999px;
  padding: 0.9rem 1.2rem;
  background: var(--brand);
  color: #fff;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

button.secondary,
.button-link.secondary {
  background: rgba(43, 36, 27, 0.08);
  color: var(--ink);
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  font: inherit;
  background: #fff;
}

.auth-page {
  display: grid;
  place-items: center;
  padding: 2.5rem;
}

.auth-shell {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 440px);
  gap: 1.5rem;
  align-items: stretch;
}

.auth-shell-single {
  width: min(100%, 520px);
  grid-template-columns: 1fr;
}

.auth-panel,
.panel {
  background: var(--panel);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-panel {
  padding: 2.2rem;
}

.auth-hero {
  display: grid;
  align-content: start;
  gap: 1.35rem;
  padding: clamp(2rem, 4vw, 3.25rem);
  background:
    radial-gradient(circle at top right, rgba(31, 106, 95, 0.18), transparent 26%),
    linear-gradient(160deg, rgba(255, 252, 248, 0.95) 0%, rgba(242, 236, 226, 0.92) 100%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
}

.auth-hero h1,
.auth-panel h1,
.panel h2 {
  margin: 0;
}

.auth-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.highlight-card {
  min-height: 150px;
  padding: 1.1rem 1rem;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(69, 54, 37, 0.08);
  border-radius: 18px;
}

.highlight-card h2 {
  margin: 0 0 0.45rem;
  font-size: 1.02rem;
}

.highlight-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.eyebrow {
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  color: var(--brand);
}

.lede {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.stack {
  display: grid;
  gap: 1rem;
}

.auth-site-name {
  margin: 0;
  color: #0f3d36;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 4.8rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 0.65rem;
  transform: translateY(-50%);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(31, 106, 95, 0.12);
  color: var(--brand-deep);
  font-size: 0.84rem;
  font-weight: 600;
}

.auth-panel form + form {
  margin-top: 1rem;
}

.notice {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(31, 106, 95, 0.1);
  color: var(--brand-deep);
}

.notice.error {
  background: rgba(162, 74, 43, 0.12);
  color: var(--warn);
}

.notice.hidden {
  display: none;
}

.room-shell {
  padding: 1.25rem;
}

.topbar,
.controls,
.layout {
  width: min(1400px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.topbar-meta,
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.pill,
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(31, 106, 95, 0.1);
  color: var(--brand-deep);
  font-size: 0.9rem;
}

.pill.subtle,
.badge {
  background: rgba(43, 36, 27, 0.08);
  color: var(--ink);
}

.pill.ok {
  background: rgba(31, 106, 95, 0.12);
  color: var(--ok);
}

.pill.warn {
  background: rgba(162, 74, 43, 0.12);
  color: var(--warn);
}

.controls {
  margin-bottom: 1rem;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14px 320px;
  align-items: start;
}

.layout-main {
  min-width: 0;
}

.layout-resizer {
  position: relative;
  min-height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.layout-resizer::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: 0 auto;
  width: 2px;
  border-radius: 999px;
  background: rgba(69, 54, 37, 0.16);
}

.layout-resizer::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 72px;
  border-radius: 999px;
  background: rgba(255, 252, 248, 0.92);
  border: 1px solid rgba(69, 54, 37, 0.14);
  box-shadow: 0 14px 28px rgba(36, 26, 16, 0.12);
  transform: translate(-50%, -50%);
}

.layout-resizer:hover::before,
.layout-resizer:focus-visible::before,
body.is-resizing .layout-resizer::before {
  background: rgba(31, 106, 95, 0.44);
}

.layout-resizer:focus-visible {
  outline: none;
}

.sidebar {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.panel {
  padding: 1.25rem;
}

.facts {
  display: grid;
  gap: 0.85rem;
  margin: 0;
}

.facts div {
  display: grid;
  gap: 0.2rem;
}

.facts dt {
  color: var(--muted);
  font-size: 0.9rem;
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.participant-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.7rem;
}

.participant-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}

.scripture-panel {
  gap: 0.9rem;
}

.scripture-form {
  display: grid;
  gap: 0.75rem;
}

.scripture-content {
  max-height: 42vh;
  overflow: auto;
  padding-right: 0.35rem;
  border-top: 1px solid var(--line);
}

.scripture-state {
  margin: 1rem 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.scripture-verse {
  margin: 0.85rem 0 0;
  line-height: 1.85;
}

.scripture-verse:first-child {
  margin-top: 1rem;
}

.scripture-verse-number {
  color: var(--brand-deep);
  font-weight: 700;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.15rem;
}

.video-card {
  display: grid;
  gap: 0.8rem;
  padding: 1.1rem;
  min-height: 0;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 160ms ease, border-color 160ms ease;
}

.video-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.video-card.speaking {
  transform: translateY(-2px);
  border-color: rgba(31, 106, 95, 0.45);
}

.media-stage {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  min-height: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, #d8efe6 0%, #d9d1c2 100%);
}

.media-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 4rem;
  font-weight: 700;
  color: rgba(18, 71, 64, 0.55);
}

.media-stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.audio-sink {
  display: none;
}

@media (max-width: 1000px) {
  .auth-page {
    padding: 1.15rem;
  }

  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-hero {
    padding: 1.5rem;
  }

  .auth-highlights {
    grid-template-columns: 1fr;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .layout-resizer {
    display: none;
  }

  .video-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .video-card {
    min-height: 0;
  }

  .media-stage {
    aspect-ratio: 4 / 3;
    min-height: 0;
  }
}
