:root {
  color-scheme: light;
  --ink: #202724;
  --muted: #5e6863;
  --accent: #187052;
  --accent-hover: #10583f;
  --border: #d5dcd8;
  --surface: #ffffff;
  --background: #f5f7f6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; letter-spacing: 0; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--surface); color: var(--ink); font-size: 16px; line-height: 1.6; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid #276ec4; outline-offset: 3px; }
.site-header, main { width: min(100%, 720px); margin: auto; padding: 24px; }
.site-header { display: flex; align-items: center; gap: 20px; min-height: 88px; border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-size: 18px; font-weight: 700; }
.brand-symbol { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; background: var(--accent); color: white; font-size: 21px; }
h1 { margin: 0; color: var(--muted); font-size: 16px; font-weight: 500; }
h2 { margin: 0; font-size: 16px; font-weight: 650; }
main { padding-top: 32px; padding-bottom: 48px; }
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.lookup-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 12px; }
.input-wrap { position: relative; min-width: 0; }
input[type="password"], input[type="text"] { width: 100%; min-width: 0; min-height: 48px; border: 1px solid #9ca9a2; border-radius: 6px; padding: 11px 12px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--surface); }
#redeem-code { padding-right: 52px; }
.show-code { position: absolute; right: 2px; top: 2px; border-color: transparent !important; }
.icon { width: 19px; height: 19px; flex: 0 0 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 10px; color: var(--muted); border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.icon-button:hover:not(:disabled) { background: var(--background); color: var(--ink); }
.icon-button:disabled { opacity: .45; cursor: default; }
.field-hint { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 8px 0; }
.button { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; padding: 11px 16px; border: 1px solid transparent; border-radius: 6px; font-size: 15px; font-weight: 600; text-decoration: none; transition: background 150ms, color 150ms; }
.primary { background: var(--accent); color: white; }
.primary:hover:not(:disabled) { background: var(--accent-hover); }
button:active:not(:disabled), a.button:active { opacity: .8; }
.button:disabled { background: #e8ece9; border-color: var(--border); color: #68736d; cursor: not-allowed; }
.secondary { background: var(--surface); border-color: var(--border); color: var(--ink); margin-top: 16px; }
.secondary:hover:not(:disabled) { background: var(--background); }
.result { border-top: 1px solid var(--border); margin-top: 24px; padding-top: 20px; }
.result-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.state-label { display: inline-block; color: #315b82; background: #eaf2fb; border-radius: 4px; font-size: 12px; font-weight: 600; padding: 3px 8px; }
.result[data-state="complete"] .state-label { color: #11613f; background: #e9f5ed; }
.result[data-state="review"] .state-label, .result[data-state="expired"] .state-label, .result[data-state="disabled"] .state-label { color: #894316; background: #fff1e6; }
.result-heading .field-hint { margin: 0; }
.result-message { font-size: 14px; margin: 12px 0 16px; overflow-wrap: anywhere; }
.details { font-size: 14px; margin: 0 0 16px; }
.details > div { display: flex; align-items: baseline; gap: 16px; margin: 10px 0; }
.details dt { flex: 0 0 78px; color: var(--muted); }
.details dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }
.confirm-label { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: #854014; font-weight: 400; padding: 14px 0; margin: 0; cursor: pointer; min-height: 48px; }
.confirm-label input { accent-color: var(--accent); width: 18px; height: 18px; flex: 0 0 18px; margin: 2px 0 0; }
.copy-row { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 8px; }
#number { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 18px; font-weight: 650; }
.link-row { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; }
#delivery-link { font-size: 13px; background: var(--background); }
.feedback { margin: 0; font-size: 13px; color: #934319; overflow-wrap: anywhere; }
.feedback:not(:empty) { margin-top: 16px; }
.history { border-top: 1px solid var(--border); margin-top: 32px; padding-top: 16px; }
.history-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.history-heading .icon-button { border-color: transparent; }
.history-list { list-style: none; margin: 8px 0 0; padding: 0; }
.history-list li { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); padding: 8px 0; }
.history-query { display: flex; flex: 1; min-width: 0; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 64px; padding: 8px; border: 0; border-radius: 4px; background: transparent; color: var(--ink); text-align: left; }
.history-query:hover:not(:disabled) { background: var(--background); }
.history-query:disabled { cursor: progress; opacity: .6; }
.history-product { font-size: 14px; overflow-wrap: anywhere; }
.history-code { font-size: 12px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--muted); overflow-wrap: anywhere; }
#history-feedback:empty { display: none; }
@media (max-width: 480px) {
  .site-header, main { padding-left: 16px; padding-right: 16px; }
  .site-header { min-height: 76px; padding-top: 20px; padding-bottom: 20px; }
  main { padding-top: 24px; }
  .lookup-row { grid-template-columns: minmax(0, 1fr) 80px; gap: 8px; }
  .details > div { gap: 10px; }
  .details dt { flex-basis: 70px; }
  .copy-row { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
