@font-face {
  font-family: "Chronicle Sans";
  src: url("assets/noto-sans.woff") format("woff");
  font-weight: 400 500;
  font-display: swap;
}
@font-face {
  font-family: "Chronicle Serif";
  src: url("assets/noto-serif.woff") format("woff");
  font-weight: 400 500;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --ink: #eef2ed;
  --dim: #9aaaae;
  --gold: #dfbd7c;
  --line: rgba(214, 196, 152, 0.19);
  --panel: rgba(7, 18, 25, 0.87);
  font-family:
    "Chronicle Sans",
    -apple-system,
    BlinkMacSystemFont,
    "Hiragino Kaku Gothic ProN",
    "Noto Sans JP",
    sans-serif;
  font-size: 14px;
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #040911;
  color: var(--ink);
  overscroll-behavior: none;
}
body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
button,
a,
select,
input {
  touch-action: manipulation;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: 0;
}
button:disabled {
  opacity: 0.35;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
button:hover:not(:disabled) {
  color: #fff;
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
[hidden] {
  display: none !important;
}
#app {
  height: 100vh;
  height: 100dvh;
  width: 100%;
  position: relative;
  isolation: isolate;
}
#world {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  outline: 0;
}
.shade {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(1, 7, 13, 0.6),
    transparent 29%,
    transparent 64%,
    rgba(1, 7, 13, 0.65)
  );
}
.topbar {
  position: absolute;
  top: calc(24px + env(safe-area-inset-top));
  left: 34px;
  right: 34px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 4;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  color: var(--ink);
}
.brand img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.brand strong {
  font-family: "Chronicle Serif", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 20px;
  letter-spacing: 0.12em;
  font-weight: 500;
}
.brand span {
  display: block;
  font-size: 9px;
  letter-spacing: 0.3em;
  color: var(--gold);
  margin-top: 4px;
}
.top-actions {
  display: flex;
  gap: 8px;
}
.icon-button {
  height: 44px;
  width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: rgba(6, 15, 21, 0.45);
  border-radius: 50%;
  backdrop-filter: blur(12px);
}
svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.epoch {
  position: absolute;
  left: 48px;
  top: 144px;
  pointer-events: none;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--gold);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
}
.shortline {
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--gold);
  opacity: 0.55;
}
.epoch h1 {
  font-family: "Chronicle Serif", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 38px;
  letter-spacing: 0.12em;
  font-weight: 400;
  margin: 15px 0 8px;
  text-shadow: 0 2px 22px #000;
}
.epoch > p {
  font-size: 11px;
  letter-spacing: 0.35em;
  color: #a0b0b7;
  margin: 0 0 21px;
}
.epoch-progress {
  height: 2px;
  width: 110px;
  background: #bfab7030;
  overflow: hidden;
}
.epoch-progress i {
  height: 100%;
  width: 0;
  display: block;
  background: var(--gold);
  transition: width 0.4s;
}
.metrics {
  position: absolute;
  right: 44px;
  top: 144px;
  width: 125px;
  display: grid;
  gap: 25px;
}
.metrics > div {
  display: grid;
  grid-template-columns: 20px 1fr;
  column-gap: 11px;
  align-items: center;
}
.metrics span {
  grid-row: 1/3;
  color: #b0c3c2;
}
.metrics svg {
  width: 18px;
}
.metrics label {
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.12em;
}
.metrics strong {
  font-size: 21px;
  font-weight: 300;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}
.metrics small {
  font-size: 11px;
  margin-left: 3px;
  color: var(--dim);
}
.view-switch {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(28px + env(safe-area-inset-top));
  display: flex;
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: 40px;
  background: rgba(6, 18, 27, 0.6);
  backdrop-filter: blur(20px);
  gap: 2px;
}
.view-switch button {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 12px;
  min-height: 40px;
  padding: 0 19px;
  border-radius: 30px;
  color: #a0afb6;
}
.view-switch button.active {
  background: #d8bc8122;
  color: #f1d49c;
}
.view-switch svg {
  width: 16px;
}
.camera-tools {
  position: absolute;
  right: 37px;
  bottom: 222px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.camera-tools .active {
  color: var(--gold);
  border-color: #dabb7960;
}
.region-label {
  position: absolute;
  left: 48px;
  bottom: 234px;
  display: grid;
  gap: 10px;
  pointer-events: none;
  text-shadow: 0 2px 14px #000;
}
.region-label strong {
  font-family: "Chronicle Serif", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-weight: 400;
  font-size: 21px;
  letter-spacing: 0.08em;
}
.region-label small {
  color: #b1c1c0;
  font-size: 12px;
}
.bottom {
  position: absolute;
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: min(840px, calc(100% - 80px));
  z-index: 4;
}
.chronicle-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 0 0 19px;
  min-height: 48px;
  text-shadow: 0 2px 13px #000;
}
.note-glyph {
  color: var(--gold);
  font-size: 25px;
}
.chronicle-note p {
  font-family: "Chronicle Serif", "Hiragino Mincho ProN", "Yu Mincho", serif;
  margin: 0 0 5px;
  font-size: 17px;
  letter-spacing: 0.08em;
}
.chronicle-note small {
  font-size: 11px;
  color: #b0bdc0;
}
.chronicle-note .icon-button {
  margin-left: 7px;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
}
.control-deck {
  border: 1px solid var(--line);
  border-radius: 18px;
  display: flex;
  align-items: center;
  background: var(--panel);
  backdrop-filter: blur(28px);
  box-shadow: 0 12px 50px #0005;
  min-height: 76px;
  padding: 10px 14px;
  gap: 18px;
}
.time-panel {
  display: flex;
  align-items: center;
  gap: 11px;
  flex: 1;
}
.pause {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 44px;
  width: 44px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #e7cf97, #b59251);
  border-radius: 12px;
  color: #17232a;
}
.pause svg {
  width: 19px;
  stroke-width: 2;
}
.speeds {
  display: flex;
  gap: 2px;
}
.speeds button {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  min-width: 39px;
  height: 44px;
  color: #94a4ae;
  border-radius: 8px;
}
.speeds button.active {
  background: #b59d6226;
  color: #f1d69e;
}
.next-era {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #c1cbd0;
  font-size: 11px;
  padding: 0 9px;
  border-left: 1px solid var(--line);
  white-space: nowrap;
}
.next-era svg {
  width: 17px;
}
.power-panel {
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 1px solid var(--line);
  padding-left: 17px;
}
.power-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--gold);
  text-align: left;
}
.power-trigger > svg {
  width: 25px;
  height: 25px;
}
.power-trigger strong {
  font-size: 13px;
  font-weight: 500;
  display: block;
  white-space: nowrap;
}
.power-trigger small {
  display: block;
  font-size: 10px;
  color: #9caaa9;
  margin-top: 4px;
  white-space: nowrap;
}
.power-chevron {
  padding: 0 5px;
  font-size: 17px;
}
.quick-powers {
  display: flex;
}
.quick-powers button {
  height: 40px;
  width: 37px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a9b9b9;
  border-radius: 9px;
}
.quick-powers button.selected {
  color: #ecd294;
  background: #d6b66c26;
}
.quick-powers svg {
  width: 20px;
}
.footer-meta {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #829295;
  letter-spacing: 0.1em;
  margin: 12px 6px 0;
}
.power-hint {
  position: absolute;
  left: 50%;
  bottom: 215px;
  transform: translateX(-50%);
  padding: 12px 14px 12px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  border: 1px solid #d7bb7955;
  background: #0a1725e6;
  border-radius: 40px;
  z-index: 5;
  white-space: nowrap;
  font-size: 12px;
}
.power-hint button {
  border-left: 1px solid var(--line);
  padding-left: 16px;
  color: var(--gold);
  min-height: 28px;
}
#toast {
  position: absolute;
  top: calc(93px + env(safe-area-inset-top));
  left: 50%;
  transform: translate(-50%, -8px);
  max-width: 90%;
  padding: 12px 22px;
  background: #091823ed;
  color: #eed4a0;
  border: 1px solid #d7bb7940;
  border-radius: 25px;
  opacity: 0;
  transition: 0.25s;
  pointer-events: none;
  text-align: center;
  font-size: 13px;
  z-index: 20;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
#flash {
  position: absolute;
  inset: 0;
  background: #ffd3a0;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}
.welcome {
  position: absolute;
  inset: 0;
  z-index: 12;
  background: radial-gradient(ellipse at 65% 50%, #03101d40, #030a13f2 80%);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}
.welcome-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  max-height: 100%;
  overflow: auto;
}
.welcome .eyebrow {
  font-size: 10px;
}
.welcome img {
  width: min(31vh, 255px);
  margin: 26px 0 15px;
  border-radius: 25%;
  box-shadow: 0 0 70px #427ca325;
}
.welcome p {
  font-family: "Chronicle Serif", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 34px;
  line-height: 1.65;
  letter-spacing: 0.18em;
  margin: 0 0 17px;
}
.welcome-desc {
  color: #a9b8be;
  font-size: 12px;
  line-height: 1.9;
}
.gold-button {
  background: linear-gradient(115deg, #e7cb8e, #b79351);
  color: #172127 !important;
  border: 1px solid #f0d5a060;
  border-radius: 8px;
  min-height: 52px;
  padding: 12px 30px;
  font-size: 14px;
  letter-spacing: 0.08em;
  box-shadow: 0 5px 35px #c09f4020;
}
.welcome .gold-button {
  margin: 30px 0 14px;
  width: 100%;
  max-width: 300px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.subtle-button {
  color: #dec48a;
  min-height: 44px;
  margin-bottom: 10px;
}
.welcome small {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: #859399;
}
#loading {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: #050d17;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s;
}
#loading p {
  font-size: 12px;
  color: #c4b185;
  letter-spacing: 0.2em;
}
.loading-orbit {
  height: 60px;
  width: 60px;
  border: 1px solid #dcc18133;
  border-top-color: #dcc181;
  border-radius: 50%;
  animation: spin 2s linear infinite;
  margin-bottom: 20px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.error {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: #08101e;
  text-align: center;
  padding: 25px;
}
.error h2 {
  font-size: 20px;
}
.error p {
  color: var(--dim);
  line-height: 1.7;
}
#scrim {
  position: absolute;
  inset: 0;
  z-index: 14;
  background: #02081060;
  backdrop-filter: blur(5px);
}
.drawer {
  position: absolute;
  z-index: 15;
  right: 22px;
  top: calc(92px + env(safe-area-inset-top));
  bottom: calc(22px + env(safe-area-inset-bottom));
  width: min(425px, calc(100% - 44px));
  background: linear-gradient(155deg, #13242df7, #08121bf7);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 25px 70px #0007;
  padding: 26px;
  display: flex;
  flex-direction: column;
}
.drawer header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.drawer header .icon-button {
  flex-shrink: 0;
}
.drawer h2 {
  font-family: "Chronicle Serif", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-weight: 400;
  font-size: 24px;
  margin: 9px 0 0;
  letter-spacing: 0.05em;
}
.drawer-intro {
  font-size: 13px;
  line-height: 1.9;
  color: #9fb2b9;
  margin: 22px 0;
}
.power-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  margin-bottom: 15px;
}
.power-tabs button {
  flex: 1;
  min-height: 44px;
  color: #91a4ad;
  border-bottom: 2px solid transparent;
}
.power-tabs button.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
#power-grid {
  overflow-y: auto;
  overscroll-behavior: contain;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 3px 0 10px;
}
.power-card {
  border: 1px solid #9eadaf20;
  padding: 14px 12px;
  border-radius: 12px;
  min-height: 126px;
  text-align: left;
  background: #263b4125;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.power-card > div {
  display: flex;
  justify-content: space-between;
  color: var(--gold);
  font-size: 11px;
}
.power-card strong {
  font-size: 14px;
  font-weight: 500;
}
.power-card small {
  font-size: 11px;
  color: #9bb0b6;
  line-height: 1.7;
}
.power-card.selected {
  border-color: #e0c180;
  background: #c5a75a12;
}
.drawer-foot {
  margin-top: 12px;
  font-size: 11px;
  color: #879ca4;
  line-height: 1.7;
}
.timeline-scroll,
.settings-scroll {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 3px 0;
}
.timeline-item {
  position: relative;
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 11px 0;
  color: #72848b;
}
.timeline-item:before {
  content: "";
  width: 7px;
  height: 7px;
  border: 1px solid #687e8555;
  border-radius: 50%;
  flex-shrink: 0;
}
.timeline-item:after {
  content: "";
  position: absolute;
  height: calc(100% - 10px);
  top: calc(50% + 7px);
  left: 3px;
  background: #83939d22;
  width: 1px;
}
.timeline-item.current {
  color: #ecd295;
}
.timeline-item.current:before {
  background: #e1bf7b;
  border-color: #e1bf7b;
  box-shadow: 0 0 12px #edbb69aa;
}
.timeline-item.past {
  color: #a7bebf;
}
.timeline-item.past:before {
  background: #829a94;
}
.timeline-item > div {
  flex: 1;
}
.timeline-item strong {
  font-size: 14px;
  font-weight: 400;
}
.timeline-item small {
  font-size: 10px;
  display: block;
  letter-spacing: 0.15em;
  margin-top: 5px;
}
.timeline-item > span {
  font-size: 11px;
}
.future {
  margin: 20px 0 30px;
  padding: 20px 15px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: #7c9099;
  font-size: 12px;
}
.future span {
  color: #b4a079;
}
.future p {
  line-height: 2;
}
.future small {
  font-size: 10px;
}
.log-title {
  font-size: 13px;
  font-weight: 400;
  color: var(--gold);
}
#event-log {
  list-style: none;
  padding: 0;
  font-size: 12px;
  color: #9cafb5;
  line-height: 1.8;
}
#event-log li {
  padding: 8px 0;
  border-bottom: 1px solid #96a4af12;
}
.help-steps p {
  font-size: 13px;
  color: #a3b5bd;
  line-height: 1.9;
  margin: 0 0 20px;
}
.help-steps b {
  display: block;
  font-weight: 500;
  color: #e4d6b2;
  font-size: 14px;
  margin-bottom: 4px;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 17px 0;
  font-size: 14px;
}
.setting-row select {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f202b;
  color: #d9c18c;
  font: inherit;
}
.setting-row input {
  width: 23px;
  height: 23px;
  accent-color: var(--gold);
}
.wide-button {
  border: 1px solid var(--line);
  border-radius: 9px;
  min-height: 46px;
  width: 100%;
  margin: 7px 0;
  color: #d7c291;
}
.danger {
  color: #d7a99a;
}
.fineprint {
  font-size: 11px;
  color: #7c929e;
  line-height: 1.9;
  margin-top: 22px;
}
.version {
  font-size: 9px;
  letter-spacing: 0.1em;
  color: #7b8f99;
}
.completion {
  position: absolute;
  z-index: 19;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(480px, calc(100% - 34px));
  padding: 42px 25px;
  text-align: center;
  background: linear-gradient(155deg, #1b2e32f5, #09131df8);
  border: 1px solid #caae7466;
  border-radius: 22px;
  box-shadow: 0 20px 100px #0008;
  backdrop-filter: blur(22px);
}
.completion > .eyebrow {
  justify-content: center;
}
.complete-star {
  display: block;
  font-size: 52px;
  color: var(--gold);
  margin: 22px 0 18px;
  text-shadow: 0 0 35px #dcae6388;
}
.completion h2 {
  font-family: "Chronicle Serif", "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 34px;
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.12em;
  margin: 0 0 19px;
}
.completion p {
  font-size: 12px;
  color: #b7c9ca;
  line-height: 2.1;
}
.completion button {
  margin: 20px 0;
}
.completion small {
  display: block;
  color: #82989d;
  font-size: 10px;
}
#exit-photo {
  position: absolute;
  bottom: calc(25px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 25px;
  background: #0e1b29b0;
  min-height: 44px;
  padding: 0 23px;
  opacity: 0.6;
  z-index: 10;
}
.photo-mode .ui {
  opacity: 0;
  pointer-events: none;
}
.ui {
  transition: opacity 0.25s;
}
.agent-label {
  position: absolute;
  top: 41%;
  left: 50%;
  transform: translateX(-50%);
  background: #12272cd9;
  border: 1px solid #c9b27455;
  border-radius: 9px;
  padding: 8px 13px;
  font-size: 12px;
  color: #e8d7b4;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 18px #0003;
}
.agent-label small {
  display: block;
  font-size: 10px;
  color: #9db4b7;
  margin-top: 5px;
}
.selected-tool #world {
  cursor: crosshair;
}
@media (max-width: 1050px) {
  .quick-powers {
    display: none;
  }
  .control-deck {
    justify-content: space-between;
  }
  .time-panel {
    flex: unset;
  }
  .bottom {
    width: min(700px, calc(100% - 60px));
  }
  .metrics {
    right: 27px;
    width: 107px;
  }
  .epoch {
    left: 30px;
  }
  .epoch h1 {
    font-size: 32px;
  }
  .topbar {
    left: 25px;
    right: 25px;
  }
  .brand strong {
    font-size: 17px;
  }
  .view-switch {
    top: calc(94px + env(safe-area-inset-top));
  }
  .epoch {
    top: 173px;
  }
  .metrics {
    top: 173px;
  }
  .region-label {
    left: 30px;
  }
}
@media (max-width: 600px) {
  :root {
    font-size: 14px;
  }
  .topbar {
    top: calc(12px + env(safe-area-inset-top));
    left: 17px;
    right: 17px;
  }
  .brand {
    gap: 9px;
  }
  .brand img {
    height: 37px;
    width: 37px;
    border-radius: 10px;
  }
  .brand strong {
    font-size: 16px;
    letter-spacing: 0.09em;
  }
  .brand span {
    font-size: 7px;
    letter-spacing: 0.2em;
  }
  .top-actions {
    gap: 7px;
  }
  .top-actions .icon-button {
    height: 37px;
    width: 37px;
  }
  .top-actions svg {
    width: 18px;
  }
  .epoch {
    left: 21px;
    top: calc(85px + env(safe-area-inset-top));
  }
  .eyebrow {
    font-size: 8px;
    gap: 8px;
    letter-spacing: 0.16em;
  }
  .epoch h1 {
    font-size: 25px;
    margin: 10px 0 6px;
    letter-spacing: 0.09em;
  }
  .epoch > p {
    font-size: 8px;
    letter-spacing: 0.25em;
    margin-bottom: 13px;
  }
  .epoch-progress {
    width: 80px;
  }
  .metrics {
    top: calc(86px + env(safe-area-inset-top));
    right: 18px;
    gap: 10px;
    width: 76px;
  }
  .metrics > div {
    grid-template-columns: 14px 1fr;
    column-gap: 7px;
  }
  .metrics svg {
    width: 13px;
  }
  .metrics label {
    font-size: 8px;
  }
  .metrics strong {
    font-size: 16px;
    line-height: 1.3;
  }
  .metrics small {
    font-size: 8px;
  }
  .view-switch {
    top: calc(193px + env(safe-area-inset-top));
    left: 19px;
    transform: none;
    padding: 3px;
  }
  .view-switch button {
    min-height: 34px;
    font-size: 10px;
    padding: 0 11px;
    gap: 4px;
  }
  .view-switch svg {
    width: 13px;
  }
  .camera-tools {
    right: 16px;
    bottom: calc(227px + env(safe-area-inset-bottom));
    gap: 7px;
  }
  .camera-tools .icon-button {
    width: 36px;
    height: 36px;
  }
  .camera-tools svg {
    width: 17px;
  }
  .camera-tools #zoom-in,
  .camera-tools #zoom-out {
    display: none;
  }
  .bottom {
    width: calc(100% - 26px);
    bottom: calc(10px + env(safe-area-inset-bottom));
  }
  .control-deck {
    border-radius: 16px;
    padding: 8px 10px;
    gap: 3px;
    flex-direction: column;
    align-items: stretch;
  }
  .time-panel {
    justify-content: space-between;
    gap: 5px;
  }
  .pause {
    height: 42px;
    width: 42px;
    border-radius: 10px;
  }
  .speeds {
    flex: 1;
    justify-content: space-evenly;
    gap: 0;
  }
  .speeds button {
    font-size: 11px;
    min-width: 34px;
    height: 42px;
    padding: 0 4px;
  }
  .next-era {
    font-size: 9px;
    flex-direction: column;
    gap: 0;
    padding: 0 7px;
    line-height: 1.5;
    min-width: 54px;
    height: 42px;
  }
  .next-era svg {
    width: 16px;
    height: 17px;
  }
  .power-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    margin-top: 5px;
    padding: 7px 3px 0;
    justify-content: space-between;
  }
  .power-trigger {
    gap: 8px;
    min-height: 38px;
  }
  .power-trigger > svg {
    width: 22px;
  }
  .power-trigger strong {
    font-size: 12px;
  }
  .power-trigger small {
    font-size: 9px;
    margin-top: 2px;
  }
  .power-chevron {
    font-size: 14px;
  }
  .quick-powers {
    display: flex;
    gap: 4px;
  }
  .quick-powers button {
    width: 33px;
    height: 37px;
  }
  .quick-powers svg {
    width: 18px;
  }
  .footer-meta {
    font-size: 8px;
    margin: 8px 5px 0;
    letter-spacing: 0;
  }
  .chronicle-note {
    gap: 9px;
    justify-content: space-between;
    margin: 0 7px 12px;
    min-height: 43px;
  }
  .note-glyph {
    font-size: 20px;
  }
  .chronicle-note > div {
    flex: 1;
  }
  .chronicle-note p {
    font-size: 13px;
    line-height: 1.6;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
  }
  .chronicle-note small {
    font-size: 9px;
    line-height: 1.6;
    display: block;
    max-width: 260px;
  }
  .chronicle-note .icon-button {
    width: 34px;
    height: 34px;
    margin-left: 0;
  }
  .chronicle-note svg {
    width: 16px;
  }
  .region-label {
    left: 23px;
    bottom: calc(249px + env(safe-area-inset-bottom));
    gap: 6px;
    max-width: 75%;
  }
  .region-label .eyebrow {
    font-size: 7px;
  }
  .region-label strong {
    font-size: 17px;
  }
  .region-label small {
    font-size: 10px;
  }
  .power-hint {
    bottom: calc(214px + env(safe-area-inset-bottom));
    padding: 9px 10px 9px 14px;
    font-size: 10px;
    gap: 8px;
    max-width: calc(100% - 30px);
  }
  .power-hint button {
    padding-left: 8px;
    font-size: 10px;
  }
  .drawer {
    top: auto;
    right: 9px;
    left: 9px;
    bottom: calc(9px + env(safe-area-inset-bottom));
    width: auto;
    max-height: calc(
      100dvh - 85px - env(safe-area-inset-top) - env(safe-area-inset-bottom)
    );
    padding: 20px;
    border-radius: 21px;
  }
  .drawer h2 {
    font-size: 22px;
  }
  .drawer header .eyebrow {
    font-size: 9px;
  }
  .drawer header .icon-button {
    width: 36px;
    height: 36px;
  }
  .drawer-intro {
    font-size: 12px;
    margin: 16px 0;
  }
  .power-card {
    min-height: 115px;
    padding: 12px;
  }
  .power-card strong {
    font-size: 13px;
  }
  .power-card small {
    font-size: 10px;
  }
  .timeline-drawer,
  .settings {
    height: 76dvh;
  }
  .welcome p {
    font-size: 28px;
  }
  .welcome img {
    width: min(30vh, 220px);
    margin: 24px 0 20px;
  }
  .welcome-desc {
    font-size: 10px;
  }
  .welcome .gold-button {
    margin-top: 24px;
  }
  .welcome-inner {
    padding: calc(20px + env(safe-area-inset-top)) 23px
      calc(20px + env(safe-area-inset-bottom));
  }
  .welcome small {
    font-size: 8px;
  }
  .welcome .eyebrow {
    font-size: 8px;
  }
  #toast {
    top: calc(59px + env(safe-area-inset-top));
    font-size: 11px;
    width: max-content;
    max-width: 90%;
    padding: 10px 16px;
  }
  .agent-label {
    top: 45%;
    font-size: 11px;
  }
  .agent-label small {
    font-size: 9px;
  }
}
@media (max-height: 660px) and (max-width: 600px) {
  .epoch {
    top: calc(68px + env(safe-area-inset-top));
  }
  .metrics {
    top: calc(68px + env(safe-area-inset-top));
  }
  .view-switch {
    top: calc(171px + env(safe-area-inset-top));
  }
  .region-label {
    display: none !important;
  }
  .chronicle-note small {
    display: none;
  }
  .welcome img {
    width: 23vh;
  }
  .welcome p {
    font-size: 24px;
  }
  .welcome .gold-button {
    margin: 15px 0 9px;
  }
  .welcome-desc {
    font-size: 9px;
  }
  .camera-tools {
    bottom: 210px;
  }
}
@media (max-height: 520px) and (min-width: 601px) {
  .topbar {
    top: 13px;
  }
  .epoch {
    top: 93px;
  }
  .metrics {
    top: 96px;
    gap: 10px;
  }
  .view-switch {
    top: 16px;
  }
  .bottom {
    bottom: 10px;
    width: min(740px, calc(100% - 60px));
  }
  .chronicle-note {
    margin-bottom: 8px;
  }
  .chronicle-note small {
    display: none;
  }
  .control-deck {
    min-height: 62px;
  }
  .region-label {
    bottom: 163px;
  }
  .camera-tools {
    bottom: 139px;
  }
  .welcome img {
    width: 130px;
    margin: 10px;
  }
  .welcome p {
    font-size: 21px;
  }
  .welcome .gold-button {
    margin: 13px 0 8px;
  }
  .welcome-desc {
    font-size: 10px;
  }
  .drawer {
    top: 65px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
  .ui,
  #toast {
    transition: none;
  }
}
/* The transparent header must never cover the camera tabs. */
.topbar {
  pointer-events: none;
}
.topbar > a,
.topbar > .top-actions {
  pointer-events: auto;
}
