/* ───────────── FORMA — design tokens ───────────── */
@property --p { syntax: '<number>'; inherits: true; initial-value: 0; }

:root {
  --bg: #0b0806; --s1: #17100c; --s2: #211812; --s3: #2c2018;
  --line: rgb(255 255 255 / .07); --line2: rgb(255 255 255 / .13);
  --tx: #f6eee7; --mu: #a39384; --mu2: #6e6157;
  --or: #ff8a3d; --or2: #ff6a1a; --or3: #ffbd8a;
  --ok: #8fe0a0; --warn: #ffd36a; --bad: #ff7468;
  --r: 24px; --r2: 16px;
  --font: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', 'Times New Roman', serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  font-family: var(--font); color: var(--tx); background: var(--bg);
  min-height: 100dvh; -webkit-font-smoothing: antialiased; overflow-x: hidden; line-height: 1.45;
}
body::before { /* cahaya oranye atmosferik */
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(70% 38% at 50% -6%, rgb(255 118 36 / .55), transparent 70%),
    radial-gradient(45% 30% at 105% 28%, rgb(255 90 20 / .13), transparent 70%),
    radial-gradient(40% 30% at -10% 80%, rgb(255 140 60 / .08), transparent 70%);
}
body::after { /* grain halus */
  content: ''; position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; border-radius: 10px; }
.serif { font-family: var(--serif); font-weight: 400; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; }
.muted { color: var(--mu); } .small { font-size: .78rem; } .tiny { font-size: .68rem; }
.num { font-variant-numeric: tabular-nums; }
.ic { flex: none; }
[hidden] { display: none !important; }

/* ───────────── Shell ───────────── */
.app { position: relative; z-index: 1; max-width: 460px; margin: 0 auto; min-height: 100dvh; padding: 0 18px 130px; }
#top {
  display: flex; align-items: center; justify-content: space-between;
  padding: max(16px, env(safe-area-inset-top)) 0 10px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.spark {
  width: 18px; height: 18px; display: inline-block; background: #fff;
  clip-path: polygon(50% 0, 60% 38%, 100% 50%, 60% 62%, 50% 100%, 40% 62%, 0 50%, 40% 38%);
  filter: drop-shadow(0 0 8px rgb(255 160 90 / .8));
}
.top-r { display: flex; gap: 8px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; font-size: .78rem; font-weight: 600;
  border-radius: 999px; background: rgb(255 255 255 / .07); border: 1px solid var(--line); color: var(--tx);
  backdrop-filter: blur(10px);
}
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem;
  background: linear-gradient(145deg, var(--or), var(--or2)); color: #1a0d05; }

.aside { display: none; }
@media (min-width: 980px) {
  .aside { display: block; position: fixed; z-index: 1; left: max(4vw, 40px); top: 50%; translate: 0 -50%; width: 300px; }
  .aside .brand-big { display: flex; gap: 12px; align-items: center; font-size: 2.2rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: 26px; }
  .aside .brand-big .spark { width: 30px; height: 30px; }
  .aside p { font-size: 2.1rem; line-height: 1.1; margin-bottom: 28px; color: var(--tx); }
  .aside p em { color: var(--or3); }
  .aside ul { list-style: none; padding: 0; display: grid; gap: 10px; color: var(--mu); font-size: .9rem; }
  .aside li::before { content: '✦'; color: var(--or); margin-right: 10px; }
  .app { border-inline: 1px solid var(--line); background: rgb(8 5 3 / .35); backdrop-filter: blur(2px); }
}

/* ───────────── Navigasi bawah ───────────── */
#nav {
  position: fixed; z-index: 30; left: 50%; translate: -50% 0; bottom: max(14px, env(safe-area-inset-bottom));
  width: min(calc(100% - 28px), 430px); display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; border-radius: 999px; background: rgb(23 16 12 / .72);
  backdrop-filter: blur(24px) saturate(1.5); -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid var(--line2); box-shadow: 0 18px 50px rgb(0 0 0 / .55), inset 0 1px 0 rgb(255 255 255 / .06);
}
#nav a { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; color: var(--mu); transition: .25s var(--ease); }
#nav a:hover { color: var(--tx); }
#nav a[aria-current] { color: var(--or3); background: rgb(255 255 255 / .07); }
#nav a.scan {
  width: 82px; height: 50px; border-radius: 999px; color: #fff;
  background: linear-gradient(180deg, #ff9a52, #ff6a1a); box-shadow: 0 8px 28px rgb(255 106 26 / .55), inset 0 1px 0 rgb(255 255 255 / .35);
}
#nav a.scan[aria-current] { background: linear-gradient(180deg, #ffab6b, #ff7424); }
#nav a.scan:active { scale: .94; }

/* ───────────── Komponen dasar ───────────── */
.view { animation: rise .55s var(--ease) both; }
@keyframes rise { from { opacity: 0; translate: 0 14px; } }
::view-transition-old(root) { animation: fadeout .18s ease both; }
::view-transition-new(root) { animation: fadein .3s var(--ease) both; }
@keyframes fadeout { to { opacity: 0; } } @keyframes fadein { from { opacity: 0; } }

h1 { font-size: 1.9rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
h1 em { font-size: 2.1rem; color: var(--or3); }
h2 { font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: .9rem; font-weight: 700; }
.eyebrow { font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; color: var(--mu); font-weight: 600; }
.stack { display: grid; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; } .between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sec { margin-top: 22px; } .sec > .row { margin-bottom: 12px; }

.card {
  background: linear-gradient(180deg, rgb(255 255 255 / .05), rgb(255 255 255 / .02));
  border: 1px solid var(--line); border-radius: var(--r); padding: 18px; position: relative; overflow: hidden;
}
.card.flat { background: var(--s1); }
.card.glow::before { content: ''; position: absolute; inset: -40% 10% auto; height: 80%; background: radial-gradient(closest-side, rgb(255 120 40 / .28), transparent); pointer-events: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 22px;
  background: #fff; color: #140b05; font-weight: 700; font-size: .92rem; border-radius: 999px;
  transition: transform .2s var(--ease), box-shadow .2s, opacity .2s; box-shadow: 0 6px 22px rgb(0 0 0 / .35);
}
.btn:active { scale: .96; } .btn[disabled] { opacity: .45; pointer-events: none; }
.btn.or { background: linear-gradient(180deg, #ff9a52, #ff6a1a); color: #fff; box-shadow: 0 8px 28px rgb(255 106 26 / .45); }
.btn.ghost { background: rgb(255 255 255 / .07); color: var(--tx); border: 1px solid var(--line2); box-shadow: none; }
.btn.danger { background: rgb(255 116 104 / .15); color: var(--bad); box-shadow: none; border: 1px solid rgb(255 116 104 / .3); }
.btn.sm { padding: 9px 14px; font-size: .8rem; } .btn.block { width: 100%; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: rgb(255 255 255 / .07); border: 1px solid var(--line); }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; font-size: .7rem; font-weight: 700; background: rgb(255 255 255 / .08); color: var(--tx); }
.pill.or { background: rgb(255 138 61 / .18); color: var(--or3); }
.pill.ok { background: rgb(143 224 160 / .15); color: var(--ok); }
.pill.warn { background: rgb(255 211 106 / .15); color: var(--warn); }
.pill.bad { background: rgb(255 116 104 / .16); color: var(--bad); }

.seg { display: flex; padding: 4px; gap: 4px; background: rgb(255 255 255 / .06); border: 1px solid var(--line); border-radius: 999px; }
.seg button { flex: 1; padding: 9px 10px; font-size: .8rem; font-weight: 600; color: var(--mu); border-radius: 999px; transition: .25s var(--ease); white-space: nowrap; }
.seg button[aria-pressed=true], .seg button.on { background: #fff; color: #140b05; }

label.f { display: grid; gap: 6px; font-size: .74rem; color: var(--mu); font-weight: 600; }
input, select, textarea {
  width: 100%; padding: 13px 14px; border-radius: 14px; background: rgb(255 255 255 / .06); border: 1px solid var(--line2);
  color: var(--tx); outline: none; transition: border-color .2s, background .2s; font-size: .95rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--or); background: rgb(255 138 61 / .07); }
select option { background: var(--s2); }
input[type=range] { padding: 0; accent-color: var(--or); height: 28px; background: none; border: 0; }

.bar { height: 7px; border-radius: 99px; background: rgb(255 255 255 / .08); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #a8460f, var(--or), var(--or3)); width: calc(var(--v, 0) * 1%); transition: width 1s var(--ease); }
.bar.over > i { background: linear-gradient(90deg, #a8460f, var(--bad)); }

.list { display: grid; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.li:first-child { border-top: 0; }
.li .grow { flex: 1; min-width: 0; } .li .t { font-weight: 600; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { text-align: center; padding: 22px 10px; color: var(--mu); font-size: .85rem; }

/* ───────────── Beranda ───────────── */
.dates { display: flex; gap: 6px; justify-content: space-between; margin: 6px -4px 0; }
.dates button { flex: 1; display: grid; gap: 6px; justify-items: center; padding: 6px 0; color: var(--mu); font-size: .68rem; font-weight: 600; }
.dates button b { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; color: var(--tx); border: 1px solid transparent; transition: .3s var(--ease); }
.dates button[aria-pressed=true] { color: var(--tx); }
.dates button[aria-pressed=true] b { background: radial-gradient(circle at 50% 30%, #ffb27a, #ff6a1a); color: #1a0d05; box-shadow: 0 0 28px rgb(255 120 40 / .65); }
.dates button.today b { border-color: var(--line2); }

.hero { text-align: center; padding: 22px 14px 16px; margin-top: 14px; }
.hero .arc { width: 100%; max-width: 300px; margin: 0 auto -78px; display: block; overflow: visible; }
.arc-fill { animation: arcin 1.4s var(--ease) both; }
@keyframes arcin { from { stroke-dasharray: 0 100; } }
.arc-knob { animation: knob 1.4s var(--ease) both; filter: drop-shadow(0 4px 12px rgb(0 0 0 / .5)); }
@keyframes knob { from { opacity: 0; } 40% { opacity: 0; } }
.hero .big { font-size: 3.1rem; font-weight: 700; letter-spacing: -.04em; line-height: 1; position: relative; }
.hero .big small { font-size: 1rem; font-weight: 600; color: var(--mu); letter-spacing: 0; }
.hero .cap { font-size: .8rem; color: var(--mu); margin-top: 4px; }
.hero .tag { margin: 14px auto 0; display: inline-flex; }

.macro .top { display: flex; justify-content: space-between; font-size: .72rem; color: var(--mu); font-weight: 600; margin-bottom: 8px; }
.macro b { display: block; font-size: 1.25rem; letter-spacing: -.02em; color: var(--tx); margin-bottom: 8px; }
.macro b small { font-size: .7rem; color: var(--mu); font-weight: 600; }

.kpis { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.kpis > div { padding: 4px 6px; border-left: 1px solid var(--line); }
.kpis > div:first-child { border-left: 0; }
.kpis b { display: block; font-size: 1.05rem; letter-spacing: -.02em; } .kpis span { font-size: .68rem; color: var(--mu); }

.bars { display: flex; align-items: flex-end; gap: 8px; height: 92px; }
.bars > div { flex: 1; display: grid; gap: 6px; justify-items: center; align-content: end; height: 100%; font-size: .66rem; color: var(--mu); }
.bars i { width: 100%; max-width: 22px; border-radius: 7px; background: rgb(255 255 255 / .1); height: calc(var(--h) * 1%); min-height: 6px; transition: height 1s var(--ease); }
.bars .on i { background: linear-gradient(180deg, var(--or3), var(--or2)); box-shadow: 0 0 18px rgb(255 120 40 / .45); }
.bars .over i { background: linear-gradient(180deg, #ffb0a6, var(--bad)); }

.score { display: flex; align-items: center; gap: 16px; }
.score .n { font-size: 2.6rem; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.score .n small { font-size: 1rem; color: var(--mu); font-weight: 600; }
.insight { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: .86rem; }
.insight .ico { width: 34px; height: 34px; border-radius: 11px; flex: none; display: grid; place-items: center; background: rgb(255 138 61 / .14); color: var(--or3); }
.insight p { color: var(--mu); font-size: .8rem; margin-top: 2px; }

.grid-pills { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.grid-pills i { height: 22px; border-radius: 999px; background: rgb(255 255 255 / .06); border: 1px solid var(--line); }
.grid-pills i.full { background: linear-gradient(180deg, #ffe3cf, #ffc193); border-color: transparent; box-shadow: 0 0 14px rgb(255 160 90 / .35); }
.grid-pills i.part { background: rgb(255 138 61 / .35); border-color: transparent; }
.legend { display: flex; gap: 14px; margin-top: 12px; font-size: .68rem; color: var(--mu); }
.legend span::before { content: ''; display: inline-block; width: 14px; height: 8px; border-radius: 99px; margin-right: 6px; background: rgb(255 255 255 / .1); vertical-align: 0; }
.legend .f::before { background: #ffc193; } .legend .p::before { background: rgb(255 138 61 / .45); }

.meal-h { display: flex; align-items: center; justify-content: space-between; }
.meal-h .k { color: var(--mu); font-size: .78rem; font-weight: 600; }
.add-b { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgb(255 138 61 / .16); color: var(--or3); }
.del { color: var(--mu2); padding: 6px; } .del:hover { color: var(--bad); }

/* ───────────── Scan ───────────── */
.cam { position: relative; border-radius: 30px; overflow: hidden; aspect-ratio: 4 / 5; background: #000; border: 1px solid var(--line2); margin-top: 6px; isolation: isolate; }
.cam video, .cam img.freeze { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgb(0 0 0 / .5), transparent 25%, transparent 60%, rgb(0 0 0 / .65)); pointer-events: none; }
.reticle { position: absolute; inset: 16% 10% 24%; pointer-events: none; }
.reticle i { position: absolute; width: 34px; height: 34px; border: 3px solid #fff; opacity: .95; filter: drop-shadow(0 0 8px rgb(255 140 60 / .8)); }
.reticle i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 16px 0 0 0; }
.reticle i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 16px 0 0; }
.reticle i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 16px; }
.reticle i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 16px 0; }
.cam .hint { position: absolute; left: 0; right: 0; bottom: 104px; text-align: center; font-size: .8rem; font-weight: 600; text-shadow: 0 2px 10px #000; }
.cam .ctl { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: space-around; align-items: center; }
.cam .top { position: absolute; top: 14px; left: 14px; right: 14px; }
.shutter { width: 74px; height: 74px; border-radius: 50%; border: 4px solid #fff; padding: 5px; transition: .2s var(--ease); }
.shutter::after { content: ''; display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; }
.shutter:active { scale: .9; }
.laser { position: absolute; left: 6%; right: 6%; height: 3px; border-radius: 3px; background: linear-gradient(90deg, transparent, #ffb27a, transparent); box-shadow: 0 0 24px 6px rgb(255 130 50 / .7); animation: laser 1.8s ease-in-out infinite alternate; }
@keyframes laser { from { top: 12%; } to { top: 86%; } }
.cam-msg { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 14px; padding: 30px; justify-items: center; color: var(--mu); font-size: .88rem; }

.res-item { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.res-item:first-child { border-top: 0; }
.res-item .g { display: flex; align-items: center; gap: 6px; }
.res-item input { width: 84px; padding: 9px 10px; text-align: right; }
.conf { display: inline-flex; gap: 3px; align-items: center; font-size: .66rem; font-weight: 700; }
.conf i { width: 4px; height: 12px; border-radius: 2px; background: rgb(255 255 255 / .18); }
.conf i.on { background: var(--or); }

/* ───────────── Move ───────────── */
.map { height: 270px; border-radius: 26px; overflow: hidden; border: 1px solid var(--line2); position: relative; background: var(--s1); isolation: isolate; }
.map canvas { width: 100%; height: 100%; display: block; }
.map .badge { position: absolute; z-index: 500; top: 12px; left: 12px; }
.leaflet-container { background: #14100d !important; font-family: var(--font) !important; }
.leaflet-tile-pane { filter: saturate(.7) brightness(1.05); }
.leaflet-control-attribution { background: rgb(0 0 0 / .5) !important; color: #aaa !important; font-size: 9px !important; } .leaflet-control-attribution a { color: #ccc !important; }
.me { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 5px solid var(--or2); box-shadow: 0 0 0 8px rgb(255 106 26 / .25), 0 0 24px var(--or2); animation: pulse 1.8s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 14px rgb(255 106 26 / .08), 0 0 24px var(--or2); } }
.stats4 { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; }
.stats4 > div { padding: 2px 4px; border-left: 1px solid var(--line); } .stats4 > div:first-child { border: 0; }
.stats4 b { display: block; font-size: 1.15rem; letter-spacing: -.02em; } .stats4 span { font-size: .64rem; color: var(--mu); }
.ringbox { display: grid; place-items: center; width: 118px; height: 118px; border-radius: 50%; flex: none;
  background: conic-gradient(var(--or) calc(var(--p) * 1%), rgb(255 255 255 / .08) 0); transition: --p 1.2s var(--ease); position: relative; }
.ringbox::before { content: ''; position: absolute; inset: 9px; border-radius: 50%; background: var(--s1); }
.ringbox > div { position: relative; text-align: center; line-height: 1.1; } .ringbox b { font-size: 1.35rem; letter-spacing: -.03em; } .ringbox span { display: block; font-size: .62rem; color: var(--mu); margin-top: 2px; }

/* ───────────── Body / Program / Coach ───────────── */
.bf-meter { position: relative; height: 12px; border-radius: 99px; background: linear-gradient(90deg, #6ab4ff, #8fe0a0 30%, #ffd36a 60%, #ff7468); margin: 26px 0 8px; }
.bf-meter .rng { position: absolute; top: -6px; bottom: -6px; border-radius: 99px; border: 2px solid #fff; background: rgb(255 255 255 / .22); box-shadow: 0 0 18px rgb(255 255 255 / .4); }
.bf-meter .mid { position: absolute; top: -26px; translate: -50% 0; font-size: .72rem; font-weight: 800; }
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.slot { aspect-ratio: 3 / 4; border-radius: 18px; border: 1.5px dashed var(--line2); display: grid; place-items: center; text-align: center; font-size: .7rem; color: var(--mu); position: relative; overflow: hidden; cursor: pointer; background: rgb(255 255 255 / .03); }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.note { font-size: .76rem; color: var(--mu); padding: 12px 14px; border-radius: 14px; background: rgb(255 255 255 / .04); border: 1px solid var(--line); display: flex; gap: 10px; }
.note.warn { background: rgb(255 211 106 / .07); border-color: rgb(255 211 106 / .22); color: #e9d8a8; }
.note.bad { background: rgb(255 116 104 / .08); border-color: rgb(255 116 104 / .28); color: #ffc8c2; }
.note .ic { margin-top: 1px; }
.pcard { min-width: 150px; scroll-snap-align: start; text-align: left; padding: 15px; border-radius: 20px; border: 1px solid var(--line); background: rgb(255 255 255 / .04); display: grid; gap: 6px; transition: .3s var(--ease); }
.pcard[aria-pressed=true] { background: linear-gradient(160deg, rgb(255 138 61 / .28), rgb(255 106 26 / .06)); border-color: rgb(255 138 61 / .6); box-shadow: 0 10px 34px rgb(255 106 26 / .22); }
.pcard b { font-size: 1rem; }
.hscroll { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -18px; padding: 4px 18px 10px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.tbl { width: 100%; border-collapse: collapse; font-size: .82rem; } .tbl td, .tbl th { padding: 9px 4px; border-top: 1px solid var(--line); text-align: right; } .tbl td:first-child, .tbl th:first-child { text-align: left; } .tbl th { color: var(--mu); font-weight: 600; font-size: .7rem; }
.chat { display: grid; gap: 10px; padding-bottom: 6px; }
.bub { max-width: 88%; padding: 12px 15px; border-radius: 20px; font-size: .88rem; animation: rise .35s var(--ease) both; }
.bub p + p, .bub ul { margin-top: 8px; } .bub ul { padding-left: 18px; }
.bub.u { justify-self: end; background: linear-gradient(180deg, #ff9a52, #ff6a1a); color: #1a0d05; font-weight: 600; border-bottom-right-radius: 6px; }
.bub.a { background: rgb(255 255 255 / .07); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.typing i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--mu); margin: 0 2px; animation: bl 1s infinite; } .typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bl { 50% { translate: 0 -4px; background: var(--or); } }
.composer { position: sticky; bottom: 92px; display: flex; gap: 8px; padding-top: 10px; }
.composer input { border-radius: 999px; background: rgb(23 16 12 / .9); backdrop-filter: blur(14px); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -18px 12px; padding: 0 18px; }
.chips::-webkit-scrollbar { display: none; } .chips .chip { white-space: nowrap; cursor: pointer; }

/* ───────────── Sheet, toast ───────────── */
dialog#sheet {
  position: fixed; inset: auto 0 0; margin: 0 auto; width: min(100%, 480px); max-height: 90dvh; border: 0; padding: 8px 20px max(26px, env(safe-area-inset-bottom));
  background: var(--s1); color: var(--tx); border-radius: 30px 30px 0 0; overflow: auto; border-top: 1px solid var(--line2);
  box-shadow: 0 -30px 80px rgb(0 0 0 / .6);
}
dialog#sheet[open] { animation: sheetup .45s var(--ease); }
dialog#sheet::backdrop { background: rgb(0 0 0 / .62); backdrop-filter: blur(6px); animation: fadein .3s; }
@keyframes sheetup { from { translate: 0 40px; opacity: 0; } }
.grab { width: 42px; height: 5px; border-radius: 9px; background: var(--line2); margin: 6px auto 16px; }
#toast { position: fixed; z-index: 90; left: 50%; bottom: 104px; translate: -50% 20px; opacity: 0; pointer-events: none; padding: 11px 18px; border-radius: 999px; background: #fff; color: #140b05; font-weight: 700; font-size: .82rem; transition: .35s var(--ease); max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; translate: -50% 0; } #toast.bad { background: var(--bad); }

.skeleton { background: linear-gradient(100deg, rgb(255 255 255 / .04) 30%, rgb(255 255 255 / .1) 50%, rgb(255 255 255 / .04) 70%); background-size: 200% 100%; animation: sk 1.4s infinite; border-radius: 14px; }
@keyframes sk { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
@media (max-width: 360px) { .app { padding-inline: 14px; } .hero .big { font-size: 2.6rem; } }

/* --- polish: gauge angka tidak menabrak busur, hint scan tidak menimpa tombol --- */
.hero .arc { margin-bottom: -64px; }
.hero .big { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.hero .big small { font-size: .85rem; }
.cam:has(.cam-msg) .hint { display: none; }

/* ───────────── Responsif: HP · tablet · laptop ───────────── */
input, select, textarea { font-size: max(16px, 1rem); }          /* iOS tidak auto-zoom saat fokus */
#nav .nl { display: none; }
.app { padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 700px) and (max-width: 1023px) {
  .app { max-width: 620px; }
  #nav { width: 460px; }
}
@media (min-width: 1024px) {
  .aside { display: none !important; }
  body { padding-left: 250px; }
  #nav {
    left: 0; top: 0; bottom: 0; translate: none; width: 250px; flex-direction: column; justify-content: flex-start; gap: 6px;
    padding: 92px 14px 20px; border-radius: 0; border-width: 0 1px 0 0; background: rgb(14 9 6 / .78); box-shadow: none;
  }
  #nav::before { content: 'forma'; position: absolute; top: 30px; left: 30px; font-weight: 800; font-size: 1.45rem; letter-spacing: -.03em; }
  #nav a { width: 100%; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: flex-start; gap: 14px; padding: 0 16px; font-weight: 600; font-size: .92rem; }
  #nav a.scan { width: 100%; height: 54px; border-radius: 16px; order: -1; margin-bottom: 12px; }
  #nav .nl { display: inline; }
  #top .brand { visibility: hidden; }
  .app { max-width: 1240px; padding: 0 44px 60px; border-inline: 0; background: none; backdrop-filter: none; }
  #top { padding-top: 26px; }
  .view { max-width: 760px; margin-inline: auto; }
  .hero .arc { max-width: 340px; }
}
@media (min-width: 1240px) {
  .view.v-home { max-width: none; columns: 2; column-gap: 20px; }
  .view.v-home > * { break-inside: avoid; margin-bottom: 14px; }
}
@media (min-width: 1700px) { .view.v-home { columns: 3; } }

/* ───────────── Anti-overflow (grid child tidak boleh melebihi layar) ───────────── */
html, body { max-width: 100%; overflow-x: clip; }
.view, .stack, .card, form { min-width: 0; }
.stack { grid-template-columns: minmax(0, 1fr); }
.stack > *, .view > *, .grid3 > * { min-width: 0; }
.hscroll { max-width: none; }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
label.f input, label.f select { min-width: 0; width: 100%; }
.dates { gap: 2px; }
.dates button { flex: 1 1 0; min-width: 0; }
