/* EFXspirit mobile readability layer.
   Keeps the current visual hierarchy while raising secondary text above
   uncomfortable micro-type sizes on real phones and improving gray contrast. */

/* Primary shell: fixed without expensive backdrop recomposition. */
html {
  scroll-padding-top: 68px;
}

body {
  padding-top: 68px;
}

body > header {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
  background: #000 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  isolation: isolate;
  transform: translateZ(0);
  backface-visibility: hidden;
}

@media (max-width: 760px) {
  body {
    --muted: #c0c7cb;
  }

  /* The fixed masked grid was forcing broad GPU repaints while scrolling. */
  body > .atmosphere {
    display: none !important;
  }

  body header .bar {
    gap: 8px;
  }

  body header .master img {
    width: 156px;
  }

  body header .actions {
    margin-left: auto;
    gap: 6px;
  }

  /* Compact account affordance: touch target stays generous, chrome disappears. */
  body .identityHeaderStatusV1 {
    position: relative;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    color: #b8c2c7;
    border: 0;
    background: transparent;
    transition: color .18s ease, opacity .18s ease;
  }

  body .identityHeaderStatusV1::before {
    content: "";
    width: 20px;
    height: 20px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='3.25' fill='none' stroke='black' stroke-width='1.8'/%3E%3Cpath d='M5.8 19c.6-3.4 2.8-5.3 6.2-5.3s5.6 1.9 6.2 5.3' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='3.25' fill='none' stroke='black' stroke-width='1.8'/%3E%3Cpath d='M5.8 19c.6-3.4 2.8-5.3 6.2-5.3s5.6 1.9 6.2 5.3' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
  }

  body .identityHeaderStatusV1 span {
    display: none;
  }

  body .identityHeaderStatusV1 i {
    position: absolute;
    right: 5px;
    bottom: 5px;
    width: 7px;
    height: 7px;
    border-width: 1px;
    box-shadow: 0 0 0 2px #000;
  }

  body .identityHeaderStatusV1.connected {
    color: #e8f6f2;
    border: 0;
    background: transparent;
  }

  body .identityHeaderStatusV1.connected i {
    box-shadow: 0 0 0 2px #000, 0 0 8px rgba(111,214,186,.48);
  }

  body .identityHeaderStatusV1:hover,
  body .identityHeaderStatusV1:focus-visible {
    color: #fff;
    background: transparent;
  }

  /* Decorative rings are attractive on desktop but expensive on real phones. */
  body .identityBridgeSignalV1 {
    display: none;
  }

  body .identityBridgeV1 {
    margin-top: -4px;
    margin-bottom: 14px;
    padding: 16px;
    gap: 13px;
    box-shadow: none;
  }

  body .identityBridgeCopyV1 small {
    font-size: 10.5px;
  }

  body .identityBridgeCopyV1 h2 {
    margin-bottom: 6px;
  }

  body .identityBridgeCopyV1 p {
    color: #c4cbcf;
    font-size: 13.5px;
    line-height: 1.56;
  }

  body .identityBridgeActionsV1 {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    justify-content: stretch;
    gap: 8px;
  }

  body .identityBridgeActionsV1 button,
  body .identityBridgeActionsV1 a {
    min-height: 40px;
    padding: 0 12px;
    font-size: 11.5px;
    line-height: 38px;
    white-space: nowrap;
  }

  body .identityBridgeActionsV1 a[href*="auth.efxspirit.fr/compte"] {
    border-color: rgba(75,220,255,.38);
    background: rgba(75,220,255,.075);
    color: #edfaff;
    text-align: center;
  }

  body .identityBridgeActionsV1 button[data-identity-logout] {
    border-color: transparent;
    background: transparent;
    color: #b9c1c5;
    padding-inline: 8px;
  }

  body .identityBridgeActionsV1 button[data-identity-logout]:hover {
    border-color: rgba(255,255,255,.12);
    background: rgba(255,255,255,.025);
  }

  body .identityBridgeStateV1 {
    color: #c6cccf;
    font-size: 10.5px;
  }

  body .identityBridgeErrorV1 {
    font-size: 12px;
  }

  /* Preserve the homepage animation, but move it to compositor-friendly
     transform/opacity animation instead of animating large CSS filters. */
  .spiritReferenceV48 {
    filter: saturate(1.06) contrast(1.035) brightness(.99) !important;
    animation: efxMobileArtworkBreath 9s ease-in-out infinite !important;
    will-change: transform, opacity;
  }

  .spiritXLifeV52 {
    filter: none !important;
    animation: efxMobileXBreath 4.4s ease-in-out infinite !important;
    will-change: transform, opacity;
  }

  .spiritReferencePulseV48:after {
    animation: none !important;
  }

  .universeNode {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  @keyframes efxMobileArtworkBreath {
    0%,100% { transform: scale(.998); opacity: .96; }
    50% { transform: scale(1.006); opacity: 1; }
  }

  @keyframes efxMobileXBreath {
    0%,100% { transform: scale(.997); opacity: .18; }
    38% { transform: scale(1.012); opacity: .58; }
    62% { transform: scale(1.004); opacity: .32; }
  }

  .lead,
  .card p,
  .principle p,
  .row p {
    color: #c0c7cb;
  }

  .origin,
  .openEcosystem,
  .universeFilter a,
  .spiritVisual.premium > p,
  .metric span,
  .panelHead span,
  .panelRow small,
  .state,
  .footIdentity span,
  .footIdentity p,
  .footMeta {
    color: #b4bdc2;
  }

  .sideNav {
    scrollbar-width: none;
    -ms-overflow-style: none;
    overscroll-behavior-inline: contain;
  }

  .sideNav::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .sideNav button {
    color: #bcc4c8;
  }

  .portalTop {
    margin-bottom: 10px;
  }

  .portalTop .badge {
    color: #b7c0c4;
    border-color: rgba(255,255,255,.15);
  }

  .panelHead span {
    color: #b3bcc1;
  }

  .panelRow small {
    color: #b7c0c5;
  }

  .state {
    min-width: 60px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 9px;
    color: #bcc5c9;
    border-color: rgba(255,255,255,.18);
  }
}

@media (max-width: 640px) {
  .eyebrow,
  .kicker {
    font-size: 11.5px;
  }

  .lead {
    font-size: 16px;
    line-height: 1.56;
  }

  .origin {
    font-size: 11.5px;
    line-height: 1.45;
  }

  .spiritVisual.premium > p {
    font-size: 10px;
  }

  .universeNode b {
    font-size: 8.8px;
  }

  .universeNode small {
    color: #aeb8bd;
    font-size: 7.4px;
  }

  .card small {
    font-size: 10px;
  }

  .card p {
    font-size: 12px;
    line-height: 1.5;
  }

  .openEcosystem {
    font-size: 11px;
  }

  .principle span {
    color: #adb7bc;
    font-size: 10px;
  }

  .principle h3 {
    font-size: 13px;
  }

  .principle p {
    font-size: 11.5px;
    line-height: 1.48;
  }

  .row .u {
    font-size: 10.5px;
  }

  .row p {
    font-size: 12.5px;
  }

  .sideNav button {
    font-size: 13.5px;
  }

  .metric span {
    font-size: 10.5px;
  }

  .panelHead h2 {
    font-size: 16px;
  }

  .panelHead span {
    font-size: 10.5px;
  }

  .panelRow strong {
    font-size: 13.5px;
  }

  .panelRow small {
    font-size: 12px;
    line-height: 1.4;
  }

  .state {
    font-size: 10.5px;
  }

  .footIdentity strong {
    font-size: 12px;
  }

  .footIdentity span,
  .footIdentity p,
  .footMeta {
    font-size: 10.5px;
  }

  body .identityBridgeActionsV1 {
    grid-template-columns: auto minmax(118px, 1fr) auto;
  }

  body .identityBridgeActionsV1 a[href*="auth.efxspirit.fr/compte"] {
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .spiritReferenceV48,
  .spiritXLifeV52 {
    animation: none !important;
    transform: none !important;
  }
}
