:root {
  --bg: #0d0f12;
  --surface: #171b1f;
  --surface-elevated: #20262b;
  --surface-soft: #111519;
  --border: #303943;
  --text: #f7f7f2;
  --text-muted: #b7bfc8;
  --accent: #29d3b8;
  --accent-strong: #0d9488;
  --gold: #d7b765;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, rgba(13, 15, 18, 0.98), rgba(17, 21, 25, 0.98) 46%, rgba(13, 15, 18, 1)),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea,
select {
  font: inherit;
}

:focus-visible {
  outline: 3px solid rgba(41, 211, 184, 0.55);
  outline-offset: 3px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(13, 15, 18, 0.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(48, 57, 67, 0.86);
}

.nav-shell,
.container {
  width: min(1180px, calc(100vw - 2rem));
  margin: 0 auto;
  min-width: 0;
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(41, 211, 184, 0.24), rgba(215, 183, 101, 0.08));
  border: 1px solid rgba(41, 211, 184, 0.34);
  color: var(--accent);
  font-size: 0.9rem;
}

.brand-logo {
  width: auto;
  height: 34px;
  max-width: 170px;
  object-fit: contain;
  flex: 0 0 auto;
}

.nav-links,
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.nav-links a,
.nav-actions a,
.nav-actions .link-button {
  color: var(--text-muted);
  font-size: 0.95rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.nav-links a:hover,
.nav-actions a:hover,
.nav-actions .link-button:hover {
  color: var(--text);
}

.page {
  padding-bottom: 5rem;
}

.page-section {
  padding: 4.5rem 0;
}

.hero-home {
  min-height: 78vh;
  display: flex;
  align-items: end;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(15, 17, 21, 0.98) 0%, rgba(15, 17, 21, 0.84) 45%, rgba(15, 17, 21, 0.58) 100%),
    linear-gradient(180deg, rgba(15, 17, 21, 0.4), rgba(15, 17, 21, 0.96));
}

.hero-home::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(45, 212, 191, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45, 212, 191, 0.08) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(90deg, transparent, black 35%, black 80%, transparent);
  opacity: 0.42;
}

.hero-home::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 17, 21, 0), rgba(15, 17, 21, 0.96));
  pointer-events: none;
}

.hero-visual-grid {
  position: absolute;
  right: max(2rem, calc((100vw - 1180px) / 2));
  bottom: 5rem;
  z-index: 1;
  width: min(520px, 44vw);
  display: grid;
  gap: 1rem;
}

.hero-visual-grid .visual-panel:nth-child(2) {
  width: 72%;
  justify-self: end;
}

.hero-visual-grid .visual-panel:nth-child(3) {
  width: 84%;
}

.hero-content {
  width: min(920px, 100%);
  padding: 6rem 0 5rem;
  position: relative;
  z-index: 2;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.84rem;
  font-weight: 700;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 1rem;
  line-height: 1.18;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.5rem, 4vw, 4.6rem);
  max-width: 12ch;
}

h2 {
  font-size: clamp(1.7rem, 2vw, 2.4rem);
}

h3 {
  font-size: 1.2rem;
}

p,
li,
dd,
dt,
label,
input,
textarea,
select {
  font-size: 1rem;
}

.lead {
  max-width: 65ch;
  font-size: 1.08rem;
  color: #d8dce3;
}

.muted {
  color: var(--text-muted);
}

.cta-row,
.inline-actions {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  align-items: center;
}

.button,
button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.8rem 1.15rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: 150ms ease;
}

.button:hover,
button:hover,
.button-link:hover {
  border-color: rgba(41, 211, 184, 0.42);
  transform: translateY(-1px);
}

.button-primary {
  background: var(--accent);
  color: #03211e;
  border-color: transparent;
  font-weight: 700;
}

.button-primary:hover {
  background: #48e0ca;
}

.button-block {
  width: 100%;
}

.button-danger {
  border-color: rgba(239, 68, 68, 0.4);
  color: #fecaca;
}

.surface,
.metric,
.table-wrap,
.message,
.timeline-item,
.faq-item,
.content-callout,
.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.surface {
  padding: 1.4rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.026), rgba(255, 255, 255, 0)),
    var(--surface);
}

.surface,
.metric,
.line-item-summary-row,
.timeline-item,
.message {
  min-width: 0;
  overflow-wrap: anywhere;
}

.surface-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  min-width: 0;
}

.grid {
  display: grid;
  gap: 1.2rem;
  min-width: 0;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric {
  padding: 1.2rem;
}

.metric-value {
  font-size: 1.7rem;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.badge-success {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.25);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.25);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.25);
}

.badge-info {
  background: rgba(45, 212, 191, 0.12);
  color: #99f6e4;
  border-color: rgba(45, 212, 191, 0.25);
}

.badge-muted {
  background: rgba(170, 177, 187, 0.08);
  color: var(--text-muted);
  border-color: rgba(170, 177, 187, 0.14);
}

.page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
  margin: 2rem auto 2.2rem;
  min-width: 0;
}

.page-header-actions {
  align-items: flex-end;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.status-row,
.detail-grid,
.payment-grid {
  display: grid;
  gap: 1.2rem;
  min-width: 0;
}

.detail-grid {
  grid-template-columns: minmax(0, 2fr) minmax(320px, 1fr);
}

.payment-grid {
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr);
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.95rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(42, 49, 60, 0.75);
  vertical-align: top;
}

th {
  color: var(--text-muted);
  font-weight: 600;
}

.form-stack {
  display: grid;
  gap: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-field {
  display: grid;
  gap: 0.45rem;
}

.form-field label {
  font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  padding: 0.85rem 0.95rem;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  border-color: rgba(41, 211, 184, 0.58);
  box-shadow: 0 0 0 3px rgba(41, 211, 184, 0.12);
  background: #12181c;
  outline: none;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.quick-create-shell h1 {
  max-width: 14ch;
}

.quick-create-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 1.2rem;
  align-items: start;
}

.quick-create-form {
  display: grid;
  gap: 1.2rem;
}

.quick-basics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.line-builder {
  display: grid;
  gap: 1rem;
}

.line-items-list {
  display: grid;
  gap: 0.85rem;
}

.line-item-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.65fr) minmax(180px, 1.15fr) minmax(120px, 0.55fr) auto;
  gap: 0.85rem;
  align-items: end;
  padding: 1rem;
  border: 1px solid rgba(63, 75, 87, 0.88);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.024), rgba(255, 255, 255, 0)),
    var(--surface-soft);
}

.line-note {
  grid-column: 1 / 4;
}

.line-note textarea {
  min-height: 76px;
}

.line-remove {
  align-self: end;
}

.line-remove:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.quick-create-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(42, 49, 60, 0.8);
}

.line-total {
  display: block;
  font-size: 1.8rem;
  line-height: 1.2;
  color: #fcf7e6;
}

.quick-preview,
.preview-card,
.visual-panel,
.escrow-visual-panel,
.audit-visual {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(22, 26, 32, 0.86);
  box-shadow: var(--shadow);
}

.quick-preview,
.preview-card {
  padding: 1rem;
}

.preview-card,
.visual-panel,
.escrow-visual-panel,
.audit-visual,
.preview-lines,
.line-item-summary {
  display: grid;
  gap: 0.85rem;
}

.preview-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
}

.preview-rail span {
  border-radius: 8px;
  border: 1px solid rgba(170, 177, 187, 0.16);
  padding: 0.55rem 0.45rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.preview-rail .is-active {
  border-color: rgba(45, 212, 191, 0.45);
  color: #99f6e4;
  background: rgba(45, 212, 191, 0.1);
}

.preview-lines div,
.visual-row,
.audit-row,
.line-item-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  border: 1px solid rgba(170, 177, 187, 0.12);
  border-radius: 8px;
  background: rgba(19, 23, 29, 0.72);
  padding: 0.75rem;
}

.preview-lines span,
.visual-step,
.audit-index {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(45, 212, 191, 0.12);
  color: #99f6e4;
  font-weight: 700;
  flex: 0 0 auto;
}

.visual-panel,
.escrow-visual-panel,
.audit-visual {
  padding: 1rem;
  backdrop-filter: blur(10px);
}

.visual-panel-header,
.visual-total-row,
.audit-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.visual-total-row strong {
  font-size: 1.4rem;
}

.visual-status-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
}

.visual-status-rail span {
  height: 8px;
  border-radius: 999px;
  background: rgba(170, 177, 187, 0.16);
}

.visual-status-rail span:nth-child(1),
.visual-status-rail span:nth-child(2) {
  background: var(--accent);
}

.payment-chip,
.release-chip,
.dispute-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-weight: 700;
  font-size: 0.86rem;
}

.payment-chip {
  color: #99f6e4;
  background: rgba(45, 212, 191, 0.12);
  border: 1px solid rgba(45, 212, 191, 0.3);
}

.release-chip {
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.28);
}

.dispute-chip {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.28);
}

.escrow-visual-panel .visual-row,
.line-item-summary-row {
  align-items: start;
}

.audit-visual {
  min-height: 360px;
  align-content: center;
}

.audit-row {
  justify-content: start;
}

.line-item-summary {
  margin: 1rem 0;
}

.line-item-summary-row p {
  margin: 0.35rem 0 0;
}

.payment-action-card {
  border-color: rgba(45, 212, 191, 0.34);
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.13), rgba(22, 26, 32, 0.86) 42%),
    var(--surface);
}

.third-party-shell h1 {
  max-width: 16ch;
}

.third-party-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 1.2rem;
  align-items: start;
}

.third-party-card,
.trust-panel {
  display: grid;
  gap: 1rem;
}

.third-party-card {
  border-color: rgba(41, 211, 184, 0.24);
}

.verification-strip {
  border: 1px solid rgba(41, 211, 184, 0.26);
  border-radius: 8px;
  background: rgba(41, 211, 184, 0.08);
  padding: 1rem;
}

.verification-strip p {
  margin: 0.35rem 0 0;
  color: #d9dde1;
}

.third-party-facts,
.trust-list {
  display: grid;
  gap: 0.85rem;
}

.third-party-facts div,
.confirmation-panel,
.consent-box,
.trust-list div {
  border: 1px solid rgba(183, 191, 200, 0.14);
  border-radius: 8px;
  background: rgba(17, 21, 25, 0.72);
  padding: 0.85rem;
}

.third-party-facts span,
.confirmation-panel span {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.third-party-facts a,
.third-party-contact a {
  color: #9ff5e7;
  overflow-wrap: anywhere;
}

.third-party-contact p {
  margin: 0.25rem 0 0;
}

.consent-box {
  border-color: rgba(215, 183, 101, 0.32);
  background: rgba(215, 183, 101, 0.08);
}

.consent-box p,
.trust-list p {
  margin: 0.35rem 0 0;
  color: #d9dde1;
}

.consent-actions {
  margin-top: 0.25rem;
}

.confirmation-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-color: rgba(34, 197, 94, 0.28);
  background: rgba(34, 197, 94, 0.08);
}

.trust-mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(41, 211, 184, 0.12);
  color: #9ff5e7;
  font-weight: 700;
}

.helptext,
.field-help,
.form-errors {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.errorlist {
  margin: 0;
  padding-left: 1.2rem;
  color: #fda4af;
}

.alert {
  padding: 1rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.22);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.22);
}

.alert-info {
  background: rgba(45, 212, 191, 0.08);
  border-color: rgba(45, 212, 191, 0.22);
}

.flash-list {
  margin: 1.4rem auto 0;
}

.timeline,
.message-list,
.faq-list {
  display: grid;
  gap: 0.9rem;
}

.timeline-item,
.message {
  padding: 1rem 1.1rem;
}

.timeline-meta,
.message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 0.65rem;
  min-width: 0;
}

.timeline-meta strong,
.message-meta strong,
.timeline-meta span,
.message-meta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.message.system {
  background: rgba(28, 33, 41, 0.8);
}

.message.dispute {
  border-color: rgba(245, 158, 11, 0.28);
}

.split-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 2rem;
  align-items: center;
}

.hero-image,
.content-image {
  min-height: 360px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.hero-image img,
.content-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.section-prose {
  width: min(860px, 100%);
}

.section-prose p,
.section-prose li {
  color: #d7dbe1;
}

.section-prose ul {
  padding-left: 1.25rem;
}

.faq-item {
  padding: 1.1rem 1.2rem;
}

.use-case-grid,
.step-grid,
.queue-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.copy-row {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
}

.copy-code {
  flex: 1 1 220px;
  min-width: 0;
  max-width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.78rem 0.95rem;
  word-break: break-all;
}

.progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(170, 177, 187, 0.12);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #5eead4);
}

.qr-box {
  width: 180px;
  height: 180px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: white;
}

.footer {
  border-top: 1px solid rgba(42, 49, 60, 0.82);
  padding: 2.4rem 0 4rem;
  color: var(--text-muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

@media (max-width: 980px) {
  .detail-grid,
  .payment-grid,
  .grid.two,
  .grid.three,
  .grid.four,
  .split-hero,
  .queue-grid,
  .use-case-grid,
  .step-grid,
  .footer-grid,
  .form-grid,
  .quick-create-layout,
  .quick-basics,
  .third-party-layout {
    grid-template-columns: 1fr;
  }

  .line-item-row {
    grid-template-columns: 1fr;
  }

  .line-note {
    grid-column: auto;
  }

  .quick-create-footer,
  .visual-total-row,
  .surface-header,
  .timeline-meta,
  .message-meta,
  .copy-row,
  .confirmation-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .page-header {
    align-items: start;
    flex-direction: column;
  }

  .page-header-actions {
    align-items: stretch;
    width: 100%;
  }

  .container,
  .nav-shell {
    width: min(100% - 1rem, 1180px);
  }

  .page-section {
    padding: 2.5rem 0;
  }

  .surface {
    padding: 1rem;
  }

  .timeline-item,
  .message {
    padding: 0.85rem;
  }

  .copy-code {
    flex-basis: auto;
    width: 100%;
  }

  .copy-row .button,
  .page-header-actions .button {
    width: 100%;
  }

  .hero-home {
    min-height: 68vh;
  }

  .hero-visual-grid {
    width: min(520px, calc(100vw - 2rem));
    right: 1rem;
    bottom: 1.5rem;
    opacity: 0.36;
  }

  h1 {
    max-width: 100%;
  }
}

@media (max-width: 520px) {
  .nav-shell {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links,
  .nav-actions,
  .cta-row,
  .inline-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .nav-links a,
  .nav-actions a,
  .nav-actions form,
  .cta-row .button,
  .inline-actions .button {
    width: 100%;
  }

  .hero-visual-grid {
    display: none;
  }

  h1 {
    font-size: 2.2rem;
  }

  .line-total {
    font-size: 1.45rem;
  }
}
