:root {
  color-scheme: light;
  --ink: #18202a;
  --muted: #66717d;
  --paper: #f4f1e8;
  --card-bg: #fffdf8;
  --line: #d8d2c5;
  --accent: #5b4cf0;
  --accent-dark: #4436cb;
  --success: #087443;
  --danger: #b42318;
  --warning: #9a6700;
  --info: #1a56db;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(91, 76, 240, .13), transparent 28rem),
    radial-gradient(circle at 88% 20%, rgba(20, 184, 166, .12), transparent 30rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.shell { width: min(920px, calc(100% - 32px)); margin: 0 auto; padding: 56px 0 72px; }
header { margin-bottom: 28px; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 13px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1 { margin: 0; max-width: 760px; font: 700 clamp(36px, 7vw, 68px)/.98 Georgia, serif; letter-spacing: -.045em; }
.lede { max-width: 680px; margin: 18px 0 0; color: var(--muted); line-height: 1.7; }
.card { position: relative; margin-top: 20px; padding: 30px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,253,248,.92); box-shadow: 0 18px 55px rgba(38,43,53,.08); }
.step-badge { position: absolute; top: 24px; right: 26px; color: #aaa293; font: 700 22px Georgia, serif; }
h2 { margin: 0 0 22px; font-size: 22px; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.three-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
label { display: block; margin-bottom: 14px; color: #3c4650; font-size: 13px; font-weight: 700; }
input, textarea, select { width: 100%; margin-top: 7px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; padding: 12px 13px; }
textarea { resize: vertical; min-height: 60px; font-family: "SF Mono", Consolas, monospace; font-size: .8rem; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,76,240,.12); outline: none; }
#pay-button, #upgrade-button, #query-button { display: block; width: 100%; margin-top: 28px; border: 0; border-radius: 14px; padding: 16px 18px; background: linear-gradient(135deg,var(--accent),var(--accent-dark)); color: #fff; font: inherit; font-size: 1.05rem; font-weight: 800; cursor: pointer; box-shadow: 0 4px 14px rgba(91,76,240,.25); }
#pay-button:disabled, #upgrade-button:disabled, #query-button:disabled { cursor: not-allowed; opacity: .52; }
.section-button { width: 100%; margin-top: 4px; border: 1px solid var(--accent); border-radius: 8px; padding: 12px 16px; background: transparent; color: var(--accent); font: inherit; font-weight: 800; cursor: pointer; }
.secondary-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.invoices-link { display: inline-block; padding: 12px 28px; border: 2px solid var(--accent); border-radius: 14px; color: var(--accent); font-weight: 800; font-size: .95rem; text-decoration: none; }
.session-actions { display: flex; gap: 10px; margin-top: 6px; }
.auto-fetch, .session-link { flex: 1; display: inline-flex; margin: 0; align-items: center; justify-content: center; height: 38px; padding: 0 14px; border: 1px dashed var(--line); border-radius: 10px; background: transparent; color: var(--muted); font-size: .8rem; text-decoration: none; cursor: pointer; white-space: nowrap; }
.steps { margin-top: 24px; padding: 20px 22px; border-radius: 14px; background: rgba(255,253,248,.85); border: 1px solid var(--line); }
.step-item { display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; font-size: .88rem; }
.step-item + .step-item { border-top: 1px solid rgba(216,210,197,.5); }
.step-num { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; background: var(--success); font-size: .72rem; font-weight: 800; }
.step-body { flex: 1; }.step-name { font-weight: 700; }.step-detail { color: var(--muted); font-size: .78rem; margin-top: 2px; }
.result { margin-top: 20px; padding: 18px 22px; border-radius: 14px; font-size: .88rem; line-height: 1.6; }
.result.success { background: #e8f5ef; border: 1px solid #86c9a9; color: #135631; }
.result.error { background: #fdecea; border: 1px solid #e09090; color: #721c24; }
.result.info { background: #eaf0ff; border: 1px solid #99b9f5; color: #1a3780; }
.notice { margin-top: 20px; padding: 16px 18px; border-left: 4px solid #dd9d22; background: rgba(255,253,248,.7); color: #5d5140; line-height: 1.6; font-size: .85rem; }
.hidden { display: none !important; }
.upgrade-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; margin-bottom: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--line); }
.summary-item { min-width: 0; padding: 14px 16px; background: #fff; }.summary-label { display: block; margin-bottom: 5px; color: var(--muted); font-size: .72rem; font-weight: 700; }.summary-value { display: block; overflow-wrap: anywhere; font-size: .95rem; font-weight: 800; }
.payment-source span, .sub-card, .invoice-item { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: rgba(255,253,248,.9); }
.payment-source small { display: block; margin-top: 4px; color: var(--muted); }
.invoice-item { display: flex; align-items: center; gap: 12px; margin-top: 10px; }.invoice-item .info { flex: 1; }.invoice-item .title { font-weight: 700; }.invoice-item .meta { margin-top: 3px; color: var(--muted); font-size: .78rem; }.invoice-item a { padding: 8px 14px; border-radius: 8px; background: var(--accent); color: #fff; text-decoration: none; font-size: .8rem; font-weight: 700; }
.sub-card { margin-top: 12px; padding: 18px 20px; }.plan-name { font-size: 1.2rem; font-weight: 800; }.plan-meta { margin-top: 6px; color: var(--muted); font-size: .82rem; line-height: 1.7; }.badge { display: inline-block; margin-left: 6px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; }.badge.active { background: rgba(20,184,166,.15); color: #0e7a6b; }.badge.cancelled { background: rgba(217,119,6,.15); color: #92400e; }.cancel-btn { display: block; width: 100%; margin-top: 16px; padding: 12px; border: 0; border-radius: 10px; background: var(--danger); color: #fff; font-weight: 800; cursor: pointer; }
@media (max-width: 640px) { .shell { padding-top: 34px; }.card { padding: 24px 20px; }.two-cols,.three-cols,.upgrade-summary { grid-template-columns: 1fr; gap: 0; }.session-actions { flex-direction: column; gap: 8px; }.session-actions .auto-fetch,.session-link { flex: none; } }
