body, html {
  margin: 0; padding: 0; 
  background-color: #121212; color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-sizing: border-box; height: 100vh; overflow: hidden; 
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;
}

#main-dashboard { display: flex; flex-direction: column; height: 100vh; padding: 1.5vh 0 0 0; cursor: pointer; }
#main-dashboard > div { margin-bottom: 1.5vh; }

.panel { background-color: #2c2c2c; border-radius: 15px; padding: 1.5vh 2vw; box-shadow: 0 4px 15px rgba(0,0,0,0.5); margin: 0 2vw; }

.header-section { text-align: center; margin: 0; }
.welcome-text { color: #888888; font-size: 1.5vw; text-transform: uppercase; letter-spacing: 3px; margin-bottom: 0.5vh; }
.clock-text { color: #FF9900; font-size: 5vw; font-weight: 900; line-height: 1; text-shadow: 2px 2px 10px rgba(0,0,0,0.8); }
.date-text { color: #cccccc; font-size: 1.8vw; margin-top: 0.5vh; }
.status-text { color: #FF9900; font-size: 3.5vw; font-weight: 900; margin-top: 1vh; letter-spacing: 1px; text-shadow: 2px 2px 10px rgba(0,0,0,0.8); }

.middle-section { display: flex; margin: 0 2vw; }
.weather-panel, .progress-panel { flex: 1; background-color: #2c2c2c; border-radius: 15px; padding: 1.5vh 2vw; box-shadow: 0 4px 15px rgba(0,0,0,0.5); display: flex; align-items: center; }
.weather-panel { margin-right: 2vw; }

.w-temp { font-size: 4vw; font-weight: 900; color: #FF9900; margin-right: 2vw; }
.w-desc { font-size: 1.5vw; font-weight: bold; }
.w-details { font-size: 1.2vw; color: #aaa; margin-top: 0.5vh; }
.w-details span { color: #FF9900; font-weight: bold; }

.progress-panel { flex-direction: column; justify-content: center; align-items: stretch; }
.progress-title { font-size: 1.2vw; color: #888; margin-bottom: 1vh; text-transform: uppercase; letter-spacing: 1px;}
.bar-bg { width: 100%; height: 3.5vh; background-color: #1a1a1a; border-radius: 10px; position: relative; overflow: hidden; }
.bar-fill { height: 100%; background-color: #FF9900; width: 0%; transition: width 0.1s linear; }
.bar-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.5vw; font-weight: bold; text-shadow: 1px 1px 5px rgba(0,0,0,0.8); }
.bar-percent { text-align: right; font-size: 1.2vw; font-weight: bold; color: #FF9900; margin-top: 0.5vh; }

.subs-header { color: #FF9900; text-align: center; font-size: 2vw; font-weight: 900; margin: 1vh 0 0 0; text-transform: uppercase; letter-spacing: 2px; }

#subs-container { flex-grow: 1; width: 100%; display: flex; justify-content: center; align-items: flex-start; padding-top: 1vh; }
#subs-display { width: 80vw; transition: opacity 0.5s ease-in-out; }
.fade-out { opacity: 0; }
.fade-in { opacity: 1; }

/* FIX PRZEWIJANIA: Dodano -webkit-overflow-scrolling: touch; */
.class-card { background-color: #2c2c2c; border-radius: 20px; padding: 2vh 3vw; box-shadow: 0 10px 30px rgba(0,0,0,0.8); width: 100%; box-sizing: border-box; max-height: 50vh; overflow-y: auto; text-align: left; -webkit-overflow-scrolling: touch; }
.class-title { background-color: #FF9900; color: #121212; font-weight: 900; font-size: 2.5vw; text-align: center; padding: 1vh; border-radius: 12px; margin-top: 0; margin-bottom: 2vh; }
table { width: 100%; border-collapse: collapse; font-size: 1.3vw; }
th { color: #aaa; text-align: left; padding-bottom: 1vh; border-bottom: 1px solid #444; text-transform: uppercase; }
td { padding: 1.5vh 5px; border-bottom: 1px solid #333; vertical-align: top; }
tr:last-child td { border-bottom: none; }
.lesson-num { color: #FF9900; font-weight: bold; text-align: center; width: 4vw; font-size: 1.5vw; }

.footer-hint { text-align: center; color: #888; font-size: 2.5vw; padding: 1.5vh; margin-bottom: 4vh; text-transform: uppercase; letter-spacing: 2px; font-weight: bold; animation: pulse 2s infinite; }
@keyframes pulse { 0% { opacity: 0.4; } 50% { opacity: 1; color: #FF9900; } 100% { opacity: 0.4; } }

.overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(18, 18, 18, 0.98); z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 3vh; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.overlay.show { opacity: 1; pointer-events: auto; }
.overlay-title { color: #FF9900; font-size: 3vw; margin-bottom: 3vh; text-transform: uppercase; letter-spacing: 2px; text-align: center; flex-shrink: 0;}

.category-tabs { display: flex; justify-content: center; gap: 2vw; margin-bottom: 3vh; width: 90%; max-width: 1200px; flex-shrink: 0; }
.cat-btn { flex: 1; background: #2c2c2c; color: #888; border: 2px solid #444; padding: 1.5vh 1vw; font-size: 1.8vw; font-weight: bold; border-radius: 12px; cursor: pointer; transition: 0.2s; }
.cat-btn.active { background: #FF9900; color: #121212; border-color: #FF9900; }

.close-btn { margin-top: 3vh; padding: 1.5vh 3vw; font-size: 1.5vw; background: #333; color: white; border: 2px solid #555; border-radius: 10px; cursor: pointer; transition: 0.2s; flex-shrink: 0; margin-bottom: 2vh;}

/* FIX PRZEWIJANIA: Dodano -webkit-overflow-scrolling: touch; */
.class-grid { display: grid; gap: 12px; width: 90%; max-width: 1200px; max-height: 65vh; overflow-y: auto; padding: 10px; align-content: flex-start; -webkit-overflow-scrolling: touch;}
.class-grid.klasy { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.class-grid.sale { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.class-grid.nauczyciele { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

.class-btn { background: #2c2c2c; color: #FF9900; border: 2px solid #FF9900; padding: 12px 8px; font-size: 1.3vw; font-weight: bold; border-radius: 10px; cursor: pointer; text-align: center; transition: 0.2s; display: flex; align-items: center; justify-content: center; word-break: break-word; line-height: 1.2;}

@media (hover: hover) and (pointer: fine) { .class-btn:hover { background: #FF9900; color: #121212; } .close-btn:hover { background: #FF3333; border-color: #FF3333; } }

/* FIX PRZEWIJANIA: Dodano -webkit-overflow-scrolling: touch; */
.schedule-container { width: 90%; max-width: 1000px; max-height: 70vh; overflow-y: auto; padding-right: 15px; scroll-behavior: smooth; -webkit-overflow-scrolling: touch;}
.lesson-row { display: flex; background: #2c2c2c; margin-bottom: 15px; border-radius: 12px; border-left: 6px solid #444; padding: 15px; transition: 0.3s; }
.lesson-row.active-lesson { border-left-color: #FF9900; background: rgba(255, 153, 0, 0.1); box-shadow: 0 0 15px rgba(255, 153, 0, 0.2); }
.lesson-time { width: 120px; text-align: center; border-right: 1px solid #444; padding-right: 15px; margin-right: 15px; display: flex; flex-direction: column; justify-content: center; }
.lesson-time strong { color: #FF9900; font-size: 1.8vw; }
.lesson-time span { color: #aaa; font-size: 1.1vw; margin-top: 5px; }

.lesson-details { flex-grow: 1; font-size: 1.4vw; display: flex; flex-direction: column; justify-content: center; }
.lesson-group { display: flex; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.lesson-group > * { margin-right: 8px; margin-bottom: 4px; }
.lesson-group:last-child { margin-bottom: 0; }
.lesson-details span.p { font-weight: bold; color: #fff; }
.lesson-details a.n, .lesson-details a.s, .lesson-details a.o { text-decoration: none; pointer-events: none; cursor: default; }
.lesson-details a.n { color: #64b5f6; } 
.lesson-details a.s { color: #81c784; } 
.lesson-details a.o { color: #e57373; }

::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: #121212; border-radius: 6px; }
::-webkit-scrollbar-thumb { background: #FF9900; border-radius: 6px; }