
:root{
  --bg:#06070a;
  --bg-elev:#0c1118;
  --text:#f5f7fb;
  --muted:rgba(255,255,255,.74);
  --line:rgba(255,255,255,.08);
  --line-strong:rgba(255,255,255,.14);
  --glass:rgba(14,20,30,.28);
  --glass-strong:rgba(16,23,35,.48);
  --dock:rgba(255,255,255,.14);
  --shadow:0 18px 40px rgba(0,0,0,.34);
  --shadow-strong:0 28px 60px rgba(0,0,0,.48);
  --accent:#0a84ff;
  --page-width:100%;
  --icon-size:78px;
  --icon-radius:23px;
  --safe-top:max(14px, env(safe-area-inset-top));
  --safe-bottom:max(16px, env(safe-area-inset-bottom));
}
:root[data-theme='light']{
  --bg:#dfe7f4;
  --bg-elev:#eef3fb;
  --text:#111827;
  --muted:rgba(17,24,39,.72);
  --line:rgba(255,255,255,.34);
  --line-strong:rgba(255,255,255,.55);
  --glass:rgba(255,255,255,.26);
  --glass-strong:rgba(255,255,255,.45);
  --dock:rgba(255,255,255,.4);
  --shadow:0 16px 38px rgba(15,23,42,.14);
  --shadow-strong:0 24px 54px rgba(15,23,42,.18);
  --accent:#007aff;
}
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-behavior:smooth}
body{
  margin:0;
  min-height:100dvh;
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text","Segoe UI",Roboto,"Noto Sans Thai","Helvetica Neue",Arial,sans-serif;
  background:
    radial-gradient(820px 420px at 16% 8%, rgba(30,96,255,.26), transparent 52%),
    radial-gradient(760px 420px at 84% 14%, rgba(255,122,0,.18), transparent 48%),
    radial-gradient(900px 580px at 50% 100%, rgba(0,0,0,.18), transparent 55%),
    linear-gradient(180deg, #0b1320 0%, #0c1a2a 28%, #0e1725 52%, #0a0e15 100%);
}
:root[data-theme='light'] body{
  background:
    radial-gradient(820px 420px at 16% 8%, rgba(0,122,255,.16), transparent 52%),
    radial-gradient(760px 420px at 84% 14%, rgba(255,149,0,.14), transparent 48%),
    radial-gradient(900px 580px at 50% 100%, rgba(255,255,255,.16), transparent 55%),
    linear-gradient(180deg, #d9e4f4 0%, #edf3fb 30%, #e3edf9 60%, #d8e4f1 100%);
}
img{display:block;max-width:100%}
a{color:inherit;text-decoration:none}
button{font:inherit}
.device-shell{
  position:relative;
  width:min(100%, 540px);
  min-height:100dvh;
  margin:0 auto;
  padding:var(--safe-top) 10px calc(130px + var(--safe-bottom));
  overflow:hidden;
}
.wallpaper-glow{position:absolute;border-radius:999px;filter:blur(40px);opacity:.7;pointer-events:none}
.wallpaper-glow-a{width:220px;height:220px;left:-40px;top:90px;background:rgba(80,142,255,.22)}
.wallpaper-glow-b{width:260px;height:260px;right:-90px;top:180px;background:rgba(255,143,54,.18)}
.chrome-float{
  position:relative;
  z-index:5;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:4px 6px 10px;
}
.floating-logo,.circle-btn,.pill-btn{
  border:1px solid var(--line);
  background:var(--glass);
  backdrop-filter:blur(18px) saturate(180%);
  -webkit-backdrop-filter:blur(18px) saturate(180%);
  box-shadow:var(--shadow);
}
.floating-logo{
  width:46px;height:46px;border-radius:15px;display:grid;place-items:center;overflow:hidden;
}
.floating-logo img{width:100%;height:100%;object-fit:cover}
.floating-actions{display:flex;align-items:center;gap:8px}
.circle-btn,.pill-btn{
  height:42px;display:inline-flex;align-items:center;justify-content:center;color:var(--text);cursor:pointer;
}
.circle-btn{width:42px;border-radius:999px;padding:0}
.pill-btn{min-width:42px;padding:0 12px;border-radius:999px}
.circle-btn svg,.pill-btn svg{width:18px;height:18px;fill:currentColor}
.install-pill{background:rgba(10,132,255,.24);border-color:rgba(10,132,255,.28)}
:root[data-theme='dark'] .icon-sun{display:block}
:root[data-theme='dark'] .icon-moon{display:none}
:root[data-theme='light'] .icon-sun{display:none}
:root[data-theme='light'] .icon-moon{display:block}
.home-screen{position:relative;z-index:2;padding:8px 0 0}
.home-sections{display:flex;flex-direction:column;gap:18px;padding:0 0 8px}
.home-section{position:relative}
.section-head{display:flex;align-items:center;justify-content:space-between;padding:0 6px 8px}
.section-title{margin:0;font-size:13px;line-height:1.2;font-weight:700;letter-spacing:-.01em;color:rgba(255,255,255,.94);text-shadow:0 1px 10px rgba(0,0,0,.28)}
:root[data-theme='light'] .section-title{color:#122033;text-shadow:none}
.app-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:18px 10px;
  align-content:start;
  padding:4px 4px 6px;
}
.section-grid{padding-bottom:2px;}
.app-card{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  gap:8px;
  min-width:0;
  text-align:center;
  user-select:none;
  -webkit-tap-highlight-color:transparent;
  transform:translateZ(0);
  transition:transform .14s ease, opacity .14s ease;
}
.app-card:active{transform:scale(.94)}
.icon-wrap{
  width:var(--icon-size);
  height:var(--icon-size);
  border-radius:var(--icon-radius);
  overflow:hidden;
  display:grid;
  place-items:center;
  background:linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,.06));
  border:1px solid var(--line-strong);
  box-shadow:0 10px 24px rgba(0,0,0,.24);
}
.icon-image{width:100%;height:100%;object-fit:contain;border-radius:inherit;transform-origin:center center;will-change:transform}
.card-title{
  width:100%;
  max-width:92px;
  min-height:28px;
  font-size:11.5px;
  line-height:1.16;
  font-weight:600;
  letter-spacing:-.01em;
  color:#fff;
  text-shadow:0 1px 10px rgba(0,0,0,.45);
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
:root[data-theme='light'] .card-title{color:#122033;text-shadow:0 1px 8px rgba(255,255,255,.5)}
.dock-bar{
  position:fixed;
  left:50%;
  bottom:calc(14px + var(--safe-bottom));
  transform:translateX(-50%);
  z-index:8;
  width:min(calc(100% - 18px), 520px);
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:10px;
  padding:12px 12px 10px;
  border:1px solid rgba(255,255,255,.18);
  border-radius:30px;
  background:var(--dock);
  box-shadow:var(--shadow-strong);
  backdrop-filter:blur(24px) saturate(180%);
  -webkit-backdrop-filter:blur(24px) saturate(180%);
}
.dock-card{gap:7px}
.dock-icon-wrap{box-shadow:0 10px 22px rgba(0,0,0,.2)}
.install-inline-tip{
  position:fixed;
  left:50%;
  bottom:calc(118px + var(--safe-bottom));
  transform:translateX(-50%);
  z-index:7;
  width:min(calc(100% - 30px), 430px);
  padding:10px 14px;
  border-radius:18px;
  border:1px solid var(--line);
  background:var(--glass-strong);
  backdrop-filter:blur(20px);
  -webkit-backdrop-filter:blur(20px);
  color:var(--muted);
  box-shadow:var(--shadow);
  font-size:13px;
}
.install-inline-tip strong{color:var(--text)}
.install-sheet-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:19}
.install-sheet{
  position:fixed;left:12px;right:12px;bottom:12px;z-index:20;max-width:520px;margin:0 auto;
  padding:10px 16px calc(18px + var(--safe-bottom));
  border-radius:28px;background:rgba(18,24,34,.88);border:1px solid var(--line);color:var(--text);
  backdrop-filter:blur(26px) saturate(180%);-webkit-backdrop-filter:blur(26px) saturate(180%);box-shadow:var(--shadow-strong)
}
:root[data-theme='light'] .install-sheet{background:rgba(255,255,255,.86)}
.sheet-handle{width:42px;height:5px;border-radius:999px;background:rgba(255,255,255,.32);margin:2px auto 12px}
.sheet-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}
.sheet-head h2{margin:0;font-size:21px;letter-spacing:-.04em}
.sheet-close{width:38px;height:38px;border-radius:999px;border:1px solid var(--line);background:var(--glass);color:var(--text);cursor:pointer}
.sheet-body{color:var(--muted);font-size:15px;line-height:1.5}.sheet-lead{margin:0 0 10px}.sheet-steps{margin:0;padding-left:20px}.sheet-steps li+li{margin-top:8px}.sheet-note{margin:12px 0 0}
.sheet-open{overflow:hidden}
.is-hidden{display:none !important}
body.is-installed-app #installBtn,
body.is-installed-app #installHelpBtn,
body.is-installed-app #installInlineTip{display:none !important}
@media (hover:hover){
  .app-card:hover{transform:translateY(-2px)}
  .circle-btn:hover,.pill-btn:hover{transform:translateY(-1px)}
}
@media (max-width:430px){
  :root{--icon-size:64px;--icon-radius:20px}
  .device-shell{padding-inline:9px;padding-bottom:calc(118px + var(--safe-bottom))}
  .chrome-float{padding-inline:2px;padding-bottom:8px}
  .floating-logo{width:42px;height:42px;border-radius:14px}
  .circle-btn,.pill-btn{height:40px}
  .circle-btn{width:40px}
  .home-sections{gap:16px}
  .section-head{padding:0 4px 8px}
  .section-title{font-size:12px}
  .app-grid{gap:16px 8px;padding-inline:2px}
  .card-title{max-width:78px;font-size:10.5px;min-height:24px}
  .dock-bar{width:min(calc(100% - 14px), 520px);padding:10px 10px 8px;border-radius:26px;gap:8px}
  .install-inline-tip{bottom:calc(104px + var(--safe-bottom));font-size:12px}
}
