/* Professional atlas/viewer pass */
:root{
  --bg:#eef2f5;
  --surface:#ffffff;
  --surface-soft:#f7f9fb;
  --surface-strong:#172033;
  --text:#172033;
  --muted:#667085;
  --subtle:#8994a3;
  --line:#d7dde5;
  --line-strong:#aeb9c8;
  --accent:#2563eb;
  --accent2:#0f766e;
  --good:#15803d;
  --warn:#b45309;
  --bad:#be123c;
  --fossil:#c47a12;
  --tech:#7c3aed;
  --arch:#15803d;
  --civ:#0f766e;
  --shadow:0 16px 40px rgba(23,32,51,.12);
}

html,
body{
  background:linear-gradient(180deg,#f6f8fb 0,#e8edf3 100%);
  color:var(--text);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

body{overflow:hidden}
button,input,select{font:inherit}
button:focus-visible,
input:focus-visible,
a:focus-visible,
.evidence-item:focus-visible,
.about-button:focus-visible,
.about-close:focus-visible{
  outline:3px solid rgba(37,99,235,.22);
  outline-offset:2px;
}

.app-shell{
  height:100vh;
  display:grid;
  grid-template-rows:auto minmax(0,1fr) auto;
  gap:10px;
  padding:12px;
}

.topbar{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:18px;
  min-height:auto;
  padding:14px 16px;
  border:1px solid var(--line);
  border-radius:8px;
  background:rgba(255,255,255,.94);
  box-shadow:var(--shadow);
  backdrop-filter:blur(14px);
}

.brand-lockup{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}

.brand-logo{
  width:54px;
  height:54px;
  flex:0 0 auto;
  border-radius:8px;
  box-shadow:0 10px 22px rgba(23,32,51,.16);
}

.eyebrow{
  color:var(--accent2);
  font-size:11px;
  font-weight:800;
  letter-spacing:.14em;
  text-transform:uppercase;
}

.topbar h1{
  margin:2px 0 4px;
  color:var(--text);
  font-size:24px;
  line-height:1.08;
  letter-spacing:0;
}

.topbar p{
  margin:0;
  max-width:980px;
  color:var(--muted);
  font-size:13px;
  line-height:1.45;
}

.topbar-tools{
  display:flex;
  align-items:center;
  justify-content:flex-end;
}

.about-button,
.about-close{
  display:inline-grid;
  place-items:center;
  border:1px solid var(--line);
  background:rgba(255,255,255,.82);
  color:var(--text);
  cursor:pointer;
  font-weight:900;
  box-shadow:0 8px 18px rgba(23,32,51,.08);
}

.about-button{
  width:34px;
  height:34px;
  border-radius:999px;
  font-size:15px;
}

.about-button:hover,
.about-close:hover{
  border-color:var(--line-strong);
  background:#fff;
}

.about-dialog[hidden]{
  display:none;
}

.about-dialog{
  position:fixed;
  inset:0;
  z-index:3000;
  display:grid;
  place-items:center;
  padding:18px;
}

.about-scrim{
  position:absolute;
  inset:0;
  background:rgba(15,23,42,.34);
  backdrop-filter:blur(10px);
}

.about-panel{
  position:relative;
  width:min(560px,calc(100vw - 24px));
  max-height:min(720px,calc(100vh - 24px));
  overflow:hidden;
  border:1px solid rgba(226,232,240,.72);
  border-radius:8px;
  background:rgba(255,255,255,.88);
  box-shadow:0 28px 70px rgba(15,23,42,.28);
  backdrop-filter:blur(20px) saturate(1.08);
}

.about-panel-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px 16px 12px;
  border-bottom:1px solid rgba(148,163,184,.26);
}

.about-panel-header h2{
  margin:2px 0 0;
  font-size:18px;
  line-height:1.12;
}

.about-close{
  width:32px;
  height:32px;
  border-radius:6px;
  font-size:18px;
  line-height:1;
}

.about-panel-body{
  max-height:calc(min(720px,100vh - 24px) - 69px);
  overflow:auto;
  padding:14px 16px 16px;
  scrollbar-color:#64748b rgba(226,232,240,.64);
}

.about-lede{
  margin:0 0 12px;
  color:var(--text);
  font-size:13px;
  line-height:1.45;
}

.about-meta-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-bottom:14px;
}

.about-meta-grid div{
  min-width:0;
  padding:8px;
  border:1px solid rgba(148,163,184,.34);
  border-radius:6px;
  background:rgba(248,250,252,.72);
}

.about-meta-grid span{
  display:block;
  color:var(--subtle);
  font-size:9px;
  font-weight:900;
  letter-spacing:.08em;
  line-height:1.1;
  text-transform:uppercase;
}

.about-meta-grid strong{
  display:block;
  overflow:hidden;
  margin-top:4px;
  color:var(--text);
  font-size:12px;
  line-height:1.25;
  text-overflow:ellipsis;
}

.about-section{
  padding-top:12px;
  border-top:1px solid rgba(148,163,184,.24);
}

.about-section + .about-section{
  margin-top:12px;
}

.about-section h3{
  margin:0 0 5px;
  color:var(--text);
  font-size:12px;
  letter-spacing:.06em;
  text-transform:uppercase;
}

.about-section p{
  margin:0;
  color:var(--muted);
  font-size:12px;
  line-height:1.48;
}

.atlas-layout{
  min-height:0;
  display:grid;
  grid-template-columns:minmax(300px,350px) minmax(560px,1fr) minmax(318px,390px);
  gap:10px;
}

.panel{
  min-height:0;
  display:flex;
  flex-direction:column;
  gap:10px;
  overflow:hidden;
}

.right-panel{max-height:100%}

.control-card,
.hero-card{
  background:rgba(255,255,255,.96);
  border:1px solid var(--line);
  border-radius:8px;
  box-shadow:0 10px 28px rgba(23,32,51,.08);
  backdrop-filter:none;
}

.control-card{padding:14px}

.section-title-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

.control-card h2,
.hero-card h2{
  margin:0;
  color:var(--text);
  font-size:14px;
  line-height:1.2;
}

.pill{
  display:inline-flex;
  align-items:center;
  min-height:24px;
  padding:4px 8px;
  border:1px solid #c8d5e4;
  border-radius:999px;
  background:#eef5ff;
  color:#1d4ed8;
  font-size:11px;
  font-weight:800;
}

.date-display{
  margin-bottom:12px;
  padding:12px;
  border:1px solid #c8d5e4;
  border-radius:8px;
  background:linear-gradient(135deg,#eef5ff,#f6fbfa);
}

.date-display span{
  display:block;
  color:var(--accent);
  font-size:30px;
  font-weight:900;
  line-height:1;
}

.date-display strong{
  display:block;
  margin-top:8px;
  color:var(--text);
  font-size:15px;
  line-height:1.25;
}

.date-display small{
  display:block;
  margin-top:5px;
  color:var(--muted);
  line-height:1.35;
}

.note{
  margin-top:12px;
  padding:9px 10px;
  border-left:3px solid var(--accent2);
  border-radius:0 8px 8px 0;
  background:#f5faf8;
  color:var(--muted);
  font-size:12px;
  line-height:1.45;
}

.note.compact{font-size:11px}

.mini-label{
  color:var(--subtle);
  font-size:11px;
  font-weight:850;
  letter-spacing:.1em;
  text-transform:uppercase;
}

.visible-list{
  scrollbar-color:#b6c2d0 transparent;
  scrollbar-width:thin;
}

.map-stack{
  position:relative;
  min-height:0;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:8px;
  background:#d9e1ea;
  box-shadow:0 14px 36px rgba(23,32,51,.14);
}

#map{
  position:absolute;
  inset:0;
  background:#d9e1ea;
}

.legend-card{
  position:absolute;
  right:12px;
  bottom:12px;
  z-index:601;
  min-width:220px;
  padding:11px 12px;
  border:1px solid rgba(215,221,229,.92);
  border-radius:8px;
  background:rgba(255,255,255,.94);
  color:var(--text);
  font-size:12px;
  line-height:1.65;
  box-shadow:0 10px 26px rgba(23,32,51,.16);
  backdrop-filter:blur(10px);
}

.legend-title{
  margin-bottom:5px;
  color:var(--text);
  font-weight:900;
}

.dot{
  display:inline-block;
  width:9px;
  height:9px;
  margin-right:8px;
  border-radius:50%;
  box-shadow:0 0 0 3px rgba(23,32,51,.06);
}

.dot.fossil{background:var(--fossil);color:var(--fossil)}
.dot.tech{background:var(--tech);color:var(--tech)}
.dot.arch{background:var(--arch);color:var(--arch)}
.dot.civ{background:var(--civ);color:var(--civ)}
.line-sample{display:inline-block;width:26px;margin-right:7px;border-top:3px dashed var(--accent);vertical-align:middle}
.area-sample{display:inline-block;width:20px;height:10px;margin-right:8px;border:1px solid var(--arch);background:rgba(21,128,61,.14)}

.hero-card{overflow:hidden}

.image-wrap{
  height:152px;
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  border-bottom:1px solid var(--line);
  background:#e4eaf1;
}

.image-wrap img{
  display:none;
  width:100%;
  height:100%;
  object-fit:cover;
}

.image-wrap::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(to top,rgba(23,32,51,.44),transparent 58%);
  pointer-events:none;
}

.image-wrap #imageFallback{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:linear-gradient(135deg,#edf4ff,#eef8f5);
  color:#738198;
  font-size:12px;
  font-weight:800;
  letter-spacing:.08em;
  text-align:center;
  text-transform:uppercase;
}

.hero-content{padding:14px}

.hero-content h2{
  margin:5px 0 8px;
  color:var(--text);
  font-size:20px;
  line-height:1.12;
}

.hero-content p{
  margin:0 0 10px;
  color:var(--muted);
  font-size:13px;
  line-height:1.5;
}

.source-chips{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin:10px 0;
}

.chip,
.badge{
  display:inline-flex;
  align-items:center;
  max-width:100%;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--surface-soft);
  color:var(--text);
  font-size:11px;
}

.chip{
  padding:5px 8px;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  text-decoration:none;
}

.chip:hover,
.text-link:hover{text-decoration:underline}

.text-link{
  color:var(--accent);
  font-size:12px;
  font-weight:850;
  text-decoration:none;
}

.list-card{
  min-height:0;
  flex:1;
  display:flex;
  flex-direction:column;
}

.visible-list{
  min-height:0;
  overflow:auto;
  display:flex;
  flex-direction:column;
  gap:7px;
  padding-right:4px;
}

.evidence-item{
  padding:10px;
  border:1px solid var(--line);
  border-radius:8px;
  background:var(--surface-soft);
  cursor:pointer;
  transition:background .16s ease,border-color .16s ease,box-shadow .16s ease;
}

.evidence-item:hover{
  border-color:#b4c3d5;
  background:#fff;
  transform:none;
}

.evidence-item strong{
  display:block;
  color:var(--text);
  font-size:13px;
  line-height:1.25;
}

.evidence-item small{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:6px;
  color:var(--muted);
  font-size:11px;
}

.badge{
  padding:2px 7px;
  color:var(--muted);
}

.badge.low{color:var(--bad);border-color:#fecdd3;background:#fff1f2}
.badge.moderate{color:var(--warn);border-color:#fed7aa;background:#fff7ed}
.badge.high{color:var(--good);border-color:#bbf7d0;background:#f0fdf4}

.site-marker{
  width:18px;
  height:18px;
  border:2px solid #fff;
  border-radius:50%;
  box-shadow:0 0 0 4px rgba(23,32,51,.24),0 8px 18px rgba(23,32,51,.22);
}

.site-marker.fossil{background:var(--fossil);color:var(--fossil)}
.site-marker.tech{background:var(--tech);color:var(--tech)}
.site-marker.arch{background:var(--arch);color:var(--arch)}
.site-marker.civ{background:var(--civ);color:var(--civ)}
.site-marker.low{border-style:dashed;opacity:.82;transform:scale(.86)}
.route-end{color:#fff;font-size:18px;text-shadow:0 2px 8px #000}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip{
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
}

.leaflet-popup-content{font-family:inherit}
.popup-title{margin-bottom:4px;color:var(--text);font-size:15px;font-weight:900}
.popup-meta{margin-bottom:8px;color:var(--muted);font-size:12px}
.popup-summary{font-size:12px;line-height:1.45}
.popup-link{display:inline-block;margin-top:8px;color:var(--accent);font-weight:850;text-decoration:none}
.popup-link:hover{text-decoration:underline}

.leaflet-control-layers{
  border:1px solid rgba(215,221,229,.92)!important;
  border-radius:8px!important;
  background:rgba(255,255,255,.94)!important;
  color:var(--text)!important;
  box-shadow:0 10px 26px rgba(23,32,51,.16)!important;
  backdrop-filter:blur(10px);
}

.leaflet-control-layers-selector{accent-color:var(--accent)}
.leaflet-control-attribution{background:rgba(255,255,255,.78)!important;color:var(--muted)!important}
.leaflet-control-attribution a{color:var(--accent)!important}

@media (max-width:1500px){
  .atlas-layout{grid-template-columns:minmax(286px,320px) minmax(480px,1fr) minmax(300px,360px)}
  .topbar h1{font-size:21px}
  .hero-content h2{font-size:18px}
}

@media (max-width:1150px){
  body{overflow:auto}
  .app-shell{height:auto;min-height:100vh}
  .topbar{grid-template-columns:1fr;align-items:flex-start}
  .atlas-layout{grid-template-columns:1fr;grid-auto-rows:auto}
  .map-stack{height:70vh;min-height:520px}
  .panel{max-height:none}
  .list-card{max-height:420px}
}

@media (max-width:680px){
  .app-shell{padding:8px}
  .brand-lockup{align-items:flex-start}
  .brand-logo{width:44px;height:44px}
  .topbar h1{font-size:19px}
  .map-stack{min-height:460px}
  .legend-card{right:8px;bottom:54px;max-width:calc(100% - 16px)}
}

@media print{
  body{overflow:visible;background:#fff;color:#000}
  .right-panel{display:none}
  .app-shell{display:block;padding:0}
  .topbar{box-shadow:none;border:none;background:#fff;color:#000}
  .map-stack{height:85vh;border:1px solid #777}
  .legend-card{color:#000;background:#fff}
}

/* ---- extracted style block ---- */

/* Map-first cleanup */
.app-shell{
  grid-template-rows:auto minmax(0,1fr);
  gap:8px;
  padding:8px;
}

.topbar{
  min-height:54px;
  grid-template-columns:1fr;
  padding:8px 12px;
  border-radius:6px;
  box-shadow:0 8px 24px rgba(23,32,51,.08);
}

.brand-lockup{gap:10px}
.brand-logo{width:38px;height:38px;border-radius:6px}
.eyebrow{font-size:10px;letter-spacing:.12em}
.topbar h1{margin:1px 0 0;font-size:17px;line-height:1.1}
.atlas-layout{
  grid-template-columns:minmax(0,1fr) 10px minmax(380px,var(--inspector-width, 430px));
  align-items:stretch;
  gap:0;
}

.map-stack{
  height:100%;
  border-radius:8px 0 0 8px;
  box-shadow:0 14px 34px rgba(23,32,51,.14);
}

.panel-resizer{
  position:relative;
  z-index:20;
  cursor:col-resize;
  background:linear-gradient(90deg,rgba(255,255,255,.78),rgba(226,232,240,.98),rgba(255,255,255,.78));
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
  touch-action:none;
}

.panel-resizer::before{
  content:"";
  position:absolute;
  top:50%;
  left:50%;
  width:3px;
  height:48px;
  border-radius:999px;
  background:#94a3b8;
  box-shadow:-4px 0 0 #cbd5e1,4px 0 0 #cbd5e1;
  transform:translate(-50%,-50%);
}

.panel-resizer:hover,
.panel-resizer:focus-visible{
  background:#dbeafe;
  outline:none;
}

body.is-resizing-panel{
  cursor:col-resize;
  user-select:none;
}

.map-period-card{
  position:static;
  width:auto;
  padding:9px 10px;
  border:1px solid var(--line);
  border-radius:6px;
  background:rgba(255,255,255,.96);
  box-shadow:0 10px 28px rgba(23,32,51,.08);
  backdrop-filter:none;
}

.period-card-header{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  align-items:center;
  gap:8px;
}

.map-period-card .date-display{
  display:grid;
  grid-template-columns:auto 1fr;
  column-gap:10px;
  row-gap:2px;
  align-items:start;
  margin:0;
  padding:0;
  border:0;
  background:transparent;
}

.map-period-card .date-display span{
  grid-row:1 / span 2;
  min-width:126px;
  color:#0f766e;
  font-size:14px;
  line-height:1.18;
  text-wrap:balance;
}
.map-period-card .date-display strong{
  margin-top:0;
  font-size:14px;
}
.map-period-card .date-display small{
  grid-column:2;
  font-size:11px;
}

.period-toggle{
  min-width:64px;
  min-height:30px;
  border:1px solid var(--line);
  border-radius:6px;
  background:#fff;
  color:var(--accent);
  cursor:pointer;
  font-size:11px;
  font-weight:900;
}

.period-toggle:hover{
  border-color:var(--line-strong);
  background:#f4f7fb;
}

.map-period-card.collapsed .period-nav{
  display:none;
}

.map-period-card.collapsed .date-display small{
  display:none;
}

.map-period-card.collapsed .date-display span{
  font-size:13px;
}

.period-nav{
  display:grid;
  margin-top:8px;
  gap:6px;
}

.period-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:6px;
}

.period-btn,
.era-chip{
  min-height:34px;
  border:1px solid var(--line);
  border-radius:6px;
  background:#fff;
  color:var(--text);
  cursor:pointer;
  font-size:12px;
  font-weight:850;
}

.period-btn:hover,
.era-chip:hover{
  border-color:var(--line-strong);
  background:#f4f7fb;
}

.period-jump{
  display:grid;
  gap:4px;
  color:var(--muted);
  font-size:11px;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
}

.period-jump select{
  width:100%;
  min-height:34px;
  border:1px solid var(--line);
  border-radius:6px;
  background:#fff;
  color:var(--text);
  padding:7px 9px;
  font-size:12px;
  text-transform:none;
  letter-spacing:0;
  outline:none;
}

.era-strip{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:5px;
}

.era-chip{
  min-height:30px;
  padding:6px 7px;
  text-align:center;
  font-size:11px;
}

.era-chip.active{
  color:#fff;
  background:linear-gradient(135deg,#2563eb,#0f766e);
  border-color:transparent;
}

.period-meta{
  display:flex;
  justify-content:space-between;
  gap:10px;
  color:var(--muted);
  font-size:10px;
  line-height:1.3;
}

.findings-summary{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin:-2px 0 10px;
}

.finding-stat{
  border:1px solid var(--line);
  border-radius:6px;
  background:var(--surface-soft);
  padding:8px;
}

.finding-stat strong{
  display:block;
  color:var(--text);
  font-size:18px;
  line-height:1;
}

.finding-stat span{
  color:var(--muted);
  font-size:10px;
  font-weight:800;
  letter-spacing:.05em;
  text-transform:uppercase;
}

.list-kicker{
  margin:2px 0 6px;
  color:var(--subtle);
  font-size:10px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}

.selection-facts{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:6px;
  margin:10px 0;
}

.selection-fact{
  min-width:0;
  border:1px solid var(--line);
  border-radius:6px;
  background:var(--surface-soft);
  padding:7px 8px;
}

.selection-fact span{
  display:block;
  color:var(--subtle);
  font-size:9px;
  font-weight:900;
  letter-spacing:.08em;
  line-height:1.1;
  text-transform:uppercase;
}

.selection-fact strong{
  display:block;
  overflow:hidden;
  margin-top:3px;
  color:var(--text);
  font-size:12px;
  line-height:1.2;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.evidence-item.active{
  border-color:#7ea7f7;
  background:#edf4ff;
  box-shadow:inset 3px 0 0 var(--accent);
}

.legend-card{
  right:12px;
  bottom:48px;
  max-width:260px;
}

.right-panel{
  display:grid;
  grid-template-rows:auto minmax(280px,.85fr) minmax(300px,1.15fr);
  gap:10px;
  min-width:0;
  max-height:100%;
  overflow:hidden;
  padding:0 0 0 10px;
}

.hero-card,
.control-card{
  min-height:0;
  border-radius:8px;
  box-shadow:0 10px 28px rgba(23,32,51,.08);
}

.hero-card{
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.image-wrap{
  flex:0 0 132px;
  height:132px;
}

.hero-content{
  min-height:0;
  overflow:auto;
  padding:14px;
}

.hero-content h2{
  font-size:20px;
  line-height:1.16;
}

.list-card{
  display:flex;
  flex-direction:column;
  min-height:0;
  overflow:hidden;
}

.visible-list{
  min-height:0;
  gap:7px;
  overflow:auto;
  padding-right:8px;
  scrollbar-width:auto;
}

.hero-content,
.visible-list{
  scrollbar-color:#64748b #e2e8f0;
}

.hero-content::-webkit-scrollbar,
.visible-list::-webkit-scrollbar{
  width:13px;
}

.hero-content::-webkit-scrollbar-track,
.visible-list::-webkit-scrollbar-track{
  background:#e2e8f0;
  border-radius:999px;
}

.hero-content::-webkit-scrollbar-thumb,
.visible-list::-webkit-scrollbar-thumb{
  min-height:64px;
  border:3px solid #e2e8f0;
  border-radius:999px;
  background:#64748b;
}

.evidence-item{
  border-radius:8px;
}

@media (max-width:1050px){
  body{overflow:auto}
  .app-shell{height:auto;min-height:100vh}
  .atlas-layout{grid-template-columns:1fr}
  .panel-resizer{display:none}
  .map-stack{height:68vh;min-height:520px}
  .right-panel{
    grid-template-rows:auto auto minmax(320px,auto);
    max-height:none;
    overflow:visible;
    padding-left:0;
  }
  .hero-card{min-height:420px}
  .list-card{min-height:420px;max-height:none}
  .visible-list{max-height:520px}
}

@media (max-width:680px){
  .app-shell{padding:6px}
  .topbar{padding:8px}
  .map-stack{min-height:500px}
  .legend-card{left:8px;right:8px;bottom:52px;max-width:none}
  
}

/* Compact production glass pass */
:root{
  --inspector-width:400px;
  --glass-panel:rgba(255,255,255,.78);
  --glass-panel-strong:rgba(255,255,255,.88);
  --glass-panel-soft:rgba(248,250,252,.66);
  --glass-line:rgba(148,163,184,.42);
  --glass-shadow:0 12px 28px rgba(23,32,51,.12);
}

body{
  background:
    linear-gradient(180deg,rgba(247,249,252,.96),rgba(228,234,242,.96)),
    #e8edf3;
}

.app-shell{
  gap:6px;
  padding:6px;
}

.topbar{
  grid-template-columns:minmax(0,1fr) auto;
  min-height:46px;
  padding:6px 10px;
  border-color:var(--glass-line);
  background:var(--glass-panel);
  box-shadow:0 8px 22px rgba(23,32,51,.08);
  backdrop-filter:blur(18px) saturate(1.12);
}

.topbar-tools{
  align-self:center;
}

.about-button{
  width:30px;
  height:30px;
  background:rgba(255,255,255,.72);
  font-size:13px;
}

.brand-lockup{gap:9px}

.brand-logo{
  width:34px;
  height:34px;
  border-radius:6px;
  opacity:.94;
  box-shadow:0 7px 16px rgba(23,32,51,.14);
}

.eyebrow{
  font-size:9.5px;
  letter-spacing:.1em;
}

.topbar h1{
  font-size:16px;
  line-height:1.05;
}

.atlas-layout{
  grid-template-columns:minmax(0,1fr) 8px minmax(340px,var(--inspector-width,400px));
}

.panel-resizer{
  background:linear-gradient(90deg,rgba(255,255,255,.5),rgba(203,213,225,.76),rgba(255,255,255,.5));
  border-color:var(--glass-line);
}

.panel-resizer::before{
  width:2px;
  height:42px;
  background:#64748b;
  box-shadow:-3px 0 0 rgba(148,163,184,.7),3px 0 0 rgba(148,163,184,.7);
}

.map-stack{
  border-color:var(--glass-line);
  border-radius:6px 0 0 6px;
  box-shadow:0 12px 30px rgba(23,32,51,.14);
}

.right-panel{
  grid-template-rows:auto minmax(228px,.72fr) minmax(276px,1.28fr);
  gap:7px;
  padding-left:7px;
}

.map-period-card,
.hero-card,
.control-card{
  border-color:var(--glass-line);
  background:var(--glass-panel);
  box-shadow:var(--glass-shadow);
  backdrop-filter:blur(18px) saturate(1.08);
}

.map-period-card{
  padding:7px 8px;
}

.period-card-header{
  gap:7px;
}

.map-period-card .date-display{
  column-gap:8px;
}

.map-period-card .date-display span{
  min-width:112px;
  color:#0f766e;
  font-size:12px;
  line-height:1.16;
}

.map-period-card .date-display strong{
  font-size:13px;
  line-height:1.18;
}

.map-period-card .date-display small{
  font-size:10.5px;
}

.period-toggle{
  min-width:54px;
  min-height:28px;
  background:rgba(255,255,255,.72);
  font-size:10px;
}

.period-nav{
  gap:5px;
  margin-top:7px;
}

.period-actions{
  gap:5px;
}

.period-btn,
.era-chip{
  min-height:28px;
  background:rgba(255,255,255,.74);
  font-size:10.5px;
}

.period-jump{
  font-size:10px;
}

.period-jump select{
  min-height:30px;
  background:rgba(255,255,255,.82);
  padding:5px 7px;
  font-size:11px;
}

.era-strip{
  gap:4px;
}

.period-meta{
  font-size:9.5px;
}

.hero-card,
.control-card{
  border-radius:7px;
}

.image-wrap{
  flex-basis:112px;
  height:112px;
}

.image-wrap::after{
  background:linear-gradient(to top,rgba(15,23,42,.48),transparent 62%);
}

.image-wrap #imageFallback{
  background:linear-gradient(135deg,rgba(226,232,240,.78),rgba(248,250,252,.82));
}

.hero-content{
  padding:10px 11px;
}

.hero-content h2{
  margin:4px 0 6px;
  font-size:17px;
  line-height:1.16;
}

.hero-content p{
  margin-bottom:8px;
  font-size:12px;
  line-height:1.42;
}

.selection-facts{
  gap:5px;
  margin:8px 0;
}

.selection-fact{
  padding:6px 7px;
  background:var(--glass-panel-soft);
}

.selection-fact span{
  font-size:8.5px;
}

.selection-fact strong{
  font-size:11px;
}

.source-chips{
  gap:5px;
  margin:7px 0;
}

.chip{
  max-width:100%;
  padding:3px 6px;
  background:rgba(248,250,252,.76);
  font-size:10px;
}

.text-link{
  font-size:11px;
}

.control-card{
  padding:10px;
}

.section-title-row{
  margin-bottom:6px;
}

.control-card h2,
.hero-card h2{
  font-size:13.5px;
}

.pill{
  min-height:22px;
  padding:3px 7px;
  background:rgba(239,246,255,.82);
  font-size:10px;
}

.findings-summary{
  gap:6px;
  margin:0 0 8px;
}

.finding-stat{
  padding:6px 7px;
  background:var(--glass-panel-soft);
}

.finding-stat strong{
  font-size:15px;
}

.finding-stat span,
.list-kicker{
  font-size:9px;
}

.visible-list{
  gap:6px;
  padding-right:6px;
}

.evidence-item{
  padding:7px 8px;
  border-radius:6px;
  background:rgba(255,255,255,.66);
}

.evidence-item:hover{
  background:rgba(255,255,255,.86);
}

.evidence-item strong{
  font-size:12px;
}

.evidence-item small{
  gap:4px;
  margin-top:4px;
  font-size:10px;
}

.evidence-item.active{
  background:rgba(237,244,255,.88);
}

.badge{
  padding:2px 5px;
  background:rgba(241,245,249,.76);
  font-size:10px;
}

.legend-card{
  right:10px;
  bottom:42px;
  max-width:222px;
  min-width:0;
  padding:8px 9px;
  border-color:rgba(226,232,240,.34);
  background:rgba(15,23,42,.66);
  color:#f8fafc;
  font-size:10.5px;
  line-height:1.45;
  box-shadow:0 12px 26px rgba(15,23,42,.22);
  backdrop-filter:blur(18px) saturate(1.08);
}

.legend-title{
  margin-bottom:5px;
}

.dot{
  width:8px;
  height:8px;
  margin-right:6px;
}

.line-sample{
  width:22px;
  margin-right:6px;
}

.area-sample{
  width:17px;
  height:9px;
  margin-right:6px;
}

.leaflet-control-layers{
  border-color:var(--glass-line)!important;
  background:rgba(255,255,255,.74)!important;
  box-shadow:0 8px 20px rgba(23,32,51,.12)!important;
  backdrop-filter:blur(18px) saturate(1.1);
  font-size:11px;
}

.leaflet-control-layers-toggle{
  width:30px!important;
  height:30px!important;
  opacity:.82;
}

.leaflet-control-zoom a{
  width:28px!important;
  height:28px!important;
  line-height:28px!important;
}

.leaflet-control-attribution{
  background:rgba(255,255,255,.64)!important;
  font-size:9.5px;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip{
  background:rgba(255,255,255,.92);
  backdrop-filter:blur(14px);
}

.hero-content,
.visible-list{
  scrollbar-color:#64748b rgba(226,232,240,.64);
}

.hero-content::-webkit-scrollbar,
.visible-list::-webkit-scrollbar{
  width:10px;
}

.hero-content::-webkit-scrollbar-track,
.visible-list::-webkit-scrollbar-track{
  background:rgba(226,232,240,.64);
}

.hero-content::-webkit-scrollbar-thumb,
.visible-list::-webkit-scrollbar-thumb{
  min-height:52px;
  border:2px solid rgba(226,232,240,.64);
}

@media (max-width:1050px){
  .atlas-layout{
    grid-template-columns:1fr;
  }

  .map-stack{
    height:64vh;
    min-height:480px;
    border-radius:6px;
  }

  .right-panel{
    gap:7px;
    padding-left:0;
  }

  .hero-card{
    min-height:360px;
  }

  .list-card{
    min-height:360px;
  }
}

@media (max-width:680px){
  .app-shell{
    padding:5px;
  }

  .topbar{
    padding:6px 8px;
  }

  .brand-logo{
    width:32px;
    height:32px;
  }

  .topbar h1{
    font-size:15px;
  }

  .map-stack{
    min-height:440px;
  }

  .map-period-card .date-display{
    grid-template-columns:1fr;
  }

  .map-period-card .date-display span{
    grid-row:auto;
    min-width:0;
  }

  .map-period-card .date-display small{
    grid-column:1;
  }

  .legend-card{
    left:8px;
    right:8px;
    bottom:46px;
    max-width:none;
  }
}
