#portal-root {
  padding: 12px 0 0;
}

.portal-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 28px;
}

.portal-heading h2 {
  margin: 8px 0;
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: -1px;
  color: #17384e;
}

.portal-heading p {
  margin: 0;
}

.portal-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.3px;
  color: #42718b;
}

.portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.portal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid #245875;
  border-radius: 8px;
  background: #245875;
  color: white;
  font: 600 14px 'Segoe UI', system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.portal-button.secondary {
  color: #245875;
  background: white;
  border-color: #cddae3;
}

.portal-button:hover {
  background: #18405a;
  color: white;
}

.portal-button:disabled,
.portal-account:disabled {
  opacity: .6;
  cursor: wait;
}

.portal-roles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.portal-role {
  border: 1px solid #dbe4e9;
  background: #fff;
  border-radius: 16px;
  padding: 30px;
  margin: 0;
}

.portal-role h3 {
  color: #17384e;
  font-size: 24px;
  margin: 14px 0 8px;
}

.portal-role p {
  margin: 0 0 25px;
}

.portal-account-list {
  display: grid;
  gap: 12px;
}

.portal-account {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 16px;
  border: 1px solid #dbe4e9;
  background: #f8fafb;
  border-radius: 10px;
  color: #244357;
  cursor: pointer;
  font: inherit;
}

.portal-account:hover {
  background: #edf5fa;
  border-color: #85acc3;
}

.portal-account strong {
  display: block;
  font-size: 15px;
}

.portal-account small {
  display: block;
  margin-top: 4px;
  color: #617887;
  font-size: 13px;
}

.portal-avatar {
  flex: 0 0 42px;
  height: 42px;
  border-radius: 12px;
  background: #e4eef3;
  display: grid;
  place-items: center;
  color: #29546c;
  font-size: 13px;
  font-weight: 700;
}

.portal-arrow {
  margin-left: auto;
}

.portal-storage-note {
  font-size: 12px;
  margin-top: 20px;
}

#portal-status {
  color: #275c76;
  font-size: 14px;
  min-height: 22px;
  margin: 0 0 12px;
}

.portal-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 36px;
}

.portal-metrics article {
  padding: 24px;
  border: 1px solid #dbe4e9;
  background: #fff;
  border-radius: 12px;
}

.portal-metrics span {
  display: block;
  color: #5a7180;
  font-size: 13px;
}

.portal-metrics strong {
  display: block;
  color: #17384e;
  margin-top: 12px;
  font-size: 32px;
  font-weight: 600;
}

.portal-metrics small {
  font-size: 16px;
  color: #68808f;
  font-weight: 400;
}

.portal-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 30px 0 16px;
}

.portal-section-heading h3,
.portal-create h3 {
  font-size: 20px;
  color: #17384e;
  margin: 0;
}

.portal-section-heading a,
.portal-section-heading>span {
  font-size: 13px;
  color: #496c83;
}

.portal-class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.portal-class {
  background: #edf4f7;
  border: 1px solid #dbe5eb;
  border-radius: 12px;
  padding: 24px;
}

.portal-class h4 {
  font-size: 19px;
  margin: 12px 0 10px;
  color: #17384e;
}

.portal-class p {
  margin: 0;
  font-size: 14px;
}

.portal-class-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #d6e2e9;
  color: #456276;
  font-size: 13px;
}

.portal-class details {
  background: transparent;
  border: 0;
  padding: 12px 0 0;
  margin: 0;
}

.portal-class ul {
  font-size: 14px;
  line-height: 1.9;
  padding-left: 20px;
}

.portal-assignment-list {
  border: 1px solid #dbe4e9;
  border-radius: 12px;
  background: white;
  overflow: hidden;
}

.portal-assignment {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 22px 24px;
  border-bottom: 1px solid #e6edf1;
}

.portal-assignment:last-child {
  border-bottom: 0;
}

.portal-assignment-main {
  min-width: 0;
  overflow-wrap: anywhere;
}

.portal-assignment h4 {
  font-size: 16px;
  color: #244357;
  margin: 7px 0;
}

.portal-assignment p {
  margin: 0;
  font-size: 12px;
}

.portal-submissions {
  min-width: 240px;
  margin: 0;
  background: #f8fafb;
}

.portal-submissions ul {
  list-style: none;
  padding: 0;
  margin-bottom: 0;
}

.portal-submissions li {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 13px;
}

.portal-badge {
  display: inline-block;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  background: #eff2f4;
  color: #596c78;
  padding: 7px 12px;
}

.portal-badge.complete {
  background: #e5f3ec;
  color: #266147;
}

.portal-create {
  margin: 28px 0;
  padding: 24px;
  border: 1px solid #dbe4e9;
  border-radius: 12px;
  background: white;
}

.portal-create form {
  display: grid;
  grid-template-columns: 2fr 1.3fr 1fr auto;
  gap: 16px;
  align-items: end;
  margin-top: 20px;
}

.portal-create label {
  display: grid;
  gap: 8px;
  color: #456276;
  font-size: 13px;
  min-width: 0;
}

.portal-create input,
.portal-create select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 10px;
  border: 1px solid #c9d7e0;
  border-radius: 7px;
  color: #244357;
  background: white;
  font: 14px 'Segoe UI', system-ui, sans-serif;
}

.portal-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 28px 0 0;
}

.portal-bottom p {
  font-size: 12px;
}

.portal-text-button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: #456276;
  font: 13px 'Segoe UI', system-ui, sans-serif;
  text-decoration: underline;
  cursor: pointer;
}

.portal-error {
  padding: 30px;
  border: 1px solid #dbe4e9;
  border-radius: 12px;
  background: white;
}

@media (max-width: 850px) {
  .portal-create form {
    grid-template-columns: 1fr 1fr;
  }

  .portal-create form>label:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 700px) {
  .portal-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-roles {
    grid-template-columns: 1fr;
  }

  .portal-role {
    padding: 24px;
  }

  .portal-metrics {
    gap: 8px;
  }

  .portal-metrics article {
    padding: 16px 12px;
  }

  .portal-metrics strong {
    font-size: 26px;
  }

  .portal-assignment {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
  }

  .portal-submissions {
    min-width: 0;
    width: 100%;
  }

  .portal-bottom {
    align-items: flex-start;
  }
}

@media (max-width: 400px) {
  .portal-create form {
    grid-template-columns: 1fr;
  }

  .portal-create form>label:first-child {
    grid-column: auto;
  }

  .portal-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}
