/* =============================================================================
   TerraTrack — Base
   =============================================================================
   Reset, typographie, layout général de l'app.
   Polices Inter + JetBrains Mono chargées via <link preconnect> dans index.html
   (Design System v2, 2026-05-24). Tokens dans styles/tokens.css.
   ========================================================================= */

/* ---------- Reset léger ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--txt);
  font-family: var(--font-sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
textarea,
select {
  font-family: inherit;
}

/* ---------- Layout principal ---------- */
.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

.screen {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: calc(80px + var(--sb));
  -webkit-overflow-scrolling: touch;
}

.screen::-webkit-scrollbar {
  display: none;
}

/* ---------- Loading overlay ---------- */
.load-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .9);
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--sp-4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.load-overlay p {
  color: var(--txt2);
  font-size: 14px;
  font-weight: 600;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(227, 163, 42, .15);
  border-top-color: var(--acc);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- Status banner ---------- */
.ds-status {
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  margin: 0 var(--sp-4) 10px;
  border-radius: 10px;
  display: none;
  border: 1px solid;
}

/* ---------- Empty state ---------- */
.es {
  text-align: center;
  padding: 70px 32px;
}
.ei {
  font-size: 52px;
  margin-bottom: var(--sp-4);
  opacity: .25;
}
.es h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: var(--sp-2);
  color: var(--txt3);
}
.es p {
  font-size: 13px;
  color: var(--txt3);
  opacity: .6;
  line-height: 1.7;
}

/* ---------- Divider ---------- */
.div2 {
  height: 1px;
  background: var(--bor);
  margin: var(--sp-4);
}
