/* Singgah demo — token dari specs/DESIGN.md */
:root {
  --bg: #F7F3EC;
  --surface: #FFFDF9;
  --sunk: #EFE8DC;
  --ink: #1E1A14;
  --ink-2: #645C51;
  --line: #E1D8C9;
  --brand: #9A5B2E;
  --brand-ink: #FFF8EF;
  --ok: #276A49;
  --wait: #835410;
  --bad: #A03A26;
  --ota: #4A5D8A;
  --ok-bg: #E3F0E7;
  --wait-bg: #F6EBD3;
  --bad-bg: #F6E1DB;
  --ota-bg: #E3E8F3;
  --r-s: 10px;
  --r-m: 16px;
  --r-l: 26px;
  --move: cubic-bezier(.22, 1, .36, 1);
  --bounce: cubic-bezier(.34, 1.56, .64, 1);
  --serif: "Fraunces", Georgia, serif;
  --sans: "Instrument Sans", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16140F;
    --surface: #1F1C16;
    --sunk: #12100C;
    --ink: #EEE8DD;
    --ink-2: #ADA597;
    --line: #36302A;
    --brand: #D99561;
    --brand-ink: #1B140D;
    --ok: #6CC596;
    --wait: #E3AE52;
    --bad: #EC8A73;
    --ota: #9DB0DF;
    --ok-bg: #18301F;
    --wait-bg: #33270F;
    --bad-bg: #3A1D16;
    --ota-bg: #1C2335;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--sans);
  font-variation-settings: "wdth" 100;
  -webkit-tap-highlight-color: transparent;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--brand); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* bilah demo */
.demobar {
  position: sticky; top: 0; z-index: 30;
  display: flex; gap: 12px; justify-content: space-between; align-items: center;
  padding: 8px 16px;
  background: var(--ink); color: var(--bg);
  font-size: 13px; line-height: 1.35;
}
.demobar a { color: var(--bg); font-weight: 600; white-space: nowrap; text-underline-offset: 3px; }

main { outline: none; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px 120px; }
.wrap--wide { max-width: 1120px; }

/* tipografi */
h1, h2, h3 { margin: 0; font-weight: 650; }
.display { font-family: var(--serif); font-weight: 650; font-size: clamp(34px, 8vw, 52px); line-height: 1.02; letter-spacing: -.01em; font-variation-settings: "opsz" 144; }
.h2 { font-family: var(--serif); font-size: 26px; line-height: 1.15; font-weight: 600; }
.h3 { font-size: 18px; font-weight: 600; }
.eyebrow { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; }

/* hero */
.hero { margin: 0 -16px; position: relative; }
.art { position: relative; overflow: hidden; background: var(--sunk); }
.art svg { width: 100%; height: 100%; }
.art__note { position: absolute; right: 10px; bottom: 8px; font-size: 11px; color: #fff; background: rgba(20, 16, 10, .45); padding: 2px 8px; border-radius: 999px; }
.hero .art { aspect-ratio: 4 / 3; max-height: 420px; width: 100%; }
@media (min-width: 720px) { .hero { margin: 16px 0 0; } .hero .art { border-radius: var(--r-l); aspect-ratio: 16 / 9; } }
.hero__text { padding: 20px 0 8px; }
.hero__meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; color: var(--ink-2); font-size: 15px; }
.hero__meta span { display: inline-flex; align-items: center; gap: 6px; }
.ico { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* pemilih tanggal */
.picker {
  display: grid; grid-template-columns: 1fr auto; gap: 0;
  margin: 16px 0 8px;
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface);
}
.picker__dates { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 16px; border: 0; background: none; text-align: left; border-right: 1px solid var(--line); border-radius: var(--r-m) 0 0 var(--r-m); min-height: 64px; }
.picker__label { font-size: 12px; color: var(--ink-2); font-weight: 600; letter-spacing: .04em; }
.picker__value { font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 4px; padding: 8px 10px; }
.stepper__btn { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: none; font-size: 20px; line-height: 1; }
.stepper__btn:disabled { opacity: .35; cursor: default; }
.stepper__val { min-width: 54px; text-align: center; font-weight: 600; font-size: 15px; }

/* unit */
.section { padding: 28px 0 4px; }
.section__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.units { display: grid; gap: 14px; }
@media (min-width: 640px) { .units { grid-template-columns: 1fr 1fr; } }
.unit {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); overflow: hidden;
  transition: transform .35s var(--move), border-color .2s;
}
.unit:hover { border-color: var(--brand); }
.unit:active { transform: scale(.99); }
.unit .art { aspect-ratio: 3 / 2; }
.unit__body { padding: 14px 16px 16px; display: grid; gap: 6px; }
.unit__row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.unit__price { font-weight: 650; }
.unit__price small { font-weight: 400; color: var(--ink-2); font-size: 13px; }
.unit__fac { font-size: 14px; color: var(--ink-2); }
.unit.is-full { opacity: .55; }
.unit.is-full .art { filter: grayscale(.8); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.pill--ok { color: var(--ok); background: var(--ok-bg); }
.pill--wait { color: var(--wait); background: var(--wait-bg); }
.pill--bad { color: var(--bad); background: var(--bad-bg); }
.pill--ota { color: var(--ota); background: var(--ota-bg); }
.pill--plain { color: var(--ink-2); background: var(--sunk); }

/* daftar info */
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; padding: 0; margin: 0; list-style: none; }
.facts li { display: flex; gap: 10px; align-items: center; font-size: 15px; }
.rules { margin: 0; padding-left: 18px; color: var(--ink-2); }
.rules li { margin: 4px 0; }
.rowlink { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); text-decoration: none; color: inherit; }
.rowlink + .rowlink { margin-top: 10px; }
hr.rule { border: 0; border-top: 1px solid var(--line); margin: 28px 0 0; }

/* tombol */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 999px;
  border: 1px solid transparent; background: var(--brand); color: var(--brand-ink);
  font-weight: 650; text-decoration: none; font-size: 16px; white-space: nowrap;
  transition: transform .3s var(--bounce), opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--ghost { background: none; color: var(--ink); border-color: var(--line); }
.btn--block { width: 100%; }
.btn--sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

/* bilah bawah lengket */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.dock__inner { max-width: 720px; margin: 0 auto; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.dock__sum { display: grid; line-height: 1.25; }
.dock__sum b { font-size: 17px; }
.dock__sum span { font-size: 13px; color: var(--ink-2); }

/* halaman unit */
.back { display: inline-flex; align-items: center; gap: 6px; padding: 14px 0; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 15px; }
.gallery { display: grid; grid-auto-flow: column; grid-auto-columns: 88%; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery .art { scroll-snap-align: start; aspect-ratio: 4 / 3; border-radius: var(--r-m); }
@media (min-width: 720px) { .gallery { grid-auto-columns: 62%; } }

.summary { border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); padding: 16px; display: grid; gap: 8px; }
.summary__line { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.summary__line.total { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 2px; font-weight: 650; font-size: 17px; }
.empty { border: 1px dashed var(--line); border-radius: var(--r-m); padding: 18px 16px; text-align: center; color: var(--ink-2); display: grid; gap: 10px; justify-items: center; }

/* form */
.form { display: grid; gap: 16px; margin-top: 20px; }
.field { display: grid; gap: 6px; }
.field label, .field .label { font-weight: 600; font-size: 15px; }
.field .hint { font-size: 13px; color: var(--ink-2); }
.input {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface);
  font-size: 16px;
}
textarea.input { min-height: 84px; resize: vertical; }
.input[aria-invalid="true"] { border-color: var(--bad); }
.err { color: var(--bad); font-size: 13px; font-weight: 600; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice label { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--surface); cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice label:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.choice label:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.choice b { font-size: 15px; }
.choice span { font-size: 13px; color: var(--ink-2); }

/* bayar */
.paycard { border: 1px solid var(--line); border-radius: var(--r-l); background: var(--surface); padding: 20px; display: grid; gap: 16px; }
.timer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r-s); background: var(--wait-bg); color: var(--wait); font-weight: 600; font-size: 15px; }
.amount { font-size: 34px; font-weight: 650; letter-spacing: -.01em; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--sunk); border-radius: 999px; }
.tabs button { min-height: 42px; border: 0; border-radius: 999px; background: none; font-weight: 600; color: var(--ink-2); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); }
.qr { width: min(260px, 70vw); margin: 0 auto; padding: 14px; background: #fff; border-radius: var(--r-m); border: 1px solid var(--line); position: relative; }
.qr__stamp { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%) rotate(-8deg); background: #fff; color: #9A5B2E; border: 2px solid #9A5B2E; padding: 2px 10px; font-weight: 700; font-size: 13px; letter-spacing: .1em; border-radius: 6px; }
.steps { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: 15px; }
.steps li { margin: 3px 0; }
.bank { display: grid; gap: 10px; }
.bank__row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-s); }
.bank__row b { font-size: 18px; }
.uniq { background: var(--wait-bg); color: var(--wait); border-radius: 4px; padding: 0 2px; }
.simulate { border: 1px dashed var(--brand); border-radius: var(--r-m); padding: 14px; display: grid; gap: 10px; }
.simulate p { margin: 0; font-size: 14px; color: var(--ink-2); }

/* status */
.statushead { display: grid; gap: 10px; padding: 28px 0 8px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 15px; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; text-align: right; font-weight: 600; }

/* pengenal minat */
.cta { margin-top: 32px; padding: 22px 20px; border-radius: var(--r-l); background: var(--ink); color: var(--bg); display: grid; gap: 10px; }
.cta h2 { font-family: var(--serif); font-size: 24px; line-height: 1.15; }
.cta p { margin: 0; color: color-mix(in srgb, var(--bg) 78%, transparent); font-size: 15px; }
.cta .btn { background: var(--bg); color: var(--ink); justify-self: start; }
.foot { padding: 28px 0 0; font-size: 13px; color: var(--ink-2); }

/* sheet */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet__backdrop { position: absolute; inset: 0; background: rgba(15, 12, 8, .45); animation: fade .25s var(--move); }
.sheet__panel {
  position: relative; width: 100%; max-width: 560px; max-height: 92dvh; overflow: auto;
  background: var(--bg); border-radius: var(--r-l) var(--r-l) 0 0;
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom));
  animation: rise .32s var(--move);
}
@media (min-width: 720px) { .sheet { align-items: center; } .sheet__panel { border-radius: var(--r-l); } }
.sheet__grip { width: 40px; height: 4px; border-radius: 999px; background: var(--line); margin: 4px auto 12px; }
.sheet__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.xbtn { width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: none; display: grid; place-items: center; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* kalender rentang */
.cal__nav { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 8px; }
.cal__month { font-weight: 650; font-size: 17px; }
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px 0; }
.cal__dow { font-size: 12px; color: var(--ink-2); text-align: center; padding: 6px 0; font-weight: 600; }
.cal__day {
  height: 44px; border: 0; background: none; font-size: 15px; font-variant-numeric: tabular-nums;
  position: relative; border-radius: 0;
}
.cal__day:disabled { color: color-mix(in srgb, var(--ink-2) 50%, transparent); cursor: default; }
.cal__day.is-full { text-decoration: line-through; color: var(--ink-2); }
.cal__day.in-range { background: color-mix(in srgb, var(--brand) 14%, transparent); }
.cal__day.is-start, .cal__day.is-end { background: var(--brand); color: var(--brand-ink); font-weight: 650; }
.cal__day.is-start { border-radius: 999px 0 0 999px; }
.cal__day.is-end { border-radius: 0 999px 999px 0; }
.cal__day.is-start.is-end { border-radius: 999px; }
.cal__day.is-today::after { content: ""; position: absolute; left: 50%; bottom: 6px; width: 4px; height: 4px; margin-left: -2px; border-radius: 999px; background: currentColor; }
.cal__legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink-2); margin: 10px 0 14px; }
.cal__foot { display: flex; gap: 10px; align-items: center; justify-content: space-between; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 60; max-width: calc(100vw - 32px); padding: 12px 16px; border-radius: var(--r-s);
  background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 500;
  animation: rise .3s var(--move);
}

/* ===== sisi pemilik ===== */
.ownerhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; padding: 24px 0 16px; }
.otabs { display: flex; gap: 4px; padding: 4px; background: var(--sunk); border-radius: 999px; width: max-content; max-width: 100%; overflow-x: auto; }
.otabs a { padding: 9px 16px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 15px; white-space: nowrap; }
.otabs a[aria-current="page"] { background: var(--surface); color: var(--ink); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); margin: 16px 0 8px; }
.stat { padding: 14px 16px; display: grid; gap: 2px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat b { font-size: 30px; font-weight: 650; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--ink-2); }
.list { border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); }
.item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; width: 100%; border: 0; background: none; text-align: left; }
.item + .item { border-top: 1px solid var(--line); }
.item__main { display: grid; gap: 2px; min-width: 0; }
.item__main b { font-weight: 600; }
.item__main span { font-size: 14px; color: var(--ink-2); }
.listhead { display: flex; justify-content: space-between; align-items: baseline; margin: 24px 0 10px; }

.grid-wrap { border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface); overflow-x: auto; }
.gcal { --day: 58px; --label: 108px; display: grid; min-width: calc(var(--label) + var(--days) * var(--day)); }
@media (min-width: 720px) { .gcal { --day: 64px; --label: 140px; } }
.gcal__row { display: grid; grid-template-columns: var(--label) repeat(var(--days), var(--day)); position: relative; min-height: 56px; }
.gcal__row + .gcal__row { border-top: 1px solid var(--line); }
.gcal__unit { position: sticky; left: 0; z-index: 2; background: var(--surface); padding: 10px 12px; font-weight: 600; font-size: 14px; border-right: 1px solid var(--line); display: flex; align-items: center; }
.gcal__day { text-align: center; padding: 8px 0; font-size: 12px; color: var(--ink-2); border-left: 1px solid var(--line); line-height: 1.25; }
.gcal__day b { display: block; font-size: 16px; color: var(--ink); }
.gcal__day.is-wknd { background: color-mix(in srgb, var(--sunk) 60%, transparent); }
.gcal__day.is-today b { color: var(--brand); }
.gcal__cell { border-left: 1px solid var(--line); border-radius: 0; border-top: 0; border-right: 0; border-bottom: 0; background: none; }
.gcal__cell.is-wknd { background: color-mix(in srgb, var(--sunk) 60%, transparent); }
.gcal__bar {
  grid-row: 1; align-self: center; z-index: 1; height: 38px; margin: 0 3px;
  border-radius: 8px; border: 0; padding: 0 10px; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px;
}
.gcal__bar.s-direct { background: var(--ok-bg); color: var(--ok); box-shadow: inset 3px 0 0 var(--ok); }
.gcal__bar.s-pending { background: var(--wait-bg); color: var(--wait); box-shadow: inset 3px 0 0 var(--wait); }
.gcal__bar.s-ota { background: var(--ota-bg); color: var(--ota); box-shadow: inset 3px 0 0 var(--ota); }
.gcal__bar.s-manual { background: var(--sunk); color: var(--ink); box-shadow: inset 3px 0 0 var(--ink-2); }
.gcal__bar.s-in { background: var(--brand); color: var(--brand-ink); }
.src { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; font-size: 11px; font-weight: 700; background: currentColor; flex: none; }
.src i { font-style: normal; }
.s-direct .src i { color: var(--ok-bg); }
.s-pending .src i { color: var(--wait-bg); }
.s-ota .src i { color: var(--ota-bg); }
.s-manual .src i { color: var(--sunk); }
.s-in .src i { color: var(--brand); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 12px 0 0; font-size: 13px; color: var(--ink-2); }
.syncnote { font-size: 13px; color: var(--ink-2); }

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