.portal-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

body.modal-open {
  overflow: hidden;
}

.portal-hero,
.portal-card {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(247, 250, 255, 0.74));
  border-radius: 28px;
  backdrop-filter: blur(10px);
}

.portal-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
  padding: 24px 28px;
}

.portal-hero .brand-logo {
  max-width: min(100%, 300px);
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.portal-card {
  padding: 24px;
}

.portal-copy {
  color: var(--muted);
}

.portal-card-wide {
  margin-top: 18px;
}

.portal-card,
.portal-hero,
.portal-lead,
.portal-status {
  overflow-wrap: anywhere;
}

.portal-section {
  overflow: hidden;
}

.portal-section-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}

.portal-section-summary::-webkit-details-marker {
  display: none;
}

.portal-section-summary h2 {
  margin: 0;
}

.portal-section-toggle {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(19, 41, 78, 0.08);
  flex: 0 0 auto;
}

.portal-section-toggle::before,
.portal-section-toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: var(--accent-dark);
  transform: translate(-50%, -50%);
  transition: transform 180ms ease, opacity 180ms ease;
}

.portal-section-toggle::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.portal-section[open] .portal-section-toggle::after {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(90deg) scaleX(0.2);
}

.portal-section-body {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.portal-form {
  display: grid;
  gap: 12px;
}

.portal-form label {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.portal-account-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.portal-status {
  color: var(--muted);
  font-weight: 600;
}

.portal-leads {
  display: grid;
  gap: 14px;
}

.portal-lead {
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(247, 250, 255, 0.72));
  border: 1px solid rgba(21, 35, 59, 0.08);
}

.portal-lead-head,
.portal-lead-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.portal-lead-meta span {
  color: var(--muted);
}

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

.portal-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.portal-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 17, 34, 0.58);
  backdrop-filter: blur(10px);
}

.portal-modal-panel {
  position: relative;
  z-index: 1;
  width: min(540px, calc(100% - 28px));
  margin: min(9vh, 72px) auto 0;
  padding: 28px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(251, 253, 255, 0.96);
  box-shadow: 0 30px 96px rgba(7, 17, 34, 0.24);
}

.portal-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(19, 41, 78, 0.08);
  color: var(--text);
  cursor: pointer;
  font-size: 1.4rem;
}

@media (max-width: 980px) {
  .portal-shell {
    width: min(1180px, calc(100% - 20px));
    padding: 24px 0 40px;
  }

  .portal-hero {
    padding: 20px;
  }

  .portal-card {
    padding: 20px;
  }

  .portal-account-head {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 860px) {
  .portal-hero,
  .portal-grid {
    grid-template-columns: 1fr;
  }

  .portal-hero {
    gap: 16px;
    padding: 18px;
  }

  .portal-hero .brand {
    justify-content: center;
  }

  .portal-section-summary {
    align-items: flex-start;
  }

  .portal-section-summary h2 {
    font-size: 1.35rem;
  }

  .portal-lead-head,
  .portal-lead-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .portal-modal-panel {
    width: calc(100% - 18px);
    margin-top: 18px;
    padding: 20px 16px;
  }
}

@media (max-width: 520px) {
  .portal-shell {
    padding-top: 18px;
  }

  .portal-hero,
  .portal-card {
    border-radius: 22px;
  }

  .portal-card {
    padding: 16px;
  }

  .portal-section-body {
    margin-top: 14px;
  }

  .portal-status {
    line-height: 1.6;
  }

  .portal-section-summary h2 {
    font-size: 1.15rem;
  }
}
