/* Plant Care - base styles (อ้างอิงดีไซน์จากต้นแบบ Plant Care.dc.html) */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: #E7E4DC;
  font-family: 'Anuphan', system-ui, -apple-system, sans-serif;
  color: #22302A;
  -webkit-font-smoothing: antialiased;
}

/* กรอบจำลองมือถือบนจอใหญ่ / เต็มจอบนมือถือจริง */
#device {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100vh;
  height: 100dvh;   /* จอพอดี (เผื่อแถบเบราว์เซอร์มือถือ) → #app scroll ในตัวเอง, footer ค้างล่างเสมอ */
  margin: 0 auto;
  background: #F4F3EE;
  color: #22302A;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 480px) {
  body { padding: 24px 0; }
  #device {
    min-height: 0;
    height: calc(100vh - 48px);
    border-radius: 40px;
    box-shadow: 0 30px 80px rgba(34,48,42,.28);
    border: 10px solid #1c1c1e;
  }
}

#app { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; }
/* แถบเมนูล่าง (footer nav) ปักล่างสุดของกรอบเสมอ — ไม่เลื่อนตามเนื้อหา */
#tabbar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 30; }
::-webkit-scrollbar { width: 0; height: 0; }

@keyframes pcFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pcPop { 0% { transform: scale(.3); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes pcCelebOut { to { opacity: 0; transform: scale(.92) translateY(-10px); } }
.pc-celebrate { animation: pcPop .45s cubic-bezier(.2,.9,.3,1.4) both, pcCelebOut .5s ease .68s forwards; }
@keyframes pcSlideUp { from { opacity: 0; transform: translateY(100%); } to { opacity: 1; transform: none; } }
/* เล่น fade-in เฉพาะตอนเปลี่ยนหน้า (ใส่คลาส pc-enter จาก render) ไม่ใช่ทุกครั้งที่อัปเดต */
.pc-enter { animation: pcFade .32s ease both; }
.pc-press { transition: transform .12s ease, box-shadow .2s ease; cursor: pointer; }
.pc-press:active { transform: scale(.975); }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px);
  background: #22302A; color: #fff; padding: 11px 20px; border-radius: 14px;
  font-size: 14px; font-weight: 600; z-index: 500; opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-width: 80%;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* spinner */
.pc-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #D5E0D7; border-top-color: #3E8E63; animation: pcRot .8s linear infinite; }
@keyframes pcRot { to { transform: rotate(360deg); } }

input, select, button, textarea { font-family: inherit; }
.pc-input {
  width: 100%; height: 48px; border-radius: 14px; border: 1.5px solid #E4E7E0;
  padding: 0 14px; font-size: 15px; background: #fff; color: #22302A; outline: none;
}
.pc-input:focus { border-color: #3E8E63; }
