/* Custom styles for the ANM Climatological Shiny Platform (RoCliHom + Eurometeo styling) */
:root {
  --rc-bg: #f8fafc;
  --rc-surface: #ffffff;
  --rc-surface-subtle: #f1f5f9;
  --rc-navy: #0f172a;
  --rc-text: #1e293b;
  --rc-muted: #475569;
  --rc-accent: #2563eb;
  --rc-sky: #0369a1;
  --rc-border: #cbd5e1;
  --rc-border-subtle: #e2e8f0;
  --rc-radius-sm: 6px;
  --rc-radius-md: 8px;
  --rc-radius-lg: 10px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--rc-bg);
  color: var(--rc-text);
}

/* WCAG 2.2 AA Skip-to-Main-Content Link (visible on keyboard focus) */
.skip-to-main-link {
  position: fixed;
  top: -120px;
  left: 14px;
  z-index: 10000;
  background-color: var(--rc-navy);
  color: #ffffff !important;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--rc-radius-md);
  border: 2px solid #93c5fd;
  text-decoration: none !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.28);
  transition: top 0.15s ease;
}

.skip-to-main-link:focus,
.skip-to-main-link:focus-visible {
  top: 10px;
}

#roclima-main-content:focus {
  outline: none;
}

/* Application Top Title & ANM Logo Header */
.roclima-header-banner {
  margin-top: 20px;
  margin-bottom: 10px;
}

.roclima-app-header {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 2px 0;
}

.roclima-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  background: var(--rc-surface);
  border: 1px solid var(--rc-border-subtle);
  border-radius: var(--rc-radius-md);
  padding: 3px 8px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.roclima-logo-link:hover {
  border-color: #94a3b8;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.09);
}

.roclima-header-logo {
  height: 44px;
  width: auto;
  display: block;
  object-fit: contain;
}

.roclima-header-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 700;
  color: var(--rc-navy);
  letter-spacing: -0.01em;
}

.roclima-beta-badge,
.roclima-beta-badge:visited {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 999px;
  padding: 4px 11px;
  text-decoration: none !important;
  line-height: 1.2;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 2px rgba(245, 158, 11, 0.15);
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.roclima-beta-badge:hover,
.roclima-beta-badge:focus {
  color: #78350f;
  background: #fde68a;
  border-color: #d97706;
  text-decoration: none !important;
}

.well {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

/* Map Wrapper Card */
.map-wrapper-card {
  position: relative;
  height: 460px;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  background: #f1f5f9;
}

/* Collapsible Map Control Styling (from alexdum/ghcnm & eurometeo) */
.map-layer-control {
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.14);
  padding: 5px;
  width: 36px;
  height: 36px;
  overflow: hidden;
  transition: width 0.25s ease, height 0.25s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.map-layer-control.expanded {
  width: 225px;
  height: auto;
  padding: 10px 12px;
}

.control-icon {
  width: 24px;
  height: 24px;
  text-align: center;
  margin-bottom: 4px;
  font-size: 16px;
  color: #334155;
  flex-shrink: 0;
}

.control-content {
  opacity: 0;
  transition: opacity 0.25s ease;
  margin-top: 2px;
  white-space: nowrap;
}

.map-layer-control.expanded .control-content {
  opacity: 1;
  white-space: normal;
}

.map-layer-control.expanded .control-icon {
  display: none !important;
}

.map-layer-control .control-content label {
  font-size: 12px;
  font-weight: 500;
  color: #334155;
}

#zoom_home_panel {
  z-index: 999 !important;
}

.btn-home {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
  color: #334155;
  width: 34px;
  height: 34px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-home:hover {
  background: #f8fafc;
  color: #0f172a;
}

/* Prevent Shiny .recalculating opacity fade/flicker on floating map overlays & breadcrumb bar */
.map-wrapper-card .shiny-html-output.recalculating,
.map-wrapper-card .recalculating,
#clean_url_breadcrumb_bar.recalculating {
  opacity: 1 !important;
  transition: none !important;
}

/* Top-Left Floating Symbol Metric Pill Switcher (Valoare / Medie | Anomalie | Tendință) */
.map-symbol-pills-overlay {
  position: absolute;
  top: 10px;
  left: 49px;
  z-index: 955;
}

.map-symbol-pills-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.map-symbol-pill {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  min-width: 26px;
  border: none;
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--rc-muted);
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.map-symbol-pill:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.map-symbol-pill.active,
.map-symbol-pill.active:hover {
  color: #ffffff;
  background: #0284c7;
  box-shadow: 0 1px 3px rgba(2, 132, 199, 0.35);
}

/* Eurometeo Top-Right Extent Summary Card */
.eurometeo-summary-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 950;
  width: 176px;
}

.eurometeo-summary-card {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  font-size: 11px;
  color: #334155;
  text-align: left;
}

.summary-card-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 5px;
  margin-bottom: 5px;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.25;
  letter-spacing: 0.01em;
  color: #1e293b;
  text-align: left;
}

.summary-hdr-title {
  display: block;
  width: 100%;
  word-break: break-word;
}

.summary-stn-pill {
  display: inline-block;
  background: #dbeafe;
  color: #1d4ed8;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  line-height: 1.3;
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
  white-space: nowrap;
}

.summary-stat-row {
  display: grid;
  grid-template-columns: minmax(44px, auto) minmax(0, 1fr);
  column-gap: 6px;
  align-items: baseline;
  padding: 2px 0;
  text-align: left;
}

.summary-stat-row + .summary-stat-row {
  border-top: 1px solid #f1f5f9;
  padding-top: 4px;
  margin-top: 2px;
}

.summary-stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--rc-muted);
  text-align: left;
}

.summary-stat-label.max-lbl { color: #dc2626; }
.summary-stat-label.min-lbl { color: #2563eb; }

.summary-stat-val {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--rc-navy);
  text-align: left;
  line-height: 1.25;
}

.summary-stat-sub {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--rc-muted);
  text-align: left;
  line-height: 1.2;
  margin-top: 1px;
}

/* Eurometeo Bottom-Right Floating Color Scale Legend */
.eurometeo-legend-overlay {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 950;
}

/* MapLibre Bottom-Left Compact Attribution / Copyright Control (expands only on click) */
.map-wrapper-card .maplibregl-ctrl-bottom-left {
  z-index: 960;
  max-width: calc(100% - 115px);
}

.map-wrapper-card .maplibregl-ctrl.maplibregl-ctrl-attrib {
  position: relative !important;
  display: block !important;
  box-sizing: border-box !important;
  background-color: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(6px);
  border: 1px solid #cbd5e1;
  border-radius: 16px !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
  margin: 0 0 10px 10px !important;
  min-height: 28px !important;
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

.map-wrapper-card .maplibregl-ctrl.maplibregl-ctrl-attrib:not(.roclima-attrib-expanded) {
  width: 28px !important;
  height: 28px !important;
  padding: 0 !important;
}

.map-wrapper-card .maplibregl-ctrl-attrib .maplibregl-ctrl-attrib-button {
  display: block !important;
  position: absolute !important;
  left: 2px !important;
  right: auto !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 22px !important;
  height: 22px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 50%;
  cursor: pointer;
  background-color: transparent !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
}

.map-wrapper-card .maplibregl-ctrl-attrib:not(.roclima-attrib-expanded) .maplibregl-ctrl-attrib-inner {
  display: none !important;
}

.map-wrapper-card .maplibregl-ctrl.maplibregl-ctrl-attrib.roclima-attrib-expanded {
  width: auto !important;
  height: auto !important;
  padding: 4px 12px 4px 28px !important;
}

.map-wrapper-card .maplibregl-ctrl-attrib.roclima-attrib-expanded .maplibregl-ctrl-attrib-inner {
  display: block !important;
  margin: 0 !important;
  font-size: 11px;
  line-height: 18px;
  color: #334155;
  white-space: normal;
}

.eurometeo-legend {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 12px 10px 12px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
  font-size: 11px;
  color: #334155;
  min-width: 86px;
}

.eurometeo-legend-title {
  font-weight: 700;
  font-size: 11px;
  text-align: center;
  color: #334155;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.eurometeo-stops-container {
  display: flex;
  flex-direction: column;
  padding-right: 44px;
  padding-bottom: 6px;
  padding-top: 1px;
  max-height: 195px;
  overflow-y: auto;
}

.eurometeo-stop-row {
  position: relative;
  height: 11px;
  flex-shrink: 0;
}

.eurometeo-stop-swatch {
  width: 18px;
  height: 100%;
  opacity: 0.92;
}

.eurometeo-stop-label {
  position: absolute;
  left: 22px;
  bottom: 0;
  transform: translateY(50%);
  font-size: 10px;
  font-weight: 600;
  color: #475569;
  line-height: 1;
  white-space: nowrap;
}

.eurometeo-grad-wrap {
  position: relative;
  height: 148px;
  width: 62px;
  margin: 4px 0;
}

.eurometeo-grad-wrap.spei-grad-wrap {
  height: 164px;
  width: 126px;
}

.eurometeo-grad-svg {
  width: 18px;
  height: 148px;
  display: block;
}

.eurometeo-grad-svg.spei-grad-svg {
  height: 164px;
}

.eurometeo-grad-label {
  position: absolute;
  left: 23px;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 600;
  color: #475569;
  line-height: 1;
  white-space: nowrap;
}

.eurometeo-tier-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 0;
  font-size: 11px;
  font-weight: 600;
  color: #334155;
}

.tier-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid #1e293b;
  flex-shrink: 0;
}

/* KPI Metric Cards Row */
.kpi-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 14px 0;
}

@media (max-width: 992px) {
  .kpi-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.kpi-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 11px 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.kpi-card-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--rc-muted);
  margin-bottom: 4px;
}

.kpi-card-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--rc-navy);
  line-height: 1.2;
}

.kpi-card-sub {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--rc-muted);
  margin-top: 3px;
}

.kpi-pos { color: #dc2626; }
.kpi-neg { color: #2563eb; }
.kpi-wet { color: #0d9488; }
.kpi-dry { color: #b45309; }

/* Station Tabs Container */
.station-tabs-container {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  margin-bottom: 24px;
}

.station-tabs-container .nav-tabs {
  padding: 8px 12px 0 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.station-tabs-container .nav-tabs > li > a {
  font-weight: 600;
  font-size: 13px;
  color: #475569;
  border-radius: 8px 8px 0 0;
  padding: 9px 14px;
}

.station-tabs-container .nav-tabs > li.active > a,
.station-tabs-container .nav-tabs > li.active > a:hover,
.station-tabs-container .nav-tabs > li.active > a:focus {
  color: #1d4ed8;
  background-color: #ffffff;
  border-color: #e2e8f0 #e2e8f0 transparent;
}

.tab-pane-inner {
  padding: 16px;
}

.tab-toolbar {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 12px;
}

.tab-toolbar .form-group {
  margin-bottom: 0;
}

.tab-toolbar .checkbox {
  margin-top: 2px;
  margin-bottom: 2px;
}

.d-flex-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.year-step-btns, .download-btns {
  display: flex;
  gap: 8px;
  align-items: center;
}

.toolbar-note {
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
}

.record-table-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.record-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
  margin-top: 2px;
  margin-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 6px;
}

.section-subtitle {
  font-size: 13.5px;
  font-weight: 700;
  color: #1e293b;
  margin-top: 16px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e2e8f0;
}

/* Dedicated Plot Card & Header (prevents Plotly title/subtitle/legend crowding) */
.plot-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 14px 6px 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.plot-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid #f1f5f9;
}

.plot-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.plot-card-badge {
  display: inline-flex;
  align-items: center;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* Top Map / Data / Info Tabbed Container */
.map-tabs-container {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  margin-bottom: 4px;
}

.map-tabs-container .nav-tabs {
  background: #f8fafc;
  padding: 8px 12px 0 12px;
  border-bottom: 1px solid #e2e8f0;
}

.map-tabs-container .nav-tabs > li > a {
  font-weight: 600;
  font-size: 13px;
  color: #475569;
  border-radius: 8px 8px 0 0;
  padding: 8px 14px;
}

.map-tabs-container .nav-tabs > li.active > a,
.map-tabs-container .nav-tabs > li.active > a:hover,
.map-tabs-container .nav-tabs > li.active > a:focus {
  color: #1d4ed8;
  background-color: #ffffff;
  border-color: #e2e8f0 #e2e8f0 transparent;
}

.map-tabs-container .map-wrapper-card {
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.full-tab-pane-card {
  padding: 16px 18px;
  background: #ffffff;
}

.map-data-table-full {
  max-height: 75vh;
  overflow-y: auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--rc-border-subtle);
  border-radius: var(--rc-radius-md);
}

.map-data-table-full table {
  margin-bottom: 0;
  font-size: 12.5px;
}

.map-data-table-full thead th {
  position: sticky;
  top: 0;
  background: var(--rc-surface-subtle);
  color: var(--rc-navy);
  font-weight: 700;
  z-index: 2;
  border-bottom: 2px solid var(--rc-border) !important;
}

@media (max-width: 991px) {
  .map-data-table-full table th:first-child,
  .map-data-table-full table td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background-color: #ffffff;
  }

  .map-data-table-full table thead th:first-child {
    z-index: 3;
    background-color: var(--rc-surface-subtle);
  }
}

/* Info & Methodology Tab Styling */
.info-methodology-scroll {
  display: block;
  line-height: 1.6;
  font-size: 13.5px;
  color: #334155;
}

.info-doc-section {
  margin-bottom: 12px;
}

.info-doc-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  margin-top: 2px;
  margin-bottom: 8px;
}

.info-doc-section ul,
.info-doc-section ol {
  padding-left: 20px;
  margin-bottom: 8px;
}

.info-doc-section li {
  margin-bottom: 6px;
}

.info-hr {
  margin: 14px 0;
  border-top: 1px solid #e2e8f0;
}

.flag-pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  margin-right: 4px;
}

.flag-pill.flag-0 {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.flag-pill.flag-1 {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
}

.flag-pill.flag-2 {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.math-formula-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #2563eb;
  border-radius: 8px;
  padding: 10px 16px;
  margin: 8px 0 10px 0;
  overflow-x: auto;
  font-size: 14.5px;
  color: #0f172a;
}

.manual-subcard {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #0284c7;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 8px 0 12px 0;
}

.manual-subtitle {
  font-size: 13.8px;
  font-weight: 700;
  color: #0f172a;
  margin-top: 2px;
  margin-bottom: 6px;
}

.manual-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 12px 0;
  font-size: 12.8px;
}

.manual-table th,
.manual-table td {
  border: 1px solid #cbd5e1;
  padding: 6px 10px;
  vertical-align: top;
  text-align: left;
}

.manual-table th {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 700;
}

/* Hierarchical Clean URL & Breadcrumb Bar */
.roclima-breadcrumb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 6px 12px;
  margin-bottom: 10px;
  font-size: 12px;
  color: #334155;
}

.breadcrumb-trail {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.breadcrumb-root {
  font-weight: 700;
  color: #0f172a;
}

.breadcrumb-sep {
  color: #94a3b8;
  font-weight: 600;
  padding: 0 1px;
}

.breadcrumb-pill {
  display: inline-block;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 1px 7px;
  font-weight: 600;
  color: #1e293b;
}

.breadcrumb-pill-active {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.clean-url-box {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}

.clean-url-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  color: #0369a1;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  border-radius: 5px;
  padding: 2px 7px;
  max-width: 440px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-copy-url,
.btn-reset-url,
.btn-feedback-url {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 26px;
  min-width: 26px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  padding: 3px 9px;
  border-radius: 5px;
  cursor: pointer;
}

.btn-copy-url {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #0f172a;
}

.btn-copy-url:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.btn-reset-url {
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.btn-reset-url:hover {
  background: #ffedd5;
  border-color: #fdba74;
}

.btn-feedback-url {
  border: 1px solid #bae6fd;
  background: #f0f9ff;
  color: #0369a1;
}

.btn-feedback-url:hover {
  background: #e0f2fe;
  border-color: #7dd3fc;
}

/* Invisible Honeypot Wrapper for Anti-Bot Protection */
.roclima-hp-wrap {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ============================================================================
   MODERN WEB ENHANCEMENTS (CLS Prevention, Tabular Numerals, Loading States,
   WCAG 2.2 Focus/Motion, Responsive Mobile/Touch UX, Footer & Print)
   ============================================================================ */

/* 1. Anti-CLS (Cumulative Layout Shift) Reservations for Above-the-Fold Dynamic Containers */
#clean_url_breadcrumb_bar {
  min-height: 38px;
}

#station_kpi_cards,
#regional_kpi_cards {
  min-height: 86px;
}

/* 2. Scientific Typography — Tabular Numerals (prevents horizontal jitter on date/year stepping) */
.kpi-card-value,
.kpi-card-sub,
.summary-stat-val,
.summary-stat-sub,
.plot-card-badge,
.clean-url-code,
.eurometeo-stop-label,
.eurometeo-grad-label,
.map-data-table-full td,
.manual-table td,
.record-table-card td,
#station_stats_table td,
#regional_summary_table td,
#station_periods_table td {
  font-variant-numeric: tabular-nums;
}

/* 3. Modern Styling for Sidebar Station Summary Output & Sticky Table Headers */
#station_summary {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 9px 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.45;
  color: #1e293b;
  margin-bottom: 4px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

#regional_summary_table thead th,
#station_stats_table thead th,
#station_periods_table thead th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 700;
  z-index: 2;
  border-bottom: 2px solid #cbd5e1 !important;
}

/* 4. Perceived Performance — Smooth Recalculating Indicator Bar */
.plot-card {
  position: relative;
  overflow: hidden;
}

.recalculating {
  opacity: 0.55 !important;
  transition: opacity 0.18s ease-in-out;
}

.plot-card:has(.recalculating)::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #dbeafe 0%, #2563eb 50%, #dbeafe 100%);
  background-size: 200% 100%;
  animation: roclima-loading-bar 1.15s linear infinite;
  z-index: 10;
}

@keyframes roclima-loading-bar {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 5. Accessibility (WCAG 2.2 AA Keyboard Focus, WAI-ARIA Modal Close & Reduced Motion) */
#shiny-modal .modal-content {
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 20px 25px -5px rgba(15, 23, 42, 0.18), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
}

.roclima-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 5;
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  padding: 13px 16px;
}

.roclima-modal-header::before,
.roclima-modal-header::after {
  display: none !important;
  content: none !important;
}

.roclima-modal-header .modal-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: #0f172a;
}

.roclima-modal-close {
  flex: 0 0 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  margin: -4px -4px -4px auto;
  padding: 0;
  background-color: transparent;
  color: #475569;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.roclima-modal-close:hover {
  background-color: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.roclima-modal-close:active {
  background-color: #e2e8f0;
  color: #0f172a;
}

@media (pointer: coarse), (max-width: 767px) {
  .roclima-modal-close {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
.control-icon:focus-visible,
.nav-tabs > li > a:focus-visible {
  outline: 2px solid #2563eb !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18) !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Sidebar Step Buttons, Info Notes & Mobile Collapsible Filter Toggle */
.sidebar-step-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: -6px;
  margin-bottom: 8px;
}

.sidebar-step-btns-year {
  margin-bottom: 10px;
}

.sidebar-step-btns .btn-xs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  min-width: 26px;
  padding: 3px 8px;
  font-weight: 600;
}

.sidebar-info-note-sky {
  font-size: 11.5px;
  color: #0369a1;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--rc-radius-sm);
  padding: 5px 8px;
  margin-bottom: 8px;
}

.sidebar-info-note-slate {
  font-size: 11.5px;
  color: #334155;
  background: var(--rc-bg);
  border: 1px solid var(--rc-border-subtle);
  border-radius: var(--rc-radius-sm);
  padding: 6px 8px;
  margin-bottom: 10px;
  line-height: 1.35;
}

.mobile-filters-toggle-btn {
  display: none;
}

/* 6. Responsive Mobile, Tablet & Touch UX */
@media (max-width: 767px) {
  .roclima-header-banner {
    margin-top: 12px;
    margin-bottom: 8px;
  }

  .roclima-app-header {
    gap: 10px;
  }

  .roclima-header-logo {
    height: 36px;
    width: auto;
  }

  .roclima-header-title {
    font-size: 18px;
    line-height: 1.25;
  }

  .mobile-filters-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-height: 40px;
    padding: 7px 11px;
    border-radius: var(--rc-radius-md);
    border: 1px solid var(--rc-border);
    background-color: var(--rc-bg);
    color: var(--rc-navy);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
  }

  .mobile-filters-toggle-btn:hover {
    background-color: var(--rc-surface-subtle);
  }

  .mobile-filters-toggle-main {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .mobile-filters-summary-badge {
    margin-left: auto;
    font-size: 11px;
    font-weight: 600;
    color: var(--rc-sky);
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    border-radius: 999px;
    padding: 1px 8px;
    white-space: nowrap;
  }

  .mobile-filters-chevron {
    font-size: 13px;
    color: var(--rc-muted);
    transition: transform 0.18s ease;
  }

  .mobile-filters-toggle-btn[aria-expanded="true"] .mobile-filters-chevron {
    transform: rotate(180deg);
  }

  .roclima-sidebar-collapsible:not(.is-mobile-open) {
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    margin: 0;
    padding: 0;
  }

  .roclima-sidebar-collapsible.is-mobile-open {
    max-height: none;
    overflow: visible;
    visibility: visible;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--rc-border-subtle);
  }

  .map-wrapper-card {
    height: 390px;
  }

  .map-symbol-pills-overlay {
    top: 8px;
    left: 46px;
    max-width: calc(100% - 210px);
  }

  .map-symbol-pills-group {
    flex-wrap: wrap;
    border-radius: 14px;
    padding: 2px;
  }

  .map-symbol-pill {
    padding: 3px 8px;
    font-size: 10.5px;
  }

  .eurometeo-summary-overlay {
    width: 156px;
    top: 8px;
    right: 8px;
  }

  .eurometeo-summary-card {
    padding: 6px 8px;
    font-size: 10px;
  }

  .summary-stat-row {
    grid-template-columns: minmax(40px, auto) minmax(0, 1fr);
    column-gap: 5px;
  }

  .eurometeo-legend-overlay {
    bottom: 8px;
    right: 8px;
  }

  .map-tabs-container .nav-tabs,
  .station-tabs-container .nav-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 1px;
  }

  .map-tabs-container .nav-tabs > li,
  .station-tabs-container .nav-tabs > li {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .tab-toolbar .shiny-input-container {
    width: 100% !important;
    max-width: 100% !important;
  }

  .clean-url-code {
    max-width: 210px;
  }
}

@media (max-width: 575px) {
  .kpi-cards-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .eurometeo-summary-overlay {
    width: 140px;
  }

  .map-symbol-pills-overlay {
    left: 44px;
    max-width: calc(100% - 194px);
  }
}

@media (pointer: coarse) {
  .btn-copy-url,
  .btn-reset-url,
  .btn-feedback-url,
  .sidebar-step-btns .btn-xs,
  .roclima-footer-btn {
    min-height: 36px;
    padding-top: 5px;
    padding-bottom: 5px;
  }
}

/* 7. Institutional Footer (`Meteo Romania`) & Print Media Styles */
.roclima-footer {
  margin-top: 20px;
  margin-bottom: 14px;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  font-size: 12px;
  color: #475569;
}

.roclima-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.roclima-footer-brand,
.roclima-footer-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.roclima-footer-link {
  font-weight: 600;
  color: #0369a1;
  text-decoration: none;
}

.roclima-footer-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.roclima-footer-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  background: transparent;
  border: none;
  padding: 2px 4px;
  border-radius: 4px;
  font-family: inherit;
  font-size: inherit;
  line-height: 1.25;
  cursor: pointer;
}

.roclima-footer-sep {
  color: #cbd5e1;
  padding: 0 2px;
}

/* 8. Top-Left Sidebar Compact Action Mini-Cards (`Stare actualizare` & `Resetare platformă`) */
.sidebar-top-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 11px;
}

.sidebar-action-card {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  padding: 7px 9px;
  border-radius: 8px;
  text-align: left;
  white-space: normal;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.sidebar-action-card:active {
  transform: translateY(1px);
}

.sidebar-action-card-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  min-width: 0;
}

.sidebar-action-card-title {
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 5px;
}

.sidebar-action-card-sub {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.85;
  line-height: 1.15;
}

.sidebar-card-status {
  color: #0369a1 !important;
  background-color: #f0f9ff !important;
  border: 1px solid #bae6fd !important;
}

.sidebar-card-status:hover,
.sidebar-card-status:focus {
  color: #075985 !important;
  background-color: #e0f2fe !important;
  border-color: #7dd3fc !important;
  box-shadow: 0 2px 5px rgba(3, 105, 161, 0.12);
}

.sidebar-card-reset {
  color: #9a3412 !important;
  background-color: #fff7ed !important;
  border: 1px solid #fed7aa !important;
}

.sidebar-card-reset:hover,
.sidebar-card-reset:focus {
  color: #7c2d12 !important;
  background-color: #ffedd5 !important;
  border-color: #fdba74 !important;
  box-shadow: 0 2px 5px rgba(154, 52, 18, 0.12);
}

@media (max-width: 1199px) and (min-width: 768px) {
  .sidebar-top-cards-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  .skip-to-main-link,
  .mobile-filters-toggle-btn,
  .well,
  .clean-url-box,
  .year-step-btns,
  .download-btns,
  .map-layer-control,
  .map-symbol-pills-overlay,
  #zoom_home_panel,
  .roclima-footer-actions {
    display: none !important;
  }

  .col-sm-9 {
    width: 100% !important;
  }

  .plot-card,
  .kpi-card,
  .station-tabs-container,
  .map-tabs-container {
    box-shadow: none !important;
    break-inside: avoid;
  }
}



