/* Subscription Center — ChatGPT Minimalist Monochrome Theme (Light & Dark) */
:root {
  --bg-page: #f9f9f9;
  --bg-topbar: #ffffff;
  --bg-card: #ffffff;
  --bg-track: #efefef;
  --bg-subtle: #f4f4f4;
  --bg-input: #ffffff;
  --border: #e5e5e5;
  --border-strong: #d4d4d4;
  --ink: #0d0d0d;
  --ink-secondary: #404040;
  --muted: #6e6e80;
  --primary: #0d0d0d;
  --primary-hover: #262626;
  --primary-ink: #ffffff;
  --ok: #10a37f;
  --ok-soft: rgba(16, 163, 127, 0.10);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.08);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.04);
  --shadow-pill: 0 1px 2px rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] {
  --bg-page: #212121;
  --bg-topbar: #171717;
  --bg-card: #2a2a2a;
  --bg-track: #1b1b1b;
  --bg-subtle: #323232;
  --bg-input: #212121;
  --border: #383838;
  --border-strong: #4a4a4a;
  --ink: #ececec;
  --ink-secondary: #cfcfcf;
  --muted: #9b9b9b;
  --primary: #ffffff;
  --primary-hover: #e5e5e5;
  --primary-ink: #0d0d0d;
  --ok: #10a37f;
  --ok-soft: rgba(16, 163, 127, 0.16);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --shadow-card: 0 8px 28px rgba(0, 0, 0, 0.30);
  --shadow-pill: 0 1px 3px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-page);
  color: var(--ink);
  font: 14px/1.6 "Söhne", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Top Navigation Bar */
.topbar {
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  min-height: 48px;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  flex-wrap: wrap;
}

.topbar-left {
  display: contents;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  order: 1;
}

.brand-badge {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 700;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.25px;
}

/* Multi-Platform Nav (ChatGPT active; Grok/Claude/Gemini coming soon) */
.product-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  order: 2;
  margin-right: auto;
}

.prod-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.prod-tab:hover {
  background: var(--bg-subtle);
  color: var(--ink);
}

.prod-tab.is-active {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--ink);
  font-weight: 650;
}

.prod-tab.is-soon {
  opacity: 0.72;
}

.soon-tag {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 500;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-track);
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  order: 3;
  margin-left: auto;
  flex-shrink: 0;
}

.top-pill-btn,
.top-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--bg-topbar);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: -0.2px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.top-pill-btn svg,
.top-icon-btn svg {
  width: 15px;
  height: 15px;
}

.top-pill-btn:hover,
.top-icon-btn:hover {
  background: var(--bg-subtle);
}

@media (max-width: 720px) {
  .topbar-inner {
    padding: 6px 12px;
    gap: 6px 8px;
  }
  .topbar-actions {
    order: 2;
  }
  .product-nav {
    order: 3;
    flex-basis: 100%;
    padding-top: 2px;
  }
  .prod-tab {
    height: 28px;
    padding: 0 8px;
    font-size: 12px;
  }
}

/* Toast Banner */
.toast-banner {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-ink);
  font-size: 13px;
  font-weight: 550;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  max-width: calc(100vw - 24px);
  white-space: normal;
  text-align: center;
  word-break: break-word;
}

/* Centered Container */
.shell {
  max-width: 680px;
  margin: 0 auto;
  padding: 44px 20px 72px;
}

/* Hero Section */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 24px;
}

.hero-title {
  margin: 0 0 12px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.2;
  color: var(--ink);
}

.trust-strip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 22px;
}

.trust-strip span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.trust-strip svg {
  color: var(--ink-secondary);
  flex-shrink: 0;
}

.trust-strip em {
  font-style: normal;
}

.trust-strip .dot {
  font-style: normal;
  opacity: 0.45;
}

/* Segmented Pill Tabs */
.seg-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 11px;
  background: var(--bg-track);
}

.seg-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 550;
  padding: 7px 22px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.seg-tab:hover {
  color: var(--ink);
}

.seg-tab.active {
  background: var(--bg-card);
  color: var(--ink);
  font-weight: 650;
  box-shadow: var(--shadow-pill);
}

html[data-theme="dark"] .seg-tab.active {
  background: #353535;
  color: #ffffff;
}

/* Main Card */
.main-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 32px 24px;
  box-shadow: var(--shadow-card);
}

/* 3-Step Horizontal Stepper */
.stepper {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.step-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--bg-track);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-item.is-active {
  color: var(--ink);
  font-weight: 650;
}

.step-item.is-active .step-num {
  background: var(--primary);
  color: var(--primary-ink);
}

.step-item.is-done {
  color: var(--ink);
}

.step-item.is-done .step-num {
  background: var(--ok);
  color: #ffffff;
}

.step-line {
  flex: 1;
  height: 1px;
  border-top: 1px dashed var(--border-strong);
  min-width: 16px;
}

/* Form Elements */
.field-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 8px;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.label-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.session-clear-btn {
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}

.session-clear-btn:hover {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--bg-card);
}

.helper-link {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.helper-link:hover {
  opacity: 0.78;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--muted);
  display: inline-flex;
  pointer-events: none;
}

input[type="text"],
input[type="password"],
input:not([type]),
textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

input[type="text"],
input[type="password"],
input:not([type]) {
  height: 46px;
  padding: 0 14px;
}

textarea {
  padding: 11px 14px;
  resize: vertical;
  min-height: 96px;
  line-height: 1.5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
}

.input-wrap input {
  padding-left: 40px;
  padding-right: 14px;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted);
  font-family: inherit;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(13, 13, 13, 0.08);
}

html[data-theme="dark"] input:focus,
html[data-theme="dark"] textarea:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.12);
}

.input-paste-btn {
  position: absolute;
  right: 8px;
  height: 30px;
  padding: 0 11px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.input-paste-btn:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.micro-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 18px;
  font-size: 12.5px;
  color: var(--muted);
}

.turnstile-slot {
  margin: 12px 0 16px;
}

.cta-btn {
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: var(--primary-ink);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease, opacity 0.14s ease;
}

.cta-btn:hover:not(:disabled) {
  background: var(--primary-hover);
}

.cta-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.cta-btn.sm {
  width: auto;
  height: 38px;
  padding: 0 18px;
  font-size: 13.5px;
}

.outline-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.outline-btn.sm {
  height: 34px;
  padding: 0 14px;
  font-size: 13px;
}

.outline-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--ink);
}

.text-link-btn {
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-link-btn:hover {
  opacity: 0.75;
}

/* Step 2 Plan Banner & Account Confirmation */
.plan-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  margin-bottom: 18px;
}

.plan-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  margin-right: 8px;
}

.plan-name {
  font-size: 14.5px;
  color: var(--ink);
}

.session-check-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 16px;
  flex-wrap: wrap;
}

.check-inline-msg {
  font-size: 12.5px;
  color: var(--muted);
  flex: 1;
  min-width: 180px;
}

.check-inline-msg.is-error {
  color: var(--danger);
}

.check-inline-msg.is-ok {
  color: var(--ok);
  font-weight: 600;
}

.confirm-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-subtle);
  padding: 12px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.confirm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13.5px;
}

.confirm-row span {
  color: var(--muted);
}

.confirm-row strong {
  color: var(--ink);
  word-break: break-all;
  text-align: right;
}

/* Step 3 Progress Bar */
.progress-wrap {
  padding: 6px 0 4px;
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.progress-head strong {
  font-size: 15.5px;
  color: var(--ink);
}

.progress-pct {
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--bg-track);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.45s ease, background 0.25s ease;
}

.progress-fill.is-ok {
  background: var(--ok);
}

.progress-fill.is-error {
  background: var(--danger);
}

.progress-desc {
  margin: 12px 0 0;
  font-size: 13.5px;
  color: var(--ink-secondary);
}

.progress-desc.is-ok {
  color: var(--ok);
  font-weight: 600;
}

.progress-desc.is-error {
  color: var(--danger);
}

.progress-actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Status Line */
.status-line {
  margin: 12px 0 0;
  min-height: 18px;
  font-size: 13px;
  color: var(--ink-secondary);
  word-break: break-word;
}

.status-line:empty {
  display: none;
}

.status-line.is-error {
  color: var(--danger);
}

.status-line.is-ok {
  color: var(--ok);
  font-weight: 600;
}

/* Card Footer */
.card-footer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.footer-help {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Tutorial Modal */
.guide-dialog {
  max-width: 460px;
  width: calc(100% - 32px);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--ink);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
}

.guide-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
}

.guide-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.guide-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.guide-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
}

.guide-steps {
  margin: 0;
  padding-left: 20px;
  color: var(--ink-secondary);
  font-size: 13.5px;
  line-height: 1.75;
}

.guide-steps li + li {
  margin-top: 6px;
}

.guide-foot {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

/* Responsive */
@media (max-width: 640px) {
  .topbar-inner {
    padding: 8px 14px;
  }
  .topbar-left {
    gap: 10px;
  }
  .product-nav {
    gap: 2px;
  }
  .prod-tab {
    padding: 0 8px;
    font-size: 12px;
  }
  .soon-tag {
    display: none;
  }
  .shell {
    padding: 26px 14px 48px;
  }
  .hero-title {
    font-size: 25px;
  }
  .main-card {
    padding: 22px 18px 18px;
    border-radius: 16px;
  }
  .stepper {
    gap: 6px;
    margin-bottom: 20px;
  }
  .step-label {
    font-size: 12px;
  }
}

/* Batch Key Lookup Layout (DD168AI structure in ChatGPT monochrome) */
.shell.is-lookup {
  max-width: 820px;
}

.lookup-shell {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.lookup-subtitle {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--muted);
}

.lookup-input-card textarea {
  min-height: 128px;
  font-size: 13px;
}

.lookup-hint {
  margin: 10px 0 16px;
  font-size: 12.5px;
  color: var(--muted);
}

.lookup-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lookup-submit-btn {
  flex: 1;
}

.lookup-clear-btn {
  flex: 0 0 auto;
  min-width: 88px;
  height: 46px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.lookup-clear-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--ink);
}

.lookup-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  color: var(--ink-secondary);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.filter-pill strong {
  font-weight: 700;
}

.filter-pill:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.filter-pill.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-ink);
}

.lookup-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.lookup-summary-text {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
}

.lookup-copy-all {
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 7px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lookup-copy-all:hover {
  background: var(--bg-subtle);
}

.lookup-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.lookup-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.lookup-table th {
  text-align: left;
  padding: 10px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.lookup-table td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  vertical-align: middle;
}

.lookup-table tbody tr:last-child td {
  border-bottom: 0;
}

.lookup-key-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  white-space: nowrap;
}

.lookup-plan-cell,
.lookup-time-cell {
  white-space: nowrap;
  color: var(--ink-secondary);
}

.lookup-account-cell {
  font-size: 13px;
  word-break: break-all;
}

.lookup-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.lookup-badge--available {
  background: rgba(16, 163, 127, 0.12);
  color: var(--ok);
}

.lookup-badge--consumed {
  background: var(--bg-subtle);
  color: var(--muted);
  border: 1px solid var(--border);
}

.lookup-badge--processing {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
}

html[data-theme="dark"] .lookup-badge--processing {
  color: #fbbf24;
}

.lookup-badge--disabled,
.lookup-badge--invalid {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
}

.lookup-copy-btn {
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.lookup-copy-btn:hover {
  background: var(--bg-subtle);
}

.lookup-empty-cell {
  text-align: center;
  padding: 28px 12px !important;
  color: var(--muted);
}

@media (max-width: 640px) {
  .lookup-actions {
    flex-direction: column;
  }
  .lookup-submit-btn {
    flex: 0 0 auto;
    width: 100%;
    height: 46px;
  }
  .lookup-clear-btn {
    width: 100%;
    height: 44px;
  }
  .lookup-summary-row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }
}
