/*
 * Formula-first Tableaux navigation.
 *
 * The legacy programme cards remain the trusted result renderer. This layer
 * only gives them a public catalogue and a focused detail route.
 */
body.tableaux-active #tableauxViewContainer {
  --tableaux-ink: #10233f;
  --tableaux-muted: #66758d;
  --tableaux-line: #e7edf5;
  --tableaux-blue: #1464d2;
  --tableaux-blue-dark: #0d4fae;
  background: #f7f9fc !important;
  color: var(--tableaux-ink);
  min-height: 100%;
}

/*
 * The mobile browser may report a different visual viewport during the first
 * route transition (address-bar collapse, safe-area resolution, or font
 * loading). The Tableaux controller refreshes these custom properties after
 * mount; this keeps the initial frame anchored even before that first read.
 */
body.tableaux-active .site-header {
  display: block !important;
  visibility: visible !important;
}

body.tableaux-active #tableauxViewContainer {
  top: var(
    --cid-tableaux-viewport-top,
    calc(var(--cid-shell-header-height, 50px) + env(safe-area-inset-top, 0px))
  ) !important;
  bottom: auto !important;
  height: var(
    --cid-tableaux-viewport-height,
    calc(100dvh - var(--cid-shell-header-height, 50px) - env(safe-area-inset-top, 0px))
  ) !important;
  max-height: var(
    --cid-tableaux-viewport-height,
    calc(100dvh - var(--cid-shell-header-height, 50px) - env(safe-area-inset-top, 0px))
  ) !important;
}

body.tableaux-active #tableauxViewContainer > #tableauxSectionsOverview,
body.tableaux-active #tableauxViewContainer > #tableauxSectionDetail {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  box-sizing: border-box;
}

body.tableaux-active #tableauxViewContainer > #tableauxSectionsOverview {
  padding: 28px 0 40px;
}

body.tableaux-active #tableauxViewContainer > .tableaux-page-header {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 20px;
  box-sizing: border-box;
}

body.tableaux-active .tableaux-page-header h1 {
  display: block !important;
  margin: 0 0 7px;
  color: var(--tableaux-ink);
  font: 800 clamp(28px, 4vw, 42px)/1.05 Arial, sans-serif;
  letter-spacing: -.04em;
}

body.tableaux-active .tableaux-page-header p {
  margin: 7px 0 0;
  color: var(--tableaux-muted);
  font: 600 14px/1.5 Arial, sans-serif;
}

body.tableaux-active .tableaux-sections-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  margin-bottom: 24px;
}

body.tableaux-active .tableaux-sections-eyebrow {
  color: var(--tableaux-blue);
  font: 800 11px/1.2 Arial, sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
}

body.tableaux-active .tableaux-sections-heading h1,
body.tableaux-active .tableaux-section-detail__header h1 {
  display: block !important;
  margin: 0;
  color: var(--tableaux-ink);
  font: 800 clamp(28px, 4vw, 42px)/1.05 Arial, sans-serif;
  letter-spacing: -.04em;
}

body.tableaux-active .tableaux-sections-heading p,
body.tableaux-active .tableaux-section-detail__header p {
  margin: 0;
  color: var(--tableaux-muted);
  font: 600 14px/1.5 Arial, sans-serif;
}

body.tableaux-active .tableaux-catalogue-nav {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--tableaux-line);
  border-radius: 12px;
  background: #fff;
}

body.tableaux-active .tableaux-catalogue-tab {
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--tableaux-muted);
  cursor: pointer;
  font: 800 12px/1 Arial, sans-serif;
}

body.tableaux-active .tableaux-catalogue-tab.is-active {
  border-color: var(--tableaux-blue);
  background: var(--tableaux-blue);
  color: #fff;
}

body.tableaux-active .tableaux-catalogue-tab:not(.is-active):hover,
body.tableaux-active .tableaux-catalogue-tab:not(.is-active):focus-visible {
  border-color: #c9d8ea;
  background: #f4f7fb;
  color: var(--tableaux-ink);
  outline: 0;
}

body.tableaux-active .tableaux-plan-catalogue {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

body.tableaux-active .tableaux-subscription-modal {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--tableaux-subscription-accent);
  border-radius: 18px;
  background:
    linear-gradient(135deg,
      var(--tableaux-subscription-tint-strong),
      var(--tableaux-subscription-tint)),
    rgba(255, 255, 255, .72);
  box-shadow:
    0 16px 34px color-mix(
      in srgb,
      var(--tableaux-subscription-accent) 18%,
      transparent
    ),
    inset 0 1px 0 rgba(255, 255, 255, .62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

body.tableaux-active .tableaux-subscription-modal__heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
  color: var(--tableaux-subscription-ink);
}

body.tableaux-active .tableaux-subscription-modal__heading span {
  color: var(--tableaux-subscription-accent-strong);
  font: 800 10px/1.2 Arial, sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
}

body.tableaux-active .tableaux-subscription-modal__heading strong {
  font: 800 13px/1.2 Arial, sans-serif;
}

body.tableaux-active .tableaux-subscription-modal .tableaux-plan-catalogue {
  margin-top: 7px;
}

body.tableaux-active .tableaux-subscription-modal .tableaux-plan-card {
  border-color: color-mix(
    in srgb,
    var(--tableaux-subscription-accent) 34%,
    var(--tableaux-line)
  );
  background: rgba(255, 255, 255, .78);
}

body.tableaux-active .tableaux-subscription-modal .tableaux-plan-card.is-active,
body.tableaux-active .tableaux-subscription-modal .tableaux-plan-card.is-subscribed,
body.tableaux-active .tableaux-subscription-modal .tableaux-plan-card.is-subscribed.is-active {
  border-color: var(--tableaux-subscription-accent);
  background: var(--tableaux-subscription-tint);
  box-shadow: 0 8px 22px color-mix(
    in srgb,
    var(--tableaux-subscription-accent) 20%,
    transparent
  );
}

body.tableaux-active .tableaux-subscription-modal
  .tableaux-plan-card.is-subscribed {
  order: -1;
}

body.tableaux-active .tableaux-subscription-modal
  .tableaux-plan-card__title strong,
body.tableaux-active .tableaux-subscription-modal
  .tableaux-plan-card.is-active .tableaux-plan-card__title strong,
body.tableaux-active .tableaux-subscription-modal
  .tableaux-plan-card.is-subscribed .tableaux-plan-card__title strong {
  color: var(--tableaux-subscription-ink);
}

body.tableaux-active .tableaux-subscription-modal
  .tableaux-plan-card__title em {
  background: var(--tableaux-subscription-tint-strong);
  color: var(--tableaux-subscription-accent-strong);
}

body.tableaux-active .tableaux-subscription-modal
  .tableaux-plan-card__active-summary,
body.tableaux-active .tableaux-subscription-modal
  .tableaux-plan-card__details {
  border-top-color: color-mix(
    in srgb,
    var(--tableaux-subscription-accent) 30%,
    transparent
  );
}

body.tableaux-active .tableaux-subscription-modal
  .tableaux-plan-card__expiry {
  background: var(--tableaux-subscription-tint-strong);
  color: var(--tableaux-subscription-ink) !important;
}

body.tableaux-active .tableaux-subscription-modal
  .tableaux-plan-card__details li::before {
  color: var(--tableaux-subscription-accent-strong);
}

body.tableaux-active .tableaux-subscription-modal
  .tableaux-subscription-purchase {
  border-color: var(--tableaux-subscription-accent);
  background: var(--tableaux-subscription-accent);
  color: var(--tableaux-subscription-contrast);
  box-shadow: 0 7px 14px color-mix(
    in srgb,
    var(--tableaux-subscription-accent) 24%,
    transparent
  );
}

body.tableaux-active .tableaux-subscription-modal
  .tableaux-subscription-purchase:hover:not(:disabled),
body.tableaux-active .tableaux-subscription-modal
  .tableaux-subscription-purchase:focus-visible {
  border-color: var(--tableaux-subscription-accent-strong);
  background: var(--tableaux-subscription-accent-strong);
  outline: 2px solid color-mix(
    in srgb,
    var(--tableaux-subscription-accent) 35%,
    transparent
  );
  outline-offset: 2px;
}

body.tableaux-active .tableaux-subscription-modal
  .tableaux-subscription-purchase:disabled {
  border-color: var(--tableaux-subscription-accent);
  background: var(--tableaux-subscription-accent);
  color: var(--tableaux-subscription-contrast);
  opacity: .65;
}

body.tableaux-active .tableaux-plan-card {
  display: grid;
  gap: 4px;
  min-height: 86px;
  padding: 0;
  border: 1px solid var(--tableaux-line);
  border-radius: 12px;
  background: #fff;
  color: var(--tableaux-ink);
  text-align: left;
}

body.tableaux-active .tableaux-plan-card__select {
  display: grid;
  width: 100% !important;
  gap: 4px;
  min-height: 86px;
  padding: 12px 13px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

body.tableaux-active .tableaux-plan-card__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

body.tableaux-active .tableaux-plan-card__title strong {
  font: 800 15px/1.2 Arial, sans-serif;
}

body.tableaux-active .tableaux-plan-card span,
body.tableaux-active .tableaux-plan-card small {
  color: var(--tableaux-muted);
  font: 700 11px/1.25 Arial, sans-serif;
}

body.tableaux-active .tableaux-plan-card.is-active {
  border-color: var(--tableaux-blue);
  background: #eef6ff;
  box-shadow: 0 7px 18px rgba(20, 100, 210, .12);
}

body.tableaux-active .tableaux-plan-card.is-subscribed {
  order: -1;
  border-color: #1d9a62;
  background: #f1fcf6;
  box-shadow: 0 8px 22px rgba(17, 117, 73, .13);
}

body.tableaux-active .tableaux-plan-card.is-subscribed.is-active {
  border-color: #1d9a62;
  background: #f1fcf6;
}

body.tableaux-active .tableaux-plan-card__title em {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: #d9f5e6;
  color: #16754b;
  font: 800 10px/1 Arial, sans-serif;
  font-style: normal;
  text-transform: uppercase;
}

body.tableaux-active .tableaux-plan-card.is-active .tableaux-plan-card__title strong {
  color: var(--tableaux-blue-dark);
}

body.tableaux-active .tableaux-plan-card.is-subscribed .tableaux-plan-card__title strong {
  color: #126b44;
}

body.tableaux-active .tableaux-plan-card__details {
  display: grid;
  gap: 8px;
  padding: 0 13px 13px;
  border-top: 1px solid rgba(20, 100, 210, .12);
}

body.tableaux-active .tableaux-plan-card__active-summary {
  display: grid;
  gap: 8px;
  padding: 0 13px;
  border-top: 1px solid rgba(29, 154, 98, .18);
}

body.tableaux-active .tableaux-plan-card__action {
  padding: 0 13px 13px;
}

body.tableaux-active .tableaux-plan-card__action .tableaux-subscription-purchase {
  width: 100%;
  min-height: 38px;
}

body.tableaux-active .tableaux-plan-card.is-subscribed .tableaux-plan-card__details {
  border-top-color: rgba(29, 154, 98, .18);
}

body.tableaux-active .tableaux-plan-card__details > strong {
  padding-top: 10px;
  color: var(--tableaux-ink);
  font: 800 11px/1.2 Arial, sans-serif;
  letter-spacing: .05em;
  text-transform: uppercase;
}

body.tableaux-active .tableaux-plan-card__details ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

body.tableaux-active .tableaux-plan-card__details li {
  color: var(--tableaux-muted);
  font: 700 12px/1.3 Arial, sans-serif;
}

body.tableaux-active .tableaux-plan-card__details li::before {
  margin-right: 6px;
  color: var(--tableaux-blue);
  content: '•';
}

body.tableaux-active .tableaux-plan-card__details p {
  margin: 0;
  color: var(--tableaux-muted);
  font: 600 12px/1.4 Arial, sans-serif;
}

body.tableaux-active .tableaux-plan-card__active-summary p {
  margin: 0;
  padding-top: 10px;
  color: #166740;
  font: 600 12px/1.4 Arial, sans-serif;
}

body.tableaux-active .tableaux-plan-card__expiry {
  padding: 8px 9px;
  border-radius: 8px;
  background: #e3f7eb;
  color: #166740 !important;
}

body.tableaux-active .tableaux-plan-card__details .tableaux-subscription-purchase {
  width: 100%;
  min-height: 38px;
}

body.tableaux-active .tableaux-catalogue-empty {
  margin: 0 0 24px;
  padding: 22px 16px;
  border: 1px dashed var(--tableaux-line);
  border-radius: 14px;
  background: #fff;
  color: var(--tableaux-muted);
  font: 700 13px/1.45 Arial, sans-serif;
  text-align: center;
}

body.tableaux-active .tableaux-sections-heading .tableaux-discover-button {
  align-self: flex-start;
  margin-top: 6px;
}

body.tableaux-active .tableaux-section-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

body.tableaux-active .tableaux-section-card {
  display: flex;
  min-height: 226px;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--tableaux-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(24, 55, 91, .06);
  box-sizing: border-box;
}

body.tableaux-active .tableaux-section-card.is-unlocked {
  border-color: #b9dfcc;
  box-shadow: 0 12px 30px rgba(17, 117, 73, .08);
}

body.tableaux-active .tableaux-section-card h2 {
  margin: 0;
  color: var(--tableaux-ink);
  font: 800 21px/1.15 Arial, sans-serif;
}

body.tableaux-active .tableaux-section-card__programs {
  min-height: 45px;
  margin: 13px 0 17px;
  color: var(--tableaux-muted);
  font: 600 13px/1.55 Arial, sans-serif;
}

body.tableaux-active .tableaux-section-card__meta {
  margin-top: auto;
  color: var(--tableaux-blue);
  font: 800 12px/1.35 Arial, sans-serif;
}

body.tableaux-active .tableaux-section-card__actions,
body.tableaux-active .tableaux-section-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

body.tableaux-active .tableaux-section-card__actions {
  margin-top: 18px;
}

body.tableaux-active .tableaux-button {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font: 800 clamp(11px, 2.7vw, 12px)/1.25 Arial, sans-serif;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  text-align: center;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

body.tableaux-active .tableaux-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

body.tableaux-active .tableaux-button--primary {
  border-color: var(--tableaux-blue);
  background: var(--tableaux-blue);
  color: #fff;
}

body.tableaux-active .tableaux-button--primary:hover:not(:disabled) {
  border-color: var(--tableaux-blue-dark);
  background: var(--tableaux-blue-dark);
}

body.tableaux-active .tableaux-button--secondary {
  border-color: #d6e0ee;
  background: #fff;
  color: var(--tableaux-ink);
}

body.tableaux-active #tableauxViewContainer
  .tableaux-access-mode .tableaux-button,
body.tableaux-active #tableauxViewContainer
  .tableaux-schema-unlock {
  display: inline-flex;
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
  flex-wrap: wrap;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.2;
}

body.tableaux-active .tableaux-button--secondary:hover:not(:disabled) {
  border-color: #a8bdd8;
  background: #f4f7fb;
}

body.tableaux-active .tableaux-button.is-muted,
body.tableaux-active .tableaux-button:disabled {
  border-color: #b9dfcc;
  background: #effaf4;
  color: #18764c;
  cursor: default;
  opacity: 1;
}

body.tableaux-active #tableauxSectionDetail {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 8px 0 40px !important;
  overflow-x: hidden !important;
  box-sizing: border-box;
}

body.tableaux-active .tableaux-section-detail__header {
  display: block;
  width: calc(100% - 32px);
  max-width: 1120px;
  margin: 0 auto;
  padding: 4px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  box-sizing: border-box;
}

body.tableaux-active .tableaux-section-detail__header > div:first-child {
  display: grid;
  gap: 3px;
}

body.tableaux-active .tableaux-section-detail__header h1 {
  margin: 0;
  color: var(--tableaux-ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.25;
}

body.tableaux-active .tableaux-section-detail__actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin-top: 9px;
  justify-content: stretch;
}

body.tableaux-active .tableaux-section-global-unlock {
  min-height: 48px;
  padding-inline: 18px;
  box-shadow: 0 8px 18px rgba(20, 100, 210, .18);
}

body.tableaux-active .tableaux-section-detail__notice {
  width: calc(100% - 32px);
  max-width: 1120px;
  margin: 9px auto 12px;
  box-sizing: border-box;
  color: var(--tableaux-muted);
  font: 600 12px/1.45 Arial, sans-serif;
}

/*
 * A formula is a reading page, not a floating panel. Keep its content in one
 * predictable vertical column and let each table use the complete available
 * width. The legacy Tableaux styles enable horizontal scrolling on narrow
 * screens; the detail page deliberately fits those tables instead.
 */
body.tableaux-active #tableauxSectionDetail > * {
  min-width: 0;
  max-width: 100%;
}

body.tableaux-active #tableauxSectionDetail
  .portfolio-universal,
body.tableaux-active #tableauxSectionDetail
  .portfolio-intuition,
body.tableaux-active #tableauxSectionDetail
  .portfolio-oracle,
body.tableaux-active #tableauxSectionDetail
  .portfolio-manual,
body.tableaux-active #tableauxSectionDetail
  .portfolio-lnb,
body.tableaux-active #tableauxSectionDetail
  .portfolio-standby {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin-inline: 0 !important;
  padding-inline: 12px !important;
  box-sizing: border-box !important;
  overflow-x: hidden !important;
}

body.tableaux-active #tableauxSectionDetail .table-container {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin-inline: 0 !important;
  padding-inline: 0 !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}

body.tableaux-active #tableauxSectionDetail .color-table {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed !important;
  box-sizing: border-box !important;
}

body.tableaux-active #tableauxSectionDetail .color-table th,
body.tableaux-active #tableauxSectionDetail .color-table td {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

body.tableaux-active #tableauxSectionDetail .satellite-combination {
  max-width: 100%;
  flex-wrap: wrap;
}

/* Do not pin a large action bar over the first table while the page scrolls. */
body.tableaux-active #tableauxSectionDetail .tableaux-section-detail__header {
  position: static;
}

/* The catalogue owns the first screen; legacy cards only exist in detail. */
body.tableaux-active #tableauxViewContainer[data-tableaux-mode="overview"] .portfolio-universal,
body.tableaux-active #tableauxViewContainer[data-tableaux-mode="overview"] .portfolio-intuition,
body.tableaux-active #tableauxViewContainer[data-tableaux-mode="overview"] .portfolio-oracle,
body.tableaux-active #tableauxViewContainer[data-tableaux-mode="overview"] .portfolio-manual,
body.tableaux-active #tableauxViewContainer[data-tableaux-mode="overview"] .portfolio-lnb,
body.tableaux-active #tableauxViewContainer[data-tableaux-mode="overview"] .portfolio-standby,
body.tableaux-active #tableauxViewContainer[data-tableaux-mode="overview"] #createdProgramPortfolios {
  display: none !important;
}

body.tableaux-active #tableauxViewContainer[data-tableaux-mode="detail"] .portfolio-universal[hidden],
body.tableaux-active #tableauxViewContainer[data-tableaux-mode="detail"] .portfolio-intuition[hidden],
body.tableaux-active #tableauxViewContainer[data-tableaux-mode="detail"] .portfolio-oracle[hidden],
body.tableaux-active #tableauxViewContainer[data-tableaux-mode="detail"] .portfolio-manual[hidden],
body.tableaux-active #tableauxViewContainer[data-tableaux-mode="detail"] .portfolio-lnb[hidden],
body.tableaux-active #tableauxViewContainer[data-tableaux-mode="detail"] .portfolio-standby[hidden],
body.tableaux-active #tableauxViewContainer[data-tableaux-mode="detail"] #createdProgramPortfolios[hidden] {
  display: none !important;
}

body.tableaux-active #tableauxViewContainer .portfolio-universal:not([hidden]),
body.tableaux-active #tableauxViewContainer .portfolio-intuition:not([hidden]),
body.tableaux-active #tableauxViewContainer .portfolio-oracle:not([hidden]),
body.tableaux-active #tableauxViewContainer .portfolio-manual:not([hidden]),
body.tableaux-active #tableauxViewContainer .portfolio-lnb:not([hidden]),
body.tableaux-active #tableauxViewContainer #createdProgramPortfolios:not([hidden]) {
  margin-top: 0 !important;
}

/* Free programmes are a real public stream, placed after the formula cards
 * on the landing view. Paid programmes remain available only in detail. */
body.tableaux-active #tableauxViewContainer[data-tableaux-mode="overview"] .portfolio-universal:not([hidden]),
body.tableaux-active #tableauxViewContainer[data-tableaux-mode="overview"] .portfolio-intuition:not([hidden]),
body.tableaux-active #tableauxViewContainer[data-tableaux-mode="overview"] .portfolio-oracle:not([hidden]),
body.tableaux-active #tableauxViewContainer[data-tableaux-mode="overview"] .portfolio-manual:not([hidden]),
body.tableaux-active #tableauxViewContainer[data-tableaux-mode="overview"] .portfolio-lnb:not([hidden]) {
  display: grid !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding-inline: 12px !important;
  box-sizing: border-box !important;
}

body.tableaux-active #tableauxViewContainer[data-tableaux-mode="overview"] .portfolio-standby:not([hidden]) {
  display: block !important;
}

body.tableaux-active #tableauxViewContainer[data-tableaux-mode="overview"] #createdProgramPortfolios:not([hidden]) {
  display: block !important;
}

@media (max-width: 820px) {
  body.tableaux-active .tableaux-section-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.tableaux-active .tableaux-section-detail__header {
    align-items: stretch;
    flex-direction: column;
  }

  body.tableaux-active .tableaux-section-detail__actions {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  body.tableaux-active #tableauxViewContainer > #tableauxSectionsOverview,
  body.tableaux-active #tableauxViewContainer > #tableauxSectionDetail {
    width: calc(100% - 24px);
  }

  body.tableaux-active #tableauxViewContainer > #tableauxSectionsOverview {
    padding-top: 20px;
  }

  body.tableaux-active .tableaux-section-card-grid {
    grid-template-columns: 1fr;
  }

  body.tableaux-active .tableaux-section-card {
    min-height: 0;
    padding: 18px;
  }

  body.tableaux-active .tableaux-section-card__programs {
    min-height: 0;
  }

  body.tableaux-active .tableaux-section-card__actions,
  body.tableaux-active .tableaux-section-detail__actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  body.tableaux-active .tableaux-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.tableaux-active .tableaux-button {
    transition: none;
  }
}

/* Formule Libre is a distinct public stream after the three paid cards. */
body.tableaux-active .tableaux-section-card.is-free {
  grid-column: 1 / -1;
  border-color: #cfe1ef;
  background: #f9fcff;
}

/* A debit always requires a second, explicit confirmation. */
.cid-unlock-confirmation {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: auto !important;
  bottom: auto !important;
  width: 100vw !important;
  height: var(--cid-viewport-height, 100dvh) !important;
  z-index: 100000 !important;
  display: grid;
  place-items: center;
  padding: max(24px, calc(var(--cid-shell-header-height, 50px) + env(safe-area-inset-top, 0px)))
           max(16px, env(safe-area-inset-right, 0px))
           max(24px, calc(var(--cid-shell-footer-height, 56px) + env(safe-area-inset-bottom, 0px)))
           max(16px, env(safe-area-inset-left, 0px)) !important;
  box-sizing: border-box;
  overflow: auto;
  background: rgba(0, 0, 0, .6) !important;
}

.modal-overlay.cid-payment-overlay.cid-unlock-confirmation {
  display: grid !important;
  align-items: center !important;
  justify-content: center !important;
}

.cid-unlock-confirmation__card {
  width: 90% !important;
  max-width: 450px !important;
  max-height: 80vh !important;
  overflow-y: auto !important;
  padding: 20px !important;
  border: 1px solid #dce6f2;
  border-radius: 16px !important;
  background: #fff !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, .3) !important;
  color: #10233f;
  box-sizing: border-box;
  margin: auto !important;
}

.cid-unlock-confirmation[data-tableaux-theme] .cid-unlock-confirmation__card {
  border-color: var(--tableaux-subscription-accent);
  background:
    linear-gradient(145deg,
      var(--tableaux-subscription-tint),
      rgba(255, 255, 255, .94)),
    #fff !important;
  color: var(--tableaux-subscription-ink);
}

.cid-unlock-confirmation[data-tableaux-theme]
  .cid-unlock-confirmation__eyebrow {
  color: var(--tableaux-subscription-accent-strong);
}

.cid-unlock-confirmation[data-tableaux-theme]
  .cid-unlock-confirmation__included {
  border-color: var(--tableaux-subscription-accent);
  background: var(--tableaux-subscription-tint);
  color: var(--tableaux-subscription-ink);
}

.cid-unlock-confirmation[data-tableaux-theme]
  .cid-unlock-confirmation__included strong,
.cid-unlock-confirmation[data-tableaux-theme]
  .cid-unlock-confirmation__included li::marker {
  color: var(--tableaux-subscription-accent-strong);
}

.cid-unlock-confirmation[data-tableaux-theme]
  [data-tableaux-unlock-confirm] {
  border-color: var(--tableaux-subscription-accent);
  background: var(--tableaux-subscription-accent);
  color: var(--tableaux-subscription-contrast);
}

.cid-unlock-confirmation[data-tableaux-theme]
  [data-tableaux-unlock-confirm]:hover:not(:disabled) {
  border-color: var(--tableaux-subscription-accent-strong);
  background: var(--tableaux-subscription-accent-strong);
}

.cid-unlock-confirmation__eyebrow {
  color: #1464d2;
  font: 800 11px/1.2 Arial, sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.cid-unlock-confirmation__card h2 {
  margin: 9px 0 8px;
  font: 800 25px/1.15 Arial, sans-serif;
}

.cid-unlock-confirmation__card p {
  margin: 0 0 18px;
  color: #66758d;
  font: 600 13px/1.5 Arial, sans-serif;
}

.cid-unlock-confirmation__included {
  margin: 0 0 16px;
  padding: 13px 14px;
  border: 1px solid #d6e6f7;
  border-radius: 12px;
  background: #f4f9ff;
  color: #315474;
  font: 600 12px/1.45 Arial, sans-serif;
}

.cid-unlock-confirmation__included strong {
  display: block;
  margin-bottom: 6px;
  color: #173b62;
  font: 800 13px/1.3 Arial, sans-serif;
}

.cid-unlock-confirmation__included ul {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 16px;
  margin: 0 0 7px;
  padding-left: 17px;
}

.cid-unlock-confirmation__included li::marker {
  color: #1464d2;
}

.cid-unlock-confirmation__included span,
.cid-unlock-confirmation__included small {
  display: block;
}

.cid-unlock-confirmation__included small {
  color: #607c99;
  font-size: 11px;
}

.cid-unlock-confirmation__summary {
  display: grid;
  gap: 0;
  margin: 0 0 22px;
  border: 1px solid #e3eaf3;
  border-radius: 13px;
  overflow: hidden;
}

.cid-unlock-confirmation__summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: #f8fafd;
  font: 700 13px/1.3 Arial, sans-serif;
}

.cid-unlock-confirmation__summary div + div {
  border-top: 1px solid #e3eaf3;
}

.cid-unlock-confirmation__summary dt {
  color: #66758d;
}

.cid-unlock-confirmation__summary dd {
  margin: 0;
  color: #10233f;
  text-align: right;
}

.cid-unlock-confirmation__summary .is-total {
  background: #eef6ff;
}

.cid-unlock-confirmation__summary .is-total dt,
.cid-unlock-confirmation__summary .is-total dd {
  color: #1464d2;
}

.cid-unlock-confirmation__summary .is-insufficient {
  background: #fff5f2;
}

.cid-unlock-confirmation__summary .is-insufficient dt,
.cid-unlock-confirmation__summary .is-insufficient dd {
  color: #b13b2e;
}

.cid-unlock-confirmation.is-balance-insufficient
  .cid-unlock-confirmation__eyebrow {
  color: #b13b2e;
}

.cid-unlock-confirmation.is-balance-insufficient
  [data-tableaux-unlock-buy] {
  border-color: #b13b2e;
  background: #b13b2e;
  color: #fff;
}

.cid-unlock-confirmation.is-balance-insufficient
  [data-tableaux-unlock-buy]:hover:not(:disabled),
.cid-unlock-confirmation.is-balance-insufficient
  [data-tableaux-unlock-buy]:focus-visible {
  border-color: #8f2e24;
  background: #8f2e24;
}

.cid-unlock-confirmation__actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 10px;
}

.cid-unlock-confirmation__actions .tableaux-button {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 46px;
  padding-inline: 10px;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
}

/*
 * The advanced-decoding gate contains a short method explanation and
 * validity dates. Keep that information dense enough for a phone viewport
 * without turning the confirmation into a full-screen wall of text.
 */
.cid-plus-unlock-confirmation .cid-unlock-confirmation__card {
  width: min(92%, 430px) !important;
  max-height: min(82vh, 680px) !important;
  padding: 17px !important;
}

.cid-plus-unlock-confirmation .cid-unlock-confirmation__card h2 {
  margin-top: 6px;
  margin-bottom: 6px;
  font-size: 22px;
}

.cid-plus-unlock-confirmation .cid-unlock-confirmation__card p {
  margin-bottom: 12px;
  font-size: 12px;
  line-height: 1.38;
}

.cid-plus-unlock-confirmation .cid-unlock-confirmation__included {
  margin-bottom: 12px;
  padding: 10px 11px;
  font-size: 11px;
  line-height: 1.32;
}

.cid-plus-unlock-confirmation .cid-unlock-confirmation__included strong {
  margin-bottom: 4px;
  font-size: 12px;
}

.cid-plus-unlock-confirmation .cid-unlock-confirmation__included ul {
  display: grid;
  gap: 3px;
  margin-bottom: 5px;
}

.cid-plus-unlock-confirmation .cid-unlock-confirmation__included small {
  font-size: 10px;
  line-height: 1.3;
}

.cid-plus-unlock-validity {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 3px 10px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid rgba(20, 100, 210, .18);
  color: #607c99;
  font-size: 10px;
  line-height: 1.25;
}

.cid-plus-unlock-validity b {
  color: #173b62;
  text-align: right;
}

.cid-plus-unlock-confirmation .cid-unlock-confirmation__summary {
  margin-bottom: 14px;
}

@media (max-width: 560px) {
  .cid-unlock-confirmation {
    align-items: end;
    padding: 12px;
  }

  .cid-unlock-confirmation__card {
    padding: 20px;
    border-radius: 18px;
  }

  .cid-unlock-confirmation__actions {
    grid-template-columns: 1fr;
  }

  .cid-plus-unlock-confirmation .cid-unlock-confirmation__card {
    width: min(100%, 430px) !important;
    max-height: 86vh !important;
    padding: 15px !important;
  }

  .cid-plus-unlock-validity {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  }
}

/*
 * Final detail-page override: the formula heading stays in normal document
 * flow so it never occupies a floating/sticky layer above the tables.
 */
body.tableaux-active #tableauxSectionDetail .tableaux-section-detail__header {
  position: static !important;
  z-index: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
