/* FLEXITREE · ส่วนกลางของหน้า landing และหน้าผลประเมิน (สีและฟอนต์ตาม DESIGNFLEXTREE.html) */
:root{
  --ft-leaf:#739348; --ft-leaf-dark:#5C7639; --ft-leaf-light:#E8EFDD;
  --ft-forest:#3F7652; --ft-deep:#265642; --ft-bark:#7D5B3C; --ft-rust:#A35615; --ft-soil:#5A2B1C;
  --ft-ink:#000; --ft-ink-2:#242323; --ft-ink-3:#414141; --ft-ink-4:#5E5E5E;
  --ft-mist:#F0F0F0; --ft-line:#DADADA; --ft-white:#fff;
  --ft-font:'Prompt',sans-serif; --ft-font-alt:'Kanit',sans-serif;
  --ft-r-sm:8px; --ft-r-md:16px; --ft-r-lg:24px; --ft-r-pill:50px;
  --ft-shadow:0 6px 20px rgba(38,86,66,.12);
  /* เพิ่มเอง (ไม่มีใน design system): สีสถานะ */
  --ft-no:#C0392B; --ft-no-light:#F8E5E3; --ft-cond-light:#F6EADF;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--ft-white);color:var(--ft-ink);font-family:var(--ft-font);line-height:1.55;-webkit-text-size-adjust:100%}
img{max-width:100%;display:block}
a{color:var(--ft-forest)}
.wrap{max-width:1080px;margin:0 auto;padding:0 16px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;font-family:var(--ft-font);font-size:16px;cursor:pointer;text-decoration:none;transition:.2s;border:0}
.btn-cta{background:var(--ft-forest);color:#fff;padding:13px 34px;border-radius:var(--ft-r-pill)}
.btn-cta:hover{background:var(--ft-deep)}
.btn-cta:disabled{background:var(--ft-ink-4);cursor:wait}
.btn-outline{background:#fff;color:var(--ft-ink);padding:11px 26px;border:1px solid var(--ft-leaf)}
.btn-outline:hover{background:var(--ft-leaf);color:#fff}

/* header */
header.top{border-bottom:1px solid var(--ft-line);background:#fff;position:sticky;top:0;z-index:20}
header.top .wrap{display:flex;align-items:center;justify-content:space-between;height:64px;gap:12px}
header.top img{height:40px;width:auto}
header.top .contact{display:flex;gap:10px;align-items:center;font-size:14px}
header.top .contact a{text-decoration:none;color:var(--ft-deep);white-space:nowrap}
header.top .contact .btn-cta{padding:8px 18px;font-size:14px;color:#fff}

/* hero */
.hero{position:relative;color:#fff;background:var(--ft-deep) url(img/hero.jpg) center/cover no-repeat}
.hero::before{content:"";position:absolute;inset:0;background:linear-gradient(90deg,rgba(38,86,66,.92) 0%,rgba(38,86,66,.75) 45%,rgba(38,86,66,.25) 100%)}
.hero .wrap{position:relative;padding:72px 16px 80px}
.hero .eyebrow{font-size:14px;letter-spacing:.12em;color:var(--ft-leaf-light);margin:0 0 10px}
.hero h1{font-size:44px;line-height:1.3;font-weight:500;margin:0 0 14px;max-width:620px}
.hero p.sub{font-size:18px;max-width:560px;margin:0 0 28px;color:#F2F6EC}
.hero .chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:26px}
.hero .chips span{border:1px solid rgba(255,255,255,.6);border-radius:var(--ft-r-pill);padding:4px 14px;font-size:14px}
.hero .btn-cta{background:#fff;color:var(--ft-deep);font-weight:500}
.hero .btn-cta:hover{background:var(--ft-leaf-light)}

section{padding:56px 0}
section.mist{background:var(--ft-mist)}
.eyebrow{color:var(--ft-leaf);font-size:14px;letter-spacing:.12em;margin:0 0 6px}
h2.title{font-size:32px;font-weight:500;margin:0 0 8px;line-height:1.35}
.lead{color:var(--ft-ink-4);margin:0 0 28px;max-width:720px}

.steps{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.step{background:#fff;border:1px solid var(--ft-line);border-radius:var(--ft-r-md);padding:22px}
.step b.n{display:inline-flex;width:34px;height:34px;border-radius:50%;background:var(--ft-leaf);color:#fff;align-items:center;justify-content:center;font-weight:500;margin-bottom:10px}
.step h3{margin:0 0 6px;font-size:18px;font-weight:500;color:var(--ft-deep)}
.step p{margin:0;color:var(--ft-ink-3);font-size:15px}


/* form */
form{max-width:820px}
.hint{font-size:14px;color:var(--ft-ink-4);margin:0 0 14px}
.grid{display:grid;grid-template-columns:1fr 1fr;gap:14px 18px}
.grid .full{grid-column:1/-1}
label.f{display:block;font-size:15px;color:var(--ft-ink-2);margin-bottom:6px}
label.f .req{color:var(--ft-no)}
label.f .opt{color:var(--ft-ink-4);font-size:13px}
input[type=text],input[type=tel],input[type=email],input[type=url],input[type=number],input[type=password],select,textarea{
  width:100%;font-family:var(--ft-font);font-size:16px;padding:11px 14px;border:1px solid var(--ft-line);border-radius:var(--ft-r-sm);background:#fff;color:var(--ft-ink)}
input:focus,select:focus,textarea:focus{outline:2px solid var(--ft-leaf);outline-offset:0;border-color:var(--ft-leaf)}
textarea{min-height:96px;resize:vertical}
.unit{position:relative}
.unit input{padding-right:52px}
.unit span{position:absolute;right:14px;top:50%;transform:translateY(-50%);color:var(--ft-ink-4);font-size:14px;pointer-events:none}
.seg{display:inline-flex;border:1px solid var(--ft-leaf);border-radius:var(--ft-r-pill);overflow:hidden;margin-bottom:8px}
.seg label{padding:6px 16px;font-size:14px;cursor:pointer}
.seg input{position:absolute;opacity:0;pointer-events:none}
.seg label:has(input:checked){background:var(--ft-leaf);color:#fff}
.choices{display:flex;flex-wrap:wrap;gap:8px}
.choices label{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--ft-line);border-radius:var(--ft-r-pill);padding:7px 15px;font-size:15px;cursor:pointer;background:#fff}
.choices input{accent-color:var(--ft-forest);margin:0}
.choices label:has(input:checked){border-color:var(--ft-forest);background:var(--ft-leaf-light);color:var(--ft-deep)}
.check{display:flex;gap:10px;align-items:flex-start;font-size:15px;cursor:pointer}
.check input{accent-color:var(--ft-forest);width:18px;height:18px;margin:3px 0 0;flex:none}

/* photo picker */
.drop{display:block;border:2px dashed var(--ft-leaf);border-radius:var(--ft-r-md);background:var(--ft-leaf-light);padding:26px 16px;text-align:center;cursor:pointer;transition:.2s}
.drop:hover,.drop.over{background:#DCE7CD}
.drop b{display:block;font-size:18px;font-weight:500;color:var(--ft-deep)}
.drop span{font-size:14px;color:var(--ft-ink-3)}
.drop svg{width:40px;height:40px;margin:0 auto 6px;display:block}
.thumbs{display:grid;grid-template-columns:repeat(5,1fr);gap:10px;margin-top:14px}
.thumbs:empty{display:none}
.thumb{position:relative;aspect-ratio:1;border-radius:var(--ft-r-sm);overflow:hidden;border:1px solid var(--ft-line);background:var(--ft-mist)}
.thumb img{width:100%;height:100%;object-fit:cover}
.thumb button{position:absolute;top:4px;right:4px;width:28px;height:28px;border-radius:50%;border:0;background:rgba(0,0,0,.65);color:#fff;font-size:16px;cursor:pointer;line-height:1}
.thumb.busy::after{content:"กำลังย่อรูป…";position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:12px;color:var(--ft-ink-3)}

/* model cards */
.models{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.model{cursor:pointer;border:1px solid var(--ft-line);border-radius:var(--ft-r-md);overflow:hidden;background:#fff;display:flex;flex-direction:column;transition:.2s}
.model input{position:absolute;opacity:0;pointer-events:none}
.model .pic{aspect-ratio:4/3;background:var(--ft-mist);display:flex;align-items:center;justify-content:center;color:var(--ft-leaf);font-size:30px}
.model .pic img{width:100%;height:100%;object-fit:cover}
.model .t{padding:8px 10px 10px}
.model b{display:block;font-size:15px;font-weight:500}
.model small{display:block;font-size:12px;color:var(--ft-ink-4);line-height:1.35}
.model:has(input:checked){border:2px solid var(--ft-forest);box-shadow:var(--ft-shadow)}
.model:has(input:checked) b{color:var(--ft-forest)}
.model:has(input:focus-visible){outline:2px solid var(--ft-leaf);outline-offset:2px}

/* wizard */
#form,#f{scroll-margin-top:76px}
form{background:#fff;border:1px solid var(--ft-line);border-radius:var(--ft-r-lg);padding:24px 28px 20px;box-shadow:var(--ft-shadow)}
.prog{list-style:none;margin:0 0 24px;padding:0;display:grid;grid-template-columns:repeat(4,1fr);gap:6px;counter-reset:s}
.prog li{position:relative}
.prog li::after{content:"";position:absolute;left:0;right:0;bottom:0;height:4px;border-radius:4px;background:var(--ft-line)}
.prog li.on::after,.prog li.done::after{background:var(--ft-leaf)}
.prog button{all:unset;display:flex;align-items:center;gap:8px;padding:0 0 10px;font-family:var(--ft-font);font-size:14px;color:var(--ft-ink-4);cursor:default;width:100%}
.prog li.done button{cursor:pointer;color:var(--ft-deep)}
.prog li.on button{color:var(--ft-deep);font-weight:500}
.prog b{flex:none;width:26px;height:26px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:13px;background:var(--ft-mist);color:var(--ft-ink-4);font-weight:500}
.prog li.on b{background:var(--ft-forest);color:#fff}
.prog li.done b{background:var(--ft-leaf-light);color:var(--ft-deep)}
.prog li.done b::before{content:"✓"}
.prog li.done b{font-size:0}
.prog li.done b::before{font-size:13px}
.pane{animation:fade .25s ease}
@keyframes fade{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
h3.q{font-size:22px;font-weight:500;margin:0 0 4px;color:var(--ft-deep);line-height:1.4}
.req{color:var(--ft-no)}
.opt{color:var(--ft-ink-4);font-size:13px;font-weight:400}
.pane > label.f{margin-top:18px}
.tip{font-size:13px;color:var(--ft-leaf-dark);margin:6px 0 0}
.shots{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:0 0 14px}
.shots div{background:var(--ft-mist);border-radius:var(--ft-r-sm);padding:10px;text-align:center;font-size:14px;color:var(--ft-ink-2);line-height:1.35}
.shots i{display:block;font-style:normal;color:var(--ft-leaf);font-size:18px}
.shots small{color:var(--ft-ink-4);font-size:12px}
.picks{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.picks.four{grid-template-columns:repeat(4,1fr);margin-top:12px}
.pick{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;text-align:center;border:1px solid var(--ft-line);border-radius:var(--ft-r-md);padding:12px 8px;cursor:pointer;background:#fff;min-height:64px;transition:.15s}
.pick input{position:absolute;opacity:0;pointer-events:none}
.pick svg{width:44px;height:44px}
.pick span{font-size:15px;line-height:1.3}
.pick span small{display:block;font-size:12px;color:var(--ft-ink-4)}
.pick b{font-weight:500;font-size:16px}
.pick b + span{font-size:13px;color:var(--ft-ink-4)}
.pick:hover{border-color:var(--ft-leaf)}
.pick:has(input:checked){border:2px solid var(--ft-forest);background:var(--ft-leaf-light);padding:11px 7px}
.pick:has(input:checked) b,.pick:has(input:checked) > span{color:var(--ft-deep)}
.pick:has(input:focus-visible){outline:2px solid var(--ft-leaf);outline-offset:2px}
.stepper{display:inline-flex;align-items:center;gap:8px}
.stepper button{width:44px;height:44px;border-radius:50%;border:1px solid var(--ft-leaf);background:#fff;color:var(--ft-forest);font-size:22px;cursor:pointer;font-family:var(--ft-font)}
.stepper button:hover{background:var(--ft-leaf-light)}
.stepper input{width:72px;text-align:center;-moz-appearance:textfield}
.stepper input::-webkit-inner-spin-button,.stepper input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.stepper span{color:var(--ft-ink-4)}
.exact{margin-top:10px;max-width:320px}
details.more{margin-top:22px;border:1px solid var(--ft-line);border-radius:var(--ft-r-md);background:#FAFBF7}
details.more summary{cursor:pointer;padding:14px 16px;font-size:15px;color:var(--ft-forest);list-style:none;display:flex;align-items:center;gap:8px}
details.more summary::-webkit-details-marker{display:none}
details.more summary::before{content:"+";display:inline-flex;width:22px;height:22px;border-radius:50%;border:1px solid var(--ft-leaf);align-items:center;justify-content:center;font-size:15px;flex:none}
details.more[open] summary::before{content:"−"}
details.more summary small{color:var(--ft-ink-4)}
details.more .grid{padding:0 16px 16px}
.recap{display:flex;flex-wrap:wrap;gap:6px;margin:18px 0 0}
.recap:empty{display:none}
.recap span{font-size:13px;background:var(--ft-leaf-light);color:var(--ft-deep);border-radius:var(--ft-r-pill);padding:3px 12px}
.consent{margin-top:18px;background:var(--ft-mist);border-radius:var(--ft-r-sm);padding:12px 14px;font-size:14px}
.navbar{display:flex;gap:12px;justify-content:space-between;margin-top:26px;padding-top:16px;border-top:1px solid var(--ft-line)}
.navbar .btn-cta{margin-left:auto;min-width:160px}
.navbar #prev[hidden]{display:none}
.fine{font-size:13px;color:var(--ft-ink-4);margin:10px 0 0;text-align:right}

.hide{display:none!important}
.hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
.err{background:var(--ft-no-light);color:var(--ft-no);border-radius:var(--ft-r-sm);padding:12px 16px;margin:16px 0 0}

/* result */
#result{max-width:820px}
.panel{background:#fff;border:1px solid var(--ft-line);border-radius:var(--ft-r-lg);padding:28px;box-shadow:var(--ft-shadow)}
.wait{text-align:center;padding:40px 20px}
.spinner{width:54px;height:54px;border-radius:50%;border:5px solid var(--ft-leaf-light);border-top-color:var(--ft-forest);animation:spin 1s linear infinite;margin:0 auto 18px}
@keyframes spin{to{transform:rotate(360deg)}}
.wait ul{list-style:none;padding:0;margin:18px auto 0;max-width:340px;text-align:left;font-size:15px;color:var(--ft-ink-4)}
.wait li{padding:4px 0}
.wait li.on{color:var(--ft-deep)}
.wait li.on::before{content:"✓ ";color:var(--ft-leaf)}
.wait li:not(.on)::before{content:"○ "}
.rec{border-radius:var(--ft-r-md);padding:22px;margin:18px 0;background:var(--ft-leaf-light);border:1px solid var(--ft-leaf)}
.rec.cond{background:var(--ft-cond-light);border-color:var(--ft-rust)}
.rec.none{background:var(--ft-mist);border-color:var(--ft-line)}
.rec .k{font-size:14px;color:var(--ft-ink-3);margin:0}
.rec .code{font-family:var(--ft-font-alt);font-size:34px;font-weight:500;color:var(--ft-deep);margin:2px 0 8px;line-height:1.3}
.rec.cond .code{color:var(--ft-soil)}
.badge{display:inline-block;font-size:13px;border-radius:var(--ft-r-pill);padding:2px 12px;background:var(--ft-leaf);color:#fff;vertical-align:middle}
.badge.cond{background:var(--ft-rust)}
.badge.pending{background:var(--ft-ink-4)}
.badge.no{background:var(--ft-no)}
.rec ul,.box ul{margin:8px 0 0;padding-left:20px}
.rec li,.box li{margin-bottom:4px}
/* ผลแบบรูปสรุป */
.rec2{display:grid;grid-template-columns:170px 1fr;gap:20px;align-items:center;border-radius:var(--ft-r-md);padding:18px;margin:18px 0 0;background:var(--ft-leaf-light);border:1px solid var(--ft-leaf)}
.rec2.cond{background:var(--ft-cond-light);border-color:var(--ft-rust)}
.rec2 .prodpic img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:var(--ft-r-sm);background:#fff}
.rec2 .code{font-family:var(--ft-font-alt);font-size:34px;font-weight:500;color:var(--ft-deep);margin:6px 0 2px;line-height:1.25}
.rec2.cond .code{color:var(--ft-soil)}
.rec2 .pname{margin:0;font-weight:500;color:var(--ft-ink-2)}
.rec2 .pwhat{margin:2px 0 0;font-size:14px;color:var(--ft-ink-4)}
.rec2 .badge{font-size:14px;padding:3px 14px}
.sum{display:grid;grid-template-columns:1.1fr 1fr;gap:20px;margin-top:18px}
.sum.one{grid-template-columns:1fr;max-width:460px}
.dia{margin:0;background:var(--ft-mist);border-radius:var(--ft-r-md);padding:14px 10px 10px}
.dia svg{width:100%;height:auto;max-height:400px;display:block;font-family:var(--ft-font)}
.dia figcaption{font-size:12px;color:var(--ft-ink-4);text-align:center;margin-top:4px}
.dia .gnd{stroke:var(--ft-bark);stroke-width:2}
.dia .ball{fill:var(--ft-bark);opacity:.35}
.dia .trunk{fill:var(--ft-bark)}
.dia .crown{opacity:.6}
.dia .crown ellipse{fill:var(--ft-leaf)}
.dia .dev{stroke:var(--ft-deep);stroke-width:5;stroke-linecap:round}
.dia .dev.thin{stroke-width:3.5;opacity:.6}
.dia .pin{fill:var(--ft-rust);stroke:#fff;stroke-width:2}
.dia .dim{stroke:var(--ft-ink-3);stroke-width:1.2}
.dia .dash{stroke:var(--ft-ink-3);stroke-width:1.2;stroke-dasharray:4 4}
.dia .lb{font-size:14px;fill:var(--ft-ink-2);paint-order:stroke;stroke:var(--ft-mist);stroke-width:4px;stroke-linejoin:round}
.dia .lb.b{font-weight:600}
.dia .lb.acc{fill:var(--ft-rust);font-weight:600}
.dia .lb.inv{fill:#fff;stroke:none;font-weight:500}
.checks h4{margin:0 0 6px;font-size:20px;font-weight:500;color:var(--ft-deep)}
.checks .line{margin:0 0 8px;padding:10px 14px;border-radius:var(--ft-r-sm);font-weight:500;background:var(--ft-leaf-light);color:var(--ft-deep)}
.checks .line.todo{background:var(--ft-cond-light);color:var(--ft-soil)}
.checks ul{list-style:none;margin:0;padding:0}
.checks li{display:flex;gap:12px;align-items:flex-start;padding:12px 0;border-bottom:1px solid var(--ft-line);font-size:16px;line-height:1.5}
.checks li:last-child{border-bottom:0}
.checks li i{flex:0 0 26px;height:26px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-style:normal;font-weight:600;color:#fff;background:var(--ft-leaf)}
.checks li.chk i{background:var(--ft-rust)}
.checks li.more i{background:var(--ft-ink-4)}
.checks li.more{color:var(--ft-ink-4);font-size:14px}
.checks li small{display:block;font-size:13px;color:var(--ft-rust)}
.dia .cap-top{text-align:left;font-size:14px;font-weight:500;color:var(--ft-deep);margin:0 0 4px 4px}
.dia .key{display:inline-flex;align-items:center;gap:6px;margin:0 8px 4px;font-size:13px;color:var(--ft-ink-3)}
.dia .key i{display:inline-block}
.dia .k-dev{width:18px;height:4px;border-radius:2px;background:var(--ft-deep)}
.dia .k-pin{width:10px;height:10px;border-radius:50%;background:var(--ft-rust)}
.cta-box{margin-top:20px;padding:16px 18px;border-radius:var(--ft-r-md);background:var(--ft-mist)}
.cta-box p{margin:0;font-weight:500;color:var(--ft-deep)}
.cta-box .actions{margin-top:12px}
.cta-box .actions .btn{flex:1 1 200px;text-align:center}
.more-box summary{cursor:pointer;font-weight:500;color:var(--ft-deep)}
.more-box .note{margin:8px 0 0}
.linkbtn{all:unset;cursor:pointer;color:var(--ft-forest);text-decoration:underline}
.steps.mini .step{display:flex;gap:12px;align-items:flex-start;padding:16px}
.steps.mini .step h3{margin:0 0 2px;font-size:16px}
.steps.mini .step p{margin:0;font-size:14px}
.steps.mini b.n{flex:none;margin:0}
@media (max-width:760px){
  .rec2{grid-template-columns:96px 1fr;gap:14px;padding:14px}
  .rec2 .code{font-size:26px}
  .sum{grid-template-columns:1fr}
}
.box{border-top:1px solid var(--ft-line);padding-top:16px;margin-top:16px}
.box h4{margin:0 0 4px;font-size:16px;font-weight:500;color:var(--ft-deep)}
.box p{margin:4px 0}
.note{background:var(--ft-mist);border-radius:var(--ft-r-sm);padding:12px 16px;font-size:15px}
.disc{font-size:13px;color:var(--ft-ink-4)}
.actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:20px}
.ref{font-size:13px;color:var(--ft-ink-4);margin-top:14px}

footer{background:var(--ft-deep);color:#E8EFDD;padding:36px 0;font-size:15px}
footer .wrap{display:flex;flex-wrap:wrap;gap:24px;justify-content:space-between;align-items:center}
footer a{color:#fff}
footer img{height:44px;width:auto;border-radius:6px;background:#fff;padding:4px}

@media (max-width:860px){
}
@media (max-width:640px){
  .hero .wrap{padding:48px 16px 56px}
  .hero h1{font-size:32px}
  .hero p.sub{font-size:16px}
  h2.title{font-size:26px}
  section{padding:40px 0}
  .steps{grid-template-columns:1fr}
  .grid{grid-template-columns:1fr}
  form{padding:18px 14px 14px;border-radius:var(--ft-r-md)}
  .prog span{display:none}
  .prog li.on span{display:inline}
  .prog{display:flex}
  .prog li{flex:none}
  .prog li.on{flex:1}
  h3.q{font-size:19px}
  .picks.four{grid-template-columns:repeat(2,1fr)}
  .navbar{position:sticky;bottom:0;background:#fff;margin:20px -14px 0;padding:12px 14px calc(12px + env(safe-area-inset-bottom));z-index:5;box-shadow:0 -6px 16px rgba(0,0,0,.06)}
  .navbar .btn{flex:1}
  .navbar .btn-cta{min-width:0}
  .fine{text-align:left}
  .thumbs{grid-template-columns:repeat(3,1fr)}
  .models{grid-template-columns:repeat(2,1fr)}
  header.top .contact .tel{display:none}
  .salesbtn .lg{display:none}
  .panel{padding:20px 16px}
  .rec .code{font-size:28px}
}

/* รายงานสรุป 1 หน้า + QR (หน้าผล) */
.rpt-cta{display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:space-between;margin-top:12px;padding:14px 18px;border:1px dashed var(--ft-leaf);border-radius:var(--ft-r-md)}
.rpt-cta b{display:block;font-weight:500;color:var(--ft-deep)}
.rpt-cta span{font-size:14px;color:var(--ft-ink-4)}
.rpt-dlg{border:0;padding:0;background:transparent;width:min(760px,calc(100vw - 24px));max-height:calc(100vh - 24px)}
.rpt-dlg::backdrop{background:rgba(0,0,0,.55)}
.rpt-tools{position:sticky;bottom:0;display:flex;gap:10px;justify-content:flex-end;padding:12px 0 2px}
.rpt-tools .btn{box-shadow:var(--ft-shadow)}
#printArea{display:none}
.rpt{background:#fff;color:var(--ft-ink-2);font-family:var(--ft-font);border-radius:var(--ft-r-md);padding:24px;font-size:14px;line-height:1.5}
.rpt-head{display:flex;gap:14px;align-items:center;border-bottom:3px solid var(--ft-leaf);padding-bottom:12px}
.rpt-head img{height:44px;width:auto}
.rpt-head b{display:block;font-size:19px;font-weight:500;color:var(--ft-deep)}
.rpt-head span{font-size:12px;color:var(--ft-ink-4)}
.rpt-head p{margin:0 0 0 auto;text-align:right;font-size:12px;color:var(--ft-ink-4)}
.rpt-who{margin:12px 0 10px}
.rpt-who b{font-weight:500}
.rpt-rec{display:flex;gap:16px;align-items:center;padding:14px;border-radius:var(--ft-r-sm);background:var(--ft-leaf-light);border:1px solid var(--ft-leaf)}
.rpt-rec.cond{background:var(--ft-cond-light);border-color:var(--ft-rust)}
.rpt-rec.none{background:var(--ft-mist);border-color:var(--ft-line)}
.rpt-rec img{width:84px;height:84px;object-fit:cover;border-radius:var(--ft-r-sm);flex:none}
.rpt-rec .badge{font-size:12px}
.rpt-code{font-family:var(--ft-font-alt);font-size:28px;font-weight:500;color:var(--ft-deep);line-height:1.2;margin:4px 0 2px}
.rpt-rec p{margin:0;font-size:13px;color:var(--ft-ink-3)}
.rpt-nums{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:8px;margin:12px 0 0}
.rpt-nums div{background:var(--ft-mist);border-radius:var(--ft-r-sm);padding:8px 10px}
.rpt-nums dt{font-size:12px;color:var(--ft-ink-4)}
.rpt-nums dd{margin:0;font-weight:600;color:var(--ft-deep)}
.rpt-body{display:grid;grid-template-columns:1fr 210px;gap:16px;margin-top:12px;align-items:start}
.rpt-body > :only-child{grid-column:1 / -1}
.rpt-checks .line{margin:0 0 4px;padding:6px 10px;border-radius:var(--ft-r-sm);font-weight:500;background:var(--ft-leaf-light);color:var(--ft-deep)}
.rpt-checks .line.todo{background:var(--ft-cond-light);color:var(--ft-soil)}
.rpt-checks ul{list-style:none;margin:0;padding:0}
.rpt-checks li{display:flex;gap:8px;padding:5px 0;border-bottom:1px solid var(--ft-line)}
.rpt-checks li:last-child{border-bottom:0}
.rpt-checks li i{flex:0 0 20px;height:20px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-style:normal;font-size:12px;font-weight:600;color:#fff;background:var(--ft-leaf)}
.rpt-checks li.chk i{background:var(--ft-rust)}
.rpt-checks li.more i{background:var(--ft-ink-4)}
.rpt-checks li small{display:block;font-size:12px;color:var(--ft-rust)}
.rpt-dia{padding:8px;border-radius:var(--ft-r-sm)}
.rpt-dia svg{max-height:260px}
.rpt-foot{display:flex;gap:16px;align-items:center;margin-top:14px;padding-top:12px;border-top:1px solid var(--ft-line)}
.rpt-qr{flex:0 0 120px}
.rpt-qr svg{display:block;width:120px;height:120px}
.rpt-foot b{display:block;font-weight:500;color:var(--ft-deep)}
.rpt-foot a{display:block;font-size:12px;color:var(--ft-forest);word-break:break-all;margin:2px 0 6px}
.rpt-foot p{margin:0;font-size:13px}
.rpt-foot small{display:block;font-size:11px;color:var(--ft-ink-4);margin-top:4px}
@media (max-width:560px){
  .rpt{padding:16px}
  .rpt-tools .btn{flex:1}
  .rpt-head p{display:none}
  .rpt-body{grid-template-columns:1fr}
  .rpt-code{font-size:24px}
  .rpt-qr{flex-basis:96px}
  .rpt-qr svg{width:96px;height:96px}
}
@media print{
  @page{size:A4;margin:12mm}
  body.print-rpt{background:#fff}
  body.print-rpt > :not(#printArea){display:none!important}
  body.print-rpt #printArea{display:block}
  .rpt{padding:0;border-radius:0;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .rpt-head p{display:block}
  .rpt-body{grid-template-columns:1fr 210px}
  .rpt-qr{flex-basis:120px}
  .rpt-qr svg{width:120px;height:120px}
  .rpt-dia .lb{stroke:#fff}
}

/* โหมดเซลล์: ปุ่มเข้าสู่ระบบ แถบบอกโหมด และหน้าต่างล็อกอิน */
.salesbtn{all:unset;cursor:pointer;font-family:var(--ft-font);font-size:14px;color:var(--ft-deep);padding:6px 14px;border:1px solid var(--ft-line);border-radius:var(--ft-r-pill);white-space:nowrap}
.salesbtn:hover,.salesbtn:focus-visible{border-color:var(--ft-forest)}
.salesbtn .lg::after{content:" "}
.salesbar{display:flex;flex-wrap:wrap;gap:8px 16px;align-items:center;justify-content:space-between;max-width:820px;margin:-12px 0 20px;padding:12px 16px;border-radius:var(--ft-r-sm);background:var(--ft-cond-light);border-left:4px solid var(--ft-rust);color:var(--ft-soil);font-size:15px}
.salesbar b{font-weight:500}
.salesbar .act{display:flex;gap:16px}
.salesbar a,.salesbar button{all:unset;cursor:pointer;color:var(--ft-rust);text-decoration:underline;font-size:14px;white-space:nowrap}
.panel .salesbar{margin:0 0 16px}
.sales-only{margin-top:16px}
.sdlg{border:0;border-radius:var(--ft-r-md);padding:24px;width:min(400px,calc(100vw - 32px));box-shadow:var(--ft-shadow);font-family:var(--ft-font);color:var(--ft-ink-2)}
.sdlg::backdrop{background:rgba(0,0,0,.45)}
.sdlg h3{margin:0 0 4px;font-weight:500;font-size:20px;color:var(--ft-deep)}
.sdlg input{margin-bottom:12px}
.sdlg .err{margin:0 0 12px}
.sdlg .err a{color:inherit}
.sdlg .row{display:flex;gap:10px;justify-content:flex-end}

/* ทางลัดไปผลประเมินเดิม (หน้าแรก) */
.lastbar{display:flex;flex-wrap:wrap;gap:6px;align-items:center;justify-content:space-between;max-width:820px;margin:-12px 0 20px;padding:12px 16px;border-radius:var(--ft-r-sm);background:var(--ft-leaf-light);color:var(--ft-deep);text-decoration:none;font-size:15px}
.lastbar b{font-weight:500;color:var(--ft-forest)}

/* หน้าผลประเมิน */
.hero.slim .wrap{padding:44px 16px 48px}
.hero.slim h1{font-size:36px}
.past{list-style:none;margin:0;padding:0;max-width:820px;display:grid;gap:8px}
.past a{display:flex;gap:12px;justify-content:space-between;align-items:center;padding:14px 16px;border:1px solid var(--ft-line);border-radius:var(--ft-r-sm);text-decoration:none;color:var(--ft-ink)}
.past a:hover{border-color:var(--ft-leaf);background:#FAFBF7}
.past small{color:var(--ft-ink-4);font-size:13px}
.past a > small{white-space:nowrap}
.past b{font-weight:500;color:var(--ft-deep)}
.past .now{border-color:var(--ft-forest);background:var(--ft-leaf-light)}
@media (max-width:640px){
  .hero.slim .wrap{padding:32px 16px 36px}
  .hero.slim h1{font-size:28px}
}

/* ขั้นที่ 4: ผลพร้อมแล้ว กรอกข้อมูลเพื่อเปิดดู */
.gate{margin:0 0 22px}
.gate-st{display:flex;align-items:center;gap:10px;color:var(--ft-deep);font-size:16px;margin-bottom:10px}
.gate-st b{font-weight:500}
.gate.ready .gate-st b::before{content:"✓ ";color:var(--ft-leaf)}
.spinner.sm{width:22px;height:22px;border-width:3px;margin:0;flex:none}
.gate-card{position:relative;border-radius:var(--ft-r-md);padding:18px 20px;background:var(--ft-leaf-light);border:1px solid var(--ft-leaf);overflow:hidden;user-select:none}
.gate-card .k{font-size:14px;color:var(--ft-ink-3);margin:0}
.gate-card .code,.gate-card .lines{filter:blur(6px)}
.gate-card .code{font-family:var(--ft-font-alt);font-size:30px;font-weight:500;color:var(--ft-deep);line-height:1.3;margin:2px 0 6px}
.gate-card .lines{margin:0;color:var(--ft-ink-3);letter-spacing:.3em}
.gate-card .lock{position:absolute;left:50%;top:50%;transform:translate(-50%,-30%);background:#fff;color:var(--ft-deep);border-radius:var(--ft-r-pill);padding:6px 16px;font-size:14px;box-shadow:var(--ft-shadow);white-space:nowrap}
.gate:not(.ready) .gate-card{opacity:.6}

/* ---------- landing: ดึงดูดลูกค้า ---------- */
.hero-grid{display:grid;grid-template-columns:1.15fr .85fr;gap:40px;align-items:center}
.hero .pill-top{display:inline-flex;align-items:center;gap:8px;background:rgba(255,255,255,.14);border:1px solid rgba(255,255,255,.35);border-radius:var(--ft-r-pill);padding:4px 14px 4px 4px;font-size:14px;margin:0 0 16px}
.hero .pill-top span{background:var(--ft-leaf);color:#fff;border-radius:var(--ft-r-pill);padding:2px 12px;font-weight:500}
.hero h1 em{font-style:normal;color:var(--ft-leaf-light)}
.hero-cta{display:flex;flex-wrap:wrap;gap:12px}
.btn-ghost{color:#fff;border:1px solid rgba(255,255,255,.7);padding:12px 26px;border-radius:var(--ft-r-pill)}
.btn-ghost:hover{background:rgba(255,255,255,.12)}
.ticks{list-style:none;display:flex;flex-wrap:wrap;gap:8px 20px;margin:24px 0 0;padding:0;font-size:15px;color:#F2F6EC}
.ticks li::before{content:"✓";display:inline-flex;width:20px;height:20px;border-radius:50%;background:var(--ft-leaf);color:#fff;font-size:12px;align-items:center;justify-content:center;margin-right:8px}
.demo{position:relative;background:#fff;color:var(--ft-ink);border-radius:var(--ft-r-lg);padding:26px 24px 20px;box-shadow:0 20px 50px rgba(0,0,0,.25);transform:rotate(1.5deg)}
.demo-tag{position:absolute;top:-12px;left:20px;background:var(--ft-rust);color:#fff;font-size:12px;border-radius:var(--ft-r-pill);padding:3px 12px}
.demo .k{font-size:13px;color:var(--ft-ink-4);margin:0}
.demo .code{font-family:var(--ft-font-alt);font-size:30px;font-weight:500;color:var(--ft-deep);line-height:1.3;margin:2px 0 6px}
.demo ul{margin:12px 0 0;padding:0;list-style:none;font-size:14px;color:var(--ft-ink-2)}
.demo li{padding:3px 0}
.demo li::before{content:"✓ ";color:var(--ft-leaf);font-weight:600}
.demo-ai{margin-top:14px;background:var(--ft-mist);border-radius:var(--ft-r-sm);padding:10px 12px;font-size:13px;color:var(--ft-ink-3)}
.demo-ai b{display:block;font-weight:500;color:var(--ft-deep)}

.range{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
.prod{display:flex;flex-direction:column;background:#fff;border:1px solid var(--ft-line);border-radius:var(--ft-r-md);overflow:hidden;text-decoration:none;color:var(--ft-ink);transition:.2s}
.prod:hover{border-color:var(--ft-leaf);box-shadow:var(--ft-shadow);transform:translateY(-2px)}
.prod img{aspect-ratio:4/3;object-fit:cover;width:100%}
.prod div{padding:14px 16px 16px}
.prod b{font-family:var(--ft-font-alt);font-size:20px;font-weight:500;color:var(--ft-deep)}
.prod span{margin-left:6px;font-size:14px;color:var(--ft-leaf-dark)}
.prod p{margin:6px 0 0;font-size:14px;color:var(--ft-ink-3);line-height:1.5}

.faq{max-width:820px;display:grid;gap:10px}
.faq details{background:#fff;border:1px solid var(--ft-line);border-radius:var(--ft-r-sm)}
.faq summary{cursor:pointer;padding:14px 18px;font-size:16px;font-weight:500;color:var(--ft-deep);list-style:none;display:flex;justify-content:space-between;gap:12px}
.faq summary::-webkit-details-marker{display:none}
.faq summary::after{content:"+";color:var(--ft-leaf);font-size:20px;line-height:1}
.faq details[open] summary::after{content:"−"}
.faq p{margin:0;padding:0 18px 16px;color:var(--ft-ink-3);font-size:15px}
.faq-cta{display:flex;flex-wrap:wrap;gap:12px;margin-top:22px}

.sticky-cta{display:none}
@media (max-width:860px){
  .hero-grid{grid-template-columns:1fr;gap:34px}
  .demo{max-width:420px;transform:none}
  .range{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:640px){
  .hero h1{font-size:28px}
  .hero-cta .btn{flex:1}
  .range{gap:10px}
  .prod div{padding:10px 12px 12px}
  .prod b{font-size:17px}
  .prod span{display:block;margin:0}
  .prod p{font-size:13px}
  .demo .code{font-size:26px}
  .sticky-cta{display:block;position:fixed;left:16px;right:16px;bottom:calc(14px + env(safe-area-inset-bottom));z-index:30;text-align:center;background:var(--ft-forest);color:#fff;text-decoration:none;border-radius:var(--ft-r-pill);padding:14px;font-size:16px;font-weight:500;box-shadow:0 8px 24px rgba(38,86,66,.35);transition:.25s}
  .sticky-cta.off{opacity:0;pointer-events:none;transform:translateY(20px)}
}
.hero-grid h1{font-size:40px;max-width:none}
.hero h1 em{display:block}
@media (max-width:640px){ .hero-grid h1{font-size:28px} }
.nw{white-space:nowrap}
@media (max-width:640px){
  .hero-grid h1{font-size:25px;line-height:1.4}
  .hero-cta .btn{padding:12px 16px;white-space:nowrap}
}
