/* Semantic foregrounds and readable component states, after profile/area CSS.
   Literal colours here are the house's fixed status surfaces, never accent substitutes. */
.pop-tag--strong, .pop-tag.is-on, .pop-tag:hover, .pop-tag:focus-visible,
.pop-header__link:hover, .pop-iconbtn:hover { background: var(--accent); color: var(--accent-ink); }
.pop-btn--ink, .pop-label, .pop-badge--ink,
.pop-tabs__tab[aria-selected="true"], .pop-header__link.is-active,
.pop-pager__btn[aria-current="page"] { color: var(--accent-on-ink); }
[data-theme="dark"] :is(.pop-tabs__tab[aria-selected="true"], .pop-header__link.is-active) { color: var(--accent-ink); }
.pop-btn--primary, .pop-price__flag, .pop-side__plan,
.pop-side__link.is-active, .pop-side__link.is-active .pop-icon,
.pop-avatar--yellow, .pop-badge--yellow, .pop-toast--warning,
.pop-pager__btn:hover, .pop-acc__plus, .pop-acc__item.is-open,
.pop-feed__ico--yellow { color: var(--accent-ink); }
.pop-card--yellow, .pop-stat:not(.pop-stat--paper):not(.pop-stat--mint):not(.pop-stat--pink):not(.pop-stat--lilac),
.pop-alert:not(.pop-alert--paper):not(.pop-alert--danger):not(.pop-alert--info):not(.pop-alert--success) {
  color: var(--accent-ink); --text: var(--accent-ink); --text-soft: var(--accent-ink); --text-faint: var(--accent-ink);
}
.pop-stat:not(.pop-stat--paper):not(.pop-stat--mint):not(.pop-stat--pink):not(.pop-stat--lilac) .pop-stat__note { color: inherit; }
.pop-price__flag.plan-flag--current { background: var(--side); color: var(--accent-on-ink); }
.pop-btn--ghost:focus-visible { background: var(--paper-sunk); color: var(--text); }
.pop-footer__col a:hover, .pop-footer__col h3 { color: var(--accent-on-ink); }
.dg-chip-n { opacity: 1; color: inherit; }
/* Disabled is a real muted surface/foreground pair, with no alpha applied to text. */
body.pop-ui :is(button,input,select,textarea):disabled,
body.pop-ui :is(button,input,select,textarea)[aria-disabled="true"] {
  opacity: 1; background: var(--surface-2); color: var(--muted);
  --text: var(--muted); --text-soft: var(--muted); --text-faint: var(--muted);
  box-shadow: none; cursor: not-allowed; text-shadow: none;
}
body.pop-ui :is(button,input,select,textarea):disabled *,
body.pop-ui :is(button,input,select,textarea)[aria-disabled="true"] * { color: inherit !important; opacity: 1; background-color: transparent; }
.m-credit-usage-batch--over { opacity: 1; }
.m-credit-usage-batch--over :is(.m-credit-usage-batch-cost,.m-credit-usage-batch-rows) { color: var(--muted); }
/* Shrink grid/flex children before allowing a code box to scroll. */
:is(.m-api-product-step,.m-appbk-step) { min-width: 0; grid-template-columns: auto minmax(0,1fr); }
:is(.m-api-product-step-body,.m-appbk-step-body,.m-api-product-code,.m-appbk-code) { min-width: 0; max-width: 100%; }
:is(.m-api-product-code,.m-appbk-code) pre { max-width: 100%; overflow-x: auto; }
.demo-design { position: relative; flex: none; }
.demo-design summary { list-style: none; }
.demo-design summary::-webkit-details-marker { display: none; }
.demo-design summary::after { content: ' ▾'; }
.demo-design summary:focus-visible, .demo-design-menu a:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 3px; }
.demo-design-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 100;
  width: min(300px, calc(100vw - 28px)); max-height: min(60vh,460px); overflow-y: auto;
  padding: 8px; border: 2.5px solid var(--ink); border-radius: 16px;
  background: var(--surface); color: var(--text); box-shadow: 5px 5px 0 var(--drop);
}
.pop-side .demo-design summary { width: 100%; justify-content: space-between; }
.pop-side .demo-design-menu { top: auto; bottom: calc(100% + 8px); left: 0; }
@media(max-width:640px) {
  .pop-header__actions { flex-wrap: wrap; }
  .demo-design .nav-demo-btn { padding-inline: 9px; font-size: 11px; }
}

.button-primary { color: var(--accent-ink); }
.cta-band .button-primary, .thanks-card .button-primary { color: var(--accent-on-ink); }
.sf-close-card .pop-btn--ghost:hover, .sf-close-card .pop-btn--ghost:focus-visible { background: var(--side); color: var(--side-text); }
.pop-header__link.is-active:hover { background: var(--side); color: var(--accent-on-ink); }
[data-theme="dark"] .pop-header__link.is-active:hover { background: var(--accent); color: var(--accent-ink); }
.filter-pills .pill span, .hx-key-kpi span, .hx-key-kpi em { opacity: 1; }
.hx-bill-mark { opacity: 1; -webkit-text-stroke-color: var(--accent-ink); }
.proof-stat:nth-child(1) strong { color: var(--accent-text); }
.seg.is-on .seg-sub { color: var(--accent-ink); }
.m-api-product-curl-key { color: var(--text); }
.link-button.is-danger { color: var(--text); text-decoration: underline; }

.demo-design-mobile { display: none; }
@media(max-width:1000px) {
  .demo-design-mobile { display: block; margin-left: auto; }
  .demo-design-mobile + .pop-header__burger { margin-left: 0; }
}
@media(max-width:480px) {
  .is-demo .pop-header__brand { font-size: 16px; gap: 6px; }
  .is-demo .pop-header__bar { gap: 6px; padding-inline: 10px; }
}

/* Fixed status fills are independent of the selected accent's foreground. */
.pop-avatar--pink, .pop-avatar--mint, .pop-avatar--lilac,
.pop-stat--mint, .pop-stat--pink, .pop-stat--lilac,
.pipe-stage:nth-child(odd) .pipe-node, .pop-toast--error i { color: #111111; }
.app-row .val.accent { color: var(--accent-text); }
.statband-label, .sf-offer-buy .sf-fineprint { opacity: 1; }
.m-appbk-method-card { opacity: 1; }
.m-showcase-token-accent2 { background: var(--accent-2); color: var(--accent-2-ink); }
.m-image-studio-thumb-cost, .m-image-studio-thumb-ratio, .m-image-studio-card-ratio,
.m-image-studio-landing-badge { background: var(--side); color: var(--side-text); backdrop-filter: none; }

.dep-chips span:nth-child(n+2) { color: #111111; }
.pop-field__msg i, .pop-iconbtn--danger:hover, .pop-feed__ico--red { color: #111111; }
.pop-card--red { color: #111111; --text: #111111; --text-soft: #222222; --text-faint: #333333; }
.pop-card--red .pop-card__body { color: #111111; }

/* Accent-band controls keep the stable dark face rather than reusing a link tint. */
.cms-band.bg-accent :is(.cms-eyebrow,.cms-hero-eyebrow,.pop-btn--primary),
.cms-band.bg-accent .cms-hero-title .grad,
.cms-band.bg-accent .cms-heading.ink-gradient :where(h2,h3,h4) {
  background: var(--side); color: var(--accent-on-ink); -webkit-text-fill-color: currentColor;
}

/* Primary silhouettes and ghost outlines remain distinct from neutral surfaces. */
.pop-btn--primary { background: var(--primary-fill, var(--accent)); color: var(--primary-label, var(--accent-ink)); }
.pop-btn--primary:is(:hover,:active,:focus-visible) { background: var(--primary-hover-fill, var(--accent)); color: var(--primary-label, var(--accent-ink)); }
.pop-btn--ghost { border-color: var(--control-edge, var(--muted)); }

/* CMS bands carry their own contrasting control pair, independently of the page. */
[data-chrome] .cms-band.bg-accent .pop-btn--primary,
[data-chrome] .cms-band.bg-accent .pop-btn--primary:is(:hover,:focus-visible,:active) { background: var(--accent-ink); color: var(--accent); }
[data-chrome] .cms-band.bg-accent .pop-btn--ghost,
[data-chrome] .cms-band.bg-accent .pop-btn--ghost:is(:hover,:focus-visible,:active) { background: transparent; color: var(--accent-ink); border-color: var(--accent-ink); }
[data-chrome] .cms-band.bg-dark .pop-btn--primary,
[data-chrome] .cms-band.bg-dark .pop-btn--primary:is(:hover,:focus-visible,:active) { background: var(--side-text); color: var(--side); }
[data-chrome] .cms-band.bg-dark .pop-btn--ghost,
[data-chrome] .cms-band.bg-dark .pop-btn--ghost:is(:hover,:focus-visible,:active) { background: transparent; color: var(--side-text); border-color: var(--side-text); }
/* Image slides are siblings of the text. This guaranteed dark base plus an extra
   scrim keeps white text readable even over an entirely white source image. */
.cms-hero.has-bg { background: #111111; }
.cms-hero.has-bg .cms-hero-bg::after { content: ''; position: absolute; inset: 0; background: rgb(0 0 0 / .65); }
[data-chrome] .cms-hero.has-bg .pop-btn--primary,
[data-chrome] .cms-hero.has-bg .pop-btn--primary:is(:hover,:focus-visible,:active) { background: #ffffff; color: #111111; }
[data-chrome] .cms-hero.has-bg .pop-btn--ghost,
[data-chrome] .cms-hero.has-bg .pop-btn--ghost:is(:hover,:focus-visible,:active) { background: transparent; color: #ffffff; border-color: #ffffff; }

[data-chrome="pop"] .cms-plan.is-featured .cms-plan-cta.pop-btn--primary,
[data-chrome="pop"] .cms-plan.is-featured .cms-plan-cta.pop-btn--primary:is(:hover,:active,:focus-visible) { background: var(--accent-ink); color: var(--accent); }
/* Primary controls keep their visible silhouette in the disabled state too. */
body.pop-ui .pop-btn--primary:is(:disabled,[aria-disabled="true"]) {
  background: var(--primary-fill, var(--accent)); color: var(--primary-label, var(--accent-ink));
}

/* Example mocks share the same readable filled-control contract as real UI. */
.xm-toggle .is-on, .xm-tier.is-hot i { background: var(--text); color: var(--bg); }
.xm-tier.is-hot { background: var(--surface-2); color: var(--text); }
.xm-tier.is-hot :is(b,strong,small,span) { color: var(--text); }
.xm-tier .xm-flag { position: static; display: inline-flex; align-self: start; margin: 0 0 8px; background: var(--surface); color: var(--text); }
/* A decorative action on an accent card needs an opposing fill, too. */
[data-chrome="pop"] .th-designs-link .pop-btn--primary,
[data-chrome="pop"] .th-designs-link .pop-btn--primary:is(:hover,:active,:focus-visible) { background: var(--accent-ink); color: var(--accent); }
[data-chrome="pop"] .xm-json { background: var(--side); color: var(--accent-on-ink); }
[data-chrome="pop"] .scene-api .term,
[data-chrome="pop"] .scene-app .api-card { background: var(--side); color: var(--side-text); }
[data-chrome="pop"] .scene-api .term-body .t-faint { color: var(--side-text); opacity: 1; }
[data-chrome="pop"] .scene-app .api-card .method { color: var(--accent-on-ink); }
[data-chrome="pop"] .key-btn--danger { color: #111111; }

.th-theme-chip { color: var(--th-ink); }
.th-designs-copy span { opacity: 1; }

/* Public demo chrome reserves exactly the bar height at the end of the page. */
body.is-demo { height: auto; overflow: visible; padding-bottom: 0; }
.is-demo.shell-public { --demo-bar-height: calc(40px + env(safe-area-inset-bottom)); padding-bottom: var(--demo-bar-height); }
.demo-sales-bar { position: fixed; z-index: 110; inset: auto 0 0; height: var(--demo-bar-height); box-sizing: border-box; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 24px env(safe-area-inset-bottom); background: var(--surface); color: var(--text); border-top: 1px solid var(--edge); font: 500 13px/20px var(--font-body); }
.demo-sales-bar a { color: var(--accent-text); font-weight: 700; white-space: nowrap; text-underline-offset: 3px; }
.demo-sidebar-buy { display: block; padding: 10px 4px; font: 600 13px/20px var(--font-body); color: var(--side-text); text-underline-offset: 3px; }
@media(max-width:640px) {
  .is-demo.shell-public { --demo-bar-height: calc(44px + env(safe-area-inset-bottom)); }
  .demo-sales-bar { padding-inline: 12px; font-size: 11px; gap: 8px; }
}
/* SVGs and scene labels inherit the foreground of their painted accent tile. */
.bento-card:nth-child(6) .feature-ico { background: var(--accent); color: var(--accent-ink); }
.m-digital-downloads-bar { background: var(--accent); }
.m-digital-downloads-bar-pct { background: transparent; color: var(--accent-ink) !important; padding: 0; }
.feature-ico svg { color: inherit; }
.bento-card:nth-child(2) .feature-ico,
.bento-card:nth-child(3) .feature-ico,
.bento-card:nth-child(4) .feature-ico,
.bento-card:nth-child(5) .feature-ico { color: #111; }
/* A narrow product table stays readable; long customer emails never split. */
.adm-users-table { container-type: inline-size; }
.adm-users-table .pop-table { width: 100%; min-width: 0; table-layout: fixed; }
.adm-users-table :is(th,td) { overflow: hidden; text-overflow: ellipsis; }
.adm-users-table :is(th,td):first-child { width: 28%; }
.adm-users-table :is(th,td):last-child { width: 64px; }
.adm-users-table .adm-optional { width: 132px; white-space: nowrap; }
@container(max-width:1050px) { .adm-users-table .adm-created { display: none; } }
.adm-users-table .pop-table__who { display: flex; min-width: 0; white-space: nowrap; overflow-wrap: normal; }
.adm-users-table .pop-table__who > span { min-width: 0; overflow: hidden; }
.adm-users-table .pop-table__who :is(strong,.adm-sub) { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; overflow-wrap: normal; }
@container(max-width:850px) { .adm-users-table .adm-optional { display: none; } .adm-users-table :is(th,td):first-child { width: 40%; } }
@container(max-width:500px) { .adm-users-table .adm-detail { display: none; } .adm-users-table :is(th,td):first-child { width: 56%; } .adm-users-table :is(th,td):last-child { width: 56px; } }
@media(min-width:900px) { .adm-filter { flex-wrap: nowrap; flex: 1; max-width: 850px; } .adm-filter__search { min-width: 0; flex: 1 1 220px; } .adm-filter__select { flex: none; } .adm-filter > .pop-btn { flex: none; } }
/* One modest sample-data chip travels with each dashboard title. */
.m-pack h1 { display: inline; margin-right: 12px; }
.sample-data-chip { display: inline-block; vertical-align: middle; white-space: nowrap; padding: 2px 8px; border: 1px solid var(--edge); border-radius: 999px; color: var(--muted); background: var(--surface); font: 500 11px/18px var(--font-body); letter-spacing: 0; }
.demo-closing .demo-closing-panel { padding: 48px 24px; border: 1px solid var(--edge); border-radius: 18px; text-align: center; background: var(--surface); color: var(--text); }
.demo-closing h2 { font-size: 36px; line-height: 1.2; }
.demo-closing p { max-width: 58ch; margin: 20px auto 0; color: var(--muted); }
.demo-closing-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
/* Demo client work is drawn in the active palette, including the portrait. */
.cms-project-art { box-sizing: border-box; width: 100%; height: 100%; min-height: 300px; padding: 7%; background: var(--surface-2); color: var(--text); display: grid; place-items: center; }
.cms-project-browser { width: 100%; overflow: hidden; border: 1px solid var(--edge); border-radius: 12px; background: var(--surface); }
.cms-project-toolbar { padding: 10px 14px; border-bottom: 1px solid var(--edge); color: var(--muted); font-size: 11px; }
.cms-project-page { padding: 24px; }
.cms-project-page strong { display: block; font: 600 32px/1.15 var(--font-display); max-width: 10ch; margin-block: 12px 24px; }
.cms-project-page small { color: var(--muted); }
.cms-project-blocks { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; height: 110px; }
.cms-project-blocks i { background: var(--accent); border-radius: 6px; }
.cms-project-blocks i + i { background: var(--text); }
.cms-project-phones { display: flex; gap: 20px; align-items: center; justify-content: center; width: 100%; }
.cms-project-phone { width: 42%; border: 2px solid var(--edge); border-radius: 22px; padding: 20px 12px; background: var(--surface); min-height: 240px; }
.cms-project-phone:nth-child(2) { margin-top: 36px; }
.cms-project-phone b { display: block; font-size: 19px; line-height: 1.3; margin: 18px 0; }
.cms-project-phone i { display: block; height: 90px; border-radius: 40% 40% 8px 8px; background: var(--accent); margin-bottom: 16px; }
.cms-project-phone span { display: block; height: 8px; margin-top: 12px; background: var(--surface-2); border-radius: 4px; }
.cms-q-avatar.demo-portrait { display: grid; place-items: center; flex: none; background: var(--accent); color: var(--accent-ink); font: 600 16px/1 var(--font-display); }
/* Scene icon tiles follow their actual surface in every theme. */
.xm-toast .xm-ico { background: var(--surface); color: var(--text); border-color: var(--text); }
.xm-file-ico { background: var(--surface-2); color: var(--text); }
.pop-pager__btn[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
/* Plan emphasis comes from the flag and outline; every CTA keeps one style. */
[data-chrome="pop"] .price-plan.pop-price--featured { background: var(--surface); color: var(--text); }
[data-chrome="pop"] .price-plan.pop-price--featured { --text: inherit; --text-soft: inherit; --text-faint: inherit; }
[data-chrome="pop"] .price-plan.pop-price--featured .pop-price__note { color: var(--muted); }
[data-chrome="pop"] .price-plan.pop-price--featured .pop-price__list .pop-icon { background: var(--surface-2); color: var(--text); }
.pop-shell__topbar .pop-side__logo { min-width: 0; flex-shrink: 1; }
.pop-shell__topbar .pop-side__logo strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media(min-width:900px) { .adm-filter { min-width: 0; } .adm-filter__select { min-width: 0; max-width: 38%; } .adm-filter__select select { max-width: 100%; } }
/* Fixed thumbnail slots contain the whole captured panel, without intrinsic-size overflow. */
.xp-card-shot { position: relative; flex: none; }
.xp-card-shot img { position: absolute; inset: 0; object-fit: contain; }
.xm-bars i { background: var(--accent); }
.xp-kicker { margin-bottom: 20px; }
.pop-footer__col a { display: block; }
@media(max-width:360px) { .pop-shell__topbar:has(.app-credits-top) { gap: 4px; } }
.pop-pager__btn[aria-current="page"]:is(:hover,:active,:focus-visible) { background: var(--accent); color: var(--accent-ink); }
/* Project rows have text and a date; iconless rows need two real columns. */
.m-showcase-feed-row:has(> .m-showcase-feed-body:first-child) { grid-template-columns: minmax(0,1fr) auto; }
