@charset "UTF-8";

.progression {
  --tree-accent: #376d8b;
  --tree-accent-dark: #24516b;
  --tree-band: #edf3f4;
  --tree-band-alt: #e7eff2;
  --tree-head: #dae7ed;
  --tree-border: #acbec8;
  --tree-route: #809eac;
  min-width: 0;
}
.progression[data-progression-kind="civics"] {
  --tree-accent: #7b5489;
  --tree-accent-dark: #60426b;
  --tree-band: #f2edf3;
  --tree-band-alt: #ece6ef;
  --tree-head: #e8ddec;
  --tree-border: #c3b0ca;
  --tree-route: #a18caa;
}
.progression-topline { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.progression-track-nav { display: inline-flex; gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.progression-track-link { display: inline-flex; align-items: center; gap: 8px; min-height: 43px; padding: 9px 16px; border: 1px solid transparent; border-radius: 4px; color: var(--muted); font-size: 15px; font-weight: 650; line-height: 1.4; }
.progression-track-link img { width: 23px; height: 23px; object-fit: contain; }
.progression-track-link[aria-current="page"] { border-color: var(--tree-border); background: var(--tree-head); color: var(--tree-accent-dark); }
.progression-track-link:hover { color: var(--tree-accent-dark); background: var(--tree-band); }
.progression-list-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--teal); font-size: 14px; }
.progression-list-link svg { width: 17px; height: 17px; }
.progression-list-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.progression-era-nav { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); margin: 0; border: 1px solid var(--tree-border); border-bottom: 0; border-radius: 6px 6px 0 0; overflow: hidden; background: var(--surface); }
.progression-era-nav a { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 3px 7px; min-height: 47px; padding: 10px 5px; border-right: 1px solid var(--line-soft); color: var(--muted); font-size: 14px; font-weight: 600; line-height: 1.5; }
.progression-era-nav a:last-child { border-right: 0; }
.progression-era-nav small { font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; opacity: .85; }
.progression-era-nav a[aria-current="true"] { background: var(--tree-accent); color: #fff; }
.progression-era-nav a:hover { background: var(--tree-head); color: var(--tree-accent-dark); }
.progression-tools { display: flex; align-items: center; gap: 14px; min-height: 65px; padding: 10px 13px; border: 1px solid var(--tree-border); background: var(--surface); }
.progression-find { display: flex; flex: 0 1 300px; align-items: center; gap: 8px; min-width: 100px; min-height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); }
.progression-find svg { width: 18px; height: 18px; color: var(--muted); }
.progression-find input { width: 100%; min-width: 0; min-height: 40px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 14px; }
.progression-find:focus-within { border-color: var(--tree-accent); box-shadow: 0 0 0 2px var(--tree-head); }
.progression-legend { display: flex; align-items: center; gap: 8px; margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.progression-legend-line { position: relative; display: block; width: 28px; height: 1px; background: var(--tree-route); }
.progression-legend-line::after { position: absolute; top: -3px; right: 0; width: 6px; height: 6px; border-top: 1px solid var(--tree-route); border-right: 1px solid var(--tree-route); transform: rotate(45deg); content: ""; }
.progression-reset { flex-shrink: 0; min-height: 40px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--muted); font-size: 13px; }
.progression-reset:hover { border-color: var(--tree-border); background: var(--tree-band); color: var(--tree-accent-dark); }
.progression-expand { flex-shrink: 0; min-height: 40px; padding: 6px 12px; border: 1px solid var(--tree-border); border-radius: 4px; background: var(--tree-head); color: var(--tree-accent-dark); font-size: 13px; font-weight: 650; }
.progression-expand:hover, .progression-expand[aria-pressed="true"] { border-color: var(--tree-accent); background: var(--tree-accent); color: #fff; }
.progression-status { margin: 0; padding: 11px 15px; border-inline: 1px solid var(--tree-border); background: var(--tree-head); color: var(--tree-accent-dark); font-size: 14px; line-height: 1.6; }
.progression-scroll { position: relative; width: 100%; height: min(76vh, 820px); min-height: 420px; overflow: auto; overscroll-behavior: contain; border: 1px solid var(--tree-border); border-top: 0; border-radius: 0 0 5px 5px; background: var(--tree-band); scrollbar-width: auto; scrollbar-color: var(--tree-accent) var(--tree-head); scroll-behavior: smooth; scroll-padding: 76px 24px 20px; }
.progression-scroll:focus-visible { outline-offset: 3px; }
.progression-stage { position: relative; isolation: isolate; }
.progression-era-bands { position: absolute; inset: 0; pointer-events: none; }
.progression-era { position: absolute; top: 0; height: 100%; border-right: 1px solid var(--tree-border); background: var(--tree-band); }
.progression-era-alternate { background: var(--tree-band-alt); }
.progression-era-title { position: sticky; z-index: 5; top: 0; display: flex; align-items: baseline; gap: 10px; height: 58px; margin: 0; padding: 15px 28px; border-bottom: 1px solid var(--tree-border); background: var(--tree-head); color: var(--tree-accent-dark); font-size: 18px; font-weight: 750; line-height: 1.5; letter-spacing: -.3px; white-space: nowrap; box-shadow: 0 2px 3px #16313c05; }
.progression-era-title small { font-size: 12px; font-weight: 450; letter-spacing: 0; }
.progression-future-note { margin-left: auto; padding: 2px 8px; border: 1px solid var(--tree-border); border-radius: 3px; font-size: 11px; font-weight: 500; letter-spacing: 0; }
.progression-connections { position: absolute; z-index: 1; inset: 0; overflow: visible; color: var(--tree-route); pointer-events: none; }
.progression-connection { stroke: var(--tree-route); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: opacity 120ms ease, stroke 120ms ease; }
.progression-connection.is-highlighted { stroke: var(--tree-accent-dark); stroke-width: 3; color: var(--tree-accent-dark); }
.progression-connection.is-dimmed { opacity: .16; }
.progression-node { position: absolute; z-index: 2; top: var(--node-y); left: var(--node-x); display: flex; flex-direction: column; width: 238px; height: 182px; margin: 0; border: 1px solid var(--tree-border); border-radius: 6px; background: var(--surface); color: var(--text); box-shadow: 0 2px 4px #16313c0a; transition: opacity 120ms ease, border-color 120ms ease, box-shadow 120ms ease; scroll-margin: 76px 26px 24px; }
.progression-node:hover { border-color: var(--tree-accent); }
.progression-node-top { position: relative; display: flex; flex-shrink: 0; align-items: center; gap: 5px; min-height: 66px; padding: 8px 10px 7px 8px; border-bottom: 1px solid var(--tree-head); border-radius: 5px 5px 0 0; background: linear-gradient(100deg, var(--tree-band), var(--surface)); }
.progression-node h3 { flex: 1; min-width: 0; margin: 0; color: var(--tree-accent-dark); font-size: 15px; font-weight: 750; line-height: 1.45; letter-spacing: -.3px; }
.progression-node-link { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 45px; }
.progression-node-link > span:last-child { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; word-break: keep-all; overflow-wrap: anywhere; }
.progression-node-link:hover > span:last-child { text-decoration: underline; text-underline-offset: 3px; }
.progression-node-picture { display: grid; flex: 0 0 auto; place-items: center; width: 43px; height: 43px; padding: 4px; border: 1px solid var(--tree-border); border-radius: 50%; background: var(--tree-accent-dark); }
.progression-node-picture img { width: 35px; height: 35px; object-fit: contain; }
.progression-cost { display: flex; flex: 0 0 auto; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-width: 33px; color: var(--tree-accent-dark); font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.4; }
.progression-cost img { width: 19px; height: 19px; object-fit: contain; }
.progression-boost { display: -webkit-box; flex: 1 0 auto; height: 44px; margin: 9px 11px 0; overflow: hidden; color: #5e695f; font-size: 12px; line-height: 1.7; -webkit-box-orient: vertical; -webkit-line-clamp: 2; word-break: keep-all; overflow-wrap: anywhere; }
.progression-boost > span { color: var(--tree-accent-dark); font-weight: 700; }
.progression-node-bottom { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 3px; min-height: 43px; margin: auto 8px 6px; padding-top: 5px; border-top: 1px solid var(--line-soft); }
.progression-unlocks { display: flex; align-items: center; gap: 2px; min-width: 0; }
.progression-unlock { display: grid; flex: 0 0 auto; place-items: center; width: 23px; height: 30px; border-radius: 3px; }
.progression-unlock img { width: 23px; height: 26px; object-fit: contain; }
.progression-unlock[data-category="units"] img, .progression-unlock[data-monochrome="true"] img { width: 23px; height: 23px; padding: 3px; border-radius: 50%; background: #355747; }
.progression-unlock:hover { background: var(--tree-head); outline: 1px solid var(--tree-border); }
.progression-unlocks-more { display: grid; flex-shrink: 0; place-items: center; min-width: 23px; min-height: 30px; color: var(--tree-accent-dark); font-size: 11px; font-weight: 650; line-height: 1; }
.progression-unlocks-more:hover { text-decoration: underline; }
.progression-no-unlocks { color: #7a8378; font-size: 11px; }
.progression-path-button { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 3px; min-width: 43px; min-height: 31px; padding: 3px 5px; border: 1px solid var(--tree-border); border-radius: 4px; background: var(--tree-band); color: var(--tree-accent-dark); font-size: 11px; font-weight: 600; line-height: 1.5; }
.progression-path-button svg { width: 12px; height: 12px; }
.progression-path-button:hover, .progression-path-button[aria-pressed="true"] { background: var(--tree-accent); color: #fff; }
.progression-path-button:disabled { padding-inline: 4px; border-style: dashed; color: var(--muted); background: var(--paper); font-size: 10px; }
.progression-path-button:disabled svg { display: none; }
.progression-node.is-selected { z-index: 4; border-color: var(--tree-accent-dark); box-shadow: 0 0 0 3px var(--tree-accent), 0 5px 12px #16313c18; }
.progression-node.is-prerequisite { z-index: 3; border-color: var(--tree-accent); box-shadow: 0 0 0 1px var(--tree-accent); }
.progression-node.is-dimmed { opacity: .32; }
.progression-node.is-dimmed:focus-within, .progression-node.is-dimmed:hover { opacity: 1; }
.progression-node.is-randomized { border-style: dashed; }
.progression-bottomline { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 5px 20px; margin-top: 10px; color: var(--muted); font-size: 12px; }

/* An app-local full-window view keeps chart controls and native page links. */
body.tree-expanded .sidebar, body.tree-expanded .topbar, body.tree-expanded .page-footer, body.tree-expanded .mobile-overlay, body.tree-expanded main > .dictionary-heading { display: none !important; }
body.tree-expanded .workspace { min-height: 100dvh; margin-left: 0; }
body.tree-expanded main { width: 100%; max-width: none; min-height: 0; padding: 12px; }
body.tree-expanded .progression { display: flex; flex-direction: column; height: calc(100dvh - 24px); min-height: 0; }
body.tree-expanded .progression-topline, body.tree-expanded .progression-era-nav, body.tree-expanded .progression-tools, body.tree-expanded .progression-status, body.tree-expanded .progression-bottomline { flex-shrink: 0; }
body.tree-expanded .progression-topline { margin-bottom: 10px; }
body.tree-expanded .progression-track-link { min-height: 36px; padding-block: 6px; }
body.tree-expanded .progression-era-nav a { min-height: 44px; padding-block: 8px; }
body.tree-expanded .progression-tools { min-height: 58px; padding-block: 7px; }
body.tree-expanded .progression-scroll { flex: 1 1 auto; height: calc(100dvh - 210px); min-height: 240px; }
body.tree-expanded .progression-bottomline { margin-top: 8px; }

@media (max-width: 1100px) {
  .progression-era-nav a { gap: 0 5px; font-size: 12px; }
  .progression-era-nav small { font-size: 10px; }
  .progression-legend { display: none; }
  .progression-reset { margin-left: auto; }
}
@media (max-width: 640px) {
  .progression-topline { gap: 8px; margin-bottom: 14px; }
  .progression-track-nav { flex: 1 1 auto; }
  .progression-track-link { flex: 1; justify-content: center; gap: 6px; min-height: 43px; padding-inline: 10px; font-size: 13px; }
  .progression-track-link img { width: 20px; height: 20px; }
  .progression-list-link { margin-left: auto; min-height: 35px; font-size: 12px; }
  .progression-era-nav { display: flex; overflow: auto; scrollbar-width: thin; }
  .progression-era-nav a { flex: 0 0 auto; min-width: 68px; min-height: 45px; padding-inline: 10px; font-size: 13px; }
  .progression-era-nav a:nth-child(4) { min-width: 86px; }
  .progression-tools { gap: 8px; min-height: 62px; padding-inline: 8px; }
  .progression-find { flex-basis: auto; flex-grow: 1; }
  .progression-find input { font-size: 13px; }
  .progression-reset { padding-inline: 8px; font-size: 12px; }
  .progression-expand { padding-inline: 8px; font-size: 12px; }
  .progression-scroll { height: 68vh; min-height: 400px; }
  .progression-status { padding: 10px 12px; font-size: 13px; }
  .progression-bottomline { font-size: 11px; }
  body.tree-expanded main { padding: 8px; }
  body.tree-expanded .progression { height: calc(100dvh - 16px); }
}
@media (prefers-reduced-motion: reduce) {
  .progression-scroll { scroll-behavior: auto; }
  .progression-node, .progression-connection { transition: none; }
}
@media print {
  .progression-tools { display: none; }
  .progression-scroll { height: auto; max-height: none; overflow: visible; }
}
