/* ========================================================================== 
   BETRA NEXUS — readability, touch-target and visual QA correction pass
   Loaded last so the established product identities remain intact while
   critical text, controls and contrast receive a dependable floor.
   ========================================================================== */

:root {
  --text-soft: rgba(244, 240, 231, 0.79);
  --text-muted: rgba(244, 240, 231, 0.62);
  --text-faint: rgba(244, 240, 231, 0.43);
  --nexus-muted: rgba(242,238,228,.73);
  --nexus-faint: rgba(242,238,228,.48);
  --chat-warm-muted: rgba(244,238,226,.74);
  --chat-warm-faint: rgba(244,238,226,.49);
  --readable-micro: .75rem;
  --readable-label: .8125rem;
  --readable-secondary: .875rem;
  --readable-body: 1rem;
}

html { text-size-adjust:100%; -webkit-text-size-adjust:100%; }
body { font-size:16px; }
p, li, dd, figcaption { text-wrap:pretty; }

/* Universal text roles ---------------------------------------------------- */
.eyebrow,
.badge,
.project-status,
.project-importance,
.division-tag,
.version-tag,
.state,
.docs-section-label,
.command-group-label,
figcaption,
time,
kbd {
  font-size:var(--readable-micro);
  line-height:1.38;
}

.project-status,
.project-importance,
.division-tag,
.badge { min-height:25px; padding-block:4px; }

/* Company chrome ---------------------------------------------------------- */
.betra-desktop-nav > a,
.betra-desktop-nav > button,
.betra-header__actions > a,
.betra-header__actions > button,
.betra-header__news,
.betra-header__status,
.betra-header__cta,
.betra-search-trigger,
.status-trigger,
.nav-dropdown__link,
.betra-mega a,
.betra-mega button {
  font-size:var(--readable-label);
}

.nav-dropdown__link small,
.nav-dropdown__head span,
.status-mini__head small,
.command-result small,
.command-dialog footer,
.betra-announcement,
.betra-footer__meta,
.betra-footer__group h3,
.site-footer__meta,
.site-footer__group h3 {
  font-size:var(--readable-micro);
  line-height:1.45;
}

.nav-dropdown__head strong,
.status-mini__services div,
.status-mini__link,
.site-footer__status,
.command-result strong,
.docs-search-results strong { font-size:var(--readable-label); }

.betra-footer__group a,
.site-footer__group a { font-size:var(--readable-label); line-height:1.5; }

/* Editorial and public product reading ---------------------------------- */
.section-heading p,
.endgame-heading p:not(.eyebrow),
.warm-heading p,
.section-copy,
.editorial-intro p,
.product-hero__copy > p:not(.eyebrow),
.division-hero__copy > p:not(.eyebrow),
.products-endgame-hero p,
.betra-catalog-hero p,
.newsroom-hero p,
.research-journal-hero p,
.devlog-hero p,
.timeline-hero p,
.graph-hero p,
.media-hero p,
.editorial-hero p,
.trust-hero p,
.system-map-hero p {
  font-size:clamp(.94rem,.35vw + .88rem,1.08rem);
  line-height:1.72;
}

.company-signal__lead strong,
.company-signal dd,
.company-signal__link,
.endgame-tower__latest strong,
.endgame-astrid dd,
.editorial-project__update strong,
.editorial-project__update span,
.editorial-project__link,
.today-item div p,
.media-tile strong,
.media-tile em,
.inside-story-card p,
.division-object p,
.operations-preview__signal strong,
.arc-overview__story p,
.arc-continue p,
.arc-continue a,
.products-featured__story p,
.products-featured__story section > a,
.activity-stream__list p,
.activity-stream__list a,
.release-story > div > p,
.release-story > div > a,
.inside-feature p,
.inside-feature a,
.inside-grid p,
.roadmap-board article p,
.known-issues-list p,
.trust-grid p,
.press-overview__facts p,
.press-release-links p,
.brand-assets__grid p,
.brand-reference-list p,
.support-grid__items p,
.help-steps p,
.contact-config > p,
.moonshaft-systems__grid p {
  font-size:var(--readable-secondary);
  line-height:1.62;
}

.editorial-project__copy > p:not(.editorial-project__tagline),
.betra-product-card__body p,
.news-card p,
.devlog-list article p,
.devlog-record p,
.archive-row__copy p,
.betra-status-actual__grid p,
.research-card p,
.news-card__body p,
.lab-entry p,
.archive-entry p {
  font-size:clamp(.875rem,.2vw + .84rem,.98rem);
  line-height:1.68;
}

/* Catalog, status and compact metadata ---------------------------------- */
.betra-product-card__index,
.products-registry__toolbar button,
.filter-bar__label,
.filter-bar__scroll button,
.filter-bar__search,
.research-card__meta,
.research-card__foot,
.article-hero__breadcrumbs,
.article-hero__meta,
.article-hero__authors span,
.article-toc > strong,
.article-toc > a,
.article-share button,
.article-meta-rail span,
.article-section-number,
.article-figure figcaption,
.devlog-record__meta,
.archive-row__meta,
.status-service small,
.status-service time {
  font-size:var(--readable-micro);
  line-height:1.45;
}

.betra-product-card__body li,
.model-card__body li,
.value-list li,
.safety-accordion__panel li,
.docs-reference-section li,
.article-body li,
.article-body p {
  font-size:var(--readable-secondary);
  line-height:1.7;
}

/* Models and pricing ----------------------------------------------------- */
.model-card__technical summary,
.model-card__technical dt,
.model-card__technical dd,
.model-card__context,
.model-card__metrics small,
.model-card__footer > span small,
.evaluation-card__head span,
.evaluation-card__foot,
.compare-table td small,
.evaluation-matrix__head span,
.evaluation-matrix__row > span em,
.evaluation-matrix__row > p,
.routing-core span,
.routing-node small,
.plan-card small,
.pricing-matrix small,
.pricing-disclaimer {
  font-size:var(--readable-micro);
  line-height:1.45;
}

.model-card__body li,
.compare-table th,
.compare-table td,
.plan-table th,
.plan-table td,
.evaluation-row__label,
.evaluation-row > strong,
.model-card__link,
.compare-selector button,
.evaluation-selector button {
  font-size:var(--readable-label);
  line-height:1.5;
}

/* Documentation and code ------------------------------------------------ */
.docs-main,
.article-body { font-size:var(--readable-body); }
.docs-main p,
.docs-main li,
.docs-main td,
.docs-main th,
.docs-callout p,
.event-table strong,
.event-table code,
.event-table span {
  font-size:.9375rem;
  line-height:1.72;
}
.docs-sidebar__group strong,
.docs-sidebar__group a,
.docs-sidebar__bottom a,
.docs-breadcrumbs,
.docs-version > span,
.docs-version button,
.docs-toc > strong,
.docs-toc > a,
.docs-feedback span,
.docs-next > span,
.docs-next__link small,
.docs-search-trigger,
.docs-search-trigger kbd,
.code-block__bar,
.copy-button,
.terminal-demo__bar,
.console-sidebar nav button,
.console-logs__head,
.sdk-packages code {
  font-size:var(--readable-micro);
  line-height:1.45;
}

.code-block code,
pre code,
.mini-code,
.pf-code pre,
.terminal-demo__body,
.console-logs > div {
  font-size:.8125rem;
  line-height:1.62;
}

/* Astrid workspace ------------------------------------------------------- */
.chat-title,
.chat-model-trigger > span strong,
.chat-model-trigger [data-chat-model-label],
.chat-response-head strong,
.chat-response-head small,
.chat-composer__meta [data-chat-inline-model],
.chat-composer__under,
.chat-empty__signal,
.chat-empty__model,
.chat-empty__health,
.chat-thinking span,
.chat-config-note strong,
.chat-config-note small,
.chat-vision-notice span,
.chat-latest strong,
.chat-model-list > button small,
.chat-model-list > button em,
.chat-model-details-toggle,
.chat-model-details > div span,
.chat-model-details > div em,
.chat-model-details > p,
.chat-attach-menu strong,
.chat-attach-menu small,
.chat-context__tool-list strong,
.chat-context__tool-list em,
.chat-cloud-picker__head p,
.chat-cloud-picker__crumbs button,
.chat-cloud-picker__item small,
.chat-cloud-file small {
  font-size:var(--readable-micro);
  line-height:1.45;
}

.chat-empty > p:not(.chat-empty__signal),
.chat-starters button strong,
.chat-user-copy,
.chat-response-body,
.chat-response-body p,
.chat-response-body li,
.chat-response-body table,
.chat-composer textarea,
.chat-cloud-picker__item strong,
.chat-cloud-picker__head input {
  font-size:.9375rem;
}

.chat-response-body { line-height:1.78; }
.chat-response-body p,
.chat-response-body li { max-width:74ch; }
.chat-starters button { min-height:66px; }
.chat-starters button strong { line-height:1.35; }
.chat-model-list > button,
.chat-attach-menu button { min-height:58px; }

/* Nexus private platform ------------------------------------------------ */
.nexus-convergence__plane small,
.nexus-convergence__core span,
.nexus-home-reveal footer span,
.nexus-app-rail a span,
.nexus-app-rail button span,
.nexus-app-rail__bottom i,
.nexus-app-topbar p,
.nexus-service-dot,
.nexus-notification-sheet header p,
.nexus-setup > header > span,
.nexus-login > header > span,
.nexus-setup__progress span,
.nexus-setup__progress i,
.nexus-setup__visual b,
.nexus-setup > footer,
.my-betra-welcome kbd,
.my-betra-card header,
.my-betra-lower header p,
.nexus-activity-row em,
.nexus-activity-row time,
.nexus-health-row em,
.cloud-navigation__brand small,
.cloud-navigation__storage small,
.cloud-context-header p,
.cloud-item__copy small,
.cloud-item__copy > span,
.cloud-item__meta,
.cloud-detail header p,
.cloud-upload-manager header span,
.cloud-upload-row small,
.bobflix-hero__copy > span,
.bobflix-tile__copy span,
.bobflix-hero > div:last-child > p:first-child,
.bobflix-tile > span:last-child,
.bobflix-player header span,
.bobflix-player__center button span,
.private-search > header p,
.private-search-group header p,
.appearance-options em,
.system-dashboard > header p,
.system-stat small,
.system-grid header p,
.system-audit header p,
.system-audit-row,
.cloud-product-signals span,
.bobflix-product-truth span,
.cloud-product-hero__object > span,
.cloud-product-story__grid article > strong,
.bobflix-product-frame > em,
.page--shared-file .shared-file-main > header > span,
.page--shared-file .shared-file-main > footer,
.nexus-toast p,
.account-edit-form label > span,
.settings-cloud-form label > span {
  font-size:var(--readable-micro);
  line-height:1.45;
}

.my-betra-welcome p,
.my-betra-card p,
.my-betra-lower p,
.nexus-activity-row strong,
.nexus-health-row strong,
.cloud-context-header > div > p,
.cloud-item__copy strong,
.cloud-detail p,
.cloud-upload-row strong,
.bobflix-hero__copy p,
.bobflix-tile__copy strong,
.bobflix-hero > div:last-child > p,
.bobflix-tile > strong,
.private-search-result p,
.settings-panel p,
.system-dashboard p,
.system-stat strong,
.system-grid p,
.page--shared-file .shared-file-main p {
  font-size:var(--readable-secondary);
  line-height:1.62;
}

.nexus-app-topbar button,
.nexus-app-topbar a,
.cloud-toolbar button,
.cloud-toolbar a,
.cloud-navigation a,
.cloud-navigation button,
.cloud-action-sheet button,
.bobflix-mobile-nav button,
.nexus-mobile-nav a,
.nexus-mobile-nav button,
.private-search button,
.settings-panel button,
.system-dashboard button {
  font-size:var(--readable-label);
}

/* Better contrast for intentionally quiet content ----------------------- */
.company-signal dt,
.company-signal small,
.endgame-hero__coordinate,
.endgame-hero__coordinate time,
.endgame-hero__signals span,
.arc-visual__signals span,
.endgame-product-scene > span,
.today-item small,
.media-tile em,
.arc-prototype small,
.arc-prototype em,
.operations-preview small,
.betra-footer__meta,
.chat-response-head small,
.chat-response-state,
.chat-inline-event,
.cloud-item__meta,
.nexus-activity-row em,
.nexus-health-row em {
  color:rgba(244,238,226,.52);
}

/* Touch and click targets ------------------------------------------------ */
.icon-button,
.mobile-menu-trigger,
.betra-search-trigger,
.status-trigger,
.copy-button,
.chat-header__icon,
.chat-rail__action,
.chat-rail__connection,
.chat-composer__attach,
.chat-send,
.cloud-toolbar button,
.cloud-action-sheet button,
.nexus-mobile-nav a,
.nexus-mobile-nav button,
.bobflix-mobile-nav button,
.docs-mobile-bar button {
  min-width:44px;
  min-height:44px;
}

/* Mobile-specific readability ------------------------------------------- */
@media (max-width:900px) {
  :root {
    --readable-micro:.75rem;
    --readable-label:.8125rem;
    --readable-secondary:.9375rem;
    --readable-body:1rem;
  }

  .section-heading p,
  .endgame-heading p:not(.eyebrow),
  .warm-heading p,
  .section-copy,
  .editorial-intro p { font-size:.9375rem!important; line-height:1.68; }
  .eyebrow { font-size:.75rem!important; letter-spacing:.11em; }

  .betra-mobile-menu__link strong { font-size:.9375rem; }
  .betra-mobile-menu__link span,
  .betra-mobile-menu__featured-item strong,
  .betra-mobile-menu__featured-item small,
  .betra-mobile-menu__utility a,
  .betra-mobile-menu__utility a span,
  .betra-mobile-menu__secondary a,
  .betra-mobile-menu--first-class .mobile-menu__bottom strong {
    font-size:.8125rem;
    line-height:1.35;
  }
  .betra-mobile-menu__link,
  .betra-mobile-menu__utility a,
  .betra-mobile-menu__secondary a { min-height:46px; }

  .editorial-project__copy > p:not(.editorial-project__tagline),
  .betra-product-card__body p,
  .news-card p,
  .devlog-list article p,
  .devlog-record p,
  .archive-row__copy p,
  .betra-status-actual__grid p,
  .inside-story-card p,
  .division-object p,
  .products-featured__story p,
  .activity-stream__list p,
  .trust-grid p,
  .support-grid__items p,
  .moonshaft-systems__grid p { font-size:.9375rem; line-height:1.68; }

  .chat-empty > p:not(.chat-empty__signal),
  .chat-starters button strong,
  .chat-user-copy,
  .chat-response-body,
  .chat-response-body p,
  .chat-response-body li,
  .chat-response-body table,
  .chat-composer textarea { font-size:1rem!important; }
  .chat-response-head small,
  .chat-composer__under,
  .chat-empty__signal,
  .chat-empty__health,
  .chat-model-list > button small,
  .chat-model-list > button em,
  .chat-config-note small,
  .chat-vision-notice span { font-size:.8125rem!important; }
  .chat-composer__under { line-height:1.45; }

  .docs-main p,
  .docs-main li,
  .docs-main td,
  .docs-main th,
  .docs-callout p { font-size:1rem; line-height:1.72; }
  .docs-sidebar__group a,
  .docs-mobile-toc-sheet nav a,
  .docs-mobile-bar button { font-size:.875rem!important; }

  .nexus-app-topbar p,
  .cloud-context-header p,
  .cloud-item__copy small,
  .cloud-item__meta,
  .bobflix-tile__copy span,
  .private-search-group header p,
  .system-stat small,
  .nexus-mobile-nav a,
  .nexus-mobile-nav button,
  .bobflix-mobile-nav button { font-size:.875rem!important; }
  .my-betra-welcome p,
  .my-betra-card p,
  .cloud-item__copy strong,
  .bobflix-hero__copy p,
  .settings-panel p,
  .system-dashboard p { font-size:.9375rem; }

  .nexus-mobile-nav a,
  .nexus-mobile-nav button,
  .bobflix-mobile-nav button { min-height:54px; }

  /* Increased text needs flexible boxes rather than clipping. */
  .project-status,
  .project-importance,
  .division-tag,
  .badge,
  .betra-product-card__meta,
  .product-hero__meta,
  .cloud-item__meta { white-space:normal; overflow-wrap:anywhere; }
  .betra-product-card__head,
  .product-hero__meta,
  .cloud-context-header,
  .nexus-app-topbar { min-width:0; }
}

@media (max-width:430px) {
  .section-heading h2,.endgame-heading h2,.warm-heading h2 { text-wrap:balance; }
  .betra-header__logo .betra-logo__word { font-size:.75rem; }
  .nexus-app-topbar p { max-width:17ch; }
  .cloud-item__copy,.bobflix-tile__copy,.bobflix-tile,.my-betra-card > div { min-width:0; }
}

@media (prefers-reduced-motion:reduce) {
  .readability-pulse { animation:none!important; }
}

/* Final contrast and compact-control corrections ------------------------- */
small { font-size:.75rem!important; line-height:1.45; }
.code-block pre,.code-line code,pre code { font-size:.8125rem!important; }

.nav-link,
.text-link,
.betra-header__news,
.betra-footer__group a,
.site-footer__group a,
.model-card__link,
.editorial-project__link,
.activity-stream__list a,
.release-story > div > a,
.inside-feature a,
.products-featured__story section > a {
  font-size:.875rem;
  color:rgba(244,238,226,.72);
}
.nav-link:hover,.nav-link:focus-visible,.text-link:hover,.text-link:focus-visible { color:var(--text); }

.betra-footer__group h3,
.site-footer__group h3,
.products-endgame-hero dt,
.company-signal dt,
.arc-hero__availability span,
.endgame-tower__latest small,
.editorial-project__update small,
.products-registry__count,
.warm-constellation__filters button,
.today-item small,
.arc-reveal__step,
.nexus-app-topbar p {
  color:rgba(244,238,226,.57);
}

.products-endgame-hero dd,
.company-signal dd,
.arc-hero__availability strong { font-size:.875rem; color:rgba(244,238,226,.82); }

.warm-constellation__filters button,
.products-registry__toolbar button,
.filter-bar__scroll button,
.tabs__list button { min-height:40px; color:rgba(244,238,226,.64); }

.betra-product-card__link,
.news-card__link,
.archive-row__link { min-width:44px; min-height:44px; }

.arc-hero__copy > p:not(.arc-hero__tagline),
.tower-product-hero__copy > p:not(.eyebrow),
.cloud-product-hero__copy > p:not(.eyebrow),
.bobflix-product-hero__copy > p:not(.eyebrow),
.nexus-home-reveal header > p:not(.eyebrow) {
  font-size:clamp(.9375rem,.25vw + .9rem,1.06rem);
  line-height:1.68;
}

@media (max-width:900px) {
  .arc-hero__availability {
    display:grid!important;
    grid-template-columns:1fr!important;
    overflow:visible!important;
    scroll-snap-type:none!important;
  }
  .arc-hero__availability span {
    width:100%;
    min-width:0;
    padding:14px 0!important;
    border-right:0!important;
    border-bottom:1px solid var(--eg-line)!important;
  }
  .arc-hero__availability span:last-child { border-bottom:0!important; }
  .arc-hero__availability strong { margin-top:8px; }

  .arc-visual__signals span {
    transform:rotate(calc(var(--arc-i) * 1turn / var(--arc-total))) translateX(124px) rotate(calc(var(--arc-i) * -1turn / var(--arc-total)))!important;
  }
  .betra-footer__group.is-open > div > a { font-size:.875rem; color:rgba(244,238,226,.68); min-height:46px; }
  .tabs__list button,.warm-constellation__filters button,.products-registry__toolbar button,.filter-bar__scroll button { min-height:44px; }
}

@media (max-width:430px) {
  .nexus-app-topbar p { display:none; }
  .nexus-app-topbar > div:first-child { grid-template-columns:auto minmax(0,1fr); }
  .nexus-app-topbar h1 { grid-row:1; align-self:center; }
}

@media (max-width:360px) {
  .arc-visual__signals span {
    transform:rotate(calc(var(--arc-i) * 1turn / var(--arc-total))) translateX(102px) rotate(calc(var(--arc-i) * -1turn / var(--arc-total)))!important;
  }
  .arc-visual__signals span:nth-child(n+6) { display:none; }
}
.docs-main code,.article-body code,.docs-reference-section code { font-size:.8125rem!important; }

/* Final visual bug corrections ------------------------------------------ */
/* Decorative hero signals must never intersect the persistent navigation. */
.endgame-hero__signals {
  inset:96px 0 0;
  mask-image:linear-gradient(to bottom,transparent 0,#000 11%,#000 88%,transparent 100%);
  -webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 11%,#000 88%,transparent 100%);
}

/* Input hints remain visibly secondary without becoming illegible. */
.chat-composer textarea::placeholder,
.nexus-form input::placeholder,
.nexus-form textarea::placeholder,
.cloud-search input::placeholder,
.private-search-input::placeholder,
input[type="search"]::placeholder {
  color:rgba(244,238,226,.52)!important;
  opacity:1;
}

@media (max-width:900px) {
  /* The mobile Arc map uses a deliberate compass layout. The desktop orbit
     pushed long labels beyond the viewport once the typography became readable. */
  .arc-visual__signals span {
    left:auto!important;
    top:auto!important;
    right:auto!important;
    bottom:auto!important;
    max-width:42%;
    overflow:hidden;
    text-overflow:ellipsis;
    transform:none!important;
    transform-origin:center!important;
    font-size:.75rem!important;
    line-height:1.2!important;
  }
  .arc-visual__signals span:nth-child(1) { right:14px!important;top:47%!important;text-align:right; }
  .arc-visual__signals span:nth-child(2) { right:22px!important;top:72%!important;text-align:right; }
  .arc-visual__signals span:nth-child(3) { left:50%!important;bottom:8px!important;max-width:58%;transform:translateX(-50%)!important;text-align:center; }
  .arc-visual__signals span:nth-child(4) { left:22px!important;top:72%!important; }
  .arc-visual__signals span:nth-child(5) { left:14px!important;top:47%!important; }
  .arc-visual__signals span:nth-child(6) { left:18%!important;top:14%!important;text-align:center; }
  .arc-visual__signals span:nth-child(7) { left:50%!important;top:5px!important;transform:translateX(-50%)!important;text-align:center; }
  .arc-visual__signals span:nth-child(8) { right:18%!important;top:14%!important;text-align:center; }
}

@media (max-width:360px) {
  .arc-visual__signals span:nth-child(n+6) { display:block; }
  .arc-visual__signals span:nth-child(6),
  .arc-visual__signals span:nth-child(8) { display:none; }
  .arc-visual__signals span:nth-child(1) { right:9px!important; }
  .arc-visual__signals span:nth-child(2) { right:12px!important; }
  .arc-visual__signals span:nth-child(4) { left:12px!important; }
  .arc-visual__signals span:nth-child(5) { left:9px!important; }
}

/* Product demonstrations contain real reading content, not micro-metadata. */
.streaming-response li,
.demo-assistant-message li {
  font-size:.875rem!important;
  line-height:1.65;
}
@media (max-width:900px) {
  .streaming-response li,
  .demo-assistant-message li { font-size:.9375rem!important;line-height:1.68; }
}
