/* Pass 29 — National Heritage Atlas Foundation */
.page-heritage-atlas,
.page-heritage-layer {
    --heritage-ink: #0b2338;
    --heritage-deep: #081c2c;
    --heritage-paper: #f4efe4;
    --heritage-gold: #f3c62f;
    --heritage-line: rgba(11,35,56,.16);
}
.heritage-hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 78% 24%, rgba(243,198,47,.23), transparent 28rem),
        linear-gradient(132deg,#071a2a 0%,#0a3558 58%,#0b4f62 100%);
    padding: clamp(5.5rem,9vw,9.5rem) 0 clamp(4rem,7vw,7rem);
}
.heritage-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .22;
    background-image: linear-gradient(rgba(255,255,255,.08) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.08) 1px,transparent 1px);
    background-size: 54px 54px;
    mask-image: linear-gradient(to right,transparent 0,#000 45%,#000 100%);
}
.heritage-hero__grid { position: relative; display: grid; grid-template-columns: minmax(0,1.2fr) minmax(19rem,.8fr); gap: clamp(2rem,6vw,7rem); align-items: end; }
.heritage-hero h1 { max-width: 13ch; margin: .5rem 0 1.5rem; font-size: clamp(3.5rem,8.3vw,8.4rem); line-height: .88; letter-spacing: -.065em; }
.heritage-hero h1 em { color: var(--heritage-gold); font-style: normal; }
.heritage-hero__grid > div > p:not(.eyebrow) { max-width: 50rem; font-size: clamp(1.08rem,1.6vw,1.45rem); line-height: 1.6; color: rgba(255,255,255,.82); }
.heritage-hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }
.heritage-hero__manifest { display: grid; grid-template-columns: auto 1fr; gap: .55rem .9rem; align-items: center; padding: 1.3rem; border: 1px solid rgba(255,255,255,.2); background: rgba(4,19,31,.5); backdrop-filter: blur(16px); box-shadow: 0 24px 70px rgba(0,0,0,.24); }
.heritage-hero__manifest span { color: #fff; font-size: .72rem; letter-spacing: .16em; font-weight: 800; }
.heritage-hero__manifest i { display: block; height: 1px; background: linear-gradient(90deg,var(--heritage-gold),transparent); }
.heritage-hero__manifest p { grid-column: 1/-1; margin: .8rem 0 0; color: rgba(255,255,255,.72); line-height: 1.55; font-size: .92rem; }
.heritage-metrics { margin-top: -2rem; position: relative; z-index: 2; }
.heritage-metrics__grid { display: grid; grid-template-columns: repeat(4,1fr); background: #fff; border: 1px solid var(--heritage-line); box-shadow: 0 22px 65px rgba(9,34,53,.13); }
.heritage-metrics article { padding: 1.5rem; min-height: 9.5rem; display: flex; flex-direction: column; border-right: 1px solid var(--heritage-line); }
.heritage-metrics article:last-child { border-right: 0; }
.heritage-metrics span { color: #5e6e78; font-size: .77rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.heritage-metrics strong { margin: auto 0 .25rem; font-size: clamp(2.2rem,4vw,4.4rem); letter-spacing: -.05em; color: var(--heritage-ink); }
.heritage-metrics small { color: #72808a; line-height: 1.35; }
.heritage-layers { padding: clamp(5rem,8vw,9rem) 0; background: #f7f4ed; }
.heritage-section-head { display: grid; grid-template-columns: 1fr minmax(20rem,.72fr); gap: 3rem; align-items: end; margin-bottom: 2.8rem; }
.heritage-section-head h2 { max-width: 14ch; margin: .35rem 0 0; font-size: clamp(2.35rem,5vw,5.2rem); line-height: .98; letter-spacing: -.055em; color: var(--heritage-ink); }
.heritage-section-head > p { margin: 0; color: #55646f; line-height: 1.75; font-size: 1.05rem; }
.heritage-layer-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.heritage-layer-card { --card-accent: #0b5b7d; position: relative; overflow: hidden; min-height: 29rem; padding: clamp(1.4rem,3vw,2.2rem); display: flex; flex-direction: column; background: #fff; border: 1px solid rgba(11,35,56,.14); box-shadow: 0 16px 44px rgba(10,33,49,.07); }
.heritage-layer-card::before { content:""; position:absolute; inset:0 auto 0 0; width:.42rem; background: var(--card-accent); }
.heritage-layer-card--gold { --card-accent:#dca800; }.heritage-layer-card--red { --card-accent:#a83c34; }.heritage-layer-card--berry { --card-accent:#7e345b; }.heritage-layer-card--pine { --card-accent:#1f654f; }.heritage-layer-card--blue { --card-accent:#205f98; }.heritage-layer-card--green { --card-accent:#3e7c43; }.heritage-layer-card--ink { --card-accent:#152d40; }
.heritage-layer-card.is-planned { background: repeating-linear-gradient(135deg,#fff,#fff 18px,#faf8f2 18px,#faf8f2 36px); }
.heritage-layer-card header { display:flex; justify-content:space-between; gap:1rem; color:#687782; }
.heritage-layer-card header span { font-size:1.8rem; color:var(--card-accent); font-weight:850; }
.heritage-layer-card header small { font-size:.69rem; letter-spacing:.14em; font-weight:850; }
.heritage-layer-card h3 { margin: 2.5rem 0 1rem; max-width: 15ch; font-size: clamp(2rem,4vw,4rem); line-height:.95; letter-spacing:-.05em; }
.heritage-layer-card h3 a { color:var(--heritage-ink); text-decoration:none; }
.heritage-layer-card > p { max-width: 45rem; color:#56656f; line-height:1.65; }
.heritage-layer-card ul { display:flex; flex-wrap:wrap; gap:.45rem; list-style:none; padding:0; margin:1.3rem 0; }
.heritage-layer-card li { padding:.45rem .65rem; background:#f2eee5; border:1px solid rgba(11,35,56,.1); font-size:.79rem; }
.heritage-layer-card dl { margin:auto 0 1.4rem; display:grid; grid-template-columns:repeat(3,1fr); border-top:1px solid var(--heritage-line); border-bottom:1px solid var(--heritage-line); }
.heritage-layer-card dl div { padding:1rem .7rem; border-right:1px solid var(--heritage-line); }
.heritage-layer-card dl div:last-child { border-right:0; }
.heritage-layer-card dt { font-size:.67rem; text-transform:uppercase; letter-spacing:.1em; color:#75828b; }
.heritage-layer-card dd { margin:.35rem 0 0; color:var(--heritage-ink); font-weight:800; line-height:1.25; }
.heritage-layer-card footer { display:flex; flex-wrap:wrap; gap:.65rem; }
.heritage-layer-card footer a { color:var(--heritage-ink); font-weight:800; text-decoration:none; border-bottom:2px solid var(--card-accent); padding-bottom:.25rem; }
.heritage-pipeline { padding: clamp(5rem,9vw,10rem) 0; color:#fff; background:#081d2e; }
.heritage-section-head--inverse h2 { color:#fff; }.heritage-section-head--inverse > p { color:rgba(255,255,255,.68); }
.heritage-pipeline__steps { list-style:none; padding:0; margin:0; display:grid; grid-template-columns:repeat(5,1fr); border-top:1px solid rgba(255,255,255,.16); border-bottom:1px solid rgba(255,255,255,.16); }
.heritage-pipeline__steps li { min-height:22rem; padding:1.4rem; border-right:1px solid rgba(255,255,255,.14); }
.heritage-pipeline__steps li:last-child { border-right:0; }
.heritage-pipeline__steps span { display:block; color:var(--heritage-gold); font-size:2.2rem; font-weight:900; }
.heritage-pipeline__steps h3 { margin:5rem 0 .8rem; font-size:1.35rem; }
.heritage-pipeline__steps p { color:rgba(255,255,255,.66); line-height:1.6; }
.heritage-safety { padding:clamp(5rem,8vw,9rem) 0; background:var(--heritage-paper); }
.heritage-safety__grid { display:grid; grid-template-columns:1fr 1fr; gap:clamp(3rem,8vw,9rem); }
.heritage-safety h2 { margin:.4rem 0 0; font-size:clamp(2.8rem,5.5vw,5.6rem); line-height:.93; letter-spacing:-.06em; color:var(--heritage-ink); }
.heritage-safety__grid > div:last-child { padding-top:2rem; }
.heritage-safety p { color:#4f616c; line-height:1.8; font-size:1.08rem; }
.heritage-safety a { color:var(--heritage-ink); font-weight:850; }

.heritage-layer-hero { color:#fff; padding:clamp(5rem,8vw,8rem) 0 4rem; background:linear-gradient(132deg,#081d2e,#0b4867); }
.heritage-layer-hero--gold { background:linear-gradient(132deg,#3c2d05,#8c6400); }.heritage-layer-hero--red { background:linear-gradient(132deg,#361311,#8f342d); }.heritage-layer-hero--berry { background:linear-gradient(132deg,#2b1022,#733153); }.heritage-layer-hero--pine,.heritage-layer-hero--green { background:linear-gradient(132deg,#0b2f27,#2f6f4d); }.heritage-layer-hero--blue { background:linear-gradient(132deg,#0a2443,#235f99); }.heritage-layer-hero--ink { background:linear-gradient(132deg,#071622,#1d394d); }
.heritage-layer-hero h1 { margin:.7rem 0 1.2rem; max-width:15ch; font-size:clamp(3.5rem,8vw,8rem); line-height:.9; letter-spacing:-.065em; }
.heritage-layer-hero > .shell > p:not(.eyebrow) { max-width:58rem; font-size:1.24rem; line-height:1.65; color:rgba(255,255,255,.8); }
.heritage-layer-hero__meta { display:flex; flex-wrap:wrap; gap:.55rem; margin-top:2rem; }
.heritage-layer-hero__meta span { padding:.55rem .75rem; border:1px solid rgba(255,255,255,.25); background:rgba(0,0,0,.12); font-size:.78rem; text-transform:uppercase; letter-spacing:.09em; }
.heritage-question-strip { background:#f3c62f; }
.heritage-question-strip .shell { display:flex; flex-wrap:wrap; align-items:center; gap:.6rem; padding-top:.8rem; padding-bottom:.8rem; }
.heritage-question-strip span { margin-right:.5rem; font-size:.72rem; font-weight:900; letter-spacing:.12em; text-transform:uppercase; }
.heritage-question-strip a { color:#0b2338; background:rgba(255,255,255,.48); padding:.48rem .68rem; font-weight:750; text-decoration:none; }
.heritage-layer-workspace { padding:clamp(3rem,6vw,7rem) 0; background:#f7f4ed; }
.heritage-layer-toolbar { display:grid; grid-template-columns:1fr auto; gap:2rem; align-items:end; margin-bottom:2rem; }
.heritage-layer-toolbar form { display:flex; flex-wrap:wrap; gap:.75rem; align-items:end; }
.heritage-layer-toolbar label { display:grid; gap:.35rem; color:#52636e; font-size:.76rem; font-weight:800; text-transform:uppercase; letter-spacing:.08em; }
.heritage-layer-toolbar input,.heritage-layer-toolbar select { min-width:14rem; border:1px solid rgba(11,35,56,.22); background:#fff; padding:.8rem; color:#0b2338; }
.heritage-layer-toolbar nav { display:flex; flex-direction:column; align-items:flex-end; gap:.5rem; }
.heritage-layer-toolbar a { color:#0b3558; font-weight:800; }
.heritage-planned-note { padding:1.3rem 1.5rem; margin:0 0 2rem; border-left:.4rem solid #dca800; background:#fff8dd; color:#3f3a29; }
.heritage-planned-note p { margin:.35rem 0 0; line-height:1.6; }
.heritage-object-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1rem; }
.heritage-object-card { min-height:27rem; display:flex; flex-direction:column; padding:1.35rem; background:#fff; border:1px solid var(--heritage-line); }
.heritage-object-card header { display:flex; justify-content:space-between; color:#71808a; }
.heritage-object-card header span { color:#d4a400; font-size:1.4rem; font-weight:900; }
.heritage-object-card header small { font-size:.7rem; letter-spacing:.11em; text-transform:uppercase; }
.heritage-object-card h2 { margin:2.4rem 0 .9rem; font-size:clamp(1.65rem,2.7vw,2.7rem); line-height:1; letter-spacing:-.045em; }
.heritage-object-card h2 a { color:var(--heritage-ink); text-decoration:none; }
.heritage-object-card > p { color:#5a6973; line-height:1.6; }
.heritage-object-card dl { margin:auto 0 1.2rem; border-top:1px solid var(--heritage-line); }
.heritage-object-card dl div { display:grid; grid-template-columns:6.5rem 1fr; gap:.6rem; padding:.55rem 0; border-bottom:1px solid rgba(11,35,56,.08); }
.heritage-object-card dt { color:#75828a; font-size:.72rem; text-transform:uppercase; letter-spacing:.08em; }
.heritage-object-card dd { margin:0; font-weight:700; color:#1c3547; }
.heritage-object-card footer a { color:#0b3558; font-weight:850; }
.heritage-empty { min-height:24rem; display:grid; grid-template-columns:auto 1fr; gap:2rem; align-items:center; padding:clamp(2rem,5vw,5rem); background:#fff; border:1px solid var(--heritage-line); }
.heritage-empty > span { font-size:clamp(5rem,13vw,13rem); line-height:.8; color:#e2ddd1; font-weight:900; }
.heritage-empty h2 { margin:.3rem 0 1rem; font-size:clamp(2.2rem,5vw,5rem); line-height:.95; letter-spacing:-.055em; color:var(--heritage-ink); }
.heritage-empty p { max-width:50rem; color:#5a6973; line-height:1.7; }
.heritage-gates { margin-top:3rem; display:grid; grid-template-columns:1fr 1fr; gap:3rem; padding:clamp(2rem,5vw,4rem); color:#fff; background:#0a263b; }
.heritage-gates h2 { margin:.3rem 0 .8rem; font-size:clamp(2.3rem,4.5vw,4.7rem); line-height:.95; letter-spacing:-.05em; }
.heritage-gates p { color:rgba(255,255,255,.66); }
.heritage-gates ol { margin:0; display:grid; gap:.55rem; counter-reset:gates; }
.heritage-gates li { padding:.65rem .8rem; background:rgba(255,255,255,.08); color:rgba(255,255,255,.86); }

.heritage-admin-contract pre { white-space:pre-wrap; }

@media (max-width: 1050px) {
    .heritage-metrics__grid { grid-template-columns:repeat(2,1fr); }
    .heritage-metrics article:nth-child(2) { border-right:0; }
    .heritage-metrics article:nth-child(-n+2) { border-bottom:1px solid var(--heritage-line); }
    .heritage-pipeline__steps { grid-template-columns:repeat(2,1fr); }
    .heritage-pipeline__steps li { min-height:18rem; border-bottom:1px solid rgba(255,255,255,.14); }
    .heritage-pipeline__steps h3 { margin-top:3rem; }
    .heritage-object-grid { grid-template-columns:repeat(2,1fr); }
}
@media (max-width: 760px) {
    .heritage-hero__grid,.heritage-section-head,.heritage-safety__grid,.heritage-layer-toolbar,.heritage-gates { grid-template-columns:1fr; }
    .heritage-hero__manifest { margin-top:1rem; }
    .heritage-metrics { margin-top:0; }
    .heritage-metrics__grid,.heritage-layer-grid,.heritage-object-grid,.heritage-pipeline__steps { grid-template-columns:1fr; }
    .heritage-metrics article { border-right:0; border-bottom:1px solid var(--heritage-line); }
    .heritage-layer-card { min-height:auto; }
    .heritage-layer-card dl { grid-template-columns:1fr; }
    .heritage-layer-card dl div { border-right:0; border-bottom:1px solid var(--heritage-line); }
    .heritage-layer-card dl div:last-child { border-bottom:0; }
    .heritage-pipeline__steps li { min-height:auto; border-right:0; }
    .heritage-pipeline__steps h3 { margin-top:2rem; }
    .heritage-layer-toolbar nav { align-items:flex-start; }
    .heritage-layer-toolbar input,.heritage-layer-toolbar select { min-width:min(100%,20rem); width:100%; }
    .heritage-empty { grid-template-columns:1fr; }
    .heritage-empty > span { font-size:5rem; }
}
@media (prefers-reduced-motion: reduce) {
    .heritage-layer-card,.heritage-object-card { scroll-behavior:auto; }
}

/* Pass 29 integration: map layer switcher and canonical entity heritage profile */
.map-heritage-layers {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .45rem;
    margin: .8rem 0 1rem;
    padding: .75rem;
    border: 1px solid rgba(11,35,56,.14);
    background: #f5f0e5;
}
.map-heritage-layers span { margin-right: .3rem; font-size: .7rem; font-weight: 900; letter-spacing: .12em; color: #536672; }
.map-heritage-layers a { padding: .45rem .65rem; color: #0b3558; background: #fff; border: 1px solid rgba(11,35,56,.12); text-decoration: none; font-size: .78rem; font-weight: 800; }
.map-heritage-layers a[aria-current="page"] { color: #081c2c; background: #f3c62f; border-color: #d2a500; }
.entity-heritage-profile { padding: clamp(3.5rem,7vw,7rem) 0; color: #fff; background: linear-gradient(132deg,#071b2b,#103e58 64%,#1f654f); }
.entity-heritage-profile__grid { display: grid; grid-template-columns: minmax(0,1.05fr) minmax(17rem,.72fr) minmax(19rem,.85fr); gap: clamp(1rem,3vw,2rem); align-items: start; }
.entity-heritage-profile__intro h2 { max-width: 12ch; margin: .35rem 0 1rem; font-size: clamp(2.6rem,5vw,5.3rem); line-height: .94; letter-spacing: -.055em; }
.entity-heritage-profile__intro > p:not(.eyebrow) { max-width: 45rem; color: rgba(255,255,255,.72); line-height: 1.7; }
.entity-heritage-profile__layers { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.5rem; }
.entity-heritage-chip { --chip:#f3c62f; display: grid; gap: .15rem; min-width: 12rem; padding: .75rem .9rem; color: #fff; border: 1px solid rgba(255,255,255,.18); border-left: .35rem solid var(--chip); background: rgba(0,0,0,.16); text-decoration: none; }
.entity-heritage-chip--red { --chip:#d15c50; }.entity-heritage-chip--berry { --chip:#d476a6; }.entity-heritage-chip--pine,.entity-heritage-chip--green { --chip:#7bc3a4; }.entity-heritage-chip--blue { --chip:#77b8ef; }.entity-heritage-chip--ink { --chip:#c1d3df; }
.entity-heritage-chip span { color: rgba(255,255,255,.62); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; }
.entity-heritage-chip strong { font-size: .86rem; }
.entity-heritage-profile__classification,
.entity-heritage-profile__protection { padding: 1.15rem; border: 1px solid rgba(255,255,255,.18); background: rgba(2,17,27,.38); }
.entity-heritage-profile__classification > span,
.entity-heritage-profile__protection > header span { font-size: .7rem; font-weight: 900; letter-spacing: .13em; color: #f3c62f; }
.entity-heritage-profile__classification article { padding: 1rem 0; border-bottom: 1px solid rgba(255,255,255,.13); }
.entity-heritage-profile__classification article:last-child { border-bottom: 0; }
.entity-heritage-profile__classification article header,
.entity-heritage-profile__protection > header { display: flex; justify-content: space-between; gap: 1rem; }
.entity-heritage-profile__classification article header b { color: #f3c62f; }
.entity-heritage-profile__classification p { margin: .55rem 0; color: rgba(255,255,255,.68); line-height: 1.55; font-size: .9rem; }
.entity-heritage-profile__classification small { color: rgba(255,255,255,.52); }
.entity-heritage-profile__protection > header strong { font-size: 2rem; }
.entity-heritage-profile__protection article { margin-top: .8rem; padding: .9rem; color: #0b2338; background: #fff; }
.entity-heritage-profile__protection h3 { margin: .2rem 0 .7rem; font-size: 1.05rem; }
.entity-heritage-profile__protection article small { color: #687985; font-size: .67rem; letter-spacing: .09em; text-transform: uppercase; }
.entity-heritage-profile__protection dl { display: grid; gap: .35rem; margin: .8rem 0; }
.entity-heritage-profile__protection dl div { display: grid; grid-template-columns: 5rem 1fr; gap: .6rem; }
.entity-heritage-profile__protection dt { color: #75848d; font-size: .7rem; text-transform: uppercase; }
.entity-heritage-profile__protection dd { margin: 0; font-size: .84rem; font-weight: 750; }
.entity-heritage-profile__protection a { color: #0b4e72; font-weight: 850; font-size: .82rem; }
.entity-heritage-profile__empty { margin: 1rem 0 0; color: rgba(255,255,255,.67); line-height: 1.6; }
@media (max-width: 1050px) { .entity-heritage-profile__grid { grid-template-columns: 1fr 1fr; } .entity-heritage-profile__intro { grid-column: 1/-1; } }
@media (max-width: 700px) { .entity-heritage-profile__grid { grid-template-columns: 1fr; } .entity-heritage-profile__intro { grid-column: auto; } .map-heritage-layers { align-items: stretch; } .map-heritage-layers a { flex: 1 1 9rem; text-align: center; } }
