:root{
  --bg:#F4F3EE;
  --surface:#FFFFFF;
  --surface-2:#FBFAF6;
  --ink:#2A211B;
  --ink-2:#6B6359;
  --ink-3:#9A938A;
  --border:#E7E7E0;
  --border-strong:#DAD9D0;
  --lime:#C7D416;
  --lime-ink:#3A3F00;
  --lavender:#BAC0FA;
  --lavender-deep:#9AA2F2;
  --coral:#EE6E32;
  --coral-deep:#D85B22;
  /* status */
  --st-pending:#F5C451;
  --st-quoted:#BAC0FA;
  --st-decision:#EE6E32;
  --st-shipment:#6AA7E8;
  --st-payment:#C7D416;
  --st-completed:#4CAF50;
  --st-rejected:#E25D5D;
  --st-declined:#9A8F84;
  /* tweakable — overridden inline on .app-root */
  --accent:#EE6E32;
  --accent-ink:#FFFFFF;
  --r:18px;
  --r-sm:11px;
  --r-lg:24px;
  --r-xl:30px;
  --card-shadow:none;
  --card-border:1px solid var(--border);
  --pad:1;
  --display-weight:800;
  --display-family:'Sora';
}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  font-family:'Sora','Anuphan',system-ui,-apple-system,sans-serif;
  background:var(--bg);
  color:var(--ink);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
:lang(th), .th{ font-family:'Anuphan','Sora',system-ui,sans-serif; }
.display{ font-family:var(--display-family),'Anuphan',system-ui,sans-serif; font-weight:var(--display-weight); letter-spacing:-0.02em; line-height:1.02; text-wrap:balance; }
button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit}
input,select,textarea{font-family:inherit}
a{color:inherit;text-decoration:none}
::selection{background:var(--lime);color:var(--lime-ink)}

/* ============ APP LAYOUT ============ */
.viewport{ min-height:100vh; width:100%; background:var(--bg); display:flex; flex-direction:column; align-items:stretch; }
.viewport.mobile{ background:#E5E3DA; padding:0; }
.stage{ container-type:inline-size; width:100%; flex:1; display:flex; flex-direction:column; min-height:100vh; background:var(--bg); position:relative; }
.viewport.mobile .stage{
  max-width:402px; width:402px; margin:0 auto; min-height:100vh;
  box-shadow:0 0 0 1px rgba(0,0,0,.06), 0 30px 80px -30px rgba(0,0,0,.4);
}
@media(max-width:440px){ .viewport.mobile .stage{ width:100%; max-width:100%; box-shadow:none; } }

/* ============ UTILITY BAR ============ */
.toolbar{ position:sticky; top:0; z-index:50; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 28px; backdrop-filter:saturate(140%) blur(8px); }
.toolbar.onlight{ background:color-mix(in srgb, var(--bg) 82%, transparent); }
.toolbar.onlav{ background:transparent; }
.brand{ display:flex; align-items:center; gap:7px; font-family:var(--display-family); font-weight:800; font-size:23px; letter-spacing:-0.03em; color:var(--ink); }
.brand .amp{ color:var(--lime); }
.brand .spark{ color:var(--lime); font-size:15px; transform:translateY(-6px); }
.nav-links{ display:flex; align-items:center; gap:30px; font-weight:600; font-size:15px; }
.nav-links a{ color:var(--ink); opacity:.82; transition:opacity .15s; }
.nav-links a:hover{ opacity:1; }
.toolbar-right{ display:flex; align-items:center; gap:12px; }
.tb-segs{ display:flex; align-items:center; gap:12px; }
.tb-more{ display:none; position:relative; }
@container (max-width:720px){
  .nav-links{ display:none; }
  .toolbar{ padding:12px 16px; gap:8px; }
  .toolbar-right{ gap:9px; }
  .tb-segs{ display:none; }
  .tb-more{ display:grid; place-items:center; }
}

/* lang + device toggle */
.seg{ display:inline-flex; padding:3px; background:color-mix(in srgb,var(--ink) 8%,transparent); border-radius:999px; gap:2px; }
.seg.onlight{ background:rgba(42,33,27,.07); }
.seg button{ font-weight:700; font-size:12.5px; padding:5px 11px; border-radius:999px; color:var(--ink-2); transition:.15s; letter-spacing:.02em; }
.seg button.on{ background:var(--surface); color:var(--ink); box-shadow:0 1px 2px rgba(0,0,0,.07); }
.acct-item{ cursor:pointer; transition:background .12s; }
.acct-item:hover{ background:var(--surface-2); }

/* ============ BUTTONS ============ */
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:9px; font-weight:700; font-size:16px; padding:15px 26px; border-radius:999px; transition:transform .12s cubic-bezier(.3,.7,.4,1), background .15s, box-shadow .15s, opacity .15s; white-space:nowrap; line-height:1; }
.btn:active{ transform:scale(.97); }
.btn-primary{ background:var(--accent); color:var(--accent-ink); }
.btn-primary:hover{ filter:brightness(.96); }
.btn-ink{ background:var(--ink); color:#fff; }
.btn-ink:hover{ filter:brightness(1.25); }
.btn-lime{ background:var(--lime); color:var(--lime-ink); }
.btn-lime:hover{ filter:brightness(.97); }
.btn-outline{ background:transparent; color:var(--ink); box-shadow:inset 0 0 0 1.5px var(--ink); }
.btn-outline:hover{ background:var(--ink); color:#fff; }
.btn-ghost{ background:transparent; color:var(--ink); }
.btn-ghost:hover{ background:rgba(42,33,27,.06); }
.btn-soft{ background:var(--surface); color:var(--ink); box-shadow:inset 0 0 0 1px var(--border); }
.btn-soft:hover{ background:var(--surface-2); }
.btn-sm{ font-size:14px; padding:10px 18px; }
.btn-lg{ font-size:18px; padding:18px 32px; }
.btn-block{ width:100%; }
.btn:disabled{ opacity:.45; pointer-events:none; }

/* ============ CARDS ============ */
.card{ background:var(--surface); border-radius:var(--r); border:var(--card-border); box-shadow:var(--card-shadow); }
.card-pad{ padding:calc(26px * var(--pad)); }
.surface-2{ background:var(--surface-2); }

/* ============ FORM ============ */
.field{ display:flex; flex-direction:column; gap:8px; }
.label{ font-weight:600; font-size:14px; color:var(--ink-2); }
.input, .select, .textarea{
  width:100%; background:var(--surface); border:1.5px solid var(--border); border-radius:var(--r-sm);
  padding:14px 16px; font-size:16px; color:var(--ink); transition:border-color .15s, box-shadow .15s;
}
.input::placeholder,.textarea::placeholder{ color:var(--ink-3); }
.input:focus,.select:focus,.textarea:focus{ outline:none; border-color:var(--ink); box-shadow:0 0 0 3px rgba(42,33,27,.08); }
.input.err,.select.err{ border-color:var(--st-rejected); box-shadow:0 0 0 3px rgba(226,93,93,.12); }
.textarea{ resize:vertical; min-height:96px; line-height:1.5; }
.select{ appearance:none; background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%236B6359' d='M0 0h12L6 8z'/></svg>"); background-repeat:no-repeat; background-position:right 16px center; padding-right:40px; }
.help{ font-size:13px; color:var(--ink-3); }
.err-msg{ font-size:13px; color:var(--st-rejected); font-weight:600; display:flex; align-items:center; gap:5px; }

/* ============ BADGES ============ */
.badge{ display:inline-flex; align-items:center; gap:6px; font-weight:700; font-size:12.5px; padding:5px 12px; border-radius:999px; letter-spacing:.01em; white-space:nowrap; }
.badge .dot{ width:7px; height:7px; border-radius:50%; background:currentColor; opacity:.9; }
.chip{ display:inline-flex; align-items:center; gap:7px; font-weight:600; font-size:14px; padding:9px 16px; border-radius:999px; background:var(--surface); border:1.5px solid var(--border); color:var(--ink); transition:.15s; }
.chip.on{ background:var(--ink); color:#fff; border-color:var(--ink); }
.chip.pill-lime.on{ background:var(--lime); color:var(--lime-ink); border-color:var(--lime); }

/* payment method options */
.pay-opt{ display:flex; align-items:center; gap:9px; text-align:left; padding:13px 14px; border-radius:var(--r-sm); font-weight:700; font-size:14.5px; background:var(--surface); color:var(--ink-2); border:1.5px solid var(--border); transition:background .15s, color .15s, border-color .15s; }
.pay-opt .pay-radio{ width:18px; height:18px; border-radius:50%; flex:none; display:grid; place-items:center; border:1.5px solid var(--border-strong); background:transparent; }
.pay-opt .pay-radio i{ width:7px; height:7px; border-radius:50%; background:var(--lime); opacity:0; }
.pay-opt.on{ background:var(--lime); color:var(--lime-ink); border-color:var(--lime-ink); }
.pay-opt.on .pay-radio{ border-color:transparent; background:var(--lime-ink); }
.pay-opt.on .pay-radio i{ opacity:1; }

/* ============ MISC ============ */
.eyebrow{ display:inline-flex; align-items:center; gap:7px; font-weight:700; font-size:13px; letter-spacing:.04em; padding:7px 14px; border-radius:999px; background:var(--lavender); color:var(--ink); }
.divider{ height:1px; background:var(--border); width:100%; }
.muted{ color:var(--ink-2); }
.faint{ color:var(--ink-3); }
.stripe-ph{ background-image:repeating-linear-gradient(135deg, var(--border) 0 1.5px, transparent 1.5px 11px); background-color:var(--surface-2); display:flex; align-items:center; justify-content:center; }
.ph-label{ font-family:'Sora',monospace; font-weight:600; font-size:12px; letter-spacing:.14em; text-transform:uppercase; color:var(--ink-3); background:var(--surface); padding:6px 12px; border-radius:999px; }

/* footer */
.foot-h{ font-weight:800; font-size:14px; letter-spacing:.01em; color:var(--ink); margin-bottom:18px; }
.foot-link{ color:var(--ink-2); font-size:14.5px; font-weight:600; text-align:left; transition:color .15s; width:fit-content; white-space:nowrap; }
.foot-link:hover{ color:var(--ink); }
.foot-legal{ color:var(--ink-3); font-size:13px; font-weight:600; transition:color .15s; white-space:nowrap; }
.foot-legal:hover{ color:var(--ink-2); }

.fade-in{ animation:fadeUp .5s cubic-bezier(.2,.7,.3,1) both; }
@keyframes fadeUp{ from{ transform:translateY(10px);} to{ transform:none; } }
.pop-in{ animation:pop .4s cubic-bezier(.2,1.1,.4,1) both; }
@keyframes pop{ from{ transform:scale(.96);} to{ transform:none; } }
@keyframes attnPulse{ 0%{ box-shadow:0 0 0 0 rgba(199,212,22,0); } 18%{ box-shadow:0 0 0 7px rgba(199,212,22,.55); transform:translateY(-2px); } 100%{ box-shadow:0 0 0 16px rgba(199,212,22,0); transform:none; } }
.attn{ animation:attnPulse 1.15s cubic-bezier(.2,.7,.3,1) 1; }
@media (prefers-reduced-motion: reduce){ .attn{ animation:none; } }
@media (prefers-reduced-motion: reduce){ .fade-in,.pop-in{ animation:none; } }

.scrolly{ overflow-y:auto; }
.scrolly::-webkit-scrollbar{ width:10px; height:10px; }
.scrolly::-webkit-scrollbar-thumb{ background:var(--border-strong); border-radius:99px; border:3px solid var(--bg); }

/* spinner (photo upload, etc.) */
@keyframes rr-spin{ to{ transform:rotate(360deg); } }
.rr-spin{ width:22px; height:22px; border-radius:50%; border:2.5px solid var(--border-strong); border-top-color:var(--accent); animation:rr-spin .7s linear infinite; }

/* toast */
.toast-wrap{ position:fixed; left:50%; bottom:30px; transform:translateX(-50%); z-index:200; display:flex; flex-direction:column; gap:10px; align-items:center; pointer-events:none; }
.toast{ display:flex; align-items:center; gap:11px; background:var(--ink); color:#fff; padding:14px 20px; border-radius:14px; font-weight:600; font-size:15px; box-shadow:0 14px 40px -10px rgba(0,0,0,.5); animation:pop .35s cubic-bezier(.2,1.1,.4,1) both; }.toast .tk{ width:22px; height:22px; border-radius:50%; background:var(--lime); color:var(--lime-ink); display:grid; place-items:center; font-weight:800; font-size:13px; flex:none; }

/* modal */
.modal-back{ position:fixed; inset:0; z-index:150; background:rgba(36,28,22,.5); backdrop-filter:blur(3px); display:flex; align-items:center; justify-content:center; padding:24px; animation:fadeUp .25s ease both; }
.modal{ background:var(--surface); border-radius:var(--r-lg); max-width:480px; width:100%; padding:34px; animation:pop .35s cubic-bezier(.2,1.1,.4,1) both; max-height:90vh; overflow-y:auto; }

/* ============ RESPONSIVE (container-query driven) ============ */
.wrap{ width:100%; max-width:1200px; margin:0 auto; padding-left:40px; padding-right:40px; }
.wrap-narrow{ width:100%; max-width:760px; margin:0 auto; padding-left:24px; padding-right:24px; }
.cq-2{ display:grid; grid-template-columns:1.05fr .95fr; gap:48px; align-items:center; }
.cq-3{ display:grid; grid-template-columns:repeat(3,1fr); gap:20px; }
.cq-4{ display:grid; grid-template-columns:repeat(4,1fr); gap:18px; }
.cq-2e{ display:grid; grid-template-columns:1fr 1fr; gap:20px; }
.admin-split{ display:grid; grid-template-columns:1.55fr 1fr; gap:clamp(18px,2.6cqw,36px); align-items:start; }
.quote-split{ display:grid; grid-template-columns:1.4fr 1fr; gap:clamp(20px,2.8cqw,40px); align-items:start; }
.quote-summary{ position:sticky; top:90px; }
.dash-top{ display:grid; grid-template-columns:1.4fr 1fr; gap:16px; align-items:stretch; margin-bottom:30px; }
.cq-row{ display:flex; gap:14px; align-items:center; }
.sticky-cta{ position:sticky; bottom:0; z-index:30; }
.only-desktop{ display:initial; }
.only-mobile{ display:none; }
.mobile-acct{ display:none; }
/* admin queue: table rows on desktop (separator lines) */
.admin-list-row:not(:last-child){ border-bottom:1px solid var(--border); }
@container (max-width:880px){
  .cq-4{ grid-template-columns:repeat(2,1fr); }
  .cq-3{ grid-template-columns:1fr; }
}
@container (max-width:760px){
  .cq-2{ grid-template-columns:1fr; gap:30px; }
  .cq-2e{ grid-template-columns:1fr; }
  .admin-split{ grid-template-columns:1fr; gap:18px; }
  .quote-split{ grid-template-columns:1fr; gap:18px; }
  .quote-summary{ order:-1; position:static; }
  .dash-top{ grid-template-columns:1fr; gap:14px; margin-bottom:26px; }
  .wrap{ padding-left:20px; padding-right:20px; }
  .wrap-narrow{ padding-left:18px; padding-right:18px; }
  .only-desktop{ display:none !important; }
  .only-mobile{ display:block; }
  .mobile-acct{ display:grid; }
  /* admin queue: separate spaced cards on mobile */
  .admin-list{ background:transparent !important; border:none !important; box-shadow:none !important; overflow:visible !important; border-radius:0 !important; display:flex; flex-direction:column; gap:12px; }
  .admin-list-row{ background:var(--surface); border:1px solid var(--border); border-radius:var(--r); box-shadow:var(--card-shadow); }
  .admin-list-row:not(:last-child){ border-bottom:1px solid var(--border); }
  .cq-row.stack-m{ flex-direction:column; align-items:stretch; }
  .hero-h1{ font-size:clamp(54px,17cqw,84px) !important; }
}
@container (max-width:480px){
  .cq-4{ grid-template-columns:repeat(2,1fr); gap:12px; }
}
