/* Subber case study: the "system" section's live figures. Prefixed sx- because ui.css has global classes like .task and .claim.
   Product pieces stay dark in both themes and read ui.css's tokens; the controls and spec around them follow the page (--p-). */

/* ---------- controls ---------- */
.sx-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; }
.sx-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 10px; background: var(--p-line); }
.sx-seg button { appearance: none; border: 0; background: none; font: 500 13.5px/1 Inter, system-ui, sans-serif; letter-spacing: -.006em; color: var(--p-muted); height: 30px; padding: 0 12px; border-radius: 7px; cursor: pointer; transition: color .16s ease-out, background-color .16s ease-out, transform .16s ease-out; }
.sx-seg button[aria-pressed="true"] { background: var(--p-bg); color: var(--p-text); }
.sx-seg button:active { transform: scale(.97); }
.sx-seg button:focus-visible, .sx-roles button:focus-visible, .sx-act:focus-visible, .sx-claim:focus-visible { outline: 2px solid var(--p-acc); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .sx-seg button:hover { color: var(--p-text); } }
.sx-lab { font-size: 13.5px; color: var(--p-muted); margin-right: 10px; }
.sx-ctl { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 0; }

/* ---------- 1. shell and community ---------- */
.sx-board { --sx-fade: .32s var(--p-ease); background: #0D0D10; border: 1px solid var(--ln2); border-radius: 14px; padding: 20px; color: var(--tx); font-size: 14px; line-height: 1.4; transition: background-color var(--sx-fade), border-color var(--sx-fade); }
.sx-board-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; transition: opacity var(--sx-fade); }
.sx-board-h h4 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.sx-new { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 8px; background: var(--red); color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap; transition: opacity .2s ease-out, filter .2s ease-out; }
.sx-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.sx-c { display: flex; flex-direction: column; min-width: 0; padding: 8px; border-radius: 12px; background: var(--s1); border: 1px solid var(--ln); transition: background-color var(--sx-fade), border-color var(--sx-fade); }
.sx-art { position: relative; aspect-ratio: 1; border-radius: 8px; background: var(--s3); }
.sx-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 8px; transition: opacity var(--sx-fade); }
.sx-slot { position: absolute; inset: 0; border-radius: 8px; display: grid; place-items: center; font-size: 12px; color: var(--tx3); opacity: 0; border: 1px dashed var(--ln2); transition: opacity var(--sx-fade); }
.sx-none { position: absolute; inset: 0; border-radius: 8px; display: grid; place-items: center; background: var(--s2); font-size: 34px; font-weight: 500; color: var(--tx3); }
.sx-av { position: absolute; left: 8px; bottom: -14px; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--s1); background: var(--s3); }
.sx-art img.sx-av { inset: auto auto -14px 8px; width: 36px; height: 36px; border-radius: 50%; }
.sx-tx { padding: 22px 4px 4px; display: flex; flex-direction: column; flex: 1; gap: 2px; min-width: 0; transition: opacity var(--sx-fade); }
.sx-tx b { font-size: 14px; font-weight: 600; letter-spacing: -.01em; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.sx-tx > span { color: var(--tx2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.sx-pills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; padding-top: 12px; min-height: 34px; }
.sx-p { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap; transition: opacity .2s ease-out, filter .2s ease-out; }
.sx-p svg { width: 11px; height: 11px; flex: none; }
.sx-p.brand { color: var(--red2); background: rgba(255, 68, 88, .12); }
.sx-p.vio { color: #D7A9FF; background: rgba(180, 108, 248, .14); }
.sx-p.ok { color: var(--grn); background: rgba(43, 212, 107, .1); }

.sx-board[data-view="system"] .sx-art img:not(.sx-av), .sx-board[data-view="system"] .sx-none { opacity: 0; }
.sx-board[data-view="system"] .sx-av { opacity: 0; }
.sx-board[data-view="system"] .sx-slot { opacity: 1; }
.sx-board[data-view="system"] .sx-tx b, .sx-board[data-view="system"] .sx-tx > span { color: transparent; background: var(--s3); border-radius: 4px; width: fit-content; min-width: 60%; -webkit-line-clamp: 1; }
.sx-board[data-view="community"] { background: #09090B; border-color: transparent; }
.sx-board[data-view="community"] .sx-board-h, .sx-board[data-view="community"] .sx-tx { opacity: 0; }
.sx-board[data-view="community"] .sx-c { background: transparent; border-color: transparent; }

.sx-roles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 16px; margin: 20px 0 0; padding: 0; list-style: none; }
.sx-roles button { appearance: none; width: 100%; height: 100%; text-align: left; border: 0; border-top: 1px solid var(--p-line); background: none; padding: 12px 0 0; font: inherit; color: inherit; cursor: default; }
.sx-roles b { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.sx-roles b i { width: 10px; height: 10px; border-radius: 50%; background: var(--sw); flex: none; }
.sx-roles span { display: block; margin-top: 2px; font-size: 13.5px; line-height: 1.4; color: var(--p-muted); }
.sx-board[data-role] .sx-p, .sx-board[data-role] .sx-new { opacity: .18; filter: saturate(.3); }
.sx-board[data-role="brand"] .sx-p.brand, .sx-board[data-role="brand"] .sx-new, .sx-board[data-role="claim"] .sx-p.vio, .sx-board[data-role="ok"] .sx-p.ok { opacity: 1; filter: none; }
.sx-board[data-role="neutral"] .sx-p, .sx-board[data-role="neutral"] .sx-new { opacity: .18; }
.sx-board[data-role="neutral"] .sx-art img { opacity: .18; }

/* ---------- 2. the gate ---------- */
.sx-gate { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px; align-items: start; }
.sx-w { background: #121215; border: 1px solid var(--ln2); border-radius: 16px; padding: 16px; color: var(--tx); font-size: 14px; line-height: 1.4; }
.sx-w h4 { margin: 0 0 12px; font-size: 13px; font-weight: 500; color: var(--tx2); }
.sx-ts { display: flex; flex-direction: column; gap: 8px; }
.sx-t { border-radius: 10px; background: var(--s2); border: 1px solid var(--ln); transition: background-color .24s ease-out, border-color .24s ease-out; }
.sx-t-r { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 6px 6px 12px; }
.sx-t-r .ci { width: 15px; height: 15px; flex: none; }
.sx-t-r > span { flex: 1; min-width: 0; font-size: 13.5px; }
.sx-act { appearance: none; border: 0; flex: none; height: 32px; min-width: 32px; padding: 0 11px; border-radius: 7px; background: var(--s3); color: var(--tx); font: 600 12.5px Inter, system-ui, sans-serif; cursor: pointer; display: grid; place-items: center; transition: background-color .16s ease-out, transform .16s ease-out; }
.sx-act:active { transform: scale(.95); }
.sx-act[disabled] { cursor: default; background: transparent; }
.sx-act.ok { background: var(--grn); color: #04210F; padding: 0; animation: sx-pop .28s var(--spring); }
.sx-act.ok svg { width: 15px; height: 15px; }
.sx-spin { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--ln2); border-top-color: var(--tx2); animation: sx-spin .7s linear infinite; }
.sx-msg { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .28s var(--ease); }
.sx-msg > p { overflow: hidden; margin: 0; padding: 0 12px; font-size: 12.5px; line-height: 1.4; color: #FF8E8E; }
.sx-t[data-s="failed"] { border-color: rgba(255, 110, 110, .4); background: rgba(255, 90, 90, .07); }
.sx-t[data-s="failed"] .sx-msg { grid-template-rows: 1fr; }
.sx-t[data-s="failed"] .sx-msg > p { padding-bottom: 10px; }
.sx-claim { appearance: none; border: 0; width: 100%; height: 44px; margin-top: 12px; border-radius: 10px; background: var(--s3); color: var(--tx3); font: 600 13.5px Inter, system-ui, sans-serif; cursor: not-allowed; transition: background-color .24s ease-out, color .24s ease-out, transform .16s ease-out; }
.sx-claim.ready { background: linear-gradient(110deg, var(--vio-a), var(--vio-b)); color: #fff; cursor: pointer; }
.sx-claim.ready:active { transform: scale(.98); }
.sx-claim.done { background: var(--grn); color: #04210F; cursor: default; }
.sx-spec { margin: 0; font-size: 14px; }
.sx-spec div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; padding: 10px 0; border-top: 1px solid var(--p-line); }
.sx-spec div:first-child { border-top: 0; padding-top: 0; }
.sx-spec dt { color: var(--p-muted); }
.sx-spec dd { margin: 0; line-height: 1.45; }
.sx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@keyframes sx-spin { to { transform: rotate(360deg); } }
@keyframes sx-pop { from { transform: scale(.7); } to { transform: none; } }

/* ---------- 3. one campaign, three surfaces ---------- */
.sx-surf { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 5fr) minmax(0, 4fr); gap: 16px; align-items: stretch; }
.sx-s { min-width: 0; display: flex; flex-direction: column; }
.sx-s > h4 { margin: 0 0 8px; font-size: 13.5px; font-weight: 500; color: var(--p-muted); }
.sx-sb { flex: 1; color: var(--tx); font-size: 13.5px; line-height: 1.4; border-radius: 12px; border: 1px solid var(--ln2); padding: 14px; min-width: 0; }
.sx-sb.web { background: #121215; display: flex; flex-direction: column; }
.sx-sb.dc2 { background: #313338; }
.sx-sb.feed { background: #0D0D10; display: flex; flex-direction: column; }
.sx-swap { transition: opacity .18s ease-out; display: flex; flex-direction: column; flex: 1; min-width: 0; }
.sx-fading .sx-swap { opacity: 0; }
.sx-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sx-top img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; }
.sx-top b { display: block; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
.sx-top span { font-size: 12.5px; color: var(--tx2); }
.sx-big { margin: 14px 0 12px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; color: #D7A9FF; font-variant-numeric: tabular-nums; }
.sx-big small { display: block; font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--tx2); margin-bottom: 2px; }
.sx-cta { margin-top: auto; height: 40px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(110deg, var(--vio-a), var(--vio-b)); color: #fff; font-size: 13px; font-weight: 600; text-align: center; padding: 0 8px; }
.sx-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; margin-bottom: 14px; }
.sx-meta .chain { height: 24px; padding: 0 8px 0 6px; border-radius: 7px; font-size: 11.5px; }
.sx-dch { display: flex; align-items: baseline; gap: 6px; font-weight: 600; margin-bottom: 8px; }
.sx-dch em { font-style: normal; font-size: 9.5px; font-weight: 700; padding: 1px 4px; border-radius: 3px; background: #5865F2; }
.sx-em { flex: 1; border-left: 4px solid var(--vio); border-radius: 4px; background: #2B2D31; padding: 12px; }
.sx-em b { display: block; font-weight: 600; margin-bottom: 4px; }
.sx-em p { margin: 0 0 10px; color: #DBDEE1; font-size: 13px; }
.sx-em dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.sx-em dt { font-size: 11.5px; font-weight: 600; color: #B5BAC1; }
.sx-em dd { margin: 0; font-size: 12.5px; }
.sx-db { margin-top: 10px; height: 34px; border-radius: 4px; background: #5865F2; display: grid; place-items: center; font-size: 12.5px; font-weight: 500; color: #fff; }
.sx-why { margin-top: 14px; padding: 12px; border-radius: 10px; background: var(--s1); border: 1px solid var(--ln); }
.sx-why small { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--grn); margin-bottom: 4px; }
.sx-why small svg { width: 13px; height: 13px; }
.sx-why p { margin: 0; color: var(--tx2); font-size: 12.5px; }
.sx-feed-cta { margin-top: auto; padding-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #D7A9FF; font-weight: 600; font-size: 13px; }
.sx-feed-cta svg { width: 14px; height: 14px; flex: none; }

@media (max-width: 860px) {
  .sx-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sx-roles { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 16px; }
  .sx-gate { grid-template-columns: 1fr; gap: 24px; }
  .sx-surf { grid-template-columns: 1fr; gap: 20px; }
  .sx-board { padding: 12px; }
  .sx-new { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sx-board *, .sx-board, .sx-t, .sx-msg, .sx-swap, .sx-claim, .sx-act { transition-duration: .01s !important; animation-duration: .01s !important; }
  .sx-spin { animation-duration: 1.6s !important; }
}

/* the shell's b rule uses the page text color, which is dark in light mode; product pieces are always dark */
.sx-board b, .sx-w b, .sx-sb b { color: var(--tx); }
.sx-board[data-view="system"] .sx-tx b { color: transparent; }

/* ---------- 0. entry widget variations ---------- */
.cs-head.sx-sub { margin-top: 48px; }
.cs-head.sx-sub h3 { font-size: 17px; font-weight: 500; letter-spacing: -.01em; margin: 0 0 8px; }
.sx-wg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.sx-wg-c { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sx-wg-c figcaption { font-size: 12.5px; color: var(--p-muted); padding-left: 2px; }
.sx-w { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 14px; background: #111114; border: 1px solid rgba(255, 255, 255, .08); color: #F5F5F6; font: 400 13px/1.35 Inter, system-ui, sans-serif; }
.sx-w-h { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sx-w-h img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex: none; }
.sx-w-h b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-w-h .sx-p { margin-left: auto; flex: none; }
.sx-w-v small span { letter-spacing: 0; text-transform: none; font-weight: 500; }
.sx-w-v small { display: flex; justify-content: space-between; gap: 8px; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #6C6C76; }
.sx-w-v b { display: flex; align-items: baseline; gap: 6px; margin: 2px 0 10px; font-size: 26px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.sx-w-v em { font-style: normal; font-size: 13px; font-weight: 600; letter-spacing: 0; color: #D7A9FF; }
.sx-w-bar { display: block; height: 4px; border-radius: 2px; background: #202026; overflow: hidden; }
.sx-w-bar i { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, #D877F7, #9558F6); }
.sx-el { padding: 10px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .08); background: #17171B; min-height: 62px; }
.sx-el small { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; }
.sx-el small svg { width: 12px; height: 12px; }
.sx-el.yes { border-color: rgba(43, 212, 107, .25); background: rgba(43, 212, 107, .05); } .sx-el.yes small { color: #2BD46B; }
.sx-el.chk small { color: #D7A9FF; }
.sx-el.no { border-color: rgba(255, 179, 64, .28); background: rgba(255, 179, 64, .05); } .sx-el.no small { color: #FFB340; }
.sx-el p { margin: 4px 0 0; font-size: 12px; color: #A3A3AD; }
.sx-el.in { animation: sx-pop .45s var(--p-ease) both; }
@keyframes sx-pop { from { opacity: 0; transform: translateY(4px); } }
.sx-via { display: flex; margin-top: 8px; }
.sx-via img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; border: 2px solid #17171B; margin-right: -6px; }
.sx-via.dim img { opacity: .45; }
.sx-spin { width: 11px; height: 11px; border-radius: 50%; border: 2px solid rgba(215, 169, 255, .3); border-top-color: #D7A9FF; animation: sx-rot .8s linear infinite; }
@keyframes sx-rot { to { transform: rotate(1turn); } }
.sx-w-t { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sx-w-t li { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 30px; padding: 0 10px; border-radius: 8px; background: #17171B; font-size: 12px; color: #A3A3AD; }
.sx-w-t li i { width: 16px; height: 16px; border-radius: 4px; display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); color: transparent; }
.sx-w-t li i svg { width: 10px; height: 10px; }
.sx-w-t li.ok { color: #F5F5F6; } .sx-w-t li.ok i { background: #2BD46B; box-shadow: none; color: #0A0A0C; }
.is-no .sx-w-t { opacity: .4; }
.sx-w-cta { margin-top: auto; height: 38px; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(90deg, #D877F7, #9558F6); color: #fff; font-size: 12.5px; font-weight: 600; white-space: nowrap; transition: background .3s, color .3s; }
.sx-w-cta.off { background: #202026; color: #6C6C76; }
.sx-w-cta.ghost { background: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); color: #F5F5F6; }
@media (max-width: 960px) { .sx-wg { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .sx-wg { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 12px; } .sx-wg::-webkit-scrollbar { display: none; } .sx-wg-c { flex: 0 0 84%; scroll-snap-align: start; } }
@media (prefers-reduced-motion: reduce) { .sx-spin, .sx-el.in { animation: none; } }
