.cinema .history.sandbox-enabled .history-inner {
  gap: clamp(.75rem, 2.15svh, 1.45rem);
}
.sandbox-marginalia {
  padding-left: .7rem;
  border-left: 1px solid #bba2776b;
  color: #edc78d;
  font-size: .71rem;
  white-space: nowrap;
}
.sandbox-enabled .history-spread {
  grid-template-columns: minmax(0, 55fr) minmax(0, 45fr);
  gap: clamp(1.3rem, 3vw, 3.3rem);
  align-items: center;
}
.sand-map { min-width: 0; margin: 0; }
.sand-map-board {
  position: relative;
  isolation: isolate;
  height: clamp(16rem, 57svh, 38rem);
  overflow: hidden;
  border: 1px solid #a3855c91;
  background: #222321;
  box-shadow: 0 1.35rem 4rem #0d0a0a4f;
  color: #f4d29a;
}
.sand-map-board > .history-map {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  max-width: none;
}
.sand-map-board::after {
  position: absolute;
  z-index: 1;
  inset: .45rem;
  content: "";
  border: 1px solid #dec19529;
  pointer-events: none;
}
.sand-register, .sand-north {
  position: absolute;
  z-index: 2;
  margin: 0;
  color: #f0cc92;
  font: 500 .63rem/1.4 var(--mono, monospace);
  letter-spacing: .12em;
  pointer-events: none;
  text-shadow: 0 1px 4px #080907;
}
.sand-register { top: 1.05rem; left: 1.12rem; }
.sand-register span { display: block; color: #dcc6a5; margin-top: .2rem; letter-spacing: .07em; }
.sand-north { top: 1.02rem; right: 1.25rem; text-align: center; }
.sand-north::after {
  content: "";
  display: block;
  width: 1px;
  height: 1.2rem;
  margin: .2rem auto 0;
  background: linear-gradient(#dec58f, transparent);
}
.sand-pin {
  position: absolute;
  z-index: 3;
  left: var(--pin-x);
  top: var(--pin-y);
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  background: transparent;
  transform: translate(-50%, -50%);
  color: #d2b990;
}
.sand-pin:hover, .sand-pin:focus-visible, .sand-pin[aria-current] { color: #ffdda2; z-index: 4; }
.sand-pin:focus-visible { outline-color: #edbc78; outline-offset: 0; border-radius: 50%; }
.sand-pin > span {
  position: absolute;
  left: 50%;
  bottom: calc(50% + .54rem);
  transform: translateX(-50%);
  padding: .16rem .33rem;
  background: #1819178c;
  font: 600 clamp(.67rem, 1.0vw, .89rem)/1.15 var(--body, sans-serif);
  letter-spacing: .03em;
  white-space: nowrap;
  text-shadow: 0 1px 4px #0b0908;
}
.sand-pin[aria-current] > span {
  border-bottom: 1px solid currentColor;
  background: #221c18ee;
}
.sand-pin[data-town="zhongshan"] > span,
.sand-pin[data-town="hongkong"] > span { bottom: auto; top: calc(50% + .59rem); }
.sand-pin[data-town="kaiping"] > span { right: calc(50% + .56rem); left: auto; bottom: auto; top: 50%; transform: translateY(-50%); }
.sand-map-caption {
  display: flex;
  align-items: baseline;
  gap: .35rem .9rem;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: .46rem 0 .5rem;
  border-bottom: 1px solid #977c5490;
  color: #d9c6aa;
  font-size: .72rem;
  line-height: 1.4;
}
.sand-map-caption output { font: 600 .75rem/1.4 var(--mono, monospace); color: #f1c58b; }
.sand-map[data-phase="war"] output { color: #ffc08f; }
.sand-map[data-phase="return"] output { color: #ffe0a2; }
.sand-map-caption .sand-history-note {
  flex-basis: 100%;
  color: #ead8bd;
}
.sand-warning {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, .75rem);
  padding: .15rem .35rem;
  border: 1px solid #d7675b80;
  background: #34191aeb;
  color: #ffb0a0;
  font-size: .67rem;
  white-space: nowrap;
  pointer-events: none;
}
.sand-map[data-phase="seed"] .sand-pin:not([data-town="guangzhou"]):not(:hover):not(:focus-visible) {
  opacity: .48;
}
.sandbox-archive { min-width: 0; display: grid; gap: .7rem; }
.sandbox-enabled .history-copy .history-date { gap: .7rem; }
.sandbox-enabled #history-year { font-size: clamp(3.2rem, 6.3vw, 7.5rem); }
.sandbox-enabled .history-copy h2 { margin: .35rem 0 .43rem; font-size: clamp(1.5rem, 3.2vw, 3.6rem); line-height: 1.12; }
.sandbox-enabled .history-lede {
  max-width: 40rem;
  min-height: 0;
  font-size: clamp(.83rem, 1.05vw, 1.01rem);
  line-height: 1.75;
}
.sandbox-proof { display: flex; gap: .22rem .85rem; flex-wrap: wrap; align-items: center; }
.sandbox-proof .archive-seal { margin: 0; }
.sandbox-proof .citation { padding-inline: 0; }
.sandbox-enabled .history-figure { width: 100%; }
.sandbox-enabled .history-screen {
  max-height: none;
  width: 100%;
  height: clamp(8rem, 22.8svh, 17rem);
  aspect-ratio: auto;
}
.sandbox-enabled .history-figure figcaption { padding-block: .3rem; font-size: .66rem; }
.sandbox-enabled .history-screen .archive-typography > span { font-size: clamp(3.7rem, 7.3vw, 8rem); }
.sandbox-enabled .history-controls { gap: .7rem; }
.cinema .sandbox-enabled .history-steps { max-width: 40rem; grid-auto-flow: unset; grid-template-columns: repeat(10, minmax(0, 1fr)); }
.cinema .sandbox-enabled .history-steps button { min-height: 32px; }
.fold-moments { display: grid; gap: 1.05rem; margin-top: 1.3rem; }
.fold-moment-heading { margin: 0; color: #532c25; font-size: 1.06rem; }
.fold-moment-slider { display: block; width: 100%; margin: 0; accent-color: #9e3b34; }
.fold-moment-controls { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; }
.fold-moment-controls button {
  min-height: 3.1rem;
  padding: .55rem .62rem;
  border: 1px solid #9e725d7a;
  background: #f7ebd589;
  text-align: left;
  color: #5a3728;
  font: 600 .77rem/1.3 var(--body, sans-serif);
}
.fold-moment-controls button time {
  display: block;
  margin-bottom: .21rem;
  color: #8b3128;
  font: 600 .77rem/1.2 var(--mono, monospace);
}
.fold-moment-controls button:hover { border-color: #8d3830; }
.fold-moment-controls button[aria-selected="true"] {
  border-color: #9e3b34;
  background: #9e3b3419;
  box-shadow: inset 2px 0 #9e3b34;
}
.fold-moment-panel {
  min-height: 8.4rem;
  padding: .85rem 0 0 1rem;
  border-top: 1px solid #8f654a62;
  border-left: 2px solid #a3483b;
}
.fold-moment-panel h3 { margin: 0 0 .4rem; color: #532c25; font-size: 1.15rem; }
.fold-moment-panel p { margin: 0; font-size: .89rem; line-height: 1.8; }
@media (max-height: 755px) and (min-width: 771px) {
  .sand-map-board { height: clamp(13.5rem, 54svh, 26rem); }
  .sandbox-enabled #history-year { font-size: clamp(2.75rem, 6vw, 5.8rem); }
  .sandbox-enabled .history-screen { height: clamp(6rem, 20svh, 13rem); }
  .sandbox-archive { gap: .44rem; }
}
@media (max-width: 770px) {
  .cinema .history.sandbox-enabled .history-inner {
    padding-top: clamp(4.1rem, 9svh, 5.1rem);
    padding-bottom: 3.8rem;
    gap: .65rem;
  }
  .sandbox-enabled .history-spread { grid-template-columns: 1fr; gap: .65rem; }
  .sandbox-marginalia { padding-left: .36rem; font-size: .61rem; letter-spacing: .04em; }
  .sand-map-board { height: clamp(11rem, 32svh, 17rem); }
  .sand-map-caption { padding-block: .28rem; gap: .25rem .6rem; font-size: .63rem; }
  .sand-map-caption output { font-size: .64rem; }
  .sand-register { top: .65rem; left: .7rem; font-size: .53rem; }
  .sand-north { top: .62rem; right: .8rem; font-size: .53rem; }
  .sand-pin > span { padding: .13rem .19rem; font-size: .67rem; }
  .sandbox-archive {
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    column-gap: .55rem;
    row-gap: .32rem;
    align-items: center;
  }
  .sandbox-proof { grid-column: 1 / -1; gap: .24rem .66rem; }
  .sandbox-proof .archive-seal { min-height: 29px; }
  .sandbox-proof .citation { min-height: 30px; font-size: .64rem; }
  .sandbox-enabled .history-copy .history-date { gap: .24rem .4rem; }
  .sandbox-enabled #history-year { font-size: clamp(2.75rem, 11vw, 4.25rem); }
  .sandbox-enabled #history-date-note { font-size: .62rem; }
  .sandbox-enabled .history-copy h2 { font-size: clamp(1.15rem, 5.1vw, 1.8rem); }
  .sandbox-enabled .history-lede { font-size: .77rem; line-height: 1.65; }
  .sandbox-enabled .history-screen { height: clamp(5.25rem, 17svh, 10rem); }
  .sandbox-enabled .history-screen .archive-typography > span { font-size: clamp(1.65rem, 7.1vw, 3.1rem); }
  .sandbox-enabled .history-screen .archive-typography > small { font-size: .49rem; }
  .sandbox-enabled .history-figure figcaption { display: block; font-size: .59rem; }
  .sandbox-enabled .history-figure figcaption span { display: block; text-align: start; }
  .cinema .sandbox-enabled .history-steps { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .18rem .4rem; }
  .cinema .sandbox-enabled .history-steps button { min-height: 24px; font-size: .7rem; }
}
@media (max-width: 770px) and (max-height: 670px) {
  .sand-map-board { height: clamp(10.2rem, 27svh, 12rem); }
  .cinema .history.sandbox-enabled .history-inner { gap: .4rem; }
  .sandbox-enabled .history-spread { gap: .46rem; }
}
