:root {
  --page-bg: #63b4f6;
  --surface: #ffffff;
  --surface-soft: #f4f9ff;
  --surface-tint: #eef7ff;
  --border: rgba(71, 125, 185, 0.18);
  --border-strong: rgba(74, 142, 224, 0.3);
  --text: #203a5d;
  --muted: #567193;
  --accent: #3f82f5;
  --accent-hover: #2f72e3;
  --accent-soft: rgba(63, 130, 245, 0.1);
  --brand-dark: #334e6e;
  --warning-bg: #fff9ec;
  --warning-border: rgba(231, 183, 82, 0.34);
  --danger: #dc3545;
  --success: #28a745;
  --shadow: 0 18px 44px rgba(29, 87, 149, 0.08);
  --radius-xl: 20px;
  --radius-lg: 15px;
  --radius-md: 12px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.3), transparent 24%),
    linear-gradient(180deg, #73bcf8 0%, #5aa8ef 320px, #f3f8ff 320px, #f8fbff 100%),
    var(--page-bg);
}

button,
input {
  font: inherit;
}

button,
a {
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

.shell {
  min-height: 100vh;
  padding: 28px 16px 52px;
}

.panel {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0;
}

.hero-panel {
  margin-bottom: 0;
  padding: 12px 4px 60px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.brand-column {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--brand-dark);
  box-shadow: 0 12px 24px rgba(51, 78, 110, 0.15);
}

.brand-logo {
  display: block;
  width: auto;
  height: 18px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(238, 246, 255, 0.82);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.back-link::before {
  content: "←";
  color: rgba(255, 255, 255, 0.92);
}

.back-link:hover,
.back-link:focus-visible {
  color: #ffffff;
  text-decoration: none;
}

.topbar-meta,
.rule-row,
.empty-steps,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge,
.pill,
.rule-chip,
.empty-step {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.badge {
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(122, 164, 215, 0.22);
  color: var(--text);
  box-shadow: 0 8px 20px rgba(44, 108, 173, 0.05);
}

.badge-bonus {
  color: var(--accent);
}

.intro {
  display: grid;
  gap: 6px;
  margin-bottom: 0;
}

.eyebrow {
  margin: 0;
  color: rgba(233, 244, 255, 0.84);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(27px, 4vw, 36px);
  line-height: 1.02;
}

h2 {
  font-size: 20px;
  line-height: 1.1;
}

.subcopy,
.section-heading p,
.status-subcopy,
.empty-state p,
.notice-card span,
.guide-block p,
.qr-note,
.help-block p,
.help-warning {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.subcopy {
  max-width: 660px;
  color: rgba(238, 246, 255, 0.88);
}

.hero-panel h1 {
  color: #ffffff;
}

.hero-panel .badge {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: none;
}

.hero-panel .badge-bonus {
  color: #3979ea;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  position: relative;
  z-index: 1;
  margin-top: -18px;
}

.card,
.help-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.card {
  padding: 18px;
}

.form-card {
  position: sticky;
  top: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 255, 0.96));
}

.section-heading,
.status-head {
  display: grid;
  gap: 6px;
}

.form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.form label,
.amount-input {
  display: grid;
  gap: 8px;
}

.form label > span {
  font-size: 13px;
  font-weight: 700;
}

.field-hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.field-hint a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.field-hint a:hover,
.field-hint a:focus-visible {
  text-decoration: underline;
}

input {
  width: 100%;
  min-width: 0;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(108, 153, 211, 0.22);
  background: #fcfeff;
  color: var(--text);
}

input:focus {
  outline: none;
  border-color: var(--border-strong);
  box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.08);
}

.amount-input {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 0 0 0 0;
  border-radius: var(--radius-md);
  border: 1px solid rgba(108, 153, 211, 0.22);
  background: #fcfeff;
  overflow: hidden;
}

.amount-input input {
  border: 0;
  box-shadow: none;
}

.amount-input span {
  padding: 0 14px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.notice-card {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
}

.notice-card strong {
  font-size: 14px;
  color: #6d5620;
}

.notice-card span {
  color: #7a6540;
}

.primary,
.action-primary,
.ghost,
.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.primary {
  min-height: 48px;
  padding: 0 18px;
  background: linear-gradient(180deg, #4a8df0, #3979ea);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 12px 20px rgba(63, 130, 245, 0.2);
}

.primary:hover,
.primary:focus-visible {
  background: var(--accent-hover);
}

.action-primary {
  min-height: 40px;
  min-width: 132px;
  padding: 0 14px;
  background: linear-gradient(180deg, #4a8df0, #3979ea);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(63, 130, 245, 0.16);
}

.action-primary:hover,
.action-primary:focus-visible {
  background: var(--accent-hover);
}

.ghost,
.action-link {
  min-height: 40px;
  padding: 0 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.ghost:hover,
.action-link:hover {
  background: rgba(0, 123, 255, 0.14);
}

.primary:active,
.action-primary:active,
.ghost:active,
.action-link:active {
  transform: translateY(1px);
}

.error {
  margin: 0;
  color: var(--danger);
  font-size: 14px;
}

.rule-row {
  margin-top: 14px;
}

.rule-chip {
  padding: 8px 11px;
  background: #f5f9ff;
  border: 1px solid rgba(83, 141, 220, 0.12);
  color: #425c81;
}

.status-card {
  display: grid;
  gap: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(250, 252, 255, 0.98));
}

.status-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.pill {
  padding: 10px 12px;
}

.pill-idle,
.pill-pending {
  background: rgba(0, 123, 255, 0.08);
  color: var(--accent);
}

.pill-confirming {
  background: rgba(23, 162, 184, 0.12);
  color: #138496;
}

.pill-completed {
  background: rgba(40, 167, 69, 0.12);
  color: var(--success);
}

.pill-error {
  background: rgba(220, 53, 69, 0.12);
  color: var(--danger);
}

.empty-state {
  display: grid;
  gap: 10px;
  align-content: center;
  min-height: 190px;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(83, 141, 220, 0.2);
  background: linear-gradient(180deg, #f9fbff, #f3f8ff);
}

.empty-state strong {
  font-size: 20px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.empty-state p {
  max-width: 520px;
}

.empty-step {
  padding: 8px 11px;
  border: 1px solid rgba(83, 141, 220, 0.18);
  background: #fff;
  color: var(--text);
}

#deposit-view {
  display: grid;
  gap: 14px;
}

.credit-error {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(220, 53, 69, 0.18);
  background: rgba(220, 53, 69, 0.06);
  color: #8f2430;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 600;
}

.invoice-banner {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(81, 149, 229, 0.13), rgba(255, 255, 255, 1));
  border: 1px solid rgba(83, 141, 220, 0.16);
}

.invoice-kicker,
.summary-box span,
.detail-head span,
.qr-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.invoice-banner strong {
  display: block;
  margin-top: 4px;
  font-size: clamp(26px, 4vw, 34px);
  line-height: 0.98;
}

.invoice-banner p {
  max-width: 320px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.summary-box,
.detail-card,
.qr-panel {
  border: 1px solid rgba(83, 141, 220, 0.14);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.summary-box {
  display: grid;
  gap: 6px;
  padding: 13px 14px;
}

.summary-box strong {
  font-size: 16px;
}

.invoice-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 12px;
}

.invoice-main {
  display: grid;
  gap: 14px;
}

.detail-actions {
  align-items: center;
}

.detail-card {
  display: grid;
  gap: 12px;
  padding: 15px;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.detail-head strong {
  font-size: 16px;
}

.detail-address code {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-tint);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  color: #35527a;
}

.payment-guide {
  gap: 14px;
}

.guide-block {
  display: grid;
  gap: 5px;
}

.guide-block strong {
  font-size: 14px;
}

.note-strip {
  margin: 0;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  background: var(--surface-tint);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.help-card {
  background: rgba(255, 255, 255, 0.94);
}

.qr-panel {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 15px;
  text-align: center;
}

.qr-wrap {
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.qr-wrap img {
  width: 100%;
  max-width: 180px;
  height: auto;
  border-radius: 10px;
}

.qr-label {
  color: #4f6f95;
}

.action-link {
  width: 100%;
}

.qr-note {
  font-size: 12px;
  line-height: 1.5;
}

.help-card {
  margin-top: 16px;
  overflow: hidden;
}

.help-card summary {
  padding: 15px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  list-style: none;
}

.help-card summary::-webkit-details-marker {
  display: none;
}

.help-body {
  display: grid;
  gap: 12px;
  padding: 0 20px 18px;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.help-block {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.help-block strong {
  font-size: 14px;
}

.help-warning {
  margin: 0;
  font-size: 13px;
}

@media (max-width: 980px) {
  .grid,
  .invoice-layout,
  .help-grid {
    grid-template-columns: 1fr;
  }

  .form-card {
    position: static;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }

  .qr-panel {
    text-align: left;
  }

  .qr-wrap {
    justify-items: start;
  }
}

@media (max-width: 720px) {
  .shell {
    padding: 18px 12px 28px;
  }

  .card,
  .help-card summary,
  .help-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar,
  .status-header,
  .invoice-banner,
  .detail-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .brand-column {
    gap: 10px;
  }

  .brand-logo {
    height: 17px;
  }

  h1 {
    font-size: 29px;
  }

  .empty-state {
    min-height: 170px;
    padding: 18px;
  }

  .empty-state strong {
    font-size: 18px;
  }
}
