:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #596379;
  --paper: #f8f6f1;
  --card: #ffffff;
  --line: #dcdfe7;
  --accent: #d0583b;
  --accent-dark: #963a28;
  --focus: #245cbd;
  --radius: 20px;
  --shadow: 0 16px 46px rgba(28, 33, 48, .09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 10% 0, #fff 0, transparent 36%), var(--paper); line-height: 1.58; }
a { color: #2f559c; text-underline-offset: .18em; overflow-wrap: anywhere; }
a:hover { color: var(--accent-dark); }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; line-height: 1.08; letter-spacing: -.025em; margin: 0 0 .65rem; }
h1 { font-size: clamp(2.25rem, 5vw, 4.6rem); }
h2 { font-size: clamp(1.55rem, 3vw, 2.4rem); }
p { margin: 0 0 1rem; }
code { font-size: .88em; background: #f1f2f5; border-radius: 6px; padding: .15em .35em; overflow-wrap: anywhere; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 99; background: #fff; padding: .7rem 1rem; }
.skip-link:focus { top: 1rem; }
.portal-header { max-width: 1180px; margin: auto; padding: 1.35rem clamp(1rem, 4vw, 2rem); display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.brand { color: var(--ink); text-decoration: none; font: 700 1.25rem Georgia, serif; }
.brand span { display: block; color: var(--muted); font: 500 .72rem/1.2 Inter, sans-serif; letter-spacing: .04em; }
.portal-header nav { display: flex; flex-wrap: wrap; gap: 1rem; }
.portal-header nav a { font-weight: 700; }
.portal-shell { width: min(1180px, calc(100% - 2rem)); margin: 1rem auto 5rem; }
footer { border-top: 1px solid var(--line); color: var(--muted); text-align: center; padding: 2rem 1rem 3rem; font-size: .88rem; }

.panel { background: rgba(255,255,255,.94); border: 1px solid rgba(50,60,85,.12); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1.25rem, 3vw, 2rem); }
.narrow { max-width: 680px; margin: 7vh auto; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; color: var(--accent-dark); font-size: .76rem; font-weight: 800; margin-bottom: .6rem; }
.lede { color: #374058; font-size: clamp(1.05rem, 2vw, 1.3rem); max-width: 64ch; }
.fine, .hint, small { color: var(--muted); font-size: .83rem; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 6vw, 5rem); align-items: center; min-height: 70vh; }
.form-card { max-width: 560px; width: 100%; justify-self: end; }
.pay-strip { display: grid; grid-template-columns: auto 1fr; gap: .35rem .8rem; align-items: baseline; margin: 1.5rem 0; max-width: 510px; }
.pay-strip strong { font: 700 1.7rem Georgia, serif; color: var(--accent-dark); }

form { display: grid; gap: 1rem; }
label, legend { color: #30384a; font-weight: 720; }
input, textarea, select { width: 100%; margin-top: .35rem; padding: .8rem .9rem; color: var(--ink); background: #fff; border: 1px solid #aeb5c4; border-radius: 10px; font: inherit; }
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus), transparent 60%); outline-offset: 2px; border-color: var(--focus); }
fieldset { border: 1px solid var(--line); border-radius: 14px; padding: 1rem; }
.check, .radio { display: grid; grid-template-columns: 1.25rem 1fr; gap: .65rem; align-items: start; font-weight: 520; }
.check input, .radio input { width: 1.1rem; height: 1.1rem; margin: .25rem 0 0; }
.radio { padding: .7rem; border-radius: 10px; }
.radio:hover { background: #f5f6f8; }
.radio small { display: block; font-weight: 450; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 44px; padding: .72rem 1rem; border: 1px solid transparent; border-radius: 999px; font: 760 .94rem Inter, sans-serif; text-decoration: none; cursor: pointer; }
.button.primary { color: #fff; background: var(--accent-dark); }
.button.primary:hover { color: #fff; background: #70291d; }
.button.secondary { color: var(--ink); background: #fff; border-color: var(--line); }
.disabled, button:disabled { cursor: not-allowed; opacity: .62; }
.trap { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
details { border-top: 1px solid var(--line); padding-top: .8rem; margin-top: .8rem; }
summary { cursor: pointer; font-weight: 750; color: #39445b; }
.notice { border-radius: 14px; padding: .95rem 1.15rem; margin-bottom: 1rem; }
.notice.success { border: 1px solid #8bb8a0; background: #edf8f1; color: #194a2f; }

.dashboard-head { display: flex; align-items: start; justify-content: space-between; gap: 2rem; margin: 3rem 0 2rem; }
.dashboard-head h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1rem; }
.stat span, .stat small { display: block; color: var(--muted); }
.stat strong { display: block; font-size: clamp(1.35rem, 3vw, 2rem); margin: .45rem 0; overflow-wrap: anywhere; }
.copy-link { border: 0; background: transparent; padding: .2rem 0; color: #2f559c; text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }
.share-panel { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; margin-bottom: 1rem; }
.url-row { display: flex; gap: 1rem; align-items: center; padding: .8rem; border-radius: 12px; background: #f4f5f7; }
.url-row a { flex: 1; }
.qr-card { width: 230px; text-align: center; }
.qr-card img { width: 220px; height: 220px; display: block; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.qr-actions { display: flex; gap: .5rem; margin: .6rem 0; }
.qr-actions > * { flex: 1; }
.customize-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; margin-bottom: 1rem; }
.customize-controls { display: grid; gap: .75rem; min-width: 0; }
.restore-form { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; padding: .3rem .7rem; }
.slug-input { display: flex; align-items: center; border: 1px solid #aeb5c4; border-radius: 10px; margin-top: .35rem; background: #f4f5f7; overflow: hidden; }
.slug-input span { padding: .6rem 0 .6rem .7rem; color: var(--muted); font-size: .77rem; white-space: nowrap; }
.slug-input input { border: 0; margin: 0; border-radius: 0; min-width: 100px; }
.author-preview { position: sticky; top: 1rem; min-height: 520px; padding: clamp(1.5rem, 5vw, 3.5rem); border-radius: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: center; transition: background .25s; }
.preview-hero-art { width: 100%; max-height: 210px; object-fit: cover; border-radius: 16px; margin-bottom: 1rem; }
.author-preview.layout-editorial { justify-content: start; }
.author-preview h2 { font-size: clamp(2rem, 4vw, 3.4rem); max-width: 13ch; }
.preview-brand { font: 700 1.05rem Georgia, serif; letter-spacing: .02em; }
.preview-by { opacity: .72; font-size: .82rem; }
.preview-offer { display: grid; gap: .2rem; border-left: 3px solid currentColor; padding-left: .8rem; margin: 1.2rem 0; }
.preview-offer span { font-size: .88rem; }
.preview-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin-top: 1rem; }
.preview-gallery img { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 8px; }
.section-heading { display: flex; justify-content: space-between; gap: 2rem; align-items: start; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; vertical-align: top; padding: .75rem; border-bottom: 1px solid var(--line); }
td small { display: block; max-width: 42ch; }
.status { display: inline-block; border-radius: 999px; padding: .15rem .5rem; background: #eef0f4; font-size: .78rem; }
.status-eligible, .status-paid, .status-completed { background: #e3f4e8; color: #205c37; }
.status-reversed { background: #f8e5e1; color: #812f21; }

.theme-ink { --page-bg: #f2eee6; --page-fg: #172033; --page-accent: #963a28; background: var(--page-bg); color: var(--page-fg); }
.theme-sky { --page-bg: #eaf4fb; --page-fg: #17324c; --page-accent: #225e86; background: var(--page-bg); color: var(--page-fg); }
.theme-sage { --page-bg: #ecf1e9; --page-fg: #253c31; --page-accent: #35624a; background: var(--page-bg); color: var(--page-fg); }
.theme-sunset { --page-bg: #fbede6; --page-fg: #542f2b; --page-accent: #a34534; background: var(--page-bg); color: var(--page-fg); }
.theme-ink .button.primary, .theme-sky .button.primary, .theme-sage .button.primary, .theme-sunset .button.primary { background: var(--page-accent); }
.author-page { border-radius: 32px; padding: clamp(1rem, 4vw, 4rem); display: block; box-shadow: var(--shadow); }
.author-page.layout-editorial .author-intro { max-width: 900px; margin-inline: auto; text-align: center; }
.author-page.layout-editorial .author-intro h1 { margin-inline: auto; max-width: 17ch; }
.author-page.layout-editorial .author-form { width: min(760px, 100%); margin-inline: auto; }
.author-page.layout-editorial .trust-list { text-align: left; }
.author-hero-art { width: 100%; max-height: 360px; object-fit: cover; border-radius: 22px; margin-bottom: 1rem; box-shadow: 0 10px 30px rgba(20,30,45,.12); }
.partner-header-image { display: block; width: 100%; aspect-ratio: 8 / 3; object-fit: cover; border-radius: 22px; margin-bottom: 1rem; box-shadow: 0 10px 30px rgba(20,30,45,.12); }
.partner-profile-image { display: block; width: 112px; aspect-ratio: 1; object-fit: cover; border: 4px solid rgba(255,255,255,.9); border-radius: 50%; margin: -3.5rem 1rem 1rem; position: relative; box-shadow: var(--shadow); }
.author-intro h1 { font-size: clamp(2.5rem, 6vw, 5.2rem); max-width: 12ch; }
.trust-list { border-top: 1px solid color-mix(in srgb, currentColor, transparent 75%); margin-top: 2rem; padding-top: 1rem; }
.trust-list p { display: grid; grid-template-columns: 1.6rem 1fr; gap: .6rem; }
.relationship-disclosure { max-width: 65ch; border: 1px solid color-mix(in srgb, currentColor, transparent 72%); border-radius: 12px; padding: .8rem 1rem; font-size: .84rem; }
.focus-callout { display: grid; gap: .25rem; border-left: 3px solid var(--page-accent); padding: .7rem 0 .7rem 1rem; margin: 1rem 0; }
.focus-callout span { font-size: .9rem; }
.author-form { color: var(--ink); }
.demo-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .8rem 1.5rem; background: #222b3d; color: #fff; border-radius: 14px; padding: .8rem 1rem; margin-bottom: 1rem; }
.demo-banner a { color: #fff; font-weight: 750; }
.demo-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; align-items: start; margin-bottom: 1rem; height: auto; min-height: 0; overflow: visible; }
.demo-controls > div { grid-column: span 2; }
.demo-controls label { min-width: 0; align-self: start; }
.sample-picker { min-width: 0; margin: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 14px; }
.sample-picker legend { font-weight: 750; padding: 0 .35rem; }
.sample-picker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
.sample-choice { display: grid; grid-template-columns: auto 46px 1fr; align-items: center; gap: .55rem; min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: .45rem; background: #fff; cursor: pointer; }
.sample-choice:has(input:checked) { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.sample-choice input { width: auto; margin: 0; }
.sample-choice img { display: block; width: 46px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 5px; }
.sample-choice span { min-width: 0; font-size: .78rem; line-height: 1.25; }
.demo-sample-picker { grid-column: 1 / -1; }
.section-order-list { display: grid; gap: .5rem; padding: 0; list-style: none; }
.section-order-list li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; padding: .65rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.section-move-actions { display: flex; gap: .35rem; }
.section-move-actions .button { min-height: 36px; padding: .35rem .6rem; }
.media-editor { margin-top: 1rem; }
.media-form { padding: 1rem 0; border-top: 1px solid var(--line); }
.preview-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.preview-toolbar > div { display: flex; gap: .4rem; }
.preview-viewport { margin-inline: auto; transition: width .2s; }
.preview-desktop { width: 100%; }
.preview-mobile { width: min(390px, 100%); }
.preview-section-list { display: grid; gap: .25rem; padding-left: 1.3rem; font-size: .83rem; }
.offer-proof { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
.focus-detail li, .process-detail li { margin-bottom: .55rem; }
.portfolio-proof { padding: clamp(1.5rem, 4vw, 3rem) 0; scroll-margin-top: 1rem; }
.author-page, .offer-proof, .author-form { scroll-margin-top: 1rem; }
.process-detail { margin: 1rem 0; scroll-margin-top: 1rem; }
.author-form { max-width: 820px; margin: 1rem auto; }
.required-offer-summary { border: 1px solid var(--line); border-radius: 14px; padding: 1rem; margin-bottom: 1.25rem; background: #f8fafc; }
.report-page-control { text-align: center; margin: 2rem 0 0; font-size: .85rem; }
.proof-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.proof-grid figure { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.proof-grid img { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
.proof-grid figcaption { padding: .7rem .9rem; color: var(--muted); font-size: .85rem; }

@media (max-width: 850px) {
  .hero-grid, .author-page, .customize-grid, .offer-proof { grid-template-columns: 1fr; }
  .hero-grid { min-height: 0; margin-top: 3rem; }
  .form-card { justify-self: stretch; }
  .card-grid { grid-template-columns: 1fr; }
  .share-panel { grid-template-columns: 1fr; }
  .qr-card { width: min(100%, 230px); }
  .author-preview { position: static; min-height: 420px; }
  .author-page { border-radius: 20px; }
  .demo-controls { grid-template-columns: 1fr 1fr; }
  .sample-picker-grid { grid-template-columns: 1fr; }
  .preview-toolbar { align-items: flex-start; flex-direction: column; }
  .proof-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .portal-header { align-items: flex-start; }
  .portal-header nav { flex-direction: column; gap: .25rem; }
  .portal-shell { width: min(100% - 1rem, 1180px); }
  .dashboard-head, .section-heading { display: block; }
  .url-row { display: grid; }
  .slug-input { display: block; }
  .slug-input span { display: block; padding-bottom: 0; }
  .demo-controls { grid-template-columns: 1fr; }
  .demo-controls > div { grid-column: auto; }
  .proof-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
