:root {
  --portal-ink: #152024;
  --portal-muted: #657276;
  --portal-line: #ccd5d6;
  --portal-teal: #147f84;
  --portal-red: #bd3e35;
  --portal-surface: rgba(246, 249, 249, 0.94);
}

.portal-home {
  position: absolute;
  z-index: 80;
  inset: 72px 0 86px;
  display: grid;
  grid-template-columns: minmax(220px, 0.78fr) minmax(430px, 1.65fr) minmax(270px, 0.9fr);
  grid-template-rows: minmax(0, 1fr);
  color: var(--portal-ink);
  background: var(--portal-surface);
  border-top: 1px solid rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px) saturate(0.8);
  transition: opacity 280ms ease, visibility 280ms ease;
}

.portal-home[hidden] {
  display: none;
}

body.portal-experience-open .portal-home {
  bottom: 0;
}

body.portal-experience-open .timeline-bar {
  visibility: hidden;
}

.portal-modes,
.portal-reading,
.portal-context {
  min-width: 0;
}

.portal-modes {
  grid-row: 1;
  display: grid;
  grid-template-rows: auto repeat(4, minmax(62px, 1fr)) 52px 52px;
  padding: 28px 0 24px 28px;
  border-right: 1px solid var(--portal-line);
}

.portal-modes header,
.portal-context header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 0 22px 18px 0;
}

.portal-modes header span,
.portal-context header span,
.portal-reading-index span {
  font-size: 12px;
  font-weight: 700;
  color: var(--portal-teal);
}

.portal-modes header small,
.portal-context header small,
.portal-reading-index small {
  font-size: 11px;
  color: var(--portal-muted);
}

.portal-modes button {
  display: grid;
  grid-template-columns: 34px 1fr;
  grid-template-rows: 1fr 1fr;
  align-items: end;
  min-height: 58px;
  padding: 9px 18px 9px 0;
  color: var(--portal-ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--portal-line);
  cursor: pointer;
}

.portal-modes button > span {
  grid-row: 1 / 3;
  align-self: center;
  font: 600 10px/1 ui-monospace, monospace;
  color: #849093;
}

.portal-modes button b {
  align-self: end;
  font: 600 17px/1.15 "Songti SC", "STSong", serif;
}

.portal-modes button small {
  align-self: start;
  margin-top: 3px;
  color: var(--portal-muted);
  font-size: 10px;
}

.portal-modes button:hover,
.portal-modes button:focus-visible {
  color: var(--portal-red);
  background: rgba(255, 255, 255, 0.62);
  outline: none;
}

.portal-modes button:active {
  transform: translateY(1px);
}

.portal-modes .portal-lab-launch {
  margin-right: 18px;
  padding: 8px 12px;
  color: #fff;
  background: var(--portal-ink);
  border: 1px solid var(--portal-ink);
}

.discovery-shell {
  display: grid;
  min-height: 100%;
  grid-template-columns: minmax(230px, 0.72fr) minmax(460px, 1.8fr) minmax(240px, 0.78fr);
}

.discovery-controls,
.discovery-reading {
  padding: 30px;
}

.discovery-controls {
  border-right: 1px solid var(--portal-line);
}

.discovery-reading {
  border-left: 1px solid var(--portal-line);
}

.discovery-controls > small,
.discovery-results header small,
.discovery-reading > span {
  color: var(--portal-teal);
  font: 600 9px/1 ui-monospace, monospace;
}

.discovery-controls h3,
.discovery-reading h3 {
  margin: 10px 0 24px;
  font: 600 20px/1.2 "Songti SC", "STSong", serif;
}

.discovery-controls form {
  display: grid;
  gap: 16px;
}

.discovery-controls label {
  display: grid;
  gap: 7px;
  color: var(--portal-muted);
  font-size: 10px;
}

.discovery-controls select,
.discovery-controls input {
  width: 100%;
  min-height: 40px;
  padding: 0 30px 0 10px;
  color: var(--portal-ink);
  background: #fff;
  border: 1px solid var(--portal-line);
  border-radius: 3px;
  font-size: 12px;
}

.discovery-controls button,
.discovery-pagination button {
  min-height: 38px;
  color: var(--portal-ink);
  background: transparent;
  border: 1px solid var(--portal-line);
  border-radius: 3px;
  cursor: pointer;
}

.discovery-filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.discovery-filter-actions button[type="submit"] {
  color: #fff;
  background: var(--portal-teal);
  border-color: var(--portal-teal);
}

.discovery-controls button:hover,
.discovery-pagination button:hover:not(:disabled) {
  color: #fff;
  background: var(--portal-red);
  border-color: var(--portal-red);
}

.discovery-results {
  min-width: 0;
  padding: 30px clamp(24px, 4vw, 52px);
}

.discovery-results > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--portal-line);
}

.discovery-results h3 {
  margin: 9px 0 0;
  font: 600 28px/1.15 "Songti SC", "STSong", serif;
}

.discovery-results header strong {
  flex: 0 0 auto;
  color: var(--portal-red);
  font: 500 30px/1 "Songti SC", "STSong", serif;
}

.discovery-results header strong small {
  color: var(--portal-muted);
  font: 500 10px/1 sans-serif;
}

.discovery-result-list {
  display: grid;
}

.discovery-result {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 94px;
  padding: 14px 0;
  color: var(--portal-ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--portal-line);
  cursor: pointer;
}

.discovery-result > span {
  color: var(--portal-red);
  font: 600 9px/1 ui-monospace, monospace;
}

.discovery-result div {
  min-width: 0;
}

.discovery-result small,
.discovery-result em {
  color: var(--portal-muted);
  font-size: 9px;
  font-style: normal;
}

.discovery-result b {
  display: block;
  margin: 5px 0;
  font: 600 16px/1.2 "Songti SC", "STSong", serif;
}

.discovery-result p {
  margin: 0;
  overflow: hidden;
  color: var(--portal-muted);
  font-size: 10px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discovery-result:hover b,
.discovery-result:focus-visible b {
  color: var(--portal-red);
}

.discovery-empty {
  display: grid;
  min-height: 260px;
  place-content: center;
  text-align: center;
}

.discovery-empty b {
  font: 600 22px/1.3 "Songti SC", "STSong", serif;
}

.discovery-empty p,
.discovery-reading p {
  max-width: 30em;
  color: var(--portal-muted);
  font-size: 10px;
  line-height: 1.7;
}

.discovery-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  color: var(--portal-muted);
  font: 500 9px/1 ui-monospace, monospace;
}

.discovery-pagination button {
  padding: 0 14px;
}

.discovery-pagination button:disabled {
  opacity: 0.35;
  cursor: default;
}

.discovery-reading dl {
  display: grid;
  margin: 0 0 24px;
}

.discovery-reading dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--portal-line);
  font-size: 10px;
}

.discovery-reading dd {
  margin: 0;
  text-align: right;
}

.portal-modes .portal-lab-launch > span,
.portal-modes .portal-lab-launch small {
  color: #aebabc;
}

.portal-modes .portal-lab-launch:hover,
.portal-modes .portal-lab-launch:focus-visible {
  color: #fff;
  background: var(--portal-red);
  border-color: var(--portal-red);
}

.portal-reading {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(38px, 6vh, 74px) clamp(42px, 6vw, 100px);
  overflow: hidden;
}

.portal-reading::after {
  position: absolute;
  right: 7%;
  bottom: 8%;
  content: "诗";
  color: rgba(21, 32, 36, 0.035);
  font: 400 min(32vw, 390px)/0.8 "Songti SC", "STSong", serif;
  pointer-events: none;
}

.portal-reading-index {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: clamp(22px, 4vh, 44px);
}

.portal-reading-index::before {
  width: 34px;
  height: 1px;
  content: "";
  background: var(--portal-red);
}

.portal-reading h1 {
  position: relative;
  z-index: 1;
  margin: 0 0 24px;
  font: 500 clamp(42px, 5vw, 74px)/1 "Songti SC", "STSong", serif;
  letter-spacing: 0;
}

.portal-reading blockquote {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #2f3a3e;
  font: 400 clamp(18px, 2vw, 28px)/1.9 "Songti SC", "STSong", serif;
}

.portal-reading blockquote p {
  margin: 0;
}

.portal-reading-note {
  position: relative;
  z-index: 1;
  max-width: 31em;
  margin: 24px 0 0;
  color: var(--portal-muted);
  font-size: 13px;
  line-height: 1.75;
}

.portal-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  margin-top: clamp(24px, 4vh, 42px);
}

.portal-actions button {
  min-height: 42px;
  padding: 0 22px;
  border-radius: 4px;
  font-weight: 700;
  cursor: pointer;
}

.portal-primary {
  color: #fff;
  background: var(--portal-red);
  border: 1px solid var(--portal-red);
}

.portal-secondary {
  color: var(--portal-ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--portal-line);
}

.portal-actions button:active {
  transform: translateY(1px);
}

.portal-context {
  display: flex;
  flex-direction: column;
  padding: 28px 28px 24px;
  background: rgba(255, 255, 255, 0.46);
  border-left: 1px solid var(--portal-line);
}

.portal-context dl {
  margin: 8px 0 28px;
  border-top: 1px solid var(--portal-line);
}

.portal-context dl div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 15px 0;
  border-bottom: 1px solid var(--portal-line);
}

.portal-context dt {
  color: var(--portal-muted);
  font-size: 12px;
}

.portal-context dd {
  margin: 0;
  font: 600 22px/1 ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

.portal-context dl div > small {
  flex-basis: 100%;
  margin-top: 6px;
  color: var(--portal-muted);
  font-size: 10px;
  text-align: right;
}

.portal-search {
  margin-top: auto;
}

.portal-search label {
  display: block;
  margin-bottom: 9px;
  font-size: 12px;
  font-weight: 700;
}

.portal-search > div {
  display: grid;
  grid-template-columns: 1fr 42px;
  background: #fff;
  border: 1px solid #aebbbc;
  border-radius: 4px;
}

.portal-search input {
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  color: var(--portal-ink);
  background: transparent;
  border: 0;
  outline: none;
}

.portal-search input::placeholder {
  color: #788487;
}

.portal-search button {
  color: #fff;
  background: var(--portal-teal);
  border: 0;
  border-radius: 0 3px 3px 0;
  font-size: 18px;
  cursor: pointer;
}

.portal-evidence-note {
  margin: 16px 0;
  color: var(--portal-muted);
  font-size: 10px;
  line-height: 1.6;
}

.portal-context > a {
  color: var(--portal-ink);
  font-size: 11px;
  text-decoration: none;
}

.portal-context > a span {
  color: var(--portal-red);
}

.portal-experience {
  position: absolute;
  z-index: 6;
  inset: 0;
  display: grid;
  grid-template-rows: 76px minmax(0, 1fr);
  color: var(--portal-ink);
  background: #f4f7f7;
}

.portal-experience[hidden] { display: none; }

.experience-header {
  display: grid;
  grid-template-columns: 54px minmax(220px, 0.8fr) minmax(260px, 1.2fr) auto;
  align-items: center;
  border-bottom: 1px solid var(--portal-line);
}

.experience-header > button {
  align-self: stretch;
  padding: 0 18px;
  color: var(--portal-ink);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--portal-line);
  cursor: pointer;
}

.experience-header > button:hover,
.experience-header > button:focus-visible {
  color: #fff;
  background: var(--portal-red);
  outline: none;
}

.experience-header > div {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 0 24px;
}

.experience-header span {
  color: var(--portal-red);
  font: 600 10px/1 ui-monospace, monospace;
}

.experience-header h2 {
  margin: 0;
  font: 600 24px/1 "Songti SC", "STSong", serif;
}

.experience-header p {
  margin: 0;
  color: var(--portal-muted);
  font-size: 12px;
}

#experience-enter-workspace {
  min-width: 164px;
  border-right: 0;
  border-left: 1px solid var(--portal-line);
  font-size: 11px;
}

.experience-body {
  min-height: 0;
  overflow: auto;
}

.experience-loading {
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--portal-muted);
  font-size: 12px;
}

.experience-grid {
  display: grid;
  min-height: 100%;
  grid-template-columns: minmax(210px, 0.7fr) minmax(420px, 1.7fr) minmax(250px, 0.9fr);
}

.experience-controls,
.experience-notes {
  padding: 30px;
}

.experience-controls { border-right: 1px solid var(--portal-line); }
.experience-notes { border-left: 1px solid var(--portal-line); }

.experience-controls h3,
.experience-notes h3 {
  margin: 0 0 22px;
  font-size: 12px;
}

.experience-choice-list { display: grid; }

.experience-choice-list button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 0;
  color: var(--portal-ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--portal-line);
  cursor: pointer;
}

.experience-choice-list button[aria-pressed="true"] { color: var(--portal-red); }
.experience-choice-list button small { color: var(--portal-muted); }

.life-author-search {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.life-author-search span,
.life-discovery-heading span,
.life-discovery-note,
.life-author-state {
  color: var(--portal-muted);
  font-size: 9px;
  line-height: 1.5;
}

.life-author-search input {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  color: var(--portal-ink);
  background: #fff;
  border: 1px solid var(--portal-line);
  border-radius: 0;
  outline: none;
}

.life-author-search input:focus {
  border-color: var(--portal-teal);
  box-shadow: inset 3px 0 0 var(--portal-teal);
}

.life-discovery-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 24px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--portal-line);
}

.life-discovery-heading b {
  font-size: 10px;
  font-weight: 700;
}

.life-author-results {
  display: grid;
  max-height: 300px;
  overflow-y: auto;
}

.life-author-results button {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  color: var(--portal-ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--portal-line);
  cursor: pointer;
}

.life-author-results button:hover,
.life-author-results button:focus-visible,
.life-author-results button[aria-pressed="true"] {
  color: var(--portal-red);
  outline: none;
}

.life-author-results button small {
  color: var(--portal-muted);
  white-space: nowrap;
}

.life-discovery-note { margin: 12px 0 0; }
.life-author-state { margin: 14px 0; }

.life-chronology {
  margin: 20px 0 18px;
  border-top: 1px solid var(--portal-line);
  border-bottom: 1px solid var(--portal-line);
}

.life-chronology > header {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.life-chronology > header div {
  display: grid;
  gap: 4px;
}

.life-chronology > header small,
.life-chronology-track article small,
.life-chronology-boundary {
  color: var(--portal-muted);
  font-size: 9px;
}

.life-chronology > header b {
  font-size: 14px;
}

.life-chronology > header strong {
  font: 500 20px/1 ui-monospace, monospace;
}

.life-chronology-track {
  display: grid;
  grid-auto-columns: minmax(220px, 0.72fr);
  grid-auto-flow: column;
  overflow-x: auto;
  border-top: 1px solid var(--portal-line);
  scrollbar-width: thin;
}

.life-chronology-track article {
  min-height: 150px;
  padding: 18px 18px 16px;
  border-right: 1px solid var(--portal-line);
}

.life-chronology-track time {
  color: var(--portal-red);
  font: 600 22px/1 ui-monospace, monospace;
}

.life-chronology-track p {
  margin: 14px 0 16px;
  color: var(--portal-ink);
  font-size: 12px;
  line-height: 1.7;
}

.life-chronology-track article small {
  display: block;
  overflow-wrap: anywhere;
}

.life-chronology-empty,
.life-chronology-boundary {
  margin: 0;
  padding: 14px 0;
  border-top: 1px solid var(--portal-line);
  line-height: 1.6;
}

.life-biography-excerpt {
  margin: 12px 0;
  color: var(--portal-ink);
  font-size: 11px;
  line-height: 1.8;
}

.experience-canvas {
  position: relative;
  min-width: 0;
  padding: clamp(34px, 5vw, 72px);
  overflow: hidden;
}

.experience-canvas > small {
  color: var(--portal-teal);
  font-size: 11px;
  font-weight: 700;
}

.experience-canvas > h3 {
  max-width: 760px;
  margin: 18px 0 34px;
  font: 500 clamp(44px, 6vw, 86px)/0.98 "Songti SC", "STSong", serif;
}

.city-era-list,
.life-work-list,
.birth-layer-list {
  display: grid;
  margin-top: 26px;
  border-top: 1px solid var(--portal-line);
}

.city-era,
.life-work,
.birth-layer {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 18px;
  align-items: baseline;
  padding: 15px 0;
  border-bottom: 1px solid var(--portal-line);
}

.city-era b,
.life-work b,
.birth-layer b {
  font: 500 18px/1.3 "Songti SC", "STSong", serif;
}

.city-era p,
.life-work p,
.birth-layer p {
  margin: 0;
  color: var(--portal-muted);
  font-size: 11px;
  line-height: 1.6;
}

.city-era span,
.life-work span,
.birth-layer span {
  color: var(--portal-red);
  font: 600 10px/1 ui-monospace, monospace;
}

.city-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 16px 0 24px;
}

.city-heading h3 {
  margin: 0;
  font: 500 clamp(48px, 6vw, 84px)/0.95 "Songti SC", "STSong", serif;
}

.city-heading p {
  max-width: 260px;
  margin: 0 0 7px;
  color: var(--portal-muted);
  font-size: 11px;
  line-height: 1.6;
  text-align: right;
}

.city-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--portal-line);
}

.city-metrics span {
  display: grid;
  gap: 5px;
  padding: 14px 10px 13px 0;
  color: var(--portal-muted);
  font-size: 9px;
}

.city-metrics b {
  color: var(--portal-ink);
  font: 600 20px/1 ui-monospace, monospace;
}

.city-era-tabs {
  display: flex;
  gap: 0;
  margin-top: 28px;
  overflow-x: auto;
  border-bottom: 1px solid var(--portal-line);
}

.city-era-tabs button {
  display: grid;
  flex: 0 0 auto;
  gap: 5px;
  min-width: 112px;
  padding: 0 24px 13px 0;
  color: var(--portal-muted);
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.city-era-tabs button b {
  color: inherit;
  font: 500 22px/1.1 "Songti SC", "STSong", serif;
}

.city-era-tabs button span {
  font-size: 9px;
}

.city-era-tabs button[aria-pressed="true"] {
  color: var(--portal-red);
  box-shadow: inset 0 -2px var(--portal-red);
}

.city-work-list {
  display: grid;
  margin-top: 8px;
}

.city-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 18px;
  color: var(--portal-muted);
  font: 500 9px/1 ui-monospace, monospace;
}

.city-pagination button {
  min-height: 34px;
  padding: 0 12px;
  color: var(--portal-ink);
  background: transparent;
  border: 1px solid var(--portal-line);
  border-radius: 3px;
  cursor: pointer;
}

.city-pagination button:hover:not(:disabled) {
  color: #fff;
  background: var(--portal-red);
  border-color: var(--portal-red);
}

.city-pagination button:disabled {
  opacity: 0.35;
  cursor: default;
}

.city-work-list > p,
.city-era-tabs > p {
  color: var(--portal-muted);
  font-size: 11px;
}

.city-work-card {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  width: 100%;
  padding: 17px 0;
  color: var(--portal-ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--portal-line);
  cursor: pointer;
}

.city-work-card > span {
  padding-top: 3px;
  color: var(--portal-muted);
  font: 600 9px/1 ui-monospace, monospace;
}

.city-work-card b {
  font: 500 17px/1.3 "Songti SC", "STSong", serif;
}

.city-work-card p {
  display: -webkit-box;
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--portal-muted);
  font-size: 11px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.city-work-card small {
  padding-top: 3px;
  color: var(--portal-muted);
  font-size: 10px;
  white-space: nowrap;
}

.city-work-card:hover,
.city-work-card:focus-visible,
.city-work-card[aria-pressed="true"] {
  color: var(--portal-red);
  outline: none;
}

.city-work-card[aria-pressed="true"] {
  box-shadow: inset 3px 0 var(--portal-red);
}

.city-reading .experience-notes > small {
  color: var(--portal-teal);
  font: 600 9px/1 ui-monospace, monospace;
}

.city-reading .experience-notes > h3 {
  margin: 10px 0 22px;
  font: 500 24px/1.2 "Songti SC", "STSong", serif;
}

.city-evidence-list {
  display: grid;
  border-top: 1px solid var(--portal-line);
}

.city-evidence-item {
  display: grid;
  gap: 8px;
  padding: 15px 0;
  border-bottom: 1px solid var(--portal-line);
}

.city-evidence-item b,
.city-evidence-item small {
  color: var(--portal-muted);
  font: 600 9px/1.3 ui-monospace, monospace;
}

.city-evidence-item q {
  font: 500 15px/1.7 "Songti SC", "STSong", serif;
}

.city-read-button,
.city-reading-back {
  min-height: 38px;
  margin-top: 20px;
  padding: 0 16px;
  color: #fff;
  font-size: 11px;
  background: var(--portal-ink);
  border: 0;
  cursor: pointer;
}

.city-reading-back {
  margin: 0 0 24px;
  color: var(--portal-ink);
  background: transparent;
  border: 1px solid var(--portal-line);
}

.city-boundary {
  margin: 22px 0 0;
  color: var(--portal-muted);
  font-size: 10px;
  line-height: 1.65;
}

.city-full-text {
  white-space: pre-wrap;
  font: 500 17px/2 "Songti SC", "STSong", serif;
}

.city-full-meta {
  margin-top: 24px;
}

.city-workspace-actions {
  display: grid;
  margin-top: 24px;
  border-top: 1px solid var(--portal-line);
}

.city-workspace-actions button {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  min-height: 52px;
  padding: 12px 0;
  color: var(--portal-ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--portal-line);
  cursor: pointer;
}

.city-workspace-actions button:hover,
.city-workspace-actions button:focus-visible {
  color: var(--portal-red);
  outline: none;
}

.city-workspace-actions span {
  color: var(--portal-muted);
  font-size: 9px;
}

.city-workspace-actions b {
  font: 500 14px/1.4 "Songti SC", "STSong", serif;
}

.evidence-definition { margin: 0; }

.evidence-definition div {
  padding: 14px 0;
  border-top: 1px solid var(--portal-line);
}

.evidence-definition dt {
  margin-bottom: 5px;
  color: var(--portal-muted);
  font-size: 10px;
}

.evidence-definition dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
}

.life-arc {
  position: relative;
  display: flex;
  margin: 34px 0 22px;
}

.life-arc::before {
  position: absolute;
  top: 4px;
  right: 0;
  left: 0;
  height: 1px;
  content: "";
  background: var(--portal-line);
}

.life-arc span {
  position: relative;
  flex: 1;
  padding-top: 26px;
  color: var(--portal-muted);
  font-size: 10px;
}

.life-arc span::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 9px;
  height: 9px;
  content: "";
  background: var(--portal-red);
}

.life-library-toolbar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 20px;
  align-items: end;
  padding: 14px 0;
  border-top: 1px solid var(--portal-line);
  border-bottom: 1px solid var(--portal-line);
}

.life-library-toolbar > div:first-child {
  display: grid;
  gap: 5px;
}

.life-library-toolbar b {
  font: 500 18px/1.2 "Songti SC", "STSong", serif;
}

.life-library-toolbar span {
  color: var(--portal-muted);
  font-size: 10px;
}

.life-library-toolbar label {
  display: grid;
  gap: 5px;
}

.life-library-toolbar select {
  min-width: 148px;
  height: 36px;
  padding: 0 30px 0 10px;
  color: var(--portal-ink);
  background: #fff;
  border: 1px solid #aebbbc;
  border-radius: 0;
}

.life-pagination {
  display: flex;
}

.life-pagination button {
  width: 38px;
  height: 36px;
  color: var(--portal-ink);
  background: transparent;
  border: 1px solid var(--portal-line);
  cursor: pointer;
}

.life-pagination button + button { border-left: 0; }
.life-pagination button:disabled { color: #9ca7a9; cursor: not-allowed; }
.life-pagination button:not(:disabled):hover { color: #fff; background: var(--portal-red); }

.life-work-list {
  margin-top: 0;
}

.life-representative-list {
  margin-bottom: 24px;
  border-top: 1px solid var(--portal-line);
}

.life-representative {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--portal-line);
}

.life-representative > span {
  color: var(--portal-red);
  font: 600 9px/1 ui-monospace, monospace;
}

.life-representative div {
  display: grid;
  gap: 4px;
}

.life-representative b {
  font: 500 14px/1.25 "Songti SC", "STSong", serif;
}

.life-representative small {
  color: var(--portal-muted);
  font-size: 9px;
}

.geography-heading {
  margin-top: 30px !important;
  padding-top: 22px;
  border-top: 1px solid var(--portal-line);
}

.geography-evidence-ladder {
  display: grid;
  border-top: 1px solid var(--portal-line);
}

.geography-evidence-ladder > div {
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 38px;
  border-bottom: 1px solid var(--portal-line);
}

.geography-evidence-ladder span {
  color: var(--portal-muted);
  font: 600 8px/1 ui-monospace, monospace;
}

.geography-evidence-ladder b {
  font-size: 10px;
  font-weight: 500;
}

.geography-evidence-ladder strong {
  font: 600 13px/1 ui-monospace, monospace;
}

.geography-evidence-ladder .active strong {
  color: var(--portal-teal);
}

.geography-place-list article {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--portal-line);
}

.geography-place-list article > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.geography-place-list b {
  font: 500 14px/1.2 "Songti SC", "STSong", serif;
}

.geography-place-list small,
.geography-place-list article > span,
.geography-boundary {
  color: var(--portal-muted);
  font-size: 8px;
  line-height: 1.55;
}

.geography-place-list p {
  display: -webkit-box;
  grid-column: 1 / -1;
  max-height: 3.1em;
  margin: 0;
  overflow: hidden;
  color: var(--portal-muted);
  font: 400 10px/1.55 "Songti SC", "STSong", serif;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.geography-boundary {
  margin: 12px 0 0;
}

.imagery-field {
  position: relative;
  height: min(52vh, 500px);
  min-height: 390px;
}

.imagery-field::before,
.imagery-field::after {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid var(--portal-line);
  border-radius: 50%;
  content: "";
  transform: translate(-50%, -50%);
}

.imagery-field::before { width: 58%; aspect-ratio: 1; }
.imagery-field::after { width: 88%; aspect-ratio: 1; }

.imagery-node {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: var(--node-size);
  height: var(--node-size);
  color: var(--portal-ink);
  background: #f4f7f7;
  border: 1px solid #9eaaac;
  border-radius: 50%;
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.imagery-node:hover,
.imagery-node[aria-pressed="true"] {
  color: #fff;
  background: var(--portal-red);
  border-color: var(--portal-red);
}

.imagery-node b { font: 500 20px/1 "Songti SC", "STSong", serif; }
.imagery-node small { font: 600 9px/1 ui-monospace, monospace; }

.imagery-result {
  position: relative;
  display: block;
  width: 100%;
  padding: 13px 0;
  color: var(--portal-ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--portal-line);
  cursor: pointer;
}

.imagery-result:hover b,
.imagery-result:focus-visible b { color: var(--portal-red); }

.imagery-result b {
  display: block;
  margin-bottom: 4px;
  font: 500 16px/1.25 "Songti SC", "STSong", serif;
}

.imagery-result small { color: var(--portal-muted); }

.imagery-result > span {
  position: absolute;
  top: 15px;
  right: 0;
  color: var(--portal-muted);
  font-size: 8px;
}

.imagery-dynasties {
  display: grid;
  margin: -8px 0 20px;
}

.imagery-dynasty {
  display: grid;
  grid-template-columns: 24px 1fr 44px;
  gap: 8px;
  align-items: center;
  min-height: 26px;
  border-top: 1px solid var(--portal-line);
  font-size: 9px;
}

.imagery-dynasty i {
  position: relative;
  height: 2px;
  background: #dfe5e5;
}

.imagery-dynasty i::after {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--term-share);
  background: var(--portal-teal);
  content: "";
}

.imagery-dynasty b {
  text-align: right;
  font: 600 9px/1 ui-monospace, monospace;
}

.birth-poem {
  margin: 28px 0;
  font: 400 18px/1.9 "Songti SC", "STSong", serif;
  white-space: pre-line;
}

.birth-search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  margin-bottom: 10px;
}

.birth-empty {
  display: grid;
  align-content: center;
  width: min(560px, calc(100% - 40px));
  min-height: 100%;
  margin: 0 auto;
}

.birth-empty > span {
  color: var(--portal-teal);
  font: 600 9px/1 ui-monospace, monospace;
}

.birth-empty h3 {
  margin: 18px 0 10px;
  font: 500 clamp(32px, 5vw, 64px)/1.12 "Songti SC", "STSong", serif;
}

.birth-empty p {
  margin: 0 0 26px;
  color: var(--portal-muted);
  font-size: 11px;
  line-height: 1.7;
}

.birth-empty-suggestions {
  display: flex;
  gap: 8px;
}

.birth-empty-suggestions button {
  padding: 9px 12px;
  color: var(--portal-ink);
  background: transparent;
  border: 1px solid var(--portal-line);
  border-radius: 0;
  cursor: pointer;
}

.birth-empty-suggestions button:hover {
  color: #fff;
  background: var(--portal-red);
  border-color: var(--portal-red);
}

.birth-search-form input,
.birth-search-form button {
  height: 38px;
  color: var(--portal-ink);
  background: #fff;
  border: 1px solid #aebbbc;
  border-radius: 0;
}

.birth-search-form input {
  min-width: 0;
  padding: 0 10px;
  border-right: 0;
}

.birth-search-form button {
  color: #fff;
  background: var(--portal-teal);
  border-color: var(--portal-teal);
  cursor: pointer;
}

.birth-search-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--portal-muted);
  font-size: 8px;
}

.birth-search-results {
  display: grid;
  max-height: min(48vh, 440px);
  overflow-y: auto;
  border-top: 1px solid var(--portal-line);
}

.birth-search-result {
  position: relative;
  display: grid;
  gap: 5px;
  padding: 12px 34px 12px 0;
  color: var(--portal-ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--portal-line);
  cursor: pointer;
}

.birth-search-result:hover,
.birth-search-result[aria-pressed="true"] {
  color: var(--portal-red);
}

.birth-search-result[aria-pressed="true"]::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -30px;
  width: 3px;
  background: var(--portal-red);
  content: "";
}

.birth-search-result b {
  font: 500 14px/1.25 "Songti SC", "STSong", serif;
}

.birth-search-result small {
  color: var(--portal-muted);
  font-size: 8px;
}

.birth-search-result > span {
  position: absolute;
  top: 13px;
  right: 0;
  color: var(--portal-muted);
  font: 600 8px/1 ui-monospace, monospace;
}

.birth-search-boundary,
.birth-place-boundary {
  color: var(--portal-muted);
  font-size: 9px;
  line-height: 1.65;
}

.birth-search-boundary {
  margin: 14px 0 0;
}

.birth-place-boundary {
  margin: 18px 0 0;
  padding-left: 12px;
  border-left: 2px solid var(--portal-teal);
}

.birth-source-list,
.birth-relation-list {
  display: grid;
  border-top: 1px solid var(--portal-line);
}

.birth-source-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--portal-line);
}

.birth-source-row > span {
  color: var(--portal-red);
  font: 600 8px/1 ui-monospace, monospace;
}

.birth-source-row div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.birth-source-row b {
  font-size: 10px;
  font-weight: 500;
}

.birth-source-row small {
  overflow: hidden;
  color: var(--portal-muted);
  font: 400 8px/1.4 ui-monospace, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.birth-relation-heading,
.birth-identity-heading {
  margin-top: 26px !important;
}

.birth-relation-row {
  display: grid;
  grid-template-columns: minmax(84px, auto) 1fr;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--portal-line);
}

.birth-relation-row span {
  color: var(--portal-teal);
  font: 600 8px/1 ui-monospace, monospace;
}

.birth-relation-row b {
  overflow: hidden;
  font: 500 11px/1.2 "Songti SC", "STSong", serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-state {
  display: inline-flex;
  padding: 5px 8px;
  color: #fff;
  background: var(--portal-teal);
  font-size: 10px;
  font-style: normal;
}

.evidence-state.unknown {
  color: var(--portal-ink);
  background: #dfe5e5;
}

#experience-enter-workspace[hidden] {
  display: none;
}

.lab-index {
  display: grid;
  min-height: 100%;
  grid-template-columns: minmax(280px, 0.78fr) minmax(560px, 1.7fr);
  grid-template-rows: 1fr auto;
}

.lab-index > header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(42px, 6vw, 92px);
  border-right: 1px solid var(--portal-line);
}

.lab-index > header span,
.lab-index > header p {
  color: var(--portal-muted);
  font-size: 11px;
  line-height: 1.7;
}

.lab-index > header span {
  color: var(--portal-teal);
  font: 700 10px/1 ui-monospace, monospace;
}

.lab-index > header h3 {
  max-width: 6em;
  margin: 28px 0;
  font: 500 clamp(52px, 6vw, 90px)/0.98 "Songti SC", "STSong", serif;
}

.lab-index-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.lab-index-grid button {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-rows: 1fr auto;
  min-height: 50%;
  padding: clamp(30px, 5vw, 66px);
  color: var(--portal-ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--portal-line);
  border-bottom: 1px solid var(--portal-line);
  cursor: pointer;
}

.lab-index-grid button:nth-child(2n) { border-right: 0; }
.lab-index-grid button:nth-child(n + 3) { border-bottom: 0; }

.lab-index-grid button > span {
  color: var(--portal-red);
  font: 700 10px/1 ui-monospace, monospace;
}

.lab-index-grid button b {
  font: 500 clamp(27px, 3vw, 44px)/1 "Songti SC", "STSong", serif;
}

.lab-index-grid button small {
  grid-column: 2;
  margin-top: 14px;
  color: var(--portal-muted);
}

.lab-index-grid button i {
  position: absolute;
  right: 24px;
  bottom: 22px;
  color: transparent;
  font-size: 10px;
  font-style: normal;
}

.lab-index-grid button:hover,
.lab-index-grid button:focus-visible {
  color: #fff;
  background: var(--portal-ink);
  outline: none;
}

.lab-index-grid button:hover small,
.lab-index-grid button:focus-visible small,
.lab-index-grid button:hover i,
.lab-index-grid button:focus-visible i {
  color: #cbd3d4;
}

.lab-index > footer {
  grid-column: 1 / -1;
  padding: 12px 24px;
  color: var(--portal-muted);
  border-top: 1px solid var(--portal-line);
  font-size: 10px;
}

.experiment-shell {
  display: grid;
  min-height: 100%;
  grid-template-columns: minmax(190px, 0.62fr) minmax(520px, 1.8fr) minmax(240px, 0.75fr);
}

.experiment-rail,
.sentence-rail,
.trail-evidence {
  padding: 30px;
}

.experiment-rail { border-right: 1px solid var(--portal-line); }
.sentence-rail,
.trail-evidence { border-left: 1px solid var(--portal-line); }

.experiment-rail h3,
.sentence-rail h3,
.trail-evidence h3 {
  margin: 0 0 20px;
  font-size: 12px;
}

.microscope-stage,
.trail-stage {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: clamp(36px, 5vw, 76px);
}

.microscope-stage header small,
.trail-stage header small,
.season-poem > small {
  color: var(--portal-teal);
  font-size: 11px;
  font-weight: 700;
}

.microscope-stage header h3,
.trail-stage header h3 {
  margin: 14px 0 36px;
  font: 500 clamp(40px, 5vw, 72px)/1 "Songti SC", "STSong", serif;
}

.microscope-line {
  display: flex;
  align-items: stretch;
  min-height: 160px;
  overflow-x: auto;
  border: 1px solid var(--portal-line);
}

.microscope-line > span {
  display: grid;
  flex: 1 0 70px;
  min-width: 70px;
  place-items: center;
  border-right: 1px solid var(--portal-line);
}

.microscope-line > span:last-child { border-right: 0; }

.microscope-line b {
  align-self: end;
  font: 500 48px/1 "Songti SC", "STSong", serif;
}

.microscope-line small {
  align-self: start;
  color: #899497;
  font: 600 9px/1 ui-monospace, monospace;
}

.microscope-line .punctuation {
  color: var(--portal-red);
  background: #e8eeee;
}

.microscope-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr;
  margin: 24px 0 0;
}

.microscope-metrics > div {
  padding-right: 20px;
  border-right: 1px solid var(--portal-line);
}

.microscope-metrics > div + div { padding-left: 20px; }
.microscope-metrics > div:last-child { border-right: 0; }
.microscope-metrics dt { color: var(--portal-muted); font-size: 10px; }
.microscope-metrics dd { margin: 7px 0 0; font-size: 12px; line-height: 1.5; }

.sentence-rail button {
  display: grid;
  width: 100%;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  padding: 14px 0;
  color: var(--portal-ink);
  text-align: left;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--portal-line);
  cursor: pointer;
}

.sentence-rail button[aria-pressed="true"] { color: var(--portal-red); }
.sentence-rail button span { font: 600 9px/1 ui-monospace, monospace; }

.compare-shell {
  display: grid;
  min-height: 100%;
  grid-template-rows: auto 1fr auto;
}

.compare-pairs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--portal-line);
}

.compare-pairs button {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--portal-ink);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--portal-line);
  cursor: pointer;
}

.compare-pairs button:last-child { border-right: 0; }
.compare-pairs button[aria-pressed="true"] { color: #fff; background: var(--portal-ink); }
.compare-pairs button span { color: var(--portal-red); }

.compare-stage {
  position: relative;
  display: grid;
  min-height: 0;
  grid-template-columns: 1fr 1fr;
}

.compare-poem {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  padding: clamp(42px, 7vw, 104px);
}

.compare-poem.left { border-right: 1px solid var(--portal-line); }
.compare-poem small { color: var(--portal-teal); font-weight: 700; }

.compare-poem h3 {
  margin: 18px 0 30px;
  font: 500 clamp(42px, 5vw, 72px)/1 "Songti SC", "STSong", serif;
}

.compare-poem > div {
  font: 400 17px/1.95 "Songti SC", "STSong", serif;
  white-space: pre-line;
}

.compare-poem footer {
  margin-top: 28px;
  color: var(--portal-muted);
  font: 600 10px/1 ui-monospace, monospace;
}

.compare-overlap {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 138px;
  min-height: 138px;
  padding: 16px;
  place-items: center;
  text-align: center;
  background: #f4f7f7;
  border: 1px solid var(--portal-red);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.compare-overlap span { color: var(--portal-muted); font-size: 9px; }
.compare-overlap b { color: var(--portal-red); font: 500 36px/1 "Songti SC", "STSong", serif; }
.compare-overlap p { margin: 5px 0 0; font-size: 10px; line-height: 1.5; }

.compare-boundary {
  margin: 0;
  padding: 12px 24px;
  color: var(--portal-muted);
  border-top: 1px solid var(--portal-line);
  font-size: 10px;
}

.season-shell {
  display: grid;
  min-height: 100%;
  grid-template-columns: minmax(190px, 0.62fr) minmax(560px, 1.8fr) minmax(220px, 0.7fr);
}

.season-next {
  width: 100%;
  min-height: 42px;
  margin-top: 22px;
  color: #fff;
  background: var(--portal-ink);
  border: 0;
  cursor: pointer;
}

.season-poem {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(42px, 7vw, 110px);
}

.season-poem h3 {
  margin: 20px 0 8px;
  font: 500 clamp(48px, 7vw, 96px)/0.96 "Songti SC", "STSong", serif;
}

.season-poem > p { color: var(--portal-muted); }

.season-poem blockquote {
  margin: 34px 0;
  color: var(--portal-ink);
  font: 400 clamp(18px, 2vw, 27px)/1.9 "Songti SC", "STSong", serif;
  opacity: 1;
  white-space: pre-line;
}

.season-poem mark {
  padding: 0 2px;
  color: #fff;
  background: var(--portal-red);
}

.season-poem footer { color: var(--portal-muted); font-size: 10px; }

.season-rule {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 32px;
  border-left: 1px solid var(--portal-line);
}

.season-rule span {
  color: var(--portal-red);
  font: 500 clamp(100px, 12vw, 180px)/1 "Songti SC", "STSong", serif;
}

.season-rule p { color: var(--portal-muted); font-size: 11px; line-height: 1.7; }

.trail-field {
  position: relative;
  height: min(48vh, 470px);
  min-height: 350px;
  border: 1px solid var(--portal-line);
}

.trail-field::before {
  position: absolute;
  top: 50%;
  right: 12%;
  left: 16%;
  height: 1px;
  content: "";
  background: var(--portal-line);
}

.trail-field::after {
  position: absolute;
  top: 24%;
  bottom: 24%;
  left: 48%;
  width: 1px;
  content: "";
  background: var(--portal-line);
}

.trail-node {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  display: grid;
  width: 112px;
  min-height: 76px;
  padding: 12px;
  place-items: center;
  text-align: center;
  background: #f4f7f7;
  border: 1px solid #9eaaac;
  transform: translate(-50%, -50%);
}

.trail-node.root {
  top: 50%;
  left: 16%;
  color: #fff;
  background: var(--portal-red);
  border-color: var(--portal-red);
}

.trail-node:nth-child(2) { top: 24%; left: 48%; }
.trail-node:nth-child(3) { top: 76%; left: 48%; }
.trail-node:nth-child(4) { top: 24%; left: 80%; }
.trail-node:nth-child(5) { top: 76%; left: 80%; }

.trail-node small { color: inherit; opacity: 0.72; font-size: 8px; }
.trail-node b { font: 500 15px/1.25 "Songti SC", "STSong", serif; }

.trail-relations div {
  display: grid;
  gap: 5px;
  padding: 13px 0;
  border-top: 1px solid var(--portal-line);
}

.trail-relations b { color: var(--portal-teal); font: 600 9px/1 ui-monospace, monospace; }
.trail-relations span { font-size: 12px; line-height: 1.4; }
.trail-evidence > p { color: var(--portal-muted); font-size: 10px; line-height: 1.6; }

body.portal-open .workspace,
body.portal-open .timeline-bar {
  filter: saturate(0.45);
}

body.portal-open .brand-mark {
  background: var(--portal-red);
}

@media (max-width: 960px) {
  .portal-home {
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .portal-context {
    display: none;
  }

  .portal-reading {
    padding-inline: clamp(32px, 7vw, 68px);
  }

  .experience-grid { grid-template-columns: 180px minmax(0, 1fr); }
  .experience-notes { display: none; }

  .city-reading .experience-notes {
    display: block;
    grid-column: 2;
    border-top: 1px solid var(--portal-line);
    border-left: 0;
  }

  .discovery-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .discovery-reading {
    display: none;
  }
}

@media (max-width: 700px) {
  .portal-home {
    position: fixed;
    inset: 58px 0 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: #f4f7f7;
    backdrop-filter: none;
  }

  .portal-reading {
    order: 1;
    min-height: 410px;
    padding: 42px 24px 34px;
  }

  .portal-reading h1 {
    font-size: 46px;
  }

  .portal-reading blockquote {
    font-size: 18px;
  }

  .portal-reading::after {
    font-size: 220px;
  }

  .portal-modes {
    order: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto repeat(2, 78px) 58px 58px;
    padding: 24px;
    border-top: 1px solid var(--portal-line);
    border-right: 0;
  }

  .portal-modes header {
    grid-column: 1 / -1;
  }

  .portal-modes button {
    padding-right: 12px;
  }

  .portal-modes button:nth-of-type(odd) {
    margin-right: 12px;
  }

  .portal-modes .portal-lab-launch {
    grid-column: 1 / -1;
    margin: 10px 0 0;
  }

  .discovery-shell {
    display: flex;
    flex-direction: column;
  }

  .discovery-controls {
    padding: 18px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--portal-line);
  }

  .discovery-controls h3 {
    margin-bottom: 14px;
  }

  .discovery-controls form {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .discovery-filter-actions {
    grid-column: 1 / -1;
  }

  .discovery-results {
    padding: 22px 20px 34px;
  }

  .discovery-results h3 {
    font-size: 22px;
  }

  .discovery-results header strong {
    font-size: 24px;
  }

  .discovery-result {
    grid-template-columns: 26px minmax(0, 1fr);
  }

  .discovery-result > em {
    display: none;
  }

  .portal-actions {
    width: 100%;
  }

  .portal-actions button {
    flex: 1;
    padding-inline: 12px;
    white-space: nowrap;
  }

  .portal-experience {
    position: fixed;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .experience-header {
    grid-template-columns: 48px 1fr;
    min-height: 76px;
  }

  .experience-header > div { padding: 12px 16px; }
  .experience-header p,
  #experience-enter-workspace { display: none; }

  .experience-grid {
    display: flex;
    flex-direction: column;
  }

  .experience-controls {
    padding: 16px 20px 0;
    border-right: 0;
  }

  .experience-controls h3 { margin-bottom: 10px; }

  .experience-choice-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }

  .life-author-search {
    margin-bottom: 10px;
  }

  .life-curated-authors {
    padding-bottom: 4px;
  }

  .life-discovery-heading {
    margin-top: 12px;
  }

  .life-author-results {
    display: flex;
    gap: 8px;
    max-height: none;
    padding: 8px 0;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .life-author-results button {
    flex: 0 0 auto;
    min-height: 38px;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--portal-line);
  }

  .birth-search-results {
    display: flex;
    gap: 8px;
    max-height: none;
    padding-bottom: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    border-top: 0;
  }

  .birth-search-result {
    flex: 0 0 210px;
    min-height: 62px;
    padding: 10px 36px 10px 10px;
    border: 1px solid var(--portal-line);
  }

  .birth-search-result[aria-pressed="true"]::before {
    top: -1px;
    bottom: -1px;
    left: -1px;
  }

  .birth-search-result > span {
    top: 11px;
    right: 8px;
  }

  .birth-search-boundary {
    margin-bottom: 12px;
  }

  .life-discovery-note {
    margin-bottom: 12px;
  }

  .experience-choice-list button {
    flex: 0 0 auto;
    padding: 10px 12px;
    border: 1px solid var(--portal-line);
  }

  .experience-canvas {
    flex: 1;
    padding: 30px 20px;
  }

  .experience-canvas > h3 {
    margin-bottom: 26px;
    font-size: 44px;
  }

  .city-heading {
    align-items: start;
    margin-top: 12px;
  }

  .city-heading h3 {
    font-size: 48px;
  }

  .city-heading p {
    max-width: 42%;
    text-align: right;
  }

  .city-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .city-work-card {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .city-work-card small {
    grid-column: 2;
    padding: 0;
  }

  .city-reading .experience-notes {
    flex: 0 0 auto;
    padding: 28px 20px 40px;
    border-top: 1px solid var(--portal-line);
    border-left: 0;
  }

  .city-era,
  .life-work,
  .birth-layer {
    grid-template-columns: 60px 1fr;
  }

  .city-era > span:last-child,
  .life-work > span:last-child,
  .birth-layer > span:last-child,
  .birth-layer > i { display: none; }

  .imagery-field { min-height: 430px; }

  .life-library-toolbar {
    grid-template-columns: 1fr auto;
  }

  .life-library-toolbar label {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .life-library-toolbar select {
    width: 100%;
  }

  .life-chronology > header {
    min-height: 52px;
  }

  .life-chronology > header strong {
    font-size: 16px;
  }

  .life-chronology-track {
    grid-auto-columns: minmax(240px, 86vw);
  }

  .lab-index {
    display: flex;
    flex-direction: column;
  }

  .lab-index > header {
    padding: 34px 20px 28px;
    border-right: 0;
    border-bottom: 1px solid var(--portal-line);
  }

  .lab-index > header h3 {
    max-width: none;
    margin: 18px 0;
    font-size: 48px;
  }

  .lab-index-grid {
    grid-template-columns: 1fr;
  }

  .lab-index-grid button {
    min-height: 128px;
    padding: 26px 20px;
    border-right: 0;
    border-bottom: 1px solid var(--portal-line);
  }

  .lab-index-grid button:nth-child(n + 3) {
    border-bottom: 1px solid var(--portal-line);
  }

  .lab-index-grid button b { font-size: 30px; }

  .experiment-shell,
  .season-shell {
    display: flex;
    flex-direction: column;
  }

  .experiment-rail {
    padding: 16px 20px 0;
    border-right: 0;
  }

  .microscope-stage,
  .trail-stage {
    padding: 30px 20px;
  }

  .microscope-stage header h3,
  .trail-stage header h3 {
    margin-bottom: 24px;
    font-size: 42px;
  }

  .microscope-line { min-height: 126px; }
  .microscope-line > span { flex-basis: 54px; min-width: 54px; }
  .microscope-line b { font-size: 36px; }

  .microscope-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .microscope-metrics > div:last-child {
    grid-column: 1 / -1;
    padding: 18px 0 0;
  }

  .sentence-rail,
  .trail-evidence {
    padding: 20px;
    border-top: 1px solid var(--portal-line);
    border-left: 0;
  }

  .compare-pairs {
    grid-template-columns: 1fr 1fr;
  }

  .compare-pairs button:nth-child(2) { border-right: 0; }
  .compare-pairs button:nth-child(-n + 2) { border-bottom: 1px solid var(--portal-line); }

  .compare-stage {
    display: flex;
    flex-direction: column;
  }

  .compare-poem {
    min-height: 360px;
    padding: 38px 20px;
  }

  .compare-poem.left {
    border-right: 0;
    border-bottom: 1px solid var(--portal-line);
  }

  .compare-poem h3 { font-size: 48px; }

  .compare-overlap {
    top: 50%;
    width: 112px;
    min-height: 112px;
  }

  .season-next { margin-bottom: 12px; }

  .season-poem {
    padding: 42px 20px;
  }

  .season-poem h3 { font-size: 54px; }

  .season-rule {
    min-height: 180px;
    padding: 24px 20px;
    border-top: 1px solid var(--portal-line);
    border-left: 0;
  }

  .season-rule span { font-size: 92px; }

  .trail-field {
    min-height: 470px;
  }

  .trail-node {
    width: 92px;
  }

  .trail-node.root { top: 14%; left: 50%; }
  .trail-node:nth-child(2) { top: 44%; left: 25%; }
  .trail-node:nth-child(3) { top: 44%; left: 75%; }
  .trail-node:nth-child(4) { top: 78%; left: 25%; }
  .trail-node:nth-child(5) { top: 78%; left: 75%; }
}

@media (prefers-reduced-motion: reduce) {
  .portal-home {
    transition: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .portal-home {
    background: #f4f7f7;
    backdrop-filter: none;
  }
}

/* v59: editorial cartographic portal */

:root {
  --portal-ink: #202323;
  --portal-muted: #606969;
  --portal-line: rgba(32, 35, 35, 0.18);
  --portal-teal: #147d7b;
  --portal-red: #c94b32;
  --portal-surface: #f5f6f3;
}

.portal-home {
  inset: var(--topbar-height) 0 var(--timeline-height);
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr) 164px;
  overflow: hidden;
  background: var(--portal-surface);
  border-top: 0;
  backdrop-filter: none;
}

.portal-reading {
  grid-column: 1 / 10;
  grid-row: 1;
  align-items: flex-start;
  justify-content: flex-end;
  padding: clamp(36px, 5vh, 64px) clamp(34px, 4.2vw, 80px);
  isolation: isolate;
  border-right: 1px solid var(--portal-line);
}

.portal-reading::before {
  position: absolute;
  z-index: -2;
  inset: 0;
  content: "";
  background: #e8ece8 url("./assets/china-poetry-map.png") center 46% / cover no-repeat;
  filter: saturate(0.55) contrast(0.92);
}

.portal-reading::after {
  z-index: -1;
  inset: 0 auto 0 0;
  width: min(68%, 820px);
  content: "";
  background: rgba(245, 246, 243, 0.9);
  pointer-events: none;
}

.portal-reading-index {
  margin-bottom: clamp(18px, 2.8vh, 30px);
}

.portal-reading-index::before {
  width: 48px;
  height: 2px;
}

.portal-reading-index span {
  color: var(--portal-red);
  font: 700 11px/1 ui-monospace, "SFMono-Regular", monospace;
}

.portal-reading-index small {
  color: #4d5757;
  font-size: 11px;
}

.portal-reading h1 {
  max-width: 9em;
  margin-bottom: 20px;
  color: #202323;
  font-size: clamp(58px, 6.4vw, 96px);
  font-weight: 600;
  line-height: 0.95;
}

.portal-reading blockquote {
  width: min(100%, 690px);
  padding: 18px 0 18px 24px;
  color: #293131;
  border-left: 3px solid var(--portal-red);
  font-size: clamp(21px, 2vw, 31px);
  line-height: 1.7;
}

.portal-reading-note {
  max-width: 42em;
  margin-top: 18px;
  color: #4f5a5a;
  font-size: 12px;
}

.portal-actions {
  margin-top: 24px;
}

.portal-actions button {
  min-height: 44px;
  padding: 0 20px;
  border-radius: 2px;
  transition:
    color 250ms cubic-bezier(0.4, 0, 0.2, 1),
    background-color 250ms cubic-bezier(0.4, 0, 0.2, 1),
    transform 100ms ease;
}

.portal-primary {
  background: var(--portal-red);
  border-color: var(--portal-red);
}

.portal-secondary {
  background: rgba(245, 246, 243, 0.82);
  border-color: rgba(32, 35, 35, 0.34);
}

.portal-secondary:hover,
.portal-secondary:focus-visible {
  color: #fff;
  background: var(--portal-ink);
  border-color: var(--portal-ink);
}

.portal-context {
  grid-column: 10 / 13;
  grid-row: 1 / 3;
  padding: clamp(28px, 3.2vw, 50px);
  color: #f8f8f4;
  background: #202727;
  border-left: 0;
}

.portal-context header {
  padding-right: 0;
  padding-bottom: 28px;
}

.portal-context header span {
  color: #82c8c4;
  font: 700 11px/1 ui-monospace, "SFMono-Regular", monospace;
}

.portal-context header small {
  color: rgba(248, 248, 244, 0.56);
  font-size: 11px;
}

.portal-context dl {
  margin: 0;
  border-top-color: rgba(248, 248, 244, 0.2);
}

.portal-context dl div {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  min-height: 86px;
  padding: 18px 0;
  border-bottom-color: rgba(248, 248, 244, 0.2);
}

.portal-context dt {
  color: rgba(248, 248, 244, 0.62);
  font-size: 12px;
}

.portal-context dd {
  color: #fff;
  font-size: clamp(22px, 2vw, 32px);
}

.portal-context dl div > small {
  grid-column: 1 / -1;
  color: rgba(248, 248, 244, 0.48);
}

.portal-search label {
  color: #fff;
}

.portal-search > div {
  border-color: rgba(248, 248, 244, 0.36);
  border-radius: 2px;
}

.portal-search button {
  background: var(--portal-red);
  border-radius: 0 1px 1px 0;
}

.portal-evidence-note {
  color: rgba(248, 248, 244, 0.56);
}

.portal-context > a {
  color: #fff;
}

.portal-modes {
  grid-column: 1 / 10;
  grid-row: 2;
  display: grid;
  grid-template-columns: 1.15fr repeat(4, 1fr) 1.12fr 1.12fr;
  grid-template-rows: 1fr;
  padding: 0;
  background: #fff;
  border-top: 1px solid var(--portal-line);
  border-right: 1px solid var(--portal-line);
}

.portal-modes header {
  justify-content: flex-start;
  padding: 24px;
  border-right: 1px solid var(--portal-line);
}

.portal-modes header span {
  color: var(--portal-red);
  font: 700 11px/1 ui-monospace, "SFMono-Regular", monospace;
}

.portal-modes button,
.portal-modes .portal-lab-launch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr auto;
  align-items: start;
  min-height: 0;
  margin: 0;
  padding: 22px 18px;
  border: 0;
  border-right: 1px solid var(--portal-line);
  transition:
    color 250ms cubic-bezier(0.4, 0, 0.2, 1),
    background-color 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

.portal-modes button:last-child {
  border-right: 0;
}

.portal-modes button > span,
.portal-modes .portal-lab-launch > span {
  grid-row: auto;
  align-self: start;
  color: #7a8383;
  font-size: 10px;
}

.portal-modes button b {
  align-self: center;
  font-size: clamp(16px, 1.2vw, 21px);
  line-height: 1.15;
}

.portal-modes button small,
.portal-modes .portal-lab-launch small {
  color: #697272;
  line-height: 1.4;
}

.portal-modes button:hover,
.portal-modes button:focus-visible {
  color: #fff;
  background: var(--portal-red);
}

.portal-modes button:hover > span,
.portal-modes button:hover small,
.portal-modes button:focus-visible > span,
.portal-modes button:focus-visible small {
  color: rgba(255, 255, 255, 0.76);
}

.portal-modes .portal-lab-launch {
  color: #fff;
  background: var(--portal-ink);
}

.portal-modes .portal-lab-launch:hover,
.portal-modes .portal-lab-launch:focus-visible {
  background: var(--portal-teal);
  border-color: transparent;
}

body.portal-open .topbar {
  border-bottom-color: var(--portal-line);
  box-shadow: none;
}

@media (max-width: 1100px) {
  .portal-home {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .portal-reading {
    grid-column: 1 / 7;
  }

  .portal-reading::after {
    width: 78%;
  }

  .portal-context {
    grid-column: 7 / 9;
    padding: 28px 22px;
  }

  .portal-context dd {
    font-size: 20px;
  }

  .portal-modes {
    grid-column: 1 / 7;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 82px;
    overflow-y: auto;
  }

  .portal-modes header {
    display: none;
  }

  .portal-modes button,
  .portal-modes .portal-lab-launch {
    padding: 14px;
  }

  .portal-modes button b {
    font-size: 15px;
  }
}

@media (max-width: 760px) {
  .portal-home {
    inset: 58px 0 0;
    display: flex;
    overflow-x: hidden;
    background: var(--portal-surface);
  }

  .portal-reading {
    order: 1;
    min-height: min(68svh, 590px);
    padding: 38px 20px 32px;
    border-right: 0;
  }

  .portal-reading::before {
    background-position: 58% center;
  }

  .portal-reading::after {
    width: 100%;
    background: rgba(245, 246, 243, 0.84);
  }

  .portal-reading h1 {
    font-size: clamp(52px, 16vw, 70px);
  }

  .portal-reading blockquote {
    padding-left: 16px;
    font-size: 19px;
  }

  .portal-reading-note {
    font-size: 11px;
  }

  .portal-actions {
    width: 100%;
  }

  .portal-actions button {
    flex: 1;
    padding: 0 12px;
  }

  .portal-context {
    order: 3;
    display: flex;
    min-height: 380px;
    padding: 30px 20px;
  }

  .portal-context dl {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .portal-context dl div {
    display: flex;
    align-items: flex-start;
    min-height: 96px;
    padding: 14px 10px 14px 0;
    border-right: 1px solid rgba(248, 248, 244, 0.2);
    border-bottom: 0;
  }

  .portal-context dl div + div {
    padding-left: 10px;
  }

  .portal-context dl div:last-child {
    border-right: 0;
  }

  .portal-context dd {
    width: 100%;
    margin-top: 8px;
    font-size: 18px;
  }

  .portal-context dl div > small {
    text-align: left;
  }

  .portal-modes {
    order: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto repeat(3, 126px);
    padding: 0;
    overflow: visible;
    border-top: 0;
    border-right: 0;
  }

  .portal-modes header {
    display: flex;
    grid-column: 1 / -1;
    min-height: 92px;
    padding: 24px 20px;
    border-top: 1px solid var(--portal-line);
    border-bottom: 1px solid var(--portal-line);
  }

  .portal-modes button,
  .portal-modes .portal-lab-launch {
    min-height: 126px;
    padding: 18px 16px;
    border-bottom: 1px solid var(--portal-line);
  }

  .portal-modes button:nth-of-type(odd) {
    margin-right: 0;
  }

  .portal-modes button b {
    font-size: 18px;
  }

  .portal-modes .portal-lab-launch {
    grid-column: auto;
    margin: 0;
  }
}
