:root { color-scheme: light; --ink: #22272b; --muted: #737b82; --line: #e4e8ea; --green: #15765a; --green-dark: #0e5944; --paper: #fff; --error: #b5473c; }
* { box-sizing: border-box; letter-spacing: 0; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; min-width: 280px; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
button:focus-visible, a:focus-visible { outline: 3px solid #66b9de; outline-offset: 4px; }
.topbar { height: 78px; border-bottom: 1px solid var(--line); padding: 0 48px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 650; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; background: #eaf3ef; border-radius: 6px; }
.brand-mark img { opacity: .8; }
.connection { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: #b5bdc1; }
.connection[data-state="ready"] .dot { background: var(--green); }
.connection[data-state="error"] .dot { background: var(--error); }
main { width: min(920px, calc(100% - 80px)); margin: 64px auto 90px; min-height: 480px; }
.eyebrow { color: var(--green); font-size: 12px; font-weight: 600; }
h1 { font-size: 28px; line-height: 1.3; margin: 8px 0 42px; font-weight: 650; }
h2 { font-size: 15px; line-height: 1.5; font-weight: 600; margin: 0 0 27px; }
.mode-tabs { display: flex; gap: 28px; margin: -18px 0 32px; border-bottom: 1px solid var(--line); }
.mode-tabs button { border: 0; border-radius: 0; background: none; color: var(--muted); padding: 10px 0; border-bottom: 2px solid transparent; font-size: 14px; }
.mode-tabs button[aria-pressed="true"] { color: var(--green); border-bottom-color: var(--green); }
.redemption-layout { display: grid; grid-template-columns: minmax(0, 1fr) 296px; gap: 64px; }
.redemption-layout > * { min-width: 0; }
.redemption-result { border-left: 1px solid var(--line); padding-left: 32px; }
#redeem-message[data-state="success"] { color: var(--green); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 296px; gap: 64px; }
.activation { min-width: 0; }
.field { margin: 0 0 22px; }
.field label { display: block; font-size: 13px; margin-bottom: 8px; color: #4e575e; }
.field input { display: block; width: 100%; min-width: 0; height: 46px; border: 1px solid #cdd4d8; border-radius: 5px; padding: 0 12px; background: #fff; color: var(--ink); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; transition: border-color .15s; }
.field input::placeholder { color: #9aa2a8; font-size: 12px; }
.field input:focus { outline: 2px solid #d4e7df; outline-offset: 1px; border-color: var(--green); }
.field textarea { display: block; width: 100%; min-width: 0; min-height: 125px; border: 1px solid #cdd4d8; border-radius: 5px; padding: 10px 12px; resize: vertical; font: 12px/1.7 ui-monospace, SFMono-Regular, Consolas, monospace; }
.field textarea:focus { outline: 2px solid #d4e7df; border-color: var(--green); }
.query-devices { list-style: none; padding: 0; font-size: 12px; max-height: 240px; overflow-y: auto; }
.query-devices li { display: flex; gap: 12px; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.query-devices span { overflow-wrap: anywhere; }
.upgrade-notice { font-size: 13px; color: #956322; overflow-wrap: anywhere; }
.id-field { max-width: 230px; }
.id-field input { font-size: 16px; text-transform: uppercase; }
.confirmation { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 24px 0 15px; width: fit-content; cursor: pointer; }
.confirmation input { width: 16px; height: 16px; margin: 0; accent-color: var(--green); }
.challenge { min-height: 65px; margin-bottom: 16px; max-width: 100%; }
.primary, .download { min-height: 44px; border-radius: 5px; padding: 10px 16px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; font-weight: 550; }
.primary { color: #fff; border: 1px solid var(--green); background: var(--green); min-width: 160px; }
.primary:hover:not(:disabled) { background: var(--green-dark); }
.primary img { width: 17px; height: 17px; filter: invert(1); }
.form-message { color: var(--error); font-size: 13px; min-height: 42px; margin-top: 12px; overflow-wrap: anywhere; }
.delivery { border-left: 1px solid var(--line); padding-left: 32px; min-width: 0; }
.section-heading { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.badge { font-size: 11px; color: var(--muted); white-space: nowrap; }
.state-icon { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 8px; background: #f1f4f5; margin: 3px 0 20px; }
.state-icon img { opacity: .5; }
.delivery[data-state="done"] .state-icon { background: #e5f3eb; }
.delivery[data-state="done"] .state-icon img { opacity: .8; }
.delivery[data-state="failed"] .state-icon { background: #faeeeb; }
.delivery[data-state="pending"] .state-icon img, .delivery[data-state="processing"] .state-icon img { animation: spin 2s linear infinite; }
h3 { font-size: 17px; font-weight: 600; margin: 0 0 8px; line-height: 1.5; }
#state-message { color: var(--muted); font-size: 13px; margin: 0; min-height: 42px; overflow-wrap: anywhere; }
.file-details { margin: 24px 0; font-size: 12px; }
.file-details > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 10px 0; }
dt { color: var(--muted); }
dd { margin: 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }
.download { width: 100%; color: var(--ink); background: #fff; border: 1px solid #cdd4d8; }
.download img { width: 17px; height: 17px; flex-shrink: 0; }
.download:hover:not(:disabled) { border-color: var(--green); background: #f5faf7; }
.download-message { font-size: 12px; color: var(--muted); min-height: 24px; margin-top: 10px; overflow-wrap: anywhere; }
.device-list { padding: 0; margin: -8px 0 24px; list-style: none; display: flex; flex-wrap: wrap; gap: 6px 12px; font: 11px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--muted); max-height: 104px; overflow: auto; }
.device-list li { overflow-wrap: anywhere; }
.device-list li[aria-current] { color: var(--green); font-weight: 600; }
footer { border-top: 1px solid var(--line); padding: 22px 48px; color: #8a9399; font-size: 11px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 760px) {
  .topbar { height: 66px; padding: 0 22px; }
  main { width: calc(100% - 44px); margin: 38px auto 50px; }
  h1 { font-size: 25px; margin-bottom: 30px; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .redemption-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .redemption-result { border-left: 0; border-top: 1px solid var(--line); padding: 28px 0 0; }
  .delivery { padding: 28px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .delivery .section-heading h2 { margin-bottom: 20px; }
  .state-icon { width: 48px; height: 48px; margin-bottom: 14px; }
  .state-icon img { width: 26px; height: 26px; }
  .file-details { max-width: 360px; }
  .download { max-width: 360px; }
  footer { padding: 20px 22px; }
  .challenge { min-height: 65px; }
}
@media (max-width: 360px) {
  .topbar { padding: 0 14px; gap: 10px; }
  .brand { font-size: 11px; gap: 7px; }
  .connection { font-size: 10px; gap: 5px; }
  main { width: calc(100% - 28px); }
  .field input::placeholder { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
