:root {
  color-scheme: light;
  --bg: #eef2f6;
  --ink: #17202a;
  --muted: #647080;
  --line: #d9e0e8;
  --panel: #ffffff;
  --accent: #1f7a62;
  --accent-strong: #165d4b;
  --warm: #b66b2b;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto;
}

.workspace {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  align-items: start;
}

.panel,
.stage {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(25, 36, 50, 0.08);
}

.panel {
  padding: 22px;
}

.stage {
  min-height: 620px;
  padding: 26px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 26px;
}

.mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 24px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 21px;
}

.brand p,
.muted,
.hint,
.step p,
.empty p {
  color: var(--muted);
}

.form,
.phone-box {
  display: grid;
  gap: 16px;
}

.form.compact {
  gap: 10px;
}

.lookup {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.lookup h2 {
  margin-bottom: 12px;
  font-size: 17px;
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: #354254;
  font-size: 14px;
  font-weight: 650;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 11px;
  background: #fbfcfe;
  color: var(--ink);
}

input:focus,
select:focus {
  outline: 2px solid rgba(31, 122, 98, 0.18);
  border-color: var(--accent);
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  padding: 0 16px;
  background: #26384c;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

button.primary {
  background: var(--accent);
}

button.secondary {
  width: 100%;
  margin-top: 14px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid var(--line);
}

button:hover {
  filter: brightness(0.95);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e8edf3;
  color: #344255;
  font-size: 13px;
  font-weight: 800;
}

.badge.ready {
  background: #ddf3ea;
  color: var(--accent-strong);
}

.badge.warn {
  background: #fff1df;
  color: var(--warm);
}

.badge.error {
  background: #fee4e2;
  color: var(--danger);
}

.empty {
  display: grid;
  place-items: center;
  min-height: 460px;
  text-align: center;
  gap: 8px;
}

.pay-area {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: center;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.amount {
  margin: 10px 0;
  font-size: 48px;
  font-weight: 850;
  letter-spacing: 0;
}

.qr {
  width: 280px;
  height: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.steps {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.step {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 14px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.step > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e8edf3;
  color: #334155;
  font-weight: 800;
}

.step.done > span {
  background: var(--accent);
  color: #fff;
}

.phone-box {
  margin-top: 18px;
  padding: 18px;
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.message {
  min-height: 24px;
  margin-top: 16px;
  color: var(--danger);
  font-weight: 650;
}

.hidden {
  display: none !important;
}

@media (max-width: 860px) {
  .workspace,
  .pay-area {
    grid-template-columns: 1fr;
  }

  .qr {
    width: min(280px, 100%);
    height: auto;
    justify-self: center;
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 20px, 1180px);
    margin: 10px auto;
  }

  .panel,
  .stage,
  .pay-area {
    padding: 16px;
  }

  .grid-two {
    grid-template-columns: 1fr;
  }

  .amount {
    font-size: 36px;
  }
}
