:root {
  color-scheme: light;
  --ink: #1c1915;
  --muted: #6f675c;
  --paper: #efeae2;
  --surface: #f7f4ee;
  --card: #fffcf8;
  --line: #e4ddd2;
  --line-strong: #d2c8b8;
  --accent: #1f4a45;
  --accent-ink: #f6f1e8;
  --accent-soft: #e4eeeb;
  --warn: #8a5a12;
  --warn-soft: #f8efd8;
  --danger: #8d2e24;
  --ok: #1d6b45;
  --shadow: 0 1px 0 rgba(48, 36, 18, 0.04), 0 16px 40px rgba(62, 48, 28, 0.07);
  --font: "Outfit", "Segoe UI Variable", "Segoe UI", sans-serif;
  --top: 60px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 15px/1.45 var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 280px at 0% -10%, rgba(31, 74, 69, 0.08), transparent 60%),
    var(--paper);
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #163833; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip {
  position: absolute; left: 12px; top: -40px; z-index: 5;
  background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px;
}
.skip:focus { top: 8px; }

.top {
  height: var(--top);
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 18px;
  background: rgba(255, 252, 248, 0.92);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 600; letter-spacing: -0.02em; }
.mark { width: 16px; height: 16px; border-radius: 99px; background: var(--accent); box-shadow: 0 7px 0 -5px var(--accent); }
.top nav { display: flex; gap: 4px; }
.top nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 7px 11px;
  border-radius: 999px;
  font-weight: 500;
}
.top nav a:hover { background: rgba(28, 25, 21, 0.05); color: var(--ink); }
.top nav a.on { background: var(--accent); color: var(--accent-ink); }
.who { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.who b { font-weight: 600; }
.who span { color: var(--muted); font-size: 0.78rem; }
.top form { margin: 0; }

button, .btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  border-radius: 9px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 160ms ease, border-color 160ms ease, transform 80ms ease;
}
button:hover, .btn:hover { background: #f3eee6; }
button:active, .btn:active { transform: translateY(1px); }
button.primary, .btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
button.primary:hover, .btn.primary:hover { background: #183e3a; color: var(--accent-ink); }
button.ghost, .btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.ghost:hover { background: rgba(28, 25, 21, 0.05); color: var(--ink); }
button.danger { color: var(--danger); background: transparent; }
button.danger:hover { background: #f8ece9; }

input, select, textarea {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 8px 10px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
label { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: 0.78rem; font-weight: 500; }
label input, label select, label textarea { color: var(--ink); font-size: 0.95rem; font-weight: 400; }

.page-head, .kicker, .error, .resume-row { margin: 22px 28px 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.page-head h1, .panel h2, .login-aside h1 { font-weight: 600; letter-spacing: -0.03em; text-wrap: balance; }
.page-head h1 { margin: 0; font-size: 2rem; line-height: 1.05; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.lede { max-width: 62ch; margin: 8px 0 0; color: var(--muted); }
.error { color: var(--danger); }

.stats { display: grid; grid-template-columns: 280px 1fr; gap: 14px; padding: 18px 28px 0; }
.stat, .panel {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.stat.featured { padding: 20px 22px 18px; display: flex; flex-direction: column; justify-content: space-between; background: var(--accent); color: var(--accent-ink); }
.stat.featured span, .stat.featured a { color: rgba(246, 241, 232, 0.78); }
.stat.featured strong { font-size: 4rem; line-height: 0.9; letter-spacing: -0.05em; font-weight: 600; margin: 14px 0; }
.stat.featured a { font-weight: 600; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-grid a {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 16px; background: var(--card); border-radius: 14px;
  color: inherit; text-decoration: none; box-shadow: var(--shadow);
}
.stat-grid a:hover { background: #fff; }
.stat-grid strong { font-size: 1.7rem; letter-spacing: -0.04em; font-weight: 600; }
.stat-grid span { color: var(--muted); font-size: 0.86rem; }

.split { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 14px; padding: 14px 28px 32px; }
.panel { padding: 8px 8px 16px; }
.panel h2 { margin: 12px 12px 8px; font-size: 1.05rem; }
table { border-collapse: collapse; width: 100%; }
th { color: var(--muted); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; }
td, th { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.panel-table { overflow-x: auto; }
.counts { font-size: 0.84rem; }
.counts th, .counts td { padding: 8px 10px; white-space: nowrap; }
.counts th:not(:first-child), .counts td:not(:first-child) { text-align: right; }
.counts a { color: inherit; text-decoration: none; }
.counts a:hover { color: var(--accent); }
.counts tfoot td { font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(31, 74, 69, 0.04); }
.people { list-style: none; margin: 0; padding: 0 8px; }
.people li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 8px; border-bottom: 1px solid var(--line); }
.days { display: flex; flex-direction: column; gap: 7px; padding: 0 12px; }
.day { display: grid; grid-template-columns: 92px 1fr 28px; gap: 8px; align-items: center; color: var(--muted); font-size: 0.86rem; }
.day i { display: block; height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; }
.day i span { display: block; height: 100%; width: var(--w); background: var(--accent); border-radius: inherit; }
.empty { color: var(--muted); padding: 0 16px; }

.workspace {
  height: calc(100dvh - var(--top));
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 10px var(--map-width, 34%);
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}
.dossier { grid-column: 1; grid-row: 1 / span 2; }
.place-cue { grid-column: 2 / -1; grid-row: 1; }
.street { grid-column: 2; grid-row: 2; }
.split-handle { grid-column: 3; grid-row: 2; }
.map-pane { grid-column: 4; grid-row: 2; }
.dossier, .street, .map-pane { min-width: 0; min-height: 0; background: var(--surface); }
.dossier {
  display: grid;
  grid-template-rows: auto minmax(150px, 34%) minmax(0, 1fr);
  border-right: 1px solid var(--line);
  background: var(--card);
}
.filters { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.queue { overflow: auto; }
.queue a {
  display: block;
  padding: 9px 12px 9px 14px;
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
}
.queue a:hover { background: rgba(31, 74, 69, 0.04); }
.queue a.on { background: var(--accent-soft); border-left-color: var(--accent); }
.queue b { font-weight: 600; letter-spacing: -0.02em; }
.busy {
  float: right;
  width: 16px;
  height: 16px;
  margin: 2px 0 0 8px;
  color: var(--warn);
}
.busy svg { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.busy circle { fill: currentColor; stroke: none; }
.queue small { display: block; color: var(--muted); margin-top: 2px; }
.sheet { overflow: auto; padding: 16px 16px 28px; }
.sheet h1 { margin: 0; font-size: 1.7rem; letter-spacing: -0.04em; font-weight: 600; }
.place-kind { margin: 8px 0 0; color: var(--muted); font-size: 0.86rem; }
.place-kind b {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.place-cue {
  display: flex;
  align-items: baseline;
  gap: 10px 14px;
  flex-wrap: wrap;
  margin: 0;
  padding: 8px 14px;
  background: var(--accent);
  color: var(--accent-ink);
}
.place-cue b {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(246, 241, 232, 0.16);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.place-cue span { font-weight: 600; }
.place-cue small { color: rgba(246, 241, 232, 0.82); }
.place-cue em {
  margin-left: auto;
  font-style: normal;
  font-size: 0.78rem;
  color: rgba(246, 241, 232, 0.88);
}
.status { display: inline-flex; margin: 8px 0 12px; padding: 3px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 0.78rem; font-weight: 600; }
.status-valide { background: #e5f4eb; color: var(--ok); }
.status-impossible, .status-a_revoir { background: #f8ece9; color: var(--danger); }
.status-en_attente { background: var(--accent-soft); color: var(--accent); }
.sheet h2 { margin: 18px 0 8px; font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.sheet dt { color: var(--muted); font-size: 0.75rem; margin-top: 8px; }
.sheet dd { margin: 1px 0 0; }
.sheet p { margin: 0 0 8px; }
.lock { background: var(--warn-soft); color: var(--warn); padding: 8px 10px; border-radius: 10px; }
.ref { padding: 8px 0; border-bottom: 1px solid var(--line); }
.ref b { font-weight: 600; }
#comment-form { display: flex; flex-direction: column; gap: 8px; }

.street, .map-pane { display: flex; flex-direction: column; }
.street-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  min-height: 46px; padding: 6px 12px;
  background: rgba(255, 252, 248, 0.94);
  border-bottom: 1px solid var(--line);
}
.street-bar span { color: var(--muted); font-size: 0.86rem; }
#pano, #map { flex: 1; min-height: 0; background: #d7e0da; }
#pano { position: relative; }
#pano-date {
  position: absolute;
  z-index: 3;
  top: 12px;
  left: 12px;
  max-width: calc(100% - 24px);
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 252, 248, 0.94);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow);
}
#pano-date[hidden] { display: none; }
#pano:not(:has(.gm-style)) { display: flex; align-items: center; justify-content: center; }
#pano-state { max-width: 42ch; margin: 24px; text-align: center; color: var(--muted); }
.map-pane { background: var(--paper); }
.map-resize {
  flex: none;
  height: 10px;
  cursor: row-resize;
  touch-action: none;
  position: relative;
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.map-resize::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 3px;
  margin: -1.5px 0 0 -18px;
  border-radius: 99px;
  background: var(--line-strong);
}
.map-resize:hover, .map-resize.is-drag { background: var(--accent-soft); }
.map-resize + .proposal { border-top: 0; }
.map-pane.is-sized #map { flex: none; height: var(--map-height, 280px); }
.map-pane.is-sized .proposal { flex: 1 1 auto; max-height: none; min-height: 0; }
.map-pane.is-sized .proposal .fields { flex: 1 1 auto; min-height: 0; }
body.map-dragging { user-select: none; cursor: row-resize; }
.proposal {
  display: flex;
  flex-direction: column;
  max-height: 68%;
  overflow: hidden;
  background: var(--card);
  border-top: 1px solid var(--line);
}
.fields {
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  padding: 12px;
}
.fields .wide, .fields #candidates, .fields #form-note { grid-column: 1 / -1; }
.nature-block { display: flex; flex-direction: column; gap: 8px; }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-size: 0.92rem; }
label.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.fields > .ghost { justify-self: start; }
.camera {
  margin: 2px 0 0;
  padding: 10px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.camera legend { padding: 0 6px; font-weight: 600; color: var(--ink); }
.camera .hint { margin: 0 0 8px; color: var(--muted); font-size: 0.84rem; }
.camera label { margin-top: 8px; }
#compass-wrap[hidden] { display: none; }
.compass-layout { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.compass {
  position: relative;
  width: 188px;
  height: 188px;
  flex: 0 0 188px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  touch-action: none;
  cursor: crosshair;
}
.compass svg { width: 100%; height: 100%; display: block; }
.compass .tick {
  position: absolute;
  font-size: 12px;
  font-weight: 650;
  color: var(--accent);
  pointer-events: none;
}
.compass .tick.n { top: 8px; left: 50%; transform: translateX(-50%); }
.compass .tick.e { right: 8px; top: 50%; transform: translateY(-50%); }
.compass .tick.s { bottom: 8px; left: 50%; transform: translateX(-50%); }
.compass .tick.o { left: 8px; top: 50%; transform: translateY(-50%); }
.compass-tools { display: flex; flex-direction: column; gap: 8px; min-width: 148px; }
.compass-read { margin: 0; font-size: 1.35rem; font-weight: 600; letter-spacing: -0.03em; color: var(--ink); }
.compass-cardinals { display: flex; gap: 6px; }
.compass-cardinals button { min-width: 36px; padding: 6px 0; }
.cam {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 4px;
  vertical-align: -2px;
  position: relative;
  color: var(--accent);
}
.cam-unknown { font-size: 12px; font-weight: 650; line-height: 14px; text-align: center; }
.cam-unknown::before { content: "?"; }
.cam-omni { box-shadow: inset 0 0 0 1.5px currentColor; border-radius: 50%; }
.cam-pieuvre {
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px currentColor;
  background:
    radial-gradient(circle at 50% 22%, currentColor 1.15px, transparent 1.35px),
    radial-gradient(circle at 78% 50%, currentColor 1.15px, transparent 1.35px),
    radial-gradient(circle at 50% 78%, currentColor 1.15px, transparent 1.35px),
    radial-gradient(circle at 22% 50%, currentColor 1.15px, transparent 1.35px);
}
.cam-pivotante {
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px currentColor;
  background: radial-gradient(circle at 50% 30%, currentColor 2px, transparent 2.2px);
}
.cam-directional::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 1px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 11px solid currentColor;
  transform: rotate(var(--aim, 35deg));
  transform-origin: 50% 78%;
}
.actions, .review { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 12px 10px; }
.actions { flex-direction: column; align-items: stretch; border-top: 1px solid var(--line); }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.review { flex-direction: column; align-items: stretch; border-top: 1px solid var(--line); background: var(--surface); }
.review input { width: 100%; }
.verdict { margin: 0; font-weight: 600; }
.verdict-valider { color: var(--ok); }
.verdict-rejeter { color: var(--danger); }
.verdict-renvoyer { color: var(--warn); }
button.danger.chosen { background: var(--danger); color: var(--accent-ink); border-color: transparent; }
button.warn.chosen { background: var(--warn); color: #fff; border-color: transparent; }
#impossible { margin-left: auto; }
#form-note { margin: 0; color: var(--muted); min-height: 0; }
#form-note.error { color: var(--danger); }
#form-note:empty { display: none; }
#candidates { display: flex; flex-direction: column; gap: 6px; }
.candidate { text-align: left; justify-content: flex-start; }
.candidate.warn { border-color: #e2c089; background: var(--warn-soft); }
.split-handle { cursor: col-resize; background: linear-gradient(var(--paper), var(--paper)) padding-box, var(--line); }
.split-handle:hover { background: var(--accent-soft); }
.leaflet-container { font: inherit; }
.pegman-icon { background: none !important; border: 0 !important; }
.pegman { position: relative; width: 36px; height: 36px; cursor: grab; }
.pegman-view {
  position: absolute;
  left: 9px;
  top: 2px;
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 16px solid rgba(224, 122, 47, 0.7);
  transform-origin: 9px 16px;
  transform: rotate(var(--head, 0deg));
}
.pegman-body {
  position: absolute;
  left: 9px;
  top: 9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e07a2f;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(40, 24, 8, 0.35);
}
.leaflet-bar { border: 0 !important; box-shadow: var(--shadow) !important; }
.leaflet-bar a { border-bottom-color: var(--line) !important; color: var(--ink) !important; }

.desk { display: grid; grid-template-columns: 340px 1fr; gap: 16px; padding: 22px 28px 36px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 16px; }
.export-list { display: grid; grid-template-columns: repeat(2, minmax(0, 420px)); gap: 12px; padding: 22px 28px 36px; }
.export-list a {
  display: block; padding: 16px 18px; background: var(--card); border-radius: 14px;
  box-shadow: var(--shadow); color: var(--ink); text-decoration: none; font-weight: 600;
}
.export-list a:hover { background: #fff; }
.export-list a span { display: block; margin-top: 4px; color: var(--muted); font-weight: 400; }
.note { color: var(--muted); padding: 0 28px 28px; max-width: 68ch; }

.login-body {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background:
    radial-gradient(700px 320px at 15% 0%, rgba(31, 74, 69, 0.16), transparent 60%),
    var(--paper);
}
.login-shell {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  background: var(--card);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.login-aside { padding: 42px 36px; background: var(--accent); color: var(--accent-ink); }
.login-aside .eyebrow { color: #d7ebe6; }
.login-aside h1 { margin: 0; font-size: 2.6rem; line-height: 1.02; letter-spacing: -0.045em; font-weight: 600; }
.login-aside p:last-child { margin: 16px 0 0; max-width: 34ch; color: rgba(246, 241, 232, 0.82); }
.login { display: flex; flex-direction: column; gap: 12px; padding: 36px 28px; justify-content: center; }
.login h2 { margin: 0 0 4px; font-size: 1.3rem; letter-spacing: -0.03em; }
.login button { margin-top: 6px; }

@media (max-width: 1100px) {
  .stats, .split, .desk, .login-shell { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .workspace { grid-template-columns: 1fr; grid-template-rows: none; height: auto; }
  .dossier, .place-cue, .street, .split-handle, .map-pane { grid-column: auto; grid-row: auto; }
  .dossier { grid-template-rows: auto 240px auto; }
  #pano, #map { height: 420px; flex: none; }
  .page-head { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
