/*
 * Creator portal styles. Mobile first: the base rules are the phone (360px
 * and up); wider layouts are layered on with min-width queries.
 *
 * Colour is tokens on :root, redefined for dark mode both by system
 * preference and by an explicit [data-theme]. The program's accent comes from
 * the API at runtime (--accent, --on-accent set by ui.applyAccent); tints of
 * it are mixed here so one brand colour themes everything.
 */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --accent: #E6007E;
  --on-accent: #ffffff;
  --bg: #faf7f8;
  --surface: #ffffff;
  --surface-2: #f4eff2;
  --surface-3: #ebe4e8;
  --ink: #1b1520;
  --ink-2: #4f4655;
  --ink-3: #6f6675;
  --line: #e6dee3;
  --line-strong: #cfc4cb;
  --focus: #1b1520;
  --success: #0f7b45; --success-bg: #e3f5ea;
  --warning: #8a5300; --warning-bg: #fff2d9;
  --danger: #b4232f; --danger-bg: #fde7e8;
  --info: #1f5fbf; --info-bg: #e5eefc;
  --accent-ink: color-mix(in oklab, var(--accent) 82%, black);
  --accent-soft: color-mix(in oklab, var(--accent) 10%, var(--surface));
  --accent-soft-2: color-mix(in oklab, var(--accent) 18%, var(--surface));
  --shadow: 0 1px 2px rgb(27 21 32 / 6%), 0 6px 20px rgb(27 21 32 / 6%);
  --shadow-lg: 0 10px 40px rgb(27 21 32 / 18%);
  --radius: 18px;
  --radius-sm: 12px;
  --tap: 44px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --tabbar-h: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121015; --surface: #1b181f; --surface-2: #24202a; --surface-3: #2e2935;
    --ink: #f4f0f6; --ink-2: #cdc5d2; --ink-3: #a59cab; --line: #322c38; --line-strong: #4a4252; --focus: #ffffff;
    --success: #5fd398; --success-bg: #12301f; --warning: #f3bd5a; --warning-bg: #352710;
    --danger: #ff8a92; --danger-bg: #3a1619; --info: #8ab4ff; --info-bg: #15233d;
    --accent-ink: color-mix(in oklab, var(--accent) 65%, white);
    --accent-soft: color-mix(in oklab, var(--accent) 16%, var(--surface));
    --accent-soft-2: color-mix(in oklab, var(--accent) 26%, var(--surface));
    --shadow: 0 1px 2px rgb(0 0 0 / 40%); --shadow-lg: 0 10px 40px rgb(0 0 0 / 55%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121015; --surface: #1b181f; --surface-2: #24202a; --surface-3: #2e2935;
  --ink: #f4f0f6; --ink-2: #cdc5d2; --ink-3: #a59cab; --line: #322c38; --line-strong: #4a4252; --focus: #ffffff;
  --success: #5fd398; --success-bg: #12301f; --warning: #f3bd5a; --warning-bg: #352710;
  --danger: #ff8a92; --danger-bg: #3a1619; --info: #8ab4ff; --info-bg: #15233d;
  --accent-ink: color-mix(in oklab, var(--accent) 65%, white);
  --accent-soft: color-mix(in oklab, var(--accent) 16%, var(--surface));
  --accent-soft-2: color-mix(in oklab, var(--accent) 26%, var(--surface));
  --shadow: 0 1px 2px rgb(0 0 0 / 40%); --shadow-lg: 0 10px 40px rgb(0 0 0 / 55%);
  color-scheme: dark;
}

/* ── Base ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; overflow-x: hidden; min-height: 100dvh;
}
body.has-modal { overflow: hidden; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 6vw, 2.1rem); font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 750; }
h3, .h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .75em; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
#main:focus { outline: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.center { text-align: center; }
.right { text-align: right; }
.mono { font-family: var(--mono); letter-spacing: .02em; }
.spacer { flex: 1; }
.grow { flex: 1; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.row.baseline { align-items: flex-end; }
.row.gap { gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.lead { font-size: 1.08rem; color: var(--ink-2); }
.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-ink); margin-bottom: .5em; }
.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; vertical-align: -3px; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 10px 18px;
  border-radius: 999px; border: 1.5px solid transparent; font-weight: 700; font-size: .975rem; text-decoration: none;
  cursor: pointer; transition: transform .12s ease, background-color .15s ease, box-shadow .15s ease; position: relative; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 18px color-mix(in oklab, var(--accent) 30%, transparent); }
.btn-primary:hover:not(:disabled) { background: color-mix(in oklab, var(--accent) 90%, black); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--accent-ink); }
.btn-ghost:hover:not(:disabled) { background: var(--accent-soft); }
.btn-danger { background: transparent; color: var(--danger); border-color: color-mix(in oklab, var(--danger) 40%, transparent); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-full { width: 100%; }
.btn-icon { padding: 0; width: var(--tap); }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after {
  content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid currentColor; border-color: var(--on-accent) var(--on-accent) transparent transparent; animation: spin .7s linear infinite;
}
.btn-secondary.is-loading::after, .btn-ghost.is-loading::after { border-color: var(--ink) var(--ink) transparent transparent; }
.btn-instagram {
  color: #fff; border: 0; background: linear-gradient(90deg, #c92a6d, #8f2fb8 55%, #4a55c9);
  box-shadow: 0 6px 18px rgb(143 47 184 / 28%);
}
.btn-instagram:hover:not(:disabled) { filter: brightness(1.08); }
.btn-instagram.is-loading::after { border-color: #fff #fff transparent transparent; }
.ig-card { margin: 18px 0 12px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.ig-card h2 { margin: 0; }
.ig-mark { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #f2a03d, #c92a6d 45%, #8f2fb8 75%, #4a55c9); }
.ig-shares { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; font-size: .92rem; color: var(--ink-2); }
.ig-shares li { display: flex; gap: 8px; align-items: flex-start; }
.ig-shares .icon { color: var(--success); margin-top: 3px; stroke-width: 3; }
.metrics { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; color: var(--ink-2); }
.link-btn {
  background: none; border: 0; padding: 8px 4px; min-height: var(--tap); color: var(--accent-ink); font-weight: 700; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px; font-size: .95rem;
}
.link-btn.inline { min-height: 0; padding: 0; display: inline; font-size: inherit; text-decoration: underline; }
.link-btn:disabled { color: var(--ink-3); cursor: default; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Badges, banners ────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700;
  white-space: nowrap; background: var(--surface-2); color: var(--ink-2);
}
.badge .icon { width: 14px; height: 14px; }
.tone-success.badge { background: var(--success-bg); color: var(--success); }
.tone-warning.badge { background: var(--warning-bg); color: var(--warning); }
.tone-danger.badge { background: var(--danger-bg); color: var(--danger); }
.tone-info.badge { background: var(--info-bg); color: var(--info); }
.banner { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); margin: 12px 0; align-items: flex-start; }
.banner > .icon { margin-top: 2px; }
.banner p { margin: .25em 0 0; }
.banner.tone-info { background: var(--info-bg); color: var(--ink); } .banner.tone-info > .icon { color: var(--info); }
.banner.tone-warning { background: var(--warning-bg); } .banner.tone-warning > .icon { color: var(--warning); }
.banner.tone-danger { background: var(--danger-bg); } .banner.tone-danger > .icon { color: var(--danger); }
.mini-steps { margin: .5em 0; padding-left: 1.2em; } .mini-steps li { margin: .3em 0; }

/* ── Cards, sections ────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card.soft { background: var(--surface-2); box-shadow: none; border-color: transparent; }
.section { margin-top: 26px; }
.section > h2, .section > .h3 { margin-bottom: 12px; }
.page { padding: 16px 16px 32px; max-width: 1080px; margin: 0 auto; }
.page-head { margin: 6px 0 4px; }
.page-head .segmented { margin-top: 12px; }
.narrow { max-width: 480px; margin: 0 auto; padding: 8px 16px 40px; }
.narrow-page { max-width: 640px; }
.grid-2 { display: grid; gap: 14px; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .fieldset legend { font-weight: 650; font-size: .92rem; }
.optional { font-weight: 400; color: var(--ink-3); }
.field input, .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--line-strong);
  background: var(--surface); font-size: 16px; /* 16px stops iOS zooming on focus */ transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft-2); }
.field.has-error input, .field.has-error select { border-color: var(--danger); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input-affix { display: flex; align-items: stretch; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.input-affix:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft-2); }
.input-affix .affix { display: flex; align-items: center; padding: 0 4px 0 14px; color: var(--ink-3); font-weight: 600; white-space: nowrap; max-width: 50%; overflow: hidden; text-overflow: ellipsis; }
.field .input-affix input { border: 0; box-shadow: none; min-width: 0; padding-left: 4px; }
.field.has-error .input-affix { border-color: var(--danger); }
.help { margin: 0; font-size: .84rem; color: var(--ink-3); }
.field-error { margin: 0; display: flex; gap: 6px; align-items: flex-start; color: var(--danger); font-size: .86rem; font-weight: 600; }
.field-error .icon { margin-top: 1px; }
.checkbox { display: flex; gap: 12px; align-items: flex-start; font-size: .92rem; color: var(--ink-2); cursor: pointer; }
.checkbox input { width: 24px; height: 24px; min-height: 0; margin: 0; accent-color: var(--accent); flex: none; }
.fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.fieldset legend { margin-bottom: 4px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: .85rem; margin: 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.input-action { display: flex; gap: 8px; }
.input-action input { flex: 1; min-width: 0; }
.disclosure { border: 1.5px solid var(--line); border-radius: var(--radius-sm); }
.disclosure-toggle {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px; min-height: var(--tap); background: none; border: 0; text-align: left; cursor: pointer;
}
.disclosure-toggle > span { display: flex; flex-direction: column; flex: 1; }
.disclosure-toggle .chev { transition: transform .2s; color: var(--ink-3); }
.disclosure-toggle[aria-expanded="true"] .chev { transform: rotate(90deg); }
.disclosure-body { padding: 0 14px 14px; }
.address-fields { display: flex; flex-direction: column; gap: 12px; }
.address { font-style: normal; line-height: 1.55; }

/* ── Segmented, tabs ────────────────────────────────────────────────────── */
.segmented { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 2px; max-width: 100%; }
.segmented > a, .segmented > button {
  border: 0; background: none; padding: 8px 16px; min-height: 40px; border-radius: 999px; font-weight: 700; font-size: .9rem; color: var(--ink-2);
  text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; white-space: nowrap;
}
.segmented .is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.segmented.small > button { padding: 6px 12px; min-height: 36px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; margin: 14px -16px 4px; padding-inline: 16px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs [role="tab"] {
  flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 8px 16px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line-strong); background: var(--surface); font-weight: 700;
}
.tabs [aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tab-count { font-size: .75rem; background: var(--surface-3); color: var(--ink-2); border-radius: 999px; padding: 1px 8px; }
.tabs [aria-selected="true"] .tab-count { background: color-mix(in oklab, var(--bg) 25%, transparent); color: inherit; }

/* ── Boot, skeleton, empty ──────────────────────────────────────────────── */
.boot { display: grid; place-items: center; min-height: 60dvh; }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.skeleton-page { padding: 16px; max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.sk { border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.sk-title { height: 34px; width: 55%; border-radius: 10px; }
.sk-card { height: 120px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty { text-align: center; padding: 36px 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty-icon, .hero-icon {
  display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--accent-soft); color: var(--accent-ink); margin-bottom: 8px;
}
.hero-icon.big { width: 76px; height: 76px; border-radius: 24px; }
.hero-icon.big .icon { width: 36px; height: 36px; }
.hero-icon.success { background: var(--success-bg); color: var(--success); }
.hero-icon.warm { background: var(--warning-bg); color: var(--warning); }

/* ── Demo strip, toasts ─────────────────────────────────────────────────── */
.demo-strip {
  display: flex; align-items: center; gap: 8px; padding: 2px 16px; font-size: .82rem; background: var(--ink); color: var(--bg);
}
.demo-strip span { flex: 1; min-width: 0; }
.demo-strip .link-btn { color: var(--bg); text-decoration: underline; font-size: .82rem; }
.toast-region {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); z-index: 60;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 480px; width: 100%; padding: 10px 8px 10px 14px; border-radius: 14px;
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 600; font-size: .92rem; animation: rise .2s ease;
}
.toast > span { flex: 1; }
.toast.tone-critical > .icon { color: #ff9aa2; }
.toast > .icon { color: #7ee2a8; }
.toast-action { background: none; border: 0; color: inherit; font-weight: 800; text-decoration: underline; min-height: var(--tap); padding: 0 8px; cursor: pointer; }
.toast-close { background: none; border: 0; color: inherit; width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; opacity: .75; }
body[data-layout="public"] .toast-region { top: calc(12px + env(safe-area-inset-top)); bottom: auto; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

/* ── Modal → bottom sheet on phones ─────────────────────────────────────── */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgb(10 6 14 / 50%); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.modal {
  width: 100%; max-height: 92dvh; overflow: auto; background: var(--surface); border-radius: 24px 24px 0 0; padding: 8px 18px calc(20px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg); animation: sheet .22s ease; outline: none;
}
.modal-grip { width: 40px; height: 5px; border-radius: 9px; background: var(--line-strong); margin: 4px auto 6px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.modal-header h2 { margin: 0; }
.modal-body { display: flex; flex-direction: column; gap: 14px; }
@keyframes sheet { from { transform: translateY(40px); opacity: .4; } }
@keyframes fade { from { opacity: 0; } }

/* ── Public layout ──────────────────────────────────────────────────────── */
.public-header { display: flex; align-items: center; gap: 8px; padding: 10px 16px; max-width: 1080px; margin: 0 auto; }
.program-mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; min-height: var(--tap); min-width: 0; }
.program-mark img { width: 32px; height: 32px; border-radius: 10px; object-fit: cover; }
.program-initial { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-weight: 800; flex: none; }
.program-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.public-main { padding-bottom: 24px; }
.public-main.solo { padding-top: 24px; }
.no-program { max-width: 440px; margin: 10dvh auto 0; text-align: center; }
.no-program form { text-align: left; margin: 16px 0; }

/* Landing */
.landing { max-width: 960px; margin: 0 auto; padding: 0 16px 120px; }
.hero { padding: 28px 0 8px; position: relative; }
.hero::before {
  content: ''; position: absolute; inset: -10px -16px auto; height: 300px; z-index: -1; border-radius: 0 0 40px 40px;
  background: radial-gradient(120% 90% at 0% 0%, var(--accent-soft-2), transparent 60%), radial-gradient(80% 80% at 100% 10%, var(--accent-soft), transparent 70%);
}
.hero h1 { font-size: clamp(2.1rem, 10vw, 3.4rem); line-height: 1.05; margin-bottom: .35em; }
.hero-perk { display: inline-flex; gap: 8px; align-items: center; background: var(--surface); border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; font-weight: 650; font-size: .9rem; }
.hero-actions { display: grid; gap: 10px; margin: 18px 0 6px; }
.brand-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.brand-tile { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); min-width: 0; }
.brand-tile img, .brand-initial { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; flex: none; }
.brand-initial { display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-weight: 800; }
.brand-tile > span { display: flex; flex-direction: column; min-width: 0; }
.brand-tile strong { overflow-wrap: anywhere; line-height: 1.25; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.steps h3 { margin-bottom: .2em; }
.steps p { margin: 0; }
.steps.compact li { padding: 12px 14px; border-radius: var(--radius-sm); }
.step-num { flex: none; width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-weight: 800; }
.ladder { list-style: none; margin: 14px 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ladder li { display: grid; grid-template-columns: minmax(96px, 38%) 1fr; align-items: center; gap: 10px; }
.ladder-label { font-weight: 650; font-size: .92rem; }
.ladder-bar { display: flex; justify-content: flex-end; width: var(--w); min-width: 56px; padding: 7px 12px; border-radius: 10px; background: var(--accent-soft-2); color: var(--accent-ink); font-weight: 800; }
.ladder li:last-child .ladder-bar, .ladder li.is-current .ladder-bar { background: var(--accent); color: var(--on-accent); }
.criteria { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.criteria li { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.criteria li > .icon { color: var(--accent-ink); margin-top: 2px; }
.criteria li div { display: flex; flex-direction: column; }
.criteria li span { color: var(--ink-3); font-size: .92rem; }
.criteria.compact li { background: var(--surface); }
.landing-foot { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-top: 32px; }
.landing-foot a { color: var(--ink-3); }
.sticky-cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.landing .sticky-cta > .btn:only-child { grid-column: 1 / -1; }
.sticky-cta.solo { grid-template-columns: 1fr; position: sticky; margin: 16px -16px 0; }

/* Apply */
.stepper { display: flex; align-items: center; gap: 8px; margin: 8px 0 22px; font-size: .85rem; font-weight: 700; color: var(--ink-3); }
.stepper-item { display: flex; align-items: center; gap: 8px; }
.stepper-item > span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); }
.stepper-item.is-done > span { background: var(--accent); color: var(--on-accent); }
.stepper-item.is-current { color: var(--ink); }
.stepper-line { flex: 1; height: 3px; border-radius: 3px; background: var(--surface-3); }
.stepper-line.is-done { background: var(--accent); }

/* Code */
.otp { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp-box {
  width: 100%; min-width: 0; aspect-ratio: 5 / 6; max-height: 64px; text-align: center; font: 800 1.5rem var(--mono); border-radius: 14px;
  border: 1.5px solid var(--line-strong); background: var(--surface); caret-color: var(--accent);
}
.otp-box:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft-2); }
.otp-box[aria-invalid] { border-color: var(--danger); }
.code-foot { display: flex; justify-content: space-between; margin-top: 8px; }

/* Instagram verify */
.code-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 16px; margin: 18px 0; border-radius: var(--radius);
  background: var(--accent-soft); border: 2px dashed color-mix(in oklab, var(--accent) 45%, transparent);
}
.bio-code { font-size: clamp(1.8rem, 9vw, 2.6rem); font-weight: 800; color: var(--ink); letter-spacing: .06em; user-select: all; word-break: break-all; text-align: center; }
.narrow > .btn-full { margin-top: 12px; }

/* Status */
.status-screen { text-align: center; padding-top: 24px; position: relative; }
.status-screen .lead { margin-bottom: 1.2em; }
.status-screen .card { text-align: left; margin-top: 16px; }
.reason-list { list-style: none; padding: 0; margin: 0 0 16px; text-align: left; display: grid; gap: 8px; }
.reason-list li { display: flex; gap: 10px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.tips { margin: 0; padding-left: 1.2em; } .tips li { margin: .3em 0; }
.confetti { position: absolute; inset: 0 0 auto; height: 260px; overflow: hidden; pointer-events: none; }
.confetti span {
  position: absolute; top: -12px; left: calc(var(--x) * 1%); width: 8px; height: 14px; border-radius: 2px;
  background: var(--accent); opacity: .85; animation: drop 2.6s ease-in calc(var(--d) * 70ms) forwards;
}
.confetti span:nth-child(3n) { background: #ffc531; } .confetti span:nth-child(3n+1) { background: #3fc5a0; width: 6px; }
@keyframes drop { to { transform: translateY(280px) rotate(540deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .confetti { display: none; }
}

/* ── App layout ─────────────────────────────────────────────────────────── */
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--surface); padding: 10px 14px; border-radius: 10px; }
.skip-link:focus { top: 8px; }
.app-header {
  position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 8px; padding: 6px 16px;
  background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.header-avatar { display: grid; place-items: center; width: var(--tap); height: var(--tap); border-radius: 50%; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-initial { display: grid; place-items: center; background: var(--accent-soft-2); color: var(--accent-ink); font-weight: 800; }
.avatar.big { width: 72px; height: 72px; font-size: 1.8rem; }
.app-main { padding-bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); min-width: 0; }
.rail { display: none; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in oklab, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: var(--tabbar-h);
  color: var(--ink-3); text-decoration: none; font-size: .72rem; font-weight: 700; -webkit-tap-highlight-color: transparent;
}
.tabbar a.is-active { color: var(--accent-ink); }
.tabbar a.is-active .icon { background: var(--accent-soft-2); border-radius: 999px; padding: 3px 14px; width: 52px; height: 30px; box-sizing: border-box; }

/* Home */
.next-step {
  display: flex; gap: 14px; padding: 18px; border-radius: var(--radius); margin-top: 16px; border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow);
}
.next-step.tone-accent { background: linear-gradient(135deg, var(--accent-soft-2), var(--accent-soft)); border-color: transparent; }
.next-step.tone-danger { background: var(--danger-bg); border-color: transparent; }
.next-step.tone-warning { background: var(--warning-bg); border-color: transparent; }
.next-icon { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); color: var(--accent-ink); }
.next-step.tone-danger .next-icon { color: var(--danger); } .next-step.tone-warning .next-icon { color: var(--warning); }
.next-body { min-width: 0; }
.next-body .eyebrow { margin-bottom: .2em; }
.next-body h2 { font-size: 1.15rem; }
.next-body p { color: var(--ink-2); }
.next-action { margin-top: 4px; }
.nudges { display: grid; gap: 10px; margin-top: 12px; }
.nudge {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 56px; border-radius: var(--radius-sm); text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px dashed var(--line-strong);
}
.nudge > span { flex: 1; display: flex; flex-direction: column; }
.nudge > .icon:first-child { color: var(--accent-ink); }
.brand-month h3 { margin: 0; }
.brand-month .row.between.baseline { margin: 14px 0 6px; }
.brand-month .small { display: block; }
.big-num { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; display: block; }
.mid-num { font-size: 1.15rem; font-weight: 800; display: block; }
.meter { position: relative; height: 12px; border-radius: 99px; background: var(--surface-3); margin: 22px 0 8px; }
.meter-fill { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--accent); min-width: 12px; transition: width .6s ease; }
.meter-tick { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--line-strong); }
.meter-tick.is-reached { background: var(--on-accent); }
.meter-tick > span { position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%); font-size: .72rem; font-weight: 800; color: var(--ink-3); }
.meter-tick.is-reached > span { color: var(--accent-ink); }
.meter-caption { margin: 0; font-size: .92rem; color: var(--ink-2); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; display: flex; flex-direction: column; min-width: 0; }
.card .stat { background: var(--surface-2); border-color: transparent; }
.stat-label { font-size: .82rem; color: var(--ink-3); font-weight: 650; }
.stat-value { font-size: 1.35rem; font-weight: 800; overflow-wrap: anywhere; }
.stat-hint { font-size: .78rem; color: var(--ink-3); }

/* Products */
.product-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.product-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.product-media { position: relative; aspect-ratio: 1; background: var(--accent-soft); }
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-placeholder { width: 100%; height: 100%; display: grid; place-items: center; color: var(--accent-ink); background: radial-gradient(circle at 30% 20%, var(--accent-soft-2), var(--accent-soft)); }
.product-placeholder .icon { width: 40px; height: 40px; opacity: .7; }
.product-placeholder.small { width: 56px; height: 56px; border-radius: 14px; flex: none; }
.product-placeholder.small .icon { width: 24px; height: 24px; }
.product-flag { position: absolute; top: 8px; left: 8px; }
.product-flag .badge { box-shadow: var(--shadow); }
.product-info { padding: 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.product-info h3 { font-size: .95rem; margin: 0; }
.product-info p { margin: 0; }
.product-info .btn { margin-top: auto; }
.product-card.is-unavailable .product-media { filter: grayscale(.6); opacity: .8; }
.lock-reason { display: flex; gap: 6px; align-items: flex-start; color: var(--ink-3); margin-top: auto !important; padding-top: 6px; }
.request-product { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.request-product img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; }
.request-product > div { display: flex; flex-direction: column; }
.ship-to { padding: 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.ship-to h3 { margin: 0; }
.success-sheet { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding-bottom: 8px; }

/* My products */
.request.is-overdue { border-color: color-mix(in oklab, var(--danger) 55%, transparent); box-shadow: 0 0 0 3px var(--danger-bg); }
.request.is-closed { opacity: .8; box-shadow: none; }
.request-head { display: flex; gap: 12px; align-items: center; }
.request-head img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; flex: none; }
.request-head h3 { margin: 0; font-size: 1rem; }
.request-head p { margin: 0; }
.request-head .badge { align-self: flex-start; }
.overdue-note { display: flex; gap: 6px; color: var(--danger); font-weight: 650; font-size: .9rem; margin: 12px 0 0; }
/* Phones: a vertical timeline (six labels never fit across 360px). */
.timeline { list-style: none; margin: 14px 0 4px; padding: 0; display: grid; gap: 0; }
.timeline li { position: relative; display: grid; grid-template-columns: 24px 1fr auto auto; align-items: center; gap: 2px 10px; min-height: 34px; }
.timeline li::before { content: ''; position: absolute; left: 10.5px; top: -17px; height: 34px; width: 3px; background: var(--surface-3); z-index: 0; }
.timeline li:first-child::before { display: none; }
.timeline li.is-done::before, .timeline li.is-current::before { background: var(--accent); }
.timeline .dot { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); border: 3px solid var(--surface-3); display: grid; place-items: center; color: var(--on-accent); }
.timeline .is-done .dot { background: var(--accent); border-color: var(--accent); }
.timeline .is-done .dot .icon { width: 14px; height: 14px; stroke-width: 3; }
.timeline .is-current .dot { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft-2); }
.timeline .is-late .dot { border-color: var(--danger); box-shadow: 0 0 0 4px var(--danger-bg); }
.t-label { font-size: .88rem; font-weight: 650; color: var(--ink-3); line-height: 1.2; }
.is-done .t-label, .is-current .t-label { color: var(--ink); }
.is-current .t-label { font-weight: 800; }
.is-late .t-label { color: var(--danger); }
.t-detail { font-size: .8rem; color: var(--ink-3); line-height: 1.2; text-align: right; }
a.t-detail { color: var(--accent-ink); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; }
.post { margin-top: 12px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.post p { margin: 0; }
.post .btn { align-self: flex-start; }
.post-link { font-weight: 700; display: inline-flex; gap: 6px; align-items: center; min-height: 32px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.checks li > span:last-child { display: flex; flex-direction: column; }
.check-icon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.check-icon .icon { width: 14px; height: 14px; stroke-width: 3; }
.checks .ok .check-icon { background: var(--success-bg); color: var(--success); }
.checks .fail .check-icon { background: var(--danger-bg); color: var(--danger); }
.submit-reel { margin-top: 12px; }
.requirements { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); }
.requirements p { margin: 0 0 6px; }
.requirements ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .9rem; }
.requirements li { display: flex; gap: 8px; align-items: flex-start; }
.requirements li .icon { color: var(--accent-ink); margin-top: 3px; stroke-width: 3; }
details > summary { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; font-weight: 650; color: var(--accent-ink); }
.request-actions { margin-top: 8px; }

/* Links */
.code-tiles { display: grid; gap: 10px; }
.code-tile { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 12px 8px 12px 16px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1.5px dashed color-mix(in oklab, var(--accent) 40%, transparent); }
.code-tile > div { display: flex; flex-direction: column; min-width: 0; }
.code-text { font-size: 1.35rem; font-weight: 800; }
.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.link-row { display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.link-row.is-new { box-shadow: 0 0 0 3px var(--accent-soft-2); border-color: var(--accent); }
.link-main { display: flex; flex-direction: column; min-width: 0; }
.link-url { font-size: .88rem; color: var(--accent-ink); overflow-wrap: anywhere; margin-top: 2px; }
.link-meta { display: flex; flex-direction: column; align-items: flex-end; }
.link-meta strong { font-size: 1.2rem; }
.link-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.link-remove { color: var(--ink-3); }
.modal-sm { max-width: 420px; }

/* Earnings */
.chart { position: relative; margin-top: 14px; min-height: 200px; touch-action: pan-y; border-radius: 8px; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .baseline { stroke: var(--line-strong); stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font: 600 11px var(--font); }
.chart .bar { fill: var(--accent); opacity: .85; }
.chart .bar.is-selected { opacity: 1; fill: var(--accent-ink); }
.chart .cursor { stroke: var(--line-strong); stroke-dasharray: 3 3; }
.chart-tip {
  position: absolute; top: 0; transform: translateX(-50%); pointer-events: none; background: var(--ink); color: var(--bg); padding: 6px 10px;
  border-radius: 10px; font-size: .8rem; display: flex; flex-direction: column; align-items: center; white-space: nowrap; box-shadow: var(--shadow-lg);
}
.chart-empty { min-height: 200px; display: grid; place-content: center; text-align: center; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 16px; }
.chart-empty p { margin: 0 0 4px; }
.table-view { margin-top: 8px; }
.table-scroll { overflow-x: auto; max-height: 280px; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: right; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--ink-3); font-weight: 700; position: sticky; top: 0; background: var(--surface); }
.earn-grid { display: grid; gap: 10px; }
.earn { padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; }
.earn strong { font-size: 1.45rem; font-weight: 800; }
.earn-due { background: var(--accent-soft); border-color: transparent; }
.period-group { margin-bottom: 18px; }
.period-group h3 { font-size: .95rem; color: var(--ink-2); }
.statement-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.statement { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.statement p { margin: 6px 0 0; }
.statement-lines { margin: 10px 0 0; display: grid; gap: 4px; }
.statement-lines div, .kv div { display: flex; justify-content: space-between; gap: 12px; }
.statement-lines dt { color: var(--ink-3); }
.statement-lines dd, .kv dd { margin: 0; font-weight: 650; text-align: right; overflow-wrap: anywhere; }
.statement-lines .total { border-top: 1px solid var(--line); padding-top: 6px; margin-top: 4px; }
.statement-lines .total dt, .statement-lines .total dd { color: var(--ink); font-weight: 800; }
.kv { margin: 0 0 12px; display: grid; gap: 10px; }
.kv dt { color: var(--ink-3); flex: none; }

/* Profile */
.profile-head { display: flex; align-items: center; gap: 16px; margin: 8px 0 4px; }
.profile-head h1 { margin: 0; font-size: 1.5rem; }
.profile-head p { margin: 0; }
.profile-head .icon { color: var(--info); }
.menu { list-style: none; margin: 0; padding: 0; }
.menu a { display: flex; align-items: center; gap: 12px; min-height: 52px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.menu li:last-child a { border-bottom: 0; }
.menu a span { flex: 1; overflow-wrap: anywhere; }
.menu a .icon:last-child { color: var(--ink-3); }
.page > .btn-danger { margin-top: 26px; }

/* ── Wider screens ──────────────────────────────────────────────────────── */
@media (min-width: 560px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .earn-grid { grid-template-columns: repeat(3, 1fr); }
  .code-tiles { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .hero-actions { grid-template-columns: auto auto; justify-content: start; }
  .hero-actions .btn { min-width: 180px; }
  .link-row { grid-template-columns: 1fr auto auto; align-items: center; }
  .link-actions { grid-column: auto; display: flex; }
  .timeline { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-top: 18px; }
  .timeline li { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; min-height: 0; }
  .timeline li::before { top: 11px; left: -50%; right: 50%; width: auto; height: 3px; }
  .t-label { font-size: .78rem; }
  .t-detail { font-size: .72rem; text-align: center; }
  a.t-detail { min-height: 0; }
  .backdrop { align-items: center; padding: 24px; }
  .modal { max-width: 520px; border-radius: 24px; padding: 16px 22px 22px; }
  .modal-grip { display: none; }
}
@media (min-width: 760px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .landing { padding-bottom: 40px; }
  .landing .sticky-cta { display: none; }
  .links-layout { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
  .links-layout #create { position: sticky; top: 80px; }
  .toast-region { bottom: 24px; left: auto; right: 24px; align-items: flex-end; }
}
@media (min-width: 960px) {
  .steps { grid-template-columns: repeat(4, 1fr); }
  .steps li { flex-direction: column; }
  .app-frame { display: grid; grid-template-columns: 248px 1fr; min-height: 100dvh; }
  .rail {
    display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100dvh; padding: 18px 14px;
    border-right: 1px solid var(--line); background: var(--surface);
  }
  .rail ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
  .rail ul a { display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: 8px 12px; border-radius: 12px; color: var(--ink-2); text-decoration: none; font-weight: 700; }
  .rail ul a:hover { background: var(--surface-2); }
  .rail ul a.is-active { background: var(--accent-soft); color: var(--accent-ink); }
  .rail-foot { margin-top: auto; display: flex; gap: 10px; align-items: center; min-width: 0; }
  .rail-foot div { display: flex; flex-direction: column; min-width: 0; font-size: .88rem; }
  .rail-foot strong, .rail-foot span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .app-header, .tabbar { display: none; }
  .app-main { padding-bottom: 40px; }
  .page { padding: 28px 32px 48px; }
}
