/* A continuous ambient field, without architectural stripes or tilted light planes. */
#workspace:before{background:radial-gradient(ellipse at 25% 30%,#fffdf7c9,transparent 63%),radial-gradient(ellipse at 76% 75%,#dce4d25c,transparent 62%)!important;inset:-12%!important;opacity:.65!important;animation:gallery-light 28s ease-in-out infinite alternate;filter:blur(34px);pointer-events:none}
#workspace{overflow:hidden;position:relative;grid-template-columns:minmax(0,1fr)}
#workspace:before{content:"";position:absolute;z-index:0}
#workspace>*{min-width:0}
#treeRegion:before{background:radial-gradient(ellipse at 50% 95%,#d1d5c233,transparent 70%)!important}
@keyframes gallery-light{0%{transform:translate3d(-2%,-1%,0) scale(1)}100%{transform:translate3d(3%,2%,0) scale(1.08)}}
.tree-tools #overview,.tree-tools #resetCamera{border-radius:14px;padding:6px 12px}
.tree-tools #overview[aria-pressed=true],.tree-tools #resetCamera[aria-pressed=true]{background:#7f70451a;color:#665329;box-shadow:inset 0 0 0 1px #9e916d33}
@media(min-width:851px) and (orientation:landscape){
 #workspace{--exhibition-height:215px;background:linear-gradient(180deg,#f5f5ee,#f1f3e9)!important}
 #encounter{top:48px;left:24px;right:24px}
 .encounter-body{grid-template-columns:180px minmax(240px,1.2fr) minmax(250px,1fr);gap:0;position:relative;border:1px solid #ffffffc9;border-radius:9px;background:linear-gradient(115deg,#ffffffb0,#ffffff42);box-shadow:0 15px 35px -25px #59604a55;backdrop-filter:blur(22px);-webkit-backdrop-filter:blur(22px);padding:10px 14px;height:164px;flex:0 0 164px;overflow:hidden}
 #exhibit{grid-column:1;grid-row:1;height:146px;min-height:0;width:160px;justify-self:center;transform:none}
 #personIntro{grid-column:2;grid-row:1;background:none;border:0;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;padding:3px 21px 3px 13px;max-height:146px;align-self:start;transform:none}
 #personName h1{font-size:32px;line-height:1.1;margin-bottom:5px;letter-spacing:-1px}
 #personRole{margin:7px 0 3px;font-size:11px}#personLead{font-size:12px;line-height:1.6;max-width:420px;-webkit-line-clamp:2}
 #futureLinks{margin-top:6px}
 #relationOrbit{grid-column:3;grid-row:1;border:0;border-left:1px solid #aeb7a23b;background:none;border-radius:0;box-shadow:none;backdrop-filter:none;-webkit-backdrop-filter:none;transform:none;height:146px;max-height:146px;align-self:start;align-content:start;padding:3px 0 3px 19px;gap:4px 14px;overflow-y:auto;scrollbar-width:thin;scroll-padding:8px}
 #relationOrbit .section-label{font-size:9px;line-height:1.2;margin-bottom:3px}
 #relationOrbit .relation-card{padding:3px 0;gap:1px;min-height:0}#relationOrbit .relation-card strong{font-size:18px;line-height:1.15}#relationOrbit .relation-card small{font-size:9px;line-height:1.3}.relation-direction{font-size:9px}
 #exhibitPoster,#exhibitCanvas{height:126px;top:0}#exhibit.photo #exhibitPoster{padding:0 3px 3px;filter:drop-shadow(3px 6px 5px #64644720)}.exhibit-plinth{display:none}
 #exhibit .art-source{bottom:0;font-size:9px;background:transparent;border:0;box-shadow:none}#modelToggle{bottom:20px;right:0;font-size:8px}
 .cast-line{min-height:27px;margin-top:7px;box-shadow:none;background:#ffffff50}#cast{padding:2px 0}
 .encounter-heading{height:20px;padding:0 3px;font-size:10px}
}
@media(min-width:851px) and (max-width:1120px) and (orientation:landscape){.encounter-body{grid-template-columns:130px minmax(195px,1fr) minmax(180px,1fr);padding-left:4px;padding-right:10px}#exhibit{width:124px}#personIntro{padding-left:7px;padding-right:12px}#personName h1{font-size:27px}#relationOrbit{padding-left:12px}#personLead{font-size:11px}}
@media(prefers-reduced-motion:reduce){#workspace:before{animation:none!important;transform:none!important}}

@media(max-width:600px){#personName h1{font-size:28px;letter-spacing:-.8px}}
/* Fixed-height rows must never be compressed by the surrounding grid. */
#relationOrbit{grid-auto-rows:max-content;align-content:start!important}
#relationOrbit .relation-card{min-height:59px!important;flex-shrink:0;line-height:1.3}
#relationOrbit .relation-card small{display:block;line-height:1.45!important}
#collapseEncounter{display:none}
.tree-heading{position:relative;z-index:4;flex-shrink:0}
#peopleLayer{position:absolute;inset:calc(var(--exhibition-height,215px) + 86px) 0 0;z-index:8;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .45s ease,visibility .45s}
#peopleLayer.is-open{opacity:1;visibility:visible;pointer-events:auto}
.genealogy-glass{position:absolute;inset:0;width:100%;height:100%;background:#f6f8f180;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px)}
.genealogy-head{position:absolute;left:25px;right:25px;top:12px;display:flex;align-items:center;justify-content:space-between;z-index:3;color:#506660;font-size:13px;pointer-events:none}
.genealogy-head small{font-size:10px;margin-left:12px;color:#7f8c85}.genealogy-head button{pointer-events:auto;font-size:11px;background:#ffffffb8;border:1px solid #c7d3ca;border-radius:20px;padding:5px 12px;margin-left:6px}
.genealogy-stage{position:absolute;inset:52px 16px 24px;touch-action:none;user-select:none;cursor:grab}
.genealogy-stage canvas{position:absolute;width:100%;height:100%;pointer-events:none}.genealogy-cards{position:absolute;inset:0;pointer-events:none}
.genealogy-person{position:absolute;left:0;top:0;width:132px;min-height:72px;padding:9px 10px;text-align:left;background:linear-gradient(135deg,#ffffffed,#edf2eced);border:1px solid #c8d4ce;border-radius:4px;box-shadow:0 8px 24px #344e4516;pointer-events:auto;color:#314d45;will-change:transform}
.genealogy-person.selected{border-color:#7f9c90;background:#fffef8;box-shadow:0 10px 28px #344e4530}.genealogy-person img{float:left;width:26px;height:35px;object-fit:contain;margin:0 7px 4px 0}.genealogy-person strong{display:block;font:19px/1.1 Georgia,serif;overflow-wrap:anywhere}.genealogy-person span{display:block;clear:both;font-size:8px;margin-top:5px}.genealogy-person em{display:block;font:italic 9px Georgia;margin-top:3px;color:#89958b}.genealogy-edge{position:absolute;font-size:9px;color:#657c72;background:#f6f8f1dc;padding:1px 4px;white-space:nowrap}
@media(max-width:850px){#peopleLayer{inset:0;position:absolute}#treeRegion{position:relative}.genealogy-head{left:15px;right:15px}.genealogy-head small{display:none}.genealogy-person{width:112px;padding:7px}.genealogy-person strong{font-size:16px}.genealogy-stage{inset:50px 8px 12px}}
@media(prefers-reduced-motion:reduce){#peopleLayer{transition:none}}
@media(min-width:851px) and (orientation:landscape){
 #peopleLayer{top:calc(var(--exhibition-height,215px) + 43px)}
 body.people-open #workspace{--exhibition-height:125px}
 body.people-open .encounter-body{height:80px;flex-basis:80px;grid-template-columns:100px 1fr;padding:5px 14px}
 body.people-open #exhibit{height:68px;width:85px}
 body.people-open #exhibitPoster,body.people-open #exhibitCanvas{height:62px}
 body.people-open #personIntro{max-height:68px;padding:0 12px}
 body.people-open #personName h1{font-size:27px;display:inline-block;margin-right:14px}
 body.people-open #personRole,body.people-open #personLead,body.people-open #relationOrbit,body.people-open #artSource,body.people-open #modelToggle{display:none}
 body.people-open #futureLinks{margin-top:2px}
 body.people-open .encounter-heading{height:18px}
}
.genealogy-person{width:124px;padding:8px;min-height:70px}.genealogy-person strong{font-size:18px;letter-spacing:-.3px}.genealogy-person img{width:22px;height:28px}.genealogy-head{background:linear-gradient(90deg,#f7f8f1e0,#f7f8f170);padding:4px 0}
body.encounter-collapsed #peopleLayer{top:60px}
.genealogy-person img{float:none;position:absolute;top:-13px;left:8px;width:25px;height:29px;background:#f8faf4;border-radius:2px}.genealogy-person:has(img){padding-top:20px}.genealogy-person strong{overflow-wrap:normal;font-size:17px}.genealogy-stage{overflow:hidden}#personName{cursor:pointer}
/* One selection, one reading pane. The map carries relationships. */
.encounter-heading,#relationOrbit,#futureLinks,.cast-line,#personRole,#traceButton,#showEncounter,#treeHint,#treeLegend{display:none!important}
#personLead{display:none!important}.tree-heading{height:40px!important;flex-direction:row!important;align-items:center!important}
#treeTitle{font-size:12px}.inline-person{display:inline;color:inherit;border-bottom:1px solid #95a99a;line-height:inherit;text-align:left}.inline-person:hover{color:#52786b;background:#e7eee6}.story-destination{font-size:13px}#wikiBody h3{font-size:14px;margin-top:26px}#wikiBody details{font-size:12px;margin-top:20px;color:#71786a}#wikiBody summary{cursor:pointer}
@media(min-width:851px) and (orientation:landscape){
 #workspace,body.people-open #workspace{--exhibition-height:94px}
 .encounter-body,body.people-open .encounter-body{height:84px;flex-basis:84px;grid-template-columns:95px 1fr;padding:5px 14px;background:#ffffff70;border:0;box-shadow:none}
 #personIntro,body.people-open #personIntro{max-height:74px;padding:4px 12px}
 #exhibit,body.people-open #exhibit{height:72px;width:85px}
 #exhibitPoster,#exhibitCanvas,body.people-open #exhibitPoster,body.people-open #exhibitCanvas{height:66px}
 #personName h1,body.people-open #personName h1{display:block;font-size:30px;margin:0 0 5px}
 #artSource,#modelToggle{display:none!important}
 #peopleLayer{top:calc(var(--exhibition-height) + 43px)}
}
#peopleLayer{transition:opacity .6s ease,visibility .6s}.genealogy-glass{background:#f6f8f1bf;backdrop-filter:blur(2px)}.genealogy-head{font-size:12px;background:none}
.genealogy-person,.genealogy-person.selected{width:96px;min-height:0;padding:0!important;background:none;border:0;box-shadow:none;text-align:center;color:#89958a;transition:color .35s}
.genealogy-person:before{content:"";display:block;width:24px;height:24px;margin:0 auto 5px;border:1px solid #b9c8bc;border-radius:50%;background:#f5f7ef;box-shadow:0 0 0 4px #e6eee340}
.genealogy-person img{position:absolute;top:1px;left:calc(50% - 11px);width:22px;height:22px;object-fit:contain;border-radius:50%;background:#f8faf3}
.genealogy-person strong{font:13px/1.2 Georgia,serif;letter-spacing:0;overflow-wrap:anywhere}.genealogy-person span,.genealogy-person em{display:none}
.genealogy-person.event-lit{color:#3f5f53}.genealogy-person.event-lit:before{border-color:#a88a50;box-shadow:0 0 0 5px #cfbd802b,0 0 22px #cbbb864d}
.genealogy-person.selected{color:#254f43}.genealogy-person.selected:before{border-color:#416d61;box-shadow:0 0 0 5px #8bb19d36,0 0 25px #90b99c55}.genealogy-person.selected strong{font-weight:bold}
.genealogy-edge{font-size:13px;line-height:1.4;padding:4px 7px;border-radius:4px;border:1px solid #d9e2d5;background:#fafcf3ed;pointer-events:auto;box-shadow:0 2px 7px #324a3610;max-width:150px;white-space:normal;text-align:center;z-index:2}
@media(max-width:850px){#workspace{grid-template-rows:39px 110px minmax(300px,1fr)}#encounter{padding:4px 15px}.encounter-body{grid-template-columns:1fr 85px;grid-template-rows:1fr}#exhibit{min-height:0;height:100px}#exhibitPoster,#exhibitCanvas{height:90px}#personName h1{font-size:27px}#personName .name-ja,#personName .name-zh,#personName .name-latin{display:inline-block;font-size:10px;margin-right:7px}#artSource,#modelToggle{display:none!important}.tree-tools{width:auto!important;gap:8px!important}.genealogy-person{width:75px}.genealogy-person strong{font-size:11px}.genealogy-edge{font-size:12px;max-width:120px}}
body.people-open #treeWorld{opacity:.13;transition:opacity .6s}body.people-open .tree-heading{visibility:hidden}
@media(min-width:851px) and (orientation:landscape){#peopleLayer{top:calc(var(--exhibition-height) + 6px)}}
.genealogy-head{font-size:13px}.genealogy-edge{font-size:14px}.genealogy-person:not(.event-lit):not(.selected){color:#667767}
@media(max-width:600px){.genealogy-person:not(.event-lit):not(.selected) strong{display:none}.genealogy-person{width:64px}.genealogy-person:before{width:21px;height:21px}.genealogy-person img{width:19px;height:19px;left:calc(50% - 9px)}.genealogy-edge{font-size:12px;padding:3px 5px}}
.genealogy-head button[data-in],.genealogy-head button[data-out]{padding:4px 9px;font-size:14px}
#wikiBody>.eyebrow{display:none}.genealogy-person:hover span,.genealogy-person:focus-visible span,.genealogy-person:hover em,.genealogy-person:focus-visible em{display:block;background:#fafbf3e8;font-size:9px;color:#526c5d}
/* Visible artwork is now world-space geometry; DOM buttons are keyboard equivalents. */
.genealogy-stage{isolation:isolate}.genealogy-stage>canvas{pointer-events:none}.genealogy-cards{z-index:3}
.genealogy-person,.genealogy-person.selected{width:1px!important;height:1px!important;min-height:0!important;overflow:hidden!important;clip-path:inset(50%);padding:0!important;pointer-events:none;opacity:0}
.genealogy-person:focus-visible{width:120px!important;height:auto!important;clip-path:none;background:#fffdf1;padding:8px!important;pointer-events:auto;opacity:1;z-index:8}
.genealogy-person:before{display:none}.genealogy-head{z-index:5}.genealogy-head small{font-size:10px;color:#74836c}.genealogy-head output{display:inline-block;min-width:36px;text-align:center;font-size:10px;color:#647760}
canvas.ambient-backdrop{position:absolute;inset:0;width:100%;height:100%;z-index:0;pointer-events:none!important;opacity:1}
#treeCanvas,.genealogy-stage>canvas:not(.ambient-backdrop){z-index:1}
.genealogy-glass{background:#f5f7efb8}.genealogy-stage{inset:55px 12px 20px}
@media(max-width:600px){.genealogy-head{flex-wrap:wrap;gap:7px;top:8px}.genealogy-head>div{display:flex;gap:3px;align-items:center;width:100%;justify-content:space-between}.genealogy-head button{margin-left:0;padding:4px 7px;font-size:10px}.genealogy-stage{top:80px}.genealogy-head small{display:inline!important;font-size:9px}.genealogy-edge{max-width:120px}}
#peopleLayer[data-fallback=true] .genealogy-person{width:130px!important;height:auto!important;clip-path:none;overflow:visible!important;pointer-events:auto;opacity:1;background:#fafbef;border:1px solid #bacbbb;padding:7px!important;font-size:12px}
/* One continuous light field; remove stacked legacy glow animations. */
#workspace:before{animation:none!important;background:none!important;filter:none!important}
/* Relationship colors retain their meaning across all selections. */
.relation-legend{position:absolute;bottom:12px;left:24px;z-index:5;display:flex;gap:16px;pointer-events:none;padding:8px 12px;border-radius:20px;background:rgba(250,250,244,.86);font-size:11px;color:#555e54}
.relation-legend span{display:flex;align-items:center;gap:6px}.relation-legend span:before{content:'';width:18px;height:2px;background:var(--relation-color)}
.genealogy-edge{color:var(--relation-color,#58786b)!important;border-color:var(--relation-color,#879e93)!important;box-shadow:0 2px 9px #2b34280a!important}
@media(max-width:600px){.relation-legend{left:8px;bottom:8px;gap:9px;padding:7px;font-size:10px}.relation-legend span:before{width:10px}}
