.invite-name-grid {
  margin-bottom: 0;
}

.success-note {
  margin-top: 14px;
  color: var(--success);
  font-weight: 700;
}

.freelancer-onboarding-enhanced .panel-header {
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.portal-auth.is-profile-setup-screen {
  align-items: start;
  padding: 34px 18px 56px;
  place-items: start center;
}

.auth-card.is-profile-setup-card {
  width: min(100%, 920px);
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.auth-card.is-profile-setup-card > .auth-logo,
.auth-card.is-profile-setup-card > .section-label,
.auth-card.is-profile-setup-card > h1,
.auth-card.is-profile-setup-card > p:not(.error-note) {
  display: none;
}

.auth-card.is-profile-setup-card > .portal-profile-shell {
  order: 1;
}

.portal-profile-shell {
  margin: 0 auto;
  border-color: rgba(120, 191, 255, 0.28);
  border-radius: 12px;
  background: var(--surface);
  overflow: visible;
  box-shadow: 0 24px 70px rgba(6, 26, 51, 0.12);
}

.portal-profile-shell .panel-header {
  min-height: auto;
  padding: 28px 32px;
  border-bottom: 0;
  background:
    radial-gradient(circle at 94% 0%, rgba(120, 191, 255, 0.22), transparent 32%),
    linear-gradient(135deg, #061a33, #0b4db8);
  color: var(--jsa-white);
}

.portal-profile-shell .panel-header .section-label {
  color: rgba(216, 231, 247, 0.92);
}

.portal-profile-shell .panel-title {
  margin-top: 8px;
  color: var(--jsa-white);
  font-size: clamp(1.8rem, 4vw, 2.55rem);
  line-height: 1;
}

.setup-intro {
  max-width: 560px;
  margin: 12px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.95rem;
  line-height: 1.6;
}

.freelancer-onboarding-enhanced .form-body {
  gap: 28px;
  padding: 30px 32px 32px;
}

.freelancer-onboarding-enhanced .form-section {
  gap: 18px;
  padding-bottom: 26px;
}

.freelancer-onboarding-enhanced .form-section:nth-of-type(1) .section-label,
.freelancer-onboarding-enhanced .form-section:nth-of-type(3) .section-label {
  font-size: 0.78rem;
}

.freelancer-onboarding-enhanced .profile-uploader {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.freelancer-onboarding-enhanced .profile-preview {
  width: 88px;
  height: 88px;
  flex-basis: 88px;
  font-size: 1.55rem;
}

.freelancer-onboarding-enhanced .profile-upload-actions {
  display: flex;
  align-items: center;
  gap: 10px 12px;
}

.label-text,
.field-group label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.info-tooltip {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--jsa-signal-blue);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.info-tooltip::after {
  position: absolute;
  left: -12px;
  bottom: calc(100% + 10px);
  z-index: 30;
  width: min(320px, calc(100vw - 48px));
  padding: 10px 12px;
  border: 1px solid rgba(120, 191, 255, 0.36);
  border-radius: 8px;
  background: var(--jsa-navy);
  color: var(--jsa-white);
  box-shadow: 0 18px 46px rgba(2, 6, 17, 0.22);
  content: attr(data-tooltip);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
  white-space: pre-line;
}

.info-tooltip:hover::after,
.info-tooltip:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.info-tooltip:focus-visible {
  border-color: var(--jsa-signal-blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(120, 191, 255, 0.3);
}

.project-actions .inline-info::after {
  right: 0;
  left: auto;
  width: min(300px, calc(100vw - 48px));
  transform: translateY(4px);
}

.project-actions .inline-info:hover::after,
.project-actions .inline-info:focus-visible::after {
  transform: translateY(0);
}

.availability-field {
  width: fit-content;
  max-width: 100%;
  grid-template-columns: repeat(3, 108px);
  gap: 4px;
  align-items: stretch;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
}

.availability-choice span {
  width: 100%;
  min-height: 40px;
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
  color: #4f5f73;
  line-height: 1;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.availability-choice:hover span {
  background: rgba(255, 255, 255, 0.74);
}

.availability-choice input:checked + span {
  border-color: var(--border-strong);
  background: var(--surface);
  box-shadow: 0 7px 18px rgba(6, 26, 51, 0.08);
}

.availability-choice[data-availability="green"] input:checked + span {
  border-color: rgba(19, 121, 91, 0.36);
  background: #e8f8ef;
  color: #08704f;
}

.availability-choice[data-availability="yellow"] input:checked + span {
  border-color: rgba(154, 103, 0, 0.32);
  background: #fff7df;
  color: #7a5200;
}

.availability-choice[data-availability="red"] input:checked + span {
  border-color: rgba(180, 35, 24, 0.3);
  background: #fff1f0;
  color: #9f1f15;
}

.freelancer-onboarding-enhanced .textarea.large {
  min-height: 178px;
}

.expertise-section {
  gap: 0;
  margin-top: 0;
  padding: 0;
  border: 1px solid rgba(120, 191, 255, 0.26);
  border-radius: 12px;
  overflow: visible;
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(6, 26, 51, 0.06);
}

.expertise-intro,
.expertise-section > div:first-child {
  display: grid;
  gap: 7px;
  max-width: none;
  padding: 24px 26px 20px;
  border-bottom: 1px solid var(--border);
  border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, rgba(237, 246, 255, 0.9), rgba(255, 255, 255, 0.96));
}

.expertise-section > div:first-child .section-label {
  margin: 0;
  color: var(--jsa-navy);
  font-family: var(--font-display);
  font-size: 1.38rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: none;
}

.freelancer-onboarding-enhanced .expertise-section > .expertise-intro .section-label {
  color: var(--jsa-navy);
  font-family: var(--font-display);
  font-size: 1.38rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: none;
}

.expertise-section > div:first-child .field-note {
  max-width: 700px;
  color: #4f5f73;
  font-size: 0.92rem;
  line-height: 1.55;
}

.expertise-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
  padding: 22px 24px 24px;
}

.expertise-panel {
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-color: var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(6, 26, 51, 0.045);
}

.expertise-panel-header {
  align-items: center;
  padding: 18px 20px 15px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.expertise-panel-header .section-label {
  margin: 0;
  color: #526275;
  font-family: var(--font-accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  line-height: 1;
  text-transform: uppercase;
}

.expertise-panel h3 {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-top: 10px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-blue);
  color: var(--jsa-signal-blue);
  font-size: 0.78rem;
}

.freelancer-onboarding-enhanced [data-selected-count],
.freelancer-onboarding-enhanced [data-selected-summary] {
  display: none !important;
}

.expertise-panel .input-wrap {
  margin: 16px 20px 0;
}

.selected-expertise {
  display: flex;
  align-items: center;
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  margin: 12px 20px 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.selected-expertise .chip-list {
  flex-wrap: nowrap;
  align-items: center;
  min-width: max-content;
}

.selected-expertise .chip {
  flex: 0 0 auto;
}

.selected-expertise .compact-note {
  white-space: nowrap;
}

.expertise-browser {
  gap: 8px;
  align-content: start;
  min-height: 380px;
  max-height: 560px;
  margin-top: 14px;
  padding: 0 14px 18px 20px;
  scrollbar-gutter: stable;
}

.expertise-category {
  gap: 8px;
}

.expertise-category > p {
  margin: 18px 0 2px;
  padding: 0 2px;
  color: #39506a;
  font-family: var(--font-accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.045em;
  line-height: 1.2;
  text-transform: uppercase;
}

.expertise-category:first-child > p {
  margin-top: 4px;
}

.expertise-group {
  position: relative;
  border-color: var(--border);
  border-radius: 10px;
  background: var(--surface);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease;
}

.expertise-group[open] {
  border-color: rgba(11, 77, 184, 0.28);
  box-shadow: 0 10px 22px rgba(6, 26, 51, 0.05);
}

.expertise-group summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 14px;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 12px 14px;
  line-height: 1.25;
  list-style: none;
  transition: background-color 0.16s ease;
}

.expertise-group summary::-webkit-details-marker {
  display: none;
}

.expertise-group summary::after {
  content: "";
  width: 8px;
  height: 8px;
  justify-self: center;
  border-right: 2px solid #526275;
  border-bottom: 2px solid #526275;
  transform: rotate(45deg);
  transition: transform 0.16s ease;
}

.expertise-group[open] summary::after {
  transform: rotate(225deg);
}

.expertise-group summary:hover {
  background: #f8fbff;
}

.expertise-group summary:focus-visible {
  outline: 3px solid rgba(120, 191, 255, 0.58);
  outline-offset: -3px;
}

.expertise-group summary span {
  min-width: 0;
  color: var(--jsa-navy);
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.expertise-group summary small {
  flex: 0 0 auto;
  align-self: center;
  min-width: max-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #f2f7fd;
  color: #526275;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
}

.expertise-group summary small.has-selection {
  border: 1px solid rgba(11, 77, 184, 0.18);
  background: #eaf3ff;
  color: var(--jsa-signal-blue);
}

.expertise-options {
  gap: 5px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(120, 191, 255, 0.18);
  background: #fbfdff;
}

.expertise-option {
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  min-height: 42px;
  padding: 10px;
  cursor: pointer;
  transition:
    background-color 0.16s ease,
    box-shadow 0.16s ease;
}

.expertise-option input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--jsa-signal-blue);
}

.expertise-option:hover,
.expertise-option:has(input:checked) {
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(11, 77, 184, 0.18);
}

.expertise-option strong {
  color: var(--jsa-navy);
  font-size: 0.88rem;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.expertise-option small {
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.expertise-option.is-parent {
  margin: 10px 12px 8px;
  border-color: rgba(11, 77, 184, 0.16);
  background: #f8fbff;
}

.expertise-top-group summary {
  min-height: 60px;
}

.expertise-top-group summary span {
  font-size: 1rem;
}

.expertise-top-group .expertise-options {
  padding: 12px;
}

.expertise-subservice-options .expertise-option {
  min-height: 46px;
}

.expertise-panel[data-expertise-panel="tools"] .expertise-browser {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.expertise-panel[data-expertise-panel="tools"] .expertise-group {
  overflow: visible;
}

.expertise-panel[data-expertise-panel="tools"] .expertise-group summary {
  grid-template-columns: minmax(0, 1fr) minmax(56px, auto) 14px;
  min-height: 54px;
  padding: 12px 14px;
}

.expertise-panel[data-expertise-panel="tools"] .expertise-group summary span {
  display: block;
  line-height: 1.22;
  white-space: normal;
}

.expertise-panel[data-expertise-panel="tools"] .expertise-group summary small {
  justify-self: end;
  min-width: 54px;
  text-align: center;
}

.expertise-panel[data-expertise-panel="tools"] .expertise-options {
  max-height: 300px;
  overflow: auto;
}

.freelancer-form-admin .expertise-section {
  border-radius: 10px;
  box-shadow: 0 14px 34px rgba(6, 26, 51, 0.045);
}

.freelancer-form-admin .expertise-intro,
.freelancer-form-admin .expertise-section > div:first-child {
  padding: 18px 18px 16px;
}

.freelancer-form-admin .expertise-section > div:first-child .section-label,
.freelancer-form-admin.freelancer-onboarding-enhanced .expertise-section > .expertise-intro .section-label {
  font-size: 1.18rem;
}

.freelancer-form-admin .expertise-section > div:first-child .field-note {
  font-size: 0.82rem;
  line-height: 1.5;
}

.freelancer-form-admin .expertise-layout {
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 16px;
}

.freelancer-form-admin .expertise-panel {
  border-radius: 10px;
  box-shadow: none;
}

.freelancer-form-admin .expertise-panel-header {
  padding: 15px 16px 12px;
}

.freelancer-form-admin .expertise-panel h3 {
  min-height: 26px;
  margin-top: 8px;
  font-size: 0.74rem;
}

.freelancer-form-admin .expertise-panel .input-wrap {
  margin: 14px 16px 0;
}

.freelancer-form-admin .expertise-browser {
  min-height: 0;
  max-height: 370px;
  margin-top: 12px;
  padding: 0 12px 14px 16px;
}

.freelancer-form-admin .expertise-category > p {
  margin-top: 12px;
  font-size: 0.68rem;
}

.freelancer-form-admin .expertise-group summary {
  grid-template-columns: minmax(0, 1fr) auto 12px;
  gap: 10px;
  min-height: 52px;
  padding: 12px;
}

.freelancer-form-admin .expertise-group summary span {
  font-size: 0.92rem;
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: normal;
}

.freelancer-form-admin .expertise-group summary small {
  min-width: 0;
  max-width: 92px;
  white-space: nowrap;
}

.freelancer-form-admin .expertise-option {
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 9px;
  min-height: 40px;
  padding: 9px;
}

.freelancer-form-admin .expertise-option strong {
  font-size: 0.84rem;
  overflow-wrap: break-word;
  word-break: normal;
}

.freelancer-form-admin .expertise-option small {
  font-size: 0.72rem;
  overflow-wrap: break-word;
  word-break: normal;
}

.freelancer-form-admin .expertise-panel[data-expertise-panel="tools"] .expertise-group summary {
  grid-template-columns: minmax(0, 1fr) auto 12px;
}

.freelancer-form-admin .expertise-panel[data-expertise-panel="tools"] .expertise-group summary small {
  min-width: 0;
}

@media (max-width: 760px) {
  .portal-auth.is-profile-setup-screen {
    padding: 16px 10px 36px;
  }

  .portal-profile-shell .panel-header {
    padding: 24px 22px;
  }

  .freelancer-onboarding-enhanced .form-body {
    padding: 22px;
  }

  .freelancer-onboarding-enhanced .profile-uploader {
    grid-template-columns: 1fr;
  }

  .availability-field {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .expertise-intro,
  .expertise-section > div:first-child {
    padding: 20px;
  }

  .expertise-section > div:first-child .section-label {
    font-size: 1.22rem;
  }

  .freelancer-onboarding-enhanced .expertise-section > .expertise-intro .section-label {
    font-size: 1.22rem;
  }

  .expertise-layout {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px;
  }

  .expertise-panel .input-wrap,
  .selected-expertise {
    margin-left: 14px;
    margin-right: 14px;
  }

  .expertise-panel-header {
    padding-left: 14px;
    padding-right: 14px;
  }

  .expertise-browser {
    min-height: 320px;
    max-height: 360px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .expertise-group summary {
    grid-template-columns: minmax(0, 1fr) auto 12px;
    gap: 10px;
  }
}
