/* Deterministic chat enrollment: one conversation column that works on
   any screen size. Desktop it sits in a framed window, on a phone it
   takes the full screen height with controls pinned to the bottom.
   Pure HTML, CSS, and JavaScript: no AI calls, no per-visitor cost. */
.enroll-head{padding:48px 0 28px}
.enroll-head h1{font-size:44px;line-height:1.05;margin:0 0 12px;color:#fff}
.enroll-head .lead{font-size:18px;color:#cfcdea;max-width:54ch;margin:0}
.enroll-head .price-line{margin-top:14px;color:#fff;font-size:16px}
.enroll-head .price-line strong{color:var(--bright)}
.chat-section{padding:36px 0 64px}
.chat-shell{max-width:780px;margin:0 auto;border:1px solid #e0e0ef;border-radius:18px;overflow:hidden;display:flex;flex-direction:column;height:min(700px,calc(100dvh - 200px));min-height:460px;background:#fff}
.chat-head{flex:none;display:flex;align-items:center;gap:12px;padding:14px 18px;border-bottom:1px solid #e8e8f2;background:#fbfbfe}
.chat-head .tmark{flex:none;width:36px;height:36px;border-radius:50%;background:var(--navy);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:18px}
.chat-head .who{flex:1;min-width:0}
.chat-head .who strong{display:block;font-size:16px;line-height:1.25}
.chat-head .who span{font-size:13px;color:var(--faint)}
.chat-head .qcount{flex:none;font-size:13px;font-weight:700;color:var(--purple-deep);letter-spacing:.06em}
.chat-track{flex:none;height:4px;background:#eeeef6}
.chat-fill{height:100%;background:var(--grad);transform-origin:left;transform:scaleX(0);transition:transform 300ms cubic-bezier(.2,0,0,1)}
.chat-log{flex:1;overflow-y:auto;padding:20px 18px;overscroll-behavior:contain}
.msg{display:flex;gap:10px;margin:0 0 14px;align-items:flex-end}
.msg .avatar{flex:none;width:30px;height:30px;border-radius:50%;background:var(--navy);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:14px}
.msg img.avatar{object-fit:cover;object-position:center 28%;background:#e8e2da}
.chat-head img.tmark{object-fit:cover;object-position:center 28%;background:#e8e2da}
.msg .bubble{max-width:82%;padding:12px 16px;border-radius:16px;border-bottom-left-radius:5px;background:var(--mist);line-height:1.45;font-size:16.5px}
.msg .bubble p{margin:0 0 8px}
.msg .bubble p:last-child{margin:0}
.msg.user{justify-content:flex-end}
.msg.user .bubble{background:var(--grad);color:#fff;border-radius:16px;border-bottom-right-radius:5px}
.js .msg{opacity:0;transform:translateY(8px);transition:opacity 240ms cubic-bezier(.2,0,0,1),transform 240ms cubic-bezier(.2,0,0,1)}
.js .msg.in{opacity:1;transform:none}
.typing .bubble{display:flex;gap:5px;padding:16px}
.typing i{width:8px;height:8px;border-radius:50%;background:#a5a3c8;display:block}
.js .typing i{animation:tpulse 1s ease-in-out infinite}
.js .typing i:nth-child(2){animation-delay:.15s}
.js .typing i:nth-child(3){animation-delay:.3s}
@keyframes tpulse{0%,100%{opacity:.3;transform:translateY(0)}50%{opacity:1;transform:translateY(-3px)}}
.chat-controls{flex:none;border-top:1px solid #e8e8f2;padding:14px;background:#fff}
.chips{display:flex;flex-wrap:wrap;gap:10px}
.chip-btn{font:inherit;font-weight:600;min-height:48px;padding:10px 20px;border-radius:999px;border:2px solid var(--purple);background:#fff;color:var(--purple-deep);cursor:pointer}
.chip-btn:hover{background:#efe9fd}
.chip-btn.primary{background:var(--grad);color:#fff;border-color:transparent}
.chip-btn.quiet{border-color:#c4c4da;color:var(--ink)}
.chip-btn:disabled{opacity:.4;cursor:default}
a.chip-btn{display:inline-flex;align-items:center;text-decoration:none}
.text-row{display:flex;gap:10px;align-items:flex-start}
.text-row input,.text-row textarea{flex:1;font:inherit;font-size:17px;min-height:52px;padding:12px 16px;border:1.5px solid #c4c4da;border-radius:12px;color:var(--ink);min-width:0}
.text-row textarea{min-height:76px;resize:vertical}
.text-row input:focus,.text-row textarea:focus{outline:3px solid var(--bright);outline-offset:1px;border-color:var(--purple)}
.send-btn{flex:none;min-height:52px;height:52px;padding:0 24px;align-self:flex-start}
.chat-error{color:#a11;font-weight:600;font-size:15px;margin:0 0 10px}
.profile-card{background:#fff;border:2px solid var(--ink);border-radius:14px;padding:18px;max-width:100%}
.profile-card .pc-head{display:flex;gap:14px;align-items:center;margin-bottom:12px}
.profile-card .initials{flex:none;width:46px;height:46px;border-radius:50%;background:var(--grad);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:18px}
.profile-card dl{display:grid;grid-template-columns:150px 1fr;gap:7px 16px;margin:0}
.profile-card dt{font-weight:700;font-size:14.5px}
.profile-card dd{margin:0;color:var(--soft);font-size:14.5px}
.checkout-card{background:#fff;border:2px solid var(--ink);border-radius:14px;padding:18px}
.checkout-card .co-price{font-family:var(--serif);font-size:39px;margin:2px 0 6px}
.checkout-card ul{margin:10px 0;padding-left:20px;color:var(--soft)}
.checkout-card li{margin-bottom:5px}
.checkout-card li strong{color:var(--ink)}
.below-chat{max-width:780px;margin:18px auto 0;color:var(--soft);font-size:15px}
.noscript-box{max-width:780px;margin:0 auto;border:1px solid #e0e0ef;border-radius:14px;padding:20px;color:var(--soft)}
@media (max-width:700px){
  .enroll-head{padding:36px 0 20px}
  .enroll-head h1{font-size:34px}
  .chat-section{padding:0 0 40px}
  .chat-section .wrap{padding:0}
  .chat-shell{border:none;border-radius:0;height:calc(100dvh - 150px);min-height:420px}
  .msg .bubble{max-width:88%;font-size:16px}
  .profile-card dl{grid-template-columns:1fr}
  .below-chat{padding:0 16px}
}
@media (prefers-reduced-motion:reduce){
  .js .msg{opacity:1;transform:none;transition:none}
  .js .typing i{animation:none}
  .chat-fill{transition:none}
}

/* Full screen chat app (enroll page), ChatGPT and Muse style:
   the conversation is the whole screen, composer pinned at the bottom. */
body.app{margin:0}
.app{display:flex;flex-direction:column;height:100dvh;height:100svh;background:#fff}
.app-bar{flex:none;display:flex;align-items:center;gap:12px;padding:10px 16px;border-bottom:1px solid #e8e8f2}
.app-bar .tmark{width:38px;height:38px;border-radius:50%;object-fit:cover;object-position:center 28%}
.app-bar .who{flex:1;min-width:0}
.app-bar .who strong{display:block;font-size:16px;line-height:1.25}
.app-bar .who span{font-size:13px;color:var(--faint)}
.app-bar .home-link{flex:none;font-weight:600;font-size:15px;color:var(--ink);text-decoration:none;border:1.5px solid #c4c4da;border-radius:999px;padding:9px 18px;min-height:48px;display:inline-flex;align-items:center}
.app-bar .qcount{flex:none;font-size:13px;font-weight:700;color:var(--purple-deep);letter-spacing:.06em}
.app .chat-log{flex:1;overflow-y:auto;padding:24px 16px;overscroll-behavior:contain}
.app .chat-log .msg{max-width:780px;margin-left:auto;margin-right:auto}
.app .chat-controls{flex:none;border-top:1px solid #e8e8f2;padding:14px 16px calc(14px + env(safe-area-inset-bottom));background:#fff}
.app .chat-controls>*{max-width:780px;margin-left:auto;margin-right:auto}
.app .chat-error{max-width:780px}
.app .below-note{flex:none;text-align:center;font-size:13.5px;color:var(--faint);padding:0 16px 10px}
/* Homepage: the chat section is a full screen moment below the hero */
.chat-section.full{min-height:100dvh;display:flex;flex-direction:column;justify-content:center;padding:64px 0}
.chat-section.full .chat-shell{height:min(720px,calc(100dvh - 220px));width:100%}
.chat-intro{max-width:780px;margin:0 auto 26px;text-align:left;width:100%}
.chat-intro h2{font-size:39px;margin:0 0 10px}
.chat-intro p{color:var(--soft);font-size:18px;margin:0;max-width:56ch}
@media (max-width:700px){
  .app-bar .who span{display:none}
  .chat-section.full{padding:40px 0;min-height:0}
  .chat-section.full .chat-shell{height:calc(100dvh - 190px)}
  .chat-intro h2{font-size:31px}
}

/* Tai arrives: walks onto the screen and waves hello */
.tai-intro .tai-big{width:92px;height:92px;border-radius:24px;object-fit:cover;object-position:center 28%;flex:none;box-shadow:0 10px 28px rgba(1,2,24,.18)}
.js .tai-intro .tai-big{animation:walkin 1s cubic-bezier(.2,0,0,1) both,waving .55s ease-in-out 1.1s 3;transform-origin:bottom center}
.js .tai-wave{animation:waving .55s ease-in-out .5s 3;transform-origin:bottom center}
@keyframes walkin{0%{opacity:0;transform:translateX(-72px)}35%{opacity:1;transform:translateX(-36px) translateY(-7px)}70%{transform:translateX(-12px) translateY(0)}100%{opacity:1;transform:translateX(0)}}
@keyframes waving{0%,100%{transform:rotate(0deg)}50%{transform:rotate(7deg)}}
@media (prefers-reduced-motion:reduce){
  .js .tai-intro .tai-big,.js .tai-wave,}

/* Paired drops (v2.7): two questions per turn, grouped controls */
.part{margin-bottom:12px}
.part-label{font-size:13.5px;font-weight:600;color:#55536e;margin:0 0 7px}
.part .chips{margin-bottom:2px}
.chip-btn.selected{border-color:var(--purple);background:var(--purple);color:#fff}
.chat-controls .send-btn{margin-top:2px}

/* v2.8 reconciliation: the rules the current chat script actually uses.
   Fixes the invisible-messages bug: the old entrance rule hid every
   message waiting for a class the new script never adds. Messages are
   now visible by default and animate in with keyframes that end visible. */
.js .msg{opacity:1;transform:none;transition:none}
.js .msg.arrive{animation:msgin .35s cubic-bezier(.2,0,0,1) both}
@keyframes msgin{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
.msg.me{justify-content:flex-end}
.msg.me .bubble{background:var(--grad);color:#fff;border-radius:16px;border-bottom-right-radius:5px}
.bubble.wide{max-width:94%;width:100%}
.tdots{display:flex;gap:5px;padding:16px;background:var(--mist);border-radius:16px;border-bottom-left-radius:5px}
.tdots span{width:8px;height:8px;border-radius:50%;background:#a5a3c8;display:block}
.js .tdots span{animation:tpulse 1s ease-in-out infinite}
.js .tdots span:nth-child(2){animation-delay:.15s}
.js .tdots span:nth-child(3){animation-delay:.3s}
.chat-controls input,.chat-controls textarea{width:100%;font:inherit;font-size:17px;min-height:52px;padding:12px 16px;border:1.5px solid #c4c4da;border-radius:12px;color:var(--ink);background:#fff;box-sizing:border-box}
.chat-controls textarea{min-height:84px;resize:vertical}
.chat-controls input:focus,.chat-controls textarea:focus{outline:3px solid var(--bright);outline-offset:1px;border-color:var(--purple)}
.send-btn{background:var(--grad);color:#fff;border:0;border-radius:999px;font:inherit;font-weight:700;cursor:pointer;padding:0 26px}
.send-btn:hover{filter:brightness(1.07)}
.err{color:#a11;font-weight:600;font-size:15px;margin:10px 0 0}
.snapshot{background:#fff;border:2px solid var(--ink);border-radius:14px;padding:18px}
.snap-head{display:flex;flex-direction:column;gap:2px;margin-bottom:12px}
.snap-head strong{font-size:18px}
.snap-sub{font-size:13.5px;color:var(--faint)}
.snap-row{display:flex;gap:14px;padding:7px 0;border-top:1px solid #eeeef6;font-size:14.5px}
.snap-k{flex:none;width:118px;font-weight:700}
.snap-v{color:var(--soft)}
.buy-list{margin:10px 0;padding-left:20px;color:var(--soft)}
.buy-list li{margin-bottom:5px}
.buy-price{display:flex;align-items:baseline;gap:6px;margin:12px 0}
.buy-price span{font-family:var(--serif);font-size:39px;color:var(--ink)}
.buy-price small{color:var(--soft);font-size:15px}
.buy-btn{width:100%;min-height:54px;border:0;border-radius:999px;background:var(--grad);color:#fff;font:inherit;font-weight:700;font-size:17px;cursor:pointer}
.buy-btn:hover{filter:brightness(1.07)}
.buy-note{margin:10px 0 0;font-size:13.5px;color:var(--faint)}
@media (prefers-reduced-motion:reduce){
  .js .msg.arrive,.js .tdots span{animation:none}
}

/* Full screen chat on the homepage (v2.9): the chat takes the entire
   screen on any device, edge to edge, with the conversation kept in a
   readable centered column, the Muse and ChatGPT pattern. */
.chat-section.full{height:100dvh;min-height:100dvh;padding:0}
.chat-section.full .wrap{max-width:none;width:100%;height:100%;padding:0;display:flex;flex-direction:column}
.chat-section.full .chat-shell{flex:1;min-height:0;height:auto;max-width:none;width:100%;border:none;border-radius:0}
.chat-section.full .chat-log{padding:26px 18px}
.chat-section.full .chat-log .msg{max-width:780px;margin-left:auto;margin-right:auto}
.chat-section.full .chat-controls>*{max-width:780px;margin-left:auto;margin-right:auto}
.chat-section.full .below-chat{flex:none;max-width:none;margin:0;text-align:center;background:#fff;padding:10px 16px calc(10px + env(safe-area-inset-bottom))}
@media (max-width:700px){
  .chat-section.full .chat-log{padding:18px 12px}
}

/* App mode (v2.14): on phones, the moment a visitor engages, the chat
   becomes a fixed full screen layer. The page behind it locks, so the
   keyboard can never push the visitor down into the footer again, and
   the layer height tracks the visible viewport while the keyboard is up. */
.chat-shell{position:relative}
.chat-close{display:none;position:absolute;top:10px;right:12px;z-index:6;width:40px;height:40px;border-radius:50%;border:1px solid #e0e0ef;background:#fff;color:var(--ink);font-size:16px;line-height:1;cursor:pointer;box-shadow:0 4px 14px rgba(1,2,24,.14);align-items:center;justify-content:center;padding:0}
body.locked{position:fixed;left:0;right:0;width:100%;overflow:hidden}
.chat-section.full.appmode .chat-shell{position:fixed;left:0;right:0;top:0;height:100dvh;z-index:90;background:#fff;animation:apprise 240ms cubic-bezier(.2,0,0,1) both}
.chat-section.full.appmode .chat-close{display:flex}
.chat-section.full.appmode .chat-controls{box-shadow:0 -10px 28px rgba(1,2,24,.07)}
.chat-section.full .chat-shell{touch-action:manipulation}
@keyframes appr{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:translateY(0)}}
@media (prefers-reduced-motion:reduce){
  .chat-section.full.appmode .chat-shell{animation:none}
}

/* Open inline chat (homepage, v2.15): the conversation lives in the page
   flow directly below the Talk to Tai band. No frame, no fixed height,
   and no inner scroll box, so the page scroll never gets trapped in the
   chat and the conversation reads as part of the website. The full
   screen app experience stays at enroll.html. */
.chat-section.open{height:auto;min-height:0;padding:6px 0 64px;display:block;background:var(--navy)}
.chat-section.open .wrap{height:auto;display:block}
.chat-section.open .chat-shell{height:auto;min-height:0;max-width:780px;border:none;border-radius:0;overflow:visible;background:transparent;display:block;box-shadow:none}
.chat-section.open .chat-log{overflow:visible;flex:none;padding:10px 0 2px;overscroll-behavior:auto}
.chat-section.open .chat-controls{border-top:none;padding:16px 0 0;background:transparent}
.chat-section.open .chat-track{background:rgba(255,255,255,.14)}
.chat-section.open .below-chat{margin:24px auto 0;color:#cfcdea}
.chat-section.open .below-chat a{color:var(--bright)}
.chat-section.open .part-label{color:#b9b7dd}
.chat-section.open .err{color:#ffa3a3}
@media (max-width:700px){
  .chat-section.open{padding:2px 0 48px}
  .chat-section.open .wrap{padding:0 20px}
  .chat-section.open .chat-shell{height:auto;min-height:0}
}
