/* R37 structural regions missing in R36. Scoped to these real PHP regions, not the mockup runtime. */
body.htc5-r34 .htc5-r37-tree-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(230px,25%);gap:16px;align-items:start}
body.htc5-r34 .htc5-r37-tree-layout>#htc5-tree-mount{min-width:0;max-width:100%;margin:0!important;width:100%!important}
body.htc5-r34 .htc5-r37-tree-shell,body.htc5-r34 .htc5-r37-member-shell{background:none!important;border:0!important;box-shadow:none!important}
body.htc5-r34 .htc5-r37-side{min-width:0;position:relative;text-align:left}
body.htc5-r34 .htc5-r37-head{display:flex;align-items:center;gap:10px}
body.htc5-r34 .htc5-r37-head .htc5-r34-icon-box{width:42px;height:42px;min-width:42px;flex:0 0 42px}
body.htc5-r34 .htc5-r37-head h2{font-size:clamp(22px,2vw,30px);margin:0;line-height:1.2}
body.htc5-r34 [data-r37-member-card]{display:grid;justify-items:start;gap:8px;min-width:0}
body.htc5-r34 [data-r37-member-card] h3,body.htc5-r34 [data-r37-member-card] p{margin:0;overflow-wrap:anywhere}
body.htc5-r34 [data-r37-member-card] img,body.htc5-r34 .htc5-r37-avatar-placeholder{display:grid;place-items:center;width:76px;height:76px;border-radius:15.2px;object-fit:cover;background:var(--r34-plate);color:var(--r34-gold);border:1px solid var(--r34-line);margin-bottom:3px}
body.htc5-r34 .htc5-r37-tree-lower,body.htc5-r34 .htc5-r37-member-footer{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:16px;margin:16px 0;align-items:start}
body.htc5-r34 .htc5-r37-generations{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(115px,100%),1fr));gap:9px}
body.htc5-r34 .htc5-r37-generations>article,body.htc5-r34 .htc5-r37-overview>article{min-width:0;display:grid;gap:4px;padding:12px;background:var(--r34-inner);border:1px solid var(--r34-card-line);border-radius:10px;overflow-wrap:anywhere}
body.htc5-r34 .htc5-r37-generations strong,body.htc5-r34 .htc5-r37-overview strong{font:700 28px/1.1 'Baloo 2','Nunito Sans',sans-serif;color:var(--r34-title)}
body.htc5-r34 .htc5-r37-generations small{font-size:12px;color:var(--r34-muted)}
body.htc5-r34 .htc5-r37-legend{display:grid;gap:13px}
body.htc5-r34 .htc5-r37-legend>div{display:flex;align-items:center;gap:12px;font-size:13px}
body.htc5-r34 .r37-key{display:block;width:30px;flex:0 0 30px;height:24px}.r37-key.selected{border:2px solid #c49b3f;border-radius:5px;background:#fbf3dc}.r37-key.marriage{color:#a87d35;font-size:25px;line-height:1;text-align:center}.r37-key.parent,.r37-key.adopted{height:0;border-top:2px solid #ad925d}.r37-key.adopted{border-top-style:dashed}
body.htc5-r34 .htc5-r37-overview{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(145px,100%),1fr));gap:10px;margin:14px 0}
body.htc5-r34 .htc5-r37-overview a{font-size:13px;text-decoration:underline}
body.htc5-r34 .htc5-r37-tool-list{display:flex;flex-wrap:wrap;gap:10px;align-items:start}
body.htc5-r34 .htc5-r37-account-pane .htc5-r36-controls{display:flex;align-items:end}.htc5-r37-account-pane .htc5-r36-controls label{margin-bottom:0!important}
body.htc5-r34 .htc5-r37-member-footer details{border-bottom:1px solid var(--r34-card-line);padding:8px 0}body.htc5-r34 .htc5-r37-member-footer details summary{cursor:pointer;font-weight:700}
/* Real directory: filters relocated rather than duplicated, original event hooks stay on the same section. */
body.htc5-r34 .gpc5-r37-directory-layout{display:grid;grid-template-columns:minmax(195px,24%) minmax(0,1fr);gap:16px;align-items:start}
body.htc5-r34 .gpc5-r37-directory-side,body.htc5-r34 .gpc5-r37-directory-main{min-width:0;background:var(--r34-paper);border:1px solid var(--r34-line);border-radius:10px;padding:clamp(12px,1.6vw,22px)}
body.htc5-r34 .gpc5-r37-directory-side>h3,body.htc5-r34 .gpc5-r37-directory-main>h3{font:700 28px/1.2 Charm,Georgia,serif!important;margin:0 0 12px;color:var(--r34-title)}
body.htc5-r34 .gpc5-r37-directory-side .gpc5-directory-filters{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:10px!important;margin:0 0 10px!important;padding:0!important;min-width:0}
body.htc5-r34 .gpc5-r37-directory-side .gpc5-directory-filters>*{min-width:0!important;max-width:100%;width:100%!important}
body.htc5-r34 .gpc5-r37-directory-main .gpc5-directory-grid{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(min(185px,100%),1fr))!important;gap:12px}
body.htc5-r34 .gpc5-r37-directory-main .gpc5-directory-card[hidden]{display:none!important}
body.htc5-r34 .gpc5-r37-directory-side .gpc5-r37-filter-help{margin:10px 0;font-size:12px;color:var(--r34-muted)}
/* Calendar and community; no duplicate events, original editing dialogs stay in community root. */
body.htc5-r34 .gpc5-r37-community-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin:0 0 16px}
body.htc5-r34 .gpc5-r37-community-stats article{min-width:0;display:flex;align-items:center;gap:11px;background:var(--r34-paper);border:1px solid var(--r34-line);border-radius:10px;padding:15px;overflow-wrap:anywhere}
body.htc5-r34 .gpc5-r37-icon-plate{display:grid;place-items:center;width:48px;height:48px;flex:0 0 48px;border:1px solid var(--r34-plate-line);border-radius:9.6px;background:var(--r34-plate);color:var(--r34-gold)}
body.htc5-r34 .gpc5-r37-community-stats article>div{display:grid;min-width:0;gap:2px;font-size:13px}
body.htc5-r34 .gpc5-r37-community-stats strong{font:700 30px/1.1 'Baloo 2','Nunito Sans',sans-serif;color:var(--r34-title)}
body.htc5-r34 .gpc5-r37-community-stats small{font-size:11px;color:var(--r34-muted)}
body.htc5-r34 .gpc5-r37-calendar-layout{display:grid;grid-template-columns:minmax(255px,32%) minmax(0,1fr);gap:16px;align-items:start;margin-top:12px}
body.htc5-r34 .gpc5-r37-calendar,body.htc5-r34 .gpc5-r37-calendar-list,body.htc5-r34 .gpc5-r37-community-footer>section{min-width:0;background:var(--r34-paper);border:1px solid var(--r34-line);border-radius:10px;padding:clamp(12px,1.4vw,20px)}
body.htc5-r34 .gpc5-r37-calendar h3,body.htc5-r34 .gpc5-r37-calendar-list h3,body.htc5-r34 .gpc5-r37-community-footer h3{font:700 26px/1.2 Charm,Georgia,serif!important;color:var(--r34-title);margin:0 0 12px}
body.htc5-r34 .gpc5-r37-cal-controls{display:flex;justify-content:space-between;align-items:center;gap:5px;margin-bottom:10px}
body.htc5-r34 .gpc5-r37-cal-controls button{display:grid;place-items:center;width:34px;height:34px;background:var(--r34-control);border:1px solid var(--r34-line);border-radius:6.8px;color:var(--r34-title);font-size:22px;padding:0}
body.htc5-r34 .gpc5-r37-cal-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;align-items:center;text-align:center;margin-bottom:16px;font-size:12px}
body.htc5-r34 .gpc5-r37-cal-grid>*{display:grid;min-width:0;min-height:28px;place-items:center;position:relative}
body.htc5-r34 .gpc5-r37-cal-grid .r37-day{border:1px solid var(--r34-card-line);border-radius:5.6px;background:var(--r34-field);color:var(--r34-copy);padding:3px 0;font:inherit}
body.htc5-r34 .gpc5-r37-cal-grid button.r37-day{font-weight:800;color:#67431e;background:#ead7ac;cursor:pointer;border-color:#b99a63}
body.htc5-r34 .gpc5-r37-cal-grid .r37-today{outline:2px solid #ac7b28;outline-offset:-2px}
body.htc5-r34 .gpc5-r37-cal-grid .r37-day[aria-pressed=true]{background:var(--r34-primary);color:#fff9eb}
body.htc5-r34 [data-r37-cal-events]{display:grid;gap:6px;font-size:13px;max-height:280px;overflow-y:auto}
body.htc5-r34 [data-r37-cal-events] button{display:flex;align-items:flex-start;gap:8px;text-align:left;border:1px solid var(--r34-card-line);background:var(--r34-control);color:var(--r34-title);padding:8px;border-radius:7px;font:inherit;overflow-wrap:anywhere}
body.htc5-r34 .gpc5-r37-cal-note{font-size:11px;color:var(--r34-muted);margin:12px 0 0}
body.htc5-r34 .gpc5-r37-calendar-list .gpc5-mem-filters{flex-wrap:wrap;min-width:0}
body.htc5-r34 .gpc5-r37-calendar-list .gpc5-community-memorial-list{grid-template-columns:minmax(0,1fr)!important}
body.htc5-r34 .gpc5-r37-calendar-list .gpc5-mem-main{min-width:0;flex-wrap:wrap}
body.htc5-r34 .gpc5-r37-community-footer{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:16px 0}
body.htc5-r34 .gpc5-r37-community-footer a,body.htc5-r34 .gpc5-r37-directory-side>a{color:var(--r34-title);font-weight:700;text-decoration:underline}
/* Shrine feature, tab sections and evidence gallery; scoped to actual shrine records. */
body.htc5-r34 .r37-shrine-record{display:grid;gap:14px;min-width:0;margin-bottom:18px}
body.htc5-r34 .r37-shrine-record>.r36-shrine-feature{margin:0!important}
body.htc5-r34 .r37-shrine-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
body.htc5-r34 .r37-shrine-stats>div{display:flex;gap:10px;align-items:center;padding:14px;min-width:0;background:var(--r34-paper);border:1px solid var(--r34-line);border-radius:10px;overflow-wrap:anywhere}
body.htc5-r34 .r37-shrine-stats strong{display:block;font-size:17px;color:var(--r34-title);line-height:1.35}
body.htc5-r34 .r37-shrine-tabs,.r37-shrine-gallery{min-width:0;background:var(--r34-paper);border:1px solid var(--r34-line);border-radius:10px;padding:clamp(12px,2vw,22px)}
body.htc5-r34 .r37-shrine-tabnav{display:flex;flex-wrap:wrap;gap:8px;border-bottom:1px solid var(--r34-line);padding-bottom:14px;margin-bottom:14px}
body.htc5-r34 .r37-shrine-tabnav button{min-width:0;display:inline-flex;gap:7px;align-items:center;padding:10px 14px;border:1px solid var(--r34-line);border-radius:8px;background:var(--r34-control);color:var(--r34-title);font-weight:700}
body.htc5-r34 .r37-shrine-tabnav button[aria-selected=true]{background:var(--r34-primary);color:#fff9eb}
body.htc5-r34 .r37-shrine-tabpanel{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:start}
body.htc5-r34 .r37-shrine-tabpanel[hidden]{display:none!important}
body.htc5-r34 .r37-shrine-tabpanel>section{min-width:0;border:1px solid var(--r34-card-line);border-radius:9px;background:var(--r34-inner);padding:14px;overflow-wrap:anywhere}
body.htc5-r34 .r37-shrine-tabpanel h3,.r37-shrine-gallery h2{font:700 26px/1.2 Charm,Georgia,serif!important;margin:0 0 10px;color:var(--r34-title)}
body.htc5-r34 .r37-shrine-tabpanel .r37-shrine-map{grid-column:span 2}.r37-shrine-map iframe{width:100%;height:250px;display:block;border:0;border-radius:9px}
body.htc5-r34 .r37-shrine-gallery-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
body.htc5-r34 .r37-shrine-gallery-grid article{min-width:0;border:1px solid var(--r34-card-line);border-radius:9px;overflow:hidden;padding:12px;background:var(--r34-inner)}
body.htc5-r34 .r37-shrine-gallery-grid img{width:100%;height:auto;max-height:210px;object-fit:contain;border-radius:8px}
/* Respect hidden on actual panes. Keep dialogs, geometry and controls unchanged. */
body.htc5-r34 .htc5-account-edit>[hidden],body.htc5-r34 .htc5-account-settings>[hidden]{display:none!important}
@media(max-width:1100px){body.htc5-r34 .htc5-r37-tree-layout{grid-template-columns:minmax(0,1fr) minmax(205px,25%)}body.htc5-r34 .gpc5-r37-community-stats,body.htc5-r34 .r37-shrine-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:900px){body.htc5-r34 .htc5-r37-tree-layout,body.htc5-r34 .htc5-r37-tree-lower,body.htc5-r34 .htc5-r37-member-footer,body.htc5-r34 .gpc5-r37-directory-layout,body.htc5-r34 .gpc5-r37-calendar-layout{grid-template-columns:minmax(0,1fr)}body.htc5-r34 .gpc5-r37-directory-side .gpc5-directory-filters{grid-template-columns:repeat(2,minmax(0,1fr))!important}body.htc5-r34 .gpc5-r37-directory-side .gpc5-directory-search{grid-column:1/-1}body.htc5-r34 .r37-shrine-tabpanel,body.htc5-r34 .gpc5-r37-community-footer{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){body.htc5-r34 .r37-shrine-tabpanel,body.htc5-r34 .r37-shrine-gallery-grid,body.htc5-r34 .gpc5-r37-community-footer{grid-template-columns:minmax(0,1fr)}body.htc5-r34 .r37-shrine-tabpanel .r37-shrine-map{grid-column:auto}body.htc5-r34 .gpc5-r37-community-stats article,body.htc5-r34 .r37-shrine-stats>div{gap:7px;padding:9px;align-items:flex-start}body.htc5-r34 .gpc5-r37-icon-plate{width:34px;height:34px;flex-basis:34px;border-radius:6.8px}body.htc5-r34 .gpc5-r37-community-stats strong{font-size:23px}body.htc5-r34 .r37-shrine-stats strong{font-size:14px}body.htc5-r34 .htc5-r37-tree-layout .gpc5-canvas{max-width:100%;min-width:0}body.htc5-r34 .r37-shrine-tabnav button{flex:1 1 40%;justify-content:center;padding:8px 5px;font-size:12px}}
body.htc5-r34 .htc5-r37-banner-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px;max-width:100%}
body.htc5-r34 .htc5-r37-banner-actions>a{display:inline-flex!important;visibility:visible!important;opacity:1!important;font-size:14px;min-height:44px;max-width:100%;white-space:normal}
body.htc5-r34 .gpc5-r37-linked-person{display:flex;gap:13px;align-items:center;padding:14px;border:1px solid var(--r34-card-line);border-radius:10px;background:var(--r34-inner);margin:0 0 15px}
body.htc5-r34 .gpc5-r37-linked-person>span{flex:0 0 64px;min-width:0}
body.htc5-r34 .gpc5-r37-linked-person img,body.htc5-r34 .gpc5-r37-linked-person .gpc5-member-placeholder{width:64px;height:64px;display:grid;place-items:center;border-radius:12.8px!important;object-fit:cover}
body.htc5-r34 .gpc5-r37-linked-person h3{margin:2px 0 4px;font-size:20px;overflow-wrap:anywhere}
body.htc5-r34 .gpc5-r37-linked-person a{color:var(--r34-title);text-decoration:underline;font-size:13px}
@media(max-width:600px){body.htc5-r34 .htc5-r37-banner-actions{gap:7px}body.htc5-r34 .htc5-r37-banner-actions>a{padding:9px 10px;font-size:12px;min-height:38px}}
/* The legacy tree uses a viewport-wide breakout. Within the two-column R34 layout
 * it must use the grid track, except in genuine fullscreen mode. */
body.htc5-r34 .htc5-r37-tree-layout #htc5-tree-mount .gpc5-tree:not(:fullscreen){width:100%!important;max-width:100%!important;min-width:0!important;left:auto!important;transform:none!important;margin:0!important}
body.htc5-r34 .htc5-r37-tree-layout .gpc5-tree:not(:fullscreen) .gpc5-canvas{min-width:0!important;max-width:100%!important;width:100%!important}
body.htc5-r34 .htc5-r37-tree-layout .gpc5-tree .gpc5-controls-row{max-width:100%;min-width:0;flex-wrap:wrap!important}
body.htc5-r34 .htc5-r37-tree-layout .gpc5-tree .gpc5-root-trigger{background:var(--r34-control)!important;border-color:var(--r34-line)!important;color:var(--r34-title)!important;box-shadow:none!important;min-width:0!important;max-width:100%!important}
body.htc5-r34 .htc5-r37-tree-layout .gpc5-tree .gpc5-zoom-group{background:var(--r34-inner)!important;border-color:var(--r34-line)!important}
body.htc5-r34 .htc5-r37-tree-layout .gpc5-tree .gpc5-zoom-group input{accent-color:var(--r34-primary)!important}
body.htc5-r34 .gpc5-r37-directory-main .gpc5-content,body.htc5-r34 .gpc5-r37-directory-main{min-width:0}
body.htc5-r34 .gpc5-content.gpc5-directory .gpc5-r37-directory-main a.gpc5-directory-card .gpc5-directory-card-head{display:flex!important;flex-wrap:wrap;align-items:flex-start;gap:8px;min-width:0}
body.htc5-r34 .gpc5-content.gpc5-directory .gpc5-r37-directory-main a.gpc5-directory-card .gpc5-directory-card-head>.gpc5-directory-gen{min-width:0!important;max-width:100%;white-space:normal;overflow-wrap:anywhere;align-self:flex-start}
