:root {
  --blue-meteo: #1a6b8a;
  --green-meteo: #4daf2f;
  --blue-light: #4da8c9;

  --bg: #f7f9fb;
  --panel: #ffffff;
  --text: #2a2a2a;
  --muted: #6b7280;
  --accent: #1a6b8a;
  --accent-hover: #145a75;
  --accent-soft: rgba(26, 107, 138, 0.08);
  --green: #4daf2f;
  --green-hover: #3d9624;
  --error: #dc2626;
  --border: #e5e7eb;

  --weather-sun: #f59e0b;
  --weather-rain: #4da8c9;
  --weather-cloud: #9ca3af;

  --chart-temp: #e67e22;
  --chart-precip: #3498db;
  --chart-wind: #9ca3af;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  --radius: 10px;
  --radius-sm: 8px;
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  margin: 0;
  padding-top: var(--space-md);
  min-height: 100vh;
}

.hero {
  padding: var(--space-lg) 0 var(--space-sm);
  text-align: center;
}

.logo-link {
  display: inline-block;
  text-decoration: none;
}

.logo {
  width: auto;
  height: auto;
  max-height: 120px;
  max-width: 100%;
}

.hero-subtitle {
  margin: var(--space-sm) auto 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: 0.92rem;
}

.use-cases-section {
  max-width: 800px;
  margin: 0 auto 1.5rem;
  padding: 0 1rem;
}

.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.use-case-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  text-align: center;
  font: inherit;
  color: var(--text);
}

.use-case-card:hover,
.use-case-card:focus-visible {
  border-color: var(--blue-meteo);
  box-shadow: 0 2px 8px rgba(26, 107, 138, 0.15);
}

.use-case-icon {
  font-size: 2rem;
}

.use-case-text {
  font-size: 0.9rem;
  line-height: 1.4;
}

.container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 var(--space-sm);
  display: grid;
  gap: var(--space-md);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  min-width: 0;
}

.info-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  min-width: 0;
}

.search-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.search-compact.hidden {
  display: none;
}

.search-compact-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-width: 0;
}

.search-compact-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.search-compact-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.search-compact-title {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

#search-compact-commune {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#search-compact-period {
  font-size: 0.9rem;
  color: var(--muted);
}

#search-form-body {
  overflow: hidden;
  max-height: 2000px;
  opacity: 1;
  transition:
    max-height 0.3s ease-out,
    opacity 0.2s ease-out;
}

#search-form-body.collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

#search-compact + #search-form-body:not(.collapsed) {
  border-top: 1px solid var(--border);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
}

.card-subtitle {
  margin: -0.3rem 0 0.8rem;
  color: var(--muted);
  font-size: 0.92rem;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 0;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

label {
  display: block;
  margin: 0.4rem 0;
  font-weight: 600;
}

input[type="text"],
input[type="date"] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.75rem;
  font-size: 16px;
  min-height: 44px;
}

#search-button,
button[type="submit"] {
  margin-top: 0.9rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--green);
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: background 0.15s;
}

#search-button {
  width: 100%;
}

.suggestions li,
#search-button,
.btn-secondary,
.btn-period-link,
.results-nav a,
.btn-cancel,
.btn-calendar,
.preset-buttons button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.suggestions li {
  justify-content: flex-start;
}

#search-button:hover:not([disabled]),
button[type="submit"]:hover:not([disabled]) {
  background: var(--green-hover);
}

button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.autocomplete {
  position: relative;
}

#commune-input {
  padding-right: 2rem;
}

.input-clear-btn {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--muted);
  padding: 0.25rem;
  line-height: 1;
  z-index: 1;
}

.input-clear-btn:hover {
  color: var(--text);
}

.suggestions {
  position: absolute;
  z-index: 20;
  list-style: none;
  margin: 0.3rem 0 0;
  padding: 0;
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: min(220px, 50vh);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.suggestions li {
  padding: 0.75rem 0.8rem;
  cursor: pointer;
}

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

.field-message {
  margin: 0.45rem 0 0;
  min-height: 1.2rem;
  color: var(--muted);
}

.date-range-note {
  color: var(--muted);
  margin: 0.7rem 0;
}

.date-mode-toggle {
  display: flex;
  gap: 0;
  margin-bottom: 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  width: fit-content;
}

.date-mode-btn {
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
  white-space: nowrap;
}

.date-mode-btn:not(:last-child) {
  border-right: 1px solid var(--border);
}

.date-mode-btn.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.date-mode-btn:hover:not(.active) {
  background: var(--accent-soft);
}

.date-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.date-fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

.date-fieldset legend {
  display: block;
  font-weight: 600;
  margin: 0.4rem 0;
  padding: 0;
}

.date-input-wrapper {
  display: flex;
  align-items: center;
  position: relative;
}

.date-input-wrapper input[type="text"] {
  flex: 1;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}

.btn-calendar {
  width: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg);
  color: var(--muted);
  cursor: pointer;
  transition:
    color 0.15s,
    background 0.15s;
  flex-shrink: 0;
}

.btn-calendar:hover:not([disabled]) {
  color: var(--accent);
  background: var(--accent-soft);
}

.btn-calendar svg {
  pointer-events: none;
}

.date-arrow {
  display: none;
  font-size: 1.2rem;
  color: var(--muted);
  align-self: end;
  padding-bottom: 0.65rem;
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.6rem 0;
}

.quick-actions {
  display: flex;
  gap: 0.75rem;
  margin: 1rem 0;
}

.quick-action-btn {
  flex: 1;
  padding: 0.875rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  border: 2px solid var(--blue-meteo);
  border-radius: 10px;
  background: #fff;
  color: var(--blue-meteo);
  cursor: pointer;
  transition:
    background 0.2s,
    color 0.2s;
}

.quick-action-btn:hover:not(:disabled),
.quick-action-btn:focus-visible:not(:disabled) {
  background: var(--blue-meteo);
  color: #fff;
}

.quick-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.advanced-toggle {
  text-align: center;
  margin-top: 0.75rem;
}

.advanced-toggle button {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0.25rem 0.5rem;
}

.advanced-toggle button:hover {
  color: var(--text);
}

.weather-hero {
  background: linear-gradient(135deg, var(--blue-meteo), var(--blue-light));
  color: #fff;
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.weather-hero-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.weather-hero-icon {
  font-size: 3.5rem;
}

.weather-hero-label {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.weather-hero-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.weather-hero-stat {
  font-size: 1.1rem;
  opacity: 0.9;
}

.preset-buttons button {
  margin-top: 0;
  padding: 0.55rem 0.85rem;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.preset-buttons button:hover:not([disabled]) {
  background: var(--accent);
  color: #fff;
}

.preset-buttons button[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.preset-buttons button.active {
  background: var(--accent);
  color: #fff;
}

.error-block {
  text-align: center;
  color: var(--error);
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 0.8rem;
  margin-bottom: 0.75rem;
}

.error-message {
  margin: 0;
  line-height: 1.5;
}

#retry-button {
  margin-top: 0.7rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  padding: 0.7rem 1.2rem;
  cursor: pointer;
}

#retry-button:hover {
  background: var(--accent-hover);
}

.spinner {
  display: inline-block;
  width: 1.2em;
  height: 1.2em;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: var(--space-xs);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(to right, var(--panel) 30%, transparent),
    linear-gradient(to left, var(--panel) 30%, transparent),
    linear-gradient(to right, rgba(0, 0, 0, 0.08), transparent 15px),
    linear-gradient(to left, rgba(0, 0, 0, 0.08), transparent 15px);
  background-position:
    left center,
    right center,
    left center,
    right center;
  background-size:
    20px 100%,
    20px 100%,
    15px 100%,
    15px 100%;
  background-repeat: no-repeat;
  background-attachment: local, local, scroll, scroll;
}

.charts-wrapper {
  display: flex;
  flex-direction: column;
  gap: var(--space-md, 1rem);
}

.chart-block h3 {
  margin: 0 0 var(--space-sm, 0.5rem);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.chart-container {
  position: relative;
  height: 200px;
  width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

#daily-summary table {
  min-width: 780px;
}

#daily-summary td a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border);
  text-underline-offset: 2px;
  transition:
    color 0.15s,
    text-decoration-color 0.15s;
}

#daily-summary td a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--border);
  padding: 0.55rem;
  white-space: nowrap;
}

th {
  background: #f8fafc;
}

.info p {
  margin: 0;
  line-height: 1.45;
}

footer {
  text-align: center;
  font-size: 0.95rem;
  color: var(--muted);
  padding: var(--space-sm) var(--space-md) var(--space-xl);
}

footer p {
  margin: 0;
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.footer-logo {
  width: auto;
  height: auto;
  max-height: 55px;
  margin-bottom: var(--space-sm);
  opacity: 0.7;
}

.hidden {
  display: none;
}

.day-group {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.65rem;
  overflow: hidden;
}

.day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 0.8rem;
  background: var(--panel);
  cursor: pointer;
  font-weight: 600;
  user-select: none;
  flex-wrap: wrap;
  min-height: 44px;
}

.day-header:hover {
  background: #f8fafc;
}

.day-date {
  text-transform: capitalize;
}

.day-summary {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.8rem;
}

.weather-icon-day-header {
  font-size: 1.8em;
  line-height: 1;
  vertical-align: middle;
}

.weather-icon-lg {
  font-size: 1.6em;
  line-height: 1;
  vertical-align: middle;
}

.period-summary-icon {
  font-size: 2em;
  vertical-align: middle;
  margin-left: 0.3rem;
}

.share-block {
  text-align: center;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.75rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
}

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

.share-btn-copy {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

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

.share-feedback {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
}

.day-group[open] > .day-header {
  border-bottom: 1px solid var(--border);
}

.day-group .table-wrapper {
  margin: 0;
  padding: 0;
}

.day-group table {
  margin: 0;
  border-radius: 0;
}

.btn-secondary {
  margin-top: 0;
  margin-bottom: 0.75rem;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition:
    background 0.15s,
    color 0.15s;
}

.btn-secondary:hover:not([disabled]) {
  background: var(--accent);
  color: #fff;
}

.btn-cancel {
  margin-top: 0.5rem;
  background: transparent;
  border: 1px solid var(--error);
  color: var(--error);
  padding: 0.55rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-cancel:hover:not([disabled]) {
  background: var(--error);
  color: #fff;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  min-width: 620px;
}

.comparison-table th,
.comparison-table td {
  text-align: center;
  padding: 0.55rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.comparison-table th {
  background: #f8fafc;
}

.comparison-winner {
  font-weight: 600;
  color: var(--accent);
}

.anomaly-warm {
  color: #d32f2f;
  font-weight: 600;
}

.anomaly-cold {
  color: #1976d2;
  font-weight: 600;
}

.anomaly-wet {
  color: #1976d2;
  font-weight: 600;
}

.anomaly-dry {
  color: #ef6c00;
  font-weight: 600;
}

.commune-info-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.commune-info-list li {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.info-label {
  color: var(--muted);
  font-weight: 600;
}

.commune-info-compact {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.commune-info-compact p {
  margin: 0;
  color: var(--muted);
}

.commune-info-compact p:first-child {
  font-weight: 600;
  color: var(--text);
}

.seo-intro-text {
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text);
  text-align: center;
  margin: 0;
  padding: 0.2rem 0;
  line-height: 1.5;
}

.seo-h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin: 0 0 var(--space-md);
}

#seo-h2.hidden {
  display: none;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-sm);
}

.kpi-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-sm);
  text-align: center;
}

.kpi-card .kpi-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.kpi-card .kpi-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.month-links-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.month-links-nav button {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.month-links-nav button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.month-links-nav .year-label {
  font-size: 1.1rem;
  font-weight: 600;
}

.month-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-sm);
}

.month-card {
  display: block;
  background: var(--panel);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  text-align: center;
  text-decoration: none;
  color: var(--text);
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}

.month-card:hover {
  border-color: var(--accent);
}

.month-card.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.month-card .month-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.month-card .month-temp {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.internal-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}

.internal-links a {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--accent);
  font-size: 0.9rem;
  transition: background 0.2s;
}

.internal-links a:hover {
  background: var(--accent);
  color: #fff;
}

.nearby-communes-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0;
  margin: 0;
}

.nearby-communes-list a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  transition:
    border-color 0.15s,
    background 0.15s;
}

.nearby-communes-list a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.nearby-communes-list a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.nearby-distance {
  color: var(--muted);
  font-size: 0.8rem;
}

#quick-periods-body {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}

#quick-periods-body a {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
}

#quick-periods-body a:hover {
  border-color: var(--accent);
}

.results-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin: var(--space-md) 0 var(--space-sm);
}

.results-nav {
  position: static;
  z-index: 10;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-sm);
}

.results-nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  transition: background 0.15s;
}

.results-nav a:hover {
  background: var(--accent-soft);
}

.results-nav a.active {
  background: var(--accent);
  color: #fff;
}

.seasonal-context {
  font-style: italic;
  color: var(--muted);
  margin-top: var(--space-xs);
}

.anomaly-synthesis {
  margin-top: var(--space-sm);
  font-size: 0.95rem;
}

.climate-month-list {
  list-style: none;
  padding: 0;
  margin: var(--space-sm) 0 0;
}

.climate-month-list li {
  padding: 0.35rem 0;
  display: flex;
  gap: 0.5rem;
}

.period-links {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 1rem 0;
  flex-wrap: wrap;
  flex-direction: column;
}

.period-links.hidden {
  display: none;
}

.btn-period-link {
  flex: 1;
  min-width: 0;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition:
    background 0.15s,
    color 0.15s;
}

.btn-period-link:hover:not([disabled]) {
  background: var(--accent);
  color: #fff;
}

.btn-period-link[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.comparison-city-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
  color: var(--text);
}

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

@media (max-width: 600px) {
  .use-cases-grid {
    grid-template-columns: 1fr;
  }

  .quick-actions {
    flex-direction: column;
  }

  .weather-hero {
    padding: 1.25rem;
  }

  .weather-hero-content {
    flex-direction: column;
    gap: 0.75rem;
  }

  .weather-hero-icon {
    font-size: 2.5rem;
  }

  .weather-hero-label {
    font-size: 1.2rem;
  }

  .weather-hero-stats {
    flex-direction: column;
    gap: 0.25rem;
  }

  .search-compact {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  #retry-button {
    width: 100%;
  }

  .search-compact .btn-secondary {
    align-self: stretch;
    text-align: center;
  }

  .search-modify-long {
    display: none;
  }
}

@media (min-width: 640px) {
  .logo {
    max-height: 140px;
  }

  .hero {
    padding: var(--space-xl) 0 var(--space-md);
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .results-nav {
    position: sticky;
    top: 0;
    gap: 1.5rem;
    padding: 0.6rem 1rem;
  }

  .results-nav a {
    padding: 0.3rem 0.6rem;
    min-height: unset;
    font-size: 0.95rem;
  }

  .period-links {
    gap: 1rem;
    flex-direction: row;
  }

  .day-header {
    gap: 0.8rem;
    flex-wrap: nowrap;
  }

  .day-summary {
    font-size: 0.9rem;
  }
}

@media (min-width: 768px) {
  body {
    padding-top: var(--space-lg);
  }

  .container {
    padding: 0 var(--space-md);
  }

  .panel {
    padding: 1.2rem;
  }

  .info-card {
    padding: var(--space-lg);
  }

  .table-wrapper {
    margin: 0 calc(-1 * var(--space-md));
    padding: 0 var(--space-md);
  }

  .day-group .table-wrapper {
    margin: 0;
    padding: 0;
  }

  .date-grid {
    grid-template-columns: 1fr auto 1fr;
    align-items: end;
  }

  .date-arrow:not(.hidden) {
    display: block;
  }

  .chart-container {
    height: 300px;
  }

  #search-button {
    width: auto;
  }
}

/* === Insights Section === */

.insights-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-md, 1rem);
}

.insight-block h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  color: var(--text-primary, #1a1a2e);
}

.insight-block p,
.insight-block ul {
  margin: 0;
}

.insight-block ul {
  padding-left: 1.25rem;
}

.insight-block li {
  margin-bottom: 0.25rem;
}

/* Anomalies layout */
.insight-anomalies {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm, 0.5rem);
}

.insight-anomalies h3 {
  width: 100%;
}

.anomaly-item {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius, 8px);
  background: var(--panel, #fff);
  border: 1px solid var(--border, #e0e0e0);
}

.anomaly-value {
  font-size: 1.25rem;
  font-weight: 700;
}

.anomaly-label {
  font-size: 0.85rem;
  color: var(--text-secondary, #555);
}

/* Anomaly color coding */
.anomaly-chaud .anomaly-value {
  color: #d32f2f;
}

.anomaly-froid .anomaly-value {
  color: #1976d2;
}

.anomaly-humide .anomaly-value {
  color: #1976d2;
}

.anomaly-sec .anomaly-value {
  color: #ef6c00;
}

.anomaly-normal .anomaly-value {
  color: var(--text-secondary, #555);
}

/* Responsive mobile */
@media (max-width: 600px) {
  .insight-anomalies {
    flex-direction: column;
  }

  .anomaly-item {
    width: 100%;
  }

  .anomaly-value {
    font-size: 1.1rem;
  }
}

/* FAQ */
.faq-item {
  margin-bottom: 1rem;
}

.faq-item h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.faq-item p {
  font-size: 0.95rem;
  color: #444;
  line-height: 1.5;
}
