/* ============================================================================
   Chajarati V41 · Styles Cockpit Mairie (Éditorial Luxe + Tiroir Fiche Complète)
   ============================================================================ */
@font-face {
  font-family: 'Geist Mono'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/polices/geist/geist-mono-latin-wght-normal.woff2') format('woff2');
}
:root {
  --paper: #F4F1EA; --surface: #FBFAF6; --white: #FFFFFF; --warm: #ECE7DC;
  --ink: #16211C; --ink-2: #3A4740; --muted: #626C66;
  --line: rgba(22,33,28,0.11); --line-s: rgba(22,33,28,0.22);
  --leaf: #1F5A45; --leaf-h: #174434; --leaf-soft: #E2ECE5;
  --good: #2F7A55; --good-soft: #E2F1E8;
  --warn: #B47E25; --warn-ink: #7A4F0B; --warn-soft: #F7EEDB;
  --bad: #B0473A; --bad-ink: #8A2E23; --bad-soft: #F9E8E5;
  --water: #1D6F8A; --water-soft: #E3F1F6;
  --brass: #97733A; --brass-soft: #F3EAD9;
  --serif: 'Instrument Serif', Georgia, serif;
  --sans: 'Jost', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'Geist Mono', ui-monospace, Menlo, monospace;
  --top-h: 64px;
  --nav-w: 248px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--paper); color: var(--ink); font: 400 14.5px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
[hidden] { display: none !important; }
svg.ico { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* Barre supérieure */
.m-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40; height: var(--top-h);
  background: rgba(244,241,234,0.92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 0 22px; display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.m-brand { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 0 1 auto; }
.brand-link { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.brand-link svg { width: 27px; height: 27px; color: var(--leaf); flex: none; }
.brand-txt { min-width: 0; }
.brand-link b { display: block; font: 400 1.52rem/0.95 var(--serif); letter-spacing: -0.01em; white-space: nowrap; }
.brand-link .sub { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-sm { display: none; }

.live-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  background: var(--leaf-soft); color: var(--leaf); font: 600 11.5px/1 var(--sans);
  border: 1px solid rgba(31,90,69,0.22); white-space: nowrap; transition: background 0.3s;
}
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px rgba(47,122,85,0.22); }
.live-pill.pulse { background: #CBE6D5; }

.dist-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.dist-seg button { height: 32px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 550; color: var(--ink-2); white-space: nowrap; }
.dist-seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.m-top-acts { display: flex; align-items: center; gap: 7px; }
.pill-btn {
  height: 36px; padding: 0 13px; border-radius: 999px; background: var(--white); border: 1px solid var(--line-s);
  font: 550 13px/1 var(--sans); color: var(--ink); display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap; transition: all 0.15s;
}
.pill-btn:hover { border-color: var(--leaf); color: var(--leaf); }
.pill-btn.accent { background: var(--leaf); border-color: var(--leaf); color: #FFFFFF; }
.pill-btn.accent:hover { background: var(--leaf-h); color: #FFFFFF; }
.pill-btn.brass { background: var(--brass); border-color: var(--brass); color: #FFFFFF; }
.pill-btn.sm { height: 30px; padding: 0 10px; font-size: 12px; }
.pill-btn.good { background: var(--good-soft); border-color: rgba(47,122,85,0.3); color: var(--good); }
.pill-btn.bad { background: var(--bad-soft); border-color: rgba(176,71,58,0.3); color: var(--bad-ink); }

/* Shell */
.m-shell { display: flex; padding-top: var(--top-h); min-height: 100vh; }

/* Navigation latérale */
.m-nav {
  position: fixed; top: var(--top-h); left: 0; bottom: 0; width: var(--nav-w);
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 18px 12px; display: flex; flex-direction: column; justify-content: space-between; gap: 16px;
  overflow-y: auto; z-index: 20;
}
.nav-list { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  width: 100%; min-height: 44px; padding: 0 12px; border-radius: 13px;
  display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: var(--ink-2);
  text-align: left; transition: all 0.15s;
}
.nav-item:hover { background: var(--warm); color: var(--ink); }
.nav-item.active { background: var(--ink); color: var(--paper); box-shadow: 0 6px 18px rgba(22,33,28,0.12); }
.nav-item span.nav-lbl { flex: 1; min-width: 0; }
.nav-item span.nav-lbl-sm { display: none; }
.nav-badge {
  font: 600 11px/1 var(--mono); padding: 3px 7px; border-radius: 999px; font-style: normal;
  background: rgba(22,33,28,0.1); color: var(--ink-2);
}
.nav-item.active .nav-badge { background: rgba(255,255,255,0.18); color: #FFFFFF; }
.nav-badge.bad { background: var(--bad); color: #FFFFFF; }
.nav-badge.warn { background: var(--warn); color: #FFFFFF; }
.nav-badge.brass { background: var(--brass); color: #FFFFFF; }

.nav-foot { display: flex; flex-direction: column; gap: 10px; }
.nf-card { padding: 12px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); font-size: 12px; color: var(--muted); line-height: 1.45; }
.nf-card b { display: block; color: var(--ink); font-size: 12.5px; margin-bottom: 4px; }
.nf-card code { font: 600 11px/1 var(--mono); color: var(--leaf); }
.nf-links { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 0 4px; font-size: 12.5px; color: var(--muted); }
.nf-links a:hover { color: var(--leaf); text-decoration: underline; }

/* Zone principale */
.m-main {
  flex: 1; margin-left: var(--nav-w); padding: 24px clamp(18px, 3vw, 34px) 64px;
  max-width: calc(var(--nav-w) + 1440px);
}
.tab-view { display: none; }
.tab-view.active { display: block; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.eyebrow { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--leaf); }
h1 { font: 400 clamp(2.05rem, 3.2vw, 2.8rem)/1.02 var(--serif); letter-spacing: -0.015em; margin-top: 4px; }
h2 { font: 400 1.48rem/1.12 var(--serif); letter-spacing: -0.01em; }
h3 { font: 600 14.5px/1.25 var(--sans); color: var(--ink); }
.head-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* KPIs */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi-card {
  background: var(--white); border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 4px; box-shadow: 0 6px 22px rgba(22,33,28,0.04);
  position: relative; overflow: hidden;
}
.kpi-card::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3.5px; background: var(--leaf); opacity: 0.28; }
.kpi-card.bad::after { background: var(--bad); opacity: 0.7; }
.kpi-card.water::after { background: var(--water); opacity: 0.7; }
.kpi-card.brass::after { background: var(--brass); opacity: 0.7; }
.kpi-lbl { font-size: 12px; font-weight: 600; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kpi-val { font: 400 2.4rem/1 var(--serif); color: var(--ink); font-variant-numeric: tabular-nums; margin-top: 4px; }
.kpi-val.leaf { color: var(--leaf); }
.kpi-val.bad { color: var(--bad); }
.kpi-val.water { color: var(--water); }
.kpi-val.brass { color: var(--brass); }
.kpi-sub { font-size: 12.5px; color: var(--ink-2); line-height: 1.38; margin-top: 2px; }

/* Cartes & Grilles */
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: 22px; padding: 18px 20px;
  box-shadow: 0 6px 24px rgba(22,33,28,0.04);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.split-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.85fr); gap: 16px; margin-bottom: 18px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }

/* Carte MapLibre Minimaliste & Capsules Flottantes Verre Dépoli */
.compact-head { align-items: center; margin-bottom: 12px; }
.chip {
  height: 30px; padding: 0 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-s);
  font-size: 12px; font-weight: 550; color: var(--ink-2); display: inline-flex; align-items: center; gap: 5px; transition: all 0.14s;
}
.chip:hover { border-color: var(--leaf); color: var(--leaf); }
.chip.active, .chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.map-box { position: relative; height: 580px; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: #F6F3EC; transition: background 0.3s; }
.map-box.is-dark { background: #0C1511; }
#mairieMap { position: absolute; inset: 0; width: 100%; height: 100%; }

.map-top-bar {
  position: absolute; top: 12px; left: 12px; right: 12px; z-index: 6;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; flex-wrap: wrap; pointer-events: none;
}
.map-top-bar > * { pointer-events: auto; }

.map-search-float {
  position: relative; flex: 1 1 168px; max-width: 242px; min-width: 150px;
  background: rgba(251,250,246,0.92); border: 1px solid rgba(22,33,28,0.14); border-radius: 999px;
  padding: 0 12px; height: 38px; display: flex; align-items: center; gap: 7px;
  box-shadow: 0 8px 26px rgba(22,33,28,0.10); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.map-box.is-dark .map-search-float {
  background: rgba(15,24,20,0.82); border-color: rgba(255,255,255,0.16); color: #F4F1EA;
}
.map-search-float input { flex: 1; border: 0; background: none; outline: none; font-size: 13px; min-width: 0; }
.map-box.is-dark .map-search-float input::placeholder { color: rgba(244,241,234,0.62); }
.map-search-drop {
  position: absolute; top: 44px; left: 0; right: 0; background: var(--white); border: 1px solid var(--line-s); color: var(--ink);
  border-radius: 16px; padding: 6px; box-shadow: 0 14px 36px rgba(22,33,28,0.18); max-height: 280px; overflow-y: auto; z-index: 12;
}
.msd-row { width: 100%; padding: 8px 10px; border-radius: 10px; text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.msd-row:hover { background: var(--surface); }
.msd-row b { display: block; font-weight: 600; }
.msd-row small { display: block; font-size: 11.5px; color: var(--muted); }

/* Dock flottant Haut-Droite : Canopée · Nuit · Sat 15 cm · 3D + Calques */
.map-dock-tr {
  position: relative; display: flex; align-items: center; gap: 7px; margin-left: auto; max-width: 100%;
}
.map-seg {
  display: inline-flex; padding: 3px; border-radius: 999px;
  background: rgba(251,250,246,0.90); border: 1px solid rgba(22,33,28,0.14);
  box-shadow: 0 8px 26px rgba(22,33,28,0.10); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.map-box.is-dark .map-seg {
  background: rgba(15,24,20,0.82); border-color: rgba(255,255,255,0.16);
}
.mseg-btn {
  height: 31px; padding: 0 9.5px; border-radius: 999px; font-size: 11.8px; font-weight: 550; color: var(--ink-2);
  white-space: nowrap; transition: all 0.16s;
}
.map-box.is-dark .mseg-btn { color: rgba(244,241,234,0.78); }
.mseg-btn.active { background: var(--ink); color: #FBFAF6; box-shadow: 0 3px 10px rgba(22,33,28,0.16); }
.map-box.is-dark .mseg-btn.active { background: #D9B26A; color: #121D18; }

.layers-wrap { position: relative; }
.map-fab {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(251,250,246,0.90); border: 1px solid rgba(22,33,28,0.14); color: var(--ink);
  box-shadow: 0 8px 26px rgba(22,33,28,0.10); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.map-box.is-dark .map-fab { background: rgba(15,24,20,0.82); border-color: rgba(255,255,255,0.16); color: #F4F1EA; }
.map-fab.active { background: var(--leaf); border-color: var(--leaf); color: #FFFFFF; }
.layers-pop {
  position: absolute; top: 46px; right: 0; width: 230px; background: rgba(251,250,246,0.96);
  border: 1px solid var(--line-s); border-radius: 18px; padding: 10px 12px; color: var(--ink);
  box-shadow: 0 18px 44px rgba(15,24,20,0.22); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  display: flex; flex-direction: column; gap: 8px;
}
.lp-row { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 500; cursor: pointer; padding: 3px 2px; }
.lp-row input { accent-color: var(--leaf); width: 15px; height: 15px; }
.lp-btn {
  margin-top: 4px; padding: 8px 10px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line);
  font-size: 12.5px; font-weight: 600; color: var(--leaf); text-align: center;
}
.lp-btn:hover { background: var(--leaf-soft); }

.map-legend {
  position: absolute; left: 14px; bottom: 14px; z-index: 4;
  display: flex; flex-wrap: wrap; gap: 8px 13px; padding: 7px 14px; border-radius: 999px;
  background: rgba(251,250,246,0.88); border: 1px solid rgba(22,33,28,0.12); font-size: 11.5px; color: var(--ink-2);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.map-box.is-dark .map-legend {
  background: rgba(15,24,20,0.78); border-color: rgba(255,255,255,0.14); color: rgba(244,241,234,0.88);
}
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.map-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* Panneau latéral rapide */
.inspector-card { display: flex; flex-direction: column; gap: 10px; max-height: 656px; overflow-y: auto; }
.quick-tree-row {
  display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 15px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: all 0.14s;
}
.quick-tree-row:hover { border-color: var(--leaf); background: var(--white); transform: translateY(-1px); }
.quick-tree-row .qt-thumb {
  width: 50px; height: 50px; border-radius: 12px; overflow: hidden; flex: none;
  background: var(--leaf-soft); display: grid; place-items: center; font: 600 11px/1 var(--mono); color: var(--leaf);
}
.quick-tree-row .qt-thumb img { width: 100%; height: 100%; object-fit: cover; }
.quick-tree-row .qt-body { flex: 1; min-width: 0; }
.quick-tree-row b { display: block; font-size: 13.8px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick-tree-row small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Tiroir Slide-Over : Fiche Complète de l'Arbre */
.drawer-scrim {
  position: fixed; inset: 0; z-index: 75; background: rgba(15,24,20,0.44);
  display: flex; justify-content: flex-end; backdrop-filter: blur(3px);
}
.tree-drawer {
  width: min(560px, 96vw); height: 100%; background: var(--paper);
  border-left: 1px solid var(--line-s); box-shadow: -20px 0 60px rgba(15,24,20,0.28);
  overflow-y: auto; padding: 20px 22px 42px; display: flex; flex-direction: column; gap: 16px;
  animation: slideInR 0.22s ease;
}
@keyframes slideInR { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.td-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.td-code { display: inline-block; padding: 4px 10px; border-radius: 8px; border: 1.2px solid var(--ink); font: 650 12.5px/1 var(--mono); }
.td-sec { margin-left: 8px; font-size: 12px; color: var(--muted); font-weight: 600; }
.td-x { width: 34px; height: 34px; border-radius: 50%; background: var(--white); border: 1px solid var(--line-s); display: grid; place-items: center; }

.td-hero { display: flex; gap: 16px; align-items: flex-start; }
.td-photo {
  width: 124px; height: 142px; border-radius: 62px 62px 16px 16px; overflow: hidden; flex: none;
  background: var(--surface); border: 1.5px solid var(--line-s); position: relative; cursor: pointer;
  display: grid; place-items: center; box-shadow: 0 8px 20px rgba(22,33,28,0.09);
}
.td-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.td-ph-cap {
  position: absolute; left: 4px; right: 4px; bottom: 5px; font-size: 9.5px; text-align: center;
  background: rgba(22,33,28,0.72); color: #FBFAF6; padding: 2px 6px; border-radius: 999px;
}
.td-ph-seal { text-align: center; padding: 10px; color: var(--brass); }
.td-ph-seal svg { width: 56px; height: 56px; display: block; margin: 0 auto 4px; }
.td-ph-seal small { font: 600 10px/1 var(--mono); color: var(--muted); }
.td-title { flex: 1; min-width: 0; }
.td-title h2 { font: 400 2rem/1.02 var(--serif); letter-spacing: -0.015em; }
.td-sci { font: italic 15px/1.3 'Instrument Serif', serif; color: var(--ink-2); margin-top: 3px; }
.td-loc { font-size: 13px; color: var(--muted); margin-top: 4px; }
.td-pills { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.td-pill { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font: 600 11.5px/1.2 var(--sans); background: var(--warm); color: var(--ink-2); }
.td-pill.good { background: var(--good-soft); color: var(--good); }
.td-pill.warn { background: var(--warn-soft); color: var(--warn-ink); }
.td-pill.bad { background: var(--bad-soft); color: var(--bad-ink); }
.td-pill.water { background: var(--water-soft); color: var(--water); }
.td-pill.brass { background: var(--brass-soft); color: var(--brass); }

.td-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.td-btn {
  flex: 1 1 auto; min-height: 38px; padding: 0 13px; border-radius: 999px; background: var(--white);
  border: 1px solid var(--line-s); font: 600 12.8px/1 var(--sans); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
}
.td-btn:hover { border-color: var(--leaf); color: var(--leaf); }
.td-btn.accent { background: var(--leaf); border-color: var(--leaf); color: #FFFFFF; }
.td-btn.accent:hover { background: var(--leaf-h); color: #FFFFFF; }

.td-ded-card {
  padding: 13px 15px; border-radius: 16px; background: linear-gradient(145deg, var(--brass-soft), var(--white));
  border: 1px solid rgba(151,115,58,0.38); display: flex; gap: 12px; align-items: center;
}
.td-ded-seal { width: 46px; height: 46px; color: var(--brass); flex: none; }
.td-ded-card small { display: block; font-size: 11px; font-weight: 650; text-transform: uppercase; color: var(--brass); }
.td-ded-card b { display: block; font: 400 1.35rem/1.1 var(--serif); }
.td-ded-card p { font-size: 12.5px; color: var(--ink-2); font-style: italic; margin-top: 2px; }

.td-section { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.td-sec-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.td-sec-hd h3 { font: 400 1.32rem/1.1 var(--serif); }
.td-sec-hd small { font-size: 12px; color: var(--muted); font-weight: 550; }
.td-health-box { display: flex; gap: 14px; align-items: center; }
.td-ring { flex: none; }
.td-signs { list-style: none; display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.td-signs li { display: flex; align-items: flex-start; gap: 7px; font-size: 12.8px; color: var(--ink-2); line-height: 1.35; }
.td-signs li i { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; flex: none; }
.td-signs li.good i { background: var(--good); }
.td-signs li.warn i { background: var(--warn); }
.td-signs li.bad i { background: var(--bad); }

.td-chart { padding: 8px 6px 4px; background: var(--surface); border-radius: 13px; border: 1px solid var(--line); }
.td-solar-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 9px; font-size: 12.5px; color: var(--ink-2); }
.td-botanic { font-size: 13px; color: var(--ink-2); background: var(--surface); padding: 9px 11px; border-radius: 11px; margin-bottom: 10px; line-height: 1.45; }
.td-botanic b { color: var(--leaf); }
.td-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.td-grid div { padding: 8px 10px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); }
.td-grid small { display: block; font-size: 10.5px; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.td-grid b { display: block; font-size: 13.2px; font-weight: 600; margin-top: 2px; }
.td-grid b.mono { font-family: var(--mono); font-size: 12px; }
.td-note { margin-top: 10px; padding: 9px 11px; border-radius: 11px; background: var(--warn-soft); font-size: 12.8px; color: var(--ink-2); }

.td-timeline { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.td-timeline li { display: flex; gap: 10px; align-items: flex-start; }
.td-timeline .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--leaf); }
.td-timeline .dot.water { background: var(--water); }
.td-timeline .dot.warn { background: var(--warn); }
.td-timeline .dot.bad { background: var(--bad); }
.td-timeline b { display: block; font-size: 13px; font-weight: 600; }
.td-timeline small { display: block; font-size: 12px; color: var(--muted); }

.td-seal-foot { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.td-seal-ico { width: 46px; height: 46px; color: var(--brass); flex: none; }
.td-seal-foot b { display: block; font-size: 13px; }
.td-seal-foot small { display: block; font-size: 11.5px; color: var(--muted); }

/* Tags, Tableaux, Listes, Barres & Modales */
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font: 600 11.5px/1.2 var(--sans); background: var(--warm); color: var(--ink-2); }
.tag.good { background: var(--good-soft); color: var(--good); }
.tag.warn { background: var(--warn-soft); color: var(--warn-ink); }
.tag.bad { background: var(--bad-soft); color: var(--bad-ink); }
.tag.water { background: var(--water-soft); color: var(--water); }
.tag.brass { background: var(--brass-soft); color: var(--brass); }
.tag.mono { font-family: var(--mono); }

.empty-box { padding: 28px 20px; border-radius: 16px; background: var(--surface); border: 1px dashed var(--line-s); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-box b { font: 600 15.5px/1.3 var(--sans); color: var(--ink); }
.empty-box p { font-size: 13.5px; color: var(--muted); max-width: 440px; }
.empty-acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }

.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.search-in { height: 36px; min-width: 240px; padding: 0 14px; border-radius: 999px; background: var(--white); border: 1px solid var(--line-s); font-size: 13.5px; outline: none; }
.search-in:focus { border-color: var(--leaf); }

.tbl-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; background: var(--white); }
.tbl th { text-align: left; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: var(--surface); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: var(--surface); }
.row-acts { display: flex; gap: 5px; justify-content: flex-end; flex-wrap: nowrap; }

.list-stack { list-style: none; display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-row .lr-main { min-width: 0; flex: 1; }
.list-row .lr-main b { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.list-row .lr-main small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.lr-thumb { width: 46px; height: 46px; border-radius: 10px; overflow: hidden; flex: none; background: var(--warm); border: 1px solid var(--line); display: grid; place-items: center; font: 600 11px/1 var(--mono); color: var(--muted); cursor: pointer; }
.lr-thumb img { width: 100%; height: 100%; object-fit: cover; }

.bar-row { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(90px, 140px) 46px; gap: 10px; align-items: center; padding: 6px 0; font-size: 13px; }
.bar { position: relative; height: 7px; border-radius: 999px; background: var(--warm); overflow: visible; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--leaf); display: block; }
.bar i.over { background: var(--bad); }
.bar i.warn { background: var(--warn); }
.bar i.good { background: var(--good); }
.bar .mark { position: absolute; top: -3px; bottom: -3px; width: 0; border-left: 1.5px dashed var(--ink); }
.bar-row .v { text-align: right; font: 600 12.5px/1 var(--mono); color: var(--ink-2); }

.stack-bar { display: flex; height: 11px; border-radius: 999px; overflow: hidden; gap: 2px; margin: 10px 0; }
.stack-bar i { display: block; }
.stack-leg { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; color: var(--ink-2); }
.stack-leg span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }

.note-box { margin-top: 12px; padding: 11px 14px; border-radius: 13px; font-size: 12.8px; line-height: 1.48; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.note-box.water { background: var(--water-soft); border-color: rgba(29,111,138,0.25); }
.note-box.brass { background: var(--brass-soft); border-color: rgba(151,115,58,0.28); }
.note-box.bad { background: var(--bad-soft); border-color: rgba(176,71,58,0.28); color: var(--bad-ink); }
.note-box b { color: var(--ink); font-weight: 600; }

.chart-box { padding: 14px; border-radius: 15px; background: var(--surface); border: 1px solid var(--line); margin-top: 12px; }
.chart-box svg { width: 100%; height: auto; display: block; }

.sec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(195px, 1fr)); gap: 10px; }
.sec-tile { padding: 11px 12px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); }
.sec-tile.done { border-color: rgba(47,122,85,0.4); background: var(--good-soft); }
.sec-tile b { display: block; font-size: 13px; font-weight: 600; }
.sec-tile small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.sec-tile .st-num { font: 600 12px/1 var(--mono); color: var(--leaf); margin-top: 6px; display: block; }

.ded-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.ded-card {
  background: var(--white); border: 1px solid rgba(151,115,58,0.34); border-radius: 20px; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.ded-card-top { display: flex; gap: 12px; align-items: center; }
.ded-card-seal { width: 46px; height: 46px; color: var(--brass); flex: none; }
.ded-card h3 { font: 400 1.45rem/1.08 var(--serif); }

.modal-scrim { position: fixed; inset: 0; z-index: 85; background: rgba(16,24,20,0.46); display: grid; place-items: center; padding: 18px; }
.modal-card { width: 100%; max-width: 480px; background: var(--paper); border-radius: 22px; padding: 20px 22px; box-shadow: 0 20px 60px rgba(0,0,0,0.24); border: 1px solid var(--line); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.modal-head h3 { font: 400 1.55rem/1.1 var(--serif); }
.icon-x { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); }
.modal-sub { font-size: 13px; color: var(--muted); margin-top: 6px; }
.modal-form { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.modal-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.modal-form select, .modal-form textarea, .modal-form input[type="text"] { padding: 10px 12px; border-radius: 12px; background: var(--white); border: 1px solid var(--line-s); font-weight: 400; color: var(--ink); }
.modal-form .chk-row { flex-direction: row; align-items: center; gap: 9px; font-weight: 500; cursor: pointer; }
.modal-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

.photo-modal-card { max-width: min(92vw, 760px); background: var(--paper); border-radius: 20px; overflow: hidden; box-shadow: 0 24px 64px rgba(0,0,0,0.35); }
.photo-modal-card img { display: block; max-width: 100%; max-height: 75vh; object-fit: contain; background: #111; margin: 0 auto; }
.photo-modal-bar { padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 24px); z-index: 95;
  background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: 999px;
  font-size: 13.5px; font-weight: 500; opacity: 0; pointer-events: none; transition: all 0.22s;
  box-shadow: 0 10px 30px rgba(0,0,0,0.22); max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1160px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-grid, .two-col { grid-template-columns: 1fr; }
  .hide-md { display: none !important; }
  .m-top { padding: 0 16px; gap: 10px; }
  #liveSyncTxt { display: none; }
  .live-pill { width: 26px; height: 26px; padding: 0; justify-content: center; flex: none; }
}
@media (max-width: 880px) {
  .m-top { padding: 0 12px; gap: 8px; }
  .brand-link .sub { max-width: 155px; font-size: 11px; }
  .m-top-acts { gap: 6px; flex: none; }
  .pill-btn { height: 34px; padding: 0 11px; font-size: 12.5px; }
  .m-nav {
    top: auto; left: 0; right: 0; bottom: 0; width: 100%;
    height: calc(68px + env(safe-area-inset-bottom));
    background: rgba(251,250,246,0.96);
    -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-right: 0; border-top: 1px solid var(--line);
    padding: 5px 6px env(safe-area-inset-bottom);
    flex-direction: row; align-items: stretch; overflow: hidden;
    box-shadow: 0 -6px 24px rgba(22,33,28,0.06);
  }
  .nav-foot { display: none; }
  .nav-list { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); width: 100%; gap: 3px; align-items: stretch; }
  .nav-item {
    flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    padding: 6px 2px 5px; min-height: 54px; position: relative; border-radius: 13px;
    text-align: center; color: var(--ink-2);
  }
  .nav-item svg.ico { width: 19px; height: 19px; flex: none; }
  .nav-item span.nav-lbl { display: none; }
  .nav-item span.nav-lbl-sm {
    display: block; flex: none; font: 600 10.5px/1.1 var(--sans); letter-spacing: -0.01em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  }
  .nav-item.active { background: var(--ink); color: var(--paper); box-shadow: 0 4px 14px rgba(22,33,28,0.18); }
  .nav-badge { position: absolute; top: 3px; right: 5px; padding: 2px 5px; font-size: 9px; line-height: 1; min-width: 16px; text-align: center; }
  .m-main { margin-left: 0; padding: 16px 14px calc(92px + env(safe-area-inset-bottom)); }
  .m-top-mid, .hide-sm { display: none !important; }
  .map-box { height: 430px; }
  .map-search-float { flex: 1 1 220px; max-width: none; }
  .map-legend { right: 52px; font-size: 11px; padding: 6px 11px; }
}
@media (max-width: 600px) {
  .brand-link .sub { display: none; }
  .brand-link b { font-size: 1.38rem; }
  .act-full { display: none; }
  .act-sm { display: inline; }
  .pill-btn { height: 32px; padding: 0 9px; font-size: 12px; gap: 4px; }
  .pill-btn svg.ico { width: 14px; height: 14px; }
  .nav-item span.nav-lbl-sm { font-size: 9.8px; }
  .map-seg { overflow-x: auto; max-width: calc(100vw - 88px); }
  .mseg-btn { padding: 0 9px; font-size: 11.5px; }
}
