.mobile-shell-header,
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 700px) {
  body.authenticated-shell > .desktop-shell-header {
    display: none;
  }

  body.authenticated-shell > .mobile-shell-header {
    display: block;
    position: relative;
    z-index: 40;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
  }

  .mobile-shell-topbar {
    width: 100%;
    min-height: 52px;
    padding: 4px 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }

  .mobile-shell-menu {
    position: relative;
    min-width: 0;
  }

  .mobile-shell-menu > summary,
  .mobile-shell-context-link,
  .mobile-shell-back {
    min-height: 44px;
    border: 0;
    border-radius: 10px;
    color: var(--ink);
    background: transparent;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
  }

  .mobile-shell-menu > summary {
    list-style: none;
    cursor: pointer;
  }

  .mobile-shell-menu > summary::-webkit-details-marker {
    display: none;
  }

  .mobile-shell-workspace > summary {
    width: 100%;
    padding: 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--soft);
    border: 1px solid var(--line);
  }

  .mobile-shell-workspace-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-shell-chevron {
    margin-left: auto;
    color: var(--muted);
  }

  .mobile-shell-account > summary {
    min-width: 64px;
    padding-inline: 8px;
    display: grid;
    place-items: center;
    font-size: .8rem;
  }

  .mobile-shell-popover {
    position: absolute;
    top: calc(100% + 4px);
    z-index: 60;
    display: grid;
    gap: 8px;
    min-width: min(320px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 16px 36px rgb(23 32 51 / 18%);
  }

  .mobile-shell-workspace-popover {
    left: 0;
  }

  .mobile-shell-account-popover {
    right: 0;
  }

  .mobile-shell-popover a,
  .mobile-shell-popover button {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .mobile-shell-popover form,
  .mobile-shell-popover button {
    width: 100%;
  }

  .mobile-shell-focused .mobile-shell-topbar {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }

  .mobile-shell-back {
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    line-height: 1;
  }

  .mobile-shell-title {
    min-width: 0;
    overflow: hidden;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-shell-balance {
    width: 44px;
    height: 44px;
  }

  body.authenticated-shell:not(.mobile-shell-focused) > .mobile-bottom-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 50;
    min-height: 62px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    align-items: stretch;
    gap: 4px;
    background: var(--surface);
    border-top: 1px solid var(--line);
  }

  body.authenticated-shell:not(.mobile-shell-focused) main {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  body.authenticated-shell:not(.mobile-shell-focused) main
    :is(a[href], button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"])) {
    scroll-margin-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  .mobile-bottom-nav__item,
  .mobile-bottom-more > summary {
    min-height: 48px;
    padding: 4px 8px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--ink);
    font-size: .9rem;
    font-weight: 700;
    line-height: 1.05;
    text-align: center;
    text-decoration: none;
  }

  .mobile-bottom-nav__item[aria-current="page"],
  .mobile-bottom-more.is-current > summary,
  .mobile-bottom-more[open] > summary {
    color: var(--brand);
    background: #eef2ff;
  }

  .mobile-bottom-sheet {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(68px + env(safe-area-inset-bottom));
    z-index: 70;
    display: grid;
    gap: 4px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 -12px 36px rgb(23 32 51 / 18%);
  }

  .mobile-bottom-sheet a {
    min-height: 44px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    border-radius: 8px;
    color: var(--ink);
    font-weight: 650;
    text-decoration: none;
  }

  .mobile-bottom-sheet a[aria-current="page"] {
    color: var(--brand);
    background: #eef2ff;
  }

  body.authenticated-shell main {
    padding-top: 14px;
  }
  /* #875 F2-B MOBILE — le trial reste immédiatement compréhensible sans
     concurrencer la tâche quotidienne. L’administration garde la notice
     complète et Abonnement porte son propre état sans doublon global. */
  body.authenticated-shell:not(:has(.workspace-management-menu > summary[aria-current="page"]))
    main > .notice--trial {
    width: fit-content;
    max-width: 100%;
    margin: 0 0 8px;
    border: 0;
    border-radius: 10px;
    padding: 0 4px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 6px;
    background: transparent;
    box-shadow: none;
    color: var(--muted);
    font-size: .85rem;
    line-height: 1.35;
  }

  body.authenticated-shell:not(:has(.workspace-management-menu > summary[aria-current="page"]))
    main > .notice--trial strong {
    color: var(--ink);
    font-weight: 700;
  }

  body.authenticated-shell:not(:has(.workspace-management-menu > summary[aria-current="page"]))
    main > .notice--trial strong::after {
    content: " ·";
    color: var(--muted);
    font-weight: 400;
  }

  body.authenticated-shell:not(:has(.workspace-management-menu > summary[aria-current="page"]))
    main > .notice--trial .trial-notice-detail {
    display: none;
  }

  body.authenticated-shell:not(:has(.workspace-management-menu > summary[aria-current="page"]))
    main > .notice--trial a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding-inline: 4px;
  }

  /* #929 WARNING MOBILE — contrairement au trial, aucun contenu commercial
     n'est masqué. La shell compacte uniquement la géométrie sur les tâches
     quotidiennes et conserve l'action à 44 px. Les surfaces Administration
     restent sur la primitive warning complète définie par la shell desktop. */
  body.authenticated-shell:not(:has(.workspace-management-menu > summary[aria-current="page"]))
    main > .notice--warning {
    width: fit-content;
    max-width: 100%;
    margin: 0 0 8px;
    border-radius: 10px;
    padding: var(--space-1) var(--space-2);
    display: block;
    box-shadow: none;
    font-size: .85rem;
    line-height: 1.35;
  }

  body.authenticated-shell:not(:has(.workspace-management-menu > summary[aria-current="page"]))
    main > .notice--warning:has(> a) {
    position: relative;
    min-height: 54px;
    padding-inline-end: 136px;
  }

  body.authenticated-shell:not(:has(.workspace-management-menu > summary[aria-current="page"]))
    main > .notice--warning > a {
    position: absolute;
    inset-inline-end: var(--space-2);
    top: 50%;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    transform: translateY(-50%);
    padding-inline: 4px;
    white-space: nowrap;
  }

  body:has(.subscription-page) main > .notice--trial {
    display: none;
  }

}
