:root {
  --navy: #033067; --navy-deep: #021F45; --blue: #006BCA; --blue-strong: #005BAD; --blue-light: #5CA9F2;
  --gold: #FFD27A; --red: #A3122A; --green: #1E7A46;
  --bg: #F3F7FC; --surface: #fff; --text: #0B1A30; --text-2: #4A5B73; --border: #D6DFEA; --soft: #E5F0FB; --field: #fff;
  --r: 16px; --shadow: 0 1px 2px rgba(3,48,103,.06), 0 10px 30px rgba(3,48,103,.08);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #071427; --surface: #0D1E36; --text: #EAF2FC; --text-2: #A9BCD6; --border: #22395A; --soft: #13294A; --field: #091a30; color-scheme: dark; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: 'Montserrat', system-ui, sans-serif; font-size: 15px; line-height: 1.55; background: var(--bg); color: var(--text); }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue-light); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--gold); color: var(--navy-deep); padding: 10px 16px; border-radius: 10px; font-weight: 700; z-index: 10; }
.skip:focus { top: 12px; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--text-2); }

.co-hdr { background: var(--navy); color: #fff; }
.co-hdr-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 14px 0; }
.co-logo { width: 150px; }
.back { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 600; font-size: 14px; color: #C9DDF3; }
.back:hover { color: #fff; }
.co-lock { justify-self: end; display: inline-flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 700; color: #C9DDF3; }
.proto { background: #FFF4D6; color: #5A4300; font-size: 13.5px; padding: 9px 0; border-bottom: 1px solid #F1D98C; }
@media (prefers-color-scheme: dark) { .proto { background: #3A2E08; color: #FFE7A6; border-color: #5A4712; } }

.co-main { padding: 28px 0 40px; }
h1 { font-family: 'DM Serif Display', Georgia, serif; font-weight: 400; font-size: clamp(30px, 3.6vw, 44px); line-height: 1.1; margin: 0 0 14px; }
h2 { font-size: 20px; margin: 0 0 12px; }
.steps { display: flex; flex-wrap: wrap; gap: 6px 22px; list-style: none; padding: 0; margin: 0 0 22px; counter-reset: s; color: var(--text-2); font-size: 13.5px; font-weight: 600; }
.steps li { counter-increment: s; }
.steps li::before { content: counter(s) ". "; color: var(--blue); }
.co-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.co-col { display: grid; gap: 20px; min-width: 0; }
.card-box { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 22px; box-shadow: var(--shadow); margin: 0; min-width: 0; }
legend { float: left; width: 100%; padding: 0; margin-bottom: 14px; font-weight: 800; font-size: 17px; display: flex; align-items: center; gap: 10px; }
legend + * { clear: both; }
.num { width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 13px; }

.line { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.line img { width: 56px; height: 56px; object-fit: contain; background: #fff; border-radius: 10px; border: 1px solid var(--border); }
.line strong { display: block; font-size: 14px; }
.line small { color: var(--text-2); }
.line .amt { font-weight: 700; white-space: nowrap; }
.line.bad small { color: var(--red); font-weight: 600; }
.total-row { display: flex; justify-content: space-between; padding: 14px 0 6px; font-weight: 800; font-size: 17px; }
.empty-list { padding: 18px; text-align: center; color: var(--text-2); background: var(--soft); border-radius: 12px; }
.problems, .err { background: #FDECEE; color: #7A0E22; border: 1px solid #F2B8C0; border-radius: 12px; padding: 10px 14px; font-weight: 600; font-size: 14px; }
@media (prefers-color-scheme: dark) { .problems, .err { background: #3a0f18; color: #ffc9d1; border-color: #6b1c2a; } }
.text-link { display: inline-block; margin-top: 10px; color: var(--blue); font-weight: 700; font-size: 14px; }
@media (prefers-color-scheme: dark) { .text-link { color: var(--blue-light); } }

.field { display: grid; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field label, .lbl { font-weight: 700; font-size: 13.5px; }
.opt { font-weight: 500; color: var(--text-2); }
input:not([type=radio]):not([type=checkbox]):not([type=file]), textarea, select { width: 100%; border: 1.5px solid var(--border); background: var(--field); border-radius: 12px; padding: 11px 13px; font-size: 15px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 25%, transparent); }
input[aria-invalid="true"] { border-color: var(--red) !important; }
.hint { margin: 0; font-size: 12.5px; color: var(--text-2); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; border: 1.5px solid var(--border); border-radius: 12px; padding: 10px 14px; }
.seg small { display: block; color: var(--text-2); font-size: 12.5px; }
.seg input:checked + span { border-color: var(--blue); background: var(--soft); box-shadow: inset 0 0 0 1px var(--blue); }
.seg input:focus-visible + span { outline: 3px solid var(--blue-light); outline-offset: 2px; }

.momo { background: linear-gradient(165deg, var(--surface), var(--surface)); }
.pay-card { background: var(--navy); color: #fff; border-radius: 16px; padding: 18px 20px; position: relative; overflow: hidden; }
.pay-card::after { content: ""; position: absolute; right: -50px; top: -50px; width: 160px; height: 160px; border-radius: 50%; border: 30px solid rgba(255,210,122,.16); }
.pay-label { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); font-weight: 800; }
.pay-amount { margin: 2px 0 12px; font-size: 36px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.pay-dl { margin: 0; display: grid; gap: 8px; position: relative; z-index: 1; }
.pay-dl div { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid rgba(255,255,255,.14); padding-top: 8px; }
.pay-dl dt { color: #C9DDF3; font-size: 13.5px; }
.pay-dl dd { margin: 0; font-weight: 700; text-align: right; }
.copy { margin-left: 6px; border: 1px solid rgba(255,255,255,.35); background: none; color: #fff; border-radius: 8px; padding: 2px 8px; font-size: 12px; font-weight: 700; cursor: pointer; }
.copy:hover { background: rgba(255,255,255,.12); }
.tbc { color: var(--gold); font-weight: 600; }
.howto { margin: 16px 0 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; color: var(--text-2); }

.drop { display: block; border: 2px dashed var(--border); border-radius: 14px; padding: 18px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.drop:hover, .drop.over { border-color: var(--blue); background: var(--soft); }
.drop:focus-within { outline: 3px solid var(--blue-light); outline-offset: 2px; }
.drop-empty { display: grid; justify-items: center; gap: 4px; color: var(--text-2); }
.drop-empty strong { color: var(--text); }
.drop-empty small { font-size: 12.5px; max-width: 40ch; }
.drop-full { display: flex; gap: 14px; align-items: center; text-align: left; }
.drop-full img { width: 72px; height: 110px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.drop-full small { display: block; color: var(--text-2); }
.change { color: var(--blue); font-weight: 700; font-size: 13.5px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; margin: 6px 0 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--blue); }
.err { margin: 0 0 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; padding: 13px 22px; font-weight: 700; font-size: 15px; text-decoration: none; border: 2px solid transparent; cursor: pointer; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-strong); }
.btn-primary:disabled { background: #7E8FA6; cursor: progress; }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--blue); }
.btn-block { width: 100%; }
.fine { font-size: 12.5px; color: var(--text-2); margin: 12px 0 0; }

.done { text-align: center; max-width: 640px; margin: 10px auto 24px; padding: 36px 26px; }
.tick { width: 64px; height: 64px; border-radius: 50%; background: #E3F4EA; color: var(--green); display: grid; place-items: center; margin: 0 auto 14px; }
.big-ref { font-size: 30px; font-weight: 800; letter-spacing: .06em; margin: 4px 0 12px; color: var(--blue); }
@media (prefers-color-scheme: dark) { .big-ref { color: var(--gold); } }
.done-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

.track { margin-top: 24px; }
.empty-co { max-width: 560px; display: grid; gap: 10px; justify-items: start; }
.empty-co h2 { margin: 0; }
.track-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.track-row .field { margin: 0; }
#track-out:not(:empty) { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--soft); font-size: 14.5px; }
.status { display: inline-block; padding: 3px 10px; border-radius: 999px; font-weight: 800; font-size: 12.5px; }
.st-awaiting { background: #FFF1CC; color: #6B4E00; }
.st-approved, .st-ready, .st-completed { background: #DDF3E6; color: #135C33; }
.st-rejected, .st-refunded { background: #FBE1E5; color: #7A0E22; }

.co-ftr { border-top: 1px solid var(--border); padding: 20px 0 30px; font-size: 13px; color: var(--text-2); }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); visibility: hidden; background: var(--navy-deep); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; transition: transform .3s; z-index: 50; }
#toast.show { transform: translate(-50%, 0); visibility: visible; }

@media (max-width: 860px) {
  .co-grid { grid-template-columns: 1fr; }
  .co-hdr-row { grid-template-columns: auto 1fr; }
  .co-logo { justify-self: end; width: 120px; }
  .co-lock { display: none; }
  .back span { display: none; }
}
@media (max-width: 560px) {
  .two, .track-row { grid-template-columns: 1fr; }
  .card-box { padding: 18px 16px; }
  .pay-amount { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; } }
