/* SuhoorFest Creators: the creator dashboard (/creators/dashboard), the
   creator link page (/c/CODE) and the owner admin (/owner/creators).
   Built on css/v2.css (tokens, buttons, fields, stickers). Flat cards,
   hairline rows, one accent, straight stickers only. Phone first. */

.cx { padding: 116px 0 96px; min-height: 80vh; }
.cx__in { max-width: 720px; margin: 0 auto; }
.cx--wide .cx__in { max-width: 1120px; }
.cx-head h1 { font: 400 clamp(44px, 6vw, 76px)/.94 'TT Display'; letter-spacing: -0.01em; margin-top: 14px; text-wrap: balance; }
.cx-head .lead { margin-top: 14px; max-width: 560px; }
.cx-head__row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cx-loading { color: var(--dim); padding: 40px 0; }

/* cards */
.cx-card { margin-top: 16px; padding: 22px; border-radius: var(--r-lg); background: var(--elevated); box-shadow: inset 0 0 0 1px var(--line); }
.cx-card--accent { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.cx-card--accent .cx-k { color: rgba(17,17,17,.7); }
.cx-card h2, .cx-h2 { font: 400 clamp(28px, 3vw, 36px)/1 'TT Display'; }
.cx-card p + p { margin-top: 8px; }
.cx-sec { margin-top: 40px; }
.cx-sec > .cx-h2 { margin-bottom: 4px; }
.cx-sub { color: var(--muted); font-size: 16px; line-height: 1.45; margin-top: 8px; }
.cx-k { font: 600 14px/1.2 'TT'; color: var(--dim); }
.cx-note { color: var(--dim); font-size: 14px; line-height: 1.45; margin-top: 10px; }
.cx-note a, .cx-sub a { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }

/* the link + code card */
.cx-share { display: grid; gap: 18px; }
.cx-share__val { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; }
.cx-share__link { font: 700 clamp(18px, 2.4vw, 22px)/1.25 'TT'; overflow-wrap: anywhere; min-width: 0; }
.cx-share__code { font: 400 clamp(44px, 7vw, 64px)/.9 'TT Display'; letter-spacing: .02em; overflow-wrap: anywhere; min-width: 0; }
.cx-share .btn-row { margin-top: 0; }
.cx-btn-dark { background: #111; color: #fff; }
.cx-btn-dark:hover { background: #262626; }
.cx-btn-line { background: transparent; color: #111; box-shadow: inset 0 0 0 1.5px rgba(17,17,17,.35); }
.cx-btn-line:hover { background: rgba(17,17,17,.06); }
.cx-perk { display: inline-block; margin-top: 10px; font: 600 15px/1.35 'TT'; }

/* earnings */
.cx-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.cx-stat { padding: 16px; border-radius: var(--r-lg); background: var(--elevated); box-shadow: inset 0 0 0 1px var(--line); min-width: 0; }
.cx-stat__n { font: 400 clamp(32px, 4.4vw, 44px)/1 'TT Display'; font-variant-numeric: tabular-nums; margin-top: 8px; overflow-wrap: anywhere; }
.cx-stat__s { color: var(--dim); font-size: 13px; line-height: 1.35; margin-top: 6px; }

/* hairline lists */
.cx-list { margin-top: 12px; border-top: 1px solid var(--line); }
.cx-li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); min-height: 64px; }
.cx-li__main { min-width: 0; flex: 1; }
.cx-li__t { font: 600 16px/1.3 'TT'; overflow-wrap: anywhere; }
.cx-li__s { color: var(--dim); font-size: 14px; line-height: 1.4; margin-top: 3px; overflow-wrap: anywhere; }
.cx-li__end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; text-align: right; }
.cx-li__amt { font: 700 17px/1.1 'TT'; font-variant-numeric: tabular-nums; }
.cx-li a.cx-li__t { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.cx-empty { color: var(--dim); padding: 20px 0; border-bottom: 1px solid var(--line); }
.cx-more { margin-top: 12px; }

/* status pills (straight caption stickers) */
.cx-pill { display: inline-block; font: 400 14px/1.15 'TT Caption'; border-radius: var(--r); padding: 3px 8px 4px; white-space: nowrap; background: rgba(255,255,255,.10); color: #fff; }
.cx-pill--ok { background: var(--accent); color: var(--on-accent); }
.cx-pill--white { background: #fff; color: #111; }
.cx-pill--bad { background: rgba(255,107,107,.16); color: #FF9A9A; }
.cx-pill--warn { background: #FFD66B; color: #111; }

/* forms */
.cx-form .field:first-child { margin-top: 18px; }
.cx-form .field { margin-top: 18px; }
.cx-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.cx-at { position: relative; }
.cx-at > span { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--dim); pointer-events: none; font-size: 17px; }
.cx-at > input { padding-left: 34px !important; }
.cx-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cx-chips .chip { height: 44px; }
.cx-choice { display: grid; gap: 10px; }
.cx-opt { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: var(--r-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; text-align: left; width: 100%; }
.cx-opt[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.cx-opt__dot { width: 22px; height: 22px; border-radius: 999px; box-shadow: inset 0 0 0 2px var(--line-strong); flex: none; margin-top: 1px; }
.cx-opt[aria-pressed="true"] .cx-opt__dot { box-shadow: inset 0 0 0 7px var(--accent); }
.cx-opt b { display: block; font: 600 16px/1.3 'TT'; }
.cx-opt small { display: block; color: var(--dim); font-size: 14px; line-height: 1.4; margin-top: 3px; }
.cx-err { color: var(--danger); font-size: 15px; margin-top: 12px; }
.cx-ok { color: var(--accent); font-size: 15px; margin-top: 12px; }
.cx-actions { margin-top: 22px; }
.cx-actions .btn { width: 100%; }
.cx-inline { display: flex; gap: 8px; align-items: stretch; }
.cx-inline .input { flex: 1; min-width: 0; }
.cx-inline .btn { flex: none; min-height: 56px; height: 56px; }
.cx-otp { letter-spacing: .3em; font: 700 24px 'TT' !important; text-align: center; }
.cx-link-btn { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 15px; padding: 10px 0; }
.cx-link-btn:hover { color: #fff; }

/* switch */
.cx-switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font: 600 16px 'TT'; }
.cx-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cx-switch__track { width: 52px; height: 32px; border-radius: 999px; background: rgba(255,255,255,.16); position: relative; flex: none; transition: background-color .15s; }
.cx-switch__track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 999px; background: #fff; transition: transform .18s var(--ease); }
.cx-switch input:checked + .cx-switch__track { background: var(--accent); }
.cx-switch input:checked + .cx-switch__track::after { transform: translateX(20px); background: #111; }
.cx-switch input:focus-visible + .cx-switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* segmented control */
.cx-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); max-width: 100%; }
.cx-seg button { min-height: 40px; padding: 0 14px; border-radius: 8px; font: 600 14px 'TT'; color: var(--muted); white-space: nowrap; }
.cx-seg button[aria-pressed="true"] { background: #fff; color: #111; }

/* owner tabs */
.cx-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 22px calc(-1 * var(--gutter)) 0; padding: 0 var(--gutter) 2px; position: sticky; top: 84px; z-index: 10; background: var(--bg); padding-top: 8px; padding-bottom: 10px; }
.cx-tabs::-webkit-scrollbar { display: none; }
.cx-tabs .chip { flex: none; height: 44px; gap: 8px; }
.cx-tabs .chip i { font-style: normal; font: 700 12px/1 'TT'; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--accent); color: var(--on-accent); }
.cx-tabs .chip.is-on i { background: #111; color: #fff; }

/* owner cards */
.cx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-top: 12px; }
.cx-grid .cx-card { margin-top: 0; }
.cx-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cx-card__name { font: 700 19px/1.25 'TT'; overflow-wrap: anywhere; }
.cx-meta { color: var(--dim); font-size: 14px; line-height: 1.45; margin-top: 4px; overflow-wrap: anywhere; }
.cx-socials { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.cx-socials a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: var(--r); background: rgba(255,255,255,.08); font: 600 14px 'TT'; }
.cx-socials a:hover { background: rgba(255,255,255,.14); }
.cx-pitch { margin-top: 12px; color: var(--muted); font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.cx-kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.cx-kv > div { padding: 10px 12px; border-radius: var(--r); background: var(--surface); min-width: 0; }
.cx-kv b { display: block; font: 700 17px/1.2 'TT'; font-variant-numeric: tabular-nums; margin-top: 3px; overflow-wrap: anywhere; }
.cx-kv span { font: 600 12px/1.2 'TT'; color: var(--dim); }
.cx-edit { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.cx-edit > * { min-width: 0; }
.cx-edit__row > .cx-edit__lab { flex: 1 1 220px; min-width: 0; }
.cx-edit__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cx-edit__row > label, .cx-edit__lab { font: 600 15px 'TT'; }
.cx-edit__lab small { display: block; color: var(--dim); font: 400 13px/1.35 'TT'; margin-top: 2px; }
.cx-num { display: inline-flex; align-items: center; gap: 6px; }
.cx-num input { width: 92px; min-height: 44px; height: 44px; border-radius: var(--r); background: var(--surface); border: 0; box-shadow: inset 0 0 0 1px var(--line); padding: 0 12px; color: #fff; font-size: 16px; text-align: right; outline: none; }
.cx-num input:focus { box-shadow: inset 0 0 0 1px var(--accent); }
.cx-num input::placeholder { color: var(--faint); }
.cx-num span { color: var(--dim); font: 600 15px 'TT'; }
.cx-code-in { width: 100%; min-height: 48px; border-radius: var(--r); background: var(--surface); border: 0; box-shadow: inset 0 0 0 1px var(--line); padding: 0 14px; color: #fff; font: 700 18px 'TT'; letter-spacing: .06em; text-transform: uppercase; outline: none; }
.cx-code-in:focus { box-shadow: inset 0 0 0 1px var(--accent); }
.cx-select { min-height: 44px; border-radius: var(--r); background: var(--surface); border: 0; box-shadow: inset 0 0 0 1px var(--line); padding: 0 12px; color: #fff; font-size: 16px; max-width: 100%; }
.cx-card .btn-row { margin-top: 16px; }
.cx-flag { margin-top: 10px; padding: 10px 12px; border-radius: var(--r); background: rgba(255,214,107,.12); color: #FFD66B; font: 600 14px/1.4 'TT'; }

/* sales table (owner) */
.cx-table-wrap { margin-top: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; border-top: 1px solid var(--line); }
.cx-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 920px; }
.cx-table th, .cx-table td { text-align: left; padding: 12px 10px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.cx-table th { color: var(--dim); font: 600 13px 'TT'; white-space: nowrap; }
.cx-table td b { font-weight: 600; }
.cx-table td small { display: block; color: var(--dim); font-size: 13px; margin-top: 2px; }
.cx-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cx-table tr.is-flag td { background: rgba(255,214,107,.06); }
.cx-sales-cards { display: none; }
.cx-filter { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }

/* video embeds (dashboard + owner) */
.cx-video { display: flex; align-items: center; gap: 12px; }
.cx-video__ico { width: 44px; height: 44px; border-radius: 10px; flex: none; display: grid; place-items: center; background: rgba(255,255,255,.08); font: 700 12px 'TT'; color: var(--muted); }

/* creator link page (/c/CODE) */
.cgo { padding: 108px 0 72px; min-height: 90vh; }
.cgo__in { max-width: 560px; margin: 0 auto; }
.cgo__pic { position: relative; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 16 / 10; background: var(--elevated); }
.cgo__pic img, .cgo__pic .clip { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.cgo__pic .reel__shade { background: linear-gradient(to top, rgba(0,0,0,.7) 0%, rgba(0,0,0,0) 55%); }
.cgo__pic .sticker { position: absolute; left: 14px; bottom: 14px; z-index: 2; }
.cgo h1 { font: 400 clamp(42px, 6vw, 64px)/.94 'TT Display'; margin-top: 22px; text-wrap: balance; }
.cgo .lead { margin-top: 12px; }
.cgo__code { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--accent); color: var(--on-accent); }
.cgo__code small { display: block; font: 600 13px/1.2 'TT'; opacity: .75; }
.cgo__code b { display: block; font: 400 40px/1 'TT Display'; letter-spacing: .03em; margin-top: 4px; overflow-wrap: anywhere; }
.cgo__stores { margin-top: 14px; }
.cgo__stores .store { flex: 1; justify-content: center; }
.cgo__or { display: flex; align-items: center; gap: 12px; color: var(--dim); font: 600 14px 'TT'; margin: 22px 0 12px; }
.cgo__or::before, .cgo__or::after { content: ''; height: 1px; flex: 1; background: var(--line); }
.cgo__web { width: 100%; }
.cgo__steps { margin-top: 26px; border-top: 1px solid var(--line); }
.cgo__steps li { display: flex; gap: 14px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 16px; line-height: 1.4; }
.cgo__steps li b { color: #fff; font-weight: 600; }
.cgo__steps li i { font: 400 22px/1 'TT Display'; font-style: normal; color: var(--accent); flex: none; width: 20px; }

/* toast */
.cx-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 80; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 12px 18px; border-radius: 12px; background: #fff; color: #111; font: 600 15px/1.3 'TT'; max-width: calc(100vw - 32px); text-align: center; transition: opacity .2s var(--ease), transform .2s var(--ease); }
.cx-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.cx-toast.is-bad { background: #FF6B6B; color: #111; }

/* demo ribbon (localhost only) */
.cx-demo { position: fixed; left: 10px; bottom: 10px; z-index: 90; font: 600 12px 'TT'; padding: 6px 10px; border-radius: 8px; background: #FFD66B; color: #111; }

@media (min-width: 761px) {
  .cx-actions .btn { width: auto; min-width: 240px; }
  .cx-share { grid-template-columns: 1fr 1fr; }
  .cx-share > .cx-share__full { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .cx { padding: 92px 0 64px; }
  .cx-head h1 { font-size: clamp(40px, 11.6vw, 52px); }
  .cx-card { padding: 18px 16px; }
  .cx-stats { gap: 8px; }
  .cx-stat { padding: 12px; }
  .cx-stat__n { font-size: 28px; }
  .cx-stat__s { font-size: 12px; }
  .cx-row2 { grid-template-columns: 1fr; }
  .cx-share__val { flex-direction: column; align-items: stretch; }
  .cx-share .btn-row .btn { flex: 1; }
  .cx-grid { grid-template-columns: 1fr; }
  .cx-tabs { top: 72px; }
  .cx-kv b { font-size: 15px; }
  .cx-table-wrap { display: none; }
  .cx-sales-cards { display: block; }
  .cgo { padding: 84px 0 56px; }
  .cgo h1 { font-size: clamp(38px, 10.6vw, 46px); }
  .cgo__code b { font-size: 34px; }
  .cx-seg { width: 100%; }
  .cx-seg button { flex: 1; padding: 0 8px; }
}
@media (max-width: 360px) {
  .cgo__stores .store { flex: 1 1 100%; }
  .cx-stats { grid-template-columns: 1fr; }
}
