/* ═══════════════════════════════════════
   BASE — Reset, layout global, fond
═══════════════════════════════════════ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--txt);
  font-family: var(--fr);
  overflow-x: hidden;
  overflow-y: auto;
  font-size: 15px;
}

button, input, select, textarea {
  font-family: var(--fr);
  font-size: 15px;
  color: var(--txt);
}

img {
  display: block;
  max-width: 100%;
}

/* Quadrillage de fond */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(90,110,64,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(90,110,64,.07) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* ─── APP SHELL ─── */
#app {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  height: auto;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  z-index: 1;
}


/* ─── ÉCRANS ─── */
.screen {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: auto;
}

.screen.active { display: flex; }

/* ─── PAGE WRAPPER ─── */
#pw {
  flex: 1;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: auto;
}


/* ─── PAGES (onglets internes) ─── */
.page {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--nav) + 20px);
  display: none;
}
.page.active { display: block; }
.page::-webkit-scrollbar { width: 3px; }
.page::-webkit-scrollbar-thumb { background: var(--c4); }

/* ─── BARRE HORS-LIGNE ─── */
.offbar {
  display: none;
  background: rgba(231,76,60,.1);
  border-bottom: 2px solid rgba(231,76,60,.4);
  padding: 7px 16px;
  font-family: var(--fm);
  font-size: 10px;
  color: var(--red2);
  text-align: center;
  flex-shrink: 0;
  letter-spacing: 1px;
}
.offbar.show { display: block; }

/* ─── ANIMATION BLINK ─── */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: .2; }
}

/* ─── ANIMATION AVATAR RING ─── */
@keyframes ringPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--yglow); }
  50%       { box-shadow: 0 0 0 6px rgba(245,168,0,0); }
}
.av-ring { animation: ringPulse 2s ease-in-out infinite; }
