:root {
  --ink: #132039;
  --text: #4c5d73;
  --muted: #78869a;
  --line: #e3e9f1;
  --surface: #f5f7fb;
  --brand: #405bd8;
  --brand-dark: #2f47b4;
  --brand-soft: #eef1ff;
  --success: #287565;
  --danger: #a33b4b;
  --white: #fff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #fbfcfe; color: var(--ink); font-family: Manrope, "Avenir Next", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; transform: translateY(-150%); border-radius: 7px; padding: 9px 12px; background: var(--ink); color: var(--white); font-size: 11px; font-weight: 700; }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid rgba(64,91,216,.35); outline-offset: 3px; }
.portal-container { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.portal-header { height: 74px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.95); }
.portal-nav { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.portal-brand img { display: block; width: 104px; height: auto; }
.portal-nav nav { display: flex; align-items: center; gap: 23px; color: var(--text); font-size: 12px; font-weight: 600; }
.portal-nav nav a:hover, .nav-button:hover { color: var(--brand); }
.inline-form { display: inline; margin: 0; }
.nav-button { border: 0; padding: 0; background: none; cursor: pointer; }
.nav-cta { border-radius: 9px; padding: 11px 14px; background: var(--brand); color: var(--white) !important; }

.flash { margin-top: 18px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--white); color: var(--text); font-size: 12px; }
.flash.success { border-color: #cce7df; background: #f1faf7; color: var(--success); }
.flash.error { border-color: #f0cdd3; background: #fff6f7; color: var(--danger); }

.auth-shell { min-height: calc(100vh - 150px); display: grid; place-items: center; padding: 62px 20px; background: radial-gradient(circle at 20% 10%, rgba(64,91,216,.07), transparent 30%); }
.auth-card { width: min(460px, 100%); border: 1px solid var(--line); border-radius: 18px; padding: 34px; background: var(--white); box-shadow: 0 24px 70px rgba(28,42,72,.09); }
.auth-card h1, .page-title h1 { margin: 0; font-size: 34px; line-height: 1.12; letter-spacing: -.05em; }
.auth-card > p, .page-title > div > p:last-child { margin: 12px 0 0; color: var(--text); font-size: 13px; line-height: 1.65; }
.role-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 25px 0; border-radius: 11px; padding: 5px; background: var(--surface); }
.role-switch a { border-radius: 8px; padding: 10px; color: var(--muted); font-size: 11px; font-weight: 700; text-align: center; }
.role-switch a.active { background: var(--white); color: var(--ink); box-shadow: 0 2px 8px rgba(25,38,64,.08); }
.form-stack { display: grid; gap: 17px; margin-top: 26px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 11px; font-weight: 700; }
.field-label-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.field-label-row a { color: var(--brand); font-size: 10px; font-weight: 700; }
.field small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfe; color: var(--ink); outline: 0; }
.field input, .field select { height: 45px; padding: 0 12px; }
.field textarea { min-height: 105px; padding: 12px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: #a8b5e8; background: var(--white); box-shadow: 0 0 0 3px rgba(64,91,216,.08); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.form-grid.three-column { grid-template-columns: repeat(3,1fr); }
.field.full { grid-column: 1 / -1; }
.optional { margin-left: 4px; color: var(--muted); font-size: 9px; font-weight: 500; }
.error-list { margin: 20px 0 0; border-radius: 9px; padding: 12px 14px 12px 30px; background: #fff4f6; color: var(--danger); font-size: 11px; line-height: 1.6; }
.primary-button, .secondary-button, .danger-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 9px; padding: 0 17px; font-size: 12px; font-weight: 700; cursor: pointer; }
.primary-button { background: var(--brand); color: var(--white); box-shadow: 0 8px 22px rgba(64,91,216,.15); }
.primary-button:hover { background: var(--brand-dark); }
.secondary-button { border-color: var(--line); background: var(--white); color: var(--ink); }
.danger-button { border-color: #efcbd1; background: #fff7f8; color: var(--danger); }
.button-row { display: flex; flex-wrap: wrap; gap: 9px; }
.download-note { margin: 13px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.auth-foot { margin-top: 22px; color: var(--muted); font-size: 11px; text-align: center; }
.auth-foot a { color: var(--brand); font-weight: 700; }
.remember-row { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 10px; cursor: pointer; }
.remember-row input { width: 15px; height: 15px; accent-color: var(--brand); }
.consent-row { display: flex; align-items: flex-start; gap: 9px; color: var(--text); font-size: 10px; line-height: 1.55; cursor: pointer; }
.consent-row input { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 1px; accent-color: var(--brand); }
.consent-row a { color: var(--brand); font-weight: 700; text-decoration: underline; }
.auth-message-card { text-align: center; }
.auth-message-card .form-stack { margin-top: 23px; }
.auth-message-card > p strong { color: var(--ink); }
.auth-symbol { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 22px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); font-size: 20px; font-weight: 800; }
.auth-secondary-form { margin-top: 13px; }
.text-action { border: 0; padding: 4px; background: transparent; color: var(--brand); font-size: 10px; font-weight: 700; cursor: pointer; }
.auth-help { margin-top: 24px !important; color: var(--muted) !important; font-size: 10px !important; }

.page-shell { min-height: calc(100vh - 150px); padding: 58px 0 90px; }
.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 34px; }
.eyebrow { margin: 0 0 12px; color: var(--brand); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.panel { border: 1px solid var(--line); border-radius: 15px; padding: 25px; background: var(--white); box-shadow: 0 16px 45px rgba(28,42,72,.055); }
.panel h2 { margin: 0 0 7px; font-size: 17px; letter-spacing: -.03em; }
.panel > p { margin: 0; color: var(--text); font-size: 12px; line-height: 1.6; }
.dashboard-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 22px; }
.uid-card { padding: 28px; background: var(--ink); color: var(--white); }
.uid-card .eyebrow { color: #b8c4ff; }
.uid-value { margin: 12px 0 8px; font-size: 24px; font-weight: 800; letter-spacing: .04em; }
.uid-card p { color: #bdc6d5; }
.share-url { display: block; overflow: hidden; margin: 22px 0 18px; border-radius: 8px; padding: 11px 13px; background: rgba(255,255,255,.08); color: #dfe4ec; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.status-badge { display: inline-flex; align-items: center; border-radius: 99px; padding: 5px 8px; background: var(--brand-soft); color: var(--brand); font-size: 9px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.status-badge.public, .status-badge.approved { background: #eaf7f2; color: var(--success); }
.status-badge.pin_locked, .status-badge.pending { background: #fff5df; color: #8b6420; }
.status-badge.private { background: #eef1f5; color: #586579; }
.status-badge.denied { background: #fff1f3; color: var(--danger); }
.stat-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 13px; margin-top: 22px; }
.stat { border-radius: 10px; padding: 15px; background: var(--surface); }
.stat span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.stat strong { display: block; margin-top: 7px; font-size: 18px; }
.stat strong.stat-date { font-size: 14px; }
.dashboard-section { margin-top: 22px; }
.activity-window { flex: 0 0 auto; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.visit-list { display: grid; }
.visit-item { display: flex; align-items: center; justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); padding: 15px 0; }
.visit-item:first-child { border-top: 0; padding-top: 2px; }
.visit-item:last-child { padding-bottom: 0; }
.visit-identity { min-width: 0; display: flex; align-items: center; gap: 11px; }
.visit-mark { width: 33px; height: 33px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--muted); font-size: 10px; font-weight: 800; }
.visit-mark.identified { background: var(--brand-soft); color: var(--brand); }
.visit-identity h3 { overflow: hidden; margin: 0 0 3px; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.visit-identity p { margin: 0; color: var(--muted); font-size: 9px; }
.visit-meta { flex: 0 0 auto; display: flex; align-items: center; gap: 13px; }
.visit-meta time { min-width: 126px; color: var(--muted); font-size: 9px; text-align: right; }
.access-method { display: inline-flex; border-radius: 99px; padding: 5px 8px; background: var(--surface); color: var(--text); font-size: 8px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.access-method.approved { background: #eaf7f2; color: var(--success); }
.access-method.pin { background: #fff5df; color: #8b6420; }
.access-method.public { background: var(--brand-soft); color: var(--brand); }
.request-list { display: grid; gap: 12px; margin-top: 19px; }
.request-item { display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); padding-top: 15px; }
.request-item h3 { margin: 0 0 4px; font-size: 12px; }
.request-item p { margin: 0; color: var(--muted); font-size: 10px; }
.request-actions { display: flex; gap: 7px; }
.admin-stat-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 10px; }
.admin-list { display: grid; }
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); padding: 15px 0; }
.admin-row:first-child { border-top: 0; padding-top: 2px; }
.admin-row h3 { margin: 0 0 4px; font-size: 12px; }
.admin-row p { margin: 0; color: var(--muted); font-size: 9px; }
.admin-row small { display: block; max-width: 720px; margin-top: 7px; color: var(--text); font-size: 10px; line-height: 1.5; }

.onboarding-layout { display: grid; grid-template-columns: 220px 1fr; gap: 30px; align-items: start; }
.onboarding-steps { position: sticky; top: 25px; display: grid; gap: 10px; }
.onboarding-steps span { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 11px; }
.onboarding-steps b { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 9px; }
.form-section + .form-section { margin-top: 22px; }
.form-section h2 { margin-bottom: 18px; }
.section-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-title-row h2 { margin-bottom: 5px; }
.section-title-row p { margin: 0; color: var(--muted); font-size: 10px; }
.add-entry-button { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; border: 1px solid #cfd8e6; border-radius: 8px; padding: 8px 11px; background: var(--white); color: var(--brand); font-size: 10px; font-weight: 700; cursor: pointer; }
.add-entry-button span { font-size: 16px; line-height: 1; }
.add-entry-button:hover { border-color: var(--brand); background: var(--brand-soft); }
.repeater-list { display: grid; gap: 14px; }
.repeater-empty { border: 1px dashed #ccd5e3; border-radius: 10px; padding: 22px; color: var(--muted); font-size: 10px; text-align: center; }
.repeater-card { border: 1px solid var(--line); border-radius: 11px; padding: 18px; background: #fbfcfe; }
.repeater-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.repeater-card-head strong { font-size: 11px; }
.repeater-card-head button { border: 0; padding: 3px; background: transparent; color: var(--danger); font-size: 9px; font-weight: 700; cursor: pointer; }
.pin-field { margin-top: 16px; }
.form-submit-row { margin-top: 22px; }

.skills-picker { position: relative; min-height: 45px; border: 1px solid var(--line); border-radius: 9px; padding: 6px; background: #fbfcfe; }
.skills-picker:focus-within { border-color: #a8b5e8; background: var(--white); box-shadow: 0 0 0 3px rgba(64,91,216,.08); }
.skills-picker > input[type="text"] { height: 32px; border: 0; padding: 0 7px; background: transparent; box-shadow: none; }
.skill-entry-row { display: grid; grid-template-columns: 1fr; gap: 7px; margin-top: 5px; }
.skill-entry-row input { height: 36px; border: 0; padding: 0 7px; background: transparent; outline: 0; }
.skill-entry-row > button { border: 0; border-radius: 7px; padding: 0 13px; background: var(--brand-soft); color: var(--brand); font-size: 10px; font-weight: 700; cursor: pointer; }
.selected-skills { display: flex; flex-wrap: wrap; gap: 6px; }
.selected-skills:empty { display: none; }
.selected-skills span { display: inline-flex; align-items: center; gap: 5px; border-radius: 99px; padding: 5px 6px 5px 9px; background: var(--brand-soft); color: var(--brand-dark); font-size: 9px; font-weight: 700; }
.selected-skills button { width: 17px; height: 17px; display: grid; place-items: center; border: 0; border-radius: 50%; padding: 0; background: rgba(64,91,216,.1); color: var(--brand-dark); cursor: pointer; }
.skill-suggestions { position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; right: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; padding: 5px; background: var(--white); box-shadow: 0 14px 35px rgba(28,42,72,.12); }
.skill-suggestions button { width: 100%; display: flex; justify-content: space-between; border: 0; border-radius: 6px; padding: 9px 10px; background: transparent; color: var(--text); font-size: 10px; text-align: left; cursor: pointer; }
.skill-suggestions button:hover, .skill-suggestions button:focus { background: var(--brand-soft); color: var(--brand); }
.skill-suggestions small { color: var(--muted); }
.visibility-options { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.visibility-option { position: relative; display: block; border: 1px solid var(--line); border-radius: 11px; padding: 16px; cursor: pointer; }
.visibility-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.visibility-option input { position: absolute; opacity: 0; }
.visibility-option strong { display: block; font-size: 12px; }
.visibility-option span { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.5; }

.employer-hero { padding: 90px 0; background: var(--ink); color: var(--white); }
.employer-hero-inner { display: grid; grid-template-columns: 1fr .75fr; align-items: center; gap: 80px; }
.employer-hero h1 { max-width: 650px; margin: 0; font-size: clamp(44px,6vw,68px); line-height: 1.05; letter-spacing: -.06em; }
.employer-hero p { max-width: 610px; margin: 23px 0 28px; color: #b9c3d4; font-size: 15px; line-height: 1.75; }
.employer-note { border: 1px solid rgba(255,255,255,.13); border-radius: 15px; padding: 25px; background: rgba(255,255,255,.06); }
.employer-note strong { display: block; margin-bottom: 9px; font-size: 14px; }
.employer-note span { color: #b9c3d4; font-size: 11px; line-height: 1.65; }
.search-bar { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin: 25px 0 30px; }
.search-bar input { min-width: 0; height: 47px; border: 1px solid var(--line); border-radius: 9px; padding: 0 14px; outline: 0; }
.search-panel { display: grid; grid-template-columns: 1.35fr 1fr 1fr .75fr auto; align-items: end; gap: 12px; margin: 25px 0 16px; border: 1px solid var(--line); border-radius: 13px; padding: 18px; background: var(--white); }
.search-panel .field { min-width: 0; }
.search-panel input { min-width: 0; }
.clear-search { grid-column: 1 / -1; color: var(--brand); font-size: 10px; font-weight: 700; }
.results-summary { display: flex; justify-content: space-between; gap: 15px; margin: 0 2px 16px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.profile-results { display: grid; gap: 13px; }
.profile-result { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; border: 1px solid var(--line); border-radius: 13px; padding: 21px; background: var(--white); }
.profile-result h2 { margin: 0 0 5px; font-size: 17px; }
.profile-result p { margin: 0; color: var(--text); font-size: 11px; line-height: 1.55; }
.profile-result .result-summary { max-width: 720px; margin-top: 10px; color: var(--text); }
.profile-result .skills { margin-top: 11px; color: var(--muted); }
.result-actions { display: flex; align-items: center; gap: 9px; }
.result-heading { align-items: center; }
.access-request-form { width: 220px; display: grid; gap: 8px; }
.access-request-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; background: #fbfcfe; color: var(--ink); font-size: 10px; resize: vertical; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 24px; color: var(--muted); font-size: 10px; }
.pagination a { color: var(--brand); font-weight: 700; }
.pagination strong { color: var(--text); font-size: 9px; }
.empty-state { border: 1px dashed #ccd5e3; border-radius: 13px; padding: 40px; color: var(--muted); text-align: center; font-size: 12px; }
.empty-state.compact { margin-top: 12px; padding: 24px; }

.portal-footer { border-top: 1px solid var(--line); padding: 31px 0; background: var(--white); }
.portal-footer-inner { display: flex; align-items: center; gap: 18px; color: var(--muted); font-size: 10px; }
.portal-footer img { width: 92px; height: auto; }
.portal-footer span:last-child { margin-left: auto; }
.legal-links { display: flex; gap: 13px; margin-left: auto; }
.legal-links a:hover { color: var(--brand); }
.legal-shell { min-height: calc(100vh - 150px); padding: 60px 20px 90px; }
.legal-document { width: min(760px, 100%); margin: 0 auto; }
.legal-document h1 { margin: 0; font-size: 40px; letter-spacing: -.05em; }
.legal-document h2 { margin: 34px 0 8px; font-size: 16px; letter-spacing: -.02em; }
.legal-document p { margin: 10px 0 0; color: var(--text); font-size: 12px; line-height: 1.75; }
.legal-document a { color: var(--brand); text-decoration: underline; }
.legal-document .legal-meta { color: var(--muted); font-size: 10px; }
.legal-document .legal-note { margin-top: 36px; border-left: 3px solid var(--brand); padding: 12px 15px; background: var(--brand-soft); color: var(--ink); }
.account-container { max-width: 760px; }
.account-action { margin-top: 18px; }
.danger-panel { border-color: #efcbd1; }

@media (max-width: 760px) {
  .portal-nav nav > a:not(.nav-cta) { display: none; }
  .dashboard-grid, .onboarding-layout, .employer-hero-inner { grid-template-columns: 1fr; }
  .admin-stat-grid { grid-template-columns: repeat(3,1fr); }
  .onboarding-steps { position: static; grid-template-columns: repeat(5,1fr); }
  .onboarding-steps span { flex-direction: column; align-items: flex-start; gap: 5px; }
  .page-title { align-items: flex-start; flex-direction: column; }
  .profile-result { grid-template-columns: 1fr; }
  .search-panel { grid-template-columns: 1fr 1fr; }
  .search-panel .search-keyword { grid-column: 1 / -1; }
  .visit-item { align-items: flex-start; flex-direction: column; gap: 11px; }
  .visit-meta { width: 100%; justify-content: space-between; }
  .visit-meta time { min-width: 0; }
}

@media (max-width: 520px) {
  .portal-container { width: calc(100% - 28px); }
  .portal-header { height: 66px; }
  .portal-brand img { width: 92px; }
  .auth-card, .panel { padding: 22px; }
  .form-grid, .form-grid.three-column, .visibility-options { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .onboarding-steps { grid-template-columns: 1fr 1fr; }
  .section-title-row { align-items: stretch; flex-direction: column; }
  .add-entry-button { align-self: flex-start; }
  .search-bar { grid-template-columns: 1fr; }
  .search-panel { grid-template-columns: 1fr; }
  .search-panel .search-keyword { grid-column: auto; }
  .result-actions, .request-item { align-items: flex-start; flex-direction: column; }
  .admin-stat-grid { grid-template-columns: repeat(2,1fr); }
  .admin-row { align-items: flex-start; flex-direction: column; }
  .portal-footer-inner { align-items: flex-start; flex-direction: column; }
  .portal-footer span:last-child, .legal-links { margin-left: 0; }
}
