.payment-page {
  min-height: 100vh;
  background: #f2f4f6;
}

.payment-closed {
  display: grid;
  min-height: 100vh;
  padding: calc(var(--topbar-height) + 32px) 20px 40px;
  place-items: center;
}

.payment-closed__panel {
  width: min(620px, 100%);
  padding: 38px;
  border: 1px solid #d8dde1;
  border-top: 4px solid #d59a15;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(26, 37, 46, 0.1);
}

.payment-closed__icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 20px;
  border-radius: 8px;
  place-items: center;
  background: #fff1ca;
  color: #8a5b00;
}

.payment-closed__icon svg {
  width: 28px;
  height: 28px;
}

.payment-closed h1 {
  margin: 8px 0 12px;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.1;
}

.payment-closed p {
  margin: 0;
  color: #59656e;
  line-height: 1.65;
}

.payment-closed__status {
  display: grid;
  margin-top: 24px;
  padding: 14px;
  border: 1px solid #b9ddce;
  border-radius: 6px;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 12px;
  background: #e9f6f0;
  color: #145c45;
}

.payment-closed__status svg {
  width: 22px;
}

.payment-closed__status span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.payment-closed__status small {
  color: #4b7666;
}

.payment-closed__actions {
  display: flex;
  margin-top: 24px;
  flex-wrap: wrap;
  gap: 10px;
}

.payment-closed__actions a {
  text-decoration: none;
}

.payment-closed__actions .payment-action,
.payment-closed__actions .secondary-action {
  display: inline-flex;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.payment-closed__actions .secondary-action {
  border: 1px solid #cfd6db;
  background: #fff;
  color: #26323b;
}

.payment-closed__actions svg {
  width: 18px;
}

.payment-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: calc(var(--topbar-height) + 24px) 0 72px;
}

.breadcrumb {
  display: flex;
  min-height: 30px;
  margin-bottom: 20px;
  align-items: center;
  gap: 7px;
  color: #7b858f;
  font-size: 0.8rem;
}

.breadcrumb a {
  color: #216776;
  font-weight: 700;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb svg {
  width: 15px;
}

.payment-title {
  display: flex;
  margin-bottom: 24px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.payment-title h1 {
  margin-bottom: 7px;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
}

.payment-title p {
  margin: 0;
  color: var(--muted);
}

.secure-mark {
  display: flex;
  min-width: 220px;
  padding: 10px 13px;
  border-left: 3px solid var(--green);
  align-items: center;
  gap: 10px;
  background: var(--green-soft);
  color: #225d49;
}

.secure-mark > svg {
  width: 25px;
  flex: 0 0 25px;
}

.secure-mark span {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.secure-mark small {
  margin-top: 2px;
  color: #5e7d71;
  font-size: 0.72rem;
}

.test-banner {
  display: grid;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #e6c66a;
  border-radius: 6px;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  background: #fff4cb;
  color: #6b5521;
}

.test-banner > svg {
  width: 24px;
  color: #a16b00;
}

.test-banner p {
  margin: 2px 0 0;
  font-size: 0.84rem;
}

.test-banner > span {
  padding: 4px 8px;
  border: 1px solid #c89521;
  border-radius: 4px;
  color: #895e00;
  font: 800 0.68rem Consolas, monospace;
}

.checkout-progress {
  display: grid;
  margin: 0 0 18px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--surface);
  list-style: none;
}

.checkout-progress li {
  position: relative;
  display: flex;
  min-height: 66px;
  padding: 11px 16px;
  border-right: 1px solid var(--line);
  align-items: center;
  gap: 10px;
  color: #7d8790;
}

.checkout-progress li:last-child {
  border-right: 0;
}

.checkout-progress li.is-current {
  box-shadow: inset 0 -3px var(--cyan);
  color: var(--ink);
}

.checkout-progress li > span,
.block-number {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  place-items: center;
  background: #e8edf0;
  color: #63707a;
  font-size: 0.75rem;
  font-weight: 800;
}

.checkout-progress li.is-current > span {
  background: var(--cyan);
  color: #fff;
}

.checkout-progress li div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.25;
}

.checkout-progress small {
  margin-top: 3px;
  font-size: 0.72rem;
}

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  gap: 18px;
}

.checkout-main {
  display: grid;
  gap: 18px;
}

.checkout-block,
.order-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(24, 34, 43, 0.04);
}

.checkout-block {
  padding: 24px;
}

.checkout-block__heading {
  display: flex;
  margin-bottom: 20px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.checkout-block__heading > div {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.checkout-block__heading h2 {
  margin: 0 0 3px;
  font-size: 1.15rem;
}

.checkout-block__heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.block-number {
  margin-top: -3px;
  background: var(--charcoal);
  color: #fff;
}

.asset-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.asset-option {
  display: grid;
  min-height: 82px;
  padding: 13px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  grid-template-columns: 46px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 11px;
  background: #fafbfc;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.asset-option:hover {
  border-color: #91a3ad;
  background: #f4f7f8;
}

.asset-option.is-active {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 167, 196, 0.1);
  background: #f3fcfd;
}

.asset-option > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.asset-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.75rem;
}

.asset-option > svg {
  width: 21px;
  color: #9aa4ac;
}

.asset-option.is-active > svg {
  color: var(--cyan);
}

.asset-option:disabled {
  cursor: default;
  opacity: 0.72;
}

.asset-logo {
  display: grid;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  place-items: center;
  color: #fff;
  font-size: 1.35rem;
  font-weight: 900;
}

.asset-logo--usdt {
  background: #178f6e;
}

.asset-logo--ltc {
  background: #486a99;
}

.invoice-state {
  display: inline-flex;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  align-items: center;
  gap: 5px;
  background: #eef2f4;
  color: #68737c;
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.invoice-state svg {
  width: 14px;
}

.invoice-state--demo {
  border-color: #e4c467;
  background: #fff3c6;
  color: #8b6204;
}

.invoice-state--waiting,
.invoice-state--created,
.invoice-state--detected,
.invoice-state--confirming {
  border-color: #b9d5df;
  background: #eaf7fa;
  color: #17687a;
}

.invoice-state--paid {
  border-color: #9fd1bc;
  background: #e4f5ed;
  color: #176147;
}

.invoice-state--expired,
.invoice-state--cancelled,
.invoice-state--review {
  border-color: #e2b8bc;
  background: #fff0f1;
  color: #8a3e47;
}

.transfer-box {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 20px;
}

.qr-placeholder {
  display: flex;
  width: 180px;
  height: 180px;
  border: 1px dashed #aab5bd;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: #f4f7f8;
  color: #6d7881;
  text-align: center;
}

.qr-placeholder > span {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.qr-placeholder img {
  display: block;
  width: 164px;
  height: 164px;
  object-fit: contain;
  image-rendering: pixelated;
}

.qr-placeholder svg {
  width: 33px;
  height: 33px;
  margin-bottom: 9px;
}

.qr-placeholder small {
  margin-top: 2px;
  font-size: 0.7rem;
}

.transfer-details label {
  display: block;
  margin: 0 0 6px;
  color: #77828b;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.readonly-field,
.amount-field {
  display: flex;
  min-height: 48px;
  margin-bottom: 15px;
  padding: 6px 7px 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  align-items: center;
  gap: 8px;
  background: #f7f9fa;
}

.readonly-field code {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #6f7a83;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.readonly-field .icon-button,
.amount-field .icon-button {
  margin-left: auto;
  flex: 0 0 36px;
  color: #49616a;
}

.readonly-field .icon-button:hover,
.amount-field .icon-button:hover {
  background: #e6edef;
}

.readonly-field .icon-button:disabled,
.amount-field .icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}

.amount-field strong {
  font: 800 1.15rem Consolas, "Cascadia Mono", monospace;
}

.amount-field > span {
  color: #5f6b74;
  font-weight: 800;
}

.network-hint {
  display: flex;
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--red);
  align-items: flex-start;
  gap: 9px;
  background: var(--red-soft);
  color: #75494d;
  font-size: 0.8rem;
}

.network-hint svg {
  width: 17px;
  flex: 0 0 17px;
  color: var(--red);
}

.checkout-block--status {
  border-left: 4px solid var(--cyan);
}

.payment-status {
  display: flex;
  margin-bottom: 16px;
  align-items: center;
  gap: 13px;
}

.payment-status p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.status-orbit {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 50%;
  place-items: center;
  background: var(--cyan-soft);
  color: #08798e;
}

.status-orbit svg {
  width: 23px;
}

.payment-action,
.demo-button {
  display: inline-flex;
  min-height: 44px;
  padding: 9px 15px;
  border: 0;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--charcoal);
  color: #fff;
  font-weight: 800;
}

.payment-action {
  width: 100%;
}

.payment-action:disabled {
  cursor: not-allowed;
  background: #c6cdd2;
  color: #717b83;
}

.payment-timer {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--muted);
  font: 700 0.78rem Consolas, "Cascadia Mono", monospace;
  text-align: center;
}

.payment-action svg,
.demo-button svg {
  width: 18px;
}

.order-summary {
  position: sticky;
  top: calc(var(--topbar-height) + 18px);
  overflow: hidden;
}

.order-summary__head {
  display: flex;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  align-items: center;
  gap: 12px;
  background: #f8fafb;
}

.order-summary__head .eyebrow {
  margin-bottom: 3px;
}

.order-summary__head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.summary-list {
  margin: 0;
  padding: 8px 20px;
}

.summary-list > div {
  display: flex;
  min-height: 49px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.summary-list dt {
  color: var(--muted);
  font-size: 0.78rem;
}

.summary-list dd {
  margin: 0;
  color: #3e4850;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: right;
}

.summary-list__total {
  min-height: 72px !important;
  border-bottom: 0 !important;
}

.summary-list__total dd strong {
  color: var(--ink);
  font: 800 1.14rem Consolas, monospace;
}

.demo-button {
  width: calc(100% - 40px);
  margin: 4px 20px 0;
  cursor: pointer;
  background: #31515a;
}

.demo-button:hover {
  background: #223f47;
}

.demo-note {
  margin: 8px 20px 18px;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

.safety-list {
  padding: 17px 20px 20px;
  border-top: 1px solid var(--line);
  background: #edf7f3;
}

.safety-list h3 {
  display: flex;
  margin-bottom: 10px;
  align-items: center;
  gap: 7px;
  color: #235b48;
  font-size: 0.9rem;
}

.safety-list h3 svg {
  width: 18px;
}

.safety-list ul {
  margin: 0;
  padding-left: 18px;
  color: #4f6d62;
  font-size: 0.78rem;
}

.safety-list li + li {
  margin-top: 6px;
}

.integration-note {
  display: grid;
  margin-top: 18px;
  padding: 20px;
  border: 1px solid #c9d2d9;
  border-radius: 6px;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  background: #e9eef2;
  color: #42515c;
}

.integration-note > svg {
  width: 26px;
  color: var(--violet);
}

.integration-note p {
  margin: 3px 0 0;
  color: #64717b;
  font-size: 0.84rem;
}

.noscript-message {
  position: fixed;
  z-index: 300;
  right: 12px;
  bottom: 12px;
  left: 12px;
  padding: 12px;
  background: var(--red);
  color: #fff;
  text-align: center;
}

@media (max-width: 940px) {
  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .order-summary {
    position: static;
    order: -1;
  }

  .order-summary__head,
  .summary-list,
  .safety-list {
    padding-inline: 18px;
  }

  .demo-button {
    width: calc(100% - 36px);
    margin-inline: 18px;
  }
}

@media (max-width: 680px) {
  .payment-closed {
    padding: calc(var(--topbar-height) + 20px) 12px 24px;
  }

  .payment-closed__panel {
    padding: 24px 20px;
  }

  .payment-closed__actions {
    flex-direction: column;
  }

  .payment-closed__actions a {
    width: 100%;
  }

  .payment-shell {
    width: calc(100% - 20px);
    padding-top: calc(var(--topbar-height) + 16px);
  }

  .breadcrumb {
    margin-bottom: 12px;
  }

  .payment-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .payment-title h1 {
    font-size: 1.9rem;
  }

  .secure-mark {
    width: 100%;
  }

  .test-banner {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .test-banner > span {
    grid-column: 2;
    width: max-content;
  }

  .checkout-progress li {
    min-height: 54px;
    padding: 8px;
    justify-content: center;
  }

  .checkout-progress li > div {
    display: none;
  }

  .checkout-block {
    padding: 18px;
  }

  .checkout-block__heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .asset-selector {
    grid-template-columns: 1fr;
  }

  .asset-option {
    min-height: 74px;
  }

  .transfer-box {
    grid-template-columns: 1fr;
  }

  .qr-placeholder {
    width: 150px;
    height: 150px;
    justify-self: center;
  }
}

@media (max-width: 430px) {
  .payment-page .topbar__actions .text-button span {
    display: none;
  }

  .payment-page .topbar__actions .text-button {
    width: 38px;
    padding: 0;
    justify-content: center;
  }

  .readonly-field code {
    max-width: 235px;
  }
}
[hidden] {
  display: none !important;
}
