/**
 * Barre d’onglets bas (mobile) — style dock, marque or / crème, icônes SVG.
 * Pages avec nav injectée : body.has-app-bottom-tabs. Dashboard : même classe + .app .main.
 */
/* Renforce le meta viewport (pas de zoom pincement) sur les écrans avec dock */
body.has-app-bottom-tabs {
  /* pan-x pan-y : scroll tactile sans pinch-zoom (manipulation l’autorise souvent) */
  touch-action: pan-x pan-y;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

:root {
  --ab-accent: #f0c85a;
  --ab-accentRgb: 240, 200, 90;
  --ab-muted: rgba(245, 237, 224, 0.42);
  --ab-text: rgba(245, 237, 224, 0.9);
  --ab-border: rgba(245, 237, 224, 0.12);
}

.app-bottom-tabs {
  display: none;
}

@media (max-width: 720px) {
  body.has-app-bottom-tabs .wrap {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body.has-app-bottom-tabs .app > .main {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
  }

  body.has-app-bottom-tabs .bg {
    bottom: calc(-1 * env(safe-area-inset-bottom, 0px)) !important;
    min-height: calc(100dvh + env(safe-area-inset-bottom, 0px)) !important;
    min-height: calc(100lvh + env(safe-area-inset-bottom, 0px)) !important;
  }

  .app-bottom-tabs {
    display: flex;
    position: fixed;
    z-index: 1000;
    left: max(12px, env(safe-area-inset-left, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: max(10px, calc(6px + env(safe-area-inset-bottom, 0px)));
    justify-content: space-between;
    align-items: stretch;
    gap: 2px;
    padding: 8px 6px;
    border-radius: 22px;
    background: linear-gradient(165deg, rgba(22, 18, 15, 0.94), rgba(10, 9, 8, 0.9));
    border: 1px solid var(--ab-border);
    box-shadow:
      0 12px 40px rgba(0, 0, 0, 0.45),
      0 0 0 1px rgba(0, 0, 0, 0.35) inset,
      0 1px 0 rgba(255, 255, 255, 0.05) inset;
    backdrop-filter: blur(24px) saturate(1.12);
    -webkit-backdrop-filter: blur(24px) saturate(1.12);
  }

  .app-bottom-tab {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 52px;
    min-width: 0;
    margin: 0;
    padding: 6px 2px;
    text-decoration: none;
    color: var(--ab-muted);
    font-size: clamp(0.56rem, 2.5vw, 0.62rem);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-family: Inter, system-ui, sans-serif;
    border-radius: 16px;
    -webkit-tap-highlight-color: transparent;
    transition:
      color 0.2s ease,
      background 0.2s ease,
      box-shadow 0.2s ease,
      transform 0.15s ease;
  }

  .app-bottom-tab:active {
    transform: scale(0.97);
  }

  .app-bottom-tab:hover,
  .app-bottom-tab:focus-visible {
    outline: none;
    color: var(--ab-text);
    background: rgba(245, 237, 224, 0.06);
  }

  .app-bottom-tab.active {
    color: rgba(254, 243, 199, 0.98);
    background: linear-gradient(180deg, rgba(var(--ab-accentRgb), 0.22), rgba(220, 38, 38, 0.06));
    box-shadow:
      0 0 0 1px rgba(var(--ab-accentRgb), 0.25),
      0 4px 20px rgba(0, 0, 0, 0.25);
  }

  /* Accueil (1er onglet) : jaune / ambre — sans mélange or + rouge qui tire sur le violet */
  .app-bottom-tabs .app-bottom-tab:first-child.active {
    color: #fffbeb;
    background: linear-gradient(180deg, rgba(253, 224, 71, 0.38), rgba(234, 179, 8, 0.16));
    box-shadow:
      0 0 0 1px rgba(253, 224, 71, 0.42),
      0 4px 22px rgba(245, 158, 11, 0.22);
  }

  .app-bottom-tab__ico {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
  }

  .app-bottom-tab__ico svg {
    display: block;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    opacity: 0.88;
    stroke: currentColor;
    fill: none;
    transition: opacity 0.2s ease;
  }

  .app-bottom-tab.active .app-bottom-tab__ico svg {
    opacity: 1;
  }

  .app-bottom-tab__lbl {
    line-height: 1.12;
    text-align: center;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
  }
}
