/* ========== State visibility (chat / menu / flips) ========== */
.p1 .view-p1-chat,
.p1 .view-p2 {
  display: none;
}
.p1[data-chat="suggest"] .view-p2 { display: block; }
.p1[data-chat="live"] .p1__chat-stream,
.p1[data-chat="suggest"] .p1__chat-stream { display: flex; }
.p1[data-chat="suggest"] .p1__chat-stream {
  bottom: 360px;
  z-index: 1;
}
.p1[data-chat="suggest"] .view-p2 {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.p1[data-chat="suggest"] .view-p2 .p1__chat-box-p2-ai,
.p1[data-chat="suggest"] .view-p2 .p1__opt {
  pointer-events: auto;
}
/* 選面向時 stream 常是空的，但仍蓋在 suggest 按鈕上 → 關掉點擊 */
.p1[data-chat="suggest"] .p1__chat-stream:not(:has(.p1__msg)) {
  pointer-events: none;
}

/* API-mode chat stream：對齊隊友 Framer
   YOU 框 right:30／AI 框 left:30；標頭「YOU／SOULHOUSE」字一律靠左（padding-left:10） */
.p1__chat-stream {
  display: none;
  position: absolute;
  top: 30px;
  left: 30px;
  right: 30px;
  bottom: 120px;
  flex-direction: column;
  gap: 30px;
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 3;
  padding: 4px 6px 12px;
  box-sizing: border-box;
  isolation: isolate;
}
.p1__msg {
  display: block;
  position: relative;
  width: min(300px, 93%);
  max-width: 300px;
  min-width: 140px; /* SOULHOUSE 標頭至少要放下 */
  flex: 0 0 auto;
  background-color: rgb(40, 26, 20); /* 不要 white */
  border: 1px solid rgb(40, 26, 20);
  border-radius: 8px;
  box-shadow: 4px 5px 0 #281A14;
  overflow: hidden; /* 勿裁切標頭字頂 */
}
/* 對齊 .p1__chat-box（right:30）／.p1__chat-box-2（left:30）：框左右，不是標題字 */
.p1__msg--user { align-self: flex-end; }
.p1__msg--assistant { align-self: flex-start; }
/* 建議鈕掛在 AI 泡泡底部，不另開絕對定位層 */
.p1__msg-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 10px 11px;
  box-sizing: border-box;
  background-color: rgb(254, 250, 244);
  border-radius: 0 0 8px 8px;
  overflow: visible;
}
.p1__msg-opts .p1__opt {
  position: static;
  left: auto;
  bottom: auto;
  flex: 0 0 auto;
  width: auto;
  max-width: 100%;
  min-width: 50px;
  height: 34px;
  padding: 0 10px;
  font-size: 20px;
  line-height: 1.2;
  white-space: nowrap;
}
.p1__msg-opts .p1__opt--wide {
  font-size: 20px;
}
.p1__multi-actions {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  flex-basis: 100%;
  width: 100%;
  grid-column: 1 / -1;
  margin-top: 6px;
  padding-bottom: 3px; /* 2px 3px 陰影不被裁切 */
  box-sizing: border-box;
}
.p1__multi-submit {
  background: #E3B562;
  width: auto;
  padding: 0 10px;
}
.p1__suggest-opts .p1__opt.p1__multi-submit {
  width: auto;
  max-width: 100%;
  padding: 0 10px;
  flex: 0 0 auto;
}
.p1__multi-submit:disabled { opacity: 0.5; cursor: default; }
/* 對齊 .p1__header／.p1__you：標頭列內「YOU」字靠左（框在右也不變） */
.p1__msg-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  height: 27px;
  padding-left: 10px;
  box-sizing: border-box;
  background-color: rgb(40, 26, 20);
  border: 2px solid rgb(40, 26, 20);
  color: #fefaf4;
  font-family: "Tenor Sans", sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1; /* 避免 1.2 超出 27px 被裁切 */
  text-align: left;
  white-space: nowrap;
  overflow: visible;
  border-radius: 8px 8px 0 0; /* 標題蓋住左右上圓角 */
  /* border : none; */
}
/* 對齊 .p1__text-9／.p1__text-10 */
.p1__msg-body {
  margin: 0;
  padding: 8px 10px 11px;
  /* max-width: 280px;  */
  box-sizing: border-box; /* 含 padding 算進 280 */
  background-color: rgb(254, 250, 244);
  color: #281a14;
  font-family: "獅尾四季春JP", "獅尾四季春 JP", sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 1.2;
  /* text-align: left; */
  text-align: justify;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  /* border-radius: 0 0 8px 8px; */
}
.p1__msg-body:last-child {
  border-radius: 0 0 8px 8px; /* 只有純文字、沒 opts 時才圓底 */
}

/* 助理思考中：三點跳動；分段文字時氣泡跟著句子變寬 */
.p1__msg--typing {
  width: fit-content;
  min-width: 140px;
  max-width: none;
}
.p1__msg--typing.is-phased {
  width: fit-content;
  max-width: none;
}
.p1__msg--typing.is-phased .p1__msg-body {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: max-content;
  max-width: none;
  white-space: nowrap;
  text-align: left;
  overflow-wrap: normal;
}
.p1__typing-phase {
  white-space: nowrap;
}
.p1__typing-dots {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 6px;
  align-items: center;
}
.p1__msg-typing {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  min-height: 1.55em;
  padding-top: 14px;
  padding-bottom: 14px;
}
.p1__typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #281a14;
  opacity: 0.35;
  animation: p1-typing-dot 1.2s infinite ease-in-out;
}
.p1__typing-dot:nth-child(2) { animation-delay: 0.2s; }
.p1__typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes p1-typing-dot {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}
.p1__chat-input {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  box-sizing: border-box;
  padding: 0 18px;
  font-family: "獅尾四季春JP", "獅尾四季春 JP", sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 1.2;
  color: #281a14;
}
/* 對話泡泡內文（建議／邀約）一律 bold */
.p1 #suggest-prompt,
.p1__chat-box-p2-ai .p1__text-10 {
  font-weight: 700;
}
.p1__suggest-opts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;              /* 橫豎間距一致＝中間均分 */
  padding: 0 10px 11px;  /* 左／右 10、下 11 */
  background-color: rgb(254, 250, 244);
  box-sizing: border-box;
  border-radius: 0 0 8px 8px;
  /* 其餘 position / background 可留 */
}
.p1__suggest-opts .p1__opt {
  position: static;
  left: auto;
  bottom: auto;
  width: 100%;
  max-width: none;
  flex: unset;           /* 拿掉舊的 calc((100%-18px)/4) */
  height: 34px;
  font-size: 20px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
}
/* 較長文案（如「繼續探索需求」）單行、依內容寬度 */
.p1__suggest-opts .p1__opt--wide {
  flex: 0 0 auto;
  width: auto;
  max-width: 100%;
  padding: 0 10px;
  font-size: 20px;
}
.p1[data-chat="suggest"] #suggest-box {
  height: auto;
  min-height: 140px;
  overflow: hidden;
  padding-top: 27px; /* 留給 absolute header */
  box-sizing: border-box;
}
.p1[data-chat="suggest"] #suggest-box .p1__bubbles {
  display: none;
}
.p1[data-chat="suggest"] #suggest-box .p1__content-2 {
  position: relative;
  top: auto;
  height: auto;
  min-height: 43px;
  /* padding: 8px 10px 4px; */
  padding: 8px 10px ;
  box-sizing: border-box;
}
.p1[data-chat="suggest"] #suggest-box .p1__text-10 {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  max-width: 100%;      /* ← 重要：蓋掉 calc(100% - 20px) */
  text-align: justify;
}
.p1[data-chat="suggest"] #suggest-box .p1__suggest-opts {
  position: relative;
}
.p1[data-busy="1"] .p1__frame-29,
.p1[data-busy="1"] .p1__opt {
  pointer-events: none;
  opacity: 0.7;
}

/* Header above menu */
.p1__frame-2 {
  z-index: 60;
}
.p1[data-menu="1"] .p1__soulhouse {
  color: #FEFAF4;
  visibility: visible;
  opacity: 1;
}
.p1[data-menu="1"] .p1__burger-component {
  z-index: 61;
}

.p1__burger-component,
.p1__card,
.p1__frame-29,
.p1__opt,
.p1__menu-date,
.p1__menu-heart,
.p1__heart,
.sh-close {
  cursor: pointer;
}

/* ========== Flip slots（垂直中軸、always 往右翻） ========== */
.p1__flip {
  position: absolute;
  perspective: 1200px;
  -webkit-perspective: 1200px;
  z-index: 5;
}
.p1__flip--left {
  left: 100px;
  top: 100px; /* 800/2 - 600/2 — avoid transform on perspective parent */
  width: 600px;
  height: 600px;
}
.p1__flip--right {
  top: 100px;
  left: 730px;
  width: 370px;
  height: 225px;
}
.p1__flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: center center; /* 垂直軸穿過區塊正中間 */
  -webkit-transform-origin: center center;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.65s ease-in-out;
}
.p1__flip-face {
  position: absolute;
  inset: 0;
  overflow: hidden; /* contain face content; do NOT set preserve-3d here (Safari) */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-origin: center center;
  -webkit-transform-origin: center center;
}
/* rotateY(-…)：右側先朝向鏡頭 = 往右翻 */
.p1__flip-face--front {
  z-index: 2;
  transform: rotateY(0deg);
  -webkit-transform: rotateY(0deg);
}
.p1__flip-face--back {
  transform: rotateY(-180deg);
  -webkit-transform: rotateY(-180deg);
}

/* Open: vertical-axis flip to the right */
.p1[data-detail="1"] .p1__flip--left .p1__flip-inner {
  transform: rotateY(-180deg);
  -webkit-transform: rotateY(-180deg);
}
.p1[data-why="1"] .p1__flip--right .p1__flip-inner {
  transform: rotateY(-180deg);
  -webkit-transform: rotateY(-180deg);
}
/*
 * Continuous flip: rely on backface-visibility during the 0.65s spin.
 * Safari leak fix: only visibility-hide the retiring face AFTER ~90°
 * (half of 0.65s ≈ 0.325s), so there is no empty gap mid-flip.
 */
.p1__flip-face--front {
  transition: visibility 0s linear 0s;
}
.p1[data-detail="1"] .p1__flip--left .p1__flip-face--front,
.p1[data-why="1"] .p1__flip--right .p1__flip-face--front {
  pointer-events: none;
  visibility: hidden;
  transition-delay: 0.325s; /* hide after halfway */
}
.p1__flip-face--back {
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0s linear 0.325s; /* delay hide when closing */
}
.p1[data-detail="1"] .p1__flip--left .p1__flip-face--back,
.p1[data-why="1"] .p1__flip--right .p1__flip-face--back {
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s; /* show immediately when opening */
}

/* Inner panels fill flip faces (override absolute page coords) */
.p1__flip--left .p1__frame-27,
.p1__flip--left .p1__detail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: none;
  left: auto;
  top: auto;
}
.p1__flip--right .p1__frame-14,
.p1__flip--right .p1__why {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  left: auto;
  top: auto;
  overflow: hidden; /* prevent Safari front-face spill outside the card */
}

/* Selected card: dim the others (keep 2px border unchanged) */
.p1[data-detail="1"] .p1__card:not(.is-active) {
  opacity: 0.6;
}

/* ========== P2 delta ========== */
.p1__chat-p2 {
  display: block;
  position: absolute;
  inset: 0;
}
.p1__chat-box-p2-ai {
  display: block;
  position: absolute;
  bottom: 220px;
  left: 30px;
  width: 300px;
  height: 113px;
  /* visible so option hard-shadows are not clipped */
  overflow: visible;
  background-color: white;
  border: 1px solid rgb(40, 26, 20);
  border-radius: 8px;
  box-shadow: 4px 5px 0 #281A14;
}
.p1__bubbles {
  display: block;
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 43px;
  overflow: visible;
  background-color: rgb(254, 250, 244);
  border-radius: 0 0 8px 8px;
}
.p1__chat-box-p2-ai .p1__header-2 {
  height: 27px;
}
.p1__chat-box-p2-ai .p1__content-2 {
  position: absolute;
  top: 27px;
  right: 0;
  left: 0;
  height: 43px;
  bottom: auto;
  overflow: clip;
  background-color: rgb(254, 250, 244);
}
.p1__chat-box-p2-ai .p1__text-10 {
  /* same Framer pins as other bubbles: T8 L10 (B11 via content height) */
  top: 8px;
  left: 10px;
  right: 10px;
  bottom: auto;
  transform: none;
}
/* Framer: 50×34, border 0.6 #281A14, radius 4, shadow 2/3/0, text Bold 20 / lh 1.2, inset ~5 */
.p1__opt {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  bottom: 11px;
  width: 50px;
  height: 34px;
  overflow: visible;
  box-sizing: border-box;
  border: 0.6px solid #281A14;
  border-radius: 4px;
  box-shadow: 2px 3px 0 #281A14;
  background: #FEFAF4;
  font-family: "獅尾四季春JP", "獅尾四季春 JP", sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
  color: #281A14;
  text-align: center;
  padding: 0;
  z-index: 2;
}
.p1__opt--suite { left: 10px; }
.p1__opt--shared { left: 70px; }
.p1__opt--whole { left: 130px; }
.p1__opt.is-selected {
  background: #E3B562;
}

.p1__chat-box-p2-you {
  display: block;
  position: absolute;
  right: 30px;
  bottom: 120px;
  width: 300px;
  height: 70px;
  overflow: clip;
  background-color: white;
  border: 1px solid rgb(40, 26, 20);
  border-radius: 8px;
  box-shadow: 4px 5px 0 #281A14;
}

/* ========== P3: Toolakea-style dropdown + backdrop ==========
   Sequence (matches Toolakea rhythm):
   1) fog covers everything below header (55px)
   2) menu panel slides down (slightly after fog)
   3) menu content fades in after a beat (~0.4s delay)
*/
.p1__menu-backdrop {
  display: block;
  position: absolute;
  /* cover ALL below header — including under the 120px dropdown strip */
  top: 55px;
  left: 0;
  right: 0;
  bottom: 0;
  height: auto;
  overflow: clip;
  background-color: rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 40;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.p1[data-menu="1"] .p1__menu-backdrop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.p1__dropdown-menu {
  display: block;
  position: absolute;
  top: 55px;
  left: 0;
  right: 0;
  height: 120px;
  overflow: clip;
  background-color: rgb(40, 26, 20);
  z-index: 50; /* above fog */
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  /* close: retract promptly (no delay) */
  transition:
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.p1[data-menu="1"] .p1__dropdown-menu {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  /* open step 2: slide slightly after fog (Toolakea ~0.55–0.6s) */
  transition:
    transform 0.55s cubic-bezier(0.4, 0, 0.2, 1) 0.08s,
    opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.08s,
    visibility 0.55s cubic-bezier(0.4, 0, 0.2, 1) 0.08s;
}

/* step 3: content appears after panel has mostly dropped */
.p1__menu-items,
.p1__menu-lines {
  opacity: 0;
  transition: opacity 0.2s ease;
}
.p1[data-menu="1"] .p1__menu-items,
.p1[data-menu="1"] .p1__menu-lines {
  opacity: 1;
  transition: opacity 0.35s ease 0.4s; /* 秒差 ~0.4s */
}

.p1__menu-items {
  display: block;
  position: absolute;
  inset: 0;
  overflow: clip;
  z-index: 2;
}
.p1__menu-lines {
  display: block;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 988px;
  overflow: clip;
  transform: translateX(-50%);
  z-index: 1;
}
.p1__ml {
  display: block;
  position: absolute;
  overflow: clip;
  border-width: 0 0 0.6px 0;
  border-style: solid;
  border-color: rgb(254, 250, 244);
  box-sizing: border-box;
}
.p1__ml--j { top: 0; left: 0; width: 191px; height: 35px; }
.p1__ml--k { top: 35px; left: 0; width: 169px; height: 25px; }
.p1__ml--l { bottom: 35px; left: 0; width: 147px; height: 25px; }
.p1__ml--g { top: 0; left: 235px; width: 259px; height: 35px; }
.p1__ml--h { top: 35px; left: 213px; width: 259px; height: 25px; }
.p1__ml--i { bottom: 35px; left: 191px; width: 259px; height: 25px; }
.p1__ml--d { top: 0; left: 538px; width: 259px; height: 35px; }
.p1__ml--e { top: 35px; left: 516px; width: 259px; height: 25px; }
.p1__ml--f { bottom: 35px; left: 494px; width: 259px; height: 25px; }
.p1__ml--a { top: 0; right: 0; width: 147px; height: 35px; }
.p1__ml--b { top: 35px; right: 0; width: 169px; height: 25px; }
.p1__ml--c { bottom: 35px; right: 0; width: 191px; height: 25px; }
.p1__ml--m {
  right: 0;
  bottom: 0;
  left: 0;
  height: 35px;
  border: none;
}
.p1__menu-date {
  display: block;
  position: absolute;
  top: 50%;
  width: max-content;
  white-space: pre;
  height: auto;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #FEFAF4;
  font-family: "Tenor Sans", sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.2;
  cursor: pointer;
  z-index: 2;
}
.p1__menu-date--a {
  left: 50%;
  transform: translateX(-50%) translateY(-50%) rotate(-45deg);
}
.p1__menu-date--b {
  left: 865.9931353151841px;
  transform: translateY(-50%) rotate(-45deg);
}
/* selected: #FEFAF4；unselected: #FEFAF4 @ 60% */
.p1__menu-date,
.p1__menu-heart {
  opacity: 0.6;
}
.p1[data-list="noon"] .p1__menu-date--a,
.p1[data-list="evening"] .p1__menu-date--b,
.p1[data-list="favorites"] .p1__menu-heart,
.p1__menu-date.is-active {
  opacity: 1;
}
/* Dynamic middle/right dates (N≠3): same look as --a/--b; position set inline from baseline X_left/X_right */
.p1__menu-date--dyn {
  transform: translateX(-50%) translateY(-50%) rotate(-45deg);
}
.p1__menu-date--dyn-end {
  transform: translateY(-50%) rotate(-45deg);
}
.p1__menu-hearts {
  display: block;
  position: absolute;
  left: 260px;
  top: 50%;
  width: 74px;
  height: 18px;
  overflow: visible;
  transform: translateY(-50%) rotate(-45deg);
  z-index: 2;
}
.p1__menu-heart {
  display: block;
  position: absolute;
  top: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}
.p1__menu-heart svg {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.p1__menu-heart--1 { left: 0; }
.p1__menu-heart--2 { left: 28px; }
.p1__menu-heart--3 { right: 0; }

/* ========== Right-top recommendation list (4-row window) ========== */
/*
 * Row border-box: 20px from panel top/left/right (first) and bottom/left/right (last).
 * Framer shadow: X2 Y3 Blur0 #281A14 — needs +2 right / +3 bottom gutter
 * so overflow:hidden does not clip it (same approach as before the 20px tweak).
 * Gaps between visible rows share remaining height (--rec-gap).
 */
 .p1__rec-viewport {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 18px;
  bottom: 14px;          /* 原本 17，多留一點給 padding */
  width: auto;
  height: auto;
  padding: 0 2px 6px 0;  /* 底改 6px，吃滿 shadow Y:3 + 容錯 */
  box-sizing: border-box;
  overflow: hidden;
}
.p1__rec-track {
  display: flex;
  flex-direction: column;
  gap: var(--rec-gap, 17px);
  padding-bottom: 3px; /* 留給最後一列 box-shadow Y:3，不被 overflow:hidden 裁掉 */
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.p1__rec-row {
  position: relative;
  flex: 0 0 33px;
  width: 100%;
  height: 33px;
  /* clip children to radius 4; own box-shadow is not clipped by this */
  overflow: hidden;
  background-color: #FFFFFF;
  border: 1px solid #281A14;
  border-radius: 4px;
  /* Framer: Box / Outside / X:2 Y:3 Blur:0 Spread:0 / #281A14 100% */
  box-shadow: 2px 3px 0 #281A14;
}
.p1__rec-num {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 33px;
  background-color: #E3B562;
  border-radius: 3px 0 0 3px; /* sit inside 4px outer radius + 1px border */
  display: flex;
  align-items: center;
  justify-content: center;
}
.p1__rec-num p {
  margin: 0;
  font-family: "Tenor Sans", sans-serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 1;
  color: #281A14;
}
.p1__rec-text {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 33px;
  width: auto;
  background-color: #FEFAF4;
  border: none;
  border-left: 1px solid #281A14;
  border-radius: 0 3px 3px 0;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}
.p1__rec-text p {
  margin: 0;
  padding: 0 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: "獅尾四季春JP", "獅尾四季春 JP", sans-serif;
  font-weight: 200;
  font-size: 15px;
  color: #281A14;
}

/* ========== Right-bottom cards (exact Sourceferry / 參考圖) ========== */
.p1__frame-3 {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  /* no scroll-snap — free slide, no sticky jitter */
}
.p1__frame-3::-webkit-scrollbar {
  display: none;
}
.p1__cards-track {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px; /* matches original card1→card2 spacing */
  height: 100%;
  padding: 0 20px;
  width: max-content;
  box-sizing: border-box;
}
/* same as .p1__frame-4 / .p1__frame-9 */
.p1__card {
  position: relative;
  flex: 0 0 200px;
  width: 200px;
  height: 305px;
  overflow: clip;
  background-color: white;
  border: 2px solid rgb(40, 26, 20);
  border-radius: 12px;
  transition: opacity 0.2s ease;
}
/* image area: no full box border (that stacked with card = mysterious thick edge) */
.p1__card-media {
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 185px;
  overflow: clip;
  border: none;
}
/* same as .p1__05 */
.p1__card-img--a {
  display: block;
  position: absolute;
  bottom: -30px;
  left: 0;
  width: 220px;
  height: 330px;
  overflow: visible;
}
/* same as .p1__02 */
.p1__card-img--b {
  display: block;
  position: absolute;
  bottom: 0;
  left: -57px;
  width: 277.5px;
  height: 185px;
  overflow: visible;
}
/* same as .p1__frame-6 */
.p1__card-badge-bg {
  display: block;
  position: absolute;
  top: 10px;
  left: 10px;
  width: 20px;
  height: 20px;
  overflow: clip;
  background-color: white;
  border-radius: 50%;
  z-index: 1;
}
/* heart circle — top/right 10 (pair with badge top/left 10) */
.p1__card-heart-bg {
  display: block;
  position: absolute;
  top: 10px;
  right: 10px;
  left: auto;
  width: 20px;
  height: 20px;
  overflow: clip;
  background-color: white;
  border-radius: 50%;
  z-index: 1;
}
/* 20×20 hit area over heart badge; 10×10 icon centered */
.p1__card .p1__heart {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 10px;
  right: 10px;
  left: auto;
  width: 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  z-index: 3;
}
.p1__card .p1__heart svg {
  display: block;
  width: 10px;
  height: 10px;
  pointer-events: none;
}
.p1__card .p1__heart.is-liked path,
.p1__card .p1__heart[aria-pressed="true"] path {
  fill: #FF5F57;
  stroke: #FF5F57;
}
.p1__card.is-list-hidden {
  display: none;
}
/* centered in the 20×20 badge circle */
.p1__card-num {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 10px;
  left: 10px;
  margin: 0;
  width: 20px;
  height: 20px;
  white-space: pre;
  font-family: "Tenor Sans", sans-serif;
  font-weight: 400;
  font-size: 11px;
  line-height: 1;
  text-align: center;
  color: #281A14;
  z-index: 2;
}
/* meta + top border = black line between image and text */
.p1__card-meta {
  display: block;
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 120px;
  overflow: clip;
  background-color: rgb(254, 250, 244);
  border-top: 2px solid rgb(40, 26, 20);
  box-sizing: border-box;
}
.p1__card-commute,
.p1__card-dist,
.p1__card-type,
.p1__card-price {
  display: block;
  position: absolute;
  margin: 0;
  width: max-content;
  white-space: pre;
  height: auto;
  font-family: "獅尾四季春JP", "獅尾四季春 JP", sans-serif;
  color: #281A14;
  line-height: 1.2;
}
/* district — same as .p1__text */
.p1__card-dist {
  top: 20px;
  left: 20px;
  font-weight: 700;
  font-size: 20px;
}
/* price — top/right 20 to match 板橋區 spacing rule */
.p1__card-price {
  top: 20px;
  right: 20px;
  left: auto;
  font-weight: 700;
  font-size: 20px;
}
/* type — same as .p1__text-2 */
.p1__card-type {
  bottom: 38px;
  left: 20px;
  font-weight: 200;
  font-size: 15px;
}
/* commute — same as .p1__6 */
.p1__card-commute {
  bottom: 20px;
  left: 20px;
  font-weight: 200;
  font-size: 15px;
}
.p1__card-blurb {
  display: block;
  position: absolute;
  top: 46px;
  left: 20px;
  right: 20px;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: "獅尾四季春JP", sans-serif;
  font-weight: 200;
  font-size: 12px;
  line-height: 1.2;
  color: rgba(40, 26, 20, 0.72);
}
.p1__typing-phase {
  display: block;
  margin-bottom: 6px;
}
.p1__why-text.is-pending {
  text-align: left;
}
.p1__why-skel {
  display: block;
  height: 12px;
  margin: 0 0 8px;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    rgba(40, 26, 20, 0.08),
    rgba(40, 26, 20, 0.2),
    rgba(40, 26, 20, 0.08)
  );
  background-size: 200% 100%;
  animation: p1Skel 1.1s ease-in-out infinite;
}
.p1__why-skel--short {
  width: 62%;
}
.p1__why-pending {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(40, 26, 20, 0.62);
}
.p1__why-text.is-reveal {
  animation: p1WhyIn 0.35s ease;
}
@keyframes p1Skel {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@keyframes p1WhyIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ========== P4 detail + why (layout inside flip faces) ========== */
.p1__detail {
  border: 2px solid #281A14;
  border-radius: 16px;
  overflow: clip;
}
/* Detail + Why title bars — identical chrome */
.p1__detail-bar,
.p1__why-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 25px;
  background: #72785A;
  border: none;
  border-bottom: 2px solid #281A14; /* junction with light-green body */
  overflow: clip;
  z-index: 2;
}
.sh-close {
  position: absolute;
  right: 10px;
  top: 52%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border: none;
  background: transparent;
  padding: 0;
}
.sh-close svg { display: block; width: 100%; height: 100%; }

/* Same close control on both green bars */
.p1__detail-bar .sh-close,
.p1__why-bar .sh-close {
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #FF5F57;
  display: flex;
  align-items: center;
  justify-content: center;
}
.p1__detail-bar .sh-close svg,
.p1__why-bar .sh-close svg {
  width: 12px;
  height: 12px;
}

.p1__detail-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 575px;
  background: rgb(234, 237, 227);
}
.p1__detail-card {
  position: absolute;
  top: 50px;
  left: 50%;
  width: 500px;
  height: 475px;
  transform: translateX(-50%);
  background: #FEFAF4;
  border-radius: 12px;
  overflow: clip;
}
/* Photo = list card media × 1.5 (200×185 → 300×277.5); radius stays 12 */
.p1__detail-photo {
  position: absolute;
  top: 0;
  left: 0;
  width: 300px;
  height: 277.5px;
  overflow: clip;
  border-radius: 12px;
}
.p1__detail-photo img {
  position: absolute;
  bottom: -45px; /* -30 × 1.5 */
  left: 0;
  width: 330px; /* 220 × 1.5 */
  height: 495px; /* 330 × 1.5 */
  object-fit: cover;
  display: block;
}
/* oval + 01 = list badge × 1.5 (20@10 → 30@15, font 11 → 16.5) */
.p1__detail-badge {
  position: absolute;
  z-index: 2;
  top: 15px;
  left: 15px;
  width: 30px;
  height: 30px;
  margin: 0;
  font-family: "Tenor Sans", sans-serif;
  font-weight: 400;
  font-size: 15px;
  line-height: 1;
  color: #281A14;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* oval + heart = list heart × 1.5 (20@10 + icon 10 → 30@15 + icon 15) */
.p1__detail-heart {
  position: absolute;
  z-index: 3;
  top: 15px;
  right: 15px;
  left: auto;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.p1__detail-heart svg {
  display: block;
  width: 15px;
  height: 15px;
  pointer-events: none;
}
.p1__detail-heart path {
  fill: transparent;
  stroke: #281A14;
  stroke-width: 1.5;
}
.p1__detail-heart.is-liked path,
.p1__detail-heart[aria-pressed="true"] path {
  fill: #FF5F57;
  stroke: #FF5F57;
}

.p1__detail-meta {
  position: absolute;
  right: 0;
  bottom: 187px;
  width: 200px;
  height: 120px;
}
.p1__detail-meta .loc {
  position: absolute;
  top: 7px;
  left: 20px;
  font-family: "獅尾四季春JP", sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: #281A14;
}
.p1__detail-meta .price {
  position: absolute;
  top: 7px;
  right: 20px;
  font-family: "獅尾四季春JP", sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: #281A14;
}
.p1__detail-meta .type {
  position: absolute;
  bottom: 38px;
  left: 20px;
  font-family: "獅尾四季春JP", sans-serif;
  font-weight: 200;
  font-size: 15px;
  color: #281A14;
}
.p1__detail-meta .commute {
  position: absolute;
  bottom: 20px;
  left: 20px;
  font-family: "獅尾四季春JP", sans-serif;
  font-weight: 200;
  font-size: 15px;
  color: #281A14;
}
.p1__book {
  position: absolute;
  bottom: 23px; /* parent .p1__detail-meta 120px → top 51 */
  left: 132px;
  width: 46px;
  height: 46px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  background: #E3B562;
  border: 1px solid #281A14;
  border-radius: 4px;
  box-shadow: 2px 3px 0 #281A14;
  overflow: clip;
  opacity: 1;
  cursor: pointer;
}
.p1__book-line {
  display: block;
  position: absolute;
  left: 8px;
  right: 8px;
  width: max-content;
  margin: 0;
  transform: none;
  font-family: "獅尾四季春JP", sans-serif;
  font-weight: 700; /* Bold */
  font-size: 15px;
  line-height: 1.2em;
  letter-spacing: 0;
  text-align: left;
  color: #281A14;
  opacity: 1;
  white-space: pre;
}
.p1__book-line--top { top: 5px; }
.p1__book-line--bot { top: 23px; bottom: auto; }
.p1__score {
  position: absolute;
  top: 15px;
  right: 20px;
  margin: 0;
  font-family: "獅尾四季春JP", sans-serif;
  font-weight: 700; /* Bold */
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0;
  color: #281A14;
  white-space: pre;
}
.p1__score-star {
  position: absolute;
  top: 50px; /* score bottom (15+30) + 5 */
  right: 142px;
  width: max-content;
  margin: 0;
  font-family: "獅尾四季春JP", sans-serif;
  font-weight: 200; /* ExtraLight */
  font-size: 5px;
  line-height: 1.2em;
  letter-spacing: 0;
  text-align: left;
  color: #281A14;
  opacity: 0.6;
  white-space: pre;
}
.p1__score-note {
  position: absolute;
  top: 50px; /* score bottom (15+30) + 5 */
  right: 22px;
  width: 120px;
  margin: 0;
  font-family: "獅尾四季春JP", sans-serif;
  font-weight: 200; /* ExtraLight */
  font-size: 5px;
  line-height: 1.2em;
  letter-spacing: 0;
  text-align: left;
  color: #281A14;
  opacity: 0.6;
}
.p1__specs {
  position: absolute;
  left: 50%;
  bottom: 20px;
  width: 460px;
  height: 156px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(3, 1fr);
}
.p1__spec {
  position: relative;
  min-width: 0;
  border-right: 0.1px solid rgba(40, 26, 20, 0.6);
  border-bottom: 0.1px solid rgba(40, 26, 20, 0.6);
  padding: 0;
  overflow: hidden;
}
.p1__spec:nth-child(5n) { border-right: none; }
.p1__spec:nth-child(n+11) { border-bottom: none; }
.p1__spec-label {
  position: absolute;
  top: 5px;
  left: 5px;
  width: max-content;
  height: auto;
  margin: 0;
  font-family: "獅尾四季春JP", sans-serif;
  font-weight: 200; /* ExtraLight */
  font-size: 10px;
  line-height: 1.2em;
  letter-spacing: 0;
  text-align: left;
  color: #281A14;
  opacity: 0.6;
  white-space: nowrap;
}
.p1__spec-value {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: max-content; /* grow left from right edge — no max-width squeeze */
  height: auto;
  margin: 0;
  font-family: "獅尾四季春JP", sans-serif;
  font-weight: 200; /* ExtraLight */
  font-size: 15px;
  line-height: 1.2em;
  letter-spacing: 0;
  text-align: left;
  color: #281A14;
  opacity: 1;
  white-space: nowrap;
}
/* Tags area: L/R/B 10; top row right-aligned over bottom-right tag */
.p1__spec-tags {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.p1__spec-tags-top,
.p1__spec-tags-bottom {
  display: flex;
  justify-content: flex-end; /* 靠右 */
  align-items: flex-end;
  gap: 2px;                  /* tag 之間 2 */
}
.p1__spec-tags span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  height: max-content;
  padding: 2px;
  box-sizing: content-box;
  border: none;
  border-radius: 2px;
  box-shadow: none;
  overflow: clip;
  background: #C7CEB6;
  font-family: "獅尾四季春JP", sans-serif;
  font-weight: 200; /* ExtraLight */
  /* 對齊 P4 設計稿可讀性；排法仍為上 1／下最多 3 */
  font-size: 8px;
  line-height: 1.2em;
  letter-spacing: 0;
  text-align: left;
  color: #281A14;
  opacity: 1;
  white-space: nowrap;
}

.p1__why {
  border: 2px solid #281A14;
  border-radius: 16px;
  overflow: clip;
  background: transparent;
}
.p1__why-body {
  position: absolute;
  left: 0;
  top: 25px;
  width: 100%;
  height: 200px;
  overflow: clip;
  background: #EAEDE3;
}
.p1__why-title {
  position: absolute;
  top: 24px;
  left: 35px;
  width: max-content;
  margin: 0;
  font-family: "獅尾四季春JP", sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
  text-align: left;
  color: #281A14;
  opacity: 1;
  white-space: pre;
}
/* Framer text frame: L35 T68 W300（與標題左緣對齊） */
.p1__why-text {
  position: absolute;
  top: 68px;
  left: 35px;
  width: 300px;
  margin: 0;
  transform: none;
  font-family: "獅尾四季春JP", sans-serif;
  font-weight: 200;
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: 0;
  text-align: justify;
  color: #281A14;
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .p1__flip-inner,
  .p1__dropdown-menu,
  .p1__menu-backdrop,
  .p1__rec-track {
    transition: none !important;
  }
}
