:root {
  --paper: #f2efe5;
  --paper-deep: #e7e1d3;
  --ink: #17231d;
  --muted: #667068;
  --line: #cbc8bc;
  --green: #0c6948;
  --green-dark: #074932;
  --green-soft: #d8e9de;
  --signal: #d8573f;
  --white: #fffdf8;
  --shadow: 0 28px 80px rgba(28, 38, 32, 0.12);
  --font-sans: "Avenir Next", Avenir, "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", "Cascadia Code", monospace;
}

* { box-sizing: border-box; }

.mode-picker { display: flex; gap: 24px; margin: 28px 0; padding: 18px; border: 1px solid var(--line); }
.mode-picker legend { padding: 0 8px; color: var(--muted); font-size: 14px; }
.mode-picker label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.mode-picker label:has(input:disabled) { opacity: 0.5; cursor: not-allowed; }
.mode-picker input { width: auto; min-height: auto; accent-color: var(--green); }
.auto-input-panel textarea { display: block; width: 100%; margin-top: 12px; padding: 14px; resize: vertical; border: 1px solid var(--line); background: var(--white); color: var(--ink); font: 15px var(--font-mono); overflow-wrap: anywhere; }
.auto-info summary { cursor: pointer; }
.customer-results { width: min(100% - 28px, 1180px); margin: 32px auto 48px; padding: 28px; background: var(--white); border: 1px solid var(--line); box-sizing: border-box; }
.results-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.results-heading h2 { margin: 0; font-size: 28px; }
.results-table-wrap { overflow-x: auto; }
.results-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.results-table th, .results-table td { text-align: left; padding: 18px 14px; border-bottom: 1px solid var(--line); }
.results-table th { color: var(--muted); white-space: nowrap; }
.results-table td:first-child, .results-table td:nth-child(2) { overflow-wrap: anywhere; min-width: 150px; }
.results-table td:last-child { white-space: nowrap; }
.auto-summary { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 16px; padding: 24px 0; border-block: 1px solid var(--line); }
.auto-summary dt { color: var(--muted); }
.auto-summary dd { margin: 0; overflow-wrap: anywhere; }
textarea:focus-visible { outline: 3px solid var(--green-soft); outline-offset: 2px; }

html { min-width: 320px; background: var(--paper); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }

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

button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid rgba(216, 87, 63, 0.42);
  outline-offset: 3px;
}

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(23, 35, 29, 0.025) 4px);
}

.site-header {
  width: min(1180px, calc(100% - 48px));
  min-height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.wordmark-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: var(--green);
  border-radius: 50%;
  font-family: "Songti SC", serif;
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.security-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.security-note span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(12, 105, 72, 0.1);
}

.buy-cdk-button {
  min-height: 42px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  background: var(--green);
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(12, 105, 72, 0.18);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.buy-cdk-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.buy-cdk-button:active { transform: translateY(1px); }

.app-shell {
  width: min(1180px, calc(100% - 48px));
  margin: 64px auto 48px;
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(520px, 1.18fr);
  align-items: start;
  gap: 64px;
}

.intro-panel { min-width: 0; padding-top: 16px; }

.eyebrow, .section-number, .workspace-topline {
  margin: 0;
  color: var(--green);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.intro-panel h1 {
  max-width: 560px;
  margin: 20px 0 24px;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(38px, 5vw, 58px);
  line-height: 1.12;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.lede {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
  text-wrap: pretty;
}

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

.steps li {
  min-height: 74px;
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  color: #899089;
  border-bottom: 1px solid var(--line);
  transition: color 180ms ease, padding 180ms ease, background 180ms ease;
}

.steps li.is-current {
  padding-left: 12px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.48);
}

.steps li.is-complete { color: var(--green); }

.step-index { font-family: var(--font-mono); font-size: 12px; }
.steps strong, .steps small { display: block; }
.steps strong { font-size: 15px; }
.steps small { margin-top: 3px; font-size: 12px; font-weight: 500; }

.workspace {
  position: relative;
  min-width: 0;
  min-height: 590px;
  padding: 32px 40px 40px;
  overflow: hidden;
  background: var(--white);
  border: 1px solid rgba(82, 91, 84, 0.18);
  box-shadow: var(--shadow);
}

.workspace::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  right: -9px;
  top: 88px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 414px 0 var(--paper);
}

.workspace-topline {
  min-height: 40px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.balance-pill {
  padding: 7px 11px;
  color: var(--green-dark);
  background: var(--green-soft);
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.balance-pill b { font-family: var(--font-mono); }

.view { animation: enter 320ms cubic-bezier(.2,.8,.2,1) both; }

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

.view-heading { margin: 48px 0 40px; }
.view-heading.compact { margin: 36px 0 28px; }

.view-heading h2 {
  margin: 12px 0 12px;
  font-family: "Songti SC", "STSong", serif;
  font-size: 34px;
  line-height: 1.22;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.view-heading > p:last-child {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  text-wrap: pretty;
}

form label {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 700;
}

.field-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }

input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  color: var(--ink);
  background: transparent;
  border: 1px solid #9c9f97;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 15px;
  letter-spacing: 0.04em;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:hover { border-color: var(--ink); }
input:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(12, 105, 72, 0.09); outline: none; }
input::placeholder { color: #a7aaa3; }

.field-hint { margin: 10px 0 0; color: var(--muted); font-size: 12px; }

button { min-height: 44px; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.48; }

.primary-button, .secondary-button, .copy-button {
  border: 0;
  border-radius: 10px;
  font-weight: 700;
  transition: transform 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.primary-button {
  min-height: 52px;
  padding: 0 22px;
  color: var(--white);
  background: var(--green);
  box-shadow: 0 8px 22px rgba(12, 105, 72, 0.18);
}

.primary-button:hover { background: var(--green-dark); transform: translateY(-1px); }
.primary-button:active { transform: translateY(1px); }
.primary-button.wide { width: 100%; }

.secondary-button {
  padding: 0 18px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
}

.secondary-button:not(:disabled):hover { border-color: var(--ink); background: var(--paper); }

.text-button {
  min-height: 44px;
  padding: 0 8px;
  color: var(--muted);
  background: transparent;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
}

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

.service-ticket {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
  color: var(--white);
  background: var(--ink);
}

.service-ticket-main { width: 100%; display: flex; align-items: center; gap: 16px; }
.service-ticket-main strong, .service-ticket-main small { display: block; }
.service-ticket-main small { margin-top: 5px; color: #bfc8c1; font-size: 12px; }

.service-ticket select {
  min-height: 36px;
  max-width: 270px;
  padding: 0 30px 0 0;
  color: var(--white);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,0.34);
  border-radius: 0;
  font-weight: 700;
  cursor: pointer;
}

.service-ticket select:focus-visible { outline-color: rgba(255,255,255,0.65); }

.service-monogram {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--ink);
  background: var(--green-soft);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
}

.action-stack { margin-top: 32px; display: grid; gap: 12px; justify-items: center; }

.activation-header { min-width: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; }
.activation-header .compact { min-width: 0; flex: 1; }

.timer {
  flex: 0 0 auto;
  margin-top: 36px;
  padding: 9px 11px;
  color: var(--signal);
  border: 1px solid rgba(216, 87, 63, 0.32);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
}

.number-block {
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.number-label-row {
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.number-label-row small, .code-block > small {
  color: var(--muted);
  font-size: 12px;
}

.code-block > small {
  display: block;
  margin-bottom: 8px;
}

.country-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  max-width: 70%;
  padding: 4px 10px;
  color: var(--green-dark);
  background: var(--green-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  text-align: right;
}

.copy-line { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.copy-line strong {
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: clamp(22px, 4vw, 28px);
  letter-spacing: -0.03em;
}

.copy-button { min-width: 72px; padding: 0 14px; color: var(--green-dark); background: var(--green-soft); }
.copy-button:hover { background: #c4dfce; }
.copy-button.light { color: var(--ink); background: var(--white); }

.waiting-block {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
  padding: 16px;
  background: var(--paper);
}

.waiting-block strong, .waiting-block small { display: block; }
.waiting-block strong { font-size: 14px; }
.waiting-block small { margin-top: 4px; color: var(--muted); font-size: 12px; }

.pulse {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(12, 105, 72, 0.45);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  65% { box-shadow: 0 0 0 12px rgba(12, 105, 72, 0); }
  100% { box-shadow: 0 0 0 0 rgba(12, 105, 72, 0); }
}

.code-block {
  margin-top: 22px;
  padding: 22px;
  color: var(--white);
  background: var(--signal);
}

.code-line strong { font-size: clamp(30px, 6vw, 42px); letter-spacing: 0.08em; }
.code-block > small, .code-block p { color: rgba(255,255,255,0.78); }
.code-block p { margin: 16px 0 0; font-size: 13px; }

.activation-actions {
  min-height: 52px;
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

#target-rejected-button, #no-sms-button { flex: 1 1 190px; }

.notice {
  position: absolute;
  left: 40px;
  right: 40px;
  bottom: 24px;
  z-index: 2;
  padding: 12px 14px;
  color: var(--ink);
  background: #f4d9cf;
  border: 1px solid rgba(216, 87, 63, 0.3);
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(23, 35, 29, 0.12);
}

.notice.is-success { background: var(--green-soft); border-color: rgba(12, 105, 72, 0.25); }

footer {
  width: min(1180px, calc(100% - 48px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
}

footer a { min-height: 44px; display: inline-flex; align-items: center; color: var(--muted); }
footer a:hover { color: var(--ink); }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; gap: 40px; margin-top: 40px; }
  .intro-panel { padding-top: 0; }
  .intro-panel h1 { max-width: 720px; }
  .lede { max-width: 680px; }
  .steps { display: grid; grid-template-columns: repeat(4, 1fr); }
  .steps li { min-height: 86px; grid-template-columns: 1fr; gap: 6px; align-content: center; border-right: 1px solid var(--line); }
  .steps li:last-child { border-right: 0; }
  .steps li.is-current { padding-left: 10px; }
}

@media (max-width: 600px) {
  .site-header, .app-shell, footer { width: min(100% - 28px, 1180px); }
  .site-header { min-height: 70px; }
  .header-actions { gap: 10px; }
  .security-note { display: none; }
  .buy-cdk-button { min-height: 40px; padding: 0 14px; }
  .app-shell { margin: 30px auto 28px; gap: 28px; }
  .intro-panel h1 { margin-top: 14px; font-size: 38px; }
  .lede { font-size: 15px; }
  .steps { margin-top: 30px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .steps li { padding: 8px 10px; }
  .workspace { min-height: 570px; padding: 24px 20px 28px; box-shadow: 0 18px 50px rgba(28, 38, 32, 0.12); }
  .workspace-topline { padding-bottom: 16px; }
  .view-heading { margin: 36px 0 30px; }
  .view-heading h2 { font-size: 30px; }
  .field-row { grid-template-columns: 1fr; }
  .service-ticket { align-items: flex-start; padding: 20px; }
  .service-ticket-main { align-items: flex-start; }
  .service-monogram { width: 44px; height: 44px; }
  .activation-header { gap: 10px; }
  .timer { margin-top: 36px; }
  .copy-line { align-items: flex-start; }
  .copy-line strong { font-size: 21px; }
  .code-line { align-items: center; }
  .code-line strong { font-size: 32px; }
  .activation-actions { justify-content: stretch; }
  .activation-actions button { flex: 1; }
  .notice { left: 20px; right: 20px; bottom: 18px; }
  footer { min-height: 96px; align-items: flex-start; flex-direction: column; justify-content: center; gap: 0; line-height: 1.6; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
