/* Leader profile dialog. Local tokens (not in base.css):
   --map-text: secondary text on map surfaces; --map-site: location dot, matches the globe marker;
   --profile-bar: height of the sticky bar, keep it under 60px.
   scroll-padding-top keeps keyboard focus and the Amazon deep-link targets clear of the sticky bar;
   the Amazon sections add only a few px of scroll-margin-top on top of it. */
dialog#profile {--map-text:#c3d3cb;--map-site:#ffb377;--profile-bar:56px;scroll-padding-top:calc(var(--profile-bar) + var(--space-3))}
body:has(dialog[open]) {overflow:hidden}

/* Dialog chrome and motion */
dialog {padding:0;width:min(1000px,calc(100vw - 40px));max-width:none;max-height:calc(100dvh - 40px);border:1px solid var(--line);border-radius:var(--radius-lg);background:var(--paper);color:var(--ink);box-shadow:0 25px 100px #10191970;overscroll-behavior:contain;scrollbar-gutter:stable;
  opacity:1;transform:none;transition:opacity 200ms var(--ease),transform 240ms var(--ease),overlay 240ms allow-discrete,display 240ms allow-discrete}
dialog:not([open]) {opacity:0;transform:translateY(14px) scale(.985)}
dialog::backdrop {background:#0f1b1cb3;backdrop-filter:blur(4px);transition:background-color 220ms var(--ease),backdrop-filter 220ms var(--ease),overlay 240ms allow-discrete,display 240ms allow-discrete}
dialog:not([open])::backdrop {background-color:#0f1b1c00;backdrop-filter:blur(0)}
@starting-style {
  dialog[open] {opacity:0;transform:translateY(14px) scale(.985)}
  dialog[open]::backdrop {background-color:#0f1b1c00;backdrop-filter:blur(0)}
}

/* Sticky top bar */
.profile-top {position:sticky;top:0;z-index:3;display:flex;align-items:center;gap:var(--space-3);min-height:var(--profile-bar);padding:var(--space-2) var(--space-5);border-bottom:1px solid var(--line);background:var(--paper)}
.profile-top .eyebrow {margin:0 auto 0 0;font-size:12px;white-space:nowrap}
.profile-nav {display:flex;align-items:center;gap:var(--space-1)}
.profile-step {display:flex;align-items:center;gap:var(--space-2);min-height:40px;padding:var(--space-1) var(--space-3);border-radius:var(--radius-sm);color:var(--ink);text-decoration:none;line-height:1.15;transition:background-color 150ms var(--ease)}
.profile-step[data-step="next"] {text-align:right}
.profile-step:hover {background:var(--paper-2)}
.profile-step:hover .step-name {text-decoration:underline;text-underline-offset:3px}
.step-text {display:flex;flex-direction:column}
.step-text small {white-space:nowrap;font-size:11px;font-weight:750;letter-spacing:.12em;color:var(--muted);text-transform:uppercase}
.step-name {font:400 15px/1.2 var(--serif);max-width:190px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.step-arrow {font-size:17px;color:var(--red)}
.profile-nav .profile-step + .profile-step {position:relative}
.profile-nav .profile-step:not([hidden]) + .profile-step::before {content:"";position:absolute;left:-3px;top:10px;bottom:10px;border-left:1px solid var(--line)}
.close {display:grid;place-items:center;flex:none;width:40px;height:40px;padding:0 0 2px;margin-left:var(--space-2);border:1px solid var(--line);border-radius:50%;color:var(--ink);background:var(--card);font:300 26px/1 var(--sans);transition:background-color 150ms var(--ease),border-color 150ms var(--ease),color 150ms var(--ease)}
.close:focus-visible {outline-offset:1px}
.close:hover {background:var(--paper-2);border-color:var(--red);color:var(--red)}

/* Title block */
#profile-body {padding:var(--space-6) var(--space-6) var(--space-6)}
.profile-title {display:flex;align-items:center;gap:var(--space-5);margin-bottom:var(--space-5)}
.profile-title .portrait {flex:none;width:112px;height:112px;border-radius:var(--radius);box-shadow:var(--shadow-1)}
.profile-heading {min-width:0}
.profile-title .eyebrow {color:var(--red);font-size:12px;margin-bottom:var(--space-2)}
.profile-title h2 {font-size:clamp(38px,5.4vw,60px);line-height:.98;margin:0 0 var(--space-2);overflow-wrap:anywhere}
.profile-role {margin:0;font-size:15px;color:var(--muted)}
.profile-role strong {color:var(--ink);font-weight:650}
.profile-ticker {display:inline-block;margin-left:var(--space-1);padding:1px 6px;border:1px solid var(--line);border-radius:var(--radius-sm);font-size:11px;font-weight:700;letter-spacing:.08em;color:var(--muted);vertical-align:2px}
.profile-lede {max-width:46em;margin:0 0 var(--space-5);padding-top:var(--space-4);border-top:1px solid var(--line);font:400 clamp(19px,2.1vw,23px)/1.4 var(--serif);letter-spacing:-.01em;color:var(--ink)}
.profile-lede strong {white-space:nowrap;font-weight:400;color:var(--green);box-shadow:inset 0 -.32em 0 var(--green-soft)}

/* Three stats */
.profile-stats {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin:0 0 var(--space-5);border:1px solid var(--line);border-radius:var(--radius);background:var(--card);overflow:hidden}
.profile-stats > div {display:flex;flex-direction:column;gap:var(--space-2);padding:var(--space-4) var(--space-4) var(--space-4);border-left:1px solid var(--line)}
.profile-stats > div:first-child {border-left:0}
.profile-stats dt {font-size:12px;font-weight:750;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);line-height:1.3}
.profile-stats dd {display:flex;flex-direction:column;gap:var(--space-1);margin:0}
.profile-stats strong {font:400 clamp(26px,3.4vw,38px)/1 var(--serif);letter-spacing:-.04em;font-variant-numeric:tabular-nums}
.profile-stats dd span {font-size:13px;color:var(--muted)}
.profile-stats .stat-jobs strong,.profile-stats .stat-payroll strong {color:var(--green)}
.profile-stats .stat-payroll {background:var(--green-soft)}
.profile-stats .stat-payroll dt,.profile-stats .stat-payroll dd span {color:#3c5a45}

/* Generic operating footprint (Amazon uses its own .amazon-footprint; .zoom is shared) */
.footprint {display:grid;grid-template-columns:minmax(0,1.65fr) minmax(0,1fr);border:1px solid var(--map-line);border-radius:var(--radius);overflow:hidden;background:var(--map);color:var(--night-text)}
.map-pane {position:relative;min-width:0;min-height:380px;background:radial-gradient(ellipse at 50% 55%,#243739,var(--map) 75%);display:flex;flex-direction:column}
.map-heading {position:absolute;top:var(--space-5);left:var(--space-5);pointer-events:none;z-index:1}
.map-kicker {margin:0 0 var(--space-1);font-size:11px;font-weight:750;letter-spacing:.15em;color:var(--gold)}
.map-heading h3 {font:400 clamp(24px,2.6vw,30px)/1.1 var(--serif);letter-spacing:-.02em;margin-bottom:var(--space-1)}
.map-heading p:last-child,.places > p {color:var(--map-text);font-size:13px;margin:0}
.map-pane canvas {display:block;width:100%;height:320px;flex:1;touch-action:none;cursor:grab}
.map-pane canvas:active {cursor:grabbing}
.map-pane canvas:focus-visible {outline-offset:-5px}
.zoom {position:absolute;right:12px;bottom:12px;display:flex;gap:var(--space-1)}
.zoom button {display:grid;place-items:center;width:34px;height:34px;padding:0;background:var(--map-2);border:1px solid #556d6a;color:var(--night-text);border-radius:var(--radius-sm);font-size:18px;line-height:1;transition:background-color 150ms var(--ease),border-color 150ms var(--ease)}
.zoom button:hover {background:#2c4044;border-color:var(--gold)}
.places {display:flex;flex-direction:column;padding:var(--space-5) var(--space-4) var(--space-4);background:var(--map-2);border-left:1px solid var(--map-line)}
.places h3 {margin:0 var(--space-2) var(--space-3);font-size:12px;font-weight:750;letter-spacing:.14em;text-transform:uppercase;color:var(--map-text)}
#place-list {display:flex;flex-direction:column;gap:2px}
.places button {display:flex;gap:var(--space-3);align-items:center;width:100%;padding:var(--space-2) var(--space-3) var(--space-2) var(--space-2);text-align:left;border-radius:var(--radius-sm);border:1px solid transparent;background:none;color:inherit;transition:background-color 150ms var(--ease),border-color 150ms var(--ease)}
.places button:hover {background:#26363a}
.places button[aria-pressed="true"] {background:#2b3d40;border-color:#5d726c}
.places button:focus-visible {outline-offset:-2px}
.places i {width:8px;height:8px;flex:none;border-radius:50%;background:var(--map-site);opacity:.7}
.places button[aria-pressed="true"] i {opacity:1;box-shadow:0 0 0 4px #ffb37733}
.places strong,.places small {display:block}
.places strong {font-size:14px;font-weight:650}
.places small {color:var(--map-text);font-size:13px;line-height:1.35}
.places > p {margin:auto var(--space-2) 0;padding-top:var(--space-4);line-height:1.45}

/* Slider and sources */
.profile-bottom {display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:var(--space-5);margin-top:var(--space-5)}
.profile-bottom section {border:1px solid var(--line);border-radius:var(--radius);padding:var(--space-5);background:var(--card)}
.profile-bottom h3 {font:400 22px/1.2 var(--serif);letter-spacing:-.02em;margin-bottom:var(--space-2)}
.profile-bottom p {color:var(--muted);font-size:15px;margin-bottom:var(--space-3)}
.profile-bottom label,.scenario {display:flex;justify-content:space-between;align-items:baseline;gap:var(--space-3);font-size:14px}
.profile-bottom output {font-weight:750;color:var(--ink);font-variant-numeric:tabular-nums}
.scenario {flex-wrap:wrap;margin:var(--space-4) 0 var(--space-4);padding:var(--space-3) var(--space-4);border-radius:var(--radius-sm);background:var(--green-soft);color:#3c5a45}
.scenario strong {font:400 clamp(26px,3vw,34px)/1 var(--serif);letter-spacing:-.03em;color:var(--green);font-variant-numeric:tabular-nums}
.profile-bottom input[type=range] {--fill:50%;display:block;width:100%;height:22px;margin:var(--space-3) 0 var(--space-1);background:none;accent-color:var(--red);-webkit-appearance:none;appearance:none;cursor:pointer}
.profile-bottom input[type=range]::-webkit-slider-runnable-track {height:6px;border-radius:999px;background:linear-gradient(90deg,var(--red) var(--fill),var(--line) var(--fill))}
.profile-bottom input[type=range]::-webkit-slider-thumb {-webkit-appearance:none;width:20px;height:20px;margin-top:-7px;border:3px solid var(--card);border-radius:50%;background:var(--red);box-shadow:0 0 0 1px var(--red-dark),var(--shadow-1);transition:transform 150ms var(--ease)}
.profile-bottom input[type=range]:active::-webkit-slider-thumb {transform:scale(1.12)}
.profile-bottom input[type=range]::-moz-range-track {height:6px;border-radius:999px;background:var(--line)}
.profile-bottom input[type=range]::-moz-range-progress {height:6px;border-radius:999px;background:var(--red)}
.profile-bottom input[type=range]::-moz-range-thumb {width:14px;height:14px;border:3px solid var(--card);border-radius:50%;background:var(--red);box-shadow:0 0 0 1px var(--red-dark)}
.range-scale {display:grid;grid-template-columns:1fr auto 1fr;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.range-scale span:last-child {text-align:right}
.scenario-reset {margin-top:var(--space-3);padding:0;border:0;background:none;color:var(--red-dark);font-size:14px;font-weight:650;text-decoration:underline;text-underline-offset:3px}
.sources {display:flex;gap:8px 14px;flex-wrap:wrap}
.sources a {font-size:14px;color:var(--red-dark);text-underline-offset:3px}
.profile-sources .sources {gap:var(--space-2)}
.profile-sources .sources a {display:inline-flex;align-items:center;gap:6px;padding:6px var(--space-3);border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--paper);font-weight:650;text-decoration:none;transition:border-color 150ms var(--ease),background-color 150ms var(--ease)}
.profile-sources .sources a::after {content:"↗";content:"↗" / "";font-size:12px}
.profile-sources .sources a:hover {border-color:var(--red-dark);background:var(--card)}
.profile-bottom .photo-credit {margin:var(--space-4) 0 0;padding-top:var(--space-3);border-top:1px solid var(--line);font-size:13px}
.photo-credit a {color:var(--red-dark);text-underline-offset:3px}

/* Content swap when paging between leaders */
@keyframes profile-rise {from {opacity:0;transform:translateY(6px)}}
#profile-body > .profile-title,#profile-body > .profile-lede,#profile-body > .profile-stats {animation:profile-rise 260ms var(--ease) both}
#profile-body > .profile-lede {animation-delay:30ms}
#profile-body > .profile-stats {animation-delay:60ms}

@media (max-width:760px) {
  dialog {width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}
  .profile-top {padding-inline:var(--space-3) var(--space-2);gap:var(--space-1)}
  #profile-body {padding:var(--space-5) var(--space-4)}
  .step-name {max-width:120px}
  .profile-title {gap:var(--space-4)}
  .profile-title .portrait {width:88px;height:88px}
  .profile-stats > div {padding:var(--space-3)}
  .profile-bottom {grid-template-columns:minmax(0,1fr);gap:var(--space-4)}
  .footprint {grid-template-columns:minmax(0,1fr)}
  .map-pane {min-height:300px}
  .map-pane canvas {height:300px}
  .map-heading {top:var(--space-4);left:var(--space-4)}
  .places {border-left:0;border-top:1px solid var(--map-line)}
}
@media (max-width:560px) {
  .profile-top .eyebrow {font-size:11px;letter-spacing:.12em}
  .step-name {display:none}
  .profile-step {padding-inline:var(--space-2)}
  .profile-title {align-items:flex-start}
  .profile-title .portrait {width:72px;height:72px}
  .profile-title h2 {font-size:clamp(32px,9vw,38px)}
  .profile-lede {font-size:18px}
  .profile-stats {grid-template-columns:minmax(0,1fr)}
  .profile-stats > div {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:var(--space-3);border-left:0;border-top:1px solid var(--line)}
  .profile-stats > div:first-child {border-top:0}
  .profile-stats dd {align-items:flex-end;text-align:right}
  .profile-stats strong {font-size:28px}
  .profile-stats dd span {font-size:12px}
  .profile-bottom section {padding:var(--space-4)}
}
@media (max-width:380px) {
  .profile-top .eyebrow {display:none}
  .profile-nav {margin-right:auto}
}
@media (prefers-reduced-motion:reduce) {
  dialog,dialog::backdrop,.profile-step,.close,.zoom button,.places button {transition:none}
  #profile-body > *,#profile-body > .profile-title,#profile-body > .profile-lede,#profile-body > .profile-stats {animation:none}
  .profile-bottom input[type=range]::-webkit-slider-thumb {transition:none}
}
