:root {
  --ink: #17221f;
  --muted: #6b7772;
  --paper: #f5f4ee;
  --surface: #fffef9;
  --line: #dfe3dc;
  --green: #0c5b4e;
  --green-dark: #083e36;
  --green-soft: #e1eee8;
  --orange: #d76735;
  --danger: #b34a3e;
  --shadow: 0 2px 8px rgba(23, 34, 31, 0.08);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); }
a { color: inherit; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: 0.6; }

.site-header, .admin-header { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 5vw; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -0.02em; }
.brand-mark { display: grid; place-items: center; width: 28px; height: 28px; color: var(--surface); background: var(--green); border-radius: 8px; font-weight: 800; font-size: 19px; line-height: 1; }
.connection-state, .admin-actions { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.connection-state a, .admin-actions a { color: var(--green); text-decoration: none; }
.state-line { width: 8px; height: 8px; background: var(--orange); border-radius: 50%; }

.customer-shell { width: min(1080px, calc(100% - 40px)); margin: 0 auto; padding: 68px 0 36px; }
.welcome-block { max-width: 620px; }
.kicker { margin: 0 0 9px; color: var(--green); font-size: 12px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 600px; margin-bottom: 13px; font-size: clamp(37px, 6vw, 72px); line-height: 0.98; letter-spacing: -0.065em; font-weight: 750; }
h2 { margin-bottom: 9px; font-size: 24px; letter-spacing: -0.035em; line-height: 1.1; }
.lede { color: var(--muted); font-size: 18px; line-height: 1.45; }
.steps { display: flex; gap: 30px; margin: 46px 0 33px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.step { display: flex; align-items: center; gap: 10px; color: #a0aaa4; font-size: 14px; }
.step span { font-size: 12px; font-weight: 800; }
.step.active { color: var(--green); }
.step.active span { color: var(--orange); }
.portal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 64px; align-items: start; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-heading h2 { margin-bottom: 0; }
.section-note { color: var(--muted); font-size: 12px; white-space: nowrap; }
.package-list { border-top: 1px solid var(--line); }
.package-option { width: 100%; display: grid; grid-template-columns: 20px minmax(110px, 1fr) 150px 90px; gap: 13px; align-items: center; padding: 21px 0; color: var(--ink); text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); }
.package-option:hover, .package-option.selected { color: var(--green); }
.package-radio { width: 16px; height: 16px; border: 1px solid #a9b7af; border-radius: 50%; }
.package-option.selected .package-radio { border: 5px solid var(--orange); }
.package-copy, .package-detail { display: flex; flex-direction: column; gap: 5px; }
.package-copy strong, .package-detail strong { font-size: 16px; }
.package-copy small, .package-detail small { color: var(--muted); font-size: 13px; }
.package-price { color: var(--ink); font-weight: 800; text-align: right; }
.payment-panel { padding: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.panel-copy { color: var(--muted); font-size: 14px; line-height: 1.5; }
label { display: flex; flex-direction: column; gap: 8px; color: var(--ink); font-size: 13px; font-weight: 700; }
input { width: 100%; min-height: 46px; padding: 0 13px; color: var(--ink); background: var(--surface); border: 1px solid #bfc9c2; border-radius: 7px; outline: none; }
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.primary-button, .secondary-button, .table-button { min-height: 44px; border: 1px solid transparent; border-radius: 7px; font-weight: 800; transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease; }
.primary-button { width: 100%; margin-top: 18px; color: white; background: var(--green); }
.primary-button:hover { background: var(--green-dark); }
.secondary-button { padding: 0 18px; color: var(--green); background: transparent; border-color: var(--green); }
.secondary-button:hover { color: white; background: var(--green); }
.trust-line { display: flex; gap: 8px; margin-top: 20px; color: var(--muted); font-size: 11px; }
.message { min-height: 20px; margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.message.error { color: var(--danger); }
.message.success { color: var(--green); }
.message.warning { color: #986323; }
.result-panel { display: flex; gap: 22px; align-items: flex-start; margin-top: 38px; padding: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.result-panel h2 { margin-bottom: 8px; }
.result-panel p:not(.kicker) { max-width: 620px; color: var(--muted); line-height: 1.55; }
.result-symbol { display: grid; flex: 0 0 40px; place-items: center; width: 40px; height: 40px; color: white; background: var(--green); border-radius: 50%; font-weight: 900; }
.failure .result-symbol { background: var(--danger); }
.waiting .result-symbol { background: var(--orange); }
.result-details { display: flex; gap: 30px; margin: 18px 0 0; }
.result-details div { display: flex; flex-direction: column; gap: 4px; }
.result-details dt { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
.result-details dd { margin: 0; font-size: 13px; font-weight: 700; }
.spinner { flex: 0 0 22px; width: 22px; height: 22px; margin: 9px; border: 2px solid var(--green-soft); border-top-color: var(--orange); border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.customer-footer { display: flex; justify-content: space-between; gap: 15px; margin-top: 54px; color: var(--muted); font-size: 13px; }
.customer-footer a { color: var(--green); text-decoration: none; }
.empty-state { color: var(--muted); padding: 24px 0; }

.admin-header { padding-inline: 4vw; }
.admin-shell { width: min(1240px, calc(100% - 48px)); margin: 0 auto; padding: 52px 0 80px; }
.admin-intro { display: flex; align-items: end; justify-content: space-between; gap: 32px; padding-bottom: 34px; border-bottom: 1px solid var(--line); }
.admin-intro h1 { font-size: clamp(34px, 5vw, 58px); }
.enforcement-note { max-width: 350px; padding: 14px 16px; color: #7d5921; background: #fff3d9; border-left: 3px solid var(--orange); font-size: 13px; line-height: 1.45; }
.status-label { color: var(--orange); font-size: 12px; }
.metrics-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 30px 0 60px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metric { display: flex; flex-direction: column; gap: 7px; padding: 18px 20px 18px 0; border-right: 1px solid var(--line); }
.metric:not(:first-child) { padding-left: 20px; }
.metric:last-child { border-right: 0; }
.metric span { color: var(--muted); font-size: 12px; }
.metric strong { font-size: 26px; letter-spacing: -0.04em; }
.admin-section { margin-top: 56px; }
.admin-section .section-heading { margin-bottom: 17px; }
.compact { margin-bottom: 20px; }
.table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 13px 10px 13px 0; color: var(--muted); font-size: 11px; font-weight: 700; text-align: left; text-transform: uppercase; letter-spacing: 0.08em; }
td { padding: 14px 10px 14px 0; border-top: 1px solid var(--line); vertical-align: middle; }
td input { min-width: 110px; min-height: 35px; padding: 0 8px; font-size: 13px; }
td small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.table-button { min-height: 34px; padding: 0 11px; color: var(--green); background: transparent; border-color: #b9c7be; font-size: 12px; }
.table-button:hover { border-color: var(--green); background: var(--green-soft); }
.order-status { display: inline-block; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.06em; }
.order-status.complete { color: var(--green); }
.order-status.failed { color: var(--danger); }
.order-status.processing { color: #986323; }
.empty-row { padding: 22px 0; color: var(--muted); }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid label:nth-child(1), .form-grid label:nth-child(2), .form-grid button { grid-column: 1 / -1; }
.form-grid button { justify-self: start; padding-inline: 18px; }
.toggle { flex-direction: row; align-items: center; gap: 8px; color: var(--green); font-size: 12px; }
.toggle input { width: 16px; min-height: 16px; accent-color: var(--green); }

@media (max-width: 800px) {
  .site-header, .admin-header { padding: 0 20px; }
  .connection-state { display: none; }
  .customer-shell { width: min(100% - 32px, 640px); padding-top: 42px; }
  h1 { font-size: clamp(40px, 14vw, 62px); }
  .portal-layout, .two-column { grid-template-columns: 1fr; gap: 42px; }
  .package-option { grid-template-columns: 20px minmax(0, 1fr) 88px; }
  .package-detail { display: none; }
  .payment-panel { padding: 24px; }
  .admin-shell { width: min(100% - 32px, 640px); padding-top: 34px; }
  .admin-intro { display: block; }
  .enforcement-note { margin-top: 22px; }
  .metrics-row { grid-template-columns: 1fr 1fr; }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(3), .metric:nth-child(4) { border-top: 1px solid var(--line); }
  .metric:nth-child(3) { padding-left: 0; }
  .metric:nth-child(4) { border-right: 0; }
}

@media (max-width: 480px) {
  .steps { gap: 18px; }
  .step { gap: 6px; font-size: 12px; }
  .section-heading { align-items: start; flex-direction: column; gap: 7px; }
  .section-note { white-space: normal; }
  .package-option { grid-template-columns: 18px minmax(0, 1fr) 76px; gap: 9px; padding: 18px 0; }
  .package-copy strong { font-size: 14px; }
  .package-price { font-size: 13px; }
  .result-panel { gap: 12px; }
  .result-details { flex-direction: column; gap: 12px; }
  .customer-footer { flex-direction: column; margin-top: 38px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid label:nth-child(1), .form-grid label:nth-child(2), .form-grid button { grid-column: auto; }
  .admin-actions a { display: none; }
}
