/* LINK B2B — unified user passport Modal S (approved mockups, local tokens only). */
.link-user-passport-screen{
  position:fixed;inset:0;z-index:1400;display:grid;place-items:center;padding:16px;
  padding-bottom:calc(16px + var(--link-local-tools-height,0px));
  background:var(--sg-backdrop);font-family:var(--link-font-family);color:var(--sg-ink);
}
.link-user-passport-modal{
  width:min(480px,calc(100vw - 24px));max-height:min(520px,calc(100dvh - 24px - var(--link-local-tools-height,0px)));
  display:flex;flex-direction:column;min-height:0;overflow:hidden;
  background:var(--sg-surface);border:1px solid var(--sg-line);border-radius:16px;
  box-shadow:0 22px 58px rgba(var(--sg-rgb-ink),.24);
}
.link-user-passport-head{
  display:flex;align-items:center;justify-content:space-between;gap:10px;flex:0 0 auto;
  min-height:56px;padding:0 16px;border-bottom:1px solid var(--sg-line);background:var(--sg-surface);
}
.link-user-passport-head-title{display:flex;align-items:center;gap:12px;min-width:0}
.link-user-passport-brand{display:inline-flex;align-items:baseline;gap:3px;flex:0 0 auto;color:var(--sg-ink);font-size:20px;font-weight:700;letter-spacing:-.055em;line-height:1}
.link-user-passport-brand span{font-size:11px;font-weight:700;letter-spacing:.015em;color:var(--sg-gold-text)}
.link-user-passport-head-divider{width:1px;height:22px;background:var(--sg-line-strong);flex:0 0 auto}
.link-user-passport-head h2{margin:0;font-size:18px;line-height:1.25;font-weight:600;letter-spacing:-.025em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--sg-ink)}
.link-user-passport-head-actions{display:flex;align-items:center;gap:7px;flex:0 0 auto}
.link-user-passport-head-actions .button{min-height:32px;height:32px;padding:5px 10px;border-radius:7px;font-size:11px;white-space:nowrap}
.link-user-passport-head .button-primary{background:var(--sg-ink-2)!important;background-image:none!important;border-color:var(--sg-ink-2)!important;color:var(--sg-surface)!important}
.link-user-passport-head .button-primary:hover:not(:disabled){background:var(--sg-ink)!important;border-color:var(--sg-ink)!important}
.link-user-passport-icon-link{
  width:32px;height:32px;display:grid;place-items:center;padding:0;border:1px solid var(--sg-line);
  border-radius:8px;background:var(--sg-gold-soft);color:var(--sg-gold-text);
}
.link-user-passport-icon-link:hover{background:var(--sg-gold-quick-hover);border-color:var(--sg-gold-border);color:var(--sg-gold-strong)}
.link-user-passport-tabs{display:flex;flex:0 0 auto;min-height:45px;padding:0 8px;border-bottom:1px solid var(--sg-line);background:var(--sg-surface)}
.link-user-passport-tab{
  position:relative;display:flex;align-items:center;justify-content:center;gap:7px;flex:1 1 0;min-width:0;
  border:0;background:transparent;padding:8px 6px 7px;color:var(--sg-muted);font:inherit;font-size:10.5px;font-weight:600;
  line-height:1.2;letter-spacing:-.012em;text-align:center;
}
.link-user-passport-tab:hover{color:var(--sg-ink-2);background:transparent}
.link-user-passport-tab.active{color:var(--sg-ink);font-weight:700}
.link-user-passport-tab.active:after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:3px;background:var(--sg-gold-strong);border-radius:2px 2px 0 0}
.link-user-passport-tab-icon{display:grid;place-items:center;width:18px;height:18px;flex:0 0 18px;color:var(--sg-gold-text)}
.link-user-passport-tab.active .link-user-passport-tab-icon{color:var(--sg-gold-text)}
.link-user-passport-tab-label{min-width:0;white-space:nowrap;overflow:visible;text-overflow:clip}
.link-user-passport-body{
  flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;
  padding:12px 16px 14px;scrollbar-width:thin;scrollbar-color:var(--sg-line-strong) transparent;
}
.link-user-passport-panel{min-width:0;outline:none}
.link-user-passport-panel:focus-visible{outline:2px solid var(--sg-gold);outline-offset:-2px;border-radius:6px}
.link-user-passport-modal:focus{outline:none}
.link-user-passport-general{padding:0}
.link-user-passport-hero{display:flex;align-items:center;gap:14px;min-width:0;margin:0 2px 12px}
.link-user-passport-avatar-large{
  width:72px;height:72px;flex:0 0 72px;border-radius:50%;overflow:hidden;display:grid;place-items:center;
  background:var(--sg-gold-soft);border:1px solid var(--sg-line);color:var(--sg-gold-text);
}
.link-user-passport-avatar-large img{display:block;width:100%;height:100%;object-fit:cover}
.link-user-passport-avatar-fallback{display:grid;place-items:center;width:100%;height:100%;color:var(--sg-gold-text)}
.link-user-passport-identity{display:flex;flex-direction:column;justify-content:center;gap:7px;min-width:0}
.link-user-passport-identity h3{margin:0;font-size:20px;line-height:1.22;font-weight:700;letter-spacing:-.025em;color:var(--sg-ink);overflow-wrap:anywhere}
.link-user-passport-pills{display:flex;align-items:center;flex-wrap:wrap;gap:6px;min-width:0}
.link-user-passport-pill{
  display:inline-flex;align-items:center;min-height:22px;max-width:100%;padding:3px 8px;border-radius:5px;
  background:var(--sg-gold-soft);color:var(--sg-gold-text);font-size:11px;font-weight:600;line-height:1.2;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.link-user-passport-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;align-items:stretch}
.link-user-passport-card{
  display:flex;align-items:center;gap:8px;min-width:0;min-height:58px;padding:9px 9px;
  border:1px solid var(--sg-line);border-radius:9px;background:var(--sg-gold-panel);color:var(--sg-ink-2);
}
.link-user-passport-card.is-wide{grid-column:1/-1}
.link-user-passport-card-icon{display:grid;place-items:center;width:22px;height:22px;flex:0 0 22px;color:var(--sg-gold-text);align-self:center}
.link-user-passport-card-content{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1 1 auto}
.link-user-passport-card-label{font-size:9.5px;line-height:1.25;font-weight:500;color:var(--sg-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.link-user-passport-card-value{display:flex;align-items:center;flex-wrap:wrap;gap:2px;min-height:17px;font-size:13px;line-height:1.35;font-weight:600;color:var(--sg-ink-2);overflow-wrap:anywhere}
.link-user-passport-card-value a{color:var(--sg-gold-text);font-weight:600;text-decoration:none;overflow-wrap:anywhere}
.link-user-passport-card-value a:hover{text-decoration:underline}
.link-user-passport-card-actions{display:flex;align-items:center;gap:1px;flex:0 0 auto;align-self:center;color:var(--sg-muted)}
.link-user-passport-card-copies{display:flex;flex-direction:column;align-items:center;gap:1px}
.link-user-passport-copy{
  width:22px;height:22px;min-width:22px;display:inline-grid;place-items:center;padding:0;border:0;border-radius:5px;
  background:transparent;color:var(--sg-muted);cursor:pointer;
}
.link-user-passport-copy:hover{background:var(--sg-gold-quick);color:var(--sg-gold-text)}
.link-user-passport-external{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:5px;color:var(--sg-gold-text);text-decoration:none}
.link-user-passport-external:hover{background:var(--sg-gold-quick)}
.link-user-passport-eye{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;margin-left:1px;color:var(--sg-muted);flex:0 0 auto;vertical-align:middle;align-self:center}
.link-user-passport-hint{font-size:9.5px;line-height:1.45;color:var(--sg-muted);margin:9px 2px 0}
.link-user-passport-muted{color:var(--sg-muted);font-weight:400}
.link-user-passport-footer{
  flex:0 0 auto;display:flex;align-items:center;gap:9px;padding:8px 16px 9px;
  border-top:1px solid var(--sg-line);background:var(--sg-surface);
}
.link-user-passport-footer .button{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;flex:1 1 0;min-width:0;
  min-height:38px;height:38px;padding:6px 9px;border-radius:9px;font-size:12px;font-weight:600;line-height:1.15;
  white-space:normal;text-align:center;
}
.link-user-passport-footer .button-outline{background:var(--sg-surface);border-color:var(--sg-line);color:var(--sg-ink-2)}
.link-user-passport-footer .button-outline:hover:not(:disabled){background:var(--sg-gold-panel);border-color:var(--sg-line-strong)}
.link-user-passport-footer .button-primary{
  background:var(--sg-gold-quick-hover)!important;background-image:none!important;border-color:var(--sg-gold-border)!important;
  color:var(--sg-gold-text)!important;box-shadow:none!important;
}
.link-user-passport-footer .button-primary:hover:not(:disabled){background:var(--sg-gold-quick-hover)!important;border-color:var(--sg-gold-strong)!important}
.link-user-passport-footer .button-primary>svg,.link-user-passport-footer .button-outline>svg{width:17px;height:17px;flex:0 0 17px}
.link-user-passport-companies{display:flex;flex-direction:column;gap:8px}
.link-user-passport-company{border:1px solid var(--sg-line);border-radius:10px;overflow:hidden;background:var(--sg-surface)}
.link-user-passport-company-toggle{
  display:flex;align-items:center;gap:9px;width:100%;min-height:46px;padding:7px 10px;
  border:0;background:var(--sg-gold-soft);color:var(--sg-ink);text-align:left;font:inherit;
}
.link-user-passport-company-toggle:hover{background:var(--sg-gold-quick)}
.link-user-passport-company-icon{display:grid;place-items:center;width:25px;height:25px;flex:0 0 25px;color:var(--sg-gold-text)}
.link-user-passport-company-main{display:flex;align-items:center;gap:7px;flex:1;min-width:0;flex-wrap:wrap}
.link-user-passport-company-main strong{font-size:14px;font-weight:700;line-height:1.25;color:var(--sg-ink);overflow-wrap:anywhere}
.link-user-passport-company-id{
  display:inline-flex;align-items:center;min-height:20px;max-width:100%;padding:3px 7px;border-radius:5px;
  background:var(--sg-gold-soft);color:var(--sg-gold-text);font-size:10.5px;font-weight:600;line-height:1.2;white-space:nowrap;
}
.link-user-passport-company-chevron{display:grid;place-items:center;width:22px;height:22px;flex:0 0 22px;color:var(--sg-gold-text);transition:transform .15s ease}
.link-user-passport-company.is-expanded .link-user-passport-company-chevron{transform:rotate(180deg)}
.link-user-passport-company-body{padding:0 10px 8px;background:var(--sg-surface)}
.link-user-passport-company-row{
  display:grid;grid-template-columns:19px minmax(85px,1fr) minmax(0,1.45fr) 24px;align-items:center;gap:7px;
  min-height:28px;padding:3px 0;border-bottom:1px solid var(--sg-line);font-size:11px;
}
.link-user-passport-company-row:last-of-type{border-bottom:0}
.link-user-passport-company-row-icon{display:grid;place-items:center;width:18px;height:18px;color:var(--sg-gold-text)}
.link-user-passport-company-row-label{color:var(--sg-muted);font-weight:500;line-height:1.3;overflow-wrap:anywhere}
.link-user-passport-company-row-value{color:var(--sg-ink-2);font-weight:600;line-height:1.35;font-size:11.5px;overflow-wrap:anywhere}
.link-user-passport-company-row-actions{display:grid;place-items:center;min-width:24px}
.link-user-passport-company-note{font-size:9.5px;line-height:1.35;color:var(--sg-muted);margin:5px 0 1px;padding-top:6px;border-top:1px solid var(--sg-line)}
.link-user-passport-company-permissions{margin-top:7px;padding-top:6px;border-top:1px solid var(--sg-line)}
.link-user-passport-company-permissions .link-user-passport-card-label{display:block;margin-bottom:4px}
.link-user-passport-permissions{display:flex;flex-wrap:wrap;gap:4px}
.link-user-passport-permission{display:inline-flex;padding:3px 6px;border:1px solid var(--sg-line);border-radius:4px;background:var(--sg-gold-panel);color:var(--sg-ink-2);font-size:9.5px;line-height:1.3}
.link-user-passport-work-edit{margin-top:6px;padding:0;font-size:10.5px;color:var(--sg-gold-text)}
.link-user-passport-work-editor{margin-top:8px;padding-top:7px;border-top:1px solid var(--sg-line);display:flex;flex-direction:column;gap:6px}
.link-user-passport-work-editor h4{margin:0 0 1px;font-size:9.5px;color:var(--sg-muted);font-weight:600}
.link-user-passport-work-editor .link-user-passport-field span{font-size:9px;color:var(--sg-muted);font-weight:600}
.link-user-passport-work-editor input{width:100%;min-height:30px;padding:5px 8px;border:1px solid var(--sg-line);border-radius:6px;background:var(--sg-field);color:var(--sg-ink-2);font:inherit;font-size:10.5px}
.link-user-passport-work-actions{display:flex;gap:6px}
.link-user-passport-work-actions .button{min-height:30px;padding:5px 10px;font-size:10.5px;border-radius:7px}
.link-user-passport-company-settings{margin-top:8px;padding-top:7px;border-top:1px solid var(--sg-line);display:flex;flex-direction:column;gap:5px}
.link-user-passport-company-settings h4{margin:2px 0 1px;font-size:9.5px;color:var(--sg-muted);font-weight:600}
.link-user-passport-company-settings .link-user-passport-edit-grid{margin-top:2px}
.link-user-passport-empty{display:grid;place-items:center;min-height:150px;color:var(--sg-muted);font-size:11px;text-align:center}
/* Edit mode uses the same shell and identity language. */
.link-user-passport-edit{display:flex;flex-direction:column;gap:10px}
.link-user-passport-avatar-editor{display:flex;align-items:center;gap:12px}
.link-user-passport-avatar-editor .link-user-passport-avatar-large{width:62px;height:62px;flex-basis:62px}
.link-user-passport-avatar-editor .button{min-height:32px;height:32px;padding:6px 10px;font-size:10.5px;border-radius:7px}
.link-user-passport-avatar-editor p{margin:5px 0 0}
.link-user-passport-avatar-library{display:flex;align-items:center;gap:6px;padding:1px 0 2px}
.link-user-passport-avatar-choice{width:36px;height:36px;padding:2px;border:1px solid var(--sg-line);border-radius:50%;background:var(--sg-surface);display:grid;place-items:center;overflow:hidden}
.link-user-passport-avatar-choice:hover{border-color:var(--sg-gold-border)}
.link-user-passport-avatar-choice.selected{border-color:var(--sg-gold-strong);box-shadow:0 0 0 1px var(--sg-gold-strong)}
.link-user-passport-avatar-choice svg{width:30px;height:30px;border-radius:50%}
.link-user-passport-form{display:flex;flex-direction:column;gap:7px}
.link-user-passport-edit-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px 9px}
.link-user-passport-edit-grid:has(> :nth-child(3)):not(:has(> :nth-child(4))){grid-template-columns:repeat(3,minmax(0,1fr))}
.link-user-passport-field{display:flex;flex-direction:column;gap:3px;min-width:0;font-size:11px;color:var(--sg-ink-2)}
.link-user-passport-field span,.link-user-passport-form .link-user-passport-field span{font-size:9.5px;color:var(--sg-muted);font-weight:600}
.link-user-passport-form input,.link-user-passport-form select,.link-user-passport-company-settings select{
  width:100%;min-height:34px;padding:7px 9px;border:1px solid var(--sg-line);border-radius:7px;background:var(--sg-field);color:var(--sg-ink-2);font:inherit;font-size:11px;
}
.link-user-passport-form input:focus,.link-user-passport-form select:focus,.link-user-passport-company-settings select:focus{outline:none;border-color:var(--sg-gold-border);box-shadow:0 0 0 2px var(--sg-gold-soft)}
.link-user-passport-form input:disabled{opacity:.6;background:var(--sg-surface-warm)}
.link-user-passport-inline-check{display:flex;align-items:center;gap:6px;color:var(--sg-ink-2);font-size:10px;line-height:1.35;cursor:pointer}
.link-user-passport-inline-check input{width:14px;height:14px;min-height:0;margin:0;accent-color:var(--sg-gold-strong);flex:0 0 auto}
.link-user-passport-visibility-edit{margin-top:3px;padding-top:8px;border-top:1px solid var(--sg-line);display:flex;flex-wrap:wrap;gap:5px 13px;align-items:center}
.link-user-passport-visibility-edit h3{width:100%;margin:0 0 1px;font-size:10px;color:var(--sg-ink-2);font-weight:600}
.link-user-passport-contact-edit-list{margin-top:8px;padding-top:8px;border-top:1px solid var(--sg-line)}
.link-user-passport-contact-edit-list h3{font-size:10px;line-height:1.3;color:var(--sg-ink-2);margin:0 0 5px;font-weight:600}
.link-user-passport-contact-edit{display:flex;flex-direction:column;gap:2px;padding:4px 0;border-bottom:1px solid var(--sg-line)}
.link-user-passport-contact-edit:last-child{border-bottom:0}
.link-user-passport-contact-text{font-size:10.5px;color:var(--sg-ink-2);overflow-wrap:anywhere}
.link-user-passport-loading{padding:36px 8px;text-align:center;color:var(--sg-muted);font-size:11px}
.link-user-passport-error{padding:18px 2px;color:var(--sg-ink-2);font-size:11px;line-height:1.6}
.link-user-passport-error p{margin:0 0 12px}
.link-user-passport-error .button{width:fit-content;min-height:32px}
@media(max-width:560px){
  .link-user-passport-screen{padding:10px;padding-bottom:calc(10px + var(--link-local-tools-height,0px))}
  .link-user-passport-modal{width:calc(100vw - 20px);max-height:calc(100dvh - 20px - var(--link-local-tools-height,0px));border-radius:14px}
  .link-user-passport-head{padding:0 12px;min-height:54px}
  .link-user-passport-head-title{gap:8px}
  .link-user-passport-brand{font-size:16px}
  .link-user-passport-head h2{font-size:13px}
  .link-user-passport-tabs{padding:0 4px;align-items:stretch;min-height:56px}
  .link-user-passport-tab{font-size:10.5px;gap:5px;padding:7px 4px 6px;min-height:56px;height:auto;align-items:center;white-space:normal}
  .link-user-passport-tab-label{white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere;text-wrap:balance;line-height:1.25}
  .link-user-passport-body{padding:12px}
  .link-user-passport-card-grid{grid-template-columns:1fr}
  .link-user-passport-card.is-wide{grid-column:auto}
  .link-user-passport-hero{gap:11px;margin-bottom:11px}
  .link-user-passport-avatar-large{width:60px;height:60px;flex-basis:60px}
  .link-user-passport-identity h3{font-size:15px}
  .link-user-passport-footer{padding:9px 12px}
  .link-user-passport-footer .button{font-size:10.5px;height:38px;min-height:38px;padding:6px 7px}
  .link-user-passport-company-row{grid-template-columns:18px minmax(72px,1fr) minmax(0,1.3fr) 22px;gap:5px}
}
@media(max-height:560px){
  .link-user-passport-body{padding-top:10px;padding-bottom:10px}
  .link-user-passport-avatar-library{display:none}
}

/* The company tab keeps the identity block while leaving room for two cards. */
.link-user-passport-general.is-companies .link-user-passport-hero{gap:10px;margin-bottom:6px}
.link-user-passport-general.is-companies .link-user-passport-avatar-large{width:58px;height:58px;flex-basis:58px}
.link-user-passport-general.is-companies .link-user-passport-identity{gap:5px}
.link-user-passport-general.is-companies .link-user-passport-identity h3{font-size:17px}
.link-user-passport-general.is-companies .link-user-passport-company-toggle{min-height:42px;padding:5px 9px}
.link-user-passport-general.is-companies .link-user-passport-company-row{min-height:24px;padding:1px 0}
.link-user-passport-general.is-companies .link-user-passport-company-body{padding-bottom:6px}
.link-user-passport-general.is-companies .link-user-passport-company-note{margin:4px 0 0;padding-top:4px;line-height:1.3;font-size:10.5px}
.link-user-passport-general.is-companies .link-user-passport-companies{gap:5px}
