/* =============================================================
   pages.css — μόνο για /nomos/*, /nomoi, /statistika
   Επαναχρησιμοποιεί τις CSS variables του styles.css (dark/light auto).
   ============================================================= */

.nomos-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  color: var(--text-color);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Breadcrumbs */
.breadcrumbs { font-size: .9rem; color: var(--text-secondary); margin-bottom: 1rem; }
.breadcrumbs a { color: var(--text-secondary); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent-color); }
.breadcrumbs span { margin: 0 .4rem; opacity: .6; }
.breadcrumbs strong { color: var(--text-color); }

/* Hero */
.nomos-hero {
  display: flex; flex-wrap: wrap; gap: 1.5rem;
  justify-content: space-between; align-items: center;
  padding: 1.5rem; margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
  border-radius: 14px;
  border: 1px solid var(--border-color);
}
.nomos-hero .hero-left { flex: 1 1 320px; }
.nomos-hero h1 { font-size: 1.8rem; margin: .25rem 0 .5rem; line-height: 1.2; }
.nomos-hero .hero-sub { color: var(--text-secondary); font-size: .95rem; max-width: 680px; }
.region-tag {
  display: inline-block; font-size: .75rem; text-transform: uppercase;
  letter-spacing: .05em; padding: .25rem .6rem; border-radius: 12px;
  background: var(--bg-color); color: var(--text-secondary); border: 1px solid var(--border-color);
}

.hero-counters { display: flex; gap: 1rem; flex-wrap: wrap; }
.counter {
  min-width: 140px; padding: 1rem 1.25rem;
  background: var(--bg-secondary); border-radius: 12px;
  border: 1px solid var(--border-color); text-align: center;
}
.counter-num { display: block; font-size: 2.2rem; font-weight: 700; line-height: 1; }
.counter-label { display: block; font-size: .8rem; color: var(--text-secondary); margin-top: .25rem; text-transform: uppercase; letter-spacing: .04em; }
.counter-active .counter-num { color: var(--accent-color); }

/* Cards */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.25rem 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}
.card h2 {
  font-size: 1.2rem; margin-bottom: .8rem;
  display: flex; align-items: center; gap: .6rem;
}
.card h2 i { color: var(--accent-color); }
.card .chart-title { font-size: 1rem; margin: 1.25rem 0 .5rem; color: var(--text-secondary); }
.muted { color: var(--text-secondary); font-size: .9rem; margin-top: -.4rem; margin-bottom: .8rem; }
.empty-state { color: var(--text-secondary); font-style: italic; padding: 1rem 0; }

/* Mini map */
.mini-map {
  height: 420px; width: 100%; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border-color); background: var(--bg-tertiary);
}

/* Καθαροί, μεγάλοι fire markers — μόνο circle + flame, κανένα ring/value */
.fire-icon-wrap { background: transparent !important; border: none !important; }

.fire-pin {
  --c1: #ffb800;
  --c2: #cc5500;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 32% 30%, rgba(255,255,255,.7) 0%, transparent 35%),
    radial-gradient(circle at 50% 55%, var(--c1) 0%, var(--c2) 70%, #4a0000 100%);
  border: 3px solid #fff;
  box-shadow:
    0 3px 12px rgba(0,0,0,.5),
    0 0 0 1.5px rgba(0,0,0,.15);
}
.fire-pin.fire-med  { --c1: #ff7a1a; --c2: #b53600; }
.fire-pin.fire-high { --c1: #ff2a2a; --c2: #800000; }
.fire-pin svg {
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.4));
}

/* Leaflet popup overrides για τις φωτιές */
.fire-popup { font-family: 'Segoe UI', Tahoma, sans-serif; min-width: 180px; }
.fire-popup-title { font-weight: 600; font-size: .95rem; margin-bottom: .35rem; color: #222; }
.fire-popup-meta { display: flex; justify-content: space-between; gap: .8rem; font-size: .8rem; }
.fire-popup-meta .fp-frp {
  font-weight: 700; color: #d63500;
  background: #ffe9d4; padding: .15rem .45rem; border-radius: 4px;
}
.fire-popup-meta .fp-time { color: #666; }
.leaflet-popup-content-wrapper { border-radius: 10px !important; }
[data-theme="dark"] .fire-popup-title { color: #fff; }
[data-theme="dark"] .leaflet-popup-content-wrapper { background: #222 !important; color: #fff !important; }
[data-theme="dark"] .leaflet-popup-tip { background: #222 !important; }
[data-theme="dark"] .fire-popup-meta .fp-time { color: #ccc; }

/* Active fire cards */
.active-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; }
.fire-card {
  background: var(--bg-color); border: 1px solid var(--border-color);
  border-radius: 10px; padding: .8rem; transition: transform .15s;
}
.fire-card:hover { transform: translateY(-2px); }
.fire-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; }
.fire-card-title { font-weight: 600; margin: .25rem 0; font-size: .95rem; }
.fire-card-meta { font-size: .8rem; color: var(--text-secondary); display: flex; flex-direction: column; gap: .15rem; }
.fire-time { font-size: .75rem; color: var(--text-secondary); }

/* FRP badge */
.frp-badge {
  display: inline-block; font-weight: 700; font-size: .78rem;
  padding: .2rem .55rem; border-radius: 12px; white-space: nowrap;
}
.frp-low  { background: #fff3cd; color: #7a5a00; }
.frp-med  { background: #ffd6a1; color: #7a3b00; }
.frp-high { background: #ffb3a1; color: #7a1500; }
[data-theme="dark"] .frp-low  { background: #4a3a00; color: #ffe28a; }
[data-theme="dark"] .frp-med  { background: #6a3a00; color: #ffc88a; }
[data-theme="dark"] .frp-high { background: #6a1500; color: #ff9a8a; }

/* Stats grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .8rem; margin: .5rem 0 1rem; }
.stat-card {
  padding: 1rem; text-align: center;
  background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 10px;
}
.stat-val { font-size: 1.6rem; font-weight: 700; color: var(--accent-color); line-height: 1.1; }
.stat-val small { font-size: .8rem; font-weight: 500; color: var(--text-secondary); }
.stat-label { font-size: .8rem; color: var(--text-secondary); margin-top: .3rem; }

/* Monthly bars */
.monthly-bars {
  display: grid; grid-template-columns: repeat(12, 1fr); gap: .35rem;
  align-items: end; height: 180px; margin-top: .8rem; padding: 0 .25rem;
}
.bar-wrap { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.bar-val { font-size: .72rem; color: var(--text-secondary); margin-bottom: .2rem; min-height: 1em; }
.bar {
  width: 70%; max-width: 28px; background: var(--primary-btn-bg);
  border-radius: 4px 4px 0 0; transition: height .3s;
}
.bar-label { font-size: .72rem; color: var(--text-secondary); margin-top: .25rem; }

/* Year comparison */
.year-compare {
  display: flex; align-items: end; gap: .5rem;
  height: 200px; padding: 0 .25rem;
}
.year-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.year-col .bar { width: 60%; max-width: 50px; background: var(--bg-tertiary); border: 1px solid var(--border-color); }
.year-col .bar.is-current { background: var(--accent-color); border-color: var(--accent-color); }

/* Filters */
.hist-filters {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: end;
  padding: .8rem; margin-bottom: 1rem;
  background: var(--bg-color); border: 1px solid var(--border-color); border-radius: 10px;
}
.hist-filters.inline { background: transparent; border: none; padding: 0; margin: 0; }
.filter-field { display: flex; flex-direction: column; min-width: 140px; }
.filter-field label { font-size: .85rem; color: var(--text-secondary); margin-bottom: .3rem; }
.filter-field select, .filter-field input[type="range"] {
  padding: .5rem; background: var(--bg-secondary); color: var(--text-color);
  border: 1px solid var(--border-color); border-radius: 6px;
}
.filter-actions { display: flex; gap: .5rem; }
.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .55rem 1rem; border-radius: 6px; font-size: .9rem;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  font-family: inherit;
}
.btn-primary { background: var(--primary-btn-bg); color: #fff; }
.btn-primary:hover { background: var(--primary-btn-hover); }
.btn-secondary { background: var(--bg-color); color: var(--text-color); border-color: var(--border-color); }
.btn-secondary:hover { background: var(--bg-tertiary); color: var(--accent-color); }

.hist-summary { margin-bottom: .8rem; color: var(--text-secondary); font-size: .9rem; }

/* Table */
.table-wrap { overflow-x: auto; border: 1px solid var(--border-color); border-radius: 8px; }
.hist-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.hist-table thead { background: var(--bg-tertiary); position: sticky; top: 0; }
.hist-table th, .hist-table td { padding: .55rem .75rem; text-align: left; border-bottom: 1px solid var(--border-color); }
.hist-table th { font-weight: 600; color: var(--text-secondary); font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; }
.hist-table tbody tr:nth-child(even) { background: var(--bg-color); }
.hist-table tbody tr:hover { background: var(--bg-tertiary); }
.hist-table .num { text-align: right; white-space: nowrap; }
.hist-table small { color: var(--text-secondary); }
.hist-table a { color: var(--accent-color); text-decoration: none; }
.hist-table a:hover { text-decoration: underline; }

/* Pagination */
.pagination { display: flex; gap: 1rem; justify-content: center; align-items: center; margin-top: 1rem; font-size: .9rem; color: var(--text-secondary); }
.pagination a { color: var(--accent-color); text-decoration: none; padding: .4rem .8rem; border: 1px solid var(--border-color); border-radius: 6px; }
.pagination a:hover { background: var(--bg-tertiary); }

/* Region tiles */
.region-card h2 { font-size: 1.05rem; color: var(--text-secondary); }
.region-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .7rem; margin-top: .5rem; }
.pref-tile {
  display: block; padding: .85rem 1rem; border-radius: 10px;
  background: var(--bg-color); border: 1px solid var(--border-color);
  text-decoration: none; color: var(--text-color);
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.pref-tile:hover { transform: translateY(-2px); border-color: var(--accent-color); box-shadow: 0 2px 8px var(--shadow-color); }
.pref-tile.has-active { border-color: var(--accent-color); }
.pref-name { font-weight: 600; font-size: 1rem; margin-bottom: .4rem; }
.pref-stats { display: flex; gap: .4rem; flex-wrap: wrap; }
.pill { display: inline-block; font-size: .75rem; padding: .15rem .55rem; border-radius: 10px; background: var(--bg-tertiary); color: var(--text-secondary); }
.pill-active { background: var(--accent-color); color: #fff; }

/* Top list */
.top-list { list-style: none; padding: 0; margin: 0; }
.top-list li { margin-bottom: .35rem; }
.top-row {
  display: grid; grid-template-columns: 32px 1fr 2fr 70px;
  gap: .8rem; align-items: center;
  padding: .55rem .75rem; border-radius: 8px;
  background: var(--bg-color); border: 1px solid var(--border-color);
  text-decoration: none; color: var(--text-color);
  transition: background .15s;
}
.top-row:hover { background: var(--bg-tertiary); }
.rank { font-weight: 700; color: var(--accent-color); font-size: 1rem; text-align: center; }
.top-name { font-weight: 500; }
.top-bar { background: var(--bg-tertiary); border-radius: 4px; height: 10px; overflow: hidden; }
.top-bar-fill { display: block; height: 100%; background: var(--accent-color); transition: width .3s; }
.top-count { text-align: right; font-weight: 600; }

/* Cross links */
.cross-links { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 2rem; justify-content: center; }

/* =============================================================
   MOBILE: Clean rewrite — όλα σε καθαρό block stack
   ============================================================= */
@media (max-width: 720px) {
  /* Hard reset για το page section */
  .nomos-page,
  .nomos-page * {
    box-sizing: border-box !important;
    max-width: 100% !important;
  }
  .nomos-page {
    padding: .75rem .55rem 2rem !important;
    width: 100% !important;
    overflow-x: hidden !important;
  }

  /* HERO: simple block stack — ΟΧΙ flex */
  .nomos-hero {
    display: block !important;
    padding: .9rem !important;
    margin: 0 0 .9rem 0 !important;
    border-radius: 12px !important;
  }
  .nomos-hero > * {
    display: block !important;
    width: 100% !important;
    margin: 0 0 .7rem 0 !important;
    float: none !important;
    position: static !important;
  }
  .nomos-hero > *:last-child { margin-bottom: 0 !important; }

  .nomos-hero .hero-left { padding: 0 !important; }
  .nomos-hero .region-tag {
    display: inline-block !important;
    margin-bottom: .4rem !important;
  }
  .nomos-hero h1 {
    font-size: 1.25rem !important;
    line-height: 1.2 !important;
    margin: .25rem 0 .45rem 0 !important;
    word-break: break-word;
  }
  .nomos-hero .hero-sub {
    font-size: .82rem !important;
    margin: 0 !important;
    line-height: 1.4 !important;
  }

  /* COUNTERS: flex row of 2 με ίσα μερίδια */
  .nomos-hero .hero-counters {
    display: flex !important;
    flex-direction: row !important;
    gap: .5rem !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
  }
  .nomos-hero .counter {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    padding: .65rem .35rem !important;
    text-align: center !important;
  }
  .counter-num { font-size: 1.45rem !important; line-height: 1 !important; display: block; }
  .counter-label { font-size: .65rem !important; line-height: 1.2 !important; margin-top: .25rem !important; }

  /* SEARCH (στο /nomoi) */
  .hero-search { min-width: 0 !important; width: 100% !important; }
  .search-wrap input[type="search"] {
    padding: .55rem 2.2rem .55rem 2.1rem !important;
    font-size: .9rem !important;
  }
  .search-count { text-align: left !important; font-size: .75rem !important; }

  /* CARDS */
  .card {
    padding: .85rem .65rem 1rem !important;
    margin: 0 0 .9rem 0 !important;
    border-radius: 10px !important;
    display: block !important;
    width: 100% !important;
  }
  .card > * { max-width: 100% !important; }
  .card h2 {
    font-size: 1rem !important;
    gap: .45rem !important;
    margin: 0 0 .6rem 0 !important;
    word-break: break-word;
  }
  .chart-title { font-size: .9rem !important; margin: .9rem 0 .4rem !important; }
  .muted { font-size: .8rem !important; }

  /* MAP */
  .mini-map { height: 280px !important; min-height: 240px; }

  /* ACTIVE FIRES */
  .active-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: .5rem !important;
  }
  .fire-card {
    padding: .65rem !important;
    width: 100% !important;
  }
  .fire-card-head {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: .3rem !important;
    justify-content: space-between !important;
  }
  .fire-card-title {
    font-size: .85rem !important;
    line-height: 1.3 !important;
    word-break: break-word;
  }
  .fire-card-meta {
    font-size: .72rem !important;
  }
  .fire-card-meta span { word-break: break-all; }

  /* STATS GRID — 2 col strict */
  .stats-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: .45rem !important;
  }
  .stat-card { padding: .55rem .4rem !important; min-height: 0 !important; }
  .stat-val { font-size: 1.15rem !important; line-height: 1.1; }
  .stat-val small { font-size: .65rem !important; }
  .stat-label { font-size: .68rem !important; line-height: 1.2 !important; margin-top: .2rem !important; }

  /* MONTHLY BARS */
  .monthly-bars {
    display: grid !important;
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
    gap: .1rem !important;
    height: 120px !important;
    overflow: hidden !important;
    padding: 0 .1rem !important;
  }
  .bar-wrap { min-width: 0 !important; }
  .bar-val { font-size: .55rem !important; min-height: 1em !important; }
  .bar { width: 90% !important; max-width: none !important; }
  .bar-label { font-size: .55rem !important; transform: none !important; }

  /* YEAR COMPARE */
  .year-compare {
    display: flex !important;
    height: 150px !important;
    gap: .2rem !important;
  }
  .year-col .bar-val { font-size: .58rem !important; }
  .year-col .bar-label { font-size: .65rem !important; }

  /* FILTERS — vertical stack */
  .hist-filters {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: .55rem !important;
    padding: .65rem !important;
    margin-bottom: .8rem !important;
  }
  .filter-field {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  .filter-field select,
  .filter-field input { width: 100% !important; }
  .filter-actions {
    display: flex !important;
    gap: .4rem !important;
    width: 100% !important;
  }
  .filter-actions > * { flex: 1 1 0 !important; justify-content: center !important; }

  /* TABLE: horizontal scroll, never overflow page */
  .table-wrap {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
  }
  .hist-table {
    width: 100% !important;
    font-size: .76rem !important;
  }
  .hist-table th, .hist-table td {
    padding: .4rem .45rem !important;
    white-space: nowrap;
  }
  /* Κρύψε τις λιγότερο κρίσιμες στήλες */
  .hist-table th:nth-child(2), .hist-table td:nth-child(2),  /* Ώρα */
  .hist-table th:nth-child(6), .hist-table td:nth-child(6) { /* Lat/Lon */
    display: none !important;
  }

  .hist-summary { font-size: .8rem !important; }

  /* PAGINATION */
  .pagination {
    flex-wrap: wrap !important;
    gap: .5rem !important;
    font-size: .82rem !important;
  }

  /* TOP LIST */
  .top-list { padding: 0 !important; margin: 0 !important; }
  .top-row {
    display: grid !important;
    grid-template-columns: 24px minmax(0,1fr) auto !important;
    gap: .45rem !important;
    padding: .5rem .65rem !important;
    align-items: center !important;
  }
  .top-row .top-bar { display: none !important; }
  .top-name {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    min-width: 0 !important;
    font-size: .85rem !important;
  }
  .top-count { font-size: .8rem !important; font-weight: 700 !important; white-space: nowrap; }
  .rank { font-size: .85rem !important; }

  /* REGION TILES (στο /nomoi) */
  .region-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: .5rem !important;
  }
  .pref-tile {
    display: block !important;
    padding: .65rem .65rem !important;
    min-height: 0 !important;
  }
  .pref-name {
    font-size: .85rem !important;
    line-height: 1.2 !important;
    margin: 0 0 .3rem 0 !important;
    word-break: break-word;
  }
  .pref-stats {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: .2rem !important;
  }
  .pill {
    font-size: .62rem !important;
    padding: .08rem .35rem !important;
    line-height: 1.4 !important;
    white-space: nowrap;
  }

  /* BREADCRUMBS */
  .breadcrumbs {
    font-size: .78rem !important;
    margin-bottom: .6rem !important;
    flex-wrap: wrap;
  }

  /* CROSS-LINKS — full width vertical */
  .cross-links {
    display: flex !important;
    flex-direction: column !important;
    gap: .4rem !important;
    margin-top: 1.2rem !important;
  }
  .cross-links a {
    width: 100% !important;
    justify-content: center !important;
  }
}

/* Πολύ μικρές οθόνες (≤380px) — single column για stats/region */
@media (max-width: 380px) {
  .nomos-hero h1 { font-size: 1.1rem !important; }
  .stats-grid { grid-template-columns: 1fr !important; }
  .region-grid { grid-template-columns: 1fr !important; }
  .monthly-bars { height: 100px !important; }
  .bar-val { display: none !important; }
  .nomos-hero .hero-counters .counter { padding: .5rem .25rem !important; }
  .counter-num { font-size: 1.3rem !important; }
}

/* =============================================================
   AJAX search για /nomoi
   ============================================================= */
.hero-search { flex: 0 0 auto; min-width: 280px; }
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-wrap input[type="search"] {
  width: 100%;
  padding: .65rem 2.3rem .65rem 2.4rem;
  border: 1px solid var(--border-color);
  border-radius: 24px;
  background: var(--bg-color);
  color: var(--text-color);
  font-size: .95rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-wrap input[type="search"]:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(214,53,0,.15);
}
.search-wrap input[type="search"]::-webkit-search-cancel-button { display: none; }
.search-icon {
  position: absolute;
  left: .9rem;
  color: var(--text-secondary);
  pointer-events: none;
  font-size: .9rem;
}
.search-clear {
  position: absolute;
  right: .5rem;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-tertiary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background .15s, color .15s;
}
.search-clear:hover { background: var(--accent-color); color: #fff; }
.search-count { margin-top: .4rem; font-size: .8rem; color: var(--text-secondary); text-align: right; }

.search-empty {
  background: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  border-radius: 10px;
  padding: 1.2rem;
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}
.search-empty i { color: var(--accent-color); margin-right: .35rem; }

/* =============================================================
   AGGRESSIVE MOBILE FIXES — να μη πέφτουν κείμενα πάνω σε άλλα
   ============================================================= */
@media (max-width: 720px) {
  .nomos-page { padding: .85rem .6rem 2rem !important; max-width: 100%; }

  /* Hero σε καθαρό vertical layout */
  .nomos-hero {
    display: block !important;
    margin-bottom: 1rem;
  }
  .nomos-hero .hero-left { margin-bottom: 1rem; }
  .hero-counters { display: flex !important; }
  .hero-search { min-width: 0 !important; width: 100%; margin-top: .8rem; }
  .search-count { text-align: left; }

  /* Cards: σαφή vertical spacing */
  .card { overflow: visible; }
  .card > * { min-width: 0; }

  /* Active fire cards: 1 column */
  .active-grid { grid-template-columns: 1fr !important; }
  .fire-card { padding: .7rem; }
  .fire-card-head { flex-wrap: wrap; gap: .3rem; }
  .fire-card-title { word-break: break-word; }
  .fire-card-meta span { word-break: break-all; }

  /* Πίνακας ιστορικού: word-break και max-content */
  .table-wrap { max-width: 100%; }
  .hist-table { table-layout: auto; min-width: 100%; }
  .hist-table td { word-break: break-word; }

  /* Monthly bars: δώσε χώρο για labels */
  .monthly-bars {
    grid-template-columns: repeat(12, minmax(0,1fr)) !important;
    overflow: hidden;
    padding: 0 .15rem;
  }
  .bar-label {
    font-size: .58rem;
    transform: rotate(-25deg);
    transform-origin: top center;
    margin-top: .15rem;
    white-space: nowrap;
  }

  /* Top list: φρέσκος κανόνας — ποτέ overflow */
  .top-row {
    grid-template-columns: 24px 1fr auto !important;
    gap: .4rem !important;
    padding: .55rem .65rem !important;
  }
  .top-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .top-count { font-size: .85rem; }

  /* Region tiles: τα pills όχι overflow */
  .pref-tile { padding: .65rem .7rem !important; min-height: 0; }
  .pref-name { font-size: .88rem !important; line-height: 1.2; }
  .pref-stats { gap: .25rem !important; flex-wrap: wrap; }
  .pill { font-size: .65rem !important; padding: .1rem .35rem !important; line-height: 1.35; }

  /* Year-compare: γραμματάκια πιο μικρά */
  .year-col .bar-val { font-size: .6rem; }
  .year-col .bar-label { font-size: .68rem; }

  /* Filters in stats page (.inline): vertical-ish */
  .hist-filters.inline { flex-direction: column; align-items: stretch; gap: .6rem; }

  /* Στατιστικά: top-list πιο compact */
  .top-list li { margin-bottom: .25rem; }
}

@media (max-width: 480px) {
  .nomos-page { padding: .75rem .5rem 2rem !important; }
  .nomos-hero { padding: .9rem !important; }
  .nomos-hero h1 { font-size: 1.15rem !important; }
  .hero-sub { font-size: .8rem !important; }
  .counter { padding: .55rem .35rem !important; }
  .counter-num { font-size: 1.4rem !important; line-height: 1; }
  .counter-label { font-size: .65rem !important; line-height: 1.2; }

  .card { padding: .85rem .65rem !important; border-radius: 10px; }
  .card h2 { font-size: .98rem !important; }

  .mini-map { height: 260px !important; }

  /* Πίνακας: κράτησε μόνο τις σημαντικότερες στήλες */
  .hist-table { font-size: .76rem; }
  .hist-table th, .hist-table td { padding: .4rem .35rem; }
  .hist-table th:nth-child(5), .hist-table td:nth-child(5) { display: none; } /* Εμπιστοσύνη */

  .top-row { grid-template-columns: 22px 1fr auto !important; padding: .5rem .55rem !important; }
  .top-name { font-size: .82rem; }
  .top-count { font-size: .78rem; }
  .rank { font-size: .85rem; }
}
