.test-login-page .page-shell {
  width: min(1180px, 94vw);
}

.test-login-page .site-nav a[aria-current="page"] {
  background: var(--nav-hover-bg);
  color: var(--nav-hover-link);
}

.docs-hero h1 {
  margin: 2px 0 12px;
  color: var(--heading);
  font-size: clamp(1.7rem, 2.8vw, 2.5rem);
}

.docs-lead {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  max-width: 760px;
}

.docs-stamp {
  margin: 14px 0 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
}

.quick-guide h2 {
  margin: 0;
  color: var(--heading);
  font-size: 1.2rem;
}

.guide-list {
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.75;
}

.alert-panel {
  background: linear-gradient(135deg, rgba(250, 180, 53, 0.18), rgba(250, 180, 53, 0.08));
}

.alert-title {
  margin: 0;
  color: var(--heading);
  font-weight: 800;
}

.alert-text {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.doc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--shadow);
}

.doc-card h2 {
  margin: 0;
  color: var(--heading);
  font-size: 1.3rem;
}

.portal-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.portal-test-link,
.portal-direct-link {
  text-decoration: none;
  font-weight: 800;
  border-radius: 10px;
  padding: 9px 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.portal-test-link {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--primary-text);
  box-shadow: 0 10px 22px rgba(214, 146, 11, 0.24);
}

.portal-test-link:hover,
.portal-test-link:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(214, 146, 11, 0.32);
  outline: none;
}

.portal-direct-link {
  color: var(--heading);
  background: var(--panel-bg);
  border: 1px solid var(--border);
}

.portal-direct-link:hover,
.portal-direct-link:focus-visible {
  transform: translateY(-2px);
  background: var(--nav-hover-bg);
  outline: none;
}

.portal-url {
  margin: 10px 0 0;
  color: var(--muted);
  word-break: break-word;
}

.role-block {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: var(--panel-bg);
}

.role-block h3 {
  margin: 0 0 10px;
  color: var(--heading);
  font-size: 1rem;
}

.cred-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.cred-row span {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
}

.cred-row code {
  font-family: "Manrope", "Segoe UI", sans-serif;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 6px 8px;
  color: var(--heading);
  overflow-x: auto;
  word-break: break-word;
}

:root[data-theme="dark"] .cred-row code {
  background: rgba(255, 255, 255, 0.08);
}

.pending-note {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.test-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
}

.test-modal[hidden] {
  display: none;
}

.test-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 10, 20, 0.7);
  backdrop-filter: blur(4px);
}

.test-modal-dialog {
  position: relative;
  width: min(1200px, 96vw);
  max-height: calc(100vh - 40px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  overflow: hidden;
}

.test-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  padding: 16px 18px 8px;
}

.modal-kicker {
  margin: 0;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 800;
}

.test-modal-header h3 {
  margin: 4px 0 0;
  color: var(--heading);
  font-size: 1.1rem;
}

.modal-close-btn {
  border: 1px solid var(--border);
  background: var(--panel-bg);
  color: var(--heading);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.modal-close-btn:hover,
.modal-close-btn:focus-visible {
  background: var(--nav-hover-bg);
  outline: none;
}

.modal-url {
  margin: 0;
  padding: 0 18px 10px;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
  word-break: break-word;
}

.iframe-shell {
  margin: 0 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  min-height: 420px;
}

#portalFrame {
  width: 100%;
  height: 65vh;
  border: 0;
  background: #ffffff;
}

.modal-tools {
  padding: 12px 18px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.modal-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 980px) {
  .doc-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .docs-hero h1 {
    font-size: clamp(1.45rem, 7.6vw, 1.9rem);
  }

  .docs-lead,
  .guide-list,
  .alert-text {
    font-size: 0.95rem;
  }

  .portal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .portal-test-link,
  .portal-direct-link {
    text-align: center;
  }

  .cred-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .test-modal {
    padding: 10px;
  }

  .test-modal-dialog {
    width: 100%;
    max-height: calc(100vh - 20px);
  }

  .test-modal-header {
    align-items: center;
  }

  .iframe-shell {
    margin: 0 12px;
    min-height: 320px;
  }

  #portalFrame {
    height: 52vh;
  }

  .modal-url {
    padding: 0 12px 10px;
  }

  .test-modal-header,
  .modal-tools {
    padding-left: 12px;
    padding-right: 12px;
  }

  .modal-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-tools .portal-direct-link {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .doc-card {
    padding: 16px;
    border-radius: 16px;
  }

  .role-block {
    padding: 12px;
  }

  .test-modal {
    padding: 6px;
  }

  .test-modal-dialog {
    border-radius: 14px;
  }

  .iframe-shell {
    margin: 0 10px;
    min-height: 280px;
  }

  #portalFrame {
    height: 48vh;
  }
}
