:root{--ink:#203f32;--muted:#63786a;--green:#28684b;--cream:#f7f6ef;--line:#dce7d9;--soft:#edf5eb;--gold:#b58139}
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;min-width:320px;min-height:100vh;color:var(--ink);background:linear-gradient(160deg,#eaf2e7 0,var(--cream) 340px,#faf9f5 100%);font:15px/1.5 system-ui,-apple-system,"Segoe UI","Noto Sans Thai",sans-serif}
[hidden]{display:none!important}button,input{font:inherit}button{cursor:pointer}button:disabled{opacity:.55;cursor:wait}img{display:block;max-width:100%}
.app-shell{width:min(100% - 28px,720px);margin:auto;padding:12px 0 24px}
.brandbar{display:flex;align-items:center;gap:9px;min-height:48px;margin-bottom:10px}.brandmark{display:grid;place-items:center;width:42px;height:42px;flex:none;background:#244b36;border-radius:11px}.brandmark img{width:36px;height:36px;object-fit:contain}.brandcopy{display:grid;line-height:1.2}.brandcopy strong{font-size:18px}.brandcopy span{color:var(--muted);font-size:10px;letter-spacing:.07em}.scent-chip{margin-left:auto;padding:5px 8px;border-radius:99px;background:#e2eee0;color:var(--green);font-size:10px;font-weight:700}
.module-nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;margin-bottom:12px;padding:4px;border:1px solid var(--line);border-radius:15px;background:#fffefa;box-shadow:0 5px 20px #294b3210}.module-nav a{display:flex;align-items:center;justify-content:center;gap:4px;min-height:42px;min-width:0;padding:4px;border-radius:11px;color:var(--ink);font-size:13px;font-weight:700;text-align:center;text-decoration:none;white-space:nowrap}.module-nav a span{font-size:17px}.module-nav a[aria-current=page]{color:white;background:var(--green)}
.hero{position:relative;display:flex;align-items:center;min-height:125px;overflow:hidden;margin-bottom:12px;padding:15px 18px;border:1px solid #d1dfcc;border-radius:19px;background:linear-gradient(105deg,#e5f1e2,#f5f1df)}.hero::before{content:"";position:absolute;inset:0 0 0 auto;width:52%;background:url('/static/tcff/botanical-soft.jpg') center 54%/cover;opacity:.25;mask-image:linear-gradient(90deg,transparent,#000 45%)}.hero-copy{position:relative;z-index:2;max-width:70%}.hero .eyebrow{margin:0 0 2px;color:var(--gold);font-size:10px;font-weight:800;letter-spacing:.1em}.hero h1{margin:0;color:#164d38;font-size:clamp(21px,5vw,29px);line-height:1.2}.hero p:last-child{margin:4px 0 0;color:#4b6854;font-size:12px;line-height:1.35}.hero-art{position:absolute;right:9px;bottom:-18px;z-index:1;width:112px;height:136px;background:url('/static/tcff/bottle-clean.png') center/contain no-repeat;transform:rotate(5deg)}.perfume-drop{position:absolute;display:block;width:11px;height:15px;right:18px;bottom:18px;border-radius:60% 60% 65% 65%/45% 45% 70% 70%;background:linear-gradient(130deg,#fff8d6 10%,#c78939 80%);box-shadow:inset 2px 2px 2px #fff9,0 2px 5px #72532166;animation:drip 3.3s ease-in infinite}.drop-two{right:24px;animation-delay:1.65s;opacity:.7}@keyframes drip{0%,45%{transform:translateY(0) scale(.35);opacity:0}55%{opacity:1}85%{transform:translateY(25px) scale(1);opacity:1}100%{transform:translateY(36px) scale(.8);opacity:0}}
.card,.bottle-table,.empty-card,.move-history li{border:1px solid var(--line);border-radius:17px;background:#fffefa;box-shadow:0 6px 22px #244b3010}.card{margin-bottom:12px;padding:16px}.section-title{display:flex;align-items:center;justify-content:space-between;gap:7px;margin-bottom:12px}.section-title>div{display:flex;align-items:center;gap:8px;min-width:0}.section-title h2{margin:0;font-size:17px;line-height:1.3}.section-title.outside{margin:18px 2px 9px}.section-title.compact{margin-top:18px}.step-dot{display:grid;place-items:center;flex:none;width:26px;height:26px;border-radius:8px;background:var(--soft);color:var(--green);font-size:11px;font-weight:800}.soft-tag{display:inline-block;max-width:45%;overflow:hidden;padding:5px 8px;border-radius:99px;background:var(--soft);color:var(--green);font-size:10px;font-weight:800;text-overflow:ellipsis;white-space:nowrap}
label{display:block;margin-bottom:5px;font-size:13px;font-weight:700}input:not([type=file]){display:block;width:100%;min-width:0;height:45px;padding:0 11px;border:1px solid #c9d9c9;border-radius:10px;background:#fff;color:var(--ink);outline:none;font-size:16px}input::placeholder{color:#87998b}input:focus-visible,button:focus-visible,a:focus-visible{outline:3px solid #8dbd95;outline-offset:2px}.input-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px}button{min-height:44px;padding:0 14px;border:0;border-radius:10px;font-weight:750}.primary,button[type=submit]{background:var(--green);color:#fff}.primary:hover,button[type=submit]:hover{background:#1c5039}.secondary{border:1px solid #bed5c1;background:var(--soft);color:#1c5039}.scan-action,.scan-location-btn{width:100%;margin-top:10px}.hint,.muted,#status,#message{color:var(--muted);font-size:13px}.hint{margin:6px 0 0;text-align:center}#status,#message{min-height:18px;margin:8px 0 0}.error{color:#a33b2c!important}.or-line{display:flex;align-items:center;gap:9px;margin:9px 0;color:var(--muted);font-size:12px}.or-line::before,.or-line::after{content:"";flex:1;height:1px;background:var(--line)}#camera{position:relative;overflow:hidden;margin-bottom:9px;border-radius:12px;background:#17271e;aspect-ratio:4/3}#video{width:100%;height:100%;object-fit:cover}#stop,#stop-camera{width:100%}
.result-head{display:flex;justify-content:space-between;gap:10px}.result-head h2,.product-name{margin:0;font-size:20px;line-height:1.3;overflow-wrap:anywhere}.result-head .muted,.first-result .muted{margin:4px 0}.leaf-seal{color:var(--gold);font-size:22px}.quantities{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:13px 0}.quantities>div{padding:10px 12px;border-radius:11px;background:var(--soft)}.quantities small,.quantities strong{display:block}.quantities small{color:var(--muted);font-size:11px}.quantities strong{font-size:19px;color:#18513a;overflow-wrap:anywhere}.detail-list{display:grid;grid-template-columns:90px minmax(0,1fr);gap:7px 10px;margin:0;padding-top:12px;border-top:1px solid var(--line);font-size:13px}.detail-list dt{color:var(--muted)}.detail-list dd{margin:0;font-weight:650;overflow-wrap:anywhere}
.bottle-table{width:100%;border-collapse:separate;border-spacing:0;overflow:hidden;text-align:left;font-size:12px}.bottle-table thead{background:var(--soft);color:var(--muted)}.bottle-table th,.bottle-table td{padding:10px 8px;border-bottom:1px solid var(--line);vertical-align:top}.bottle-table tbody tr:last-child>*{border-bottom:0}.bottle-table tbody th strong,.cell-location,.bottle-table tbody th small{display:block;overflow-wrap:anywhere}.cell-location,.bottle-table tbody th small{color:var(--muted);font-size:11px}.cell-qty{font-weight:800}.state-badge{display:inline-block;padding:3px 5px;border-radius:5px;background:var(--soft);color:var(--green)}.opened-row{background:#fcfaf1}.empty-card{margin:0;padding:18px;text-align:center;color:var(--muted)}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.move-current{margin-top:14px;padding:13px;border:1px solid #cfe0cd;border-radius:12px;background:#f4f8f1}.mini-label{margin-bottom:5px;color:var(--muted);font-size:11px;font-weight:700}.current-grid{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center}.move-code{display:block;margin-top:5px;overflow-wrap:anywhere}.current-grid p{margin:3px 0 0}.location-orb{display:grid;min-width:78px;padding:7px;border-radius:9px;background:#e4efe2;text-align:center}.location-orb span{color:var(--muted);font-size:11px}.location-orb strong{font-size:14px;overflow-wrap:anywhere}.move-location-step{margin-top:16px;padding-top:15px;border-top:1px solid var(--line)}.destination{margin:9px 0 0;color:var(--muted);font-size:13px}
.weight-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:16px}.net-panel{display:flex;justify-content:space-between;align-items:center;margin:11px 0 0;padding:10px 12px;border-radius:10px;background:var(--soft)}.net-panel strong{font-size:18px;color:#18513a}.photo-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.photo-slot{min-width:0;padding:10px;border:1px dashed #c6d9c7;border-radius:11px;background:#fbfcf8}.photo-slot img{width:100%;max-height:110px;margin-bottom:6px;border-radius:6px;object-fit:cover}.photo-slot input{width:100%;max-width:100%;font-size:11px;color:var(--muted)}.photo-clear{min-height:30px;margin-top:6px;padding:0 9px;font-size:11px}.save-action{width:100%;margin-top:16px}.move-history{display:grid;gap:8px;margin:0;padding:0;list-style:none}.move-history li{padding:11px 12px;overflow-wrap:anywhere}footer{padding:11px 0 4px;color:#849487;text-align:center;font-size:10px;letter-spacing:.06em}.footer-leaf{color:var(--green)}
@media(max-width:520px){.scent-chip{display:none}.hero{min-height:114px;padding:13px 15px}.hero-copy{max-width:72%}.hero-art{right:0;width:100px;height:125px}.card{padding:14px}.bottle-table th:nth-child(3),.bottle-table td:nth-child(3),.bottle-table th:nth-child(4),.bottle-table td:nth-child(4){display:none}.bottle-table th,.bottle-table td{padding:9px 11px}}
@media(max-width:360px){.module-nav a{font-size:11px;gap:2px}.module-nav a span{font-size:14px}}
@media(prefers-reduced-motion:reduce){.perfume-drop{animation:none;opacity:.65}}

/* Nature glass refresh: keep data readable against the leafy backdrop. */
body{background:#edf3ea}
body::before{content:"";position:fixed;inset:0;z-index:0;background:linear-gradient(125deg,#f5f8f1bc,#eef5e8b8),url('/static/tcff/botanical-soft.jpg') center/cover no-repeat;pointer-events:none}
.app-shell{position:relative;z-index:1}
.module-nav,.card,.bottle-table,.empty-card,.move-history li{background:rgba(255,255,251,.80);border-color:rgba(208,225,204,.9);box-shadow:0 10px 32px #254e2d14;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)}
.hero{background:linear-gradient(110deg,#e6f1e6dc,#f5f1e1b7);border-color:#d3e2d1}
.hero-jasmine{position:absolute;right:112px;top:8px;z-index:1;width:34px;height:34px;background:url('/static/tcff/jasmine-cutout.png') center/contain no-repeat;filter:drop-shadow(0 2px 4px #60795665);animation:jasmine-turn 14s ease-in-out infinite alternate}
@keyframes jasmine-turn{from{transform:rotate(-22deg) scale(.9)}to{transform:rotate(65deg) scale(1.04)}}
.perfume-drop{animation:drip 3.3s ease-in infinite}
.bottle-table{table-layout:fixed;font-size:12px}
.bottle-table th:nth-child(1){width:41%}.bottle-table th:nth-child(2){width:23%}.bottle-table th:nth-child(3){width:36%}
.bottle-table thead{background:#e0ede0;color:#214b37}
.bottle-table th,.bottle-table td{padding:10px 8px;overflow-wrap:anywhere}
.bottle-table tbody th strong{font-size:13px;color:#173e2d}
.bottle-table .row-state{display:inline-block;margin-top:4px;padding:2px 6px;border-radius:7px;background:#edf4e8;color:#28684b;font-weight:700}
.bottle-table .opened-row{background:rgba(236,247,232,.75)}
.cell-dates span{display:block;margin:0 0 3px;line-height:1.35}.cell-dates b{color:#557563;font-weight:750}
.cell-qty{font-variant-numeric:tabular-nums;white-space:nowrap;letter-spacing:-.04em}
.current-weight{display:flex;justify-content:space-between;gap:8px;align-items:center;margin:12px 0 0;padding:10px 12px;border-radius:11px;background:#e6f1e5;font-size:13px}.current-weight strong{font-size:17px;color:#175539}
.net-edit{margin-top:14px}.net-edit input{background:#f6faf3!important;border-color:#a9caaa!important;font-weight:750}.weight-grid{margin-top:11px}.photo-help{margin:-4px 0 10px;color:var(--muted);font-size:12px;line-height:1.4}.photo-slot input::file-selector-button{padding:7px 9px;border:1px solid #bdd4c0;border-radius:8px;background:#eaf3e7;color:#245941;font:inherit;cursor:pointer}
.photo-slot{background:rgba(250,253,248,.72)}
@media(max-width:520px){.bottle-table th:nth-child(3),.bottle-table td:nth-child(3){display:table-cell}.bottle-table th:nth-child(1){width:41%}.bottle-table th:nth-child(2){width:23%}.bottle-table th:nth-child(3){width:36%}.bottle-table th,.bottle-table td{padding:9px 6px}.cell-qty{font-size:10px}.cell-dates{font-size:10px}.hero-jasmine{right:89px;width:29px;height:29px}}
@media(prefers-reduced-motion:reduce){.hero-jasmine,.perfume-drop{animation:none!important}}

/* Bottle selection and simplified artwork. */
.hero-art{background-image:url('/static/tcff/bottle-clean.png')}
.candidate-help{margin:0 2px 10px;color:var(--muted);font-size:13px}
.candidate-list{display:grid;gap:8px}
.candidate-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;width:100%;min-height:75px;padding:11px 13px;border:1px solid #cfdfcd;border-radius:13px;background:rgba(255,255,252,.88);color:var(--ink);text-align:left;box-shadow:0 4px 12px #21472a0e}
.candidate-row:hover,.candidate-row:focus-visible{border-color:#75a786;background:#f3faf1}
.candidate-main,.candidate-side{display:grid;min-width:0;gap:2px}.candidate-main strong{font-size:15px;overflow-wrap:anywhere}.candidate-main small,.candidate-side small{color:var(--muted);font-size:11px;line-height:1.35;overflow-wrap:anywhere}.candidate-side{text-align:right;max-width:115px}.candidate-side strong{font-size:15px;font-variant-numeric:tabular-nums;color:#1b5d3c}.first-candidates{margin-top:16px;padding-top:15px;border-top:1px solid var(--line)}
@media(max-width:520px){.candidate-row{padding:10px 11px}.candidate-side{max-width:94px}}

/* Stock location view v20260919-location2: scanned bottle first, same-MP friends by location. */
.primary-location{margin:12px 0 0;padding:10px 12px;border:1px solid #cfe0cd;border-radius:11px;background:rgba(230,241,229,.86)}
.primary-location small,.primary-location strong{display:block}.primary-location small{color:var(--muted);font-size:11px;font-weight:700}.primary-location strong{margin-top:2px;color:#164f37;font-size:18px;line-height:1.25;overflow-wrap:anywhere}
.friends-help{margin:-2px 2px 9px;color:var(--muted);font-size:12px;line-height:1.4}
.friend-list{display:grid;gap:8px}
.friend-row{padding:11px 12px;border:1px solid rgba(207,223,205,.95);border-radius:14px;background:rgba(255,255,252,.86);box-shadow:0 5px 16px #21472a0d;backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
.friend-row.is-opened{border-left:4px solid #2b7452;padding-left:9px}
.friend-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding-bottom:8px;border-bottom:1px solid var(--line)}
.friend-location{min-width:0}.friend-location small,.friend-ident small,.friend-meta small{display:block;color:var(--muted);font-size:10px;font-weight:700}.friend-location strong{display:block;margin-top:1px;color:#15533a;font-size:16px;line-height:1.25;overflow-wrap:anywhere}
.friend-state{flex:none;padding:4px 7px;border-radius:99px;background:#e8f2e5;color:#28684b;font-size:10px;font-weight:800;white-space:nowrap}
.friend-ident{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:8px}.friend-ident>div{min-width:0}.friend-ident strong{display:block;margin-top:1px;color:#1a4131;font-size:12px;line-height:1.3;overflow-wrap:anywhere}
.friend-meta{display:grid;grid-template-columns:.75fr 1fr 1fr;gap:8px;margin-top:8px;padding-top:8px;border-top:1px dashed #dbe7d8}.friend-meta>div{min-width:0}.friend-meta strong{display:block;margin-top:1px;color:#284a39;font-size:11px;line-height:1.3;overflow-wrap:anywhere}.friend-meta .friend-qty strong{color:#155c3b;font-size:14px;font-variant-numeric:tabular-nums}
@media(min-width:700px){.friend-row{display:grid;grid-template-columns:minmax(130px,.9fr) minmax(220px,1.5fr) minmax(270px,1.7fr);gap:14px;align-items:center}.friend-top,.friend-ident,.friend-meta{margin:0;padding:0;border:0}.friend-ident{display:grid}.friend-meta{display:grid}.friend-location strong{font-size:17px}}
@media(max-width:360px){.friend-meta{grid-template-columns:1fr 1fr}.friend-meta .friend-qty{grid-column:1/-1}.friend-location strong{font-size:15px}}

/* Simple scan UI: full camera view, no aiming frame. */
#camera{aspect-ratio:16/9;margin-top:10px;border-radius:14px;background:#101b16}
#video{width:100%;height:100%;object-fit:cover}
.compact-hero{min-height:108px}
.compact-hero .hero-copy{max-width:72%}
.workflow-card #message{margin-bottom:0}
.page-move .move-current{margin-top:14px}
.page-move .move-location-step{margin-top:14px;padding-top:14px}
.page-first .first-result .muted{font-size:12px}
@media(max-width:520px){
  .app-shell{width:min(100% - 20px,720px)}
  .brandbar{margin-bottom:8px}
  .module-nav{margin-bottom:10px}
  .compact-hero{min-height:102px;margin-bottom:10px}
  .compact-hero h1{font-size:24px}
  .card{padding:13px}
  .section-title{margin-bottom:10px}
  .section-title h2{font-size:16px}
  #camera{aspect-ratio:16/9}
  .photo-grid{gap:7px}
}


/* Production custom confirmation: avoids browser/hostname alert title. */
.modal-open{overflow:hidden}
.confirm-modal{position:fixed;inset:0;z-index:9999;display:grid;place-items:center;padding:20px}
.confirm-backdrop{position:absolute;inset:0;background:rgba(12,28,21,.58);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}
.confirm-box{position:relative;width:min(100%,390px);padding:22px;border:1px solid #d7e4d4;border-radius:20px;background:#fffefa;box-shadow:0 24px 80px rgba(12,39,27,.28);text-align:center}
.confirm-box h2{margin:0;color:#173f2f;font-size:22px;line-height:1.25}
.confirm-code{margin:13px 0 8px;color:#294b3a;font-size:17px;font-weight:800;overflow-wrap:anywhere}
.confirm-route{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:8px;align-items:center;margin:8px 0 18px;padding:12px;border-radius:12px;background:#edf5eb;color:#1f553d;font-size:16px;font-weight:750}
.confirm-route span{overflow-wrap:anywhere}.confirm-route b{color:#6c806f;font-size:18px}
.confirm-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}.confirm-actions button{min-height:48px}
@media(max-width:380px){.confirm-box{padding:18px}.confirm-box h2{font-size:20px}.confirm-route{font-size:14px}}
