/* === Chata Phase 2 Extras: Elevated Craft, 3D Tarot Deck, Animated I Ching Coins, Layered Depth === */

/* Saved Profiles Bar inside Birth Form */
.ch-prof-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
  padding: .65rem .9rem;
  border: 1px solid color-mix(in srgb, var(--shu) 22%, var(--line));
  border-radius: 10px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--paper-hi) 85%, var(--paper)), color-mix(in srgb, var(--paper) 72%, var(--paper-hi)));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
  font-size: var(--fs-sub, .875rem);
}
.ch-prof-lbl {
  color: var(--ink-soft);
  font-size: var(--fs-label, .8125rem);
  white-space: nowrap;
}
.ch-prof-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  flex: 1;
  min-width: 0;
}
.ch-prof-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .24rem .7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-hi);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-label, .8125rem);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(43,37,34,.06);
  transition: border-color .2s, color .2s, transform .15s;
}
.ch-prof-chip:hover { border-color: var(--shu); color: var(--shu); transform: translateY(-1px); }
.ch-prof-chip .ch-x {
  margin-left: .15rem;
  opacity: .55;
  font-size: .9em;
  padding: 0 .15rem;
}
.ch-prof-chip .ch-x:hover { opacity: 1; color: var(--shu); }
.ch-prof-save {
  font: inherit;
  font-size: var(--fs-label, .8125rem);
  font-weight: 500;
  padding: .28rem .8rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--shu) 50%, var(--line));
  background: color-mix(in srgb, var(--shu) 8%, var(--paper-hi));
  color: var(--shu);
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s, color .2s, transform .15s;
}
.ch-prof-save:hover { background: var(--shu); color: var(--on-shu); transform: translateY(-1px); }

/* Homepage Visual-First 3-Tile Showcase (full-width Row 2 below balanced form + preview) */
.ch-visual-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: .25rem;
}
.ch-vtile {
  position: relative;
  display: flex;
  align-items: center;
  gap: .95rem;
  padding: 1rem 1.2rem;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--shu) 15%, var(--line));
  background: linear-gradient(180deg, var(--paper-hi) 0%, color-mix(in srgb, var(--paper) 45%, var(--paper-hi)) 100%);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.5);
  transition: border-color .2s ease, transform .22s cubic-bezier(.22,1,.36,1), box-shadow .22s ease;
}
.ch-vtile::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 11px;
  border: 1px solid color-mix(in srgb, var(--shu) 12%, transparent);
  pointer-events: none;
  transition: border-color .2s ease;
}
.ch-vtile:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--shu) 55%, var(--line));
  box-shadow: 0 12px 24px -14px rgba(194,58,46,.28), inset 0 1px 0 rgba(255,255,255,.6);
}
.ch-vtile:hover::after {
  border-color: color-mix(in srgb, var(--shu) 30%, transparent);
}
.ch-vtile-art {
  flex: none;
  position: relative;
  height: 64px;
  width: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .25s cubic-bezier(.22,1,.36,1);
}
.ch-vtile:hover .ch-vtile-art {
  transform: scale(1.05);
}
/* Fanned Mini Tarot Cards using our actual card-back.svg */
.ch-art-tarot {
  position: relative;
}
.ch-mini-c {
  position: absolute;
  width: 34px;
  height: 54px;
  border-radius: 4px;
  box-shadow: 0 4px 10px -3px rgba(43,25,20,.38);
  transition: transform .25s cubic-bezier(.22,1,.36,1);
}
.ch-mini-c.c1 { transform: translateX(-14px) rotate(-14deg) translateY(3px); }
.ch-mini-c.c2 { transform: translateY(-2px); z-index: 2; }
.ch-mini-c.c3 { transform: translateX(14px) rotate(14deg) translateY(3px); }
.ch-vtile:hover .ch-mini-c.c1 { transform: translateX(-19px) rotate(-19deg) translateY(3px); }
.ch-vtile:hover .ch-mini-c.c2 { transform: translateY(-5px); }
.ch-vtile:hover .ch-mini-c.c3 { transform: translateX(19px) rotate(19deg) translateY(3px); }

.ch-vtile-txt {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.ch-vtile-t {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.25;
  color: var(--ink);
}
.ch-vtile-s {
  font-size: var(--fs-label, .8125rem);
  color: var(--ink-soft);
  line-height: 1.35;
}
@media (max-width: 780px) {
  .ch-visual-grid { gap: .6rem; }
  .ch-vtile { flex-direction: column; text-align: center; gap: .45rem; padding: .9rem .5rem .8rem; }
  .ch-vtile-art { width: 100%; }
  .ch-vtile-s { display: none; }
  .ch-vtile-t { font-size: .88rem; white-space: nowrap; }
}

/* Result Modal: Share Card Button & 4-Tradition Switcher */
.ch-share-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font: inherit;
  font-size: var(--fs-label, .8125rem);
  font-weight: 500;
  padding: .36rem .9rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--on-shu) 50%, transparent);
  background: color-mix(in srgb, var(--on-shu) 16%, transparent);
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s, transform .15s;
}
.ch-share-btn:hover { background: color-mix(in srgb, var(--on-shu) 28%, transparent); transform: translateY(-1px); }

.ch-trad-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  max-width: 928px;
  margin: 4.15rem auto 1.15rem;
  padding: .45rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--shu) 24%, var(--line));
  background: linear-gradient(180deg, var(--paper-hi), color-mix(in srgb, var(--paper) 55%, var(--paper-hi)));
  box-shadow: 0 2px 6px rgba(43,37,34,.06), 0 10px 24px -16px rgba(43,37,34,.18);
  position: relative;
  z-index: 2;
}
#sheet.ch-trad-other .ch-trad-bar {
  margin-top: 1.15rem;
}
@media (max-width: 960px) {
  .ch-trad-bar {
    margin: .9rem var(--edge, 16px) 1rem;
  }
}
@media (min-width: 961px) {
  .ch-trad-bar {
    width: calc(100% - var(--edge, 32px) * 2);
  }
}
.ch-trad-tab {
  flex: 1 1 135px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .6rem .85rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: var(--fs-sub, .875rem);
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, color .2s, box-shadow .2s, transform .15s;
}
.ch-trad-tab:hover { color: var(--ink); background: color-mix(in srgb, var(--paper) 75%, transparent); }
.ch-trad-tab[aria-selected="true"] {
  background: linear-gradient(145deg, var(--shu), color-mix(in srgb, var(--shu) 82%, #5c130e));
  color: var(--on-shu);
  box-shadow: 0 4px 12px -4px rgba(194,58,46,.5);
}
.ch-trad-view {
  max-width: 928px;
  margin: 0 auto 2.5rem;
  padding-inline: var(--edge, 16px);
}
/* ให้ .sec ในแท็บดาวม่วง/ดวงไทย/ดวงสากล ใช้เลย์เอาต์ 1 คอลัมน์ + ป้ายแนวนอนเหมือน #result > .sec */
#ch-trad-view > .sec {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  padding: 1.65rem 0;
  margin-top: 0;
  border: 0;
  border-top: 1px dashed var(--line);
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}
#ch-trad-view > .sec:first-child {
  border-top: 0;
  padding-top: .5rem;
}
#ch-trad-view > .sec > .sec-label {
  flex-direction: row;
  align-items: center;
  gap: .75rem;
}
#ch-trad-view > .sec > .sec-label .kj {
  writing-mode: horizontal-tb;
  min-height: 0;
  letter-spacing: .1em;
  font-size: 1.55rem;
}
#ch-trad-view > .sec > .sec-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: currentColor;
  opacity: .16;
}
#ch-trad-view h2 {
  font-size: var(--fs-h2, 1.45rem);
  margin: 0 0 .65rem;
  color: var(--ink);
}

/* Shared Modal for Tarot / I Ching / Calendar / Share Card */
.ch-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(18, 14, 13, .74);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  padding: 1rem;
  overflow-y: auto;
}
.ch-modal[hidden] { display: none !important; }
.ch-dialog {
  width: min(860px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--shu) 25%, var(--line));
  border-radius: 14px;
  box-shadow: 0 28px 70px -16px rgba(0,0,0,.55);
  padding: 0;
  position: relative;
}
.ch-dialog-head {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 2.85rem;
  background: var(--band-grad, linear-gradient(155deg, #9A261D, #731812));
  color: var(--on-band, #FBF6EA);
  border-bottom: 1px solid color-mix(in srgb, var(--gold-psd, #D8B56C) 35%, transparent);
}
.ch-dialog-head::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--asa, none) 0 0 / 69.282px 40px;
  opacity: .55;
}
.ch-crn {
  position: absolute;
  width: 2.2rem;
  height: 2.2rem;
  color: var(--gold-psd, #D8B56C);
  opacity: .48;
  pointer-events: none;
}
.ch-crn.tl { top: .3rem; left: .3rem; }
.ch-crn.tr { top: .3rem; right: .3rem; transform: scaleX(-1); }
.ch-hcl {
  position: absolute;
  right: 4rem;
  bottom: -1.4rem;
  width: 9rem;
  color: var(--on-band, #FBF6EA);
  opacity: .11;
  pointer-events: none;
}
.ch-head-in {
  display: flex;
  align-items: center;
  gap: .75rem;
  position: relative;
  z-index: 1;
}
.ch-head-seal {
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--gold-psd, #D8B56C) 65%, transparent);
  background: rgba(251, 246, 234, .1);
  color: var(--gold-psd, #F3E5C8);
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1;
}
.ch-dialog-head h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h2, 1.45rem);
  margin: 0;
  color: var(--on-band, #FBF6EA);
  letter-spacing: .02em;
}
.ch-dialog-body {
  padding: 1.35rem 1.6rem 1.6rem;
}
.ch-dialog .btn {
  width: auto !important;
  justify-self: auto;
  padding: .62rem 1.35rem;
  border-radius: 999px;
}
.ch-tarot-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  margin-bottom: 1rem;
}
.ch-seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: .25rem;
  padding: .25rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-hi);
}
.ch-seg-btn {
  font: inherit;
  font-size: var(--fs-label, .8125rem);
  font-weight: 500;
  padding: .42rem .9rem;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .18s, color .18s;
}
.ch-seg-btn:hover { color: var(--ink); }
.ch-seg-btn[aria-pressed="true"] {
  background: var(--shu);
  color: var(--on-shu);
}
.ch-tarot-acts {
  display: inline-flex;
  gap: .45rem;
}
.ch-tarot-stage p {
  margin-inline: auto;
}
.ch-close {
  position: relative;
  z-index: 1;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 1px solid rgba(251, 246, 234, .38);
  background: rgba(251, 246, 234, .12);
  color: var(--on-band, #FBF6EA);
  font-size: 1.05rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background .2s, transform .15s;
}
.ch-close:hover { background: rgba(251, 246, 234, .24); transform: rotate(90deg); }

/* Reusable Elevated Card & Grid Utilities */
.ch-card {
  position: relative;
  background: linear-gradient(180deg, var(--paper-hi) 0%, color-mix(in srgb, var(--paper) 35%, var(--paper-hi)) 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 5px rgba(43,37,34,.05), 0 12px 24px -16px rgba(43,37,34,.18), inset 0 1px 0 rgba(255,255,255,.4);
}
.ch-card h3 {
  font-family: var(--font-display);
  font-size: var(--fs-h3, 1.12rem);
  margin: 0 0 .6rem;
  color: var(--ink);
}
.ch-pill {
  display: inline-block;
  padding: .18rem .68rem;
  border-radius: 999px;
  font-size: var(--fs-micro, .75rem);
  font-weight: 500;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
}
.ch-pill.accent {
  border-color: color-mix(in srgb, var(--shu) 45%, var(--line));
  color: var(--shu);
  background: color-mix(in srgb, var(--shu) 10%, var(--paper-hi));
}
.ch-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin: .85rem 0;
}
.ch-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.ch-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.ch-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
@media (max-width: 640px) {
  .ch-grid-2, .ch-grid-3 { grid-template-columns: 1fr; }
  .ch-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ch-dialog { padding: 1.15rem; }
}

/* ===== TAROT: Interactive Fan Deck + 3D Flip + Illustrated Cards ===== */
.ch-tarot-stage {
  text-align: center;
  padding: 1rem .5rem 1.25rem;
  border-radius: 12px;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--shu) 10%, var(--paper-hi)), color-mix(in srgb, var(--paper) 85%, var(--paper-hi)));
  border: 1px solid color-mix(in srgb, var(--shu) 20%, var(--line));
  margin-bottom: 1.15rem;
}
.ch-tarot-prompt {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--ink);
  margin: 0 0 .85rem;
}
.ch-fan-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.ch-fan-nav {
  flex: none;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper-hi);
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
  transition: border-color .2s, color .2s;
}
.ch-fan-nav:hover { border-color: var(--shu); color: var(--shu); }
.ch-fan {
  display: flex;
  align-items: center;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 1.5rem 1.25rem .85rem;
  min-height: 184px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--shu) 40%, var(--line)) transparent;
  -webkit-overflow-scrolling: touch;
}
.ch-fan-card {
  flex: none;
  position: relative;
  width: 92px;
  height: 146px;
  margin-left: -46px;
  border-radius: 9px;
  border: 1px solid #E8D6B5;
  background: #A62C22;
  box-shadow: -4px 4px 10px rgba(43,25,20,.26), 0 0 0 1px rgba(43,37,34,.14);
  cursor: pointer;
  transform: translateY(0);
  transition: transform .22s cubic-bezier(.22,1,.36,1), box-shadow .22s ease, opacity .25s ease, margin .22s ease;
  padding: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #F3E5C8;
}
.ch-fan-card:first-child { margin-left: 0; }
.ch-fan-card:hover:not(:disabled) {
  transform: translateY(-22px) scale(1.08);
  box-shadow: 0 16px 28px rgba(43,20,16,.48), 0 0 0 2px #F0D284;
  z-index: 20;
}
.ch-fan-card.picked {
  opacity: 0;
  transform: translateY(-44px) scale(.85);
  pointer-events: none;
}
.ch-fan-card svg { width: 58px; height: 98px; pointer-events: none; }

/* Opened Tarot Card with 3D Flip */
.ch-t-slot {
  perspective: 1000px;
}
.ch-t-flip {
  position: relative;
  width: 100%;
  max-width: 220px;
  aspect-ratio: 2 / 3.35;
  margin: .45rem auto .75rem;
  transform-style: preserve-3d;
  transition: transform .72s cubic-bezier(.22,1,.36,1);
}
.ch-t-flip.flipped { transform: rotateY(180deg); }
.ch-t-side {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 12px;
  overflow: hidden;
}
.ch-t-back {
  background: linear-gradient(155deg, #8E241C 0%, #52100B 100%);
  border: 2px solid #C8A252;
  display: grid;
  place-items: center;
  color: #E7C982;
  box-shadow: 0 12px 26px -10px rgba(0,0,0,.35);
}
.ch-t-front {
  transform: rotateY(180deg);
  background: linear-gradient(180deg, #FDF9F0 0%, #F3E9D4 100%);
  color: #2B2522;
  border: 2px solid var(--tc, #C23A2E);
  box-shadow: 0 14px 30px -12px rgba(43,37,34,.35), inset 0 0 0 5px #FDF9F0, inset 0 0 0 6.5px color-mix(in srgb, var(--tc, #C23A2E) 38%, transparent);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 10px 11px;
  text-align: center;
}
.ch-t-top {
  font-family: var(--font-display);
  font-size: .78rem;
  letter-spacing: .16em;
  color: var(--tc, #C23A2E);
  font-weight: 600;
}
.ch-t-art {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 4px;
  transition: transform .4s ease;
}
.ch-t-art.rev { transform: rotate(180deg); }
.ch-t-art svg { width: 100%; max-width: 132px; height: auto; }
.ch-t-art-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.ch-t-back-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ch-fan-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 7px;
  pointer-events: none;
  display: block;
}
.ch-t-title {
  font-family: var(--font-display);
  font-size: .98rem;
  font-weight: 600;
  color: #2B2522;
  line-height: 1.25;
}
.ch-t-sub {
  font-size: .72rem;
  color: #6B6158;
  margin-top: 2px;
}
.ch-tarot-card {
  background: linear-gradient(180deg, var(--paper-hi), color-mix(in srgb, var(--paper) 40%, var(--paper-hi)));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  box-shadow: 0 4px 14px -8px rgba(43,37,34,.18);
  animation: chPopIn .35s ease both;
}
@keyframes chPopIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ===== I CHING: Animated Ancient Chinese Coins (Heads vs Tails) + Hexagram ===== */
.ch-coins-row {
  display: flex;
  justify-content: center;
  gap: 1.35rem;
  margin: 1rem 0 .85rem;
}
.ch-coin-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
}
.ch-coin {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #F6DF98, #C9983E 62%, #8A6118 100%);
  border: 2.5px solid #7A5414;
  box-shadow: 0 8px 18px -6px rgba(43,37,34,.45), inset 0 2px 4px rgba(255,255,255,.55);
  display: grid;
  place-items: center;
  position: relative;
  color: #4A3006;
  font-family: var(--font-display);
  font-weight: 600;
  transition: background .25s, border-color .25s, color .25s;
}
.ch-coin.tails {
  background: radial-gradient(circle at 32% 28%, #B89D72, #7B6342 65%, #4A3B26 100%);
  border-color: #3E301D;
  color: #EFE2C6;
}
.ch-coin-hole {
  width: 17px;
  height: 17px;
  border: 2px solid currentColor;
  background: var(--paper-hi);
  border-radius: 2px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.3);
}
.ch-coin-g {
  position: absolute;
  font-size: 13px;
  line-height: 1;
  font-family: var(--font-display);
  font-weight: 600;
  pointer-events: none;
}
.ch-coin-g.t { top: 5px; left: 50%; transform: translateX(-50%); }
.ch-coin-g.b { bottom: 5px; left: 50%; transform: translateX(-50%); }
.ch-coin-g.l { left: 6px; top: 50%; transform: translateY(-50%); }
.ch-coin-g.r { right: 6px; top: 50%; transform: translateY(-50%); }
.ch-coin-cap {
  font-size: var(--fs-micro, .75rem);
  color: var(--ink-soft);
  font-weight: 500;
}
.ch-coin-cap.heads { color: var(--shu); }
.ch-coin.spin {
  animation: chCoinSpin .58s cubic-bezier(.22,1,.36,1);
}
@keyframes chCoinSpin {
  0% { transform: translateY(0) rotateY(0deg) scale(1); }
  45% { transform: translateY(-24px) rotateY(540deg) scale(1.1); }
  100% { transform: translateY(0) rotateY(1080deg) scale(1); }
}
.ch-ic-build {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  align-items: center;
  text-align: left;
  margin-top: .85rem;
  padding-top: .85rem;
  border-top: 1px dashed var(--line);
}
@media (max-width: 520px) {
  .ch-ic-build { grid-template-columns: 1fr; text-align: center; }
}
.ch-ic-log {
  font-size: var(--fs-label, .8125rem);
  color: var(--ink-soft);
  line-height: 1.7;
}
.ch-line-empty {
  height: 8px;
  border-radius: 4px;
  border: 1px dashed var(--line);
  opacity: .55;
}
.ch-hex-sym {
  font-size: 4.2rem;
  line-height: 1;
  color: var(--shu);
  font-family: var(--font-display);
  text-shadow: 0 4px 14px rgba(194,58,46,.18);
}
.ch-hex-lines {
  display: flex;
  flex-direction: column-reverse;
  gap: 7px;
  width: 112px;
  margin: .6rem auto;
}
.ch-line-yang {
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--shu), color-mix(in srgb, var(--shu) 75%, #7a1811));
  box-shadow: 0 2px 6px rgba(194,58,46,.28);
  animation: chPopIn .3s ease both;
}
.ch-line-yin { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; animation: chPopIn .3s ease both; }
.ch-line-yin span {
  height: 8px;
  border-radius: 4px;
  background: var(--ink);
  box-shadow: 0 2px 5px rgba(0,0,0,.18);
}

/* Auspicious Calendar */
.ch-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .85rem;
}
.ch-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}
.ch-cal-dow {
  text-align: center;
  font-size: var(--fs-micro, .75rem);
  font-weight: 600;
  color: var(--ink-soft);
  padding: .3rem 0;
}
.ch-cal-cell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-hi);
  color: var(--ink);
  padding: .45rem .25rem;
  text-align: center;
  cursor: pointer;
  font: inherit;
  font-size: var(--fs-label, .8125rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  box-shadow: 0 1px 2px rgba(43,37,34,.04);
  transition: border-color .15s, background .15s, transform .12s;
}
.ch-cal-cell:hover { border-color: var(--shu); transform: translateY(-1px); }
.ch-cal-cell.active { background: var(--shu); color: var(--on-shu); border-color: var(--shu); box-shadow: 0 4px 10px -4px rgba(194,58,46,.55); }
.ch-cal-cell.today { box-shadow: inset 0 0 0 1.5px var(--shu); }
.ch-cal-cell .ch-dot { width: 6px; height: 6px; border-radius: 50%; }
.ch-cal-cell .ch-dot.good { background: #2E8B57; }
.ch-cal-cell .ch-dot.mid { background: #C7922B; }
.ch-cal-cell .ch-dot.bad { background: var(--shu); }
.ch-cal-cell.active .ch-dot { background: var(--on-shu); }

/* Seven-Number Table & Zi Wei Palaces */
.ch-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sub, .875rem);
}
.ch-table th, .ch-table td {
  border: 1px solid var(--line);
  padding: .5rem .55rem;
  text-align: center;
}
.ch-table th { background: color-mix(in srgb, var(--paper) 75%, var(--paper-hi)); font-weight: 600; color: var(--ink-soft); }
.ch-palace {
  background: linear-gradient(180deg, var(--paper-hi), color-mix(in srgb, var(--paper) 35%, var(--paper-hi)));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .85rem;
  font-size: var(--fs-label, .8125rem);
  box-shadow: 0 2px 6px rgba(43,37,34,.04);
}
.ch-palace.soul {
  border-color: var(--shu);
  box-shadow: 0 4px 14px -8px rgba(194,58,46,.35), inset 0 0 0 1px color-mix(in srgb, var(--shu) 35%, transparent);
}
.ch-palace-h { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: .35rem; color: var(--shu); }
.ch-stars { color: var(--ink); line-height: 1.55; }
.ch-stars-minor { color: var(--ink-soft); font-size: var(--fs-micro, .75rem); margin-top: .25rem; }

/* Share Card Preview */
.ch-canvas-wrap {
  display: flex;
  justify-content: center;
  background: radial-gradient(circle at center, var(--paper-hi), var(--paper));
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.1rem;
}
.ch-canvas-wrap canvas {
  max-width: 100%;
  max-height: 56vh;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 16px 38px -10px rgba(0,0,0,.32);
}

/* 2. เงินและงาน: Money Style Spectrum */
.ch-money-viz {
  margin: .85rem 0 1.35rem;
  padding: 1.15rem 1.35rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--shu) 18%, var(--line));
  background: var(--paper-hi);
  box-shadow: var(--shadow);
}
.ch-mv-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .4rem;
  margin-bottom: .9rem;
}
.ch-mv-head b {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--shu);
}
.ch-spec-bar {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2B5B84 0%, #C89B42 50%, var(--shu) 100%);
  opacity: .82;
}
.ch-spec-dot {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--paper-hi);
  border: 3.5px solid var(--shu);
  box-shadow: 0 2px 8px rgba(43, 37, 34, .3);
  transform: translate(-50%, -50%);
}
.ch-spec-lbls {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-micro, .75rem);
  color: var(--ink-soft);
  margin-top: .5rem;
}

/* 3. เสริมดวง: Compass SVG + Real Color Palette */
.ch-boost-colors {
  margin: .85rem 0 1.4rem;
  padding: 1.15rem 1.3rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--shu) 18%, var(--line));
  background: var(--paper-hi);
  box-shadow: var(--shadow);
}
.ch-boost-layout {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 1.1rem;
  align-items: center;
}
.ch-compass-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .4rem;
  padding: .65rem;
  border-radius: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.ch-compass-svg {
  width: 112px;
  height: 112px;
}
.ch-compass-cap {
  display: flex;
  flex-direction: column;
  gap: .1rem;
}
.ch-compass-cap b {
  font-family: var(--font-display);
  font-size: .88rem;
  color: var(--shu);
  line-height: 1.3;
}
@media (max-width: 640px) {
  .ch-boost-layout { grid-template-columns: 1fr; }
}

/* ===== Chata Story Mode (Spotify Wrapped-style Interactive Reveal) ===== */
.ch-story {
  position: fixed;
  inset: 0;
  z-index: 1150;
  display: grid;
  place-items: center;
  padding: max(12px, env(safe-area-inset-top, 0px)) 16px max(12px, env(safe-area-inset-bottom, 0px));
  background: rgba(16, 12, 11, .84);
  backdrop-filter: blur(10px);
  animation: chFadeIn .25s ease both;
}
.ch-story[hidden] { display: none !important; }
@keyframes chFadeIn { from { opacity: 0; } to { opacity: 1; } }

.ch-st-shell {
  width: min(680px, 100%);
  min-height: min(620px, 88vh);
  max-height: 92vh;
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #FBF6EA;
  box-shadow: 0 32px 80px -18px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,240,214,.2);
  border: 1px solid rgba(243, 229, 200, .2);
  transition: background .45s ease, color .35s ease;
}
.ch-story[data-theme="crimson"] .ch-st-shell { background: radial-gradient(circle at 80% 18%, rgba(243,210,122,.16), transparent 55%), linear-gradient(155deg, #9C281E 0%, #52110C 100%); }
.ch-story[data-theme="ink"]     .ch-st-shell { background: radial-gradient(circle at 20% 20%, rgba(194,58,46,.18), transparent 55%), linear-gradient(155deg, #211D1B 0%, #141110 100%); }
.ch-story[data-theme="umber"]   .ch-st-shell { background: radial-gradient(circle at 85% 80%, rgba(200,155,66,.16), transparent 55%), linear-gradient(155deg, #3A221D 0%, #1F1412 100%); }
.ch-story[data-theme="indigo"]  .ch-st-shell { background: radial-gradient(circle at 50% 15%, rgba(90,155,212,.18), transparent 55%), linear-gradient(155deg, #1A2331 0%, #241920 100%); }
.ch-story[data-theme="washi"]   .ch-st-shell { background: linear-gradient(160deg, #F6EFE1 0%, #EAE0CC 100%); color: #2B2522; border-color: #D8CCB6; }

.ch-st-top {
  padding: 1rem 1.35rem .5rem;
}
.ch-st-prog {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: .85rem;
}
.ch-st-bar {
  height: 3.5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  overflow: hidden;
  display: block;
}
.ch-story[data-theme="washi"] .ch-st-bar { background: rgba(43, 37, 34, .16); }
.ch-st-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: #F3E5C8;
  transition: width .35s ease;
}
.ch-story[data-theme="washi"] .ch-st-bar i { background: #B53226; }
.ch-st-bar.done i, .ch-st-bar.active i { width: 100%; }

.ch-st-bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.ch-st-brand {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-display);
  font-size: .92rem;
  letter-spacing: .04em;
  opacity: .9;
}
.ch-st-brand i {
  font-style: normal;
  display: inline-grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 5px;
  background: rgba(251, 246, 234, .16);
  border: 1px solid rgba(243, 229, 200, .4);
  font-size: .92rem;
}
.ch-story[data-theme="washi"] .ch-st-brand i {
  background: #B53226;
  color: #FBF6EA;
  border-color: transparent;
}
.ch-st-skip {
  font: inherit;
  font-size: .82rem;
  padding: .34rem .85rem;
  border-radius: 999px;
  border: 1px solid rgba(251, 246, 234, .32);
  background: rgba(251, 246, 234, .1);
  color: inherit;
  cursor: pointer;
  transition: background .18s;
}
.ch-st-skip:hover { background: rgba(251, 246, 234, .22); }
.ch-story[data-theme="washi"] .ch-st-skip {
  border-color: rgba(43, 37, 34, .22);
  background: rgba(43, 37, 34, .06);
}

.ch-st-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.75rem 1.25rem;
  overflow-y: auto;
}
.ch-st-in {
  width: 100%;
  text-align: center;
  animation: chStorySlide .46s cubic-bezier(.22,1,.36,1) both;
}
@keyframes chStorySlide {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: none; }
}
.ch-st-eyebrow {
  font-size: .78rem;
  letter-spacing: .12em;
  color: #F3E5C8;
  opacity: .88;
  margin-bottom: .5rem;
}
.ch-st-hero-glyph {
  font-family: var(--font-display);
  font-size: clamp(4.2rem, 11vw, 5.8rem);
  line-height: 1.05;
  color: #F3E5C8;
  text-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  margin: .2rem 0 .45rem;
}
.ch-st-title {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.6vw, 1.85rem);
  line-height: 1.3;
  margin: 0 0 .75rem;
  color: inherit;
}
.ch-st-lead {
  margin: 0 auto 1.15rem;
  max-width: 48ch;
  font-size: .96rem;
  line-height: 1.78;
  opacity: .9;
}
.ch-st-sub {
  font-size: .85rem;
  opacity: .78;
}
.ch-st-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
}
.ch-st-tags span {
  padding: .34rem .9rem;
  border-radius: 999px;
  font-size: .82rem;
  background: rgba(251, 246, 234, .14);
  border: 1px solid rgba(243, 229, 200, .28);
}

/* Slide 2: Four Pillars + 5 Elements */
.ch-st-pillars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .65rem;
  margin: 1rem 0 1.1rem;
}
.ch-st-pil {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
  padding: .75rem .4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  animation: chStorySlide .45s cubic-bezier(.22,1,.36,1) var(--d, 0ms) both;
}
.ch-st-pil.day {
  border-color: #F3D27A;
  background: rgba(243, 210, 122, .12);
}
.ch-st-pil small { font-size: .72rem; opacity: .7; }
.ch-st-pil b { font-family: var(--font-display); font-size: 1.75rem; line-height: 1.15; }
.ch-st-pil span { font-size: .72rem; opacity: .82; margin-top: .15rem; }

.ch-st-elbox {
  display: flex;
  flex-direction: column;
  gap: .45rem;
  max-width: 440px;
  margin: 0 auto;
  text-align: left;
  font-size: .82rem;
}
.ch-st-eb {
  display: grid;
  grid-template-columns: 4.4rem 1fr 1.6rem;
  align-items: center;
  gap: .65rem;
}
.ch-st-ebt {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  overflow: hidden;
  display: block;
}
.ch-st-ebt i {
  display: block;
  height: 100%;
  width: var(--w, 20%);
  border-radius: 999px;
  animation: chGrowW .7s cubic-bezier(.22,1,.36,1) .15s both;
}
@keyframes chGrowW { from { width: 0; } to { width: var(--w); } }

/* Slide 3: 3 Personal Deep Cards */
.ch-st-cards3 {
  display: flex;
  flex-direction: column;
  gap: .7rem;
  text-align: left;
  margin-top: .75rem;
}
.ch-st-c3 {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(243, 229, 200, .18);
  border-radius: 12px;
  padding: .85rem 1.05rem;
  animation: chStorySlide .45s cubic-bezier(.22,1,.36,1) var(--d, 0ms) both;
}
.ch-st-c3 b {
  display: block;
  font-size: .84rem;
  color: #F3E5C8;
  margin-bottom: .25rem;
}
.ch-st-c3 p {
  margin: 0;
  max-width: none;
  font-size: .88rem;
  line-height: 1.65;
  opacity: .9;
}

/* Slide 4: Score Ring + 4 Animated Bars */
.ch-st-ring-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.15rem;
  margin: .75rem 0 1.25rem;
}
.ch-st-ring { width: 104px; height: 104px; flex: none; }
.ch-st-cats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  text-align: left;
}
.ch-st-cat {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  padding: .85rem 1rem;
  animation: chStorySlide .45s cubic-bezier(.22,1,.36,1) var(--d, 0ms) both;
}
.ch-st-cath {
  display: flex;
  justify-content: space-between;
  font-size: .85rem;
  margin-bottom: .45rem;
}
.ch-st-catb {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .15);
  overflow: hidden;
}
.ch-st-catb i {
  display: block;
  height: 100%;
  width: var(--w, 60%);
  border-radius: 999px;
  animation: chGrowW .75s cubic-bezier(.22,1,.36,1) .15s both;
}

/* Slide 5: Washi Compass + Colors + CTAs */
.ch-st-compass-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin: .75rem 0 1.35rem;
}
.ch-st-comp { width: 122px; height: 122px; flex: none; }
.ch-st-swbox { text-align: left; max-width: 260px; }
.ch-st-sws { display: flex; flex-wrap: wrap; gap: .4rem; }
.ch-st-sw {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .24rem .68rem;
  border-radius: 999px;
  border: 1px solid #D8CCB6;
  background: #FAF6EC;
  color: #2B2522;
  font-size: .82rem;
}
.ch-st-sw i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(43,37,34,.22);
  display: inline-block;
}
.ch-st-cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .65rem;
}
.ch-st-cta {
  font: inherit;
  font-size: .92rem;
  font-weight: 500;
  padding: .72rem 1.45rem;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .15s, filter .18s;
}
.ch-st-cta:hover { transform: translateY(-1px); filter: brightness(1.05); }
.ch-st-cta.primary {
  border: 0;
  background: #B53226;
  color: #FBF6EA;
  box-shadow: 0 8px 20px -8px rgba(181, 50, 38, .55);
}
.ch-st-cta.secondary {
  border: 1px solid #C8B89C;
  background: #FAF6EC;
  color: #2B2522;
}

/* Story Footer Controls */
.ch-st-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.35rem 1.05rem;
  background: rgba(0, 0, 0, .18);
}
.ch-story[data-theme="washi"] .ch-st-foot { background: rgba(43, 37, 34, .06); }
.ch-st-nav {
  font: inherit;
  font-size: .86rem;
  font-weight: 500;
  padding: .46rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(251, 246, 234, .28);
  background: rgba(251, 246, 234, .12);
  color: inherit;
  cursor: pointer;
  transition: background .18s, opacity .18s;
}
.ch-st-nav:disabled { opacity: .35; cursor: default; }
.ch-st-nav.primary {
  background: #F3E5C8;
  color: #6E1711;
  border-color: transparent;
  font-weight: 600;
}
.ch-story[data-theme="washi"] .ch-st-nav {
  border-color: rgba(43, 37, 34, .2);
  background: #FAF6EC;
  color: #2B2522;
}
.ch-story[data-theme="washi"] .ch-st-nav.primary {
  background: #B53226;
  color: #FBF6EA;
}
.ch-st-count { font-size: .82rem; opacity: .8; }

@media (max-width: 560px) {
  .ch-st-stage { padding: .85rem 1.1rem 1rem; }
  .ch-st-cats { grid-template-columns: 1fr; }
  .ch-st-pillars { gap: .4rem; }
  .ch-st-pil b { font-size: 1.45rem; }
  .ch-st-ring-wrap { flex-direction: column; gap: .6rem; }
  .ch-st-ring-t, .ch-st-ring-t * { text-align: center !important; }
}

/* ===== Phase A + B + D: Atmospheric Hero Themes, Interactive Sub-Tabs, Dark Divination Stages & Homepage Polish ===== */

/* Story Mode Slide 1 Elemental Medallion */
.ch-st-medallion {
  position: relative;
  width: 118px;
  height: 118px;
  margin: .35rem auto .7rem;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(243, 229, 200, .65);
  box-shadow: 0 12px 32px -8px rgba(0, 0, 0, .5), 0 0 0 6px rgba(243, 229, 200, .1);
  display: grid;
  place-items: center;
  background: rgba(20, 12, 10, .45);
}
.ch-st-medallion img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.28);
  border-radius: 50%;
  opacity: .56;
}
.ch-st-med-g {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 3.6rem;
  line-height: 1;
  color: #FBF6EA;
  text-shadow: 0 4px 18px rgba(0, 0, 0, .65);
}

/* Tab 1 Vermilion Lead Hero Element Artwork Watermark */
#result > .sec.lead {
  position: relative;
  overflow: hidden;
}
.ch-el-bg {
  position: absolute !important;
  top: 0;
  right: 0;
  z-index: 0;
  width: 320px;
  height: 320px;
  object-fit: cover;
  border-radius: 0;
  opacity: .26;
  pointer-events: none;
  mix-blend-mode: soft-light;
  -webkit-mask-image: linear-gradient(225deg, rgba(0, 0, 0, .92) 0%, rgba(0, 0, 0, .4) 48%, transparent 78%);
  mask-image: linear-gradient(225deg, rgba(0, 0, 0, .92) 0%, rgba(0, 0, 0, .4) 48%, transparent 78%);
}
@media (max-width: 640px) { .ch-el-bg { width: 200px; height: 200px; opacity: .2; } }

/* Unified Atmospheric Hero Base (Story Mode DNA inside Result Tabs) */
.ch-atmo-hero {
  position: relative;
  overflow: hidden;
  border-radius: 16px !important;
  border: 1px solid rgba(243, 229, 200, .24) !important;
  color: #FBF6EA !important;
  box-shadow: 0 18px 42px -18px rgba(20, 12, 10, .55), inset 0 1px 0 rgba(255, 240, 214, .18) !important;
}
.ch-hero-ink {
  background: radial-gradient(circle at 85% 20%, rgba(200, 155, 66, .2), transparent 55%), linear-gradient(155deg, #241F1D 0%, #141110 100%) !important;
}
.ch-hero-indigo {
  background: radial-gradient(circle at 18% 20%, rgba(90, 155, 212, .22), transparent 55%), linear-gradient(155deg, #1A2331 0%, #241920 100%) !important;
}
.ch-hero-umber {
  background: radial-gradient(circle at 80% 25%, rgba(200, 155, 66, .22), transparent 55%), linear-gradient(155deg, #3D241E 0%, #211512 100%) !important;
}
.ch-hero-rose {
  background: radial-gradient(circle at 85% 25%, rgba(243, 210, 122, .18), transparent 55%), linear-gradient(155deg, #7C2122 0%, #3E1214 100%) !important;
}
.ch-atmo-eye {
  font-size: .76rem;
  letter-spacing: .1em;
  color: #F3E5C8;
  opacity: .9;
  margin-bottom: .35rem;
}
.ch-atmo-hero h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: #FBF6EA !important;
  margin: 0 0 .25rem;
}
.ch-atmo-note {
  font-size: .88rem;
  color: rgba(251, 246, 234, .84) !important;
  margin: .75rem 0 0;
  max-width: none;
}

/* Override internal text/tracks inside Dark Atmospheric Heroes */
.ch-atmo-hero .ch-spec-lbls { color: rgba(251, 246, 234, .76); }
.ch-atmo-hero .ch-spec-dot { border-color: #F3D27A; background: #241F1D; }
.ch-atmo-hero .ch-bars-col { border-color: rgba(255, 255, 255, .16); }
.ch-atmo-hero .ch-bar-k { color: rgba(251, 246, 234, .82); }
.ch-atmo-hero .ch-bar-v { color: #FBF6EA; }
.ch-atmo-hero .ch-bar-track { background: rgba(255, 255, 255, .15); }
.ch-atmo-hero .ch-bar-fill { animation: chGrowW .75s cubic-bezier(.22,1,.36,1) both; }
.ch-atmo-hero .ch-bar-fill.hi { background: #6ED398; }
.ch-atmo-hero .ch-bar-fill.mid { background: #F0CA73; }
.ch-atmo-hero .ch-bar-fill.lo { background: #F28B82; }
.ch-atmo-hero .ch-ring-meta b { color: #F3D27A; }
.ch-atmo-hero .ch-compass-card {
  background: rgba(255, 255, 255, .07);
  border-color: rgba(243, 229, 200, .22);
  color: #FBF6EA;
}
.ch-atmo-hero .ch-compass-cap b { color: #F3D27A; }
.ch-atmo-hero .ch-swatch-grp {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(243, 229, 200, .22);
  color: #F3E5C8;
}
.ch-atmo-hero .ch-swatch-grp > span {
  color: #F3E5C8 !important;
  font-weight: 500;
  opacity: .95;
}
.ch-atmo-hero .ch-swatch {
  background: rgba(251, 246, 234, .14);
  border-color: rgba(243, 229, 200, .32);
  color: #FBF6EA !important;
}

/* Interactive Sub-Tab Pills (for 細論 & 財運 chapters — removes wall of stacked boxes!) */
.ch-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: .9rem 0 1rem;
}
.ch-subtab {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font: inherit;
  font-size: var(--fs-label, .8125rem);
  font-weight: 500;
  padding: .46rem .9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-hi);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s, transform .15s;
}
.ch-subtab i { font-style: normal; color: var(--shu); }
.ch-subtab:hover { border-color: var(--shu); color: var(--ink); transform: translateY(-1px); }
.ch-subtab[aria-selected="true"] {
  background: var(--shu);
  color: var(--on-shu);
  border-color: var(--shu);
  box-shadow: 0 6px 14px -6px rgba(181, 50, 38, .55);
}
.ch-subtab[aria-selected="true"] i { color: var(--on-shu); }
.ch-tabbed-body > [hidden] { display: none !important; }
.ch-tabbed-body.areas { display: block !important; }
.ch-tab-anim { animation: chStorySlide .34s cubic-bezier(.22,1,.36,1) both; }

/* Tab 5: 1-Click Saved Profile Picker inside เทียบดวง */
.ch-cp-profs {
  padding: 1rem 1.2rem;
  margin-bottom: 1.1rem;
}
.ch-cp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.ch-cp-chip {
  font: inherit;
  font-size: .84rem;
  font-weight: 500;
  padding: .34rem .9rem;
  border-radius: 999px;
  border: 1px solid rgba(243, 229, 200, .42);
  background: rgba(251, 246, 234, .14);
  color: #FBF6EA;
  cursor: pointer;
  transition: background .18s, transform .15s;
}
.ch-cp-chip:hover {
  background: #F3E5C8;
  color: #6E1711;
  transform: translateY(-1px);
}

/* Phase B: Dark-Gold Atmospheric Stages for Tarot & I Ching Modals */
.ch-tarot-stage,
.ch-ic-stage {
  background: radial-gradient(ellipse at 50% 25%, rgba(200, 155, 66, .18), transparent 62%), linear-gradient(155deg, #241A18 0%, #361714 100%) !important;
  border: 1px solid rgba(243, 229, 200, .25) !important;
  color: #FBF6EA !important;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .48), inset 0 1px 0 rgba(255, 240, 214, .16) !important;
}
.ch-tarot-stage .ch-tarot-prompt,
.ch-ic-stage p,
.ch-ic-stage b { color: #FBF6EA !important; }
.ch-tarot-stage .soft,
.ch-ic-stage .soft,
.ch-ic-stage .ch-ic-log,
.ch-ic-stage .ch-coin-cap { color: rgba(251, 246, 234, .78) !important; }
.ch-ic-stage .ch-coin-cap.heads { color: #F3D27A !important; }
.ch-ic-stage .ch-ic-build { border-top-color: rgba(243, 229, 200, .2); }
.ch-ic-stage .ch-line-yin span { background: #F3E5C8; }
.ch-ic-stage .ch-line-empty { border-color: rgba(243, 229, 200, .35); }
.ch-ic-stage .btn-line {
  border-color: rgba(243, 229, 200, .35);
  color: #FBF6EA;
}
.ch-ic-stage .btn-line:hover { border-color: #F3E5C8; background: rgba(251, 246, 234, .12); }
.ch-tarot-stage .ch-fan-nav {
  background: rgba(251, 246, 234, .14);
  border-color: rgba(243, 229, 200, .35);
  color: #FBF6EA;
}
.ch-tarot-stage .ch-fan-nav:hover { background: #F3E5C8; color: #6E1711; }
.ch-tarot-sum { padding: 1.1rem 1.25rem; }

/* Phase D: Homepage Features & FAQ Subtle Modern Elevation */
#features .hf-card {
  transition: transform .22s cubic-bezier(.22,1,.36,1), border-color .22s ease, box-shadow .22s ease;
}
@media (hover: hover) {
  #features .hf-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--shu) 38%, var(--line));
    box-shadow: 0 14px 28px -16px rgba(181, 50, 38, .22);
  }
}
#faq .faq-list details {
  transition: background .18s ease;
  border-radius: 10px;
}
#faq .faq-list details[open] {
  background: color-mix(in srgb, var(--paper-hi) 65%, transparent);
}


/* ==========================================================================
   TAB 1 · STRUCTURED BENTO & VISUAL CARD SYSTEM (BALANCED PROPORTIONS)
   ========================================================================== */

/* Shared Bento Surface Tokens */
.ch-bento-stack {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  margin-top: 1.15rem;
}
.ch-bento-2col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
  align-items: stretch;
}
.ch-bento-card {
  background: var(--paper-hi);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem 1.35rem;
  box-shadow: 0 8px 24px -18px rgba(43, 37, 34, .22);
  display: flex;
  flex-direction: column;
}
.ch-bento-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .9rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--line);
}
.ch-subhead {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}
.ch-bento-cap {
  font-size: .76rem;
  color: var(--ink-soft);
}
.ch-el-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* 1. Identity Hero (命格) — Clean Header + Golden-Ratio 62/38 Reader Panel */
#result > .sec.lead.ch-ov-hero {
  position: relative;
  overflow: hidden;
  padding-top: clamp(2rem, 3.8vw, 2.8rem);
  padding-bottom: clamp(2rem, 3.8vw, 2.8rem);
}
.ch-ov-hero-in {
  position: relative;
  z-index: 2;
}
.ch-ov-head {
  margin-bottom: 1.75rem;
  max-width: 36rem;
}
.ch-ov-title {
  font-family: var(--font-display) !important;
  font-size: clamp(2rem, 4.4vw, 2.85rem) !important;
  line-height: 1.14 !important;
  margin: 0 0 .4rem !important;
  color: #FBF6EA !important;
}
.ch-ov-sub {
  font-size: 1.05rem;
  color: rgba(251, 246, 234, .9);
  margin: 0 0 1rem;
}
.ch-ov-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.ch-ov-tag {
  display: inline-flex;
  align-items: center;
  padding: .26rem .78rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 500;
  color: #FBF6EA;
  background: rgba(251, 246, 234, .12);
  border: 1px solid rgba(243, 229, 200, .24);
}
.ch-ov-tag-dyn {
  background: rgba(243, 229, 200, .2);
  border-color: rgba(243, 229, 200, .4);
  color: #FFF8E8;
}

/* Single Unified Frosted Panel — Clean, Spacious, Zero Nested Boxes */
.ch-ov-reader {
  padding: 1.45rem 1.75rem 1.7rem;
  border-radius: 16px;
  background: rgba(0, 0, 0, .22);
  border: 1px solid rgba(251, 246, 234, .16);
  backdrop-filter: blur(8px);
}
.ch-ov-ctabs {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.75rem;
  margin-bottom: 1.3rem;
  border-bottom: 1px solid rgba(251, 246, 234, .16);
}
.ch-ov-ctab {
  font: inherit;
  font-size: .88rem;
  font-weight: 500;
  padding: .2rem .05rem .75rem;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  color: rgba(251, 246, 234, .68);
  cursor: pointer;
  transition: color .18s, border-color .18s;
}
.ch-ov-ctab:hover { color: #FFF; }
.ch-ov-ctab[aria-selected="true"] {
  color: #FFFDF8;
  border-bottom-color: #F3E5C8;
  font-weight: 600;
}
.ch-ov-cpanels {
  min-height: 5.5rem;
}
.ch-ov-clead {
  font-family: var(--font-display);
  font-size: clamp(1.08rem, 1.9vw, 1.24rem);
  line-height: 1.7;
  color: #FFFDF8 !important;
  margin: 0 0 .6rem;
}
.ch-ov-cbody {
  font-size: .93rem;
  line-height: 1.82;
  color: rgba(251, 246, 234, .86) !important;
  margin: 0;
}
.ch-ov-dlist {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}
.ch-ov-drow {
  padding: .15rem 1.35rem;
}
.ch-ov-drow:first-child { padding-left: 0; }
.ch-ov-drow:last-child { padding-right: 0; }
.ch-ov-drow + .ch-ov-drow {
  border-left: 1px solid rgba(251, 246, 234, .16);
}
.ch-ov-drow b {
  display: block;
  font-size: .8rem;
  color: #F3E5C8;
  margin-bottom: .35rem;
}
.ch-ov-drow p {
  font-size: .87rem;
  line-height: 1.68;
  color: rgba(251, 246, 234, .88) !important;
  margin: 0;
}

@media (max-width: 780px) {
  .ch-ov-reader { padding: 1.15rem 1.25rem 1.35rem; }
  .ch-ov-dlist { grid-template-columns: 1fr; }
  .ch-ov-drow { padding: .85rem 0; }
  .ch-ov-drow:first-child { padding-top: 0; }
  .ch-ov-drow:last-child { padding-bottom: 0; }
  .ch-ov-drow + .ch-ov-drow { border-left: 0; border-top: 1px solid rgba(251, 246, 234, .14); }
}

/* 2. Interactive 4-Pillar Console + Equal 2-Col Bento (命式) */
.ch-pil-console {
  gap: 1rem;
}
.ch-pillars {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
}
.ch-pillars .pillar {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.1rem .5rem .9rem;
  border-radius: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  margin: 0;
  width: 100%;
}
.ch-pillars .pillar.day {
  background: color-mix(in srgb, var(--shu) 7%, var(--paper));
}
.ch-pil-btn {
  appearance: none;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: transform .2s cubic-bezier(.22,1,.36,1), border-color .2s, box-shadow .2s, background .2s;
}
.ch-pil-btn:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--shu) 50%, var(--line));
}
.ch-pil-btn.is-sel {
  background: var(--paper-hi) !important;
  border-color: var(--shu) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--shu) 24%, transparent), 0 12px 24px -14px rgba(181, 50, 38, .35);
  transform: translateY(-2px);
}
.ch-pil-hint {
  display: block;
  font-size: .68rem;
  color: var(--ink-soft);
  opacity: .7;
  margin-top: .35rem;
}
.ch-pil-btn.is-sel .ch-pil-hint {
  color: var(--shu);
  opacity: 1;
  font-weight: 600;
}

/* Docked Inspector Tray inside Pillar Console */
.ch-pil-inspect {
  padding: .95rem 1.1rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--paper) 82%, var(--line));
  border: 1px solid var(--line);
}
.ch-pil-ph {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .4rem 1rem;
  margin-bottom: .7rem;
}
.ch-pil-pt {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-wrap: wrap;
}
.ch-pil-badge {
  font-size: .74rem;
  font-weight: 600;
  color: var(--on-shu, #FBF6EA);
  background: var(--shu);
  padding: .16rem .62rem;
  border-radius: 999px;
}
.ch-pil-pt strong {
  font-size: 1rem;
  color: var(--ink);
}
.ch-pil-role {
  font-size: .82rem;
  color: var(--ink-soft);
}
.ch-pil-hid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .75rem;
}
.ch-pil-hlbl {
  font-size: .78rem;
  color: var(--ink-soft);
}
.ch-hid-row {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.ch-hid-pill {
  display: inline-flex;
  align-items: center;
  gap: .36rem;
  padding: .25rem .7rem;
  border-radius: 999px;
  font-size: .8rem;
  background: var(--paper-hi);
  border: 1px solid var(--line);
  color: var(--ink);
}
.ch-hid-pill b { font-size: .95rem; line-height: 1; }
.ch-hid-pill em {
  font-style: normal;
  font-size: .7rem;
  color: var(--ink-soft);
  padding-left: .25rem;
  border-left: 1px solid var(--line);
}

/* Equal-height Bento Pair: Radar & 5-Force Bars */
.ch-radar-wrap .radar-fig {
  margin: auto 0;
}
.ch-forces .ch-fbar-list {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: .95rem;
  flex: 1;
  padding: .35rem 0;
}
.ch-fbar-h {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: .86rem;
  margin-bottom: .32rem;
}
.ch-fbar-n {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
}
.ch-fbar-n b { color: var(--ink); font-weight: 600; }
.ch-fbar-n small { color: var(--ink-soft); font-size: .75rem; }
.ch-fbar-v {
  font-variant-numeric: tabular-nums;
  font-size: .8rem;
  font-weight: 600;
  color: var(--ink);
  padding: .1rem .48rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
}
.ch-fbar-t {
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  overflow: hidden;
}
.ch-fbar-t i {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width .6s cubic-bezier(.22,1,.36,1);
}

@media (max-width: 780px) {
  .ch-bento-2col { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .ch-pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==========================================================================
   V2 MODERN RESULT SYSTEM · POSTER HERO, BENTO 6, RANKING, SHRINES & SHEET
   ========================================================================== */

/* Prevent CSS Grid blowout on narrow mobile viewports */
.ch-v2-poster > *,
.ch-v2-duo > *,
.ch-bento6 > *,
.ch-rk-grid > *,
.ch-dgrid > * { min-width: 0; }

/* 1. Poster Identity Hero (Tab 1 · 命格) */
#result > .sec.lead.ch-v2-hero {
  position: relative;
  overflow: hidden;
  padding-top: clamp(2rem, 4vw, 3rem);
  padding-bottom: clamp(2rem, 4vw, 3rem);
}
.ch-v2-hero-in {
  position: relative;
  z-index: 2;
}
.ch-v2-glyph {
  position: absolute;
  right: 2%;
  top: -1rem;
  font-size: clamp(11rem, 24vw, 18rem);
  line-height: 1;
  color: rgba(255, 244, 220, .08);
  pointer-events: none;
  user-select: none;
}
.ch-v2-poster {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: 1.5rem 2rem;
  align-items: end;
  margin-bottom: 1.75rem;
}
.ch-v2-eyebrow {
  font-size: .78rem;
  letter-spacing: .1em;
  color: #F3E5C8;
  opacity: .92;
  margin-bottom: .4rem;
}
.ch-v2-title {
  font-family: var(--font-display) !important;
  font-size: clamp(2rem, 4.6vw, 3rem) !important;
  font-weight: 600 !important;
  line-height: 1.18 !important;
  margin: 0 0 .75rem !important;
  color: #FBF6EA !important;
}
.ch-v2-title em {
  font-style: normal;
  color: #FFE1A0;
}
.ch-v2-quote {
  font-family: var(--font-display);
  font-size: clamp(1rem, 1.8vw, 1.18rem);
  line-height: 1.65;
  color: rgba(255, 248, 232, .94) !important;
  padding-left: .95rem;
  border-left: 2px solid #FFE1A0;
  margin: 0 0 1.15rem;
  max-width: 40ch;
}
.ch-v2-stats {
  display: grid;
  gap: .65rem;
}
.ch-pstat {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .85rem 1.05rem;
  border-radius: 14px;
  background: rgba(20, 12, 4, .26);
  border: 1px solid rgba(255, 240, 210, .18);
  backdrop-filter: blur(8px);
}
.ch-pstat .kj {
  font-size: 1.65rem;
  line-height: 1;
  color: #FFE1A0;
  width: 2rem;
  text-align: center;
  flex-shrink: 0;
}
.ch-pstat small {
  display: block;
  font-size: .72rem;
  color: rgba(255, 240, 210, .78);
}
.ch-pstat b {
  font-size: .98rem;
  color: #FBF6EA;
}

/* Equal-Height Strength / Caution Duo Cards inside Hero */
.ch-v2-duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
  align-items: stretch;
}
.ch-duo-card {
  position: relative;
  overflow: hidden;
  background: var(--paper-hi);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.45rem 1.55rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 14px 32px -20px rgba(0, 0, 0, .35);
}
.ch-duo-wm {
  position: absolute;
  right: .85rem;
  top: .15rem;
  font-size: 5.5rem;
  line-height: 1;
  color: var(--ink);
  opacity: .055;
  pointer-events: none;
  user-select: none;
}
.ch-duo-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink) !important;
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: .55rem;
}
.ch-duo-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ch-duo-li {
  display: flex;
  gap: .85rem;
  align-items: flex-start;
  padding: .72rem 0;
  border-top: 1px dashed var(--line);
}
.ch-duo-li:first-of-type { border-top: 0; padding-top: .15rem; }
.ch-duo-li i {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--c) 28%, var(--line));
  color: var(--c);
  background: color-mix(in srgb, var(--c) 8%, transparent);
}
.ch-duo-li i svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ch-duo-li b {
  display: block;
  font-size: .95rem;
  color: var(--ink);
  margin-bottom: .15rem;
}
.ch-duo-li span {
  display: block;
  font-size: .85rem;
  line-height: 1.65;
  color: var(--ink-soft);
}
.ch-duo-more {
  margin-top: auto;
  padding-top: 1.15rem;
  border: 0;
  background: none;
  font: inherit;
  font-size: .84rem;
  font-weight: 600;
  color: var(--shu);
  cursor: pointer;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  transition: gap .2s;
}
.ch-duo-more:hover { gap: .55rem; }

@media (max-width: 820px) {
  .ch-v2-poster, .ch-v2-duo { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .ch-duo-card { padding: 1.2rem; border-radius: 16px; }
}

/* 2. Dark-Mood Asymmetric 6-Domain Bento (Tab 1 · 細論) */
#result > section.sec.sec-dark.ch-v2-areas {
  background: linear-gradient(160deg, #211B18 0%, #2F2520 100%) !important;
  color: #FBF6EA;
  border-radius: 22px;
  margin-top: .5rem;
}
#result > section.sec.sec-dark.ch-v2-areas .sec-label .kj { color: #E9C77B; }
#result > section.sec.sec-dark.ch-v2-areas .sec-label .th { color: rgba(251, 246, 234, .75); }
#result > section.sec.sec-dark.ch-v2-areas h2 { color: #FBF6EA !important; }
#result > section.sec.sec-dark.ch-v2-areas p.soft { color: rgba(251, 246, 234, .74) !important; }

.ch-bento6 {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: minmax(148px, auto);
  gap: .9rem;
  margin-top: 1.35rem;
}
.ch-btile {
  position: relative;
  overflow: hidden;
  text-align: left;
  font: inherit;
  border-radius: 20px;
  padding: 1.3rem;
  background: rgba(255, 248, 232, .055);
  border: 1px solid rgba(255, 240, 210, .14);
  color: #FBF6EA;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform .3s cubic-bezier(.22,1,.36,1), background .25s, border-color .25s;
}
.ch-btile:hover {
  transform: translateY(-4px);
  background: rgba(255, 248, 232, .1);
  border-color: color-mix(in srgb, var(--ac) 60%, transparent);
}
.ch-btile::before {
  content: '';
  position: absolute;
  right: -28%;
  bottom: -55%;
  width: 68%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ac), transparent 70%);
  opacity: .2;
  pointer-events: none;
  transition: opacity .3s;
}
.ch-btile:hover::before { opacity: .38; }
.ch-btk {
  display: block;
  font-size: 2.1rem;
  line-height: 1;
  color: var(--ac);
}
.ch-btile h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: #FBF6EA;
  margin: .55rem 0 .25rem;
}
.ch-bdesc {
  font-size: .83rem;
  line-height: 1.62;
  color: rgba(251, 246, 234, .76);
  margin: 0;
}
.ch-bquote {
  font-family: var(--font-display);
  font-size: 1.04rem;
  line-height: 1.68;
  color: rgba(255, 248, 232, .92);
  margin: .45rem 0 0;
}
.ch-brow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-top: 1rem;
  position: relative;
}
.ch-blvl {
  display: flex;
  gap: 4px;
}
.ch-blvl i {
  width: 16px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 248, 232, .16);
}
.ch-blvl i.on { background: var(--ac); }
.ch-btap {
  font-size: .74rem;
  color: rgba(251, 246, 234, .62);
}
.ch-btile.t-a { grid-column: span 3; grid-row: span 2; }
.ch-btile.t-b { grid-column: span 3; }
.ch-btile.t-c { grid-column: span 3; }
.ch-btile.t-d, .ch-btile.t-e, .ch-btile.t-f { grid-column: span 2; }
.ch-btile.t-a .ch-btk { font-size: 3.4rem; }
.ch-btile.t-a h3 { font-size: 1.32rem; }

@media (max-width: 820px) {
  .ch-bento6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ch-btile.t-a, .ch-btile.t-b, .ch-btile.t-c, .ch-btile.t-d, .ch-btile.t-e, .ch-btile.t-f { grid-column: span 1; grid-row: auto; }
  .ch-btile.t-a { grid-column: span 2; }
}
@media (max-width: 560px) {
  .ch-bento6 { grid-template-columns: 1fr; }
  .ch-btile.t-a { grid-column: span 1; }
}

/* 3. Top-3 Career Ranking Cards (Tab 2 · 事業) */
.ch-rk-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 1.1rem;
  margin-top: 1.25rem;
  align-items: stretch;
}
.ch-rk-grid.two {
  grid-template-columns: 1.12fr 1fr;
}
.ch-rk {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 1.45rem 1.5rem;
  background: var(--paper-hi);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: transform .3s cubic-bezier(.22,1,.36,1), box-shadow .3s;
}
.ch-rk:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px -18px rgba(43, 37, 34, .22);
}
.ch-rk.first {
  background: linear-gradient(155deg, #9A261D 0%, #6E1711 100%);
  color: #FBF6EA;
  border-color: transparent;
}
.ch-rk-no {
  position: absolute;
  top: .6rem;
  right: 1rem;
  font-size: 4.5rem;
  line-height: .9;
  font-weight: 600;
  opacity: .11;
  pointer-events: none;
}
.ch-rk.first .ch-rk-no { font-size: 5.6rem; opacity: .18; color: #FFE1A0; }
.ch-rk small {
  font-size: .74rem;
  letter-spacing: .06em;
  color: var(--shu);
  font-weight: 600;
}
.ch-rk.first small { color: #FFE1A0; }
.ch-rk h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin: .35rem 0 .5rem;
  color: var(--ink);
}
.ch-rk.first h3 { font-size: 1.45rem; color: #FBF6EA; }
.ch-rk p {
  font-size: .85rem;
  line-height: 1.62;
  color: var(--ink-soft);
  margin: 0;
}
.ch-rk.first p { color: rgba(251, 246, 234, .85); }
.ch-rk-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .9rem;
}
.ch-rk-tags span {
  font-size: .75rem;
  padding: .22rem .62rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
}
.ch-rk.first .ch-rk-tags span {
  border-color: rgba(255, 240, 210, .26);
  background: rgba(255, 248, 232, .12);
  color: #FBF6EA;
}
.ch-rk-match {
  margin-top: auto;
  padding-top: 1.1rem;
  display: flex;
  align-items: center;
  gap: .65rem;
  font-size: .82rem;
}
.ch-rk-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 10%, transparent);
  overflow: hidden;
}
.ch-rk-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--shu);
}
.ch-rk.first .ch-rk-bar { background: rgba(255, 255, 255, .18); }
.ch-rk.first .ch-rk-bar i { background: #FFE1A0; }

@media (max-width: 820px) {
  .ch-rk-grid, .ch-rk-grid.two { grid-template-columns: 1fr; }
}

/* 4. Real 12-Month Year Fortune Curve (Tab 3 · 時運) */
.ch-year-curve {
  margin-top: 1.35rem;
  padding: 1.35rem 1.45rem 1rem;
  border-radius: 18px;
  background: var(--paper-hi);
  border: 1px solid var(--line);
}
.ch-yc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: .65rem 1rem;
  margin-bottom: .9rem;
}
.ch-yc-head b {
  display: block;
  font-size: 1.12rem;
  color: var(--ink);
}
.ch-yc-head small {
  display: block;
  font-size: .78rem;
  color: var(--ink-soft);
}
.ch-yc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
}
.ch-yc-chip {
  font-size: .76rem;
  font-weight: 600;
  padding: .22rem .68rem;
  border-radius: 999px;
}
.ch-yc-chip.pk {
  background: color-mix(in srgb, var(--shu) 12%, transparent);
  color: var(--shu);
}
.ch-yc-chip.lo {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--ink-soft);
}
.ch-yc-svg {
  width: 100%;
  height: auto;
  display: block;
}
.ch-yc-m {
  font-size: 11px;
  fill: var(--ink-soft);
}
.ch-yc-m.pk, .ch-yc-pk {
  font-size: 11px;
  font-weight: 600;
  fill: var(--shu);
}

/* 5. Centered Seal Deity / Shrine Cards (Tab 4 · 守護 / 參拜) */
.ch-dgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1.15rem;
}
.ch-dcarousel {
  display: flex;
  gap: .95rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: .35rem .1rem .75rem;
  margin-top: 1.1rem;
  scrollbar-width: thin;
}
.ch-dcard {
  font: inherit;
  border-radius: 20px;
  padding: 1.4rem 1.2rem;
  background: var(--paper-hi);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: transform .25s cubic-bezier(.22,1,.36,1), border-color .2s, box-shadow .25s;
}
.ch-dcarousel .ch-dcard {
  flex: 0 0 232px;
  scroll-snap-align: start;
}
.ch-dcard:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--shu) 45%, var(--line));
  box-shadow: 0 14px 28px -18px rgba(43, 37, 34, .24);
}
.ch-dseal {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  color: #FBF6EA;
  box-shadow: 0 0 0 4px var(--paper-hi), 0 0 0 5px var(--gold, #C89B42);
  margin-bottom: .55rem;
}
.ch-dbadge {
  font-size: .72rem;
  color: var(--ink-soft);
  margin-bottom: .25rem;
}
.ch-dcard h4 {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 600;
  color: var(--ink);
  margin: .1rem 0 .35rem;
}
.ch-dcard p {
  font-size: .81rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
}
.ch-dloc {
  margin-top: auto;
  padding-top: .85rem;
  font-size: .76rem;
  font-weight: 600;
  color: var(--shu);
}

/* 6. Global Bottom Sheet (#ch-bs) */
.ch-bs-scrim[hidden],
.ch-bs[hidden],
.ch-bs-iso[hidden],
.ch-bs-lead[hidden],
.ch-bs-tips[hidden],
.ch-bs-actions[hidden] {
  display: none !important;
}
.ch-bs-scrim {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 10, .48);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .3s ease;
  z-index: 1200;
}
.ch-bs-scrim.on { opacity: 1; }
.ch-bs {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: min(680px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  transform: translate(-50%, 104%);
  transition: transform .42s cubic-bezier(.22,1,.36,1);
  background: var(--paper-hi);
  color: var(--ink);
  border-radius: 26px 26px 0 0;
  border-top: 1px solid var(--line);
  padding: .85rem clamp(1.25rem, 4vw, 2.25rem) 2.25rem;
  box-shadow: 0 -22px 60px -20px rgba(0, 0, 0, .45);
  z-index: 1201;
}
.ch-bs.on { transform: translate(-50%, 0); }
.ch-bs-grab {
  width: 44px;
  height: 5px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--ink) 18%, transparent);
  margin: 0 auto 1.25rem;
}
.ch-bs-top {
  display: flex;
  align-items: center;
  gap: .95rem;
  margin-bottom: 1.15rem;
}
.ch-bs-k {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.85rem;
  color: #FBF6EA;
  background: var(--ac, var(--shu));
  flex-shrink: 0;
}
.ch-bs-h small {
  display: block;
  font-size: .76rem;
  color: var(--ink-soft);
}
.ch-bs-h h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.25;
  margin: .1rem 0 0;
  color: var(--ink);
}
.ch-bs-x {
  margin-left: auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: color-mix(in srgb, var(--ink) 7%, transparent);
  color: var(--ink);
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
}
.ch-bs-iso {
  width: min(230px, 68%);
  height: auto;
  display: block;
  margin: 0 auto 1.1rem;
  border-radius: 16px;
  mix-blend-mode: multiply;
}
[data-theme="dark"] .ch-bs-iso {
  mix-blend-mode: normal;
  border: 1px solid var(--line);
}
.ch-bs-lead {
  font-family: var(--font-display);
  font-size: 1.1rem;
  line-height: 1.7;
  padding: .95rem 1.15rem;
  border-radius: 14px;
  background: color-mix(in srgb, var(--ac, var(--shu)) 9%, transparent);
  color: var(--ink);
  margin-bottom: 1.15rem;
}
.ch-bs-body p {
  font-size: .94rem;
  line-height: 1.85;
  color: var(--ink);
  margin: 0 0 .85rem;
}
.ch-bs-deep-wrap {
  margin-top: 1.2rem;
  padding-top: 1.1rem;
  border-top: 1px dashed var(--line);
}
.ch-bs-deep-wrap h4 {
  font-family: var(--font-display);
  font-size: 1.02rem;
  color: var(--shu);
  margin: 0 0 .75rem;
}
.ch-bs-deep {
  margin-bottom: .75rem;
}
.ch-bs-deep b {
  display: block;
  font-size: .82rem;
  color: var(--ink-soft);
  margin-bottom: .15rem;
}
.ch-bs-deep p {
  font-size: .9rem;
  margin: 0;
}
.ch-bs-tips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .6rem;
  margin-top: 1.15rem;
}
.ch-bs-tips div {
  padding: .75rem .85rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: .82rem;
}
.ch-bs-tips b {
  display: block;
  font-size: .72rem;
  color: var(--ink-soft);
  font-weight: 500;
  margin-bottom: .15rem;
}
.ch-bs-actions {
  margin-top: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.ch-bs-map {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  width: 100%;
  padding: .82rem 1.2rem;
  border-radius: 12px;
  background: var(--shu);
  color: #FBF6EA;
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
}
.ch-bs-map:hover { opacity: .92; }
.ch-bs-extra {
  font-size: .82rem;
  color: var(--ink-soft);
}
@media (max-width: 600px) {
  .ch-bs-tips { grid-template-columns: 1fr; }
}


/* ==========================================================================
   V2 FULL UNIFICATION · MODERN EDITORIAL SHELL ACROSS ALL 5 BAZI TABS
   ========================================================================== */

/* 1. Unified Full-Width Editorial Sections (Remove legacy vertical .sec-label sidebar) */
#result > .sec[hidden] {
  display: none !important;
}
#result > .sec:not([hidden]) {
  display: block !important;
  max-width: 1080px;
  margin: 0 auto !important;
  padding: clamp(2rem, 4.5vw, 3.2rem) clamp(1rem, 3.5vw, 2rem) !important;
  border-top: 0 !important;
}
#result > .sec.lead {
  max-width: none !important;
  border-radius: 0 !important;
}
#result > .sec.lead > .sec-label,
#result > .sec.lead > .ch-v2-hero-in {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}
#result > .sec.tint {
  max-width: none !important;
  background: color-mix(in srgb, var(--paper-hi) 58%, var(--paper)) !important;
}
#result > .sec.tint > .sec-label,
#result > .sec.tint > div {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}
#result > .sec.sec-dark.ch-v2-areas {
  max-width: none !important;
  border-radius: 0 !important;
  margin-top: 0 !important;
}
#result > .sec.sec-dark.ch-v2-areas > .sec-label,
#result > .sec.sec-dark.ch-v2-areas > div {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}

/* Horizontal Editorial Eyebrow (.sec-label) */
#result > .sec > .sec-label {
  position: static !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: .55rem !important;
  margin: 0 0 .5rem !important;
  padding: 0 !important;
  border: 0 !important;
  width: auto !important;
}
#result > .sec > .sec-label .kj {
  writing-mode: horizontal-tb !important;
  font-size: 1.05rem !important;
  letter-spacing: 0 !important;
  line-height: 1 !important;
  color: var(--shu);
}
#result > .sec > .sec-label .th {
  font-size: .78rem !important;
  font-weight: 600 !important;
  letter-spacing: .12em !important;
  color: var(--shu);
  opacity: .9;
}
#result > .sec.lead > .sec-label .kj,
#result > .sec.lead > .sec-label .th {
  color: #F3E5C8 !important;
}
#result > .sec > div > h2 {
  font-family: var(--font-display) !important;
  font-size: clamp(1.5rem, 3.2vw, 2.15rem) !important;
  font-weight: 600 !important;
  line-height: 1.28 !important;
  margin: 0 0 .5rem !important;
}

/* 2. Tab Bar (#jtabs-wrap) — Keep original Chata red-accent header & tab bar intact */

/* 3. Tab 2: 5-Chapter Interactive Money Bento Grid */
.ch-mny-bento {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.ch-mtile {
  font: inherit;
  text-align: left;
  border-radius: 20px;
  padding: 1.35rem 1.45rem;
  background: var(--paper-hi);
  border: 1px solid var(--line);
  border-top: 3px solid var(--ac, var(--shu));
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform .25s cubic-bezier(.22,1,.36,1), box-shadow .25s, border-color .2s;
}
.ch-mtile:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px -18px rgba(43, 37, 34, .22);
}
.ch-mtile.wide {
  grid-column: 1 / -1;
}
.ch-mtile-top {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .65rem;
}
.ch-mtile-k {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  line-height: 1;
  color: #FBF6EA;
  background: var(--ac, var(--shu));
  flex-shrink: 0;
}
.ch-mtile-tag {
  font-size: .76rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.ch-mtile h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 .4rem;
}
.ch-mtile p {
  font-size: .88rem;
  line-height: 1.68;
  color: var(--ink-soft);
  margin: 0;
}
.ch-mtile-go {
  margin-top: auto;
  padding-top: .95rem;
  font-size: .8rem;
  font-weight: 600;
  color: var(--shu);
}
@media (max-width: 680px) {
  .ch-mny-bento { grid-template-columns: 1fr; }
  .ch-mtile.wide { grid-column: auto; }
}

/* 4. Tab 3 (Daily/Period & Yiji), Tab 4 (Boost), Tab 5 (Compat) Unified Card Surface */
.ch-v2-clr {
  margin: 1.1rem 0 1.25rem;
}
.ch-v2-yiji-duo {
  margin-top: 0;
}
.ch-v2-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.ch-v2-list li {
  position: relative;
  padding-left: 1.1rem;
  font-size: .9rem;
  line-height: 1.7;
  color: var(--ink-soft);
}
.ch-v2-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--shu);
  opacity: .55;
}

#sec-time .d-block,
#sec-time .d-sum,
#sec-time .d-date,
#yiji-body .yiji,
#cp-sec .cp-form,
#cp-sec .cp-res {
  border-radius: 20px !important;
  border: 1px solid var(--line) !important;
  box-shadow: 0 8px 24px -18px rgba(43, 37, 34, .18) !important;
}
#sec-time .tabs {
  gap: .4rem !important;
  padding: .35rem !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--ink) 6%, transparent) !important;
  display: inline-flex !important;
  flex-wrap: wrap;
}
#sec-time .tabs .tab {
  border-radius: 999px !important;
  border: 0 !important;
  padding: .45rem 1.05rem !important;
}
#sec-time .tabs .tab[aria-pressed="true"] {
  background: var(--ink) !important;
  color: var(--paper-hi) !important;
  box-shadow: 0 4px 12px -6px rgba(0, 0, 0, .35) !important;
}


/* Progressive Disclosure Polish (Match result-prototype.html Cleanliness) */
#result > .sec.ch-v2-empty {
  display: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
.ch-chart-toprow {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: .85rem 1.25rem;
  margin-bottom: 1.1rem;
}
.ch-chart-toprow h2 { margin-bottom: .25rem !important; }
.ch-chart-toprow p.soft { margin: 0 !important; }
.ch-pill-cta {
  font: inherit;
  font-size: .84rem;
  font-weight: 600;
  padding: .55rem 1.15rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--shu) 45%, var(--line));
  background: var(--paper-hi);
  color: var(--shu);
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s, color .18s, transform .15s;
}
.ch-pill-cta:hover {
  background: var(--shu);
  color: #FBF6EA;
  transform: translateY(-1px);
}
.ch-chart-mini {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.4rem;
  padding-top: .85rem;
  border-top: 1px solid var(--line);
  font-size: .84rem;
  color: var(--ink-soft);
}
.ch-chart-mini b {
  color: var(--ink);
  font-weight: 600;
}
.ch-bs-chart-block {
  margin-top: .25rem;
}
.ch-bs-sub {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: .65rem;
}
.ch-bs-radar .radar-fig {
  max-width: 320px;
  margin: 0 auto;
}


/* ==========================================================================
   TAB 3 (TODAY BENTO + HEATMAP) & TAB 4 (COMPASS + PANTONE SWATCHES)
   ========================================================================== */

.ch-t3-raw { display: none !important; }
.ch-t3-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 1.15rem;
  margin-top: 1.25rem;
  align-items: stretch;
}
.ch-t3-ring-card {
  align-items: center;
  text-align: center;
  justify-content: center;
}
.ch-t3-ring {
  position: relative;
  width: 176px;
  height: 176px;
  margin-bottom: .75rem;
}
.ch-t3-ring svg {
  width: 100%;
  height: 100%;
  display: block;
}
.ch-t3-rc {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ch-t3-rc b {
  font-size: 3rem;
  line-height: 1;
  color: var(--ink);
}
.ch-t3-rc small {
  font-size: .78rem;
  color: var(--ink-soft);
  margin-top: .2rem;
}
.ch-t3-ring-card h3 {
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 600;
  margin: 0 0 .35rem;
  color: var(--ink);
}
.ch-t3-ring-card p {
  font-size: .86rem;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0;
  max-width: 32ch;
}
.ch-t3-bars-card {
  justify-content: space-between;
}
.ch-t3-bars {
  display: flex;
  flex-direction: column;
  gap: .95rem;
}
.ch-t3-bh {
  display: flex;
  justify-content: space-between;
  font-size: .88rem;
  margin-bottom: .32rem;
}
.ch-t3-bh b { color: var(--ink); }
.ch-t3-bh span { font-size: .8rem; color: var(--ink-soft); }
.ch-t3-bt {
  height: 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  overflow: hidden;
}
.ch-t3-bt i {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width .7s cubic-bezier(.22,1,.36,1);
}
.ch-t3-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: .45rem;
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}
.ch-t3-day {
  text-align: center;
  padding: .55rem .2rem;
  border-radius: 12px;
  font-size: .74rem;
  color: var(--ink-soft);
  background: var(--paper);
}
.ch-t3-day.hi { background: color-mix(in srgb, var(--shu) 13%, var(--paper-hi)); }
.ch-t3-day.mid { background: color-mix(in srgb, var(--gold, #C89B42) 15%, var(--paper-hi)); }
.ch-t3-day.sel { outline: 2px solid var(--shu); outline-offset: -2px; }
.ch-t3-day b {
  display: block;
  font-size: 1rem;
  color: var(--ink);
  margin: .1rem 0;
}
.ch-t3-day em {
  display: block;
  font-style: normal;
  font-size: .72rem;
  color: var(--shu);
  min-height: 1em;
}
@media (max-width: 820px) {
  .ch-t3-grid { grid-template-columns: 1fr; }
}

/* Tab 4: Prototype-Exact Dark Compass + 4 Pantone Color Swatch Cards */
.ch-t4-top {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  gap: 1.15rem;
  margin: 1.2rem 0 1.25rem;
  align-items: stretch;
}
.ch-t4-compass {
  background: linear-gradient(160deg, #3A2A1C 0%, #24190F 100%);
  color: #FBF6EA;
  border-radius: 20px;
  padding: 1.4rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.ch-t4-compass .ch-compass-card {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
}
.ch-t4-compass .ch-compass-svg {
  width: 170px;
  height: 170px;
}
.ch-t4-compass .ch-compass-cap b {
  color: #FFE1A0;
  font-family: var(--font-display);
  font-size: 1.15rem;
}
.ch-t4-cnote {
  font-size: .8rem;
  line-height: 1.55;
  color: rgba(251, 246, 234, .74);
  margin: .6rem 0 0;
  max-width: 28ch;
}
.ch-t4-swatches {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}
.ch-swcard {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-hi);
  display: flex;
  flex-direction: column;
  transition: transform .25s cubic-bezier(.22,1,.36,1);
}
.ch-swcard:hover { transform: translateY(-3px); }
.ch-swcard i {
  display: block;
  height: 74px;
}
.ch-swcard.avoid i {
  background-image: repeating-linear-gradient(45deg, transparent 0 8px, rgba(255, 255, 255, .22) 8px 10px);
}
.ch-swcard div {
  padding: .68rem .85rem;
}
.ch-swcard b {
  display: block;
  font-size: .88rem;
  color: var(--ink);
  margin-bottom: .12rem;
}
.ch-swcard span {
  display: block;
  font-size: .75rem;
  color: var(--ink-soft);
}
@media (max-width: 820px) {
  .ch-t4-top { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .ch-swcard i { height: 56px; }
}


/* ==========================================================================
   V2 FINAL POLISH · SPLIT POSTER/DUO BANDS, GLASS CHROME, YIJI & COMPAT
   ========================================================================== */

/* Split Tab 1 Hero: Colored Poster Band + Warm Washi Duo Band (Matches Prototype 100%) */
#result > .sec.lead.ch-v2-hero {
  padding: 0 !important;
  background: var(--paper) !important;
}
.ch-v2-hero-band {
  position: relative;
  overflow: hidden;
  padding: clamp(2.2rem, 4.5vw, 3.6rem) clamp(1rem, 3.5vw, 2rem) clamp(2rem, 4vw, 3.2rem);
  background: var(--band-grad, linear-gradient(155deg, #9A261D 0%, #6E1711 100%));
  color: #FBF6EA;
}
#result > .sec.lead[data-el="0"] .ch-v2-hero-band { background: var(--lg-0); }
#result > .sec.lead[data-el="2"] .ch-v2-hero-band { background: var(--lg-2); }
#result > .sec.lead[data-el="3"] .ch-v2-hero-band { background: var(--lg-3); }
#result > .sec.lead[data-el="4"] .ch-v2-hero-band { background: var(--lg-4); }

.ch-v2-hero-band > .sec-label,
.ch-v2-hero-band > .ch-v2-hero-in {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}
.ch-v2-hero-band > .sec-label {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: .55rem !important;
  margin-bottom: .5rem !important;
}
.ch-v2-hero-band > .sec-label .kj,
.ch-v2-hero-band > .sec-label .th {
  color: #F3E5C8 !important;
  writing-mode: horizontal-tb !important;
}
.ch-v2-hero-band .ch-v2-poster { margin-bottom: 0; }

.ch-v2-duo-band {
  background: var(--paper);
  color: var(--ink);
  padding: clamp(2.2rem, 4.5vw, 3.4rem) clamp(1rem, 3.5vw, 2rem);
}
.ch-v2-duo-in {
  max-width: 1080px;
  margin: 0 auto;
}
.ch-v2-sec-eyebrow {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--shu);
  margin-bottom: .45rem;
}
.ch-v2-sec-eyebrow .kj { font-size: 1.05rem; letter-spacing: 0; }
.ch-v2-sec-h {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.2vw, 2.15rem);
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 1.4rem;
}
.ch-duo-card h4 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: .55rem;
}

/* Keep original Chata signature vermilion .sheet-bar intact */

/* Tab 3: Modern 2-Column Yiji Strip */
.ch-t3-yiji {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.ch-yiji-card {
  background: var(--paper-hi);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.2rem 1.3rem;
  display: flex;
  gap: .9rem;
  align-items: flex-start;
  box-shadow: 0 8px 24px -18px rgba(43, 37, 34, .18);
}
.ch-yiji-mk {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  color: #FBF6EA;
}
.ch-yiji-card b {
  display: block;
  font-size: .92rem;
  color: var(--ink);
  margin-bottom: .22rem;
}
.ch-yiji-card p {
  font-size: .84rem;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0;
}
@media (max-width: 640px) {
  .ch-t3-yiji { grid-template-columns: 1fr; }
}

/* Bottom Sheet Yiji Checklist */
.ch-bs-yiji {
  display: grid;
  gap: 1rem;
}
.ch-bs-yg {
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.ch-bs-yg b {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .92rem;
  color: var(--ink);
  margin-bottom: .5rem;
}
.ch-bs-yg ul {
  margin: 0;
  padding-left: 1.15rem;
  font-size: .88rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

/* Tab 5: Modern Compat Form & Cards */
#cp-sec .cp-form {
  background: var(--paper-hi) !important;
  padding: 1.4rem 1.5rem !important;
}
#cp-sec .cp-pil {
  border-radius: 16px !important;
  border: 1px solid var(--line) !important;
}


/* ==========================================================================
   CHATA UNIFIED CI (SINGLE SOURCE OF TRUTH ACROSS HOMEPAGE + ALL 5 TABS)
   4 Surfaces: Washi Canvas · Washi Card (20px) · Lacquer Vermilion · Sumi Ink
   ========================================================================== */

:root {
  --ch-rad: 20px;
  --ch-rad-sm: 12px;
  --ch-sumi: radial-gradient(ellipse at 85% 15%, rgba(233, 199, 123, .14), transparent 58%), linear-gradient(155deg, #211B18 0%, #2E2420 100%);
  --ch-shadow: 0 10px 28px -18px rgba(43, 37, 34, .2);
}

/* 1. Unify ALL Dark Surfaces to ONE Sumi Ink & Antique Gold Palette */
.ch-hero-ink,
.ch-t4-compass,
.ch-cp-profs,
#result > section.sec.sec-dark.ch-v2-areas,
.ch-tarot-stage,
.ch-ic-stage {
  background: var(--ch-sumi) !important;
  color: #FBF6EA !important;
  border-color: rgba(233, 199, 123, .18) !important;
}
.ch-hero-ink,
.ch-t4-compass,
.ch-cp-profs {
  border-radius: var(--ch-rad) !important;
}
.ch-atmo-eye,
.ch-t4-compass .ch-compass-cap b {
  color: #E9C77B !important;
}

/* 2. Unify ALL Washi Cards across Result Tabs 1–5 (Clean 20px, zero inconsistent border-top stripes) */
.ch-bento-card,
.ch-duo-card,
.ch-mtile,
.ch-rk:not(.first),
.ch-year-curve,
.ch-yiji-card,
.ch-dcard,
#cp-sec .cp-form {
  border-radius: var(--ch-rad) !important;
  background: var(--paper-hi) !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--ch-shadow) !important;
}
.ch-mtile {
  border-top: 1px solid var(--line) !important;
}
.ch-mtile:hover,
.ch-rk:not(.first):hover,
.ch-dcard:hover {
  border-color: color-mix(in srgb, var(--shu) 40%, var(--line)) !important;
}
.ch-rk.first {
  border-radius: var(--ch-rad) !important;
}
.ch-swcard {
  border-radius: 16px !important;
  border: 1px solid var(--line) !important;
  background: var(--paper-hi) !important;
}

/* 3. Sync Homepage Cards to the exact same 20px Washi CI Surface */
#form,
.showcase-side .vis,
.fz-banner,
.ch-vtile,
#features .hf-card {
  border-radius: var(--ch-rad) !important;
}
.ch-vtile,
#features .hf-card {
  border: 1px solid var(--line) !important;
  box-shadow: var(--ch-shadow);
}

/* 4. Tab 2 Alternating Band Rhythm (#sec-career contrasting light band) */
#result > #sec-career:not([hidden]) {
  max-width: none !important;
  background: color-mix(in srgb, var(--paper-hi) 58%, var(--paper)) !important;
}
#result > #sec-career > .sec-label,
#result > #sec-career > div {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}

/* 5. Tab 3 Yiji Spacing inside #sec-time */
#sec-time .ch-t3-yiji {
  margin-top: 1.15rem;
}

/* 6. Tab 5 (เทียบดวง) Unified Bento Styles */
.ch-cp-top {
  margin-top: 1.5rem;
}
.ch-cp-badge {
  display: inline-block;
  font-size: .76rem;
  font-weight: 600;
  color: var(--shu);
  background: color-mix(in srgb, var(--shu) 10%, transparent);
  padding: .22rem .75rem;
  border-radius: 999px;
  margin-bottom: .45rem;
}
.ch-cp-pcard {
  justify-content: center;
}
.ch-cp-pil {
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}
.ch-cp-subh {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--ink);
  margin: 1.65rem 0 .25rem;
}
.ch-cp-bar {
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  overflow: hidden;
  margin-top: .85rem;
}
.ch-cp-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
}
#cp-sec .cp-form .btn {
  border-radius: 999px !important;
  padding: .75rem 1.8rem !important;
}


/* ==========================================================================
   QA VISUAL BUG FIXES (STORY STACKING, BOTTOM SHEET FIT, SUBTITLES, TAB 5)
   ========================================================================== */

/* Fix #1: Story Mode solid opaque backdrop & top stacking (zero bleed-through) */
.ch-story {
  z-index: 1250 !important;
  background: rgba(14, 10, 9, .95) !important;
}
.ch-st-shell {
  background: #211B18;
}

/* Fix #5: Bottom Sheet Isometric Shrine cream mat (crisp in Light & Dark) + compact height so Maps CTA stays above fold */
.ch-bs-iso {
  width: min(176px, 46%) !important;
  background: #FAF6EC !important;
  padding: 6px !important;
  border-radius: 16px !important;
  mix-blend-mode: normal !important;
  box-shadow: 0 6px 18px -10px rgba(0, 0, 0, .25);
  margin: 0 auto .85rem !important;
}
.ch-bs {
  padding: .8rem clamp(1.25rem, 4vw, 2.2rem) 1.65rem !important;
}
.ch-bs-top { margin-bottom: .85rem !important; }
.ch-bs-lead { padding: .8rem 1rem !important; margin-bottom: .85rem !important; font-size: 1.02rem !important; }

/* Fix #6: Prevent subtitles & disclaimer notes from wrapping narrowly at ~55% width */
#result > .sec p.soft,
#result > .sec p.small.soft {
  max-width: 78ch !important;
}

/* Fix #7: Tab 5 Compat select single chevron & aligned field baselines */
#cp-sec .cp-form .fields {
  align-items: end;
}
#cp-sec .cp-form select {
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: none !important;
}

/* Global Thai Typography Guard: NEVER apply letter-spacing to Thai text (prevents broken vowel/tone spacing) */
body, h1, h2, h3, h4, h5, p, small, label, button, a, li, dt, dd,
.ch-bs *, .ch-story *, .ch-modal *, .ch-tools-wrap *, .ch-v2-sec-eyebrow, .ch-st-eyebrow, .ch-eyebrow {
  letter-spacing: 0;
}
[lang="zh-Hant"], .kj, .v3-kj {
  font-family: var(--font-cjk, "Shippori Mincho", serif);
}
@media (prefers-reduced-motion: reduce) {
  .ch-story, .ch-story *, .ch-t-flip, .ch-fan-card, .ch-coin, .ch-bs, .ch-bs-scrim {
    transition: none !important;
    animation: none !important;
  }
}
