:root {
  color-scheme: light dark;
  --bg: #eef3fb;
  --bg-gradient: linear-gradient(160deg, #dce9fb 0%, #eef3fb 40%, #f7fafc 100%);
  --surface: #ffffff;
  --surface-alt: #f4f7fc;
  --border: #dde5f0;
  --text: #16202e;
  --text-muted: #5b6b81;
  --accent: #2f6fed;
  --accent-soft: #e5edff;
  --high: #1f9d55;
  --high-bg: #e5f8ed;
  --medium: #c9820a;
  --medium-bg: #fdf2df;
  --low: #d5432f;
  --low-bg: #fbe7e3;
  --shadow: 0 8px 24px rgba(30, 45, 80, 0.08);
  --radius: 16px;
  --topbar-h: 60px;
}

:root[data-theme='dark'] {
  --bg: #0d1420;
  --bg-gradient: linear-gradient(160deg, #0d1420 0%, #101a29 45%, #0c121c 100%);
  --surface: #151f30;
  --surface-alt: #1b283c;
  --border: #253248;
  --text: #eaf0fb;
  --text-muted: #93a3bd;
  --accent: #6d9bff;
  --accent-soft: #1c2b4c;
  --high: #4ade80;
  --high-bg: #143323;
  --medium: #f1b34c;
  --medium-bg: #3a2a10;
  --low: #f37060;
  --low-bg: #3a1712;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0d1420;
    --bg-gradient: linear-gradient(160deg, #0d1420 0%, #101a29 45%, #0c121c 100%);
    --surface: #151f30;
    --surface-alt: #1b283c;
    --border: #253248;
    --text: #eaf0fb;
    --text-muted: #93a3bd;
    --accent: #6d9bff;
    --accent-soft: #1c2b4c;
    --high: #4ade80;
    --high-bg: #143323;
    --medium: #f1b34c;
    --medium-bg: #3a2a10;
    --low: #f37060;
    --low-bg: #3a1712;
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  }
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg-gradient);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: var(--accent);
}

button {
  font-family: inherit;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* ---------- Header ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  flex-wrap: wrap;
}

.drawer-toggle {
  display: inline-flex;
}

.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
  margin-right: auto;
}

.brand-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: block;
}

.search-panel.location-picker {
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
}

.search-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.search-wrap input {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 16px; /* évite le zoom auto iOS */
}

.search-wrap input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

select {
  width: 100%;
  padding: 11px 36px 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background-color: var(--surface-alt);
  color: var(--text);
  font-size: 16px; /* évite le zoom auto iOS */
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%238a97ab' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}

select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.search-results {
  list-style: none;
  margin: 4px 0 0;
  padding: 6px;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  max-height: 280px;
  overflow-y: auto;
  z-index: 30;
}

.search-results li {
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.92rem;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.search-results li:hover,
.search-results li.active {
  background: var(--accent-soft);
}

.search-results .result-sub {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.search-results .empty {
  padding: 10px;
  color: var(--text-muted);
  cursor: default;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.05s ease;
}

.btn:hover {
  background: var(--accent-soft);
}

.btn:active {
  transform: scale(0.97);
}

.btn.small {
  padding: 8px 10px;
  min-height: 38px;
  font-size: 0.85rem;
}

.btn.icon-btn {
  padding: 8px 10px;
  min-width: 42px;
  font-size: 1.05rem;
}

.btn[aria-pressed='true'] {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-label {
  display: none;
}

/* ---------- Tabs ---------- */
.view-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--topbar-h);
  z-index: 30;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.tab-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- Layout / drawer ---------- */
.layout {
  flex: 1;
  display: block;
  padding: 14px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 25, 0.45);
  z-index: 45;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(320px, 86vw);
  background: var(--surface);
  z-index: 50;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transform: translateX(-105%);
  transition: transform 0.22s ease;
  box-shadow: var(--shadow);
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-title {
  font-weight: 700;
}

.drawer-close {
  display: inline-flex;
}

.panel {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.settings-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.auth-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.auth-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-alt);
}

.auth-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Compte (icône top-right + menu déroulant) ---------- */
.account-menu {
  position: relative;
}

.btn.icon-btn.account-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  font-size: 1.15rem;
}

.account-btn-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: max-content;
  min-width: 260px;
  max-width: min(90vw, 320px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

.panel-header h2 {
  margin: 0;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.82rem;
  padding: 4px 0;
}

.muted {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.muted.small {
  font-size: 0.78rem;
}

/* Favorites */
.favorites-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.favorites-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
}

.favorites-list li:hover {
  background: var(--surface);
}

.favorites-list li.active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.favorites-list .fav-name {
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.favorites-list .fav-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 6px;
}

.favorites-list .fav-remove:hover {
  background: var(--low-bg);
  color: var(--low);
}

/* Sources */
.sources-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sources-list label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.9rem;
}

.sources-list input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
}

.source-name {
  font-weight: 600;
}

.source-agency {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
}

/* API categories (collapsible) */
.api-categories {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.api-category {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.api-category-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface);
  border: none;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  color: var(--text);
}

.api-category-chevron {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.api-category-body {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border);
}

.api-category-body.hidden {
  display: none;
}

/* ---------- Main content ---------- */
.content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.view {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.status-bar {
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--medium-bg);
  color: var(--medium);
  font-size: 0.9rem;
}

.status-bar.error {
  background: var(--low-bg);
  color: var(--low);
}

.section h2 {
  font-size: 1.02rem;
  margin: 0 0 12px;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
}

.section-header h2 {
  margin: 0;
}

/* Alertes météo officielles */
.weather-alerts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.weather-alert {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--medium);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.weather-alert.severity-extreme,
.weather-alert.severity-severe {
  border-left-color: var(--low);
}

.weather-alert.severity-moderate {
  border-left-color: var(--medium);
}

.weather-alert.severity-minor {
  border-left-color: var(--high);
}

.weather-alert-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
}

.weather-alert-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.weather-alert-desc {
  margin: 8px 0 6px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

/* Current card */
.current-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.current-favorite-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.current-favorite-btn:hover {
  opacity: 0.7;
}

.current-favorite-btn.active {
  color: #f5b301;
}

.current-alert-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.current-alert-btn:hover {
  opacity: 0.7;
}

.current-alert-btn.severity-extreme,
.current-alert-btn.severity-severe {
  color: var(--low);
}

.current-alert-btn.severity-moderate {
  color: var(--medium);
}

.current-alert-btn.severity-minor {
  color: var(--high);
}

.current-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.current-icon {
  font-size: 2.8rem;
  line-height: 1;
}

.current-temp {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.current-location {
  font-size: 1.05rem;
  font-weight: 600;
  /* Réserve la place de l'étoile de favori (en haut à droite de la tuile,
     positionnée en absolu donc ignorée par le flux normal) pour qu'un nom
     de ville long passe à la ligne avant de disparaître dessous. */
  padding-right: 40px;
}

.current-desc {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.current-range {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 4px;
}

.best-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--high-bg);
  color: var(--high);
  font-size: 0.76rem;
  font-weight: 600;
}

.current-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.current-details strong {
  color: var(--text);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge.high {
  background: var(--high-bg);
  color: var(--high);
}

.badge.medium {
  background: var(--medium-bg);
  color: var(--medium);
}

.badge.low {
  background: var(--low-bg);
  color: var(--low);
}

.badge.unknown {
  background: var(--surface-alt);
  color: var(--text-muted);
}

/* Activities */
.activities-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.activity-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  box-shadow: var(--shadow);
}

/* Horizontal scroll strips (jours / heures) */
.daily-strip,
.hourly-cards {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.day-card,
.hour-card {
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  cursor: pointer;
}

.day-card {
  /* Largeur fixe (pas "auto") : sinon chaque tuile prend la largeur de son
     propre contenu (ex. le badge "Sources divergentes" est plus long que
     "Accord modéré"), et les 7 tuiles n'ont plus la même largeur. */
  flex: 0 0 108px;
  width: 108px;
}

.day-card .badge {
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}

.hour-card {
  flex: 0 0 74px;
  width: 74px;
}

.day-card.active,
.hour-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Détail matin/après-midi/soir : se déplie sur place dans la tuile active,
   au lieu d'un panneau séparé — animation de hauteur (glissement). */
.day-periods {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease;
}

.day-card.active .day-periods {
  max-height: 160px;
  opacity: 1;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.day-period-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.day-period-label {
  color: var(--text-muted);
  min-width: 0;
}

.day-period-value {
  display: flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
}

.day-name {
  font-weight: 600;
  font-size: 0.83rem;
  text-transform: capitalize;
}

.day-icon,
.hour-icon {
  font-size: 1.6rem;
}

.day-temps {
  font-size: 0.88rem;
}

.day-temps .max {
  font-weight: 700;
}

.day-temps .min {
  color: var(--text-muted);
}

.day-precip,
.hour-precip {
  font-size: 0.76rem;
  color: var(--accent);
}

.hour-time {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.hour-temp {
  font-weight: 700;
  font-size: 0.92rem;
}

/* Hourly chart */
.hourly-chart {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  overflow-x: auto;
  margin-top: 10px;
}

.hourly-chart svg {
  display: block;
  min-width: 560px;
}

.hourly-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Source breakdown table */
.breakdown-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

table.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  min-width: 480px;
}

table.breakdown-table th,
table.breakdown-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

table.breakdown-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

table.breakdown-table tr:last-child td {
  border-bottom: none;
}

table.breakdown-table tr.consensus-row td {
  font-weight: 700;
  background: var(--accent-soft);
}

table.breakdown-table tr.source-row-failed td {
  color: var(--text-muted);
}

.accuracy-cell.low-sample {
  opacity: 0.7;
}

.accuracy-days {
  font-size: 0.85em;
  color: var(--text-muted);
}

/* ---------- Destinations ---------- */
.search-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 14px 0;
}

.search-panel h2 {
  margin: 0;
  font-size: 1rem;
}

.search-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-field label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.search-row {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.origin-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
}

.search-distance {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-distance input {
  width: 100px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 16px;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stepper-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.stepper-btn:hover {
  background: var(--accent-soft);
}

.stepper-input {
  width: 52px;
  padding: 9px 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 16px;
  text-align: center;
  /* Cache les flèches natives du navigateur : on a déjà nos propres boutons +/-. */
  -moz-appearance: textfield;
}

.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.stepper-unit {
  color: var(--text-muted);
  font-size: 0.86rem;
}

#durationSelect {
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 0.9rem;
  max-width: 260px;
}

.search-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
}

.checkbox-field input {
  width: 18px;
  height: 18px;
}

/* ---------- Road trip ---------- */
.roadtrip-timeline {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-top: 16px;
}

.roadtrip-step {
  display: flex;
  gap: 14px;
}

.roadtrip-marker-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 36px;
  flex: 0 0 auto;
}

.roadtrip-marker {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex: 0 0 auto;
}

.roadtrip-connector {
  flex: 1;
  width: 2px;
  background: var(--border);
  min-height: 28px;
  margin: 4px 0;
}

.roadtrip-step-body {
  flex: 1;
  padding-bottom: 22px;
  min-width: 0;
}

.roadtrip-step-title {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
}

.roadtrip-step-name {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 2px 0 6px;
}

.roadtrip-leg {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: -6px 0 6px 50px;
}

.roadtrip-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
}

.roadtrip-summary strong {
  font-size: 1rem;
}

.roadtrip-weather {
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.roadtrip-poi {
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.roadtrip-poi a {
  color: var(--accent);
}

.roadtrip-activity-highlight {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.roadtrip-lodging {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.roadtrip-lodging-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.lodging-item {
  font-size: 0.82rem;
  margin-bottom: 4px;
}

.roadtrip-activity-highlight.mismatch {
  color: var(--low);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.roadtrip-activity-highlight.mandatory {
  color: var(--accent);
}

.roadtrip-mismatch-warning {
  display: block;
  background: var(--low-bg);
  color: var(--low);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.roadtrip-trails {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.trail-item {
  display: block;
  color: inherit;
  text-decoration: none;
}

.trail-item:hover {
  text-decoration: underline;
}

.match-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
}

.window-badge {
  background: var(--high-bg);
  color: var(--high);
}

.match-detail {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.filters-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0 16px;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
}

.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.mustvisit-chip {
  cursor: default;
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.chip-remove {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0;
}

.destinations-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.destination-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.destination-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.destination-name-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
  min-height: 0;
}

.destination-name-btn:hover .destination-name,
.destination-name-btn:focus-visible .destination-name {
  color: var(--accent);
  text-decoration: underline;
}

.destination-name {
  font-weight: 700;
  font-size: 1.02rem;
}

.destination-sub {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.destination-weather {
  display: flex;
  align-items: center;
  gap: 10px;
}

.destination-weather .icon {
  font-size: 1.8rem;
}

.destination-days {
  display: flex;
  gap: 6px;
  overflow-x: auto;
}

.destination-days .mini-day {
  flex: 0 0 auto;
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--surface-alt);
  border-radius: 8px;
  padding: 6px 8px;
}

.destination-days .mini-day.in-window {
  background: var(--high-bg);
  color: var(--high);
  font-weight: 600;
}

.deal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.deal-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.78rem;
  text-decoration: none;
}

.deal-btn:hover {
  background: var(--accent-soft);
}

/* Footer */
.app-footer {
  padding: 16px 16px 28px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* =========================================================
   Tablette (≥ 700px)
   ========================================================= */
@media (min-width: 700px) {
  .btn-label {
    display: inline;
  }

  .layout {
    padding: 20px;
  }

  .current-main {
    gap: 18px;
  }

  .current-icon {
    font-size: 3.2rem;
  }

  .current-temp {
    font-size: 2.9rem;
  }

  .current-card {
    flex-direction: row;
    align-items: center;
    padding: 22px;
  }

  .current-details {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    flex: 1;
  }

  .destinations-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters-bar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .search-row {
    flex-direction: row;
    gap: 24px;
  }

  /* Les 7 jours passent en grille sur une seule ligne (7 colonnes) plutôt
     qu'en bandeau qui défile horizontalement — bien plus lisible dès qu'il y
     a la place, sans jamais déborder sur une 2e ligne. */
  .daily-strip {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    overflow-x: visible;
    scroll-snap-type: none;
  }

  .day-card {
    min-width: 0;
    width: auto;
    padding: 12px 6px;
  }
}

/* =========================================================
   Tablette large / bureau (≥ 860px) : la barre latérale devient une
   colonne fixe. Beaucoup de tablettes (portrait comme paysage) sont sous
   1024px de large ; les coincer dans la mise en page "mobile" jusque-là
   donnait une interface tassée forçant à dézoomer pour voir correctement.
   ========================================================= */
@media (min-width: 860px) {
  .drawer-toggle,
  .drawer-close {
    display: none;
  }

  .drawer-backdrop {
    display: none !important;
  }

  .layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
    align-items: start;
  }

  .sidebar {
    position: sticky;
    top: calc(var(--topbar-h) + 52px);
    left: auto;
    transform: none;
    width: auto;
    box-shadow: none;
    max-height: calc(100vh - var(--topbar-h) - 72px);
  }

  .sidebar-header {
    display: none;
  }

  .view-tabs {
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    padding: 8px 20px;
  }

  .tab-btn {
    flex: 0 0 auto;
    padding: 10px 22px;
  }
}

@media (min-width: 1024px) {
  .layout {
    grid-template-columns: 280px 1fr;
  }

  .destinations-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .destinations-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
