/* ===== Ovaltine Demo — Shared Styles (flat, no-gradient) ===== */
@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;500;600;700&display=swap');

:root{
  --ov-orange:#EC6A1E;      /* primary, solid */
  --ov-orange-d:#CB550F;
  --ov-orange-soft:#FBEADC; /* tint bg */
  --ov-navy:#1E3A79;
  --ov-navy-soft:#E8EDF7;
  --ov-brown:#4A382B;
  --ink:#2B2620;
  --muted:#8C8377;
  --line:#EBE4D9;
  --line-2:#E0D7C9;
  --bg:#F2EFE9;
  --card:#FFFFFF;
  --ok:#2E9457; --ok-soft:#E7F3EC;
  --star:#EFA435;
  --fb:#1877F2;
  --danger:#D64B3F;
  --shadow:0 6px 20px rgba(74,56,43,.08);
  --shadow-sm:0 2px 8px rgba(74,56,43,.06);
}

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0}
body{
  font-family:'Kanit',system-ui,sans-serif;
  color:var(--ink);background:var(--bg);
  min-height:100vh;-webkit-font-smoothing:antialiased;
}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}
button{font-family:inherit;cursor:pointer;border:none;background:none}
svg.licon{display:inline-block;vertical-align:middle;flex:0 0 auto}

/* ===== Responsive app shell (no phone mockup) ===== */
.stage{min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;align-items:center;background:var(--bg)}
.phone{
  width:100%;max-width:430px;height:100vh;height:100dvh;
  background:#FBF9F5;position:relative;overflow:hidden;display:flex;flex-direction:column;
}
/* remove device chrome */
.phone .notch{display:none}
.statusbar{display:none}
.hint{display:none}

.viewport{flex:1;overflow-y:auto;overflow-x:hidden;position:relative;scrollbar-width:none;-webkit-overflow-scrolling:touch}
.viewport::-webkit-scrollbar{display:none}

/* desktop: centered column, not exceeding phone width, with a soft frame */
@media (min-width:480px){
  .stage{padding:22px 0}
  .phone{height:calc(100dvh - 44px);border-radius:20px;box-shadow:0 10px 40px rgba(74,56,43,.12);border:1px solid var(--line)}
}

.screen{display:none;flex-direction:column;min-height:100%}
.screen.active{display:flex;animation:fade .24s ease}
@keyframes fade{from{opacity:0}to{opacity:1}}

/* ===== App header (flat) ===== */
.appbar{background:var(--ov-orange);color:#fff;padding:16px 16px 15px;position:relative}
.appbar.navy{background:var(--ov-navy)}
.appbar .row{display:flex;align-items:center;gap:12px}
.appbar .back{width:34px;height:34px;border-radius:10px;background:rgba(255,255,255,.16);display:grid;place-items:center;color:#fff;flex:0 0 auto}
.appbar h1{font-size:18px;font-weight:600;margin:0;line-height:1.25}
.appbar .sub{font-size:12px;opacity:.85;font-weight:300;margin-top:1px}
.appbar .pill{margin-left:auto;background:rgba(255,255,255,.18);border-radius:8px;padding:5px 10px;font-size:12px;font-weight:500;display:flex;align-items:center;gap:5px}

/* ===== content ===== */
.content{padding:16px;display:flex;flex-direction:column;gap:13px}
.section-title{font-size:12px;font-weight:600;color:var(--muted);letter-spacing:.3px;margin:2px 0;text-transform:none;display:flex;align-items:center;gap:7px}
.muted{color:var(--muted)}
.small{font-size:12.5px}

/* cards */
.card{background:var(--card);border-radius:14px;padding:15px;border:1px solid var(--line);box-shadow:var(--shadow-sm)}
.card.tap{transition:border-color .12s,transform .08s}
.card.tap:active{transform:scale(.995);border-color:var(--line-2)}

/* list card */
.list-card{display:flex;align-items:center;gap:13px}
.list-card .tile{width:46px;height:46px;border-radius:11px;flex:0 0 auto;display:grid;place-items:center;background:var(--ov-orange-soft);color:var(--ov-orange)}
.list-card .tile.navy{background:var(--ov-navy-soft);color:var(--ov-navy)}
.list-card .body{flex:1;min-width:0}
.list-card .body h3{margin:0;font-size:15.5px;font-weight:600}
.list-card .body p{margin:3px 0 0;font-size:12.5px;color:var(--muted);display:flex;align-items:center;gap:5px}
.list-card .go{color:var(--muted);display:flex;align-items:center}

.badge{display:inline-flex;align-items:center;gap:4px;padding:4px 9px;border-radius:7px;font-size:11.5px;font-weight:500;white-space:nowrap}
.badge.wait{background:#FBF0DE;color:#B87514}
.badge.done{background:var(--ok-soft);color:var(--ok)}
.badge.blue{background:var(--ov-navy-soft);color:var(--ov-navy)}

/* progress */
.progress{height:7px;background:#EEE7DB;border-radius:6px;overflow:hidden}
.progress > i{display:block;height:100%;background:var(--ov-orange);border-radius:6px}

/* buttons */
.btn{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;padding:14px;border-radius:12px;font-size:15.5px;font-weight:600;background:var(--ov-orange);color:#fff;box-shadow:var(--shadow-sm);transition:background .12s,transform .08s}
.btn:active{transform:translateY(1px);background:var(--ov-orange-d)}
.btn.ghost{background:#fff;color:var(--ov-orange);border:1.5px solid var(--ov-orange);box-shadow:none}
.btn.ghost:active{background:var(--ov-orange-soft)}
.btn.navy{background:var(--ov-navy)}
.btn.navy:active{background:#152B5C}
.btn.fb{background:var(--fb)}
.btn.sm{padding:11px;font-size:14px;border-radius:10px}
.btn:disabled{opacity:.45}

.footer-cta{padding:13px 16px;background:#FBF9F5;border-top:1px solid var(--line);position:sticky;bottom:0}

/* forms */
.field{display:flex;flex-direction:column;gap:6px}
.field label{font-size:12.5px;font-weight:500;color:var(--ov-brown)}
.field input,.field select,.field textarea{font-family:inherit;font-size:14.5px;padding:11px 13px;border-radius:10px;border:1.5px solid var(--line-2);background:#fff;color:var(--ink);width:100%}
.field input:focus,.field select:focus,.field textarea:focus{outline:none;border-color:var(--ov-orange)}
.field textarea{resize:none;min-height:74px}

/* photo uploader */
.photo-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}
.photo-cell{aspect-ratio:1;border-radius:11px;border:1.5px dashed var(--line-2);background:#FBF7F1;display:grid;place-items:center;color:#B9AE9C;position:relative;overflow:hidden;transition:border-color .12s}
.photo-cell:active{border-color:var(--ov-orange)}
.photo-cell.filled{border-style:solid;border-color:transparent}
.photo-cell.filled > .ph-ic{display:none}
.photo-cell .rm{position:absolute;top:4px;right:4px;background:rgba(0,0,0,.5);color:#fff;width:20px;height:20px;border-radius:50%;display:grid;place-items:center}
.photo-cell .fill{width:100%;height:100%;display:grid;place-items:center;color:rgba(255,255,255,.85)}

/* stars */
.stars{display:flex;gap:5px;color:#DBD2C4}
.stars .st{cursor:pointer;transition:transform .08s;color:inherit}
.stars .st.on{color:var(--star)}
.stars .st.on svg{fill:var(--star)}
.stars .st:active{transform:scale(1.15)}

/* rating scale */
.scale{display:flex;gap:6px}
.scale button{flex:1;padding:9px 0;border-radius:9px;border:1.5px solid var(--line-2);background:#fff;font-weight:600;color:var(--muted);font-size:14.5px;font-family:inherit}
.scale button.on{background:var(--ov-orange);color:#fff;border-color:var(--ov-orange)}

/* success */
.success{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:30px;gap:12px}
.success .ring{width:96px;height:96px;border-radius:50%;background:var(--ov-orange-soft);display:grid;place-items:center;color:var(--ov-orange);animation:pop .4s cubic-bezier(.2,1.3,.5,1)}
.success .ring.ok{background:var(--ok-soft);color:var(--ok)}
@keyframes pop{from{transform:scale(.5);opacity:0}to{transform:scale(1);opacity:1}}
.success h2{margin:4px 0 0;font-size:21px;color:var(--ink);font-weight:600}

/* QR */
.qr-box{background:#fff;border:1px solid var(--line);border-radius:16px;padding:20px;display:flex;flex-direction:column;align-items:center;gap:13px;box-shadow:var(--shadow-sm)}
.qr-img{width:196px;height:196px}

/* facebook mock */
.fb-top{background:var(--fb);color:#fff;padding:12px 16px;display:flex;align-items:center;gap:9px;font-weight:600}
.fb-cover{height:112px;background:var(--ov-orange-soft);display:grid;place-items:center;color:var(--ov-orange)}
.like-btn{display:flex;align-items:center;justify-content:center;gap:8px;background:var(--fb);color:#fff;padding:11px;border-radius:10px;font-weight:600;font-size:15px;width:100%;font-family:inherit}
.like-btn.liked{background:#EAF1FE;color:var(--fb);border:1.5px solid var(--fb)}

/* dashboard */
.kpi-grid{display:grid;grid-template-columns:1fr 1fr;gap:11px}
.kpi{background:#fff;border-radius:13px;padding:13px;border:1px solid var(--line);box-shadow:var(--shadow-sm)}
.kpi .kh{display:flex;align-items:center;justify-content:space-between;color:var(--muted)}
.kpi .kh .kt{width:30px;height:30px;border-radius:8px;background:var(--ov-orange-soft);color:var(--ov-orange);display:grid;place-items:center}
.kpi .n{font-size:24px;font-weight:700;line-height:1;margin-top:9px}
.kpi .l{font-size:11.5px;color:var(--muted);margin-top:4px}
.kpi .t{font-size:11px;margin-top:6px;font-weight:500;display:flex;align-items:center;gap:4px}
.kpi .t.up{color:var(--ok)}
.tabs{display:flex;background:#EDE6DA;border-radius:11px;padding:3px;gap:3px}
.tabs button{flex:1;padding:9px;border-radius:9px;background:transparent;font-weight:600;font-size:13px;color:var(--muted);font-family:inherit}
.tabs button.on{background:#fff;color:var(--ov-orange);box-shadow:var(--shadow-sm)}
.bar-row{display:flex;align-items:center;gap:10px;margin:9px 0}
.bar-row .lab{width:60px;font-size:12px;flex:0 0 auto;color:var(--ink)}
.bar-track{flex:1;height:20px;background:#EFE8DC;border-radius:6px;overflow:hidden}
.bar-track > i{display:block;height:100%;background:var(--ov-orange);border-radius:6px;display:flex;align-items:center;justify-content:flex-end;padding-right:8px;color:#fff;font-size:11px;font-weight:600}
.legend{display:flex;flex-direction:column;gap:7px;font-size:12.5px}
.legend .dot{width:10px;height:10px;border-radius:3px;display:inline-block;margin-right:7px}

table.mini{width:100%;border-collapse:collapse;font-size:12.5px}
table.mini th{text-align:left;color:var(--muted);font-weight:500;padding:7px 6px;border-bottom:1px solid var(--line);font-size:11.5px}
table.mini td{padding:9px 6px;border-bottom:1px solid var(--line)}
table.mini tr:last-child td{border-bottom:none}

/* bottom nav */
.bottom-nav{display:flex;background:#fff;border-top:1px solid var(--line);padding:8px 6px 10px;flex:0 0 auto;align-items:flex-end}
.bottom-nav a{flex:1;text-align:center;font-size:10.5px;color:var(--muted);display:flex;flex-direction:column;gap:3px;align-items:center;cursor:pointer;padding:2px 0}
.bottom-nav a.on{color:var(--ov-orange)}
/* raised center brand (transparent logo, no bg) */
.bottom-nav a.brand{flex:0 0 66px;justify-content:flex-end}
.bottom-nav a.brand .brand-btn{display:grid;place-items:center;margin-top:-34px}
.bottom-nav a.brand .brand-btn img{width:54px}
/* logo in app header (transparent, no bg) */
.appbar .logo-chip{margin-left:auto;display:grid;place-items:center;flex:0 0 auto}
.appbar .logo-chip img{width:44px}

/* hint under phone */
.hint{font-size:12.5px;color:#7d6f5d;background:#fff;padding:8px 15px;border-radius:10px;border:1px solid var(--line);text-align:center;max-width:390px}
.hint b{color:var(--ov-orange);font-weight:600}
