:root {
  color-scheme: dark;
  --mn-bg: #0f0f0e;
  --mn-bg-soft: #151411;
  --mn-surface-1: #171613;
  --mn-surface-2: #1e1c18;
  --mn-surface-3: #25211c;
  --mn-border: rgba(220, 197, 156, 0.16);
  --mn-border-strong: rgba(220, 197, 156, 0.28);
  --mn-text: #ede4d6;
  --mn-text-secondary: #bfb4a4;
  --mn-text-muted: #a69a89;
  --mn-gold: #b58a4f;
  --mn-gold-soft: #8c6b42;
  --mn-gold-light: #d2b37c;
  --mn-black: #090909;
  --ivory: var(--mn-text);
  --charcoal: var(--mn-text);
  --olive: var(--mn-text-secondary);
  --line: var(--mn-border);
  --taupe: var(--mn-text-secondary);
  --sage: var(--mn-gold);
  --safe: env(safe-area-inset-bottom, 0px);
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: Inter, system-ui, sans-serif;
}
* {
  box-sizing: border-box;
}
[hidden],
#nl-badge-frame {
  display: none !important;
}
html {
  background: var(--mn-bg);
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--mn-text);
  background:
    radial-gradient(
      ellipse at 50% 0,
      rgba(181, 138, 79, 0.065),
      transparent 550px
    ),
    linear-gradient(#11100e, #0c0c0b);
  font: 15px/1.55 var(--sans);
  -webkit-tap-highlight-color: transparent;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button {
  color: inherit;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
a {
  color: inherit;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--mn-gold-light);
  outline-offset: 3px;
}
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  z-index: 20;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
header {
  height: calc(62px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 10;
  max-width: 620px;
  margin: auto;
}
.iconbtn,
.close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: transparent;
  border: 1px solid var(--mn-border);
  border-radius: 50%;
  color: var(--mn-text-secondary);
}
.header-actions {
  display: flex;
  gap: 5px;
}
.brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font: 18px var(--serif);
  letter-spacing: 0.18em;
  border: 0;
  background: transparent;
  min-height: 44px;
  color: var(--mn-gold-light);
}
.brand span {
  color: var(--mn-gold-soft);
}
.ui-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
main {
  max-width: 620px;
  margin: auto;
  padding: 12px 20px calc(100px + var(--safe));
  min-height: calc(100dvh - 62px);
  position: relative;
}
h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.2;
}
h1 {
  font-size: 30px;
  letter-spacing: 0.15em;
  margin: 12px 0 5px;
}
h2 {
  font-size: 30px;
  margin: 8px 0 14px;
  letter-spacing: 0.035em;
}
h3 {
  font-size: 23px;
  margin: 8px 0;
  overflow-wrap: anywhere;
}
p {
  margin: 10px 0;
}
.eyebrow,
.kicker,
.meta,
.micro,
small {
  font-family: var(--sans);
}
.eyebrow,
.kicker,
.meta {
  font-size: 10px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--mn-text-secondary);
}
.kicker {
  margin: 0;
}
.micro {
  font-size: 11px;
  line-height: 1.5;
  color: var(--mn-text-muted);
}
.meta {
  display: block;
  margin-bottom: 8px;
}
.emblem {
  width: 84px;
  height: 112px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  margin: auto;
}
.emblem img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.brand-block {
  text-align: center;
  padding: 12px 0 4px;
}
.brand-block .eyebrow {
  font-size: 8px;
  letter-spacing: 0.26em;
}
.tagline {
  text-align: center;
  font: 22px/1.35 var(--serif);
  margin: 18px 0 26px;
  color: var(--mn-text);
}
.tagline em {
  color: var(--mn-text-secondary);
  font-weight: 400;
}
.feature-case {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--mn-border-strong);
  border-radius: 18px;
  min-height: 244px;
  text-decoration: none;
  background: var(--mn-surface-2);
}
.feature-case > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 45%;
  filter: saturate(0.6) contrast(1.08) brightness(0.78) sepia(0.08);
}
.feature-case:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    rgba(9, 9, 8, 0.98),
    rgba(9, 9, 8, 0.4) 65%,
    rgba(9, 9, 8, 0.15)
  );
}
.feature-content {
  position: relative;
  z-index: 1;
  padding: 20px;
  min-height: 244px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.feature-content > .eyebrow {
  color: var(--mn-text);
  margin: 0 auto auto 0;
  width: 100%;
  font-size: 9px;
}
.feature-content > .eyebrow span {
  float: right;
  font-size: 18px;
}
.feature-content h2 {
  font-size: 31px;
  text-transform: uppercase;
  letter-spacing: 0.055em;
  margin: 34px 0 12px;
}
.feature-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--mn-text-secondary);
}
.feature-meta > span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.feature-meta svg {
  width: 13px;
  height: 13px;
  color: var(--mn-gold-light);
}
.progress-track {
  height: 2px;
  background: rgba(220, 197, 156, 0.22);
  margin: 16px 0 0;
}
.progress-track span {
  display: block;
  height: 100%;
  background: var(--mn-gold-light);
  min-width: 3px;
}
.feature-content .micro {
  font-size: 9px;
  margin: 7px 0 0;
}
.home-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0;
}
.home-stats button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border: 1px solid var(--mn-border);
  border-radius: 14px;
  background: var(--mn-surface-1);
  padding: 14px 8px;
}
.home-stats svg {
  color: var(--mn-gold);
  width: 18px;
  height: 18px;
}
.home-stats strong {
  font: 30px var(--serif);
}
.home-stats small {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--mn-text-secondary);
}
.sealed-record {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  padding: 19px 14px;
  border: 1px solid var(--mn-border);
  border-radius: 16px;
  background: linear-gradient(110deg, #1b1914, #10100f);
  text-align: left;
}
.sealed-record .eyebrow {
  font-size: 8px;
  color: var(--mn-gold-light);
  letter-spacing: 0.12em;
}
.sealed-copy {
  display: block;
  font: 17px/1.35 var(--serif);
  color: var(--mn-text-secondary);
  margin-top: 7px;
}
.seal-orbit {
  width: 47px;
  height: 47px;
  flex-shrink: 0;
  border: 1px solid var(--mn-gold-soft);
  border-radius: 50%;
  position: relative;
  background: repeating-conic-gradient(
    from 5deg,
    transparent 0 14deg,
    rgba(181, 138, 79, 0.14) 15deg 16deg
  );
}
.seal-orbit:after,
.seal-orbit:before {
  content: "";
  position: absolute;
  border: 1px solid var(--mn-border-strong);
  border-radius: 50%;
  inset: 7px;
}
.seal-orbit:after {
  inset: 15px;
}
.round-arrow {
  display: grid;
  place-items: center;
  border: 1px solid var(--mn-border-strong);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  margin-left: auto;
  flex-shrink: 0;
  color: var(--mn-gold-light);
}
.section-label {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--mn-border);
  padding-top: 23px;
  margin: 28px 0 18px;
  font-size: 8px;
  letter-spacing: 0.12em;
  color: var(--mn-text-muted);
}
.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0;
}
.stat {
  padding: 14px;
  border: 1px solid var(--mn-border);
  border-radius: 12px;
  background: var(--mn-surface-1);
}
.stat small,
.card small,
.archive-doc > small {
  display: block;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mn-gold-light);
}
.stat b {
  display: block;
  font-size: 12px;
  font-weight: 500;
  margin-top: 8px;
  overflow-wrap: anywhere;
}
.panel,
.archive-doc,
.card {
  background: var(--mn-surface-1);
  border: 1px solid var(--mn-border);
  border-radius: 16px;
  padding: 19px;
  box-shadow:
    0 8px 24px #00000022,
    inset 0 1px #ffffff03;
}
.panel {
  margin: 18px 0;
  line-height: 1.6;
  white-space: pre-line;
}
.objective {
  font-size: 14px;
  color: var(--mn-text-secondary);
  line-height: 1.55;
}
.list {
  display: grid;
  gap: 14px;
}
.card p {
  color: var(--mn-text-secondary);
  font-size: 13px;
}
.card.locked {
  background: var(--mn-black);
}
.primary,
.secondary,
.choice,
input,
textarea,
select {
  width: 100%;
  padding: 13px 14px;
  min-height: 46px;
  border: 1px solid var(--mn-border-strong);
  background: var(--mn-surface-2);
  color: var(--mn-text);
  border-radius: 12px;
}
input,
textarea,
select {
  font-size: 16px;
}
input::placeholder,
textarea::placeholder {
  color: var(--mn-text-muted);
  opacity: 1;
}
textarea {
  min-height: 110px;
  resize: vertical;
}
.primary,
.secondary {
  font: 500 10px/1.5 var(--sans);
  letter-spacing: 0.14em;
  margin-top: 10px;
  text-transform: uppercase;
}
.primary {
  background: #29241c;
  border-color: var(--mn-gold-soft);
  color: var(--mn-text);
}
.secondary {
  background: transparent;
}
.choice {
  text-align: left;
}
.choices {
  display: grid;
  gap: 9px;
}
.chips,
.filter-chips {
  display: flex;
  gap: 6px;
  margin: 16px 0 22px;
  overflow: auto;
  scrollbar-width: none;
}
.chip,
.filter-chips button {
  font: 500 9px var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 10px 12px;
  border: 1px solid var(--mn-border);
  border-radius: 10px;
  background: var(--mn-surface-2);
  color: var(--mn-text-secondary);
  min-height: 44px;
  white-space: nowrap;
}
.filter-chips button[aria-pressed="true"],
.segmented button[aria-pressed="true"] {
  background: var(--mn-text);
  color: #191714;
  border-color: var(--mn-text);
}
.page-heading {
  padding: 13px 0 22px;
}
.page-heading h2 {
  font-size: 30px;
  letter-spacing: 0.14em;
  margin: 0 0 8px;
}
.page-heading .eyebrow {
  font-size: 8px;
  letter-spacing: 0.15em;
}
.searchbox {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--mn-surface-1);
  border: 1px solid var(--mn-border-strong);
  border-radius: 12px;
  padding: 0 12px;
  color: var(--mn-gold);
}
.searchbox input {
  border: 0;
  background: transparent;
  padding-left: 4px;
}
.searchbox svg {
  width: 18px;
}
.archive-timeline {
  border-left: 1px solid var(--mn-gold-soft);
  margin-left: 5px;
  padding-left: 19px;
}
.archive-timeline > article {
  position: relative;
  margin: 0;
}
.archive-timeline > article:before {
  content: "";
  position: absolute;
  left: -25px;
  top: 24px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mn-gold);
  border: 2px solid var(--mn-bg);
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 13px/1.6 var(--sans);
  color: var(--mn-text-secondary);
}
.version-grid {
  display: grid;
  gap: 10px;
}
.version {
  padding: 12px;
  border: 1px solid var(--mn-border);
  border-radius: 10px;
  font-size: 13px;
}
.sealed {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(
      circle at 100% 0,
      rgba(181, 138, 79, 0.08),
      transparent 65%
    ),
    #111110;
}
.segmented {
  display: flex;
  border: 1px solid var(--mn-border);
  padding: 4px;
  border-radius: 12px;
  gap: 5px;
  margin-bottom: 16px;
  background: var(--mn-surface-1);
}
.segmented button {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--mn-text-secondary);
}
.map-panel {
  background: radial-gradient(ellipse, #252219, #12110f);
  border: 1px solid var(--mn-border-strong);
  border-radius: 16px;
  margin-bottom: 18px;
  padding: 15px 12px;
}
.map-label {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
}
.journey {
  width: 100%;
  color: rgba(181, 138, 79, 0.15);
  overflow: visible;
}
.journey circle {
  stroke: var(--mn-gold-light);
  stroke-width: 1.5;
  fill: var(--mn-bg);
}
.journey .visited {
  fill: var(--mn-gold);
}
.journey text {
  font: 8px var(--sans);
  fill: var(--mn-text);
}
.map-panel .micro {
  font-size: 8px;
}
.map-panel .micro span {
  float: right;
}
.relic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 24px;
}
.relic-card {
  padding: 12px;
  overflow: hidden;
}
.relic-art {
  display: grid;
  place-items: center;
  height: 155px;
  margin: -12px -12px 16px;
  background: radial-gradient(ellipse at 50% 70%, #3a3021, #141310 70%);
  border-bottom: 1px solid var(--mn-border);
}
.relic-art svg {
  width: 65px;
  height: 65px;
  color: var(--mn-gold);
  stroke-width: 0.6;
  filter: drop-shadow(0 12px 8px black);
}
.relic-card h3 {
  font-size: 22px;
}
.relic-card small {
  font-size: 8px;
  line-height: 1.5;
}
.relic-card p {
  font-size: 11px;
}
.oracle-avatar {
  width: 100px;
  height: 100px;
  display: grid;
  place-items: center;
  border: 1px solid var(--mn-gold-soft);
  border-radius: 50%;
  margin: 0 auto 15px;
  position: relative;
  background: radial-gradient(circle, #30291d, #10100f 70%);
}
.oracle-avatar:before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid var(--mn-border-strong);
  border-radius: 50%;
}
.oracle-avatar .emblem {
  transform: scale(0.52);
  height: 119px;
  margin-top: -10px;
}
.oracle-avatar > span {
  position: absolute;
  inset: -6px;
  border: 1px solid var(--mn-border);
  border-radius: 50%;
}
.oracle-avatar > span:after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--mn-gold-light);
  border-radius: 50%;
  top: 15px;
  right: 10px;
}
.oracle-avatar.thinking > span {
  animation: orbit 5s ease-in-out infinite alternate;
}
.oracle-status {
  text-align: center;
  font-size: 8px;
  color: var(--mn-gold-light);
}
.oracle-log {
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-height: 180px;
  flex: 1;
  overflow-y: auto;
  padding: 18px 0;
  overscroll-behavior: contain;
}
.bubble {
  max-width: 84%;
  padding: 16px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-radius: 18px;
  font-size: 14px;
}
.bubble.user {
  align-self: flex-end;
  background: #c7bbaa;
  color: #191714;
}
.bubble.assistant {
  align-self: flex-start;
  background: #151412;
  border: 1px solid rgba(181, 138, 79, 0.35);
  color: #efe6d8;
}
.bubble.typing {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--mn-gold-light);
}
.thinking-dots {
  display: block;
  font-size: 19px;
  letter-spacing: 5px;
  animation: soft-pulse 1.4s infinite alternate;
}
.message-opening {
  text-align: center;
  margin: auto;
  color: var(--mn-text-secondary);
  font: 20px var(--serif);
}
.chatbox {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--mn-border-strong);
  border-radius: 18px;
  background: #1a1815f5;
  padding: 6px;
  flex-shrink: 0;
}
.chatbox textarea {
  min-height: 44px;
  height: 44px;
  max-height: 90px;
  resize: none;
  background: none;
  border: 0;
  padding: 10px;
  font-size: 16px;
}
.chatbox button {
  border: 0;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: var(--mn-gold);
  color: #191714;
  font-size: 24px;
}
body[data-page="pythia"] main {
  height: calc(
    var(--viewport-height, 100dvh) - 62px - env(safe-area-inset-top, 0px)
  );
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(86px + var(--safe));
}
body[data-page="pythia"] .page-heading {
  padding-bottom: 16px;
  flex-shrink: 0;
}
body[data-page="pythia"] .oracle-avatar {
  flex-shrink: 0;
}
.notice {
  padding: 18px;
  background: var(--mn-surface-2);
  border: 1px solid var(--mn-border);
  border-left: 2px solid var(--mn-gold);
  border-radius: 12px;
  margin: 16px 0;
  white-space: pre-line;
}
.warden {
  background: #1b1c1b;
  border: 1px solid #ede4d65c;
  color: var(--mn-text);
}
.warden .meta {
  color: var(--mn-text);
}
.hand {
  background: #090909;
  border: 0;
  border-top: 1px dashed var(--mn-gold-soft);
  border-radius: 0;
  font: 20px/1.5 var(--serif);
}
.echo {
  color: var(--mn-text-secondary);
  font-style: italic;
}
.photoButton {
  display: block;
  text-align: center;
}
.photo-preview {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 12px;
  filter: saturate(0.65) contrast(1.08) brightness(0.78) sepia(0.08);
}
fieldset {
  border: 1px solid var(--mn-border);
  border-radius: 12px;
  display: grid;
  gap: 8px;
}
.carrier-portrait {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  margin: 20px auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--mn-gold-soft);
  overflow: hidden;
  font: 32px var(--serif);
  background: var(--mn-surface-1);
}
.carrier-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#carrierForm label:not(.portraitPick) {
  display: block;
  font-size: 10px;
  color: var(--mn-text-secondary);
  letter-spacing: 0.12em;
  margin: 15px 0;
}
#carrierForm input,
#carrierForm textarea {
  margin-top: 7px;
}
.portraitPick {
  display: block;
  text-align: center;
}
.settings-card {
  border-top: 1px solid var(--mn-border);
  margin-top: 26px;
  padding-top: 20px;
}
.settings-card label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 10px;
  letter-spacing: 0.1em;
}
.settings-card small {
  display: block;
  font-size: 11px;
  letter-spacing: 0;
  color: var(--mn-text-secondary);
  margin-top: 6px;
}
.settings-card input {
  width: 24px;
  min-height: 44px;
  accent-color: var(--mn-gold);
}
nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(74px + var(--safe));
  padding: 7px 10px calc(7px + var(--safe));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: #121210f5;
  border-top: 1px solid var(--mn-border-strong);
  backdrop-filter: blur(18px);
  z-index: 12;
}
nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 48px;
  border: 0;
  background: none;
  color: var(--mn-text-muted);
}
nav button span {
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
nav button.active {
  color: var(--mn-gold-light);
}
nav button.active:after {
  content: "";
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--mn-gold-light);
  position: absolute;
  bottom: calc(5px + var(--safe));
}
#toast {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: calc(90px + var(--safe));
  max-width: 560px;
  margin: auto;
  padding: 15px;
  background: #24211c;
  border: 1px solid var(--mn-border-strong);
  border-radius: 12px;
  color: var(--mn-text);
  z-index: 100;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  font-size: 12px;
}
#toast.show {
  opacity: 1;
}
.session {
  max-width: 580px;
  margin: 0 auto calc(100px + var(--safe));
  padding: 10px 20px;
  text-align: center;
  font-size: 9px;
  color: var(--mn-text-muted);
  letter-spacing: 0.1em;
}
.session button {
  background: none;
  color: var(--mn-text-secondary);
  border: 0;
  min-height: 44px;
  padding: 10px;
  font-size: 10px;
}
.login {
  max-width: 390px;
  margin: 0 auto;
  text-align: center;
}
.login .brand-block {
  padding-top: 22px;
}
.login-card {
  margin-top: 30px;
  border-top: 1px solid var(--mn-border);
  padding-top: 28px;
}
.login-card h2 {
  font-size: 32px;
}
.login form {
  display: grid;
  gap: 12px;
  margin: 25px 0;
}
.login .primary {
  margin: 0;
}
.login .micro {
  font-size: 8px;
  letter-spacing: 0.1em;
}
.hero-mark {
  display: grid;
  place-items: center;
  margin: 24px 0;
}
.empty-state {
  text-align: center;
  padding: 40px 15px;
  color: var(--mn-text-secondary);
}
.empty-state .seal-orbit {
  margin: 0 auto 24px;
}
.empty-state .emblem {
  transform: scale(0.6);
  margin-bottom: -15px;
}
dialog {
  width: min(94%, 680px);
  max-height: 90dvh;
  overflow: auto;
  border: 1px solid var(--mn-border-strong);
  background: #171512;
  color: var(--mn-text);
  border-radius: 18px;
  padding: 22px;
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(5px);
}
.close {
  float: right;
  font-size: 27px;
  margin: 0 0 12px 12px;
}
.admin-section {
  border-top: 1px solid var(--mn-border);
  padding: 20px 0;
}
.admin-section > label {
  display: block;
  color: var(--mn-gold-light);
  font-size: 10px;
  letter-spacing: 0.14em;
  margin: 8px 0 12px;
}
.admin-section input,
.admin-section textarea,
.admin-section select {
  margin: 5px 0;
}
.admin-section textarea {
  min-height: 150px;
  font:
    13px/1.5 ui-monospace,
    monospace;
}
.admin-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.admin-section .card {
  margin: 10px 0;
}
.unbroken {
  font-family: var(--serif);
  color: var(--mn-gold-light);
}
.future-flash {
  position: fixed;
  inset: 28% 20px auto;
  max-width: 550px;
  margin: auto;
  z-index: 40;
  background: #090909;
  color: var(--mn-text);
  padding: 30px;
  border: 1px solid var(--mn-border-strong);
  border-radius: 16px;
  display: grid;
  gap: 15px;
  text-align: center;
  box-shadow: 0 20px 80px #0009;
}
.future-flash small,
.future-flash span {
  font-size: 10px;
  letter-spacing: 0.15em;
}
.future-flash b {
  font: 30px var(--serif);
}
#recordSheet {
  text-align: center;
  padding: 26px;
}
#recordSheet .seal-orbit {
  margin: 35px auto 25px;
}
#splash {
  position: fixed;
  inset: 0;
  background: #0c0c0b;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  animation: splash-out 0.3s 1s forwards;
}
#splash .emblem {
  margin: 0;
  animation: fade-in 0.4s both;
}
#splash strong {
  font: 30px var(--serif);
  letter-spacing: 0.14em;
  margin-top: 20px;
  animation: fade-in 0.4s 0.25s both;
}
#splash small {
  font-size: 8px;
  letter-spacing: 0.22em;
  margin-top: 8px;
  animation: fade-in 0.4s 0.4s both;
}
#splash p {
  position: absolute;
  bottom: calc(40px + var(--safe));
  font-size: 8px;
  letter-spacing: 0.18em;
  color: var(--mn-gold-light);
}
.enhanced {
  --mn-text: #fff1dd;
  --mn-text-secondary: #e0d4c2;
  --mn-text-muted: #cabba6;
  --mn-border: rgba(220, 197, 156, 0.4);
  --mn-border-strong: rgba(220, 197, 156, 0.6);
  --mn-surface-1: #25221d;
  --mn-surface-2: #302b24;
}
.enhanced .micro,
.enhanced .eyebrow {
  color: var(--mn-text-secondary);
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes splash-out {
  to {
    opacity: 0;
    visibility: hidden;
  }
}
@keyframes orbit {
  to {
    transform: rotate(6deg);
  }
}
@keyframes soft-pulse {
  to {
    opacity: 0.45;
  }
}
@media (min-width: 700px) {
  main {
    padding-top: 24px;
  }
  .home-stats {
    gap: 16px;
  }
  .feature-case,
  .feature-content {
    min-height: 300px;
  }
  .feature-content h2 {
    font-size: 40px;
  }
  nav {
    max-width: 620px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 1px solid var(--mn-border);
    border-right: 1px solid var(--mn-border);
  }
}
@media (max-height: 700px) {
  body[data-page="pythia"] .oracle-avatar {
    width: 60px;
    height: 60px;
    margin-bottom: 8px;
  }
  body[data-page="pythia"] .oracle-avatar .emblem {
    transform: scale(0.3);
    margin-top: -32px;
  }
  body[data-page="pythia"] .page-heading {
    padding: 0 0 10px;
  }
  body[data-page="pythia"] .oracle-log {
    min-height: 65px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  #splash {
    display: none;
  }
}
.physical-task {
  border: 1px solid var(--mn-gold-soft);
  border-radius: 16px;
  padding: 22px;
  margin: 20px 0;
  background: var(--mn-surface-1);
}
.physical-task > .ui-icon {
  color: var(--mn-gold-light);
  margin-bottom: 8px;
}
.physical-task .secondary {
  border-color: var(--mn-text-secondary);
}
#classification {
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100dvh;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: #090909;
  padding: calc(30px + env(safe-area-inset-top, 0px)) 30px
    calc(30px + var(--safe));
}
.classification-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
}
.classification-content .emblem {
  margin: 0 0 30px;
  opacity: 0.3;
}
.classification-content h2 {
  font-size: 60px;
  letter-spacing: 0.12em;
  margin: 20px 0;
  animation: fade-in 0.7s 0.2s both;
}
.classification-content h3 {
  font-size: 24px;
  letter-spacing: 0.1em;
  animation: fade-in 0.7s 0.6s both;
}
.classification-content > .eyebrow {
  animation: fade-in 0.7s 1s both;
}
.ceremonial-line {
  width: 60px;
  height: 1px;
  background: var(--mn-gold);
  margin: 25px;
}
.classification-content button {
  max-width: 250px;
  margin-top: 40px;
  animation: fade-in 0.7s 1.3s both;
}
.emblem {
  width: 98px;
  height: 134px;
}
.brand-block .emblem {
  width: 70px;
  height: 96px;
}
.brand-block h1 {
  font-size: 28px;
}
.feature-content h2 {
  font-size: 27px;
  letter-spacing: 0.025em;
}
.feature-case,
.feature-content {
  min-height: 226px;
}
.tagline {
  margin: 16px 0 22px;
}
.oracle-avatar .emblem {
  height: 134px;
  margin-top: -17px;
}
body[data-page="pythia"] .session {
  display: none;
}
@media (min-width: 700px) {
  .feature-case,
  .feature-content {
    min-height: 280px;
  }
  .feature-content h2 {
    font-size: 38px;
  }
}
.completed-case {
  text-align: center;
  padding: 26px 15px;
  background: radial-gradient(ellipse at center, #29241b, #11110f 80%);
  border: 1px solid var(--mn-border-strong);
  border-radius: 18px;
}
.completed-case h2 {
  font-size: 40px;
  letter-spacing: 0.08em;
  color: var(--mn-text);
  margin: 14px 0;
}
.completed-case .ceremonial-line {
  margin: 20px auto;
}
/* Photo-first journey: a clear notebook beside a warmer companion voice. */
.investigation { border:1px solid #706044; border-radius:16px; padding:18px 20px; margin:8px 0 26px; background:linear-gradient(135deg,#25251f,#191b18); }
.investigation summary { cursor:pointer; font-size:14px; color:#e4d6bb; }
.investigation summary span { float:right; font-size:11px; opacity:.7; }
.investigation h3 { margin:8px 0 18px; font-size:22px; line-height:1.35; }
.investigation .eyebrow { margin:20px 0 7px; font-size:10px; }
.investigation ul { padding-left:19px; color:#c7c6b8; line-height:1.7; font-size:14px; }
.investigation .next-idea { color:#f1e3c6; line-height:1.6; margin-bottom:0; }
.pythia-note,.photo-request { border-left:2px solid #b49b6d; padding:18px 20px; margin:22px 0; background:#292720; border-radius:0 14px 14px 0; }
.pythia-note p,.photo-request p { white-space:pre-line; line-height:1.7; }
.photo-actions { display:flex; gap:12px; flex-wrap:wrap; }
.photo-actions label { flex:1; cursor:pointer; text-align:center; min-width:120px; }
.photo-actions label:focus-within { outline:2px solid #ebd3a3; outline-offset:4px; }
.photo-actions input { display:block; position:absolute; width:1px; height:1px; opacity:0; }
.photo-observation { color:#dec797; }
.evidence-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:20px; }
.evidence-card { overflow:hidden; border:1px solid #4a483d; border-radius:16px; background:#22231f; }
.evidence-card img { width:100%; aspect-ratio:4/3; object-fit:cover; display:block; }
.evidence-card>div { padding:20px; }
.evidence-card p { line-height:1.6; }
.case-cover { width:100%; max-height:500px; object-fit:cover; border-radius:18px; }
.personal-moment { background:#f8f2e8; color:#463b33; }
.personal-moment .grain,.personal-moment header,.personal-moment #tabs,.personal-moment .session { display:none !important; }
.personal-letter { min-height:80dvh; display:flex; flex-direction:column; justify-content:center; max-width:560px; margin:auto; padding:40px 20px; }
.personal-letter p { font-family:Georgia,serif; font-size:clamp(23px,5vw,34px); line-height:1.7; }
.personal-letter button { color:#594630; border-color:#bca88c; margin-top:35px; }
.authored-opening { border-left:2px solid #b49b6d; }
.journey-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; color:#b7ab91; font-size:11px; margin:0 0 26px; }
.text-link { background:none; border:0; color:#dcc79d; padding:8px 0; cursor:pointer; font-size:12px; }
.skip-consent { display:flex !important; align-items:flex-start; gap:10px; margin:16px 0; color:#e0c493; line-height:1.4; }
.skip-consent input { width:18px !important; height:18px; flex:0 0 auto; margin-top:1px; }
@media(max-width:480px){.investigation{padding:16px}.investigation summary span{float:none;display:block;margin-top:5px}.evidence-grid{grid-template-columns:1fr}}

/* Pythia is a full conversation surface. The visual viewport keeps the composer above mobile keyboards. */
body[data-page="pythia"] {
  height: var(--viewport-height, 100dvh);
  min-height: 0;
  overflow: hidden;
}
body[data-page="pythia"] > header,
body[data-page="pythia"] > .session {
  display: none !important;
}
body[data-page="pythia"] > #tabs { display:grid !important; }
body[data-page="pythia"] main {
  position: fixed;
  top: 0;
  left: 50%;
  width: min(100%, 620px);
  height: calc(var(--viewport-height, 100dvh) - 74px - var(--safe));
  min-height: 0;
  margin: 0;
  padding: 0;
  transform: translateX(-50%);
  overflow: hidden;
}
.pythia-chat {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background:
    radial-gradient(circle at 80% 10%, rgba(181,138,79,.08), transparent 36%),
    #11110f;
}
body[data-page="pythia"].keyboard-open > #tabs { display:none !important; }
body[data-page="pythia"].keyboard-open main { height:var(--viewport-height,100dvh); }
.chat-header {
  min-height: calc(64px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 12px 0;
  display: grid;
  grid-template-columns: 44px 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  background: rgba(24,23,20,.97);
  border-bottom: 1px solid var(--mn-border);
  z-index: 2;
}
.chat-back,
.chat-home {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--mn-text);
  font-size: 34px;
  line-height: 1;
}
.chat-home {
  color: var(--mn-text-secondary);
  font: 17px var(--sans);
  border: 1px solid var(--mn-border);
}
.chat-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #28251e;
  border: 1px solid var(--mn-border-strong);
}
.chat-avatar .emblem {
  width: 28px;
  height: 32px;
  margin: 0;
}
.chat-avatar.thinking { box-shadow: 0 0 0 3px rgba(181,138,79,.14); }
.chat-identity h2 {
  margin: 0;
  font: 600 17px/1.15 var(--sans);
  letter-spacing: 0;
}
.chat-identity p {
  margin: 3px 0 0;
  color: var(--mn-text-secondary);
  font-size: 11px;
}
body[data-page="pythia"] .oracle-log {
  min-height: 0;
  margin: 0;
  padding: 18px 14px 22px;
  gap: 4px;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.message-row {
  display: flex;
  width: 100%;
  margin: 2px 0;
}
.message-row.user { justify-content: flex-end; }
.message-row.assistant { justify-content: flex-start; }
body[data-page="pythia"] .bubble {
  max-width: min(84%, 440px);
  padding: 9px 12px;
  border-radius: 15px;
  font-size: 15px;
  line-height: 1.42;
  box-shadow: 0 1px 1px rgba(0,0,0,.3);
}
body[data-page="pythia"] .bubble.user {
  background: #b99f76;
  color: #171510;
  border-bottom-right-radius: 4px;
}
body[data-page="pythia"] .bubble.assistant {
  background: #27251f;
  border: 0;
  color: #f1eadf;
  border-bottom-left-radius: 4px;
}
body[data-page="pythia"] .authored-opening { border-left: 2px solid var(--mn-gold); }
body[data-page="pythia"] .typing { min-width: 54px; padding: 6px 12px 9px; }
body[data-page="pythia"] .thinking-dots { line-height: 1; color: var(--mn-gold-light); }
body[data-page="pythia"] .photo-request {
  flex: 0 0 auto;
  margin: 14px 0;
  background: #2b2923;
}
body[data-page="pythia"] .chatbox {
  width: auto;
  margin: 0;
  padding: 7px 8px calc(7px + env(safe-area-inset-bottom, 0px));
  gap: 7px;
  align-items: flex-end;
  border: 0;
  border-top: 1px solid var(--mn-border);
  border-radius: 0;
  background: rgba(20,19,17,.98);
  z-index: 3;
}
body[data-page="pythia"] .chatbox textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  height: 44px;
  max-height: 112px;
  padding: 11px 14px;
  overflow-y: auto;
  border: 1px solid var(--mn-border-strong);
  border-radius: 22px;
  background: #2a2823;
  color: var(--mn-text);
  line-height: 20px;
}
body[data-page="pythia"] .chatbox textarea::placeholder { color: #a59c8e; }
body[data-page="pythia"] .chatbox button {
  width: 44px;
  height: 44px;
  margin: 0;
  background: var(--mn-gold-light);
  color: #171510;
}
.chat-offline {
  padding: 16px 18px calc(16px + env(safe-area-inset-bottom, 0px));
  background: #211f1b;
  color: var(--mn-text-secondary);
  text-align: center;
}
@media (min-width: 700px) {
  .pythia-chat { border-inline: 1px solid var(--mn-border); }
}

/* The supplied MNEMOSYNE artwork, with real alpha, replaces the temporary icon. */
.emblem { width:150px; height:150px; overflow:hidden; }
.emblem img { width:100%; height:100%; object-fit:contain; }
.brand-block .emblem { width:172px; height:172px; }
.brand-block h1,.brand-block > .eyebrow { display:none; }
#splash .emblem { width:190px; height:190px; }
#splash strong,#splash small { display:none; }
.chat-avatar .emblem { width:42px; height:42px; }
.chat-avatar .emblem img { width:100%; height:100%; max-width:100%; transform:none; object-fit:contain; object-position:center; }

.main-objective { margin:5px 0 18px; color:#f0cf8f; font-size:29px; }
.riddle-form,.location-consent { margin:20px 0; padding:18px; border:1px solid var(--mn-border-strong); border-radius:16px; background:var(--mn-surface-2); }
.riddle-form label { display:grid; gap:8px; color:var(--mn-text-secondary); }
.riddle-form input { text-transform:uppercase; }
.riddle-hint { min-height:22px; color:#e5c68d; }
.location-consent h3 { font-family:var(--sans); font-size:17px; font-weight:650; }
.real-map { position:relative; margin:14px 0 20px; overflow:hidden; border:1px solid var(--mn-border-strong); border-radius:18px; background:#171a17; }
#journeyMap { width:100%; height:min(58dvh,520px); min-height:390px; background:#dfe4dc; }
.map-legend { display:flex; align-items:center; gap:14px; padding:10px 12px; color:var(--mn-text-secondary); font-size:11px; }
.map-legend span { display:flex; align-items:center; gap:5px; }
.map-legend i { width:10px; height:10px; border:2px solid #8f8779; border-radius:50%; background:#292720; }
.map-legend i.visited { border-color:#d3b06e; background:#b58a4f; }
.map-legend button { margin-left:auto; border:0; background:none; color:var(--mn-gold-light); }
.map-attribution { margin:0; padding:0 12px 10px; color:var(--mn-text-muted); font-size:9px; }
.leaflet-popup-content-wrapper,.leaflet-popup-tip { background:#25231e; color:#f3eadc; }
.record-fields { display:grid; gap:8px; margin-top:14px; }
.record-field { display:grid; grid-template-columns:minmax(90px,.7fr) 1.3fr; gap:12px; padding:10px 0; border-bottom:1px solid var(--mn-border); }
.record-field span,.record-label { color:var(--mn-text-muted); font-size:10px; letter-spacing:.1em; text-transform:uppercase; }
.record-field strong { overflow-wrap:anywhere; font-weight:600; }
.record-list { display:flex; flex-wrap:wrap; gap:7px; }
.record-list>span { padding:5px 8px; background:var(--mn-surface-3); border-radius:8px; }

/* Safari pans the visual viewport independently of the layout viewport. */
html.chat-viewport { height:100%; overflow:hidden; overscroll-behavior:none; }
html.chat-viewport body { position:fixed; inset:0; width:100%; overflow:hidden; overscroll-behavior:none; }
body[data-page="pythia"] main { top:var(--viewport-top,0px); }
body[data-page="pythia"] .pythia-chat { flex:1; width:100%; min-height:0; }
body[data-page="pythia"] .oracle-log { touch-action:pan-y; }
body[data-page="pythia"].keyboard-open .chatbox { padding-bottom:7px; }
.emblem img { transform:none; object-position:center; }
.chat-avatar .emblem { margin:0; display:grid; place-items:center; }
