:root {
  font-family: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #15221f;
  background: #f6f8f6;
  line-height: 1.55;
  font-synthesis: none;
  --ink: #15221f; --muted: #51615c; --line: #dbe3de;
  --primary: #145644; --hover: #0c4535; --soft: #ecf3ee;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1136px; min-height: 74px; margin: auto; padding: 14px 32px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 760; letter-spacing: -.025em; }
.brand-icon {
  display: grid; place-items: center; width: 31px; height: 31px; margin-right: 3px;
  border-radius: 9px; color: #dbf4e5; background: #173e33; font-size: 17px; font-weight: 780;
}
.brand-product { color: var(--muted); font-weight: 520; }
main { max-width: 1136px; margin: auto; padding: 48px 32px 76px; }
body[data-view="app"] main { max-width: 820px; padding-top: 30px; }
.auth-layout {
  display: grid; grid-template-columns: minmax(0, 1.16fr) minmax(0, .84fr);
  overflow: hidden; min-height: 494px; border: 1px solid var(--line); border-radius: 24px;
  background: #fff; box-shadow: 0 22px 70px #183e3210;
}
.welcome {
  display: flex; flex-direction: column; justify-content: center; padding: clamp(36px, 6vw, 76px);
  color: #f1f7f2; background: radial-gradient(ellipse at 95% 90%, #286253, transparent 53%), #15352d;
}
.welcome-tag { color: #a9cdb9; font-size: .84rem; letter-spacing: .09em; font-weight: 650; }
.welcome-title { margin: 20px 0 16px; font-weight: 760; font-size: clamp(38px, 5.3vw, 69px); line-height: 1.16; letter-spacing: -.065em; }
.welcome-title span { color: #a0dbbb; }
.welcome-description { max-width: 22em; color: #d3e6dc; font-size: 1rem; }
.auth { align-self: center; width: 100%; padding: 40px clamp(24px, 4.5vw, 62px); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(29px, 5.5vw, 40px); line-height: 1.18; letter-spacing: -.045em; }
.auth h1 { margin-bottom: 26px; font-size: 30px; }
h2 { font-size: 1.02rem; line-height: 1.4; }
.intro, .loading { color: var(--muted); margin: 7px 0 16px; font-size: .9rem; }
.page-intro { margin-bottom: 21px; }
.panel-heading, .order { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: clamp(18px, 4vw, 28px); margin-bottom: 12px; }
.wallet { background: #173e33; color: #f5faf6; border-color: #173e33; }
.wallet h2, .wallet label, .wallet .price span, .wallet .message, .wallet .order span { color: #cde5d7; }
.wallet .message[data-error] { color: #ffb7ad; }
.wallet .text-button { color: #e0f5e8; }
.wallet .primary, .wallet .secondary { background: #ceeedb; color: #143e31; }
.wallet .primary:hover, .wallet .secondary:hover { background: #e3f8ec; }
.wallet button:disabled { background: #416459; color: #e5eee8; }
.wallet :focus-visible { outline-color: #c3edda; }
.balance { font-size: clamp(36px, 6vw, 48px); line-height: 1.17; letter-spacing: -.06em; font-weight: 760; font-variant-numeric: tabular-nums; margin-top: 5px; }
label, .price span { display: block; color: var(--muted); font-size: .85rem; font-weight: 620; margin-bottom: 5px; }
input { width: 100%; min-height: 44px; border: 1px solid #aebfb6; border-radius: 9px; padding: 8px 11px; background: #fff; color: var(--ink); font: inherit; }
.auth input { margin-bottom: 14px; }
.auth .primary { width: 100%; margin-top: 6px; }
.auth .text-button { display: block; margin: 9px auto 0; }
button { min-height: 43px; border: 0; border-radius: 9px; padding: 8px 15px; font: inherit; font-weight: 650; cursor: pointer; }
.primary { background: var(--primary); color: #fff; }
.primary:hover { background: var(--hover); }
.secondary { background: var(--soft); color: #204d3c; }
.text-button { background: transparent; color: var(--primary); padding-inline: 8px; }
.text-button:hover { text-decoration: underline; }
button[aria-busy="true"] { cursor: progress; }
button[aria-busy="true"]::before {
  content: ""; display: inline-block; width: 11px; height: 11px; border: 2px solid currentColor;
  border-right-color: transparent; border-radius: 50%; margin-right: 8px; vertical-align: -2px;
  animation: spin .75s linear infinite;
}
button:disabled { background: #ecf0ed; color: #5d6c64; cursor: default; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { button[aria-busy="true"]::before { animation: none; } }
:focus-visible { outline: 2px solid #297052; outline-offset: 2px; }
.purchase { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 15px; margin: 18px 0; }
.price strong { font-size: 1.25rem; }
.message { font-size: .875rem; color: var(--muted); margin-top: 9px; }
.message[data-error], .loading[data-error] { color: #9f221e; }
.message:empty { display: none; }
.order { border-top: 1px solid #6c8f80; margin-top: 16px; padding-top: 8px; font-size: .875rem; }
.order span { display: block; }
.config { margin: 8px 0 0; }
.config div { display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); min-height: 44px; }
.config div:last-child { border-bottom: 0; }
dt { color: var(--muted); font-size: .85rem; }
dd { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
code { overflow-wrap: anywhere; font-size: .81rem; }
dd button { flex: 0 0 auto; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--soft); border-radius: 9px; padding: 12px; margin: 12px 0 0; font: inherit; }
@media (max-width: 660px) {
  .site-header { min-height: 62px; padding: 11px 17px; }
  main, body[data-view="app"] main { padding: 18px 14px 42px; }
  .auth-layout { grid-template-columns: 1fr; min-height: 0; border-radius: 18px; }
  .welcome { padding: 25px 24px 26px; }
  .welcome-title { margin: 9px 0 6px; font-size: clamp(30px, 8vw, 44px); }
  .welcome-description { font-size: .9rem; }
  .auth { padding: 24px; }
  .auth h1 { margin-bottom: 18px; font-size: 25px; }
  .config div { grid-template-columns: 64px 1fr; }
}
