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

:root {
  --ground: #F2F3EE;
  --surface: #FFFFFF;
  --surface-2: #E4E8E1;
  --ink: #13211B;
  --muted: #4F5D56;
  --green: #0B5D3B;     /* hijau papan nama Jalan Malioboro */
  --green-2: #127A4E;
  --green-soft: #DDEFE4;
  --gold: #F2B33D;
  --brown: #8B5A33;
  --danger: #A8261E;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--ground); color: var(--ink); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
[aria-busy="true"] { opacity: .6; pointer-events: none; } /* tombol sedang menyimpan: cegah ketuk dua kali */
.loading { padding: 40vh 20px 0; text-align: center; color: var(--muted); font-weight: 600; }

.app { max-width: 480px; margin: 0 auto; min-height: 100dvh; background: var(--ground); position: relative; padding-bottom: 180px; }
@media (min-width: 600px) { body.phone { background: #D5DBD2; } }

.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; }
.wordmark { font-weight: 800; font-size: 22px; letter-spacing: -0.04em; text-decoration: none; }
.chip { min-height: 40px; padding: 0 16px; border-radius: 999px; background: var(--surface-2); font-weight: 600; font-size: 15px; transition: transform .12s var(--ease), background .15s; }
.chip:hover { background: #D6DCD3; }
.chip:active { transform: scale(.96); }
.back { min-height: 44px; font-weight: 700; padding-right: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; padding: 0 24px; border-radius: 999px; font-weight: 700; font-size: 17px; background: var(--green); color: #fff; text-decoration: none; transition: transform .12s var(--ease), background .15s; }
.btn:hover { background: var(--green-2); }
.btn:active { transform: scale(.97); }
.btn.block { width: 100%; }
.btn + .btn { margin-top: 10px; }
.btn.ghost { background: var(--surface-2); color: var(--ink); }
.btn.ghost:hover { background: #D6DCD3; }
.btn.gold { background: var(--gold); color: var(--ink); }
.btn.gold:hover { background: #E8A526; }
.btn.danger { background: var(--danger); }
.btn.light { background: #fff; color: var(--green); }

.pad { padding: 0 20px; }
.title { font-size: 30px; line-height: 1.05; letter-spacing: -0.035em; font-weight: 800; margin: 8px 0 20px; }
.field { display: grid; gap: 8px; margin-bottom: 18px; border: 0; }
.field > label, .field > legend, .lbl { font-weight: 700; font-size: 15px; }
.opt { font-weight: 500; color: var(--muted); }
.input { width: 100%; min-height: 56px; padding: 12px 18px; border-radius: 16px; border: 2px solid transparent; background: var(--surface); font-size: 17px; }
.input:focus { border-color: var(--green); outline: none; }
.input[aria-invalid="true"] { border-color: var(--danger); }

.bill { background: var(--surface); border-radius: 20px; padding: 6px 18px; }
.bill div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; }
.bill dt { color: var(--muted); }
.bill dd { font-weight: 700; font-variant-numeric: tabular-nums; }
.bill .now { background: var(--green-soft); margin: 4px -18px -6px; padding: 14px 18px; border-radius: 0 0 20px 20px; }
.bill .now dt { color: var(--green); font-weight: 700; }
.bill .now dd { color: var(--green); font-size: 20px; }

.avatar { border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; letter-spacing: -0.02em; }

.toast { position: fixed; left: 50%; bottom: calc(166px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px); background: var(--ink); color: #fff; padding: 14px 22px; border-radius: 999px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease); z-index: 99; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.sheet-backdrop { position: fixed; inset: 0; background: rgba(8, 18, 13, .5); display: flex; align-items: flex-end; justify-content: center; z-index: 50; animation: fade .2s both; }
.sheet { background: var(--ground); width: 100%; max-width: 480px; border-radius: 28px 28px 0 0; padding: 28px 20px calc(28px + env(safe-area-inset-bottom)); max-height: 92dvh; overflow: auto; animation: up .3s var(--ease) both; box-shadow: 0 -12px 40px rgba(0, 0, 0, .18); }
.sheet h2 { font-size: 26px; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 12px; }
.dock { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 480px; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); background: var(--ground); z-index: 10; }

.foot-note { font-size: 14px; color: var(--muted); text-align: center; padding: 28px 20px; }

.rise { animation: rise .5s var(--ease) both; }
.rise:nth-child(2) { animation-delay: .06s; } .rise:nth-child(3) { animation-delay: .12s; } .rise:nth-child(4) { animation-delay: .18s; }
.rise:nth-child(5) { animation-delay: .24s; } .rise:nth-child(6) { animation-delay: .3s; } .rise:nth-child(n+7) { animation-delay: .36s; }
.quiet .rise { animation: none; } /* pembaruan data dari tab lain tidak memutar ulang animasi masuk */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes up { from { transform: translateY(48px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pulse { 0% { transform: scale(.8); opacity: .9; } 100% { transform: scale(2.4); opacity: 0; } }
@keyframes trot { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes spin { to { transform: rotate(360deg); } }
.delman-art .wheel { transform-box: fill-box; transform-origin: center; animation: spin 6s linear infinite reverse; }
.delman-art .horse, .delman-art .cart { animation: trot .6s ease-in-out infinite; }
.delman-art .cart { animation-delay: .15s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
