:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  --ink: #182f33; --muted: #526c70; --line: #d8e3e2; --teal: #00685f;
  color: var(--ink); background: #f5f8f7; font-size: 16px;
}
* { box-sizing: border-box }
[hidden] { display: none !important }
body { margin: 0 }
button, input, select { font: inherit }
button, select { cursor: pointer }
button { color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 7px }
button:disabled { cursor: default; opacity: .43 }
button:hover:not(:disabled) { border-color: #8caeaa; background: #edf5f3 }
:focus-visible { outline: 3px solid #028b83; outline-offset: 3px }
h1,h2,p { margin: 0 }
.masthead { height: 66px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(18px, 4.4vw, 82px); border-bottom: 1px solid var(--line); background: #fff }
.identity { display: flex; align-items: center; gap: 12px; font-size: .94rem; color: var(--muted) }
.identity b { color: var(--ink); font-size: 1.05rem }
.separator { margin: 0 2px; height: 17px; border-left: 1px solid var(--line) }
.mark { display: inline-flex; align-items: flex-end; justify-content: center; gap: 3px; width: 30px; height: 30px; padding: 6px; border-radius: 8px; background: var(--teal) }
.mark i { display: block; width: 4px; background: #fff; border-radius: 2px }
.mark i:nth-child(1) { height: 8px }.mark i:nth-child(2) { height: 16px }.mark i:nth-child(3) { height: 12px }
.quiet,select { min-height: 35px; padding: 6px 12px; font-size: .88rem }
.waiting, noscript { display: block; margin: 4rem auto; text-align: center; color: var(--muted) }
.gate { width: min(410px,calc(100% - 32px)); margin: clamp(48px,13vh,140px) auto; padding: 34px; background: #fff; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 8px 28px #153a3210 }
.gate h1 { font-size: 1.65rem; letter-spacing: -.04em; margin: 19px 0 8px }
.gate p,.page-heading p { color: var(--muted); line-height: 1.65 }
.lock-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #e3f3ed }
.lock-mark i { display: block; width: 18px; height: 13px; border-radius: 3px; border: 2px solid var(--teal); position: relative; margin-top: 6px }
.lock-mark i::before { content: ''; position: absolute; width: 8px; height: 8px; left: 1px; top: -10px; border: 2px solid var(--teal); border-radius: 7px 7px 0 0; border-bottom: 0 }
.gate form { display: grid; gap: 9px; margin-top: 23px }
.gate label { font-size: .92rem; font-weight: 600 }
input { border: 1px solid #abc2bf; border-radius: 7px; padding: 10px 12px; width: 100%; color: var(--ink); background: #fff }
.primary { min-height: 42px; border: 0; color: #fff; background: var(--teal); font-weight: 650; margin-top: 6px }
button.primary:hover:not(:disabled) { background: #00524c }
.gate .notice { margin-top: 12px; font-size: .88rem; color: #9b3f27 }.notice:empty { display:none }
.directory { max-width: 1760px; margin: 0 auto; padding: 37px clamp(16px,4.4vw,82px) 42px }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 25px }
.page-heading h1 { font-size: clamp(1.75rem,3vw,2.25rem); letter-spacing: -.05em; margin-bottom: 5px }
.search-box { position: relative; width: min(330px,100%) }
.search-box input { padding-left: 39px; min-height: 43px }
.search-mark { position: absolute; left: 14px; top: 14px; height: 12px; width: 12px; border: 2px solid #667f80; border-radius: 50% }
.search-mark::after { content: ''; position: absolute; width: 7px; height: 2px; background: #667f80; transform: rotate(45deg); top: 9px; left: 7px }
.workspace { display: grid; grid-template-columns: minmax(210px,24%) minmax(0,1fr); gap: 18px; align-items: start }
.org-pane,.roster { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden }
.org-pane { position: sticky; top: 12px; max-height: calc(100vh - 24px); display: flex; flex-direction: column }
.pane-label,.roster-heading,.dialog-head,.pagination { display: flex; justify-content: space-between; align-items: center; gap: 12px }
.pane-label { padding: 18px; border-bottom: 1px solid var(--line) }
.pane-label h2 { font-size: 1rem }
#tree-area { overflow-y: auto; padding: 10px }
.org-choice { text-align: left; background: transparent; min-height: 39px; display: flex; align-items: center; justify-content: space-between; gap: 5px; padding: 6px 9px; width: 100%; border: 1px solid transparent; font-size: .91rem; overflow-wrap: anywhere }
.org-choice[aria-current="true"] { color: #005c54; background: #e1f2ec; font-weight: 650 }
.count { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .81rem; padding-left: 3px }
.all-org { margin-bottom: 5px }
.branch { display: flex; align-items: center }
.expander { border-color: transparent; width: 30px; min-width: 30px; height: 33px; display: grid; place-content: center; color: var(--muted) }
.chevron { display: block; height: 7px; width: 7px; transform: rotate(-45deg); border: solid currentColor; border-width: 0 1.7px 1.7px 0 }
.expander[aria-expanded="true"] .chevron { transform: rotate(45deg) }
.units { margin: 0 0 3px 6px; border-left: 1px solid var(--line); padding-left: 5px }
.branch.leaf { padding-left: 30px }
.units .org-choice { font-size: .87rem; min-height: 35px }
.roster-heading { padding: 22px 22px 4px }
#crumb { font-size: .83rem; color: var(--muted); margin-bottom: 6px }
.roster-heading h2 { font-size: 1.35rem }
select { border: 1px solid var(--line); color: var(--ink); border-radius: 6px; background-color: #fff }
#result-count { padding: 4px 22px 18px; color: var(--muted); font-size: .88rem }
.table-wrap { overflow-x: auto }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .94rem }
th { color: var(--muted); background: #f3f7f6; font-size: .86rem; font-weight: 600 }
th,td { padding: 12px 10px; border-bottom: 1px solid #e8eeed; vertical-align: middle; overflow-wrap: anywhere }
th:first-child,td:first-child { padding-left: 22px }
th:last-child,td:last-child { padding-right: 22px }
td.name { font-weight: 600 }
.phone { display:block; font-weight:400; font-size:.86rem; color:var(--muted); font-variant-numeric:tabular-nums }
.sub { display: block; color: var(--muted); font-size: .83rem; line-height: 1.5 }
.table-action { border-color: transparent; color: var(--teal); font-size: .87rem; min-height: 33px; padding: 3px 6px; white-space: nowrap }
.status { display: inline-block; border-radius: 5px; padding: 3px 7px; font-size: .81rem; white-space: nowrap; background: #f0f3f3; color: #53666a }
.status.matched { background: #e4f3ec; color: #21694b }
.status.conflict,.status.ambiguous { background: #fff0db; color: #91570b }
.no-review .review-column { display: none }
.pagination { padding: 14px 22px; color: var(--muted); font-size: .86rem }
.pagination button + button { margin-left: 6px }
#empty { text-align: center; padding: 3rem 1rem; color: var(--muted) }
.sr { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0 }
.mobile-only { display: none }
dialog { color: var(--ink); width: min(460px,calc(100vw - 24px)); max-height: 86vh; padding: 24px; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 48px #153a3224 }
dialog::backdrop { background: #152e38a6 }
.dialog-head { color: var(--muted); font-size: .9rem; margin-bottom: 14px }
dialog h2 { font-size: 1.6rem }
#person-path { color: var(--muted); margin-top: 5px; font-size: .89rem; overflow-wrap: anywhere }
dl { margin: 20px 0 0 } dl div { display: grid; grid-template-columns: minmax(94px, 32%) minmax(0,1fr); border-top: 1px solid var(--line); padding: 10px 0; gap:12px }
dt,dd { margin: 0; overflow-wrap: anywhere; font-size: .93rem; line-height: 1.55 }
dt { color: var(--muted) }
.review-info { padding: 14px; margin-top: 14px; font-size: .89rem; line-height: 1.7; background: #eff5f3; border-radius: 8px; overflow-wrap: anywhere }
#person-sources { margin-top:14px; font-size:.9rem }
#person-sources summary { color:var(--teal); cursor:pointer; padding:6px 0 }
#source-rows { margin-top:6px }
@media(max-width:800px){
  .workspace { grid-template-columns: 1fr }
  .org-pane { position: static; max-height: 54vh }.pane-label { padding: 10px 14px }
  .mobile-only { display: block }#tree-area:not(.open) { display: none }
}
@media(max-width:580px){
  .masthead { height: 56px }.directory { padding-top: 22px }.page-heading { display: grid; gap: 12px; margin-bottom:16px }.search-box { width: 100% }
  .roster-heading { padding: 16px 12px 4px }.roster-heading h2 { font-size: 1.12rem }
  #result-count { padding-left:12px }.pagination { padding:12px }
  th,td { padding: 8px 4px; font-size: .86rem }th:first-child,td:first-child { padding-left: 9px }th:last-child,td:last-child { padding-right: 9px }
  .status { padding: 2px 4px; white-space: normal }.sub { font-size: .78rem }.table-action { padding: 3px 2px }.workspace { gap:12px }
}
