:root {
  color-scheme: dark;
  --bg: #050607;
  --surface: #090b0d;
  --surface-strong: #0c0f12;
  --ink: #f1f0eb;
  --muted: #9ba3a4;
  --quiet: #7b8587;
  --line: rgba(241, 240, 235, 0.14);
  --line-strong: rgba(241, 240, 235, 0.32);
  --teal: #4bd9cc;
  --teal-soft: rgba(75, 217, 204, 0.12);
  --copper: #f0a45b;
  --danger: #ff786f;
  --font-ui: "SF Pro Text", "Aptos", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "SF Pro Display", "Aptos Display", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", ui-monospace, Menlo, Consolas, monospace;
  --page-pad: 38px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: var(--font-ui);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.014) 1px, transparent 1px) 0 0 / 100% 72px,
    var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

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

svg {
  display: block;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  transform: translateY(-160%);
  border: 1px solid var(--teal);
  border-radius: 2px;
  padding: 10px 14px;
  background: var(--bg);
  color: var(--ink);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.zenpay-header {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr);
  min-height: 64px;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--line);
  padding: 0 var(--page-pad);
  background: rgba(5, 6, 7, 0.95);
}

.zenpay-brand {
  display: inline-flex;
  width: fit-content;
  min-height: 44px;
  align-items: center;
  gap: 20px;
}

.zenpay-brand span {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 520;
}

.zenpay-brand strong {
  font-size: 15px;
  font-weight: 650;
}

.zenpay-header nav {
  display: flex;
  align-items: center;
  gap: 38px;
  color: var(--muted);
  font-size: 13px;
}

.zenpay-header nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease, color 160ms ease;
}

.zenpay-header nav a:hover,
.zenpay-header nav a:focus-visible,
.zenpay-header nav a[aria-current="page"] {
  border-bottom-color: var(--teal);
  color: var(--teal);
}

.header-status {
  display: inline-flex;
  justify-self: end;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
}

.header-status i,
.network-health i,
.live-line i,
.payment-status i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(75, 217, 204, 0.08);
}

.zenpay-main,
.zenpay-footer {
  width: min(100%, 1600px);
  margin: 0 auto;
}

.zenpay-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(560px, 1.02fr);
  min-height: 760px;
  border-bottom: 1px solid var(--line);
}

.zenpay-intro,
.zenpay-console {
  min-width: 0;
  padding: 34px var(--page-pad) 28px;
}

.zenpay-intro {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
}

.intro-copy {
  padding: 8px 0 28px;
}

.intro-copy h1 {
  max-width: 690px;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 92px;
  font-weight: 780;
  letter-spacing: 0;
  line-height: 0.82;
  text-wrap: balance;
}

.intro-copy h1 span {
  display: block;
}

.intro-copy p {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.network-readout {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}

.network-readout article {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 7px;
  align-content: start;
  padding: 0 18px;
  border-right: 1px solid var(--line);
}

.network-readout article:first-child {
  padding-left: 0;
}

.network-readout article:last-child {
  border-right: 0;
  padding-right: 0;
}

.network-readout article > span,
.section-label-row,
.console-title-row,
.payment-panel-header,
.recent-heading > div > span,
.zenpay-bottom span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.network-readout strong {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 520;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.network-readout small {
  overflow: hidden;
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.network-health {
  display: flex;
  align-items: center;
  gap: 8px;
}

.network-health b {
  overflow: hidden;
  font-weight: 520;
  text-overflow: ellipsis;
}

.network-readout .icon-button {
  position: absolute;
  right: 0;
  bottom: -4px;
}

.icon-button {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--quiet);
  cursor: pointer;
}

.icon-button:hover {
  color: var(--teal);
}

.icon-button svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.block-ribbon-section {
  display: grid;
  gap: 14px;
  margin-top: auto;
  padding-top: 38px;
}

.section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.section-label-row small {
  color: var(--quiet);
  font-size: 9px;
}

.block-ribbon-shell {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.block-ribbon-shell::before,
.block-ribbon-shell::after {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  width: 46px;
  content: "";
  pointer-events: none;
}

.block-ribbon-shell::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg), transparent);
}

.block-ribbon-shell::after {
  right: 0;
  background: linear-gradient(-90deg, var(--bg), transparent);
}

.block-ribbon {
  display: grid;
  grid-auto-columns: minmax(108px, 1fr);
  grid-auto-flow: column;
  min-height: 112px;
  transform: translate3d(-5px, 0, 0);
  animation: ribbon-drift 10s var(--ease) infinite alternate;
  will-change: transform;
}

.block-card,
.block-skeleton {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 8px;
  align-content: center;
  border-right: 1px solid var(--line);
  padding: 14px;
  background: rgba(255, 255, 255, 0.012);
}

.block-card.is-latest {
  background: linear-gradient(180deg, rgba(75, 217, 204, 0.1), rgba(75, 217, 204, 0.02));
  box-shadow: inset 0 1px 0 var(--teal), inset 0 -1px 0 var(--teal);
}

.block-card strong {
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 520;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.block-card small,
.block-card code {
  overflow: hidden;
  color: var(--quiet);
  font-family: var(--font-mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.block-card.is-latest small {
  color: var(--teal);
}

.block-skeleton::before,
.block-skeleton::after {
  width: 72%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  content: "";
}

.block-skeleton::after {
  width: 48%;
}

.live-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
}

.privacy-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  color: var(--quiet);
}

.privacy-line svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  margin-top: 2px;
  fill: none;
  stroke: var(--teal);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.privacy-line p {
  max-width: 560px;
  margin: 0;
  font-size: 11px;
  line-height: 1.55;
}

.zenpay-console {
  display: grid;
  gap: 18px;
  align-content: start;
  background: rgba(255, 255, 255, 0.006);
}

.invoice-form {
  display: grid;
}

.console-title-row {
  display: flex;
  min-height: 38px;
  align-items: start;
  justify-content: space-between;
}

.text-button {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--quiet);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
}

.text-button:hover {
  color: var(--teal);
}

.form-row {
  display: grid;
  grid-template-columns: 158px minmax(0, 1fr);
  min-height: 52px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.form-row:last-of-type {
  border-bottom: 1px solid var(--line);
}

.form-row > span,
.form-row > label {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-right: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
}

.form-row > span small {
  margin-left: 7px;
  color: var(--quiet);
  font-size: 9px;
}

.form-row input,
.form-row textarea {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 0 14px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  outline: 0;
}

.form-row textarea {
  min-height: 70px;
  resize: vertical;
  padding-top: 16px;
  line-height: 1.45;
}

.form-row input::placeholder,
.form-row textarea::placeholder {
  color: #576064;
}

.form-row:focus-within {
  border-top-color: var(--teal);
  box-shadow: inset 0 1px 0 rgba(75, 217, 204, 0.22);
}

.amount-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 136px;
}

.unit-switch {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-left: 1px solid var(--line);
}

.unit-switch label {
  position: relative;
  cursor: pointer;
}

.unit-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.unit-switch span {
  display: grid;
  min-height: 51px;
  place-items: center;
  color: var(--quiet);
  font-family: var(--font-mono);
  font-size: 11px;
}

.unit-switch label + label span {
  border-left: 1px solid var(--line);
}

.unit-switch input:checked + span {
  background: var(--teal-soft);
  box-shadow: inset 0 0 0 1px var(--teal);
  color: var(--teal);
}

.unit-switch input:focus-visible + span {
  outline: 2px solid var(--teal);
  outline-offset: -3px;
}

.address-row > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.address-status {
  margin-right: 12px;
  color: var(--quiet);
  font-family: var(--font-mono);
  font-size: 9px;
  white-space: nowrap;
}

.address-status[data-state="checking"] {
  color: var(--muted);
}

.address-status[data-state="valid"] {
  color: var(--teal);
}

.address-status[data-state="invalid"] {
  color: var(--danger);
}

.fresh-address-note {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-left: 170px;
  color: var(--copper);
  font-family: var(--font-mono);
  font-size: 10px;
}

.fresh-address-note svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.form-error {
  min-height: 18px;
  margin: 8px 0 0 170px;
  color: var(--danger);
  font-family: var(--font-mono);
  font-size: 10px;
}

.create-button {
  display: inline-flex;
  width: 220px;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  border: 1px solid rgba(75, 217, 204, 0.54);
  border-radius: 2px;
  padding: 0 18px;
  background: #177d76;
  color: #f8fffe;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  transition: background 160ms ease, transform 160ms ease;
}

.create-button:hover {
  background: #1b9288;
  transform: translateY(-1px);
}

.create-button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.create-button svg,
.zenpay-bottom a svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.payment-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--surface);
}

.payment-panel::before,
.payment-panel::after {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--ink);
  content: "";
  pointer-events: none;
}

.payment-panel::before {
  top: -1px;
  left: -1px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.payment-panel::after {
  right: -1px;
  bottom: -1px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.scan-line {
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  left: -20%;
  width: 1px;
  background: var(--teal);
  box-shadow: 0 0 14px 2px rgba(75, 217, 204, 0.35);
  opacity: 0;
  pointer-events: none;
}

.payment-panel.is-monitoring .scan-line {
  opacity: 0.65;
  animation: panel-scan 4.8s linear infinite;
}

.payment-panel-header {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 0 16px;
  color: var(--teal);
}

.payment-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
}

.payment-status i {
  background: var(--quiet);
  box-shadow: none;
}

.payment-status[data-state="waiting"] {
  color: var(--copper);
}

.payment-status[data-state="partial"] {
  color: var(--copper);
}

.payment-status[data-state="partial"] i {
  background: var(--copper);
}

.payment-status[data-state="waiting"] i {
  background: var(--copper);
  animation: status-pulse 1.8s ease-in-out infinite;
}

.payment-status[data-state="detected"] {
  color: var(--teal);
}

.payment-status[data-state="detected"] i,
.payment-status[data-state="settled"] i {
  background: var(--teal);
}

.payment-status[data-state="settled"] {
  color: var(--teal);
}

.payment-status[data-state="expired"] {
  color: var(--danger);
}

.payment-status[data-state="expired"] i {
  background: var(--danger);
}

.payment-panel-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 234px;
  min-height: 250px;
}

.payment-details {
  min-width: 0;
  padding: 18px;
}

.payment-amount {
  display: grid;
  gap: 5px;
}

.payment-amount span,
.payment-details dt {
  color: var(--quiet);
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
}

.payment-amount strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 23px;
  font-weight: 520;
  line-height: 1.2;
}

.payment-amount b {
  color: var(--copper);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 520;
}

.payment-amount small {
  color: var(--quiet);
  font-family: var(--font-mono);
  font-size: 9px;
}

.payment-details dl {
  display: grid;
  gap: 13px;
  margin: 24px 0 0;
}

.payment-details dl div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.payment-details dd {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-shell {
  display: grid;
  min-width: 0;
  place-items: center;
  align-content: center;
  gap: 8px;
  border-left: 1px solid var(--line);
  padding: 16px;
  background: #07090a;
}

.qr-shell svg {
  width: min(100%, 196px);
  height: auto;
  background: #fff;
  shape-rendering: crispEdges;
}

.qr-shell small {
  color: var(--quiet);
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
}

.qr-ready-mark {
  display: grid;
  width: 160px;
  height: 160px;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 24px;
  border: 1px solid var(--line);
}

.qr-ready-mark span,
.qr-ready-mark b {
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.07);
}

.qr-ready-mark b {
  background: var(--teal-soft);
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 520;
}

.payment-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 10px 14px;
}

.action-button {
  display: inline-flex;
  min-width: 0;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
}

.action-button:hover:not(:disabled):not(.is-disabled) {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.action-button:disabled,
.action-button.is-disabled {
  cursor: not-allowed;
  color: var(--quiet);
  opacity: 0.48;
}

.action-button svg,
.export-button svg,
.dialog-actions svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.4;
}

.settlement-note {
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 10px 14px;
  color: var(--quiet);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.5;
}

.recent-section {
  padding: 22px var(--page-pad) 26px;
  border-bottom: 1px solid var(--line);
}

.recent-heading {
  display: flex;
  min-height: 52px;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
}

.recent-heading h2 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 620;
}

.export-button {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0 12px;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
}

.export-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.invoice-list {
  border-top: 1px solid var(--line);
}

.invoice-row {
  display: grid;
  grid-template-columns: 120px minmax(180px, 1.4fr) minmax(150px, 0.9fr) minmax(150px, 0.85fr) minmax(140px, 0.85fr) 38px;
  min-height: 54px;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.invoice-row > span,
.invoice-row > strong,
.invoice-row > time {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-row strong {
  color: var(--ink);
  font-weight: 520;
}

.invoice-row-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--copper);
  text-transform: capitalize;
}

.invoice-row-status i {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}

.invoice-row-status[data-state="settled"],
.invoice-row-status[data-state="detected"] {
  color: var(--teal);
}

.invoice-row-status[data-state="expired"] {
  color: var(--danger);
}

.invoice-row button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--quiet);
  cursor: pointer;
}

.invoice-row button:hover {
  color: var(--teal);
}

.invoice-row button svg {
  width: 16px;
  height: 16px;
}

.empty-list {
  display: flex;
  min-height: 72px;
  align-items: center;
  margin: 0;
  color: var(--quiet);
  font-family: var(--font-mono);
  font-size: 10px;
}

.zenpay-bottom {
  display: grid;
  grid-template-columns: repeat(3, 1fr) minmax(250px, 1.15fr);
  border-bottom: 1px solid var(--line);
}

.zenpay-bottom > div,
.zenpay-bottom > a {
  display: grid;
  min-height: 120px;
  align-content: center;
  gap: 8px;
  border-right: 1px solid var(--line);
  padding: 20px var(--page-pad);
}

.zenpay-bottom > div p {
  max-width: 260px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.zenpay-bottom > a {
  position: relative;
  border-right: 0;
  background: var(--teal-soft);
  transition: background 180ms ease;
}

.zenpay-bottom > a:hover {
  background: rgba(75, 217, 204, 0.17);
}

.zenpay-bottom > a strong {
  color: var(--teal);
  font-size: 16px;
  font-weight: 650;
}

.zenpay-bottom > a svg {
  position: absolute;
  right: 24px;
  bottom: 24px;
}

.zenpay-footer {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 var(--page-pad);
  color: var(--quiet);
  font-family: var(--font-mono);
  font-size: 10px;
}

.zenpay-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.zenpay-footer a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
}

.zenpay-footer a:hover {
  color: var(--teal);
}

.toast {
  position: fixed;
  z-index: 80;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 40px));
  transform: translateY(18px);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  padding: 12px 14px;
  background: #0d1113;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.invoice-dialog {
  width: min(620px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  padding: 0;
  background: var(--surface-strong);
  color: var(--ink);
}

.invoice-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.dialog-shell {
  display: grid;
}

.dialog-shell header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  padding: 20px;
}

.dialog-shell header span {
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
}

.dialog-shell h2 {
  margin: 5px 0 0;
  font-size: 24px;
  font-weight: 620;
}

.dialog-close {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
}

.dialog-shell > dl {
  display: grid;
  margin: 0;
  padding: 8px 20px;
}

.dialog-shell > dl div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.dialog-shell dt {
  color: var(--quiet);
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
}

.dialog-shell dd {
  overflow-wrap: anywhere;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.5;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 20px 20px;
}

.dialog-actions button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0 12px;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 10px;
}

.dialog-actions .danger-button {
  margin-left: auto;
  color: var(--danger);
}

@keyframes ribbon-drift {
  from { transform: translate3d(-5px, 0, 0); }
  to { transform: translate3d(5px, 0, 0); }
}

@keyframes panel-scan {
  0% { left: -10%; }
  70%, 100% { left: 110%; }
}

@keyframes status-pulse {
  0%, 100% { opacity: 0.48; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}

@media (max-width: 1180px) {
  :root {
    --page-pad: 26px;
  }

  .zenpay-workbench {
    grid-template-columns: minmax(0, 0.9fr) minmax(520px, 1.1fr);
  }

  .intro-copy h1 {
    font-size: 70px;
  }

  .network-readout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 20px;
  }

  .network-readout article:nth-child(2) {
    border-right: 0;
  }

  .network-readout article:nth-child(3) {
    padding-left: 0;
  }

  .zenpay-bottom {
    grid-template-columns: repeat(2, 1fr);
  }

  .zenpay-bottom > div:nth-child(2) {
    border-right: 0;
  }

  .zenpay-bottom > div,
  .zenpay-bottom > a {
    border-bottom: 1px solid var(--line);
  }

  .zenpay-bottom > a {
    border-bottom: 0;
  }
}

@media (max-width: 960px) {
  .zenpay-header {
    grid-template-columns: 1fr auto;
  }

  .zenpay-header nav {
    order: 3;
    grid-column: 1 / -1;
    justify-content: space-between;
    gap: 14px;
    border-top: 1px solid var(--line);
  }

  .zenpay-header {
    padding-top: 8px;
  }

  .zenpay-workbench {
    grid-template-columns: 1fr;
  }

  .zenpay-intro {
    min-height: 680px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .intro-copy h1 {
    max-width: 760px;
    font-size: 88px;
  }

  .block-ribbon-section {
    margin-top: 36px;
  }

  .invoice-row {
    grid-template-columns: 110px minmax(170px, 1fr) minmax(140px, 0.8fr) minmax(130px, 0.8fr) 38px;
  }

  .invoice-row > span:nth-of-type(3) {
    display: none;
  }
}

@media (max-width: 680px) {
  :root {
    --page-pad: 18px;
  }

  body {
    background: var(--bg);
  }

  .zenpay-header {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 4px;
  }

  .zenpay-brand {
    min-height: 54px;
  }

  .header-status {
    display: none;
  }

  .zenpay-header nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
  }

  .zenpay-header nav a {
    justify-content: center;
    font-size: 11px;
  }

  .zenpay-intro,
  .zenpay-console {
    padding-top: 24px;
  }

  .zenpay-intro {
    min-height: auto;
  }

  .intro-copy h1 {
    font-size: 54px;
    line-height: 0.86;
  }

  .intro-copy p {
    font-size: 14px;
  }

  .network-readout strong {
    font-size: 16px;
  }

  .block-ribbon-section {
    margin-top: 24px;
    padding-top: 24px;
  }

  .privacy-line {
    margin-bottom: 4px;
  }

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

  .form-row > span,
  .form-row > label {
    min-height: 36px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0;
  }

  .form-row input {
    min-height: 50px;
    padding-left: 0;
  }

  .form-row textarea {
    padding-left: 0;
  }

  .amount-control {
    grid-template-columns: minmax(0, 1fr) 128px;
  }

  .unit-switch span {
    min-height: 49px;
  }

  .address-row > div {
    grid-template-columns: 1fr;
  }

  .address-status {
    min-height: 24px;
    margin: 0;
  }

  .fresh-address-note {
    padding: 8px 0;
    line-height: 1.4;
  }

  .form-error {
    margin-left: 0;
  }

  .create-button {
    width: 100%;
  }

  .payment-panel-body {
    grid-template-columns: 1fr;
  }

  .qr-shell {
    min-height: 230px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .qr-shell svg {
    width: 190px;
  }

  .payment-actions {
    grid-template-columns: 1fr;
  }

  .action-button {
    min-height: 46px;
  }

  .recent-heading {
    align-items: center;
  }

  .invoice-list {
    display: grid;
    gap: 10px;
    border-top: 0;
  }

  .invoice-row {
    grid-template-columns: 1fr auto;
    gap: 7px 14px;
    border: 1px solid var(--line);
    padding: 12px;
  }

  .invoice-row > * {
    grid-column: 1;
  }

  .invoice-row > button {
    grid-row: 1 / 3;
    grid-column: 2;
  }

  .invoice-row > span:nth-of-type(2) {
    display: none;
  }

  .zenpay-bottom {
    grid-template-columns: 1fr;
  }

  .zenpay-bottom > div,
  .zenpay-bottom > a {
    min-height: 104px;
    border-right: 0;
  }

  .zenpay-footer {
    display: grid;
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .zenpay-footer nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 24px;
  }

  .dialog-shell > dl div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .dialog-actions {
    display: grid;
  }

  .dialog-actions .danger-button {
    margin-left: 0;
  }
}

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

  .block-ribbon {
    transform: none;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .zenpay-header,
  .zenpay-intro,
  .invoice-form,
  .recent-section,
  .zenpay-bottom,
  .zenpay-footer,
  .payment-actions,
  .toast {
    display: none !important;
  }

  .zenpay-workbench {
    display: block;
    min-height: 0;
  }

  .zenpay-console {
    display: block;
    padding: 0;
    background: #fff;
  }

  .payment-panel {
    border-color: #000;
    background: #fff;
    color: #000;
  }

  .payment-panel * {
    color: #000 !important;
  }
}
