/* Atlas interface: full-bleed galaxy with floating glass panels.
   Replaces the observatory, chart-room and chart-desk sheets on the map pages.
   Layered over the inline base sheet; the renderer, data and behaviour are unchanged.
   Self-hosted type (SIL OFL 1.1, licences in /assets/fonts/). */

@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/fonts/cormorant-garamond-italic-wght-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/fonts/cormorant-garamond-italic-wght-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/fonts/cormorant-garamond-italic-wght-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: italic;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/fonts/cormorant-garamond-italic-wght-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/fonts/cormorant-garamond-wght-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/fonts/cormorant-garamond-wght-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/fonts/cormorant-garamond-wght-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/fonts/cormorant-garamond-wght-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-400-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-400-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-500-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-500-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-500-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-sans-wght-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-sans-wght-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-sans-wght-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-sans-wght-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Spectral";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/spectral-italic-400-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Spectral";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/spectral-italic-400-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Spectral";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/spectral-italic-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Spectral";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/spectral-italic-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Spectral";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/spectral-400-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Spectral";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/spectral-400-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Spectral";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/spectral-400-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Spectral";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/spectral-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;
  --void: #04050a;
  --void-2: #0b0d14;
  --solid: #090a10;
  --ink: rgba(11, 13, 20, 0.8);
  --ink-deep: rgba(6, 7, 12, 0.92);
  --raise: rgba(236, 226, 200, 0.045);
  --raise-2: rgba(236, 226, 200, 0.085);
  --line: rgba(232, 214, 170, 0.13);
  --line-2: rgba(232, 214, 170, 0.26);

  --bone: #ede6d4;
  --bone-2: #cdc6b5;
  --mist: #a3a9b6;
  --dim: #838999;

  --gold: #d6b56d;
  --gold-hi: #f1d99d;
  --gold-lo: #8f7641;
  --frost: #c3d2e5;
  --crimson: #d9584c;
  --crimson-lo: #7e2c27;
  --cold: #93b4cb;

  /* Names the base sheet and custom-planets.css still read. */
  --amber: var(--gold);
  --amber-soft: rgba(214, 181, 109, 0.72);
  --rust: var(--gold-lo);
  --muted: var(--mist);
  --seal: var(--crimson);
  --panel: var(--solid);
  --shadow: rgba(0, 0, 0, 0.55);

  --display: "Cormorant Garamond", "Palatino Linotype", "Book Antiqua", Georgia, "Noto Serif TC", "Songti TC", PMingLiU, serif;
  --prose: "Spectral", "Palatino Linotype", "Book Antiqua", Georgia, "Noto Serif TC", "Songti TC", PMingLiU, serif;
  --ui: "IBM Plex Sans", "Segoe UI", system-ui, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --mono: "IBM Plex Mono", Consolas, "Liberation Mono", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", monospace;
  --instrument: var(--ui);

  --top: 68px;
  --bottom: 40px;
  --gap: 16px;
  --index-w: 316px;
  --dossier-w: 440px;
  --reading-w: min(760px, calc(100vw - var(--index-w) - 3 * var(--gap) - 80px));
  --dock-nav: 122px;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);

  --icon-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --icon-globe: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.4'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M3.5 12h17M12 3.5c2.6 2.4 4 5.3 4 8.5s-1.4 6.1-4 8.5c-2.6-2.4-4-5.3-4-8.5s1.4-6.1 4-8.5z'/%3E%3C/svg%3E");
  --icon-menu: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M4 7h16M4 12h16M4 17h16'/%3E%3C/svg%3E");
  --icon-expand: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 5h5v5M19 5l-6 6M10 19H5v-5M5 19l6-6'/%3E%3C/svg%3E");
  --icon-reduce: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10h-5V5M15 10l5-5M4 14h5v5M9 14l-5 5'/%3E%3C/svg%3E");
  --icon-list: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'%3E%3Cpath d='M9 7h11M9 12h11M9 17h11M4.5 7h.01M4.5 12h.01M4.5 17h.01'/%3E%3C/svg%3E");
  --icon-target: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='6.5'/%3E%3Ccircle cx='12' cy='12' r='1.6'/%3E%3Cpath d='M12 2.5v3M12 18.5v3M2.5 12h3M18.5 12h3'/%3E%3C/svg%3E");
  --icon-record: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3.5h10v17H7zM10 8h4M10 12h4M10 16h2'/%3E%3C/svg%3E");
  --icon-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'%3E%3Cpath d='M4 5.5h16v13H4z'/%3E%3Cpath d='m4 15 4.5-4 4 3.5 2.5-2 5 4'/%3E%3Ccircle cx='15.5' cy='9.5' r='1.3'/%3E%3C/svg%3E");
}

html,
body {
  background: var(--void);
}
body {
  font-family: var(--ui);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection {
  background: rgba(214, 181, 109, 0.32);
  color: #fff;
}

#app {
  background: none;
  color: var(--bone);
  font: 14px/1.5 var(--ui);
}
/* Edge shade keeps chart lettering quiet behind the masthead and status line. */
#app::after {
  z-index: 15;
  background:
    linear-gradient(180deg, rgba(4, 5, 10, 0.97) 0, rgba(4, 5, 10, 0.9) calc(var(--top) * 0.62), rgba(4, 5, 10, 0.62) var(--top), rgba(4, 5, 10, 0.22) calc(var(--top) + 22px), rgba(4, 5, 10, 0) calc(var(--top) + 64px)),
    linear-gradient(0deg, rgba(4, 5, 10, 0.9) 0, rgba(4, 5, 10, 0.45) var(--bottom), rgba(4, 5, 10, 0) calc(var(--bottom) + 70px)),
    radial-gradient(120% 90% at 52% 50%, rgba(4, 5, 10, 0) 55%, rgba(4, 5, 10, 0.55) 100%);
}
.scanlines,
.purity-seal {
  display: none;
}
#app [hidden] {
  display: none !important;
}

/* One focus ring and one press response everywhere. */
#app :is(button, a, summary, [role="button"], input, select):focus-visible,
#artworkViewer button:focus-visible {
  outline: 1px solid var(--gold-hi);
  outline-offset: 2px;
}
#app :is(.archive-row, .tab, .mobile-workspace button):focus-visible {
  outline-offset: -3px;
}
#app
  .right-panel
  :is(.tab.active, .dossier-action, .dossier-page-link, .relation):focus-visible,
#app .right-panel .tab-content :focus-visible {
  outline-color: var(--gold-hi);
}
#app
  :is(button, summary, .archive-row):not(:disabled):not([aria-disabled="true"]):active,
#artworkViewer button:not(:disabled):active {
  filter: brightness(0.92);
}
@media (hover: hover) and (pointer: fine) {
  #app
    :is(
      .icon-button,
      .toggle,
      .collapse,
      .reading-toggle,
      .era-option,
      .tab,
      .mobile-workspace button
    ):not(:disabled):not(.active):not([aria-pressed="true"]):hover,
  #app :is(.layers-disclosure, .archive-utilities, .archive-filters) > summary:hover,
  #artworkViewer button:not(:disabled):not([aria-pressed="true"]):hover {
    color: var(--gold-hi);
    background-color: var(--raise-2);
    border-color: var(--line-2);
  }
  #app :is(.era-option, .tab):not(:disabled):not(.active):not([aria-pressed="true"]):hover {
    color: var(--bone);
    background-color: transparent;
    border-color: transparent;
  }
  #app .archive-row:not(.active):hover {
    background-color: var(--raise);
    border-left-color: transparent;
  }
  #app :is(.era-option, .toggle)[aria-pressed="true"]:hover {
    border-color: var(--line-2);
  }
  #app .right-panel :is(.dossier-action, .relation):hover {
    background-color: var(--raise-2);
    border-color: var(--gold-lo);
    color: var(--gold-hi);
  }
}

/* Backdrop filters stay off under the boot overlay (see the base sheet). */
body.booting #app :is(.topbar, .bottombar, .panel, .debug, .era-switch, .map-tools, .map-navigation, .mobile-workspace) {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

/* ================================================================ MASTHEAD */
#app .topbar {
  z-index: 40;
  top: 0;
  left: 0;
  right: 0;
  height: var(--top);
  min-height: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 24px;
  padding: 0 22px 0 20px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  clip-path: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  pointer-events: none;
}
#app .topbar > * {
  pointer-events: auto;
}
#app .brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  flex: 0 1 auto;
  color: var(--bone);
  text-transform: none;
  text-shadow: none;
  animation: none;
}
#app .brand-mark {
  width: 42px;
  height: 42px;
  flex: none;
  filter: brightness(1.2) saturate(1.15) drop-shadow(0 0 10px rgba(214, 181, 109, 0.25));
}
#app .brand-inscription {
  display: grid;
  gap: 5px;
  min-width: 0;
}
#app .brand-kicker {
  margin: 0;
  font: 500 9.5px/1 var(--mono);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  opacity: 0.88;
  white-space: nowrap;
}
#app .brand h1 {
  margin: 0;
  font: 600 23px/1 var(--display);
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--bone);
  white-space: nowrap;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.7);
}

#app .top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
#app .top-link,
#app .locale-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--bone-2);
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color 160ms, border-color 160ms, background-color 160ms;
}
#app .top-link:hover,
#app .locale-toggle:hover,
#app .locale-toggle[aria-expanded="true"] {
  color: var(--gold-hi);
  border-color: var(--line-2);
  background: rgba(8, 9, 14, 0.6);
}
#app .top-support {
  color: var(--gold);
  border-color: var(--line-2);
  background: rgba(8, 9, 14, 0.5);
}
#app .top-support::before {
  content: "\2720";
  font: 400 12px/1 var(--ui);
}
#app .top-support:hover {
  border-color: var(--gold-lo);
}
#app .locale-menu {
  position: relative;
}
#app .locale-toggle::before,
#app .locale-toggle::after {
  content: "";
  width: 16px;
  height: 16px;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--icon-globe) center / contain no-repeat;
  mask: var(--icon-globe) center / contain no-repeat;
}
#app .locale-toggle::after {
  width: 12px;
  height: 12px;
  -webkit-mask-image: var(--icon-chevron);
  mask-image: var(--icon-chevron);
}

/* Shared popover surface. */
#app .locale-menu .locale-switch,
#app .archive-utilities .banner-actions,
#app .layers-disclosure .layer-controls {
  position: absolute;
  inset: auto;
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  min-width: 220px;
  width: auto;
  height: auto;
  padding: 8px;
  border: 1px solid var(--line-2);
  border-radius: 0;
  background: rgba(9, 10, 16, 0.96);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  pointer-events: auto;
  white-space: nowrap;
}
#app .locale-menu .locale-switch {
  right: 0;
  top: calc(100% + 8px);
}
#app .locale-menu:not(.open) .locale-switch {
  display: none;
}
#app .locale-switch .locale-label,
#app .locale-switch .language-label,
#app .layers-disclosure .layer-controls::before {
  padding: 8px 10px 10px;
  color: var(--gold);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
#app .locale-menu .locale-switch a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  color: var(--bone-2);
  font: 400 14px/1.2 var(--ui);
  letter-spacing: 0;
  text-decoration: none;
  background: none;
}
#app .locale-menu .locale-switch a::after {
  order: 1;
  flex: 1;
}
#app .locale-switch a[data-locale="en"]::after { content: "English"; }
#app .locale-switch a[data-locale="de"]::after { content: "Deutsch"; }
#app .locale-switch a[data-locale="es"]::after { content: "Español"; }
#app .locale-switch a[data-locale="ru"]::after { content: "Русский"; }
#app .locale-switch a[data-locale="pt-br"]::after { content: "Português (BR)"; }
#app .locale-switch a[data-locale="zh-tw"]::after { content: "繁體中文"; }
#app .locale-menu .locale-code {
  order: 2;
  color: var(--dim);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.14em;
}
#app .locale-flag {
  width: 18px;
  height: 12px;
  border: 1px solid rgba(237, 230, 212, 0.3);
  object-fit: cover;
  flex: none;
}
#app .locale-menu .locale-switch a:hover {
  background: var(--raise);
  color: var(--bone);
}
#app .locale-menu .locale-switch a[aria-current="true"] {
  color: var(--gold-hi);
  background: none;
}
#app .locale-menu .locale-switch a[aria-current="true"] .locale-code {
  color: var(--gold);
}
/* Before the composition script runs the language links sit inline. */
#app .topbar > .locale-switch {
  margin-left: auto;
  border: 1px solid var(--line-2);
  background: rgba(8, 9, 14, 0.6);
}

/* Services menu: the compact home for support, contact and page links. */
#app .archive-utilities {
  position: relative;
  display: none;
  flex: none;
}
#app .archive-utilities > summary {
  width: 36px;
  height: 36px;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  color: var(--bone-2);
  font-size: 0;
  list-style: none;
  cursor: pointer;
}
#app .archive-utilities > summary::-webkit-details-marker {
  display: none;
}
#app .archive-utilities > summary > span {
  display: none;
}
#app .archive-utilities > summary::before {
  content: "";
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: var(--icon-menu) center / contain no-repeat;
  mask: var(--icon-menu) center / contain no-repeat;
}
#app .archive-utilities[open] > summary {
  color: var(--gold-hi);
  border-color: var(--line-2);
  background: rgba(8, 9, 14, 0.6);
}
#app .archive-utilities .banner-actions {
  right: 0;
  top: calc(100% + 8px);
  width: 264px;
  grid-template-columns: none;
  white-space: normal;
}
#app .kofi-skull {
  display: none;
}
#app .banner-actions > .kofi-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: none;
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  min-height: 42px;
  margin: 0;
  padding: 11px 10px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--bone-2);
  font: 400 14px/1.4 var(--ui);
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  text-decoration: none;
  opacity: 1;
  white-space: normal;
  overflow: visible;
}
#app .banner-actions > .kofi-link:hover {
  background: var(--raise);
  color: var(--bone);
}
#app .banner-actions > .contact-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  border-top: 1px solid var(--line);
}
#app .contact-link .contact-face {
  justify-content: flex-start;
  text-align: left;
}
#app .contact-link .contact-email {
  font: 400 12px/1.4 var(--mono);
  color: var(--gold-hi);
}
#app .mobile-service-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 12px 10px 6px;
  border-top: 1px solid var(--line);
}

/* ============================================================== ERA SWITCH */
#app .era-switch {
  position: fixed;
  z-index: 41;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: stretch;
  height: 44px;
  border: 1px solid var(--line-2);
  border-radius: 0;
  background: rgba(8, 9, 14, 0.72);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: none;
}
#app .era-option {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-height: 0;
  padding: 0 20px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--mist);
  text-transform: none;
  text-shadow: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color 200ms, background-color 200ms;
}
#app .era-option + .era-option {
  border-left: 1px solid var(--line-2);
}
#app .era-century {
  font: 600 22px/42px var(--display);
  letter-spacing: 0.04em;
}
#app .era-caption {
  font: 500 9.5px/42px var(--mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
#app .era-option.active {
  color: var(--gold-hi);
  background: linear-gradient(180deg, rgba(214, 181, 109, 0.04), rgba(214, 181, 109, 0.16));
}
#app .era-option.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--gold-hi);
  box-shadow: 0 0 12px var(--gold);
}
#app .era-option[data-era="m42"].active {
  color: #f6c2b6;
  background: linear-gradient(180deg, rgba(217, 88, 76, 0.04), rgba(217, 88, 76, 0.2));
}
#app .era-option[data-era="m42"].active::after {
  background: var(--crimson);
  box-shadow: 0 0 14px var(--crimson);
}

/* ==================================================================== DOCK */
#app .controls {
  position: fixed;
  z-index: 30;
  top: auto;
  left: auto;
  right: calc(var(--gap) + 4px);
  bottom: calc(var(--bottom) + 14px + var(--dock-nav) + 10px);
  width: auto;
  height: auto;
  min-width: 0;
  display: block;
  flex: none;
  gap: 0;
  pointer-events: auto;
  transition: right 460ms var(--ease);
}
#app .map-navigation {
  position: fixed;
  z-index: 30;
  right: calc(var(--gap) + 4px);
  bottom: calc(var(--bottom) + 14px);
  transition: right 460ms var(--ease);
}
#app:has(.right-panel:not(.collapsed)) :is(.controls, .map-navigation) {
  right: calc(var(--dossier-w) + 2 * var(--gap));
}
#app:has(.right-panel.reading:not(.collapsed)) :is(.controls, .map-navigation) {
  right: calc(var(--reading-w) + 2 * var(--gap));
}
#app .map-tools,
#app .map-navigation {
  display: flex;
  flex-direction: column;
  height: auto;
  border: 1px solid var(--line-2);
  border-radius: 0;
  background: rgba(8, 9, 14, 0.78);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
}
#app .map-navigation {
  flex-direction: column-reverse;
}
#app .control-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}
#app .layers-disclosure {
  position: relative;
}
#app .layers-disclosure > summary,
#app .map-tools > #motionToggle,
#app .map-navigation > button {
  width: 40px;
  height: 40px;
  min-height: 0;
  display: grid;
  place-items: center;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--bone-2);
  font-size: 0;
  line-height: 0;
  list-style: none;
  cursor: pointer;
  transition: color 160ms, background-color 160ms;
}
#app .layers-disclosure > summary::-webkit-details-marker {
  display: none;
}
#app .layers-disclosure > summary > span {
  display: none;
}
#app .map-tools > #motionToggle {
  border-top: 1px solid var(--line);
}
#app .map-navigation > button {
  font: 300 20px/1 var(--mono);
}
#app .map-navigation > button + button {
  border-bottom: 1px solid var(--line);
}
#app .layers-disclosure[open] > summary,
#app .map-tools > #motionToggle[aria-pressed="true"] {
  color: var(--gold-hi);
}
#app .layers-disclosure[open] > summary {
  background: var(--raise-2);
}
#motionToggle[aria-pressed="true"] .motion-play,
#motionToggle[aria-pressed="false"] .motion-pause {
  display: none;
}
#app .layers-disclosure .layer-controls {
  right: calc(100% + 10px);
  top: 0;
}
#app .layers-disclosure:not([open]) .layer-controls {
  display: none;
}
#app .layers-disclosure .layer-controls::before {
  content: attr(aria-label);
  white-space: normal;
}
#app .layer-controls > .toggle,
#app .layer-controls > #resetCamera {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  width: 100%;
  height: auto;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--bone-2);
  font: 400 13.5px/1.2 var(--ui);
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}
#app .layer-controls > .toggle .control-icon {
  width: 16px;
  height: 16px;
  flex-basis: 16px;
  color: var(--dim);
}
#app .layer-controls > .toggle[aria-pressed="true"] .control-icon {
  color: var(--gold);
}
#app .layer-controls > .toggle:not([aria-pressed="true"]) {
  color: var(--mist);
}
/* Each layer row ends in a small switch. */
#app .layer-controls > .toggle::after {
  content: "";
  width: 30px;
  height: 16px;
  flex: none;
  margin-left: auto;
  border: 1px solid var(--line-2);
  background: linear-gradient(var(--mist), var(--mist)) 2px 50% / 10px 10px no-repeat;
  transition: background-position 180ms var(--ease), border-color 180ms;
}
#app .layer-controls > .toggle[aria-pressed="true"]::after {
  border-color: var(--gold-lo);
  background:
    linear-gradient(var(--gold-hi), var(--gold-hi)) calc(100% - 2px) 50% / 10px 10px no-repeat,
    rgba(214, 181, 109, 0.14);
}
#app .layer-controls > #resetCamera {
  margin-top: 6px;
  border-top: 1px solid var(--line);
  color: var(--mist);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
#app .ctrl-divider {
  display: none;
}

/* ================================================================ SURFACES */
#app .panel {
  position: fixed;
  z-index: 20;
  top: calc(var(--top) + 8px);
  bottom: calc(var(--bottom) + 8px);
  width: var(--index-w);
  height: auto;
  max-height: none;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: visible;
  transform: none;
  visibility: visible;
  border: 1px solid var(--line);
  border-radius: 0;
  clip-path: none;
  background: linear-gradient(180deg, var(--ink), var(--ink-deep));
  -webkit-backdrop-filter: blur(22px) saturate(1.25);
  backdrop-filter: blur(22px) saturate(1.25);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.55),
    inset 0 2px 0 rgba(255, 255, 255, 0.025);
  transition: opacity 220ms ease, width 460ms var(--ease);
}
#app .panel::before {
  content: none;
}
/* Cartouche corners. */
#app .panel::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 8;
  pointer-events: none;
  border: 0;
  --c: var(--gold);
  --l: 13px;
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) 0 0 / 1px var(--l),
    linear-gradient(var(--c), var(--c)) 100% 0 / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) 100% 0 / 1px var(--l),
    linear-gradient(var(--c), var(--c)) 0 100% / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) 0 100% / 1px var(--l),
    linear-gradient(var(--c), var(--c)) 100% 100% / var(--l) 1px,
    linear-gradient(var(--c), var(--c)) 100% 100% / 1px var(--l);
  background-repeat: no-repeat;
  opacity: 0.75;
}
#app .left-panel {
  left: var(--gap);
}
#app .panel-head {
  flex: none;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 0 10px 0 18px;
  border: 0;
  background: none;
  color: var(--bone);
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.26em;
  text-transform: uppercase;
}
#app .panel-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  /* The title pushes the count and buttons to the far edge. */
  margin-right: auto;
  white-space: nowrap;
}
#app .panel-numeral {
  min-width: 14px;
  color: var(--gold);
  font: 600 15px/1 var(--display);
  letter-spacing: 0.04em;
  text-align: center;
}
#app .collapse,
#app .reading-toggle {
  position: relative;
  width: 30px;
  height: 30px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--mist);
  font-size: 0;
  line-height: 0;
  cursor: pointer;
  transition: color 160ms, border-color 160ms, background-color 160ms;
}
#app .collapse::after {
  content: "";
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 1.5px 0 0 1.5px;
  transform: translateX(2px) rotate(-45deg);
}
#app .right-panel:not(.collapsed) .collapse::after,
#app .left-panel.collapsed .collapse::after {
  transform: translateX(-2px) rotate(135deg);
}

/* A collapsed panel is a small pill that reopens it. */
#app .panel.collapsed {
  bottom: auto;
  width: auto;
  transform: none;
  border-color: var(--line-2);
  background: rgba(8, 9, 14, 0.78);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
  transition: none;
}
#app .panel.collapsed::after {
  content: none;
}
#app .panel.collapsed .panel-body {
  display: none;
}
#app .panel.collapsed .panel-head {
  position: static;
  height: 40px;
  padding: 0 4px 0 14px;
  background: none;
  color: var(--bone-2);
  font-size: 10.5px;
  letter-spacing: 0.22em;
}
#app .panel.collapsed .panel-head span {
  display: inline-flex;
}
#app .panel.collapsed .reading-toggle {
  display: none;
}
#app .panel.collapsed .collapse {
  position: static;
  border-color: transparent;
  background: none;
}
#app .panel.collapsed .collapse::before {
  content: "";
  position: absolute;
  inset: 0;
}
#app .panel.collapsed:hover .panel-head {
  color: var(--gold-hi);
}
#app .panel.collapsed.left-panel,
#app .panel.collapsed.right-panel {
  transform: none;
}
/* With no record selected the dossier leaves the chart entirely. */
#app .right-panel.collapsed:not(:has(.doc-identity)) {
  display: none;
}

/* ============================================================ ARCHIVE INDEX */
#app .left-panel .panel-body {
  flex: 1;
  min-height: 0;
  height: auto;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  opacity: 1;
}
#app .left-panel .result-count {
  flex: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--mist);
  font: 400 10.5px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: none;
  white-space: nowrap;
}
/* Until the composition script moves it into the heading it is a plain line. */
#app .left-panel .panel-body .result-count {
  margin: 10px 18px 0;
}
#app .left-panel.collapsed .result-count,
#app .left-panel.count-crowded .panel-head .result-count,
#app .left-panel:has(.cp-archive-view[hidden]) .result-count {
  display: none;
}
#app .left-panel .cp-archive-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
#app .index-tools {
  position: relative;
  display: block;
  flex: none;
  margin: 0;
  padding: 4px 18px 0;
}
#app #searchInput {
  width: 100%;
  height: 40px;
  margin: 0;
  padding: 0 36px 0 28px;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  border-radius: 0;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a3a9b6' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6'/%3E%3Cpath d='m15 15 5 5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 0 50%;
  background-size: 17px 17px;
  box-shadow: none;
  color: var(--bone);
  font: 400 15px/1 var(--ui);
  outline: 0;
  transition: border-color 160ms;
}
#app #searchInput::placeholder {
  color: var(--dim);
}
#app #searchInput:focus,
#app #searchInput:focus-visible {
  outline: 0;
  border-bottom-color: var(--gold);
  box-shadow: 0 1px 0 var(--gold);
}
#app #searchInput::-webkit-search-cancel-button {
  filter: grayscale(1) brightness(1.6);
  cursor: pointer;
}
#app .search-key {
  position: absolute;
  right: 18px;
  top: 15px;
  padding: 3px 6px;
  border: 1px solid var(--line-2);
  color: var(--dim);
  font: 500 10px/1 var(--mono);
  pointer-events: none;
}
#app .index-tools:focus-within .search-key,
#app #searchInput:not(:placeholder-shown) ~ .search-key {
  display: none;
}
#app .segment-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 14px;
}
#app .segment-chips button {
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: none;
  color: var(--mist);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 160ms, border-color 160ms, background-color 160ms;
}
#app .segment-chips button:hover {
  color: var(--bone);
  border-color: var(--line-2);
}
#app .segment-chips button[aria-pressed="true"] {
  color: var(--gold-hi);
  border-color: var(--gold-lo);
  background: rgba(214, 181, 109, 0.12);
}
#app .archive-filters {
  margin-top: 10px;
  border: 0;
}
#app .archive-filters > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 30px;
  padding: 0;
  color: var(--mist);
  font: 400 13px/1 var(--ui);
  list-style: none;
  cursor: pointer;
}
#app .archive-filters > summary::-webkit-details-marker {
  display: none;
}
#app .filter-state {
  margin-left: auto;
  color: var(--dim);
  font-size: 12px;
}
#app .filter-fields {
  display: grid;
  gap: 4px;
  padding: 0;
}
#app .index-filter {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  height: 30px;
  min-width: 0;
  color: var(--mist);
}
#app .index-filter > span {
  flex: none;
  color: var(--dim);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
#app .index-filter .field {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  width: auto;
  min-width: 0;
  height: 100%;
  padding: 0 20px 0 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--bone-2);
  font: 400 13px/1 var(--ui);
  letter-spacing: 0;
  text-transform: none;
  text-align: right;
  text-align-last: right;
  cursor: pointer;
}
#app .index-filter .field option {
  background: #0c0e15;
  color: var(--bone);
  text-align: left;
}
#app .index-filter::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 13px;
  height: 13px;
  margin-top: -6px;
  background: currentColor;
  -webkit-mask: var(--icon-chevron) center / contain no-repeat;
  mask: var(--icon-chevron) center / contain no-repeat;
  pointer-events: none;
}
#app .index-filter:focus-within {
  color: var(--gold-hi);
}
/* With the chips in place the filters stay open and the segmentum select retires. */
#app.atlas-ready .archive-filters > summary,
#app.atlas-ready .index-filter:has(#segmentFilter) {
  display: none;
}

#app .row-list {
  flex: 1 1 0;
  min-height: 0;
  max-height: none;
  margin-top: 12px;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border-top: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 214, 170, 0.22) transparent;
}
#app .archive-group {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px 9px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 11, 17, 0.95);
  color: var(--gold);
  font: 500 9.5px/1 var(--mono);
  letter-spacing: 0.26em;
  text-transform: uppercase;
}
#app .archive-group::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-2), transparent);
}
#app .archive-group i {
  order: 3;
  color: var(--dim);
  font-style: normal;
  letter-spacing: 0.08em;
}
#app .archive-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  width: auto;
  min-height: 52px;
  margin: 0;
  padding: 9px 18px;
  border: 0;
  border-bottom: 1px solid rgba(232, 214, 170, 0.055);
  border-radius: 0;
  background: none;
  box-shadow: none;
  clip-path: none;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  /* Keeps a revealed row clear of its sticky segmentum heading. */
  scroll-margin: 36px 0 4px;
  transition: background-color 140ms;
}
#app .row-glyph {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  opacity: 0.8;
  filter: none;
  transition: opacity 140ms;
}
#app .row-text {
  flex: 1;
  min-width: 0;
}
#app .archive-row .row-name {
  display: block;
  margin: 0;
  color: var(--bone);
  font: 600 18px/1.15 var(--display);
  letter-spacing: 0.015em;
  text-transform: none;
}
#app .archive-row .row-meta {
  display: block;
  margin-top: 3px;
  color: var(--mist);
  font: 400 11.5px/1.3 var(--ui);
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}
#app .archive-row:hover .row-glyph,
#app .archive-row.active .row-glyph {
  opacity: 1;
}
#app .archive-row:hover .row-name {
  color: var(--bone);
}
#app .archive-row.active {
  background: linear-gradient(90deg, rgba(214, 181, 109, 0.17), rgba(214, 181, 109, 0.03));
}
#app .archive-row.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gold-hi);
  box-shadow: 0 0 12px var(--gold);
}
#app .archive-row.active::after {
  content: none;
}
#app .archive-row.active .row-name {
  color: var(--gold-hi);
}
#app .row-flag {
  margin-left: 7px;
  color: var(--cold);
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  vertical-align: 2px;
}
#app .row-list .dossier-empty {
  height: auto;
  display: block;
  padding: 36px 24px;
  color: var(--mist);
  font: italic 400 15px/1.5 var(--prose);
  text-align: center;
}
#app .index-note {
  order: 6;
  flex: none;
  margin: 0;
  padding: 10px 18px 11px;
  border: 0;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font: 400 10px/1.4 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
#app .index-note::before {
  content: "\2248";
  margin-right: 6px;
  color: var(--gold);
}
#app .chapter-slot {
  order: 5;
  flex: none;
}
#app .chapter-slot:empty {
  display: none;
}
#app .chapter-slot .chapter-placeholder {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-height: 0;
  margin: 0;
  padding: 10px 18px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--mist);
  font: 400 12.5px/1.3 var(--ui);
  text-align: left;
  text-transform: none;
  cursor: not-allowed;
}
#app .chapter-slot .chapter-placeholder small {
  flex: none;
  color: var(--gold);
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ============================================================ WORLD DOSSIER */
#app .right-panel {
  left: auto;
  right: var(--gap);
  width: var(--dossier-w);
  background: linear-gradient(180deg, rgba(10, 11, 17, 0.96), rgba(8, 9, 14, 0.985));
}
#app .right-panel.reading {
  width: var(--reading-w);
}
#app .right-panel:not(.collapsed) .panel-head {
  position: absolute;
  z-index: 7;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  padding: 0 10px 0 18px;
  background: linear-gradient(180deg, rgba(6, 7, 12, 0.85), rgba(6, 7, 12, 0));
  text-shadow: 0 1px 6px #000;
  pointer-events: none;
}
#app .right-panel .panel-head > * {
  pointer-events: auto;
}
#app .right-panel:not(.collapsed):has(.dossier.scrolled) .panel-title {
  visibility: hidden;
}
#app .right-panel:not(.collapsed) :is(.collapse, .reading-toggle) {
  border-color: var(--line);
  background: rgba(6, 7, 12, 0.5);
  color: var(--bone-2);
}
#app .reading-toggle::after {
  content: "";
  width: 16px;
  height: 16px;
  background: currentColor;
  -webkit-mask: var(--icon-expand) center / contain no-repeat;
  mask: var(--icon-expand) center / contain no-repeat;
}
#app .reading-toggle[aria-pressed="true"] {
  color: var(--gold-hi);
  border-color: var(--gold-lo);
}
#app .reading-toggle[aria-pressed="true"]::after {
  -webkit-mask-image: var(--icon-reduce);
  mask-image: var(--icon-reduce);
}
#app .right-panel .panel-body {
  position: relative;
  flex: 1;
  height: auto;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  opacity: 1;
}
#app .right-panel .panel-body::before {
  content: none;
}
#app .dossier {
  height: 100%;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--bone);
  scroll-padding-top: 104px;
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 214, 170, 0.22) transparent;
  user-select: text;
  cursor: auto;
}
#app .dossier-empty {
  height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--bone-2);
  font: italic 400 16px/1.6 var(--prose);
  text-align: center;
}
#app .empty-glyph {
  margin-bottom: 10px;
  color: var(--gold);
  font: 400 40px/1 var(--display);
  text-shadow: 0 0 18px rgba(214, 181, 109, 0.35);
}
#app .empty-sub {
  margin: 10px 0 0;
  color: var(--dim);
  font: 500 10px/1.5 var(--mono);
  font-style: normal;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 1;
}

/* The scrolled record keeps its name in a bar; no height, so nothing jumps. */
#app .doc-mini {
  position: sticky;
  top: 0;
  z-index: 6;
  display: block;
  height: 0;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  opacity: 1;
  overflow: visible;
  transition: none;
}
#app .doc-mini .row-glyph {
  display: none;
}
#app .doc-mini strong {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 50px;
  padding: 0 88px 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--solid);
  color: var(--gold-hi);
  font: 600 21px/50px var(--display);
  letter-spacing: 0.02em;
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  visibility: hidden;
  transition: opacity 200ms ease, visibility 200ms;
}
#app .dossier.scrolled .doc-mini {
  max-height: none;
  padding: 0;
}
#app .dossier.scrolled .doc-mini strong {
  opacity: 1;
  visibility: visible;
}

/* Hero: the artwork leads, the name sits on it. */
#app .record-heading {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 266px;
  padding: 104px 22px 16px;
  background: #05060b;
  overflow: hidden;
}
#app .record-heading > :not(.doc-banner) {
  position: relative;
  z-index: 1;
  pointer-events: none;
}
#app .record-heading .doc-banner {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #05060b;
  clip-path: none;
  overflow: hidden;
  cursor: zoom-in;
}
#app .doc-banner canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* The procedural portrait is the stand-in only while no artwork is in place. */
#app .doc-banner:has(.doc-art) canvas {
  visibility: hidden;
}
#app .doc-art {
  position: absolute;
  left: 50%;
  top: -62px;
  width: 100%;
  max-width: none;
  aspect-ratio: 1;
  display: block;
  object-fit: cover;
  transform: translateX(-50%);
  transition: transform 1600ms var(--ease);
}
#app .doc-banner:hover .doc-art {
  transform: translateX(-50%) scale(1.03);
}
#app .doc-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(9, 10, 16, 0) 34%, rgba(9, 10, 16, 0.62) 62%, rgba(9, 10, 16, 0.96) 90%, var(--solid) 100%),
    linear-gradient(90deg, rgba(8, 9, 14, 0.5), rgba(8, 9, 14, 0) 55%);
}
#app .artwork-trigger-hint {
  position: absolute;
  z-index: 2;
  top: 58px;
  right: 14px;
  left: auto;
  bottom: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: rgba(6, 7, 12, 0.6);
  color: var(--bone-2);
  font: 500 9.5px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: left;
  opacity: 0;
  transition: opacity 200ms, color 160ms, border-color 160ms;
}
#app .artwork-trigger-hint::before {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: var(--icon-image) center / contain no-repeat;
  mask: var(--icon-image) center / contain no-repeat;
}
#app .doc-banner:hover .artwork-trigger-hint,
#app .doc-banner:focus-visible .artwork-trigger-hint {
  opacity: 1;
  color: var(--gold-hi);
  border-color: var(--gold-lo);
}
@media (hover: none) {
  #app .artwork-trigger-hint {
    opacity: 1;
  }
}
#app .doc-bar {
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--gold);
  font: 500 9.5px/1.4 var(--mono);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-shadow: 0 1px 8px #000;
  white-space: normal;
  overflow: visible;
}
#app .doc-bar b {
  color: var(--crimson);
  font-weight: 500;
}
#app .doc-identity {
  display: block;
  margin: 7px 0 0;
  padding: 0;
}
#app .dossier .doc-identity h2 {
  margin: 0;
  color: #fbf5e6;
  font: 600 48px/0.98 var(--display);
  letter-spacing: 0.012em;
  text-transform: none;
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.85);
  text-wrap: balance;
  overflow-wrap: anywhere;
}
#app .dossier .doc-identity h2.name-long {
  font-size: 40px;
}
#app .dossier .doc-identity h2.name-xlong {
  font-size: 33px;
}
#app .classification {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 11px 0 0;
  padding: 0;
  border: 0;
  color: var(--bone-2);
  font: 400 13px/1.3 var(--ui);
}
#app .classification .row-glyph {
  margin: -3px -3px -3px -3px;
  transform: scale(0.8);
  opacity: 1;
}
#app .classification .kv {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0.35em;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
}
#app .classification .kv span,
#app .classification .kv strong {
  display: inline;
  margin: 0;
  color: inherit;
  font: inherit;
  letter-spacing: 0;
  text-transform: none;
}
#app .classification div.kv:first-of-type span {
  display: none;
}
#app .classification div.kv:first-of-type strong {
  color: var(--bone);
  font-weight: 500;
}
#app .classification .kv + .kv::before {
  content: "\25C6";
  align-self: center;
  margin-right: 0.6em;
  color: var(--gold-lo);
  font-size: 8px;
}
#app .badge {
  margin: 0 0 0 auto;
  padding: 4px 6px;
  border: 1px solid var(--gold-lo);
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--gold);
  font: 500 9px/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: help;
  pointer-events: auto;
}
#app .badge::before {
  content: "\2248\00A0";
}

#app .dossier-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0 22px;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--line-2);
}
#app .dossier-meta .kv {
  display: block;
  min-width: 0;
  padding: 11px 14px 11px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
}
#app .dossier-meta .kv:nth-child(even) {
  padding: 11px 0 11px 14px;
  border-left: 1px solid var(--line);
}
#app .dossier-meta .kv span {
  display: block;
  margin: 0;
  color: var(--dim);
  font: 500 9.5px/1 var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
#app .dossier-meta .kv strong {
  display: block;
  margin: 6px 0 0;
  color: var(--bone);
  font: 400 14.5px/1.38 var(--prose);
  overflow-wrap: anywhere;
}

#app .tabs {
  position: sticky;
  top: 50px;
  z-index: 5;
  display: flex;
  gap: 24px;
  height: auto;
  margin: 6px 0 0;
  padding: 0 22px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--solid);
  /* Long translated tab names scroll sideways instead of wrapping. */
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
#app .tabs::-webkit-scrollbar {
  display: none;
}
#app .tab {
  position: relative;
  height: auto;
  padding: 15px 0 14px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--mist);
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.17em;
  text-transform: uppercase;
  white-space: nowrap;
  flex: none;
  cursor: pointer;
  transition: color 160ms;
}
#app .tab.active {
  color: var(--gold-hi);
  background: none;
}
#app .tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--gold-hi);
  box-shadow: 0 0 10px var(--gold);
}
#app .tab-count {
  color: var(--dim);
}
#app .tab-count::before {
  content: "\00B7\00A0";
}
#app .tab.active .tab-count {
  color: var(--gold);
}

#app .tab-content {
  margin: 0;
  padding: 20px 22px 8px;
  background: none;
  color: var(--bone);
}
#app .copy,
#app .section-copy p,
#app .tl-event p {
  margin: 0 0 1em;
  color: #ddd6c4;
  font: 400 16px/1.72 var(--prose);
  letter-spacing: 0;
}
#app .copy:last-child,
#app .section-copy p:last-child {
  margin-bottom: 0;
}
#app .copy + .copy {
  margin-top: 0;
}
#app .section-copy {
  padding: 0;
}
#app .section-copy.section-lead {
  padding: 0 0 20px;
}
/* The drop cap belongs to the opening paragraph only. */
#app .section-copy p:first-child:not(:has(.era-note))::first-letter {
  float: none;
  padding: 0;
  color: inherit;
  font: inherit;
  text-shadow: none;
}
#app .section-lead p:first-child:not(:has(.era-note))::first-letter,
#app .tab-content > p.copy:first-child::first-letter {
  float: left;
  padding: 7px 10px 0 0;
  color: var(--gold-hi);
  font: 600 62px/0.8 var(--display);
  text-shadow: 0 0 24px rgba(214, 181, 109, 0.35);
}
body[data-locale="zh-tw"] #app .section-lead p:first-child:not(:has(.era-note))::first-letter,
body[data-locale="zh-tw"] #app .tab-content > p.copy:first-child::first-letter {
  float: none;
  padding: 0;
  color: inherit;
  font: inherit;
  text-shadow: none;
}
#app .lore-link,
#app .dossier-page-link {
  color: var(--gold-hi);
  text-decoration: underline;
  text-decoration-color: rgba(214, 181, 109, 0.45);
  text-decoration-style: solid;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-shadow: none;
  cursor: pointer;
  transition: text-decoration-color 160ms;
}
#app .lore-link:hover,
#app .dossier-page-link:hover {
  color: var(--gold-hi);
  text-decoration-color: var(--gold-hi);
  text-shadow: none;
}
#app .section-block,
#app .section-block[open] {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: none;
  clip-path: none;
}
#app .section-block:last-of-type {
  border-bottom: 1px solid var(--line);
}
#app .section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 2px;
  border: 0;
  color: var(--bone);
  font: 600 19px/1.1 var(--display);
  letter-spacing: 0.02em;
  text-transform: none;
  list-style: none;
  cursor: pointer;
  transition: color 160ms;
}
#app .section-title::-webkit-details-marker {
  display: none;
}
#app .section-title::after {
  content: "+";
  color: var(--gold);
  font: 400 18px/1 var(--mono);
}
#app .section-block[open] > .section-title::after {
  content: "\2212";
}
#app .section-title:hover {
  color: var(--gold-hi);
}
#app .section-block > .section-copy {
  padding: 0 2px 18px;
}
#app .section-block > .section-copy p {
  font-size: 15.5px;
}
#app .era-note {
  display: inline-block;
  margin-right: 9px;
  padding: 3px 6px;
  border: 1px solid var(--gold-lo);
  color: var(--gold);
  font: 500 9.5px/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  vertical-align: 2px;
}
#app .dossier-sources .section-title {
  color: var(--mist);
  font: 500 10.5px/1.2 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
#app .dossier-sources .section-copy p,
#app .dossier-sources li {
  color: var(--bone-2);
  font: 400 13px/1.6 var(--ui);
}
#app .dossier-sources strong {
  color: var(--bone);
  font-weight: 600;
}
#app .dossier-sources .source-list {
  margin: 10px 0;
  padding-left: 20px;
}
#app .dossier-sources .source-list li {
  margin-bottom: 10px;
}
#app .dossier-sources .source-list a {
  color: var(--gold-hi);
}
#app .dossier-sources .source-kind {
  margin-top: 2px;
  color: var(--dim);
  font: 400 10px/1.4 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 1;
}
#app .dossier-sources p.source-books,
#app .dossier-sources p.source-access {
  margin: 4px 0 0;
  color: var(--mist);
  font: 400 12px/1.5 var(--ui);
}

/* Timeline. */
#app .timeline2 {
  position: relative;
  padding: 4px 0 6px 26px;
}
#app .timeline2::before {
  left: 5px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: linear-gradient(180deg, var(--gold-lo), var(--line) 85%, transparent);
}
#app .tl-event {
  position: relative;
  margin: 0;
  padding-bottom: 20px;
}
#app .tl-event:last-child {
  padding-bottom: 0;
}
#app .tl-node {
  left: -24px;
  top: 4px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--gold);
  background: #0a0b11;
  transform: rotate(45deg);
}
#app .tl-event strong {
  display: block;
  margin: 0;
  color: var(--gold);
  font: 500 11px/1.4 var(--mono);
  letter-spacing: 0.16em;
}
#app .tl-event p {
  margin: 5px 0 0;
  font-size: 15.5px;
  line-height: 1.6;
}
#app .tl-nihilus strong {
  color: var(--cold);
}
#app .tl-nihilus .tl-node {
  border-color: var(--cold);
}
#app .rift-break {
  position: relative;
  margin: 2px 0 22px -26px;
  padding: 9px 0;
  border-top: 1px solid rgba(217, 88, 76, 0.45);
  border-bottom: 1px solid rgba(217, 88, 76, 0.45);
  background: linear-gradient(90deg, rgba(217, 88, 76, 0), rgba(217, 88, 76, 0.2) 20%, rgba(217, 88, 76, 0.2) 80%, rgba(217, 88, 76, 0));
  clip-path: none;
  color: #f0a79d;
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.3em;
  text-align: center;
  text-transform: uppercase;
}

/* Relations. */
#app #relationChart {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 6px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #07080d;
  clip-path: none;
  cursor: pointer;
}
#app .relation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 12px 2px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
  color: var(--bone);
  font: 600 18px/1.15 var(--display);
  letter-spacing: 0.015em;
  text-align: left;
  cursor: pointer;
  transition: color 160ms;
}
#app .relation::after {
  content: "\2192";
  color: var(--dim);
  font: 400 14px/1 var(--mono);
  transition: color 160ms, transform 160ms var(--ease);
}
#app .relation:hover::after {
  color: var(--gold-hi);
  transform: translateX(3px);
}
#app .right-panel .relation:hover {
  background-color: transparent;
}

/* Record footer. */
#app .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 20px 22px 0;
  background: none;
}
#app .chip {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--raise);
  color: var(--bone-2);
  font: 400 11.5px/1 var(--ui);
}
#app .doc-ref {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px 12px;
  margin: 16px 22px 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--line);
  background: none;
  color: var(--mist);
  font: 400 10.5px/1.3 var(--mono);
  letter-spacing: 0.12em;
  overflow-wrap: anywhere;
}
#app .doc-stamp {
  position: static;
  display: inline-block;
  padding: 6px 9px;
  border: 1px solid currentColor;
  border-radius: 0;
  background: none;
  box-shadow:
    inset 0 0 0 2px #0a0b11,
    inset 0 0 0 3px currentColor;
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0.9;
  transform: rotate(-2.5deg);
}
#app .stamp-amber {
  color: var(--gold);
}
#app .stamp-crimson {
  color: var(--crimson);
}
#app .stamp-cold {
  color: var(--cold);
}
#app .dossier-page-link {
  grid-column: 1 / -1;
  justify-self: start;
  font: 400 14px/1.3 var(--prose);
  letter-spacing: 0;
}
#app .locale-fallback {
  grid-column: 1 / -1;
  justify-self: start;
  padding: 2px 5px;
  border: 1px solid var(--line-2);
  color: var(--dim);
}
#app .dossier-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 22px 0;
  padding: 0 0 24px;
  border: 0;
  background: none;
}
#app .dossier-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 0;
  background: var(--raise);
  color: var(--bone-2);
  font: 500 10.5px/1.2 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 160ms, border-color 160ms, background-color 160ms;
}
#app .share-status {
  grid-column: 1 / -1;
  min-height: 16px;
  color: var(--gold);
  font: 400 11px/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-align: left;
}
#app .share-status:empty {
  display: none;
}

/* Expanded record: a wide reading layout. */
#app .right-panel.reading .record-heading {
  min-height: 380px;
  padding: 120px 56px 22px;
}
#app .right-panel.reading .doc-art {
  left: 68%;
  top: -150px;
  width: 78%;
}
#app .right-panel.reading .dossier .doc-identity h2 {
  font-size: 66px;
}
#app .right-panel.reading .dossier .doc-identity h2.name-long {
  font-size: 54px;
}
#app .right-panel.reading .dossier .doc-identity h2.name-xlong {
  font-size: 44px;
}
#app .right-panel.reading .dossier-meta {
  grid-template-columns: repeat(4, 1fr);
  margin: 0 56px;
}
#app .right-panel.reading .dossier-meta .kv,
#app .right-panel.reading .dossier-meta .kv:nth-child(even) {
  padding: 12px 14px;
  border-left: 1px solid var(--line);
}
#app .right-panel.reading .dossier-meta .kv:first-child {
  padding-left: 0;
  border-left: 0;
}
#app .right-panel.reading :is(.tabs, .tab-content, .chips) {
  padding-left: 56px;
  padding-right: 56px;
}
#app .right-panel.reading :is(.doc-ref, .dossier-actions) {
  margin-left: 56px;
  margin-right: 56px;
}
#app .right-panel.reading .doc-mini strong {
  padding-left: 56px;
}
#app .right-panel.reading :is(.copy, .section-copy p, .tl-event p) {
  max-width: 62ch;
}
#app .right-panel.reading :is(.copy, .section-lead p) {
  font-size: 17.5px;
}

/* =============================================================== MAP HINT */
#app .map-hint {
  position: fixed;
  z-index: 16;
  left: calc(50% + (var(--index-w) + var(--gap)) / 2);
  bottom: calc(var(--bottom) + 22px);
  margin: 0;
  transform: translateX(-50%);
  color: var(--bone-2);
  font: italic 500 17px/1 var(--display);
  letter-spacing: 0.03em;
  text-shadow: 0 1px 12px #000;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 400ms;
}
#app .map-hint::before {
  content: "\2020";
  margin-right: 8px;
  color: var(--gold);
  font-style: normal;
}
#app:has(.left-panel.collapsed) .map-hint {
  left: 50%;
}
#app:has(.right-panel .doc-identity) .map-hint,
body:is(.booting, .arrival-cinematic, .arrival-chrome-waiting) #app .map-hint {
  opacity: 0;
}

/* ============================================================== STATUS BAR */
#app .bottombar {
  z-index: 16;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--bottom);
  min-height: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 22px;
  padding: 0 22px 2px 20px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  clip-path: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  color: var(--dim);
  font: 400 11px/1 var(--ui);
  pointer-events: none;
}
#app .bottombar > * {
  pointer-events: auto;
}
#app .footer-copy {
  order: 1;
  flex: 0 1 auto;
  min-width: 120px;
  max-width: none;
  color: var(--dim);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1;
}
#app .thought {
  order: 2;
  position: static;
  left: auto;
  max-width: none;
  flex: 1 1 0;
  min-width: 0;
  display: block;
  transform: none;
  color: var(--bone-2);
  font: italic 500 15px/1.3 var(--display);
  letter-spacing: 0.03em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#app .thought:not(:empty)::before {
  content: "\2720";
  margin-right: 8px;
  color: var(--gold);
  font-style: normal;
}
#app .footer-guides,
#app .bottombar .contact-link {
  order: 3;
  flex: none;
  color: var(--mist);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms;
}
#app .footer-guides:hover,
#app .footer-guides:focus-visible,
#app .bottombar .contact-link:hover {
  color: var(--gold-hi);
  text-decoration: none;
}
#app .bottombar .contact-link {
  order: 4;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  opacity: 1;
}
#app .bottombar .contact-link .contact-email {
  font: 400 10.5px/1 var(--mono);
  letter-spacing: 0.06em;
}
#app .coord-readout {
  order: 5;
  position: static;
  flex: none;
  min-width: 132px;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--gold);
  font: 400 10.5px/1 var(--mono);
  letter-spacing: 0.14em;
  text-align: right;
  white-space: nowrap;
}
#app .fps-readout {
  order: 6;
  flex: none;
  color: var(--mist);
  font: 400 10.5px/1 var(--mono);
  letter-spacing: 0.14em;
}
#app .mobile-service-links a {
  color: var(--mist);
  font: 500 10px/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
}
/* While the masthead has room for the guides link, the status line leaves it out. */
#app.atlas-ready:not(.mast-no-guides) .bottombar .footer-guides[href$="/guides/"] {
  display: none;
}

#app .debug {
  right: calc(var(--gap) + 60px);
  bottom: calc(var(--bottom) + 14px);
  border: 1px solid var(--line-2);
  border-radius: 0;
  background: rgba(8, 9, 14, 0.9);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
  clip-path: none;
  color: var(--bone-2);
  font: 400 11px/1.55 var(--mono);
}

/* ============================================================ MOBILE TABS */
#app .mobile-workspace {
  display: none;
}

/* ================================================= BOOT, INTRO AND VIEWER */
#bootScreen {
  background: var(--void);
}
#skipCameraIntro {
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--line-2);
  background: rgba(8, 9, 14, 0.82);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: var(--bone-2);
  font: 500 11px/1 var(--mono);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
#skipCameraIntro:hover {
  color: var(--gold-hi);
  border-color: var(--gold-lo);
}
#skipCameraIntro:focus-visible {
  outline: 1px solid var(--gold-hi);
  outline-offset: 3px;
}

#artworkViewer {
  border: 1px solid var(--line-2);
  background: #05060b;
  color: var(--bone);
  box-shadow: 0 40px 120px #000;
}
#artworkViewer::backdrop {
  background: rgba(3, 4, 8, 0.93);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
#artworkViewer .artwork-header,
#artworkViewer .artwork-footer {
  background: var(--solid);
  border-color: var(--line);
}
#artworkViewer .artwork-eyebrow,
#artworkViewer .artwork-era-caption {
  color: var(--gold);
  font: 500 9.5px/1.4 var(--mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
#artworkViewer .artwork-header h2 {
  color: var(--bone);
  font: 600 clamp(26px, 3vw, 38px)/1.05 var(--display);
  letter-spacing: 0.02em;
}
#artworkViewer button {
  border: 1px solid var(--line-2);
  border-radius: 0;
  background: var(--raise);
  color: var(--bone-2);
  font: 500 11px/1.2 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
#artworkViewer .artwork-close {
  font: 300 24px/1 var(--mono);
  letter-spacing: 0;
}
#artworkViewer .artwork-eras button[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  border-color: var(--gold-hi);
  color: #17130a;
}
#artworkViewer .artwork-eras button span {
  font-size: 9.5px;
}
#artworkViewer .artwork-status {
  color: var(--bone-2);
  font: italic 400 15px/1.6 var(--prose);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(232, 214, 170, 0.22);
  border-radius: 0;
}

/* ========================================================== CUSTOM PLANETS */
#app .cp-index-tabs {
  display: flex;
  gap: 22px;
  flex: none;
  margin: 0;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
#app .cp-index-tabs::-webkit-scrollbar {
  display: none;
}
#app .cp-index-tab {
  position: relative;
  flex: none;
  min-height: 0;
  white-space: nowrap;
  padding: 8px 0 12px;
  border: 0;
  background: none;
  color: var(--mist);
  font: 500 13.5px/1 var(--ui);
  cursor: pointer;
  transition: color 160ms;
}
#app .cp-index-tab:hover {
  color: var(--bone);
}
#app .cp-index-tab[aria-selected="true"] {
  color: var(--gold-hi);
  background: none;
}
#app .cp-index-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--gold-hi);
}
#app .left-panel .cp-index-tabs + .cp-archive-view .index-tools {
  padding-top: 10px;
}
/* The tabs above already open the custom-planet view. */
#app .left-panel:has(.cp-index-tabs) .chapter-slot .cp-launcher {
  display: none;
}
#app .cp-view {
  flex: 1;
  padding: 18px;
  color: var(--bone-2);
  font: 400 13px/1.55 var(--ui);
  scrollbar-width: thin;
  scrollbar-color: rgba(232, 214, 170, 0.22) transparent;
}
#app .cp-launcher,
#app .cp-button,
.cp-placement-bar .cp-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-2);
  border-radius: 0;
  background: var(--raise);
  box-shadow: none;
  color: var(--bone-2);
  font: 500 10.5px/1.2 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 160ms, border-color 160ms, background-color 160ms;
}
#app .cp-button:hover:not(:disabled),
#app .cp-launcher:hover,
.cp-placement-bar .cp-button:hover {
  color: var(--gold-hi);
  border-color: var(--gold-lo);
  background: var(--raise-2);
}
#app .cp-primary,
.cp-placement-bar .cp-primary {
  border-color: var(--gold-hi);
  background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  color: #17130a;
}
#app .cp-primary:hover:not(:disabled) {
  color: #17130a;
  background: linear-gradient(180deg, #f8e6b6, var(--gold-hi));
}
#app .cp-master {
  padding: 10px 0;
  border-block: 1px solid var(--line);
  color: var(--bone);
  font: 400 13.5px/1.3 var(--ui);
}
#app .cp-local-note,
#app .cp-hint,
#app .cp-save-state,
#app .cp-record-meta,
#app .cp-record-names small {
  color: var(--mist);
  font-family: var(--ui);
}
#app .cp-input {
  border: 1px solid var(--line-2);
  border-radius: 0;
  background: rgba(4, 5, 10, 0.6);
  color: var(--bone);
  font: 400 13px/1.5 var(--ui);
}
#app .cp-input:focus {
  outline: 1px solid var(--gold);
  outline-offset: 0;
}
#app .cp-input::placeholder {
  color: var(--dim);
}
#app .cp-count {
  border-color: var(--line);
  color: var(--gold);
  font: 400 10.5px/1 var(--mono);
  letter-spacing: 0.1em;
}
#app .cp-record,
#app .cp-field-group,
#app .cp-coordinate-box {
  border-color: var(--line);
}
#app .cp-record.is-selected {
  background: linear-gradient(90deg, rgba(214, 181, 109, 0.14), rgba(214, 181, 109, 0.02));
}
#app .cp-record-names strong,
#app .cp-editor-top h2,
#app .cp-dossier-copy :is(h3, h4) {
  color: var(--bone);
  font-family: var(--display);
  font-weight: 600;
}
#app .cp-record-names strong {
  font-size: 18px;
}
#app .cp-editor-top h2 {
  font-size: 25px;
}
#app .cp-field-group > summary {
  color: var(--gold);
  font: 500 10.5px/1.2 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
#app .cp-field > span {
  color: var(--mist);
  font: 400 12px/1.4 var(--ui);
}
#app .cp-message,
#app .cp-confirm {
  border-color: var(--line-2);
  background: var(--raise);
}
#app .cp-message.cp-error,
#app .cp-confirm {
  border-color: rgba(217, 88, 76, 0.55);
  background: rgba(217, 88, 76, 0.08);
}
#app .cp-campaign {
  border-left-color: var(--gold-lo);
}
#app .cp-editor-footer {
  border-top-color: var(--line-2);
  background: var(--solid);
}
#app .cp-dossier-banner {
  border-bottom-color: var(--line);
  background: #05060b;
}
#app .cp-dossier-copy {
  padding: 8px 22px 18px;
  color: #ddd6c4;
}
#app .cp-dossier-copy p {
  font: 400 15.5px/1.7 var(--prose);
}
#app .cp-dossier-copy section + section,
#app .cp-dossier-chronicle article {
  border-color: var(--line);
}
#app .cp-dossier-actions {
  margin: 0 22px 13px;
}
#app .cp-dossier-note {
  margin: 0 22px 22px;
}
.cp-placement-bar {
  border: 1px solid var(--gold-lo);
  border-radius: 0;
  background: rgba(9, 10, 16, 0.96);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  color: var(--bone);
  font: 400 13px/1.5 var(--ui);
}

/* Han characters need more size than letter-spaced Latin capitals at label scale. */
body[data-locale="zh-tw"] #app :is(
  .brand-kicker,
  .top-link,
  .locale-toggle,
  .panel-head,
  .archive-group,
  .segment-chips button,
  .index-filter > span,
  .index-note,
  .doc-bar,
  .badge,
  .dossier-meta .kv span,
  .tab,
  .tl-event strong,
  .era-note,
  .dossier-action,
  .doc-stamp,
  .artwork-trigger-hint,
  .footer-guides,
  .mobile-service-links a,
  .mobile-workspace button,
  .layer-controls > #resetCamera
),
body[data-locale="zh-tw"] #app .bottombar .contact-link,
body[data-locale="zh-tw"] #app .layers-disclosure .layer-controls::before,
body[data-locale="zh-tw"] #app .locale-switch :is(.locale-label, .language-label) {
  font-size: 12px;
  letter-spacing: 0.1em;
}
body[data-locale="zh-tw"] #app .era-caption {
  font-size: 12px;
  letter-spacing: 0.1em;
}

/* ============================================================== RESPONSIVE */
@media (max-width: 1400px) {
  #app .brand h1 {
    font-size: 20px;
    letter-spacing: 0.15em;
  }
  #app .brand-mark {
    width: 38px;
    height: 38px;
  }
}

/* The era switch stays centred. atlas.js measures the masthead and folds the
   brand to two lines, then retires the guides and support links, as each is needed. */
#app.mast-no-guides .top-guides,
#app.mast-no-support .top-support {
  display: none;
}
#app.mast-no-support .archive-utilities {
  display: block;
}
#app.mast-brand-fold .brand-kicker {
  display: none;
}
#app.mast-brand-fold .brand h1 {
  max-width: 12.5em;
  font-size: 16px;
  line-height: 1.14;
  letter-spacing: 0.17em;
  white-space: normal;
}

@media (max-width: 1180px) {
  :root {
    --index-w: 288px;
    --dossier-w: 400px;
  }
  #app .footer-copy {
    display: none;
  }
  #app .panel-head {
    letter-spacing: 0.2em;
  }
  #app .topbar {
    gap: 12px;
  }
}

/* Two-row masthead: brand and menus above, the era switch across the full width. */
@media (max-width: 900px) {
  :root {
    --top: 104px;
  }
  #app .topbar {
    height: 52px;
    padding: 0 10px 0 12px;
  }
  #app .brand-mark {
    width: 34px;
    height: 34px;
  }
  #app .brand-kicker {
    display: none;
  }
  #app .brand h1,
  #app.mast-brand-fold .brand h1 {
    max-width: none;
    font-size: 17px;
    line-height: 1;
    letter-spacing: 0.15em;
    white-space: nowrap;
  }
  #app .top-guides,
  #app .top-support {
    display: none;
  }
  #app .archive-utilities {
    display: block;
  }
  #app .era-switch {
    top: 56px;
    left: 10px;
    right: 10px;
    height: 40px;
    transform: none;
  }
  #app .era-option {
    flex: 1;
    justify-content: center;
  }
  #app .era-century {
    font-size: 20px;
    line-height: 38px;
  }
  #app .era-caption {
    line-height: 38px;
  }
}

@media (max-width: 700px) {
  :root {
    --bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    --gap: 0px;
  }
  #app .topbar {
    top: env(safe-area-inset-top, 0px);
  }
  #app .brand h1,
  #app.mast-brand-fold .brand h1 {
    max-width: 12.5em;
    font-size: 15px;
    line-height: 1.12;
    letter-spacing: 0.17em;
    white-space: normal;
  }
  #app .locale-toggle {
    padding: 0 8px;
  }
  #app .era-switch {
    top: calc(56px + env(safe-area-inset-top, 0px));
  }

  #app .bottombar,
  #app .map-hint,
  #app .left-panel .collapse,
  #app .reading-toggle {
    display: none;
  }
  #app .mobile-workspace {
    position: fixed;
    z-index: 38;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--bottom);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    padding: 0 0 env(safe-area-inset-bottom, 0px);
    border-top: 1px solid var(--line-2);
    background: rgba(7, 8, 13, 0.94);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
  }
  #app .mobile-workspace button {
    position: relative;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 5px;
    border: 0;
    background: none;
    color: var(--mist);
    font: 500 9.5px/1 var(--mono);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
  }
  #app .mobile-workspace button::before {
    content: "";
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: var(--icon-list) center / contain no-repeat;
    mask: var(--icon-list) center / contain no-repeat;
  }
  #app .mobile-workspace button[data-workspace="map"]::before {
    -webkit-mask-image: var(--icon-target);
    mask-image: var(--icon-target);
  }
  #app .mobile-workspace button[data-workspace="record"]::before {
    -webkit-mask-image: var(--icon-record);
    mask-image: var(--icon-record);
  }
  #app .mobile-workspace button:disabled {
    opacity: 0.4;
    cursor: default;
  }
  #app .mobile-workspace button[aria-pressed="true"] {
    color: var(--gold-hi);
    background: none;
  }
  #app .mobile-workspace button[aria-pressed="true"]::after {
    content: "";
    position: absolute;
    top: -1px;
    left: 22%;
    right: 22%;
    height: 2px;
    background: var(--gold-hi);
    box-shadow: 0 0 10px var(--gold);
  }

  /* Archive and record are full sheets between the masthead and the tab bar. */
  #app .panel,
  #app .left-panel,
  #app .right-panel,
  #app .right-panel.reading {
    left: 0;
    right: 0;
    top: calc(var(--top) + env(safe-area-inset-top, 0px));
    bottom: var(--bottom);
    width: auto;
    height: auto;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    box-shadow: none;
    transition: none;
  }
  #app .panel::after {
    content: none;
  }
  #app .panel.collapsed,
  #app .right-panel.collapsed:not(:has(.doc-identity)) {
    display: none;
  }
  #app .left-panel .panel-head {
    padding-right: 18px;
  }
  #app .archive-row {
    min-height: 58px;
  }
  #app .record-heading {
    min-height: 280px;
  }
  #app .dossier .doc-identity h2 {
    font-size: 44px;
  }
  #app .dossier .doc-identity h2.name-long {
    font-size: 36px;
  }
  #app .dossier .doc-identity h2.name-xlong {
    font-size: 30px;
  }
  #app .doc-bar {
    letter-spacing: 0.15em;
  }

  #app .controls,
  #app .map-navigation,
  #app:has(.right-panel:not(.collapsed)) :is(.controls, .map-navigation) {
    right: 10px;
  }
  #app .controls {
    bottom: calc(var(--bottom) + 12px + var(--dock-nav) + 10px);
  }
  #app .map-navigation {
    bottom: calc(var(--bottom) + 12px);
  }
  #app:has(.panel:not(.collapsed)) :is(.map-tools, .map-navigation) {
    display: none;
  }
  #app .layers-disclosure .layer-controls {
    top: auto;
    bottom: 0;
  }
  #app .debug {
    right: 60px;
  }
}

@media (max-width: 360px) {
  #app .era-caption {
    display: none;
  }
}

/* Short desktop windows keep the dock clear of the record. */
@media (max-height: 520px) and (min-width: 701px) {
  #app .record-heading {
    min-height: 200px;
    padding-top: 70px;
  }
  #app .doc-art {
    top: -110px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #app *,
  #app *::before,
  #app *::after,
  #artworkViewer * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
