/* Chrome 61 baseline + progressive enhancement — Shipped Watercolor Storybook INS Edition v2 */
@font-face {
  font-family: "FeltDiary";
  src: url("./assets/fonts/felt-diary.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "FeltDiary";
  src: url("./assets/fonts/felt-diary.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: "FeltRound";
  src: url("./assets/fonts/felt-round.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: "FeltRound";
  src: url("./assets/fonts/felt-round.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
}

:root {
  --desk-sand: #F2EDE3;
  --cream-canvas: #FAF7F0;
  --card-white: #FFFFFF;
  --oat-surface: #F2ECE0;
  --oat-subtle: #F5F0E6;
  --track-warm: #E8DFD1;
  --ink-main: #2E241E;
  --ink-body: #4F4036;
  --ink-muted: #6E5B4E;
  --line-soft: #E8E0D3;
  --line-rule: #EAE1D3;
  --accent-coral: #C45438;
  --accent-bar: #DC7459;
  --accent-border: #E59882;
  --accent-soft: #FFF4EE;
  --accent-ink: #9E3D25;
  --sage-soft: #EAF3E6;
  --sage-ink: #355931;
  --font-round: "FeltRound", "PingFang SC", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-diary: "FeltDiary", "FeltRound", "PingFang SC", sans-serif;
  --top-inset: 8px;
  --right-capsule-offset: 0px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html {
  height: 100%;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  background-color: var(--cream-canvas);
  color: var(--ink-main);
  font-family: "PingFang SC", "Hiragino Sans GB", -apple-system, BlinkMacSystemFont, "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.58;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  overflow-x: hidden;
}

@media (min-width: 480px) {
  body {
    background-color: var(--desk-sand);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px 14px 28px;
  }
}

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

button:focus {
  outline: none;
}

button.kb-focus:focus {
  box-shadow: 0 0 0 2.5px var(--accent-coral);
}

img {
  display: block;
  max-width: 100%;
}

/* Seamless Mobile Canvas / Centered Desktop App Frame */
.app-shell {
  position: relative;
  width: 100%;
  max-width: 420px;
  min-height: 100vh;
  margin-left: auto;
  margin-right: auto;
  background-color: var(--cream-canvas);
  display: flex;
  flex-direction: column;
  padding-top: var(--top-inset, var(--safe-area-inset-top, env(safe-area-inset-top, 8px)));
  padding-bottom: calc(16px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
}

@media (min-width: 480px) {
  .app-shell {
    min-height: 0;
    border-radius: 28px;
    box-shadow: 0 18px 48px rgba(92, 70, 48, 0.085);
    padding-top: 12px;
    padding-bottom: 18px;
  }
}

/* Top Bar */
.topbar {
  padding: 6px 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-round);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-body);
  letter-spacing: 0.01em;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background-color: var(--accent-bar);
  margin-right: 7px;
  flex-shrink: 0;
}

.codex-pill-btn {
  display: inline-flex;
  align-items: center;
  background-color: var(--card-white);
  border: 1px solid var(--line-soft);
  color: var(--ink-main);
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 2px 6px rgba(96, 74, 52, 0.04);
  margin-right: var(--right-capsule-offset, 0px);
  transition: transform 0.14s ease;
}

.codex-pill-btn:active {
  transform: scale(0.97);
}

.paw-mini-icon {
  width: 14px;
  height: 14px;
  margin-right: 5px;
  color: var(--accent-bar);
  flex-shrink: 0;
}

/* Main Content Stage */
.stage-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-left: 16px;
  padding-right: 16px;
}

.quiz-section {
  display: flex;
  flex-direction: column;
}

/* Returning User Strip */
.resume-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--card-white);
  border-radius: 12px;
  padding: 7px 12px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-body);
  box-shadow: 0 2px 8px rgba(96, 74, 52, 0.04);
}

.resume-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-ink);
  padding: 2px 4px;
}

/* Compact Integrated Header + Center-Converging 5-Card Watercolor Stage */
.storybook-header {
  padding: 2px 0 2px;
  margin-bottom: 13px;
}

.hero-copy-row {
  padding: 0 2px 9px;
}

.hero-title-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quiz-main-title {
  font-family: var(--font-round);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: 0.01em;
  color: var(--ink-main);
}

.hero-feature-pill {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-ink);
  background-color: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.quiz-sub {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.42;
  color: var(--ink-muted);
  margin-top: 4px;
}

/* 5-Card Miniature White Watercolor Strip: Converges to Center Stage (#1 at middle slot 2!) */
.peek-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 3px;
  padding-bottom: 2px;
}

.peek-mini-card {
  position: relative;
  width: 18.9%;
  background-color: var(--card-white);
  border-radius: 14px;
  padding: 6px 2px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 3px 10px rgba(96, 74, 52, 0.045);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.24s ease;
}

.peek-mini-card.is-top1 {
  z-index: 3;
  transform: translateY(-4px) scale(1.045);
  box-shadow: 0 0 0 1.5px var(--accent-coral), 0 8px 18px rgba(196, 84, 56, 0.14);
}

.peek-mini-card.is-top2 {
  z-index: 2;
  transform: translateY(-1.5px);
  box-shadow: 0 0 0 1px var(--accent-border), 0 5px 12px rgba(196, 84, 56, 0.09);
}

.peek-mini-card.is-flank {
  z-index: 1;
  transform: translateY(1.5px) scale(0.96);
}

.peek-art-wrap {
  width: 44px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.peek-art-img {
  width: 42px;
  height: 44px;
  object-fit: contain;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.peek-mini-card.is-flank .peek-art-img {
  opacity: 0.56;
}

.peek-name {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink-body);
  margin-top: 3px;
  white-space: nowrap;
}

.peek-mini-card.is-top1 .peek-name,
.peek-mini-card.is-top2 .peek-name {
  color: var(--accent-ink);
  font-weight: 700;
}

.peek-mini-card.is-flank .peek-name {
  color: var(--ink-muted);
}

/* Single Unified Progress + Adjacent Step Navigation */
.scene-progress-block {
  margin-bottom: 12px;
}

.scene-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  min-height: 28px;
}

.scene-meta-left {
  display: flex;
  align-items: center;
  min-width: 0;
}

.step-num-pill {
  display: inline-block;
  background-color: var(--accent-soft);
  color: var(--accent-ink);
  font-family: var(--font-round);
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  margin-right: 8px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.scene-topic-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-nav-group {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.step-nav-btn {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-body);
  background-color: var(--card-white);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 4px 11px;
  margin-left: 6px;
  line-height: 1.3;
  white-space: nowrap;
}

.step-nav-btn:active {
  transform: scale(0.97);
}

.step-nav-btn.is-forward {
  color: var(--accent-ink);
  border-color: #EBC3B4;
  background-color: var(--accent-soft);
}

.step-nav-btn.is-invisible {
  display: none;
}

.progress-rail {
  width: 100%;
  height: 5px;
  background-color: var(--track-warm);
  border-radius: 999px;
  overflow: hidden;
}

.progress-rail-fill {
  height: 100%;
  background-color: var(--accent-bar);
  border-radius: 999px;
  transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Question & Crisp Shipped Two-Layer Choice Cards */
.question-stage {
  transform-origin: center center;
  transition: opacity 0.16s ease, transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.question-stage.is-turning-out {
  opacity: 0.18;
  transform: translateY(4px);
}

.question-stage.is-turning-in {
  opacity: 0.96;
  transform: translateY(-1px);
}

.question-scene {
  font-family: var(--font-round);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.46;
  color: var(--ink-main);
  margin-bottom: 11px;
  padding-left: 1px;
  padding-right: 1px;
  text-wrap: pretty;
}

.choices-list {
  display: flex;
  flex-direction: column;
}

.choices-list > .choice-slip + .choice-slip {
  margin-top: 9px;
}

.supports-flex-gap .choices-list {
  row-gap: 9px;
}

.supports-flex-gap .choices-list > .choice-slip + .choice-slip {
  margin-top: 0;
}

.choice-slip {
  position: relative;
  width: 100%;
  text-align: left;
  background-color: var(--card-white);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 11px 38px 11px 12px;
  display: flex;
  align-items: flex-start;
  box-shadow: 0 2px 8px rgba(96, 74, 52, 0.035);
  transition: transform 0.12s ease, background-color 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.choice-slip:active {
  transform: scale(0.99);
}

.choice-slip.is-picked {
  background-color: var(--accent-soft);
  border-color: var(--accent-border);
  box-shadow: 0 4px 14px rgba(196, 84, 56, 0.09);
}

.choice-code {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background-color: var(--oat-surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-round);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink-body);
  margin-right: 11px;
  margin-top: 2px;
  flex-shrink: 0;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.choice-slip.is-picked .choice-code {
  background-color: var(--accent-coral);
  color: #FFFDF9;
}

.choice-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.choice-title {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.36;
  color: var(--ink-main);
  margin-bottom: 2px;
}

.choice-slip.is-picked .choice-title {
  color: var(--accent-ink);
}

.choice-text {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.44;
  color: var(--ink-body);
  text-wrap: pretty;
}

.choice-check {
  position: absolute;
  right: 12px;
  top: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  border-radius: 999px;
  background-color: var(--accent-coral);
  color: #FFFDF9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  transform: scale(0.7);
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.choice-slip.is-picked .choice-check {
  opacity: 1;
  transform: scale(1);
}

/* Permanent Resident Bottom Observer Bar (Clean spacious header, tap-to-skip supported) */
.observer-bar {
  margin-top: 13px;
  background-color: var(--oat-surface);
  border-radius: 18px;
  padding: 10px 13px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.observer-avatar-box {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background-color: var(--card-white);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 11px;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(96, 74, 52, 0.04);
}

.observer-avatar-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  transition: transform 0.24s ease;
}

.observer-avatar-box.is-speaking .observer-avatar-img {
  transform: scale(1.06) translateY(-1px);
}

.observer-content {
  flex: 1;
  min-width: 0;
}

.observer-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}

.observer-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-ink);
  white-space: nowrap;
}

.observer-skip-hint {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  white-space: nowrap;
}

.observer-note-text {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.48;
  color: var(--ink-main);
  min-height: 37px;
  text-wrap: pretty;
}

.observer-caret {
  display: inline-block;
  width: 2px;
  height: 13px;
  background-color: var(--accent-coral);
  margin-left: 2px;
  vertical-align: -2px;
  opacity: 0;
}

.observer-caret.is-typing {
  opacity: 1;
  animation: caretBlink 0.65s steps(2, start) infinite;
}

@keyframes caretBlink {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* Unboxing Transition Stage */
.unbox-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 56px;
  padding-bottom: 56px;
  text-align: center;
}

.unbox-specimen-ring {
  width: 164px;
  height: 164px;
  border-radius: 32px;
  background-color: var(--card-white);
  box-shadow: 0 12px 32px rgba(96, 74, 52, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.unbox-seal-img {
  width: 124px;
  height: 124px;
  object-fit: contain;
  animation: gentleFloat 0.65s ease-in-out infinite alternate;
}

@keyframes gentleFloat {
  0% { transform: translateY(2px) scale(0.98); }
  100% { transform: translateY(-4px) scale(1.02); }
}

.unbox-title {
  font-family: var(--font-round);
  font-size: 19px;
  font-weight: 800;
  color: var(--ink-main);
  margin-bottom: 4px;
}

.unbox-sub {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-muted);
}

/* Mid-quiz safe return banner */
.midquiz-return-bar {
  margin-bottom: 10px;
}

.midquiz-return-btn {
  width: 100%;
  background-color: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: 12px;
  text-align: center;
}

/* Result View: Pure White Art-Paper Specimen Card (Zero greyish inner frame!) */
.specimen-hero-card {
  background-color: var(--card-white);
  border-radius: 24px;
  padding: 15px 16px 19px;
  margin-bottom: 16px;
  box-shadow: 0 8px 26px rgba(96, 74, 52, 0.055);
}

.specimen-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.specimen-meta-left {
  display: inline-flex;
  align-items: center;
}

.specimen-code {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

.result-new-pill {
  margin-left: 7px;
  background-color: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.specimen-family-badge {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-body);
  background-color: var(--oat-subtle);
  padding: 3px 10px;
  border-radius: 999px;
}

.specimen-art-stage {
  position: relative;
  width: 100%;
  height: 204px;
  background-color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease-out;
}

.portrait-img {
  position: relative;
  z-index: 1;
  width: 194px;
  height: 194px;
  object-fit: contain;
}

.portrait-sheen {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(circle at var(--sheen-x, 30%) var(--sheen-y, 25%), rgba(255, 252, 246, 0.28) 0%, rgba(255, 252, 246, 0) 62%);
}

.specimen-ink-seal {
  position: absolute;
  right: 16px;
  bottom: 8px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border: 1.5px solid rgba(196, 84, 56, 0.55);
  border-radius: 8px;
  color: var(--accent-ink);
  font-family: var(--font-round);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transform: rotate(-6deg);
  background-color: rgba(255, 255, 255, 0.94);
  pointer-events: none;
}

.specimen-identity {
  padding-top: 8px;
  text-align: center;
}

.result-animal-name {
  font-family: var(--font-round);
  font-size: 29px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.24;
  color: var(--ink-main);
  margin-bottom: 5px;
}

.result-animal-tag {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-body);
  margin-bottom: 11px;
}

.result-pill-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.temperament-pill {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-body);
  background-color: var(--oat-subtle);
  padding: 4px 11px;
  border-radius: 999px;
  margin: 2px 4px;
}

.temperament-pill.is-accent {
  background-color: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 700;
}

/* Open Paper Bipolar Temperament Scale (Directly on warm paper, breaks 4-box stack!) */
.open-bipolar-section {
  padding: 2px 4px 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line-rule);
}

.bipolar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.bipolar-title {
  font-family: var(--font-round);
  font-size: 15px;
  font-weight: 800;
  color: var(--ink-main);
}

.bipolar-sub {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-muted);
}

.bipolar-rows {
  display: flex;
  flex-direction: column;
}

.bipolar-row {
  display: flex;
  align-items: center;
  padding-top: 6px;
  padding-bottom: 6px;
}

.bipolar-pole {
  width: 50px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-muted);
  flex-shrink: 0;
  white-space: nowrap;
}

.bipolar-pole.is-right {
  text-align: right;
}

.bipolar-scale-track {
  position: relative;
  flex: 1;
  height: 2px;
  background-color: #DFD5C5;
  margin-left: 9px;
  margin-right: 9px;
  border-radius: 2px;
}

.bipolar-mid-tick {
  position: absolute;
  left: 50%;
  top: -3px;
  width: 1px;
  height: 8px;
  background-color: #CFC3B0;
}

.bipolar-marker {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  margin-top: -5px;
  margin-left: -5px;
  border-radius: 999px;
  background-color: #8C735F;
  box-shadow: 0 0 0 3px var(--cream-canvas);
}

.bipolar-marker.is-peak {
  width: 12px;
  height: 12px;
  margin-top: -6px;
  margin-left: -6px;
  background-color: var(--accent-coral);
}

.bipolar-tag {
  margin-left: 10px;
  min-width: 62px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-body);
  background-color: var(--oat-surface);
  padding: 2px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.bipolar-tag.is-peak {
  background-color: var(--accent-soft);
  color: var(--accent-ink);
}

/* Editorial Coexistence Manual Card (Strict Shared 18px Vertical Left Anchor!) */
.editorial-card {
  background-color: var(--card-white);
  border-radius: 22px;
  padding: 16px 18px;
  margin-bottom: 14px;
  box-shadow: 0 6px 20px rgba(96, 74, 52, 0.045);
}

.card-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 13px;
  padding-bottom: 10px;
  border-bottom: 1px solid #F1EAE0;
}

.card-section-title {
  font-family: var(--font-round);
  font-size: 15.5px;
  font-weight: 800;
  color: var(--ink-main);
}

.card-section-sub {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-muted);
}

.manual-section {
  margin-bottom: 13px;
}

.manual-section.is-last {
  margin-bottom: 0;
  margin-top: 13px;
}

/* Negative horizontal bleed = padding -> 01, 02, 03 share the EXACT same 18px left anchor! */
.manual-highlight-box {
  background-color: var(--accent-soft);
  border-radius: 14px;
  margin-left: -12px;
  margin-right: -12px;
  padding: 12px 12px;
}

.manual-heading {
  display: flex;
  align-items: center;
  font-family: var(--font-round);
  font-size: 14.5px;
  font-weight: 800;
  color: var(--ink-main);
  margin-bottom: 6px;
}

.manual-heading.is-warm {
  color: var(--accent-ink);
}

.manual-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-body);
  background-color: var(--oat-surface);
  border-radius: 6px;
  padding: 1px 6px;
  margin-right: 7px;
  font-variant-numeric: tabular-nums;
}

.manual-index.is-warm {
  background-color: #FADCD0;
  color: var(--accent-ink);
}

.manual-lead {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--ink-main);
  margin-bottom: 5px;
  text-wrap: pretty;
}

.manual-body {
  font-size: 13.5px;
  line-height: 1.64;
  color: var(--ink-body);
  text-wrap: pretty;
}

.manual-body.is-strong {
  color: var(--ink-main);
  font-weight: 500;
}

/* Twin Companion White Watercolor Cards (Pure #FFFFFF avatar paper backing!) */
.match-cards-row {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  margin-bottom: 14px;
}

.match-mini-card {
  width: 48.6%;
  text-align: left;
  background-color: var(--card-white);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 3px 10px rgba(96, 74, 52, 0.035);
  transition: transform 0.14s ease;
}

.match-mini-card:active {
  transform: scale(0.985);
}

.match-mini-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.match-role-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.match-role-tag.is-best {
  background-color: var(--sage-soft);
  color: var(--sage-ink);
}

.match-role-tag.is-rival {
  background-color: var(--accent-soft);
  color: var(--accent-ink);
}

.companion-arrow {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
}

.match-mini-hero {
  display: flex;
  align-items: center;
  margin-bottom: 7px;
}

.match-avatar-frame {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background-color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(96, 74, 52, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 9px;
  flex-shrink: 0;
}

.match-mini-avatar {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.match-mini-name {
  font-family: var(--font-round);
  font-size: 15.5px;
  font-weight: 800;
  color: var(--ink-main);
}

.match-desc {
  font-size: 12px;
  line-height: 1.44;
  color: var(--ink-body);
  margin-top: auto;
}

/* Shipped Product Actions */
.result-actions {
  padding-bottom: 6px;
}

.primary-cta-btn {
  width: 100%;
  background-color: var(--accent-coral);
  color: #FFFDF9;
  font-family: var(--font-round);
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.4;
  padding: 14px 18px;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(196, 84, 56, 0.22);
  transition: transform 0.14s ease, opacity 0.14s ease;
}

.primary-cta-btn:active {
  transform: scale(0.985);
}

.primary-cta-btn[disabled] {
  opacity: 0.65;
}

.secondary-actions-row {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.secondary-btn {
  flex: 1;
  background-color: var(--card-white);
  border: 1px solid var(--line-soft);
  color: var(--ink-main);
  font-size: 13px;
  font-weight: 700;
  padding: 11px 8px;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(96, 74, 52, 0.03);
}

.secondary-actions-row > .secondary-btn + .secondary-btn {
  margin-left: 8px;
}

.secondary-btn:active {
  transform: scale(0.985);
}

/* Toast Banner */
.toast-banner {
  position: fixed;
  left: 50%;
  top: 60px;
  transform: translateX(-50%);
  background-color: rgba(46, 36, 30, 0.94);
  color: #FFFDF9;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  z-index: 60;
  max-width: 88vw;
  text-align: center;
  box-shadow: 0 8px 22px rgba(46, 36, 30, 0.18);
}

/* Bottom Sheets */
.sheet-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: rgba(46, 36, 30, 0.42);
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

@media (min-width: 540px) {
  .sheet-backdrop {
    align-items: center;
  }
}

.sheet-panel {
  position: relative;
  width: 100%;
  max-width: 424px;
  max-height: 89vh;
  background-color: var(--cream-canvas);
  border-top-left-radius: 26px;
  border-top-right-radius: 26px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -10px 36px rgba(68, 50, 36, 0.18);
}

.codex-panel {
  max-height: 90vh;
}

@media (min-width: 540px) {
  .sheet-panel {
    border-radius: 26px;
  }
}

.sheet-head {
  padding: 14px 18px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
  background-color: var(--card-white);
  flex-shrink: 0;
}

.sheet-head-copy {
  flex: 1;
  min-width: 0;
  padding-right: 16px;
}

.sheet-title {
  font-family: var(--font-round);
  font-size: 16.5px;
  font-weight: 800;
  color: var(--ink-main);
}

.sheet-subtitle {
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-top: 2px;
}

.sheet-close-btn {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-body);
  background-color: var(--oat-subtle);
  border: 1px solid var(--line-soft);
  padding: 6px 14px;
  border-radius: 999px;
  flex-shrink: 0;
}

.sheet-body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 13px 15px 20px;
}

.codex-body {
  padding-bottom: calc(18px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
}

.poster-sheet-body {
  padding-bottom: 10px;
}

.sheet-foot {
  position: relative;
  padding: 9px 18px 14px;
  padding-bottom: calc(12px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
  background-color: var(--card-white);
  border-top: 1px solid var(--line-soft);
  flex-shrink: 0;
  z-index: 2;
}

.sheet-foot-hint {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
  text-align: center;
  margin-bottom: 8px;
}

.sheet-foot-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sheet-main-btn {
  width: 100%;
  background-color: var(--accent-coral);
  color: #FFFDF9;
  font-family: var(--font-round);
  font-size: 14.5px;
  font-weight: 700;
  padding: 12px 14px;
  border-radius: 14px;
  text-align: center;
}

/* Non-destructive Companion Spotlight inside Codex */
.companion-spotlight {
  background-color: var(--card-white);
  border-radius: 18px;
  padding: 12px 13px;
  margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(96, 74, 52, 0.05);
}

.spot-top-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.spot-avatar-frame {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background-color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(96, 74, 52, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  flex-shrink: 0;
}

.spot-avatar {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.spot-meta {
  flex: 1;
  min-width: 0;
}

.companion-spot-title {
  font-family: var(--font-round);
  font-size: 15px;
  font-weight: 800;
  color: var(--ink-main);
}

.companion-spot-tag {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-muted);
}

.companion-spot-desc {
  font-size: 13px;
  line-height: 1.58;
  color: var(--ink-body);
}

.spot-jump-btn {
  margin-top: 9px;
  width: 100%;
  background-color: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 11px;
  text-align: center;
}

/* Codex Grid: Clean 3x4 White Watercolor Cards (Clear white-fur silhouettes even when locked!) */
.codex-grid {
  display: flex;
  flex-wrap: wrap;
  margin-left: -5px;
  margin-right: -5px;
}

.codex-cell {
  width: 33.3333%;
  padding: 5px;
}

.codex-card {
  width: 100%;
  background-color: var(--card-white);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 9px 6px 8px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(96, 74, 52, 0.03);
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.codex-card:active {
  transform: scale(0.98);
}

.codex-card.is-locked {
  background-color: #F7F3EA;
  border-color: #E8DFD1;
}

.codex-card.is-related {
  background-color: var(--card-white);
  border-color: #E2C8B8;
}

.codex-card.is-highlighted {
  border-color: var(--accent-coral);
  box-shadow: 0 4px 12px rgba(196, 84, 56, 0.12);
}

.codex-thumb {
  width: 62px;
  height: 62px;
  margin-left: auto;
  margin-right: auto;
  object-fit: contain;
}

/* Warm contour drop-shadow keeps white Samoyed & Lop Rabbit silhouettes 100% distinct when locked! */
.codex-card.is-locked .codex-thumb {
  filter: grayscale(0.75) contrast(1.06) brightness(0.94) drop-shadow(0 1px 2.5px rgba(102, 80, 58, 0.3));
  opacity: 0.72;
}

.codex-name {
  font-family: var(--font-round);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-main);
  margin-top: 6px;
  line-height: 1.28;
}

.codex-card.is-locked .codex-name {
  color: var(--ink-body);
}

.codex-status {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-ink);
  margin-top: 2px;
  line-height: 1.25;
}

.codex-card.is-related .codex-status {
  color: var(--sage-ink);
}

.codex-card.is-locked .codex-status {
  color: var(--ink-muted);
}

/* Poster Preview Tabs & Dual Side-by-Side Frame */
.poster-tabs {
  display: flex;
  margin-bottom: 11px;
  background-color: var(--oat-surface);
  padding: 4px;
  border-radius: 12px;
}

.poster-tab-btn {
  flex: 1;
  padding: 7px 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-muted);
  border-radius: 9px;
  text-align: center;
  white-space: nowrap;
}

.poster-tab-btn.is-active {
  background-color: var(--card-white);
  color: var(--ink-main);
  box-shadow: 0 2px 6px rgba(96, 74, 52, 0.06);
}

.poster-preview-frame {
  width: 100%;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  overflow: hidden;
  background-color: var(--card-white);
  box-shadow: 0 8px 24px rgba(96, 74, 52, 0.08);
}

.poster-preview-img {
  width: 100%;
  height: auto;
  display: block;
}

.poster-dual-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.poster-dual-item {
  width: 48.6%;
  text-align: center;
}

.poster-dual-caption {
  display: block;
  margin-top: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-body);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
