/* ── Header ─────────────────────────────────────────────────────── */
.fa-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  position: sticky;
  top: 0;
  z-index: 100;
  /* isolation: isolate crée un nouveau contexte SANS casser le fixed des enfants */
  isolation: isolate;
}
.fa-header-inner {
  max-width: var(--mw);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
}

/* Logo */
.fa-logo {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; flex-shrink: 0; margin-right: 8px;
}
.fa-logo-mark {
  background: var(--accent);
  width: 30px; height: 30px;
  border-radius: var(--r8);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.fa-logo-mark svg { color: #fff; width: 16px; height: 16px; }
.fa-logo-text { font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: -.2px; }
.fa-logo-text span { color: var(--accent); }

/* Desktop nav */
.fa-nav { display: flex; align-items: center; gap: 2px; height: 100%; overflow-x: auto; scrollbar-width: none; }
.fa-nav::-webkit-scrollbar { display: none; }
.fa-nav a {
  display: flex; align-items: center; gap: 5px;
  height: 100%; padding: 0 11px;
  font-size: 13px; font-weight: 500;
  color: var(--ink3);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.fa-nav a svg { width: 15px; height: 15px; flex-shrink: 0; opacity: .6; }
.fa-nav a:hover { color: var(--ink); }
.fa-nav a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.fa-nav a.active svg { opacity: 1; }

/* Search */
.fa-nav-search {
  margin-left: auto;
  display: flex; align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r24);
  padding: 7px 14px; gap: 7px;
  font-size: 13px; color: var(--ink3);
  flex-shrink: 0;
}
.fa-nav-search svg { width: 14px; height: 14px; flex-shrink: 0; }
.fa-nav-search input {
  background: none; border: none; outline: none;
  font: inherit; font-size: 13px; color: var(--ink);
  width: 160px;
}
.fa-nav-search input::placeholder { color: var(--ink3); }

/* ── Mobile Tab Bar ──────────────────────────────────────────────── */
.fa-tabbar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  /* z-index maximal — rien ne doit passer au-dessus */
  z-index: 99999;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -1px 0 rgba(0,0,0,.06), 0 -4px 16px rgba(0,0,0,.06);
  /* NE PAS utiliser transform ni overflow:hidden ici — casserait le fixed */
}
.fa-tabbar-inner {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  /* Hauteur barre + safe area iPhone X+ */
  height: calc(56px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  width: 100%;
}
.fa-tabbar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #9ca3af;
  cursor: pointer;
  transition: color .15s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  border: none;
  background: none;
  font-family: inherit;
  text-decoration: none;
  /* Padding vertical suffisant pour les deux éléments */
  padding: 10px 2px 8px;
  min-width: 0;
}
.fa-tabbar-item.active { color: #2563eb; }
.fa-tabbar-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 2px;
  background: #2563eb;
  border-radius: 0 0 3px 3px;
}
.fa-tabbar-item svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: block;
}
.fa-tabbar-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1px;
  white-space: nowrap;
  line-height: 1;
  display: block;
}

/* Search overlay */
.fa-sov {
  display: none; position: fixed; inset: 0; z-index: 400;
  background: rgba(10,14,23,.95);
  flex-direction: column;
}
.fa-sov.open { display: flex; }
.fa-sov-top {
  display: flex; align-items: center; gap: 10px;
  padding: 12px var(--pad);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.fa-sov-field {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--r8); padding: 10px 12px;
  color: rgba(255,255,255,.4);
}
.fa-sov-field svg { width: 16px; height: 16px; flex-shrink: 0; }
.fa-sov-field input {
  background: none; border: none; outline: none;
  font: inherit; font-size: 16px; color: #fff; flex: 1;
}
.fa-sov-field input::placeholder { color: rgba(255,255,255,.35); }
.fa-sov-cancel { font-size: 14px; font-weight: 600; color: var(--accent); cursor: pointer; white-space: nowrap; }
.fa-sov-results { flex: 1; overflow-y: auto; padding: 8px 0; }
.fa-sov-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px var(--pad); color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.05);
  cursor: pointer; transition: background .1s;
}
.fa-sov-item:hover { background: rgba(255,255,255,.05); }
.fa-sov-item-img {
  width: 36px; height: 36px; border-radius: var(--r8);
  object-fit: contain; background: rgba(255,255,255,.06); flex-shrink: 0;
}
.fa-sov-item-name { font-size: 14px; font-weight: 600; }
.fa-sov-item-type { font-size: 11px; color: rgba(255,255,255,.4); margin-top: 1px; }

/* ── Footer ──────────────────────────────────────────────────────── */
.fa-footer {
  background: var(--ink); margin-top: 32px;
  padding: 28px 0 20px; color: rgba(255,255,255,.5); font-size: 12.5px;
}
.fa-footer-grid {
  display: grid; grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 28px; margin-bottom: 24px;
}
.fa-footer .fa-logo-text { color: #fff; }
.fa-footer .fa-logo-text span { color: var(--accent); }
.fa-footer-brand p { font-size: 12px; line-height: 1.6; max-width: 220px; margin-top: 10px; }
.fa-footer-col h4 {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; color: rgba(255,255,255,.7); margin-bottom: 12px;
}
.fa-footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.fa-footer-col a:hover { color: var(--accent); }
.fa-footer-bottom {
  border-top: 1px solid rgba(255,255,255,.07); padding-top: 16px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px;
}

/* Responsive */
@media (max-width: 767px) {
  .fa-nav { display: none; }
  .fa-nav-search { display: none; }
  .fa-tabbar { display: flex; flex-direction: column; }
  .fa-page { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 16px); }
  .fa-footer-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
}
@media (max-width: 480px) {
  .fa-footer-grid { grid-template-columns: 1fr; }
}
