/* ------------------------------------------------------------------ base */

:root {
  --red: #e60000;
  --red-dark: #a30000;
  --red-soft: #fdeceb;
  --ink: #16181d;
  --ink-2: #3d434d;
  --muted: #737b87;
  --line: #e3e6eb;
  --soft: #f6f7f9;
  --ok: #1f7a2e;
  --ok-soft: #e9f5ea;
  --radius: 14px;
  --font: "VodafoneRegular", -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100%;
  background: #f4f6f7;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 20px 72px;
  display: grid;
  gap: 30px;
  align-items: start;
}

@media (min-width: 1000px) {
  .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 44px; }
  .stage { position: sticky; top: 28px; }
}

/* -------------------------------------------------------------- sélecteur */

.picker { position: relative; z-index: 20; }

.field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
.field:focus-within {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(230, 0, 0, .12);
}
.field .ico {
  width: 18px; height: 18px; flex: none;
  fill: none; stroke: var(--muted); stroke-width: 2;
  stroke-linecap: round;
}
.field input {
  flex: 1;
  min-width: 0;
  padding: 14px 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  outline: 0;
}
.field input::placeholder { color: var(--muted); }
.field input::selection { background: rgba(230, 0, 0, .18); }

.clear {
  flex: none;
  width: 26px; height: 26px;
  border: 0; border-radius: 50%;
  background: var(--soft);
  color: var(--ink-2);
  font-size: 17px; line-height: 1;
  cursor: pointer;
}
.clear:hover { background: var(--red); color: #fff; }

.list {
  position: absolute;
  inset: calc(100% + 8px) 0 auto 0;
  max-height: 330px;
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(20, 30, 50, .14);
}
.list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
}
.list li[aria-selected="true"],
.list li:hover { background: var(--red-soft); }
.list li .ind {
  margin-left: auto;
  color: var(--muted);
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}
.list li .tag {
  color: var(--ok);
  background: var(--ok-soft);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.list li .tag.home { color: var(--red-dark); background: var(--red-soft); }
.list .none { padding: 14px 12px; color: var(--muted); cursor: default; }

/* ------------------------------------------------------------------ globe */

.viewer {
  position: relative;
  margin-top: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 260px;
  touch-action: none;
}
.viewer::before {
  content: "";
  position: absolute;
  inset: 6%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(38, 88, 170, .16) 46%, rgba(38, 88, 170, .05) 62%, transparent 72%);
  filter: blur(14px);
  pointer-events: none;
}
.viewer.is-map::before { opacity: 0; }

#scene {
  position: relative;
  display: block;
  max-width: 100%;
  border-radius: 50%;
  box-shadow: 0 20px 44px rgba(16, 32, 64, .22);
  cursor: grab;
}
#scene.grabbing { cursor: grabbing; }
.viewer.is-map #scene {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: none;
}

.tools {
  position: absolute;
  top: 0; right: 0;
  z-index: 5;
  display: flex;
  gap: 6px;
}
.tool {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-2);
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
}
.tool:hover { border-color: var(--red); color: var(--red); }

.tip {
  position: absolute;
  z-index: 6;
  margin: 0;
  padding: 7px 12px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(16, 32, 64, .16);
  color: var(--muted);
  font-size: .84rem;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -145%);
}
.tip b { color: var(--red); font-weight: 600; }

.loader,
.fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  font-size: .88rem;
  text-align: center;
}
.ring {
  width: 34px; height: 34px;
  border: 2px solid var(--line);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hint {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: .82rem;
  text-align: center;
}

/* --------------------------------------------------------------- résultats */

.results { display: grid; gap: 18px; }

.empty {
  margin: 0;
  padding: 32px 22px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.card {
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card > h3 {
  margin: 0 0 4px;
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--ink);
}
.card > h3 .c { color: var(--red); }
.card > .sub {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: .82rem;
}

.rows {
  margin: 0;
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 15px;
  background: #fff;
}
.row dt { color: var(--ink-2); font-size: .88rem; }
.row dd {
  margin: 0;
  color: var(--red);
  font-size: 1.14rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.row dd u {
  color: var(--muted);
  font-size: .74rem;
  font-weight: 400;
  text-decoration: none;
  margin-left: 4px;
}

.tiers { display: grid; gap: 1px; background: var(--line); }
.tiers .t {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 15px 10px 28px;
  background: var(--soft);
  font-size: .87rem;
}
.tiers .t span:first-child { color: var(--muted); }
.tiers .t span:last-child { color: var(--red); font-weight: 700; font-variant-numeric: tabular-nums; }

.badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
}
.badge.yes { background: var(--ok-soft); color: var(--ok); }
.badge.no { background: var(--red-soft); color: var(--red-dark); }

.note { margin: 14px 0 0; color: var(--muted); font-size: .76rem; }

@media (max-width: 460px) {
  .row { flex-direction: column; gap: 3px; }
  .row dd { font-size: 1.26rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ring { animation: none; }
}
