.workspace {
  --directory-width: 284px;
  grid-template-columns: var(--directory-width) minmax(0, 1fr);
  height: 100%;
  height: 100dvh;
}

.workspace[data-index-open="false"] { --directory-width: 0px; }
.index-top { padding-top: 19px; }
.index-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 18px;
}
.index-heading .brand { min-width: 0; font-size: 16px; gap: 9px; }
.index-heading .brand-mark { flex: none; }

.map-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  grid-column: 2 / -1;
  min-width: 0;
  min-height: 0;
}
.map-navigation {
  position: absolute;
  z-index: 2;
  inset: 17px auto auto 18px;
  max-width: calc(100% - 36px - var(--lore-toggle-space));
  display: flex;
  align-items: center;
  gap: 6px;
}
/* Match the responsive directory defaults while the app is starting. */
.map-brand { display: none; align-items: center; gap: 6px; flex: none; }
.workspace[data-index-open="false"] .map-brand { display: flex; }
.map-navigation .breadcrumbs { position: static; max-width: 100%; }
.map-navigation .breadcrumbs:empty { display: none; }
#era-coverage { margin-top: 5px; color: var(--gold); }

.era-timeline {
  --rail: #846747;
  --logo-height: 48px;
  color: #d8c6a4;
  background: linear-gradient(180deg, #23211e, #141a1b);
  border-top: 1px solid var(--rail);
  box-shadow: 0 -7px 20px #080b0b40;
  z-index: 2;
  min-width: 0;
}
.era-scroll { overflow-x: auto; scrollbar-width: thin; scrollbar-color: #8f7047 #1a2020; }
.era-track {
  list-style: none;
  display: flex;
  min-width: 100%;
  width: max-content;
  margin: 0;
  padding: 9px 14px 6px;
  position: relative;
}
.era-stop { position: relative; flex: 1 0 82px; }
.era-stop::before {
  content: "";
  position: absolute;
  top: calc(var(--logo-height) / 2);
  left: 50%;
  width: 100%;
  height: 1px;
  background: var(--rail);
}
.era-stop--classic { display: flex; justify-content: center; }
.era-stop--classic::before { left: 25%; width: 125%; }
.era-stop:last-child::before { content: none; }
.era-node {
  color: inherit;
  display: grid;
  justify-items: center;
  align-content: start;
  position: relative;
  z-index: 1;
  gap: 2px;
  text-align: center;
  padding: 0 3px 3px;
  width: 100%;
  min-height: 72px;
}
.era-stop--classic > .era-node, .era-fork { min-width: 58px; }
.era-node-art {
  display: grid;
  place-items: center;
  width: min(100%, 126px);
  height: var(--logo-height);
  padding: 1px 4px;
  border: 1px solid transparent;
  border-radius: 5px;
}
.era-node-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px #080b0d);
}
/* Scale the artwork inside each frame to compensate for transparent padding. */
.era-node[data-era="forever"] img { scale: 1.2; }
.era-node[data-era="the-war-within"] img { scale: 1.65; }
.era-node[data-era="midnight"] img { scale: 1.5; }
.era-node:is([data-era="forever"], [data-era="the-war-within"], [data-era="midnight"]) .era-node-art {
  overflow: clip;
}
.era-node-name {
  font: 700 10px/1.2 var(--title);
  max-width: 92px;
}
.era-node-year { color: #b4ad9d; font-size: 9px; line-height: 1.2; }
.era-node:is(:hover, :focus-visible, [aria-current]) { color: #ffdf9b; }
.era-node:is(:hover, :focus-visible) .era-node-art {
  background: #423727;
  border-color: #756345;
}
.era-fork {
  position: relative;
  margin-top: 12px;
  --rail: #80aaa2;
  --gold: #b4e5d4;
}
.era-fork::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 5px;
  width: 56px;
  height: 12px;
  border: solid var(--rail);
  border-width: 0 0 1px 1px;
  border-radius: 0 0 0 9px;
}
.era-node--forever:is(:hover, :focus-visible, [aria-current]) .era-node-art { background: #283b33; }

@media (max-width: 1050px) {
  .workspace { --directory-width: 255px; }
  .index-heading .brand { font-size: 14px; }
  .index-heading .brand-mark { width: 31px; height: 31px; font-size: 21px; }
}
@media (max-width: 780px) {
  .workspace { display: block; }
  .map-panel { height: 100%; }
  .index { z-index: 4; }
  .map-navigation {
    top: 10px;
    left: 10px;
    max-width: calc(100% - 20px - var(--lore-toggle-space));
  }
  .workspace:not([data-index-open="true"]) .map-brand { display: flex; }
  .map-home { display: none; }
  .map-tools { top: 60px; }
}

/* The directory and time dial share the materials of the atlas compass. */
.workspace {
  --brass: #af8a4f;
  --trim: #514936;
  --ink: #12191a;
  --dim: #abae9d;
  --gold: #edc985;
}
.index {
  background: radial-gradient(ellipse 135% 40% at 5% 0%, #343329, transparent), #181e1e;
  border-right: 1px solid var(--brass);
}
.index-top { padding-inline: 15px; }
.index-heading { padding-bottom: 16px; }
.index-heading .brand { gap: 9px; letter-spacing: .045em; white-space: nowrap; }
.index-heading .brand-mark {
  width: 44px;
  height: 44px;
  font-size: 0;
  border: 0;
  border-radius: 0;
  background: url('./atlas-emblem.webp') center / contain no-repeat;
  filter: drop-shadow(0 2px 2px #050908);
}
.brand small { color: #c0b59b; font-size: 8px; letter-spacing: .21em; }
.breadcrumbs, .map-controls button, .map-tools button {
  border-radius: 3px;
  border-color: #756345;
  background: linear-gradient(#30332df5, #181f1ef5);
  box-shadow: inset 0 1px #f8e6b817, 0 2px 5px #090e0f56;
}
.search-wrap { border-radius: 3px; border-color: var(--trim); background: #111818; }
.tabs { border-color: var(--trim); }
.tabs button[aria-pressed="true"] { background: linear-gradient(0deg, #b4975922, transparent 75%); }
.directory { scrollbar-color: #685e47 transparent; }
.directory h2 { font: 600 10px var(--title); letter-spacing: .17em; color: #d0b98a; }
.index-item .glyph { background: linear-gradient(135deg,#394238,#202a2a); border-color: #5c5e48; border-radius: 3px; }
.index-item[aria-current] { background: linear-gradient(100deg,#363a2d,#282c27); border-color: #78623f; }
.index-footer { border-color: var(--trim); }
.era-timeline {
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  align-items: stretch;
  background: linear-gradient(#403a29 0,#222822 3px,#1e2423 48%,#131a1b);
  border-top-color: #b69253;
}
.era-scroll { min-width: 0; scrollbar-width: thin; }
.era-track { padding: 10px 6px 4px; }
.era-stop { flex: 1 0 104px; width: 104px; }
.era-stop--classic { flex-basis: 208px; width: 208px; }
.era-node { color: #dfd7bf; min-height: 84px; gap: 3px; }
.era-node-name { font-size: 10px; max-width: 87px; line-height: 1.18; }
.era-node-year { color: #bcb59e; font-variant-numeric: tabular-nums; }
.era-node[aria-current] .era-node-art {
  border-color: var(--gold);
  background: #453825;
  box-shadow: 0 0 10px #edc98544;
}
.era-node:focus-visible { outline-offset: -1px; border-radius: 3px; }
.era-step {
  align-self: stretch;
  width: 28px;
  padding: 0;
  border: 0;
  background: #181e1eda;
  color: var(--gold);
  font: 25px Georgia, serif;
}
.era-step:disabled { color: #746f5e; cursor: default; }
.era-step:focus-visible { outline-offset: -3px; }
.era-step:hover:enabled { background: #36372d; }
.era-step--previous { border-right: 1px solid var(--trim); }
.era-step--next { border-left: 1px solid var(--trim); }
@media (max-width: 780px) {
  .index-heading .brand { font-size: 16px; }
  .era-step { width: 25px; }
}
@media (max-height: 500px) {
  .era-track { padding-block: 5px 3px; }
  .era-timeline { --logo-height: 33px; }
  .era-node { min-height: 49px; }
  .era-node-name { font-size: 9px; }
  .era-node-year { display: none; }
  .era-fork { margin-top: 7px; }
}

/* Keep long location trails above the overlay controls on compact maps. */
.map-navigation .breadcrumbs {
  min-width: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}
@media (min-width: 1051px) {
  .map-tools { right: calc(18px + var(--lore-toggle-space)); }
  .map-shell:has(.map-tools:not([hidden])) .map-navigation { max-width: calc(100% - 390px - var(--lore-toggle-space)); }
}
@media (min-width: 781px) and (max-width: 1050px) {
  .map-tools { top: 60px; }
  .globe-inset { top: 99px; }
}
@media (max-width: 360px) {
  .index-heading .brand { font-size: 14px; gap: 6px; }
  .index-heading .brand-mark { width: 36px; height: 36px; }
  .map-tools { max-width: calc(100% - 20px); overflow-x: auto; }
  .map-tools button { white-space: nowrap; }
}
.era-stop--classic > .era-node, .era-fork { width: 50%; flex: 0 0 50%; }
.era-fork::before { width: 100%; left: -50%; top: calc(var(--logo-height) / 2 - 12px); }

.placement-tools:not([hidden]) { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.placement-tools button { min-height: 32px; white-space: nowrap; }
.placement-tools button svg { display: block; }
.placement-output { position: absolute; z-index: 20; right: 14px; top: 110px; width: min(400px, 90%); height: 160px; }
.globe-view[data-layout-editing] .globe-overlay { pointer-events: none; }
.globe-view[data-layout-editing] .layout-handle { pointer-events: all; cursor: grab; }
.layout-handle .layout-outline { fill: #e4bb5810; stroke: #d6b875a0; stroke-width: 1.15; }
.layout-handle .layout-dot { fill: #f0ca78; stroke: #241c12; stroke-width: 2; }
.layout-handle .layout-name {
  fill: #ffe5a7; stroke: #120f0c; stroke-width: 3px; paint-order: stroke; font-size: 12px; text-anchor: middle;
}
.layout-handle:hover .layout-outline, .layout-handle:focus-visible .layout-outline,
.layout-handle[data-dragging] .layout-outline { fill: #ffd87d38; stroke: #ffdc85; stroke-width: 2; }
.globe-view.layout-grabbing, .globe-view.layout-grabbing * { cursor: grabbing !important; }

.index-heading .atlas-brand { flex: 1; min-width: 0; }
.brand-crest {
  display: block;
  width: min(100%, 222px);
  height: auto;
  filter: drop-shadow(0 2px 3px #08090d);
}
.map-home .brand-crest { width: 102px; }

#retail-projection, #placement-region-select {
  min-width: 0;
  min-height: 32px;
  padding: 4px 5px;
  border: 1px solid #756345;
  border-radius: 3px;
  background: #222824;
  color: var(--text);
  font: 600 12px var(--sans);
}

.placement-adjustments {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  width: min(330px, calc(100vw - 36px));
  padding: 9px;
  border: 1px solid #756345;
  border-radius: 4px;
  background: #181f1ef5;
  box-shadow: 0 5px 12px #090e0f85;
}

.placement-continent {
  grid-column: 1 / -1;
  color: var(--gold);
  font-size: 11px;
  font-weight: 600;
}

.placement-scale { display: flex; align-items: center; gap: 4px; }
.placement-scale button { width: 33px; padding: 0; font-size: 16px; }
#placement-scale-value { min-width: 42px; text-align: center; font: 600 12px var(--sans); font-variant-numeric: tabular-nums; }
.placement-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 5px; }

@media (max-width: 780px) {
  .map-tools:has(.placement-adjustments:not([hidden])) { overflow: visible; }
  .placement-adjustments { right: auto; left: 0; }
  .placement-scale button { min-height: 36px; width: 36px; }
}
