:root {
  --mansion-black: #040706;
  --mansion-velvet: #0a0d0c;
  --mansion-blood: #d4483e;
  --mansion-vermilion: #d4483e;
  --mansion-bone: #e6e3d7;
  --mansion-muted: #8e9a96;
  --mansion-gold: #6ba8a8;
  --mansion-gold-bright: #d7e5df;
  --mansion-verdigris: #5f9f9f;
  --mansion-blue: #75b5b3;
  --mansion-panel: rgba(5, 9, 8, 0.97);
  --tokyo-ink: #050807;
  --tokyo-paper: #e6e3d7;
  --tokyo-cyan: #68a9a9;
  --tokyo-red: #d4483e;
  --tokyo-yellow: #c8ad55;
}

/* Primary descent command: centered, ceremonial, and visually dominant. */
.model-picker-frame {
  grid-template-rows: 5.6rem minmax(0, 1fr) 7.2rem;
}

.model-picker-footer {
  position: relative;
  min-height: 7.2rem;
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) minmax(19rem, 24rem) minmax(10rem, 1fr);
  align-items: center;
  gap: 1.25rem;
  padding: 0.72rem 1.4rem;
  overflow: visible;
  border-top: 1px solid rgba(213, 235, 226, 0.22);
  background:
    linear-gradient(90deg, rgba(2, 7, 7, 0.98), rgba(32, 4, 10, 0.9) 50%, rgba(2, 7, 7, 0.98)),
    url("/assets/mansion-panel-v2.webp");
  background-size: auto, 42rem 42rem;
}

.model-picker-footer::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: -0.18rem;
  bottom: 0;
  left: 50%;
  width: min(31rem, 38vw);
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(201, 52, 65, 0.1) 18%, transparent 32% 68%, rgba(104, 229, 217, 0.08) 82%, transparent),
    linear-gradient(180deg, rgba(229, 220, 178, 0.32), transparent 0.18rem);
  clip-path: polygon(7% 0, 93% 0, 100% 22%, 94% 100%, 6% 100%, 0 22%);
  transform: translateX(-50%);
}

.model-picker-footer > div {
  position: relative;
  z-index: 1;
  grid-column: 1;
  min-width: 0;
  padding-left: 0.7rem;
  border-left: 0.16rem solid rgba(104, 229, 217, 0.44);
}

.model-picker-footer > .picker-hina-dialogue {
  position: relative;
  z-index: 1;
  grid-column: 3;
  max-width: none;
  margin: 0;
  color: rgba(205, 221, 214, 0.58);
  font-size: 0.64rem;
  line-height: 1.45;
  text-align: right;
}

.picker-confirm {
  position: relative;
  z-index: 2;
  grid-column: 2;
  width: 100%;
  min-width: 0;
  min-height: 5.35rem;
  display: grid;
  grid-template-rows: auto auto auto;
  place-content: center;
  justify-items: center;
  gap: 0.08rem;
  padding: 0.62rem 2.8rem 0.68rem;
  overflow: hidden;
  border: 0;
  background:
    linear-gradient(90deg, rgba(4, 7, 7, 0.98), rgba(80, 7, 18, 0.98) 17%, #a91f35 49%, rgba(68, 5, 16, 0.98) 82%, rgba(3, 7, 7, 0.98)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 34%);
  color: #f7f4e8;
  filter:
    drop-shadow(0 0 0.5rem rgba(221, 56, 69, 0.62))
    drop-shadow(0 0 1.8rem rgba(150, 17, 40, 0.44));
  clip-path: polygon(1.2rem 0, calc(50% - 1.2rem) 0, 50% 0.42rem, calc(50% + 1.2rem) 0, calc(100% - 1.2rem) 0, 100% 50%, calc(100% - 1.2rem) 100%, calc(50% + 1.2rem) 100%, 50% calc(100% - 0.42rem), calc(50% - 1.2rem) 100%, 1.2rem 100%, 0 50%);
  isolation: isolate;
  cursor: pointer;
  animation: descent-command-pulse 2.6s ease-in-out infinite;
}

.picker-confirm::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -40%;
  bottom: -40%;
  left: -28%;
  width: 24%;
  background: linear-gradient(90deg, transparent, rgba(255, 248, 218, 0.72), transparent);
  transform: skewX(-17deg);
  animation: descent-command-sweep 3.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.picker-confirm::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0.22rem;
  border-top: 1px solid rgba(255, 243, 201, 0.7);
  border-bottom: 1px solid rgba(104, 229, 217, 0.48);
  clip-path: inherit;
  pointer-events: none;
}

.picker-confirm .picker-confirm-kicker,
.picker-confirm small {
  color: rgba(246, 231, 181, 0.82);
  font: 750 0.55rem/1.15 "Cascadia Code", Consolas, monospace;
  letter-spacing: 0;
}

.picker-confirm > strong {
  color: #fffdf3;
  font: 700 2rem/1 "Yu Mincho", "Hiragino Mincho ProN", serif;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  text-shadow:
    0 0 0.42rem rgba(255, 255, 239, 0.92),
    0 0 1.3rem rgba(255, 66, 82, 0.88),
    0 0 2.8rem rgba(176, 12, 38, 0.72);
}

.picker-confirm > i {
  position: absolute;
  top: 50%;
  right: 1.15rem;
  width: 0.5rem;
  height: 1.9rem;
  background: linear-gradient(180deg, transparent, #f8ecc1 18% 28%, #65e0d5 29% 68%, transparent 72%);
  clip-path: polygon(50% 0, 100% 30%, 65% 100%, 35% 100%, 0 30%);
  transform: translateY(-50%);
  filter: drop-shadow(0 0 0.48rem rgba(104, 229, 217, 0.88));
}

.picker-confirm:hover,
.picker-confirm:focus-visible {
  background:
    linear-gradient(90deg, #081514, #871126 14%, #d33349 50%, #821024 86%, #081514),
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), transparent 38%);
  color: #fff;
  filter:
    drop-shadow(0 0 0.75rem rgba(255, 238, 188, 0.78))
    drop-shadow(0 0 2.4rem rgba(226, 38, 61, 0.72));
  outline: 0;
  transform: scale(1.035);
}

.picker-confirm:active {
  transform: scale(0.97);
}

.picker-confirm.is-armed {
  animation: descent-command-arm 880ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes descent-command-pulse {
  0%, 100% { filter: drop-shadow(0 0 0.42rem rgba(221, 56, 69, 0.5)) drop-shadow(0 0 1.4rem rgba(150, 17, 40, 0.34)); }
  48% { filter: drop-shadow(0 0 0.72rem rgba(255, 229, 178, 0.7)) drop-shadow(0 0 2.2rem rgba(214, 31, 55, 0.62)); }
}

@keyframes descent-command-sweep {
  0%, 28% { left: -28%; opacity: 0; }
  38% { opacity: 0.82; }
  62% { left: 112%; opacity: 0.46; }
  63%, 100% { left: 112%; opacity: 0; }
}

@keyframes descent-command-arm {
  0% { transform: scale(0.9); filter: brightness(0.35) drop-shadow(0 0 0 transparent); }
  32% { transform: scale(1.07); filter: brightness(1.9) drop-shadow(0 0 2.8rem rgba(255, 52, 76, 0.96)); }
  58% { transform: scale(0.985); filter: brightness(1.08) drop-shadow(0 0 1.2rem rgba(104, 229, 217, 0.72)); }
  100% { transform: scale(1); filter: brightness(1) drop-shadow(0 0 1.8rem rgba(207, 30, 54, 0.58)); }
}

@media (max-width: 1100px) {
  .model-picker-footer {
    grid-template-columns: minmax(8rem, 1fr) minmax(17rem, 21rem) minmax(8rem, 1fr);
    gap: 0.75rem;
    padding-inline: 0.8rem;
  }
}

@media (max-width: 780px) {
  .model-picker-frame {
    grid-template-rows: 4.8rem minmax(0, 1fr) 6.2rem;
  }

  .model-picker-footer {
    min-height: 6.2rem;
    grid-template-columns: minmax(0, 1fr);
    place-items: center;
    padding: 0.5rem 0.65rem;
  }

  .model-picker-footer::before {
    width: min(24rem, 96vw);
  }

  .model-picker-footer > div,
  .model-picker-footer > .picker-hina-dialogue {
    display: none;
  }

  .picker-confirm {
    grid-column: 1;
    width: min(22rem, 94vw);
    min-height: 5rem;
    padding-inline: 2rem;
  }

  .picker-confirm > strong {
    font-size: 1.75rem;
  }
}

/* Character dialogue: a transmitted subtitle, not a boxed two-column speech card. */
.character-speech {
  top: 13.9rem;
  right: 15.5rem;
  left: calc(50% + 5rem);
  width: auto;
  min-width: 19rem;
  max-width: 31rem;
  max-height: 12.5rem;
  display: block;
  overflow: visible;
  border: 0;
  border-left: 0.16rem solid rgba(111, 231, 219, 0.88);
  border-bottom: 1px solid rgba(111, 202, 193, 0.38);
  background:
    linear-gradient(100deg, rgba(4, 30, 27, 0.88), rgba(3, 14, 14, 0.76) 68%, rgba(34, 7, 11, 0.58)),
    repeating-linear-gradient(90deg, transparent 0 1.6rem, rgba(123, 224, 213, 0.025) 1.6rem calc(1.6rem + 1px));
  clip-path: polygon(0 0, calc(100% - 0.48rem) 0, 100% 0.48rem, 100% 100%, 0 100%);
  box-shadow:
    0 0.8rem 1.8rem rgba(0, 0, 0, 0.34),
    inset 0 0 1.3rem rgba(70, 188, 176, 0.045);
  backdrop-filter: blur(0.28rem) saturate(1.08);
}

.character-speech::before {
  content: "";
  position: absolute;
  top: 2.65rem;
  left: -5.2rem;
  width: 5.2rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(105, 221, 210, 0.42) 35%, rgba(157, 246, 237, 0.9));
  clip-path: none;
  filter: drop-shadow(0 0 0.28rem rgba(99, 226, 214, 0.42));
  transform: rotate(-7deg);
  transform-origin: right center;
}

.character-speech::after {
  content: "";
  position: absolute;
  top: 2.82rem;
  left: -5.38rem;
  width: 0.28rem;
  height: 0.28rem;
  border: 1px solid rgba(141, 239, 229, 0.78);
  background: rgba(7, 24, 22, 0.82);
  box-shadow: 0 0 0.55rem rgba(97, 230, 217, 0.5);
  transform: rotate(38deg);
}

.character-speech header {
  position: absolute;
  z-index: 2;
  top: 0.52rem;
  right: 1rem;
  left: 1.05rem;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.58rem;
  padding: 0 0 0.38rem;
  border: 0;
  border-bottom: 1px solid rgba(115, 210, 201, 0.18);
  background: transparent;
}

.character-speech header span {
  order: 2;
  color: rgba(118, 211, 203, 0.68);
  font-size: 0.42rem;
}

.character-speech header b {
  order: 1;
  color: #f1f4ed;
  font-size: 0.9rem;
  text-shadow: 0 0 0.7rem rgba(106, 216, 206, 0.18);
}

.character-speech p {
  max-height: 12.5rem;
  margin: 0;
  padding: 2.25rem 1.15rem 0.86rem 1.05rem;
  color: rgba(245, 249, 243, 0.96);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.65;
  text-shadow: 0 1px 0.18rem rgba(0, 0, 0, 0.72);
}

.character-speech p[data-scrambling="true"]::after {
  padding: 2.25rem 1.15rem 0.86rem 1.05rem;
  color: rgba(245, 249, 243, 0.96);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.65;
}

@media (max-width: 1100px) and (min-width: 781px) {
  .character-speech {
    top: 13.4rem;
    right: 13.8rem;
    left: calc(50% + 3.8rem);
    width: auto;
    min-width: 17rem;
    max-width: none;
  }
}

@media (max-width: 780px) {
  .character-speech {
    top: 18.2rem;
    right: 0.72rem;
    left: 5.1rem;
    width: auto;
    min-width: 0;
    max-height: 9.5rem;
    background: linear-gradient(100deg, rgba(4, 30, 27, 0.94), rgba(3, 13, 13, 0.9) 70%, rgba(34, 7, 11, 0.78));
  }

  .character-speech::before {
    top: 2.35rem;
    left: -2.65rem;
    width: 2.65rem;
  }

  .character-speech::after {
    top: 2.47rem;
    left: -2.82rem;
  }

  .character-speech header {
    top: 0.4rem;
    right: 0.7rem;
    left: 0.75rem;
    gap: 0.42rem;
    padding-bottom: 0.28rem;
  }

  .character-speech header span {
    font-size: 0.32rem;
  }

  .character-speech header b {
    font-size: 0.78rem;
  }

  .character-speech p {
    max-height: 9.5rem;
    padding: 1.8rem 0.78rem 0.65rem 0.74rem;
    font-size: 0.84rem;
    line-height: 1.55;
  }

  .character-speech p[data-scrambling="true"]::after {
    padding: 1.8rem 0.78rem 0.65rem 0.74rem;
    font-size: 0.84rem;
    line-height: 1.55;
  }
}

/* Location hierarchy: identify the site first, then inspect the map. */
.game-status-hud .location-plaque {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.game-status-hud .location-intel {
  position: relative;
  z-index: 9;
  inset: auto;
  grid-row: 1;
  min-height: 0;
  padding: 0.56rem 0.68rem 0.58rem;
  border-top: 0;
  border-bottom: 1px solid rgba(126, 223, 212, 0.52);
  background:
    linear-gradient(104deg, rgba(5, 23, 22, 0.96), rgba(3, 9, 10, 0.96) 64%, rgba(38, 7, 12, 0.9)),
    repeating-linear-gradient(90deg, transparent 0 1.8rem, rgba(106, 190, 188, 0.04) 1.8rem calc(1.8rem + 1px));
  box-shadow: 0 0.7rem 1.3rem rgba(0, 0, 0, 0.46);
}

.game-status-hud .location-intel::before {
  top: 0.44rem;
  right: 0.58rem;
  bottom: auto;
}

.game-status-hud .location-intel > strong {
  margin-top: 0.24rem;
  font-size: 1.32rem;
  line-height: 1.16;
}

.game-status-hud .location-map {
  position: relative;
  inset: auto;
  grid-row: 2;
  width: 100%;
  height: auto;
  min-height: 0;
  border-bottom: 0;
}

@media (max-width: 780px) {
  .game-status-hud .location-plaque {
    height: 5.55rem;
    min-height: 5.55rem;
    grid-template-rows: 2.65rem minmax(0, 1fr);
  }

  .game-status-hud .location-intel {
    position: relative;
    inset: auto;
    grid-row: 1;
    display: flex;
    align-items: center;
    padding: 0.3rem 0.52rem;
    background: linear-gradient(90deg, rgba(4, 23, 22, 0.97), rgba(3, 10, 10, 0.98) 70%, rgba(32, 7, 11, 0.94));
  }

  .game-status-hud .location-intel > strong {
    width: auto;
    margin: 0;
    font-size: 0.68rem;
    line-height: 1.16;
    white-space: nowrap;
  }

  .game-status-hud .location-intel::before,
  .game-status-hud .location-intel-head,
  .game-status-hud .location-meta,
  .game-status-hud .location-state {
    display: none;
  }

  .game-status-hud .location-map {
    position: relative;
    inset: auto;
    grid-row: 2;
  }

  .location-chronometer {
    top: 0.18rem;
    bottom: auto;
  }
}

/* Final viewport placement and imperial clock hierarchy. */
@media (min-width: 781px) {
  body .oracle-console,
  body .oracle-console[data-empty="true"] {
    bottom: 5rem;
  }
}

@media (max-width: 780px) {
  body .oracle-console,
  body .oracle-console[data-empty="true"] {
    bottom: 1.6rem;
  }
}

.location-map .location-chronometer {
  top: 0.48rem;
  right: 0.48rem;
  bottom: auto;
  left: auto;
  width: auto;
  min-width: 12.4rem;
  min-height: 0;
  display: grid;
  justify-items: stretch;
  align-content: start;
  gap: 0.28rem;
  padding: 0.4rem 0.55rem 0.46rem 0.68rem;
  overflow: hidden;
  border: 1px solid rgba(99, 151, 145, 0.28);
  border-right: 0.18rem solid rgba(137, 39, 47, 0.78);
  border-left: 0.18rem solid rgba(102, 190, 181, 0.76);
  background: linear-gradient(104deg, rgba(2, 10, 10, 0.94), rgba(3, 8, 8, 0.97) 72%, rgba(23, 7, 10, 0.94));
  box-shadow: 0 0.55rem 1rem rgba(0, 0, 0, 0.46), inset 0 1px rgba(177, 225, 216, 0.07);
  backdrop-filter: blur(0.22rem);
  clip-path: polygon(0 0, calc(100% - 0.42rem) 0, 100% 0.42rem, 100% 100%, 0 100%);
}

.location-map .location-chronometer::before {
  content: none;
  display: none;
}

.location-map .location-chronometer::after {
  content: "";
  position: absolute;
  right: 0.55rem;
  bottom: 0.28rem;
  left: 0.68rem;
  height: 1px;
  background: linear-gradient(90deg, rgba(177, 146, 69, 0.5), rgba(101, 180, 172, 0.18), transparent);
}

.game-status-hud .location-map .location-chronometer > span {
  color: rgba(125, 190, 182, 0.64);
  font: 750 0.34rem/1 "Cascadia Code", Consolas, monospace;
  letter-spacing: 0.08em;
  text-align: left;
}

.location-map .location-chronometer .imperial-clock {
  min-width: 0;
  display: grid;
  grid-template-columns: auto auto minmax(4.8rem, 1fr);
  align-items: baseline;
  justify-content: stretch;
  gap: 0;
  margin: 0;
  padding-top: 0.28rem;
  border-top: 1px solid rgba(101, 168, 160, 0.18);
  line-height: 1;
  white-space: nowrap;
}

.location-map .location-chronometer .imperial-clock b,
.location-map .location-chronometer .imperial-clock small,
.location-map .location-chronometer .imperial-clock strong {
  display: block;
  margin: 0;
  overflow: visible;
  font-family: "Cascadia Code", Consolas, monospace;
  line-height: 1;
  white-space: nowrap;
}

.location-map .location-chronometer .imperial-clock b {
  padding-right: 0.48rem;
  color: rgba(220, 225, 216, 0.82);
  font-size: 0.66rem;
  font-weight: 750;
}

.location-map .location-chronometer .imperial-clock small {
  padding: 0 0.48rem;
  border-left: 1px solid rgba(102, 174, 166, 0.24);
  color: rgba(175, 196, 188, 0.62);
  font-size: 0.52rem;
  font-weight: 650;
}

.location-map .location-chronometer .imperial-clock strong {
  justify-self: end;
  color: #a5ddd6;
  font-size: 0.92rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  text-shadow: 0 0 0.55rem rgba(103, 201, 191, 0.2);
}

@media (max-width: 780px) {
  .location-map .location-chronometer {
    top: 0.24rem;
    right: 0.28rem;
    left: auto;
    min-width: 10.4rem;
    padding: 0.3rem 0.4rem 0.36rem 0.5rem;
  }

  .game-status-hud .location-map .location-chronometer > span {
    font-size: 0.26rem;
  }

  .location-map .location-chronometer .imperial-clock {
    grid-template-columns: auto auto minmax(3.8rem, 1fr);
    padding-top: 0.22rem;
  }

  .location-map .location-chronometer .imperial-clock b {
    padding-right: 0.34rem;
    font-size: 0.5rem;
  }

  .location-map .location-chronometer .imperial-clock small {
    padding-inline: 0.34rem;
    font-size: 0.4rem;
  }

  .location-map .location-chronometer .imperial-clock strong {
    font-size: 0.7rem;
  }
}

/* Oracle petition console: quiet ritual hardware instead of a generic chat form. */
body .oracle-console .composer {
  grid-template-columns: minmax(0, 1fr) 9.25rem;
  gap: 0.9rem;
  padding: 1.68rem 0.9rem 0.72rem;
  border-top: 1px solid rgba(126, 197, 188, 0.52);
  border-right: 0.24rem solid #70232b;
  border-bottom: 0.16rem solid #42131a;
  background:
    linear-gradient(96deg, rgba(7, 23, 21, 0.98), rgba(2, 8, 8, 0.99) 64%, rgba(30, 6, 10, 0.98)),
    repeating-linear-gradient(90deg, transparent 0 3.8rem, rgba(116, 177, 168, 0.035) 3.8rem calc(3.8rem + 1px)),
    url("/assets/mansion-panel-v2.webp");
  background-size: auto, auto, 42rem 42rem;
  box-shadow:
    inset 0 1px rgba(215, 239, 230, 0.08),
    inset 0 1.2rem 2.4rem rgba(0, 0, 0, 0.28),
    0 1.4rem 3rem rgba(0, 0, 0, 0.58);
}

body .oracle-console .composer::before {
  content: "神託請願 / ORACLE PETITION";
  width: 16.4rem;
  height: 1.42rem;
  padding: 0 0.85rem 0 1.15rem;
  border-right: 1px solid rgba(169, 142, 72, 0.46);
  background:
    linear-gradient(90deg, #7a252d 0 0.28rem, rgba(7, 24, 22, 0.98) 0.28rem 72%, rgba(18, 14, 10, 0.92));
  color: #d2bd77;
  font: 750 0.64rem/1 "Cascadia Code", Consolas, monospace;
  letter-spacing: 0.04em;
  clip-path: polygon(0 0, 100% 0, calc(100% - 0.72rem) 100%, 0 100%);
}

body .oracle-console .composer::after {
  top: 0.69rem;
  right: 0.9rem;
  left: 15.7rem;
  background: linear-gradient(90deg, rgba(169, 142, 72, 0.52), rgba(111, 190, 181, 0.2) 52%, rgba(112, 35, 43, 0.72));
}

body .oracle-console .composer textarea,
body .oracle-console .composer textarea:hover,
body .oracle-console .composer textarea:focus {
  border: 1px solid rgba(103, 158, 151, 0.46);
  border-bottom: 0.16rem solid rgba(131, 112, 59, 0.56);
  border-left: 0.28rem solid #547e78;
  background-color: #07110f;
  background-image:
    linear-gradient(180deg, rgba(22, 48, 43, 0.3), rgba(2, 8, 7, 0.1)),
    repeating-linear-gradient(0deg, transparent 0 1.45rem, rgba(130, 190, 180, 0.028) 1.45rem calc(1.45rem + 1px));
  color: #e9ede4;
  caret-color: #d2bd77;
  box-shadow:
    inset 0.7rem 0 1.5rem rgba(79, 137, 129, 0.055),
    inset 0 0 0 1px rgba(0, 0, 0, 0.72),
    0 0.4rem 0.9rem rgba(0, 0, 0, 0.34);
}

body .oracle-console .composer textarea:hover {
  border-color: rgba(123, 184, 175, 0.62);
  border-bottom-color: rgba(179, 150, 73, 0.66);
  background-color: #091713;
}

body .oracle-console .composer textarea:focus {
  outline: 1px solid rgba(188, 158, 75, 0.38);
  outline-offset: 0.12rem;
  border-color: rgba(151, 211, 201, 0.72);
  border-bottom-color: #b79a4d;
  border-left-color: #76aaa2;
  background-color: #0b1b17;
  box-shadow:
    inset 0.7rem 0 1.5rem rgba(93, 160, 151, 0.07),
    0 0 0 1px rgba(179, 150, 73, 0.16),
    0 0 1.2rem rgba(111, 184, 174, 0.1);
}

body .oracle-console .composer textarea::placeholder {
  color: rgba(188, 199, 187, 0.46);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-weight: 500;
  letter-spacing: 0.02em;
}

body .oracle-console .composer:focus-within {
  border-top-color: rgba(183, 154, 76, 0.72);
  background:
    linear-gradient(96deg, rgba(8, 28, 25, 0.99), rgba(2, 9, 8, 0.99) 64%, rgba(36, 7, 12, 0.99)),
    repeating-linear-gradient(90deg, transparent 0 3.8rem, rgba(116, 177, 168, 0.04) 3.8rem calc(3.8rem + 1px)),
    url("/assets/mansion-panel-v2.webp");
  background-size: auto, auto, 42rem 42rem;
}

body .oracle-console .composer-context {
  color: rgba(130, 165, 157, 0.54);
  font: 650 0.52rem/1.2 "Cascadia Code", Consolas, monospace;
  letter-spacing: 0.02em;
}

body .oracle-console .keyboard-hint {
  color: rgba(174, 148, 78, 0.62);
}

body .oracle-console #composer-model::before {
  content: "媒介 / ";
  color: rgba(104, 157, 150, 0.52);
}

body .oracle-console .send-button {
  position: relative;
  isolation: isolate;
  min-height: 3.55rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2rem;
  align-items: center;
  gap: 0.55rem;
  padding: 0.58rem 0.62rem 0.58rem 0.82rem;
  overflow: hidden;
  border: 1px solid rgba(174, 145, 72, 0.68);
  border-top-color: rgba(204, 178, 101, 0.82);
  border-right: 0.28rem solid #8d2933;
  border-bottom-color: rgba(74, 16, 24, 0.96);
  border-left: 0.18rem solid #9b8246;
  background:
    linear-gradient(135deg, rgba(103, 25, 34, 0.98), rgba(42, 8, 14, 0.99) 58%, rgba(14, 5, 7, 0.99));
  color: #eee8d8;
  box-shadow:
    inset 0 0 1.4rem rgba(142, 40, 49, 0.16),
    inset 0 1px rgba(255, 225, 153, 0.12),
    0 0.38rem 0 #26080d,
    0 0.7rem 1.2rem rgba(0, 0, 0, 0.44);
  clip-path: polygon(0.52rem 0, 100% 0, 100% calc(100% - 0.52rem), calc(100% - 0.52rem) 100%, 0 100%, 0 0.52rem);
}

body .oracle-console .send-button::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: repeating-linear-gradient(135deg, transparent 0 7px, rgba(220, 184, 91, 0.025) 7px 8px);
}

body .oracle-console .send-copy {
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 0.2rem;
  text-align: left;
}

body .oracle-console .send-copy small {
  color: rgba(205, 177, 100, 0.7);
  font: 750 0.4rem/1 "Cascadia Code", Consolas, monospace;
  letter-spacing: 0.07em;
}

body .oracle-console .send-copy strong {
  color: #f0eadb;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

body .oracle-console .send-sigil {
  width: 1.8rem;
  height: 1.8rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(199, 166, 83, 0.62);
  color: #d8bc70;
  background: rgba(8, 5, 5, 0.48);
  font-size: 0.9rem;
  transform: rotate(45deg);
}

body .oracle-console .send-sigil::first-letter {
  transform: rotate(-45deg);
}

body .oracle-console .send-button:hover,
body .oracle-console .send-button:focus-visible {
  border-color: #c9a75b;
  border-right-color: #b23843;
  background: linear-gradient(135deg, #7d2630, #360b12 58%, #140609);
  color: #fff9e9;
  box-shadow:
    inset 0 0 1.5rem rgba(171, 50, 60, 0.2),
    0 0.28rem 0 #26080d,
    0 0 1.2rem rgba(157, 46, 55, 0.2);
  transform: translateY(-1px);
}

body .oracle-console .send-button:disabled {
  opacity: 0.68;
  border-color: rgba(111, 91, 51, 0.56);
  border-right-color: rgba(92, 31, 37, 0.7);
  background: linear-gradient(135deg, rgba(59, 24, 28, 0.96), rgba(20, 11, 12, 0.98));
  color: rgba(193, 185, 165, 0.7);
  box-shadow: 0 0.25rem 0 rgba(24, 9, 11, 0.9);
}

@media (max-width: 780px) {
  body .oracle-console .composer {
    grid-template-columns: minmax(0, 1fr) 7.5rem;
    gap: 0.48rem;
    padding: 1.48rem 0.48rem 0.48rem;
  }

  body .oracle-console .composer::before {
    width: 12.6rem;
    height: 1.28rem;
    padding-left: 0.75rem;
    font-size: 0.54rem;
  }

  body .oracle-console .composer::after {
    left: 12rem;
  }

  body .oracle-console .send-button {
    grid-template-columns: minmax(0, 1fr) 1.55rem;
    gap: 0.3rem;
    padding: 0.45rem;
  }

  body .oracle-console .send-copy small {
    display: none;
  }

  body .oracle-console .send-copy strong {
    font-size: 0.72rem;
  }

  body .oracle-console .send-sigil {
    width: 1.4rem;
    height: 1.4rem;
    font-size: 0.68rem;
  }
}

/* Give the petition console breathing room above the viewport edge. */
@media (min-width: 781px) {
  body .oracle-console,
  body .oracle-console[data-empty="true"] {
    bottom: 5rem;
  }
}

@media (max-width: 780px) {
  body .oracle-console,
  body .oracle-console[data-empty="true"] {
    bottom: 1.6rem;
  }
}

/* Compact imperial clock: time first, calendar metadata second. */
.location-map .location-chronometer {
  top: 0.48rem;
  right: 0.48rem;
  width: auto;
  min-width: 12.4rem;
  min-height: 0;
  display: grid;
  justify-items: stretch;
  align-content: start;
  gap: 0.28rem;
  padding: 0.4rem 0.55rem 0.46rem 0.68rem;
  overflow: hidden;
  border: 1px solid rgba(99, 151, 145, 0.28);
  border-right: 0.18rem solid rgba(137, 39, 47, 0.78);
  border-left: 0.18rem solid rgba(102, 190, 181, 0.76);
  background: linear-gradient(104deg, rgba(2, 10, 10, 0.94), rgba(3, 8, 8, 0.97) 72%, rgba(23, 7, 10, 0.94));
  box-shadow: 0 0.55rem 1rem rgba(0, 0, 0, 0.46), inset 0 1px rgba(177, 225, 216, 0.07);
  backdrop-filter: blur(0.22rem);
  clip-path: polygon(0 0, calc(100% - 0.42rem) 0, 100% 0.42rem, 100% 100%, 0 100%);
}

.location-map .location-chronometer::before {
  content: none;
  display: none;
}

.location-map .location-chronometer::after {
  content: "";
  position: absolute;
  right: 0.55rem;
  bottom: 0.28rem;
  left: 0.68rem;
  height: 1px;
  background: linear-gradient(90deg, rgba(177, 146, 69, 0.5), rgba(101, 180, 172, 0.18), transparent);
}

.game-status-hud .location-map .location-chronometer > span {
  color: rgba(125, 190, 182, 0.64);
  font: 750 0.34rem/1 "Cascadia Code", Consolas, monospace;
  letter-spacing: 0.08em;
  text-align: left;
}

.location-map .location-chronometer .imperial-clock {
  min-width: 0;
  display: grid;
  grid-template-columns: auto auto minmax(4.8rem, 1fr);
  align-items: baseline;
  justify-content: stretch;
  gap: 0;
  margin: 0;
  padding-top: 0.28rem;
  border-top: 1px solid rgba(101, 168, 160, 0.18);
  line-height: 1;
  white-space: nowrap;
}

.location-map .location-chronometer .imperial-clock b,
.location-map .location-chronometer .imperial-clock small,
.location-map .location-chronometer .imperial-clock strong {
  display: block;
  margin: 0;
  overflow: visible;
  font-family: "Cascadia Code", Consolas, monospace;
  line-height: 1;
  white-space: nowrap;
}

.location-map .location-chronometer .imperial-clock b {
  padding-right: 0.48rem;
  color: rgba(220, 225, 216, 0.82);
  font-size: 0.66rem;
  font-weight: 750;
}

.location-map .location-chronometer .imperial-clock small {
  padding: 0 0.48rem;
  border-left: 1px solid rgba(102, 174, 166, 0.24);
  color: rgba(175, 196, 188, 0.62);
  font-size: 0.52rem;
  font-weight: 650;
}

.location-map .location-chronometer .imperial-clock strong {
  justify-self: end;
  color: #a5ddd6;
  font-size: 0.92rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  text-shadow: 0 0 0.55rem rgba(103, 201, 191, 0.2);
}

@media (max-width: 780px) {
  .location-map .location-chronometer {
    top: 0.24rem;
    right: 0.28rem;
    left: auto;
    min-width: 10.4rem;
    padding: 0.3rem 0.4rem 0.36rem 0.5rem;
  }

  .game-status-hud .location-map .location-chronometer > span {
    font-size: 0.26rem;
  }

  .location-map .location-chronometer .imperial-clock {
    grid-template-columns: auto auto minmax(3.8rem, 1fr);
    padding-top: 0.22rem;
  }

  .location-map .location-chronometer .imperial-clock b {
    padding-right: 0.34rem;
    font-size: 0.5rem;
  }

  .location-map .location-chronometer .imperial-clock small {
    padding-inline: 0.34rem;
    font-size: 0.4rem;
  }

  .location-map .location-chronometer .imperial-clock strong {
    font-size: 0.7rem;
  }
}

/* Final conversation layout: one live history line above a compact composer. */
body .run-banner {
  width: min(38rem, calc(100vw - 42rem));
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  gap: 0.68rem;
}

body .run-banner .run-copy {
  min-width: 0;
  display: contents;
}

body .run-banner .run-copy strong {
  color: rgba(138, 220, 212, 0.76);
  font: 750 0.58rem/1 "Cascadia Code", Consolas, monospace;
  white-space: nowrap;
}

body .run-banner .run-copy strong::after {
  content: "/";
  margin-left: 0.68rem;
  color: rgba(184, 157, 87, 0.42);
}

body .run-banner .run-copy span {
  min-width: 0;
  overflow: hidden;
  color: rgba(235, 240, 233, 0.88);
  font-size: 0.76rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body .oracle-console,
body .oracle-console[data-empty="true"] {
  height: 6.8rem;
  grid-template-rows: minmax(0, 1fr);
}

body .oracle-console .messages {
  display: none;
}

body .oracle-console .messages::before,
body .oracle-console .messages::after {
  content: none;
  display: none;
}

body .oracle-console .composer {
  grid-row: 1;
}

@media (min-width: 781px) {
  body .oracle-console,
  body .oracle-console[data-empty="true"] {
    bottom: 3.6rem;
    height: 6.8rem;
    grid-template-rows: minmax(0, 1fr);
  }
}

@media (max-width: 1100px) and (min-width: 781px) {
  body .run-banner {
    width: min(31rem, calc(100vw - 30rem));
  }
}

@media (max-width: 780px) {
  body .run-banner {
    width: calc(100vw - 1.4rem);
    min-width: 0;
    grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  }

  body .run-banner .run-copy strong::after {
    margin-left: 0.42rem;
  }

  body .run-banner .run-copy span {
    font-size: 0.66rem;
  }

  body .oracle-console,
  body .oracle-console[data-empty="true"] {
    bottom: 1.1rem;
    height: 6.2rem;
    grid-template-rows: minmax(0, 1fr);
  }
}

/* The stage keeps only one current log line; the avatar carries the actual reply. */
.run-banner {
  width: min(38rem, calc(100vw - 42rem));
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  gap: 0.68rem;
}

.run-copy {
  min-width: 0;
  display: contents;
}

.run-copy strong {
  color: rgba(138, 220, 212, 0.76);
  font: 750 0.58rem/1 "Cascadia Code", Consolas, monospace;
  white-space: nowrap;
}

.run-copy strong::after {
  content: "/";
  margin-left: 0.68rem;
  color: rgba(184, 157, 87, 0.42);
}

.run-copy span {
  min-width: 0;
  overflow: hidden;
  color: rgba(235, 240, 233, 0.88);
  font-size: 0.76rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oracle-console,
.oracle-console[data-empty="true"] {
  height: 6.8rem;
  grid-template-rows: minmax(0, 1fr);
}

.oracle-console .messages {
  display: none;
}

.oracle-console .composer {
  grid-row: 1;
}

@media (min-width: 781px) {
  .oracle-console,
  .oracle-console[data-empty="true"] {
    bottom: 3.6rem;
    height: 6.8rem;
    grid-template-rows: minmax(0, 1fr);
  }
}

@media (max-width: 1100px) and (min-width: 781px) {
  .run-banner {
    width: min(31rem, calc(100vw - 30rem));
  }
}

@media (max-width: 780px) {
  .run-banner {
    width: calc(100vw - 1.4rem);
    min-width: 0;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
  }

  .run-copy strong::after {
    margin-left: 0.42rem;
  }

  .run-copy span {
    font-size: 0.66rem;
  }

  .oracle-console,
  .oracle-console[data-empty="true"] {
    bottom: 1.1rem;
    height: 6.2rem;
    grid-template-rows: minmax(0, 1fr);
  }
}

/* Final map-native timestamp override. */
.location-chronometer {
  top: 0.52rem;
  right: 0.58rem;
  bottom: auto;
  left: auto;
  width: auto;
  min-width: 10.6rem;
  min-height: 0;
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 0.08rem;
  padding: 0.14rem 0.34rem 0.34rem 1.5rem;
  overflow: visible;
  border: 0;
  background: linear-gradient(90deg, transparent, rgba(1, 8, 9, 0.5) 44%, rgba(1, 7, 8, 0.78));
  clip-path: none;
  box-shadow: none;
  backdrop-filter: none;
}

.location-chronometer::before {
  top: 0.25rem;
  right: auto;
  left: 1.1rem;
  width: 0.18rem;
  height: 0.18rem;
  background: #ec554f;
  box-shadow: 0 0 0.48rem rgba(236, 85, 79, 0.82);
}

.location-chronometer::after {
  right: 0.34rem;
  bottom: 0.18rem;
  left: 1.1rem;
  background: linear-gradient(90deg, rgba(101, 218, 207, 0.14), rgba(126, 231, 220, 0.84));
}

.game-status-hud .location-chronometer > span {
  color: rgba(115, 211, 202, 0.66);
  font: 700 0.3rem/1.1 "Cascadia Code", Consolas, monospace;
  text-align: right;
}

.location-chronometer .imperial-clock {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.46rem;
  margin: 0;
  color: #eef5ef;
  font-family: "Cascadia Code", Consolas, monospace;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 0 0.55rem rgba(100, 213, 203, 0.2), 0 1px 0.18rem #000;
}

.location-chronometer .imperial-clock b,
.location-chronometer .imperial-clock small,
.location-chronometer .imperial-clock strong {
  display: inline;
  margin: 0;
  overflow: visible;
  color: inherit;
  font-family: inherit;
  line-height: 1;
  text-overflow: clip;
  white-space: nowrap;
}

.location-chronometer .imperial-clock b { color: #e8eee8; font-size: 0.66rem; font-weight: 800; }
.location-chronometer .imperial-clock small { color: rgba(183, 215, 207, 0.72); font-size: 0.42rem; font-weight: 700; }
.location-chronometer .imperial-clock strong { color: #9be2da; font-size: 0.64rem; font-weight: 800; font-variant-numeric: tabular-nums; }

@media (max-width: 780px) {
  .location-chronometer {
    top: 0.18rem;
    right: 0.32rem;
    left: auto;
    min-width: 9rem;
    padding: 0.08rem 0.22rem 0.26rem 1rem;
  }

  .location-chronometer::before { left: 0.7rem; }
  .location-chronometer::after { right: 0.22rem; left: 0.7rem; }
  .game-status-hud .location-chronometer > span { font-size: 0.24rem; }
  .location-chronometer .imperial-clock { gap: 0.32rem; }
  .location-chronometer .imperial-clock b { font-size: 0.48rem; }
  .location-chronometer .imperial-clock small { font-size: 0.34rem; }
  .location-chronometer .imperial-clock strong { font-size: 0.48rem; }
}

/* Map-native imperial timestamp: no floating card. */
.location-chronometer {
  top: 0.52rem;
  right: 0.58rem;
  left: auto;
  width: auto;
  min-width: 10.6rem;
  min-height: 0;
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 0.08rem;
  padding: 0.14rem 0.34rem 0.34rem 1.5rem;
  overflow: visible;
  border: 0;
  background: linear-gradient(90deg, transparent, rgba(1, 8, 9, 0.5) 44%, rgba(1, 7, 8, 0.78));
  clip-path: none;
  box-shadow: none;
  backdrop-filter: none;
}

.location-chronometer::before {
  top: 0.25rem;
  right: auto;
  left: 1.1rem;
  width: 0.18rem;
  height: 0.18rem;
  background: #ec554f;
  box-shadow: 0 0 0.48rem rgba(236, 85, 79, 0.82);
}

.location-chronometer::after {
  right: 0.34rem;
  bottom: 0.18rem;
  left: 1.1rem;
  background: linear-gradient(90deg, rgba(101, 218, 207, 0.14), rgba(126, 231, 220, 0.84));
}

.game-status-hud .location-chronometer > span {
  color: rgba(115, 211, 202, 0.66);
  font: 700 0.3rem/1.1 "Cascadia Code", Consolas, monospace;
  text-align: right;
}

.location-chronometer .imperial-clock {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.46rem;
  margin: 0;
  color: #eef5ef;
  font-family: "Cascadia Code", Consolas, monospace;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 0 0.55rem rgba(100, 213, 203, 0.2), 0 1px 0.18rem #000;
}

.location-chronometer .imperial-clock b,
.location-chronometer .imperial-clock small,
.location-chronometer .imperial-clock strong {
  display: inline;
  margin: 0;
  overflow: visible;
  color: inherit;
  font-family: inherit;
  line-height: 1;
  text-overflow: clip;
  white-space: nowrap;
}

.location-chronometer .imperial-clock b {
  color: #e8eee8;
  font-size: 0.66rem;
  font-weight: 800;
}

.location-chronometer .imperial-clock small {
  color: rgba(183, 215, 207, 0.72);
  font-size: 0.42rem;
  font-weight: 700;
}

.location-chronometer .imperial-clock strong {
  color: #9be2da;
  font-size: 0.64rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 780px) {
  .location-chronometer {
    top: 0.18rem;
    right: 0.32rem;
    left: auto;
    min-width: 9rem;
    padding: 0.08rem 0.22rem 0.26rem 1rem;
  }

  .location-chronometer::before { left: 0.7rem; }
  .location-chronometer::after { right: 0.22rem; left: 0.7rem; }
  .game-status-hud .location-chronometer > span { font-size: 0.24rem; }
  .location-chronometer .imperial-clock { gap: 0.32rem; }
  .location-chronometer .imperial-clock b { font-size: 0.48rem; }
  .location-chronometer .imperial-clock small { font-size: 0.34rem; }
  .location-chronometer .imperial-clock strong { font-size: 0.48rem; }
}

/* Compact model discovery: primary filters stay visible, secondary filters collapse. */
.model-picker[open] .model-picker-catalog {
  padding: 0.72rem 0.85rem 0.78rem;
}

.model-picker[open] .compact-filter-bar {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) minmax(8rem, 0.28fr) minmax(10rem, 0.34fr) minmax(10rem, 0.34fr) auto;
  align-items: stretch;
  gap: 0.45rem;
}

.model-picker[open] .compact-filter-bar label {
  min-width: 0;
}

.model-picker[open] .compact-filter-bar input,
.model-picker[open] .compact-filter-bar select {
  min-height: 2.45rem;
  padding: 0.42rem 0.62rem;
  font-size: 0.7rem;
}

.model-picker[open] .compact-filter-bar .filter-reset {
  min-width: 4.7rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid rgba(213, 235, 226, 0.18);
  background: rgba(3, 8, 7, 0.82);
  color: rgba(203, 218, 211, 0.64);
  font-size: 0.62rem;
  text-decoration: none;
}

.model-picker[open] .compact-filter-bar .filter-reset:hover,
.model-picker[open] .compact-filter-bar .filter-reset:focus-visible {
  border-color: rgba(104, 229, 217, 0.56);
  color: var(--tokyo-paper);
  outline: 0;
}

.model-filter-details {
  margin: 0.42rem 0 0;
  border-top: 1px solid rgba(213, 235, 226, 0.12);
  border-bottom: 1px solid rgba(213, 235, 226, 0.12);
  background: rgba(1, 5, 4, 0.58);
}

.model-filter-details > summary {
  min-height: 2rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.36rem 0.55rem;
  color: rgba(203, 218, 211, 0.7);
  font-size: 0.64rem;
  cursor: pointer;
  list-style: none;
}

.model-filter-details > summary::-webkit-details-marker {
  display: none;
}

.model-filter-details > summary::before {
  content: "+";
  width: 0.9rem;
  color: var(--tokyo-cyan);
  font: 700 0.82rem/1 "Cascadia Code", Consolas, monospace;
  text-align: center;
}

.model-filter-details[open] > summary::before {
  content: "−";
}

.model-filter-details > summary small {
  margin-left: auto;
  color: rgba(137, 162, 155, 0.62);
  font-size: 0.57rem;
}

.model-filter-details[data-active="true"] > summary {
  color: var(--tokyo-paper);
}

.model-filter-details[data-active="true"] > summary small {
  color: #f0ce72;
}

.model-filter-details-body {
  padding: 0.25rem 0.55rem 0.55rem;
  border-top: 1px solid rgba(213, 235, 226, 0.1);
}

.model-filter-details .model-filters {
  grid-template-columns: minmax(10rem, 0.32fr) minmax(22rem, 1fr);
  align-items: end;
  gap: 0.65rem;
  padding: 0.45rem 0;
  border-bottom: 0;
}

.model-filter-details .nsfw-filter {
  grid-column: auto;
}

.model-filter-details .archetype-index {
  margin-top: 0.2rem;
}

.model-picker[open] .model-result-heading {
  min-height: 1.7rem;
  margin-top: 0.35rem;
  padding-block: 0.2rem;
}

@media (max-width: 1100px) {
  .model-picker[open] .compact-filter-bar {
    grid-template-columns: minmax(14rem, 1fr) repeat(3, minmax(8rem, 0.42fr)) auto;
  }
}

@media (max-width: 780px) {
  .model-picker[open] .model-picker-catalog {
    padding: 0.55rem 0.55rem 0.65rem;
  }

  .model-picker[open] .compact-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem;
  }

  .model-picker[open] .compact-filter-bar .model-search-field {
    grid-column: 1 / -1;
  }

  .model-picker[open] .compact-filter-bar .filter-reset {
    min-width: 0;
  }

  .model-filter-details .model-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .model-filter-details .nsfw-filter {
    grid-column: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .picker-confirm,
  .picker-confirm::before,
  .picker-confirm.is-armed {
    animation: none !important;
  }
}

/* Keep the subterranean sanctuary legible beneath the invocation spectacle. */
.spirit-invocation .invocation-veil {
  background:
    linear-gradient(90deg, rgba(44, 4, 12, 0.22), transparent 28% 72%, rgba(2, 38, 37, 0.2)),
    radial-gradient(ellipse at 50% 48%, rgba(1, 8, 8, 0.02) 0 20%, rgba(1, 7, 7, 0.2) 44%, rgba(0, 2, 2, 0.62) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.58), rgba(3, 12, 11, 0.08) 50%, rgba(0, 0, 0, 0.58));
  backdrop-filter: saturate(0.72) brightness(0.78) contrast(1.04);
}

body.is-model-invoking .mansion-art-backdrop {
  filter: saturate(1.12) contrast(1.05) brightness(1.2);
}

body.is-model-invoking .cathedral-canvas {
  filter: saturate(1.36) contrast(1.05) brightness(1.32);
}

body.is-model-invoking .world-overlay {
  box-shadow:
    inset 0 0 5rem rgba(0, 0, 0, 0.18),
    inset 0 -4rem 6rem rgba(0, 0, 0, 0.24);
}

body.is-model-invoking .world-vignette {
  opacity: 0.48;
  background: radial-gradient(ellipse at 50% 46%, transparent 58%, rgba(0, 0, 0, 0.38) 100%);
}

body,
button,
input,
select,
textarea {
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

.mansion-art-backdrop {
  background-color: #040706;
  background-image:
    linear-gradient(180deg, rgba(2, 5, 5, 0.02), rgba(2, 5, 5, 0.06) 58%, rgba(2, 4, 4, 0.34)),
    url("/assets/oracle-sanctum-large-underlit-d.png");
  background-position: center;
  background-size: cover;
  filter: saturate(0.98) contrast(1.1) brightness(0.92);
}

body[data-cathedral-state="sending"] .mansion-art-backdrop,
body[data-cathedral-state="waiting"] .mansion-art-backdrop,
body[data-cathedral-state="thinking"] .mansion-art-backdrop,
body[data-cathedral-state="streaming"] .mansion-art-backdrop {
  filter: saturate(1.08) contrast(1.12) brightness(0.98);
}

.summoning-seal-art {
  display: none;
}

.world-overlay {
  box-shadow:
    inset 0 0 8rem rgba(0, 0, 0, 0.34),
    inset 0 -6rem 8rem rgba(0, 0, 0, 0.42);
}

.world-vignette {
  background: radial-gradient(ellipse at 50% 46%, transparent 48%, rgba(0, 0, 0, 0.56) 100%);
}

.boot-sequence {
  background-color: #040706;
  background-image:
    linear-gradient(rgba(2, 5, 5, 0.28), rgba(2, 5, 5, 0.7)),
    url("/assets/oracle-sanctum-large-underlit-d.png");
  background-position: center;
  background-size: cover;
  color: var(--tokyo-paper);
}

.app-bar,
.header-model,
.game-status-hud,
.game-command-menu,
.settings-panel,
.inspect-panel,
.composer,
.model-picker-frame,
.model-picker-catalog,
.model-picker-preview,
.model-picker-header,
.model-picker-footer {
  background-color: rgba(4, 8, 7, 0.96);
  background-image:
    linear-gradient(90deg, rgba(8, 14, 13, 0.95), rgba(3, 7, 6, 0.98)),
    url("/assets/mansion-panel-v2.webp");
  background-size: cover, 48rem 48rem;
  background-blend-mode: normal, soft-light;
}

.app-bar {
  border: 0;
  border-top: 0.22rem solid var(--tokyo-cyan);
  border-bottom: 1px solid rgba(230, 227, 215, 0.22);
  box-shadow: 0 1rem 2.6rem rgba(0, 0, 0, 0.48);
}

.app-bar::after {
  height: 0.18rem;
  background: linear-gradient(90deg, transparent, var(--tokyo-paper) 28%, var(--tokyo-red) 64%, transparent 88%);
}

.brand-mark {
  border: 0;
  border-left: 0.3rem solid var(--tokyo-red);
  border-radius: 0;
  background: #0a100f;
  box-shadow: inset 0 0 0 1px rgba(230, 227, 215, 0.24);
}

.brand-copy .eyebrow,
.model-launcher-kicker,
.panel-kicker {
  color: var(--tokyo-cyan);
}

.header-model {
  border: 0;
  border-top: 1px solid rgba(230, 227, 215, 0.36);
  border-bottom: 0.25rem solid var(--tokyo-red);
  clip-path: polygon(1rem 0, calc(100% - 1rem) 0, 100% 50%, calc(100% - 1rem) 100%, 1rem 100%, 0 50%);
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.42);
}

.header-model:hover,
.header-model:focus-visible {
  border-color: var(--tokyo-paper);
  background-color: #101715;
  background-image:
    linear-gradient(90deg, rgba(14, 26, 23, 0.96), rgba(4, 8, 7, 0.98)),
    url("/assets/mansion-panel-v2.webp");
}

.moon-widget i {
  border-color: var(--tokyo-paper);
  box-shadow: none;
}

.game-status-hud,
.game-command-menu,
.settings-panel,
.inspect-panel {
  border: 0;
  box-shadow: 0 1.4rem 3rem rgba(0, 0, 0, 0.58);
}

.game-status-hud {
  border-left: 0.35rem solid var(--tokyo-cyan);
  clip-path: polygon(0 0, calc(100% - 0.9rem) 0, 100% 0.9rem, 100% 100%, 0 100%);
}

.game-command-menu {
  border-right: 0.35rem solid var(--tokyo-red);
  clip-path: polygon(0.9rem 0, 100% 0, 100% 100%, 0 100%, 0 0.9rem);
}

.game-command-menu button {
  border-bottom: 1px solid rgba(230, 227, 215, 0.1);
  background: rgba(2, 5, 5, 0.66);
}

.game-command-menu button:hover,
.game-command-menu button:focus-visible,
.game-command-menu button.is-active {
  background: linear-gradient(90deg, rgba(104, 169, 169, 0.42), rgba(212, 72, 62, 0.24) 66%, transparent);
  color: #fff;
}

.run-banner {
  border-top-color: rgba(104, 169, 169, 0.48);
  border-bottom-color: rgba(230, 227, 215, 0.2);
  background: linear-gradient(90deg, transparent, rgba(3, 8, 7, 0.9) 12%, rgba(3, 8, 7, 0.9) 88%, transparent);
}

.messages {
  padding: 2.4rem 2.2rem 1.4rem;
  border: 0;
  border-top: 0.24rem solid var(--tokyo-paper);
  border-left: 0.45rem solid var(--tokyo-cyan);
  border-bottom: 0.2rem solid var(--tokyo-red);
  background: rgba(3, 7, 6, 0.96);
  box-shadow: 0 1.8rem 4.5rem rgba(0, 0, 0, 0.68);
}

.messages::before {
  content: "応答記録 / RESPONSE LOG";
  top: 0.72rem;
  left: 1.25rem;
  color: var(--tokyo-paper);
  text-shadow: none;
}

.messages::after {
  display: block;
  top: 0;
  right: 0;
  width: 5.2rem;
  height: 0.58rem;
  background: linear-gradient(90deg, var(--tokyo-red) 0 42%, var(--tokyo-paper) 42% 68%, var(--tokyo-cyan) 68%);
}

.composer {
  border: 0;
  border-left: 0.35rem solid var(--tokyo-cyan);
  border-bottom: 0.25rem solid var(--tokyo-red);
  box-shadow: 0 1.6rem 4rem rgba(0, 0, 0, 0.72);
}

.composer::before {
  content: "メッセージ入力 / MESSAGE";
}

.composer textarea {
  border: 0;
  border-bottom: 1px solid rgba(230, 227, 215, 0.22);
  background: rgba(1, 4, 3, 0.84);
}

.send-button,
.picker-confirm {
  border: 0;
  border-left: 0.3rem solid var(--tokyo-paper);
  border-right: 0.3rem solid var(--tokyo-red);
  background: var(--tokyo-cyan);
  color: #06100e;
  box-shadow: none;
}

.send-button:hover,
.send-button:focus-visible,
.picker-confirm:hover,
.picker-confirm:focus-visible {
  background: var(--tokyo-paper);
  color: #050807;
}

.model-picker {
  background-color: rgba(1, 4, 3, 0.94);
  background-image:
    linear-gradient(rgba(2, 6, 5, 0.62), rgba(2, 6, 5, 0.78)),
    url("/assets/oracle-sanctum-large-underlit-d.png");
  background-size: cover;
  backdrop-filter: blur(0.24rem);
}

.model-picker-frame {
  border: 0;
  border-top: 0.35rem solid var(--tokyo-cyan);
  border-bottom: 0.25rem solid var(--tokyo-red);
  outline: 1px solid rgba(230, 227, 215, 0.18);
  outline-offset: -0.45rem;
}

.model-picker-frame::before,
.model-picker-frame::after {
  content: "";
  width: 6.5rem;
  height: 0.35rem;
  background: var(--tokyo-red);
}

.model-picker-header {
  border-bottom: 0.18rem solid rgba(230, 227, 215, 0.32);
}

.model-picker-header::after {
  background: linear-gradient(90deg, var(--tokyo-paper), var(--tokyo-cyan) 48%, transparent 78%);
}

.model-picker-header h2 {
  color: var(--tokyo-paper);
}

.model-picker-close,
.game-panel-close,
.model-picker-header-actions .quiet-button {
  border: 1px solid rgba(230, 227, 215, 0.34);
  background: #070c0b;
  color: var(--tokyo-paper);
}

.model-picker-close:hover,
.model-picker-close:focus-visible,
.game-panel-close:hover,
.game-panel-close:focus-visible {
  border-color: var(--tokyo-red);
  background: var(--tokyo-red);
}

.model-picker-body {
  grid-template-columns: minmax(45rem, 1fr) minmax(24rem, 29rem);
}

.model-picker-catalog {
  border-right: 0.2rem solid rgba(230, 227, 215, 0.18);
}

.model-picker-toolbar input,
.model-picker-toolbar select,
.model-filters select,
.advanced-model input {
  border: 0;
  border-left: 0.25rem solid var(--tokyo-cyan);
  border-bottom: 1px solid rgba(230, 227, 215, 0.24);
  background: #030706;
  color: var(--tokyo-paper);
}

.model-picker-toolbar input:focus,
.model-picker-toolbar select:focus,
.model-filters select:focus,
.advanced-model input:focus {
  border-color: var(--tokyo-red);
  box-shadow: none;
}

.model-picker-toolbar label > span,
.model-filters label > span,
.model-filters legend,
.filter-heading,
.model-result-heading {
  color: var(--tokyo-cyan);
}

.segmented-filter {
  border-color: rgba(230, 227, 215, 0.22);
}

.segmented-filter button {
  border-right-color: rgba(230, 227, 215, 0.14);
  background: #030706;
}

.segmented-filter button[aria-pressed="true"] {
  background: var(--tokyo-cyan);
  color: #050807;
  box-shadow: inset 0 -0.22rem var(--tokyo-red);
}

.archetype-index {
  margin-top: 0.65rem;
  border-top: 1px solid rgba(230, 227, 215, 0.18);
  border-bottom: 1px solid rgba(230, 227, 215, 0.18);
  background: rgba(2, 6, 5, 0.58);
}

.archetype-index > header {
  min-height: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0.45rem;
  color: var(--tokyo-paper);
  font-size: 0.66rem;
  font-weight: 700;
}

.archetype-index > header small {
  color: var(--mansion-muted);
  font-size: 0.55rem;
  font-weight: 500;
}

.archetype-filter {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid rgba(230, 227, 215, 0.14);
}

.archetype-filter button {
  position: relative;
  min-width: 0;
  min-height: 3.25rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-content: center;
  gap: 0.06rem 0.3rem;
  padding: 0.42rem 0.5rem;
  border: 0;
  border-right: 1px solid rgba(230, 227, 215, 0.14);
  background: #040807;
  color: var(--mansion-muted);
  text-align: left;
}

.archetype-filter button:last-child {
  border-right: 0;
}

.archetype-filter button::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 0.16rem;
  background: transparent;
}

.archetype-filter button strong {
  overflow: hidden;
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archetype-filter button small {
  grid-column: 1;
  color: #66736f;
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.48rem;
}

.archetype-filter button em {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  color: var(--tokyo-paper);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.68rem;
  font-style: normal;
}

.archetype-filter button:hover,
.archetype-filter button:focus-visible {
  background: #101715;
  color: var(--tokyo-paper);
  outline: 0;
}

.archetype-filter button[aria-pressed="true"] {
  background: var(--tokyo-paper);
  color: var(--tokyo-ink);
}

.archetype-filter button[aria-pressed="true"] small,
.archetype-filter button[aria-pressed="true"] em {
  color: #35413e;
}

.archetype-filter button[aria-pressed="true"]::after {
  background: var(--tokyo-red);
}

.model-result-heading {
  border-bottom: 0.2rem solid var(--tokyo-cyan);
}

#model-result-count {
  color: var(--tokyo-paper);
  font-size: 0.86rem;
  font-weight: 800;
}

.model-roster {
  grid-auto-rows: 13.2rem;
  gap: 0.6rem;
  scrollbar-color: var(--tokyo-cyan) transparent;
}

.model-card {
  --type-color: var(--tokyo-paper);
  height: 13.2rem;
  padding: 0.75rem 0.68rem 0.62rem 47%;
  border: 0;
  border-top: 0.25rem solid var(--type-color);
  border-bottom: 1px solid rgba(230, 227, 215, 0.22);
  background: #050908;
  clip-path: none;
  box-shadow: 0 0.8rem 1.7rem rgba(0, 0, 0, 0.4);
  content-visibility: auto;
  contain-intrinsic-size: auto 13.2rem;
}

.model-card[data-archetype="router"] { --type-color: #d4483e; }
.model-card[data-archetype="multimodal"] { --type-color: #68a9a9; }
.model-card[data-archetype="code"] { --type-color: #c8ad55; }
.model-card[data-archetype="agent"] { --type-color: #9c5a4f; }
.model-card[data-archetype="reason"] { --type-color: #e6e3d7; }
.model-card[data-archetype="general"] { --type-color: #7d8783; }

.model-card::after {
  border: 0;
  border-right: 0.25rem solid var(--type-color);
}

.model-card:hover,
.model-card:focus-visible {
  border-color: var(--type-color);
  background: #0d1412;
  box-shadow: 0 0 0 1px rgba(230, 227, 215, 0.24), 0 1rem 2rem rgba(0, 0, 0, 0.52);
}

.model-card.is-previewing:not(.is-selected) {
  border-color: var(--tokyo-cyan);
  background: #0c1715;
  box-shadow:
    0 0 0 1px rgba(109, 255, 235, 0.72),
    inset 0 0 1.2rem rgba(63, 205, 190, 0.1),
    0 0.7rem 1.6rem rgba(0, 0, 0, 0.56);
}

.model-card.is-previewing .model-card-portrait img {
  transform: scale(1.035);
  filter: saturate(1.12) brightness(1.08);
}

.model-card.is-selected {
  border-color: var(--tokyo-red);
  background: #101614;
  box-shadow: 0 0 0 2px var(--tokyo-paper), 0 0 0 0.35rem var(--tokyo-red), 0 1rem 2rem rgba(0, 0, 0, 0.62);
}

.model-card-portrait {
  right: 54%;
  border-right: 0.22rem solid var(--type-color);
  background: #e6e3d7;
}

.model-card-portrait::after {
  z-index: 1;
  background:
    linear-gradient(90deg, transparent 62%, rgba(4, 8, 7, 0.96)),
    linear-gradient(180deg, transparent 65%, rgba(3, 7, 6, 0.88));
}

.model-card-portrait img {
  position: relative;
  z-index: 0;
  object-fit: cover;
  object-position: center;
  background: #080d0c;
  filter: contrast(1.04) saturate(0.88);
  image-rendering: auto;
}

.model-card-archetype {
  z-index: 3;
  right: 0.35rem;
  bottom: 0.46rem;
  left: 0.5rem;
  color: #f5f3e9;
  font-size: 0.56rem;
}

.model-card-alignment {
  position: absolute;
  z-index: 4;
  top: 0.45rem;
  left: 0.5rem;
  padding: 0.18rem 0.32rem;
  background: rgba(3, 7, 6, 0.78);
  color: #b8c2be;
  font-size: 0.5rem;
  font-weight: 700;
}

.model-card-alignment[data-value="confirmed"] {
  background: var(--tokyo-red);
  color: #fff;
}

.model-card-alignment[data-value="moderated"] {
  border-left: 0.18rem solid var(--tokyo-cyan);
}

.model-card-price {
  min-width: 0;
  min-height: 2rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 0.35rem;
  padding: 0;
  border: 0;
  border-bottom: 0.18rem solid var(--type-color);
  background: #030706;
  color: var(--tokyo-paper);
  font-size: 0.68rem;
  white-space: normal;
}

.model-card-price > span {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.22rem;
  padding: 0.22rem 0.3rem;
  background: #08100e;
}

.model-card-price small {
  color: var(--tokyo-cyan);
  font-size: 0.48rem;
  font-weight: 800;
}

.model-card-price b {
  min-width: 0;
  overflow: hidden;
  color: var(--tokyo-paper);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-card-price .is-free {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  padding: 0.25rem;
  color: var(--tokyo-paper);
  font-size: 0.72rem;
}

.model-card-rank,
.model-card-name {
  color: var(--tokyo-paper);
}

.model-card-id {
  color: rgba(155, 172, 166, 0.6);
}

.model-card-stats {
  border-top-color: rgba(230, 227, 215, 0.16);
}

.model-card-loadout span,
.model-card-loadout .is-source,
.model-card-loadout .is-empty {
  border-bottom-color: var(--type-color);
  color: color-mix(in srgb, var(--type-color) 70%, var(--tokyo-paper));
}

.model-picker-preview {
  scrollbar-color: var(--tokyo-cyan) transparent;
}

.entity-stage {
  height: clamp(14rem, 31vh, 20rem);
  border: 0;
  border-top: 0.28rem solid var(--tokyo-paper);
  border-bottom: 0.32rem solid var(--tokyo-red);
  background: #e6e3d7;
  clip-path: none;
  box-shadow: 0 1.2rem 2.6rem rgba(0, 0, 0, 0.48);
}

.entity-stage::after {
  z-index: 3;
  height: 0.22rem;
  background: linear-gradient(90deg, var(--tokyo-cyan) 0 72%, var(--tokyo-red) 72%);
}

.entity-stage img {
  position: relative;
  z-index: 0;
  object-fit: cover;
  object-position: center;
  background: #080d0c;
  filter: contrast(1.04) saturate(0.88);
  image-rendering: auto;
}

.entity-stage-code {
  z-index: 4;
  background: rgba(3, 7, 6, 0.86);
  color: var(--tokyo-paper);
}

.entity-stage::before {
  z-index: 1;
}

.model-picker-preview[data-previewing="true"] .entity-stage {
  outline: 1px solid rgba(100, 255, 234, 0.76);
  outline-offset: -0.42rem;
}

.model-picker-preview[data-previewing="true"] .archetype-evidence {
  border-left-color: #73ffe9;
  background: #06110f;
}

.rarity-fx {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: none;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  contain: paint;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 52% 48%, transparent 0 18%, rgba(37, 13, 70, 0.5) 39%, rgba(0, 113, 124, 0.28) 62%, rgba(2, 2, 8, 0.72) 100%),
    conic-gradient(
      from 214deg at 52% 48%,
      transparent 0 13%,
      rgba(16, 4, 39, 0.2) 22%,
      rgba(91, 53, 151, 0.52) 34%,
      transparent 47%,
      rgba(0, 173, 184, 0.36) 62%,
      transparent 77%,
      rgba(105, 20, 34, 0.28) 91%,
      transparent 100%
    );
  background-position: 50% 50%, 50% 50%;
  background-size: 132% 132%, 152% 152%;
  background-blend-mode: screen;
  mix-blend-mode: screen;
}

.rarity-fx::before,
.rarity-fx::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.rarity-fx::before {
  inset: -38%;
  opacity: 0;
  background: linear-gradient(
    108deg,
    transparent 37%,
    rgba(30, 9, 65, 0.18) 43%,
    rgba(114, 91, 185, 0.58) 47%,
    rgba(229, 255, 252, 0.96) 50%,
    rgba(0, 191, 198, 0.72) 52%,
    rgba(91, 11, 27, 0.28) 57%,
    transparent 63%
  );
  filter: contrast(1.08) drop-shadow(0 0 0.6rem rgba(104, 239, 232, 0.54));
  mix-blend-mode: screen;
  transform: translateX(-70%) rotate(6deg);
}

.rarity-fx::after {
  inset: -10%;
  opacity: 0;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 0 21%, rgba(116, 79, 178, 0.22) 27%, transparent 35%, rgba(0, 163, 175, 0.2) 43%, transparent 56%),
    radial-gradient(ellipse at 46% 54%, transparent 0 34%, rgba(218, 245, 241, 0.14) 35%, transparent 36% 48%, rgba(91, 18, 38, 0.18) 52%, transparent 61%);
  filter: blur(0.12rem) contrast(1.18);
  mix-blend-mode: screen;
}

.model-card[data-rank="s"] .model-card-portrait {
  box-shadow:
    inset -0.18rem 0 rgba(111, 18, 34, 0.78),
    inset 0.18rem 0 rgba(82, 225, 217, 0.52),
    inset 0 0 1.8rem rgba(24, 5, 48, 0.78);
}

.model-card[data-rank="s"].is-selected {
  box-shadow:
    0 0 0 1px rgba(224, 255, 251, 0.96),
    0 0 0 0.3rem #160b2b,
    -0.45rem 0 1.5rem rgba(44, 218, 210, 0.34),
    0.45rem 0 1.6rem rgba(75, 34, 126, 0.5),
    0 0 2.2rem rgba(4, 0, 14, 0.92),
    0 1rem 2rem rgba(0, 0, 0, 0.62);
}

.entity-stage[data-rank="s"] {
  box-shadow:
    -0.3rem 0 1.5rem rgba(46, 207, 201, 0.26),
    0.3rem 0 1.6rem rgba(65, 30, 116, 0.46),
    0 0 2.4rem rgba(3, 0, 12, 0.86),
    0 1.2rem 2.6rem rgba(0, 0, 0, 0.48);
}

.model-card[data-rank="s"] .model-card-portrait img,
.entity-stage[data-rank="s"] img {
  filter: contrast(1.12) saturate(0.72) brightness(0.86);
}

.model-card[data-rank="s"] .rarity-fx,
.entity-stage[data-rank="s"] .rarity-fx {
  display: block;
  opacity: 0.76;
  box-shadow:
    inset 0 0 0 1px rgba(215, 255, 250, 0.88),
    inset 0.24rem 0 1rem rgba(0, 179, 187, 0.32),
    inset -0.24rem 0 1.2rem rgba(73, 30, 123, 0.46),
    inset 0 0 2.8rem rgba(4, 0, 16, 0.7);
  animation: rarity-edge-s 3.2s ease-in-out infinite;
}

.model-card[data-rank="s"] .rarity-fx::before,
.entity-stage[data-rank="s"] .rarity-fx::before {
  animation: rarity-foil-s 3.2s cubic-bezier(0.45, 0, 0.2, 1) infinite;
}

.model-card[data-rank="s"] .rarity-fx::after,
.entity-stage[data-rank="s"] .rarity-fx::after {
  animation: rarity-abyss-s 3.2s ease-in-out infinite;
}

.model-card[data-rank="a"] .rarity-fx,
.entity-stage[data-rank="a"] .rarity-fx {
  display: block;
  opacity: 0.2;
  box-shadow:
    inset 0 0 0 1px rgba(172, 223, 218, 0.5),
    inset 0 0 1.4rem rgba(29, 17, 58, 0.4);
  animation: rarity-edge-a 6s ease-in-out infinite;
}

.model-card[data-rank="a"] .rarity-fx::before,
.entity-stage[data-rank="a"] .rarity-fx::before {
  animation: rarity-foil-a 6s cubic-bezier(0.45, 0, 0.2, 1) infinite;
}

.model-card[data-rank="a"] .rarity-fx::after,
.entity-stage[data-rank="a"] .rarity-fx::after {
  animation: rarity-abyss-a 6s ease-in-out infinite;
}

.model-card.is-summoning[data-rank="s"] .rarity-fx,
.model-card.is-summoning[data-rank="a"] .rarity-fx,
.entity-stage.is-rarity-burst[data-rank="s"] .rarity-fx,
.entity-stage.is-rarity-burst[data-rank="a"] .rarity-fx {
  animation: rarity-burst-shell 650ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.model-card.is-summoning[data-rank="s"] .rarity-fx::before,
.model-card.is-summoning[data-rank="a"] .rarity-fx::before,
.entity-stage.is-rarity-burst[data-rank="s"] .rarity-fx::before,
.entity-stage.is-rarity-burst[data-rank="a"] .rarity-fx::before {
  animation: rarity-burst-foil 650ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.model-card.is-summoning[data-rank="s"] .rarity-fx::after,
.model-card.is-summoning[data-rank="a"] .rarity-fx::after,
.entity-stage.is-rarity-burst[data-rank="s"] .rarity-fx::after,
.entity-stage.is-rarity-burst[data-rank="a"] .rarity-fx::after {
  animation: rarity-burst-abyss 650ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes rarity-edge-s {
  0%, 100% {
    opacity: 0.56;
    background-position: 48% 52%, 44% 48%;
    background-size: 126% 126%, 146% 146%;
    filter: contrast(1.04) brightness(0.86);
  }
  42% {
    opacity: 0.86;
    background-position: 54% 45%, 56% 52%;
    background-size: 138% 138%, 158% 158%;
    filter: contrast(1.18) brightness(1.16);
  }
  72% {
    opacity: 0.7;
    background-position: 46% 55%, 50% 45%;
    background-size: 132% 132%, 152% 152%;
    filter: contrast(1.1) brightness(0.96);
  }
}

@keyframes rarity-edge-a {
  0%, 100% {
    opacity: 0.1;
    background-position: 48% 52%, 50% 50%;
    filter: saturate(0.55) brightness(0.78);
  }
  52% {
    opacity: 0.24;
    background-position: 54% 46%, 55% 48%;
    filter: saturate(0.7) brightness(0.98);
  }
}

@keyframes rarity-foil-s {
  0%, 12% { opacity: 0; transform: translateX(-70%) rotate(6deg); }
  38% { opacity: 0.42; }
  50% { opacity: 0.96; }
  62% { opacity: 0.3; }
  88%, 100% { opacity: 0; transform: translateX(70%) rotate(6deg); }
}

@keyframes rarity-foil-a {
  0%, 38% { opacity: 0; transform: translateX(-70%) rotate(6deg); }
  54% { opacity: 0.2; }
  72%, 100% { opacity: 0; transform: translateX(70%) rotate(6deg); }
}

@keyframes rarity-abyss-s {
  0%, 100% { opacity: 0.34; transform: scale(0.9) rotate(-3deg); filter: blur(0.16rem) brightness(0.78); }
  46% { opacity: 0.82; transform: scale(1.08) rotate(2deg); filter: blur(0.08rem) brightness(1.28); }
  70% { opacity: 0.5; transform: scale(0.98) rotate(0deg); filter: blur(0.13rem) brightness(0.92); }
}

@keyframes rarity-abyss-a {
  0%, 100% { opacity: 0.06; transform: scale(0.94); }
  50% { opacity: 0.22; transform: scale(1.03); }
}

@keyframes rarity-burst-shell {
  0% { opacity: 0; filter: brightness(0.1); box-shadow: inset 0 0 4rem rgba(0, 0, 0, 0.96); }
  32% {
    opacity: 0.96;
    filter: contrast(1.35) brightness(0.42);
    box-shadow:
      inset 0 0 4rem rgba(2, 0, 12, 0.96),
      inset 0.8rem 0 2.4rem rgba(61, 26, 112, 0.7),
      inset -0.8rem 0 2.2rem rgba(0, 111, 120, 0.54);
  }
  58% {
    opacity: 1;
    filter: contrast(1.2) brightness(1.7);
    box-shadow:
      inset 0 0 0 1px rgba(229, 255, 252, 1),
      inset 0 0 3rem rgba(48, 209, 201, 0.42),
      0 0 1.8rem rgba(76, 42, 130, 0.62);
  }
  100% { opacity: 0.7; filter: contrast(1.08) brightness(0.94); }
}

@keyframes rarity-burst-foil {
  0%, 28% { opacity: 0; transform: translateX(-76%) rotate(6deg); }
  56% { opacity: 1; }
  100% { opacity: 0; transform: translateX(76%) rotate(6deg); }
}

@keyframes rarity-burst-abyss {
  0% { opacity: 0; transform: scale(1.28); filter: blur(0.5rem); }
  38% { opacity: 0.9; transform: scale(0.72); filter: blur(0.18rem); }
  66% { opacity: 0.72; transform: scale(1.14); filter: blur(0.06rem); }
  100% { opacity: 0.34; transform: scale(1); filter: blur(0.12rem); }
}

.model-card:not(.is-render-visible) .rarity-fx,
.model-card:not(.is-render-visible) .rarity-fx::before,
.model-card:not(.is-render-visible) .rarity-fx::after {
  animation: none !important;
}

.archetype-evidence {
  min-height: 3.15rem;
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  margin: -0.15rem 0 0.75rem;
  padding: 0.5rem 0.7rem;
  border-left: 0.28rem solid var(--tokyo-cyan);
  border-bottom: 1px solid rgba(230, 227, 215, 0.18);
  background: #030706;
}

.archetype-evidence span {
  color: var(--tokyo-cyan);
  font-size: 0.57rem;
  font-weight: 700;
}

.archetype-evidence strong {
  color: var(--tokyo-paper);
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1.45;
}

.model-identity {
  border-bottom-color: rgba(230, 227, 215, 0.24);
}

.model-emblem {
  border: 0;
  border-left: 0.3rem solid var(--tokyo-red);
  background: var(--tokyo-paper);
  color: var(--tokyo-ink);
  clip-path: none;
}

.model-rank {
  color: var(--tokyo-cyan);
}

.model-facts span,
.capability-item {
  border-color: rgba(230, 227, 215, 0.18);
  background: #030706;
}

.price-board {
  border: 0;
  border-top: 0.22rem solid var(--tokyo-paper);
  border-left: 0.35rem solid var(--tokyo-cyan);
  border-bottom: 0.22rem solid var(--tokyo-red);
  background: #050908;
  box-shadow: none;
}

.price-item strong {
  color: var(--tokyo-paper);
}

.price-item small {
  color: var(--tokyo-cyan);
}

.score-track span {
  background: linear-gradient(90deg, var(--tokyo-cyan), var(--tokyo-paper) 72%, var(--tokyo-red));
}

.model-picker-footer {
  border-top: 0.2rem solid rgba(230, 227, 215, 0.28);
}

.hina-dialogue {
  position: fixed;
  z-index: 33;
  bottom: 21rem;
  left: 50%;
  width: min(42rem, calc(100vw - var(--mansion-left) - var(--mansion-right) - 7rem));
  min-height: 4.2rem;
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-left: 0.3rem solid var(--tokyo-cyan);
  border-bottom: 1px solid rgba(230, 227, 215, 0.34);
  background:
    linear-gradient(90deg, rgba(2, 9, 8, 0.96), rgba(3, 8, 7, 0.9) 76%, transparent),
    repeating-linear-gradient(180deg, transparent 0 0.22rem, rgba(104, 169, 169, 0.04) 0.22rem 0.28rem);
  box-shadow: 0 1.2rem 2.8rem rgba(0, 0, 0, 0.42);
  clip-path: polygon(0 0, calc(100% - 0.7rem) 0, 100% 0.7rem, 100% 100%, 0 100%);
  opacity: 0.96;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 220ms ease, filter 220ms ease;
}

.hina-dialogue::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 7rem;
  height: 0.18rem;
  background: linear-gradient(90deg, var(--tokyo-red), var(--tokyo-paper) 42%, var(--tokyo-cyan), transparent);
  transform-origin: left;
}

.hina-dialogue.is-speaking::after {
  animation: hina-signal 1.2s ease-out both;
}

.hina-dialogue header {
  position: relative;
  display: grid;
  align-content: center;
  gap: 0.18rem;
  padding: 0.65rem 0.7rem;
  border: 0;
  border-right: 1px solid rgba(104, 169, 169, 0.28);
  background: rgba(5, 15, 13, 0.82);
}

.hina-dialogue header span {
  color: var(--tokyo-cyan);
  font: 700 0.48rem/1.2 "Cascadia Code", Consolas, monospace;
}

.hina-dialogue header b {
  color: var(--tokyo-paper);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 1rem;
  font-weight: 600;
}

.hina-dialogue > p {
  min-width: 0;
  min-height: 3.4rem;
  margin: 0;
  padding: 0.72rem 1rem 0.66rem;
  color: rgba(236, 242, 237, 0.94);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.58;
  overflow-wrap: anywhere;
  text-shadow: 0 0.12rem 0.5rem #000;
}

.hina-dialogue > p[data-scrambling="true"],
.picker-hina-dialogue[data-scrambling="true"],
.invocation-copy > p[data-scrambling="true"] {
  color: #c9fff5;
  text-shadow: 0 0 0.45rem var(--tokyo-cyan), 0 0 1rem rgba(104, 169, 169, 0.46);
}

.hina-dialogue > p[data-scrambling="true"]::after,
.picker-hina-dialogue[data-scrambling="true"]::after,
.invocation-copy > p[data-scrambling="true"]::after {
  content: "▋";
  margin-left: 0.12rem;
  color: var(--tokyo-red);
  animation: hina-cursor 180ms steps(2, jump-none) infinite;
}

body[data-game-overlay="compendium"] .hina-dialogue,
body.is-model-invoking .hina-dialogue {
  opacity: 0;
  filter: blur(0.2rem);
}

.picker-hina-dialogue {
  flex: 1 1 24rem;
  min-width: 8rem;
  max-width: 34rem;
  min-height: 1.2rem;
  margin: 0 auto;
  overflow: hidden;
  color: rgba(230, 227, 215, 0.82);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invocation-copy > p {
  min-height: 1.4rem;
}

@keyframes hina-cursor {
  0%, 48% { opacity: 1; }
  49%, 100% { opacity: 0.18; }
}

@keyframes hina-signal {
  0% { opacity: 0; transform: scaleX(0); }
  28% { opacity: 1; }
  100% { opacity: 0.45; transform: scaleX(1); }
}

/* Full-screen possession sequence: the selected model manifests, then collapses into MITRA. */
.spirit-invocation {
  --invocation-primary: #68d7d0;
  --invocation-secondary: #d4483e;
  --invocation-tertiary: #e6e3d7;
  position: fixed;
  z-index: 300;
  inset: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  color: var(--tokyo-paper);
  contain: strict;
  isolation: isolate;
  pointer-events: none;
}

.spirit-invocation.is-active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.invocation-veil,
.invocation-flash,
.invocation-beam,
.invocation-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.invocation-veil {
  z-index: 0;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 49%, rgba(2, 7, 7, 0.02) 0 10%, rgba(1, 5, 5, 0.58) 34%, rgba(0, 2, 2, 0.94) 76%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.92), rgba(3, 12, 11, 0.34) 50%, rgba(0, 0, 0, 0.92));
  backdrop-filter: saturate(0.38) brightness(0.48);
}

.spirit-invocation.is-active .invocation-veil {
  animation: invocation-veil 4.6s ease both;
}

.invocation-gate {
  position: absolute;
  z-index: 2;
  top: 44%;
  left: 50%;
  width: min(43rem, 72vw);
  aspect-ratio: 1;
  opacity: 0;
  filter:
    drop-shadow(0 0 1rem color-mix(in srgb, var(--invocation-primary) 66%, transparent))
    drop-shadow(0 0 3.2rem color-mix(in srgb, var(--invocation-secondary) 44%, transparent));
  transform: translate(-50%, -50%) scale(1.5);
}

.invocation-gate::before,
.invocation-gate::after,
.invocation-gate i {
  content: "";
  position: absolute;
  border: 1px solid color-mix(in srgb, var(--invocation-primary) 76%, transparent);
  border-radius: 50%;
  box-shadow:
    inset 0 0 2rem color-mix(in srgb, var(--invocation-primary) 12%, transparent),
    0 0 1.4rem color-mix(in srgb, var(--invocation-secondary) 20%, transparent);
}

.invocation-gate::before {
  inset: 3%;
  border-width: 0.35rem 1px 0.35rem 1px;
  border-color: var(--invocation-primary) transparent var(--invocation-secondary) transparent;
}

.invocation-gate::after {
  inset: 19%;
  border-width: 1px 0.28rem;
  border-color: color-mix(in srgb, var(--invocation-tertiary) 84%, transparent) var(--invocation-secondary);
}

.invocation-gate i:nth-child(1) {
  inset: 10%;
  border-style: dashed;
}

.invocation-gate i:nth-child(2) {
  inset: 27%;
  border-color: var(--invocation-secondary);
  transform: rotate(45deg);
}

.invocation-gate i:nth-child(3) {
  inset: 38%;
  border-width: 0.25rem 1px;
  border-color: var(--invocation-primary) transparent;
}

.invocation-gate i:nth-child(4) {
  inset: 46%;
  border-color: var(--invocation-tertiary);
  background: color-mix(in srgb, var(--invocation-primary) 18%, transparent);
}

.spirit-invocation.is-active .invocation-gate {
  animation: invocation-gate-collapse 4.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.spirit-invocation.is-active .invocation-gate::before {
  animation: invocation-ring-clockwise 2.1s linear 0.2s 2 both;
}

.spirit-invocation.is-active .invocation-gate::after,
.spirit-invocation.is-active .invocation-gate i:nth-child(1),
.spirit-invocation.is-active .invocation-gate i:nth-child(3) {
  animation: invocation-ring-counter 1.7s linear 0.2s 2.5 both;
}

.invocation-spirit {
  position: absolute;
  z-index: 3;
  top: 2vh;
  left: 50%;
  width: min(35rem, 48vw);
  height: 53vh;
  opacity: 0;
  overflow: hidden;
  mix-blend-mode: screen;
  mask-image: linear-gradient(180deg, transparent 0, #000 12% 72%, transparent 100%);
  transform: translateX(-50%) scale(1.28);
  transform-origin: 50% 90%;
}

.invocation-spirit img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter:
    saturate(0.42)
    contrast(1.45)
    brightness(1.34)
    drop-shadow(0 0 1.2rem var(--invocation-primary))
    drop-shadow(0 0 3rem color-mix(in srgb, var(--invocation-secondary) 58%, transparent));
}

.invocation-spirit span {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 58%, transparent 0 30%, color-mix(in srgb, var(--invocation-primary) 28%, transparent) 58%, transparent 76%),
    linear-gradient(180deg, color-mix(in srgb, var(--invocation-secondary) 32%, transparent), transparent 45%, color-mix(in srgb, var(--invocation-primary) 38%, transparent));
  mix-blend-mode: color-dodge;
}

.spirit-invocation.is-active .invocation-spirit {
  animation: invocation-spirit-descent 4.6s cubic-bezier(0.2, 0.72, 0.22, 1) both;
}

.invocation-beam {
  z-index: 4;
  right: auto;
  bottom: auto;
  left: 50%;
  width: min(16rem, 26vw);
  height: 68vh;
  opacity: 0;
  background:
    linear-gradient(90deg, transparent, color-mix(in srgb, var(--invocation-primary) 26%, transparent) 22%, rgba(240, 255, 253, 0.92) 50%, color-mix(in srgb, var(--invocation-secondary) 28%, transparent) 76%, transparent),
    linear-gradient(180deg, transparent, var(--invocation-primary) 32%, var(--invocation-tertiary) 68%, transparent);
  filter: blur(0.25rem) drop-shadow(0 0 2rem var(--invocation-primary));
  clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%);
  mix-blend-mode: screen;
  transform: translateX(-50%) scaleX(0.1);
  transform-origin: 50% 78%;
}

.spirit-invocation.is-active .invocation-beam {
  animation: invocation-beam-strike 4.6s ease both;
}

.invocation-core {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  width: min(20rem, 34vw);
  aspect-ratio: 1;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.2);
}

.invocation-core::before,
.invocation-core::after,
.invocation-core i {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.invocation-core::before {
  inset: 30%;
  background: rgba(240, 255, 253, 0.92);
  box-shadow:
    0 0 1rem #fff,
    0 0 3rem var(--invocation-primary),
    0 0 6rem var(--invocation-secondary);
}

.invocation-core::after {
  inset: 2%;
  border: 1px solid var(--invocation-tertiary);
  box-shadow: inset 0 0 2rem var(--invocation-primary);
}

.invocation-core i {
  inset: 14%;
  border: 1px solid var(--invocation-primary);
}

.invocation-core i:nth-child(2) {
  inset: 22%;
  border-color: var(--invocation-secondary);
}

.invocation-core i:nth-child(3) {
  inset: 38%;
  background: #fff;
}

.spirit-invocation.is-active .invocation-core {
  animation: invocation-core-impact 4.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Abyssal descent aperture: asymmetric fragments replace the former scan rings. */
.invocation-gate {
  top: 46%;
  width: min(31rem, 50vw);
  height: min(48rem, 82vh);
  aspect-ratio: auto;
  filter:
    drop-shadow(0 0 0.55rem color-mix(in srgb, var(--invocation-primary) 38%, transparent))
    drop-shadow(0 0 2.6rem rgba(0, 0, 0, 0.94));
  mix-blend-mode: screen;
}

.invocation-gate::before,
.invocation-gate::after,
.invocation-gate i {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.invocation-gate::before {
  inset: 1% 11%;
  opacity: 0.78;
  background:
    linear-gradient(90deg, transparent 0 44%, color-mix(in srgb, var(--invocation-primary) 48%, transparent) 48%, rgba(225, 255, 250, 0.82) 50%, color-mix(in srgb, var(--invocation-secondary) 42%, transparent) 52%, transparent 57%),
    linear-gradient(180deg, transparent, rgba(3, 28, 27, 0.34) 18%, rgba(0, 0, 0, 0.88) 48%, rgba(25, 2, 8, 0.4) 78%, transparent);
  clip-path: polygon(49% 0, 58% 12%, 54% 32%, 67% 47%, 57% 62%, 61% 84%, 50% 100%, 39% 85%, 43% 62%, 32% 48%, 45% 31%, 41% 13%);
}

.invocation-gate::after {
  inset: 8% 18%;
  opacity: 0.52;
  background:
    repeating-linear-gradient(180deg, transparent 0 7%, color-mix(in srgb, var(--invocation-tertiary) 42%, transparent) 7.2% 7.45%, transparent 7.7% 15%),
    linear-gradient(90deg, color-mix(in srgb, var(--invocation-secondary) 35%, transparent), transparent 24% 76%, color-mix(in srgb, var(--invocation-primary) 42%, transparent));
  clip-path: polygon(0 10%, 7% 3%, 12% 27%, 5% 43%, 14% 68%, 4% 96%, 0 89%, 6% 66%, 0 45%, 6% 25%, 100% 2%, 94% 27%, 100% 48%, 92% 70%, 98% 93%, 91% 100%, 86% 69%, 94% 46%, 87% 24%);
}

.invocation-gate i:nth-child(1),
.invocation-gate i:nth-child(2) {
  top: 13%;
  bottom: 12%;
  width: 24%;
  opacity: 0.7;
  background:
    linear-gradient(180deg, transparent 0 9%, var(--invocation-primary) 9% 9.4%, transparent 9.8% 42%, color-mix(in srgb, var(--invocation-tertiary) 55%, transparent) 42.2% 42.5%, transparent 43% 78%, var(--invocation-secondary) 78% 78.5%, transparent 79%),
    linear-gradient(90deg, transparent, rgba(108, 223, 214, 0.16));
}

.invocation-gate i:nth-child(1) {
  right: auto;
  left: 2%;
  clip-path: polygon(92% 0, 100% 3%, 57% 27%, 84% 43%, 35% 63%, 68% 81%, 16% 100%, 0 97%, 45% 79%, 14% 62%, 65% 41%, 38% 25%);
}

.invocation-gate i:nth-child(2) {
  right: 2%;
  left: auto;
  clip-path: polygon(8% 0, 0 4%, 43% 26%, 17% 45%, 66% 61%, 33% 82%, 84% 100%, 100% 96%, 56% 79%, 87% 61%, 35% 42%, 63% 24%);
  transform: none;
}

.invocation-gate i:nth-child(3),
.invocation-gate i:nth-child(4) {
  right: 32%;
  left: 32%;
  height: 13%;
  opacity: 0.54;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--invocation-primary) 48%, transparent), transparent);
  clip-path: polygon(48% 0, 58% 17%, 53% 58%, 73% 79%, 50% 100%, 27% 79%, 47% 58%, 42% 17%);
}

.invocation-gate i:nth-child(3) {
  top: -2%;
  bottom: auto;
}

.invocation-gate i:nth-child(4) {
  top: auto;
  bottom: -2%;
  transform: rotate(180deg);
}

.spirit-invocation.is-active .invocation-gate {
  animation: invocation-abyss-aperture 4.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.spirit-invocation.is-active .invocation-gate::before {
  animation: invocation-rift-breathe 1.35s steps(2, end) 0.18s 3 both;
}

.spirit-invocation.is-active .invocation-gate::after {
  animation: invocation-rift-script 1.8s steps(7, end) 0.2s 2 both;
}

.spirit-invocation.is-active .invocation-gate i:nth-child(1) {
  animation: invocation-fragment-left 2.2s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s 2 alternate both;
}

.spirit-invocation.is-active .invocation-gate i:nth-child(2) {
  animation: invocation-fragment-right 2.05s cubic-bezier(0.2, 0.7, 0.2, 1) 0.22s 2 alternate both;
}

.spirit-invocation.is-active .invocation-gate i:nth-child(3),
.spirit-invocation.is-active .invocation-gate i:nth-child(4) {
  animation: invocation-seal-needle 1.5s steps(3, end) 0.4s 2 both;
}

.invocation-core {
  top: 70%;
  width: min(15rem, 24vw);
  height: min(18rem, 32vh);
  aspect-ratio: auto;
}

.invocation-core::before,
.invocation-core::after,
.invocation-core i {
  border: 0;
  border-radius: 0;
}

.invocation-core::before {
  inset: 4% 42%;
  background: linear-gradient(180deg, transparent, rgba(227, 255, 250, 0.94) 46%, var(--invocation-primary) 62%, transparent);
  box-shadow: 0 0 1.2rem var(--invocation-primary), 0 0 3.8rem color-mix(in srgb, var(--invocation-primary) 44%, transparent);
  clip-path: polygon(50% 0, 100% 42%, 62% 100%, 39% 100%, 0 42%);
}

.invocation-core::after {
  inset: 28% 8% 18%;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--invocation-tertiary) 75%, transparent) 47%, transparent 49% 51%, color-mix(in srgb, var(--invocation-secondary) 58%, transparent) 53%, transparent);
  box-shadow: none;
  clip-path: polygon(0 48%, 35% 42%, 46% 0, 53% 0, 64% 42%, 100% 48%, 66% 56%, 54% 100%, 45% 100%, 34% 56%);
}

.invocation-core i:nth-child(1),
.invocation-core i:nth-child(2),
.invocation-core i:nth-child(3) {
  width: 0.16rem;
  height: 42%;
  background: linear-gradient(180deg, transparent, var(--invocation-primary), transparent);
}

.invocation-core i:nth-child(1) { inset: 32% auto auto 22%; transform: rotate(18deg); }
.invocation-core i:nth-child(2) { inset: 24% 22% auto auto; transform: rotate(-16deg); }
.invocation-core i:nth-child(3) { inset: 48% auto auto 50%; background: var(--invocation-tertiary); transform: translateX(-50%); }

.invocation-particles {
  z-index: 5;
}

.invocation-particles i {
  position: absolute;
  width: 0.32rem;
  height: 1.3rem;
  opacity: 0;
  background: var(--invocation-primary);
  box-shadow: 0 0 0.65rem currentColor, 0 0 1.4rem currentColor;
  color: var(--invocation-primary);
  transform: rotate(35deg) scaleY(0.35);
}

.invocation-particles i[data-tone="1"] {
  width: 0.22rem;
  color: var(--invocation-secondary);
  background: var(--invocation-secondary);
}

.invocation-particles i[data-tone="2"] {
  width: 0.18rem;
  color: var(--invocation-tertiary);
  background: var(--invocation-tertiary);
}

.spirit-invocation.is-active .invocation-particles i {
  animation: invocation-particle-converge var(--particle-duration) cubic-bezier(0.36, 0, 0.2, 1) calc(620ms + var(--particle-delay)) both;
}

.invocation-copy {
  position: absolute;
  z-index: 8;
  right: 1rem;
  bottom: 5.6vh;
  left: 1rem;
  max-width: 48rem;
  margin-inline: auto;
  display: grid;
  justify-items: center;
  gap: 0.34rem;
  opacity: 0;
  text-align: center;
  text-shadow: 0 0.16rem 0.7rem #000, 0 0 1.5rem #000;
}

.invocation-copy > span {
  color: var(--invocation-primary);
  font: 700 0.68rem/1.2 "Cascadia Code", Consolas, monospace;
}

.invocation-copy > strong {
  color: #f1f4ef;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 2.8rem;
  font-weight: 600;
  line-height: 1.05;
  text-shadow:
    0 0.18rem 0.5rem #000,
    0 0 1.2rem var(--invocation-primary),
    0 0 2.8rem color-mix(in srgb, var(--invocation-secondary) 56%, transparent);
}

.invocation-copy > b {
  display: block;
  max-width: min(46rem, calc(100vw - 2rem));
  overflow: hidden;
  color: var(--invocation-tertiary);
  font: 800 1rem/1.3 "Cascadia Code", Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invocation-copy > small {
  color: color-mix(in srgb, var(--invocation-primary) 72%, #fff);
  font: 700 0.66rem/1.3 "Cascadia Code", Consolas, monospace;
}

.invocation-copy > p {
  margin: 0.2rem 0 0;
  color: rgba(241, 244, 239, 0.88);
  font-size: 0.88rem;
  font-weight: 600;
}

.spirit-invocation.is-active .invocation-copy {
  animation: invocation-copy-enter 4.6s ease both;
}

.spirit-invocation[data-phase="descent"] .invocation-copy > strong,
.spirit-invocation[data-phase="binding"] .invocation-copy > strong {
  color: #fff;
  text-shadow: 0 0 1rem var(--invocation-secondary), 0 0 2.8rem var(--invocation-primary);
}

.spirit-invocation[data-phase="complete"] .invocation-copy > strong {
  color: #fff;
  text-shadow: 0 0 0.8rem #fff, 0 0 2rem var(--invocation-primary), 0 0 4rem var(--invocation-secondary);
}

.invocation-progress {
  position: absolute;
  z-index: 8;
  right: 1rem;
  bottom: 3.4vh;
  left: 1rem;
  max-width: 34rem;
  height: 0.2rem;
  margin-inline: auto;
  overflow: hidden;
  background: rgba(230, 227, 215, 0.16);
}

.invocation-progress i {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--invocation-secondary), #fff, var(--invocation-primary));
  box-shadow: 0 0 1rem var(--invocation-primary);
  transform: translateX(-100%);
}

.spirit-invocation.is-active .invocation-progress i {
  animation: invocation-progress 4.35s linear 0.08s both;
}

.invocation-flash {
  z-index: 7;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 50%, #fff 0 4%, var(--invocation-primary) 12%, color-mix(in srgb, var(--invocation-secondary) 48%, transparent) 30%, transparent 66%);
  mix-blend-mode: screen;
}

.spirit-invocation.is-active .invocation-flash {
  animation: invocation-flash 4.6s linear both;
}

.spirit-invocation[data-rank="s"] {
  filter: saturate(1.22) contrast(1.08);
}

.spirit-invocation[data-rank="s"] .invocation-gate,
.spirit-invocation[data-rank="s"] .invocation-core {
  filter: drop-shadow(0 0 1.4rem var(--invocation-primary)) drop-shadow(0 0 4rem var(--invocation-secondary));
}

body.is-model-invoking .app-bar,
body.is-model-invoking .game-status-hud,
body.is-model-invoking .game-command-menu,
body.is-model-invoking .run-banner,
body.is-model-invoking .vrm-contract-status,
body.is-model-invoking .messages,
body.is-model-invoking .composer {
  opacity: 0.05;
  filter: blur(0.12rem);
  pointer-events: none;
  transition: opacity 260ms ease, filter 260ms ease;
}

body.is-model-invoking .cathedral-canvas {
  filter: saturate(1.32) contrast(1.12) brightness(1.06);
}

@keyframes invocation-veil {
  0% { opacity: 0; }
  9%, 76% { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes invocation-gate-collapse {
  0% { opacity: 0; filter: blur(1.2rem); transform: translate(-50%, -50%) scale(1.55) rotate(-8deg); }
  13% { opacity: 0.72; filter: blur(0.12rem); transform: translate(-50%, -50%) scale(1.02) rotate(0); }
  34% { opacity: 1; transform: translate(-50%, -50%) scale(0.92); }
  54% { opacity: 1; filter: blur(0); transform: translate(-50%, -50%) scale(0.68) rotate(10deg); }
  64% { opacity: 0.94; filter: blur(0.2rem); transform: translate(-50%, -50%) scale(0.18) rotate(28deg); }
  69%, 100% { opacity: 0; filter: blur(1rem); transform: translate(-50%, -50%) scale(0.02) rotate(45deg); }
}

@keyframes invocation-ring-clockwise {
  to { transform: rotate(360deg); }
}

@keyframes invocation-ring-counter {
  to { transform: rotate(-360deg); }
}

@keyframes invocation-spirit-descent {
  0% { opacity: 0; filter: blur(1.6rem); transform: translateX(-50%) translateY(-8vh) scale(1.35); }
  12% { opacity: 0.74; filter: blur(0.25rem); }
  24%, 34% { opacity: 0.92; filter: blur(0); transform: translateX(-50%) translateY(0) scale(1); }
  48% { opacity: 1; filter: blur(0.06rem); transform: translateX(-50%) translateY(16vh) scale(0.68); }
  58% { opacity: 0.96; filter: blur(0.15rem) brightness(1.8); transform: translateX(-50%) translateY(37vh) scale(0.22); }
  64%, 100% { opacity: 0; filter: blur(1rem) brightness(3); transform: translateX(-50%) translateY(43vh) scale(0.02); }
}

@keyframes invocation-beam-strike {
  0%, 29% { opacity: 0; transform: translateX(-50%) scaleX(0.04); }
  38% { opacity: 0.32; transform: translateX(-50%) scaleX(0.32); }
  52% { opacity: 0.76; transform: translateX(-50%) scaleX(0.82); }
  58% { opacity: 1; filter: blur(0.08rem) brightness(2.2); transform: translateX(-50%) scaleX(1.18); }
  65% { opacity: 0.18; transform: translateX(-50%) scaleX(0.06); }
  70%, 100% { opacity: 0; transform: translateX(-50%) scaleX(0); }
}

@keyframes invocation-core-impact {
  0%, 43% { opacity: 0; transform: translate(-50%, -50%) scale(0.08); }
  55% { opacity: 0.28; transform: translate(-50%, -50%) scale(0.38); }
  59% { opacity: 1; transform: translate(-50%, -50%) scale(1.35); }
  66% { opacity: 0.72; transform: translate(-50%, -50%) scale(0.68); }
  75% { opacity: 0.18; transform: translate(-50%, -50%) scale(1.9); }
  82%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(2.5); }
}

@keyframes invocation-abyss-aperture {
  0% { opacity: 0; filter: blur(1.1rem); transform: translate(-50%, -50%) scaleX(0.04) scaleY(1.18); }
  12% { opacity: 0.38; filter: blur(0.16rem); }
  24%, 48% { opacity: 0.9; filter: blur(0); transform: translate(-50%, -50%) scaleX(0.82) scaleY(1); }
  57% { opacity: 1; filter: brightness(1.8); transform: translate(-50%, -50%) scaleX(1.04) scaleY(0.94); }
  66% { opacity: 0.48; filter: blur(0.24rem); transform: translate(-50%, -50%) scaleX(0.16) scaleY(1.08); }
  72%, 100% { opacity: 0; filter: blur(0.9rem); transform: translate(-50%, -50%) scaleX(0.01) scaleY(0.72); }
}

@keyframes invocation-rift-breathe {
  0%, 100% { opacity: 0.42; transform: scaleX(0.7); }
  50% { opacity: 0.9; transform: scaleX(1.08); }
}

@keyframes invocation-rift-script {
  0% { opacity: 0; transform: translateY(-4%); }
  28% { opacity: 0.58; }
  74% { opacity: 0.34; transform: translateY(4%); }
  100% { opacity: 0; transform: translateY(9%); }
}

@keyframes invocation-fragment-left {
  from { opacity: 0.18; transform: translate(-12%, 3%) skewY(-3deg); }
  to { opacity: 0.76; transform: translate(5%, -2%) skewY(2deg); }
}

@keyframes invocation-fragment-right {
  from { opacity: 0.14; transform: translate(13%, -3%) skewY(3deg); }
  to { opacity: 0.7; transform: translate(-4%, 2%) skewY(-2deg); }
}

@keyframes invocation-seal-needle {
  0%, 100% { opacity: 0; filter: blur(0.2rem); }
  34%, 68% { opacity: 0.7; filter: blur(0); }
}

@keyframes invocation-particle-converge {
  0% { opacity: 0; transform: rotate(35deg) scaleY(0.2); }
  18% { opacity: 0.9; }
  72% { opacity: 1; transform: translate(var(--particle-x), var(--particle-y)) rotate(210deg) scaleY(1.25); }
  100% { opacity: 0; transform: translate(var(--particle-x), var(--particle-y)) rotate(260deg) scale(0.05); }
}

@keyframes invocation-copy-enter {
  0%, 5% { opacity: 0; transform: translateY(1rem); }
  13%, 88% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-0.5rem); }
}

@keyframes invocation-progress {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@keyframes invocation-flash {
  0%, 52% { opacity: 0; }
  56% { opacity: 0.94; }
  59% { opacity: 0; }
  70% { opacity: 0; }
  73% { opacity: 0.38; }
  77%, 100% { opacity: 0; }
}

@media (max-width: 1100px) and (min-width: 781px) {
  .model-picker-body {
    grid-template-columns: minmax(33rem, 1fr) minmax(21rem, 25rem);
  }

  .archetype-filter {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .archetype-filter button:nth-child(4) {
    border-right: 0;
  }
}

@media (max-width: 780px) {
  .mansion-art-backdrop {
    background-position: center top;
    filter: saturate(0.94) contrast(1.1) brightness(0.82);
  }

  .messages {
    padding: 2rem 1rem 0.9rem;
  }

  .model-picker-catalog {
    border-right: 0;
  }

  .archetype-index > header small {
    display: none;
  }

  .archetype-filter {
    grid-auto-columns: 6.4rem;
    grid-template-columns: none;
    grid-auto-flow: column;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .archetype-filter button {
    border-bottom: 0;
  }

  .model-roster {
    grid-auto-rows: 11.8rem;
  }

  .model-card {
    height: 11.8rem;
    padding-left: 44%;
  }

  .model-card-portrait {
    right: 58%;
  }

  .entity-stage {
    height: 18rem;
  }

  .rarity-fx::after {
    background:
      radial-gradient(ellipse at 50% 50%, transparent 0 24%, rgba(101, 67, 160, 0.2) 30%, transparent 39%, rgba(0, 151, 162, 0.16) 48%, transparent 59%),
      radial-gradient(ellipse at 46% 54%, transparent 0 38%, rgba(219, 244, 241, 0.12) 39%, transparent 41% 56%, rgba(87, 17, 36, 0.16) 60%, transparent 68%);
  }

  .invocation-gate {
    top: 45%;
    width: 74vw;
    height: 68vh;
  }

  .invocation-spirit {
    top: 7vh;
    width: 92vw;
    height: 45vh;
  }

  .invocation-beam {
    width: 42vw;
    height: 63vh;
  }

  .invocation-core {
    top: 68%;
    width: 38vw;
    height: 25vh;
  }

  .invocation-copy {
    right: 0.75rem;
    bottom: 4.6rem;
    left: 0.75rem;
    gap: 0.26rem;
  }

  .invocation-copy > span,
  .invocation-copy > small {
    font-size: 0.56rem;
  }

  .invocation-copy > strong {
    font-size: 1.85rem;
  }

  .invocation-copy > b {
    max-width: calc(100vw - 2rem);
    font-size: 0.78rem;
  }

  .invocation-copy > p {
    max-width: 21rem;
    font-size: 0.74rem;
  }

  .invocation-progress {
    bottom: 3.2rem;
    max-width: calc(100vw - 3rem);
  }

  .hina-dialogue {
    right: 0.55rem;
    bottom: 18.9rem;
    left: 0.55rem;
    width: auto;
    min-height: 3.35rem;
    grid-template-columns: 4.7rem minmax(0, 1fr);
    border-left-width: 0.2rem;
    transform: none;
  }

  .hina-dialogue::after {
    left: 4.7rem;
  }

  .hina-dialogue header {
    padding: 0.48rem 0.5rem;
  }

  .hina-dialogue header span {
    font-size: 0.4rem;
  }

  .hina-dialogue header b {
    font-size: 0.78rem;
  }

  .hina-dialogue > p {
    min-height: 3.2rem;
    padding: 0.52rem 0.62rem;
    font-size: 0.68rem;
    line-height: 1.48;
  }

  .model-picker-footer > div {
    display: none;
  }

  .picker-hina-dialogue {
    max-width: calc(100% - 9.4rem);
    margin: 0;
    font-size: 0.58rem;
    text-align: left;
  }
}

/* Imperial year clock: full JST readout in the header, compact form in message history. */
.connection-status {
  min-width: 20rem;
  min-height: 3.4rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  align-content: center;
  align-items: center;
  justify-content: stretch;
  gap: 0.18rem 0.48rem;
  padding: 0.42rem 0.72rem;
}

.connection-status .status-dot {
  grid-column: 1;
  grid-row: 1;
}

.connection-status #connection-label {
  grid-column: 2;
  grid-row: 1;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.imperial-clock {
  grid-column: 1 / -1;
  grid-row: 2;
  display: block;
  overflow: visible;
  color: rgba(224, 235, 229, 0.84);
  font: 750 0.72rem/1.25 "Cascadia Code", Consolas, monospace;
  letter-spacing: 0;
  text-align: right;
  white-space: nowrap;
}

.oracle-console .message-time {
  font-size: 0.42rem;
  line-height: 1.28;
  white-space: pre-line;
}

@media (max-width: 1100px) {
  .connection-status {
    min-width: 16rem;
  }

  .connection-status #connection-label {
    display: none;
  }
}

@media (max-width: 780px) {
  .connection-status {
    top: 0.35rem;
    right: 0.45rem;
    width: 12rem;
    min-width: 12rem;
    min-height: 2.75rem;
    padding: 0.3rem 0.45rem;
    background: linear-gradient(90deg, transparent, rgba(4, 10, 9, 0.88));
  }

  .connection-status .status-dot,
  .connection-status #connection-label {
    display: none;
  }

  .imperial-clock {
    grid-column: 1 / -1;
    grid-row: 1 / -1;
    max-width: 100%;
    font-size: 0.58rem;
    line-height: 1.45;
    white-space: normal;
  }

  .oracle-console .message-time {
    font-size: 0.38rem;
  }
}

/* External-intelligence readout: keep final DOM text accessible while the visual layer decrypts. */
.model-picker-preview [data-model-scrambling="true"] {
  position: relative;
  color: transparent !important;
  text-shadow: none !important;
}

.model-picker-preview [data-model-scrambling="true"]::after {
  content: attr(data-scramble);
  position: absolute;
  z-index: 4;
  inset: 0;
  box-sizing: border-box;
  overflow: hidden;
  color: #9af1df;
  font: inherit;
  line-height: inherit;
  text-align: inherit;
  text-shadow: 0 0 0.35rem rgba(92, 238, 214, 0.72), 0 0 0.9rem rgba(92, 238, 214, 0.22);
  white-space: pre-wrap;
  -webkit-text-fill-color: #9af1df;
  pointer-events: none;
}

.model-picker-preview .model-facts > [data-model-scrambling="true"]::after {
  display: flex;
  align-items: center;
  padding: inherit;
}

.model-picker-preview .capability-item[data-model-scrambling="true"] > * {
  visibility: hidden;
}

.model-picker-preview .capability-item[data-model-scrambling="true"]::after {
  display: flex;
  align-items: center;
  padding: 0.4rem 0.45rem;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.52rem;
  font-weight: 750;
}

@media (prefers-reduced-motion: reduce) {
  .model-picker-preview [data-model-scrambling="true"] {
    color: inherit !important;
  }

  .model-picker-preview [data-model-scrambling="true"]::after {
    content: none;
  }
}

/* Contract lanes: separate each summon card and make the two reading columns unambiguous. */
.model-roster {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1.45rem;
  row-gap: 0.95rem;
  padding: 0.8rem 1rem 1.15rem;
  background:
    linear-gradient(90deg,
      transparent 0 calc(50% - 0.72rem),
      rgba(0, 0, 0, 0.88) calc(50% - 0.72rem) calc(50% + 0.72rem),
      transparent calc(50% + 0.72rem)),
    linear-gradient(180deg, rgba(4, 12, 11, 0.78), rgba(1, 5, 5, 0.92));
  scrollbar-gutter: stable;
}

.model-card {
  padding-left: 47%;
  border: 1px solid rgba(126, 172, 165, 0.3);
  border-left: 0.3rem solid var(--type-color);
  background-color: #040908;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.92),
    0 0.8rem 1.65rem rgba(0, 0, 0, 0.58),
    inset 0 0 0 1px rgba(231, 240, 233, 0.025);
}

.model-card::after {
  inset: 0;
  border: 0;
  box-shadow: inset -1px 0 rgba(126, 205, 200, 0.18);
}

.model-card:hover,
.model-card:focus-visible {
  border-color: rgba(151, 224, 214, 0.78);
  border-left-color: var(--type-color);
  box-shadow:
    0 0 0 1px rgba(126, 205, 200, 0.42),
    0 1rem 2rem rgba(0, 0, 0, 0.7),
    0 0 1.2rem rgba(85, 193, 181, 0.12);
}

.model-card.is-previewing:not(.is-selected) {
  border-color: rgba(121, 234, 219, 0.92);
  border-left-color: #8ce8dc;
  box-shadow:
    0 0 0 2px rgba(93, 208, 194, 0.38),
    inset 0 0 1.3rem rgba(63, 205, 190, 0.1),
    0 1rem 2rem rgba(0, 0, 0, 0.72);
}

.model-card.is-selected {
  border-color: var(--tokyo-paper);
  border-left-color: var(--tokyo-red);
  box-shadow:
    0 0 0 2px rgba(212, 72, 62, 0.82),
    0 0 0 0.38rem rgba(3, 8, 7, 0.96),
    0 1.1rem 2.2rem rgba(0, 0, 0, 0.76);
}

.model-card-portrait {
  right: 54%;
  border-right: 1px solid rgba(137, 218, 208, 0.62);
  box-shadow: 0.8rem 0 1.3rem rgba(0, 0, 0, 0.68);
}

.model-card-top,
.model-card-price,
.model-card-name,
.model-card-id,
.model-card-stats,
.model-card-loadout {
  position: relative;
  z-index: 2;
}

@media (max-width: 1100px) {
  .model-roster {
    grid-template-columns: minmax(0, 1fr);
    column-gap: 0;
    padding-inline: 0.65rem;
    background: linear-gradient(180deg, rgba(4, 12, 11, 0.78), rgba(1, 5, 5, 0.92));
  }
}

/* Model price re-synchronization */
.price-item {
  position: relative;
  overflow: hidden;
}

.price-item strong,
.price-item small {
  font-variant-numeric: tabular-nums;
}

.price-item::after {
  content: "";
  position: absolute;
  z-index: 4;
  top: 0;
  bottom: 0;
  left: -38%;
  width: 28%;
  background: linear-gradient(90deg, transparent, rgba(153, 238, 228, 0.2), transparent);
  opacity: 0;
  pointer-events: none;
  transform: skewX(-12deg);
}

.price-item.is-price-decaying strong,
.price-item.is-price-decaying small {
  color: rgba(152, 181, 174, 0.56);
  text-shadow: 0 0 0.65rem rgba(84, 154, 148, 0.16);
}

.price-item.is-price-syncing::after {
  animation: price-sync-scan 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.price-item.is-price-syncing strong {
  color: #f5fff9;
  text-shadow: 0 0 0.65rem rgba(110, 220, 210, 0.5), 0 0 1.4rem rgba(92, 188, 181, 0.22);
  animation: price-value-lock 520ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.price-item.is-price-syncing small {
  color: #86d9d1;
}

.price-item[data-price-trend="up"].is-price-syncing {
  box-shadow: inset 0 -0.16rem rgba(108, 218, 207, 0.72), inset 0 0 1.4rem rgba(71, 164, 156, 0.09);
}

.price-item[data-price-trend="down"].is-price-syncing {
  box-shadow: inset 0 -0.16rem rgba(218, 183, 102, 0.58), inset 0 0 1.4rem rgba(165, 128, 54, 0.08);
}

@keyframes price-sync-scan {
  0% { left: -38%; opacity: 0; }
  18% { opacity: 1; }
  100% { left: 112%; opacity: 0; }
}

@keyframes price-value-lock {
  0% { opacity: 0.42; filter: blur(0.08rem); transform: translateY(0.22rem); }
  58% { opacity: 1; filter: blur(0); transform: translateY(0); }
  76% { filter: brightness(1.45); }
  100% { filter: brightness(1); }
}

@media (prefers-reduced-motion: reduce) {
  .price-item,
  .price-item::after,
  .price-item strong,
  .price-item small {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-height: 720px) and (min-width: 781px) {
  .hina-dialogue {
    bottom: 16.15rem;
    min-height: 3.5rem;
  }

  .hina-dialogue > p {
    min-height: 3rem;
    padding-block: 0.55rem;
    font-size: 0.74rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .model-card[data-rank="s"] .rarity-fx,
  .model-card[data-rank="a"] .rarity-fx,
  .entity-stage[data-rank="s"] .rarity-fx,
  .entity-stage[data-rank="a"] .rarity-fx,
  .model-card.is-summoning[data-rank="s"] .rarity-fx,
  .model-card.is-summoning[data-rank="a"] .rarity-fx,
  .entity-stage.is-rarity-burst[data-rank="s"] .rarity-fx,
  .entity-stage.is-rarity-burst[data-rank="a"] .rarity-fx,
  .model-card[data-rank="s"] .rarity-fx::before,
  .model-card[data-rank="a"] .rarity-fx::before,
  .entity-stage[data-rank="s"] .rarity-fx::before,
  .entity-stage[data-rank="a"] .rarity-fx::before,
  .model-card[data-rank="s"] .rarity-fx::after,
  .model-card[data-rank="a"] .rarity-fx::after,
  .entity-stage[data-rank="s"] .rarity-fx::after,
  .entity-stage[data-rank="a"] .rarity-fx::after {
    animation: none !important;
  }

  .model-card[data-rank="s"] .rarity-fx,
  .entity-stage[data-rank="s"] .rarity-fx {
    opacity: 0.68;
    background-position: 50% 50%, 50% 50%;
    filter: contrast(1.12) brightness(0.96);
  }

  .model-card[data-rank="a"] .rarity-fx,
  .entity-stage[data-rank="a"] .rarity-fx {
    opacity: 0.16;
    background-position: 50% 50%, 50% 50%;
    filter: saturate(0.58) brightness(0.84);
  }

  .model-card[data-rank="s"] .rarity-fx::before,
  .entity-stage[data-rank="s"] .rarity-fx::before {
    opacity: 0.34;
    transform: translateX(8%) rotate(6deg);
  }

  .model-card[data-rank="a"] .rarity-fx::before,
  .entity-stage[data-rank="a"] .rarity-fx::before {
    opacity: 0.08;
    transform: translateX(-12%) rotate(6deg);
  }

  .model-card[data-rank="s"] .rarity-fx::after,
  .entity-stage[data-rank="s"] .rarity-fx::after {
    opacity: 0.48;
  }

  .model-card[data-rank="a"] .rarity-fx::after,
  .entity-stage[data-rank="a"] .rarity-fx::after {
    opacity: 0.12;
  }

  .spirit-invocation *,
  .spirit-invocation *::before,
  .spirit-invocation *::after {
    animation: none !important;
    transition: none !important;
  }

  .spirit-invocation.is-active .invocation-veil {
    opacity: 0.9;
  }

  .spirit-invocation.is-active .invocation-gate {
    opacity: 0.62;
    filter: none;
    transform: translate(-50%, -50%) scale(0.78);
  }

  .spirit-invocation.is-active .invocation-spirit,
  .spirit-invocation.is-active .invocation-beam,
  .spirit-invocation.is-active .invocation-particles,
  .spirit-invocation.is-active .invocation-flash {
    display: none;
  }

  .spirit-invocation.is-active .invocation-core {
    opacity: 0.58;
    transform: translate(-50%, -50%) scale(0.72);
  }

  .spirit-invocation.is-active .invocation-copy {
    opacity: 1;
    transform: none;
  }

  .spirit-invocation.is-active .invocation-progress i {
    transform: translateX(0);
  }

  .hina-dialogue::after,
  .hina-dialogue > p::after,
  .picker-hina-dialogue::after,
  .invocation-copy > p::after {
    animation: none !important;
  }
}

/* Subterranean tactical location display */
.game-status-hud .location-plaque {
  position: relative;
  display: block;
  aspect-ratio: 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border-bottom-color: rgba(111, 196, 194, 0.28);
  background: #020607;
}

.location-map {
  position: absolute;
  inset: 0;
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid rgba(109, 194, 192, 0.36);
  background: #020607;
}

.location-circuit-map {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: none;
  background: #010607;
}

.location-map-image {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.9;
  filter: brightness(1.5) contrast(1.44) saturate(0.26) sepia(0.08) hue-rotate(128deg);
  transform: scale(1.015);
}

.circuit-map-void {
  fill: #010607;
}

.circuit-blocks {
  fill: rgba(11, 35, 33, 0.24);
  stroke: rgba(83, 137, 131, 0.22);
  stroke-width: 2;
}

.circuit-secondary,
.circuit-roads,
.circuit-arteries,
.circuit-pulses {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.circuit-secondary {
  stroke: rgba(77, 128, 123, 0.25);
  stroke-width: 1.3;
  stroke-dasharray: 3 10;
}

.circuit-roads {
  stroke: rgba(94, 204, 193, 0.68);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 3px rgba(63, 196, 184, 0.32));
}

.circuit-arteries {
  stroke: rgba(199, 75, 74, 0.46);
  stroke-width: 2;
  stroke-dasharray: 7 7;
}

.circuit-pulse {
  stroke: url(#circuit-pulse);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 5 95;
  stroke-dashoffset: 0;
  animation: circuit-road-current 4.8s linear infinite;
}

.circuit-pulse.pulse-b { animation-delay: -3.5s; animation-duration: 5.4s; }
.circuit-pulse.pulse-c { animation-delay: -1.2s; animation-duration: 4.1s; }
.circuit-pulse.pulse-d { animation-delay: -4.4s; animation-duration: 5.8s; }
.circuit-pulse.pulse-e { animation-delay: -2.6s; animation-duration: 4.5s; }
.circuit-pulse.pulse-f { animation-delay: -0.7s; animation-duration: 5.1s; }
.circuit-pulse.pulse-g { animation-delay: -3.1s; animation-duration: 4.3s; }

.circuit-nodes rect,
.circuit-nodes circle {
  fill: #9ee9df;
  stroke: #e8fff9;
  stroke-width: 2;
  filter: drop-shadow(0 0 7px rgba(108, 238, 222, 0.78));
  animation: circuit-node-breathe 2.8s ease-in-out infinite alternate;
}

.circuit-nodes rect:nth-child(2n) {
  fill: #c64b49;
  stroke: #ff9c94;
  animation-delay: -1.3s;
}

.circuit-nodes .circuit-core-ring {
  fill: rgba(215, 72, 67, 0.24);
  stroke: #ff776e;
  stroke-width: 5;
}

.location-map::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: url("/assets/machida-dark-map.jpg?v=1") center / cover no-repeat;
  opacity: 0;
  filter: brightness(4.6) contrast(1.75) saturate(0.12) sepia(0.08) hue-rotate(128deg) drop-shadow(0 0 5px rgba(155, 255, 241, 0.92));
  mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, rgba(0, 0, 0, 0.16) 18%, #000 44% 58%, rgba(0, 0, 0, 0.16) 82%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, rgba(0, 0, 0, 0.16) 18%, #000 44% 58%, rgba(0, 0, 0, 0.16) 82%, transparent 100%);
  -webkit-mask-size: 34% 100%;
  mask-size: 34% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  animation: actual-map-road-glint 3.3s linear infinite;
  pointer-events: none;
}

.location-map::after {
  content: "";
  position: absolute;
  z-index: 5;
  inset: 0;
  border: 1px solid rgba(212, 238, 231, 0.1);
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(181, 230, 221, 0.025) 3px 4px);
  box-shadow: inset 0 0 1.35rem rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.location-map-grid {
  position: absolute;
  z-index: 1;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(113, 199, 196, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(113, 199, 196, 0.18) 1px, transparent 1px),
    linear-gradient(rgba(113, 199, 196, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(113, 199, 196, 0.08) 1px, transparent 1px);
  background-size: 3rem 3rem, 3rem 3rem, 0.75rem 0.75rem, 0.75rem 0.75rem;
  pointer-events: none;
}

.location-exclusion-zone {
  position: absolute;
  z-index: 2;
  top: 18%;
  right: 7%;
  width: 30%;
  height: 48%;
  border: 1px solid rgba(225, 73, 67, 0.48);
  background:
    repeating-linear-gradient(135deg, rgba(214, 54, 51, 0.14) 0 3px, transparent 3px 9px),
    rgba(91, 8, 15, 0.08);
  clip-path: polygon(20% 0, 100% 14%, 86% 100%, 0 78%);
  transform: rotate(-7deg);
  pointer-events: none;
}

.location-map-sweep {
  position: absolute;
  z-index: 3;
  top: -18%;
  bottom: -18%;
  left: -22%;
  width: 12%;
  overflow: visible;
  background: linear-gradient(90deg, transparent, rgba(148, 239, 227, 0.08), rgba(218, 248, 241, 0.24), transparent);
  filter: blur(1px);
  transform: skewX(-10deg);
  display: none;
  pointer-events: none;
}

.location-map-sector,
.location-map-depth,
.location-map-attribution {
  position: absolute;
  z-index: 6;
  overflow: visible;
  font-family: "Cascadia Code", Consolas, monospace;
  letter-spacing: 0;
  white-space: nowrap;
}

.location-map-sector {
  top: 0.55rem;
  left: 0.62rem;
  padding: 0.16rem 0.32rem;
  color: rgba(211, 242, 235, 0.84);
  font-size: 0.43rem;
  background: rgba(1, 8, 9, 0.78);
  box-shadow: inset 2px 0 #6fc5c1;
}

.location-map-depth {
  right: 0.55rem;
  bottom: 0.48rem;
  padding: 0.18rem 0.34rem;
  color: #f4d68a;
  font-size: 0.44rem;
  background: rgba(7, 5, 3, 0.82);
  box-shadow: inset 0 -1px rgba(244, 214, 138, 0.58);
}

.location-map-attribution {
  bottom: 0.15rem;
  left: 0.4rem;
  color: rgba(218, 232, 225, 0.33);
  font-size: 0.33rem;
}

.location-map-beacon {
  position: absolute;
  z-index: 7;
  top: 51%;
  left: 50%;
  width: 0.54rem;
  height: 0.54rem;
  overflow: visible;
  border: 1px solid #f6f0dc;
  border-radius: 50%;
  background: #dc4a43;
  box-shadow: 0 0 0.45rem #dc4a43, 0 0 1.3rem rgba(220, 74, 67, 0.72);
  transform: translate(-50%, -50%) rotate(45deg);
}

.location-map-beacon::before,
.location-map-beacon::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 1.5rem;
  height: 1.5rem;
  border: 1px solid rgba(116, 218, 209, 0.72);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  animation: location-beacon-pulse 2.6s ease-out infinite;
}

.location-map-beacon::after {
  animation-delay: 1.3s;
}

.location-map-beacon i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2.8rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(111, 208, 201, 0.8), transparent);
  transform: translate(-50%, -50%) rotate(-45deg);
}

.location-intel {
  position: absolute;
  z-index: 8;
  right: 0;
  bottom: 0;
  left: 0;
  min-width: 0;
  padding: 0.58rem 0.68rem 0.62rem;
  border-top: 1px solid rgba(126, 223, 212, 0.5);
  background:
    linear-gradient(105deg, rgba(7, 19, 20, 0.92), rgba(3, 7, 8, 0.94) 62%, rgba(35, 7, 11, 0.88)),
    repeating-linear-gradient(90deg, transparent 0 1.8rem, rgba(106, 190, 188, 0.04) 1.8rem calc(1.8rem + 1px));
  box-shadow: 0 -1.1rem 2.4rem rgba(0, 0, 0, 0.72);
}

.location-intel::before {
  content: "KUNADO NODE / ACTIVE";
  position: absolute;
  right: 0.65rem;
  bottom: 0.5rem;
  color: rgba(109, 199, 194, 0.2);
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.37rem;
}

.location-intel-head,
.location-meta,
.location-state {
  display: flex;
  align-items: center;
  min-width: 0;
}

.location-intel-head {
  justify-content: space-between;
  gap: 0.5rem;
}

.game-status-hud .location-intel-head span {
  color: #79c9c5;
  font-size: 0.42rem;
}

.game-status-hud .location-intel-head b {
  flex: 0 0 auto;
  padding: 0.1rem 0.24rem;
  color: #f0cd75;
  font-size: 0.38rem;
  border: 1px solid rgba(240, 205, 117, 0.42);
}

.game-status-hud .location-intel > strong {
  margin-top: 0.34rem;
  overflow: visible;
  color: #f3f0e5;
  font-family: "Yu Mincho", Georgia, serif;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: normal;
  text-shadow: 0 0 0.85rem rgba(108, 197, 193, 0.26);
}

.location-meta {
  justify-content: space-between;
  gap: 0.45rem;
  margin-top: 0.36rem;
}

.game-status-hud .location-meta small {
  margin: 0;
  color: rgba(197, 224, 217, 0.48);
  font-size: 0.36rem;
}

.location-state {
  gap: 0.34rem;
  margin-top: 0.5rem;
  padding-top: 0.36rem;
  border-top: 1px solid rgba(111, 193, 190, 0.16);
}

.location-state i {
  width: 0.34rem;
  height: 0.34rem;
  flex: 0 0 auto;
  background: #d94a44;
  box-shadow: 0 0 0.55rem rgba(217, 74, 68, 0.8);
}

.game-status-hud .location-state span,
.game-status-hud .location-state b {
  color: rgba(232, 118, 105, 0.88);
  font-size: 0.38rem;
}

.game-status-hud .location-state b {
  margin-left: auto;
  color: rgba(122, 210, 202, 0.8);
}

@keyframes location-map-scan {
  0% { transform: translateX(0) skewX(-10deg); opacity: 0; }
  10% { opacity: 0.75; }
  72% { opacity: 0.48; }
  86%, 100% { transform: translateX(790%) skewX(-10deg); opacity: 0; }
}

@keyframes circuit-road-current {
  from { stroke-dashoffset: 0; opacity: 0.28; }
  18% { opacity: 1; }
  78% { opacity: 0.88; }
  to { stroke-dashoffset: -100; opacity: 0.24; }
}

@keyframes circuit-node-breathe {
  from { opacity: 0.46; }
  to { opacity: 1; }
}

@keyframes actual-map-road-glint {
  0% {
    opacity: 0;
    -webkit-mask-position: -52% 0;
    mask-position: -52% 0;
  }
  1% { opacity: 0.82; }
  9% {
    opacity: 0.68;
    -webkit-mask-position: 152% 0;
    mask-position: 152% 0;
  }
  10%, 100% {
    opacity: 0;
    -webkit-mask-position: 152% 0;
    mask-position: 152% 0;
  }
}

@keyframes location-beacon-pulse {
  0% { opacity: 0.8; transform: translate(-50%, -50%) rotate(-45deg) scale(0.22); }
  80%, 100% { opacity: 0; transform: translate(-50%, -50%) rotate(-45deg) scale(1.35); }
}

@media (min-width: 1200px) {
  .game-status-hud {
    width: 22rem;
  }
}

@media (max-width: 780px) {
  .game-status-hud {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .game-status-hud .location-plaque {
    display: block;
    grid-column: 1 / -1;
    min-height: 4.25rem;
    height: 4.25rem;
    aspect-ratio: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(109, 194, 192, 0.28);
  }

  .location-map {
    position: absolute;
    inset: 0;
    height: auto;
    border-bottom: 0;
  }

  .location-circuit-map {
    display: none;
  }

  .location-map-image {
    opacity: 0.9;
    object-position: 50% 52%;
  }

  .location-map::before {
    background: linear-gradient(90deg, rgba(1, 5, 6, 0.35), rgba(2, 6, 7, 0.72));
  }

  .location-map-grid {
    background-size: 1.5rem 1.5rem, 1.5rem 1.5rem, 0.5rem 0.5rem, 0.5rem 0.5rem;
  }

  .game-status-hud .location-exclusion-zone,
  .game-status-hud .location-map-sweep,
  .game-status-hud .location-map-sector,
  .game-status-hud .location-map-depth,
  .game-status-hud .location-map-attribution,
  .game-status-hud .location-intel-head,
  .game-status-hud .location-meta,
  .game-status-hud .location-state,
  .game-status-hud .location-intel::before {
    display: none;
  }

  .location-map-beacon {
    top: 48%;
    left: 24%;
    width: 0.4rem;
    height: 0.4rem;
  }

  .location-map-beacon i {
    width: 1.5rem;
  }

  .location-intel {
    position: absolute;
    z-index: 8;
    inset: 0;
    display: flex;
    align-items: center;
    align-items: flex-end;
    padding: 0.28rem 0.55rem 0.62rem 8.5rem;
    background: linear-gradient(90deg, transparent 0 27%, rgba(1, 5, 6, 0.58) 44%, rgba(1, 5, 6, 0.96));
  }

  .game-status-hud .location-intel > strong {
    margin: 0;
    color: #eef4ec;
    font-size: 0.65rem;
    line-height: 1.24;
    white-space: nowrap;
    text-shadow: 0 1px 0.35rem #000, 0 0 0.6rem #000;
  }

  .game-status-hud .location-intel::before {
    content: "現在地 // KUNADO NODE";
    display: block;
    top: 0.68rem;
    right: 0.55rem;
    bottom: auto;
    color: rgba(118, 210, 204, 0.82);
    font-size: 0.38rem;
  }

  .game-status-hud .location-map-depth {
    display: block;
    right: auto;
    bottom: 0.38rem;
    left: 0.42rem;
    padding: 0.12rem 0.24rem;
    font-size: 0.34rem;
  }

  .game-status-hud > .economy-plaque,
  .game-status-hud > .ritual-price-plaque,
  .game-status-hud > .contract-price-plaque {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .location-map-sweep,
  .location-map-beacon::before,
  .location-map-beacon::after {
    animation: none !important;
  }

  .location-map-sweep {
    display: none;
  }

  .circuit-pulse,
  .circuit-nodes rect,
  .circuit-nodes circle {
    animation: none !important;
  }

  .location-map::before {
    animation: none !important;
    opacity: 0;
  }
}

@media (max-height: 720px) and (min-width: 781px) {
  .game-status-hud {
    width: 18.5rem;
  }

  .game-status-hud .location-meta {
    display: none;
  }
}

/* Fixed model parameter schema */
.score-track {
  position: relative;
}

.score-row[data-state="unknown"] .score-label strong {
  color: #d8b967 !important;
  font-size: 0.48rem;
}

.score-row[data-state="unknown"] .score-label small {
  color: rgba(216, 185, 103, 0.55);
}

.score-row[data-state="unknown"] .score-track {
  border: 1px solid rgba(216, 185, 103, 0.16);
  background:
    repeating-linear-gradient(135deg, rgba(216, 185, 103, 0.12) 0 2px, transparent 2px 6px),
    rgba(9, 11, 10, 0.92);
}

.score-row[data-state="unknown"] .score-track::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(216, 185, 103, 0.18), transparent 28%, transparent 72%, rgba(216, 185, 103, 0.08));
}

.capability-item {
  position: relative;
  min-height: 3rem;
  padding-bottom: 1.05rem;
}

.capability-item .capability-status {
  position: absolute;
  right: 0.38rem;
  bottom: 0.34rem;
  left: 0.38rem;
  overflow: hidden;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.38rem;
  font-style: normal;
  line-height: 1;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capability-item[data-status="supported"] {
  color: #eaf8f4;
  background: rgba(17, 52, 49, 0.72);
  box-shadow: inset 0 -2px #64d8cb, inset 0 0 1rem rgba(100, 216, 203, 0.08);
}

.capability-item[data-status="supported"] .capability-status {
  color: #78dfd2;
}

.capability-item[data-status="unsupported"] {
  color: rgba(183, 194, 190, 0.46);
  background: rgba(4, 7, 7, 0.96);
  box-shadow: inset 0 -1px rgba(152, 163, 159, 0.14);
}

.capability-item[data-status="unsupported"] .capability-status {
  color: rgba(167, 179, 175, 0.32);
}

.capability-item[data-status="unknown"] {
  color: rgba(230, 212, 158, 0.76);
  background:
    repeating-linear-gradient(135deg, rgba(216, 185, 103, 0.055) 0 3px, transparent 3px 9px),
    rgba(8, 8, 7, 0.96);
  box-shadow: inset 0 -1px rgba(216, 185, 103, 0.38);
}

.capability-item[data-status="unknown"] .capability-status {
  color: rgba(216, 185, 103, 0.72);
}

@media (max-width: 780px) {
  .capability-item {
    min-height: 2.8rem;
  }

  .capability-item .capability-status {
    font-size: 0.34rem;
  }
}

/* Oracle Hive command hierarchy: the bound intelligence is the central apparatus. */
@media (min-width: 781px) {
  .header-model {
    top: 0.78rem;
    right: auto;
    width: clamp(35rem, 45vw, 44rem);
    min-width: 35rem;
    min-height: 0;
    height: 5.5rem;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-rows: 0.82rem 1.75rem 1.28rem;
    gap: 0 0.55rem;
    padding: 0.55rem 1.8rem 0.52rem;
    border-top-color: rgba(122, 205, 201, 0.62);
    border-bottom-width: 0.24rem;
    background:
      linear-gradient(90deg, transparent, rgba(2, 10, 10, 0.98) 8%, rgba(5, 13, 12, 0.99) 50%, rgba(12, 7, 8, 0.98) 92%, transparent),
      url("/assets/mansion-panel-v2.webp");
    background-size: auto, 42rem 42rem;
  }

  .header-model:hover,
  .header-model:focus-visible {
    background:
      linear-gradient(90deg, transparent, rgba(5, 20, 19, 0.99) 8%, rgba(8, 24, 22, 0.99) 50%, rgba(29, 9, 12, 0.98) 92%, transparent),
      url("/assets/mansion-panel-v2.webp");
    background-size: auto, 42rem 42rem;
  }

  .model-launcher-kicker {
    grid-column: 1 / 3;
    grid-row: 1;
    align-self: end;
    color: #80cfca;
    font: 700 0.55rem/1 "Cascadia Code", Consolas, monospace;
  }

  .header-model > strong {
    grid-column: 1;
    grid-row: 2;
    align-self: center;
    font-size: 1.05rem;
    letter-spacing: 0;
  }

  .model-launcher-meta {
    grid-column: 2;
    grid-row: 2;
    min-width: 8.8rem;
    padding: 0.34rem 0.55rem;
    border-color: rgba(218, 193, 111, 0.42);
    color: #f0dfaa;
    font: 700 0.62rem/1 "Cascadia Code", Consolas, monospace;
    text-align: center;
  }

  .model-launcher-rank {
    grid-column: 3;
    grid-row: 1 / 3;
    min-width: 3.3rem;
    align-self: center;
    padding: 0.42rem 0.35rem;
    border: 1px solid rgba(120, 202, 198, 0.38);
    color: rgba(212, 230, 224, 0.76);
    font: 800 0.54rem/1 "Cascadia Code", Consolas, monospace;
    text-align: center;
  }

  .model-launcher-rank[data-rank="s"] {
    border-color: rgba(230, 216, 150, 0.72);
    color: #fff1b3;
    box-shadow: inset 0 0 0.8rem rgba(103, 210, 202, 0.16), 0 0 0.8rem rgba(224, 196, 104, 0.14);
  }

  .model-launcher-rank[data-rank="a"] {
    border-color: rgba(121, 206, 201, 0.58);
    color: #a9ebe4;
  }

  .descent-link {
    grid-column: 1 / -1;
    grid-row: 3;
    min-width: 0;
    display: grid;
    grid-template-columns: auto minmax(1.2rem, 1fr) auto minmax(1.2rem, 1fr) auto minmax(1.2rem, 1fr) auto;
    align-items: center;
    gap: 0.42rem;
    padding-top: 0.34rem;
    border-top: 1px solid rgba(111, 193, 190, 0.2);
    color: rgba(210, 229, 222, 0.66);
    font: 700 0.47rem/1 "Cascadia Code", Consolas, monospace;
  }

  .descent-link small,
  .descent-link b,
  .descent-link strong,
  .descent-link em {
    color: inherit;
    font: inherit;
    font-style: normal;
    white-space: nowrap;
  }

  .descent-link b {
    color: #f4f1e6;
  }

  .descent-link strong {
    color: #81d4cf;
  }

  .descent-link em {
    color: #e2c96f;
  }

  .descent-link i {
    position: relative;
    height: 1px;
    overflow: visible;
    background: linear-gradient(90deg, rgba(105, 192, 187, 0.16), rgba(105, 192, 187, 0.88));
  }

  .descent-link i::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -1px;
    width: 0.28rem;
    height: 0.28rem;
    border-top: 1px solid #79cbc6;
    border-right: 1px solid #79cbc6;
    transform: translateY(-50%) rotate(45deg);
  }

  .game-command-menu {
    top: 8.7rem;
    right: 1.25rem;
    width: 13.75rem;
    padding: 0.42rem 0 0.35rem;
    border-top-width: 1px;
    border-bottom-width: 1px;
    transform: none;
  }

  .game-command-menu header {
    min-height: 2.6rem;
    gap: 0.5rem;
    padding: 0.35rem 0.85rem 0.55rem;
  }

  .game-command-menu header span {
    font-size: 0.5rem;
  }

  .game-command-menu header b {
    font-size: 0.94rem;
  }

  .game-command-menu button {
    height: 3.25rem;
    grid-template-columns: 1.8rem minmax(0, 1fr) auto;
    gap: 0.58rem;
    padding: 0.38rem 0.72rem 0.38rem 0.85rem;
  }

  .game-command-menu button > svg {
    width: 1.15rem;
    height: 1.15rem;
    padding: 0.24rem;
  }

  .game-command-menu button strong {
    font-size: 0.78rem;
  }

  .game-command-menu button small {
    font: 600 0.43rem/1 "Cascadia Code", Consolas, monospace;
  }

  .game-command-menu button em {
    width: 0.85rem;
    height: 0.85rem;
    font-size: 0.52rem;
  }

  .game-command-menu button:hover,
  .game-command-menu button:focus-visible,
  .game-command-menu button.is-active {
    transform: translateX(-0.25rem);
  }
}

@media (max-width: 1100px) and (min-width: 781px) {
  .header-model {
    width: 28rem;
    min-width: 28rem;
  }

  .descent-link {
    grid-template-columns: auto 1fr auto 1fr auto;
  }

  .descent-link i:nth-of-type(3),
  .descent-link em {
    display: none;
  }
}

@media (max-width: 900px) and (min-width: 781px) {
  .header-model {
    width: 23rem;
    min-width: 23rem;
  }

  .model-launcher-meta {
    min-width: 4.6rem;
  }

  .descent-link small {
    display: none;
  }
}

@media (max-width: 780px) {
  .header-model {
    right: auto;
    min-height: 0;
    height: 3.8rem;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-rows: 0.95rem 1.45rem;
    gap: 0 0.35rem;
    padding-right: 0.85rem;
  }

  .model-launcher-kicker {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .header-model > strong {
    grid-column: 1;
    grid-row: 2;
  }

  .model-launcher-meta {
    grid-column: 2;
    grid-row: 2;
    min-width: 3rem;
  }

  .model-launcher-rank {
    grid-column: 3;
    grid-row: 2;
    padding: 0.25rem 0.3rem;
    border: 1px solid rgba(115, 199, 194, 0.34);
    color: #b8d9d4;
    font: 700 0.45rem/1 "Cascadia Code", Consolas, monospace;
  }

  .descent-link {
    display: none;
  }

  .game-command-menu {
    top: 7.7rem;
  }

  .game-status-hud {
    top: 11.3rem;
  }

  .vrm-contract-status {
    top: 15.55rem;
  }

  .run-banner {
    top: 17.3rem;
  }
}

@media (max-height: 720px) and (min-width: 781px) {
  .game-command-menu {
    top: 7.2rem;
    transform: scale(0.88);
    transform-origin: right top;
  }
}

/* Unified conversation console: the model response is primary; operational events stay in history. */
.oracle-console {
  position: fixed;
  z-index: 31;
  right: 15.5rem;
  bottom: 1.1rem;
  left: 24rem;
  width: auto;
  max-width: 72rem;
  min-width: 0;
  height: clamp(17rem, 30vh, 20rem);
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(5.5rem, 1fr) 6.4rem;
  overflow: hidden;
  border-top: 1px solid rgba(126, 205, 200, 0.48);
  border-right: 0.25rem solid var(--tokyo-red);
  border-bottom: 0.18rem solid var(--tokyo-red);
  border-left: 0.32rem solid var(--tokyo-cyan);
  background: rgba(2, 7, 7, 0.96);
  box-shadow: 0 1.8rem 5rem rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(220, 240, 234, 0.07);
  clip-path: polygon(0 0, calc(100% - 0.8rem) 0, 100% 0.8rem, 100% 100%, 0.8rem 100%, 0 calc(100% - 0.8rem));
  margin-inline: auto;
  transform: none;
  transition: height 320ms cubic-bezier(0.16, 1, 0.3, 1), border-color 180ms ease;
}

.oracle-console[data-empty="true"] {
  height: 11.8rem;
  grid-template-rows: minmax(3.3rem, 1fr) 6.4rem;
}

.oracle-console:focus-within {
  border-top-color: rgba(144, 235, 226, 0.82);
  border-left-color: #85d9d3;
  box-shadow: 0 1.8rem 5rem rgba(0, 0, 0, 0.76), 0 0 1.8rem rgba(104, 196, 190, 0.12);
}

.oracle-console .hina-dialogue {
  display: none;
}

.oracle-console .hina-dialogue::after {
  right: 0;
  bottom: 0;
  left: 9.2rem;
  height: 0.12rem;
}

.oracle-console .hina-dialogue header {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  gap: 0.1rem;
  padding: 0.66rem 0.8rem 0.62rem 0.95rem;
  background: rgba(6, 19, 17, 0.96);
}

.oracle-console .hina-dialogue header span {
  grid-column: 1;
  grid-row: 1;
}

.oracle-console .hina-dialogue header b {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
  white-space: nowrap;
  font-size: 1.12rem;
  line-height: 1.15;
}

.oracle-console .hina-dialogue header small {
  grid-column: 1;
  grid-row: 3;
  align-self: end;
  overflow: hidden;
  color: rgba(128, 205, 199, 0.58);
  font: 650 0.58rem/1.25 "Cascadia Code", Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oracle-console .hina-dialogue > p {
  min-height: 0;
  display: flex;
  align-items: center;
  padding: 0.72rem 1.15rem;
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.55;
}

.oracle-console .messages {
  position: relative;
  z-index: 1;
  right: auto;
  bottom: auto;
  left: auto;
  width: 100%;
  height: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  padding: 2rem 0.9rem 0.55rem;
  overflow-x: hidden;
  overflow-y: auto;
  border: 0;
  background:
    linear-gradient(180deg, rgba(2, 8, 8, 0.98), rgba(1, 5, 5, 0.96)),
    url("/assets/mansion-panel-v2.webp");
  background-size: auto, 42rem 42rem;
  background-blend-mode: normal, soft-light;
  box-shadow: inset 0 1rem 1.8rem rgba(0, 0, 0, 0.18);
  backdrop-filter: none;
  clip-path: none;
  transform: none;
}

.oracle-console .messages::before {
  content: "応答履歴 / RESPONSE HISTORY  ·  " attr(data-count);
  top: 0.58rem;
  left: 1rem;
  color: rgba(126, 205, 200, 0.72);
  font: 700 0.65rem/1 "Cascadia Code", Consolas, monospace;
  text-shadow: none;
}

.oracle-console .message,
.oracle-console .message.assistant,
.oracle-console .message.user,
.oracle-console .message.error {
  flex: 0 0 auto;
  width: calc(100% - 0.8rem);
  max-width: 54rem;
  min-height: 4.35rem;
  padding: 0.68rem 0.82rem 0.68rem 7.15rem;
  border-bottom: 1px solid rgba(126, 205, 200, 0.12);
  background: rgba(7, 14, 13, 0.72);
}

.oracle-console .message.user {
  align-self: flex-end;
  margin-left: auto;
  border-right: 0.2rem solid rgba(212, 72, 62, 0.9);
  background: linear-gradient(270deg, rgba(78, 14, 20, 0.38), rgba(7, 13, 12, 0.76) 48%);
}

.oracle-console .message.assistant {
  width: calc(100% - 0.8rem);
  max-width: none;
  align-self: flex-start;
  margin-right: auto;
  border-top: 1px solid rgba(126, 220, 210, 0.28);
  border-left: 0.28rem solid rgba(104, 210, 199, 0.96);
  background: linear-gradient(90deg, rgba(15, 68, 61, 0.46), rgba(6, 17, 15, 0.88) 58%, rgba(19, 7, 10, 0.76));
  box-shadow: inset 0.9rem 0 1.8rem rgba(91, 211, 198, 0.055);
}

.oracle-console .message.error {
  border-left: 0.2rem solid var(--tokyo-red);
  background: rgba(55, 8, 13, 0.52);
}

.oracle-console .message-meta {
  top: 0.68rem;
  left: 0.7rem;
  width: 5.65rem;
  padding-right: 0.65rem;
  border-right-color: rgba(126, 205, 200, 0.22);
}

.oracle-console .message-role {
  color: #d9ede7;
  font: 750 0.72rem/1.2 "Cascadia Code", Consolas, monospace;
}

.oracle-console .message-kind {
  display: block;
  margin-top: 0.18rem;
  color: rgba(126, 205, 200, 0.7);
  font: 700 0.55rem/1.15 "Cascadia Code", Consolas, monospace;
  letter-spacing: 0;
}

.oracle-console .message-time {
  display: block;
  margin-top: 0.22rem;
  color: rgba(159, 191, 184, 0.46);
  font: 600 0.56rem/1.15 "Cascadia Code", Consolas, monospace;
}

.oracle-console .message-body {
  color: rgba(239, 244, 239, 0.94);
  font-size: 1rem;
  line-height: 1.62;
}

.oracle-console .message.status {
  width: 100%;
  min-height: 1.9rem;
  align-self: center;
  padding: 0.32rem 0.6rem;
  border: 0;
  border-bottom: 1px solid rgba(126, 205, 200, 0.08);
  background: rgba(2, 10, 9, 0.5);
}

.oracle-console .message.status .message-body {
  color: rgba(130, 194, 189, 0.56);
  font: 650 0.68rem/1.4 "Cascadia Code", Consolas, monospace;
}

.oracle-console .empty-state {
  width: 100%;
  min-height: 100%;
  margin: 0;
  gap: 0.65rem;
}

.oracle-console .empty-state strong {
  color: rgba(190, 215, 207, 0.62);
  font-size: 0.9rem;
}

.oracle-console .empty-mark {
  width: 1.2rem;
  height: 1.2rem;
  border-color: rgba(108, 191, 185, 0.54);
  color: #88cbc6;
  font-size: 0.65rem;
}

.oracle-console .composer {
  position: relative;
  z-index: 2;
  right: auto;
  bottom: auto;
  left: auto;
  width: 100%;
  height: auto;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) 8.5rem;
  gap: 0.75rem;
  padding: 1.55rem 0.85rem 0.62rem;
  border: 0;
  border-top: 0.22rem solid rgba(126, 219, 210, 0.9);
  background:
    linear-gradient(100deg, rgba(12, 50, 45, 0.72), rgba(3, 13, 12, 0.99) 48%, rgba(48, 9, 14, 0.92)),
    url("/assets/mansion-panel-v2.webp");
  background-size: auto, 42rem 42rem;
  box-shadow:
    inset 0 0.55rem 1.3rem rgba(0, 0, 0, 0.38),
    inset 0 1px rgba(225, 255, 250, 0.12);
  backdrop-filter: none;
  clip-path: none;
  transform: none;
}

.oracle-console .composer::before {
  content: "メッセージ入力 / MESSAGE";
  top: 0;
  left: 0;
  width: 13.5rem;
  height: 1.38rem;
  display: flex;
  align-items: center;
  padding: 0 0.9rem;
  background: #79c8c1;
  color: #020807;
  font: 850 0.7rem/1 "Cascadia Code", Consolas, monospace;
  clip-path: polygon(0 0, 100% 0, calc(100% - 0.72rem) 100%, 0 100%);
  text-shadow: none;
}

.oracle-console .composer::after {
  top: 0.66rem;
  right: 0.85rem;
  left: 13rem;
  height: 1px;
  background: linear-gradient(90deg, rgba(121, 200, 193, 0.78), rgba(212, 72, 62, 0.52) 72%, transparent);
}

.oracle-console .composer textarea {
  min-height: 3.4rem;
  padding: 0.68rem 0.82rem;
  border: 1px solid rgba(147, 221, 212, 0.62);
  border-bottom: 0.18rem solid rgba(111, 205, 196, 0.78);
  border-left: 0.34rem solid #85d9d3;
  background: rgba(6, 22, 20, 0.98);
  color: #f2f5ef;
  font-size: 1rem;
  caret-color: #8addd6;
  box-shadow:
    inset 0.8rem 0 1.6rem rgba(76, 173, 165, 0.07),
    inset 0 0 0 1px rgba(0, 0, 0, 0.54),
    0 0.35rem 0.9rem rgba(0, 0, 0, 0.34);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.oracle-console .composer textarea::placeholder {
  color: rgba(207, 231, 224, 0.68);
  font-weight: 650;
}

.oracle-console .composer textarea:hover {
  border-color: rgba(166, 237, 228, 0.82);
}

.oracle-console .composer textarea:focus {
  border-color: #b5f2eb;
  border-bottom-color: #8de2d9;
  border-left-color: #bdf9f2;
  background: rgba(8, 31, 28, 0.99);
  box-shadow:
    inset 0.8rem 0 1.5rem rgba(104, 220, 208, 0.09),
    0 0 0 1px rgba(122, 224, 214, 0.24),
    0 0 1.25rem rgba(104, 215, 204, 0.18);
}

.oracle-console .composer:focus-within {
  border-top-color: #b5f2eb;
  background:
    linear-gradient(100deg, rgba(16, 64, 57, 0.78), rgba(4, 17, 15, 0.99) 48%, rgba(57, 10, 16, 0.94)),
    url("/assets/mansion-panel-v2.webp");
  background-size: auto, 42rem 42rem;
}

.oracle-console .composer-context {
  color: rgba(151, 190, 181, 0.52);
  font: 600 0.6rem/1.2 "Cascadia Code", Consolas, monospace;
}

.oracle-console .send-button {
  min-height: 3.55rem;
  border: 1px solid rgba(190, 244, 237, 0.76);
  border-right: 0.3rem solid var(--tokyo-red);
  background: linear-gradient(135deg, #9ad8d2, #4d8b86);
  color: #020807;
  font-size: 0.92rem;
  box-shadow: 0 0.34rem 0 rgba(34, 74, 71, 0.88), 0 0.55rem 1rem rgba(0, 0, 0, 0.42);
}

.oracle-console .send-button:hover,
.oracle-console .send-button:focus-visible {
  background: linear-gradient(135deg, #a2dbd5, #4f8581);
  box-shadow: 0 0 1.4rem rgba(103, 200, 192, 0.24);
}

.oracle-console .send-button:disabled {
  border-color: rgba(148, 190, 184, 0.5);
  border-right-color: rgba(212, 72, 62, 0.7);
  background: linear-gradient(135deg, rgba(91, 126, 122, 0.9), rgba(42, 67, 64, 0.96));
  color: rgba(232, 242, 237, 0.7);
  box-shadow: 0 0.25rem 0 rgba(27, 48, 46, 0.9), 0 0.5rem 1rem rgba(0, 0, 0, 0.36);
  cursor: not-allowed;
}

@media (max-height: 720px) and (min-width: 781px) {
  .oracle-console,
  .oracle-console[data-empty="true"] {
    bottom: 0.55rem;
    height: min(19rem, calc(100vh - 1.1rem));
    grid-template-rows: minmax(4rem, 1fr) 6.4rem;
  }

  .oracle-console[data-empty="true"] {
    height: 13rem;
  }

  .oracle-console .hina-dialogue {
    min-height: 3.9rem;
  }

  .oracle-console .hina-dialogue > p {
    min-height: 0;
    padding-block: 0.48rem;
    font-size: 0.9rem;
  }

  .oracle-console .messages {
    padding-top: 1.75rem;
  }

  .oracle-console .composer {
    padding-top: 1.5rem;
    padding-bottom: 0.45rem;
  }

  .oracle-console .composer textarea,
  .oracle-console .send-button {
    min-height: 3.1rem;
  }
}

@media (max-width: 1100px) and (min-width: 781px) {
  .oracle-console {
    right: 14rem;
    left: 15rem;
  }
}

@media (max-width: 780px) {
  .oracle-console,
  .oracle-console[data-empty="true"] {
    right: 0.55rem;
    bottom: 0.45rem;
    left: 0.55rem;
    width: auto;
    min-width: 0;
    height: 17rem;
    grid-template-rows: minmax(4.2rem, 1fr) 5.8rem;
    transform: none;
  }

  .oracle-console[data-empty="true"] {
    height: 11.2rem;
  }

  .oracle-console .hina-dialogue {
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    min-height: 4.2rem;
    grid-template-columns: 5.7rem minmax(0, 1fr);
  }

  .oracle-console .hina-dialogue::after {
    left: 5.7rem;
  }

  .oracle-console .hina-dialogue header {
    padding: 0.45rem 0.45rem 0.42rem 0.55rem;
  }

  .oracle-console .hina-dialogue header small {
    display: none;
  }

  .oracle-console .hina-dialogue > p {
    min-height: 0;
    padding: 0.48rem 0.58rem;
    font-size: 0.8rem;
    line-height: 1.45;
  }

  .oracle-console .messages {
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    height: auto;
    padding: 1.7rem 0.45rem 0.42rem;
    transform: none;
  }

  .oracle-console .messages::before {
    top: 0.5rem;
    left: 0.62rem;
    font-size: 0.57rem;
  }

  .oracle-console .message,
  .oracle-console .message.assistant,
  .oracle-console .message.user,
  .oracle-console .message.error {
    width: 100%;
    min-height: 4.2rem;
    padding: 0.58rem 0.5rem 0.58rem 5.85rem;
  }

  .oracle-console .message-meta {
    top: 0.58rem;
    left: 0.45rem;
    width: 4.75rem;
  }

  .oracle-console .message-time {
    font-size: 0.5rem;
  }

  .oracle-console .message-body {
    font-size: 0.86rem;
    line-height: 1.55;
  }

  .oracle-console .empty-state strong {
    max-width: 14rem;
    font-size: 0.78rem;
    line-height: 1.42;
  }

  .oracle-console .composer {
    right: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    height: auto;
    grid-template-columns: minmax(0, 1fr) 6.25rem;
    padding: 1.45rem 0.42rem 0.42rem;
    transform: none;
  }

  .oracle-console .composer::before {
    top: 0;
    left: 0;
    width: 10.8rem;
    height: 1.28rem;
    padding-inline: 0.62rem;
    font-size: 0.6rem;
  }

  .oracle-console .composer::after {
    top: 0.61rem;
    right: 0.42rem;
    left: 10.3rem;
  }

  .oracle-console .composer textarea,
  .oracle-console .send-button {
    min-height: 3.35rem;
    font-size: 0.82rem;
  }

  .oracle-console .composer textarea {
    padding: 0.55rem;
  }
}

/* Keep the descent command above legacy footer/button theme rules. */
.model-picker[open] .model-picker-frame {
  grid-template-rows: 5.6rem minmax(0, 1fr) 7.2rem;
}

.model-picker[open] .model-picker-footer {
  min-height: 7.2rem;
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) minmax(19rem, 24rem) minmax(10rem, 1fr);
  align-items: center;
  justify-content: stretch;
  gap: 1.25rem;
  padding: 0.72rem 1.4rem;
  overflow: visible;
  border-top: 1px solid rgba(213, 235, 226, 0.22);
  background:
    linear-gradient(90deg, rgba(2, 7, 7, 0.98), rgba(32, 4, 10, 0.9) 50%, rgba(2, 7, 7, 0.98)),
    url("/assets/mansion-panel-v2.webp");
  background-size: auto, 42rem 42rem;
}

.model-picker[open] .picker-confirm {
  grid-row: 1;
  align-self: center;
  justify-self: center;
  border: 0;
  background:
    linear-gradient(90deg, rgba(4, 7, 7, 0.98), rgba(80, 7, 18, 0.98) 17%, #a91f35 49%, rgba(68, 5, 16, 0.98) 82%, rgba(3, 7, 7, 0.98)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 34%);
  color: #f7f4e8;
  box-shadow: none;
}

.model-picker[open] .model-picker-footer > div,
.model-picker[open] .model-picker-footer > .picker-hina-dialogue {
  grid-row: 1;
}

.model-picker[open] .picker-confirm:hover,
.model-picker[open] .picker-confirm:focus-visible {
  border: 0;
  background:
    linear-gradient(90deg, #081514, #871126 14%, #d33349 50%, #821024 86%, #081514),
    linear-gradient(180deg, rgba(255, 255, 255, 0.26), transparent 38%);
  color: #fff;
}

@media (max-width: 1100px) {
  .model-picker[open] .model-picker-footer {
    grid-template-columns: minmax(8rem, 1fr) minmax(17rem, 21rem) minmax(8rem, 1fr);
    gap: 0.75rem;
    padding-inline: 0.8rem;
  }
}

@media (max-width: 780px) {
  .model-picker[open] .model-picker-frame {
    grid-template-rows: 4.8rem minmax(0, 1fr) 6.2rem;
  }

  .model-picker[open] .model-picker-footer {
    min-height: 6.2rem;
    grid-template-columns: minmax(0, 1fr);
    place-items: center;
    padding: 0.5rem 0.65rem;
  }

  .model-picker[open] .picker-confirm {
    grid-column: 1;
    width: min(22rem, 94vw);
    min-height: 5rem;
  }
}

/* Dense three-column archive: more text area, less ornamental whitespace. */
.model-picker[open] .model-picker-body {
  grid-template-columns: minmax(0, 1fr) clamp(22.5rem, 25vw, 25rem);
}

.model-picker[open] .model-roster {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 12rem;
  column-gap: 0.55rem;
  row-gap: 0.55rem;
  padding: 0.42rem 0.45rem 0.7rem;
  background: linear-gradient(180deg, rgba(3, 10, 9, 0.82), rgba(1, 5, 5, 0.94));
}

.model-picker[open] .model-card {
  height: 12rem;
  padding: 0.58rem 0.58rem 0.5rem 37%;
  border: 1px solid rgba(142, 180, 173, 0.38);
  border-left: 0.24rem solid var(--type-color);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.92),
    0 0.45rem 0.9rem rgba(0, 0, 0, 0.5);
  contain-intrinsic-size: auto 12rem;
}

.model-picker[open] .model-card-portrait {
  right: 65%;
  border-right: 1px solid rgba(137, 218, 208, 0.56);
  box-shadow: 0.42rem 0 0.75rem rgba(0, 0, 0, 0.6);
}

.model-picker[open] .model-card-top {
  gap: 0.34rem;
}

.model-picker[open] .model-card-rank {
  font-size: 0.7rem;
  line-height: 1.15;
}

.model-picker[open] .model-card-maker {
  font-size: 0.66rem;
  line-height: 1.2;
}

.model-picker[open] .model-card-price {
  padding: 0.32rem 0.38rem;
  font-size: 0.68rem;
  line-height: 1.2;
}

.model-picker[open] .model-card-price > span {
  gap: 0.18rem;
}

.model-picker[open] .model-card-name {
  min-height: 2.45rem;
  margin-top: 0.4rem;
  font-size: 0.94rem;
  line-height: 1.25;
}

.model-picker[open] .model-card-id {
  margin-top: 0.12rem;
  font-size: 0.63rem;
  line-height: 1.2;
}

.model-picker[open] .model-card-stats {
  padding-top: 0.36rem;
  gap: 0.35rem;
  font-size: 0.68rem;
  line-height: 1.15;
}

.model-picker[open] .model-card-loadout {
  min-height: 1.35rem;
  margin-top: 0.38rem;
  gap: 0.22rem;
}

.model-picker[open] .model-card-loadout span,
.model-picker[open] .model-card-loadout .is-source,
.model-picker[open] .model-card-loadout .is-empty {
  padding: 0.22rem 0.32rem;
  font-size: 0.6rem;
  line-height: 1;
}

.model-picker[open] .model-card-archetype {
  font-size: 0.64rem;
}

.model-picker[open] .model-card-alignment {
  font-size: 0.58rem;
}

.model-picker[open] .model-card:hover,
.model-picker[open] .model-card:focus-visible {
  box-shadow:
    0 0 0 1px rgba(126, 205, 200, 0.5),
    0 0.7rem 1.2rem rgba(0, 0, 0, 0.66),
    0 0 0.8rem rgba(85, 193, 181, 0.12);
}

.model-picker[open] .model-card.is-selected {
  box-shadow:
    0 0 0 2px rgba(212, 72, 62, 0.88),
    0 0 0 0.24rem rgba(3, 8, 7, 0.96),
    0 0.75rem 1.35rem rgba(0, 0, 0, 0.72);
}

@media (max-width: 1280px) {
  .model-picker[open] .model-roster {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .model-picker[open] .model-roster {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: 11.4rem;
    padding-inline: 0.25rem;
  }

  .model-picker[open] .model-card {
    height: 11.4rem;
    padding-left: 44%;
  }

  .model-picker[open] .model-card-portrait {
    right: 58%;
  }
}

/* Invocation climax: fractured depth, phase strobes, and a true return crossfade. */
.spirit-invocation {
  --invocation-duration: 6.1s;
}

.invocation-depth,
.invocation-script-lanes,
.invocation-shards,
.invocation-impact {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.invocation-depth {
  z-index: 1;
  opacity: 0;
  overflow: hidden;
  background:
    linear-gradient(112deg, transparent 0 41%, color-mix(in srgb, var(--invocation-secondary) 18%, transparent) 42% 43%, transparent 44% 100%),
    linear-gradient(69deg, transparent 0 46%, color-mix(in srgb, var(--invocation-primary) 22%, transparent) 47% 48%, transparent 49% 100%),
    repeating-linear-gradient(90deg, transparent 0 7.8%, rgba(113, 240, 229, 0.04) 7.9% 8%, transparent 8.1% 15%);
  mix-blend-mode: screen;
}

.invocation-depth::before,
.invocation-depth::after,
.invocation-depth i {
  content: "";
  position: absolute;
  top: -14%;
  bottom: -14%;
  width: 0.16rem;
  background: linear-gradient(180deg, transparent, var(--invocation-primary) 24%, #fff 49%, var(--invocation-secondary) 76%, transparent);
  box-shadow: 0 0 1.2rem var(--invocation-primary), 0 0 3.6rem color-mix(in srgb, var(--invocation-secondary) 42%, transparent);
  transform: skewX(-13deg) scaleY(0.1);
}

.invocation-depth::before { left: 29%; }
.invocation-depth::after { right: 27%; transform: skewX(17deg) scaleY(0.1); }
.invocation-depth i:nth-child(1) { left: 43%; opacity: 0.48; }
.invocation-depth i:nth-child(2) { right: 41%; opacity: 0.62; transform: skewX(8deg) scaleY(0.1); }
.invocation-depth i:nth-child(3) { left: 50%; width: 0.42rem; }

.spirit-invocation.is-active .invocation-depth {
  animation: invocation-depth-open var(--invocation-duration) steps(2, end) both;
}

.spirit-invocation.is-active .invocation-depth::before,
.spirit-invocation.is-active .invocation-depth::after,
.spirit-invocation.is-active .invocation-depth i {
  animation: invocation-depth-slash var(--invocation-duration) cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

.invocation-script-lanes {
  z-index: 2;
  display: grid;
  align-content: center;
  gap: clamp(5.5rem, 15vh, 10rem);
  opacity: 0;
  overflow: hidden;
  color: color-mix(in srgb, var(--invocation-primary) 74%, #fff);
  font: 800 clamp(0.55rem, 0.75vw, 0.72rem)/1 "Cascadia Code", Consolas, monospace;
  letter-spacing: 0.12rem;
  text-shadow: 0 0 0.7rem var(--invocation-primary);
  mix-blend-mode: screen;
}

.invocation-script-lanes span {
  display: block;
  width: 150%;
  padding-block: 0.38rem;
  border-block: 1px solid color-mix(in srgb, var(--invocation-primary) 36%, transparent);
  background: linear-gradient(90deg, transparent, rgba(3, 18, 17, 0.78) 16% 84%, transparent);
  white-space: nowrap;
}

.invocation-script-lanes span:nth-child(1),
.invocation-script-lanes span:nth-child(3) { transform: translateX(-35%); }
.invocation-script-lanes span:nth-child(2) { color: color-mix(in srgb, var(--invocation-secondary) 72%, #fff); transform: translateX(10%); }

.spirit-invocation.is-active .invocation-script-lanes {
  animation: invocation-script-field var(--invocation-duration) steps(3, end) both;
}

.spirit-invocation.is-active .invocation-script-lanes span:nth-child(odd) {
  animation: invocation-script-run-left 1.1s steps(9, end) 0.55s 4 both;
}

.spirit-invocation.is-active .invocation-script-lanes span:nth-child(2) {
  animation: invocation-script-run-right 0.9s steps(8, end) 0.72s 4 both;
}

.invocation-shards {
  z-index: 6;
  opacity: 0;
  overflow: hidden;
  mix-blend-mode: screen;
}

.invocation-shards i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(4rem, 11vw, 11rem);
  height: 0.18rem;
  opacity: 0;
  background: linear-gradient(90deg, transparent, var(--invocation-primary), #fff 72%, transparent);
  box-shadow: 0 0 1rem var(--invocation-primary);
  clip-path: polygon(0 35%, 82% 0, 100% 50%, 78% 100%, 0 62%);
  transform-origin: 0 50%;
}

.invocation-shards i:nth-child(1) { --shard-angle: -164deg; --shard-distance: 34vw; --shard-delay: 0.25s; }
.invocation-shards i:nth-child(2) { --shard-angle: -139deg; --shard-distance: 38vw; --shard-delay: 0.62s; }
.invocation-shards i:nth-child(3) { --shard-angle: -112deg; --shard-distance: 41vw; --shard-delay: 0.18s; }
.invocation-shards i:nth-child(4) { --shard-angle: -74deg; --shard-distance: 36vw; --shard-delay: 0.84s; }
.invocation-shards i:nth-child(5) { --shard-angle: -43deg; --shard-distance: 40vw; --shard-delay: 0.42s; }
.invocation-shards i:nth-child(6) { --shard-angle: -16deg; --shard-distance: 35vw; --shard-delay: 0.95s; }
.invocation-shards i:nth-child(7) { --shard-angle: 18deg; --shard-distance: 39vw; --shard-delay: 0.3s; }
.invocation-shards i:nth-child(8) { --shard-angle: 48deg; --shard-distance: 42vw; --shard-delay: 0.74s; }
.invocation-shards i:nth-child(9) { --shard-angle: 83deg; --shard-distance: 37vw; --shard-delay: 0.12s; }
.invocation-shards i:nth-child(10) { --shard-angle: 117deg; --shard-distance: 41vw; --shard-delay: 0.55s; }
.invocation-shards i:nth-child(11) { --shard-angle: 146deg; --shard-distance: 36vw; --shard-delay: 0.9s; }
.invocation-shards i:nth-child(12) { --shard-angle: 174deg; --shard-distance: 40vw; --shard-delay: 0.36s; }

.spirit-invocation.is-active .invocation-shards {
  animation: invocation-shards-visible var(--invocation-duration) linear both;
}

.spirit-invocation.is-active .invocation-shards i {
  animation: invocation-shard-flight 1.4s cubic-bezier(0.16, 0.72, 0.2, 1) calc(1.65s + var(--shard-delay)) 2 both;
}

.invocation-shards i:nth-child(3n) {
  background: linear-gradient(90deg, transparent, var(--invocation-secondary), #fff 70%, transparent);
  box-shadow: 0 0 1rem var(--invocation-secondary);
}

.invocation-impact {
  z-index: 6;
  top: auto;
  right: 17%;
  bottom: 9vh;
  left: 17%;
  height: 32vh;
  opacity: 0;
  filter: drop-shadow(0 0 1.4rem var(--invocation-primary));
  transform: scaleX(0.05) scaleY(1.2);
  mix-blend-mode: screen;
}

.invocation-impact::before,
.invocation-impact::after,
.invocation-impact i {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--invocation-primary) 62%, transparent) 45%, #fff 50%, color-mix(in srgb, var(--invocation-secondary) 62%, transparent) 55%, transparent);
  clip-path: polygon(0 53%, 38% 47%, 47% 0, 53% 0, 62% 47%, 100% 53%, 63% 58%, 54% 100%, 46% 100%, 37% 58%);
}

.invocation-impact::after { inset: 18% 8%; opacity: 0.56; transform: rotate(7deg); }
.invocation-impact i:nth-child(1) { inset: 30% -8%; opacity: 0.34; transform: rotate(-5deg); }
.invocation-impact i:nth-child(2) { inset: -10% 24%; opacity: 0.72; transform: rotate(90deg); }

.spirit-invocation.is-active .invocation-impact {
  animation: invocation-impact-lock var(--invocation-duration) cubic-bezier(0.16, 1, 0.3, 1) both;
}

.spirit-invocation.is-active .invocation-veil,
.spirit-invocation.is-active .invocation-gate,
.spirit-invocation.is-active .invocation-spirit,
.spirit-invocation.is-active .invocation-beam,
.spirit-invocation.is-active .invocation-core,
.spirit-invocation.is-active .invocation-copy {
  animation-duration: var(--invocation-duration);
}

.spirit-invocation.is-active .invocation-progress i {
  animation-duration: 5.75s;
}

.invocation-flash {
  background:
    linear-gradient(103deg, transparent 0 43%, color-mix(in srgb, var(--invocation-primary) 36%, transparent) 47%, #fff 50%, color-mix(in srgb, var(--invocation-secondary) 36%, transparent) 53%, transparent 57%),
    linear-gradient(77deg, transparent 0 47%, rgba(255, 255, 255, 0.88) 50%, transparent 53%);
}

.spirit-invocation.is-active[data-phase="opening"] .invocation-flash { animation: invocation-strobe-opening 0.66s steps(2, end) both; }
.spirit-invocation.is-active[data-phase="manifest"] .invocation-flash { animation: invocation-strobe-manifest 0.72s steps(3, end) both; }
.spirit-invocation.is-active[data-phase="descent"] .invocation-flash { animation: invocation-strobe-descent 0.9s steps(3, end) both; }
.spirit-invocation.is-active[data-phase="binding"] .invocation-flash { animation: invocation-strobe-binding 0.82s steps(3, end) both; }
.spirit-invocation.is-active[data-phase="complete"] .invocation-flash { animation: invocation-strobe-complete 1s steps(3, end) both; }

.spirit-invocation[data-phase="descent"] .invocation-beam {
  filter: blur(0.12rem) brightness(2.2) drop-shadow(0 0 2rem #fff) drop-shadow(0 0 4rem var(--invocation-primary));
}

.spirit-invocation[data-phase="binding"] .invocation-impact {
  filter: brightness(1.65) drop-shadow(0 0 1.6rem var(--invocation-primary)) drop-shadow(0 0 4rem var(--invocation-secondary));
}

.spirit-invocation[data-phase="complete"] .invocation-copy {
  transform: translateY(-1vh) scale(1.05);
}

.spirit-invocation.is-active.is-releasing {
  pointer-events: none;
  animation: invocation-overlay-release 2200ms cubic-bezier(0.16, 0.84, 0.18, 1) both;
}

.spirit-invocation.is-active[data-phase="complete"] .invocation-veil {
  animation: invocation-complete-hold 1350ms cubic-bezier(0.16, 0.82, 0.2, 1) both !important;
}

.spirit-invocation.is-active.is-releasing .invocation-veil {
  animation: invocation-return-veil 2200ms cubic-bezier(0.16, 0.84, 0.18, 1) both !important;
}

.spirit-invocation.is-active.is-releasing .invocation-fusion-burst {
  animation: invocation-return-afterglow 2200ms ease-out both !important;
}

body.is-returning-home .app-bar,
body.is-returning-home .game-status-hud,
body.is-returning-home .game-command-menu,
body.is-returning-home .workspace {
  animation: oracle-home-crossfade 1900ms cubic-bezier(0.16, 0.82, 0.2, 1) both;
}

body.is-returning-home .cathedral-canvas,
body.is-returning-home .mansion-art-backdrop {
  animation: none;
  opacity: 1;
}

@keyframes invocation-depth-open {
  0% { opacity: 0; filter: brightness(0.4); }
  8% { opacity: 0.75; }
  18%, 76% { opacity: 1; filter: brightness(1.15); }
  84%, 100% { opacity: 0; filter: brightness(2); }
}

@keyframes invocation-depth-slash {
  0% { opacity: 0; transform: skewX(-13deg) scaleY(0.04); }
  12% { opacity: 0.72; transform: skewX(-13deg) scaleY(1); }
  46% { opacity: 0.28; transform: skewX(9deg) scaleY(1.12); }
  62% { opacity: 1; width: 0.55rem; transform: skewX(-5deg) scaleY(1.25); }
  78%, 100% { opacity: 0; transform: skewX(18deg) scaleY(0.1); }
}

@keyframes invocation-script-field {
  0%, 7% { opacity: 0; }
  13%, 70% { opacity: 0.7; }
  77%, 100% { opacity: 0; }
}

@keyframes invocation-script-run-left {
  from { transform: translateX(-48%); }
  to { transform: translateX(-4%); }
}

@keyframes invocation-script-run-right {
  from { transform: translateX(8%); }
  to { transform: translateX(-38%); }
}

@keyframes invocation-shards-visible {
  0%, 22% { opacity: 0; }
  28%, 72% { opacity: 1; }
  80%, 100% { opacity: 0; }
}

@keyframes invocation-shard-flight {
  0% { opacity: 0; transform: rotate(var(--shard-angle)) translateX(1rem) scaleX(0.1); }
  16% { opacity: 1; }
  72% { opacity: 0.88; }
  100% { opacity: 0; transform: rotate(var(--shard-angle)) translateX(var(--shard-distance)) scaleX(1.15); }
}

@keyframes invocation-impact-lock {
  0%, 45% { opacity: 0; transform: scaleX(0.02) scaleY(1.4); }
  51% { opacity: 0.28; }
  56% { opacity: 1; transform: scaleX(1.18) scaleY(0.9); }
  61% { opacity: 0.64; transform: scaleX(0.72) scaleY(1.06); }
  70% { opacity: 0.9; transform: scaleX(1) scaleY(1); }
  78%, 100% { opacity: 0; transform: scaleX(1.3) scaleY(0.04); }
}

@keyframes invocation-strobe-opening {
  0%, 30%, 100% { opacity: 0; }
  12% { opacity: 0.42; }
}

@keyframes invocation-strobe-manifest {
  0%, 24%, 46%, 100% { opacity: 0; }
  12% { opacity: 0.78; }
  34% { opacity: 0.24; }
}

@keyframes invocation-strobe-descent {
  0%, 18%, 42%, 68%, 100% { opacity: 0; }
  9% { opacity: 0.92; }
  30% { opacity: 0.38; }
  56% { opacity: 0.76; }
}

@keyframes invocation-strobe-binding {
  0%, 22%, 52%, 100% { opacity: 0; }
  10% { opacity: 1; }
  38% { opacity: 0.54; }
}

@keyframes invocation-strobe-complete {
  0%, 18%, 44%, 100% { opacity: 0; }
  8% { opacity: 0.86; }
  30% { opacity: 0.32; }
}

@keyframes invocation-overlay-release {
  0% { opacity: 1; }
  24% { opacity: 0.88; }
  58% { opacity: 0.48; }
  86% { opacity: 0.1; }
  100% { visibility: hidden; opacity: 0; }
}

@keyframes invocation-complete-hold {
  0% { opacity: 0; filter: saturate(1.3) brightness(1.5) blur(0.18rem); }
  18% { opacity: 0.76; filter: saturate(1.16) brightness(1.26) blur(0.04rem); }
  62%, 100% { opacity: 0.86; filter: saturate(1.04) brightness(1.08); }
}

@keyframes invocation-return-veil {
  0%, 12% { opacity: 0.82; }
  56% { opacity: 0.42; }
  100% { opacity: 0; }
}

@keyframes invocation-return-afterglow {
  0% { opacity: 0.36; }
  38% { opacity: 0.18; }
  100% { opacity: 0; }
}

@keyframes oracle-home-crossfade {
  0% { opacity: 0.08; transform: translateY(0.18rem); }
  38% { opacity: 0.38; }
  72% { opacity: 0.82; }
  100% { opacity: 1; transform: none; }
}

@keyframes oracle-world-crossfade {
  0% { opacity: 0.82; filter: saturate(1.24) contrast(0.94) brightness(1.72); }
  32% { opacity: 0.9; filter: saturate(1.14) contrast(0.98) brightness(1.42); }
  68% { opacity: 0.96; filter: saturate(1.04) contrast(1.02) brightness(1.16); }
  100% { opacity: 1; filter: saturate(0.98) contrast(1.04) brightness(1.02); }
}

@keyframes oracle-backdrop-fade-in {
  0% { opacity: 1; filter: saturate(1.14) contrast(1.04) brightness(1.28); transform: scale(1.01); }
  32% { opacity: 1; filter: saturate(1.09) contrast(1.06) brightness(1.16); }
  70% { opacity: 1; filter: saturate(1.02) contrast(1.08) brightness(1.01); }
  100% { opacity: 1; filter: saturate(0.98) contrast(1.1) brightness(0.92); transform: scale(1.01); }
}

@media (max-width: 780px) {
  .invocation-script-lanes { gap: 7rem; }
  .invocation-script-lanes span:nth-child(3) { display: none; }
  .invocation-shards i:nth-child(even) { display: none; }
  .invocation-impact { right: 4%; left: 4%; }
}

@media (prefers-reduced-motion: reduce) {
  .spirit-invocation.is-active .invocation-depth,
  .spirit-invocation.is-active .invocation-depth::before,
  .spirit-invocation.is-active .invocation-depth::after,
  .spirit-invocation.is-active .invocation-depth i,
  .spirit-invocation.is-active .invocation-script-lanes,
  .spirit-invocation.is-active .invocation-script-lanes span,
  .spirit-invocation.is-active .invocation-shards,
  .spirit-invocation.is-active .invocation-shards i,
  .spirit-invocation.is-active .invocation-impact,
  .spirit-invocation.is-active .invocation-flash,
  .spirit-invocation.is-active.is-releasing,
  body.is-returning-home .app-bar,
  body.is-returning-home .game-status-hud,
  body.is-returning-home .game-command-menu,
  body.is-returning-home .workspace,
  body.is-returning-home .cathedral-canvas,
  body.is-returning-home .mansion-art-backdrop {
    animation: none !important;
  }
}

/* Final luminance pass: this must follow the legacy invocation veil rules. */
.spirit-invocation .invocation-veil {
  background:
    linear-gradient(90deg, rgba(114, 24, 42, 0.07), transparent 28% 72%, rgba(45, 178, 166, 0.08)),
    radial-gradient(ellipse at 50% 48%, rgba(113, 224, 212, 0.055), transparent 68%);
  backdrop-filter: none;
}

body.is-model-invoking .mansion-art-backdrop {
  opacity: 1;
  filter: saturate(0.98) contrast(1.1) brightness(0.92);
  transition-duration: 420ms;
}

body.is-model-invoking .cathedral-canvas {
  opacity: 1;
  filter: saturate(0.98) contrast(1.04) brightness(1.02);
}

body.is-model-invoking .world-overlay {
  box-shadow:
    inset 0 0 8rem rgba(0, 0, 0, 0.34),
    inset 0 -6rem 8rem rgba(0, 0, 0, 0.42);
}

body.is-model-invoking .world-vignette {
  opacity: 0.52;
  background: radial-gradient(ellipse at 50% 46%, transparent 48%, rgba(0, 0, 0, 0.56) 100%);
}

/* Location is primary navigation context, not fine-print telemetry. */
.game-status-hud .location-intel > strong {
  width: 100%;
  margin-top: 0.26rem;
  font-size: 1.32rem;
  line-height: 1.18;
  letter-spacing: 0;
}

.game-status-hud .location-meta {
  margin-top: 0.28rem;
}

@media (max-width: 780px) {
  .game-status-hud .location-intel > strong {
    width: auto;
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.22;
  }
}

/* Primary route into the registry: explicit at the top and first in command order. */
@media (min-width: 781px) {
  .header-model {
    grid-template-columns: minmax(0, 1fr) 8.8rem 3.3rem;
  }

  .model-launcher-action {
    grid-column: 2 / 4;
    grid-row: 3;
    min-width: 0;
    height: 1.28rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.38rem;
    padding: 0.18rem 0.42rem 0.18rem 0.58rem;
    border-left: 0.18rem solid #eef7ef;
    background: linear-gradient(90deg, rgba(82, 194, 185, 0.92), rgba(30, 110, 108, 0.54));
    color: #020909;
    box-shadow: 0 0 0.9rem rgba(90, 229, 218, 0.2);
    font: 800 0.62rem/1 "Yu Gothic UI", Meiryo, sans-serif;
  }

  .model-launcher-action b {
    overflow: hidden;
    font: inherit;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .model-launcher-action svg {
    width: 0.82rem;
    height: 0.82rem;
    flex: 0 0 auto;
    stroke-width: 2.4;
  }

  .descent-link {
    grid-column: 1;
    padding-right: 0.65rem;
  }

  .header-model:hover .model-launcher-action,
  .header-model:focus-visible .model-launcher-action {
    background: linear-gradient(90deg, #e8f5ed, #7ce1d8);
    box-shadow: 0 0 1.25rem rgba(105, 238, 226, 0.42);
  }
}

.game-command-menu button[data-command="compendium"] {
  position: relative;
  border-left: 0.22rem solid #68d7d0;
  background:
    linear-gradient(90deg, rgba(81, 190, 182, 0.28), rgba(7, 18, 17, 0.8) 72%, rgba(61, 7, 13, 0.44)),
    rgba(2, 5, 5, 0.86);
  box-shadow: inset 0 0 1.2rem rgba(77, 211, 200, 0.08);
}

.game-command-menu button[data-command="compendium"] strong {
  color: #f3f7ef;
  font-size: 0.84rem;
}

.game-command-menu button[data-command="compendium"] small {
  color: #83d9d3;
}

.game-command-menu button[data-command="compendium"] em {
  display: grid;
  border: 1px solid rgba(120, 222, 214, 0.54);
  background: rgba(5, 18, 17, 0.84);
  color: #d9fff9;
  opacity: 1;
}

.game-command-menu button[data-command="compendium"]::after {
  content: "SELECT";
  position: absolute;
  top: 0.24rem;
  right: 0.46rem;
  color: rgba(232, 210, 125, 0.72);
  font: 700 0.34rem/1 "Cascadia Code", Consolas, monospace;
}

@media (max-width: 1100px) and (min-width: 781px) {
  .descent-link {
    display: none;
  }

  .model-launcher-action {
    grid-column: 1 / 4;
  }
}

@media (max-width: 780px) {
  .header-model {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .model-launcher-kicker {
    font-size: 0.5rem;
  }

  .model-launcher-meta,
  .model-launcher-rank {
    display: none;
  }

  .model-launcher-action {
    grid-column: 2;
    grid-row: 2;
    min-width: 7.2rem;
    min-height: 1.85rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.3rem;
    padding: 0.25rem 0.35rem 0.25rem 0.48rem;
    border-left: 0.18rem solid #eff8ef;
    background: #65c9c1;
    color: #020908;
    font: 800 0.56rem/1 "Yu Gothic UI", Meiryo, sans-serif;
  }

  .model-launcher-action b { font: inherit; }
  .model-launcher-action svg { width: 0.72rem; height: 0.72rem; }
}

/* Origin input must read as an active control even before focus. */
.oracle-console .composer {
  background:
    linear-gradient(100deg, rgba(19, 61, 56, 0.88), rgba(6, 22, 20, 0.99) 48%, rgba(55, 11, 17, 0.94)),
    url("/assets/mansion-panel-v2.webp");
  background-size: auto, 42rem 42rem;
}

.oracle-console .composer textarea {
  border: 1px solid rgba(157, 232, 223, 0.86);
  border-bottom: 0.2rem solid #79d5cc;
  border-left: 0.38rem solid #a1eee6;
  background: #102a27;
  color: #f5faf5;
  caret-color: #d8fff9;
  box-shadow:
    inset 0.8rem 0 1.7rem rgba(111, 221, 210, 0.09),
    inset 0 0 0 1px rgba(214, 255, 248, 0.04),
    0 0 0 1px rgba(0, 0, 0, 0.76),
    0 0.45rem 1rem rgba(0, 0, 0, 0.42);
}

.oracle-console .composer textarea::placeholder {
  color: rgba(225, 242, 236, 0.76);
  opacity: 1;
}

.oracle-console .composer textarea:hover {
  border-color: #b8eee8;
  background: #13312e;
}

.oracle-console .composer textarea:focus {
  outline: 0.12rem solid rgba(139, 231, 221, 0.34);
  outline-offset: 0.12rem;
  border-color: #e0fff9;
  border-bottom-color: #a7f5ec;
  border-left-color: #e6fffb;
  background: #173b37;
  box-shadow:
    inset 0.8rem 0 1.6rem rgba(133, 237, 226, 0.12),
    0 0 0 1px rgba(153, 242, 232, 0.36),
    0 0 1.4rem rgba(104, 215, 204, 0.28);
}

.oracle-console .composer-context {
  color: rgba(190, 219, 211, 0.74);
}

.oracle-console .send-button:disabled {
  opacity: 0.78;
  color: rgba(242, 250, 246, 0.84);
}

/* Dialogue staging: separate speakers and lift the conversation off the viewport edge. */
@media (min-width: 781px) {
  .oracle-console,
  .oracle-console[data-empty="true"] {
    bottom: 3.6rem;
    height: clamp(19rem, 34vh, 23rem);
    grid-template-rows: minmax(7rem, 1fr) 6.8rem;
  }

  .oracle-console[data-empty="true"] {
    height: 14.5rem;
  }
}

.oracle-console .messages {
  gap: 0.78rem;
  padding: 2.15rem 1.25rem 0.85rem;
  background:
    linear-gradient(180deg, rgba(3, 12, 11, 0.94), rgba(1, 6, 6, 0.9)),
    url("/assets/mansion-panel-v2.webp");
  background-size: auto, 42rem 42rem;
  box-shadow:
    inset 0 1.2rem 2rem rgba(0, 0, 0, 0.14),
    inset 0 -1rem 2.4rem rgba(0, 0, 0, 0.22);
}

.oracle-console .message,
.oracle-console .message.assistant,
.oracle-console .message.user,
.oracle-console .message.error {
  position: relative;
  width: auto;
  min-width: min(17rem, 58%);
  min-height: 4.7rem;
  padding: 2rem 1.15rem 0.82rem;
  border: 1px solid rgba(132, 206, 198, 0.26);
  clip-path: none;
  box-shadow: 0 0.6rem 1.35rem rgba(0, 0, 0, 0.34);
}

.oracle-console .message.assistant {
  width: fit-content;
  max-width: 78%;
  margin: 0 auto 0 2.4rem;
  border-top-color: rgba(164, 235, 226, 0.5);
  border-right-color: rgba(92, 154, 149, 0.2);
  border-bottom-color: rgba(66, 126, 121, 0.34);
  border-left: 0.3rem solid #68d7d0;
  background:
    linear-gradient(105deg, rgba(24, 80, 72, 0.72), rgba(8, 24, 21, 0.96) 60%, rgba(18, 9, 12, 0.9));
}

.oracle-console .message.user {
  width: fit-content;
  max-width: 68%;
  margin: 0 2.4rem 0 auto;
  border-top-color: rgba(235, 153, 145, 0.42);
  border-right: 0.3rem solid #d4483e;
  border-bottom-color: rgba(127, 55, 55, 0.38);
  border-left-color: rgba(151, 92, 90, 0.18);
  background:
    linear-gradient(255deg, rgba(107, 30, 36, 0.72), rgba(31, 13, 15, 0.96) 58%, rgba(9, 18, 17, 0.92));
}

.oracle-console .message.assistant::before,
.oracle-console .message.user::before {
  position: absolute;
  top: 0.58rem;
  width: 1.55rem;
  height: 1.55rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(225, 247, 240, 0.46);
  background: #0a1c1a;
  color: #dffff9;
  font: 800 0.76rem/1 "Yu Mincho", serif;
  transform: rotate(45deg);
  box-shadow: 0 0 0.8rem rgba(91, 221, 209, 0.16);
}

.oracle-console .message.assistant::before {
  content: "ひ";
  left: -2.75rem;
}

.oracle-console .message.user::before {
  content: "YOU";
  right: -2.75rem;
  border-color: rgba(245, 188, 179, 0.5);
  background: #271013;
  color: #ffe8e3;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.5rem;
  box-shadow: 0 0 0.8rem rgba(212, 72, 62, 0.18);
}

.oracle-console .message-meta {
  position: absolute;
  top: 0.46rem;
  right: 0.8rem;
  left: 0.8rem;
  width: auto;
  height: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0 0.36rem;
  border-right: 0;
  border-bottom: 1px solid rgba(136, 207, 199, 0.18);
}

.oracle-console .message.user .message-meta {
  justify-content: flex-end;
  border-bottom-color: rgba(214, 113, 104, 0.2);
}

.oracle-console .message-kind,
.oracle-console .message-time {
  display: inline;
  margin: 0;
}

.oracle-console .message-time {
  margin-left: auto;
}

.oracle-console .message.user .message-time {
  margin-left: 0;
}

.oracle-console .message-role {
  font-size: 0.78rem;
}

.oracle-console .message-body {
  color: rgba(246, 249, 244, 0.97);
  font-size: 1.05rem;
  line-height: 1.62;
}

.oracle-console .message.status {
  width: fit-content;
  min-width: 0;
  min-height: 1.65rem;
  max-width: 86%;
  margin-inline: auto;
  padding: 0.24rem 0.85rem;
  border: 1px solid rgba(111, 180, 174, 0.16);
  background: rgba(5, 16, 15, 0.72);
  box-shadow: none;
}

.oracle-console .message.status .message-body {
  color: rgba(149, 207, 199, 0.66);
  font-size: 0.66rem;
  text-align: center;
}

.oracle-console .composer {
  border-top-color: #9be5dd;
  background:
    linear-gradient(100deg, rgba(37, 91, 83, 0.92), rgba(10, 31, 29, 0.99) 50%, rgba(68, 18, 23, 0.95)),
    url("/assets/mansion-panel-v2.webp");
  background-size: auto, 42rem 42rem;
}

.oracle-console .composer textarea {
  background-color: #1c4843;
  background-image: linear-gradient(180deg, rgba(56, 111, 103, 0.24), rgba(10, 30, 28, 0.12));
  border-color: rgba(195, 247, 239, 0.9);
  border-bottom-color: #9cece3;
  border-left-color: #d1fff8;
  color: #fbfffb;
  box-shadow:
    inset 0.9rem 0 1.8rem rgba(167, 246, 236, 0.08),
    inset 0 0 1.4rem rgba(153, 235, 224, 0.06),
    0 0 0 1px rgba(0, 0, 0, 0.68),
    0 0.5rem 1.1rem rgba(0, 0, 0, 0.38);
}

.oracle-console .composer textarea::placeholder {
  color: rgba(244, 252, 248, 0.84);
}

.oracle-console .composer textarea:hover {
  background-color: #21524c;
}

.oracle-console .composer textarea:focus {
  background-color: #285f58;
  background-image: linear-gradient(180deg, rgba(87, 152, 142, 0.22), rgba(20, 59, 54, 0.12));
}

@media (max-width: 780px) {
  .oracle-console,
  .oracle-console[data-empty="true"] {
    bottom: 1.1rem;
    height: 20rem;
    grid-template-rows: minmax(6rem, 1fr) 6.2rem;
  }

  .oracle-console[data-empty="true"] {
    height: 13rem;
  }

  .oracle-console .messages {
    gap: 0.6rem;
    padding: 1.8rem 0.55rem 0.55rem;
  }

  .oracle-console .message,
  .oracle-console .message.assistant,
  .oracle-console .message.user,
  .oracle-console .message.error {
    min-width: 0;
    min-height: 4.35rem;
    padding: 1.85rem 0.72rem 0.68rem;
  }

  .oracle-console .message.assistant {
    max-width: calc(100% - 2rem);
    margin-left: 1.75rem;
  }

  .oracle-console .message.user {
    max-width: calc(100% - 2rem);
    margin-right: 1.75rem;
  }

  .oracle-console .message.assistant::before {
    left: -1.85rem;
  }

  .oracle-console .message.user::before {
    right: -1.85rem;
  }

  .oracle-console .message.assistant::before,
  .oracle-console .message.user::before {
    width: 1.2rem;
    height: 1.2rem;
    font-size: 0.62rem;
  }

  .oracle-console .message-meta {
    top: 0.42rem;
    right: 0.62rem;
    left: 0.62rem;
  }

  .oracle-console .message-body {
    font-size: 0.9rem;
    line-height: 1.52;
  }

  .oracle-console .composer textarea {
    font-size: 0.9rem;
  }
}

/* The latest MITRA line lives beside the avatar; older lines fall into history. */
.character-speech {
  position: fixed;
  z-index: 48;
  top: 14.2rem;
  left: calc(50% + 6.4rem);
  width: min(23rem, calc(50vw - 17rem));
  min-width: 18rem;
  max-height: 13rem;
  display: grid;
  grid-template-columns: 6.4rem minmax(0, 1fr);
  overflow: visible;
  border-top: 1px solid rgba(181, 242, 234, 0.72);
  border-right: 0.22rem solid rgba(212, 72, 62, 0.86);
  border-bottom: 1px solid rgba(95, 174, 166, 0.5);
  border-left: 0.3rem solid #72ddd3;
  background: linear-gradient(105deg, rgba(20, 76, 69, 0.96), rgba(7, 25, 22, 0.98) 52%, rgba(31, 10, 14, 0.96));
  box-shadow: 0 1rem 2.4rem rgba(0, 0, 0, 0.58), 0 0 1.2rem rgba(90, 220, 207, 0.12);
  opacity: 1;
  transform: translateX(0);
  transition: opacity 180ms ease, transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.character-speech::before {
  content: "";
  position: absolute;
  top: 2.15rem;
  left: -1.18rem;
  width: 1.2rem;
  height: 1.5rem;
  background: #174e48;
  clip-path: polygon(100% 0, 100% 100%, 0 50%);
  filter: drop-shadow(-1px 0 rgba(147, 231, 222, 0.54));
}

.character-speech[aria-hidden="true"] {
  visibility: hidden;
  opacity: 0;
  transform: translateX(-0.8rem);
  pointer-events: none;
}

.character-speech header {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 0.26rem;
  padding: 0.8rem 0.72rem;
  border-right: 1px solid rgba(135, 218, 208, 0.26);
  background: rgba(5, 20, 18, 0.78);
}

.character-speech header span {
  color: #79d4cd;
  font: 700 0.48rem/1.2 "Cascadia Code", Consolas, monospace;
}

.character-speech header b {
  color: #f3f4eb;
  font: 700 1rem/1.2 "Yu Mincho", serif;
}

.character-speech p {
  position: relative;
  max-height: 13rem;
  margin: 0;
  padding: 0.95rem 1rem;
  overflow-x: hidden;
  overflow-y: auto;
  color: #f5faf5;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.62;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  scrollbar-color: rgba(104, 207, 197, 0.56) transparent;
}

.character-speech p[data-scrambling="true"] {
  color: transparent;
}

.character-speech p[data-scrambling="true"]::after {
  content: attr(data-scramble);
  position: absolute;
  inset: 0;
  padding: 0.95rem 1rem;
  color: #f5faf5;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.62;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.oracle-console .message.assistant.is-presented {
  display: none;
}

@media (min-width: 781px) {
  .oracle-console[data-history-empty="true"] {
    height: 14.5rem;
  }
}

body[data-game-overlay="compendium"] .character-speech,
body.is-model-invoking .character-speech,
body:not([data-game-panel="none"]) .character-speech {
  opacity: 0;
  pointer-events: none;
}

.oracle-console .composer textarea {
  background-color: #437a73;
  background-image: linear-gradient(180deg, rgba(215, 255, 248, 0.14), rgba(20, 62, 57, 0.08));
}

.oracle-console .composer textarea:hover {
  background-color: #4b867e;
}

.oracle-console .composer textarea:focus {
  background-color: #57948b;
  background-image: linear-gradient(180deg, rgba(230, 255, 251, 0.18), rgba(31, 82, 76, 0.08));
}

@media (max-width: 1100px) and (min-width: 781px) {
  .character-speech {
    top: 13.4rem;
    right: 14rem;
    left: auto;
    width: 20rem;
    min-width: 0;
  }
}

@media (max-width: 780px) {
  .character-speech {
    top: 19rem;
    right: 0.75rem;
    left: 5.2rem;
    width: auto;
    min-width: 0;
    max-height: 10rem;
    grid-template-columns: 4.8rem minmax(0, 1fr);
  }

  .character-speech header {
    padding: 0.62rem 0.5rem;
  }

  .character-speech header span {
    font-size: 0.38rem;
  }

  .character-speech header b {
    font-size: 0.82rem;
  }

  .character-speech p {
    max-height: 10rem;
    padding: 0.72rem 0.75rem;
    font-size: 0.82rem;
    line-height: 1.5;
  }

  .character-speech p[data-scrambling="true"]::after {
    padding: 0.72rem 0.75rem;
    font-size: 0.82rem;
    line-height: 1.5;
  }

  .oracle-console[data-history-empty="true"] {
    height: 13rem;
  }
}

/* External intelligences resolve from depth only when they enter the archive viewport. */
.model-picker[open] .model-roster {
  perspective: 980px;
  perspective-origin: 50% 42%;
}

.model-picker[open] .model-card {
  transform-origin: 50% 50%;
  transform-style: preserve-3d;
}

.model-picker[open] .model-card.is-awaiting-reveal {
  opacity: 0;
  filter: blur(0.52rem) brightness(0.24) saturate(0.32);
  transform: translate3d(0, 0.7rem, -210px) scale(0.88);
  pointer-events: none;
}

.model-picker[open] .model-card.is-depth-arriving {
  will-change: opacity, filter, transform;
  animation: model-card-depth-arrival 760ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.model-card-reveal-fx {
  position: absolute;
  z-index: 12;
  inset: -28% -48%;
  opacity: 0;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(218, 255, 250, 0.72) 0 1%, rgba(75, 235, 220, 0.2) 12%, transparent 38%),
    linear-gradient(103deg, transparent 38%, rgba(98, 217, 207, 0.08) 43%, rgba(235, 255, 252, 0.95) 49.5%, rgba(91, 223, 211, 0.22) 54%, transparent 61%);
  mix-blend-mode: screen;
  transform: translate3d(-46%, 0, 34px) skewX(-8deg);
  pointer-events: none;
}

.model-picker[open] .model-card.is-depth-arriving .model-card-reveal-fx {
  animation: model-card-depth-glint 690ms cubic-bezier(0.22, 0.74, 0.22, 1) 40ms both;
}

@keyframes model-card-depth-arrival {
  0% {
    opacity: 0;
    filter: blur(0.52rem) brightness(0.24) saturate(0.32);
    transform: translate3d(0, 0.7rem, -210px) scale(0.88);
  }
  42% {
    opacity: 0.92;
    filter: blur(0.12rem) brightness(0.86) saturate(0.76);
  }
  64% {
    opacity: 1;
    filter: blur(0) brightness(1.42) saturate(1.08);
    transform: translate3d(0, -0.08rem, 18px) scale(1.008);
  }
  100% {
    opacity: 1;
    filter: none;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes model-card-depth-glint {
  0%, 12% {
    opacity: 0;
    transform: translate3d(-46%, 0, 34px) skewX(-8deg);
  }
  35% {
    opacity: 0.96;
  }
  72%, 100% {
    opacity: 0;
    transform: translate3d(46%, 0, 34px) skewX(-8deg);
  }
}

@media (max-width: 780px) {
  .model-picker[open] .model-card.is-awaiting-reveal {
    filter: blur(0.32rem) brightness(0.28) saturate(0.4);
    transform: translate3d(0, 0.45rem, -105px) scale(0.93);
  }
}

@media (prefers-reduced-motion: reduce) {
  .model-picker[open] .model-card.is-awaiting-reveal,
  .model-picker[open] .model-card.is-depth-arriving {
    opacity: 1;
    filter: none;
    transform: none;
    animation: none;
  }

  .model-card-reveal-fx {
    display: none;
  }
}

/* Screen-wide decode pass. Source text remains intact; only the visible layer is scrambled. */
[data-screen-scrambling="true"] {
  color: transparent !important;
  text-shadow: none !important;
}

[data-screen-scrambling="true"]::after {
  content: attr(data-screen-scramble);
  position: absolute;
  z-index: 20;
  inset: 0;
  overflow: hidden;
  color: var(--screen-scramble-color, #c9fff8);
  font: inherit;
  font-variant: inherit;
  font-kerning: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  text-align: inherit;
  text-indent: inherit;
  text-transform: inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.model-card [data-screen-scrambling="true"]::after,
.model-picker [data-screen-scrambling="true"]::after {
  text-shadow: 0 0 0.38rem color-mix(in srgb, var(--screen-scramble-color, #c9fff8) 54%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  [data-screen-scrambling="true"] {
    color: inherit !important;
  }

  [data-screen-scrambling="true"]::after {
    content: none;
  }
}

/* Compact lineage plaque: preserve the portrait instead of covering its left third. */
.model-picker-preview .entity-stage-code {
  position: absolute;
  z-index: 8;
  top: 0.72rem;
  right: auto;
  bottom: auto;
  left: 0.72rem;
  width: auto;
  max-width: calc(100% - 1.44rem);
  min-height: 0;
  padding: 0.38rem 0.72rem 0.34rem 0.82rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--entity-primary, #77d8cf) 40%, transparent);
  border-left: 0.2rem solid var(--entity-secondary, #d4483e);
  background:
    linear-gradient(96deg, rgba(4, 18, 17, 0.9), rgba(8, 20, 19, 0.72) 68%, rgba(8, 20, 19, 0.36)),
    color-mix(in srgb, var(--entity-primary, #77d8cf) 7%, transparent);
  clip-path: polygon(0 0, calc(100% - 0.48rem) 0, 100% 0.48rem, 100% 100%, 0.32rem 100%, 0 calc(100% - 0.32rem));
  box-shadow:
    0 0.55rem 1.1rem rgba(0, 0, 0, 0.42),
    inset 0 0 0.8rem color-mix(in srgb, var(--entity-primary, #77d8cf) 9%, transparent);
  backdrop-filter: blur(0.32rem) saturate(1.15);
  color: #eefaf7;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
  text-align: left;
  text-shadow: 0 0 0.55rem color-mix(in srgb, var(--entity-primary, #77d8cf) 58%, transparent);
  white-space: nowrap;
}

/* Imperial time belongs to the classified location feed, not the conversation. */
.location-chronometer {
  position: absolute;
  z-index: 10;
  top: 0.58rem;
  right: 0.52rem;
  width: 10.9rem;
  min-height: 3.15rem;
  display: grid;
  align-content: center;
  gap: 0.18rem;
  padding: 0.4rem 0.62rem 0.42rem 0.78rem;
  overflow: hidden;
  border-top: 1px solid rgba(137, 229, 219, 0.62);
  border-right: 0.18rem solid rgba(210, 70, 61, 0.82);
  border-bottom: 1px solid rgba(93, 173, 164, 0.32);
  border-left: 1px solid rgba(93, 173, 164, 0.22);
  background:
    linear-gradient(96deg, rgba(4, 20, 20, 0.92), rgba(4, 12, 13, 0.82) 68%, rgba(34, 7, 11, 0.76)),
    repeating-linear-gradient(90deg, transparent 0 1.15rem, rgba(111, 207, 198, 0.04) 1.15rem calc(1.15rem + 1px));
  clip-path: polygon(0 0, calc(100% - 0.5rem) 0, 100% 0.5rem, 100% 100%, 0.32rem 100%, 0 calc(100% - 0.32rem));
  box-shadow: 0 0.72rem 1.35rem rgba(0, 0, 0, 0.58), inset 0 0 1rem rgba(79, 201, 190, 0.06);
  backdrop-filter: blur(0.24rem) saturate(1.1);
}

.location-chronometer::before {
  content: "";
  position: absolute;
  top: 0.44rem;
  left: 0.42rem;
  width: 0.2rem;
  height: 0.2rem;
  background: #e4534d;
  box-shadow: 0 0 0.5rem rgba(228, 83, 77, 0.86);
}

.location-chronometer::after {
  content: "";
  position: absolute;
  right: 0.6rem;
  bottom: 0.28rem;
  left: 0.78rem;
  height: 1px;
  background: linear-gradient(90deg, rgba(103, 217, 206, 0.72), rgba(103, 217, 206, 0.06));
}

.game-status-hud .location-chronometer > span {
  color: rgba(112, 207, 199, 0.68);
  font: 700 0.34rem/1.2 "Cascadia Code", Consolas, monospace;
  letter-spacing: 0;
  text-align: right;
}

.location-chronometer .imperial-clock {
  grid-column: auto;
  grid-row: auto;
  margin: 0;
  overflow: visible;
  color: #f0f2e9;
  font: 750 0.61rem/1.34 "Cascadia Code", Consolas, monospace;
  letter-spacing: 0;
  text-align: right;
  white-space: pre-line;
  text-shadow: 0 0 0.7rem rgba(103, 217, 206, 0.22);
}

.oracle-console .message-time {
  font-size: 0.46rem;
  line-height: 1.2;
  white-space: nowrap;
}

@media (max-width: 780px) {
  .location-chronometer {
    top: 0.38rem;
    right: auto;
    left: 0.4rem;
    width: 7.35rem;
    min-height: 2.55rem;
    padding: 0.3rem 0.46rem 0.34rem 0.58rem;
  }

  .game-status-hud .location-chronometer > span {
    font-size: 0.27rem;
  }

  .location-chronometer .imperial-clock {
    max-width: none;
    font-size: 0.43rem;
    line-height: 1.35;
    white-space: pre-line;
  }
}

/* Final dialogue presentation layer. */
.character-speech {
  top: 13.9rem;
  right: 15.5rem;
  left: calc(50% + 5rem);
  width: auto;
  min-width: 19rem;
  max-width: 31rem;
  max-height: 12.5rem;
  display: block;
  overflow: visible;
  border: 0;
  border-left: 0.16rem solid rgba(111, 231, 219, 0.88);
  border-bottom: 1px solid rgba(111, 202, 193, 0.38);
  background: linear-gradient(100deg, rgba(4, 30, 27, 0.88), rgba(3, 14, 14, 0.76) 68%, rgba(34, 7, 11, 0.58));
  clip-path: polygon(0 0, calc(100% - 0.48rem) 0, 100% 0.48rem, 100% 100%, 0 100%);
  box-shadow: 0 0.8rem 1.8rem rgba(0, 0, 0, 0.34), inset 0 0 1.3rem rgba(70, 188, 176, 0.045);
  backdrop-filter: blur(0.28rem) saturate(1.08);
}

.character-speech::before {
  content: "";
  position: absolute;
  top: 2.65rem;
  left: -5.2rem;
  width: 5.2rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(105, 221, 210, 0.42) 35%, rgba(157, 246, 237, 0.9));
  clip-path: none;
  filter: drop-shadow(0 0 0.28rem rgba(99, 226, 214, 0.42));
  transform: rotate(-7deg);
  transform-origin: right center;
}

.character-speech::after {
  content: "";
  position: absolute;
  top: 2.82rem;
  left: -5.38rem;
  width: 0.28rem;
  height: 0.28rem;
  border: 1px solid rgba(141, 239, 229, 0.78);
  background: rgba(7, 24, 22, 0.82);
  box-shadow: 0 0 0.55rem rgba(97, 230, 217, 0.5);
  transform: rotate(38deg);
}

.character-speech header {
  position: absolute;
  z-index: 2;
  top: 0.52rem;
  right: 1rem;
  left: 1.05rem;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.58rem;
  padding: 0 0 0.38rem;
  border: 0;
  border-bottom: 1px solid rgba(115, 210, 201, 0.18);
  background: transparent;
}

.character-speech header span {
  order: 2;
  color: rgba(118, 211, 203, 0.68);
  font-size: 0.42rem;
}

.character-speech header b {
  order: 1;
  color: #f1f4ed;
  font-size: 0.9rem;
  text-shadow: 0 0 0.7rem rgba(106, 216, 206, 0.18);
}

.character-speech p,
.character-speech p[data-scrambling="true"]::after {
  max-height: 12.5rem;
  margin: 0;
  padding: 2.25rem 1.15rem 0.86rem 1.05rem;
  color: rgba(245, 249, 243, 0.96);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.65;
  text-shadow: 0 1px 0.18rem rgba(0, 0, 0, 0.72);
}

@media (max-width: 1100px) and (min-width: 781px) {
  .character-speech {
    top: 13.4rem;
    right: 13.8rem;
    left: calc(50% + 3.8rem);
    width: auto;
    min-width: 17rem;
    max-width: none;
  }
}

@media (max-width: 780px) {
  .character-speech {
    top: 18.2rem;
    right: 0.72rem;
    left: 5.1rem;
    width: auto;
    min-width: 0;
    max-height: 9.5rem;
    background: linear-gradient(100deg, rgba(4, 30, 27, 0.94), rgba(3, 13, 13, 0.9) 70%, rgba(34, 7, 11, 0.78));
  }

  .character-speech::before {
    top: 2.35rem;
    left: -2.65rem;
    width: 2.65rem;
  }

  .character-speech::after {
    top: 2.47rem;
    left: -2.82rem;
  }

  .character-speech header {
    top: 0.4rem;
    right: 0.7rem;
    left: 0.75rem;
    gap: 0.42rem;
    padding-bottom: 0.28rem;
  }

  .character-speech header span { font-size: 0.32rem; }
  .character-speech header b { font-size: 0.78rem; }

  .character-speech p,
  .character-speech p[data-scrambling="true"]::after {
    max-height: 9.5rem;
    padding: 1.8rem 0.78rem 0.65rem 0.74rem;
    font-size: 0.84rem;
    line-height: 1.55;
  }
}

/* Final conversation layout: one live history line above a compact composer. */
body .run-banner {
  width: min(38rem, calc(100vw - 42rem));
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  gap: 0.68rem;
}

body .run-banner .run-copy {
  min-width: 0;
  display: contents;
}

body .run-banner .run-copy strong {
  color: rgba(138, 220, 212, 0.76);
  font: 750 0.58rem/1 "Cascadia Code", Consolas, monospace;
  white-space: nowrap;
}

body .run-banner .run-copy strong::after {
  content: "/";
  margin-left: 0.68rem;
  color: rgba(184, 157, 87, 0.42);
}

body .run-banner .run-copy span {
  min-width: 0;
  overflow: hidden;
  color: rgba(235, 240, 233, 0.88);
  font-size: 0.76rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body .oracle-console,
body .oracle-console[data-empty="true"] {
  height: 6.8rem;
  grid-template-rows: minmax(0, 1fr);
}

body .oracle-console .messages {
  display: none;
}

body .oracle-console .composer {
  grid-row: 1;
}

@media (min-width: 781px) {
  body .oracle-console,
  body .oracle-console[data-empty="true"] {
    bottom: 3.6rem;
    height: 6.8rem;
    grid-template-rows: minmax(0, 1fr);
  }
}

@media (max-width: 1100px) and (min-width: 781px) {
  body .run-banner {
    width: min(31rem, calc(100vw - 30rem));
  }
}

@media (max-width: 780px) {
  body .run-banner {
    width: calc(100vw - 1.4rem);
    min-width: 0;
    grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  }

  body .run-banner .run-copy strong::after {
    margin-left: 0.42rem;
  }

  body .run-banner .run-copy span {
    font-size: 0.66rem;
  }

  body .oracle-console,
  body .oracle-console[data-empty="true"] {
    bottom: 1.1rem;
    height: 6.2rem;
    grid-template-rows: minmax(0, 1fr);
  }
}

/* Lineage labels stay on one line, including during the scramble reveal. */
.model-picker-preview .entity-stage-code,
.model-picker-preview .entity-stage-code[data-model-scrambling="true"]::after {
  white-space: nowrap;
}

/* Price telemetry: numeric decryption plus an at-a-glance cost heat field. */
.model-picker-preview .price-item {
  --cost-color: #6b817c;
  --cost-level: 0%;
  isolation: isolate;
  background:
    linear-gradient(90deg,
      color-mix(in srgb, var(--cost-color) 30%, transparent) 0,
      color-mix(in srgb, var(--cost-color) 13%, transparent) var(--cost-level),
      transparent calc(var(--cost-level) + 0.1%)),
    linear-gradient(180deg, rgba(13, 19, 17, 0.94), rgba(3, 8, 7, 0.98));
  box-shadow:
    inset 0 -0.2rem 0 color-mix(in srgb, var(--cost-color) 78%, transparent),
    inset 0 0 1.5rem color-mix(in srgb, var(--cost-color) 8%, transparent);
  transition: background 320ms ease, box-shadow 320ms ease;
}

.model-picker-preview .price-item[data-cost-tier="free"] { --cost-color: #63e5d1; }
.model-picker-preview .price-item[data-cost-tier="low"] { --cost-color: #63bdb3; }
.model-picker-preview .price-item[data-cost-tier="standard"] { --cost-color: #c8ad55; }
.model-picker-preview .price-item[data-cost-tier="high"] { --cost-color: #e17653; }
.model-picker-preview .price-item[data-cost-tier="extreme"] { --cost-color: #f13c5c; }
.model-picker-preview .price-item[data-cost-tier="unknown"] { --cost-color: #59635f; }

.model-picker-preview .price-item::before {
  content: attr(data-cost-label);
  position: absolute;
  z-index: 3;
  top: 0.56rem;
  right: 0.62rem;
  padding: 0.13rem 0.32rem;
  border: 1px solid color-mix(in srgb, var(--cost-color) 52%, transparent);
  background: color-mix(in srgb, var(--cost-color) 11%, rgba(2, 7, 6, 0.88));
  color: color-mix(in srgb, var(--cost-color) 78%, #f4f1e7);
  font: 800 0.48rem/1 "Cascadia Code", Consolas, monospace;
  white-space: nowrap;
}

.model-picker-preview .price-item.is-price-scrambling strong,
.model-picker-preview .price-item.is-price-scrambling small {
  text-shadow: 0 0 0.55rem color-mix(in srgb, var(--cost-color) 58%, transparent);
}

.model-picker-preview .price-item[data-price-trend="up"].is-price-syncing::before {
  content: "▲ " attr(data-cost-label);
}

.model-picker-preview .price-item[data-price-trend="down"].is-price-syncing::before {
  content: "▼ " attr(data-cost-label);
}

@media (prefers-reduced-motion: reduce) {
  .model-picker-preview .price-item {
    transition: none;
  }
}

/* Registry navigation: the normal exit is a visible return path, not the close glyph. */
.model-picker-heading {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 1.15rem;
}

.model-picker-title-copy {
  min-width: 0;
}

.model-picker-back {
  position: relative;
  flex: 0 0 auto;
  min-width: 8.6rem;
  min-height: 3.35rem;
  display: grid;
  grid-template-columns: 1.45rem minmax(0, 1fr);
  align-items: center;
  gap: 0.58rem;
  padding: 0.42rem 1rem 0.42rem 0.58rem;
  border: 0;
  border-right: 1px solid rgba(126, 218, 209, 0.38);
  background: linear-gradient(90deg, rgba(20, 75, 68, 0.38), transparent);
  color: #e9f2ec;
  text-align: left;
  clip-path: none;
}

.model-picker-back::after {
  content: "";
  position: absolute;
  right: -0.08rem;
  bottom: 0.22rem;
  width: 0.18rem;
  height: 1.05rem;
  background: #d4483e;
  box-shadow: 0 0 0.65rem rgba(212, 72, 62, 0.28);
}

.model-picker-back svg {
  width: 1.25rem;
  height: 1.25rem;
  color: #7edbd2;
  stroke-width: 1.6;
  filter: drop-shadow(0 0 0.35rem rgba(92, 218, 206, 0.34));
  transition: transform 180ms ease, color 180ms ease;
}

.model-picker-back span {
  min-width: 0;
  display: grid;
  gap: 0.14rem;
}

.model-picker-back strong {
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 0.82rem;
  line-height: 1.1;
  white-space: nowrap;
}

.model-picker-back small {
  color: rgba(126, 205, 198, 0.62);
  font: 700 0.42rem/1 "Cascadia Code", Consolas, monospace;
  white-space: nowrap;
}

.model-picker-back:hover,
.model-picker-back:focus-visible {
  outline: 0;
  background: linear-gradient(90deg, rgba(31, 112, 101, 0.58), rgba(10, 33, 30, 0.12));
  color: #fff;
}

.model-picker-back:hover svg,
.model-picker-back:focus-visible svg {
  color: #d9fff9;
  transform: translateX(-0.22rem);
}

@media (max-width: 780px) {
  .model-picker-heading {
    gap: 0.62rem;
  }

  .model-picker-back {
    min-width: 3.65rem;
    min-height: 2.8rem;
    grid-template-columns: 1rem auto;
    gap: 0.3rem;
    padding: 0.3rem 0.55rem 0.3rem 0.3rem;
  }

  .model-picker-back svg {
    width: 0.95rem;
    height: 0.95rem;
  }

  .model-picker-back strong {
    font-size: 0.68rem;
  }

  .model-picker-back small,
  .model-picker-title-copy .panel-kicker {
    display: none;
  }

  .model-picker-header h2 {
    font-size: 1.25rem;
  }
}

/* Invocation aura: no spotlights, rails, polygon shards, or cross-shaped impact. */
body .spirit-invocation .invocation-depth,
body .spirit-invocation .invocation-script-lanes,
body .spirit-invocation .invocation-shards,
body .spirit-invocation .invocation-impact,
body .spirit-invocation .invocation-beam {
  display: none;
}

body .spirit-invocation .invocation-gate {
  top: 48%;
  width: min(44rem, 76vw);
  height: min(49rem, 84vh);
  overflow: visible;
  border-radius: 46% 54% 49% 51% / 56% 44% 58% 42%;
  filter: drop-shadow(0 0 2.8rem color-mix(in srgb, var(--invocation-primary) 38%, transparent));
  mix-blend-mode: screen;
}

body .spirit-invocation .invocation-gate::before,
body .spirit-invocation .invocation-gate::after,
body .spirit-invocation .invocation-gate i {
  border: 0;
  clip-path: none;
  box-shadow: none;
}

body .spirit-invocation .invocation-gate::before {
  inset: 3% 13%;
  opacity: 0.78;
  border-radius: 43% 57% 48% 52% / 55% 47% 53% 45%;
  background:
    radial-gradient(ellipse at 50% 56%, transparent 0 24%, color-mix(in srgb, var(--invocation-primary) 24%, transparent) 43%, transparent 72%),
    radial-gradient(ellipse at 42% 48%, color-mix(in srgb, var(--invocation-secondary) 18%, transparent), transparent 64%);
  filter: blur(1.3rem) saturate(1.35);
}

body .spirit-invocation .invocation-gate::after {
  inset: 13% 20%;
  opacity: 0.68;
  border-radius: 57% 43% 54% 46% / 44% 58% 42% 56%;
  background:
    radial-gradient(ellipse at 50% 58%, transparent 0 18%, color-mix(in srgb, var(--invocation-tertiary) 22%, transparent) 36%, transparent 68%),
    radial-gradient(ellipse at 58% 46%, color-mix(in srgb, var(--invocation-primary) 28%, transparent), transparent 66%);
  filter: blur(1.8rem);
}

body .spirit-invocation .invocation-gate i {
  position: absolute;
  width: 42%;
  height: 58%;
  opacity: 0.42;
  border-radius: 50%;
  background: radial-gradient(ellipse, color-mix(in srgb, var(--invocation-primary) 32%, transparent), transparent 70%);
  filter: blur(1.7rem);
}

body .spirit-invocation .invocation-gate i:nth-child(1) { top: 10%; right: auto; bottom: auto; left: 4%; transform: rotate(-12deg); }
body .spirit-invocation .invocation-gate i:nth-child(2) { top: 15%; right: 3%; bottom: auto; left: auto; transform: rotate(16deg); }
body .spirit-invocation .invocation-gate i:nth-child(3) { top: auto; right: auto; bottom: 1%; left: 20%; transform: rotate(8deg); }
body .spirit-invocation .invocation-gate i:nth-child(4) { top: auto; right: 16%; bottom: 3%; left: auto; transform: rotate(-10deg); }

body .spirit-invocation.is-active .invocation-gate {
  animation: invocation-aura-manifest var(--invocation-duration) cubic-bezier(0.16, 1, 0.3, 1) both;
}

body .spirit-invocation.is-active .invocation-gate::before {
  animation: invocation-aura-breathe 1.7s ease-in-out 0.15s infinite alternate;
}

body .spirit-invocation.is-active .invocation-gate::after {
  animation: invocation-aura-breathe 2.15s ease-in-out 0.3s infinite alternate-reverse;
}

body .spirit-invocation.is-active .invocation-gate i {
  animation: invocation-aura-lobe 2.4s ease-in-out infinite alternate;
}

body .spirit-invocation.is-active .invocation-gate i:nth-child(2),
body .spirit-invocation.is-active .invocation-gate i:nth-child(4) {
  animation-delay: -1.2s;
}

body .spirit-invocation .invocation-core {
  top: 59%;
  width: min(31rem, 54vw);
  height: min(31rem, 54vw);
  overflow: visible;
  border-radius: 50%;
  filter: blur(0.12rem);
}

body .spirit-invocation .invocation-core::before,
body .spirit-invocation .invocation-core::after {
  border: 0;
  border-radius: 50%;
  clip-path: none;
}

body .spirit-invocation .invocation-core::before {
  inset: 18%;
  background: radial-gradient(circle, rgba(236, 255, 251, 0.64) 0 3%, color-mix(in srgb, var(--invocation-primary) 34%, transparent) 18%, transparent 66%);
  box-shadow: 0 0 4rem color-mix(in srgb, var(--invocation-primary) 28%, transparent);
  filter: blur(0.85rem);
}

body .spirit-invocation .invocation-core::after {
  inset: 4%;
  background: radial-gradient(ellipse, transparent 0 34%, color-mix(in srgb, var(--invocation-secondary) 15%, transparent) 52%, transparent 72%);
  filter: blur(1.5rem);
}

body .spirit-invocation .invocation-core i {
  display: none;
}

body .spirit-invocation.is-active .invocation-core {
  animation: invocation-aura-core var(--invocation-duration) ease both;
}

body .spirit-invocation .invocation-flash {
  background:
    radial-gradient(ellipse at 50% 56%, rgba(239, 255, 252, 0.42), color-mix(in srgb, var(--invocation-primary) 24%, transparent) 24%, transparent 66%),
    radial-gradient(ellipse at 50% 62%, color-mix(in srgb, var(--invocation-secondary) 16%, transparent), transparent 58%);
  filter: blur(1.4rem);
}

body .spirit-invocation.is-active[data-phase] .invocation-flash {
  animation: invocation-aura-flare 0.92s ease-out both;
}

body .spirit-invocation .invocation-particles i,
body .spirit-invocation .invocation-particles i[data-tone] {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0.8rem currentColor, 0 0 1.8rem color-mix(in srgb, currentColor 48%, transparent);
  filter: blur(0.03rem);
  transform: scale(0.35);
}

body .spirit-invocation.is-active .invocation-particles i {
  animation: invocation-aura-mote var(--particle-duration) cubic-bezier(0.32, 0, 0.2, 1) calc(420ms + var(--particle-delay)) both;
}

@keyframes invocation-aura-manifest {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.35); filter: blur(2rem); }
  16% { opacity: 0.42; }
  42% { opacity: 0.92; transform: translate(-50%, -50%) scale(1); filter: blur(0.25rem); }
  72% { opacity: 0.78; transform: translate(-50%, -50%) scale(0.92); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); filter: blur(1.5rem); }
}

@keyframes invocation-aura-breathe {
  from { opacity: 0.38; transform: scale(0.92) rotate(-2deg); filter: blur(1.8rem) saturate(1.1); }
  to { opacity: 0.9; transform: scale(1.08) rotate(2deg); filter: blur(1rem) saturate(1.5); }
}

@keyframes invocation-aura-lobe {
  from { opacity: 0.18; scale: 0.86; filter: blur(2.2rem); }
  to { opacity: 0.58; scale: 1.12; filter: blur(1.35rem); }
}

@keyframes invocation-aura-core {
  0%, 18% { opacity: 0; transform: translate(-50%, -50%) scale(0.35); }
  44% { opacity: 0.82; transform: translate(-50%, -50%) scale(1.08); }
  68% { opacity: 0.64; transform: translate(-50%, -50%) scale(0.92); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.58); filter: blur(1.8rem); }
}

@keyframes invocation-aura-flare {
  0% { opacity: 0; transform: scale(0.78); }
  36% { opacity: 0.68; transform: scale(1.04); }
  100% { opacity: 0; transform: scale(1.3); }
}

@keyframes invocation-aura-mote {
  0% { opacity: 0; transform: translate(0, 0) scale(0.25); }
  18% { opacity: 0.72; }
  72% { opacity: 0.9; transform: translate(calc(var(--particle-x) * 0.82), calc(var(--particle-y) * 0.82)) scale(1.18); }
  100% { opacity: 0; transform: translate(var(--particle-x), var(--particle-y)) scale(0.08); }
}

/* The summoned portrait dissolves on every edge so its source rectangle never becomes a light pillar. */
body .spirit-invocation .invocation-spirit {
  overflow: visible;
  -webkit-mask-image: radial-gradient(ellipse closest-side at 50% 52%, #000 0 42%, rgba(0, 0, 0, 0.9) 58%, rgba(0, 0, 0, 0.32) 78%, transparent 100%);
  mask-image: radial-gradient(ellipse closest-side at 50% 52%, #000 0 42%, rgba(0, 0, 0, 0.9) 58%, rgba(0, 0, 0, 0.32) 78%, transparent 100%);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

body .spirit-invocation .invocation-spirit img {
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.18) 10%, #000 25% 72%, rgba(0, 0, 0, 0.22) 90%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.18) 10%, #000 25% 72%, rgba(0, 0, 0, 0.22) 90%, transparent 100%);
}

/* MITRA dialogue starts beside the avatar and can be moved by its nameplate. */
body .character-speech {
  top: var(--speech-top, clamp(9rem, 16vh, 11rem));
  right: var(--speech-right, auto);
  left: var(--speech-left, calc(50% + 8rem));
  width: clamp(27rem, 36vw, 40rem);
  min-width: 0;
  max-width: none;
  min-height: 3.8rem;
  height: var(--speech-height, 3.8rem);
  max-height: 15rem;
  display: grid;
  grid-template-columns: 5.7rem minmax(0, 1fr);
  overflow: hidden;
  border: 0;
  border-top: 1px solid rgba(138, 225, 216, 0.48);
  border-right: 0.24rem solid rgba(113, 220, 210, 0.82);
  border-bottom: 1px solid rgba(93, 164, 157, 0.38);
  border-left: 0.16rem solid rgba(212, 72, 62, 0.72);
  background: linear-gradient(102deg, rgba(5, 27, 25, 0.96), rgba(3, 13, 13, 0.94) 62%, rgba(27, 8, 12, 0.92));
  clip-path: polygon(0.52rem 0, 100% 0, 100% 100%, 0 100%, 0 calc(100% - 0.52rem));
  box-shadow: -0.9rem 0.8rem 2rem rgba(0, 0, 0, 0.42), inset -1rem 0 1.4rem rgba(95, 211, 200, 0.035);
  backdrop-filter: blur(0.34rem) saturate(1.08);
  transform-origin: left top;
  transition: height 420ms cubic-bezier(0.16, 1, 0.3, 1), background 180ms ease, opacity 180ms ease;
}

body .character-speech.is-height-probe {
  position: fixed !important;
  top: 0 !important;
  right: auto !important;
  left: -10000px !important;
  height: auto !important;
  max-height: 15rem !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transition: none !important;
}

body .character-speech::before,
body .character-speech::after {
  content: none;
  display: none;
}

body .character-speech header {
  position: relative;
  inset: auto;
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 0.18rem;
  padding: 0.65rem 0.72rem 0.62rem 0.88rem;
  border: 0;
  border-right: 1px solid rgba(111, 204, 195, 0.18);
  border-bottom: 0;
  background: rgba(8, 35, 31, 0.58);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

body .character-speech header::after {
  content: "MOVE";
  position: absolute;
  right: 0.48rem;
  bottom: 0.28rem;
  color: rgba(123, 219, 210, 0.42);
  font: 700 0.28rem/1 "Cascadia Code", Consolas, monospace;
  letter-spacing: 0.08em;
}

body .character-speech header:focus-visible {
  outline: 1px solid rgba(142, 235, 226, 0.74);
  outline-offset: -0.2rem;
}

body .character-speech.is-dragging,
body .character-speech.is-dragging header {
  cursor: grabbing;
  transition: none;
  user-select: none;
}

body .character-speech header span {
  order: 2;
  overflow: hidden;
  color: rgba(115, 206, 198, 0.6);
  font: 700 0.43rem/1 "Cascadia Code", Consolas, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body .character-speech header b {
  order: 1;
  overflow: hidden;
  color: #eef4ed;
  font-size: 1rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body .character-speech p,
body .character-speech p[data-scrambling="true"]::after {
  min-width: 0;
  max-height: 12rem;
  margin: 0;
  padding: 0.83rem 1rem 0.86rem;
  overflow-x: hidden;
  overflow-y: auto;
  color: rgba(244, 248, 242, 0.94);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.62;
  overflow-wrap: anywhere;
  text-overflow: clip;
  text-shadow: 0 1px 0.18rem rgba(0, 0, 0, 0.72);
  white-space: pre-wrap;
}

body .character-speech[data-streaming="true"],
body .character-speech:has(#character-speech-text[data-scrambling="true"]),
body .character-speech:hover,
body .character-speech:focus-visible {
  background: linear-gradient(102deg, rgba(7, 38, 34, 0.98), rgba(3, 15, 14, 0.97) 62%, rgba(35, 8, 13, 0.96));
  outline: 0;
}

body .character-speech[data-streaming="true"] p,
body .character-speech:has(#character-speech-text[data-scrambling="true"]) p,
body .character-speech:hover p,
body .character-speech:focus-visible p,
body .character-speech[data-streaming="true"] p[data-scrambling="true"]::after,
body .character-speech:has(#character-speech-text[data-scrambling="true"]) p[data-scrambling="true"]::after,
body .character-speech:hover p[data-scrambling="true"]::after,
body .character-speech:focus-visible p[data-scrambling="true"]::after {
  max-height: 12rem;
  overflow-x: hidden;
  overflow-y: auto;
  text-overflow: clip;
  white-space: pre-wrap;
}

body .character-speech #character-speech-text[data-scrambling="true"] {
  color: #d9fff8;
  text-shadow: 0 0 0.48rem rgba(99, 231, 217, 0.42), 0 1px 0.18rem rgba(0, 0, 0, 0.76);
}

body .character-speech #character-speech-text[data-scrambling="true"]::after {
  content: none;
  display: none;
}

@media (max-width: 1100px) and (min-width: 781px) {
  body .character-speech {
    top: var(--speech-top, clamp(8.5rem, 16vh, 10.5rem));
    right: var(--speech-right, 0.75rem);
    left: var(--speech-left, auto);
    width: min(27rem, calc(100vw - 30rem));
    min-width: 17rem;
  }
}

@media (max-width: 780px) {
  body .character-speech {
    top: 10.95rem;
    right: 0.55rem;
    left: 0.55rem;
    width: auto;
    min-width: 0;
    min-height: 3.05rem;
    height: var(--speech-height, 3.05rem);
    max-height: 8.5rem;
    grid-template-columns: 4.4rem minmax(0, 1fr);
    border-right-width: 0.16rem;
  }

  body .character-speech header {
    padding: 0.45rem 0.5rem 0.42rem 0.62rem;
  }

  body .character-speech header span { font-size: 0.3rem; }
  body .character-speech header b { font-size: 0.68rem; }

  body .character-speech p,
  body .character-speech p[data-scrambling="true"]::after {
    padding: 0.62rem 0.68rem;
    font-size: 0.82rem;
    line-height: 1.45;
  }

  body .character-speech[data-streaming="true"],
  body .character-speech:has(#character-speech-text[data-scrambling="true"]),
  body .character-speech:hover,
  body .character-speech:focus-visible {
    max-height: 8.5rem;
  }

  body .character-speech.is-height-probe {
    max-height: 8.5rem !important;
  }

  body .game-status-hud { top: 14.35rem; }
  body .vrm-contract-status { top: 18.55rem; }
  body .run-banner { top: 20.3rem; }
}

/* The docked subtitle owns the idle line; the run strip appears only for live operations. */
body .run-banner[data-state="idle"],
body .run-banner[data-state="complete"] {
  opacity: 0;
  pointer-events: none;
}

body .run-banner[data-state="sending"],
body .run-banner[data-state="waiting"],
body .run-banner[data-state="thinking"],
body .run-banner[data-state="streaming"],
body .run-banner[data-state="error"],
body .run-banner[data-state="stopped"] {
  opacity: 1;
}

@media (min-width: 1101px) {
  body .run-banner {
    right: calc(14.9rem + clamp(27rem, 36vw, 40rem));
    left: 25.5rem;
    width: auto;
    min-width: 0;
    transform: none;
  }
}

@media (max-width: 1100px) and (min-width: 781px) {
  body .run-banner {
    top: 12.35rem;
    width: min(28rem, calc(100vw - 30rem));
  }
}

/* The legacy transcript stays as an internal data sink and can never re-enter the stage. */
#messages[hidden],
body .oracle-console #messages[hidden],
body .oracle-console #messages[hidden]::before,
body .oracle-console #messages[hidden]::after {
  content: none !important;
  display: none !important;
}

/* The compact history strip is also the direct entry point to the response archive. */
body .run-banner,
body .run-banner[data-state="idle"],
body .run-banner[data-state="complete"] {
  opacity: 1;
  cursor: pointer;
  pointer-events: auto;
}

body .run-banner:hover,
body .run-banner:focus-visible,
body .run-banner.is-log-open {
  border-top-color: rgba(139, 232, 222, 0.86);
  border-bottom-color: rgba(139, 232, 222, 0.52);
  background: linear-gradient(90deg, rgba(4, 25, 23, 0.96), rgba(5, 15, 14, 0.94) 72%, rgba(43, 9, 14, 0.9));
  box-shadow: inset 0 -0.12rem rgba(108, 218, 207, 0.34), 0 0 1.2rem rgba(92, 210, 199, 0.12);
  outline: 0;
}

body .run-banner:hover .run-indicator,
body .run-banner:focus-visible .run-indicator,
body .run-banner.is-log-open .run-indicator {
  border-color: #9cebe2;
  box-shadow: 0 0 0.7rem rgba(111, 225, 214, 0.46);
}

/* Expanded dialogue owns this layer; the fusion lane yields until it collapses again. */
.fusion-slots {
  transition: opacity 180ms ease, visibility 180ms ease, transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

body:has(.character-speech[data-streaming="true"]) .fusion-slots,
body:has(.character-speech #character-speech-text[data-scrambling="true"]) .fusion-slots,
body:has(.character-speech:hover) .fusion-slots,
body:has(.character-speech:focus-visible) .fusion-slots {
  visibility: hidden;
  opacity: 0;
  transform: translateY(0.55rem);
  pointer-events: none;
}

/* Scrambled lineage text occupies the exact same padded box as the settled label. */
.model-picker-preview .entity-stage-code[data-model-scrambling="true"]::after {
  padding: 0.38rem 0.72rem 0.34rem 0.82rem;
}

/* Final location order: description above, map below. */
/* The timestamp is part of the cartography, never a floating card. */
.location-map .location-chronometer {
  top: 0.52rem;
  right: 0.58rem;
  bottom: auto;
  left: auto;
  width: auto;
  min-width: 10.6rem;
  min-height: 0;
  display: grid;
  justify-items: end;
  align-content: start;
  gap: 0.08rem;
  padding: 0.14rem 0.34rem 0.34rem 1.5rem;
  overflow: visible;
  border: 0;
  background: linear-gradient(90deg, transparent, rgba(1, 8, 9, 0.5) 44%, rgba(1, 7, 8, 0.78));
  clip-path: none;
  box-shadow: none;
  backdrop-filter: none;
}

.location-map .location-chronometer::before { top: 0.25rem; right: auto; left: 1.1rem; width: 0.18rem; height: 0.18rem; }
.location-map .location-chronometer::after { right: 0.34rem; bottom: 0.18rem; left: 1.1rem; }
.location-map .location-chronometer > span { color: rgba(115, 211, 202, 0.66); font: 700 0.3rem/1.1 "Cascadia Code", Consolas, monospace; }
.location-map .location-chronometer .imperial-clock { display: flex; align-items: baseline; justify-content: flex-end; gap: 0.46rem; margin: 0; line-height: 1; white-space: nowrap; }
.location-map .location-chronometer .imperial-clock b,
.location-map .location-chronometer .imperial-clock small,
.location-map .location-chronometer .imperial-clock strong { display: inline; margin: 0; overflow: visible; font-family: "Cascadia Code", Consolas, monospace; line-height: 1; white-space: nowrap; }
.location-map .location-chronometer .imperial-clock b { color: #e8eee8; font-size: 0.66rem; font-weight: 800; }
.location-map .location-chronometer .imperial-clock small { color: rgba(183, 215, 207, 0.72); font-size: 0.42rem; font-weight: 700; }
.location-map .location-chronometer .imperial-clock strong { color: #9be2da; font-size: 0.64rem; font-weight: 800; font-variant-numeric: tabular-nums; }

@media (max-width: 780px) {
  .location-map .location-chronometer { top: 0.18rem; right: 0.32rem; left: auto; min-width: 9rem; padding: 0.08rem 0.22rem 0.26rem 1rem; }
  .location-map .location-chronometer::before { left: 0.7rem; }
  .location-map .location-chronometer::after { right: 0.22rem; left: 0.7rem; }
  .location-map .location-chronometer > span { font-size: 0.24rem; }
  .location-map .location-chronometer .imperial-clock { gap: 0.32rem; }
  .location-map .location-chronometer .imperial-clock b { font-size: 0.48rem; }
  .location-map .location-chronometer .imperial-clock small { font-size: 0.34rem; }
  .location-map .location-chronometer .imperial-clock strong { font-size: 0.48rem; }
}

/* Desktop left rail: status telemetry and command navigation share one panel. */
@media (min-width: 781px) {
  .left-control-panel {
    position: fixed;
    z-index: 32;
    top: 7.6rem;
    left: 1.6rem;
    width: var(--mansion-left);
    max-height: calc(100vh - 8.9rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-top: 1px solid rgba(126, 205, 200, 0.42);
    border-right: 0.35rem solid var(--tokyo-red);
    border-bottom: 1px solid rgba(212, 72, 62, 0.58);
    border-left: 0.35rem solid var(--tokyo-cyan);
    background-color: rgba(4, 8, 7, 0.96);
    background-image:
      linear-gradient(90deg, rgba(8, 14, 13, 0.95), rgba(3, 7, 6, 0.98)),
      url("/assets/mansion-panel-v2.webp");
    background-size: cover, 48rem 48rem;
    background-blend-mode: normal, soft-light;
    box-shadow: 0 1.4rem 3rem rgba(0, 0, 0, 0.64);
    clip-path: polygon(0 0, calc(100% - 0.9rem) 0, 100% 0.9rem, 100% 100%, 0 100%);
    pointer-events: none;
    transition: opacity 260ms ease, transform 360ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  .left-control-panel .game-status-hud {
    position: relative;
    inset: auto;
    z-index: 1;
    width: 100%;
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    box-shadow: none;
    clip-path: none;
    transform: none;
  }

  .left-control-panel .game-command-menu {
    position: relative;
    inset: auto;
    z-index: 2;
    width: 100%;
    flex: 0 0 auto;
    margin: 0;
    padding: 0.42rem 0 0.35rem;
    border: 0;
    border-top: 1px solid rgba(126, 205, 200, 0.36);
    background: linear-gradient(180deg, rgba(4, 15, 14, 0.46), rgba(2, 6, 6, 0.74));
    box-shadow: inset 0 0.8rem 1.4rem rgba(0, 0, 0, 0.22);
    clip-path: none;
    pointer-events: auto;
    transform: none;
  }

  .left-control-panel .game-command-menu::before,
  .left-control-panel .game-command-menu::after {
    left: 0.75rem;
    width: calc(100% - 1.5rem);
  }

  .left-control-panel .game-command-menu button:hover,
  .left-control-panel .game-command-menu button:focus-visible,
  .left-control-panel .game-command-menu button.is-active {
    transform: translateX(0.25rem);
  }

  body:not([data-game-panel="none"]) .left-control-panel {
    opacity: 0.18;
    pointer-events: none;
  }

  body:not([data-game-panel="none"]) .left-control-panel .game-status-hud,
  body:not([data-game-panel="none"]) .left-control-panel .game-command-menu,
  body[data-game-panel="settings"] .left-control-panel .game-status-hud,
  body[data-game-panel="settings"] .left-control-panel .game-command-menu,
  body[data-game-panel="records"] .left-control-panel .game-status-hud,
  body[data-game-panel="records"] .left-control-panel .game-command-menu {
    opacity: 1;
    transform: none;
  }

  body[data-game-panel="settings"] .left-control-panel {
    transform: translateX(1rem);
  }

  body[data-game-panel="records"] .left-control-panel {
    transform: translateX(-1rem);
  }
}

@media (min-width: 1200px) {
  .left-control-panel {
    width: 22rem;
  }
}

@media (max-height: 720px) and (min-width: 781px) {
  .left-control-panel {
    top: 5.25rem;
    width: 18.5rem;
    max-height: none;
    transform: scale(0.82);
    transform-origin: top left;
  }

  .left-control-panel .game-status-hud,
  .left-control-panel .game-command-menu {
    transform: none;
  }
}

@media (max-width: 780px) {
  .left-control-panel {
    display: contents;
  }
}

/* Final clock treatment after the unified left-rail overrides. */
.location-map .location-chronometer {
  top: 0.48rem;
  right: 0.48rem;
  bottom: auto;
  left: auto;
  width: auto;
  min-width: 12.4rem;
  min-height: 0;
  display: grid;
  justify-items: stretch;
  align-content: start;
  gap: 0.28rem;
  padding: 0.4rem 0.55rem 0.46rem 0.68rem;
  overflow: hidden;
  border: 1px solid rgba(99, 151, 145, 0.28);
  border-right: 0.18rem solid rgba(137, 39, 47, 0.78);
  border-left: 0.18rem solid rgba(102, 190, 181, 0.76);
  background: linear-gradient(104deg, rgba(2, 10, 10, 0.94), rgba(3, 8, 8, 0.97) 72%, rgba(23, 7, 10, 0.94));
  box-shadow: 0 0.55rem 1rem rgba(0, 0, 0, 0.46), inset 0 1px rgba(177, 225, 216, 0.07);
  backdrop-filter: blur(0.22rem);
  clip-path: polygon(0 0, calc(100% - 0.42rem) 0, 100% 0.42rem, 100% 100%, 0 100%);
}

.location-map .location-chronometer::before {
  content: none;
  display: none;
}

.location-map .location-chronometer::after {
  right: 0.55rem;
  bottom: 0.28rem;
  left: 0.68rem;
  background: linear-gradient(90deg, rgba(177, 146, 69, 0.5), rgba(101, 180, 172, 0.18), transparent);
}

.game-status-hud .location-map .location-chronometer > span {
  color: rgba(125, 190, 182, 0.64);
  font: 750 0.34rem/1 "Cascadia Code", Consolas, monospace;
  letter-spacing: 0.08em;
  text-align: left;
}

.location-map .location-chronometer .imperial-clock {
  min-width: 0;
  display: grid;
  grid-template-columns: auto auto minmax(4.8rem, 1fr);
  align-items: baseline;
  justify-content: stretch;
  gap: 0;
  margin: 0;
  padding-top: 0.28rem;
  border-top: 1px solid rgba(101, 168, 160, 0.18);
  line-height: 1;
  white-space: nowrap;
}

.location-map .location-chronometer .imperial-clock b,
.location-map .location-chronometer .imperial-clock small,
.location-map .location-chronometer .imperial-clock strong {
  display: block;
  margin: 0;
  overflow: visible;
  font-family: "Cascadia Code", Consolas, monospace;
  line-height: 1;
  white-space: nowrap;
}

.location-map .location-chronometer .imperial-clock b {
  padding-right: 0.48rem;
  color: rgba(220, 225, 216, 0.82);
  font-size: 0.66rem;
  font-weight: 750;
}

.location-map .location-chronometer .imperial-clock small {
  padding: 0 0.48rem;
  border-left: 1px solid rgba(102, 174, 166, 0.24);
  color: rgba(175, 196, 188, 0.62);
  font-size: 0.52rem;
  font-weight: 650;
}

.location-map .location-chronometer .imperial-clock strong {
  justify-self: end;
  color: #a5ddd6;
  font-size: 0.92rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  text-shadow: 0 0 0.55rem rgba(103, 201, 191, 0.2);
}

@media (min-width: 781px) {
  body .oracle-console,
  body .oracle-console[data-empty="true"] {
    bottom: 5rem;
  }
}

@media (max-width: 780px) {
  .location-map .location-chronometer {
    top: 0.24rem;
    right: 0.28rem;
    min-width: 10.4rem;
    padding: 0.3rem 0.4rem 0.36rem 0.5rem;
  }

  .game-status-hud .location-map .location-chronometer > span { font-size: 0.26rem; }
  .location-map .location-chronometer .imperial-clock { grid-template-columns: auto auto minmax(3.8rem, 1fr); padding-top: 0.22rem; }
  .location-map .location-chronometer .imperial-clock b { padding-right: 0.34rem; font-size: 0.5rem; }
  .location-map .location-chronometer .imperial-clock small { padding-inline: 0.34rem; font-size: 0.4rem; }
  .location-map .location-chronometer .imperial-clock strong { font-size: 0.7rem; }

  body .oracle-console,
  body .oracle-console[data-empty="true"] {
    bottom: 1.6rem;
  }
}

/* Classified location dossier: region, facility and live isolation state. */
body .left-control-panel .game-status-hud .location-intel {
  position: relative;
  isolation: isolate;
  min-height: 0;
  display: block;
  padding: 0.68rem 0.78rem 0.7rem 0.92rem;
  overflow: hidden;
  border-top: 1px solid rgba(118, 205, 195, 0.28);
  border-right: 0.18rem solid rgba(126, 35, 44, 0.78);
  border-bottom: 1px solid rgba(131, 190, 181, 0.42);
  border-left: 0.18rem solid rgba(111, 204, 194, 0.86);
  background:
    linear-gradient(108deg, rgba(4, 20, 19, 0.98), rgba(2, 9, 9, 0.99) 58%, rgba(31, 6, 10, 0.97)),
    repeating-linear-gradient(90deg, transparent 0 2.8rem, rgba(104, 173, 165, 0.035) 2.8rem calc(2.8rem + 1px));
  box-shadow: inset 0 1px rgba(214, 242, 233, 0.07), inset 0 -1.5rem 2.6rem rgba(0, 0, 0, 0.22), 0 0.7rem 1.3rem rgba(0, 0, 0, 0.46);
}

body .left-control-panel .game-status-hud .location-intel::before {
  content: "KUNADO NODE / SECTOR Q1";
  position: absolute;
  z-index: 0;
  top: 0.48rem;
  right: 0.66rem;
  bottom: auto;
  color: rgba(108, 183, 175, 0.24);
  font: 750 0.34rem/1 "Cascadia Code", Consolas, monospace;
  letter-spacing: 0.08em;
}

body .left-control-panel .game-status-hud .location-intel::after {
  content: "Q1";
  position: absolute;
  z-index: -1;
  top: 1.3rem;
  right: 0.35rem;
  color: rgba(132, 215, 205, 0.055);
  font: 900 4.8rem/0.9 "Cascadia Code", Consolas, monospace;
  letter-spacing: -0.12em;
  pointer-events: none;
}

body .left-control-panel .game-status-hud .location-intel-head {
  position: relative;
  z-index: 2;
  min-height: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0 0 0.48rem;
  padding: 0 5.8rem 0.38rem 0;
  border-bottom: 1px solid rgba(101, 173, 165, 0.22);
}

body .left-control-panel .game-status-hud .location-intel-head span {
  color: #78c7bf;
  font: 760 0.42rem/1 "Cascadia Code", Consolas, monospace;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

body .left-control-panel .game-status-hud .location-intel-head b {
  position: absolute;
  top: -0.06rem;
  right: 0;
  padding: 0.16rem 0.34rem;
  border: 1px solid rgba(198, 164, 76, 0.5);
  background: rgba(34, 25, 8, 0.5);
  color: #dfc36f;
  font: 800 0.4rem/1 "Cascadia Code", Consolas, monospace;
  box-shadow: inset 0 -0.12rem rgba(143, 37, 44, 0.46);
}

body .left-control-panel .game-status-hud .location-intel > strong {
  position: relative;
  z-index: 2;
  width: 100%;
  display: grid;
  gap: 0.08rem;
  margin: 0;
  color: #f0eee3;
  font-size: 1.32rem;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: none;
}

body .left-control-panel .game-status-hud .location-region {
  min-width: 0;
  display: block;
  color: rgba(221, 226, 217, 0.82);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 0.94rem;
  font-weight: 650;
  line-height: 1.2;
}

body .left-control-panel .game-status-hud .location-name {
  position: relative;
  width: max-content;
  max-width: 100%;
  padding: 0.04rem 1.6rem 0.25rem 0;
  color: #f4f1e6;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: 1.42rem;
  font-weight: 750;
  line-height: 1.22;
  letter-spacing: 0.035em;
  text-shadow: 0 0 0.9rem rgba(111, 202, 193, 0.16);
  white-space: nowrap;
}

body .left-control-panel .game-status-hud .location-name::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, #b29345, rgba(104, 190, 181, 0.34) 62%, transparent);
}

body .left-control-panel .game-status-hud .location-reading {
  width: max-content;
  max-width: 100%;
  margin-top: 0.12rem;
  color: rgba(123, 198, 190, 0.68);
  font: 760 0.5rem/1.2 "Yu Gothic UI", Meiryo, sans-serif;
  letter-spacing: 0.16em;
  white-space: nowrap;
}

body .left-control-panel .game-status-hud .location-meta {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  margin: 0.52rem 0 0;
  padding: 0.38rem 0.46rem;
  border-top: 1px solid rgba(96, 157, 150, 0.14);
  border-bottom: 1px solid rgba(96, 157, 150, 0.14);
  background: rgba(0, 5, 5, 0.34);
}

body .left-control-panel .game-status-hud .location-meta small {
  margin: 0;
  color: rgba(171, 192, 184, 0.52);
  font: 650 0.34rem/1.2 "Cascadia Code", Consolas, monospace;
  white-space: nowrap;
}

body .left-control-panel .game-status-hud .location-state {
  position: relative;
  z-index: 2;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.38rem;
  margin: 0.42rem 0 0;
  padding: 0;
  border: 0;
}

body .left-control-panel .game-status-hud .location-state i {
  width: 0.32rem;
  height: 0.32rem;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 156, 142, 0.72);
  background: #b9363d;
  box-shadow: 0 0 0.5rem rgba(185, 54, 61, 0.54);
  transform: rotate(45deg);
}

body .left-control-panel .game-status-hud .location-state span,
body .left-control-panel .game-status-hud .location-state b {
  color: rgba(198, 91, 91, 0.78);
  font: 750 0.36rem/1 "Cascadia Code", Consolas, monospace;
  letter-spacing: 0.03em;
}

body .left-control-panel .game-status-hud .location-state b {
  margin-left: auto;
  color: #71c3ba;
}

@media (max-width: 780px) {
  body .left-control-panel .game-status-hud .location-intel {
    min-height: 0;
    display: flex;
    align-items: center;
    padding: 0.3rem 0.52rem;
  }

  body .left-control-panel .game-status-hud .location-intel::before,
  body .left-control-panel .game-status-hud .location-intel::after,
  body .left-control-panel .game-status-hud .location-intel-head,
  body .left-control-panel .game-status-hud .location-meta,
  body .left-control-panel .game-status-hud .location-state {
    display: none;
  }

  body .left-control-panel .game-status-hud .location-intel > strong {
    display: flex;
    align-items: baseline;
    gap: 0.28rem;
    font-size: 0.68rem;
  }

  body .left-control-panel .game-status-hud .location-region,
  body .left-control-panel .game-status-hud .location-name {
    display: inline;
    padding: 0;
    font-size: 0.68rem;
    line-height: 1.16;
    white-space: nowrap;
  }

  body .left-control-panel .game-status-hud .location-name::after,
  body .left-control-panel .game-status-hud .location-reading {
    display: none;
  }

  body .left-control-panel .game-status-hud .location-region::after {
    content: "/";
    margin-left: 0.28rem;
    color: rgba(114, 191, 183, 0.48);
  }
}

/* Live projection of the currently descended external intelligence. */
.active-entity-card {
  --entity-glow: #78d4cb;
  --entity-accent: #b93a43;
  position: fixed;
  z-index: 29;
  top: clamp(15rem, 27vh, 23rem);
  left: max(calc(var(--mansion-left) + 4.2rem), calc(50% - 27rem));
  width: 14.5rem;
  height: 19rem;
  display: grid;
  grid-template-rows: 2.2rem minmax(0, 1fr) 3.6rem;
  overflow: hidden;
  border-top: 1px solid color-mix(in srgb, var(--entity-glow) 58%, transparent);
  border-right: 0.18rem solid color-mix(in srgb, var(--entity-accent) 78%, transparent);
  border-bottom: 1px solid rgba(183, 151, 71, 0.42);
  border-left: 0.18rem solid color-mix(in srgb, var(--entity-glow) 78%, transparent);
  background:
    linear-gradient(180deg, rgba(4, 15, 14, 0.72), rgba(1, 6, 6, 0.34) 56%, rgba(22, 5, 8, 0.82)),
    repeating-linear-gradient(90deg, transparent 0 2.4rem, color-mix(in srgb, var(--entity-glow) 4%, transparent) 2.4rem calc(2.4rem + 1px));
  box-shadow: 0 1.4rem 3.4rem rgba(0, 0, 0, 0.58), inset 0 0 2.4rem rgba(0, 0, 0, 0.24);
  clip-path: polygon(0 0, calc(100% - 0.65rem) 0, 100% 0.65rem, 100% 100%, 0.65rem 100%, 0 calc(100% - 0.65rem));
  pointer-events: none;
  transition: opacity 220ms ease, transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.active-entity-card[data-archetype="router"] { --entity-glow: #76d7ce; --entity-accent: #c53d45; }
.active-entity-card[data-archetype="multimodal"] { --entity-glow: #6bbdc4; --entity-accent: #a4455d; }
.active-entity-card[data-archetype="code"] { --entity-glow: #d2b759; --entity-accent: #9d303b; }
.active-entity-card[data-archetype="agent"] { --entity-glow: #ba7864; --entity-accent: #7ec8c0; }
.active-entity-card[data-archetype="reason"] { --entity-glow: #d8ddd4; --entity-accent: #9b3542; }
.active-entity-card[data-archetype="general"] { --entity-glow: #899f99; --entity-accent: #a23b43; }

.active-entity-card::before {
  content: "01 / ACTIVE CONTRACT";
  position: absolute;
  z-index: 4;
  top: 2.7rem;
  left: 0.58rem;
  color: color-mix(in srgb, var(--entity-glow) 62%, transparent);
  font: 750 0.34rem/1 "Cascadia Code", Consolas, monospace;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
}

.active-entity-card > header {
  position: relative;
  z-index: 4;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.52rem 0.65rem 0.42rem 0.78rem;
  border-bottom: 1px solid color-mix(in srgb, var(--entity-glow) 28%, transparent);
  background: linear-gradient(90deg, color-mix(in srgb, var(--entity-glow) 12%, rgba(3, 13, 12, 0.94)), rgba(3, 9, 9, 0.92));
}

.active-entity-card > header span {
  min-width: 0;
  overflow: hidden;
  color: color-mix(in srgb, var(--entity-glow) 78%, #dce5df);
  font: 750 0.38rem/1 "Cascadia Code", Consolas, monospace;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-entity-card > header b {
  flex: 0 0 auto;
  padding: 0.14rem 0.3rem;
  border: 1px solid color-mix(in srgb, var(--entity-glow) 46%, transparent);
  color: #e3cf8a;
  background: rgba(16, 12, 5, 0.52);
  font: 800 0.36rem/1 "Cascadia Code", Consolas, monospace;
}

.active-entity-visual {
  position: relative;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 48%, color-mix(in srgb, var(--entity-glow) 18%, transparent), transparent 48%),
    linear-gradient(180deg, rgba(1, 8, 8, 0.78), rgba(1, 5, 5, 0.24));
}

.active-entity-visual::before,
.active-entity-visual::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 10% 12%;
  border: 1px solid color-mix(in srgb, var(--entity-glow) 32%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 1.6rem color-mix(in srgb, var(--entity-glow) 10%, transparent);
}

.active-entity-visual::after {
  inset: 20% 21%;
  border-style: dashed;
  opacity: 0.58;
  animation: active-entity-orbit 18s linear infinite;
}

.active-entity-visual > i {
  position: absolute;
  z-index: 2;
  background: color-mix(in srgb, var(--entity-glow) 62%, transparent);
  box-shadow: 0 0 0.6rem color-mix(in srgb, var(--entity-glow) 38%, transparent);
}

.active-entity-visual > i:nth-child(1) { top: 50%; right: 8%; left: 8%; height: 1px; }
.active-entity-visual > i:nth-child(2) { top: 8%; bottom: 8%; left: 50%; width: 1px; }
.active-entity-visual > i:nth-child(3) {
  top: -18%;
  right: 0;
  left: 0;
  height: 12%;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--entity-glow) 42%, transparent), transparent);
  box-shadow: none;
  animation: active-entity-scan 4.4s linear infinite;
}

.active-entity-visual img {
  position: relative;
  z-index: 3;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center bottom;
  opacity: 0.86;
  filter: grayscale(0.42) sepia(0.16) hue-rotate(116deg) saturate(0.72) contrast(1.14) drop-shadow(0 0 0.8rem color-mix(in srgb, var(--entity-glow) 36%, transparent));
  mix-blend-mode: screen;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 12%, #000 78%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 12%, #000 78%, transparent 100%);
}

.active-entity-card > footer {
  position: relative;
  z-index: 4;
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 0.3rem;
  padding: 0.48rem 0.68rem 0.52rem 0.82rem;
  border-top: 1px solid color-mix(in srgb, var(--entity-glow) 34%, transparent);
  background: linear-gradient(96deg, rgba(3, 15, 14, 0.97), rgba(3, 8, 8, 0.98) 66%, color-mix(in srgb, var(--entity-accent) 22%, rgba(15, 4, 7, 0.96)));
}

.active-entity-card > footer strong,
.active-entity-card > footer span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.active-entity-card > footer strong {
  color: #eeeade;
  font: 750 0.68rem/1.1 "Yu Mincho", "Hiragino Mincho ProN", serif;
}

.active-entity-card > footer span {
  color: color-mix(in srgb, var(--entity-glow) 72%, #d4ddd7);
  font: 700 0.38rem/1 "Cascadia Code", Consolas, monospace;
  letter-spacing: 0.05em;
}

.active-entity-card.is-materializing .active-entity-visual img {
  animation: active-entity-materialize 700ms steps(7, end) both;
}

body[data-game-overlay="compendium"] .active-entity-card,
body.is-model-invoking .active-entity-card,
body:not([data-game-panel="none"]) .active-entity-card {
  opacity: 0;
  transform: translateY(0.7rem) scale(0.97);
}

@keyframes active-entity-scan {
  from { transform: translateY(0); opacity: 0; }
  12% { opacity: 0.72; }
  82% { opacity: 0.38; }
  to { transform: translateY(980%); opacity: 0; }
}

@keyframes active-entity-orbit {
  to { transform: rotate(360deg); }
}

@keyframes active-entity-materialize {
  0% { opacity: 0; filter: brightness(3) contrast(1.8); transform: scaleY(0.06); }
  38% { opacity: 1; transform: scaleY(1.04); }
  62% { opacity: 0.46; transform: translateX(-0.3rem); }
  100% { opacity: 0.86; transform: none; }
}

@media (max-width: 1100px) {
  .active-entity-card {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .active-entity-card,
  .active-entity-visual::after,
  .active-entity-visual > i:nth-child(3),
  .active-entity-card.is-materializing .active-entity-visual img {
    animation: none !important;
    transition: none !important;
  }
}

/* Bespoke command seals for the Oracle Hive control rail. */
.game-command-menu button > .command-sigil {
  width: 1.65rem;
  height: 1.65rem;
  justify-self: center;
  padding: 0;
  overflow: visible;
  border: 0;
  color: #a99558;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 0.34rem color-mix(in srgb, currentColor 22%, transparent));
  transition: color 180ms ease, filter 180ms ease, transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.game-command-menu .command-sigil .sigil-frame {
  opacity: 0.36;
  stroke-width: 0.78;
  stroke-dasharray: 2 1.8;
}

.game-command-menu .command-sigil .sigil-accent {
  color: #a6484f;
  stroke: currentColor;
  stroke-width: 1.6;
}

.game-command-menu .command-sigil .sigil-core {
  fill: currentColor;
  stroke: none;
}

.game-command-menu button[data-command="compendium"] .command-sigil { color: #79d4cb; }
.game-command-menu button[data-command="talk"] .command-sigil { color: #b8a66b; }
.game-command-menu button[data-command="settings"] .command-sigil { color: #c18f61; }
.game-command-menu button[data-command="records"] .command-sigil { color: #77aaa5; }
.game-command-menu button[data-command="clear"] .command-sigil { color: #a94a53; }

.game-command-menu button:hover > .command-sigil,
.game-command-menu button:focus-visible > .command-sigil,
.game-command-menu button.is-active > .command-sigil {
  color: #d7fff8;
  filter: drop-shadow(0 0 0.55rem color-mix(in srgb, currentColor 52%, transparent));
  transform: scale(1.08);
}

.game-command-menu button:hover > .sigil-protocol,
.game-command-menu button:focus-visible > .sigil-protocol,
.game-command-menu button.is-active > .sigil-protocol {
  transform: scale(1.08) rotate(60deg);
}

.game-command-menu button:hover > .sigil-records,
.game-command-menu button:focus-visible > .sigil-records,
.game-command-menu button.is-active > .sigil-records {
  transform: scale(1.08) rotate(-6deg);
}

@media (max-width: 780px) {
  .game-command-menu button > .command-sigil {
    width: 1.15rem;
    height: 1.15rem;
  }
}

body .boot-sequence strong {
  position: relative;
  z-index: 1;
  width: min(70rem, 90vw);
  max-width: 90vw;
  color: var(--tokyo-paper);
  font-size: clamp(1.1rem, 2.4vw, 2.2rem);
  line-height: 1.45;
  letter-spacing: 0.055em;
  text-align: center;
  text-wrap: balance;
}

body .boot-sequence::before,
body .boot-sequence::after {
  top: calc(50% - 3.45rem);
  opacity: 0.52;
}

@media (max-width: 560px) {
  body .boot-sequence strong {
    width: 88vw;
    font-size: 1.05rem;
    line-height: 1.65;
  }

  body .boot-sequence::before,
  body .boot-sequence::after {
    top: calc(50% - 2.9rem);
  }
}
.game-status-hud .location-plaque {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.game-status-hud .location-intel {
  position: relative;
  z-index: 9;
  inset: auto;
  grid-row: 1;
  min-height: 0;
  padding: 0.56rem 0.68rem 0.58rem;
  border-top: 0;
  border-bottom: 1px solid rgba(126, 223, 212, 0.52);
  background: linear-gradient(104deg, rgba(5, 23, 22, 0.96), rgba(3, 9, 10, 0.96) 64%, rgba(38, 7, 12, 0.9));
  box-shadow: 0 0.7rem 1.3rem rgba(0, 0, 0, 0.46);
}

.game-status-hud .location-intel::before {
  top: 0.44rem;
  right: 0.58rem;
  bottom: auto;
}

.game-status-hud .location-intel > strong {
  margin-top: 0.24rem;
  font-size: 1.32rem;
  line-height: 1.16;
}

.game-status-hud .location-map {
  position: relative;
  inset: auto;
  grid-row: 2;
  align-self: stretch;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  min-height: 0;
  border-bottom: 0;
}

.game-status-hud .location-plaque {
  height: auto;
  aspect-ratio: auto;
  grid-template-rows: auto auto;
}

@media (max-width: 780px) {
  .game-status-hud .location-plaque {
    height: auto;
    min-height: 0;
    grid-template-rows: 2.65rem auto;
  }

  .game-status-hud .location-intel {
    position: relative;
    inset: auto;
    grid-row: 1;
    display: flex;
    align-items: center;
    padding: 0.3rem 0.52rem;
    background: linear-gradient(90deg, rgba(4, 23, 22, 0.97), rgba(3, 10, 10, 0.98) 70%, rgba(32, 7, 11, 0.94));
  }

  .game-status-hud .location-intel > strong {
    width: auto;
    margin: 0;
    font-size: 0.68rem;
    line-height: 1.16;
    white-space: nowrap;
  }

  .game-status-hud .location-intel::before,
  .game-status-hud .location-intel-head,
  .game-status-hud .location-meta,
  .game-status-hud .location-state {
    display: none;
  }

  .game-status-hud .location-map {
    position: relative;
    inset: auto;
    grid-row: 2;
    align-self: stretch;
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .location-chronometer {
    top: 0.18rem;
    bottom: auto;
  }
}
