:root { 
    --km-green: #005a32; 
    --km-yellow: #f9d616; 
}

/* Zablokowanie przewijania całej strony (App-like feel) */
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background: #f0f0f0; 
    padding: 0; 
    margin: 0; 
    height: 100vh; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden; 
}

/* Scrollowany jest tylko środkowy kontener, żeby dolny przycisk był zawsze widoczny */
.main-container { 
    flex: 1; 
    overflow-y: auto; 
    padding: 10px; 
    padding-bottom: 80px; 
}

.step-panel { 
    background: white; 
    padding: 12px; 
    border-radius: 8px; 
    margin-bottom: 12px; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
}

h2 { 
    margin-top: 0; 
    color: var(--km-green); 
    border-bottom: 2px solid var(--km-yellow); 
    padding-bottom: 5px; 
    font-size: 1.1em; 
    margin-bottom: 12px;
}

/* --- KAFELKI TABORU (3 w rzędzie) --- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.tile { background: #fff; padding: 6px 2px; text-align: center; border: 2px solid #ddd; border-radius: 6px; cursor: pointer; display: flex; flex-direction: column; justify-content: center; min-height: 55px; }
.tile:active { border-color: var(--km-green); background: #f9fdfa; }
.tile-seria { font-size: 0.9em; font-weight: bold; color: #222; margin-bottom: 2px; }
.tile-opis { font-size: 0.65em; font-style: italic; color: #666; }

/* --- KONFIGURATOR (Plus/Minus) --- */
.config-header-row { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--km-yellow); padding-bottom: 5px; margin-bottom: 12px; }
.config-header-row h2 { border: none; margin: 0; padding: 0; }
.btn-reset-small { background: #d32f2f; color: white; border: none; border-radius: 4px; padding: 6px 10px; font-size: 0.8em; font-weight: bold; cursor: pointer; }

.config-list { display: flex; flex-direction: column; gap: 6px; }
.config-item { display: flex; justify-content: space-between; align-items: center; background: #fff; padding: 8px; border: 1px solid #ddd; border-radius: 6px; border-left: 4px solid var(--km-green); }
.config-seria { font-weight: bold; font-size: 1em; color: #222; }
.config-opis { font-size: 0.75em; color: #666; font-style: italic; display: block; }

.stepper { display: flex; align-items: center; border: 1px solid #ccc; border-radius: 4px; overflow: hidden; height: 32px; }
.stepper-btn { background: #f0f0f0; border: none; padding: 0 15px; font-size: 1.2em; font-weight: bold; cursor: pointer; color: #333; height: 100%; }
.stepper-input { width: 30px; text-align: center; border: none; font-size: 1em; font-weight: bold; border-left: 1px solid #ccc; border-right: 1px solid #ccc; pointer-events: none; height: 100%;}

/* --- PARAMETRY --- */
.toggle-group { display: flex; border-radius: 6px; overflow: hidden; border: 1px solid var(--km-green); margin-bottom: 12px; }
.toggle-btn { flex: 1; padding: 10px; border: none; background: white; font-weight: bold; font-size: 0.85em; cursor: pointer; color: #555; }
.toggle-btn.active { background: var(--km-green); color: white; }
.input-row { display: flex; justify-content: space-between; align-items: center; font-weight: bold; font-size: 0.9em; }
.input-row input { width: 60px; padding: 8px; font-size: 1.1em; text-align: center; border: 1px solid #ccc; border-radius: 4px; }

/* --- PRZYKLEJONY PRZYCISK OBLICZ --- */
.bottom-bar { position: fixed; bottom: 0; left: 0; width: 100%; background: white; padding: 10px; box-shadow: 0 -2px 10px rgba(0,0,0,0.1); z-index: 100; box-sizing: border-box; }
.btn-calc { background: var(--km-green); color: white; width: 100%; padding: 15px; font-size: 1.2em; font-weight: bold; border: none; border-radius: 8px; cursor: pointer; }

/* --- MODAL I OFICJALNA TABELA --- */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); align-items: center; justify-content: center; z-index: 1000; padding: 10px; box-sizing: border-box; }
.modal-overlay.active { display: flex; }
.modal-content { background: white; padding: 15px; border-radius: 12px; width: 100%; max-width: 500px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
.btn-close { width: 100%; padding: 15px; background: #444; color: white; font-weight: bold; border: none; border-radius: 6px; margin-top: 15px; cursor: pointer; font-size: 1.1em; }

.karta-wynikowa { width: 100%; border-collapse: collapse; font-size: 0.85em; font-family: Arial, sans-serif; color: #000; }
.karta-wynikowa td { border: 1px solid #000; padding: 8px 6px; text-align: center; vertical-align: middle; }
.vertical-text { writing-mode: vertical-rl; -webkit-writing-mode: vertical-rl; transform: rotate(180deg); -webkit-transform: rotate(180deg); font-weight: bold; padding: 20px 5px !important; }
.text-left { text-align: left !important; padding-left: 10px !important; }
.text-right { text-align: right !important; padding-right: 15px !important; }
.val-col { font-weight: bold; font-size: 1.3em; border-left: 2px solid #000 !important; width: 60px; }