@import url('https://fonts.googleapis.com/css2?family=Anuphan:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700;800;900&family=Noto+Sans+Thai:wght@400;500;600;700;800&display=swap');

:root{
  --bg:#07111f;
  --panel:#0d1a2d;
  --panel2:#0b1727;
  --line:#21334d;
  --line-soft:rgba(255,255,255,.075);
  --line-strong:rgba(103,221,255,.30);
  --text:#f4f8ff;
  --text-soft:#dce7f5;
  --muted:#9db0c7;
  --brand:#67ddff;
  --brand2:#7d75ff;
  --brand3:#d05dff;
  --input:#0b1727;
  --header:rgba(7,17,31,.88);
  --soft:#0d1a2d;
  --danger:#4a2027;
  --success:#63e3b5;
  --warning:#ffd783;
  --shadow:0 20px 55px rgba(0,0,0,.24);
  --shadow-soft:0 12px 34px rgba(0,0,0,.18);
  --focus:0 0 0 4px rgba(103,221,255,.15);
  --font-body:'Noto Sans Thai','Inter',system-ui,-apple-system,'Segoe UI',sans-serif;
  --font-display:'Anuphan','Noto Sans Thai','Inter',system-ui,sans-serif;
  --font-ui:'Inter','Noto Sans Thai',system-ui,sans-serif;
  --radius-sm:12px;
  --radius-md:18px;
  --radius-lg:24px;
  color-scheme:dark;
}

html[data-theme="light"]{
  --bg:#f3f6fa;
  --panel:#ffffff;
  --panel2:#f7f9fc;
  --line:#d9e1ea;
  --line-soft:rgba(15,23,42,.075);
  --line-strong:rgba(53,191,233,.30);
  --text:#101828;
  --text-soft:#344054;
  --muted:#667085;
  --brand:#35bfe9;
  --brand2:#7767ff;
  --brand3:#b35cff;
  --input:#ffffff;
  --header:rgba(255,255,255,.88);
  --soft:#f7f9fc;
  --danger:#fff0f1;
  --shadow:0 18px 48px rgba(15,23,42,.10);
  --shadow-soft:0 10px 28px rgba(15,23,42,.07);
  --focus:0 0 0 4px rgba(53,191,233,.14);
  color-scheme:light;
}

*{box-sizing:border-box}

html{
  font-size:16px;
  -webkit-text-size-adjust:100%;
  text-rendering:optimizeLegibility;
  scroll-behavior:smooth;
}

html,body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--font-body);
}

body{
  min-height:100vh;
  line-height:1.68;
  letter-spacing:.006em;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

h1,h2,h3,h4,h5,h6{
  font-family:var(--font-display);
  color:var(--text);
  line-height:1.18;
  letter-spacing:-.025em;
  text-wrap:balance;
}

p{line-height:1.72}

a{text-decoration:none;color:inherit}
button,input,select,textarea{font:inherit}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible{
  outline:2px solid var(--brand);
  outline-offset:3px;
}

::selection{
  background:color-mix(in srgb,var(--brand) 28%,transparent);
  color:var(--text);
}

/* ----------------------------------------------------------
   ZOVYLO SIGNATURE LINE
   Thin cyan → violet → magenta line is the brand visual DNA.
   ---------------------------------------------------------- */

header,.siteHeader{
  min-height:70px;
  padding:10px 4vw;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--line);
  position:sticky;
  top:0;
  background:var(--header);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  z-index:100
}

header::after,.siteHeader::after{
  content:"";
  position:absolute;
  left:4vw;
  right:4vw;
  bottom:-1px;
  height:1px;
  background:linear-gradient(90deg,transparent,var(--brand),var(--brand2),var(--brand3),transparent);
  opacity:.45;
  pointer-events:none;
}

.brand{display:flex;align-items:center;gap:9px}
.brand .brandMark,
.brand>span{
  width:46px;height:46px;flex:0 0 46px;
  display:grid;place-items:center;
  border-radius:14px;
  background:transparent;
  color:inherit;
  box-shadow:none;
  overflow:visible
}
.brand .brandMark img,
.brand>span img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
  filter:drop-shadow(0 10px 18px color-mix(in srgb,var(--brand2) 34%,transparent))
}
.brand b{
  font-family:var(--font-display);
  font-weight:800;
  letter-spacing:.055em;
}
.brand small{color:var(--muted);font-family:var(--font-ui)}

nav,.siteNav{display:flex;gap:8px;align-items:center}
nav a,.siteNav a{
  padding:9px 11px;border-radius:11px;
  font-weight:650;
  transition:background .18s ease,color .18s ease,border-color .18s ease
}
nav a:hover,.siteNav a:hover{background:color-mix(in srgb,var(--brand) 7%,transparent)}

.uiSettings{display:flex;align-items:center;gap:6px}
.uiSettingBtn{
  height:38px;min-width:42px;
  padding:0 10px;
  border-radius:11px;
  border:1px solid var(--line);
  background:var(--soft);
  color:var(--text);
  cursor:pointer;
  font-family:var(--font-ui);
  font-weight:800
}
.uiSettingBtn:hover{
  border-color:var(--brand);
  box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 12%,transparent)
}

.cta,.primary{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  background:linear-gradient(135deg,var(--brand),var(--brand2),var(--brand3));
  color:#06101c!important;
  border:0;border-radius:13px;
  padding:11px 15px;
  font-family:var(--font-ui);
  font-weight:850;
  cursor:pointer;
  box-shadow:0 10px 24px color-mix(in srgb,var(--brand2) 20%,transparent);
  transition:transform .18s ease,filter .18s ease,box-shadow .18s ease
}
.cta:hover,.primary:hover{
  transform:translateY(-1px);
  filter:brightness(1.035);
  box-shadow:0 14px 30px color-mix(in srgb,var(--brand2) 26%,transparent)
}

.soft{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  border:1px solid var(--line);
  background:
    linear-gradient(var(--soft),var(--soft)) padding-box,
    linear-gradient(135deg,color-mix(in srgb,var(--brand) 30%,var(--line)),color-mix(in srgb,var(--brand2) 20%,var(--line))) border-box;
  color:var(--text);
  border-radius:12px;
  padding:10px 12px;
  transition:transform .18s ease,border-color .18s ease
}
.soft:hover{transform:translateY(-1px);border-color:var(--line-strong)}

.hero{
  padding:48px 5vw 24px;
  display:flex;align-items:flex-end;
  justify-content:space-between;gap:25px
}
.hero h1{
  font-size:clamp(38px,6vw,72px);
  line-height:1.02;
  margin:8px 0;
  font-weight:800
}
.hero p,.muted{color:var(--muted)}

.search{
  padding:0 5vw 18px;
  display:grid;
  grid-template-columns:1fr 220px auto;
  gap:8px
}

.search input,.search select,
.form input,.form select,.form textarea,
.actions input{
  min-height:46px;
  background:var(--input);
  color:var(--text);
  border:1px solid var(--line);
  border-radius:13px;
  padding:11px 12px;
  transition:border-color .18s ease,box-shadow .18s ease
}
.search input:focus,.search select:focus,
.form input:focus,.form select:focus,.form textarea:focus,
.actions input:focus{
  border-color:var(--brand);
  box-shadow:var(--focus);
  outline:none
}
input::placeholder,textarea::placeholder{color:color-mix(in srgb,var(--muted) 82%,transparent)}

.wall{
  padding:10px 2vw 50px;
  display:grid;
  grid-template-columns:repeat(16,1fr);
  grid-auto-rows:62px;
  grid-auto-flow:dense;
  gap:5px;
  min-height:500px
}
.tile{
  position:relative;overflow:hidden;border-radius:9px;
  background:var(--panel2);
  border:1px solid var(--line)
}
.tile.s2{grid-column:span 2;grid-row:span 2}
.tile.s3{grid-column:span 3;grid-row:span 3}
.tile img{width:100%;height:100%;object-fit:cover}
.fallback{
  height:100%;display:grid;place-items:center;
  background:linear-gradient(135deg,#12415e,#7d5aff);
  font-weight:900;font-size:24px
}
.founder{
  position:absolute;top:5px;right:5px;
  font-size:8px;padding:3px 5px;
  background:#17392f;color:#80f3bd;border-radius:6px
}
.cap{
  position:absolute;left:0;right:0;bottom:0;
  padding:18px 6px 6px;
  background:linear-gradient(transparent,rgba(0,0,0,.8));
  color:#fff;font-size:10px
}
.cap small{display:block}

.wide{width:min(1120px,92%);margin:35px auto}
.narrow{width:min(560px,92%);margin:45px auto}

.card{
  position:relative;
  border:1px solid transparent;
  border-radius:19px;
  padding:17px;
  background:
    linear-gradient(var(--panel),var(--panel)) padding-box,
    linear-gradient(135deg,
      color-mix(in srgb,var(--brand) 34%,var(--line)),
      var(--line) 38%,
      color-mix(in srgb,var(--brand2) 28%,var(--line)) 72%,
      color-mix(in srgb,var(--brand3) 22%,var(--line))
    ) border-box;
  box-shadow:var(--shadow-soft)
}

.form{display:flex;flex-direction:column;gap:12px}
.form label{display:flex;flex-direction:column;gap:6px;font-weight:650}
.form textarea{min-height:110px}
.grid{display:grid;grid-template-columns:1fr 1fr}
.full{grid-column:1/-1}

.bad{
  background:var(--danger);
  border:1px solid color-mix(in srgb,#ff6677 25%,var(--line));
  padding:12px;border-radius:12px;margin:12px 0
}
.badtext{color:#ff9e9e}
html[data-theme="light"] .badtext{color:#b42332}

.headrow,.row,.actions{display:flex;gap:10px;align-items:center}
.headrow{justify-content:space-between}
.headrow h1{font-weight:800}
.row{margin-bottom:10px}
.grow{flex:1}
.thumb{
  width:72px;height:72px;object-fit:cover;border-radius:14px;
  border:1px solid var(--line)
}
.review{margin-bottom:10px}
.actions{flex-wrap:wrap}
.actions input{flex:1;min-width:220px}
.links{word-break:break-all;color:#55cceb}

.detail{
  width:min(1050px,92%);
  margin:35px auto;
  display:grid;
  grid-template-columns:1.1fr 1fr;
  gap:26px
}
.cover{
  min-height:450px;border-radius:24px;overflow:hidden;
  background:var(--panel);
  border:1px solid var(--line)
}
.cover img{width:100%;height:100%;object-fit:cover}
.bigfallback{min-height:450px;font-size:80px}
.detail h1{font-size:48px;margin:8px 0;font-weight:800}
.desc{line-height:1.8}
.linksGrid{
  display:grid;grid-template-columns:1fr 1fr;
  gap:8px;margin:18px 0
}
.eyebrow{
  color:#4fd7f5;font-size:12px;font-weight:800;
  letter-spacing:.12em;font-family:var(--font-ui)
}
.legal{line-height:1.8}
.empty{padding:60px;color:var(--muted)}

footer{
  padding:28px 4vw;
  border-top:1px solid var(--line);
  color:var(--muted);
  font-size:13px
}
footer a{text-decoration:underline;text-underline-offset:3px}

/* ---------- GLOBAL LIGHT OVERRIDES FOR CURRENT ZOVYLO PAGES ---------- */

html[data-theme="light"] body,
html[data-theme="light"] main{
  background:var(--bg);
  color:var(--text)
}

html[data-theme="light"] .selbox,
html[data-theme="light"] .priceBox,
html[data-theme="light"] .payCard,
html[data-theme="light"] .mapPicker,
html[data-theme="light"] .formSection,
html[data-theme="light"] .lp-card,
html[data-theme="light"] .lp-contact,
html[data-theme="light"] .lp-fact,
html[data-theme="light"] .lp-address{
  background:var(--panel)!important;
  color:var(--text)!important;
  border-color:var(--line)!important
}

html[data-theme="light"] .mapBtn,
html[data-theme="light"] .reason,
html[data-theme="light"] .slipInput{
  background:var(--input)!important;
  color:var(--text)!important;
  border-color:var(--line)!important
}

html[data-theme="light"] .muted,
html[data-theme="light"] .fieldHint,
html[data-theme="light"] .mapStatus{
  color:var(--muted)!important
}

html[data-theme="light"] #locationMap{border-color:var(--line)!important}

html[data-theme="light"] .drawer{
  background:rgba(255,255,255,.98)!important;
  color:#101828!important
}

html[data-theme="light"] .drawer .meta,
html[data-theme="light"] .drawer .desc{color:#52677d!important}

html[data-theme="light"] .bottomToggle,
html[data-theme="light"] .recs,
html[data-theme="light"] .random,
html[data-theme="light"] .iconbtn{
  background:rgba(255,255,255,.96)!important;
  color:#101828!important;
  border-color:var(--line)!important
}

html[data-theme="light"] .pill:not(.active),
html[data-theme="light"] .navbtn:not(.active),
html[data-theme="light"] .ghost{
  background:#f7f9fc!important;
  color:#101828!important;
  border-color:var(--line)!important
}

html[data-theme="light"] .stats{
  background:rgba(255,255,255,.96)!important;
  color:#101828!important;
  border-color:var(--line)!important
}

/* ---------- ACCESSIBILITY ---------- */
@media(prefers-reduced-motion:reduce){
  *,*::before,*::after{
    scroll-behavior:auto!important;
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    transition-duration:.01ms!important
  }
}

@media(max-width:820px){
  .brand small{display:none}
  .brand .brandMark,.brand>span{width:38px;height:38px;flex-basis:38px}
  nav a:not(.cta),.siteNav a:not(.cta){display:none}
  .siteNav .uiSettings{display:flex}
  .uiSettingBtn{height:35px;min-width:36px;padding:0 7px;font-size:12px}
  .hero{padding:28px 14px 18px;align-items:flex-start;flex-direction:column}
  .hero h1{font-size:44px}
  .search{grid-template-columns:1fr 1fr;padding:0 12px 14px}
  .search input{grid-column:1/-1}
  .wall{grid-template-columns:repeat(6,1fr);grid-auto-rows:58px;padding:7px}
  .grid{grid-template-columns:1fr}
  .full{grid-column:auto}
  .detail{grid-template-columns:1fr}
  .cover,.bigfallback{min-height:300px}
  .detail h1{font-size:36px}
  .row{align-items:flex-start}
}

@media(max-width:560px){
  html{font-size:15px}
  .wide{width:min(100% - 24px,1120px);margin:24px auto}
  .headrow{align-items:flex-start}
  .primary,.cta{min-height:46px}
}


/* ==========================================================
   ZOVYLO MOBILE APP EXPERIENCE V1
   Shared responsive layer for pages rendered via head()/foot()
   ========================================================== */
:root{
  --app-safe-top:env(safe-area-inset-top,0px);
  --app-safe-right:env(safe-area-inset-right,0px);
  --app-safe-bottom:env(safe-area-inset-bottom,0px);
  --app-safe-left:env(safe-area-inset-left,0px);
}

html,body{min-height:100%;min-height:100dvh}
body{-webkit-tap-highlight-color:transparent;overscroll-behavior-y:none}
img{max-width:100%}
button,a,input,select,textarea{touch-action:manipulation}

@media(max-width:820px){
  body{min-height:100dvh}

  header,.siteHeader{
    min-height:58px;
    padding:
      max(7px,var(--app-safe-top))
      max(10px,var(--app-safe-right))
      7px
      max(10px,var(--app-safe-left));
    gap:8px;
    backdrop-filter:blur(22px) saturate(1.15);
    -webkit-backdrop-filter:blur(22px) saturate(1.15)
  }
  header::after,.siteHeader::after{left:10px;right:10px}
  .brand{min-width:0;gap:7px}
  .brand b{font-size:14px;letter-spacing:.04em;white-space:nowrap}
  .brand .brandMark,.brand>span{width:36px;height:36px;flex-basis:36px;border-radius:12px}
  .brand small{display:none}
  .siteNav{margin-left:auto;gap:5px;min-width:0}
  .siteNav .uiSettings{display:flex;gap:4px}
  .uiSettingBtn{height:36px;min-width:36px;padding:0 7px;border-radius:11px}

  .wide,.narrow,.detail{
    width:calc(100% - 20px);
    margin:14px auto calc(22px + var(--app-safe-bottom))
  }
  .narrow{max-width:600px}
  .detail{gap:14px}

  .card{
    border-radius:20px;
    padding:15px;
    box-shadow:0 12px 32px rgba(0,0,0,.16)
  }

  .headrow{
    gap:10px;
    align-items:center;
    margin-bottom:12px
  }
  .headrow h1{margin:0;font-size:clamp(23px,7vw,31px)}
  .headrow .primary{flex:0 0 auto;min-height:44px;padding:10px 13px}

  .form{gap:14px}
  .form input,.form select,.form textarea,.actions input,
  .search input,.search select{
    min-height:50px;
    border-radius:14px;
    font-size:16px
  }
  .form textarea{min-height:130px}

  .primary,.cta,.soft{min-height:46px;border-radius:14px}

  .detail{grid-template-columns:1fr}
  .cover,.bigfallback{min-height:260px;border-radius:20px}
  .detail h1{font-size:34px}
  .linksGrid{grid-template-columns:1fr}

  footer{
    padding:22px max(14px,var(--app-safe-right)) calc(22px + var(--app-safe-bottom)) max(14px,var(--app-safe-left));
    font-size:12px
  }
}

@media(max-width:560px){
  html{font-size:15px}
  .wide,.narrow,.detail{width:calc(100% - 16px);margin-top:10px}
  .card{padding:14px;border-radius:18px}

  .headrow{align-items:center}
  .headrow h1{font-size:24px}
  .headrow .primary{font-size:13px;padding:9px 11px}

  /* cards that were desktop rows become app-style list cards */
  .card.row{
    display:grid;
    grid-template-columns:72px minmax(0,1fr);
    gap:12px;
    align-items:start;
    margin-bottom:10px
  }
  .card.row>div:first-child:empty{display:none}
  .card.row>div:first-child:empty + .grow{grid-column:1/-1}
  .card.row .grow{min-width:0}
  .card.row .grow h3{margin:0 0 5px;font-size:17px}
  .card.row .thumb{width:72px;height:72px;border-radius:16px}
  .card.row .rowActions{
    grid-column:1/-1;
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
    width:100%;
    margin:2px 0 0
  }
  .card.row .rowActions .soft,
  .card.row .rowActions .primary{width:100%;min-height:47px}

  .search{grid-template-columns:1fr;padding:0 8px 12px}
  .search input,.search select,.search button{grid-column:1}
  .wall{grid-template-columns:repeat(4,1fr);grid-auto-rows:62px;padding:6px;gap:4px}
  .tile{border-radius:10px}
}


/* ==========================================================
   ZOVYLO GLOBAL RESPONSIVE V2
   Fluid app-style behavior from 320px phones through tablets.
   ========================================================== */
@media(max-width:820px){
  :root{
    --fluid-gutter:clamp(8px,3vw,14px);
    --fluid-card-radius:clamp(17px,5vw,21px);
  }

  html,body{width:100%;max-width:100vw;overflow-x:hidden}

  header,.siteHeader{
    min-height:clamp(54px,14vw,60px);
    padding:
      max(6px,var(--app-safe-top))
      max(var(--fluid-gutter),var(--app-safe-right))
      6px
      max(var(--fluid-gutter),var(--app-safe-left));
    gap:clamp(5px,1.6vw,8px)
  }

  .brand{gap:6px;min-width:0}
  .brand b{font-size:clamp(13px,3.8vw,15px)}
  .brand .brandMark,.brand>span{
    width:clamp(34px,9.5vw,38px);
    height:clamp(34px,9.5vw,38px);
    flex-basis:clamp(34px,9.5vw,38px)
  }
  .siteNav{gap:4px;min-width:0}
  .uiSettingBtn{width:clamp(34px,9.5vw,38px);min-width:0;height:clamp(35px,9.8vw,40px);padding:0}

  .hero{padding:clamp(22px,7vw,32px) var(--fluid-gutter) 16px;gap:14px}
  .hero h1{font-size:clamp(34px,11vw,48px);line-height:1.06}
  .hero p{font-size:clamp(13px,3.5vw,15px)}

  .search{grid-template-columns:1fr 1fr;padding:0 var(--fluid-gutter) 14px;gap:8px}
  .search input{grid-column:1/-1}
  .search input,.search select,.form input,.form select,.form textarea,.actions input{
    width:100%;min-width:0;min-height:clamp(48px,13vw,52px);font-size:16px
  }

  .wide,.narrow,.detail{
    width:calc(100% - (var(--fluid-gutter) * 2));
    margin:clamp(10px,3vw,16px) auto calc(22px + var(--app-safe-bottom))
  }
  .card{padding:clamp(13px,4vw,16px);border-radius:var(--fluid-card-radius)}
  .headrow{gap:8px;min-width:0}
  .headrow h1{min-width:0;font-size:clamp(22px,7vw,31px);line-height:1.18}
  .headrow .primary{flex:0 0 auto;max-width:46vw;white-space:normal;text-align:center}

  .grid,.detail,.linksGrid{grid-template-columns:1fr}
  .cover,.bigfallback{min-height:clamp(230px,62vw,320px)}
  .detail h1{font-size:clamp(30px,9vw,38px)}

  .wall{
    grid-template-columns:repeat(6,minmax(0,1fr));
    grid-auto-rows:clamp(54px,15vw,62px);
    padding:6px;
    gap:4px
  }
}

@media(max-width:560px){
  .wide,.narrow,.detail{width:calc(100% - 16px)}
  .headrow{align-items:center}
  .headrow h1{font-size:clamp(21px,6.8vw,25px)}
  .headrow .primary{font-size:12.5px;padding:9px 10px;max-width:44vw}
  .wall{grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:clamp(58px,18vw,66px)}
  .card.row{grid-template-columns:clamp(64px,20vw,76px) minmax(0,1fr)}
  .card.row .thumb{width:100%;height:auto;aspect-ratio:1;border-radius:15px}
}

@media(max-width:360px){
  html{font-size:14.5px}
  .brand b{font-size:12.5px}
  .headrow{align-items:flex-start;flex-direction:column}
  .headrow .primary{width:100%;max-width:none}
  .search{grid-template-columns:1fr}
  .search input,.search select,.search button{grid-column:1}
  .wall{grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:60px}
}

@media(min-width:561px) and (max-width:820px){
  .wide,.narrow,.detail{width:min(94%,760px)}
  .wall{grid-template-columns:repeat(8,minmax(0,1fr));grid-auto-rows:60px}
  .linksGrid{grid-template-columns:1fr 1fr}
}

@media(max-width:920px) and (orientation:landscape) and (max-height:540px){
  header,.siteHeader{min-height:50px;padding-top:max(4px,var(--app-safe-top));padding-bottom:4px}
  .hero{padding-top:16px;padding-bottom:10px}
  .hero h1{font-size:clamp(28px,7vw,40px)}
  .wide,.narrow,.detail{margin-top:8px}
  .cover,.bigfallback{min-height:210px}
}
