:root {
  --ink: #07111d;
  --panel: #0c1b2a;
  --panel-2: #102438;
  --paper: #f5f1e8;
  --muted: #a9bac8;
  --red: #e12d39;
  --blue: #168eea;
  --yellow: #ffd45c;
  --line: #294157;
  --green: #39c98b;
  --display: "Barlow Condensed", sans-serif;
  --body: "Space Grotesk", sans-serif;
}

* { box-sizing: border-box; }
html { color: var(--paper); background: var(--ink); scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  font-family: var(--body);
  background:
    radial-gradient(circle at 86% 2%, rgba(22, 142, 234, .24), transparent 31rem),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(rgba(255, 255, 255, .02) 1px, transparent 1px) 0 0 / 32px 32px,
    var(--ink);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: repeating-linear-gradient(115deg, transparent 0 9px, rgba(225, 45, 57, .025) 9px 10px);
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.command-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 max(18px, calc((100vw - 1380px) / 2));
  border-bottom: 4px solid var(--red);
  background: rgba(7, 17, 29, .96);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; font: 800 16px/.9 var(--display); letter-spacing: .08em; }
.brand small { display: block; color: var(--yellow); font-size: 12px; }
.brand-mark { width: 34px; height: 34px; background: linear-gradient(135deg, var(--red) 0 48%, #fff 48% 53%, var(--blue) 53%); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.command-bar nav { display: flex; gap: 4px; margin-left: auto; }
.command-bar nav a { padding: 13px 15px; color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 700; }
.command-bar nav a:hover, .command-bar nav a.active { color: var(--ink); background: var(--paper); }
.scorebug { white-space: nowrap; color: var(--yellow); font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.scorebug i { display: inline-block; width: 9px; height: 9px; margin-right: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 12px currentColor; }
.scorebug.connected { color: var(--green); }
.scorebug.error { color: #ff7d87; }

.shell { width: min(1380px, 100%); margin: 0 auto; padding: 52px 26px 96px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 44px; align-items: end; margin-bottom: 38px; }
.kicker { margin: 0 0 8px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
h1, h2 { margin: 0; font-family: var(--display); text-transform: uppercase; }
h1 { max-width: 920px; font-size: clamp(58px, 7.4vw, 102px); line-height: .78; letter-spacing: -.025em; }
h1 em { color: var(--yellow); font-style: italic; }
.hero-copy > p:last-child { max-width: 720px; margin: 24px 0 0; color: var(--muted); font-size: 16px; line-height: 1.7; }
.environment-ticket { position: relative; padding: 23px; border: 1px solid var(--line); border-left: 6px solid var(--yellow); background: rgba(12, 27, 42, .84); box-shadow: 12px 12px 0 rgba(0, 0, 0, .16); }
.environment-ticket::after { content: ""; position: absolute; right: 10px; top: 10px; width: 28px; height: 28px; border-top: 2px solid var(--blue); border-right: 2px solid var(--blue); }
.environment-ticket span, .environment-ticket small { display: block; color: var(--muted); font-size: 10px; letter-spacing: .11em; text-transform: uppercase; }
.environment-ticket strong { display: block; margin: 7px 0 4px; font: 900 34px/1 var(--display); letter-spacing: .04em; }

.handoff-track { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); padding: 0; margin: 0 0 28px; list-style: none; border: 1px solid var(--line); background: rgba(7, 17, 29, .66); }
.handoff-track::before { content: ""; position: absolute; left: 0; bottom: 0; width: var(--progress, 0%); height: 4px; background: linear-gradient(90deg, var(--red), var(--yellow), var(--blue)); transition: width .6s cubic-bezier(.2, .8, .2, 1); }
.handoff-track li { min-height: 84px; display: grid; grid-template-columns: 48px 1fr; gap: 10px; align-items: center; padding: 15px; border-right: 1px solid var(--line); opacity: .55; }
.handoff-track li:last-child { border-right: 0; }
.handoff-track li.done, .handoff-track li.active { opacity: 1; background: linear-gradient(90deg, rgba(22, 142, 234, .12), transparent); }
.handoff-track li.active { box-shadow: inset 0 3px var(--yellow); }
.handoff-track > li > span { font: 900 27px/1 var(--display); color: var(--line); }
.handoff-track li.done > span { color: var(--green); }
.handoff-track li.active > span { color: var(--yellow); }
.handoff-track b, .handoff-track small { display: block; }
.handoff-track b { font: 800 18px/1 var(--display); text-transform: uppercase; }
.handoff-track small { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.4; }

.notice { margin-bottom: 22px; padding: 16px 18px; border-left: 5px solid var(--blue); background: #122c42; color: #e7f1f8; font-size: 13px; line-height: 1.6; }
.notice.success { border-color: var(--green); background: #102c29; }
.notice.error { border-color: var(--red); background: #351923; }
.connection-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(380px, .74fr); gap: 24px; align-items: stretch; }
.connection-card, .readiness-card, .token-warning, .troubleshooting { border: 1px solid var(--line); background: linear-gradient(145deg, rgba(16, 36, 56, .96), rgba(8, 23, 36, .99)); box-shadow: 11px 13px 0 rgba(0, 0, 0, .17); }
.connection-card { position: relative; overflow: hidden; min-height: 530px; padding: 34px; }
.card-stripe { position: absolute; left: 0; top: 0; width: 100%; height: 7px; background: linear-gradient(90deg, var(--red) 0 28%, #fff 28% 31%, var(--blue) 31% 66%, var(--yellow) 66%); }
.state-header { display: flex; justify-content: space-between; gap: 20px; align-items: start; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.state-header h2, .section-heading h2 { font-size: clamp(29px, 3.2vw, 43px); line-height: .92; }
.state-badge { flex: none; padding: 8px 11px; border: 1px solid var(--line); color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.state-badge.ready { color: var(--yellow); border-color: rgba(255, 212, 92, .7); }
.state-badge.connected { color: var(--green); border-color: rgba(57, 201, 139, .72); }
.state-badge.error { color: #ff8d96; border-color: rgba(225, 45, 57, .8); }
.connection-summary { max-width: 680px; margin: 24px 0; color: #d7e3eb; font-size: 16px; line-height: 1.65; }
.identity-block { display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center; margin: 20px 0; padding: 14px; border: 1px solid var(--line); background: #081725; }
.identity-avatar { width: 48px; height: 48px; display: grid; place-items: center; color: var(--ink); background: var(--yellow); font: 900 25px var(--display); }
.identity-block small, .identity-block strong, .identity-block div > span { display: block; }
.identity-block small { color: var(--blue); font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.identity-block strong { margin: 3px 0; font-size: 13px; }
.identity-block div > span { color: var(--muted); font-size: 11px; }
.text-button, .danger-link { min-height: 44px; border: 0; background: transparent; cursor: pointer; font-size: 11px; font-weight: 800; text-transform: uppercase; }
.text-button { color: var(--muted); }
.signin-area { margin: 22px 0; padding: 22px; border: 1px dashed #476078; background: rgba(7, 21, 33, .8); }
.signin-area > p { max-width: 580px; margin: 0 0 16px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.signin-area .microcopy { margin: 12px 0 0; font-size: 10px; }
.google-button { min-height: 44px; }
.connection-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.seller-email-form { flex: 1 1 100%; display: grid; gap: 9px; padding: 18px; border: 1px solid var(--line); background: rgba(7, 21, 33, .72); }
.seller-email-form[hidden] { display: none; }
.seller-email-form label { color: var(--paper); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.separate-account-label { display: inline-block; margin-left: 8px; padding: 3px 6px; color: var(--ink); background: var(--yellow); font-size: 9px; letter-spacing: .06em; }
.seller-email-form small { color: var(--muted); font-size: 10px; line-height: 1.5; }
.seller-account-row { display: grid; grid-template-columns: 118px minmax(180px, 1fr) auto; gap: 10px; }
.seller-account-row input,
.seller-account-row select { min-width: 0; min-height: 50px; padding: 12px 14px; color: #fff; border: 1px solid #526a80; border-radius: 0; outline: 0; background: #06131f; }
.seller-account-row select { cursor: pointer; font-weight: 800; letter-spacing: .04em; }
.seller-account-row input:focus,
.seller-account-row select:focus { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 210, 75, .16); }
.seller-account-row input::placeholder { color: #718496; }
.button { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 16px; padding: 12px 20px; border: 0; text-decoration: none; font-weight: 800; text-transform: uppercase; }
.button.primary { color: var(--ink); background: var(--yellow); box-shadow: 6px 6px 0 var(--red); }
.button.primary:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--red); }
.button.secondary { color: #fff; border: 1px solid var(--line); background: var(--panel-2); }
.action-detail { margin: 17px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.action-detail strong { color: var(--paper); }
.disconnect-area { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); }
.danger-link { padding: 0; color: #ff8b94; text-decoration: underline; text-underline-offset: 4px; }
.danger-link:disabled { opacity: .45; cursor: not-allowed; }
.disconnect-area p { max-width: 640px; margin: 2px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }

.readiness-card { padding: 28px; }
.section-heading { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.readiness-list { padding: 0; margin: 7px 0 0; list-style: none; }
.readiness-list li { display: grid; grid-template-columns: 20px 1fr auto; gap: 11px; align-items: center; min-height: 57px; padding: 10px 0; border-bottom: 1px solid rgba(41, 65, 87, .68); }
.readiness-list i { width: 15px; height: 15px; border: 2px solid #5f7180; border-radius: 50%; }
.readiness-list li.good i { border-color: var(--green); background: var(--green); box-shadow: inset 0 0 0 3px var(--panel); }
.readiness-list b, .readiness-list small { display: block; }
.readiness-list b { font: 700 16px var(--display); text-transform: uppercase; }
.readiness-list small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.readiness-list em { color: #ff8b94; font-size: 9px; font-style: normal; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.readiness-list li.good em { color: var(--green); }
.readiness-footer { margin: 17px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }

.seller-setup-panel { margin-top: 24px; border: 1px solid var(--line); background: linear-gradient(145deg, rgba(16, 36, 56, .96), rgba(8, 23, 36, .99)); box-shadow: 11px 13px 0 rgba(0, 0, 0, .17); }
.seller-setup-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 27px 30px; border-bottom: 1px solid var(--line); }
.seller-setup-heading h2 { font-size: clamp(32px, 4vw, 52px); line-height: .9; }
.seller-setup-heading > span { padding: 7px 10px; color: var(--green); border: 1px solid var(--green); font-size: 9px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.seller-setup-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr); }
.merchant-location-form, .policy-setup { min-width: 0; padding: 30px; }
.merchant-location-form { border-right: 1px solid var(--line); }
.setup-step { display: grid; grid-template-columns: 45px 1fr; gap: 13px; align-items: start; margin-bottom: 22px; }
.setup-step > b { color: var(--yellow); font: 900 34px/1 var(--display); }
.setup-step strong, .setup-step small { display: block; }
.setup-step strong { font: 800 22px/1 var(--display); text-transform: uppercase; }
.setup-step small { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.field-grid label { display: grid; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.field-grid label.wide { grid-column: 1 / -1; }
.field-grid label small { color: #6f8293; font-size: 8px; }
.field-grid input { width: 100%; min-height: 48px; padding: 12px 13px; color: #fff; border: 1px solid #526a80; border-radius: 0; outline: 0; background: #06131f; }
.field-grid input:focus { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 210, 75, .16); }
.policy-setup > p { color: var(--muted); font-size: 12px; line-height: 1.65; }
.policy-link { width: 100%; margin: 7px 0 18px; }
.policy-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 18px; }
.policy-list span { display: flex; align-items: center; gap: 7px; min-height: 42px; padding: 8px; border: 1px solid var(--line); color: #ff8b94; font: 700 14px var(--display); text-transform: uppercase; }
.policy-list i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.policy-list span.ready { color: var(--green); }
.setup-status { margin: 15px 0 0 !important; padding: 11px 13px; border-left: 4px solid var(--yellow); background: #101e2b; }
.setup-status.success { border-color: var(--green); color: #b8f1d9; }
.setup-status.error { border-color: var(--red); color: #ffabb1; }
.seller-setup-ids { display: grid; grid-template-columns: 1fr; gap: 0; margin: 16px 0 0; border: 1px solid var(--line); background: #06131f; }
.seller-setup-ids > div { display: grid; grid-template-columns: minmax(120px, .8fr) minmax(0, 1.2fr); gap: 12px; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.seller-setup-ids > div:last-child { border-bottom: 0; }
.seller-setup-ids dt { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.seller-setup-ids dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--green); font: 700 11px/1.45 var(--body); text-align: right; user-select: all; }
.seller-setup-ids dd.pending { color: #ff8b94; user-select: none; }
.button:disabled { opacity: .55; cursor: wait; transform: none !important; }

.token-warning { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 24px; align-items: center; margin-top: 24px; padding: 28px; border-color: var(--yellow); background: linear-gradient(100deg, #251f12, #111d25 60%); }
.token-warning[hidden] { display: none; }
.warning-mark { width: 58px; height: 58px; display: grid; place-items: center; color: var(--ink); background: var(--yellow); font: 900 41px/1 var(--display); clip-path: polygon(50% 0, 100% 100%, 0 100%); padding-top: 10px; }
.token-warning h2 { font-size: clamp(29px, 3vw, 42px); }
.token-warning > div > p:last-child { margin: 11px 0 0; color: #c8d3da; font-size: 13px; line-height: 1.65; }
.token-comparison { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); }
.token-comparison > span { min-height: 100px; display: grid; align-content: center; gap: 4px; padding: 15px; background: rgba(7, 17, 29, .75); }
.token-comparison > span + span { border-left: 1px solid var(--line); }
.token-comparison i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.token-comparison i.good { background: var(--green); }
.token-comparison b { font: 700 16px var(--display); text-transform: uppercase; }
.token-comparison small { color: var(--muted); font-size: 9px; }

.troubleshooting { margin-top: 24px; padding: 28px; }
.trouble-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
details { border: 1px solid var(--line); background: #081725; }
summary { min-height: 58px; display: flex; align-items: center; gap: 12px; padding: 14px; cursor: pointer; font: 700 18px var(--display); text-transform: uppercase; }
summary span { color: var(--blue); }
details p { margin: 0; padding: 0 16px 17px 50px; color: var(--muted); font-size: 12px; line-height: 1.65; }
details code { color: var(--yellow); }
footer { display: flex; justify-content: space-between; padding: 25px max(24px, calc((100vw - 1330px) / 2)); border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
footer nav { display: flex; gap: 18px; }

[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

@media (max-width: 980px) {
  .command-bar { flex-wrap: wrap; gap: 8px 15px; padding: 10px 16px; }
  .command-bar nav { order: 3; width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); }
  .command-bar nav a { padding: 10px 4px; text-align: center; }
  .scorebug { margin-left: auto; }
  .shell { padding: 36px 16px 80px; }
  .hero { grid-template-columns: 1fr; }
  .environment-ticket { width: min(420px, 100%); padding: 17px 20px; box-shadow: 7px 7px 0 rgba(0, 0, 0, .16); }
  .environment-ticket strong { font-size: 27px; }
  .connection-grid { grid-template-columns: 1fr; }
  .seller-setup-grid { grid-template-columns: 1fr; }
  .merchant-location-form { border-right: 0; border-bottom: 1px solid var(--line); }
  .token-warning { grid-template-columns: 58px 1fr; }
  .token-comparison { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .command-bar nav { overflow: visible; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .command-bar nav a { min-width: 0; padding: 9px 5px; overflow-wrap: anywhere; }
  .brand { font-size: 13px; }
  .brand-mark { width: 28px; height: 28px; }
  h1 { font-size: clamp(54px, 17vw, 76px); }
  .environment-ticket { width: 100%; border-left-width: 4px; }
  .environment-ticket::after { width: 21px; height: 21px; }
  .handoff-track { grid-template-columns: 1fr; }
  .handoff-track::before { width: 4px; height: var(--progress, 0%); background: linear-gradient(var(--red), var(--yellow), var(--blue)); transition: height .6s cubic-bezier(.2, .8, .2, 1); }
  .handoff-track li { min-height: 72px; border-right: 0; border-bottom: 1px solid var(--line); }
  .handoff-track li:last-child { border-bottom: 0; }
  .connection-card, .readiness-card, .token-warning, .troubleshooting { box-shadow: 6px 7px 0 rgba(0, 0, 0, .18); }
  .connection-card { min-height: 0; padding: 27px 19px 23px; }
  .state-header { display: grid; }
  .state-badge { width: max-content; }
  .identity-block { grid-template-columns: 42px 1fr; }
  .identity-avatar { width: 42px; height: 42px; }
  .identity-block .text-button { grid-column: 1 / -1; width: 100%; border: 1px solid var(--line); }
  .connection-actions, .button { width: 100%; }
  .seller-account-row { grid-template-columns: 1fr; }
  .readiness-card, .troubleshooting { padding: 21px 18px; }
  .seller-setup-heading, .merchant-location-form, .policy-setup { padding: 22px 18px; }
  .seller-setup-heading { align-items: start; }
  .field-grid { grid-template-columns: 1fr; }
  .field-grid label.wide { grid-column: auto; }
  .policy-list { grid-template-columns: 1fr; }
  .seller-setup-ids > div { grid-template-columns: 1fr; gap: 5px; }
  .seller-setup-ids dd { text-align: left; }
  .token-warning { grid-template-columns: 48px 1fr; padding: 20px 17px; }
  .warning-mark { width: 44px; height: 44px; font-size: 31px; }
  .token-comparison { grid-template-columns: 1fr; }
  .token-comparison > span + span { border-left: 0; border-top: 1px solid var(--line); }
  .trouble-grid { grid-template-columns: 1fr; }
  footer { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
