/* Homepage-only layout. All redemption and order state selectors remain intact. */
:root[data-theme] .site-shell.redemption-compact { --xd-pad: 24px; --xd-radius-card: 18px; }
:root[data-theme] .site-shell.redemption-compact .topbar {
  min-height: 64px; padding: 10px max(24px, calc((100% - 1120px) / 2));
  gap: 20px; overflow: visible; z-index: 40;
}
:root[data-theme] .site-shell.redemption-compact .top-actions {
  display: flex; flex: 0 1 auto; flex-wrap: nowrap; align-items: center;
  gap: 10px; width: auto; margin-left: auto;
}
:root[data-theme] .site-shell.redemption-compact .top-actions #upgradeEntry {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  min-width: 0; width: auto; min-height: 38px; margin: 0; padding: 0 12px; gap: 7px; white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--ui-primary) 24%, var(--ui-border));
  border-radius: 8px; color: var(--ui-primary-strong); background: color-mix(in srgb, var(--ui-primary) 6%, var(--ui-surface));
  box-shadow: none; transform: none; filter: none;
}
:root[data-theme] .site-shell.redemption-compact .top-actions #upgradeEntry:hover {
  border-color: var(--ui-primary); background: color-mix(in srgb, var(--ui-primary) 11%, var(--ui-surface));
  box-shadow: none; transform: none; filter: none;
}
:root[data-theme] .site-shell.redemption-compact #upgradeEntry .upgrade-entry-symbol {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 20px;
  width: 20px; height: 20px; min-width: 20px; border-radius: 5px; color: inherit; background: transparent; line-height: 1;
}
:root[data-theme] .site-shell.redemption-compact #upgradeEntry .upgrade-entry-symbol svg { display: block; flex: none; }
:root[data-theme] .site-shell.redemption-compact #upgradeEntry .upgrade-entry-copy { display: inline-flex; align-items: center; }
:root[data-theme] .site-shell.redemption-compact #upgradeEntry .upgrade-entry-copy strong { color: inherit; font-size: 14px; font-weight: 600; line-height: 20px; }
:root[data-theme] .site-shell.redemption-compact #upgradeEntry :is(.upgrade-entry-copy small, .upgrade-entry-arrow) { display: none; }
:root[data-theme] .site-shell.redemption-compact .top-actions #invoiceEntry,
:root[data-theme] .site-shell.redemption-compact .top-actions #openQuery,
:root[data-theme] .site-shell.redemption-compact .more-tools > summary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 38px; padding: 0 12px; border: 1px solid var(--xd-hair); border-radius: 8px;
  color: var(--ui-text); background: var(--ui-surface); font-size: 14px; line-height: 1.4; cursor: pointer;
  margin: 0; text-decoration: none; white-space: nowrap;
}
:root[data-theme] .site-shell.redemption-compact .top-actions #invoiceEntry:hover,
:root[data-theme] .site-shell.redemption-compact .top-actions #openQuery:hover,
:root[data-theme] .site-shell.redemption-compact .more-tools > summary:hover { background: var(--xd-fill); }
.redemption-compact .more-tools { position: relative; flex: 0 0 auto; }
.redemption-compact .more-tools > summary { list-style: none; user-select: none; }
.redemption-compact .more-tools > summary::-webkit-details-marker { display: none; }
.redemption-compact .more-tools-chevron { width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.redemption-compact .more-tools[open] .more-tools-chevron { transform: rotate(225deg) translate(-1px, -1px); }
:root[data-theme] .site-shell.redemption-compact .more-tools-panel {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
  width: 264px; max-width: calc(100vw - 28px); max-height: calc(100dvh - 140px); overflow-y: auto;
  display: grid; gap: 4px; padding: 10px; border: 1px solid var(--ui-border); border-radius: 10px;
  color: var(--ui-text); background: var(--ui-surface); box-shadow: 0 12px 32px rgba(0, 0, 0, .16);
}
:root[data-theme] .site-shell.redemption-compact .more-tools:not([open]) .more-tools-panel { display: none; }
:root[data-theme] .site-shell.redemption-compact .top-actions .more-tools-panel :is(#openSub2ApiConverter, #frontAdminEntry) {
  display: flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; min-height: 40px;
  margin: 0; padding: 8px 10px; border: 0; border-radius: 6px; color: var(--ui-text); background: transparent;
  box-shadow: none; font: inherit; font-size: 14px; text-decoration: none;
}
:root[data-theme] .site-shell.redemption-compact .more-tools-panel #openSub2ApiConverter > span { margin-left: auto; color: var(--ui-text-muted); }
:root[data-theme] .site-shell.redemption-compact .top-actions .more-tools-panel :is(#openSub2ApiConverter, #frontAdminEntry):hover { background: var(--xd-fill); }
.redemption-compact .more-tools-appearance { display: grid; gap: 8px; margin: 5px 0; padding: 12px 10px; border-block: 1px solid var(--xd-hair); }
.redemption-compact .more-tools-label { color: var(--ui-text-muted); font-size: 12px; }
:root[data-theme] .site-shell.redemption-compact .top-actions .more-tools-panel .theme-switch {
  display: flex; align-items: center; gap: 3px; width: 100%; padding: 3px; margin: 0; border: 1px solid var(--xd-hair); border-radius: 7px;
}
:root[data-theme] .site-shell.redemption-compact .more-tools-panel .theme-switch button {
  display: block; flex: 1; min-width: 0; min-height: 34px; padding: 0 8px; border-radius: 5px; font-size: 13px;
}
.redemption-compact .more-tools-language { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px 10px; font-size: 13px; }
.redemption-compact .more-tools-panel #frontAdminEntry { border-top: 1px solid var(--xd-hair); }
.redemption-compact .top-actions :is(summary, a, button):focus-visible { outline: 2px solid var(--ui-primary); outline-offset: 2px; }

:root[data-theme] .site-shell.redemption-compact .redemption-product-tabs { margin-top: 22px; padding: 4px; border-radius: 12px; }
:root[data-theme] .site-shell.redemption-compact .redemption-product-tab { min-height: 38px; padding: 0 20px; border-radius: 8px; font-size: 14px; }
:root[data-theme] .site-shell.redemption-compact .customer-hero-panel,
:root[data-theme] .site-shell.redemption-compact .claude-redemption-hero { margin: 22px 0 18px; }
:root[data-theme] .site-shell.redemption-compact .customer-hero-panel .hero-copy h1,
:root[data-theme] .site-shell.redemption-compact .claude-redemption-hero h1 { margin: 10px 0 6px; font-size: 30px; line-height: 1.35; letter-spacing: 0; }
:root[data-theme] .site-shell.redemption-compact .customer-hero-panel .hero-copy p,
:root[data-theme] .site-shell.redemption-compact .claude-redemption-hero > p { margin: 0; font-size: 14px; line-height: 1.6; }
:root[data-theme] .site-shell.redemption-compact .customer-hero-panel .pill { padding: 3px 10px; font-size: 12px; }
:root[data-theme] .site-shell.redemption-compact #step1.flow-card,
:root[data-theme] .site-shell.redemption-compact #claudeEntryCard { padding: 24px; border-radius: 18px; }
:root[data-theme] .site-shell.redemption-compact #step1 .section-heading { margin-bottom: 16px; }
:root[data-theme] .site-shell.redemption-compact #step1 .section-heading h2,
:root[data-theme] .site-shell.redemption-compact #claudeEntryCard h2 { font-size: 19px; }
:root[data-theme] .site-shell.redemption-compact #step1 .submission-row > [data-cdk-field],
:root[data-theme] .site-shell.redemption-compact #step1 .submission-row > .submission-plan-field { padding-bottom: 18px; }
:root[data-theme] .site-shell.redemption-compact #step1 .submission-row:not(.credential-ready)::after {
  content: '验证通过后，继续填写订阅账号信息'; font-size: 14px; line-height: 1.6;
}
:root[data-theme] .site-shell.redemption-compact #step1 .submission-row > [data-cdk-field] > input,
:root[data-theme] .site-shell.redemption-compact #claudeRedemptionPanel .claude-text-input {
  min-height: 50px; padding: 12px 16px; border-radius: 10px; font-family: var(--xd-sans); font-size: 16px; line-height: 1.5; letter-spacing: 0;
}
:root[data-theme] .site-shell.redemption-compact :is(input, textarea)::placeholder { font-family: var(--xd-sans); font-size: 14px; letter-spacing: 0; font-style: normal; }
:root[data-theme] .site-shell.redemption-compact #claudeEntryCard .claude-card-description { margin-bottom: 18px; font-size: 14px; }
:root[data-theme] .site-shell.redemption-compact .claude-hero-steps { margin-top: 14px; }

@media (max-width: 640px) {
  :root[data-theme] .site-shell.redemption-compact { --xd-pad: 18px; }
  :root[data-theme] .site-shell.redemption-compact .topbar { padding: 10px 14px; gap: 12px; flex-wrap: wrap; }
  :root[data-theme] .site-shell.redemption-compact .top-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); flex: 1 0 100%; width: 100%; margin: 0; gap: 8px; }
  :root[data-theme] .site-shell.redemption-compact .top-actions :is(#upgradeEntry, #invoiceEntry, #openQuery) { width: 100%; min-width: 0; min-height: 40px; padding: 0 8px; }
  :root[data-theme] .site-shell.redemption-compact .more-tools > summary { width: 100%; min-height: 40px; padding: 0 12px; }
  :root[data-theme] .site-shell.redemption-compact .redemption-product-tabs { display: flex; width: 100%; margin-top: 18px; gap: 2px; padding: 4px; }
  :root[data-theme] .site-shell.redemption-compact .redemption-product-tab { flex: 1; padding: 0 8px; min-height: 38px; font-size: 13px; white-space: nowrap; }
  :root[data-theme] .site-shell.redemption-compact .redemption-product-tab[aria-selected='true']::after { width: 5px; height: 5px; margin-left: 5px; }
  :root[data-theme] .site-shell.redemption-compact .customer-hero-panel,
  :root[data-theme] .site-shell.redemption-compact .claude-redemption-hero { margin: 18px 0 16px; }
  :root[data-theme] .site-shell.redemption-compact .customer-hero-panel .hero-copy h1,
  :root[data-theme] .site-shell.redemption-compact .claude-redemption-hero h1 { font-size: 25px; }
  :root[data-theme] .site-shell.redemption-compact #step1.flow-card,
  :root[data-theme] .site-shell.redemption-compact #claudeEntryCard { padding: 20px 18px; border-radius: 16px; }
}
@media (max-width: 360px) {
  :root[data-theme] .site-shell.redemption-compact .customer-hero-panel .hero-copy h1,
  :root[data-theme] .site-shell.redemption-compact .claude-redemption-hero h1 { font-size: 22px; }
  :root[data-theme] .site-shell.redemption-compact .redemption-product-tab { padding-inline: 5px; font-size: 12px; }
}

/* Account guides preserve the two-step redemption flow. */
:root[data-theme] .redemption-compact .account-guide-steps { display: grid; gap: 0; margin: 12px 0 18px; padding: 0; list-style: none; }
:root[data-theme] .redemption-compact .account-guide-steps > li {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: start; gap: 10px 12px;
  padding: 14px 0; border-bottom: 1px solid var(--ui-border); min-width: 0;
}
:root[data-theme] .redemption-compact .account-guide-number {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  border-radius: 50%; background: var(--xd-fill); color: var(--ui-primary-strong); font-size: 12px; font-weight: 700;
}
:root[data-theme] .redemption-compact .account-guide-copy { min-width: 0; }
:root[data-theme] .redemption-compact .account-guide-copy > strong { display: block; color: var(--ui-text); font-size: 14px; line-height: 24px; font-weight: 600; }
:root[data-theme] .redemption-compact .account-guide-copy > p { margin: 3px 0 0; color: var(--ui-text-muted); font-size: 12px; line-height: 1.65; }
:root[data-theme] .redemption-compact .account-guide-steps > li:has(.account-guide-details) .account-guide-copy { grid-column: 2 / -1; }
:root[data-theme] .redemption-compact .account-guide-action {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; min-width: 0;
  margin: 2px 0 0; padding: 8px 12px; border: 1px solid var(--ui-border); border-radius: 8px;
  color: var(--ui-primary-strong); background: var(--ui-surface); font: 600 13px/1.5 var(--xd-sans);
  text-decoration: none; white-space: nowrap; box-shadow: none; cursor: pointer;
}
:root[data-theme] .redemption-compact .account-guide-action:disabled { opacity: .6; cursor: wait; }
:root[data-theme] .redemption-compact .account-guide-details { margin-top: 8px; font-size: 13px; line-height: 1.75; }
:root[data-theme] .redemption-compact .account-guide-details > summary { width: fit-content; padding: 4px 0; color: var(--ui-primary-strong); font-weight: 600; cursor: pointer; }
:root[data-theme] .redemption-compact .account-guide-tutorial { margin-top: 8px; padding: 12px 14px; border-left: 2px solid var(--ui-primary); background: var(--xd-fill); color: var(--ui-text); overflow-wrap: anywhere; }
:root[data-theme] .redemption-compact .account-guide-tutorial ol { margin: 0; padding-left: 19px; list-style: decimal; }
:root[data-theme] .redemption-compact .account-guide-tutorial li { display: list-item; padding: 0 0 7px 2px; }
:root[data-theme] .redemption-compact .account-guide-tutorial p { margin: 6px 0 0; color: var(--ui-text-muted); font-size: 12px; }
:root[data-theme] .redemption-compact .account-guide-tutorial :is(kbd, code) { font-size: 12px; font-family: inherit; font-weight: 600; overflow-wrap: anywhere; }
:root[data-theme] .redemption-compact .account-guide-feedback { margin: 0 0 12px; color: var(--ui-primary-strong); font-size: 13px; line-height: 1.65; }
:root[data-theme] .redemption-compact .account-guide-feedback:empty { display: none; }
:root[data-theme] .redemption-compact :is(.account-guide-action, .account-guide-details > summary):focus-visible { outline: 2px solid var(--ui-primary); outline-offset: 3px; }
@media (max-width: 640px) {
  :root[data-theme] .redemption-compact .account-guide-steps > li { grid-template-columns: 24px minmax(0, 1fr); gap: 8px 10px; }
  :root[data-theme] .redemption-compact .account-guide-action { grid-column: 2; justify-self: start; white-space: normal; text-align: left; }
  :root[data-theme] .redemption-compact .account-guide-tutorial { padding: 10px; }
}

/* Order results: compact feedback, readable details and right-aligned actions. */
:root[data-theme] .site-shell.redemption-compact #step3.flow-card { padding: 26px 24px 24px; }
:root[data-theme] .site-shell.redemption-compact #step3 .result-panel { row-gap: 0; }
:root[data-theme] .site-shell.redemption-compact #step3 .result-panel > h2 { font-size: 24px; letter-spacing: 0; }
:root[data-theme] .site-shell.redemption-compact #step3 .result-panel > p { color: var(--ui-text-muted); line-height: 1.65; }
:root[data-theme] .site-shell.redemption-compact :is(#step3, #grokOrderCard) .customer-order-progress[data-status="success"] {
  margin: 20px 0 12px; padding: 16px 14px 14px; border-radius: 10px;
  background: color-mix(in srgb, var(--ui-success) 5%, var(--ui-surface)); box-shadow: none;
}
:root[data-theme] .site-shell.redemption-compact :is(#step3, #grokOrderCard) .customer-order-progress[data-status="success"] .customer-order-progress-copy { display: none; }
:root[data-theme] .site-shell.redemption-compact :is(#step3, #grokOrderCard) .customer-order-progress[data-status="success"] .customer-order-progress-track { margin-top: 16px; }
:root[data-theme] .site-shell.redemption-compact #step3 .result-panel > dl {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; margin: 2px 0 8px;
}
:root[data-theme] .site-shell.redemption-compact #step3 .result-panel > dl > div {
  display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: start; gap: 12px;
  min-width: 0; min-height: 52px; padding: 14px 0; border: 0; border-bottom: 1px solid var(--ui-border);
  border-radius: 0; background: transparent;
}
:root[data-theme] .site-shell.redemption-compact #step3 .result-panel > dl dt { color: var(--ui-text-muted); font-size: 12px; line-height: 1.6; }
:root[data-theme] .site-shell.redemption-compact #step3 .result-panel > dl dd {
  min-width: 0; margin: 0; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere;
}
:root[data-theme] .site-shell.redemption-compact #step3 .result-actions {
  display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center;
  position: static; width: 100%; gap: 8px; margin: 12px 0 0; padding: 0; border: 0;
  border-radius: 0; background: transparent; box-shadow: none; backdrop-filter: none;
}
:root[data-theme] .site-shell.redemption-compact #step3 .result-actions > :is(button, a):not(.hidden):not([hidden]) {
  display: inline-flex; align-items: center; justify-content: center; grid-column: auto; order: 0;
  flex: 0 0 auto; width: auto; max-width: 100%; min-width: 72px; min-height: 36px; margin: 0; padding: 6px 14px;
  border: 1px solid var(--ui-border); border-radius: 6px; font-size: 13px; font-weight: 600;
  line-height: 1.4; text-align: center; text-decoration: none; white-space: normal; overflow-wrap: anywhere;
  box-shadow: none; transform: none; filter: none;
}
:root[data-theme] .site-shell.redemption-compact #step3 .result-actions #completeFlow {
  border-color: var(--ui-success); color: #fff; background: var(--ui-success);
}
:root[data-theme] .site-shell.redemption-compact #step3 .result-actions #orderInvoice {
  border-color: color-mix(in srgb, var(--ui-primary) 28%, var(--ui-border));
  color: var(--ui-primary-strong); background: color-mix(in srgb, var(--ui-primary) 7%, var(--ui-surface));
}
:root[data-theme="black"] .site-shell.redemption-compact #step3 .result-actions #completeFlow { color: #082617; }
:root[data-theme] .site-shell.redemption-compact #step3 .result-actions #newSubmissionButton {
  color: var(--ui-text); background: var(--ui-surface);
}
:root[data-theme] .site-shell.redemption-compact #step3 .result-actions:has(#resubmitOrder:not(.hidden), #completeFlow:not(.hidden)) > #newSubmissionButton {
  grid-column: auto; grid-row: auto; order: 0;
}
:root[data-theme] .site-shell.redemption-compact #step3 .result-actions > :is(button, a):focus-visible {
  outline: 2px solid var(--ui-primary); outline-offset: 3px;
}
@media (hover: hover) {
  :root[data-theme] .site-shell.redemption-compact #step3 .result-actions > :is(button, a):hover {
    filter: brightness(.97); transform: none; box-shadow: none;
  }
}
:root[data-theme] .site-shell.redemption-compact #step3 .result-panel[data-status="success"] .tracked-orders-panel:has(.tracked-orders-list > .tracked-order:only-child) { display: none; }
@media (max-width: 640px) {
  :root[data-theme] .site-shell.redemption-compact #step3.flow-card { padding: 22px 18px; }
  :root[data-theme] .site-shell.redemption-compact #step3 .result-panel > h2 { font-size: 22px; }
  :root[data-theme] .site-shell.redemption-compact #step3 .result-panel > dl { grid-template-columns: minmax(0, 1fr); }
  :root[data-theme] .site-shell.redemption-compact #step3 .result-actions { gap: 8px; }
  :root[data-theme] .site-shell.redemption-compact #step3 .result-actions > :is(button, a):not(.hidden):not([hidden]) { min-width: 0; padding-inline: 10px; }
  :root[data-theme] .site-shell.redemption-compact :is(#step3, #grokOrderCard) .customer-order-progress[data-status="success"] { padding-inline: 8px; }
  :root[data-theme] .site-shell.redemption-compact :is(#step3, #grokOrderCard) .customer-order-progress-steps li > strong { font-size: 11px; }
}
