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

body {
  font-family: 'Courier New', Courier, monospace;
  height: 100vh;
  overflow: hidden;
  margin: 0;
  background: #ffffff;
  color: #000000;
  line-height: 1.6;
  transition: background 2.0s ease, color 2.0s ease;
}

body.dark {
  background: #1a1a1a;
  color: #e0e0e0;
}

.page-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  transition: background 2.0s ease;
}

.dark-mode-checkbox,
.menu-toggle {
  display: none;
}

/* === GÓRNY PASEK === */
.top-bar {
  background: #000000;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 56px;
  border-bottom: 2px solid #808080;
  flex-shrink: 0;
  transition: background 2.0s ease, color 2.0s ease, border-color 2.0s ease;
  z-index: 100000;
}

body.dark .top-bar {
  background: #0a0a0a;
  color: #e0e0e0;
}

.logo {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* === HAMBURGER (odwrócona logika) === */
.burger-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  padding: 6px;
  border: 1px solid transparent;
  transition: border-color 0.3s;
}

.burger-label:hover {
  border-color: #808080;
}

.burger-line {
  display: block;
  width: 22px;
  height: 2.5px;
  background: #ffffff;
  transform-origin: center;
  transition: transform 0.3s ease, opacity 0.2s ease, background 2.0s ease;
}

body.dark .burger-line {
  background: #e0e0e0;
}

/* Stan domyślny: X (menu zwinięte) */
.burger-label .line1 {
  transform: translateY(7.5px) rotate(45deg);
}

.burger-label .line2 {
  opacity: 0;
  transform: scaleX(0);
}

.burger-label .line3 {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* Menu rozwinięte → burger */
#menu-toggle:checked ~ .page-layout .burger-label .line1 {
  transform: translateY(0) rotate(0);
}

#menu-toggle:checked ~ .page-layout .burger-label .line2 {
  opacity: 1;
  transform: scaleX(1);
}

#menu-toggle:checked ~ .page-layout .burger-label .line3 {
  transform: translateY(0) rotate(0);
}

/* === PRZEŁĄCZNIK TRYBU === */
.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dark-mode-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 10px;
  border: 1px solid transparent;
  color: #ffffff;
  transition: border-color 0.3s, color 2.0s ease;
}

body.dark .dark-mode-label {
  color: #e0e0e0;
}

.dark-mode-label:hover {
  border-color: #808080;
}

.dark-mode-icon {
  font-size: 1.2rem;
  transition: transform 2.0s ease;
}

#dark-mode-toggle:checked ~ .page-layout .dark-mode-icon {
  transform: rotate(180deg);
}

.mode-text-light,
.mode-text-dark {
  display: none;
}

#dark-mode-toggle:checked ~ .page-layout .mode-text-dark {
  display: inline;
}

#dark-mode-toggle:not(:checked) ~ .page-layout .mode-text-light {
  display: inline;
}

/* === GŁÓWNY UKŁAD === */
.main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* === MENU BOCZNE === */
.side-menu {
  width: 240px;
  background: #0a0a0a;
  border-right: 2px solid #808080;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0;
  flex-shrink: 0;
  transition: width 0.35s ease, border-right-width 0.35s ease, background 2.0s ease, border-color 2.0s ease;
  overflow: hidden;
}

body.dark .side-menu {
  background: #050505;
}

#menu-toggle:checked ~ .page-layout .side-menu {
  width: 0;
  border-right-width: 0;
}

.menu-nav {
  display: flex;
  flex-direction: column;
  min-width: 240px;
}

.menu-link {
  color: #cccccc;
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 0.9rem 1.5rem;
  border-left: 4px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, padding-left 0.2s ease;
}

.menu-link::before {
  content: "▸ ";
  color: #808080;
  font-size: 0.75rem;
  transition: color 0.2s ease;
}

.menu-link:hover {
  background: #1a1a1a;
  color: #ffffff;
  padding-left: 2rem;
}

.menu-link.active {
  background: #1a1a1a;
  color: #ffffff;
  border-left: 4px solid #ffffff;
}

.menu-link.active::before {
  content: "● ";
}

body.dark .menu-link.active {
  background: #2a2a2a;
}

.menu-footer {
  margin-top: auto;
  padding: 1rem 1.5rem;
  font-size: 0.7rem;
  color: #808080;
  border-top: 1px solid #808080;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  min-width: 240px;
  transition: border-color 2.0s ease, color 2.0s ease;
}

/* === OBSZAR TREŚCI === */
.content-area {
  flex: 1;
  overflow-y: auto;
  background: #ffffff;
  transition: background 2.0s ease;
}

body.dark .content-area {
  background: #1a1a1a;
}

.page-content {
  padding: 3rem 2rem;
  max-width: 900px;
  margin: 0 auto;
  min-height: 100%;
}

/* === TYPOGRAFIA === */
.page-content h1 {
  font-size: 2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid #808080;
  transition: border-color 2.0s ease, color 2.0s ease;
}

.page-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 2rem 0 1rem;
  transition: color 2.0s ease;
}

.page-content p {
  margin-bottom: 1.5rem;
  transition: color 2.0s ease;
}

/* === KOD I PRE === */
.page-content code {
  background: #f2f2f2;
  padding: 0.2rem 0.4rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
  transition: background 2.0s ease, color 2.0s ease;
}

body.dark .page-content code {
  background: #2a2a2a;
  color: #e0e0e0;
}

.page-content pre {
  background: #f2f2f2;
  border: 2px solid #808080;
  padding: 1rem;
  overflow-x: auto;
  margin: 1rem 0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #000000;
  transition: background 2.0s ease, border-color 2.0s ease, color 2.0s ease;
}

body.dark .page-content pre {
  background: #2a2a2a;
  color: #e0e0e0;
}

/* === INFO BOX === */
.page-content .info-box {
  background: #f2f2f2;
  border: 2px solid #808080;
  padding: 1.5rem;
  margin: 1.5rem 0;
  transition: background 2.0s ease, border-color 2.0s ease;
}

body.dark .page-content .info-box {
  background: #2a2a2a;
}

.page-content .info-box p {
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.page-content .info-box ul {
  list-style: none;
  padding-left: 0;
}

.page-content .info-box li {
  padding: 0.3rem 0;
  border-bottom: 1px dotted #cccccc;
  transition: border-color 2.0s ease, color 2.0s ease;
}

body.dark .page-content .info-box li {
  border-bottom-color: #444444;
}

.page-content .info-box li::before {
  content: "▹ ";
  color: #808080;
}

/* === OBRAZY I SVG === */
.page-content img,
.page-content svg {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem auto;
  transition: opacity 2.0s ease;
}

/* === STOPKA === */
.page-content .footer-note {
  margin-top: 3rem;
  font-size: 0.85rem;
  color: #808080;
  text-align: center;
  border-top: 2px solid #e6e6e6;
  padding-top: 1.5rem;
  transition: border-color 2.0s ease, color 2.0s ease;
}

body.dark .page-content .footer-note {
  border-top-color: #444444;
}

/* === WYSZUKIWARKA === */
.controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 200px;
  padding: 0.7rem 1rem;
  font-family: inherit;
  font-size: 0.9rem;
  border: 2px solid #808080;
  background: #f2f2f2;
  color: #000000;
  transition: background 2.0s ease, color 2.0s ease, border-color 0.3s ease;
}

body.dark .search-box {
  background: #2a2a2a;
  color: #e0e0e0;
}

.search-box:focus {
  outline: none;
  border-color: #000000;
  background: #ffffff;
}

body.dark .search-box:focus {
  border-color: #e0e0e0;
  background: #1a1a1a;
}

.filter-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.7rem 1.2rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 2px solid #808080;
  background: #f2f2f2;
  cursor: pointer;
  color: #000000;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

body.dark .filter-btn {
  background: #2a2a2a;
  color: #cccccc;
}

.filter-btn:hover {
  background: #e0e0e0;
}

.filter-btn.active {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

body.dark .filter-btn.active {
  background: #e0e0e0;
  color: #000000;
}

.stats {
  font-size: 0.8rem;
  color: #808080;
  margin-bottom: 1.5rem;
  transition: color 2.0s ease;
}

/* === GRID INSTRUKCJI === */
.instructions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.instruction-card {
  border: 2px solid #808080;
  padding: 1.2rem;
  background: #f2f2f2;
  text-decoration: none;
  color: #000000;
  display: block;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, border-color 2.0s ease, color 2.0s ease;
}

body.dark .instruction-card {
  background: #2a2a2a;
  color: #e0e0e0;
}

.instruction-card:hover {
  background: #e0e0e0;
  transform: translateX(4px);
}

body.dark .instruction-card:hover {
  background: #1a1a1a;
}

.card-number {
  font-size: 0.75rem;
  color: #808080;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.card-preview {
  font-size: 0.8rem;
  color: #666666;
  transition: color 2.0s ease;
}

body.dark .card-preview {
  color: #999999;
}

.card-tags {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.8rem;
}

.tag {
  font-size: 0.65rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid #808080;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* === PAGINACJA === */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.page-btn {
  padding: 0.5rem 1rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  border: 2px solid #808080;
  background: #f2f2f2;
  cursor: pointer;
  min-width: 40px;
  text-align: center;
  color: #000000;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

body.dark .page-btn {
  background: #2a2a2a;
  color: #cccccc;
}

.page-btn:hover {
  background: #e0e0e0;
}

.page-btn.active {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

body.dark .page-btn.active {
  background: #e0e0e0;
  color: #000000;
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
/* === TOOLTIPY === */

/* Podstawowy styl dla słów z tooltipem */
.tooltip-word {
  cursor: pointer;
  position: relative;
  display: inline;
  white-space: nowrap;
  color: #000000;
  user-select: text;
  transition: color 2.0s ease;  /* DOSTOSOWANE DO RESZTY STRONY */
}

body.dark .tooltip-word {
  color: #e0e0e0;
}

.tooltip-word-text {
  user-select: text;
  transition: color 2.0s ease;  /* DOSTOSOWANE DO RESZTY STRONY */
}

/* Ikona ⓘ */
.tooltip-icon {
  display: inline;
  font-size: 0.85em;
  color: #808080;
  font-style: normal;
  line-height: 1;
  vertical-align: super;
  user-select: none;
  transition: color 2.0s ease;  /* ZMIENIONE Z 0.2s NA 2.0s */
}

.tooltip-word:hover .tooltip-icon {
  color: #000000;
  transition: color 0.2s ease;  /* HOVER zostaje szybki */
}

body.dark .tooltip-word:hover .tooltip-icon {
  color: #ffffff;
  transition: color 0.2s ease;
}

/* Kontener tooltipa - symetryczny padding */
.tooltip-popup {
  position: fixed;
  background: #f2f2f2;
  color: #000000;
  padding: 12px 16px;
  border-radius: 0;
  border: 2px solid #808080;
  font-size: 0.85rem;
  line-height: 1.6;
  max-width: 320px;
  min-width: 220px;
  z-index: 10000;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.15);
  pointer-events: auto;
  will-change: transform, opacity;
  user-select: text;
  font-family: 'Courier New', Courier, monospace;
  transition: background 2.0s ease, color 2.0s ease, border-color 2.0s ease;
}

body.dark .tooltip-popup {
  background: #1a1a1a;
  color: #e0e0e0;
  border-color: #808080;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
}

/* Animacja wejścia */
.tooltip-popup-entering {
  animation: tooltipIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes tooltipIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Strzałka */
.tooltip-arrow {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #f2f2f2;
  border: 2px solid #808080;
  transition: background 2.0s ease, border-color 2.0s ease;
}

body.dark .tooltip-arrow {
  background: #1a1a1a;
}

/* Dostępność klawiatury */
.tooltip-word:focus-visible {
  outline: 2px solid #808080;
  outline-offset: 2px;
  border-radius: 0;
}

/* === ZMIENNE GLOBALNE DO STEROWANIA SZEROKOŚCIĄ KOLUMN === */
:root {
  /* Lablist - 2 kolumny */
  --lablist-col-1: 1fr;
  --lablist-col-2: 1fr;

  /* Nawtab (substances-table) - 4 kolumny */
  --nawtab-col-1: 30%;
  --nawtab-col-2: 15%;
  --nawtab-col-3: 10%;
  --nawtab-col-4: 45%;

  /* Wyniki - 3 kolumny */
  --wyniki-col-1: 33.33%;
  --wyniki-col-2: 33.33%;
  --wyniki-col-3: 33.34%;
}

/* === WASTE GRID 3×3 (Benzen style) === */
.waste-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}

.waste-category {
  border: 2px solid #808080;
  padding: 0.75rem;
  background: #f2f2f2;
  transition: background 2.0s ease, border-color 2.0s ease;
}

body.dark .waste-category {
  background: #2a2a2a;
  border-color: #808080;
}

.waste-category strong {
  display: block;
  border-bottom: 2px solid #808080;
  padding-bottom: 0.25rem;
  margin-bottom: 0.5rem;
  font-family: 'Courier New', Courier, monospace;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: border-color 2.0s ease;
}

body.dark .waste-category strong {
  border-bottom-color: #808080;
}

.waste-category ul {
  margin: 0 0 0 1.25rem;
  padding: 0;
}

.waste-category li {
  margin: 0.25rem 0;
  font-family: 'Courier New', Courier, monospace;
}

/* === TABELA SUBSTANCJI (Benzen style) - 4 kolumny === */
.substances-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-family: 'Courier New', Courier, monospace;
  table-layout: fixed;
}

.substances-table caption {
  font-weight: 700;
  margin-bottom: 0.75rem;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #808080;
  transition: color 2.0s ease;
}

body.dark .substances-table caption {
  color: #999999;
}

.substances-table th,
.substances-table td {
  border: 2px solid #808080;
  padding: 0.5rem;
  text-align: left;
  vertical-align: middle;
  transition: border-color 2.0s ease, background 2.0s ease;
}

.substances-table th {
  background-color: #e6e6e6;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

body.dark .substances-table th {
  background-color: #333333;
  color: #e0e0e0;
}

body.dark .substances-table td {
  background-color: #1a1a1a;
  color: #e0e0e0;
}

/* Sterowanie szerokością kolumn w nawtab */
.substances-table th:nth-child(1),
.substances-table td:nth-child(1) {
  width: var(--nawtab-col-1);
}

.substances-table th:nth-child(2),
.substances-table td:nth-child(2) {
  width: var(--nawtab-col-2);
}

.substances-table th:nth-child(3),
.substances-table td:nth-child(3) {
  width: var(--nawtab-col-3);
}

.substances-table th:nth-child(4),
.substances-table td:nth-child(4) {
  width: var(--nawtab-col-4);
}

/* === TABELA WYNIKÓW (Benzen style) - 3 kolumny === */
.wyniki-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-family: 'Courier New', Courier, monospace;
  table-layout: fixed;
}

.wyniki-table caption {
  font-weight: 700;
  margin-bottom: 0.75rem;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #808080;
  transition: color 2.0s ease;
}

body.dark .wyniki-table caption {
  color: #999999;
}

.wyniki-table th,
.wyniki-table td {
  border: 2px solid #808080;
  padding: 0.5rem;
  text-align: left;
  vertical-align: middle;
  transition: border-color 2.0s ease, background 2.0s ease;
}

.wyniki-table th {
  background-color: #e6e6e6;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

body.dark .wyniki-table th {
  background-color: #333333;
  color: #e0e0e0;
}

body.dark .wyniki-table td {
  background-color: #1a1a1a;
  color: #e0e0e0;
}

/* Sterowanie szerokością kolumn w wyniki */
.wyniki-table th:nth-child(1),
.wyniki-table td:nth-child(1) {
  width: var(--wyniki-col-1);
}

.wyniki-table th:nth-child(2),
.wyniki-table td:nth-child(2) {
  width: var(--wyniki-col-2);
}

.wyniki-table th:nth-child(3),
.wyniki-table td:nth-child(3) {
  width: var(--wyniki-col-3);
}

/* === POLA FORMULARZA (Benzen style) === */
input[type="text"] {
  width: 95%;
  padding: 6px 8px;
  border: 2px solid #808080;
  background: #f2f2f2;
  color: #000000;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  transition: background 2.0s ease, color 2.0s ease, border-color 0.3s ease;
}

body.dark input[type="text"] {
  background: #2a2a2a;
  color: #e0e0e0;
  border-color: #808080;
}

input[type="text"]:focus {
  outline: none;
  border-color: #000000;
  background: #ffffff;
}

body.dark input[type="text"]:focus {
  border-color: #e0e0e0;
  background: #1a1a1a;
}

.substances-table input,
.wyniki-table input {
  width: 90%;
}

/* === LABLIST (Benzen style) - 2 kolumny === */
.lablist {
  display: grid;
  grid-template-columns: var(--lablist-col-1) var(--lablist-col-2);
  gap: 2rem;
  margin: 1rem 0;
  background: #f2f2f2;
  padding: 1.25rem;
  border: 2px solid #808080;
  transition: background 2.0s ease, border-color 2.0s ease;
}

body.dark .lablist {
  background: #2a2a2a;
  border-color: #808080;
}

.lablist h4 {
  margin-top: 0;
  color: #000000;
  border-bottom: 2px solid #808080;
  padding-bottom: 0.25rem;
  font-family: 'Courier New', Courier, monospace;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 2.0s ease, border-color 2.0s ease;
}

body.dark .lablist h4 {
  color: #e0e0e0;
  border-bottom-color: #808080;
}

.lablist ul {
  margin: 0.5rem 0 0 1.25rem;
}

.lablist li {
  margin: 0.25rem 0;
  font-family: 'Courier New', Courier, monospace;
}

/* === TYPOGRAFIA === */
.page-content h1 {
  font-size: 2rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 2rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid #808080;
  transition: border-color 2.0s ease, color 2.0s ease;
}

.page-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 2rem 0 1rem;
  transition: color 2.0s ease;
}

.page-content p {
  margin-bottom: 1.5rem;
  transition: color 2.0s ease;
  hyphens: auto;           /* DODANE */
  text-align: justify;     /* DODANE */
}

/* Jeśli chcesz to samo dla innych elementów tekstowych */
.page-content li,
.page-content .info-box p,
.page-content .footer-note {
  hyphens: auto;
  text-align: justify;
}

.page-content li {
  text-align: left;        /* Listy lepiej wyrównać do lewej */
}
