/* ai-layouts.css — Phase 5 agent page layouts for the Profile AI Mode canvas.
   Loaded only on the AI tab. Reuses the :root tokens from profile.css. */

.eg-ai__stage {
  display: block;
}
.eg-ai__transcript {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Shared stage masthead */
.eg-stage-head {
  margin-bottom: 14px;
}
.eg-stage-title {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--oxblood);
}
.eg-stage-kicker {
  margin: 4px 0 0;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dark-violet);
  opacity: 0.7;
}

/* ---------- 5.1 Queen ---------- */
.eg-queen {
  position: relative;
  padding: 4px 0;
}
.eg-queen__content {
  position: relative;
  z-index: 1;
}
.eg-queen__auction {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
  overflow: hidden;
  border-radius: 8px;
}
.eg-queen__auction .eg-overlay__picture,
.eg-queen__auction picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.eg-queen__auction img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.eg-queen[data-auction="true"] .eg-queen__auction {
  opacity: 1;
}

/* Museum photo frames — mirrors the product-page "section1" .frame + overlay. */
.eg-queen__gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
}
.eg-frame {
  margin: 0;
}
.eg-frame__art {
  position: relative;
  width: 100%;
  aspect-ratio: 6 / 5;
  overflow: hidden;
  border: 2px solid #111;
  background: #fff;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4);
}
.eg-frame__image-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.eg-frame__product {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.eg-frame__overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.eg-frame__sub {
  margin-top: 10px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--dark-violet);
  text-align: center;
  font-style: italic;
}
.eg-queen__explain {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  line-height: 1.7;
  color: var(--dark-violet);
  white-space: pre-wrap;
}

/* Policy / brand theme plate — text overlaid on Product_Detail_Menu_*.png,
   sized by word count. */
.eg-queen__plate {
  position: relative;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--alabaster);
  transition: height 0.3s ease;
}
.eg-overlay__picture,
.eg-queen__plate picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.eg-overlay__picture img,
.eg-queen__plate img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.eg-queen-plate__text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 26px;
  line-height: 1.7;
  color: #4a121a;
  white-space: pre-wrap;
}

/* ---------- 5.2 Rook ("Perfumery Gazette") ---------- */
.eg-gazette {
  padding: 4px 0;
}
.eg-gazette__tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.eg-gazette__tab {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--dark-violet);
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.eg-gazette__tab.is-active {
  background: var(--oxblood);
  border-color: var(--oxblood);
  color: var(--alabaster);
}
.eg-gazette__dateline {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--oxblood);
  margin-bottom: 6px;
}
.eg-gazette__chip {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--oxblood);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 10px;
}
.eg-gazette__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.eg-story {
  background: var(--alabaster);
  padding: 12px 14px;
  color: var(--dark-violet);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.eg-story:hover {
  background: #f4efe4;
}
.eg-story__headline {
  font-weight: 700;
  color: var(--oxblood);
  line-height: 1.25;
}
.eg-story__headline::first-letter {
  font-size: 1.6em;
  float: left;
  line-height: 0.9;
  margin-right: 4px;
}
.eg-story__pub {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
}
.eg-story__summary {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
}
.eg-gazette__sources {
  font-size: 0.68rem;
  color: var(--dark-violet);
  opacity: 0.7;
  margin: 10px 0 0;
}
.eg-gazette__loading,
.eg-gazette__empty {
  font-style: italic;
  color: var(--dark-violet);
  opacity: 0.75;
}

.eg-dict {
  display: grid;
  gap: 12px;
}
.eg-dict__entry {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.eg-dict__term {
  margin: 0 0 4px;
  font-size: 0.92rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--oxblood);
}
.eg-dict__para {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--dark-violet);
}

/* ---------- 5.3 Pawn ---------- */
.eg-pawn {
  --gold: #d4af37;
  position: relative;
  overflow: hidden;
  min-height: 260px;
  border-radius: 8px;
  background: #9a9a9a;
  transition: background 0.6s ease;
}
.eg-pawn__backdrop {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}
.eg-pawn__backdrop .eg-overlay__picture,
.eg-pawn__backdrop picture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.eg-pawn__backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.eg-pawn[data-auction="true"] .eg-pawn__backdrop {
  opacity: 1;
}
.eg-pawn[data-auction="true"] {
  background: var(--oxblood);
  box-shadow:
    0 0 0 2px var(--gold) inset,
    0 18px 40px rgba(74, 18, 26, 0.4);
}
.eg-pawn__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px 18px;
}
.eg-pawn__avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--alabaster);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}
.eg-pawn__avatar img {
  width: 60px;
  height: 60px;
}
.eg-pawn__status {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--alabaster);
}
.eg-pawn__answer {
  margin: 0;
  max-width: 60ch;
  line-height: 1.65;
  color: var(--alabaster);
  text-align: center;
  white-space: pre-wrap;
}
.eg-pawn__prefs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.eg-pawn__pref-hint {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--alabaster);
  opacity: 0.75;
}
.eg-pawn__pref-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.eg-pawn__pref {
  border: 1px solid rgba(240, 231, 211, 0.5);
  background: transparent;
  color: var(--alabaster);
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.eg-pawn__pref[aria-pressed="true"] {
  background: var(--gold);
  color: var(--oxblood);
  border-color: var(--gold);
}
.eg-pawn.is-compact .eg-pawn__body {
  gap: 6px;
}
.eg-pawn.is-muted .eg-pawn__answer {
  opacity: 0.75;
}
.eg-pawn__bid {
  background: var(--gold);
  color: var(--oxblood);
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

/* ---------- 5.4 Layerist ---------- */
.eg-layerist {
  padding: 4px 0;
}
.eg-wheel {
  display: grid;
  place-items: center;
  margin: 0 0 18px;
}
.eg-wheel svg {
  width: 100%;
  max-width: 320px;
  height: auto;
}

.eg-voice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 16px;
}
.eg-voice__btn {
  border: 1px solid var(--oxblood);
  background: var(--oxblood);
  color: var(--alabaster);
  font: inherit;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.eg-voice__hint {
  font-size: 0.72rem;
  color: var(--dark-violet);
  opacity: 0.7;
}

.eg-layering {
  margin: 4px 0 16px;
}
.eg-layering__title {
  margin: 0 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--oxblood);
}
.eg-layering__rail {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.eg-layering__card {
  flex: 0 0 120px;
  background: var(--alabaster);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}
.eg-layering__card img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}
.eg-layering__card strong {
  display: block;
  font-size: 0.76rem;
  color: var(--oxblood);
  margin: 6px 0 2px;
}
.eg-layering__card span {
  font-size: 0.7rem;
  color: var(--dark-violet);
  opacity: 0.75;
}
.eg-layering__empty {
  font-size: 0.78rem;
  color: var(--dark-violet);
  opacity: 0.7;
  font-style: italic;
}

/* ---------- 5.5 Knight (locked) ---------- */
.eg-knight--locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  background: #faf7f2;
  color: #2b0b10;
  border: 1px dashed rgba(74, 18, 26, 0.35);
  border-radius: 4px;
  padding: 34px 20px;
  box-shadow: 0 10px 24px rgba(43, 11, 16, 0.1);
}
.eg-knight__locked-badge {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #f0e7d3;
  background: #4a121a;
  padding: 6px 14px;
  border-radius: 999px;
}
.eg-knight__locked-icon {
  width: 64px;
  height: 64px;
  opacity: 0.85;
}
.eg-knight__locked-sub {
  margin: 0;
  font-size: 0.86rem;
  color: #8a6a55;
  font-style: italic;
}

/* ---------- 5.6 Explanation animations ---------- */
.eg-explain {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-top: 6px;
}
.eg-explain__cell {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  background: var(--alabaster);
}
.eg-explain__label {
  display: block;
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--oxblood);
  margin-bottom: 6px;
}
.eg-explain__anim {
  min-height: 64px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.eg-explain__anim svg,
.eg-explain__anim canvas {
  display: block;
}

.eg-anim--layering {
  width: 72px;
  height: 72px;
}
.eg-anim__band {
  fill: rgba(74, 18, 26, 0.5);
}
.eg-anim__band--top {
  animation: egBandTop 3s ease-in-out infinite;
}
.eg-anim__band--heart {
  animation: egBandHeart 3s ease-in-out infinite;
}
.eg-anim__band--base {
  animation: egBandBase 3s ease-in-out infinite;
}

.eg-anim--longevity {
  width: 96px;
  height: 22px;
  background: rgba(74, 18, 26, 0.12);
  border-radius: 999px;
  position: relative;
  overflow: hidden;
}
.eg-anim__bar {
  position: absolute;
  inset: 0;
  background: #4a121a;
  border-radius: 999px;
  transform-origin: left center;
  animation: egLongevity 6s ease-in-out infinite;
}
.eg-anim--static {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--oxblood);
}

@keyframes egBandTop {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(26px);
    opacity: 0.55;
  }
}
@keyframes egBandHeart {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
    opacity: 0.85;
  }
}
@keyframes egBandBase {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-26px);
    opacity: 0.55;
  }
}
@keyframes egLongevity {
  0% {
    transform: scaleX(1);
  }
  60% {
    transform: scaleX(0.28);
  }
  100% {
    transform: scaleX(0.28);
  }
}
@keyframes egPyramidOrbit {
  from {
    transform: rotateY(0deg);
  }
  to {
    transform: rotateY(360deg);
  }
}
@keyframes egNoteShift {
  0%,
  100% {
    transform: translateZ(14px) translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateZ(22px) translateY(-2px);
    opacity: 0.85;
  }
}

/* ---------- Agent room: navbar morph + isolation ---------- */
.eg-nav__agent {
  display: none;
  align-items: center;
  gap: 12px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
body.is-agent-room .eg-nav__agent {
  display: flex;
}
body.is-agent-room .eg-nav__brand,
body.is-agent-room .eg-ai__profile,
body.is-agent-room .eg-ai__back {
  display: none;
}
.eg-nav__agent-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--oxblood);
  cursor: pointer;
}
.eg-nav__agent-back svg {
  width: 18px;
  height: 18px;
}
.eg-nav__agent-label {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--oxblood);
  white-space: nowrap;
}
@media (max-width: 480px) {
  .eg-nav__agent-label {
    display: none;
  }
}

.eg-ai__landing {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
  padding: 36px 16px;
}
.eg-ai__landing-sub {
  margin: 0;
  max-width: 46ch;
  line-height: 1.6;
  color: var(--dark-violet);
}
.eg-ai-bar.is-locked {
  opacity: 0.55;
}
.eg-room__answer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  line-height: 1.7;
  color: var(--dark-violet);
  white-space: pre-wrap;
}
.eg-room__answer p {
  margin: 0;
}

/* Queen plate: in-flow text over the menu art, so height follows the text itself (no px caps). */
.eg-queen__plate {
  min-height: 12rem;
}
.eg-queen-plate__text {
  position: relative;
  inset: auto;
  display: block;
  padding: clamp(28px, 8vw, 64px) clamp(22px, 9vw, 72px);
}

/* Rook: newspaper columns */
.eg-dict {
  display: block;
  column-width: 16rem;
  column-gap: 28px;
  column-rule: 1px solid var(--line);
}
.eg-dict__entry {
  break-inside: avoid;
  margin: 0 0 14px;
}
.eg-dict__para {
  text-align: justify;
  hyphens: auto;
}
.eg-dict__entry:first-child .eg-dict__para::first-letter {
  font-size: 2.4em;
  float: left;
  line-height: 0.85;
  margin: 2px 6px 0 0;
  color: var(--oxblood);
}

/* Knight: locked book cover */
.eg-knight--locked {
  min-height: 60vh;
  justify-content: center;
  background: linear-gradient(160deg, #4a121a, #1e1926);
  color: #eae6df;
  border: 2px solid #d8d2c4;
  border-radius: 6px;
  box-shadow:
    inset 0 0 0 6px rgba(216, 210, 196, 0.15),
    0 18px 40px rgba(0, 0, 0, 0.45);
}
.eg-knight__locked-title {
  margin: 0;
  font-size: clamp(1.1rem, 4.4vw, 1.9rem);
  letter-spacing: 0.22em;
  line-height: 1.5;
  text-transform: uppercase;
  color: #eae6df;
}
.eg-knight--locked .eg-knight__locked-icon {
  filter: brightness(0) invert(0.9);
}
