.profile-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .65fr);
  align-items: start;
  gap: 16px;
  min-width: 0;
}

.profile-editor-head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  align-items: center !important;
}

.profile-completion {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.profile-completion-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--workspace-muted);
  font-size: 11px;
  font-weight: 750;
}

.profile-completion-head strong {
  color: var(--workspace-ink);
  font-size: 14px;
}

.profile-completion-track {
  overflow: hidden;
  height: 6px;
  border-radius: 3px;
  background: #e5eaf0;
}

.profile-completion-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--workspace-accent);
  transition: width 180ms ease;
}

body[data-page] .profile-completion p {
  margin: 0;
  color: var(--workspace-muted);
  font-size: 11px;
  line-height: 1.4;
}

.profile-editor-body {
  gap: 16px !important;
}

.profile-section-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--workspace-line);
  border-radius: 8px;
  background: #edf1f4;
}

.profile-section-nav button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 7px;
  min-width: 0;
  min-height: 48px;
  padding: 7px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #566476;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
}

.profile-section-nav button.active {
  background: var(--workspace-surface);
  color: var(--workspace-accent);
  box-shadow: 0 1px 2px rgba(23, 34, 48, .1);
}

.profile-step-number {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #dce3ea;
  color: #647184;
  font-size: 11px;
}

.profile-section-nav button.active .profile-step-number {
  background: var(--workspace-accent);
  color: #fff;
}

.profile-section-nav small {
  overflow: hidden;
  color: #7b8795;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-step-form {
  align-items: stretch !important;
  gap: 12px !important;
}

.profile-step-form .profile-step {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
  margin: 0;
  padding: 2px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.profile-step-form .profile-step[hidden] {
  display: none !important;
}

.profile-step-form .profile-step legend {
  width: 100%;
  margin-bottom: 12px;
  padding: 0;
}

.profile-step-form .profile-step legend span,
.profile-step-form .profile-step legend small {
  display: block;
}

.profile-step-form .profile-step legend span {
  color: var(--workspace-ink);
  font-size: 15px;
  font-weight: 850;
}

.profile-step-form .profile-step legend small {
  margin-top: 2px;
  color: var(--workspace-muted);
  font-size: 11px;
  font-weight: 650;
}

.profile-step-form .profile-step > .wide {
  grid-column: 1 / -1;
}

.profile-major-selector {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.profile-major-selector-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.profile-major-selector-head strong {
  color: var(--workspace-ink);
  font-size: 12px;
  font-weight: 800;
}

.profile-major-selector-head span {
  color: var(--workspace-muted);
  font-size: 10px;
  font-weight: 700;
}

.profile-major-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.profile-major-option {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--workspace-line);
  border-radius: 6px;
  background: #f8fafb;
  color: var(--workspace-ink);
  cursor: pointer;
}

.profile-major-option:has(input:checked) {
  border-color: var(--workspace-accent);
  background: var(--workspace-accent-soft);
}

.profile-major-option input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--workspace-accent);
}

.profile-major-option span {
  min-width: 0;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.profile-form-message {
  padding: 10px 12px;
  border-left: 3px solid var(--workspace-accent);
  border-radius: 4px;
  background: var(--workspace-accent-soft);
  color: var(--workspace-ink);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.profile-form-message[hidden] {
  display: none;
}

.profile-form-message[data-tone="success"] {
  border-left-color: #23805f;
  background: #eaf7f1;
  color: #155b43;
}

.profile-form-message[data-tone="error"] {
  border-left-color: #b9423b;
  background: #fff0ef;
  color: #8b2f2a;
}

.profile-step-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid #e7ebef;
}

.profile-step-actions > span {
  margin-right: auto;
  color: var(--workspace-muted);
  font-size: 11px;
  line-height: 1.4;
}

.profile-score-group {
  grid-column: 1 / -1;
  padding-top: 13px;
  border-top: 1px solid #e7ebef;
}

.profile-score-group:first-of-type {
  padding-top: 0;
  border-top: 0;
}

.profile-score-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.profile-score-group-head h3 {
  margin: 0;
  color: var(--workspace-ink);
  font-size: 13px;
}

.profile-score-group-head span {
  color: var(--workspace-muted);
  font-size: 10px;
}

.profile-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.profile-submit-summary {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding: 12px 14px;
  border-left: 3px solid var(--workspace-accent);
  background: #f6f8fa;
}

.profile-submit-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.profile-submit-summary-head strong {
  font-size: 13px;
}

.profile-readiness {
  font-size: 11px;
  font-weight: 800;
}

.profile-readiness.ready {
  color: #237255;
}

.profile-readiness.incomplete {
  color: #a76516;
}

.profile-submit-summary dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 0;
}

.profile-submit-summary dl div {
  min-width: 0;
}

.profile-submit-summary dt,
.profile-submit-summary dd {
  margin: 0;
}

.profile-submit-summary dt {
  color: var(--workspace-muted);
  font-size: 10px;
  font-weight: 750;
}

.profile-submit-summary dd {
  overflow-wrap: anywhere;
  color: var(--workspace-ink);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
}

.profile-submit-summary > p {
  margin: 0;
  color: #8a5a17;
  font-size: 11px;
}

.profile-form-footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #e7ebef;
}

.profile-form-footer > span {
  color: var(--workspace-muted);
  font-size: 11px;
}

.profile-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.profile-status-panel {
  position: sticky;
  top: 20px;
}

.profile-status-section > h3 {
  margin: 0 0 10px;
  color: var(--workspace-muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.profile-status-section + .profile-status-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e7ebef;
}

.profile-status-panel #studentProfileSummary .list-row {
  padding: 0;
  border: 0;
  background: transparent;
}

.profile-status-panel #studentProfileSummary .list-row::before {
  display: none;
}

.profile-status-panel #studentProfileSummary .mini-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px 12px;
  margin: 4px 0 10px;
  background: #e7ebef;
}

.profile-status-panel #studentProfileSummary .mini {
  min-height: 58px;
  padding: 10px 0;
  border: 0;
  border-radius: 0;
  background: var(--workspace-surface);
}

@media (max-width: 1100px) {
  .profile-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-status-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .profile-editor-head {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .profile-completion {
    width: 100%;
    margin-top: 4px;
  }

  .profile-section-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-section-nav button {
    min-height: 52px;
  }

  .profile-step-form .profile-step,
  .profile-field-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-major-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-major-selector-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .profile-step-actions {
    flex-wrap: wrap;
    align-items: stretch;
  }

  .profile-step-actions > span {
    flex: 0 0 100%;
  }

  .profile-step-actions button {
    flex: 1 1 140px;
  }

  .profile-submit-summary dl {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-form-footer {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .profile-form-footer > span {
    text-align: center;
  }

  .profile-form-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-form-actions button,
  .profile-form-footer > button {
    width: 100%;
  }
}
