:root {
  --navy: #1F3864; --navy2: #2F5597; --gold: #C9A043; --gold-light: #E8C66A; --gold-dark: #8A6420;
  --gray: #F2F4F7; --line: #D5DCE7; --text: #1D2433; --muted: #566074; --bad: #C00000; --warnbg: #FBE5D6;
  --tabs: 62px; color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.45 "Segoe UI", Roboto, Arial, sans-serif; color: var(--text); background: var(--gray);
  padding-bottom: calc(var(--tabs) + env(safe-area-inset-bottom)); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; min-height: 58px;
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px; background: var(--navy); color: #fff; }
.top img { border-radius: 8px; background: #fff; }
.title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.title strong { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title small { color: #C9D3E6; font-size: 12px; }
.iconbtn { width: 44px; height: 44px; margin: -4px 0 -4px -8px; border: 0; border-radius: 10px; background: none; color: inherit; display: grid; place-items: center; }
.chip { border: 0; border-radius: 999px; background: var(--gold); color: var(--navy); font-weight: 700; padding: 8px 14px; font-size: 14px; }

main { max-width: 1040px; margin: 0 auto; padding: 14px; outline: none; }
.tabs { position: fixed; inset: auto 0 0 0; z-index: 10; display: flex; background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; height: var(--tabs); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 12px; color: var(--muted); text-decoration: none; }
.tabs a[aria-current] { color: var(--navy); font-weight: 700; box-shadow: inset 0 3px 0 var(--gold); }

h2 { font-size: 16px; color: var(--navy); margin: 20px 2px 8px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); font-size: 14px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.card > :last-child { margin-bottom: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 3px; min-height: 124px; }
.tile:active { background: #E9EEF7; }
.tile .ico { width: 42px; height: 42px; border-radius: 11px; background: var(--navy); color: var(--gold-light); display: grid; place-items: center; margin-bottom: 6px; }
.tile b { color: var(--navy); line-height: 1.2; }
.tile span { font-size: 13px; color: var(--muted); line-height: 1.3; }

.calc { display: grid; gap: 12px; align-items: start; }
@media (min-width: 820px) { .calc { grid-template-columns: 380px 1fr; } }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.f.wide { grid-column: 1 / -1; }
.f label { font-size: 14px; font-weight: 600; }
.in { display: flex; align-items: stretch; border: 1.5px solid #9AA6BA; border-radius: 10px; background: #fff; overflow: hidden; }
.in:focus-within { border-color: var(--navy); box-shadow: 0 0 0 2px var(--gold-light); }
.in input { flex: 1; min-width: 0; border: 0; padding: 0 10px; height: 46px; font-size: 18px; background: none; outline: none; }
.in em { font-style: normal; color: var(--muted); padding: 0 10px; display: grid; place-items: center; background: var(--gray); font-size: 14px; }
.f.err .in { border-color: var(--bad); }
.f .msg { color: var(--bad); font-size: 13px; }
.f .hint { color: var(--muted); font-size: 12.5px; line-height: 1.3; }
select, .txt { width: 100%; height: 48px; border: 1.5px solid #9AA6BA; border-radius: 10px; background: #fff; padding: 0 10px; font-size: 16px; }
details.adv { margin-top: 12px; border-top: 1px solid var(--line); }
details.adv summary { padding: 12px 0; font-weight: 600; color: var(--navy2); cursor: pointer; }

.vol { background: var(--navy); color: #fff; border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; display: flex; flex-wrap: wrap; gap: 8px 28px; }
.vol div { display: flex; flex-direction: column; }
.vol span { font-size: 13px; color: #C9D3E6; }
.vol b { font-size: 26px; line-height: 1.2; }
.vol b small { font-size: 15px; font-weight: 400; }
.empty { text-align: center; color: var(--muted); padding: 26px 16px; }
.alert { background: var(--warnbg); border-left: 4px solid var(--bad); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }

.mat { width: 100%; border-collapse: collapse; }
.mat th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 0 0 6px; border-bottom: 1px solid var(--line); }
.mat td { padding: 9px 0; border-bottom: 1px solid #E8ECF3; vertical-align: top; }
.mat tr:last-child td { border-bottom: 0; }
.mat td:nth-child(n+2), .mat th:nth-child(n+2) { text-align: right; padding-left: 8px; white-space: nowrap; }
.mat b { color: var(--navy); font-size: 17px; }
.mat small { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.mat td:first-child { overflow-wrap: anywhere; }
.pricebtn { border: 0; background: none; padding: 4px 0; margin: -4px 0; font-size: 12.5px; color: var(--navy2); text-decoration: underline dotted; text-underline-offset: 3px; }
.pricebtn.miss { color: var(--gold-dark); font-weight: 700; }
.total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-top: 2px solid var(--navy); margin-top: 4px; padding-top: 10px; font-weight: 700; color: var(--navy); }
.total b { font-size: 20px; }
.notes { margin: 10px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.notes li { margin: 3px 0; }
.info { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; font-size: 15px; }
.info b { text-align: right; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1.5px solid var(--navy);
  background: #fff; color: var(--navy); font-weight: 700; text-decoration: none; text-align: center; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.sm { min-height: 40px; padding: 0 12px; font-size: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; }
.row .btn { flex: 1 1 130px; padding: 0 8px; font-size: 15px; }
.item { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid #E8ECF3; }
.item:last-child { border-bottom: 0; }
.item a { flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.item a b { color: var(--navy); display: block; overflow-wrap: anywhere; }
.item a small { color: var(--muted); }
.x { border: 0; background: none; width: 44px; height: 44px; border-radius: 10px; color: var(--bad); display: grid; place-items: center; flex: none; }
.pl { display: grid; grid-template-columns: 1fr 150px; gap: 8px 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid #E8ECF3; }
.pl:last-child { border-bottom: 0; }
.pl small { display: block; color: var(--muted); font-size: 12px; }
.pl .in input { height: 42px; font-size: 16px; text-align: right; }
.pl .ubah { color: var(--gold-dark); font-weight: 600; }

.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 14px; padding: 4px 14px 16px; text-align: center; font-size: 13px; color: var(--muted); }
.foot a { color: var(--navy2); font-weight: 600; padding: 4px 0; }
.foot span { padding: 4px 0; }

dialog { border: 0; border-radius: 16px; padding: 18px; width: min(420px, 92vw); color: var(--text); }
dialog::backdrop { background: rgba(15, 28, 54, .55); }
dialog h3 { margin: 0 0 10px; color: var(--navy); }
dialog .row { margin-top: 14px; }
#toast { position: fixed; left: 50%; bottom: calc(var(--tabs) + 16px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #111A2E; color: #fff; padding: 10px 16px; border-radius: 10px;
  opacity: 0; pointer-events: none; transition: opacity .2s; max-width: 90vw; z-index: 20; font-size: 14px; }
#toast.on { opacity: 1; }
.only-print { display: none; }

@media print {
  @page { margin: 14mm; }
  body { background: #fff; padding: 0; font-size: 11pt; }
  .top, .tabs, #toast, .noprint, .x { display: none !important; }
  main { max-width: none; padding: 0; }
  .card { border: 0; padding: 0; border-radius: 0; }
  .only-print { display: block; }
  .phead { display: flex; align-items: center; gap: 12px; border-bottom: 2px solid #1F3864; padding-bottom: 8px; margin-bottom: 12px; }
  .pricebtn { text-decoration: none; color: inherit; }
  .mat tr, .item { break-inside: avoid; }
}
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }

.in input::placeholder { color: #566074; opacity: 1; }
