:root{
  --plan-green:#24517a;
  --plan-green-light:#f3f7fb;
  --plan-green-mid:#dbe7f1;
  --plan-blue:#173a59;
  --plan-border:#c8d6e2;
  --plan-now:#fff4cc;
  --plan-now-border:#c58a12;
  --plan-today:#f5f9fc;
}
*{box-sizing:border-box}
body{
  background:#fff;
  color:#111;
  font:14px Verdana,Arial,sans-serif;
  overflow-x:auto;
  margin:0;
  -webkit-text-size-adjust:100%;
}
.tabtytul{
  background:var(--plan-green);
  border-bottom:2px solid #808080;
}
.tytul{
  background:var(--plan-green);
  color:#fff;
  height:72px;
  font:bold 32px Verdana,Arial,sans-serif;
  border-bottom:2px solid #c0c0c0;
  text-align:center;
}
.tytulnapis{padding:0 10px}

/* Główna tabela planu */
table.tabela{
  border-collapse:collapse;
  border:1px solid var(--plan-border);
  background:#fff;
  width:min(1180px, calc(100vw - 24px));
  table-layout:fixed;
}
table.tabela th,
table.tabela td{
  border:1px solid var(--plan-border);
  padding:7px 6px;
  line-height:1.35;
}
table.tabela th{
  background:var(--plan-green-mid);
  color:var(--plan-blue);
  font-size:13px;
  text-align:center;
}
table.tabela td{font-size:12px}
td.g{
  background:var(--plan-green-light);
  color:var(--plan-blue);
  font-weight:bold;
  vertical-align:top;
  text-align:center;
  white-space:nowrap;
}
td.nr{
  background:var(--plan-green-mid);
  color:var(--plan-blue);
  font-weight:bold;
  text-align:center;
  vertical-align:top;
  width:42px;
}
td.l{background:#fff;color:#000;vertical-align:top}
a.n,a.s,a.k{color:var(--plan-blue)}
.p{color:#000;font-weight:bold}
.op{font:10px Verdana,Arial,sans-serif}
.logo{text-align:right;border-bottom:2px solid #c0c0c0}

/* Dzisiejszy dzień i aktualna lekcja */
table.tabela .is-today-column{background:var(--plan-today)}
table.tabela th.is-today-column{background:#c5d9e8}
table.tabela td.is-current-cell{
  background:var(--plan-now) !important;
  outline:3px solid var(--plan-now-border);
  outline-offset:-3px;
  position:relative;
  font-weight:600;
}
table.tabela td.is-current-cell::after{
  content:'TERAZ';
  display:inline-block;
  margin-left:6px;
  padding:2px 6px;
  border-radius:999px;
  background:var(--plan-now-border);
  color:#fff;
  font:bold 10px Verdana,Arial,sans-serif;
  vertical-align:1px;
}
table.tabela tr.is-current-row > td.g,
table.tabela tr.is-current-row > td.nr{background:#f3dfad}

/* Pasek nad planem dodawany automatycznie przez plan.js */
.plan-live{
  width:min(1180px, calc(100vw - 24px));
  margin:14px auto 10px;
  font:14px Verdana,Arial,sans-serif;
}
.plan-status{
  border:1px solid var(--plan-border);
  border-left:5px solid var(--plan-green);
  border-radius:10px;
  padding:10px 12px;
  background:#f7f9fb;
  color:#222;
}
.plan-status strong{display:block;margin-bottom:3px;font-size:14px}
.plan-status small{color:#555}
.plan-status.is-now{
  background:#fff9d8;
  border-left-color:var(--plan-now-border);
}
.plan-days{
  display:none;
  gap:6px;
  overflow-x:auto;
  padding:8px 0 2px;
  scrollbar-width:thin;
}
.plan-day-btn{
  min-width:58px;
  min-height:42px;
  padding:8px 10px;
  border:1px solid #aebdcc;
  border-radius:8px;
  background:#fff;
  color:#173a59;
  font:600 13px Verdana,Arial,sans-serif;
  cursor:pointer;
}
.plan-day-btn[aria-selected="true"]{
  background:var(--plan-green);
  color:#fff;
  border-color:#173a59;
}
.plan-day-btn.is-today:not([aria-selected="true"]){
  box-shadow:inset 0 0 0 2px var(--plan-green);
}

/* Dyskretne informacje techniczne pod planem */
.op{
  font:9px Verdana,Arial,sans-serif !important;
  line-height:1.25;
  color:#8a949d;
  opacity:.72;
}
.op a{
  color:#6f7f8d !important;
  text-decoration:none;
}
.op img{
  width:24px !important;
  height:24px !important;
  opacity:.55;
  margin-left:5px !important;
}
/* „Drukuj plan” – pozostaje dostępne, ale nie przyciąga wzroku */
table.tabela + table,
td[align="left"] > a[href*="print"]{
  font-size:9px !important;
  color:#7e8992 !important;
}
td[align="left"] > a[href*="print"]{
  text-decoration:none;
  opacity:.75;
}
td[align="left"] > a[href*="print"]:hover,
.op a:hover{
  opacity:1;
  text-decoration:underline;
}

/* Responsywność */
@media (max-width:760px){
  body{overflow-x:hidden;font-size:14px}
  .tabtytul{width:100% !important}
  .tytul{height:58px;font-size:25px}
  .tabtytul img{height:58px !important}
  body > div[align="center"]{width:100%;padding:0 8px}
  body > div[align="center"] > table{width:100%;margin:0}
  body > div[align="center"] > table > tbody > tr > td{padding:0 !important}
  .plan-live{width:100%;margin:10px auto 8px;padding:0}
  .plan-days{display:flex}

  table.tabela{
    width:100%;
    table-layout:auto;
    margin:0;
  }
  table.tabela th,table.tabela td{padding:10px 8px;font-size:14px}
  table.tabela th:nth-child(1),
  table.tabela td:nth-child(1){display:none}
  table.tabela th:nth-child(n+3),
  table.tabela td:nth-child(n+3){display:none}
  table.tabela th:nth-child(2),
  table.tabela td:nth-child(2){display:table-cell;width:102px;min-width:102px}

  body[data-plan-day="1"] table.tabela th:nth-child(3),body[data-plan-day="1"] table.tabela td:nth-child(3),
  body[data-plan-day="2"] table.tabela th:nth-child(4),body[data-plan-day="2"] table.tabela td:nth-child(4),
  body[data-plan-day="3"] table.tabela th:nth-child(5),body[data-plan-day="3"] table.tabela td:nth-child(5),
  body[data-plan-day="4"] table.tabela th:nth-child(6),body[data-plan-day="4"] table.tabela td:nth-child(6),
  body[data-plan-day="5"] table.tabela th:nth-child(7),body[data-plan-day="5"] table.tabela td:nth-child(7){
    display:table-cell;
    width:auto;
  }

  table.tabela td.l{min-height:48px;word-break:normal;overflow-wrap:anywhere}
  table.tabela td.l .p{display:block;margin-bottom:3px;font-size:14px}
  table.tabela td.l a{display:inline-block;margin-right:6px;padding:2px 0}
  .op{font-size:8px !important;opacity:.62}
  td[align="left"] > a[href*="print"]{font-size:8px !important}
  .op img{width:20px !important;height:20px !important}
}

@media print{
  .tabtytul{display:none}
  .plan-live{display:none !important}
  body{overflow:visible}
  table.tabela{width:100%;table-layout:auto}
  table.tabela th,table.tabela td{display:table-cell !important;font-size:10px;padding:4px}
  table.tabela td.is-current-cell{outline:none;background:#fff !important}
  table.tabela td.is-current-cell::after{display:none}
}


/* SP3 v3 — techniczne informacje pod planem prawie niewidoczne */
.op,
.op td,
.op a,
td[align="left"] > a[href^="javascript:window.print"],
body > div[align="center"] p[align="left"],
body > div[align="center"] p[align="left"] a {
  color:#fff !important;
  font-size:4px !important;
  line-height:1 !important;
  font-weight:normal !important;
  text-decoration:none !important;
}
.op table,
.op tbody,
.op tr,
.op td {
  padding:0 !important;
  margin:0 !important;
  border:0 !important;
}
.op img {
  width:3px !important;
  height:3px !important;
  margin:0 !important;
  opacity:.03 !important;
}
td[align="left"] > a[href^="javascript:window.print"],
body > div[align="center"] p[align="left"] a {
  opacity:.08 !important;
}
body > div[align="center"] p[align="left"] {
  margin:1px 0 0 !important;
  padding:0 !important;
  height:4px !important;
  overflow:hidden !important;
}

/* SP3 v8 — zabezpieczenie po włączeniu prawdziwego viewportu mobilnego */
@media (max-width:760px){
  html,body{width:100%;max-width:100%;overflow-x:hidden}
  .plan-live, table.tabela{max-width:100%}
  table.tabela th:nth-child(2),table.tabela td:nth-child(2){width:88px;min-width:88px}
}
@media (max-width:380px){
  table.tabela th,table.tabela td{padding:8px 5px;font-size:12px}
  table.tabela td.l .p{font-size:13px}
  table.tabela th:nth-child(2),table.tabela td:nth-child(2){width:78px;min-width:78px;font-size:11px}
  .plan-day-btn{min-width:52px;padding:7px 8px}
}

/* SP3 v9 — widoczny link powrotu do strony głównej planu */
body > div[align="center"] p[align="left"] {
  margin:14px 0 8px !important;
  padding:0 !important;
  height:auto !important;
  overflow:visible !important;
  line-height:1.3 !important;
}
body > div[align="center"] p[align="left"] a[href="../index.html"] {
  color:#173b63 !important;
  font-size:14px !important;
  line-height:1.3 !important;
  font-weight:600 !important;
  text-decoration:none !important;
  opacity:1 !important;
}
body > div[align="center"] p[align="left"] a[href="../index.html"]:hover,
body > div[align="center"] p[align="left"] a[href="../index.html"]:focus {
  text-decoration:underline !important;
}
@media (max-width:760px){
  body > div[align="center"] p[align="left"] {
    margin:16px 0 10px !important;
  }
  body > div[align="center"] p[align="left"] a[href="../index.html"] {
    font-size:16px !important;
  }
}

/* SP3 v10 — mały przycisk powrotu do strony głównej planu */
body > div[align="center"] p.plan-back-wrap{
  margin:16px 0 10px !important;
  padding:0 !important;
  height:auto !important;
  overflow:visible !important;
  line-height:1 !important;
}
body > div[align="center"] p.plan-back-wrap a.plan-back-button{
  display:inline-flex !important;
  align-items:center;
  min-height:34px;
  padding:7px 11px !important;
  border:1px solid #173b63;
  border-radius:7px;
  background:#173b63;
  color:#fff !important;
  font-size:13px !important;
  line-height:1.15 !important;
  font-weight:600 !important;
  text-decoration:none !important;
  opacity:1 !important;
}
@media (hover:hover) and (pointer:fine){
  body > div[align="center"] p.plan-back-wrap a.plan-back-button:hover{
    background:#24517a;
    border-color:#24517a;
    text-decoration:none !important;
  }
}
body > div[align="center"] p.plan-back-wrap a.plan-back-button:focus-visible{
  outline:3px solid rgba(36,81,122,.28);
  outline-offset:2px;
}
@media (max-width:760px){
  body > div[align="center"] p.plan-back-wrap{
    margin:18px 0 12px !important;
  }
  body > div[align="center"] p.plan-back-wrap a.plan-back-button{
    min-height:38px;
    padding:9px 12px !important;
    font-size:14px !important;
  }
}

/* SP3 v15 — nagłówek podstron jak na stronie głównej: bez kreski pod nazwą */
.tabtytul,
.tytul{
  border-bottom:none !important;
}

/* SP3 v16 — pionowe wyśrodkowanie nazwy klasy / nauczyciela / sali */
.tytul{
  vertical-align:middle !important;
  line-height:1.15 !important;
}
.tytul > img{
  display:none !important;
}
.tytulnapis{
  display:inline-block;
  vertical-align:middle;
}


/* v20 school back button */
.tabtytul .tytul{position:relative;}
.school-back-link{
  position:absolute;
  left:12px;
  top:50%;
  transform:translateY(-50%);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:30px;
  padding:5px 10px;
  border:1px solid rgba(255,255,255,.8);
  border-radius:7px;
  color:#fff !important;
  background:rgba(255,255,255,.10);
  font-size:12px;
  font-weight:600;
  line-height:1.2;
  text-decoration:none !important;
  white-space:nowrap;
  z-index:2;
}
.school-back-link:hover,.school-back-link:focus{
  background:rgba(255,255,255,.20);
  outline:2px solid rgba(255,255,255,.75);
  outline-offset:2px;
}
@media (max-width:600px){
  .school-back-link{left:6px;padding:5px 7px;font-size:10px;min-height:28px;}
  .school-back-link .school-back-full{display:inline;}
  .school-back-link .school-back-short{display:none;}
}
@media (min-width:601px){
  .school-back-link .school-back-full{display:inline;}
  .school-back-link .school-back-short{display:none;}
}

/* SP3 v28 — odliczanie do końca lekcji i informacja o następnej */
.plan-status small{
  display:block;
  line-height:1.45;
}
@media (max-width:760px){
  .plan-status{
    padding:11px 12px;
  }
  .plan-status strong{
    font-size:14px;
    line-height:1.35;
  }
  .plan-status small{
    margin-top:4px;
    font-size:12px;
    line-height:1.5;
  }
}

/* SP3 v29 — wygląd podstron w stylu nowoczesnej karty */
body{
  background:#f6f8fb;
  color:#10243a;
  font-family:Arial,Helvetica,sans-serif;
}
.tabtytul{
  width:min(1220px, calc(100% - 24px)) !important;
  margin:12px auto 0;
  border-radius:14px 14px 0 0;
  overflow:hidden;
  box-shadow:0 2px 12px rgba(23,58,89,.08);
}
.tytul{
  height:68px;
  font-size:30px;
  letter-spacing:-.4px;
}
body > div[align="center"]{
  width:100%;
}
body > div[align="center"] > table{
  width:min(1220px, calc(100% - 24px));
  margin:0 auto 16px;
  background:#fff;
  border-radius:0 0 14px 14px;
  box-shadow:0 2px 12px rgba(23,58,89,.08);
}
body > div[align="center"] > table > tbody > tr:first-child > td{
  padding-top:0 !important;
}
.plan-live{
  width:100%;
  margin:0 auto 12px;
  padding:12px 12px 0;
}
.plan-status{
  display:grid;
  grid-template-columns:minmax(230px,1.4fr) minmax(135px,.55fr) minmax(250px,1fr);
  align-items:center;
  gap:0;
  min-height:86px;
  padding:12px 16px;
  border:1px solid #dbe5ee;
  border-radius:13px;
  background:#f8fafc;
  color:#10243a;
  box-shadow:0 1px 3px rgba(23,58,89,.04);
}
.plan-status-main{
  display:flex;
  align-items:center;
  min-width:0;
  gap:13px;
  padding-right:18px;
}
.plan-status-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  min-width:72px;
  min-height:38px;
  padding:7px 12px;
  border-radius:9px;
  background:#173a59;
  color:#fff;
  font-size:12px;
  font-weight:800;
  letter-spacing:.2px;
}
.plan-status-title{min-width:0}
.plan-status-title strong{
  display:block;
  margin:0 0 4px;
  font-size:18px;
  line-height:1.15;
  color:#10243a;
  overflow-wrap:anywhere;
}
.plan-status-title small,
.plan-status-next small{
  display:block;
  color:#56697b;
  font-size:12px;
  line-height:1.4;
}
.plan-status-countdown{
  min-width:0;
  padding:4px 22px;
  border-left:1px solid rgba(23,58,89,.16);
  border-right:1px solid rgba(23,58,89,.16);
  text-align:center;
}
.plan-status-count-label{
  display:block;
  margin-bottom:2px;
  color:#526579;
  font-size:12px;
}
.plan-status-count-value{
  display:block;
  color:#10243a;
  font-size:22px;
  line-height:1.05;
}
.plan-status-next{
  min-width:0;
  padding-left:22px;
}
.plan-status-next > span{
  display:block;
  margin-bottom:4px;
  color:#526579;
  font-size:12px;
}
.plan-status-next strong{
  display:block;
  margin:0 0 3px;
  color:#10243a;
  font-size:15px;
  line-height:1.2;
  overflow-wrap:anywhere;
}
.plan-status.is-now{
  background:#eaf8f2;
  border-color:#cceade;
}
.plan-status.is-now .plan-status-badge{background:#14835f}
.plan-status.is-now .plan-status-count-value{color:#08714f}
.plan-status.is-break{
  background:#eef6ff;
  border-color:#d5e7fb;
}
.plan-status.is-break .plan-status-badge{background:#315d91}
.plan-status.is-ended{
  grid-template-columns:1fr;
  background:#f4f0ff;
  border-color:#e5dcff;
}
.plan-status.is-ended .plan-status-badge{background:#6658a6;min-width:42px;width:42px;border-radius:50%}
.plan-status.is-before,.plan-status.is-selected-day,.plan-status.is-neutral,.plan-status.is-off{
  grid-template-columns:1fr;
}
.plan-status.is-before .plan-status-badge,.plan-status.is-selected-day .plan-status-badge,.plan-status.is-neutral .plan-status-badge,.plan-status.is-off .plan-status-badge{background:#315d91}
.plan-days{padding:10px 0 0}
.plan-day-btn{
  border-color:#cfdae4;
  border-radius:9px;
  background:#fff;
}
.plan-day-btn[aria-selected="true"]{
  background:#173a59;
  border-color:#173a59;
}

/* Tabela jako nowoczesna karta */
table.tabela{
  width:calc(100% - 24px);
  margin:0 12px;
  border:1px solid #dbe5ee;
  border-collapse:separate;
  border-spacing:0;
  border-radius:12px;
  overflow:hidden;
  background:#fff;
}
table.tabela th,table.tabela td{
  border:0;
  border-right:1px solid #e1e8ef;
  border-bottom:1px solid #e1e8ef;
  padding:10px 8px;
}
table.tabela tr:last-child td{border-bottom:0}
table.tabela th:last-child,table.tabela td:last-child{border-right:0}
table.tabela th{
  background:#eef3f7;
  color:#183650;
  font-size:13px;
  font-weight:700;
}
td.nr,td.g{
  background:#f7f9fb;
  color:#29465f;
}
table.tabela .is-today-column{background:#f7fbfe}
table.tabela th.is-today-column{background:#dfeaf3}
table.tabela td.is-current-cell{
  background:#dff3ea !important;
  outline:none;
  box-shadow:inset 0 0 0 2px #8acdb4;
  color:#0e503d;
}
table.tabela td.is-current-cell::after{
  background:#14835f;
}
table.tabela tr.is-current-row > td.g,
table.tabela tr.is-current-row > td.nr{background:#e7f4ef}

@media (max-width:900px){
  .plan-status{
    grid-template-columns:minmax(0,1.25fr) minmax(120px,.55fr);
  }
  .plan-status-next{
    grid-column:1 / -1;
    margin-top:10px;
    padding:10px 0 0;
    border-top:1px solid rgba(23,58,89,.12);
  }
}

@media (max-width:760px){
  body{background:#f6f8fb}
  .tabtytul{
    width:100% !important;
    margin:0;
    border-radius:0;
    box-shadow:none;
  }
  .tytul{height:60px;font-size:24px}
  body > div[align="center"] > table{
    width:100%;
    margin:0;
    border-radius:0;
    box-shadow:none;
  }
  .plan-live{padding:10px 8px 0;margin-bottom:8px}
  .plan-status{
    display:block;
    min-height:0;
    padding:12px;
    border-radius:12px;
  }
  .plan-status-main{padding:0;gap:10px}
  .plan-status-badge{
    min-width:62px;
    min-height:34px;
    padding:6px 9px;
    font-size:11px;
  }
  .plan-status-title strong{font-size:16px}
  .plan-status-title small{font-size:12px}
  .plan-status-countdown{
    display:flex;
    align-items:baseline;
    justify-content:flex-start;
    gap:6px;
    margin:10px 0 0 72px;
    padding:0;
    border:0;
    text-align:left;
  }
  .plan-status-count-label{display:inline;margin:0;font-size:12px}
  .plan-status-count-value{display:inline;font-size:17px}
  .plan-status-next{
    margin:10px 0 0 72px;
    padding:9px 0 0;
    border-top:1px solid rgba(23,58,89,.12);
  }
  .plan-status-next > span{font-size:11px}
  .plan-status-next strong{font-size:14px}
  .plan-status-next small{font-size:11px}
  .plan-days{gap:5px;padding:9px 0 0}
  .plan-day-btn{flex:1;min-width:0;min-height:40px;padding:7px 6px}
  table.tabela{
    width:calc(100% - 16px);
    margin:0 8px;
    border-radius:10px;
  }
  table.tabela th,table.tabela td{padding:10px 7px;font-size:13px}
  table.tabela th:nth-child(2),table.tabela td:nth-child(2){width:92px;min-width:92px}
  .school-back-link{font-size:9.5px;padding:5px 6px;left:5px}
}

@media (max-width:390px){
  .tytul{font-size:22px}
  .school-back-link{font-size:9px;max-width:105px;white-space:normal;line-height:1.05}
  .plan-status-main{align-items:flex-start}
  .plan-status-countdown,.plan-status-next{margin-left:0}
}


/* SP3 v30 — techniczne informacje pod planem znów delikatnie widoczne */
.op,
.op td,
.op a,
td[align="left"] > a[href^="javascript:window.print"] {
  color:#8e98a3 !important;
  font-size:10px !important;
  line-height:1.3 !important;
  font-weight:normal !important;
  text-decoration:none !important;
  opacity:.95 !important;
}
.op{
  font-size:10px !important;
}
.op a,
td[align="left"] > a[href^="javascript:window.print"] {
  color:#8e98a3 !important;
}
.op a:hover,
td[align="left"] > a[href^="javascript:window.print"]:hover {
  color:#6f7b86 !important;
  text-decoration:underline !important;
}
.op table,
.op tbody,
.op tr,
.op td {
  padding:0 !important;
  margin:0 !important;
  border:0 !important;
}
.op img {
  width:18px !important;
  height:18px !important;
  margin-left:6px !important;
  opacity:.7 !important;
  vertical-align:middle;
  filter:grayscale(100%);
}
@media (max-width:760px){
  .op,
  .op td,
  .op a,
  td[align="left"] > a[href^="javascript:window.print"] {
    font-size:9px !important;
    line-height:1.25 !important;
  }
  .op img {
    width:16px !important;
    height:16px !important;
    margin-left:5px !important;
  }
}

/* SP3 v31 — bez ikonki/logo Optivum w stopce */
.op img {
  display:none !important;
}


/* SP3 v41 — klikalne logo szkoły na wszystkich podstronach; bez przycisku tekstowego */
.school-back-link{display:none !important;}
.tabtytul .tytul{position:relative;}
.school-home-logo{
  position:absolute;
  left:12px;
  top:50%;
  transform:translateY(-50%);
  z-index:3;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  text-decoration:none !important;
  border-radius:12px;
}
.school-home-logo .school-logo-box{
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
  width:52px;
  height:52px;
  padding:5px;
  border-radius:12px;
  background:#fff;
  border:1px solid rgba(255,255,255,.68);
  box-shadow:0 2px 9px rgba(0,0,0,.16);
  box-sizing:border-box;
  transition:transform .15s ease,box-shadow .15s ease;
}
.tytul .school-home-logo .school-logo{
  display:block !important;
  width:40px !important;
  height:40px !important;
  max-width:none !important;
  object-fit:contain !important;
}
.school-home-logo:focus-visible{
  outline:3px solid rgba(255,255,255,.75);
  outline-offset:3px;
}
@media (hover:hover) and (pointer:fine){
  .school-home-logo:hover .school-logo-box{
    transform:translateY(-1px);
    box-shadow:0 3px 12px rgba(0,0,0,.22);
  }
}
@media (max-width:600px){
  .school-home-logo{left:6px;}
  .school-home-logo .school-logo-box{width:42px;height:42px;padding:4px;border-radius:10px;}
  .tytul .school-home-logo .school-logo{width:32px !important;height:32px !important;}
}
@media (max-width:390px){
  .school-home-logo{left:5px;}
  .school-home-logo .school-logo-box{width:38px;height:38px;padding:3px;border-radius:9px;}
  .tytul .school-home-logo .school-logo{width:30px !important;height:30px !important;}
}
