/* ==========================================================================
   Redemption page refresh
   Loaded after redemption-polish.css / redemption-products.css.
   Visual layer only: softer canvas, segmented product tabs, gradient accents,
   haloed step nodes and a friendlier paste area. No markup changes needed.
   ========================================================================== */

:root[data-theme] .site-shell {
  --xd-accent-a: var(--ui-primary-strong);
  --xd-accent-b: color-mix(in oklab, var(--ui-primary) 70%, #7c3aed);
  --xd-accent-grad: linear-gradient(135deg, var(--xd-accent-a), var(--xd-accent-b));
  --xd-ok-grad: linear-gradient(135deg, #16a34a, #22c55e);
  --xd-radius-card: 24px;
  --xd-radius-field: 14px;
}

/* ---------- Canvas ---------- */

:root[data-theme="white"] body.site-shell {
  background:
    radial-gradient(900px 420px at 12% -6%, rgba(99, 102, 241, .10), transparent 70%),
    radial-gradient(760px 380px at 92% 4%, rgba(56, 189, 248, .10), transparent 70%),
    linear-gradient(180deg, #f6f8fd 0%, #f2f5fb 100%);
  background-attachment: fixed;
}

:root[data-theme="white"] .site-shell .topbar {
  background: rgba(255, 255, 255, .72);
  border-bottom-color: rgba(15, 23, 42, .06);
}

:root[data-theme] .site-shell .brand-mark.brand-avatar-mark {
  border-radius: 12px;
  box-shadow: 0 0 0 2px var(--ui-surface), 0 0 0 3.5px color-mix(in srgb, var(--ui-primary) 35%, transparent);
}

/* upgrade entry: gradient pill instead of a flat block */
:root[data-theme] .site-shell .top-actions #upgradeEntry {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--xd-accent-grad);
  box-shadow: 0 6px 18px -6px color-mix(in srgb, var(--xd-accent-a) 70%, transparent);
  transition: box-shadow .2s ease, transform .2s ease, filter .2s ease;
}

:root[data-theme] .site-shell .top-actions #upgradeEntry:hover {
  border: 0;
  background: var(--xd-accent-grad);
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--xd-accent-a) 75%, transparent);
}

:root[data-theme] .site-shell .top-actions #upgradeEntry .upgrade-entry-arrow {
  transition: transform .2s ease;
}

:root[data-theme] .site-shell .top-actions #upgradeEntry:hover .upgrade-entry-arrow {
  transform: translateX(3px);
}

/* ---------- Product tabs: segmented control ---------- */

:root[data-theme] .site-shell .redemption-product-tabs {
  display: inline-flex;
  width: auto;
  gap: 4px;
  margin: 32px 0 0;
  padding: 5px;
  border: 1px solid var(--xd-hair);
  border-radius: 16px;
  background: color-mix(in srgb, var(--ui-surface) 70%, transparent);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

:root[data-theme] .site-shell .redemption-product-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 24px;
  border: 0;
  border-radius: 12px;
  color: var(--ui-text-muted);
  font-size: 15px;
  text-decoration: none;
  transition: color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

:root[data-theme] .site-shell .redemption-product-tab:hover {
  color: var(--ui-text);
  background: color-mix(in srgb, var(--ui-text) 5%, transparent);
}

:root[data-theme] .site-shell .redemption-product-tab[aria-selected="true"] {
  border: 0;
  color: #fff;
  background: var(--xd-accent-grad);
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--xd-accent-a) 70%, transparent);
}

/* ---------- Hero ---------- */

:root[data-theme] .site-shell .customer-hero-panel {
  margin: 36px 0 26px;
}

:root[data-theme] .site-shell .customer-hero-panel .pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 10px;
  border: 1px solid color-mix(in srgb, var(--ui-primary) 22%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ui-primary) 8%, var(--ui-surface));
  font-size: 12.5px;
}

:root[data-theme] .site-shell .customer-hero-panel .pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, .2);
}

:root[data-theme] .site-shell .customer-hero-panel .hero-copy h1 {
  margin: 14px 0 8px;
  font-size: clamp(28px, 3.8vw, 38px);
  font-weight: 800;
  letter-spacing: -.02em;
}

:root[data-theme] .site-shell .customer-hero-panel .hero-copy h1 span,
.claude-redemption-hero h1 span {
  background: var(--xd-accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* hero step tracker as a soft pill */
:root[data-theme] .site-shell .customer-hero-steps {
  padding: 8px 14px;
  border: 1px solid var(--xd-hair);
  border-radius: 999px;
  background: color-mix(in srgb, var(--ui-surface) 80%, transparent);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

:root[data-theme] .site-shell .customer-hero-steps li > span {
  width: 24px;
  height: 24px;
}

:root[data-theme] .site-shell .customer-hero-steps li:first-child > span {
  border-color: transparent;
  background: var(--xd-accent-grad);
}

/* ---------- Card ---------- */

:root[data-theme] .site-shell #step1.flow-card,
:root[data-theme] .site-shell #step3.flow-card,
:root[data-theme] .site-shell .claude-redemption-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--xd-radius-card);
}

:root[data-theme="white"] .site-shell #step1.flow-card,
:root[data-theme="white"] .site-shell #step3.flow-card,
:root[data-theme="white"] .site-shell .claude-redemption-card {
  border-color: rgba(15, 23, 42, .06);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, .04),
    0 12px 32px -12px rgba(30, 41, 99, .14),
    0 40px 80px -40px rgba(30, 41, 99, .18);
}

/* thin gradient accent along the top edge */
:root[data-theme] .site-shell #step1.flow-card::before,
:root[data-theme] .site-shell #step3.flow-card::before,
:root[data-theme] .site-shell .claude-redemption-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--xd-accent-a), var(--xd-accent-b), #38bdf8);
  opacity: .9;
}

:root[data-theme] .site-shell #step1.flow-card {
  padding-top: 32px;
}

:root[data-theme] .site-shell #step1 .section-heading h2 {
  font-size: 21px;
  font-weight: 750;
}

:root[data-theme] .site-shell #step1 #addSubmissionRow {
  border: 1px dashed color-mix(in srgb, var(--ui-primary) 40%, transparent);
  border-radius: 10px;
  margin: 0;
  padding: 0 12px;
}

:root[data-theme] .site-shell #step1 #addSubmissionRow:hover {
  border-style: solid;
}

/* ---------- Step nodes: gradient with halo ---------- */

:root[data-theme] .site-shell #step1 .customer-step-label > span {
  background: var(--xd-accent-grad);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--ui-primary) 12%, transparent);
}

:root[data-theme] .site-shell #step1 .submission-row.credential-ready > [data-cdk-field] > .customer-step-label > span,
:root[data-theme] .site-shell #step1 .submission-row.credential-ready > .submission-plan-field > .customer-step-label > span,
:root[data-theme] .site-shell #step1 .session-recognized-icon {
  background: var(--xd-ok-grad);
  box-shadow: 0 0 0 5px rgba(34, 197, 94, .14);
}

:root[data-theme] .site-shell #step1 .submission-row > [data-cdk-field]::before,
:root[data-theme] .site-shell #step1 .submission-row > .submission-plan-field::before {
  top: calc(var(--xd-node) + 10px);
  bottom: 10px;
}

:root[data-theme] .site-shell #step1 .submission-row.credential-ready > [data-cdk-field]::before,
:root[data-theme] .site-shell #step1 .submission-row.credential-ready > .submission-plan-field::before {
  background: linear-gradient(180deg, #22c55e, color-mix(in srgb, var(--ui-primary) 55%, transparent));
}

:root[data-theme] .site-shell #step1 .submission-row:not(.credential-ready)::before {
  border-style: dashed;
}

/* ---------- Fields ---------- */

:root[data-theme] .site-shell #step1 .submission-row > [data-cdk-field] > input {
  min-height: 58px;
  border-width: 1.5px;
  border-color: color-mix(in srgb, var(--ui-text-muted) 40%, var(--ui-surface));
  border-radius: var(--xd-radius-field);
  background-color: var(--ui-surface);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04);
  font-size: 17px;
  letter-spacing: .05em;
}

:root[data-theme] .site-shell #step1 .submission-row > [data-cdk-field]:has(> .cdk-plan-display:not(.hidden)) > input {
  border-width: 1.5px;
  border-color: color-mix(in srgb, #22c55e 55%, var(--ui-border));
}

:root[data-theme] .site-shell #step1 .submission-row > [data-cdk-field] > input:hover {
  background-color: var(--ui-surface);
}

:root[data-theme] .site-shell #step1 .submission-row > [data-cdk-field] > input:focus,
:root[data-theme] .site-shell #step1 .submission-row .session-entry > textarea:focus {
  border-color: var(--ui-primary);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ui-primary) 14%, transparent);
}

/* recognised plan: gradient badge with a check */
:root[data-theme] .site-shell #step1 .submission-row > [data-cdk-field]:has(> .cdk-plan-display:not(.hidden)) > .cdk-plan-display {
  min-height: 58px;
  padding: 6px 18px 6px 56px;
  border: 1px solid rgba(34, 197, 94, .25);
  background:
    radial-gradient(120px 60px at 100% 0%, rgba(34, 197, 94, .18), transparent 70%),
    var(--xd-stub);
}

:root[data-theme] .site-shell #step1 .submission-row > [data-cdk-field]:has(> .cdk-plan-display:not(.hidden)) > .cdk-plan-display::before {
  content: "★";
  position: absolute;
  top: 50%;
  left: 16px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-top: -14px;
  border-radius: 9px;
  color: #fff;
  background: var(--xd-ok-grad);
  box-shadow: 0 4px 10px -3px rgba(22, 163, 74, .55);
  font-size: 14px;
  line-height: 1;
}

:root[data-theme] .site-shell #step1 .cdk-plan-display strong {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.01em;
}

:root[data-theme] .site-shell #step1 .field-hint.ok {
  color: var(--ui-success-text);
  font-weight: 500;
}

/* ---------- Step 2 actions ---------- */

:root[data-theme] .site-shell #step1 .session-entry-help {
  color: var(--ui-text-muted);
}

:root[data-theme] .site-shell #step1 .session-entry-actions {
  gap: 10px;
  margin-top: 8px;
}

:root[data-theme] .site-shell .primary-button {
  background: var(--xd-accent-grad);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .06), 0 10px 22px -10px color-mix(in srgb, var(--xd-accent-a) 80%, transparent);
  transition: filter .15s ease, box-shadow .2s ease, transform .15s ease;
}

:root[data-theme] .site-shell .primary-button:hover {
  background: var(--xd-accent-grad);
  filter: brightness(1.07);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .06), 0 14px 28px -10px color-mix(in srgb, var(--xd-accent-a) 85%, transparent);
}

:root[data-theme] .site-shell .success-button {
  background: var(--xd-ok-grad);
}

/* inline 3-step guide: visible as soon as the CDK passes */
:root[data-theme] .site-shell #step1 .session-inline-steps {
  display: grid;
  gap: 0;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--xd-hair);
  border-radius: 16px;
  background: var(--ui-surface);
  overflow: hidden;
}

:root[data-theme] .site-shell #step1 .session-inline-steps > li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 14px 16px;
}

:root[data-theme] .site-shell #step1 .session-inline-steps > li + li {
  border-top: 1px solid var(--xd-hair);
}

/* the step that does the real work gets a soft highlight */
:root[data-theme] .site-shell #step1 .session-inline-steps > li:nth-child(2) {
  background: color-mix(in srgb, var(--ui-primary) 5%, var(--ui-surface));
}

:root[data-theme] .site-shell #step1 .session-inline-steps > li > b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  color: var(--ui-primary-strong);
  background: color-mix(in srgb, var(--ui-primary) 12%, var(--ui-surface));
  font-size: 13.5px;
  font-weight: 750;
  line-height: 1;
}

:root[data-theme] .site-shell #step1 .session-inline-steps > li > p {
  display: grid;
  gap: 2px;
  min-width: 0;
  margin: 0;
}

:root[data-theme] .site-shell #step1 .session-inline-steps strong {
  color: var(--ui-text);
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.4;
}

:root[data-theme] .site-shell #step1 .session-inline-steps small {
  color: var(--ui-text-muted);
  font-size: 12.5px;
  line-height: 1.6;
}

:root[data-theme] .site-shell #step1 .session-inline-steps kbd {
  display: inline-block;
  min-width: 22px;
  margin: 0 2px;
  padding: 0 5px;
  border: 1px solid var(--ui-border);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--ui-text);
  background: var(--ui-surface);
  font-family: var(--xd-mono);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

:root[data-theme] .site-shell #step1 .session-inline-mobile {
  display: block;
}

:root[data-theme] .site-shell #step1 .session-inline-steps > li > :is(a, button) {
  min-width: 150px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 11px;
  font-size: 13.5px;
  text-decoration: none;
  white-space: nowrap;
}

:root[data-theme] .site-shell #step1 .session-inline-steps .soft-button {
  border-color: color-mix(in srgb, var(--ui-text) 12%, var(--ui-border));
  background: var(--ui-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

:root[data-theme] .site-shell #step1 .session-inline-steps .soft-button:hover {
  border-color: color-mix(in srgb, var(--ui-primary) 45%, var(--ui-border));
  color: var(--ui-primary-strong);
  background: color-mix(in srgb, var(--ui-primary) 5%, var(--ui-surface));
}

/* secondary row under the steps: tutorial / file import / other ways */
:root[data-theme] .site-shell #step1 .session-entry-actions {
  margin-top: 2px;
  gap: 4px;
}

:root[data-theme] .site-shell #step1 .session-entry-actions .ghost-button.compact,
:root[data-theme] .site-shell #step1 .session-entry-actions .soft-button.compact,
:root[data-theme] .site-shell #step1 .session-more-actions > summary {
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  color: var(--ui-text-muted);
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  font-weight: 500;
}

:root[data-theme] .site-shell #step1 .session-entry-actions .session-guide-link {
  color: var(--ui-primary-strong);
}

:root[data-theme] .site-shell #step1 .session-entry-actions .session-guide-link::before {
  content: "▶";
  font-size: 9px;
}

:root[data-theme] .site-shell #step1 .session-entry-actions .ghost-button.compact:hover,
:root[data-theme] .site-shell #step1 .session-entry-actions .soft-button.compact:hover {
  color: var(--ui-text);
  background: var(--xd-fill);
}

:root[data-theme] .site-shell #step1 [data-upload-session]::before {
  content: "⇪";
  font-size: 14px;
  opacity: .75;
}

/* paste area: soft drop zone */
:root[data-theme] .site-shell #step1 .submission-row .session-entry > textarea {
  min-height: 128px;
  margin-top: 10px;
  padding: 16px 18px;
  border: 1.5px dashed color-mix(in srgb, var(--ui-primary) 35%, var(--ui-border));
  border-radius: 16px;
  background:
    linear-gradient(var(--xd-input-fill), var(--xd-input-fill)) padding-box;
}

:root[data-theme] .site-shell #step1 .submission-row .session-entry > textarea:hover {
  border-color: var(--ui-primary);
  background: color-mix(in srgb, var(--ui-primary) 8%, var(--ui-surface));
}

:root[data-theme] .site-shell #step1 .submission-row .session-entry > textarea:focus {
  border-style: solid;
}

:root[data-theme] .site-shell #step1 .submission-row .session-entry > textarea::placeholder {
  color: color-mix(in srgb, var(--ui-primary) 55%, var(--ui-text-muted));
}

/* recognised account card */
:root[data-theme] .site-shell #step1 .submission-row.session-ready > .session-recognized {
  border: 1px solid rgba(34, 197, 94, .25);
  border-radius: 16px;
}

/* submit bar */
:root[data-theme] .site-shell #step1 .customer-submit-bar .primary-button {
  min-height: 50px;
  padding: 0 28px;
  border-radius: 14px;
  font-size: 15.5px;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  :root[data-theme] .site-shell *,
  :root[data-theme] .site-shell *::before {
    transition: none !important;
  }
}

/* ---------- Small screens ---------- */

@media (max-width: 600px) {
  :root[data-theme] .site-shell .redemption-product-tabs {
    display: flex;
    width: 100%;
    margin-top: 18px;
  }

  :root[data-theme] .site-shell .redemption-product-tab {
    flex: 1;
    padding: 0 10px;
    font-size: 14px;
  }

  :root[data-theme] .site-shell .customer-hero-steps {
    padding: 6px 10px;
  }

  :root[data-theme] .site-shell #step1 .session-inline-steps > li {
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px 12px;
    padding: 12px 14px;
  }

  :root[data-theme] .site-shell #step1 .session-inline-steps > li > :is(a, button) {
    grid-column: 2;
    justify-self: start;
    width: 100%;
  }

  :root[data-theme] .site-shell #step1 .submission-row > [data-cdk-field]:has(> .cdk-plan-display:not(.hidden)) > .cdk-plan-display {
    padding-left: 52px;
  }
}

/* ==========================================================================
   Declutter pass: drop copy that repeats what the layout already shows.
   Markup stays intact (tests + JS depend on it); this only hides/tightens.
   ========================================================================== */

/* the card's own left timeline already shows "1 CDK → 2 account" */
:root[data-theme] .site-shell .customer-hero-panel .customer-hero-steps {
  display: none;
}

:root[data-theme] .site-shell .customer-hero-panel {
  margin: 28px 0 20px;
}

:root[data-theme] .site-shell .customer-hero-panel .hero-copy h1 {
  margin: 12px 0 6px;
}

/* "开始兑换" subtitle repeats the hero line */
:root[data-theme] .site-shell #step1 #submissionModeDescription,
:root[data-theme] .site-shell #step1 .session-entry-help {
  display: none;
}

:root[data-theme] .site-shell #step1 .section-heading {
  align-items: center;
  margin-bottom: 18px;
}

/* inline steps: one line per step, hints only where they carry information */
:root[data-theme] .site-shell #step1 .session-inline-steps {
  margin-top: 4px;
  border-radius: 14px;
}

:root[data-theme] .site-shell #step1 .session-inline-steps > li {
  gap: 12px;
  padding: 11px 14px;
}

:root[data-theme] .site-shell #step1 .session-inline-steps > li:nth-child(1) small,
:root[data-theme] .site-shell #step1 .session-inline-steps > li:nth-child(3) small {
  display: none;
}

:root[data-theme] .site-shell #step1 .session-inline-steps > li > b {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  font-size: 12.5px;
}

:root[data-theme] .site-shell #step1 .session-inline-steps > li > :is(a, button) {
  min-width: 132px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 13px;
}

/* desktop users get the keyboard hint, touch users get the long-press hint */
@media (hover: hover) and (pointer: fine) {
  :root[data-theme] .site-shell #step1 .session-inline-mobile {
    display: none;
  }
}

:root[data-theme] .site-shell #step1 .session-entry-actions {
  margin-top: 6px;
}

:root[data-theme] .site-shell #step1 .submission-row .session-entry > textarea {
  min-height: 96px;
  margin-top: 6px;
  padding: 14px 16px;
  border-radius: 14px;
}

@media (max-width: 600px) {
  :root[data-theme] .site-shell #step1 .session-inline-steps > li {
    padding: 11px 12px;
  }
}

/* ==========================================================================
   Order progress: one connected stepper instead of a loose bar + label row.
   The track is pulled up behind the step nodes and runs node 1 → node 4, so
   app.js percents (12 / 38 / 68 / 90 / 100) read as "heading to next step".
   ========================================================================== */

:root[data-theme] .site-shell :is(#step3, #claudeOrderCard, #grokOrderCard) .customer-order-progress {
  --op-node: 30px;
  --op-line: 4px;
  --op-tone: var(--xd-accent-a);
  --op-fill: var(--xd-accent-grad);
  margin: 22px 0 10px;
  padding: 20px 22px 18px;
  border: 1px solid var(--xd-hair);
  border-radius: 18px;
  background:
    radial-gradient(420px 140px at 0% 0%, color-mix(in srgb, var(--op-tone) 9%, transparent), transparent 70%),
    var(--ui-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

:root[data-theme] .site-shell :is(#step3, #claudeOrderCard, #grokOrderCard) .customer-order-progress[data-status="success"] {
  --op-tone: #16a34a;
  --op-fill: var(--xd-ok-grad);
  border-color: rgba(34, 197, 94, .28);
}

:root[data-theme] .site-shell :is(#step3, #claudeOrderCard, #grokOrderCard) .customer-order-progress[data-status="failed"] {
  --op-tone: #dc2626;
  --op-fill: linear-gradient(90deg, #dc2626, #f87171);
  border-color: rgba(220, 38, 38, .26);
}

:root[data-theme] .site-shell :is(#step3, #claudeOrderCard, #grokOrderCard) .customer-order-progress[data-status="review"] {
  --op-tone: #d97706;
  --op-fill: linear-gradient(90deg, #d97706, #fbbf24);
  border-color: rgba(217, 119, 6, .28);
}

/* copy block */
:root[data-theme] .site-shell :is(#step3, #claudeOrderCard, #grokOrderCard) .customer-order-progress-copy {
  gap: 4px;
}

:root[data-theme] .site-shell :is(#step3, #claudeOrderCard, #grokOrderCard) .customer-order-progress-copy > span {
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--op-tone);
  background: color-mix(in srgb, var(--op-tone) 11%, var(--ui-surface));
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .02em;
}

:root[data-theme] .site-shell :is(#step3, #claudeOrderCard, #grokOrderCard) .customer-order-progress-copy > strong {
  margin-top: 6px;
  color: var(--ui-text);
  font-size: 17px;
  font-weight: 700;
}

:root[data-theme] .site-shell :is(#step3, #claudeOrderCard, #grokOrderCard) .customer-order-progress-copy > small {
  color: var(--ui-text-muted);
  font-size: 13px;
}

/* track: spans node 1 centre → node 4 centre, sits behind the nodes */
:root[data-theme] .site-shell :is(#step3, #claudeOrderCard, #grokOrderCard) .customer-order-progress-track {
  position: relative;
  z-index: 0;
  height: var(--op-line);
  margin: 22px 12.5% 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ui-text) 9%, var(--ui-surface));
}

:root[data-theme] .site-shell :is(#step3, #claudeOrderCard, #grokOrderCard) .customer-order-progress-track > span {
  background: var(--op-fill);
  box-shadow: 0 0 10px color-mix(in srgb, var(--op-tone) 35%, transparent);
  transition: width .6s cubic-bezier(.22, 1, .36, 1);
}

/* steps: node on top, label underneath */
:root[data-theme] .site-shell :is(#step3, #claudeOrderCard, #grokOrderCard) .customer-order-progress-steps {
  position: relative;
  z-index: 1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: calc((var(--op-node) + var(--op-line)) / -2);
}

:root[data-theme] .site-shell :is(#step3, #claudeOrderCard, #grokOrderCard) .customer-order-progress-steps li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  color: var(--ui-text-soft);
}

:root[data-theme] .site-shell :is(#step3, #claudeOrderCard, #grokOrderCard) .customer-order-progress-steps li > span {
  width: var(--op-node);
  height: var(--op-node);
  border: 1.5px solid color-mix(in srgb, var(--ui-text) 14%, var(--ui-surface));
  border-radius: 50%;
  color: var(--ui-text-soft);
  background: var(--ui-surface);
  box-shadow: 0 0 0 4px var(--ui-surface);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
  transition: background-color .3s ease, border-color .3s ease, box-shadow .3s ease;
}

:root[data-theme] .site-shell :is(#step3, #claudeOrderCard, #grokOrderCard) .customer-order-progress-steps li > strong {
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
}

/* done: filled tone with a check */
:root[data-theme] .site-shell :is(#step3, #claudeOrderCard, #grokOrderCard) .customer-order-progress-steps li.done {
  color: var(--ui-text-muted);
}

:root[data-theme] .site-shell :is(#step3, #claudeOrderCard, #grokOrderCard) .customer-order-progress-steps li.done > span {
  position: relative;
  border-color: transparent;
  color: transparent;
  background: var(--op-fill);
  font-size: 0;
}

:root[data-theme] .site-shell :is(#step3, #claudeOrderCard, #grokOrderCard) .customer-order-progress-steps li.done > span::before {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

:root[data-theme] .site-shell :is(#step3, #claudeOrderCard, #grokOrderCard) .customer-order-progress[data-status="pending"] .customer-order-progress-steps li.done > span {
  background: var(--xd-ok-grad);
}

/* active: accent node with a breathing halo */
:root[data-theme] .site-shell :is(#step3, #claudeOrderCard, #grokOrderCard) .customer-order-progress-steps li.active {
  color: var(--ui-text);
}

:root[data-theme] .site-shell :is(#step3, #claudeOrderCard, #grokOrderCard) .customer-order-progress-steps li.active > span {
  border-color: transparent;
  color: #fff;
  background: var(--op-fill);
  box-shadow: 0 0 0 4px var(--ui-surface), 0 0 0 7px color-mix(in srgb, var(--op-tone) 22%, transparent);
  animation: xdProgressHalo 1.8s ease-in-out infinite;
}

:root[data-theme] .site-shell :is(#step3, #claudeOrderCard, #grokOrderCard) .customer-order-progress-steps li.active > strong {
  font-weight: 700;
}

@keyframes xdProgressHalo {
  0%, 100% { box-shadow: 0 0 0 4px var(--ui-surface), 0 0 0 6px color-mix(in srgb, var(--op-tone) 26%, transparent); }
  50% { box-shadow: 0 0 0 4px var(--ui-surface), 0 0 0 10px color-mix(in srgb, var(--op-tone) 8%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  :root[data-theme] .site-shell :is(#step3, #claudeOrderCard, #grokOrderCard) .customer-order-progress-steps li.active > span {
    animation: none;
  }
}

@media (max-width: 600px) {
  :root[data-theme] .site-shell :is(#step3, #claudeOrderCard, #grokOrderCard) .customer-order-progress {
    --op-node: 28px;
    padding: 16px 14px 14px;
  }

  :root[data-theme] .site-shell :is(#step3, #claudeOrderCard, #grokOrderCard) .customer-order-progress-steps li > strong {
    font-size: 12px;
  }
}

/* ==========================================================================
   Colour roles — keep blue for "do the next step", give everything else
   its own tone so the page is not one gradient end to end.
     promo   → warm sunset   (upgrade entry)
     brand   → emerald       (product pill)
     display → blue→violet→magenta (headline highlight)
     nav     → neutral raised segment (product tabs)
   ========================================================================== */

:root[data-theme] .site-shell {
  --xd-promo-grad: linear-gradient(135deg, #ea580c 0%, #e11d48 100%);
  --xd-display-grad: linear-gradient(100deg, #2563eb 0%, #7c3aed 55%, #c026d3 100%);
}

:root[data-theme="black"] .site-shell {
  --xd-display-grad: linear-gradient(100deg, #60a5fa 0%, #a78bfa 55%, #e879f9 100%);
}

/* promo: upgrade entry */
:root[data-theme] .site-shell .top-actions #upgradeEntry,
:root[data-theme] .site-shell .top-actions #upgradeEntry:hover {
  background-color: #e11d48;
  background-image: var(--xd-promo-grad);
}

:root[data-theme] .site-shell .top-actions #upgradeEntry {
  box-shadow: 0 6px 18px -6px rgba(225, 29, 72, .55);
}

:root[data-theme] .site-shell .top-actions #upgradeEntry:hover {
  box-shadow: 0 10px 24px -8px rgba(225, 29, 72, .6);
}

:root[data-theme] .site-shell .top-actions #upgradeEntry .upgrade-entry-symbol {
  background: rgba(255, 255, 255, .2);
}

/* nav: product tabs as a neutral segmented control */
:root[data-theme] .site-shell .redemption-product-tabs {
  background: color-mix(in srgb, var(--ui-text) 5%, var(--ui-surface));
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .05);
}

:root[data-theme] .site-shell .redemption-product-tab[aria-selected="true"] {
  color: var(--ui-text);
  background: var(--ui-surface);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 4px 12px -4px rgba(15, 23, 42, .12);
  font-weight: 700;
}

:root[data-theme="black"] .site-shell .redemption-product-tab[aria-selected="true"] {
  background: color-mix(in srgb, var(--ui-text) 12%, var(--ui-surface));
}

/* small brand-coloured underline on the active tab */
:root[data-theme] .site-shell .redemption-product-tab[aria-selected="true"]::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-radius: 50%;
  background: #10a37f;
}

:root[data-theme] .site-shell #claudeRedemptionTab[aria-selected="true"]::after {
  background: #d97757;
}

/* brand: product pill in emerald, matching its live dot */
:root[data-theme] .site-shell .customer-hero-panel .pill {
  border-color: rgba(16, 163, 127, .28);
  color: #047857;
  background: color-mix(in srgb, #10a37f 9%, var(--ui-surface));
}

:root[data-theme="black"] .site-shell .customer-hero-panel .pill {
  color: #34d399;
}

/* display: headline highlight */
:root[data-theme] .site-shell .customer-hero-panel .hero-copy h1 span,
.claude-redemption-hero h1 span {
  background: var(--xd-display-grad);
  -webkit-background-clip: text;
  background-clip: text;
}

/* neutral: batch add is a utility, not an accent */
:root[data-theme] .site-shell #step1 #addSubmissionRow {
  border-color: color-mix(in srgb, var(--ui-text) 18%, transparent);
  color: var(--ui-text-muted);
  background: transparent;
}

:root[data-theme] .site-shell #step1 #addSubmissionRow:hover {
  border-color: color-mix(in srgb, var(--ui-text) 30%, transparent);
  color: var(--ui-text);
  background: color-mix(in srgb, var(--ui-text) 4%, transparent);
}

/* ==========================================================================
   Step 2 reading order: steps → paste box → status → fallbacks.
   Sub-step numbers go neutral so they don't read as siblings of the big "2".
   ========================================================================== */

:root[data-theme] .site-shell #step1 .session-entry > .customer-step-label { order: 0; }
:root[data-theme] .site-shell #step1 .session-entry > .session-entry-help { order: 1; }
:root[data-theme] .site-shell #step1 .session-entry > .session-inline-steps { order: 2; }
:root[data-theme] .site-shell #step1 .session-entry > textarea { order: 3; }
:root[data-theme] .site-shell #step1 .session-entry > [data-session-status] { order: 4; }
:root[data-theme] .site-shell #step1 .session-entry > .session-entry-actions { order: 5; }

/* sub-step markers: small neutral circles */
:root[data-theme] .site-shell #step1 .session-inline-steps > li > b {
  width: 22px;
  height: 22px;
  border: 1.5px solid color-mix(in srgb, var(--ui-text) 16%, var(--ui-surface));
  border-radius: 50%;
  color: var(--ui-text-muted);
  background: var(--ui-surface);
  font-size: 12px;
  font-weight: 650;
}

:root[data-theme] .site-shell #step1 .session-inline-steps > li {
  grid-template-columns: 22px minmax(0, 1fr) auto;
}

/* the key step keeps its highlight; its marker picks up the accent */
:root[data-theme] .site-shell #step1 .session-inline-steps > li:nth-child(2) > b {
  border-color: transparent;
  color: #fff;
  background: var(--xd-accent-grad);
}

/* paste box sits right under "回到本页，一键识别" */
:root[data-theme] .site-shell #step1 .submission-row .session-entry > textarea {
  min-height: 88px;
  margin-top: 4px;
}

:root[data-theme] .site-shell #step1 .session-entry > [data-session-status] {
  margin: 0;
  font-size: 12.5px;
}

/* fallbacks: one quiet line at the bottom, divided from the main path */
:root[data-theme] .site-shell #step1 .session-entry > .session-entry-actions {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed var(--xd-hair);
}

:root[data-theme] .site-shell #step1 .session-entry-actions .ghost-button.compact,
:root[data-theme] .site-shell #step1 .session-entry-actions .soft-button.compact,
:root[data-theme] .site-shell #step1 .session-more-actions > summary {
  min-height: 32px;
  font-size: 12.5px;
}

@media (max-width: 600px) {
  :root[data-theme] .site-shell #step1 .session-inline-steps > li {
    grid-template-columns: 22px minmax(0, 1fr);
  }
}

/* ==========================================================================
   Bottom of step 2: three different kinds of information, three looks.
     status line  → small status bar with an icon, tinted by state
     fallbacks    → outlined mini buttons (clearly clickable)
     chosen file  → green file chip pushed to the right
   ========================================================================== */

/* status line */
:root[data-theme] .site-shell #step1 .session-entry > [data-session-status] {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 10px;
  color: var(--ui-text-muted);
  background: color-mix(in srgb, var(--ui-text) 3.5%, var(--ui-surface));
  font-size: 12.5px;
  line-height: 1.5;
}

:root[data-theme] .site-shell #step1 .session-entry > [data-session-status]:empty {
  display: none;
}

:root[data-theme] .site-shell #step1 .session-entry > [data-session-status]::before {
  content: "i";
  display: grid;
  place-items: center;
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  color: var(--ui-surface);
  background: color-mix(in srgb, var(--ui-text) 35%, var(--ui-surface));
  font-size: 10.5px;
  font-weight: 800;
  font-style: italic;
  line-height: 1;
}

:root[data-theme] .site-shell #step1 .session-entry > [data-session-status].checking {
  color: var(--ui-primary-strong, var(--ui-primary));
  background: color-mix(in srgb, var(--ui-primary) 8%, var(--ui-surface));
}

:root[data-theme] .site-shell #step1 .session-entry > [data-session-status].checking::before {
  content: "";
  border: 2px solid color-mix(in srgb, var(--ui-primary) 25%, transparent);
  border-top-color: var(--ui-primary);
  background: none;
  animation: xdStatusSpin .8s linear infinite;
}

:root[data-theme] .site-shell #step1 .session-entry > [data-session-status].ok {
  color: #15803d;
  background: color-mix(in srgb, #22c55e 10%, var(--ui-surface));
}

:root[data-theme] .site-shell #step1 .session-entry > [data-session-status].ok::before {
  content: "✓";
  color: #fff;
  background: #16a34a;
  font-style: normal;
}

:root[data-theme] .site-shell #step1 .session-entry > [data-session-status].error {
  color: var(--ui-danger-text, #b91c1c);
  background: color-mix(in srgb, var(--ui-danger, #ef4444) 8%, var(--ui-surface));
}

:root[data-theme] .site-shell #step1 .session-entry > [data-session-status].error::before {
  content: "!";
  color: #fff;
  background: #dc2626;
  font-style: normal;
}

:root[data-theme="black"] .site-shell #step1 .session-entry > [data-session-status].ok {
  color: #4ade80;
}

@keyframes xdStatusSpin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  :root[data-theme] .site-shell #step1 .session-entry > [data-session-status].checking::before {
    animation: none;
  }
}

/* fallbacks: outlined mini buttons */
:root[data-theme] .site-shell #step1 .session-entry > .session-entry-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border-top: 0;
  padding-top: 2px;
}

:root[data-theme] .site-shell #step1 .session-entry-actions .ghost-button.compact,
:root[data-theme] .site-shell #step1 .session-entry-actions .soft-button.compact,
:root[data-theme] .site-shell #step1 .session-more-actions > summary {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--xd-hair);
  border-radius: 9px;
  color: var(--ui-text-muted);
  background: var(--ui-surface);
  font-size: 12.5px;
}

:root[data-theme] .site-shell #step1 .session-entry-actions .ghost-button.compact:hover,
:root[data-theme] .site-shell #step1 .session-entry-actions .soft-button.compact:hover,
:root[data-theme] .site-shell #step1 .session-more-actions > summary:hover {
  border-color: color-mix(in srgb, var(--ui-primary) 40%, var(--ui-border));
  color: var(--ui-primary-strong, var(--ui-primary));
  background: color-mix(in srgb, var(--ui-primary) 5%, var(--ui-surface));
}

/* chosen file: a chip, not another link */
:root[data-theme] .site-shell #step1 .session-entry-actions > .session-file-name:not(.hidden) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 260px;
  min-height: 32px;
  margin-left: auto;
  padding: 0 12px 0 10px;
  overflow: hidden;
  border: 1px solid rgba(34, 197, 94, .3);
  border-radius: 999px;
  color: #15803d;
  background: color-mix(in srgb, #22c55e 9%, var(--ui-surface));
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

:root[data-theme] .site-shell #step1 .session-entry-actions > .session-file-name:not(.hidden)::before {
  content: "";
  flex: none;
  width: 13px;
  height: 13px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z'/%3E%3Cpath d='M14 3v6h6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z'/%3E%3Cpath d='M14 3v6h6'/%3E%3C/svg%3E") center / contain no-repeat;
}

:root[data-theme="black"] .site-shell #step1 .session-entry-actions > .session-file-name:not(.hidden) {
  color: #4ade80;
}

@media (max-width: 600px) {
  :root[data-theme] .site-shell #step1 .session-entry-actions > .session-file-name:not(.hidden) {
    max-width: 100%;
    margin-left: 0;
  }
}

/* Used CDKs are a warning state, not a successful validation state. */
:root[data-theme] .site-shell #step1 .submission-row[data-cdk-state="used"] > [data-cdk-field] > input {
  border-color: color-mix(in srgb, var(--ui-warning) 62%, var(--ui-border));
  background-color: color-mix(in srgb, var(--ui-warning-soft) 45%, var(--ui-surface));
}

:root[data-theme] .site-shell #step1 .submission-row[data-cdk-state="used"] > [data-cdk-field] > .cdk-plan-display {
  border: 1px solid color-mix(in srgb, var(--ui-warning) 34%, transparent);
  color: var(--ui-warning-text);
  background:
    radial-gradient(120px 60px at 100% 0%, color-mix(in srgb, var(--ui-warning) 18%, transparent), transparent 70%),
    var(--ui-warning-soft);
}

:root[data-theme] .site-shell #step1 .submission-row[data-cdk-state="used"] > [data-cdk-field] > .cdk-plan-display span,
:root[data-theme] .site-shell #step1 .submission-row[data-cdk-state="used"] > [data-cdk-field] > .cdk-plan-display strong {
  color: var(--ui-warning-text);
}

:root[data-theme] .site-shell #step1 .submission-row[data-cdk-state="used"] > [data-cdk-field] > .cdk-plan-display::before {
  background: var(--ui-warning);
  box-shadow: 0 4px 10px -3px color-mix(in srgb, var(--ui-warning) 55%, transparent);
}

:root[data-theme] .site-shell #step1 .submission-row[data-cdk-state="used"] .field-hint.warning {
  color: var(--ui-warning-text);
  font-weight: 600;
}

:root[data-theme] .site-shell #step1 .submission-row[data-cdk-state="used"] .field-hint.warning::before {
  content: "⚠ ";
  font-weight: 700;
}
