:root {
  color-scheme: light;
  --night: #10243f;
  --night-2: #1a3358;
  --slip: #ffffff;
  --ink: #142033;
  --muted: #4d5d72;
  --faint: #6b7c90;
  --line: #e3e8ef;
  --well: #f5f7fa;
  --chip: #c4a574;
  --fail: #9f2d22;
  --ok: #0d6a45;
  --warn: #8a5a12;
  --radius: 14px;
  --display: "Outfit", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --sans: "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Sarasa Mono SC", monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  padding-top: 64px;
  padding-bottom: 52px;
  background: #e7eef5;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

a { color: inherit; }
button, input, select, textarea { font: inherit; }
::selection { background: var(--chip); color: var(--ink); }

.site-top {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  height: 64px;
  padding: 0 28px;
  background: #ffffff;
  border-bottom: 1px solid #d5deea;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.mark {
  width: 28px;
  height: 28px;
  display: block;
  border-radius: 8px;
}

.site-nav { display: flex; align-items: center; gap: 2px; }

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
}

.site-nav a:hover { color: var(--ink); background: var(--well); }
.site-nav a[aria-current="page"] { color: var(--ink); background: var(--well); }

.slip-wrap {
  width: min(440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 8px 0 8px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.slip-wrap h1 {
  margin: 4px 2px 2px;
  color: var(--ink);
  font-family: var(--display);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.slip-wrap .lede {
  margin: -6px 2px 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.slip {
  background: var(--slip);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 10px 28px rgba(20, 32, 51, 0.05);
}

.site-foot {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  height: 52px;
  width: 100%;
  margin: 0;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #ffffff;
  border-top: 1px solid #d5deea;
  color: var(--muted);
  font-size: 13px;
}

.contact {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.contact img {
  width: 72px;
  height: auto;
  border: 0;
  border-radius: 10px;
  background: #ffffff;
}

.contact-copy { display: grid; line-height: 1.35; }
.contact-copy strong { font-weight: 600; }
.contact-copy span { color: var(--muted); font-weight: 400; }

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

body.charge fieldset { margin: 0; padding: 0; border: 0; }

body.charge legend {
  padding: 0;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
}

body.charge .plans { display: grid; gap: 8px; }

body.charge .plan {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  margin: 0;
  padding: 10px 14px 10px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
}

body.charge .plan input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

body.charge .plan:hover { border-color: #c5d0de; }

body.charge .plan:has(input:checked) {
  border-color: var(--ink);
  background: #f7f5f0;
  box-shadow: inset 3px 0 0 var(--chip);
}

body.charge .plan:has(input:focus-visible) { outline: 2px solid var(--chip); outline-offset: 2px; }

body.charge .plan-name {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

body.charge .plan-region {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

body.charge label.field {
  display: grid;
  gap: 6px;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 600;
}

body.charge textarea,
body.charge input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--well);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
  padding: 12px 14px;
  font-variant-numeric: tabular-nums;
}

body.charge textarea {
  min-height: 132px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
}

body.charge textarea::placeholder,
body.charge input::placeholder { color: var(--faint); }

body.charge textarea:focus,
body.charge input:focus {
  outline: none;
  border-color: var(--ink);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(20, 32, 51, 0.12);
}

body.charge .card-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 0.85fr) minmax(0, 0.7fr);
  gap: 8px;
}

body.charge button[type="submit"] {
  margin-top: 18px;
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: #ffffff;
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.02em;
  cursor: pointer;
}

body.charge button[type="submit"]:hover { background: var(--night-2); }
body.charge button[type="submit"]:active { transform: translateY(1px); }
body.charge button[aria-disabled="true"] { cursor: wait; opacity: 0.7; }

body.charge .limit { margin: 10px 0 0; color: var(--faint); font-size: 13px; text-align: center; }
body.charge .error { margin: 12px 0 0; color: var(--fail); font-weight: 500; font-size: 14px; }

body.charge .status h2 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

body.charge .stages {
  list-style: none;
  margin: 0;
  padding: 0;
}

body.charge .stages li {
  position: relative;
  margin: 0;
  padding: 0 0 16px 22px;
  color: var(--faint);
  font-size: 14px;
  line-height: 1.3;
}

body.charge .stages li:last-child { padding-bottom: 0; }

body.charge .stages li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d5deea;
}

body.charge .stages li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 15px;
  bottom: 0;
  width: 2px;
  background: #d5deea;
}

body.charge .stages li.done { color: var(--ink); }
body.charge .stages li.done::before,
body.charge .stages li.done:not(:last-child)::after { background: var(--ok); }

body.charge .stages li.current { color: var(--ink); font-weight: 600; }
body.charge .stages li.current::before {
  background: var(--ink);
  box-shadow: 0 0 0 4px rgba(20, 32, 51, 0.12);
}

body.charge .stages li.fail { color: var(--fail); font-weight: 600; }
body.charge .stages li.fail::before { background: var(--fail); }

body.charge .again {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

body.charge .facts {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px 12px;
  margin: 16px 0 0;
}

body.charge .facts dt { color: var(--muted); font-size: 14px; }
body.charge .facts dd { margin: 0; font-weight: 600; }

body.lookup label {
  display: block;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
}

body.lookup textarea {
  width: 100%;
  min-height: 200px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  color: var(--ink);
  background: var(--well);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
}

body.lookup textarea::placeholder { color: var(--faint); }
body.lookup textarea:disabled { background: #eef1f5; }
body.lookup textarea:focus {
  outline: none;
  border-color: var(--ink);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(20, 32, 51, 0.12);
}

body.lookup .actions { display: flex; gap: 8px; margin-top: 14px; }
body.lookup button { font: inherit; cursor: pointer; }

body.lookup .primary,
body.lookup .ghost {
  min-height: 48px;
  border-radius: 12px;
  padding: 0 16px;
}

body.lookup .primary {
  flex: 1;
  border: 0;
  color: #ffffff;
  background: var(--ink);
  font-family: var(--display);
  font-weight: 600;
}

body.lookup .primary:hover { background: var(--night-2); }
body.lookup .primary:active { transform: translateY(1px); }
body.lookup .primary:disabled { cursor: progress; opacity: 0.7; }

body.lookup .ghost {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  font-weight: 500;
}

body.lookup .ghost:hover { background: var(--well); }
body.lookup .ghost:disabled { cursor: progress; opacity: 0.7; }

body.lookup .wait { margin: 12px 0 0; color: var(--muted); font-size: 14px; }

body.lookup .bar {
  height: 3px;
  margin: 8px 0 0;
  width: 100%;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

body.lookup .bar span {
  display: block;
  height: 100%;
  width: 40%;
  background: var(--chip);
  animation: charge-slide 1s ease-in-out infinite;
}

@keyframes charge-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}

body.lookup .error {
  margin: 12px 0 0;
  color: var(--fail);
  font-size: 14px;
  font-weight: 500;
}

body.lookup .grid { display: grid; margin-top: 4px; }

body.lookup .cell {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 11px 0;
  border-top: 1px solid var(--line);
  background: transparent;
}

body.lookup .kicker { margin: 0; color: var(--muted); font-size: 14px; }
body.lookup .kicker span { display: none; }

body.lookup .value {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

body.lookup .value.email { font-weight: 500; word-break: break-all; }
body.lookup .value.empty { color: var(--faint); font-weight: 500; }
body.lookup .value.alert, body.lookup .value.bad { color: var(--fail); }
body.lookup .value.on, body.lookup .value.ok { color: var(--ok); }

body.lookup .banner {
  display: grid;
  gap: 2px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--well);
}

body.lookup .banner i { display: none; }
body.lookup .banner strong { font-weight: 600; }
body.lookup .banner span { color: var(--muted); font-size: 14px; }
body.lookup .banner.warn { background: #f8f1e6; }
body.lookup .banner.warn strong { color: var(--warn); }
body.lookup .banner.quiet strong { color: var(--ink); }

body.lookup .back { display: flex; margin-top: 16px; }
body.lookup .back .primary { width: 100%; }

body.lookup .toast {
  margin: 0 0 8px;
  color: var(--ok);
  font-size: 13px;
  font-weight: 600;
}

body.lookup .toast i { display: none; }

body.lookup #result h2 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

body.lookup .lookup-contact {
  display: flex;
  justify-content: center;
  padding: 4px 2px 8px;
}

body.charge .desk {
  position: fixed;
  top: 64px;
  right: 0;
  bottom: 52px;
  left: 0;
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 520px) minmax(240px, 280px);
  justify-content: center;
  align-items: start;
  gap: 16px;
  padding: 28px 20px 32px;
  overflow: auto;
  background: #e7eef5;
}

body.charge .points,
body.charge .rail,
body.charge .work {
  background: transparent;
  border: 0;
  padding: 0;
}

body.charge .side {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(20, 32, 51, 0.05);
}

body.charge .points .side,
body.charge .rail .contact {
  position: sticky;
  top: 0;
}

body.charge .points .side { padding: 20px 20px 18px; }

body.charge .side-mark {
  display: block;
  width: 32px;
  height: 32px;
  margin-bottom: 16px;
  border-radius: 8px;
}

body.charge .points h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

body.charge .points p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.7;
}

body.charge .points a {
  color: var(--ink);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

body.charge .work {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

body.charge .work .slip { width: 100%; margin: 0; }

body.charge .rail .contact {
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 16px;
  color: var(--ink);
  text-align: center;
}

body.charge .rail .contact img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
}

body.charge .rail .contact-copy { justify-items: center; }
body.charge .rail .contact-copy strong { font-size: 16px; }
body.charge .rail .contact-copy span { color: var(--muted); font-size: 14px; }

@media (max-width: 980px) {
  body.charge .desk {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 16px 24px;
  }
  body.charge .work { order: 1; }
  body.charge .points { order: 2; }
  body.charge .rail { order: 3; }
  body.charge .points .side,
  body.charge .rail .contact { position: static; }
  body.charge .rail .contact img { width: min(220px, 100%); }
}

@media (max-width: 520px) {
  .site-top, .site-foot { padding-left: 16px; padding-right: 16px; }
  .site-nav a { padding: 8px 8px; }
  .slip-wrap h1 { font-size: 28px; }
  body.charge .card-row { grid-template-columns: 1fr 1fr; }
  body.charge .card-row .field:first-child { grid-column: 1 / -1; }
  body.lookup .actions { flex-direction: column; }
  body.lookup .ghost { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  body.charge button[type="submit"]:active,
  body.lookup .primary:active { transform: none; }
  body.lookup .bar span { animation: none; width: 100%; }
}
