.portal-body {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(220, 239, 235, 0.86), rgba(251, 247, 239, 0.96)),
    var(--linen);
}

.portal-nav {
  gap: 16px;
}

.portal-nav form {
  margin: 0;
}

.nav-button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.auth-wrap,
.portal-main {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
}

.auth-wrap {
  min-height: calc(100vh - var(--header-height));
  display: grid;
  place-items: center;
  padding: 48px 0;
}

.auth-card,
.admin-panel,
.text-room,
.video-room {
  border: 1px solid rgba(36, 95, 91, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.auth-card {
  width: min(100%, 520px);
  padding: clamp(26px, 5vw, 42px);
}

.auth-card h1,
.portal-hero h1 {
  font-size: clamp(44px, 7vw, 78px);
}

.auth-card p,
.portal-hero p,
.portal-card strong,
.message-meta,
.video-status {
  color: var(--muted);
}

.auth-form {
  margin-top: 24px;
}

.auth-alert,
.auth-notice {
  padding: 12px 14px;
  border-radius: var(--radius);
  font-weight: 700;
}

.auth-alert {
  background: #fff0ed;
  color: #8c2e1d !important;
}

.auth-notice {
  background: var(--soft-teal);
  color: var(--deep-teal) !important;
}

.auth-swap {
  margin: 18px 0 0;
}

.auth-swap a {
  color: var(--deep-teal);
  font-weight: 800;
}

.portal-main {
  padding: clamp(48px, 7vw, 86px) 0;
}

.portal-hero {
  max-width: 760px;
  margin-bottom: 32px;
}

.portal-hero.compact {
  max-width: 860px;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.portal-card {
  min-height: 176px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  padding: 26px;
  border: 1px solid rgba(36, 95, 91, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  box-shadow: 0 14px 42px rgba(48, 74, 71, 0.08);
}

.portal-card:hover,
.portal-card:focus-visible {
  transform: translateY(-1px);
}

.portal-card span {
  color: var(--deep-teal);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.portal-card strong {
  font-size: 22px;
  line-height: 1.35;
}

.admin-panel,
.text-room,
.video-room {
  padding: clamp(22px, 4vw, 34px);
}

.admin-toolbar {
  margin-bottom: 16px;
}

.admin-list {
  display: grid;
  gap: 22px;
}

.admin-user-section {
  display: grid;
  gap: 12px;
}

.admin-section-title {
  margin: 0;
  font-size: 30px;
}

.admin-empty,
.access-summary {
  color: var(--muted);
}

.access-summary {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 700;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(36, 95, 91, 0.12);
  border-radius: var(--radius);
  background: var(--white);
}

.user-row h3 {
  margin-bottom: 2px;
}

.user-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.account-actions,
.access-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.small-button {
  min-height: 40px;
  padding: 8px 13px;
  border: 0;
  border-radius: 999px;
  background: var(--deep-teal);
  color: var(--white);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.small-button.secondary {
  border: 1px solid rgba(36, 95, 91, 0.22);
  background: var(--white);
  color: var(--deep-teal);
}

.small-button:disabled,
.access-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.access-toggle {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid rgba(36, 95, 91, 0.22);
  border-radius: 999px;
  background: var(--white);
  color: var(--deep-teal);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}

.access-toggle.is-on {
  border-color: transparent;
  background: var(--soft-teal);
  color: var(--deep-teal);
}

.messages {
  display: grid;
  gap: 12px;
  min-height: 280px;
  max-height: 460px;
  overflow: auto;
  padding: 4px 4px 18px;
}

.message {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid rgba(36, 95, 91, 0.12);
}

.message p {
  margin-bottom: 0;
}

.message-meta {
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 800;
}

.message-form {
  margin-top: 18px;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.video-grid h2 {
  font-size: 32px;
}

video,
.remote-videos {
  width: 100%;
  min-height: 300px;
  border-radius: var(--radius);
  background: #173c39;
  overflow: hidden;
}

.remote-videos {
  display: grid;
  place-items: center;
}

.remote-videos:empty::before {
  content: "Waiting for another approved participant";
  color: rgba(255, 255, 255, 0.78);
  font-weight: 700;
  text-align: center;
  padding: 24px;
}

.remote-videos video {
  min-height: 300px;
}

.video-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.video-status {
  margin: 0;
  font-weight: 700;
}

@media (max-width: 880px) {
  .portal-nav {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    box-shadow: none;
    border: 0;
    background: transparent;
  }

  .site-header:has(.portal-nav) {
    display: grid;
  }

  .portal-grid,
  .video-grid,
  .user-row {
    grid-template-columns: 1fr;
  }

  .user-actions,
  .account-actions,
  .access-list {
    justify-items: stretch;
    justify-content: flex-start;
  }
}
