:root{
  --bg: #f6f7f8;
  --panel: #ffffff;
  --text: #0b1220;
  --muted: #586174;
  --border: rgba(12, 20, 34, 0.10);
  --shadow: 0 10px 28px rgba(12, 20, 34, 0.08);

  --accent: #0b7a78;          /* teal / pétrole */
  --accent-2: #0a5f5d;
  --accent-soft: rgba(11, 122, 120, 0.12);

  --ok: #137a47;
  --warn: #8a5a00;
  --err: #9c1a1a;

  --radius: 18px;
  --radius-sm: 12px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

html[data-theme="dark"]{
  --bg: #0b0f14;
  --panel: #0f1722;
  --text: #e7edf6;
  --muted: #9aa7bc;
  --border: rgba(231, 237, 246, 0.10);
  --shadow: 0 18px 40px rgba(0,0,0,0.35);
  --accent-soft: rgba(37, 181, 178, 0.16);
}

*{ box-sizing: border-box; }
body{
  margin:0;
  font-family: var(--sans);
  background: radial-gradient(1200px 600px at 15% 0%, rgba(11,122,120,0.08), transparent 55%),
              radial-gradient(900px 500px at 85% 10%, rgba(11,122,120,0.06), transparent 60%),
              var(--bg);
  color: var(--text);
}

.app{ min-height: 100vh; display:flex; flex-direction:column; }
.main{ width:min(1160px, calc(100% - 32px)); margin: 18px auto 28px; flex:1; }

.topbar{
  width:min(1160px, calc(100% - 32px));
  margin: 18px auto 0;
  display:flex; align-items:center; justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.brand{ display:flex; align-items:center; gap:12px; flex: 1 1 220px; }
.brand__mark{
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  display: block;
  overflow: hidden;
  line-height: 0;
}
.brand__mark--link{
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.brand__mark--link:hover{ transform: scale(1.03); opacity: 0.92; }
.brand__logo{
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.brand__title{ font-weight: 700; letter-spacing: -0.02em; font-size: 15px; }
.brand__subtitle{ color: var(--muted); font-size: 12.5px; margin-top:2px; }

.pageNav{
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.55);
}
html[data-theme="dark"] .pageNav{ background: rgba(15,23,34,0.55); }
.pageNav__link{
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.pageNav__link:hover{ color: var(--text); background: var(--accent-soft); }
.pageNav__link--active{
  background: var(--accent);
  color: #fff;
}

.topbar__actions{ display:flex; gap:10px; align-items:center; }
.btn{
  display:inline-flex; align-items:center; gap:8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  text-decoration:none;
  cursor:pointer;
  box-shadow: none;
  font: inherit;
  transition: transform .06s ease, background .18s ease, border-color .18s ease;
}
.btn:hover{ transform: translateY(-1px); border-color: rgba(11,122,120,0.35); }
.btn:active{ transform: translateY(0px); }
.btn--primary{
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: rgba(11,122,120,0.25);
}
.btn--ghost{ background: transparent; }
.btn__icon{ font-family: var(--mono); opacity: 0.85; font-size: 14px; }
.btn__label{ font-weight: 600; font-size: 13px; }

.card{
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
html[data-theme="dark"] .card{ background: rgba(15,23,34,0.82); }

.card__head{
  padding: 16px 16px 10px;
  display:flex; align-items:flex-start; justify-content:space-between; gap:12px;
}
.card__eyebrow{ color: var(--muted); font-size: 12px; }
.card__title{ font-weight: 700; letter-spacing: -0.03em; font-size: 16px; margin-top: 2px; }
.card__body{ padding: 0 16px 16px; }

.heroHead{ margin-top: 14px; }
.hero__title{
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin: 0 0 12px;
}
.metaGrid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.metaGrid--compact{
  grid-template-columns: minmax(0, 1fr);
  max-width: 420px;
}
.metaGrid__item{
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.72);
}
html[data-theme="dark"] .metaGrid__item{ background: rgba(15,23,34,0.72); }
.metaGrid__k{
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.metaGrid__v{
  display: block;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
  word-break: break-word;
}

.heroPanel{
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 16px;
  margin-top: 14px;
  align-items: stretch;
}
.mapCard{ overflow: hidden; min-width: 0; }
.mapCard__frame{
  padding: 12px;
}
.heroMap{
  width: 100%;
  height: 220px;
  min-height: 220px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(0,0,0,0.04);
  z-index: 0;
}
.leaflet-div-icon.map-marker-sun{
  background: transparent;
  border: none;
}
.map-marker-sun__disc{
  display: block;
  width: 22px;
  height: 22px;
  margin: 3px auto 0;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fffde7 0%, #ffeb3b 42%, #ffc107 78%, #ff9800 100%);
  border: 2.5px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.heroMap .leaflet-control-attribution{
  font-size: 10px;
}

.badge{
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 12.5px;
  white-space:nowrap;
}

.kpis{ display:grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.kpi{
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.55);
}
html[data-theme="dark"] .kpi{ background: rgba(15,23,34,0.55); }
.kpi__label{ color: var(--muted); font-size: 12px; }
.kpi__value{ font-weight: 800; font-size: 18px; letter-spacing:-0.02em; margin-top: 3px; }

.best__actions{ display:flex; align-items:center; justify-content:space-between; gap: 12px; margin-top: 12px; }
.muted{ color: var(--muted); font-size: 12.5px; }

.controls{ margin-top: 16px; padding: 16px; }
.controls__row{ display:flex; gap:12px; align-items:flex-end; flex-wrap:wrap; }
.controls__row--slider{ margin-top: 14px; }
.field{ min-width: 180px; }
.field--grow{ flex:1; min-width: 260px; }
.label{ display:block; color: var(--muted); font-size: 12px; margin: 0 0 6px; }
.labelRow{ display:flex; align-items:center; justify-content:space-between; gap: 10px; }
.labelHint{ color: var(--muted); font-size: 12px; }

.input,.select{
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.65);
  color: var(--text);
  outline: none;
}
html[data-theme="dark"] .input,
html[data-theme="dark"] .select{ background: rgba(15,23,34,0.65); }
.input:focus,.select:focus{ border-color: rgba(11,122,120,0.45); box-shadow: 0 0 0 3px rgba(11,122,120,0.12); }

.searchField{ position: relative; }
.searchWrap{ position: relative; }
.searchWrap .input{ padding-right: 36px; width: 100%; }
.searchClear{
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
}
.searchClear:hover{ color: var(--text); background: var(--accent-soft); }
.searchClear.hidden{ display: none; }
.searchSuggest{
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 50;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  max-height: 240px;
  overflow: auto;
}
.searchSuggest.hidden{ display: none; }
.searchSuggest__item{
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}
.searchSuggest__item:hover,
.searchSuggest__item--active{
  background: var(--accent-soft);
}
.searchSuggest__meta{
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.range{ width: 100%; }
.rangeMarks{ display:flex; justify-content:space-between; color: var(--muted); font-size: 11px; margin-top: 6px; }

.table{ margin-top: 16px; overflow:hidden; }
.table__head{ padding: 14px 16px; display:flex; align-items:baseline; justify-content:space-between; gap: 12px; border-bottom: 1px solid var(--border); }
.table__title{ font-weight: 700; letter-spacing:-0.03em; }
.table__hint{ color: var(--muted); font-size: 12.5px; }
.tableWrap{ overflow:auto; }
table{ width:100%; border-collapse: collapse; }
th,td{ padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align:middle; }
th{ text-align:left; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; }
td{ font-size: 13.5px; }
.num{ text-align:right; font-variant-numeric: tabular-nums; }
th.num--price,
td.num--price{
  min-width: 5.75rem;
  width: 5.75rem;
}
.num .price{
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.2em;
  white-space: nowrap;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.price__amt{ font-variant-numeric: tabular-nums; }
.price__eur{
  font-weight: 700;
  font-size: 0.95em;
  flex: 0 0 auto;
  line-height: 1;
}
.station{
  display:flex; flex-direction:column; gap:2px;
}
.station__name{ font-weight: 700; }
.station__addr{ color: var(--muted); font-size: 12.5px; }
.chipRow{ display:flex; gap:6px; flex-wrap:wrap; margin-top: 6px; }
.chip{
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.55);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11.5px;
  color: var(--muted);
}
html[data-theme="dark"] .chip{ background: rgba(15,23,34,0.55); }

.price--best{
  color: var(--accent);
}
.price--best .price__eur{ color: var(--accent); }

.link{
  color: var(--accent);
  font-weight: 700;
  text-decoration:none;
}
.link:hover{ text-decoration: underline; }

.trends{ margin-top: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.trends__grid{
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 14px 14px;
  min-width: 0;
}
.trendCard{
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 9px;
  background: rgba(255,255,255,0.55);
  min-height: 84px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  overflow: hidden;
}
html[data-theme="dark"] .trendCard{ background: rgba(15,23,34,0.55); }
.trendTop{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
  flex-wrap: nowrap;
}
.trendFuel{ font-weight: 700; font-size: 12.5px; letter-spacing: -0.02em; line-height: 1.2; }
.trendDelta{
  color: var(--muted);
  font-size: 9.5px;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
}
.trendBottom{ display: flex; align-items: flex-end; justify-content: space-between; gap: 4px; }
.trendValue{ font-weight: 800; font-size: 14px; letter-spacing: -0.02em; min-width: 0; line-height: 1.15; }
.trendBottom .muted{ font-size: 10px; line-height: 1.25; }
.spark{
  width: 52px;
  height: 22px;
  display: block;
  flex: 0 0 auto;
  overflow: visible;
}
@media (max-width: 900px){
  .trends__grid{
    grid-template-columns: repeat(6, minmax(118px, 1fr));
    min-width: calc(6 * 118px + 5 * 8px + 28px);
  }
}
.spark path{ stroke: var(--accent); stroke-width: 2; fill: none; }
.spark .bg{ stroke: rgba(11,122,120,0.18); stroke-width: 2; }

.rowToggle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  cursor:pointer;
}
.rowToggle:hover{ border-color: rgba(11,122,120,0.35); }
.detailsRow td{
  padding-top: 0;
  padding-bottom: 14px;
}
.detailsBox{
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.55);
}
html[data-theme="dark"] .detailsBox{ background: rgba(15,23,34,0.55); }
.detailsGrid{
  display:grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 12px;
}
.detailsTitle{ font-weight: 700; font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; }
.detailsText{ margin-top: 6px; font-size: 13px; }
.priceGrid{ display:flex; flex-wrap:wrap; gap: 8px; margin-top: 8px; }
.pricePill{
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.55);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
html[data-theme="dark"] .pricePill{ background: rgba(15,23,34,0.55); }

.state{
  display:flex; gap: 12px; align-items:center;
  padding: 18px 16px;
}
.state__title{ font-weight: 700; }
.state__desc{ color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.state--error{ border-top: 1px solid var(--border); }
.hidden{ display:none !important; }

.spinner{
  width: 18px; height: 18px; border-radius: 999px;
  border: 2px solid rgba(11,122,120,0.25);
  border-top-color: rgba(11,122,120,1);
  animation: spin 0.9s linear infinite;
}
@keyframes spin{ to { transform: rotate(360deg);} }

.footer{
  width:min(1160px, calc(100% - 32px));
  margin: 0 auto 18px;
  display:flex; align-items:center; justify-content:space-between; gap: 12px;
  color: var(--muted);
  font-size: 12px;
}
.dot{
  width: 7px; height: 7px; border-radius: 999px; background: rgba(11,122,120,1);
  display:inline-block; margin-right: 8px;
}
.footer__left{ display:flex; align-items:center; }

.alert{
  border-radius: 14px;
  padding: 12px 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.55);
  margin-bottom: 12px;
}
html[data-theme="dark"] .alert{ background: rgba(15,23,34,0.55); }
.alert--ok{ border-color: rgba(19,122,71,0.25); }
.alert--warn{ border-color: rgba(138,90,0,0.25); }
.alert--err{ border-color: rgba(156,26,26,0.25); }
.pre{
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.05);
  overflow:auto;
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre-wrap;
}
html[data-theme="dark"] .pre{ background: rgba(0,0,0,0.18); }

.form .grid{ display:flex; gap: 12px; flex-wrap:wrap; }
.row{ display:flex; align-items:center; gap: 12px; margin-top: 12px; flex-wrap:wrap; }
.check{ display:flex; gap: 10px; align-items:center; color: var(--muted); font-size: 12.5px; }

@media (max-width: 920px){
  .pageNav{ order: 3; width: 100%; justify-content: center; }
  .topbar__actions{ margin-left: 0; }
  .heroPanel{ grid-template-columns: 1fr; }
  .metaGrid{ grid-template-columns: 1fr; }
  .kpis{ grid-template-columns: 1fr; }
  .best__actions{ flex-direction:column; align-items:stretch; }
  th:nth-child(5), td:nth-child(5){ display:none; }
  .detailsGrid{ grid-template-columns: 1fr; }
}

@media (max-width: 520px){
  th:nth-child(2), td:nth-child(2){ display:none; }
  .heroMap{ height: 200px; min-height: 200px; }
}

.modal{
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal.hidden{ display: none; }
.modal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(11, 18, 32, 0.5);
}
.modal__panel{
  position: relative;
  width: min(440px, 100%);
  padding: 20px 20px 16px;
  box-shadow: 0 24px 48px rgba(12, 20, 34, 0.18);
}
.modal__close{
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 40px;
  padding: 6px 10px;
  font-size: 20px;
  line-height: 1;
}
.modal__eyebrow{
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.modal__title{
  margin: 0 32px 8px 0;
  font-size: 1.15rem;
  line-height: 1.35;
}
.modal__meta{ margin: 0 0 16px; font-size: 13px; line-height: 1.45; }
.modal__actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.modal__actions .btn--primary{ flex: 1 1 200px; justify-content: center; }
.modal__alt{
  font-size: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.modal__alt a{ color: var(--accent); text-decoration: none; font-weight: 600; }
.modal__alt a:hover{ text-decoration: underline; }
body.modal-open{ overflow: hidden; }

