
.atlas-hero {
  position: relative; isolation: isolate; overflow: hidden; min-height: 260px; display: grid; align-items: center;
  border: 1px solid #69887770; border-radius: 22px; background: #102a22;
  color: #fffcf1; margin-block: 12px 0;
}
.atlas-hero-art { position: absolute; inset: 0 0 0 30%; z-index: -2; }
.atlas-hero-art .media-frame { max-height: none; border-radius: 0; }
.atlas-hero-art .frame-crop-note { inset: auto 7px 28px auto; }
.atlas-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, #102a22 8%, #102a22f8 31%, #102a22a6 57%, #102a2220 86%), linear-gradient(0deg,#0b211eaa,transparent 29%);
}
.atlas-hero-content { padding: clamp(20px, 2.8vw, 42px); padding-bottom: 38px; max-width: 780px; }
.atlas-hero-content nav { display: flex; gap: .7rem; align-items: center; color: #e5efdb; font-size: .83rem; }
.atlas-hero a { color: inherit; }
.atlas-hero h1 { color: inherit; font-size: clamp(2.35rem, 4.8vw, 4.35rem); letter-spacing: -.045em; line-height: .97; margin: .28em 0 .16em; }
.atlas-hero-content p { font-size: clamp(.95rem, 1.35vw, 1.14rem); color: #e9f0e3; max-width: 45ch; margin: .65rem 0 1.25rem; }
.atlas-hero .atlas-primary { display: inline-flex; gap: .8rem; align-items: center; padding: .6rem .9rem; border-radius: 9px;
  font-weight: 780; font-size: .86rem; background: #d8efaa; color: #17271a; text-decoration: none;
}
.atlas-hero .atlas-primary:hover { background: #e8f9c6; }
.atlas-hero-credit { color: #f2f1e4; background: #0a201be8; border-radius: 6px; position: absolute; right: 10px; bottom: 9px;
  max-width: calc(100% - 20px); font-size: .7rem; margin: 0; padding: .25rem .55rem; line-height: 1.4;
}
.atlas-hero-credit a { text-underline-offset: .15em; }
.atlas-taxonomy-nav { display: flex; align-items: center; justify-content: space-between; gap: .7rem 1.25rem; flex-wrap: wrap; }
.atlas-taxonomy-nav .taxon-search { margin: 8px 0; }
.atlas-picker { display: flex; flex-wrap: wrap; gap: .35rem; margin: .72rem 0; }
.atlas-picker a { padding: .4rem .65rem; white-space: nowrap; border: 1px solid var(--line); color: var(--text);
  background: var(--surface); text-decoration: none; border-radius: 8px; font-size: .8rem; font-weight: 670; }
.atlas-picker a:is(:hover,[aria-current]) { background: #d7eca8; color: #203622; border-color: #87ad6a; }
.atlas-section-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .4rem;
  margin: 1.1rem 0 .65rem; scroll-margin-top: 5rem; }
.atlas-section-heading h2 { font-size: clamp(1.7rem, 3vw, 2.7rem); margin: 0; line-height: 1; }
.atlas-section-heading p { margin: .35rem 0 0; }
.atlas-section-heading i { color: var(--muted); }
.atlas-count { border: 1px solid var(--line); background: var(--surface-alt); padding: .3rem .6rem; border-radius: 7px; font-size: .8rem; }
.atlas-filters { margin: 0 0 .8rem; box-shadow: none; }
.atlas-filters summary { font-size: .87rem; font-weight: 650; cursor: pointer; color: var(--forest); }
.atlas-filters .network-filter { margin: .5rem 0; }
.atlas-network .graph-panel, .atlas-taxonomy .graph-panel { border: 1px solid #426458; box-shadow: 0 12px 34px #0b261b22; }
.atlas-network { align-items: start; grid-template-columns: minmax(0,1fr) minmax(285px,.40fr); }
.atlas-board { position: relative; overflow: hidden; isolation: isolate; background: #143b30; }
.atlas-map {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(132px, .88fr) minmax(0, 1fr);
  gap: clamp(.55rem, 1.15vw, 1rem); padding: clamp(.65rem,1.4vw,1.35rem);
  grid-template-areas: "relatives center diet" "habitat center interactions" "lineage center pressures";
  align-items: start; position: relative; min-height: 450px; isolation: isolate;
  background: radial-gradient(ellipse at 50% 48%, #a1c37830, transparent 36%), linear-gradient(150deg,#17423696,#0c241dcf);
}
.atlas-map-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .13; z-index: -1; filter: blur(9px); }
.atlas-connector { width: 100%; height: 100%; position: absolute; inset: 0; pointer-events: none; z-index: -1; }
.atlas-connector path { stroke: var(--group-accent); stroke-width: 1.7px; fill: none; opacity: .85; }
[data-group-key] { --group-accent: #dbe5a6; }
[data-group-key="relatives"] { --group-accent: #9bd9e5; grid-area: relatives; }
[data-group-key="diet"] { --group-accent: #d7eaa0; grid-area: diet; }
[data-group-key="habitat"] { --group-accent: #a1e2cf; grid-area: habitat; }
[data-group-key="interactions"] { --group-accent: #e0c4ff; grid-area: interactions; }
[data-group-key="lineage"] { --group-accent: #d6e89f; grid-area: lineage; }
[data-group-key="pressures"] { --group-accent: #ffd6ad; grid-area: pressures; }
.atlas-focal-card { grid-area: center; align-self: center; justify-self: center; padding: 5px 5px .75rem; width: 100%;
  max-width: 225px; background: #102a22; border: 2px solid #ddec9e; border-radius: 45% 45% 22px 22px / 29% 29% 22px 22px;
  color: #fffced; box-shadow: 0 0 0 6px #e3efaa18,0 12px 28px #081911a0; overflow: hidden; cursor: pointer;
}
.atlas-focal-card img { width: 100%; height: auto; aspect-ratio: 1.04; object-fit: cover; display: block; border-radius: inherit; }
.atlas-focal-card strong { display: block; font: 680 clamp(1.1rem,2.15vw,2rem)/1.07 var(--display); padding: .35rem .1rem .15rem; }
.atlas-focal-card i { color: #e0edce; display: block; font: italic .84rem var(--display); overflow-wrap: anywhere; }
.atlas-map-group { position: relative; min-width: 0; border: 1px solid var(--group-accent); border-radius: 15px;
  overflow: hidden; background: #0c2722df; box-shadow: 0 6px 13px #0b231b50; }
.atlas-group-title { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .4rem;
  min-width: 0; padding: .46rem .55rem; border: 0; border-bottom: 1px solid #ffffff40; background: #264a3b; color: #fff9e9;
  cursor: pointer; text-align: start; min-height: 39px;
}
.atlas-group-title > span { color: var(--group-accent); font-size: 1.1rem; }
.atlas-group-title strong { overflow-wrap: anywhere; font-size: clamp(.82rem,1.13vw,1rem); }
.atlas-group-title small { color: #142b20; background: var(--group-accent); border-radius: 10px; min-width: 1.32rem; text-align: center; }
.atlas-map-records { display: grid; padding: .3rem; gap: .29rem; }
.atlas-map-record { border: 1px solid #59776f; padding: .16rem .34rem .16rem .16rem; border-radius: 8px; color: #faf9ee;
  background: #183a31; display: grid; text-align: start; align-items: center; grid-template-columns: minmax(22px, 32px) minmax(0,1fr);
  gap: .35rem; min-height: 37px; cursor: pointer; width: 100%;
}
.atlas-map-record img { width: 100%; height: 30px; object-fit: cover; border-radius: 6px; }
.atlas-record-symbol { font-size: .98rem; text-align: center; color: var(--group-accent); }
.atlas-map-record strong { display: block; font-size: .84rem; line-height: 1.19; overflow-wrap: anywhere; }
.atlas-map-record small { display: block; color: #c1dcce; font-size: .67rem; line-height: 1.19; overflow-wrap: anywhere; }
.atlas-map-record:is(:hover,[aria-pressed="true"]), .atlas-group-title:is(:hover,[aria-pressed="true"]) { background: #36564a; }
.atlas-board button:focus-visible, .atlas-group-title:focus-visible { outline: 2px solid #e5f4b8; outline-offset: -3px; }
.atlas-inspector { border-top: 4px solid #5d916b; scroll-margin-top: 5rem; }
.atlas-inspector-bar { display: flex; gap: .35rem .65rem; flex-wrap: wrap; align-items: center; justify-content: space-between;
  padding: 0 0 .6rem; margin-bottom: .5rem; border-bottom: 1px solid var(--line); font-size: .75rem; font-weight: 700; }
.atlas-inspector .graph-inspector-image { aspect-ratio: 1.85; }
.atlas-inspector .reference-list li { border-inline-start: 3px solid #5d916b; background: var(--surface-alt); }
.atlas-inspector .network-lineage { margin-top: .65rem; border-top: 1px solid var(--line); padding-top: .55rem; }
.atlas-inspector .network-lineage summary { cursor: pointer; font-weight: 670; }
.atlas-taxonomy .graph-canvas { background: radial-gradient(ellipse at 65% 20%, #2b5943, transparent 64%), linear-gradient(#193b31,#0b2822); }
.atlas-taxonomy .graph-node > rect { stroke: #8caf9c; rx: 10; }
.atlas-taxonomy .graph-node.rank-life > rect { stroke: #d9e8a3; }
.atlas-taxonomy .graph-node.rank-domain > rect { stroke: #97dfde; }
.atlas-taxonomy .rank-column-label { fill: #cfebd9; }
.atlas-taxonomy .graph-edge { stroke: #88ae9a; stroke-width: 1.5px; }
.atlas-taxonomy .graph-edge.is-lineage { stroke: #dbeea7; stroke-width: 2.6px; }
.atlas-taxonomy .workspace-side > summary { font-size: 1.23rem; margin-bottom: .65rem; }
.atlas-taxonomy .workspace-side .button { margin: .25rem 0; }
.atlas-taxonomy .workspace-inspector .graph-path { display: grid; }
.atlas-taxonomy .inspector-branch-links { display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; list-style: none; }
.atlas-taxonomy .inspector-branch-links button { min-height: 32px; padding: .18rem .4rem; background: var(--surface-alt); border: 1px solid var(--line); color: var(--text); border-radius: 6px; }
@media(max-width: 1040px) {
  .atlas-network { grid-template-columns: 1fr; }
}
@media(max-width: 650px) {
  .atlas-hero { border-radius: 14px; min-height: 210px; }
  .atlas-taxonomy .graph-canvas { height: 330px; }
  .atlas-hero-content { padding-bottom: 42px; }
  .atlas-hero-art { inset: 0; }
  .atlas-hero::after { background: linear-gradient(90deg,#102a22f5,#102a227e 100%), linear-gradient(0deg,#0b211dba,transparent 45%); }
  .atlas-hero-credit { font-size: .62rem; }
  .atlas-map { grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: stretch; min-height: auto;
    grid-template-areas: "center center" "relatives diet" "habitat interactions" "lineage pressures"; }
  .atlas-focal-card { display: grid; grid-template-columns: 60px minmax(0,1fr); column-gap: .55rem; max-width: 300px; padding: 5px 10px 5px 5px;
    border-radius: 11px; width: auto; text-align: start; min-width: 174px; }
  .atlas-focal-card img { grid-row: span 2; width: 60px; border-radius: 6px; }
  .atlas-focal-card strong { padding: 0; align-self: end; }
  .atlas-connector { display: none; }
}
@media(max-width: 370px) {
  .atlas-map { grid-template-columns: minmax(0,1fr); grid-template-areas: "center" "relatives" "diet" "habitat" "interactions" "lineage" "pressures"; }
}

/* Relationship workspace */
.relationship-masthead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: clamp(1rem,2vw,1.85rem); }
.relationship-masthead nav { font-size: .78rem; color: var(--muted); }
.relationship-masthead nav a { text-decoration: none; }
.relationship-masthead h1 { font-size: clamp(2.05rem,4.6vw,4.55rem); margin-block: .28rem .4rem; }
.relationship-masthead p { color: var(--muted); max-width: 56ch; }
.relationship-subject { display: flex; align-items: center; gap: .7rem; padding: .38rem .7rem .38rem .38rem; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); flex: 0 1 285px; min-width: 0; }
.relationship-subject img { width: 86px; height: 72px; object-fit: cover; flex-shrink: 0; border-radius: 8px; }
.relationship-subject a { font: 600 1.25rem var(--display); }
.relationship-subject i, .relationship-subject small { display: block; font-size: .78rem; color: var(--muted); overflow-wrap: anywhere; }
.relationship-controls { display: flex; align-items: start; gap: .55rem; flex-wrap: wrap; margin-block: .65rem; scroll-margin-top: 5rem; }
.relationship-controls details { margin: 0; min-width: 0; }
.relationship-controls details[open] { width: 100%; }
.relationship-controls summary { min-height: 40px; align-content: center; padding: .45rem .72rem; font-size: .84rem; font-weight: 650; color: var(--forest); border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.network-return { margin-block: .45rem; font-size: .85rem; }
.network-layers { padding-block: .25rem .65rem; display: flex; gap: .42rem; flex-wrap: wrap; }
.network-layers a { display: inline-flex; align-items: center; min-height: 42px; gap: .45rem; padding: .35rem .68rem; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 8px; font-size: .83rem; font-weight: 650; text-decoration: none; }
.network-layers a span { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .78rem; }
.network-layers a:is(:hover,[aria-current]) { border-color: var(--forest); }
.network-layers a[aria-current] { background: var(--surface-alt); box-shadow: inset 0 -2px var(--forest); }
.atlas-network .graph-panel { border-radius: 16px; }
.atlas-network .graph-toolbar { gap: .48rem; }
.atlas-network .graph-tools button { min-height: 38px; }
.atlas-network .atlas-map { background: radial-gradient(ellipse at 50% 52%,#81994b30,transparent 35%),linear-gradient(135deg,#12372b60,#071d17bd); }
.atlas-network .atlas-map-backdrop { opacity: .25; filter: blur(5px); }
.atlas-network .atlas-map-group { border-radius: 12px; background: #0c2a23f2; }
.atlas-network .atlas-focal-card { max-width: 205px; border-radius: 50% 50% 26px 26px / 31% 31% 26px 26px; }
.atlas-network .atlas-connector path { stroke-width: 2.3px; }
.atlas-network .atlas-map-record { grid-template-columns: 1.55rem minmax(0,1fr); min-height: 44px; }
.atlas-network .atlas-map-record.has-photo { grid-template-columns: minmax(32px, 3.3rem) minmax(0,1fr); }
.atlas-network .atlas-map-record img { height: 40px; object-position: center; }
.atlas-network .atlas-map-record small { font-size: .73rem; }
.atlas-extra summary { padding: .38rem .4rem; color: var(--group-accent); font-size: .8rem; }
.atlas-extra .atlas-map-record + .atlas-map-record { margin-top: .29rem; }
.atlas-network .network-inspector { min-width: 0; }
.atlas-network .network-inspector .reference-list li[data-layer="ecology"] { border-inline-start-color: #b96b35; }
.atlas-network .network-inspector .reference-list li[data-layer="context"] { border-inline-start-color: #498b8c; }
.atlas-network .network-inspector .reference-list li[data-layer="classification"] { border-inline-start-color: #6e8f4b; }
.network-inspector-actions { margin-block: .7rem; }
@media (min-width: 1041px) {
  .atlas-network .network-inspector { position: sticky; top: 74px; max-height: calc(100dvh - 90px); overflow: auto; }
}
@media (max-width: 650px) {
  .relationship-masthead { align-items: stretch; flex-direction: column; gap: .55rem; }
  .relationship-subject { flex: auto; width: fit-content; }
  .relationship-subject img { width: 56px; height: 48px; }
  .atlas-network .atlas-focal-card { max-width: 285px; border-radius: 12px; }
  .atlas-network .atlas-map-record.has-photo { grid-template-columns: 2rem minmax(0,1fr); }
  .atlas-network .atlas-map-record img { height: 30px; }
  .atlas-network .atlas-map-record strong { font-size: .8rem; }
}

.relationship-masthead.has-subject-image { position: relative; isolation: isolate; overflow: hidden; background: #142f26; color: #fff8e7; min-height: clamp(155px, 15vw, 220px); }
.relationship-masthead-art { position: absolute; z-index: -2; inset: 0 0 0 auto; width: 61%; height: 100%; object-fit: cover; object-position: 50% 40%; opacity: .55; mask-image: linear-gradient(90deg,transparent,#000 35%); }
.relationship-masthead.has-subject-image::before { position: absolute; inset: 0; z-index: -1; content: ""; background: linear-gradient(90deg,#102c25 24%,#102c2599 64%,#173a2e44); }
.relationship-masthead.has-subject-image :is(nav,p,small,i) { color: #e2ead6; }
.relationship-masthead.has-subject-image .relationship-subject { color: #fff8e7; border-color: #88a39275; background: #0f2921ea; }
@media (max-width: 650px) { .relationship-masthead-art { width: 100%; opacity: .38; } }
