/* Tempo : thème « feutre clair » commun à toutes les pages, chargé après leur feuille propre.
   Rail de navigation à gauche (barre d'onglets en bas sur mobile), surfaces blanches sur fond ivoire. */
:root {
  color-scheme: light;
  --t-bg: #f6f3ec;
  --t-surface: #ffffff;
  --t-raised: #fbf9f4;
  --t-sunk: #efeadf;
  --t-line: #e8e2d4;
  --t-line-2: #d8d0bd;
  --t-text: #1d232b;
  --t-muted: #566170;
  --t-dim: #667080;
  --t-accent: #1f6b4f;
  --t-accent-hover: #185741;
  --t-accent-ink: #ffffff;
  --t-accent-soft: rgba(31, 107, 79, 0.1);
  --t-warn: #9a5a00;
  --t-warn-bright: #f2a516;
  --t-warn-soft: rgba(242, 165, 22, 0.16);
  --t-danger: #b3261e;
  --t-ok: #12795a;
  --t-ink: #17212b;
  --t-ink-2: #223040;
  --t-felt: #14231f;
  --t-shadow: 0 1px 2px rgba(60, 48, 20, 0.06), 0 8px 24px -10px rgba(60, 48, 20, 0.16);
  --t-shadow-lg: 0 2px 4px rgba(60, 48, 20, 0.06), 0 24px 60px -18px rgba(60, 48, 20, 0.28);
  --t-radius: 16px;
  --t-radius-sm: 12px;
  --t-rail: 92px;
  --t-sans: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --t-serif: ui-serif, Georgia, 'Times New Roman', serif;
  --t-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  /* Variables des feuilles propres à chaque page */
  --bg: var(--t-bg);
  --panel: var(--t-surface);
  --line: var(--t-line);
  --border: var(--t-line);
  --text: var(--t-text);
  --muted: var(--t-muted);
  --accent: var(--t-accent);
  --sans: var(--t-sans);
  font-family: var(--t-sans);
  background: var(--t-bg);
  color: var(--t-text);
}
body {
  background-color: var(--t-bg);
  color: var(--t-text);
  font-family: var(--t-sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
/* Le rail est fixe : le contenu se décale. */
body:has(> .tempo-bar) {
  padding-left: var(--t-rail);
}
::selection {
  background: var(--t-accent);
  color: var(--t-accent-ink);
}
.eyebrow {
  font-family: var(--t-sans);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
kbd,
code,
pre {
  font-family: var(--t-mono);
}

/* Rail commun : logo, pages, état. */
.tempo-bar {
  position: fixed;
  z-index: 40;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--t-rail);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 20px 8px 18px;
  background: var(--t-surface);
  box-shadow:
    1px 0 0 var(--t-line),
    10px 0 36px -22px rgba(60, 48, 20, 0.3);
  overflow-y: auto;
  overflow-x: hidden;
}
.tempo-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--t-text);
  text-decoration: none;
  flex: none;
  padding-bottom: 14px;
}
.tempo-logo {
  width: 42px;
  height: 42px;
  flex: none;
  color: var(--t-accent);
  filter: drop-shadow(0 4px 8px rgba(31, 107, 79, 0.25));
}
.tempo-name {
  font: 700 19px/1 var(--t-serif);
  letter-spacing: -0.01em;
}
.tempo-ver {
  font: 600 9px/1 var(--t-sans);
  color: var(--t-muted);
  background: var(--t-sunk);
  border-radius: 999px;
  padding: 4px 7px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.tempo-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  flex: none;
}
.tempo-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 11px 2px 9px;
  border-radius: 14px;
  font: 600 11px/1.1 var(--t-sans);
  color: var(--t-muted);
  text-decoration: none;
  text-align: center;
  transition:
    background 0.15s,
    color 0.15s;
}
.tempo-nav a::before {
  content: '';
  width: 24px;
  height: 24px;
  background: currentColor;
  -webkit-mask: var(--ico, none) center / contain no-repeat;
  mask: var(--ico, none) center / contain no-repeat;
}
.tempo-nav a[href='live.html'] {
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='2.2' fill='black'/%3E%3Cpath d='M8 8a5.7 5.7 0 0 0 0 8M16 8a5.7 5.7 0 0 1 0 8M5 5a10 10 0 0 0 0 14M19 5a10 10 0 0 1 0 14'/%3E%3C/svg%3E");
}
.tempo-nav a[href='index.html'],
.tempo-nav a[href='./'] {
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='3.5' width='7' height='7' rx='2'/%3E%3Crect x='13.5' y='3.5' width='7' height='7' rx='2'/%3E%3Crect x='3.5' y='13.5' width='7' height='7' rx='2'/%3E%3Crect x='13.5' y='13.5' width='7' height='7' rx='2'/%3E%3C/svg%3E");
}
.tempo-nav a[href='photo.html'] {
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h3l1.6-2.4h6.8L17 8h3a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1z'/%3E%3Ccircle cx='12' cy='13' r='3.6'/%3E%3C/svg%3E");
}
.tempo-nav a[href='admin.html'] {
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8.5' r='3.5'/%3E%3Cpath d='M5 20c.8-3.6 3.6-5.5 7-5.5s6.2 1.9 7 5.5'/%3E%3C/svg%3E");
}
.tempo-nav a:hover {
  background: var(--t-sunk);
  color: var(--t-text);
}
.tempo-nav a[aria-current='page'] {
  color: var(--t-accent);
  background: var(--t-accent-soft);
}
.tempo-status {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font: 600 10px/1.25 var(--t-sans);
  color: var(--t-muted);
  text-align: center;
}
.tempo-dot {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 7px 8px;
  border-radius: 12px;
  background: var(--t-sunk);
  min-width: 64px;
}
.tempo-dot::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #a9a291;
}
.tempo-dot[data-state='live'] {
  color: var(--t-accent);
  background: var(--t-accent-soft);
}
.tempo-dot[data-state='live']::before {
  background: var(--t-accent);
  box-shadow: 0 0 0 0 rgba(31, 107, 79, 0.5);
  animation: tempo-pulse 1.6s infinite;
}
.tempo-dot[data-state='paused'],
.tempo-dot[data-state='test'] {
  color: var(--t-warn);
  background: var(--t-warn-soft);
}
.tempo-dot[data-state='paused']::before,
.tempo-dot[data-state='test']::before {
  background: var(--t-warn-bright);
}
@keyframes tempo-pulse {
  70% {
    box-shadow: 0 0 0 8px rgba(31, 107, 79, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(31, 107, 79, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .tempo-dot[data-state='live']::before {
    animation: none;
  }
}
.tempo-logout {
  color: var(--t-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.tempo-logout:hover {
  color: var(--t-text);
}

/* Mobile : en-tête réduit, navigation en barre d'onglets en bas. */
@media (max-width: 760px) {
  body:has(> .tempo-bar) {
    padding-left: 0;
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }
  .tempo-bar {
    position: sticky;
    bottom: auto;
    right: 0;
    width: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 16px;
    height: 54px;
    overflow: visible;
    box-shadow: 0 1px 0 var(--t-line);
  }
  .tempo-brand {
    flex-direction: row;
    gap: 9px;
    padding: 0;
  }
  .tempo-logo {
    width: 32px;
    height: 32px;
  }
  .tempo-name {
    font-size: 18px;
  }
  .tempo-ver,
  .tempo-status .tempo-hide-sm {
    display: none;
  }
  .tempo-status {
    margin: 0 0 0 auto;
    flex-direction: row;
    gap: 12px;
  }
  .tempo-dot {
    flex-direction: row;
    min-width: 0;
    padding: 6px 10px;
    border-radius: 999px;
    gap: 7px;
  }
  .tempo-nav {
    position: fixed;
    z-index: 60;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    flex-direction: row;
    gap: 2px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: var(--t-surface);
    box-shadow:
      0 -1px 0 var(--t-line),
      0 -10px 30px -16px rgba(60, 48, 20, 0.3);
  }
  .tempo-nav a {
    flex: 1;
    padding: 8px 2px 6px;
    font-size: 10.5px;
  }
}
