/* 대화형 입력. Full-width webtoon cuts with inked bubbles. The guide's lines are outlined
   white balloons; the customer's answers are dark notes on the right. */
body:has(.talk-flow-page) { padding: 0; background: var(--ivory); }
body:has(.talk-flow-page) :is(.site-header, .site-footer, .mobile-nav) { display: none; }
body:has(.talk-flow-page) #main { min-height: 0; margin: 0; padding: 0; }
.page.talk-flow-page { width: 100%; max-width: none; margin: 0; padding: 0; animation: none; }

.talk-flow {
  --talk-ink: #1f1a17;
  --talk-note: #3f2a1d;
  --mood: #f3e6d0;
  position: fixed; inset: 0; display: flex; flex-direction: column; width: 100%; max-width: 448px;
  margin-inline: auto; overflow: hidden; background: var(--paper) url("/assets/hanji-v1/hanji-tile.webp") 0 0 / 480px repeat; color: var(--ink); word-break: keep-all;
}
.talk-flow button { font-family: inherit; }
/* Each guide's colour field, taken from their clothes. */
.talk-flow[data-guide="bond"] { --mood: #f7e2d8; }
.talk-flow[data-guide="chief"] { --mood: #dde3ee; }
.talk-flow[data-guide="serpent"] { --mood: #eadff0; }
.talk-flow[data-guide="moon"] { --mood: #e2e3f2; }
.talk-flow[data-guide="tiger"] { --mood: #ebe7e1; }
.talk-flow[data-guide="mystery"] { --mood: #e2e3e5; }
.talk-flow[data-guide="earth"] { --mood: #ebe8d0; }
.talk-flow[data-guide="sky"] { --mood: #d9ecf6; }

.talk-top { flex: none; display: flex; align-items: center; height: 52px; padding: 0 16px 0 4px; }
.talk-back { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: var(--ink); cursor: pointer; }
.talk-thread { position: relative; flex: 1; height: 44px; margin-left: 4px; }
.talk-thread-knots { position: absolute; inset: 0; }
.talk-thread-line { position: absolute; inset: 26px 0 auto; height: 12px; }
.talk-thread-line svg { display: block; width: 100%; height: 12px; overflow: visible; }
.talk-thread-knot { position: absolute; top: 28px; width: 9px; height: 9px; margin-left: -4.5px; box-sizing: border-box; border: 1.5px solid var(--brand); border-radius: 50%; background: var(--paper); }
.talk-thread-knot.is-reached { background: var(--brand); }
.talk-thread-fox { position: absolute; top: 1px; width: 30px; height: 30px; margin-left: -15px; transition: left .6s cubic-bezier(.3, 1.3, .5, 1); }

.talk-flow > [data-generation-unavailable] { flex: none; margin: 0; padding: 10px 16px; border: 0; border-radius: 0; background: var(--blush); font-size: 14px; line-height: 1.45; color: var(--ink); }
.talk-strip { position: relative; flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 24px; padding: 0 16px; scrollbar-width: none; overscroll-behavior: contain; }
.talk-strip::-webkit-scrollbar { display: none; }
.talk-strip > .talk-group:last-child { min-height: 100%; box-sizing: border-box; padding-bottom: 12px; }
.talk-group { position: relative; flex: none; display: flex; flex-direction: column; animation: talk-rise .42s ease both; }

/* Cuts run to the edges of the column, the way panels do in a webtoon. */
.talk-cut { position: relative; flex: none; margin-inline: -16px; overflow: hidden; background: var(--mood); }
.talk-cut img { position: absolute; max-width: none; }
.talk-cut-room { inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 62% 30%; }
.talk-cut-guide { animation: talk-breathe 4.5s ease-in-out infinite alternate; }
/* Anchored at the head, so a short screen trims the waist and never the face. */
.talk-cut-welcome { height: min(440px, 54svh); }
/* Questions come with a taller sheet, so the opening cut leaves room for the face. */
.talk-cut-welcome.talk-cut-short { height: min(388px, 46svh); }
.talk-cut-welcome .talk-cut-guide { right: -22px; top: 10px; width: 360px; }
.talk-cut-welcome .talk-cut-pose { top: 6px; right: -44px; width: 446px; height: 446px; }
.talk-cut-welcome .talk-cut-fox { left: 4px; bottom: 0; width: 104px; }
.talk-cut-reply { height: 244px; }
.talk-cut-reply .talk-cut-guide { right: 0; top: 4px; width: 300px; height: 300px; object-fit: cover; }
.talk-cut-question { height: 268px; }
.talk-cut-question .talk-cut-room { object-position: 20% 20%; }
.talk-cut-question .talk-cut-guide { left: -2px; top: 10px; width: 262px; }
.talk-cut-question .talk-cut-pose { top: 6px; left: -14px; bottom: auto; width: 276px; height: 276px; }
.talk-cut-question .talk-cut-fox { right: 6px; bottom: 0; width: 100px; }
.talk-cut-finish { height: 400px; }
.talk-cut-finish .talk-cut-pose { right: -30px; bottom: 0; width: 372px; height: 372px; }
.talk-cut-finish .talk-cut-fox { left: 4px; bottom: 0; width: 108px; }
.talk-cut-scene { inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 24%; }

/* Hand-inked balloon, stretched by its middle so the corners and the line keep their weight. */
.talk-bubble {
  position: relative; flex: none; align-self: flex-start; width: max-content; max-width: 100%; box-sizing: border-box; margin: 0; padding: 2px 10px;
  border: 12px solid transparent; border-image: url("/assets/hanji-v1/bubble.webp") 90 fill / 21px stretch; color: var(--talk-ink);
  font-size: 16px; font-weight: 600; line-height: 1.42; letter-spacing: -.01em; text-align: center; z-index: 1; animation: talk-pop .36s ease both; animation-delay: .5s;
}
.talk-bubble > span { display: block; }
.talk-bubble-lead { margin-top: -30px; font-weight: 700; z-index: 2; animation-delay: .22s; }
.talk-bubble-lead::before { content: ''; position: absolute; top: -50px; left: var(--tail, 20px); width: 22px; height: 42px; background: url("/assets/hanji-v1/tail.webp") center bottom / 100% 100% no-repeat; }
.talk-bubble-start { align-self: flex-start; }
.talk-bubble-end { align-self: flex-end; }
.talk-bubble-end.talk-bubble-lead::before { left: auto; right: 34px; transform: scaleX(-1); }
.talk-group > .talk-bubble:not(.talk-bubble-lead) { margin-top: 8px; }
.talk-group > .talk-bubble-lead + .talk-bubble { margin-top: -3px; margin-left: 12px; }
.talk-group > .talk-bubble-lead + .talk-bubble-end { margin-right: 12px; margin-left: 0; }
.talk-bubble-under-guide { margin-left: 8px; }
.talk-cut-reply + .talk-bubble-lead { --tail: calc(100% - 92px); }

/* The customer's side of the conversation. */
.talk-answer { flex: none; align-self: flex-end; display: flex; flex-direction: row-reverse; align-items: flex-end; gap: 4px; max-width: 100%; animation: talk-rise .28s ease both; }
.talk-note { min-width: 0; padding: 2px 6px; border: 11px solid transparent; border-image: url("/assets/hanji-v1/note.webp") 40 fill / 12px stretch; color: #fbf4e8; font-size: 15px; font-weight: 600; line-height: 1.42; }
.talk-note > div { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.talk-note strong { font-weight: 700; }
.talk-note strong ~ span { font-size: 14px; font-weight: 500; color: #e4d6c3; }
.talk-edit { flex: none; min-height: 44px; padding: 0 8px; border: 0; background: none; font-size: 13px; color: var(--muted); cursor: pointer; }
.talk-edit:hover { color: var(--ink); }

.talk-thinking { display: flex; gap: 5px; padding: 5px 12px; animation-delay: 0s; }
.talk-thinking span { width: 7px; height: 7px; border-radius: 50%; background: var(--talk-ink); animation: talk-dot 1s infinite; }
.talk-thinking span:nth-child(2) { animation-delay: .16s; }
.talk-thinking span:nth-child(3) { animation-delay: .32s; }

/* The sheet with whatever the customer answers next. It floats over the strip. */
.talk-dock { position: relative; z-index: 2; flex: none; max-height: 74%; margin-top: -18px; overflow-y: auto; padding: 38px 16px calc(16px + env(safe-area-inset-bottom)); background: url("/assets/hanji-v1/sheet.webp") top center / 100% auto no-repeat, linear-gradient(transparent 180px, #efe5d2 180px); outline: none; animation: talk-sheet .34s cubic-bezier(.2, .9, .3, 1) both; } /* taste-skill: a floating sheet */
.talk-dock[hidden] { display: none; }
.talk-slips { display: flex; flex-direction: column; gap: 8px; }
.talk-slip { display: flex; align-items: center; justify-content: center; min-height: 58px; padding: 2px 8px; border: 13px solid transparent; border-image: url("/assets/hanji-v1/slip-bright.webp") 44 fill / 15px stretch; background: none; color: var(--talk-ink); font-size: 16px; font-weight: 600; line-height: 1.35; text-align: center; cursor: pointer; animation: talk-rise .34s ease both; animation-delay: var(--slip-delay, 0s); transition: filter .15s ease; }
.talk-slip:hover { filter: brightness(.97); }
.talk-slip:active { filter: brightness(.88); }
.talk-slip:focus-visible, .talk-segment-item:focus-visible, .talk-edit:focus-visible, .talk-skip:focus-visible { outline: 3px solid #e0b466; outline-offset: 2px; }
.talk-skip { display: block; min-height: 44px; margin: 4px auto -8px; padding: 0 12px; border: 0; background: none; color: var(--muted); font-size: 14px; cursor: pointer; }
.talk-skip:hover { color: var(--ink); }

.talk-note-heading { margin: 0 0 10px; font-size: 16px; font-weight: 700; color: var(--ink); }
.talk-saved-note { display: flex; flex-direction: column; gap: 2px; margin: 0 0 12px; padding: 14px 16px; border-radius: 16px; background: #fff; font-size: 15px; line-height: 1.45; color: var(--muted); }
.talk-saved-note[hidden] { display: none; }
.talk-saved-note strong { font-size: 17px; color: var(--ink); }
.talk-dock-note .self-profile-summary { display: none; }
.talk-dock-note .self-profile-edit-actions { margin: 0; padding: 0; border: 0; background: none; }
.talk-dock-note .self-profile-edit-actions .secondary-button { display: none; }
.talk-dock-note .profile-register-note { margin: -4px 0 10px; font-size: 13px; color: var(--muted); }
.talk-dock-note .profile-flow-status { margin: 0 0 8px; font-size: 14px; color: var(--muted); }
.talk-dock-note fieldset { min-width: 0; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; }
.talk-dock-note fieldset[hidden] { display: none; }
.talk-dock-note fieldset.form-partner { padding-top: 0 !important; border-top: 0 !important; }
.talk-dock-note .partner-profile-tools { gap: 8px; margin: 0 0 8px; }
.talk-dock-note .partner-profile-tools .checkbox-label { font-size: 14px; color: var(--ink); }
.talk-dock-note legend, .talk-dock-note .birth-time-help { display: none; }
.talk-dock-note .field-grid { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.talk-dock-note .field { display: block; margin: 0; min-width: 0; }
.talk-dock-note .field[hidden] { display: none; }
.talk-dock-note .field > label, .talk-date-heading > label, .talk-dock-note .field-heading > label:first-child { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); }
.talk-dock-note .field:has(> [id$="-name"]) { display: flex; flex-direction: row; align-items: center; gap: 10px; }
.talk-dock-note .field:has(> [id$="-name"]) > label { flex: none; white-space: nowrap; }
.talk-dock-note .field:has(> [id$="-name"]) > input { flex: 1; min-width: 0; }
.talk-flow :is(.talk-dock-note, .talk-dock-question) :is(input[type="text"], input[type="search"], select, textarea) {
  width: 100%; min-width: 0; box-sizing: border-box; border: 0; border-radius: 12px; background: #fff; color: var(--ink); font-size: 16px; font-family: inherit;
}
.talk-dock-note :is(input[type="text"], select) { height: 46px; min-height: 46px; padding: 0 12px; }
.talk-dock-note select:disabled { background: #efe9df; color: var(--muted); }
.talk-flow ::placeholder { font-size: 15px; color: var(--muted); opacity: 1; }
.talk-dock-note .field-heading, .talk-date-heading { display: flex; align-items: center; justify-content: space-between; min-height: 40px; margin: 0; }
.talk-dock-note .field-heading .checkbox-label { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; }
.talk-dock-note .field-heading .checkbox-label input { width: 18px; height: 18px; margin: 0; accent-color: var(--talk-note); }
.talk-flow .talk-dock-note :is(.birth-date-pickers, .birth-time-pickers) { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 6px; }
.talk-flow .talk-dock-note :is(.birth-date-pickers, .birth-time-pickers) > select { grid-column: auto; }
.talk-dock-note .talk-actions { position: sticky; bottom: 0; z-index: 3; padding-top: 8px; background: #efe5d2; }
.talk-dock-note .birth-time-pickers[hidden] { display: none; }
.talk-date-options { display: flex; align-items: center; gap: 4px; }
.talk-date-options .checkbox-label[hidden] { display: none; }
.talk-segment { display: flex; }
.talk-segment-boxes { gap: 6px; }
.talk-segment-boxes .talk-segment-item { flex: 1; height: 44px; border: 0; border-radius: 12px; background: #fff; color: var(--ink); font-size: 15px; font-weight: 600; cursor: pointer; }
.talk-segment-boxes .talk-segment-item[aria-pressed="true"] { background: var(--talk-note); color: #fbf4e8; }
.talk-segment-text .talk-segment-item { height: 44px; padding: 0 8px; border: 0; background: none; color: var(--muted); font-size: 14px; font-weight: 500; cursor: pointer; }
.talk-segment-text .talk-segment-item[aria-pressed="true"] { color: var(--ink); font-weight: 700; }
.talk-dock-note .name-input { margin: 8px 0 0; padding: 0; border: 0; background: none; font-size: 13px; color: var(--muted); }
.talk-dock-note .name-input summary { min-height: 32px; line-height: 32px; cursor: pointer; }

.talk-actions { display: flex; gap: 8px; margin-top: 10px; }
.talk-actions:empty { display: none; }
.talk-actions > button { flex: 1; min-height: 52px; margin: 0; border-radius: 14px; font-size: 16px; font-weight: 600; }
.talk-actions > .secondary-button { border: 0; background: #fff; }
.talk-actions > .talk-action-main { flex: 2; font-weight: 700; }
.talk-actions > button:disabled { border-color: transparent; background: #e3dbcf; color: var(--muted); box-shadow: none; opacity: 1; }

.talk-dock-question .concern-question { margin: 0; }
.talk-dock-question label { display: flex; justify-content: space-between; margin: 0 0 6px; font-size: 16px; font-weight: 700; color: var(--ink); }
.talk-dock-question textarea { display: block; padding: 12px 14px; line-height: 1.45; resize: none; }
.talk-dock-question #reading-question-help { display: none; }
.talk-dock-question .concern-question-foot { display: flex; justify-content: flex-end; margin-top: 4px; font-size: 13px; color: var(--muted); }

.talk-dock-finish .feature-info, .talk-dock-finish .form-actions > p, .talk-dock-finish .profile-submit-note { margin: 0 0 6px; font-size: 13px; line-height: 1.45; color: var(--muted); background: none; border: 0; padding: 0; text-align: left; }
.talk-dock-finish .inline-error { margin: 0 0 8px; }
.talk-flow .talk-dock-finish .form-actions { position: static; display: flex; flex-direction: column; align-items: stretch; gap: 0; width: auto; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; backdrop-filter: none; } /* taste-skill: resets the shared pinned bar */
.talk-flow .talk-dock-finish .form-actions > p { display: block; }
.talk-dock-finish .form-actions > button { width: 100%; min-height: 56px; margin: 8px 0 0; border-radius: 14px; font-size: 18px; font-weight: 700; }
.talk-dock-finish > .secondary-button { width: 100%; margin: 0 0 8px; }

.talk-door-open { position: absolute; inset: 0; z-index: 5; overflow: hidden; background: var(--paper); pointer-events: none; animation: talk-door-fade .9s ease forwards; }
.talk-door-open img { width: 100%; height: 100%; object-fit: cover; transform-origin: 50% 62%; animation: talk-door-zoom .9s cubic-bezier(.6, 0, .3, 1) forwards; }

/* Product page hero: the same doorway the flow opens from. */
.service-detail-door { position: relative; overflow: hidden; border: 1.5px solid var(--ink); background: #e6d3b3; }
.service-detail-door::after { display: none; }
.talk-door-image { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.talk-door-fox { position: absolute; right: 8px; bottom: -4px; width: 132px; max-width: 34%; }
.talk-door-bubble { position: absolute; left: 14px; bottom: 44px; margin: 0; padding: 10px 22px; border-radius: 42% 44% 46% 40% / 52% 50% 54% 48%; background: #fff; color: #1f1a17; filter: drop-shadow(1.5px 0 0 #1f1a17) drop-shadow(-1.5px 0 0 #1f1a17) drop-shadow(0 1.5px 0 #1f1a17) drop-shadow(0 -1.5px 0 #1f1a17); font-size: 15px; font-weight: 600; line-height: 1.35; }
.talk-door-guide { position: absolute; left: 14px; bottom: 12px; margin: 0; padding: 2px 8px; border-radius: var(--radius); background: #1d1a17cc; color: #fff; font-size: 13px; font-weight: 600; }

@keyframes talk-rise { from { opacity: 0; translate: 0 16px; } }
@keyframes talk-pop { 0% { opacity: 0; scale: .72; } 70% { opacity: 1; scale: 1.04; } 100% { scale: 1; } }
@keyframes talk-sheet { from { translate: 0 100%; } }
@keyframes talk-breathe { to { translate: 0 -4px; } }
@keyframes talk-dot { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes talk-door-zoom { to { transform: scale(2.7); } }
@keyframes talk-door-fade { 0%, 55% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .talk-flow *, .talk-flow { animation: none !important; transition: none !important; }
}
.talk-cut-fit .talk-cut-guide { top: 4px; bottom: auto; left: auto; right: 2%; width: var(--fit-size); height: var(--fit-size); object-fit: cover; object-position: 50% 0; }
.talk-cut-fit .talk-cut-fox { width: auto; height: min(92%, 96px); }
.talk-group-nocut > .talk-cut { display: none; }
.talk-group-nocut { padding-top: 10px; }
.talk-group-nocut > .talk-bubble-lead { margin-top: 0; }
.talk-group-nocut > .talk-bubble-lead::before { display: none; }
@media (max-height: 800px) { .talk-flow:has(.talk-dock-birth:not([hidden])) .profile-register-note { display: none; } }
.talk-flow-tight .talk-strip { flex: none; height: auto; max-height: 45svh; }
.talk-flow-tight .talk-dock:not([hidden]) { flex: 1 1 0; min-height: 0; overflow-y: auto; }
