/* =========================================================
   PetSaju v6 (ChatGPT 디자인, 2026-09-28 — 대화 「펫사주 모바일 리디자인」)
   기존 CSS 뒤에 로드 / <body class="pv6"> 적용
   모든 선택자는 body.pv6로 스코프
   JS 표시 상태, hidden 속성, .on 토글은 기존 구현 유지
   ========================================================= */

/* 01. 기본 토큰과 화면 */
body.pv6 {
  --pv6-navy: #1B2A5B;
  --pv6-muted: #5B6680;
  --pv6-blue: #2F6BFF;
  --pv6-purple: #7C5CF0;
  --pv6-gold-start: #FFD84D;
  --pv6-gold-end: #F9B91B;
  --pv6-gold-shadow: #E09A00;
  --pv6-sky: #BFE7FF;
  --pv6-sky-light: #F4FBFF;
  --pv6-cream: #FFF9ED;
  --pv6-peach: #FFF0E7;
  --pv6-line: #DCE5F0;
  --pv6-white: #FFFFFF;
  --pv6-radius: 24px;
  --pv6-shadow: 0 12px 32px rgb(27 42 91 / 6%);

  /* 기존 인라인 스타일의 var(--muted)도 톤 연결 */
  --muted: #5B6680;

  margin: 0;
  min-width: 0;
  min-height: 100dvh;
  color: var(--pv6-navy);
  background:
    linear-gradient(
      180deg,
      var(--pv6-sky) 0,
      var(--pv6-sky-light) 350px,
      #FFFDF9 720px
    );
  font-family:
    "Noto Sans KR",
    "Noto Sans JP",
    "Noto Sans SC",
    system-ui,
    sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  isolation: isolate;
}

body.pv6 *,
body.pv6 *::before,
body.pv6 *::after {
  box-sizing: border-box;
}

body.pv6 .wrap {
  width: 100%;
  max-width: 1080px;
  min-width: 0;
  margin: 0 auto;
  padding:
    env(safe-area-inset-top, 0px)
    max(16px, env(safe-area-inset-right, 0px))
    max(24px, env(safe-area-inset-bottom, 0px))
    max(16px, env(safe-area-inset-left, 0px));
}

body.pv6 :where(h1, h2, h3, p, li, label, a, button, summary) {
  overflow-wrap: anywhere;
}

body.pv6 :where(button, input, select, textarea) {
  max-width: 100%;
  min-width: 0;
  font: inherit;
}

body.pv6 :where(button, a, summary, select) {
  -webkit-tap-highlight-color: rgb(47 107 255 / 12%);
  touch-action: manipulation;
}

body.pv6 :where(button, select, summary) {
  cursor: pointer;
}

body.pv6 :where(button, a, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--pv6-blue);
  outline-offset: 3px;
}

body.pv6 :where(button:disabled, input:disabled, select:disabled) {
  cursor: not-allowed;
}

body.pv6 img {
  max-width: 100%;
}

body.pv6 :where(#form, #loading, #result, #sjOvl) {
  min-width: 0;
  scroll-margin-top: 80px;
}

/* 02. 스크립트 삽입 상단바 — 위치·열림 상태는 기존 nav 구현 유지 */
body.pv6 .topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 60px;
  margin: 0;
  padding: 8px 0;
  color: var(--pv6-navy);
  background: rgb(244 251 255 / 96%);
  border: 0;
  border-bottom: 1px solid rgb(27 42 91 / 8%);
  border-radius: 0 0 18px 18px;
  box-shadow: none;
}

body.pv6 .topbar > * {
  min-width: 0;
  max-width: 100%;
}

body.pv6 .topbar a {
  color: var(--pv6-navy);
  text-decoration: none;
}

body.pv6 .topbar :where(button, a) {
  min-height: 44px;
}

body.pv6 .topbar button,
body.pv6 .topbar .tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  max-width: 100%;
  padding: 10px 13px;
  border: 1px solid rgb(27 42 91 / 12%);
  border-radius: 14px;
  color: var(--pv6-navy);
  background: var(--pv6-white);
  box-shadow: 0 2px 0 rgb(27 42 91 / 4%);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
  text-align: center;
}

body.pv6 .topbar button:active,
body.pv6 .topbar .tb-btn:active {
  background: #EDF4FF;
}

/* 03. 히어로 */
body.pv6 .pv6-hero {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 18px 0 16px;
  color: var(--pv6-navy);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  text-align: left;
}

body.pv6 .pv6-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  grid-template-areas:
    "eyebrow eyebrow"
    "title art"
    "lead lead"
    "steps steps";
  gap: 10px 12px;
  min-width: 0;
}

body.pv6 .pv6-hero .pv5-eyebrow {
  grid-area: eyebrow;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: #394C76;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0;
}

body.pv6 .pv6-hero .pv5-h1 {
  grid-area: title;
  align-self: center;
  position: static;
  width: auto;
  height: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
  clip: auto;
  clip-path: none;
  color: var(--pv6-navy);
  font-size: clamp(24px, 6.1vw, 28px);
  font-weight: 800;
  line-height: 1.32;
  letter-spacing: -0.035em;
  word-break: keep-all;
  overflow-wrap: anywhere;
  text-align: left;
}

body.pv6 .pv6-hero .pv5-h1 strong {
  color: var(--pv6-navy);
  font-weight: 800;
  background:
    linear-gradient(
      transparent 68%,
      rgb(255 216 77 / 65%) 68%,
      rgb(255 216 77 / 65%) 94%,
      transparent 94%
    );
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

body.pv6 .pv6-art {
  grid-area: art;
  align-self: center;
  width: 100%;
  aspect-ratio: 1;
  min-width: 0;
  overflow: hidden;
  border-radius: 26%;
  background: var(--pv6-cream);
}

body.pv6 .pv6-art img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}

body.pv6 .pv6-hero .pv5-lead {
  grid-area: lead;
  width: auto;
  max-width: none;
  margin: 0;
  color: #4B5D79;
  font-size: 13px;
  line-height: 1.65;
  letter-spacing: 0;
  word-break: normal;
}

body.pv6 .pv6-hero .pv5-steps {
  grid-area: steps;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

body.pv6 .pv6-hero .pv5-steps li {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
  min-height: 40px;
  margin: 0;
  padding: 7px;
  border: 1px solid rgb(27 42 91 / 8%);
  border-radius: 12px;
  color: #4B5D79;
  background: rgb(255 255 255 / 72%);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
}

body.pv6 .pv6-hero .pv5-steps li::before,
body.pv6 .pv6-hero .pv5-steps li::after {
  content: none;
}

body.pv6 .pv6-hero .pv5-steps li:first-child {
  color: var(--pv6-navy);
  background: var(--pv6-cream);
  border-color: #E9D9AB;
}

body.pv6 .pv6-step-no {
  display: inline-flex;
  flex: 0 0 20px;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: var(--pv6-navy);
  background: #E8EFF9;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

body.pv6 .pv5-steps li:first-child .pv6-step-no {
  background: var(--pv6-gold-start);
}

/* 04. 공통 카드 */
body.pv6 #form,
body.pv6 #result {
  width: 100%;
  max-width: 760px;
  margin: 0 auto 24px;
  padding: 0;
}

body.pv6 #form > .card,
body.pv6 #result > .card,
body.pv6 #loading.card {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--pv6-line);
  border-radius: var(--pv6-radius);
  color: var(--pv6-navy);
  background: var(--pv6-white);
  box-shadow: var(--pv6-shadow);
}

/* 05. 사진 업로드 */
body.pv6 #form .drop {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 16px 12px;
  border: 2px dashed #A6BDE8;
  border-radius: 18px;
  color: var(--pv6-navy);
  background: linear-gradient(155deg, #F1F8FF, #FFF9ED);
  text-align: center;
  transition:
    border-color 160ms ease,
    background-color 160ms ease;
}

body.pv6 #form .drop:focus-within {
  border-color: var(--pv6-blue);
}

body.pv6 #form .drop .ico {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin: 0 auto 8px;
  border: 1px solid #F0E1BD;
  border-radius: 14px;
  background: #FFFFFF;
  font-size: 24px;
  line-height: 1;
}

body.pv6 #form .drop .t {
  margin: 0;
  color: var(--pv6-navy);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: -0.025em;
}

body.pv6 #form .drop .s {
  margin: 6px 0 0;
  color: var(--pv6-muted);
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

body.pv6 #form .pick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  margin: 14px 0 0;
}

body.pv6 #form .pick button {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 11px 7px;
  border: 1px solid #C6D5EB;
  border-radius: 12px;
  color: var(--pv6-navy);
  background: var(--pv6-white);
  box-shadow: 0 2px 0 rgb(27 42 91 / 5%);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}

body.pv6 #form #btnAlbum {
  border-color: var(--pv6-blue);
  color: #FFFFFF;
  background: var(--pv6-blue);
}

body.pv6 #form .pick button:active {
  transform: translateY(1px);
  box-shadow: none;
}

/* 표시 여부는 기존 #preview 규칙과 JS 유지 */
body.pv6 #form #preview {
  width: 100%;
  min-width: 0;
  margin: 16px 0 0;
  padding: 12px;
  border: 1px solid var(--pv6-line);
  border-radius: 16px;
  background: #F7FAFF;
  text-align: center;
}

body.pv6 #form #pv {
  width: 100%;
  max-height: 280px;
  margin: 0 auto;
  border-radius: 12px;
  object-fit: contain;
  vertical-align: middle;
}

body.pv6 #form .fname {
  margin-top: 8px;
  color: var(--pv6-muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* 06. 이름 입력·종류 선택 */
body.pv6 #form .lb {
  display: block;
  margin: 22px 0 8px;
  color: var(--pv6-navy);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

body.pv6 #form #name,
body.pv6 #sjOvl input,
body.pv6 #sjOvl select {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #C8D3E2;
  border-radius: 13px;
  color: var(--pv6-navy);
  background-color: #FFFFFF;
  box-shadow: none;
  font-size: 16px;
  line-height: 1.5;
}

body.pv6 #form #name::placeholder,
body.pv6 #sjOvl input::placeholder {
  color: #707C91;
  opacity: 1;
}

body.pv6 #form #name:focus,
body.pv6 #sjOvl input:focus,
body.pv6 #sjOvl select:focus {
  border-color: var(--pv6-blue);
}

body.pv6 #form .seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 5px;
  border: 1px solid #E0E7F0;
  border-radius: 16px;
  background: #F0F4F9;
}

body.pv6 #form .seg button {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  margin: 0;
  padding: 10px 5px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #53617C;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}

body.pv6 #form .seg button.sel {
  border-color: #A5B9E6;
  color: var(--pv6-navy);
  background: #FFFFFF;
  box-shadow:
    inset 0 -3px 0 var(--pv6-blue),
    0 2px 6px rgb(27 42 91 / 7%);
  font-weight: 800;
}

body.pv6 #form .seg button:active {
  background: #E4EDFF;
}

/* 07. 메인 CTA와 안내 */
body.pv6 #form .go,
body.pv6 #sjOvl .sj-go {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  margin: 24px 0 4px;
  padding: 14px 16px;
  border: 1px solid #E8AC18;
  border-radius: 16px;
  color: var(--pv6-navy);
  background:
    linear-gradient(
      180deg,
      var(--pv6-gold-start),
      var(--pv6-gold-end)
    );
  box-shadow: 0 4px 0 var(--pv6-gold-shadow);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease;
}

body.pv6 #form .go:disabled,
body.pv6 #sjOvl .sj-go:disabled {
  border-color: #DFE5ED;
  color: #69758A;
  background: #E9EDF3;
  box-shadow: none;
  opacity: 1;
  transform: none;
  cursor: not-allowed;
}

body.pv6 #form .go:not(:disabled):active,
body.pv6 #sjOvl .sj-go:not(:disabled):active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--pv6-gold-shadow);
}

body.pv6 #form .note {
  margin: 16px 0 0;
  color: var(--pv6-muted);
  font-size: 11px;
  line-height: 1.8;
  text-align: center;
  overflow-wrap: anywhere;
}

/* 고정 줄바꿈 대신 화면 폭과 번역 길이에 따라 자연스럽게 배치 */
body.pv6 #form .note br {
  display: none;
}

body.pv6 #form .err,
body.pv6 #sjOvl .err {
  color: #A3293D;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

body.pv6 #form .err:not(:empty),
body.pv6 #sjOvl .err:not(:empty) {
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid #F2CCD2;
  border-radius: 12px;
  background: #FFF3F5;
}

/* 08. 로딩 — #loading의 display는 지정하지 않음, 기존 .spin 회전 애니메이션 유지 */
body.pv6 #loading.card {
  max-width: 760px;
  margin: 0 auto 24px;
  padding: 44px 20px;
  background: linear-gradient(180deg, #FFFFFF, #FFF9ED);
  text-align: center;
}

body.pv6 .spin {
  width: 38px;
  height: 38px;
  margin: 0 auto 18px;
  border: 3px solid #E3EAF5;
  border-top-color: var(--pv6-purple);
  border-radius: 50%;
}

body.pv6 .lmsg {
  margin: 0;
  color: var(--pv6-navy);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

body.pv6 .lsub {
  margin-top: 8px;
  color: var(--pv6-muted);
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

/* 09. 관상 결과 */
body.pv6 #result .rhead {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 0 0 26px;
  padding: 12px 0 24px;
  border-bottom: 1px solid #E8EDF4;
  text-align: center;
}

body.pv6 #result #rimg {
  display: block;
  flex: none;
  width: 132px;
  height: 132px;
  aspect-ratio: 1;
  margin: 0;
  border: 5px solid #FFFFFF;
  border-radius: 32px;
  outline: 1px solid #E7D8BC;
  background: var(--pv6-cream);
  box-shadow: 0 8px 22px rgb(27 42 91 / 9%);
  object-fit: cover;
}

body.pv6 #result .rname {
  max-width: 100%;
  margin: 0;
  color: var(--pv6-navy);
  font-size: 23px;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

body.pv6 #result .reading,
body.pv6 #sjOvl .reading {
  min-width: 0;
  color: #35435F;
  font-size: 15px;
  line-height: 1.9;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

body.pv6 #result .reading h3,
body.pv6 #sjOvl .reading h3 {
  margin: 30px 0 12px;
  padding: 0 0 0 12px;
  border-left: 4px solid #B6A4F5;
  color: var(--pv6-navy);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.55;
  letter-spacing: -0.02em;
}

body.pv6 #result .reading h3:first-child,
body.pv6 #sjOvl .reading h3:first-child {
  margin-top: 0;
}

body.pv6 #result .reading p,
body.pv6 #sjOvl .reading p {
  margin: 0 0 18px;
}

body.pv6 #result .reading em,
body.pv6 #sjOvl .reading em {
  color: #6342C1;
  background: #F3EEFF;
  font-style: normal;
  font-weight: 700;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

body.pv6 #result .reading strong,
body.pv6 #sjOvl .reading strong {
  color: var(--pv6-navy);
  font-weight: 800;
}

body.pv6 #result .reading ul,
body.pv6 #result .reading ol,
body.pv6 #sjOvl .reading ul,
body.pv6 #sjOvl .reading ol {
  margin: 12px 0 20px;
  padding-inline-start: 23px;
}

body.pv6 #result .reading li,
body.pv6 #sjOvl .reading li {
  margin-bottom: 8px;
}

/* 10. 관찰 특징 */
body.pv6 #result details {
  margin: 26px 0 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--pv6-line);
  border-radius: 16px;
  background: #F7FAFE;
}

body.pv6 #result summary {
  min-height: 48px;
  margin: 0;
  padding: 14px 16px;
  color: var(--pv6-navy);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

body.pv6 #result summary::marker {
  color: var(--pv6-purple);
}

body.pv6 #result details[open] summary {
  border-bottom: 1px solid #E3EAF3;
}

body.pv6 #result .ft {
  min-width: 0;
  padding: 16px;
  color: var(--pv6-muted);
  font-size: 13px;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

/* 11. 교차판매·커뮤니티 */
body.pv6 #result .xsell {
  margin: 24px 0 0;
  padding: 18px;
  border: 1px solid #E7DDF6;
  border-radius: 18px;
  background: #F8F5FF;
}

/* 기존 인라인 padding-top:0에도 내용 상단 호흡 유지 */
body.pv6 #result .xsell .h {
  margin: 0;
  padding-top: 4px;
  color: var(--pv6-navy);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.6;
}

body.pv6 #result .xsell .d {
  margin: 8px 0 0;
  color: var(--pv6-muted);
  font-size: 13px;
  line-height: 1.75;
}

body.pv6 #result .xsell .row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

body.pv6 #result .xsell .row a {
  display: inline-flex;
  flex: 1 1 76px;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  max-width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #D7CEEA;
  border-radius: 12px;
  color: var(--pv6-navy);
  background: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  white-space: normal;
}

body.pv6 #result .xsell .row a:active {
  background: #EEE8FF;
}

/* 12. 사주 추가 풀이 카드 — 기존 가격 문구 유지 */
body.pv6 #result .sj-card {
  min-width: 0;
  margin: 18px 0 0;
  padding: 20px 18px;
  border: 1px solid #ECCFB8;
  border-radius: 18px;
  color: var(--pv6-navy);
  background: linear-gradient(135deg, var(--pv6-cream), var(--pv6-peach));
  box-shadow: 0 3px 0 #F3E3D2;
  cursor: pointer;
  touch-action: manipulation;
}

body.pv6 #result .sj-card .t {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.5;
}

body.pv6 #result .sj-card .d {
  margin: 9px 0 0;
  color: #675D59;
  font-size: 13px;
  line-height: 1.8;
}

body.pv6 #result .sj-card .p {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid #EBD9C4;
  color: var(--pv6-navy);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.65;
}

body.pv6 #result .sj-card:active {
  background: #FFF0DE;
}

/* 13. 결과 하단 버튼 */
body.pv6 #result .acts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 24px 0 4px;
}

body.pv6 #result .acts button {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  margin: 0;
  padding: 12px 10px;
  border: 1px solid #C6D2E6;
  border-radius: 14px;
  color: var(--pv6-navy);
  background: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  white-space: normal;
}

body.pv6 #result .acts .pri {
  border-color: #E8AC18;
  background: linear-gradient(180deg, #FFD84D, #F9B91B);
  box-shadow: 0 3px 0 var(--pv6-gold-shadow);
}

body.pv6 #result .acts button:active {
  transform: translateY(1px);
}

/* 14. 공통 오버레이 톤 — display / visibility / pointer-events / z-index는 기존 규칙 유지 */
body.pv6 .ovl,
body.pv6 .sj-ovl {
  background-color: rgb(15 27 61 / 52%);
}

/* 15. 사주 바텀시트 — .on 클래스에 의한 기존 표시/숨김 동작 유지 */
body.pv6 #sjOvl {
  position: fixed;
  inset: 0;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  height: 100dvh;
  margin: 0;
  padding:
    max(12px, env(safe-area-inset-top, 0px))
    0
    0;
  overflow: hidden;
  overscroll-behavior: contain;
}

body.pv6 #sjOvl .sj-sheet {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  max-width: 680px;
  max-height: 100%;
  min-width: 0;
  margin: 0 auto;
  padding:
    12px
    max(20px, env(safe-area-inset-right, 0px))
    max(24px, env(safe-area-inset-bottom, 0px))
    max(20px, env(safe-area-inset-left, 0px));
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #E0E6EE;
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  color: var(--pv6-navy);
  background: #FFFDF9;
  box-shadow: 0 -16px 48px rgb(15 27 61 / 18%);
  transform: translateY(18px);
  transition: transform 200ms ease;
}

body.pv6 #sjOvl.on .sj-sheet {
  transform: translateY(0);
}

body.pv6 #sjOvl .sj-sheet::before {
  content: "";
  display: block;
  width: 36px;
  height: 4px;
  margin: 0 auto 20px;
  border-radius: 99px;
  background: #CDD5E2;
}

body.pv6 #sjOvl h2 {
  margin: 0 0 8px;
  color: var(--pv6-navy);
  font-size: 23px;
  font-weight: 800;
  line-height: 1.45;
  letter-spacing: -0.025em;
}

body.pv6 #sjOvl .sub {
  margin: 0 0 24px;
  color: var(--pv6-muted);
  font-size: 13px;
  line-height: 1.75;
}

body.pv6 #sjOvl .sj-f {
  min-width: 0;
  margin: 0 0 22px;
}

body.pv6 #sjOvl .sj-f > label {
  display: block;
  margin: 0 0 8px;
  color: var(--pv6-navy);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
}

body.pv6 #sjOvl .sj-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}

/* .grow는 폭만 지정. sjDate/sjAge 표시 여부는 JS 유지 */
body.pv6 #sjOvl .sj-row > *,
body.pv6 #sjOvl .grow {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

body.pv6 #sjOvl select {
  padding-inline-end: 32px;
}

body.pv6 #sjOvl input[type="date"],
body.pv6 #sjOvl input[type="time"] {
  min-width: 0;
  max-width: 100%;
  appearance: none;
  -webkit-appearance: none;
}

body.pv6 #sjOvl input::-webkit-date-and-time-value {
  min-width: 0;
  text-align: start;
}

body.pv6 #sjOvl .sj-hint {
  margin-top: 7px;
  color: var(--pv6-muted);
  font-size: 12px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

body.pv6 #sjOvl #sjX {
  min-width: 88px;
  min-height: 44px;
  max-width: 100%;
  border-radius: 12px;
  line-height: 1.5;
}

body.pv6 #sjOvl .sj-pill {
  width: fit-content;
  max-width: 100%;
  margin: 12px 0 24px;
  padding: 8px 12px;
  border: 1px solid #E0D6F7;
  border-radius: 14px;
  color: #6148A5;
  background: #F3EEFF;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

/* 16. 기존 안내 푸터 + 삽입 푸터 */
body.pv6 .wrap > footer,
body.pv6 footer.pn-footer {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 28px auto 0;
  padding: 24px 12px;
  border: 0;
  border-top: 1px solid #E1E7EF;
  border-radius: 0;
  color: var(--pv6-muted);
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  line-height: 1.85;
  text-align: center;
  overflow-wrap: anywhere;
}

body.pv6 footer.pn-footer {
  padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
  background: #F1F7FC;
  border: 1px solid #E0E9F3;
  border-radius: 20px;
}

body.pv6 footer.pn-footer :where(p, small, span, li) {
  color: inherit;
}

body.pv6 .wrap > footer a,
body.pv6 footer.pn-footer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  max-width: 100%;
  padding: 6px 8px;
  color: #3D5485;
  font-weight: 600;
  line-height: 1.6;
  text-decoration: underline;
  text-decoration-color: #BBC8DF;
  text-underline-offset: 3px;
  white-space: normal;
}

/* 17. 조금 더 넓은 모바일 */
@media (min-width: 390px) {
  body.pv6 .pv6-intro {
    grid-template-columns: minmax(0, 1fr) 100px;
  }

  body.pv6 .pv6-hero .pv5-steps li {
    gap: 7px;
    padding: 8px;
    font-size: 12px;
  }
}

/* 18. 태블릿·PC 확장 */
@media (min-width: 768px) {
  body.pv6 .wrap {
    padding-right: max(32px, env(safe-area-inset-right, 0px));
    padding-left: max(32px, env(safe-area-inset-left, 0px));
  }

  body.pv6 .topbar {
    min-height: 72px;
    padding: 12px 0;
  }

  body.pv6 .pv6-hero {
    padding: 36px 0 32px;
  }

  body.pv6 .pv6-intro {
    grid-template-columns: minmax(0, 1fr) 240px;
    grid-template-areas:
      "eyebrow art"
      "title art"
      "lead art"
      "steps art";
    gap: 14px 32px;
    align-items: start;
    max-width: 920px;
    margin: 0 auto;
  }

  body.pv6 .pv6-hero .pv5-eyebrow {
    font-size: 13px;
  }

  body.pv6 .pv6-hero .pv5-h1 {
    align-self: start;
    font-size: 40px;
    line-height: 1.3;
  }

  body.pv6 .pv6-hero .pv5-lead {
    max-width: 560px;
    font-size: 15px;
    line-height: 1.8;
  }

  body.pv6 .pv6-art {
    align-self: center;
    border-radius: 28%;
  }

  body.pv6 .pv6-hero .pv5-steps {
    max-width: 520px;
    gap: 10px;
    margin-top: 4px;
  }

  body.pv6 .pv6-hero .pv5-steps li {
    min-height: 44px;
    padding: 10px;
    font-size: 12px;
  }

  body.pv6 #form > .card,
  body.pv6 #result > .card {
    padding: 28px;
    border-radius: 28px;
  }

  body.pv6 #form .drop {
    padding: 24px;
  }

  body.pv6 #form .drop .t {
    font-size: 21px;
  }

  body.pv6 #form .drop .s {
    font-size: 14px;
  }

  body.pv6 #form .pick {
    max-width: 460px;
    margin-right: auto;
    margin-left: auto;
    gap: 12px;
  }

  body.pv6 #form .pick button {
    font-size: 14px;
  }

  body.pv6 #form .seg button {
    font-size: 15px;
  }

  body.pv6 #result .reading,
  body.pv6 #sjOvl .reading {
    font-size: 16px;
  }

  body.pv6 #result .rname {
    font-size: 26px;
  }

  body.pv6 #result .xsell,
  body.pv6 #result .sj-card {
    padding: 22px;
  }

  body.pv6 #sjOvl {
    padding: 24px;
  }

  body.pv6 #sjOvl .sj-sheet {
    top: 50%;
    bottom: auto;
    width: calc(100% - 48px);
    max-height: calc(100dvh - 48px);
    padding: 28px 32px;
    border: 1px solid #E0E6EE;
    border-radius: 26px;
    transform: translateY(calc(-50% + 18px));
  }

  body.pv6 #sjOvl.on .sj-sheet {
    transform: translateY(-50%);
  }

  body.pv6 #sjOvl .sj-sheet::before {
    content: none;
  }

  body.pv6 #sjOvl .sj-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  }
}

/* 19. 모션 감소 설정 */
@media (prefers-reduced-motion: reduce) {
  body.pv6 #form .drop,
  body.pv6 #form .go,
  body.pv6 #sjOvl .sj-go,
  body.pv6 #sjOvl .sj-sheet {
    transition: none;
  }

  body.pv6 .spin {
    animation: none;
  }

  body.pv6 #form .pick button:active,
  body.pv6 #form .go:not(:disabled):active,
  body.pv6 #sjOvl .sj-go:not(:disabled):active,
  body.pv6 #result .acts button:active {
    transform: none;
  }
}

/* 20. Claude 적용 보정 (2026-09-28)
   - 960px 이상에서는 기존 pet-playful.css가 「왼쪽 소개 + 오른쪽 사진 올리기 카드」 2단을 쓰므로,
     소개 칸이 좁아진 상태에 맞춰 히어로 내부를 모바일형 배치로 되돌린다.
   - 안내문 <br>을 숨기면 한국어 두 줄이 띄어쓰기 없이 붙으므로 줄바꿈을 유지한다. */
body.pv6 #form .note br {
  display: inline;
}

@media (min-width: 960px) {
  body.pv6 .pv6-intro {
    grid-template-columns: minmax(0, 1fr) 132px;
    grid-template-areas:
      "eyebrow eyebrow"
      "title art"
      "lead lead"
      "steps steps";
    gap: 14px 18px;
    max-width: none;
    margin: 0;
  }

  body.pv6 .pv6-hero .pv5-h1 {
    align-self: center;
    font-size: 34px;
  }

  body.pv6 .pv6-hero .pv5-steps li {
    font-size: 13px;
  }
}

/* 상단바: 긴 언어(스페인어 "Iniciar sesión")에서 로그인 버튼이 둘째 줄로 떨어지지 않게 한 줄 유지 */
body.pv6 .topbar {
  flex-wrap: nowrap;
}

body.pv6 .topbar button,
body.pv6 .topbar .tb-btn {
  white-space: nowrap;
}

@media (max-width: 430px) {
  body.pv6 .topbar {
    gap: 4px;
  }

  body.pv6 .topbar button,
  body.pv6 .topbar .tb-btn {
    padding: 8px 10px;
  }
}
