/* People page (js/pages/people.js): org chart, person view, topic view. Prefix pp-. Tokens only. */

/* ---- toolbar + breadcrumb ---- */
.pp-toolbar { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; background: var(--surface); border-radius: 28px; padding: 8px 10px 8px 20px; }
.pp-field { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.pp-field label { font-weight: 500; }
.pp-field .select { padding: 0 12px; max-width: min(300px, 100%); }
.pp-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: -4px 0; font-weight: 600; }
.pp-crumbs a, .pp-crumbs [aria-current] { display: inline-flex; align-items: center; min-height: 40px; padding: 0 8px; border-radius: 6px; }
.pp-crumbs a { color: var(--accent); }
.pp-crumbs a:hover { text-decoration: underline; }
.pp-crumbs .sep { padding: 0 4px; color: var(--ink-3); font-weight: 400; }

/* ---- person cards shared by all three views ---- */
.pc { border: 1px solid transparent; color: var(--ink); }
.pc:hover { border-color: var(--ink-faint); }
.pc:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pc.is-hl { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.pp-id { flex: 1; min-width: 0; }
.pp-id .nm, .pp-id .ti { display: block; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-id .nm { font-size: 13px; font-weight: 600; }
.pp-id .ti { font-size: 12px; color: var(--ink-2); }
.disc.pp-disc-s { width: 26px; height: 26px; font-size: 10px; }
.disc.pp-disc-m { width: 32px; height: 32px; font-size: 12px; }
.disc.pp-disc-l { width: 44px; height: 44px; font-size: 14px; }
.disc.pp-disc-ceo { background: #fff; color: var(--ink); }

/* ---- org chart ---- */
.pp-chart { background: var(--surface); border-radius: var(--radius-card); padding: 32px 28px 20px; overflow-x: auto; }
.pp-chart-in { display: flex; flex-direction: column; }
.pp-ceo-row { display: flex; justify-content: center; }
.pp-ceo, .pp-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px 8px 8px; border-radius: 22px; }
.pp-ceo { width: 230px; max-width: 100%; background: var(--unit-company); color: #fff; }
.pp-ceo .pp-id .ti { color: rgba(255,255,255,0.88); }
.pp-ceo:hover { border-color: transparent; }
.pp-stem { width: 0; height: 20px; margin: 0 auto; border-left: 1px solid var(--ink-faint); }
.pp-stem.short { height: 14px; }
.pp-cols { display: grid; gap: 24px; align-items: start; }
.pp-col { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pp-join { position: relative; height: 20px; }
.pp-join .bar { position: absolute; top: 0; border-top: 1px solid var(--ink-faint); }
.pp-join .stem { position: absolute; top: 0; left: 50%; height: 20px; border-left: 1px solid var(--ink-faint); }
.pp-unit { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pp-unit-label { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 18px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); text-align: center; }
.pp-headwrap { display: flex; justify-content: center; }
.pp-headwrap.top .pp-head { max-width: 230px; }
.pp-nohead { display: flex; align-items: center; min-height: 46px; padding: 0 14px; border: 1px dashed var(--rule); border-radius: 22px; font-size: 13px; color: var(--ink-3); }
.pp-members { display: flex; flex-direction: column; gap: 2px; margin-left: 22px; padding: 4px 0 0 12px; border-left: 1px solid var(--border); }
.pp-members.nested { margin-left: 20px; padding-top: 0; }
.pp-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 10px 6px 8px; border-radius: 10px; }
.pp-row .pp-id .nm { font-weight: 500; }
.pp-row .pp-id .ti { color: var(--ink-3); }
.pp-teams { display: grid; gap: 20px; align-items: start; }
.pp-key { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--surface-sunken); font-size: 12px; color: var(--ink-2); }
.pp-key b { font-weight: 600; color: var(--ink); }
.pp-key > span { display: flex; align-items: center; gap: 6px; }

/* ---- two-column body of the person and topic views ---- */
.pp-split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.pp-main { flex: 3 1 460px; min-width: 0; background: var(--surface); border-radius: var(--radius-card); }
.pp-side { flex: 1 1 280px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.pp-panel { background: var(--surface); border-radius: var(--radius-card); padding: 20px; }
.pp-cap { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.pp-sub { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); }
.pp-meta { font-size: 13px; color: var(--ink-2); }
.pp-inline { display: inline-flex; align-items: center; min-height: 24px; color: var(--accent); font-weight: 600; }
.pp-inline:hover, .pp-textlink:hover { text-decoration: underline; }

/* ---- person view ---- */
.pp-hexcard { padding: 20px 0; display: flex; flex-direction: column; gap: 12px; }
.pp-pad { padding: 0 24px; }
.pp-hexcard .hx { transition: transform .15s ease; }
.pp-hexcard .hx:hover { transform: scale(1.04); z-index: 1; }
.pp-hexcard .hx:focus-visible { outline: none; background: var(--ink) !important; }
/* the honeycomb reserves half a column for shifted rows; move the stage so the centre tile sits in the middle */
@media (min-width: 860px) { .pp-hexcard .hexstage[data-shift="odd"] { left: -34.5px; } .pp-hexcard .hexstage[data-shift="even"] { left: 34.5px; } }
.pp-hex-disc { order: -1; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: #fff; font-size: 12px; font-weight: 600; }
.pp-hex-lv { display: flex; align-items: center; gap: 5px; margin-top: 2px; font-size: 11px; font-weight: 600; line-height: 1.3; }
.pp-hex-lv .meter { height: 12px; }
.pp-hex-lv .meter i { background: rgba(21,26,38,0.18); }
.pp-hex-lv .meter i.on { background: currentColor; }
.pp-hex-rank { font-size: 11px; line-height: 1.2; opacity: 0.85; }
.pp-who { display: flex; gap: 12px; align-items: center; }
.pp-who > div { min-width: 0; }
.pp-who h2 { margin: 0; font: 600 20px/1.25 var(--font-display); overflow-wrap: anywhere; }
.pp-lv-row { display: grid; grid-template-columns: 18px 86px 1fr; gap: 8px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--surface-sunken); font-size: 13px; }
.pp-lv-row .nm { font-weight: 600; }
.pp-lv-row .nm span { font-weight: 400; color: var(--ink-3); }
.pp-lv-row .ts { color: var(--ink-2); overflow-wrap: anywhere; }
.pp-lv-row .ts.none { color: var(--ink-3); }
.pp-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.pp-stats b { color: var(--ink); }
.pp-qa { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 14px; border-radius: 22px; background: var(--surface-sunken); }
.pp-qa:hover { background: var(--border); }
.pp-textlink { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; color: var(--accent); font-weight: 600; }

/* ---- topic view ---- */
.pp-thead { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; padding: 22px 28px; border-radius: var(--radius-card); border-bottom-left-radius: 40px; background: var(--accent); color: #fff; }
.pp-thex { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 46px; background: #fff; clip-path: var(--hex-clip); }
.pp-thex i { display: block; width: 34px; height: 39px; clip-path: var(--hex-clip); }
.pp-thead .tx { flex: 1 1 300px; min-width: 0; }
.pp-thead .eb { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: rgba(255,255,255,0.88); }
.pp-thead h2 { margin: 2px 0 0; font: 600 24px/1.2 var(--font-display); overflow-wrap: anywhere; }
.pp-thead .ct { margin-top: 2px; color: rgba(255,255,255,0.88); }
.pp-btn.btn { padding: 0 18px; }
.pp-btn.ghost { border-color: rgba(255,255,255,0.7); color: #fff; }
.pp-btn.ghost:hover { background: rgba(255,255,255,0.12); }
.pp-tiers { padding: 24px; display: flex; flex-direction: column; align-items: stretch; }
.pp-tier { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pp-tier-h { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 2px 8px; }
.pp-tier-h h3 { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.pp-tier-h span { font-size: 12px; color: var(--ink-3); }
.pp-tier-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; width: 100%; }
.pp-tier-cards.compact { gap: 8px; }
.pp-tier-empty { padding: 10px 16px; border: 1px dashed var(--rule); border-radius: 10px; font-size: 13px; color: var(--ink-2); }
.pp-tier-stem { width: 0; height: 24px; margin-bottom: 10px; border-left: 1px solid var(--ink-faint); }
.pp-tcard { flex: 0 1 230px; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-color: var(--border); border-radius: 10px; background: var(--surface); }
.pp-tcard .top { display: flex; gap: 10px; align-items: center; }
.pp-tcard .pp-id .nm { font-size: 14px; white-space: normal; overflow-wrap: anywhere; }
.pp-tcard .pp-id .ti { white-space: normal; }
.pp-tcard .rank { flex: none; font: 600 15px/1 var(--font-display); }
.pp-tcard .lv { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.pp-tcard .lv b { font-weight: 600; }
.pp-tcard .score { margin-left: auto; color: var(--ink-2); }
.pp-chip { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 12px 4px 4px; border-color: var(--border); border-radius: 20px; background: var(--surface); font-size: 13px; }
.pp-chip .disc { width: 30px; height: 30px; }
.pp-chip .meter { height: 12px; }
.pp-depth-row { display: grid; grid-template-columns: 18px 72px 1fr 18px; gap: 8px; align-items: center; font-size: 13px; }
.pp-depth-row b { font-weight: 600; }
.pp-depth-row .n { text-align: right; }
.pp-depth-row .bar { height: 8px; border-radius: 4px; background: var(--surface-sunken); overflow: hidden; }
.pp-depth-row .bar i { display: block; height: 8px; background: var(--ink); }
.pp-depth-text { margin: 12px 0 0; font-size: 13px; color: var(--ink-2); }
.pp-rank-note { margin: 2px 0 10px; font-size: 12px; color: var(--ink-3); }
.pp-ranking { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.pp-rank-row { display: grid; grid-template-columns: 22px 26px 1fr auto; gap: 8px; align-items: center; min-height: 44px; padding: 4px 6px; border-radius: 8px; font-size: 13px; }
.pp-rank-row:hover, .pp-rank-row.is-from { background: var(--surface-sunken); }
.pp-rank-row .no { font-weight: 600; color: var(--ink-2); }
.pp-rank-row .who { min-width: 0; }
.pp-rank-row .who b, .pp-rank-row .who span { display: block; line-height: 1.25; }
.pp-rank-row .who b { font-weight: 600; overflow-wrap: anywhere; }
.pp-rank-row .who span { font-size: 12px; color: var(--ink-2); }
.pp-rank-row .lv { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-size: 12px; }
.pp-rank-row .lv > span:first-child { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.pp-rank-row .score { color: var(--ink-3); }

@media (max-width: 560px) {
  .pp-toolbar { border-radius: 24px; padding: 14px 16px; }
  .pp-field, .pp-field .select { width: 100%; max-width: 100%; }
  .pp-chart { padding: 24px 16px 16px; }
  .pp-thead { padding: 20px; }
  .pp-tiers { padding: 20px 14px; }
}
