:root {
  --bg: #fff;
  --surface: #f6f7f9;
  --text: #171a20;
  --muted: #606875;
  --border: #dde1e7;
  --accent: #3159ba;
  --danger: #9c3a36;
  --font: Arial,'Hiragino Sans','Yu Gothic',sans-serif;
  color-scheme: light;
  font-family: var(--font);
  color: var(--text);
  font-size: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,input,select {
  font: inherit;
  color: inherit;
}

button,select {
  cursor: pointer;
}

button {
  border: 1px solid var(--border);
  background: white;
  border-radius: 6px;
  min-height: 36px;
  padding: 6px 12px;
  transition: background .15s,border .15s;
}

button:hover {
  background: #f0f3f9;
  border-color: #aebaca;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,canvas:focus-visible {
  outline: 3px solid #91b1ec;
  outline-offset: 2px;
}

button[aria-pressed=true],button.active {
  background: #eaf0fc;
  color: #254a9b;
  border-color: #b8c8e8;
}

button:disabled {
  cursor: default;
  opacity: .5;
}

input,select {
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 6px 8px;
  background: white;
  min-height: 34px;
}

input[type=range] {
  accent-color: #657996;
  min-height: 0;
  padding: 0;
}

a {
  color: #3159ba;
}

h1,h2,h3,p {
  margin: 0;
}

h2 {
  font-size: 23px;
  line-height: 1.7;
}

h3 {
  font-size: 14px;
  line-height: 1.7;
}

p {
  line-height: 1.85;
}

small {
  font-size: 12px;
}

.quiet {
  border-color: transparent;
  background: transparent;
}

.masthead {
  height: 84px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-family: 'Helvetica Neue',Arial,sans-serif;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -1.25px;
  text-decoration: none;
  color: #171a20;
  white-space: nowrap;
}

.brand span {
  color: #6d7d99;
}

.brand small {
  display: block;
  font-family: var(--font);
  font-size: 10px;
  letter-spacing: 2.5px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 4px;
}

.search-wrap {
  position: relative;
  margin-left: 30px;
  flex: 1;
  max-width: 410px;
}

.search-wrap>svg {
  position: absolute;
  left: 14px;
  top: 12px;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #687282;
  stroke-width: 1.7;
}

.search-wrap input {
  height: 42px;
  width: 100%;
  padding-left: 42px;
  padding-right: 34px;
  background: #f7f8fa;
  border-color: transparent;
}

.search-wrap kbd {
  position: absolute;
  right: 13px;
  top: 12px;
  color: #8a93a1;
}

.local-badge {
  margin-left: auto;
  color: #697381;
  font-size: 11px;
  white-space: nowrap;
  letter-spacing: .3px;
}

.local-badge i {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #688878;
  border-radius: 50%;
  margin-right: 5px;
}

.search-results {
  position: absolute;
  top: 48px;
  width: 440px;
  max-width: 90vw;
  max-height: 480px;
  overflow: auto;
  z-index: 30;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 32px #18325820;
  padding: 6px;
}

.search-results button {
  border: 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
  width: 100%;
  padding: 10px;
}

.search-results small {
  color: var(--muted);
}

.search-results p {
  padding: 16px;
}

.context-bar {
  height: 62px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
}

.viewpoint-field {
  display: flex;
  align-items: center;
  gap: 16px;
}

.field-label {
  font-size: 11px;
  letter-spacing: .7px;
  color: #717987;
}

.viewpoint-field select {
  font-weight: 600;
  border: 0;
  background: #f2f5fa;
  min-width: 180px;
}

.separator {
  height: 20px;
  border-left: 1px solid var(--border);
}

.date-field {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.date-field input,.date-field select {
  border: 0;
  font-size: 12px;
  background: transparent;
}

.quality-pill {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  border: 0;
}

.quality-pill span {
  background: #f4eee6;
  color: #805e37;
  padding: 4px 7px;
  border-radius: 4px;
  margin-left: 7px;
}

.workspace {
  display: grid;
  grid-template-columns: 84px minmax(0,1fr) 318px;
  height: calc(100dvh - 174px);
  min-height: 550px;
}

.view-nav {
  border-right: 1px solid var(--border);
  padding: 16px 8px;
  overflow: auto;
  scrollbar-width: thin;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-group {
  font-size: 9px;
  letter-spacing: 1px;
  color: #939aa4;
  text-align: center;
  margin: 12px 0 6px;
}

.view-nav button {
  border: 0;
  border-radius: 8px;
  min-height: 53px;
  flex-shrink: 0;
  padding: 7px 2px;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  font-size: 10px;
  color: #737c8c;
}

.view-nav button.active {
  background: #eef2fa;
  color: #294d96;
}

.view-nav button:hover {
  background: #f3f5f8;
}

.view-nav svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.4;
}

.main-area {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.view-heading {
  padding: 27px 28px 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  color: #748199;
  margin-bottom: 8px;
}

h1 {
  font-size: 24px;
  letter-spacing: .4px;
  font-weight: 600;
}

.view-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 7px;
}

.display-controls {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding-top: 12px;
}

.display-controls button {
  font-size: 12px;
  white-space: nowrap;
}

.layer-bar {
  display: flex;
  gap: 7px;
  padding: 0 28px 15px;
  overflow: auto;
  flex-shrink: 0;
}

.layer-bar button {
  border-radius: 20px;
  min-height: 30px;
  padding: 4px 13px;
  font-size: 11px;
  white-space: nowrap;
}

.layer-bar .active {
  color: #272e3c;
  background: #f1f4f8;
  border-color: #bfc9d8;
}

.map-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 28px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid #eff1f4;
}

.map-options label {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.map-options input {
  width: 70px;
}

.map-options select {
  font-size: 11px;
  min-height: 26px;
  max-width: 220px;
}

.stage {
  position: relative;
  flex: 1;
  min-height: 280px;
  overflow: hidden;
  background: #fafbfc;
  border-top: 1px solid #eef0f4;
  border-bottom: 1px solid #eef0f4;
}

.stage canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

.stage canvas:active {
  cursor: grabbing;
}

.map-guide {
  position: absolute;
  left: 25px;
  bottom: 20px;
  pointer-events: none;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #657188;
  background: #ffffffd9;
  padding: 10px 13px;
  border-left: 2px solid #b8c5d9;
}

.map-guide strong {
  font-weight: 500;
  color: #3e4b60;
}

.map-tools {
  position: absolute;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.map-tools button {
  padding: 0;
  width: 31px;
  min-height: 31px;
  background: #ffffffec;
  color: #68758b;
  font-size: 16px;
}

.map-caption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 24px;
  color: #77808e;
  font-size: 10px;
  line-height: 1.7;
}

.time-strip {
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 13px 26px;
}

.time-strip>button:first-child {
  width: 36px;
  padding: 0;
  color: #4d607f;
}

.time-strip strong {
  font-size: 12px;
  display: block;
  margin-top: 3px;
  letter-spacing: 1px;
}

.timeline-slider {
  flex: 1;
  min-width: 50px;
  padding-top: 7px;
}

.timeline-slider input {
  width: 100%;
  height: 3px;
}

.timeline-slider>div {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #8590a0;
  margin-top: 9px;
}

.time-strip .quiet {
  font-size: 11px;
}

.dossier {
  border-left: 1px solid var(--border);
  overflow: auto;
  background: #fff;
  scrollbar-width: thin;
}

.dossier-intro {
  padding: 36px 26px;
}

.dossier-intro h2 {
  font-weight: 500;
  font-size: 23px;
  line-height: 1.65;
}

.dossier-intro>p:not(.eyebrow) {
  font-size: 12px;
  color: var(--muted);
  margin-top: 20px;
}

.intro-diagram {
  margin: 33px 4px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.intro-diagram span {
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 11px;
  width: 200px;
  text-align: center;
  background: #fafbfc;
}

.intro-diagram i {
  font-style: normal;
  font-size: 10px;
  color: #8490a0;
  padding: 9px;
}

.dossier-intro ol {
  font-size: 12px;
  color: var(--muted);
  line-height: 2.4;
  padding-left: 20px;
}

.dossier-intro .muted {
  font-size: 10px!important;
  border-top: 1px solid var(--border);
  padding-top: 18px;
  margin-top: 28px!important;
}

.statusbar {
  height: 28px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 0 22px;
  border-top: 1px solid var(--border);
  background: #f7f8fa;
  font-size: 10px;
  color: #828b98;
}

.loading {
  position: absolute;
  inset: 0;
  background: #fafcfdef;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: var(--muted);
  z-index: 5;
}

.loading[hidden] {
  display: none;
}

.workspace.panel-hidden {
  grid-template-columns: 84px minmax(0,1fr);
}

.workspace.panel-hidden .dossier {
  display: none;
}

.dossier-head {
  padding: 23px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #fffffff5;
  z-index: 3;
}

.dossier-head h2 {
  font-size: 23px;
  line-height: 1.4;
  margin: 9px 0;
  overflow-wrap: anywhere;
}

.dossier-head .meta {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
}

.dossier-actions {
  display: flex;
  gap: 6px;
  margin-top: 15px;
}

.dossier-actions button {
  font-size: 11px;
  flex: 1;
  padding: 5px;
}

.dossier-section {
  padding: 21px 24px;
  border-bottom: 1px solid #e9edf2;
}

.dossier-section h3 {
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
}

.dossier-section h3 span {
  font-weight: 400;
  font-size: 11px;
  color: var(--muted);
}

.dossier-section p {
  font-size: 12px;
  color: var(--muted);
}

.reason-box {
  background: #f2f5fb;
  border-left: 2px solid #b7c8e8;
  padding: 12px 13px;
  font-size: 11px;
  line-height: 1.85;
  color: #53647d;
}

.reason-box strong {
  display: block;
  font-size: 11px;
  color: #2b456e;
  margin-bottom: 5px;
}

.relation-row {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #eef0f4;
  border-radius: 0;
  padding: 11px 0;
  font-size: 12px;
  background: transparent;
}

.relation-row strong {
  display: block;
  font-weight: 500;
  margin-top: 4px;
}

.relation-row .sub {
  display: flex;
  gap: 6px;
  font-size: 10px;
  color: #7f8896;
}

.badge {
  display: inline-block;
  font-size: 10px;
  color: #60728b;
  background: #eef2f8;
  border-radius: 3px;
  padding: 2px 5px;
  font-weight: 400;
}

.badge.warn {
  color: #865c2c;
  background: #f8f0e5;
}

.badge.estimate {
  color: #81658d;
  background: #f3edf6;
}

.badge.unknown {
  color: #6c737e;
  background: #f0f2f5;
}

.metric-row {
  padding: 12px 0;
  border-bottom: 1px solid #edf0f3;
}

.metric-row strong {
  display: block;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -.5px;
  margin: 5px 0;
}

.metric-row small {
  color: #7d8796;
  font-size: 10px;
}

.metric-row p {
  font-size: 11px;
}

.evidence-item {
  border: 1px solid var(--border);
  padding: 13px;
  border-radius: 5px;
  margin: 10px 0;
}

.evidence-item h3 {
  font-size: 13px;
  overflow-wrap: anywhere;
  line-height: 1.7;
}

.evidence-item p {
  font-size: 12px;
  color: var(--muted);
  margin: 7px 0;
  overflow-wrap: anywhere;
}

.evidence-item a {
  font-size: 11px;
  overflow-wrap: anywhere;
}

.evidence-item blockquote {
  margin: 10px 0;
  padding: 10px;
  background: #f7f8fa;
  border-left: 2px solid #bcc8d8;
  font-size: 12px;
  line-height: 1.8;
}

.text-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.8;
  margin-top: 10px;
}

.list-empty {
  padding: 30px 20px;
  color: var(--muted);
  line-height: 1.9;
  font-size: 13px;
}

#view-content {
  height: 100%;
  overflow: auto;
  padding: 20px 25px;
  background: white;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

th {
  position: sticky;
  top: -20px;
  background: #f7f8fa;
  z-index: 1;
  color: #778294;
  font-weight: 500;
  font-size: 10px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 13px 12px;
  border-bottom: 1px solid #edf0f4;
  vertical-align: top;
  line-height: 1.8;
}

td button {
  padding: 0;
  border: 0;
  background: transparent!important;
  text-align: left;
  min-height: 0;
  font-size: 12px;
  color: #2d4e81;
}

td small {
  font-size: 10px;
  color: var(--muted);
}

.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 12px;
}

.section-toolbar select {
  font-size: 12px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.compare-column {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px;
}

.compare-column>h3 {
  font-size: 17px;
}

.compare-row {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.compare-row button {
  border: 0;
  padding: 0;
  font-weight: 500;
  font-size: 13px;
  min-height: 24px;
}

.score-bar {
  height: 4px;
  background: #eef1f5;
  margin: 9px 0;
}

.score-bar span {
  display: block;
  height: 100%;
  background: #8ba2c8;
}

.compare-row p {
  font-size: 11px;
  color: var(--muted);
}

.article {
  max-width: 690px;
  margin: 8px auto;
}

.article .article-index {
  color: #8490a2;
  font-size: 11px;
  letter-spacing: 2px;
}

.article h2 {
  font-size: 27px;
  margin: 8px 0 18px;
  font-weight: 500;
}

.article p {
  margin: 14px 0;
  font-size: 14px;
  color: #485367;
  line-height: 2;
}

.article h3 {
  font-size: 17px;
  margin: 30px 0 14px;
}

.article .article-footnote {
  font-size: 11px;
  border-top: 1px solid var(--border);
  padding-top: 15px;
  color: #8993a1;
}

.timeline-item {
  display: grid;
  grid-template-columns: 94px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.timeline-item time {
  font-size: 12px;
  color: #78869d;
}

.timeline-item h3 {
  font-weight: 500;
  font-size: 13px;
}

.timeline-item p {
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
}

.flow-row {
  display: grid;
  grid-template-columns: 1fr 64px 1fr;
  gap: 12px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.flow-row .flow-arrow {
  color: #95a6c2;
  text-align: center;
  font-size: 27px;
}

.flow-row button {
  border: 0;
  text-align: left;
  padding: 0;
}

.flow-row p {
  font-size: 10px;
  color: var(--muted);
}

.flow-row strong {
  font-size: 12px;
  font-weight: 500;
}

.flow-meta {
  grid-column: 1/-1;
  font-size: 11px;
  background: #f7f8fa;
  padding: 8px 10px;
  color: #66738a;
}

.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(175px,1fr));
  gap: 12px;
}

.country-box {
  border: 1px solid var(--border);
  padding: 18px;
  border-radius: 5px;
}

.country-box h3 {
  font-size: 16px;
  margin-bottom: 12px;
}

.country-box button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  padding: 5px 0;
  font-size: 11px;
  min-height: 28px;
}

.scenario-banner {
  background: #f8f2ea;
  border: 1px solid #e9d9c0;
  padding: 16px 18px;
  font-size: 12px;
  line-height: 1.8;
  margin-bottom: 18px;
  color: #795c35;
}

.scenario-banner button {
  margin-left: 12px;
  font-size: 11px;
}

.trace-step {
  border-left: 2px solid #d5dfef;
  padding: 8px 18px;
  margin-left: 14px;
  margin-bottom: 8px;
}

.trace-step p {
  font-size: 11px;
  color: var(--muted);
}

.trace-step button {
  padding: 0;
  border: 0;
  font-size: 13px;
}

.quality-stats {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  gap: 12px;
  margin: 15px 0;
}

.quality-stats div {
  padding: 16px;
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
}

.quality-stats strong {
  display: block;
  font-size: 25px;
  font-weight: 500;
  color: #29354a;
  margin-top: 8px;
}

dialog {
  max-width: 780px;
  width: calc(100vw - 32px);
  max-height: 85dvh;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 25px 100px #10284630;
}

dialog::backdrop {
  background: #1a26363b;
  backdrop-filter: blur(3px);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 26px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.modal-head h2 {
  font-size: 18px;
}

.modal-head button {
  font-size: 21px;
  border: 0;
}

#modal-content {
  padding: 24px 26px;
}

#modal-content>p {
  font-size: 13px;
  line-height: 1.9;
  color: var(--muted);
  margin-bottom: 12px;
}

#toast {
  position: fixed;
  bottom: 42px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background: #26344b;
  color: white;
  font-size: 12px;
  z-index: 100;
  border-radius: 6px;
  box-shadow: 0 5px 25px #1f314933;
  max-width: 90vw;
}

#map-tooltip {
  position: absolute;
  background: #fffffff5;
  border: 1px solid #cbd6e6;
  border-radius: 5px;
  padding: 10px 13px;
  box-shadow: 0 6px 20px #19345615;
  pointer-events: none;
  max-width: 270px;
  font-size: 12px;
  line-height: 1.7;
  z-index: 4;
}

#map-tooltip small {
  display: block;
  font-size: 10px;
  color: var(--muted);
}

.table-wrap {
  overflow: auto;
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 11px;
  background: #f5f7fa;
  padding: 14px;
  line-height: 1.8;
}

.error {
  padding: 25px;
  color: #8a4035;
}

.retry {
  display: block;
  margin: 15px auto;
}

.muted {
  color: var(--muted);
}

[hidden] {
  display: none!important;
}

@media(min-width:1750px) {
  .workspace {
    grid-template-columns: 92px minmax(0,1fr) 350px;
  }
  .view-heading {
    padding-top: 32px;
  }
  .dossier-intro {
    padding: 42px 30px;
  }
  .view-heading h1 {
    font-size: 28px;
  }
}

@media(max-width:1250px) {
  .masthead {
    padding: 0 20px;
    gap: 10px;
  }
  .brand {
    font-size: 23px;
  }
  .search-wrap {
    margin-left: 10px;
  }
  .local-badge {
    display: none;
  }
  .context-bar {
    gap: 12px;
    padding: 0 20px;
  }
  .workspace {
    grid-template-columns: 74px minmax(0,1fr) 280px;
  }
  .view-heading {
    padding: 24px 20px 13px;
    gap: 8px;
  }
  h1 {
    font-size: 21px;
  }
  .display-controls {
    gap: 3px;
  }
  .display-controls button {
    font-size: 10px;
    padding: 6px 8px;
  }
  .view-subtitle {
    font-size: 11px;
  }
  .layer-bar {
    padding-left: 20px;
    padding-right: 20px;
  }
  .map-options {
    padding-left: 20px;
    padding-right: 20px;
  }
  .dossier-intro {
    padding: 28px 20px;
  }
  .dossier-intro h2 {
    font-size: 21px;
  }
  .dossier-head,.dossier-section {
    padding: 20px;
  }
  .map-caption {
    font-size: 9px;
    flex-wrap: wrap;
    gap: 0;
  }
  .workspace.panel-hidden {
    grid-template-columns: 74px minmax(0,1fr);
  }
}

@media(max-width:960px) {
  .workspace {
    grid-template-columns: 70px minmax(0,1fr) 250px;
  }
  .context-bar {
    gap: 7px;
  }
  .field-label {
    font-size: 10px;
  }
  .viewpoint-field {
    gap: 8px;
  }
  .viewpoint-field select {
    min-width: 130px;
    font-size: 12px;
  }
  .quality-pill {
    font-size: 10px;
    padding: 4px;
  }
  .date-field {
    font-size: 10px;
    gap: 3px;
  }
  .date-field input,.date-field select {
    font-size: 10px;
    padding: 4px;
  }
  .view-heading {
    flex-direction: column;
    padding-top: 17px;
  }
  .display-controls {
    padding-top: 0;
  }
  .dossier-intro h2 {
    font-size: 19px;
  }
  .map-options {
    flex-wrap: wrap;
  }
  .comparison-grid {
    grid-template-columns: 1fr;
  }
}

@media(max-width:700px) {
  .masthead {
    height: auto;
    min-height: 108px;
    flex-wrap: wrap;
    padding: 15px 16px 12px;
    gap: 8px;
  }
  .brand {
    font-size: 23px;
  }
  .brand small {
    font-size: 9px;
  }
  .masthead>.quiet {
    font-size: 10px;
    padding: 4px 7px;
    min-height: 30px;
  }
  .masthead #save {
    margin-left: auto;
  }
  .search-wrap {
    order: 5;
    max-width: none;
    width: 100%;
    margin: 4px 0 0;
    flex-basis: 100%;
  }
  .search-wrap input {
    height: 37px;
    font-size: 12px;
  }
  .search-wrap>svg {
    top: 10px;
  }
  .search-wrap kbd {
    top: 10px;
  }
  .context-bar {
    height: auto;
    min-height: 85px;
    padding: 12px 16px;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: space-between;
  }
  .context-bar .separator {
    display: none;
  }
  .viewpoint-field {
    width: 100%;
    justify-content: space-between;
  }
  .viewpoint-field select {
    min-width: 190px;
  }
  .quality-pill {
    margin-left: 0;
  }
  .workspace {
    height: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .view-nav {
    height: 73px;
    flex-direction: row;
    padding: 6px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    gap: 3px;
    overflow-x: auto;
  }
  .view-nav button {
    min-width: 55px;
    min-height: 57px;
    font-size: 10px;
  }
  .nav-group {
    display: none;
  }
  .main-area {
    overflow: visible;
  }
  .view-heading {
    padding: 20px 18px 13px;
    flex-direction: row;
  }
  .view-heading h1 {
    font-size: 20px;
  }
  .view-subtitle {
    max-width: 230px;
    font-size: 10px;
  }
  .display-controls {
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 104px;
  }
  .display-controls #toggle-panel {
    display: none;
  }
  .display-controls button {
    min-height: 28px;
  }
  .layer-bar {
    padding: 0 18px 12px;
  }
  .layer-bar button {
    font-size: 10px;
    padding: 3px 10px;
    min-height: 28px;
  }
  .map-options {
    padding: 9px 18px;
    gap: 6px;
    font-size: 10px;
  }
  .map-options input {
    width: 54px;
  }
  .stage {
    flex: none;
    height: 450px;
    min-height: 0;
  }
  .map-guide {
    left: 12px;
    bottom: 13px;
    font-size: 9px;
    padding: 8px 9px;
    max-width: 270px;
  }
  .map-guide span {
    max-width: 220px;
  }
  .map-tools {
    right: 10px;
    bottom: 13px;
  }
  .map-caption {
    padding: 8px 15px;
    font-size: 9px;
    gap: 3px;
    flex-direction: column;
  }
  .time-strip {
    padding: 12px 15px;
    gap: 11px;
  }
  .time-strip>button:first-child {
    width: 30px;
    min-height: 30px;
  }
  .time-strip .quiet {
    padding: 4px;
    font-size: 10px;
  }
  .time-strip strong {
    font-size: 11px;
  }
  .dossier {
    border-left: 0;
    border-top: 1px solid var(--border);
    max-height: none;
    overflow: visible;
  }
  .dossier-intro {
    padding: 25px;
  }
  .dossier-intro h2 br {
    display: none;
  }
  .intro-diagram {
    flex-direction: row;
    margin: 25px 0;
    gap: 8px;
    align-items: center;
  }
  .intro-diagram span {
    width: auto;
    padding: 10px;
    font-size: 10px;
    flex: 1;
  }
  .intro-diagram i {
    font-size: 0;
    padding: 0;
  }
  .intro-diagram i:after {
    content: '→';
    font-size: 13px;
  }
  .dossier-intro .muted {
    margin-top: 18px!important;
  }
  .statusbar {
    height: auto;
    min-height: 45px;
    padding: 10px 15px;
    flex-wrap: wrap;
    font-size: 9px;
  }
  .statusbar>span:nth-child(2) {
    display: none;
  }
  .workspace.panel-hidden {
    display: flex;
  }
  .workspace.panel-hidden .dossier {
    display: block;
  }
  #view-content {
    padding: 15px;
  }
  .comparison-grid {
    grid-template-columns: 1fr;
  }
  .quality-stats {
    grid-template-columns: 1fr 1fr;
  }
  .modal-head,#modal-content {
    padding: 18px;
  }
  .article h2 {
    font-size: 22px;
  }
  .article p {
    font-size: 12px;
  }
  .flow-row {
    gap: 7px;
    grid-template-columns: 1fr 30px 1fr;
  }
  .timeline-item {
    grid-template-columns: 75px 1fr;
    gap: 10px;
  }
  .dossier-head {
    position: static;
  }
  .map-options select {
    max-width: 210px;
  }
}

#root-pill {
  font-size: 10px;
  background: #edf2fa;
  color: #42618b;
  padding: 3px 8px;
  border-radius: 4px;
  max-width: 290px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#root-pill button {
  font-size: 10px;
  border: 0;
  background: transparent;
  padding: 0 0 0 7px;
  min-height: 20px;
}

.map-options:has(#root-pill:not([hidden])) {
  flex-wrap: wrap;
}
