:root {
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-2: #f8f9f6;
  --line: #e3e6e1;
  --line-strong: #c3c9c2;
  --ink: #1c1f1c;
  --ink-soft: #4e544f;
  --ink-muted: #727972;
  --green: #16794d;
  --green-hi: #11633e;
  --green-soft: #e9f4ed;
  --green-line: #c8e1d2;
  --amber: #a1640f;
  --amber-soft: #fdf4e3;
  --amber-line: #eeddbf;
  --red: #b42318;
  --sans: Inter, "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { color-scheme: light; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

a,
button { transition: color .18s ease, background-color .18s ease, border-color .18s ease, opacity .18s ease; }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

.container {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.partner-nav {
  height: 62px;
  border-bottom: 1px solid var(--line);
}

.partner-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand,
.back-home {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.brand { gap: 11px; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--green-line);
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.brand-mark.has-brand-logo {
  overflow: hidden;
  border: 0;
  background: transparent;
  box-shadow: 0 7px 16px -10px rgba(10, 70, 43, 0.8);
}

.brand-mark.has-brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-name { font-size: 15px; font-weight: 700; }

.back-home {
  gap: 6px;
  min-height: 34px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.back-home:hover { color: var(--green); }
.back-home svg { width: 15px; height: 15px; }

.partner-layout {
  display: grid;
  grid-template-columns: minmax(260px, 310px) minmax(0, 1fr);
  gap: 68px;
  align-items: start;
  padding: 66px 0 72px;
}

body.is-dashboard .program-intro { display: none; }

body.is-dashboard .partner-layout {
  grid-template-columns: minmax(0, 920px);
  justify-content: center;
  max-width: 968px;
  gap: 0;
  padding-top: 22px;
}

body.is-dashboard .tool-body { padding-top: 20px; padding-bottom: 20px; }
body.is-dashboard .tool-foot { display: none; }

.program-intro { padding-top: 10px; }

.eyebrow,
.panel-kicker,
.section-label {
  margin: 0;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
}

.program-intro h1 {
  margin: 18px 0 0;
  font-size: 48px;
  line-height: 1.08;
  letter-spacing: 0;
}

.intro-copy {
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.8;
}

.identity-note {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  margin-top: 28px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.identity-note-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--green-line);
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green);
}

.identity-note-icon svg { width: 17px; height: 17px; }
.identity-note strong,
.identity-note small { display: block; }
.identity-note strong { font-size: 12px; }
.identity-note small { margin-top: 3px; color: var(--ink-muted); font-size: 10px; line-height: 1.55; }

.mobile-program-rules { display: none; }

.qualification,
.reward-summary { margin-top: 30px; }

.qualification h2,
.reward-summary h2 {
  margin: 0 0 12px;
  font-size: 12px;
}

.qualification ol {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.qualification li {
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  min-height: 39px;
  border-bottom: 1px solid var(--line);
}

.qualification li span {
  color: var(--green);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
}

.qualification li p { margin: 0; color: var(--ink-soft); font-size: 11px; }

.reward-summary { border-top: 1px solid var(--line); }
.reward-summary h2 { margin-top: 17px; }

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 34px;
  color: var(--ink-muted);
  font-size: 10px;
}

.summary-row strong { color: var(--ink-soft); font-size: 11px; }
.summary-row.is-claude strong { color: var(--amber); }

.partner-tool {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 60px -32px rgba(28, 31, 28, .25);
  animation: tool-enter .45s ease-out both;
}

.tool-head,
.tool-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 24px;
  background: var(--surface-2);
}

.tool-head {
  min-height: 58px;
  border-bottom: 1px solid var(--line);
}

.tool-heading { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; }
.tool-no { color: var(--green); font-family: var(--mono); font-size: 10px; }

.tool-badge,
.share-code,
.points-balance {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
}

.tool-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin: 18px 24px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}

.tool-tab {
  min-height: 38px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.tool-tab.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(28, 31, 28, .08);
}

.tool-body { padding: 26px 28px 30px; }

.panel-lead h2,
.dashboard-head h2,
.modal-head h2 {
  margin: 6px 0 0;
  font-size: 20px;
  letter-spacing: 0;
}

.panel-lead > p:last-child {
  margin: 8px 0 0;
  color: var(--ink-muted);
  font-size: 12px;
}

.credential-map {
  margin-top: 24px;
  border-top: 1px solid var(--line);
}

.credential-map-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
}

.credential-type {
  display: inline-flex;
  justify-content: center;
  padding: 3px 5px;
  border: 1px solid var(--green-line);
  border-radius: 3px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 9px;
  font-weight: 700;
}

.credential-type.is-private {
  border-color: var(--amber-line);
  background: var(--amber-soft);
  color: var(--amber);
}

.credential-map-row strong,
.credential-map-row small { display: block; }
.credential-map-row strong { font-size: 12px; }
.credential-map-row small { margin-top: 2px; color: var(--ink-muted); font-size: 10px; }
.credential-map-row code { color: var(--ink-muted); font-family: var(--mono); font-size: 10px; }

.verification-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 70px;
  margin-top: 20px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}

.verification-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--green-line);
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green);
}

.verification-icon svg { width: 18px; height: 18px; }
.verification-row strong,
.verification-row small { display: block; }
.verification-row strong { font-size: 12px; }
.verification-row small { margin-top: 2px; color: var(--ink-muted); font-size: 10px; }
.verification-state { color: var(--green); font-family: var(--mono); font-size: 9px; font-weight: 700; }

.verification-state:not(.is-ready) { color: var(--amber); }
.partner-turnstile-box {
  grid-column: 2 / -1;
  min-height: 65px;
  overflow: hidden;
}
.partner-turnstile-box iframe { max-width: 100%; }

.confirm-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 18px;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 11px;
  line-height: 1.5;
}

.referral-table-empty {
  padding: 22px 12px;
  color: var(--ink-muted);
  font-size: 11px;
  text-align: center;
}

.confirm-row input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--green);
}

.primary-button,
.secondary-button,
.text-button,
.reward-button,
.icon-button {
  border-radius: 6px;
  cursor: pointer;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 50px;
  margin-top: 22px;
  padding: 0 16px;
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.primary-button:hover:not(:disabled) { border-color: var(--green-hi); background: var(--green-hi); }
.primary-button:disabled { cursor: not-allowed; opacity: .42; }
.primary-button svg { width: 17px; height: 17px; }
.primary-button.is-compact { width: auto; min-width: 112px; min-height: 40px; margin: 0; justify-content: center; }

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
}

.secondary-button:hover { border-color: var(--green); color: var(--green); }
.secondary-button svg { width: 14px; height: 14px; }

.icon-button {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
}

.icon-button:hover { border-color: var(--green); color: var(--green); }
.icon-button svg { width: 15px; height: 15px; }

.issued-status,
.modal-success {
  display: flex;
  align-items: center;
  gap: 11px;
}

.issued-status { margin-bottom: 22px; }
.issued-check {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
}
.issued-check svg { width: 18px; height: 18px; }
.issued-status strong,
.issued-status small,
.modal-success strong,
.modal-success small { display: block; }
.issued-status strong,
.modal-success strong { font-size: 13px; }
.issued-status small,
.modal-success small { margin-top: 2px; color: var(--ink-muted); font-size: 10px; }

.issued-fields { border-top: 1px solid var(--line); }

.issued-field {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr) 36px;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  border-bottom: 1px solid var(--line);
}

.issued-field > div span,
.issued-field > div small { display: block; }
.issued-field > div span { font-size: 11px; font-weight: 700; }
.issued-field > div small { margin-top: 2px; color: var(--ink-muted); font-size: 9px; }
.issued-field code {
  min-width: 0;
  overflow: hidden;
  color: var(--green);
  font-family: var(--mono);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.issued-field.is-secret { background: var(--amber-soft); }
.issued-field.is-secret code { color: var(--amber); }

.secret-warning,
.session-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0 0;
  color: var(--amber);
  font-size: 10px;
  line-height: 1.55;
}

.secret-warning svg,
.session-note svg { flex: 0 0 14px; width: 14px; height: 14px; margin-top: 1px; }
.session-note { color: var(--ink-muted); }

.management-key-field { display: block; margin-top: 24px; }
.management-key-field > span:first-child { display: block; margin-bottom: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 700; }

.secret-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
}

.secret-input-row:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22, 121, 77, .08); }

.secret-input-row input {
  min-width: 0;
  height: 48px;
  padding: 0 13px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
}

.secret-input-row .icon-button { align-self: center; border: 0; background: transparent; }

.dashboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.text-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 700;
}

.text-button:hover { border-color: var(--line-strong); color: var(--ink); }

.dashboard-share {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.dashboard-share-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 52px;
}

.dashboard-code-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.dashboard-code-line strong { font-family: var(--mono); font-size: 15px; }
.dashboard-code-line small { color: var(--green); font-size: 9px; font-weight: 700; }

.dashboard-share > code {
  display: block;
  min-width: 0;
  overflow: hidden;
  padding: 7px 10px;
  background: var(--surface-2);
  color: var(--green);
  font-family: var(--mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stats-strip > div { min-width: 0; padding: 10px 12px; }
.stats-strip > div:first-child { padding-left: 0; }
.stats-strip > div + div { border-left: 1px solid var(--line); }
.stats-strip span,
.stats-strip strong { display: block; }
.stats-strip span { color: var(--ink-muted); font-size: 9px; }
.stats-strip strong { margin-top: 4px; font-family: var(--mono); font-size: 17px; }

.observation-notice[hidden] { display: none; }

.observation-notice {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--amber-line);
  border-radius: 6px;
  background: var(--amber-soft);
}

.observation-notice-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--amber-line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--amber);
}

.observation-notice-icon svg { width: 16px; height: 16px; }
.observation-notice strong,
.observation-notice small { display: block; }
.observation-notice strong { color: var(--ink); font-size: 11px; }
.observation-notice small { margin-top: 3px; color: var(--amber); font-size: 9px; line-height: 1.55; }

.rewards-section { margin-top: 20px; }
.referrals-section { margin-top: 14px; }

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.section-heading h3 { margin: 4px 0 0; font-size: 13px; }

.reward-ladder {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.reward-option {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  min-height: 88px;
  padding: 10px 12px;
}

.reward-option + .reward-option { border-left: 1px solid var(--line); }
.reward-option.is-locked { opacity: .62; }
.reward-option-copy,
.reward-option-copy strong,
.reward-option-copy small { display: block; }
.reward-option-copy strong { font-size: 11px; }
.reward-option-copy small { margin-top: 3px; color: var(--ink-muted); font-size: 9px; }

.reward-option-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.reward-option-cost strong,
.reward-option-cost small { display: block; }
.reward-option-cost strong { font-family: var(--mono); font-size: 15px; }
.reward-option-cost small { color: var(--ink-muted); font-size: 8px; }

.reward-button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
}

.reward-button:hover:not(:disabled) { border-color: var(--green); color: var(--green); }
.reward-button:disabled { cursor: not-allowed; color: var(--ink-muted); opacity: .6; }

.claude-reward-band {
  position: relative;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 78px 88px;
  gap: 14px;
  align-items: center;
  min-height: 118px;
  margin-top: 15px;
  overflow: hidden;
  padding: 22px 16px 14px;
  border: 1px solid #294538;
  border-radius: 8px;
  background:
    radial-gradient(circle at 9% 12%, rgba(98, 228, 157, .19), transparent 27%),
    linear-gradient(118deg, #14241d 0%, #192a22 58%, #101d17 100%);
  box-shadow: 0 14px 30px rgba(20, 36, 29, .14);
  color: #f4fbf7;
}

.claude-reward-band::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
  background-size: 18px 18px;
  content: "";
  pointer-events: none;
}

.claude-reward-band > * { position: relative; z-index: 1; }

.monthly-reward-flag {
  position: absolute;
  top: 0;
  right: 0;
  padding: 4px 9px;
  border-bottom: 1px solid rgba(108, 226, 160, .35);
  border-left: 1px solid rgba(108, 226, 160, .35);
  border-radius: 0 7px 0 6px;
  background: rgba(108, 226, 160, .13);
  color: #86edb4;
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .14em;
}

.monthly-model-stack {
  position: relative;
  display: block;
  width: 62px;
  height: 52px;
}

.monthly-model-token {
  position: absolute;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 9px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .22);
}

.monthly-model-token.is-k3 {
  top: 0;
  left: 0;
  background: #77e8a9;
  color: #102219;
  transform: rotate(-4deg);
}

.monthly-model-token.is-claude {
  right: 0;
  bottom: 0;
  background: #f2e9dc;
  color: #643f2d;
  transform: rotate(4deg);
}

.monthly-model-token img {
  display: block;
  width: 27px;
  height: 27px;
  object-fit: contain;
}

.monthly-model-token.is-claude img {
  width: 25px;
  height: 25px;
}

.claude-reward-copy { min-width: 0; }
.claude-reward-copy > small { display: block; margin-top: 4px; color: #b8c8bf; font-size: 9px; }

.monthly-reward-kicker {
  display: block;
  margin-bottom: 3px;
  color: #75dfa4;
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .12em;
}

.claude-reward-band .reward-button:not(:disabled) {
  border-color: #76e4a7;
  background: #76e4a7;
  color: #102219;
}

.claude-reward-band .reward-button:not(:disabled):hover {
  border-color: #9af0bf;
  background: #9af0bf;
  color: #102219;
}

.claude-reward-band .reward-button:disabled {
  border-color: rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .07);
  color: #acbbb3;
}

.reward-title-line { display: flex; align-items: center; gap: 7px; }
.reward-title-line strong { color: #f7fbf8; font-size: 15px; letter-spacing: -.02em; }
.reward-title-line > span {
  padding: 2px 5px;
  border: 1px solid rgba(118, 228, 167, .28);
  border-radius: 3px;
  background: rgba(118, 228, 167, .08);
  color: #86edb4;
  font-size: 8px;
  font-weight: 700;
}

.reward-progress {
  display: block;
  height: 3px;
  margin-top: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, .12);
}

.reward-progress > span { display: block; width: 24%; height: 100%; background: #78e5a8; }

.claude-progress-value { text-align: right; }
.claude-progress-value strong,
.claude-progress-value small { display: block; }
.claude-progress-value strong { color: #f7fbf8; font-family: var(--mono); font-size: 12px; }
.claude-progress-value small { color: #9fb2a8; font-size: 8px; }

.monthly-reward-note {
  grid-column: 2 / 5;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  color: #8fa49a;
  font-size: 8px;
}

.claude-reward-band.is-focused,
.claude-reward-band.is-ready {
  border-color: rgba(118, 228, 167, .72);
  box-shadow: 0 0 0 3px rgba(83, 209, 139, .1), 0 18px 34px rgba(20, 36, 29, .18);
}

.referrals-section {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.referrals-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 50px;
  cursor: pointer;
  list-style: none;
}

.referrals-summary::-webkit-details-marker { display: none; }
.referrals-summary > span:first-child,
.referrals-summary strong { display: block; }
.referrals-summary strong { margin-top: 3px; font-size: 12px; }

.referrals-summary-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-muted);
  font-size: 9px;
}

.referrals-summary-meta svg { width: 14px; height: 14px; transition: transform .18s ease; }
.referrals-section[open] .referrals-summary-meta svg { transform: rotate(180deg); }

.privacy-copy { margin: 9px 0 11px; color: var(--ink-muted); font-size: 9px; }
.referral-table { overflow-x: auto; border-top: 1px solid var(--line); }
.referral-table-head,
.referral-table-row {
  display: grid;
  grid-template-columns: minmax(105px, 1.25fr) minmax(72px, .8fr) minmax(60px, .65fr) minmax(76px, .8fr);
  min-width: 420px;
  align-items: center;
  min-height: 42px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
}
.referral-table-head { color: var(--ink-muted); font-size: 9px; }
.state { color: var(--ink-muted); }
.state.is-qualified { color: var(--green); font-weight: 700; }
.state.is-pending { color: var(--amber); font-weight: 700; }

.tool-foot {
  min-height: 52px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(28, 31, 28, .42);
}

.redeem-modal {
  width: min(440px, 100%);
  max-height: calc(100vh - 40px);
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(28, 31, 28, .24);
}

.modal-head,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: var(--surface-2);
}

.modal-head { border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 16px; }
.modal-body { padding: 22px 20px; }
.modal-body > p { margin: 0; color: var(--ink-soft); font-size: 12px; }

.reward-channel-selector {
  min-width: 0;
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}

.reward-channel-selector legend {
  margin-bottom: 7px;
  color: var(--ink-muted);
  font-size: 9px;
  font-weight: 700;
}

.reward-channel-segments {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}

.reward-channel-option { position: relative; min-width: 0; cursor: pointer; }

.reward-channel-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.reward-channel-option > span {
  display: block;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--ink-soft);
}

.reward-channel-option strong,
.reward-channel-option small { display: block; }
.reward-channel-option strong { font-size: 11px; }
.reward-channel-option small { margin-top: 2px; color: var(--ink-muted); font-size: 8px; line-height: 1.45; }
.reward-channel-option.is-selected > span { border-color: var(--green-line); background: var(--surface); color: var(--green); }
.reward-channel-option.is-selected small { color: var(--ink-soft); }
.reward-channel-option.is-disabled { cursor: not-allowed; opacity: .45; }
.reward-channel-option:focus-within > span { outline: 2px solid var(--green); outline-offset: 1px; }

.modal-cost {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}
.modal-cost span { color: var(--ink-muted); }
.modal-note { margin-top: 14px !important; color: var(--ink-muted) !important; font-size: 10px !important; }
.modal-actions { justify-content: flex-end; border-top: 1px solid var(--line); }

.redeemed-key {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 9px;
  align-items: center;
  margin-top: 18px;
  padding: 9px;
  border: 1px solid var(--green-line);
  border-radius: 7px;
  background: var(--green-soft);
}
.redeemed-key code { min-width: 0; overflow: hidden; color: var(--green); font-family: var(--mono); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.delivery-recovery-copy {
  margin: -4px 0 14px;
  padding: 9px 11px;
  border: 1px solid rgba(20, 115, 82, .2);
  border-radius: 8px;
  background: rgba(20, 115, 82, .06);
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}

.delivery-recovery-copy[hidden] { display: none; }

.redeemed-config {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.redeemed-config > div { min-width: 0; padding: 10px; }
.redeemed-config > div:first-child { padding-left: 0; }
.redeemed-config > div + div { border-left: 1px solid var(--line); }
.redeemed-config span,
.redeemed-config strong,
.redeemed-config code { display: block; }
.redeemed-config span { color: var(--ink-muted); font-size: 8px; }
.redeemed-config strong,
.redeemed-config code { margin-top: 4px; color: var(--ink); font-size: 10px; overflow-wrap: anywhere; }
.redeemed-config code { color: var(--green); font-family: var(--mono); font-weight: 700; }

.redeemed-tutorial {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 16px;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  margin-top: 14px;
  padding: 9px 11px;
  border: 1px solid var(--green);
  border-radius: 7px;
  background: var(--green);
  color: #fff;
  text-decoration: none;
}

.redeemed-tutorial > svg:first-child {
  width: 28px;
  height: 28px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 5px;
}
.redeemed-tutorial > svg:last-child { width: 15px; height: 15px; }
.redeemed-tutorial strong,
.redeemed-tutorial small { display: block; }
.redeemed-tutorial strong { font-size: 11px; }
.redeemed-tutorial small { margin-top: 2px; color: rgba(255, 255, 255, .76); font-size: 8px; }
.redeemed-tutorial:hover { border-color: var(--green-hi); background: var(--green-hi); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 40;
  padding: 9px 13px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity .18s ease, transform .18s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@keyframes tool-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 920px) {
  .partner-layout { grid-template-columns: 1fr; gap: 38px; max-width: 700px; padding-top: 48px; }
  .program-intro h1 { font-size: 42px; }
  .identity-note { max-width: 520px; }
  .qualification,
  .reward-summary { display: none; }

  .mobile-program-rules {
    display: block;
    max-width: 520px;
    margin-top: 14px;
    border-bottom: 1px solid var(--line);
  }

  .mobile-program-rules summary {
    padding: 10px 0;
    color: var(--green);
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
  }

  .mobile-rule-grid {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 8px 12px;
    padding: 4px 0 14px;
    font-size: 10px;
  }

  .mobile-rule-grid span { color: var(--ink-muted); }
  .mobile-rule-grid strong { font-weight: 600; }
}

@media (max-width: 660px) {
  .container { width: calc(100% - 32px); }
  .partner-nav { height: 56px; }
  .brand-name { font-size: 14px; }
  .partner-layout { gap: 24px; padding: 36px 0 48px; }
  .program-intro { padding-top: 0; }
  .program-intro h1 { margin-top: 12px; font-size: 36px; }
  .intro-copy { margin-top: 15px; font-size: 14px; }
  .identity-note { margin-top: 20px; }
  .tool-head { min-height: 54px; padding: 0 17px; }
  .tool-tabs { margin: 14px 17px 0; }
  .tool-body { padding: 22px 17px 24px; }
  .credential-map-row { grid-template-columns: 42px minmax(0, 1fr); padding: 10px 0; }
  .credential-map-row code { grid-column: 2; }
  .issued-field { grid-template-columns: minmax(0, 1fr) 36px; gap: 8px; padding: 10px 0; }
  .issued-field > div { grid-column: 1; }
  .issued-field code { grid-column: 1; }
  .issued-field .icon-button { grid-column: 2; grid-row: 1 / span 2; }
  .dashboard-share-main { gap: 10px; }
  .dashboard-share-main .secondary-button { padding: 0 9px; }
  .dashboard-code-line { align-items: flex-start; flex-direction: column; gap: 2px; }
  .stats-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .reward-ladder { grid-template-columns: 1fr; }
  .reward-option {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-height: 68px;
    padding: 11px 10px;
  }
  .reward-option + .reward-option { border-top: 1px solid var(--line); border-left: 0; }
  .reward-option-footer { min-width: 104px; }
  .redeemed-config { grid-template-columns: 1fr; }
  .redeemed-config > div { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 10px; padding: 8px 0; }
  .redeemed-config > div + div { border-top: 1px solid var(--line); border-left: 0; }
  .redeemed-config strong,
  .redeemed-config code { margin-top: 0; text-align: right; }
  .claude-reward-band {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 11px;
    min-height: 0;
    padding: 24px 13px 13px;
  }
  .monthly-model-stack { width: 54px; height: 48px; }
  .monthly-model-token { width: 38px; height: 38px; font-size: 11px; }
  .claude-progress-value { grid-column: 1; text-align: left; }
  .claude-reward-band .reward-button { grid-column: 2; width: 100%; }
  .monthly-reward-note { grid-column: 1 / -1; }
  .referral-table { overflow-x: visible; }
  .referral-table-head,
  .referral-table-row {
    grid-template-columns: minmax(76px, 1.2fr) 48px 42px 58px;
    min-width: 0;
    font-size: 9px;
  }
  .tool-foot { align-items: flex-start; flex-direction: column; justify-content: center; gap: 4px; min-height: 60px; padding: 10px 17px; }
}

@media (max-width: 390px) {
  .back-home { font-size: 0; }
  .back-home svg { width: 18px; height: 18px; }
  .tool-badge { display: none; }
  .verification-row { grid-template-columns: 38px minmax(0, 1fr); }
  .verification-state { grid-column: 2; }
  .section-heading { align-items: flex-start; }
  .reward-title-line { align-items: flex-start; flex-direction: column; gap: 4px; }
  .reward-title-line strong { font-size: 13px; white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
