:root {
  color-scheme: light;
  font-family: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #26372d;
  background: #f7f7f1;
  --ink: #26372d;
  --muted: #566359;
  --green: #345840;
  --error: #9e342c;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

body {
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 30px 20px;
  background:
    radial-gradient(circle at center, #aebf9e38 1px, transparent 1.5px) 0 0 / 26px 26px,
    radial-gradient(ellipse at 14% 18%, #e2ebdb, transparent 52%),
    radial-gradient(ellipse at 88% 84%, #f4e7d3, transparent 57%),
    #f8f7ef;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .29;
  background:
    url("/assets/paw.png") 9% 23% / 33px auto no-repeat,
    url("/assets/paw.png") 13% 17% / 24px auto no-repeat,
    url("/assets/paw.png") 90% 77% / 34px auto no-repeat,
    url("/assets/paw.png") 86% 84% / 24px auto no-repeat;
}

.claim-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(226px, .8fr) minmax(325px, 1.2fr);
  width: min(100%, 832px);
  min-height: 408px;
  overflow: hidden;
  background: #fffefa;
  border: 1px solid #dbe3d6;
  border-radius: 27px;
  box-shadow: 0 28px 70px #29402b15, 0 4px 14px #29402b09;
}

.brand-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  gap: 18px;
  min-width: 0;
  padding: 31px 29px 25px;
  background: radial-gradient(ellipse at 30% 19%, #fbf9e5, transparent 52%),
              linear-gradient(150deg, #dcead7, #edf3e5 67%, #f3ebd8);
  border-right: 1px solid #dde6d9;
}

.brand-name { font-size: 20px; font-weight: 750; color: #304a35; letter-spacing: .06em; }

.brand-illustration { position: relative; isolation: isolate; display: grid; place-items: center; }
.brand-illustration::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(94%, 222px);
  aspect-ratio: 1;
  border: 1px solid #ffffffb0;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 21%, #fffdf0, #f1f5e7 62%, #e1ead9);
  box-shadow: 0 0 0 14px #fbfff463, 0 0 0 31px #fbfff426;
}

.brand-illustration img {
  display: block;
  width: min(94%, 245px);
  height: auto;
  filter: drop-shadow(0 12px 12px #704a2825);
  transform-origin: 52% 79%;
  animation: shiba-breathe 5.6s ease-in-out infinite;
}
.mascot-sparkle {
  position: absolute;
  inset: 16% 12% auto auto;
  width: 13px;
  height: 13px;
  background: #d8a763;
  clip-path: polygon(50% 0, 63% 38%, 100% 50%, 63% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: shiba-sparkle 5.6s ease-in-out infinite;
}
.brand-note { margin: 0; text-align: center; font-size: 13px; color: #4b604c; }

.claim-content {
  min-width: 0;
  padding: 49px clamp(30px, 5vw, 54px) 34px;
}

.claim-heading { margin-bottom: 28px; }
h1 { margin: 0; font-size: clamp(25px, 3.4vw, 34px); line-height: 1.25; letter-spacing: -.025em; }
.claim-heading p { margin: 10px 0 0; font-size: 14px; line-height: 1.65; color: var(--muted); }

#claim-form { display: grid; gap: 17px; }
.field { display: grid; gap: 8px; }
.field label { width: fit-content; font-size: 14px; font-weight: 700; }
.field input {
  width: 100%;
  height: 49px;
  padding: 0 13px;
  border: 1px solid #a0b0a1;
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 16px;
}
.field input[readonly] { background: #f8faf6; }
.field input[aria-invalid="true"] { border-color: var(--error); }
.field-error { margin: 0; color: var(--error); font-size: 13px; line-height: 1.5; }

button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 8px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 150ms, box-shadow 150ms, transform 150ms;
}
button:enabled:active { transform: translateY(1px); }
:is(button, input):focus-visible { outline: 2px solid #4d7454; outline-offset: 3px; }
button:disabled { cursor: default; }

.primary-button { display: flex; min-height: 47px; justify-content: center; align-items: center; gap: 9px; color: #fff; background: var(--green); }
.primary-button:enabled:hover { background: #274732; box-shadow: 0 3px 10px #27473224; }
.primary-button:disabled { color: #46604a; background: #e6eee3; }
.button-affordance { width: 7px; height: 7px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); }
.primary-button[data-state="working"] .button-affordance {
  width: 13px;
  height: 13px;
  border: 2px solid #bccbbd;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}
.primary-button[data-state="valid"] .button-affordance { display: none; }

.feedback-slot { padding-top: 13px; }
.feedback {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid #e0e6dd;
  border-radius: 10px;
  background: #f3f6f0;
  color: #415847;
  font-size: 13px;
  line-height: 1.55;
}
.feedback[data-tone="error"] { border-color: #efdad5; background: #fcf2ef; color: #872f29; }
.feedback-icon { flex: 0 0 7px; width: 7px; height: 7px; margin-top: 7px; border-radius: 50%; background: currentColor; }
.wait-time { margin-left: 6px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.code-panel {
  display: grid;
  gap: 12px;
  padding: 15px 16px 14px;
  border: 1px solid #d5e2d4;
  border-radius: 14px;
  background: #f5f9f2;
}
.claim-content:has(.feedback:not([hidden])) .code-panel { margin-top: 10px; }
.code-meta, .code-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.code-meta h2 { margin: 0; font-size: 13px; font-weight: 750; }
.expiry { color: #416347; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.code-row { flex-wrap: wrap; }
output {
  color: #284d34;
  font: 700 clamp(27px, 6.8vw, 40px)/1 ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: .05em;
  white-space: nowrap;
}
.copy-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 76px; color: #375641; background: #e5eee1; }
.copy-button:enabled:hover { background: #d8e8d5; }
.copy-icon { display: inline-block; position: relative; width: 13px; height: 13px; }
.copy-icon::before, .copy-icon::after { content: ""; position: absolute; width: 9px; height: 9px; border: 1.4px solid currentColor; border-radius: 2px; }
.copy-icon::before { inset: 0 auto auto 0; }
.copy-icon::after { inset: auto 0 0 auto; background: #e5eee1; }

progress { width: 100%; height: 4px; appearance: none; border: 0; border-radius: 4px; overflow: hidden; background: #e0e9dd; accent-color: #72956c; }
progress::-webkit-progress-bar { background: #e0e9dd; }
progress::-webkit-progress-value { border-radius: 4px; background: #72956c; }
progress::-moz-progress-bar { border-radius: 4px; background: #72956c; }
.quota { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; padding-top: 1px; }
.quota div { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; }
dt { color: var(--muted); font-size: 12px; }
dd { margin: 0; font-size: 13px; white-space: nowrap; }
dd strong { color: #284d34; font-size: 17px; font-variant-numeric: tabular-nums; }

.instructions-panel {
  margin-top: 14px;
  border-top: 1px solid #e0e7de;
  color: #435d49;
}
.instructions-panel summary { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; font-size: 14px; font-weight: 700; list-style: none; }
.instructions-panel summary::-webkit-details-marker { display: none; }
.instructions-panel summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 4px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.instructions-panel[open] summary::after { transform: rotate(225deg); }
.instructions-panel summary:focus-visible { outline: 2px solid #4d7454; outline-offset: 3px; border-radius: 5px; }
.instructions-prose { color: var(--muted); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.instructions-prose > :first-child { margin-top: 0; }
.instructions-prose > :last-child { margin-bottom: 0; }
.instructions-prose p { text-wrap: pretty; }
.instructions-prose :is(h1, h2, h3, h4, h5, h6) { margin: 12px 0 5px; color: var(--ink); font-size: 15px; }
.instructions-prose :is(ol, ul) { padding-inline-start: 22px; }
.instructions-prose a { color: #345840; text-underline-offset: 3px; }
.instructions-prose pre { white-space: pre-wrap; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shiba-breathe {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  48% { transform: translateY(-5px) rotate(1deg) scale(1.025); }
}
@keyframes shiba-sparkle {
  0%, 100% { transform: translateY(1px) scale(.85); opacity: .38; }
  50% { transform: translateY(-4px) scale(1.1); opacity: .9; }
}
@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
  .primary-button[data-state="working"] .button-affordance, .brand-illustration img, .mascot-sparkle { animation: none; }
}

@media (max-width: 620px) {
  body { padding: 19px 13px; }
  .claim-shell { grid-template-columns: minmax(0, 1fr); width: min(100%, 450px); min-height: 0; border-radius: 21px; }
  .brand-panel { grid-template: auto / 1fr 73px; min-height: 87px; padding: 9px 20px; border-right: none; border-bottom: 1px solid #dbe5d6; }
  .brand-illustration::before { width: 60px; box-shadow: 0 0 0 6px #fafff252; }
  .brand-illustration img { width: 70px; }
  .mascot-sparkle { right: 0; top: 9%; width: 8px; height: 8px; }
  .brand-note { display: none; }
  .claim-content { padding: 24px 20px 20px; }
  .claim-heading { margin-bottom: 23px; }
  .claim-heading p { margin-top: 8px; }
}
