    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body, html {
      height: 100%;
      font-family: Arial, sans-serif;
    }

    .container {
      display: flex;
      height: 100vh;
      overflow: hidden;
    }

@font-face {
  font-family: 'Conamore';
  src: url('/static/fonts/Conamore-Bold.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

    /* Lewy panel */
.left-panel {
  background-color: #f5f5f5;
  width: 250px;
  min-width: 150px;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  border-right: 2px solid #ccc;
  position: relative;
  height: 100vh; /* zachowaj pełną wysokość */
}

.left-buttons {
  display: flex;
  justify-content: space-between;
  background-color: #e0e0e0;
  flex-shrink: 0; /* niech nie zmienia wysokości */
}

    .left-buttons .btn {
      flex: 1;
      height: 60px;
      border: 1px solid #ccc;
      background-color: #fff;
      display: flex;
      justify-content: center;
      align-items: center;
      cursor: pointer;
      transition: background 0.2s;
    }

    .left-buttons .btn:hover {
      background-color: #ddd;
    }

.left-content {
  flex: 1;
  overflow-y: auto;   /* <-- najważniejsze: przewijanie w pionie */
  overflow-x: hidden;
  padding: 10px;
  color: #888;
  background-color: #f9f9f9;
  scrollbar-width: thin; /* dla Firefoxa */
}

    /* Separator */
    .resizer {
      width: 5px;
      cursor: col-resize;
      background-color: #ccc;
    }

    /* Prawy panel */
    .right-panel {
      flex: 1;
      display: flex;
      flex-direction: column;
    }

    /* Pasek górny */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px; /* albo dopasuj do swojej wartości */
  padding: 0 15px;
  /*background-color: #333;*/
  color: white;
  box-sizing: border-box;
  background: linear-gradient(90deg, white 0%, #007BFF 100%);
}

.top-left {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
}

#logo {
  height: 100%;          /* wypełnia wysokość rodzica */
  width: auto;           /* szerokość dopasowana proporcjonalnie */
  object-fit: contain;   /* zachowuje proporcje */
  display: block;
}

.title {
  font-family: 'Conamore', sans-serif;
  font-size: 1.6em;
  font-weight: normal;          /* już nie potrzeba 1000, bo to custom font */
  white-space: nowrap;
  color: #E40A24;
}

.top-right {
  display: flex;
  align-items: center;
}

    .settings-btn {
      background-color: #555;
      border: none;
      color: white;
      padding: 8px 16px;
      cursor: pointer;
      border-radius: 4px;
      transition: background 0.2s;
    }

    .settings-btn:hover {
      background-color: #777;
    }

    /* Górne przyciski w prawym panelu */
    .right-buttons {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      grid-template-rows: repeat(1, 50px);
      padding: 10px;
      background-color: #f0f0f0;
    }

    .right-buttons .btn {
      border: 1px solid #ccc;
      background-color: #fff;
      display: flex;
      justify-content: center;
      align-items: center;
      cursor: pointer;
      transition: background 0.2s;
    }

    .right-buttons .btn:hover {
      background-color: #ddd;
    }

    /* Treść główna */
.right-content {
  flex: 1;
  display: flex;
  flex-direction: column; /* pionowo */
  align-items: stretch;   /* rozciąga w poziomie */
  justify-content: flex-start; /* od góry */
  color: #aaa;
  overflow: hidden;       /* przewijanie kontrolujemy w wewnętrznym wrapperze */
}

/* Aktywny przycisk */
.right-buttons .btn.active {
  background-color: #ddd;
  font-weight: bold;
}

    /* Lista sensorów w lewym panelu */
.sensor-list {
  list-style: none;
  width: 100%;
  padding: 10px;
}

.sensor-item {
  background-color: #fff;
  border: 1px solid #ccc;
  margin-bottom: 6px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s;
  border-radius: 4px;
}

.sensor-item:hover {
  background-color: #ddd;
}

.left-content::-webkit-scrollbar {
  width: 8px;
}

.left-content::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 4px;
}

.left-content::-webkit-scrollbar-thumb:hover {
  background-color: #999;
}

.meta-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}

.meta-table th, .meta-table td {
  border: 1px solid #ccc;
  padding: 6px 8px;
  text-align: left;
  font-size: 14px;
}

.meta-bottom {
  display: flex;
  gap: 10px;
  height: 400px;
}

.map {
  width: 100%;
  height: 350px;
  border: 1px solid #ccc;
  border-radius: 10px;
}

.spiral-chart {
  flex: 1;
  height: 100%;
  border: 1px solid #ccc;
  border-radius: 8px;
}

.right-buttons .btn.active {
  background-color: #ccc;
  font-weight: bold;
}

.right-content-inner {
  padding: 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Układ dwukolumnowy dla metadanych */
.meta-layout {
  display: flex;
  gap: 20px;
  height: 100%;
  overflow: hidden;          /* zapobiega poziomemu scrollowi */
  flex-wrap: nowrap;
}

/* Lewa kolumna: tabela + mapa pionowo */
.meta-left {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
  min-width: 45%;
}

/* Prawa kolumna: wykres spiralności */
.meta-right {
  flex: 1;
  max-width: 50%;            /* dopasowanie do ekranu */
  overflow: hidden;          /* ukrywa nadmiarowy canvas */
  border: 1px solid #ccc;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  box-sizing: border-box;
  display: flex;
}

.meta-right canvas {
  max-width: 100%;
  width: 100%;
  height: 100%;
  display: block;
}

.meta-layout, .meta-left, .meta-right {
  min-width: 0;
}

.meta-left, .meta-right {
  flex: 1;       /* zajmuje całą dostępną przestrzeń */
  min-width: 0;  /* pozwala dzieciom zmniejszać się przy resize */
}

.meta-left .map {
  flex: 1;
  width: 100%;
  min-height: 200px; /* minimalna wysokość */
}

/* Responsywność – na małych ekranach wykres pod spodem */
@media (max-width: 1000px) {
  .meta-layout {
    flex-direction: column;
  }
  .meta-right {
    max-width: 100%;
    height: 400px;
  }
}

/* layout dla total displacement */
.totaldisp-layout {
  display: flex;
  gap: 10px;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.totaldisp-chart {
  flex: 1;
  min-width: 0;            /* <-- krytyczne: pozwala itemowi się kurczyć */
  display: flex;
  flex-direction: column;
  background: #fff;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 10px;
  box-sizing: border-box;
}

/* canvas wewnątrz musi rozciągać się i nie wymuszać min-width */
.totaldisp-chart canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  max-width: 100%;
}