:root {
  --navy: #071d36;
  --ocean: #0b5278;
  --signal: #0b84a5;
  --gold: #f3b61f;
  --paper: #f5f8fb;
  --ink: #152334;
  --line: #c8d7e5;
  --danger: #a52136;
  --success: #087a45;
  font-family: Aptos, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: linear-gradient(115deg, #edf4f8 0 55%, #dceaf1 55%); }
.masthead { min-height: 76px; padding: 14px clamp(20px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; background: var(--navy); color: white; }
.brand { display: flex; gap: 12px; align-items: center; color: white; text-decoration: none; font-weight: 750; font-size: 1.1rem; }
.brand small { display: block; color: #9ec9dc; font-size: .76rem; font-weight: 500; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; background: var(--gold); color: var(--navy); border-radius: 50% 50% 50% 12%; }
.environment { padding: 8px 12px; border: 1px solid #44718c; color: #d8edf5; border-radius: 999px; font-size: .82rem; }
.workspace { width: min(1180px, calc(100% - 36px)); margin: 0 auto; padding: 44px 0 64px; }
.intro { max-width: 820px; margin-bottom: 34px; }
h1 { margin: 0 0 14px; max-width: 760px; color: var(--navy); font-size: clamp(2rem, 4.6vw, 4.4rem); line-height: .98; letter-spacing: -.045em; }
.intro > p { max-width: 720px; font-size: 1.05rem; line-height: 1.65; color: #3d536a; }
.payment-rail { list-style: none; padding: 0; margin: 28px 0 0; display: flex; align-items: center; gap: 0; }
.payment-rail li { display: flex; align-items: center; gap: 9px; color: var(--ocean); font-weight: 650; }
.payment-rail li:not(:last-child)::after { content: ""; width: clamp(28px, 6vw, 78px); height: 2px; background: var(--signal); margin: 0 12px; }
.payment-rail strong { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--signal); color: white; font-size: .72rem; }
.columns { display: grid; grid-template-columns: minmax(320px, 5fr) minmax(380px, 7fr); gap: 22px; align-items: start; }
.panel { background: rgba(255,255,255,.94); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 18px 48px rgba(12, 55, 82, .09); }
.panel-heading { padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.panel-heading h2, .outcome h1 { margin: 0 0 5px; color: var(--navy); font-size: 1.35rem; letter-spacing: -.015em; }
.panel-heading p, .outcome > p { margin: 0; color: #5b6d7e; line-height: 1.5; }
form { padding: 24px; }
label { display: block; margin: 0 0 7px; font-weight: 700; font-size: .86rem; color: var(--navy); }
input, textarea { width: 100%; margin: 0 0 18px; padding: 12px 13px; border: 1px solid #aebfce; border-radius: 8px; background: white; color: var(--ink); font: inherit; }
input[readonly] { background: #eaf1f5; color: #496073; }
input:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(11,132,165,.3); outline-offset: 2px; border-color: var(--signal); }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.primary, .secondary, .quiet { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: 11px 16px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 750; text-decoration: none; cursor: pointer; }
.primary { background: var(--ocean); color: white; }
.primary:hover { background: var(--navy); }
.secondary { background: white; color: var(--ocean); border-color: var(--ocean); }
.quiet { background: #e7f2f6; color: var(--ocean); }
form > .primary { width: 100%; margin-top: 4px; }
.result-panel { min-height: 520px; }
.empty-state { min-height: 420px; padding: 54px 30px; display: grid; place-content: center; text-align: center; color: #587083; }
.empty-symbol { margin: 0 auto 18px; width: 78px; height: 78px; display: grid; place-items: center; border: 2px dashed var(--signal); border-radius: 50%; color: var(--signal); font-size: 2rem; }
.status-block { margin: 22px 24px 8px; padding: 15px 17px; display: flex; gap: 12px; align-items: center; background: #eaf6f8; border-left: 5px solid var(--signal); }
.status-block small { display: block; color: #557184; }
.status-block strong { color: var(--navy); font-size: 1.2rem; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px rgba(243,182,31,.2); }
.status-block [data-status-message] { display: block; margin-top: 3px; font-weight: 750; }
.status-block.status-paid { background: #e8f7ef; border-left-color: var(--success); }
.status-block.status-paid .status-dot { background: var(--success); box-shadow: 0 0 0 5px rgba(8,122,69,.16); }
.status-block.status-paid strong, .status-block.status-paid [data-status-message] { color: var(--success); }
.status-block.status-failed, .status-block.status-cancelled, .status-block.status-expired { background: #fff0f2; border-left-color: var(--danger); }
.status-block.status-failed .status-dot, .status-block.status-cancelled .status-dot, .status-block.status-expired .status-dot { background: var(--danger); box-shadow: 0 0 0 5px rgba(165,33,54,.15); }
.details { margin: 0; padding: 18px 24px; display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px 16px; font-size: .9rem; }
.details dt { color: #607487; }
.details dd { margin: 0; overflow-wrap: anywhere; color: var(--navy); font-weight: 650; }
.truncate { max-height: 3.2em; overflow: hidden; }
.qr-wrap { margin: 0 24px 18px; padding: 12px; display: inline-block; background: white; border: 1px solid var(--line); }
.qr-wrap img { display: block; width: 142px; height: 142px; }
.qr-section { margin: 0 24px 18px; }
.qr-section h3 { margin-bottom: 4px; color: var(--navy); }
.qr-section p { margin-top: 0; color: #607487; }
.qr-section .qr-wrap { margin-left: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; padding: 0 24px 22px; }
.poll-note { margin: -10px 24px 24px; color: #607487; font-size: .82rem; }
.notice { margin: 22px 24px; padding: 15px; border-left: 5px solid; display: grid; gap: 4px; }
.notice.error { border-color: var(--danger); background: #fff0f2; color: #721425; }
.notice.info { border-color: var(--signal); background: #edf8fb; color: var(--navy); }
.validation { color: var(--danger); font-size: .82rem; }
.result-page { display: grid; place-items: center; padding: 24px; background: #e8f1f6; }
.result-shell { width: min(720px, 100%); }
.back-link { display: inline-block; margin-bottom: 14px; color: var(--ocean); font-weight: 700; }
.outcome { padding: clamp(24px, 5vw, 48px); }
.outcome h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
.outcome .status-block, .outcome .notice { margin-left: 0; margin-right: 0; }
.outcome .details, .outcome .actions { padding-left: 0; padding-right: 0; }
@media (max-width: 800px) {
  .columns { grid-template-columns: 1fr; }
  .payment-rail li span { display: none; }
  .payment-rail li:not(:last-child)::after { width: 36px; }
}
@media (max-width: 520px) {
  .workspace { width: min(100% - 22px, 1180px); padding-top: 30px; }
  .environment { display: none; }
  .field-pair { grid-template-columns: 1fr; gap: 0; }
  .details { grid-template-columns: 1fr; gap: 3px; }
  .details dd { margin-bottom: 9px; }
  .actions > * { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
