:root {
  --ink: #17232f;
  --muted: #5a6875;
  --brand: #1b5daa;
  --brand-dark: #124477;
  --accent: #df684e;
  --surface: #ffffff;
  --canvas: #f3f6f8;
  --line: #d7dfe6;
  --success: #17704b;
  --warning: #91510e;
  --danger: #9e332d;
  --radius: 6px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { min-height: 100vh; margin: 0; display: grid; grid-template-rows: auto 1fr auto; background: var(--canvas); }
a { color: inherit; }
.site-header { min-height: 76px; padding: 0 5vw; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; }
.brand img { width: 150px; height: auto; display: block; }
.site-header nav { display: flex; align-items: center; gap: 24px; font-size: 0.9rem; font-weight: 700; }
.site-header nav a { text-decoration: none; }
.site-header nav a:hover { color: var(--brand); }
.gateway { width: min(760px, calc(100% - 40px)); margin: auto; padding: 64px 0 76px; text-align: center; }
.gateway-mark { display: none; }
.eyebrow { margin: 0 0 12px; color: var(--brand); font-size: 0.78rem; font-weight: 800; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 18px; font-size: clamp(2.3rem, 7vw, 4.8rem); line-height: 1; letter-spacing: 0; }
.gateway-copy { max-width: 590px; margin: 0 auto; color: var(--muted); font-size: 1.12rem; line-height: 1.7; }
.gateway-actions, .actions { margin-top: 32px; display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.button { min-height: 46px; padding: 12px 18px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: var(--radius); font-weight: 800; text-decoration: none; }
.button.primary { background: var(--brand); color: #fff; }
.button.primary:hover { background: var(--brand-dark); }
.button.secondary { background: var(--surface); border-color: #b9c6d1; color: var(--ink); }
.button.secondary:hover { border-color: var(--brand); color: var(--brand); }
.order-gateway { text-align: left; }
.order-gateway .gateway-copy { margin-left: 0; }
.order-gateway .gateway-actions { justify-content: flex-start; }
.contact-line { margin-top: 44px; padding-top: 18px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); color: var(--muted); }
.contact-line a { color: var(--brand); font-weight: 700; }
footer { min-height: 64px; padding: 18px 5vw; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); background: var(--surface); border-top: 1px solid var(--line); font-size: 0.86rem; }

.portal-body { background: #eef2f5; }
.portal-shell { width: min(1080px, calc(100% - 40px)); margin: 40px auto 64px; }
.portal-heading { position: relative; padding: 10px 0 28px; }
.portal-heading h1 { margin-bottom: 12px; font-size: clamp(2rem, 5vw, 3.2rem); }
.portal-heading > p:not(.eyebrow) { color: var(--muted); }
.status { position: absolute; top: 10px; right: 0; min-width: 170px; padding: 11px 14px; border-left: 3px solid var(--warning); background: #fff9ef; }
.status span, .status strong { display: block; }
.status span { margin-bottom: 3px; color: var(--muted); font-size: 0.72rem; text-transform: uppercase; }
.status.paid { border-color: var(--success); background: #eff9f4; }
.status.payment_failed { border-color: var(--danger); background: #fff4f2; }
.order-summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.section-title { padding: 22px 24px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.section-title p { margin-bottom: 4px; color: var(--muted); font-size: 0.8rem; }
.section-title h2 { margin: 0; font-size: 1.25rem; }
.section-title > strong { color: var(--brand); font-size: 1.25rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; table-layout: fixed; }
th, td { padding: 15px 18px; border-bottom: 1px solid #e7ebef; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
thead th { color: var(--muted); background: #f8fafb; font-size: 0.76rem; text-transform: uppercase; }
th:first-child, td:first-child { width: 62%; }
th:nth-child(2), td:nth-child(2) { width: 18%; }
th:last-child, td:last-child { width: 20%; text-align: right; }
tbody strong, tbody small { display: block; }
tbody small { margin-top: 5px; color: var(--muted); }
.line-no { display: inline-block; min-width: 28px; margin-right: 8px; color: var(--muted); font-size: 0.74rem; }
tfoot th, tfoot td { border: 0; background: #f5f8fa; font-size: 1rem; }
.details-grid { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.details-grid > div { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.details-grid h2 { font-size: 1.05rem; }
dl { margin: 0; display: grid; grid-template-columns: 100px 1fr; gap: 9px 16px; }
dt { color: var(--muted); font-size: 0.82rem; }
dd { margin: 0; overflow-wrap: anywhere; }
.terms-note { margin: 18px 0 0; color: var(--muted); font-size: 0.86rem; line-height: 1.6; }
.actions { justify-content: flex-end; }
.unavailable { width: min(620px, calc(100% - 40px)); margin: auto; padding: 60px 0; text-align: center; }
.unavailable h1 { font-size: clamp(1.8rem, 5vw, 3rem); }
.unavailable p { color: var(--muted); line-height: 1.7; }
.unavailable .button { margin-top: 18px; }

@media (max-width: 720px) {
  .site-header { min-height: 68px; padding: 12px 20px; flex-wrap: wrap; }
  .brand img { width: 128px; }
  .site-header nav { width: 100%; justify-content: space-between; gap: 14px; font-size: 0.78rem; }
  .gateway { padding: 48px 0 58px; }
  .gateway-actions .button { width: 100%; }
  .portal-shell { width: min(100% - 24px, 1080px); margin-top: 22px; }
  .portal-heading { padding-bottom: 18px; }
  .portal-heading h1 { padding-right: 0; }
  .status { position: static; margin-top: 18px; }
  .section-title { align-items: flex-start; flex-direction: column; }
  th, td { padding: 12px 10px; font-size: 0.82rem; }
  th:first-child, td:first-child { width: 56%; }
  th:nth-child(2), td:nth-child(2) { width: 20%; }
  th:last-child, td:last-child { width: 24%; }
  .details-grid { grid-template-columns: 1fr; }
  .details-grid > div { padding: 20px; }
  dl { grid-template-columns: 84px 1fr; }
  .actions .button { width: 100%; }
  .contact-line, footer { align-items: flex-start; flex-direction: column; }
}
